@empoweredvote/ev-ui 0.8.11 → 0.8.13
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 +580 -657
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -278
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -90,8 +90,36 @@ __export(index_exports, {
|
|
|
90
90
|
module.exports = __toCommonJS(index_exports);
|
|
91
91
|
|
|
92
92
|
// src/RadarChartCore.jsx
|
|
93
|
-
var
|
|
93
|
+
var import_react2 = __toESM(require("react"));
|
|
94
94
|
var import_web = require("@react-spring/web");
|
|
95
|
+
var import_react3 = require("react");
|
|
96
|
+
|
|
97
|
+
// src/useTheme.js
|
|
98
|
+
var import_react = require("react");
|
|
99
|
+
function useTheme() {
|
|
100
|
+
const read = () => {
|
|
101
|
+
if (typeof document === "undefined") return false;
|
|
102
|
+
const root = document.documentElement;
|
|
103
|
+
const body = document.body;
|
|
104
|
+
const hasDarkClass = (el) => el && el.classList && el.classList.contains("dark");
|
|
105
|
+
const hasDarkAttr = (el) => el && el.getAttribute && el.getAttribute("data-theme") === "dark";
|
|
106
|
+
return hasDarkClass(root) || hasDarkAttr(root) || hasDarkClass(body) || hasDarkAttr(body);
|
|
107
|
+
};
|
|
108
|
+
const [isDark, setIsDark] = (0, import_react.useState)(read);
|
|
109
|
+
(0, import_react.useEffect)(() => {
|
|
110
|
+
if (typeof document === "undefined" || typeof MutationObserver === "undefined") return;
|
|
111
|
+
const update = () => setIsDark(read());
|
|
112
|
+
update();
|
|
113
|
+
const observer = new MutationObserver(update);
|
|
114
|
+
const opts = { attributes: true, attributeFilter: ["class", "data-theme"] };
|
|
115
|
+
observer.observe(document.documentElement, opts);
|
|
116
|
+
if (document.body) observer.observe(document.body, opts);
|
|
117
|
+
return () => observer.disconnect();
|
|
118
|
+
}, []);
|
|
119
|
+
return { isDark };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// src/RadarChartCore.jsx
|
|
95
123
|
function RadarChartCore({
|
|
96
124
|
topics,
|
|
97
125
|
data,
|
|
@@ -103,95 +131,83 @@ function RadarChartCore({
|
|
|
103
131
|
onReplaceTopic = () => {
|
|
104
132
|
},
|
|
105
133
|
size = 400,
|
|
106
|
-
labelFontSize =
|
|
134
|
+
labelFontSize = 18,
|
|
107
135
|
padding = 80,
|
|
108
|
-
labelOffset =
|
|
109
|
-
tightFit = false
|
|
110
|
-
activeSpoke = null,
|
|
111
|
-
writeIns = {},
|
|
112
|
-
darkMode = false,
|
|
113
|
-
lineColor,
|
|
114
|
-
ringColor,
|
|
115
|
-
// replacedSpokes: short_titles of substitute spokes (not the user's original defaults)
|
|
116
|
-
replacedSpokes = {},
|
|
117
|
-
// boldOriginalSpokes: when true, bold spokes that are NOT replacements
|
|
118
|
-
boldOriginalSpokes = false,
|
|
119
|
-
highlightedSpoke = null
|
|
136
|
+
labelOffset = 20,
|
|
137
|
+
tightFit = false
|
|
120
138
|
}) {
|
|
121
|
-
|
|
139
|
+
const { isDark } = useTheme();
|
|
122
140
|
const radius = size / 2 - 40;
|
|
123
|
-
const extRadius = radius * 1.15;
|
|
124
141
|
const centerX = size / 2;
|
|
125
142
|
const centerY = size / 2;
|
|
126
|
-
const [tooltip, setTooltip] = (0, import_react.useState)(null);
|
|
127
143
|
const spokes = Object.entries(data);
|
|
128
144
|
const numSpokes = Math.max(spokes.length, 1);
|
|
129
|
-
const prevCountRef = (0,
|
|
145
|
+
const prevCountRef = (0, import_react3.useRef)(numSpokes);
|
|
130
146
|
const countChanged = numSpokes !== prevCountRef.current;
|
|
131
|
-
(0,
|
|
147
|
+
(0, import_react3.useEffect)(() => {
|
|
132
148
|
prevCountRef.current = numSpokes;
|
|
133
149
|
}, [numSpokes]);
|
|
134
|
-
function calcAdjusted(value, shortTitle) {
|
|
135
|
-
var _a2;
|
|
136
|
-
if (!value || Number(value) === 0) return 0;
|
|
137
|
-
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
138
|
-
const max = ((_a2 = topic == null ? void 0 : topic.stances) == null ? void 0 : _a2.length) || 10;
|
|
139
|
-
const pct = Number(value) / max * 10;
|
|
140
|
-
return invertedSpokes[shortTitle] ? (max + 1) * 10 / max - pct : pct;
|
|
141
|
-
}
|
|
142
150
|
const pointsArr = spokes.map(([shortTitle, value], index) => {
|
|
143
|
-
|
|
144
|
-
const
|
|
151
|
+
var _a;
|
|
152
|
+
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
153
|
+
const max = ((_a = topic == null ? void 0 : topic.stances) == null ? void 0 : _a.length) || 10;
|
|
154
|
+
const pct = Math.min(value / max * 10, 10);
|
|
145
155
|
const angle = 2 * Math.PI * index / numSpokes;
|
|
146
|
-
|
|
156
|
+
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ? 11 - pct : pct;
|
|
157
|
+
const r = adjusted / 10 * radius;
|
|
158
|
+
const x = centerX + r * Math.sin(angle);
|
|
159
|
+
const y = centerY - r * Math.cos(angle);
|
|
160
|
+
return [x, y];
|
|
147
161
|
});
|
|
148
162
|
const targetPoints = pointsArr.map((p) => p.join(",")).join(" ");
|
|
149
|
-
const
|
|
163
|
+
const spring = (0, import_web.useSpring)({
|
|
150
164
|
to: { points: targetPoints },
|
|
151
165
|
immediate: countChanged,
|
|
166
|
+
reset: countChanged,
|
|
152
167
|
config: { tension: 300, friction: 30 }
|
|
153
|
-
};
|
|
154
|
-
if (countChanged) springBase.from = { points: targetPoints };
|
|
155
|
-
const spring = (0, import_web.useSpring)(springBase);
|
|
168
|
+
});
|
|
156
169
|
const hasCompareData = Object.keys(compareData).length > 0;
|
|
157
170
|
const centerPoints = spokes.map(() => `${centerX},${centerY}`).join(" ");
|
|
158
171
|
let comparePoints = null;
|
|
159
172
|
let compareCoords = null;
|
|
160
173
|
if (hasCompareData) {
|
|
161
174
|
const ccoords = spokes.map(([shortTitle], index) => {
|
|
162
|
-
var
|
|
163
|
-
const value = (
|
|
164
|
-
const
|
|
165
|
-
const
|
|
175
|
+
var _a, _b;
|
|
176
|
+
const value = (_a = compareData[shortTitle]) != null ? _a : 0;
|
|
177
|
+
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
178
|
+
const max = ((_b = topic == null ? void 0 : topic.stances) == null ? void 0 : _b.length) || 10;
|
|
179
|
+
const pct = Math.min(value / max * 10, 10);
|
|
166
180
|
const angle = 2 * Math.PI * index / numSpokes;
|
|
167
|
-
|
|
181
|
+
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ? 11 - pct : pct;
|
|
182
|
+
const r = adjusted / 10 * radius;
|
|
183
|
+
const x = centerX + r * Math.sin(angle);
|
|
184
|
+
const y = centerY - r * Math.cos(angle);
|
|
185
|
+
return [x, y];
|
|
168
186
|
});
|
|
169
187
|
compareCoords = ccoords;
|
|
170
188
|
comparePoints = ccoords.map((p) => p.join(",")).join(" ");
|
|
171
189
|
}
|
|
172
|
-
const hadCompareDataRef = (0,
|
|
190
|
+
const hadCompareDataRef = (0, import_react3.useRef)(false);
|
|
173
191
|
const compareJustAppeared = hasCompareData && !hadCompareDataRef.current;
|
|
174
|
-
(0,
|
|
192
|
+
(0, import_react3.useEffect)(() => {
|
|
175
193
|
hadCompareDataRef.current = hasCompareData;
|
|
176
194
|
}, [hasCompareData]);
|
|
177
|
-
const
|
|
195
|
+
const compareSpring = (0, import_web.useSpring)({
|
|
178
196
|
to: { points: comparePoints || centerPoints || `${centerX},${centerY}` },
|
|
179
197
|
immediate: countChanged || compareJustAppeared,
|
|
198
|
+
reset: countChanged || compareJustAppeared,
|
|
180
199
|
config: { tension: 300, friction: 30 }
|
|
181
|
-
};
|
|
182
|
-
if (countChanged || compareJustAppeared) compareSpringBase.from = compareSpringBase.to;
|
|
183
|
-
const compareSpring = (0, import_web.useSpring)(compareSpringBase);
|
|
184
|
-
const spokeExtension = spokes.reduce((acc, [shortTitle]) => {
|
|
185
|
-
const userAdj = calcAdjusted(data[shortTitle], shortTitle);
|
|
186
|
-
const cmpAdj = hasCompareData && compareData[shortTitle] ? calcAdjusted(compareData[shortTitle], shortTitle) : 0;
|
|
187
|
-
acc[shortTitle] = userAdj > 10 || cmpAdj > 10;
|
|
188
|
-
return acc;
|
|
189
|
-
}, {});
|
|
200
|
+
});
|
|
190
201
|
const labelMeta = spokes.map(([shortTitle], i) => {
|
|
191
202
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
203
|
+
const baseFSize = labelFontSize;
|
|
192
204
|
const lines = wrapLabel(shortTitle, 12);
|
|
193
|
-
const longestLineLen = lines.reduce(
|
|
194
|
-
|
|
205
|
+
const longestLineLen = lines.reduce(
|
|
206
|
+
(max, ln) => ln.length > max ? ln.length : max,
|
|
207
|
+
0
|
|
208
|
+
);
|
|
209
|
+
const fSize = adaptiveFontSize(longestLineLen, baseFSize);
|
|
210
|
+
const estimatedWidth = longestLineLen * fSize * 0.6;
|
|
195
211
|
const sinA = Math.sin(angle);
|
|
196
212
|
const side = sinA < -0.1 ? "left" : sinA > 0.1 ? "right" : "center";
|
|
197
213
|
return { estimatedWidth, side };
|
|
@@ -200,9 +216,23 @@ function RadarChartCore({
|
|
|
200
216
|
const rightLabelWidths = labelMeta.filter((m) => m.side === "right").map((m) => m.estimatedWidth);
|
|
201
217
|
const minPadding = 40;
|
|
202
218
|
const maxPadding = padding * 2;
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
219
|
+
const rawLeftPadding = Math.min(
|
|
220
|
+
Math.max(
|
|
221
|
+
leftLabelWidths.length ? Math.max(...leftLabelWidths) + labelOffset : 0,
|
|
222
|
+
minPadding
|
|
223
|
+
),
|
|
224
|
+
maxPadding
|
|
225
|
+
);
|
|
226
|
+
const rawRightPadding = Math.min(
|
|
227
|
+
Math.max(
|
|
228
|
+
rightLabelWidths.length ? Math.max(...rightLabelWidths) + labelOffset : 0,
|
|
229
|
+
minPadding
|
|
230
|
+
),
|
|
231
|
+
maxPadding
|
|
232
|
+
);
|
|
233
|
+
const symmetricPadding = Math.max(rawLeftPadding, rawRightPadding);
|
|
234
|
+
const leftPadding = symmetricPadding;
|
|
235
|
+
const rightPadding = symmetricPadding;
|
|
206
236
|
const verticalPadding = padding;
|
|
207
237
|
let tightTop = -verticalPadding;
|
|
208
238
|
let tightHeight = size + verticalPadding * 2;
|
|
@@ -210,12 +240,11 @@ function RadarChartCore({
|
|
|
210
240
|
let yMin = Infinity, yMax = -Infinity;
|
|
211
241
|
for (let i = 0; i < numSpokes; i++) {
|
|
212
242
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
213
|
-
const
|
|
214
|
-
const y = centerY - effectiveR * Math.cos(angle);
|
|
243
|
+
const y = centerY - radius * Math.cos(angle);
|
|
215
244
|
if (y < yMin) yMin = y;
|
|
216
245
|
if (y > yMax) yMax = y;
|
|
217
246
|
}
|
|
218
|
-
const labelMargin = labelOffset + labelFontSize *
|
|
247
|
+
const labelMargin = labelOffset + labelFontSize * 1.4 + labelFontSize * 1.1;
|
|
219
248
|
tightTop = yMin - labelMargin;
|
|
220
249
|
tightHeight = yMax + labelMargin - tightTop;
|
|
221
250
|
}
|
|
@@ -225,111 +254,101 @@ function RadarChartCore({
|
|
|
225
254
|
const ring = [];
|
|
226
255
|
for (let i = 0; i < numSpokes; i++) {
|
|
227
256
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
228
|
-
|
|
257
|
+
const x = centerX + radius * scale * Math.sin(angle);
|
|
258
|
+
const y = centerY - radius * scale * Math.cos(angle);
|
|
259
|
+
ring.push(`${x},${y}`);
|
|
229
260
|
}
|
|
230
261
|
guidePolygons.push(
|
|
231
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ import_react2.default.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: isDark ? "#374151" : "#ccc" })
|
|
232
263
|
);
|
|
233
264
|
}
|
|
234
|
-
|
|
235
|
-
if (writeIns[shortTitle]) return writeIns[shortTitle];
|
|
236
|
-
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
237
|
-
const stances = (topic == null ? void 0 : topic.stances) || [];
|
|
238
|
-
const idx = Math.round(Number(value)) - 1;
|
|
239
|
-
if (idx >= 0 && idx < stances.length) {
|
|
240
|
-
return stances[idx].text || shortTitle;
|
|
241
|
-
}
|
|
242
|
-
return shortTitle;
|
|
243
|
-
};
|
|
244
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
265
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
245
266
|
"svg",
|
|
246
267
|
{
|
|
247
268
|
className: "w-full h-auto max-h-full",
|
|
248
|
-
viewBox: `-${
|
|
249
|
-
preserveAspectRatio: "xMidYMid meet"
|
|
250
|
-
onMouseLeave: () => setTooltip(null)
|
|
269
|
+
viewBox: `-${leftPadding} ${tightTop} ${size + leftPadding + rightPadding} ${tightHeight}`,
|
|
270
|
+
preserveAspectRatio: "xMidYMid meet"
|
|
251
271
|
},
|
|
252
272
|
guidePolygons,
|
|
253
273
|
spokes.map(([shortTitle], i) => {
|
|
254
274
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
255
|
-
const
|
|
256
|
-
const
|
|
275
|
+
const x = centerX + radius * Math.sin(angle);
|
|
276
|
+
const y = centerY - radius * Math.cos(angle);
|
|
257
277
|
const isUnanswered = !!unansweredSpokes[shortTitle];
|
|
258
|
-
|
|
259
|
-
const extX = centerX + extRadius * Math.sin(angle);
|
|
260
|
-
const extY = centerY - extRadius * Math.cos(angle);
|
|
261
|
-
return /* @__PURE__ */ import_react.default.createElement("g", { key: `spoke-${shortTitle}` }, /* @__PURE__ */ import_react.default.createElement(
|
|
278
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
262
279
|
"line",
|
|
263
280
|
{
|
|
281
|
+
key: `line-${shortTitle}`,
|
|
264
282
|
x1: centerX,
|
|
265
283
|
y1: centerY,
|
|
266
|
-
x2:
|
|
267
|
-
y2:
|
|
268
|
-
stroke: isUnanswered ? "#
|
|
284
|
+
x2: x,
|
|
285
|
+
y2: y,
|
|
286
|
+
stroke: isUnanswered ? isDark ? "#6b7280" : "#9ca3af" : isDark ? "#d1d5db" : "black",
|
|
269
287
|
strokeDasharray: isUnanswered ? "4 3" : void 0,
|
|
270
288
|
opacity: isUnanswered ? 0.6 : 1
|
|
271
289
|
}
|
|
272
|
-
)
|
|
273
|
-
"line",
|
|
274
|
-
{
|
|
275
|
-
x1: endX,
|
|
276
|
-
y1: endY,
|
|
277
|
-
x2: extX,
|
|
278
|
-
y2: extY,
|
|
279
|
-
stroke: "#aaa",
|
|
280
|
-
strokeDasharray: "4 4",
|
|
281
|
-
opacity: 0.4
|
|
282
|
-
}
|
|
283
|
-
));
|
|
290
|
+
);
|
|
284
291
|
}),
|
|
285
292
|
spokes.map(([shortTitle], i) => {
|
|
286
293
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
294
|
+
const anchor = angle > Math.PI ? "end" : angle < Math.PI && angle > 0 ? "start" : "middle";
|
|
287
295
|
const cosA = Math.cos(angle);
|
|
288
|
-
const isBottom = cosA < -0.5;
|
|
289
296
|
const isTop = cosA > 0.5;
|
|
297
|
+
const isBottom = cosA < -0.5;
|
|
298
|
+
const baseFSize = labelFontSize;
|
|
290
299
|
const lines = wrapLabel(shortTitle, 12);
|
|
291
|
-
const longestLine = lines.reduce(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
300
|
+
const longestLine = lines.reduce(
|
|
301
|
+
(max, ln) => ln.length > max ? ln.length : max,
|
|
302
|
+
0
|
|
303
|
+
);
|
|
304
|
+
const fSize = adaptiveFontSize(longestLine, baseFSize);
|
|
305
|
+
const lineHeight = fSize * 1.1;
|
|
306
|
+
const dynamicLabelOffset = lines.length > 1 ? labelOffset + 8 : labelOffset;
|
|
307
|
+
const offset2 = radius + dynamicLabelOffset;
|
|
295
308
|
const labelX = centerX + offset2 * Math.sin(angle);
|
|
296
309
|
let labelY = centerY - offset2 * Math.cos(angle);
|
|
297
|
-
if (isTop && lines.length > 1)
|
|
298
|
-
|
|
310
|
+
if (isTop && lines.length > 1) {
|
|
311
|
+
labelY -= (lines.length - 1) * lineHeight;
|
|
312
|
+
}
|
|
299
313
|
const isUnansweredLabel = !!unansweredSpokes[shortTitle];
|
|
300
|
-
|
|
301
|
-
const shouldBold = boldOriginalSpokes && !isReplaced;
|
|
302
|
-
const fSize = labelFontSize;
|
|
303
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
314
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
304
315
|
"text",
|
|
305
316
|
{
|
|
306
317
|
key: `label-${shortTitle}`,
|
|
307
318
|
x: labelX,
|
|
308
319
|
y: labelY,
|
|
309
|
-
textAnchor:
|
|
320
|
+
textAnchor: anchor,
|
|
310
321
|
dominantBaseline: isBottom ? "hanging" : "auto",
|
|
311
322
|
onClick: () => onReplaceTopic(shortTitle),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
style: { cursor: "pointer", userSelect: "none", fontSize: fSize
|
|
323
|
+
className: "text-xl font-medium mb-1 md:text-base md:font-normal",
|
|
324
|
+
fill: isUnansweredLabel ? isDark ? "#6b7280" : "#9ca3af" : isDark ? "#d1d5db" : void 0,
|
|
325
|
+
style: { cursor: "pointer", userSelect: "none", fontSize: fSize }
|
|
315
326
|
},
|
|
316
|
-
isUnansweredLabel && /* @__PURE__ */
|
|
317
|
-
lines.map((ln, idx) => /* @__PURE__ */
|
|
327
|
+
isUnansweredLabel && /* @__PURE__ */ import_react2.default.createElement("title", null, "No stance on file for this topic."),
|
|
328
|
+
lines.map((ln, idx) => /* @__PURE__ */ import_react2.default.createElement("tspan", { key: idx, x: labelX, dy: idx === 0 ? "0" : `${lineHeight}` }, ln))
|
|
318
329
|
);
|
|
319
330
|
}),
|
|
320
|
-
countChanged ? /* @__PURE__ */
|
|
331
|
+
countChanged ? /* @__PURE__ */ import_react2.default.createElement(
|
|
321
332
|
"polygon",
|
|
322
333
|
{
|
|
323
334
|
key: "user-static",
|
|
324
335
|
points: targetPoints,
|
|
325
|
-
style: {
|
|
336
|
+
style: {
|
|
337
|
+
fill: "rgba(124, 107, 158, 0.4)",
|
|
338
|
+
stroke: "#7C6B9E",
|
|
339
|
+
strokeWidth: 3
|
|
340
|
+
}
|
|
326
341
|
}
|
|
327
|
-
) : /* @__PURE__ */
|
|
342
|
+
) : /* @__PURE__ */ import_react2.default.createElement(
|
|
328
343
|
import_web.animated.polygon,
|
|
329
344
|
{
|
|
330
345
|
key: "user-animated",
|
|
331
346
|
points: spring.points,
|
|
332
|
-
style: {
|
|
347
|
+
style: {
|
|
348
|
+
fill: "rgba(124, 107, 158, 0.4)",
|
|
349
|
+
stroke: "#7C6B9E",
|
|
350
|
+
strokeWidth: 3
|
|
351
|
+
}
|
|
333
352
|
}
|
|
334
353
|
),
|
|
335
354
|
pointsArr.map(([cx, cy], i) => {
|
|
@@ -338,7 +357,7 @@ function RadarChartCore({
|
|
|
338
357
|
if (!userVal || Number(userVal) === 0) return null;
|
|
339
358
|
const compareVal = compareData[shortTitle];
|
|
340
359
|
const matches = hasCompareData && userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
341
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
342
361
|
"circle",
|
|
343
362
|
{
|
|
344
363
|
key: `user-dot-${i}`,
|
|
@@ -347,33 +366,30 @@ function RadarChartCore({
|
|
|
347
366
|
r: matches ? 8 : 7,
|
|
348
367
|
fill: matches ? "#fed12e" : "#7C6B9E",
|
|
349
368
|
stroke: "#FFFFFF",
|
|
350
|
-
strokeWidth: 3
|
|
351
|
-
style: { pointerEvents: "none" }
|
|
369
|
+
strokeWidth: 3
|
|
352
370
|
}
|
|
353
371
|
);
|
|
354
372
|
}),
|
|
355
|
-
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */
|
|
373
|
+
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ import_react2.default.createElement(
|
|
356
374
|
"polygon",
|
|
357
375
|
{
|
|
358
376
|
key: "compare-static",
|
|
359
377
|
points: comparePoints,
|
|
360
378
|
style: {
|
|
361
|
-
fill:
|
|
362
|
-
stroke:
|
|
363
|
-
strokeWidth: 2
|
|
364
|
-
mixBlendMode: darkMode ? "normal" : "multiply"
|
|
379
|
+
fill: "rgba(90, 154, 110, 0.3)",
|
|
380
|
+
stroke: "#5A9A6E",
|
|
381
|
+
strokeWidth: 2
|
|
365
382
|
}
|
|
366
383
|
}
|
|
367
|
-
) : /* @__PURE__ */
|
|
384
|
+
) : /* @__PURE__ */ import_react2.default.createElement(
|
|
368
385
|
import_web.animated.polygon,
|
|
369
386
|
{
|
|
370
387
|
key: "compare-animated",
|
|
371
388
|
points: compareSpring.points,
|
|
372
389
|
style: {
|
|
373
|
-
fill:
|
|
374
|
-
stroke:
|
|
375
|
-
strokeWidth: 2
|
|
376
|
-
mixBlendMode: darkMode ? "normal" : "multiply"
|
|
390
|
+
fill: "rgba(90, 154, 110, 0.3)",
|
|
391
|
+
stroke: "#5A9A6E",
|
|
392
|
+
strokeWidth: 2
|
|
377
393
|
}
|
|
378
394
|
}
|
|
379
395
|
) : null,
|
|
@@ -382,117 +398,45 @@ function RadarChartCore({
|
|
|
382
398
|
const userVal = spokes[i][1];
|
|
383
399
|
const compareVal = compareData[shortTitle];
|
|
384
400
|
if (!compareVal || Number(compareVal) === 0) return null;
|
|
385
|
-
const matches = userVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
386
|
-
return /* @__PURE__ */
|
|
401
|
+
const matches = userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
402
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
387
403
|
"circle",
|
|
388
404
|
{
|
|
389
405
|
key: `compare-dot-${i}`,
|
|
390
406
|
cx,
|
|
391
407
|
cy,
|
|
392
408
|
r: matches ? 8 : 7,
|
|
393
|
-
fill: matches ? "#fed12e" :
|
|
409
|
+
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
394
410
|
stroke: "#FFFFFF",
|
|
395
|
-
strokeWidth: 3
|
|
396
|
-
style: { pointerEvents: "none" }
|
|
411
|
+
strokeWidth: 3
|
|
397
412
|
}
|
|
398
413
|
);
|
|
399
414
|
}),
|
|
400
415
|
spokes.map(([shortTitle], i) => {
|
|
401
416
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
402
|
-
const
|
|
403
|
-
const
|
|
417
|
+
const x = centerX + radius * Math.sin(angle);
|
|
418
|
+
const y = centerY - radius * Math.cos(angle);
|
|
404
419
|
const isUnansweredHitbox = !!unansweredSpokes[shortTitle];
|
|
405
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
406
421
|
"line",
|
|
407
422
|
{
|
|
408
423
|
key: `hitbox-${shortTitle}`,
|
|
409
424
|
x1: centerX,
|
|
410
425
|
y1: centerY,
|
|
411
|
-
x2:
|
|
412
|
-
y2:
|
|
426
|
+
x2: x,
|
|
427
|
+
y2: y,
|
|
413
428
|
stroke: "transparent",
|
|
414
429
|
strokeWidth: 14,
|
|
415
430
|
onClick: () => isUnansweredHitbox ? onReplaceTopic(shortTitle) : onToggleInversion(shortTitle),
|
|
416
431
|
style: { cursor: "pointer" }
|
|
417
432
|
}
|
|
418
433
|
);
|
|
419
|
-
})
|
|
420
|
-
pointsArr.map(([cx, cy], i) => {
|
|
421
|
-
const shortTitle = spokes[i][0];
|
|
422
|
-
const userVal = spokes[i][1];
|
|
423
|
-
if (!userVal || Number(userVal) === 0) return null;
|
|
424
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
425
|
-
"circle",
|
|
426
|
-
{
|
|
427
|
-
key: `user-sensor-${i}`,
|
|
428
|
-
cx,
|
|
429
|
-
cy,
|
|
430
|
-
r: 14,
|
|
431
|
-
fill: "transparent",
|
|
432
|
-
stroke: "none",
|
|
433
|
-
style: { cursor: "default" },
|
|
434
|
-
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, userVal) }),
|
|
435
|
-
onMouseLeave: () => setTooltip(null)
|
|
436
|
-
}
|
|
437
|
-
);
|
|
438
|
-
}),
|
|
439
|
-
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
440
|
-
const shortTitle = spokes[i][0];
|
|
441
|
-
const compareVal = compareData[shortTitle];
|
|
442
|
-
if (!compareVal || Number(compareVal) === 0) return null;
|
|
443
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
444
|
-
"circle",
|
|
445
|
-
{
|
|
446
|
-
key: `compare-sensor-${i}`,
|
|
447
|
-
cx,
|
|
448
|
-
cy,
|
|
449
|
-
r: 14,
|
|
450
|
-
fill: "transparent",
|
|
451
|
-
stroke: "none",
|
|
452
|
-
style: { cursor: "default" },
|
|
453
|
-
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, compareVal) }),
|
|
454
|
-
onMouseLeave: () => setTooltip(null)
|
|
455
|
-
}
|
|
456
|
-
);
|
|
457
|
-
}),
|
|
458
|
-
tooltip && (() => {
|
|
459
|
-
const tipW = 190;
|
|
460
|
-
const tipH = 70;
|
|
461
|
-
const svgW = size + sidePadding * 2;
|
|
462
|
-
const tx = tooltip.x + sidePadding + 12 > svgW - tipW ? tooltip.x - tipW - 12 : tooltip.x + 12;
|
|
463
|
-
const ty = tooltip.y - 10;
|
|
464
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
465
|
-
"foreignObject",
|
|
466
|
-
{
|
|
467
|
-
x: tx,
|
|
468
|
-
y: ty,
|
|
469
|
-
width: tipW,
|
|
470
|
-
height: tipH,
|
|
471
|
-
style: { overflow: "visible", pointerEvents: "none" }
|
|
472
|
-
},
|
|
473
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
474
|
-
"div",
|
|
475
|
-
{
|
|
476
|
-
xmlns: "http://www.w3.org/1999/xhtml",
|
|
477
|
-
style: {
|
|
478
|
-
background: darkMode ? "#2F3237" : "#ffffff",
|
|
479
|
-
border: darkMode ? "1px solid #59B0C4" : "1px solid #d1d5db",
|
|
480
|
-
borderRadius: 8,
|
|
481
|
-
padding: "7px 11px",
|
|
482
|
-
fontSize: 12,
|
|
483
|
-
lineHeight: 1.4,
|
|
484
|
-
color: darkMode ? "#EBEDEF" : "#111",
|
|
485
|
-
boxShadow: darkMode ? "0 2px 12px rgba(0,0,0,0.4)" : "0 2px 8px rgba(0,0,0,0.12)",
|
|
486
|
-
width: tipW + "px",
|
|
487
|
-
wordWrap: "break-word"
|
|
488
|
-
}
|
|
489
|
-
},
|
|
490
|
-
tooltip.text
|
|
491
|
-
)
|
|
492
|
-
);
|
|
493
|
-
})()
|
|
434
|
+
})
|
|
494
435
|
);
|
|
495
436
|
}
|
|
437
|
+
function adaptiveFontSize(longestLineLen, baseFSize) {
|
|
438
|
+
return Math.max(baseFSize, 10);
|
|
439
|
+
}
|
|
496
440
|
function wrapLabel(label, maxChars = 12) {
|
|
497
441
|
const str = String(label);
|
|
498
442
|
let rawWords;
|
|
@@ -526,7 +470,7 @@ function wrapLabel(label, maxChars = 12) {
|
|
|
526
470
|
}
|
|
527
471
|
|
|
528
472
|
// src/Header.jsx
|
|
529
|
-
var
|
|
473
|
+
var import_react5 = __toESM(require("react"));
|
|
530
474
|
|
|
531
475
|
// src/tokens.js
|
|
532
476
|
var colorScales = {
|
|
@@ -922,13 +866,13 @@ var breakpoints = {
|
|
|
922
866
|
};
|
|
923
867
|
|
|
924
868
|
// src/useMediaQuery.js
|
|
925
|
-
var
|
|
869
|
+
var import_react4 = require("react");
|
|
926
870
|
function useMediaQuery(query) {
|
|
927
|
-
const [matches, setMatches] = (0,
|
|
871
|
+
const [matches, setMatches] = (0, import_react4.useState)(() => {
|
|
928
872
|
if (typeof window === "undefined") return false;
|
|
929
873
|
return window.matchMedia(query).matches;
|
|
930
874
|
});
|
|
931
|
-
(0,
|
|
875
|
+
(0, import_react4.useEffect)(() => {
|
|
932
876
|
if (typeof window === "undefined") return;
|
|
933
877
|
const mql = window.matchMedia(query);
|
|
934
878
|
const handler = (e) => setMatches(e.matches);
|
|
@@ -940,16 +884,6 @@ function useMediaQuery(query) {
|
|
|
940
884
|
}
|
|
941
885
|
|
|
942
886
|
// src/Header.jsx
|
|
943
|
-
var dark = {
|
|
944
|
-
bg: "#1C1F23",
|
|
945
|
-
bgElevated: "#2F3237",
|
|
946
|
-
bgHover: "#41454E",
|
|
947
|
-
border: "#41454E",
|
|
948
|
-
link: "#59B0C4",
|
|
949
|
-
text: "#D3D7DE",
|
|
950
|
-
textMuted: "#9CA3AF",
|
|
951
|
-
shadow: "0 10px 40px rgba(0,0,0,0.4)"
|
|
952
|
-
};
|
|
953
887
|
function Header({
|
|
954
888
|
logoSrc,
|
|
955
889
|
logoAlt = "Empowered Vote",
|
|
@@ -960,15 +894,14 @@ function Header({
|
|
|
960
894
|
currentPath,
|
|
961
895
|
onNavigate,
|
|
962
896
|
profileMenu,
|
|
963
|
-
darkMode = false,
|
|
964
897
|
style = {}
|
|
965
898
|
}) {
|
|
966
|
-
const [mobileMenuOpen, setMobileMenuOpen] = (0,
|
|
967
|
-
const [openDropdown, setOpenDropdown] = (0,
|
|
968
|
-
const [profileOpen, setProfileOpen] = (0,
|
|
899
|
+
const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react5.useState)(false);
|
|
900
|
+
const [openDropdown, setOpenDropdown] = (0, import_react5.useState)(null);
|
|
901
|
+
const [profileOpen, setProfileOpen] = (0, import_react5.useState)(false);
|
|
969
902
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
970
|
-
const profileRef = (0,
|
|
971
|
-
(0,
|
|
903
|
+
const profileRef = (0, import_react5.useRef)(null);
|
|
904
|
+
(0, import_react5.useEffect)(() => {
|
|
972
905
|
if (!profileOpen) return;
|
|
973
906
|
const handleClickOutside = (e) => {
|
|
974
907
|
if (profileRef.current && !profileRef.current.contains(e.target)) {
|
|
@@ -984,16 +917,9 @@ function Header({
|
|
|
984
917
|
onNavigate(href);
|
|
985
918
|
}
|
|
986
919
|
};
|
|
987
|
-
const linkColor = darkMode ? dark.link : colors.evTeal;
|
|
988
|
-
const dropdownBg = darkMode ? dark.bgElevated : colors.bgWhite;
|
|
989
|
-
const dropdownShadow = darkMode ? dark.shadow : "0 10px 40px rgba(0,0,0,0.1)";
|
|
990
|
-
const hoverBg = darkMode ? dark.bgHover : colors.bgLight;
|
|
991
|
-
const borderColor = darkMode ? dark.border : colors.borderLight;
|
|
992
|
-
const mobileShadow = darkMode ? "0 4px 20px rgba(0,0,0,0.4)" : "0 4px 20px rgba(0,0,0,0.1)";
|
|
993
920
|
const styles2 = {
|
|
994
921
|
header: {
|
|
995
|
-
backgroundColor:
|
|
996
|
-
borderBottom: darkMode ? `1px solid ${dark.border}` : "none",
|
|
922
|
+
backgroundColor: colors.bgWhite,
|
|
997
923
|
position: "sticky",
|
|
998
924
|
top: 0,
|
|
999
925
|
zIndex: 50,
|
|
@@ -1021,7 +947,7 @@ function Header({
|
|
|
1021
947
|
fontFamily: fonts.primary,
|
|
1022
948
|
fontWeight: fontWeights.bold,
|
|
1023
949
|
fontSize: fontSizes.xl,
|
|
1024
|
-
color:
|
|
950
|
+
color: colors.evTeal,
|
|
1025
951
|
textDecoration: "none",
|
|
1026
952
|
cursor: "pointer",
|
|
1027
953
|
display: "flex",
|
|
@@ -1044,12 +970,11 @@ function Header({
|
|
|
1044
970
|
zIndex: 100
|
|
1045
971
|
},
|
|
1046
972
|
dropdownInner: {
|
|
1047
|
-
backgroundColor:
|
|
973
|
+
backgroundColor: colors.bgWhite,
|
|
1048
974
|
borderRadius: borderRadius.lg,
|
|
1049
|
-
boxShadow:
|
|
975
|
+
boxShadow: "0 10px 40px rgba(0,0,0,0.1)",
|
|
1050
976
|
minWidth: "200px",
|
|
1051
|
-
padding: spacing[2]
|
|
1052
|
-
border: darkMode ? `1px solid ${dark.border}` : "none"
|
|
977
|
+
padding: spacing[2]
|
|
1053
978
|
},
|
|
1054
979
|
dropdownItem: {
|
|
1055
980
|
display: "block",
|
|
@@ -1057,7 +982,7 @@ function Header({
|
|
|
1057
982
|
fontFamily: fonts.primary,
|
|
1058
983
|
fontWeight: fontWeights.medium,
|
|
1059
984
|
fontSize: fontSizes.base,
|
|
1060
|
-
color:
|
|
985
|
+
color: colors.evTeal,
|
|
1061
986
|
textDecoration: "none",
|
|
1062
987
|
borderRadius: borderRadius.md,
|
|
1063
988
|
cursor: "pointer"
|
|
@@ -1079,13 +1004,13 @@ function Header({
|
|
|
1079
1004
|
display: "inline-flex",
|
|
1080
1005
|
alignItems: "center",
|
|
1081
1006
|
backgroundColor: "transparent",
|
|
1082
|
-
color:
|
|
1007
|
+
color: colors.evTeal,
|
|
1083
1008
|
fontFamily: fonts.primary,
|
|
1084
1009
|
fontWeight: fontWeights.bold,
|
|
1085
1010
|
fontSize: fontSizes.base,
|
|
1086
1011
|
padding: `${spacing[2]} ${spacing[5]}`,
|
|
1087
1012
|
borderRadius: borderRadius.full || "999px",
|
|
1088
|
-
border: `1.5px solid ${
|
|
1013
|
+
border: `1.5px solid ${colors.evTeal}`,
|
|
1089
1014
|
cursor: "pointer",
|
|
1090
1015
|
textDecoration: "none",
|
|
1091
1016
|
lineHeight: 1.2,
|
|
@@ -1101,7 +1026,7 @@ function Header({
|
|
|
1101
1026
|
hamburger: {
|
|
1102
1027
|
width: "24px",
|
|
1103
1028
|
height: "2px",
|
|
1104
|
-
backgroundColor:
|
|
1029
|
+
backgroundColor: colors.evTeal,
|
|
1105
1030
|
position: "relative"
|
|
1106
1031
|
},
|
|
1107
1032
|
mobileMenu: {
|
|
@@ -1111,26 +1036,25 @@ function Header({
|
|
|
1111
1036
|
top: "100%",
|
|
1112
1037
|
left: 0,
|
|
1113
1038
|
right: 0,
|
|
1114
|
-
backgroundColor:
|
|
1039
|
+
backgroundColor: colors.bgWhite,
|
|
1115
1040
|
padding: spacing[4],
|
|
1116
|
-
boxShadow:
|
|
1117
|
-
borderTop: darkMode ? `1px solid ${dark.border}` : "none"
|
|
1041
|
+
boxShadow: "0 4px 20px rgba(0,0,0,0.1)"
|
|
1118
1042
|
},
|
|
1119
1043
|
mobileNavItem: {
|
|
1120
1044
|
fontFamily: fonts.primary,
|
|
1121
1045
|
fontWeight: fontWeights.bold,
|
|
1122
1046
|
fontSize: fontSizes.lg,
|
|
1123
|
-
color:
|
|
1047
|
+
color: colors.evTeal,
|
|
1124
1048
|
textDecoration: "none",
|
|
1125
1049
|
padding: `${spacing[3]} 0`,
|
|
1126
|
-
borderBottom: `1px solid ${
|
|
1050
|
+
borderBottom: `1px solid ${colors.borderLight}`
|
|
1127
1051
|
},
|
|
1128
1052
|
profileButton: {
|
|
1129
1053
|
width: "40px",
|
|
1130
1054
|
height: "40px",
|
|
1131
1055
|
borderRadius: borderRadius.full,
|
|
1132
|
-
border: `2px solid ${
|
|
1133
|
-
backgroundColor:
|
|
1056
|
+
border: `2px solid ${colors.evTeal}`,
|
|
1057
|
+
backgroundColor: colors.bgLight,
|
|
1134
1058
|
cursor: "pointer",
|
|
1135
1059
|
display: "flex",
|
|
1136
1060
|
alignItems: "center",
|
|
@@ -1145,12 +1069,11 @@ function Header({
|
|
|
1145
1069
|
zIndex: 100
|
|
1146
1070
|
},
|
|
1147
1071
|
profileDropdownInner: {
|
|
1148
|
-
backgroundColor:
|
|
1072
|
+
backgroundColor: colors.bgWhite,
|
|
1149
1073
|
borderRadius: borderRadius.lg,
|
|
1150
|
-
boxShadow:
|
|
1074
|
+
boxShadow: "0 10px 40px rgba(0,0,0,0.1)",
|
|
1151
1075
|
minWidth: "160px",
|
|
1152
|
-
padding: spacing[2]
|
|
1153
|
-
border: darkMode ? `1px solid ${dark.border}` : "none"
|
|
1076
|
+
padding: spacing[2]
|
|
1154
1077
|
},
|
|
1155
1078
|
profileDropdownItem: {
|
|
1156
1079
|
display: "block",
|
|
@@ -1159,7 +1082,7 @@ function Header({
|
|
|
1159
1082
|
fontFamily: fonts.primary,
|
|
1160
1083
|
fontWeight: fontWeights.medium,
|
|
1161
1084
|
fontSize: fontSizes.base,
|
|
1162
|
-
color:
|
|
1085
|
+
color: colors.evTeal,
|
|
1163
1086
|
textDecoration: "none",
|
|
1164
1087
|
borderRadius: borderRadius.md,
|
|
1165
1088
|
cursor: "pointer",
|
|
@@ -1169,7 +1092,7 @@ function Header({
|
|
|
1169
1092
|
},
|
|
1170
1093
|
mobileDivider: {
|
|
1171
1094
|
height: "1px",
|
|
1172
|
-
backgroundColor:
|
|
1095
|
+
backgroundColor: colors.borderLight,
|
|
1173
1096
|
margin: `${spacing[3]} 0`
|
|
1174
1097
|
},
|
|
1175
1098
|
profileLabel: {
|
|
@@ -1177,8 +1100,8 @@ function Header({
|
|
|
1177
1100
|
fontFamily: fonts.primary,
|
|
1178
1101
|
fontWeight: fontWeights.semibold,
|
|
1179
1102
|
fontSize: fontSizes.sm,
|
|
1180
|
-
color:
|
|
1181
|
-
borderBottom: `1px solid ${
|
|
1103
|
+
color: colors.textMuted,
|
|
1104
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
1182
1105
|
marginBottom: spacing[1],
|
|
1183
1106
|
overflow: "hidden",
|
|
1184
1107
|
textOverflow: "ellipsis",
|
|
@@ -1189,14 +1112,14 @@ function Header({
|
|
|
1189
1112
|
const isActive = currentPath === item.href;
|
|
1190
1113
|
const hasDropdown = item.dropdown && item.dropdown.length > 0;
|
|
1191
1114
|
const isOpen = openDropdown === item.label;
|
|
1192
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
1193
1116
|
"div",
|
|
1194
1117
|
{
|
|
1195
1118
|
style: { position: "relative" },
|
|
1196
1119
|
onMouseEnter: () => hasDropdown && setOpenDropdown(item.label),
|
|
1197
1120
|
onMouseLeave: () => hasDropdown && setOpenDropdown(null)
|
|
1198
1121
|
},
|
|
1199
|
-
/* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
1200
1123
|
"a",
|
|
1201
1124
|
{
|
|
1202
1125
|
href: item.href,
|
|
@@ -1207,7 +1130,7 @@ function Header({
|
|
|
1207
1130
|
}
|
|
1208
1131
|
},
|
|
1209
1132
|
item.label,
|
|
1210
|
-
hasDropdown && /* @__PURE__ */
|
|
1133
|
+
hasDropdown && /* @__PURE__ */ import_react5.default.createElement(
|
|
1211
1134
|
"svg",
|
|
1212
1135
|
{
|
|
1213
1136
|
style: styles2.dropdownIcon,
|
|
@@ -1215,11 +1138,11 @@ function Header({
|
|
|
1215
1138
|
fill: "none",
|
|
1216
1139
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1217
1140
|
},
|
|
1218
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
1219
1142
|
"path",
|
|
1220
1143
|
{
|
|
1221
1144
|
d: "M1 1L8 8L15 1",
|
|
1222
|
-
stroke:
|
|
1145
|
+
stroke: colors.evTeal,
|
|
1223
1146
|
strokeWidth: "2",
|
|
1224
1147
|
strokeLinecap: "round",
|
|
1225
1148
|
strokeLinejoin: "round"
|
|
@@ -1227,7 +1150,7 @@ function Header({
|
|
|
1227
1150
|
)
|
|
1228
1151
|
)
|
|
1229
1152
|
),
|
|
1230
|
-
hasDropdown && isOpen && /* @__PURE__ */
|
|
1153
|
+
hasDropdown && isOpen && /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.dropdown }, /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.dropdownInner }, item.dropdown.map((dropdownItem, idx) => /* @__PURE__ */ import_react5.default.createElement(
|
|
1231
1154
|
"a",
|
|
1232
1155
|
{
|
|
1233
1156
|
key: idx,
|
|
@@ -1235,7 +1158,7 @@ function Header({
|
|
|
1235
1158
|
onClick: (e) => handleNavClick(e, dropdownItem.href),
|
|
1236
1159
|
style: styles2.dropdownItem,
|
|
1237
1160
|
onMouseEnter: (e) => {
|
|
1238
|
-
e.target.style.backgroundColor =
|
|
1161
|
+
e.target.style.backgroundColor = colors.bgLight;
|
|
1239
1162
|
},
|
|
1240
1163
|
onMouseLeave: (e) => {
|
|
1241
1164
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1245,26 +1168,26 @@ function Header({
|
|
|
1245
1168
|
))))
|
|
1246
1169
|
);
|
|
1247
1170
|
};
|
|
1248
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ import_react5.default.createElement("header", { style: styles2.header }, /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.container }, /* @__PURE__ */ import_react5.default.createElement(
|
|
1249
1172
|
"a",
|
|
1250
1173
|
{
|
|
1251
1174
|
href: logoHref,
|
|
1252
1175
|
onClick: (e) => handleNavClick(e, logoHref),
|
|
1253
1176
|
style: { display: "flex", alignItems: "center" }
|
|
1254
1177
|
},
|
|
1255
|
-
logoSrc ? /* @__PURE__ */
|
|
1178
|
+
logoSrc ? /* @__PURE__ */ import_react5.default.createElement("img", { src: logoSrc, alt: logoAlt, style: styles2.logo }) : /* @__PURE__ */ import_react5.default.createElement(
|
|
1256
1179
|
"span",
|
|
1257
1180
|
{
|
|
1258
1181
|
style: {
|
|
1259
1182
|
fontFamily: fonts.primary,
|
|
1260
1183
|
fontWeight: fontWeights.bold,
|
|
1261
1184
|
fontSize: fontSizes["2xl"],
|
|
1262
|
-
color:
|
|
1185
|
+
color: colors.evTeal
|
|
1263
1186
|
}
|
|
1264
1187
|
},
|
|
1265
1188
|
"empowered.vote"
|
|
1266
1189
|
)
|
|
1267
|
-
), /* @__PURE__ */
|
|
1190
|
+
), /* @__PURE__ */ import_react5.default.createElement("nav", { style: styles2.nav, className: "ev-header-nav" }, navItems.map((item, idx) => /* @__PURE__ */ import_react5.default.createElement(NavLink, { key: idx, item }))), /* @__PURE__ */ import_react5.default.createElement("div", { style: { display: isMobile ? "none" : "flex", alignItems: "center", gap: spacing[3] } }, secondaryAction && import_react5.default.isValidElement(secondaryAction) && secondaryAction, secondaryAction && !import_react5.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react5.default.createElement(
|
|
1268
1191
|
"a",
|
|
1269
1192
|
{
|
|
1270
1193
|
href: secondaryAction.href,
|
|
@@ -1278,16 +1201,16 @@ function Header({
|
|
|
1278
1201
|
style: styles2.secondaryAction,
|
|
1279
1202
|
className: "ev-header-secondary",
|
|
1280
1203
|
onMouseEnter: (e) => {
|
|
1281
|
-
e.currentTarget.style.backgroundColor =
|
|
1204
|
+
e.currentTarget.style.backgroundColor = colors.evTeal;
|
|
1282
1205
|
e.currentTarget.style.color = colors.textWhite;
|
|
1283
1206
|
},
|
|
1284
1207
|
onMouseLeave: (e) => {
|
|
1285
1208
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
1286
|
-
e.currentTarget.style.color =
|
|
1209
|
+
e.currentTarget.style.color = colors.evTeal;
|
|
1287
1210
|
}
|
|
1288
1211
|
},
|
|
1289
1212
|
secondaryAction.label
|
|
1290
|
-
), ctaButton && /* @__PURE__ */
|
|
1213
|
+
), ctaButton && /* @__PURE__ */ import_react5.default.createElement(
|
|
1291
1214
|
"a",
|
|
1292
1215
|
{
|
|
1293
1216
|
href: ctaButton.href,
|
|
@@ -1302,7 +1225,7 @@ function Header({
|
|
|
1302
1225
|
}
|
|
1303
1226
|
},
|
|
1304
1227
|
ctaButton.label
|
|
1305
|
-
), profileMenu && /* @__PURE__ */
|
|
1228
|
+
), profileMenu && /* @__PURE__ */ import_react5.default.createElement("div", { ref: profileRef, style: { position: "relative" } }, /* @__PURE__ */ import_react5.default.createElement(
|
|
1306
1229
|
"button",
|
|
1307
1230
|
{
|
|
1308
1231
|
style: styles2.profileButton,
|
|
@@ -1310,24 +1233,24 @@ function Header({
|
|
|
1310
1233
|
"aria-label": "Profile menu",
|
|
1311
1234
|
"aria-expanded": profileOpen
|
|
1312
1235
|
},
|
|
1313
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ import_react5.default.createElement(
|
|
1314
1237
|
"svg",
|
|
1315
1238
|
{
|
|
1316
1239
|
width: "20",
|
|
1317
1240
|
height: "20",
|
|
1318
1241
|
viewBox: "0 0 24 24",
|
|
1319
1242
|
fill: "none",
|
|
1320
|
-
stroke:
|
|
1243
|
+
stroke: colors.evTeal,
|
|
1321
1244
|
strokeWidth: "2",
|
|
1322
1245
|
strokeLinecap: "round",
|
|
1323
1246
|
strokeLinejoin: "round"
|
|
1324
1247
|
},
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ import_react5.default.createElement("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
|
|
1249
|
+
/* @__PURE__ */ import_react5.default.createElement("circle", { cx: "12", cy: "7", r: "4" })
|
|
1327
1250
|
)
|
|
1328
|
-
), profileOpen && /* @__PURE__ */
|
|
1251
|
+
), profileOpen && /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.profileDropdown }, /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.profileDropdownInner }, profileMenu.label && /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.profileLabel }, profileMenu.label), profileMenu.items.map((item, idx) => {
|
|
1329
1252
|
if (item.href) {
|
|
1330
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
1331
1254
|
"a",
|
|
1332
1255
|
{
|
|
1333
1256
|
key: idx,
|
|
@@ -1341,7 +1264,7 @@ function Header({
|
|
|
1341
1264
|
},
|
|
1342
1265
|
style: styles2.profileDropdownItem,
|
|
1343
1266
|
onMouseEnter: (e) => {
|
|
1344
|
-
e.target.style.backgroundColor =
|
|
1267
|
+
e.target.style.backgroundColor = colors.bgLight;
|
|
1345
1268
|
},
|
|
1346
1269
|
onMouseLeave: (e) => {
|
|
1347
1270
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1350,7 +1273,7 @@ function Header({
|
|
|
1350
1273
|
item.label
|
|
1351
1274
|
);
|
|
1352
1275
|
}
|
|
1353
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
1354
1277
|
"button",
|
|
1355
1278
|
{
|
|
1356
1279
|
key: idx,
|
|
@@ -1361,7 +1284,7 @@ function Header({
|
|
|
1361
1284
|
},
|
|
1362
1285
|
style: styles2.profileDropdownItem,
|
|
1363
1286
|
onMouseEnter: (e) => {
|
|
1364
|
-
e.target.style.backgroundColor =
|
|
1287
|
+
e.target.style.backgroundColor = colors.bgLight;
|
|
1365
1288
|
},
|
|
1366
1289
|
onMouseLeave: (e) => {
|
|
1367
1290
|
e.target.style.backgroundColor = "transparent";
|
|
@@ -1369,7 +1292,7 @@ function Header({
|
|
|
1369
1292
|
},
|
|
1370
1293
|
item.label
|
|
1371
1294
|
);
|
|
1372
|
-
}))))), /* @__PURE__ */
|
|
1295
|
+
}))))), /* @__PURE__ */ import_react5.default.createElement(
|
|
1373
1296
|
"button",
|
|
1374
1297
|
{
|
|
1375
1298
|
style: styles2.mobileMenuButton,
|
|
@@ -1378,7 +1301,7 @@ function Header({
|
|
|
1378
1301
|
"aria-label": "Toggle menu",
|
|
1379
1302
|
"aria-expanded": mobileMenuOpen
|
|
1380
1303
|
},
|
|
1381
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.hamburger }, /* @__PURE__ */ import_react5.default.createElement(
|
|
1382
1305
|
"span",
|
|
1383
1306
|
{
|
|
1384
1307
|
style: {
|
|
@@ -1387,10 +1310,10 @@ function Header({
|
|
|
1387
1310
|
left: 0,
|
|
1388
1311
|
width: "100%",
|
|
1389
1312
|
height: "2px",
|
|
1390
|
-
backgroundColor:
|
|
1313
|
+
backgroundColor: colors.evTeal
|
|
1391
1314
|
}
|
|
1392
1315
|
}
|
|
1393
|
-
), /* @__PURE__ */
|
|
1316
|
+
), /* @__PURE__ */ import_react5.default.createElement(
|
|
1394
1317
|
"span",
|
|
1395
1318
|
{
|
|
1396
1319
|
style: {
|
|
@@ -1399,13 +1322,13 @@ function Header({
|
|
|
1399
1322
|
left: 0,
|
|
1400
1323
|
width: "100%",
|
|
1401
1324
|
height: "2px",
|
|
1402
|
-
backgroundColor:
|
|
1325
|
+
backgroundColor: colors.evTeal
|
|
1403
1326
|
}
|
|
1404
1327
|
}
|
|
1405
1328
|
))
|
|
1406
|
-
)), /* @__PURE__ */
|
|
1329
|
+
)), /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.mobileMenu, className: "ev-header-mobile-menu" }, navItems.map((item, idx) => {
|
|
1407
1330
|
const hasDropdown = item.dropdown && item.dropdown.length > 0;
|
|
1408
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, { key: idx }, hasDropdown ? /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(
|
|
1409
1332
|
"span",
|
|
1410
1333
|
{
|
|
1411
1334
|
style: {
|
|
@@ -1415,7 +1338,7 @@ function Header({
|
|
|
1415
1338
|
}
|
|
1416
1339
|
},
|
|
1417
1340
|
item.label
|
|
1418
|
-
), item.dropdown.map((sub, subIdx) => /* @__PURE__ */
|
|
1341
|
+
), item.dropdown.map((sub, subIdx) => /* @__PURE__ */ import_react5.default.createElement(
|
|
1419
1342
|
"a",
|
|
1420
1343
|
{
|
|
1421
1344
|
key: subIdx,
|
|
@@ -1432,7 +1355,7 @@ function Header({
|
|
|
1432
1355
|
}
|
|
1433
1356
|
},
|
|
1434
1357
|
sub.label
|
|
1435
|
-
))) : /* @__PURE__ */
|
|
1358
|
+
))) : /* @__PURE__ */ import_react5.default.createElement(
|
|
1436
1359
|
"a",
|
|
1437
1360
|
{
|
|
1438
1361
|
href: item.href,
|
|
@@ -1444,7 +1367,7 @@ function Header({
|
|
|
1444
1367
|
},
|
|
1445
1368
|
item.label
|
|
1446
1369
|
));
|
|
1447
|
-
}), secondaryAction &&
|
|
1370
|
+
}), secondaryAction && import_react5.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react5.default.createElement("div", { style: { marginTop: spacing[4], textAlign: "center" } }, secondaryAction), secondaryAction && !import_react5.default.isValidElement(secondaryAction) && /* @__PURE__ */ import_react5.default.createElement(
|
|
1448
1371
|
"a",
|
|
1449
1372
|
{
|
|
1450
1373
|
href: secondaryAction.href,
|
|
@@ -1459,7 +1382,7 @@ function Header({
|
|
|
1459
1382
|
style: { ...styles2.secondaryAction, marginTop: spacing[4], textAlign: "center", justifyContent: "center" }
|
|
1460
1383
|
},
|
|
1461
1384
|
secondaryAction.label
|
|
1462
|
-
), ctaButton && /* @__PURE__ */
|
|
1385
|
+
), ctaButton && /* @__PURE__ */ import_react5.default.createElement(
|
|
1463
1386
|
"a",
|
|
1464
1387
|
{
|
|
1465
1388
|
href: ctaButton.href,
|
|
@@ -1470,7 +1393,7 @@ function Header({
|
|
|
1470
1393
|
style: { ...styles2.ctaButton, marginTop: spacing[4], textAlign: "center" }
|
|
1471
1394
|
},
|
|
1472
1395
|
ctaButton.label
|
|
1473
|
-
), profileMenu && /* @__PURE__ */
|
|
1396
|
+
), profileMenu && /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement("div", { style: styles2.mobileDivider }), profileMenu.label && /* @__PURE__ */ import_react5.default.createElement(
|
|
1474
1397
|
"span",
|
|
1475
1398
|
{
|
|
1476
1399
|
style: {
|
|
@@ -1486,7 +1409,7 @@ function Header({
|
|
|
1486
1409
|
profileMenu.label
|
|
1487
1410
|
), profileMenu.items.map((item, idx) => {
|
|
1488
1411
|
if (item.href) {
|
|
1489
|
-
return /* @__PURE__ */
|
|
1412
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
1490
1413
|
"a",
|
|
1491
1414
|
{
|
|
1492
1415
|
key: idx,
|
|
@@ -1503,7 +1426,7 @@ function Header({
|
|
|
1503
1426
|
item.label
|
|
1504
1427
|
);
|
|
1505
1428
|
}
|
|
1506
|
-
return /* @__PURE__ */
|
|
1429
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
1507
1430
|
"button",
|
|
1508
1431
|
{
|
|
1509
1432
|
key: idx,
|
|
@@ -1527,10 +1450,10 @@ function Header({
|
|
|
1527
1450
|
}
|
|
1528
1451
|
|
|
1529
1452
|
// src/SiteHeader.jsx
|
|
1530
|
-
var
|
|
1453
|
+
var import_react7 = __toESM(require("react"));
|
|
1531
1454
|
|
|
1532
1455
|
// src/FeedbackButton.jsx
|
|
1533
|
-
var
|
|
1456
|
+
var import_react6 = __toESM(require("react"));
|
|
1534
1457
|
var FEEDBACK_BASE_DEFAULT = "https://alpha.empowered.vote/feedback";
|
|
1535
1458
|
var HOST_FEATURE_MAP = {
|
|
1536
1459
|
"compass.empowered.vote": "compass",
|
|
@@ -1601,7 +1524,7 @@ function FeedbackButton({
|
|
|
1601
1524
|
cursor: "pointer"
|
|
1602
1525
|
};
|
|
1603
1526
|
const baseStyle = variant === "link" ? linkStyle2 : pillStyle;
|
|
1604
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1605
1528
|
"a",
|
|
1606
1529
|
{
|
|
1607
1530
|
href,
|
|
@@ -1652,7 +1575,6 @@ function SiteHeader({
|
|
|
1652
1575
|
profileMenu,
|
|
1653
1576
|
secondaryAction,
|
|
1654
1577
|
feedbackFeature,
|
|
1655
|
-
darkMode = false,
|
|
1656
1578
|
style = {}
|
|
1657
1579
|
}) {
|
|
1658
1580
|
const handleNavigate = (href) => {
|
|
@@ -1666,11 +1588,11 @@ function SiteHeader({
|
|
|
1666
1588
|
if (secondaryAction === false) {
|
|
1667
1589
|
resolvedSecondary = void 0;
|
|
1668
1590
|
} else if (secondaryAction === void 0) {
|
|
1669
|
-
resolvedSecondary = /* @__PURE__ */
|
|
1591
|
+
resolvedSecondary = /* @__PURE__ */ import_react7.default.createElement(FeedbackButton, { feature: feedbackFeature });
|
|
1670
1592
|
} else {
|
|
1671
1593
|
resolvedSecondary = secondaryAction;
|
|
1672
1594
|
}
|
|
1673
|
-
return /* @__PURE__ */
|
|
1595
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1674
1596
|
Header,
|
|
1675
1597
|
{
|
|
1676
1598
|
logoSrc,
|
|
@@ -1681,14 +1603,13 @@ function SiteHeader({
|
|
|
1681
1603
|
currentPath,
|
|
1682
1604
|
onNavigate: handleNavigate,
|
|
1683
1605
|
profileMenu,
|
|
1684
|
-
darkMode,
|
|
1685
1606
|
style
|
|
1686
1607
|
}
|
|
1687
1608
|
);
|
|
1688
1609
|
}
|
|
1689
1610
|
|
|
1690
1611
|
// src/FilterSidebar.jsx
|
|
1691
|
-
var
|
|
1612
|
+
var import_react8 = __toESM(require("react"));
|
|
1692
1613
|
function FilterSidebar({
|
|
1693
1614
|
title = "Filter by",
|
|
1694
1615
|
zipCode = "",
|
|
@@ -1842,14 +1763,14 @@ function FilterSidebar({
|
|
|
1842
1763
|
fontSize: fontSizes.sm
|
|
1843
1764
|
}
|
|
1844
1765
|
};
|
|
1845
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ import_react8.default.createElement("aside", { style: styles2.sidebar, className: "ev-filter-sidebar" }, !isMobile && /* @__PURE__ */ import_react8.default.createElement("h2", { style: styles2.title }, title), /* @__PURE__ */ import_react8.default.createElement("div", { style: isMobile ? void 0 : styles2.contentTop }, /* @__PURE__ */ import_react8.default.createElement("div", { style: isMobile ? { marginBottom: spacing[3] } : styles2.section }, !isMobile && /* @__PURE__ */ import_react8.default.createElement("label", { style: styles2.sectionLabel }, "Location"), autocompleteContainerRef ? /* @__PURE__ */ import_react8.default.createElement(
|
|
1846
1767
|
"div",
|
|
1847
1768
|
{
|
|
1848
1769
|
ref: autocompleteContainerRef,
|
|
1849
1770
|
style: styles2.zipInputWrapper,
|
|
1850
1771
|
className: "ev-autocomplete-container"
|
|
1851
1772
|
}
|
|
1852
|
-
) : /* @__PURE__ */
|
|
1773
|
+
) : /* @__PURE__ */ import_react8.default.createElement("div", { style: styles2.zipInputWrapper }, /* @__PURE__ */ import_react8.default.createElement(
|
|
1853
1774
|
"input",
|
|
1854
1775
|
{
|
|
1855
1776
|
ref: zipInputRef,
|
|
@@ -1861,7 +1782,7 @@ function FilterSidebar({
|
|
|
1861
1782
|
style: styles2.zipInput,
|
|
1862
1783
|
"aria-label": "Search location"
|
|
1863
1784
|
}
|
|
1864
|
-
), /* @__PURE__ */
|
|
1785
|
+
), /* @__PURE__ */ import_react8.default.createElement(
|
|
1865
1786
|
"button",
|
|
1866
1787
|
{
|
|
1867
1788
|
type: "button",
|
|
@@ -1870,7 +1791,7 @@ function FilterSidebar({
|
|
|
1870
1791
|
"aria-label": "Clear ZIP code"
|
|
1871
1792
|
},
|
|
1872
1793
|
"\xD7"
|
|
1873
|
-
))), /* @__PURE__ */
|
|
1794
|
+
))), /* @__PURE__ */ import_react8.default.createElement("div", { style: isMobile ? {} : styles2.section }, !isMobile && /* @__PURE__ */ import_react8.default.createElement("label", { style: styles2.sectionLabel }, "Group"), /* @__PURE__ */ import_react8.default.createElement("div", { style: styles2.radioGroup, role: "radiogroup", "aria-label": "Filter by group" }, filterOptions.map((option) => /* @__PURE__ */ import_react8.default.createElement("label", { key: option.value, style: styles2.radioLabel }, /* @__PURE__ */ import_react8.default.createElement(
|
|
1874
1795
|
"input",
|
|
1875
1796
|
{
|
|
1876
1797
|
type: "radio",
|
|
@@ -1880,18 +1801,18 @@ function FilterSidebar({
|
|
|
1880
1801
|
onChange: () => onFilterChange == null ? void 0 : onFilterChange(option.value),
|
|
1881
1802
|
style: styles2.radioInput
|
|
1882
1803
|
}
|
|
1883
|
-
), option.label))))), !isMobile && /* @__PURE__ */
|
|
1804
|
+
), option.label))))), !isMobile && /* @__PURE__ */ import_react8.default.createElement("div", { style: styles2.imageSection }, locationLabel && /* @__PURE__ */ import_react8.default.createElement("div", { style: styles2.locationLabel }, locationLabel), buildingImageSrc ? /* @__PURE__ */ import_react8.default.createElement(
|
|
1884
1805
|
"img",
|
|
1885
1806
|
{
|
|
1886
1807
|
src: buildingImageSrc,
|
|
1887
1808
|
alt: `${selectedFilter} government building`,
|
|
1888
1809
|
style: styles2.buildingImage
|
|
1889
1810
|
}
|
|
1890
|
-
) : /* @__PURE__ */
|
|
1811
|
+
) : /* @__PURE__ */ import_react8.default.createElement("div", { style: styles2.buildingPlaceholder }, "No image")));
|
|
1891
1812
|
}
|
|
1892
1813
|
|
|
1893
1814
|
// src/PoliticianCard.jsx
|
|
1894
|
-
var
|
|
1815
|
+
var import_react9 = __toESM(require("react"));
|
|
1895
1816
|
function PoliticianCard({
|
|
1896
1817
|
id,
|
|
1897
1818
|
imageSrc,
|
|
@@ -2043,7 +1964,7 @@ function PoliticianCard({
|
|
|
2043
1964
|
textTransform: "uppercase"
|
|
2044
1965
|
}
|
|
2045
1966
|
};
|
|
2046
|
-
const CompassIcon2 = () => /* @__PURE__ */
|
|
1967
|
+
const CompassIcon2 = () => /* @__PURE__ */ import_react9.default.createElement(
|
|
2047
1968
|
"svg",
|
|
2048
1969
|
{
|
|
2049
1970
|
style: styles2.compassIcon,
|
|
@@ -2051,7 +1972,7 @@ function PoliticianCard({
|
|
|
2051
1972
|
fill: "none",
|
|
2052
1973
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2053
1974
|
},
|
|
2054
|
-
/* @__PURE__ */
|
|
1975
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
2055
1976
|
"polygon",
|
|
2056
1977
|
{
|
|
2057
1978
|
points: "12,1 21.5,6.5 21.5,17.5 12,23 2.5,17.5 2.5,6.5",
|
|
@@ -2061,13 +1982,13 @@ function PoliticianCard({
|
|
|
2061
1982
|
strokeLinejoin: "round"
|
|
2062
1983
|
}
|
|
2063
1984
|
),
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ import_react9.default.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "1", stroke: "currentColor", strokeWidth: "1" }),
|
|
1986
|
+
/* @__PURE__ */ import_react9.default.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
1987
|
+
/* @__PURE__ */ import_react9.default.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
1988
|
+
/* @__PURE__ */ import_react9.default.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "23", stroke: "currentColor", strokeWidth: "1" }),
|
|
1989
|
+
/* @__PURE__ */ import_react9.default.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
1990
|
+
/* @__PURE__ */ import_react9.default.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
1991
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
2071
1992
|
"polygon",
|
|
2072
1993
|
{
|
|
2073
1994
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -2075,7 +1996,7 @@ function PoliticianCard({
|
|
|
2075
1996
|
opacity: "0.35"
|
|
2076
1997
|
}
|
|
2077
1998
|
),
|
|
2078
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
2079
2000
|
"polygon",
|
|
2080
2001
|
{
|
|
2081
2002
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -2086,8 +2007,8 @@ function PoliticianCard({
|
|
|
2086
2007
|
}
|
|
2087
2008
|
)
|
|
2088
2009
|
);
|
|
2089
|
-
const [imgError, setImgError] = (0,
|
|
2090
|
-
(0,
|
|
2010
|
+
const [imgError, setImgError] = (0, import_react9.useState)(false);
|
|
2011
|
+
(0, import_react9.useEffect)(() => {
|
|
2091
2012
|
setImgError(false);
|
|
2092
2013
|
}, [imageSrc]);
|
|
2093
2014
|
const getInitials = (n) => {
|
|
@@ -2096,7 +2017,7 @@ function PoliticianCard({
|
|
|
2096
2017
|
const initials = parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_a = parts[0]) == null ? void 0 : _a[0]) || "?";
|
|
2097
2018
|
return initials.toUpperCase();
|
|
2098
2019
|
};
|
|
2099
|
-
return /* @__PURE__ */
|
|
2020
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
2100
2021
|
"div",
|
|
2101
2022
|
{
|
|
2102
2023
|
style: styles2.card,
|
|
@@ -2121,8 +2042,8 @@ function PoliticianCard({
|
|
|
2121
2042
|
}
|
|
2122
2043
|
}
|
|
2123
2044
|
},
|
|
2124
|
-
badge && /* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2045
|
+
badge && /* @__PURE__ */ import_react9.default.createElement("span", { style: styles2.badge }, badge),
|
|
2046
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { style: styles2.imageWrapper }, imageSrc && !imgError ? /* @__PURE__ */ import_react9.default.createElement(
|
|
2126
2047
|
"img",
|
|
2127
2048
|
{
|
|
2128
2049
|
src: imageSrc,
|
|
@@ -2130,9 +2051,9 @@ function PoliticianCard({
|
|
|
2130
2051
|
style: styles2.image,
|
|
2131
2052
|
onError: () => setImgError(true)
|
|
2132
2053
|
}
|
|
2133
|
-
) : /* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
onCompassClick && /* @__PURE__ */
|
|
2054
|
+
) : /* @__PURE__ */ import_react9.default.createElement("div", { style: styles2.imagePlaceholder }, getInitials(name))),
|
|
2055
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { style: styles2.content }, /* @__PURE__ */ import_react9.default.createElement("h3", { style: styles2.name }, name), /* @__PURE__ */ import_react9.default.createElement("p", { style: styles2.title }, title), subtitle && /* @__PURE__ */ import_react9.default.createElement("p", { style: styles2.subtitle }, subtitle), footer && /* @__PURE__ */ import_react9.default.createElement("div", { style: { marginTop: "auto", marginLeft: "-5px" } }, footer)),
|
|
2056
|
+
onCompassClick && /* @__PURE__ */ import_react9.default.createElement(
|
|
2136
2057
|
"button",
|
|
2137
2058
|
{
|
|
2138
2059
|
type: "button",
|
|
@@ -2147,16 +2068,16 @@ function PoliticianCard({
|
|
|
2147
2068
|
},
|
|
2148
2069
|
"aria-label": `View ${name}'s compass`
|
|
2149
2070
|
},
|
|
2150
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ import_react9.default.createElement(CompassIcon2, null)
|
|
2151
2072
|
)
|
|
2152
2073
|
);
|
|
2153
2074
|
}
|
|
2154
2075
|
|
|
2155
2076
|
// src/CompassCardHorizontal.jsx
|
|
2156
|
-
var
|
|
2077
|
+
var import_react15 = __toESM(require("react"));
|
|
2157
2078
|
|
|
2158
2079
|
// src/PlaceholderRadar.jsx
|
|
2159
|
-
var
|
|
2080
|
+
var import_react10 = __toESM(require("react"));
|
|
2160
2081
|
function PlaceholderRadar({ size = 250, name = "" }) {
|
|
2161
2082
|
const cx = size / 2;
|
|
2162
2083
|
const cy = size / 2;
|
|
@@ -2169,7 +2090,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2169
2090
|
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
2170
2091
|
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
2171
2092
|
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
2172
|
-
return /* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
2173
2094
|
"svg",
|
|
2174
2095
|
{
|
|
2175
2096
|
width: size,
|
|
@@ -2183,7 +2104,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2183
2104
|
flexShrink: 0
|
|
2184
2105
|
}
|
|
2185
2106
|
},
|
|
2186
|
-
vertices.map(([x, y], i) => /* @__PURE__ */
|
|
2107
|
+
vertices.map(([x, y], i) => /* @__PURE__ */ import_react10.default.createElement(
|
|
2187
2108
|
"line",
|
|
2188
2109
|
{
|
|
2189
2110
|
key: i,
|
|
@@ -2197,7 +2118,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2197
2118
|
opacity: "0.6"
|
|
2198
2119
|
}
|
|
2199
2120
|
)),
|
|
2200
|
-
/* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
2201
2122
|
"polygon",
|
|
2202
2123
|
{
|
|
2203
2124
|
points: innerPts,
|
|
@@ -2208,7 +2129,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2208
2129
|
opacity: "0.5"
|
|
2209
2130
|
}
|
|
2210
2131
|
),
|
|
2211
|
-
/* @__PURE__ */
|
|
2132
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
2212
2133
|
"polygon",
|
|
2213
2134
|
{
|
|
2214
2135
|
points: midPts,
|
|
@@ -2219,7 +2140,7 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2219
2140
|
opacity: "0.6"
|
|
2220
2141
|
}
|
|
2221
2142
|
),
|
|
2222
|
-
/* @__PURE__ */
|
|
2143
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
2223
2144
|
"polygon",
|
|
2224
2145
|
{
|
|
2225
2146
|
points: outerPts,
|
|
@@ -2233,16 +2154,16 @@ function PlaceholderRadar({ size = 250, name = "" }) {
|
|
|
2233
2154
|
}
|
|
2234
2155
|
|
|
2235
2156
|
// src/CompassCardHorizontalMeta.jsx
|
|
2236
|
-
var
|
|
2157
|
+
var import_react14 = __toESM(require("react"));
|
|
2237
2158
|
|
|
2238
2159
|
// src/IconOverlay.jsx
|
|
2239
|
-
var
|
|
2240
|
-
var
|
|
2160
|
+
var import_react12 = __toESM(require("react"));
|
|
2161
|
+
var import_react13 = require("@floating-ui/react");
|
|
2241
2162
|
|
|
2242
2163
|
// src/icons.js
|
|
2243
|
-
var
|
|
2164
|
+
var import_react11 = __toESM(require("react"));
|
|
2244
2165
|
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
2245
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
2246
2167
|
"svg",
|
|
2247
2168
|
{
|
|
2248
2169
|
width: size,
|
|
@@ -2255,13 +2176,13 @@ function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
|
2255
2176
|
strokeLinejoin: "round",
|
|
2256
2177
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2257
2178
|
},
|
|
2258
|
-
/* @__PURE__ */
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
2180
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
2181
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "M22 19H2" })
|
|
2261
2182
|
);
|
|
2262
2183
|
}
|
|
2263
2184
|
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
2264
|
-
return /* @__PURE__ */
|
|
2185
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
2265
2186
|
"svg",
|
|
2266
2187
|
{
|
|
2267
2188
|
width: size,
|
|
@@ -2274,27 +2195,27 @@ function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
|
2274
2195
|
strokeLinejoin: "round",
|
|
2275
2196
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2276
2197
|
},
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
2198
|
+
/* @__PURE__ */ import_react11.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2199
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" })
|
|
2279
2200
|
);
|
|
2280
2201
|
}
|
|
2281
2202
|
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
2282
2203
|
let paths;
|
|
2283
2204
|
switch (branch) {
|
|
2284
2205
|
case "executive":
|
|
2285
|
-
paths = /* @__PURE__ */
|
|
2206
|
+
paths = /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ import_react11.default.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ import_react11.default.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
2286
2207
|
break;
|
|
2287
2208
|
case "legislative":
|
|
2288
|
-
paths = /* @__PURE__ */
|
|
2209
|
+
paths = /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("path", { d: "M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M15 12h-5" }));
|
|
2289
2210
|
break;
|
|
2290
2211
|
case "judicial":
|
|
2291
|
-
paths = /* @__PURE__ */
|
|
2212
|
+
paths = /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M8 21h8" }));
|
|
2292
2213
|
break;
|
|
2293
2214
|
default:
|
|
2294
|
-
paths = /* @__PURE__ */
|
|
2215
|
+
paths = /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ import_react11.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" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ import_react11.default.createElement("path", { d: "M6 18v-7" }));
|
|
2295
2216
|
break;
|
|
2296
2217
|
}
|
|
2297
|
-
return /* @__PURE__ */
|
|
2218
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
2298
2219
|
"svg",
|
|
2299
2220
|
{
|
|
2300
2221
|
width: size,
|
|
@@ -2313,24 +2234,24 @@ function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
|
2313
2234
|
|
|
2314
2235
|
// src/IconOverlay.jsx
|
|
2315
2236
|
function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps = {}, onClick }) {
|
|
2316
|
-
const [isOpen, setIsOpen] = (0,
|
|
2317
|
-
const { refs, floatingStyles, context } = (0,
|
|
2237
|
+
const [isOpen, setIsOpen] = (0, import_react12.useState)(false);
|
|
2238
|
+
const { refs, floatingStyles, context } = (0, import_react13.useFloating)({
|
|
2318
2239
|
open: isOpen,
|
|
2319
2240
|
onOpenChange: setIsOpen,
|
|
2320
|
-
middleware: [(0,
|
|
2321
|
-
whileElementsMounted:
|
|
2241
|
+
middleware: [(0, import_react13.offset)(8), (0, import_react13.flip)(), (0, import_react13.shift)({ padding: 4 })],
|
|
2242
|
+
whileElementsMounted: import_react13.autoUpdate
|
|
2322
2243
|
});
|
|
2323
|
-
const hover = (0,
|
|
2324
|
-
const focus2 = (0,
|
|
2325
|
-
const dismiss = (0,
|
|
2326
|
-
const role = (0,
|
|
2327
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
2244
|
+
const hover = (0, import_react13.useHover)(context);
|
|
2245
|
+
const focus2 = (0, import_react13.useFocus)(context);
|
|
2246
|
+
const dismiss = (0, import_react13.useDismiss)(context);
|
|
2247
|
+
const role = (0, import_react13.useRole)(context, { role: "tooltip" });
|
|
2248
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react13.useInteractions)([
|
|
2328
2249
|
hover,
|
|
2329
2250
|
focus2,
|
|
2330
2251
|
dismiss,
|
|
2331
2252
|
role
|
|
2332
2253
|
]);
|
|
2333
|
-
return /* @__PURE__ */
|
|
2254
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(
|
|
2334
2255
|
"span",
|
|
2335
2256
|
{
|
|
2336
2257
|
ref: refs.setReference,
|
|
@@ -2343,8 +2264,8 @@ function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps
|
|
|
2343
2264
|
onClick(e);
|
|
2344
2265
|
} : void 0
|
|
2345
2266
|
},
|
|
2346
|
-
/* @__PURE__ */
|
|
2347
|
-
), isOpen && /* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ import_react12.default.createElement(IconComponent, { size, color, ...extraProps })
|
|
2268
|
+
), isOpen && /* @__PURE__ */ import_react12.default.createElement(import_react13.FloatingPortal, null, /* @__PURE__ */ import_react12.default.createElement(
|
|
2348
2269
|
"div",
|
|
2349
2270
|
{
|
|
2350
2271
|
ref: refs.setFloating,
|
|
@@ -2368,7 +2289,7 @@ function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps
|
|
|
2368
2289
|
function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
2369
2290
|
if (!ballot && !hasStances && !branch) return null;
|
|
2370
2291
|
const ballotTooltip = ballot ? `This seat is on your ballot \u2014 ${ballot.electionLabel}: ${new Date(ballot.electionDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })}` : null;
|
|
2371
|
-
return /* @__PURE__ */
|
|
2292
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
2372
2293
|
"div",
|
|
2373
2294
|
{
|
|
2374
2295
|
style: {
|
|
@@ -2381,7 +2302,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2381
2302
|
// offset icon wrapper padding so icons align flush-left with text
|
|
2382
2303
|
}
|
|
2383
2304
|
},
|
|
2384
|
-
ballot && /* @__PURE__ */
|
|
2305
|
+
ballot && /* @__PURE__ */ import_react12.default.createElement(
|
|
2385
2306
|
IconWithTooltip,
|
|
2386
2307
|
{
|
|
2387
2308
|
IconComponent: BallotIcon,
|
|
@@ -2390,7 +2311,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2390
2311
|
size: 14
|
|
2391
2312
|
}
|
|
2392
2313
|
),
|
|
2393
|
-
hasStances && /* @__PURE__ */
|
|
2314
|
+
hasStances && /* @__PURE__ */ import_react12.default.createElement(
|
|
2394
2315
|
IconWithTooltip,
|
|
2395
2316
|
{
|
|
2396
2317
|
IconComponent: CompassIcon,
|
|
@@ -2400,7 +2321,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2400
2321
|
onClick: onCompassClick
|
|
2401
2322
|
}
|
|
2402
2323
|
),
|
|
2403
|
-
branch && /* @__PURE__ */
|
|
2324
|
+
branch && /* @__PURE__ */ import_react12.default.createElement(
|
|
2404
2325
|
IconWithTooltip,
|
|
2405
2326
|
{
|
|
2406
2327
|
IconComponent: BranchIcon,
|
|
@@ -2420,20 +2341,20 @@ function CompassCardHorizontalMeta({
|
|
|
2420
2341
|
userAnswers
|
|
2421
2342
|
}) {
|
|
2422
2343
|
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2423
|
-
return /* @__PURE__ */
|
|
2344
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2424
2345
|
flex: 1,
|
|
2425
2346
|
minWidth: 0,
|
|
2426
2347
|
display: "flex",
|
|
2427
2348
|
flexDirection: "column",
|
|
2428
2349
|
gap: spacing[1]
|
|
2429
|
-
} }, /* @__PURE__ */
|
|
2350
|
+
} }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2430
2351
|
fontFamily: fonts.primary,
|
|
2431
2352
|
fontSize: fontSizes.lg,
|
|
2432
2353
|
fontWeight: fontWeights.semibold,
|
|
2433
2354
|
lineHeight: 1.4,
|
|
2434
2355
|
color: colors.evMutedBlue,
|
|
2435
2356
|
margin: 0
|
|
2436
|
-
} }, politician.full_name), /* @__PURE__ */
|
|
2357
|
+
} }, politician.full_name), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2437
2358
|
fontFamily: fonts.primary,
|
|
2438
2359
|
fontSize: fontSizes.sm,
|
|
2439
2360
|
fontWeight: fontWeights.semibold,
|
|
@@ -2444,7 +2365,7 @@ function CompassCardHorizontalMeta({
|
|
|
2444
2365
|
display: "-webkit-box",
|
|
2445
2366
|
WebkitLineClamp: 2,
|
|
2446
2367
|
WebkitBoxOrient: "vertical"
|
|
2447
|
-
} }, titleText || ""), politician.district_label && /* @__PURE__ */
|
|
2368
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2448
2369
|
fontFamily: fonts.primary,
|
|
2449
2370
|
fontSize: fontSizes.sm,
|
|
2450
2371
|
fontWeight: fontWeights.regular,
|
|
@@ -2454,7 +2375,7 @@ function CompassCardHorizontalMeta({
|
|
|
2454
2375
|
overflow: "hidden",
|
|
2455
2376
|
textOverflow: "ellipsis",
|
|
2456
2377
|
whiteSpace: "nowrap"
|
|
2457
|
-
} }, politician.district_label), /* @__PURE__ */
|
|
2378
|
+
} }, politician.district_label), /* @__PURE__ */ import_react14.default.createElement(
|
|
2458
2379
|
IconOverlay,
|
|
2459
2380
|
{
|
|
2460
2381
|
ballot: politician.ballot || null,
|
|
@@ -2503,11 +2424,11 @@ function CompassCardHorizontal({
|
|
|
2503
2424
|
onClick
|
|
2504
2425
|
}) {
|
|
2505
2426
|
var _a;
|
|
2506
|
-
const [hovered, setHovered] = (0,
|
|
2507
|
-
const [focused, setFocused] = (0,
|
|
2508
|
-
const [imgError, setImgError] = (0,
|
|
2509
|
-
const [emptyCtaHovered, setEmptyCtaHovered] = (0,
|
|
2510
|
-
(0,
|
|
2427
|
+
const [hovered, setHovered] = (0, import_react15.useState)(false);
|
|
2428
|
+
const [focused, setFocused] = (0, import_react15.useState)(false);
|
|
2429
|
+
const [imgError, setImgError] = (0, import_react15.useState)(false);
|
|
2430
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react15.useState)(false);
|
|
2431
|
+
(0, import_react15.useEffect)(() => {
|
|
2511
2432
|
setImgError(false);
|
|
2512
2433
|
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2513
2434
|
const cardStyle = {
|
|
@@ -2531,7 +2452,7 @@ function CompassCardHorizontal({
|
|
|
2531
2452
|
function renderCompass() {
|
|
2532
2453
|
var _a2, _b, _c;
|
|
2533
2454
|
if (!userAnswers || userAnswers.length === 0) {
|
|
2534
|
-
return /* @__PURE__ */
|
|
2455
|
+
return /* @__PURE__ */ import_react15.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2535
2456
|
}
|
|
2536
2457
|
let topics = [];
|
|
2537
2458
|
let data = {};
|
|
@@ -2567,12 +2488,12 @@ function CompassCardHorizontal({
|
|
|
2567
2488
|
}, {}) : politician.stances;
|
|
2568
2489
|
}
|
|
2569
2490
|
if (topics.length === 0) {
|
|
2570
|
-
return /* @__PURE__ */
|
|
2491
|
+
return /* @__PURE__ */ import_react15.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2571
2492
|
}
|
|
2572
2493
|
} catch (err) {
|
|
2573
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ import_react15.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2574
2495
|
}
|
|
2575
|
-
return /* @__PURE__ */
|
|
2496
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
2576
2497
|
RadarChartCore,
|
|
2577
2498
|
{
|
|
2578
2499
|
topics,
|
|
@@ -2594,7 +2515,7 @@ function CompassCardHorizontal({
|
|
|
2594
2515
|
var _a2, _b, _c;
|
|
2595
2516
|
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;
|
|
2596
2517
|
if (imageSrc && !imgError) {
|
|
2597
|
-
return /* @__PURE__ */
|
|
2518
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
2598
2519
|
"img",
|
|
2599
2520
|
{
|
|
2600
2521
|
src: imageSrc,
|
|
@@ -2612,7 +2533,7 @@ function CompassCardHorizontal({
|
|
|
2612
2533
|
}
|
|
2613
2534
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2614
2535
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2615
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
|
2616
2537
|
width: "100%",
|
|
2617
2538
|
height: "100%",
|
|
2618
2539
|
backgroundColor: colors.evMutedBlue,
|
|
@@ -2626,7 +2547,7 @@ function CompassCardHorizontal({
|
|
|
2626
2547
|
} }, initials);
|
|
2627
2548
|
}
|
|
2628
2549
|
function renderEmptyVariant() {
|
|
2629
|
-
return /* @__PURE__ */
|
|
2550
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
|
2630
2551
|
width: "100%",
|
|
2631
2552
|
height: "100%",
|
|
2632
2553
|
display: "flex",
|
|
@@ -2637,14 +2558,14 @@ function CompassCardHorizontal({
|
|
|
2637
2558
|
padding: "12px 14px",
|
|
2638
2559
|
boxSizing: "border-box",
|
|
2639
2560
|
backgroundColor: colorScales.teal["050"]
|
|
2640
|
-
} }, /* @__PURE__ */
|
|
2561
|
+
} }, /* @__PURE__ */ import_react15.default.createElement(PlaceholderRadar, { size: 140, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react15.default.createElement("p", { style: {
|
|
2641
2562
|
margin: 0,
|
|
2642
2563
|
fontSize: fontSizes.xs,
|
|
2643
2564
|
color: colors.textMuted,
|
|
2644
2565
|
textAlign: "center",
|
|
2645
2566
|
lineHeight: 1.4,
|
|
2646
2567
|
fontFamily: fonts.primary
|
|
2647
|
-
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */
|
|
2568
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react15.default.createElement(
|
|
2648
2569
|
"button",
|
|
2649
2570
|
{
|
|
2650
2571
|
type: "button",
|
|
@@ -2672,7 +2593,7 @@ function CompassCardHorizontal({
|
|
|
2672
2593
|
));
|
|
2673
2594
|
}
|
|
2674
2595
|
function renderUnavailablePlate(message = "Compass currently unavailable for this role.") {
|
|
2675
|
-
return /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
|
2676
2597
|
width: "100%",
|
|
2677
2598
|
height: "100%",
|
|
2678
2599
|
backgroundColor: colorScales.teal["050"],
|
|
@@ -2681,7 +2602,7 @@ function CompassCardHorizontal({
|
|
|
2681
2602
|
justifyContent: "center",
|
|
2682
2603
|
padding: spacing[4],
|
|
2683
2604
|
boxSizing: "border-box"
|
|
2684
|
-
} }, /* @__PURE__ */
|
|
2605
|
+
} }, /* @__PURE__ */ import_react15.default.createElement("p", { style: {
|
|
2685
2606
|
fontSize: fontSizes.sm,
|
|
2686
2607
|
fontWeight: fontWeights.semibold,
|
|
2687
2608
|
lineHeight: 1.4,
|
|
@@ -2700,7 +2621,7 @@ function CompassCardHorizontal({
|
|
|
2700
2621
|
const name = (politician == null ? void 0 : politician.full_name) || "this official";
|
|
2701
2622
|
return renderUnavailablePlate(`No compass stances on file for ${name} yet.`);
|
|
2702
2623
|
}
|
|
2703
|
-
return /* @__PURE__ */
|
|
2624
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
|
2704
2625
|
width: "100%",
|
|
2705
2626
|
height: "100%",
|
|
2706
2627
|
display: "flex",
|
|
@@ -2710,7 +2631,7 @@ function CompassCardHorizontal({
|
|
|
2710
2631
|
boxSizing: "border-box"
|
|
2711
2632
|
} }, renderCompass());
|
|
2712
2633
|
}
|
|
2713
|
-
return /* @__PURE__ */
|
|
2634
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
2714
2635
|
"div",
|
|
2715
2636
|
{
|
|
2716
2637
|
role: "article",
|
|
@@ -2729,7 +2650,7 @@ function CompassCardHorizontal({
|
|
|
2729
2650
|
onFocus: () => setFocused(true),
|
|
2730
2651
|
onBlur: () => setFocused(false)
|
|
2731
2652
|
},
|
|
2732
|
-
/* @__PURE__ */
|
|
2653
|
+
/* @__PURE__ */ import_react15.default.createElement("div", { style: slotStyle }, renderSlotContent(), surface === "elections" && politician.running_unopposed && /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
|
2733
2654
|
position: "absolute",
|
|
2734
2655
|
bottom: "15px",
|
|
2735
2656
|
left: 0,
|
|
@@ -2744,7 +2665,7 @@ function CompassCardHorizontal({
|
|
|
2744
2665
|
padding: "6px 0",
|
|
2745
2666
|
pointerEvents: "none"
|
|
2746
2667
|
} }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed")),
|
|
2747
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ import_react15.default.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ import_react15.default.createElement(
|
|
2748
2669
|
CompassCardHorizontalMeta,
|
|
2749
2670
|
{
|
|
2750
2671
|
politician,
|
|
@@ -2756,7 +2677,7 @@ function CompassCardHorizontal({
|
|
|
2756
2677
|
}
|
|
2757
2678
|
|
|
2758
2679
|
// src/CompassCardVertical.jsx
|
|
2759
|
-
var
|
|
2680
|
+
var import_react16 = __toESM(require("react"));
|
|
2760
2681
|
var RADAR_SIZE2 = 400;
|
|
2761
2682
|
function CompassCardVertical({
|
|
2762
2683
|
politician,
|
|
@@ -2770,11 +2691,11 @@ function CompassCardVertical({
|
|
|
2770
2691
|
onClick
|
|
2771
2692
|
}) {
|
|
2772
2693
|
var _a;
|
|
2773
|
-
const [hovered, setHovered] = (0,
|
|
2774
|
-
const [focused, setFocused] = (0,
|
|
2775
|
-
const [imgError, setImgError] = (0,
|
|
2776
|
-
const [emptyCtaHovered, setEmptyCtaHovered] = (0,
|
|
2777
|
-
(0,
|
|
2694
|
+
const [hovered, setHovered] = (0, import_react16.useState)(false);
|
|
2695
|
+
const [focused, setFocused] = (0, import_react16.useState)(false);
|
|
2696
|
+
const [imgError, setImgError] = (0, import_react16.useState)(false);
|
|
2697
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react16.useState)(false);
|
|
2698
|
+
(0, import_react16.useEffect)(() => {
|
|
2778
2699
|
setImgError(false);
|
|
2779
2700
|
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2780
2701
|
const cardStyle = {
|
|
@@ -2797,7 +2718,7 @@ function CompassCardVertical({
|
|
|
2797
2718
|
function renderCompass() {
|
|
2798
2719
|
var _a2, _b, _c;
|
|
2799
2720
|
if (!userAnswers || userAnswers.length === 0) {
|
|
2800
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2801
2722
|
}
|
|
2802
2723
|
let topics = [];
|
|
2803
2724
|
let data = {};
|
|
@@ -2833,17 +2754,17 @@ function CompassCardVertical({
|
|
|
2833
2754
|
}, {}) : politician.stances;
|
|
2834
2755
|
}
|
|
2835
2756
|
if (topics.length === 0) {
|
|
2836
|
-
return /* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2837
2758
|
}
|
|
2838
2759
|
} catch {
|
|
2839
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2840
2761
|
}
|
|
2841
2762
|
const unansweredSpokes = {};
|
|
2842
2763
|
for (const t of topics) {
|
|
2843
2764
|
const v = compareData[t.short_title];
|
|
2844
2765
|
if (!v || Number(v) === 0) unansweredSpokes[t.short_title] = true;
|
|
2845
2766
|
}
|
|
2846
|
-
return /* @__PURE__ */
|
|
2767
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: { width: RADAR_SIZE2 + 240, maxWidth: "100%", flexShrink: 0 } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2847
2768
|
RadarChartCore,
|
|
2848
2769
|
{
|
|
2849
2770
|
topics,
|
|
@@ -2878,7 +2799,7 @@ function CompassCardVertical({
|
|
|
2878
2799
|
justifyContent: "center"
|
|
2879
2800
|
};
|
|
2880
2801
|
if (imageSrc && !imgError) {
|
|
2881
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2882
2803
|
"img",
|
|
2883
2804
|
{
|
|
2884
2805
|
src: imageSrc,
|
|
@@ -2896,7 +2817,7 @@ function CompassCardVertical({
|
|
|
2896
2817
|
}
|
|
2897
2818
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2898
2819
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2899
|
-
return /* @__PURE__ */
|
|
2820
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react16.default.createElement("span", { style: {
|
|
2900
2821
|
color: colors.textWhite,
|
|
2901
2822
|
fontFamily: fonts.primary,
|
|
2902
2823
|
fontWeight: fontWeights.bold,
|
|
@@ -2907,7 +2828,7 @@ function CompassCardVertical({
|
|
|
2907
2828
|
var _a2, _b, _c;
|
|
2908
2829
|
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;
|
|
2909
2830
|
if (imageSrc && !imgError) {
|
|
2910
|
-
return /* @__PURE__ */
|
|
2831
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2911
2832
|
"img",
|
|
2912
2833
|
{
|
|
2913
2834
|
src: imageSrc,
|
|
@@ -2926,7 +2847,7 @@ function CompassCardVertical({
|
|
|
2926
2847
|
}
|
|
2927
2848
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2928
2849
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2929
|
-
return /* @__PURE__ */
|
|
2850
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2930
2851
|
width: RADAR_SIZE2,
|
|
2931
2852
|
height: RADAR_SIZE2,
|
|
2932
2853
|
backgroundColor: colors.evMutedBlue,
|
|
@@ -2941,7 +2862,7 @@ function CompassCardVertical({
|
|
|
2941
2862
|
} }, initials);
|
|
2942
2863
|
}
|
|
2943
2864
|
function renderEmptyVariant() {
|
|
2944
|
-
return /* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2945
2866
|
width: "100%",
|
|
2946
2867
|
height: "100%",
|
|
2947
2868
|
flex: 1,
|
|
@@ -2954,14 +2875,14 @@ function CompassCardVertical({
|
|
|
2954
2875
|
boxSizing: "border-box",
|
|
2955
2876
|
backgroundColor: colorScales.teal["050"],
|
|
2956
2877
|
borderRadius: borderRadius.md
|
|
2957
|
-
} }, /* @__PURE__ */
|
|
2878
|
+
} }, /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: 220, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
2958
2879
|
margin: 0,
|
|
2959
2880
|
fontSize: fontSizes.sm,
|
|
2960
2881
|
color: colors.textMuted,
|
|
2961
2882
|
textAlign: "center",
|
|
2962
2883
|
lineHeight: 1.4,
|
|
2963
2884
|
fontFamily: fonts.primary
|
|
2964
|
-
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */
|
|
2885
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react16.default.createElement(
|
|
2965
2886
|
"button",
|
|
2966
2887
|
{
|
|
2967
2888
|
type: "button",
|
|
@@ -2987,7 +2908,7 @@ function CompassCardVertical({
|
|
|
2987
2908
|
));
|
|
2988
2909
|
}
|
|
2989
2910
|
function renderUnavailablePlate(message) {
|
|
2990
|
-
return /* @__PURE__ */
|
|
2911
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2991
2912
|
width: "100%",
|
|
2992
2913
|
height: "100%",
|
|
2993
2914
|
flex: 1,
|
|
@@ -2998,7 +2919,7 @@ function CompassCardVertical({
|
|
|
2998
2919
|
justifyContent: "center",
|
|
2999
2920
|
padding: spacing[6],
|
|
3000
2921
|
boxSizing: "border-box"
|
|
3001
|
-
} }, /* @__PURE__ */
|
|
2922
|
+
} }, /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
3002
2923
|
fontSize: fontSizes.base,
|
|
3003
2924
|
fontWeight: fontWeights.semibold,
|
|
3004
2925
|
lineHeight: 1.4,
|
|
@@ -3019,7 +2940,7 @@ function CompassCardVertical({
|
|
|
3019
2940
|
}
|
|
3020
2941
|
return renderCompass();
|
|
3021
2942
|
}
|
|
3022
|
-
return /* @__PURE__ */
|
|
2943
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
3023
2944
|
"div",
|
|
3024
2945
|
{
|
|
3025
2946
|
role: "article",
|
|
@@ -3038,21 +2959,21 @@ function CompassCardVertical({
|
|
|
3038
2959
|
onFocus: () => setFocused(true),
|
|
3039
2960
|
onBlur: () => setFocused(false)
|
|
3040
2961
|
},
|
|
3041
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ import_react16.default.createElement("div", { style: { padding: spacing[4], paddingBottom: spacing[3], display: "flex", alignItems: "stretch", gap: spacing[3], flexShrink: 0 } }, renderAvatar(), /* @__PURE__ */ import_react16.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1], minWidth: 0, flex: 1 } }, /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
3042
2963
|
fontFamily: fonts.primary,
|
|
3043
2964
|
fontSize: fontSizes.xl,
|
|
3044
2965
|
fontWeight: fontWeights.semibold,
|
|
3045
2966
|
lineHeight: 1.3,
|
|
3046
2967
|
color: colors.evMutedBlue,
|
|
3047
2968
|
margin: 0
|
|
3048
|
-
} }, politician.full_name), /* @__PURE__ */
|
|
2969
|
+
} }, politician.full_name), /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
3049
2970
|
fontFamily: fonts.primary,
|
|
3050
2971
|
fontSize: fontSizes.sm,
|
|
3051
2972
|
fontWeight: fontWeights.semibold,
|
|
3052
2973
|
lineHeight: 1.4,
|
|
3053
2974
|
color: colors.textSecondary,
|
|
3054
2975
|
margin: 0
|
|
3055
|
-
} }, titleText || ""), politician.district_label && /* @__PURE__ */
|
|
2976
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
3056
2977
|
fontFamily: fonts.primary,
|
|
3057
2978
|
fontSize: fontSizes.sm,
|
|
3058
2979
|
fontWeight: fontWeights.regular,
|
|
@@ -3062,7 +2983,7 @@ function CompassCardVertical({
|
|
|
3062
2983
|
overflow: "hidden",
|
|
3063
2984
|
textOverflow: "ellipsis",
|
|
3064
2985
|
whiteSpace: "nowrap"
|
|
3065
|
-
} }, politician.district_label), /* @__PURE__ */
|
|
2986
|
+
} }, politician.district_label), /* @__PURE__ */ import_react16.default.createElement("div", { style: { marginTop: "auto" } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
3066
2987
|
IconOverlay,
|
|
3067
2988
|
{
|
|
3068
2989
|
ballot: politician.ballot || null,
|
|
@@ -3070,7 +2991,7 @@ function CompassCardVertical({
|
|
|
3070
2991
|
branch: politician.branch || null
|
|
3071
2992
|
}
|
|
3072
2993
|
)))),
|
|
3073
|
-
surface === "elections" && politician.withdrawn && /* @__PURE__ */
|
|
2994
|
+
surface === "elections" && politician.withdrawn && /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
3074
2995
|
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
3075
2996
|
backgroundColor: "rgba(120,0,0,0.85)",
|
|
3076
2997
|
color: "#fff",
|
|
@@ -3082,7 +3003,7 @@ function CompassCardVertical({
|
|
|
3082
3003
|
padding: "6px 0",
|
|
3083
3004
|
borderRadius: borderRadius.sm
|
|
3084
3005
|
} }, "Withdrawn"),
|
|
3085
|
-
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */
|
|
3006
|
+
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
3086
3007
|
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
3087
3008
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
3088
3009
|
color: "#fff",
|
|
@@ -3094,7 +3015,7 @@ function CompassCardVertical({
|
|
|
3094
3015
|
padding: "6px 0",
|
|
3095
3016
|
borderRadius: borderRadius.sm
|
|
3096
3017
|
} }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed"),
|
|
3097
|
-
/* @__PURE__ */
|
|
3018
|
+
/* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
3098
3019
|
flex: 1,
|
|
3099
3020
|
padding: spacing[4],
|
|
3100
3021
|
paddingTop: 0,
|
|
@@ -3108,7 +3029,7 @@ function CompassCardVertical({
|
|
|
3108
3029
|
}
|
|
3109
3030
|
|
|
3110
3031
|
// src/CompassKey.jsx
|
|
3111
|
-
var
|
|
3032
|
+
var import_react17 = __toESM(require("react"));
|
|
3112
3033
|
|
|
3113
3034
|
// src/evContext.js
|
|
3114
3035
|
var DEFAULT_BROKER_URL = "https://ev-context.empowered.vote/";
|
|
@@ -3353,9 +3274,9 @@ var evContext = {
|
|
|
3353
3274
|
|
|
3354
3275
|
// src/CompassKey.jsx
|
|
3355
3276
|
function CompassKey({ compact = false } = {}) {
|
|
3356
|
-
const [dismissed, setDismissed] = (0,
|
|
3357
|
-
const [loaded, setLoaded] = (0,
|
|
3358
|
-
(0,
|
|
3277
|
+
const [dismissed, setDismissed] = (0, import_react17.useState)(false);
|
|
3278
|
+
const [loaded, setLoaded] = (0, import_react17.useState)(false);
|
|
3279
|
+
(0, import_react17.useEffect)(() => {
|
|
3359
3280
|
let cancelled = false;
|
|
3360
3281
|
evContext.get().then((shared) => {
|
|
3361
3282
|
if (cancelled) return;
|
|
@@ -3385,7 +3306,7 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3385
3306
|
persistDismissed(false);
|
|
3386
3307
|
}
|
|
3387
3308
|
if (!loaded) return null;
|
|
3388
|
-
const Swatch = ({ color, label, ring }) => /* @__PURE__ */
|
|
3309
|
+
const Swatch = ({ color, label, ring }) => /* @__PURE__ */ import_react17.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react17.default.createElement("span", { style: {
|
|
3389
3310
|
display: "inline-block",
|
|
3390
3311
|
width: 12,
|
|
3391
3312
|
height: 12,
|
|
@@ -3393,9 +3314,9 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3393
3314
|
background: color,
|
|
3394
3315
|
border: `2px solid ${ring || "#fff"}`,
|
|
3395
3316
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
3396
|
-
} }), /* @__PURE__ */
|
|
3317
|
+
} }), /* @__PURE__ */ import_react17.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
3397
3318
|
if (dismissed) {
|
|
3398
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
3399
3320
|
"button",
|
|
3400
3321
|
{
|
|
3401
3322
|
type: "button",
|
|
@@ -3416,11 +3337,11 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3416
3337
|
cursor: "pointer"
|
|
3417
3338
|
}
|
|
3418
3339
|
},
|
|
3419
|
-
/* @__PURE__ */
|
|
3340
|
+
/* @__PURE__ */ import_react17.default.createElement("span", { "aria-hidden": "true" }, "?"),
|
|
3420
3341
|
" Compass key"
|
|
3421
3342
|
);
|
|
3422
3343
|
}
|
|
3423
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
3424
3345
|
"div",
|
|
3425
3346
|
{
|
|
3426
3347
|
role: "region",
|
|
@@ -3439,17 +3360,17 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3439
3360
|
boxSizing: "border-box"
|
|
3440
3361
|
}
|
|
3441
3362
|
},
|
|
3442
|
-
!compact && /* @__PURE__ */
|
|
3363
|
+
!compact && /* @__PURE__ */ import_react17.default.createElement("span", { style: {
|
|
3443
3364
|
fontSize: fontSizes.xs,
|
|
3444
3365
|
fontWeight: fontWeights.semibold,
|
|
3445
3366
|
color: colors.textMuted,
|
|
3446
3367
|
textTransform: "uppercase",
|
|
3447
3368
|
letterSpacing: "0.5px"
|
|
3448
3369
|
} }, "Compass key"),
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
3452
|
-
/* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ import_react17.default.createElement(Swatch, { color: "#7C6B9E", label: "You" }),
|
|
3371
|
+
/* @__PURE__ */ import_react17.default.createElement(Swatch, { color: "#5A9A6E", label: "Politician" }),
|
|
3372
|
+
/* @__PURE__ */ import_react17.default.createElement(Swatch, { color: "#fed12e", label: "Match" }),
|
|
3373
|
+
/* @__PURE__ */ import_react17.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react17.default.createElement("span", { style: {
|
|
3453
3374
|
fontSize: fontSizes.xs,
|
|
3454
3375
|
fontWeight: fontWeights.semibold,
|
|
3455
3376
|
color: "#9ca3af",
|
|
@@ -3457,8 +3378,8 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3457
3378
|
textDecoration: "underline",
|
|
3458
3379
|
textDecorationStyle: "dashed",
|
|
3459
3380
|
textUnderlineOffset: "3px"
|
|
3460
|
-
} }, "Topic"), /* @__PURE__ */
|
|
3461
|
-
/* @__PURE__ */
|
|
3381
|
+
} }, "Topic"), /* @__PURE__ */ import_react17.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, "= no stance")),
|
|
3382
|
+
/* @__PURE__ */ import_react17.default.createElement(
|
|
3462
3383
|
"button",
|
|
3463
3384
|
{
|
|
3464
3385
|
type: "button",
|
|
@@ -3481,7 +3402,7 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3481
3402
|
}
|
|
3482
3403
|
|
|
3483
3404
|
// src/CategorySection.jsx
|
|
3484
|
-
var
|
|
3405
|
+
var import_react18 = __toESM(require("react"));
|
|
3485
3406
|
function CategorySection({
|
|
3486
3407
|
title,
|
|
3487
3408
|
infoTooltip,
|
|
@@ -3491,7 +3412,7 @@ function CategorySection({
|
|
|
3491
3412
|
tier
|
|
3492
3413
|
}) {
|
|
3493
3414
|
var _a, _b;
|
|
3494
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3415
|
+
const [showTooltip, setShowTooltip] = (0, import_react18.useState)(false);
|
|
3495
3416
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
3496
3417
|
const styles2 = {
|
|
3497
3418
|
section: {
|
|
@@ -3559,7 +3480,7 @@ function CategorySection({
|
|
|
3559
3480
|
gap: spacing[4]
|
|
3560
3481
|
}
|
|
3561
3482
|
};
|
|
3562
|
-
return /* @__PURE__ */
|
|
3483
|
+
return /* @__PURE__ */ import_react18.default.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ import_react18.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ import_react18.default.createElement(
|
|
3563
3484
|
"button",
|
|
3564
3485
|
{
|
|
3565
3486
|
type: "button",
|
|
@@ -3571,8 +3492,8 @@ function CategorySection({
|
|
|
3571
3492
|
"aria-label": `Info about ${title}`
|
|
3572
3493
|
},
|
|
3573
3494
|
"i",
|
|
3574
|
-
showTooltip && /* @__PURE__ */
|
|
3575
|
-
), websiteUrl && /* @__PURE__ */
|
|
3495
|
+
showTooltip && /* @__PURE__ */ import_react18.default.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
3496
|
+
), websiteUrl && /* @__PURE__ */ import_react18.default.createElement(
|
|
3576
3497
|
"a",
|
|
3577
3498
|
{
|
|
3578
3499
|
href: websiteUrl,
|
|
@@ -3581,7 +3502,7 @@ function CategorySection({
|
|
|
3581
3502
|
style: styles2.externalLink,
|
|
3582
3503
|
"aria-label": `Visit official website for ${title}`
|
|
3583
3504
|
},
|
|
3584
|
-
/* @__PURE__ */
|
|
3505
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
3585
3506
|
"svg",
|
|
3586
3507
|
{
|
|
3587
3508
|
viewBox: "0 0 24 24",
|
|
@@ -3589,7 +3510,7 @@ function CategorySection({
|
|
|
3589
3510
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3590
3511
|
style: { width: "14px", height: "14px" }
|
|
3591
3512
|
},
|
|
3592
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
3593
3514
|
"path",
|
|
3594
3515
|
{
|
|
3595
3516
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -3600,11 +3521,11 @@ function CategorySection({
|
|
|
3600
3521
|
}
|
|
3601
3522
|
)
|
|
3602
3523
|
)
|
|
3603
|
-
)), /* @__PURE__ */
|
|
3524
|
+
)), /* @__PURE__ */ import_react18.default.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
3604
3525
|
}
|
|
3605
3526
|
|
|
3606
3527
|
// src/SubGroupSection.jsx
|
|
3607
|
-
var
|
|
3528
|
+
var import_react19 = __toESM(require("react"));
|
|
3608
3529
|
function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap, justifyContent }) {
|
|
3609
3530
|
const styles2 = {
|
|
3610
3531
|
section: {
|
|
@@ -3639,7 +3560,7 @@ function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap
|
|
|
3639
3560
|
width: "100%"
|
|
3640
3561
|
}
|
|
3641
3562
|
};
|
|
3642
|
-
return /* @__PURE__ */
|
|
3563
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react19.default.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ import_react19.default.createElement(
|
|
3643
3564
|
"a",
|
|
3644
3565
|
{
|
|
3645
3566
|
href: websiteUrl,
|
|
@@ -3647,12 +3568,12 @@ function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap
|
|
|
3647
3568
|
rel: "noopener noreferrer",
|
|
3648
3569
|
style: styles2.link
|
|
3649
3570
|
},
|
|
3650
|
-
/* @__PURE__ */
|
|
3651
|
-
)), /* @__PURE__ */
|
|
3571
|
+
/* @__PURE__ */ import_react19.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.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" }))
|
|
3572
|
+
)), /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
3652
3573
|
}
|
|
3653
3574
|
|
|
3654
3575
|
// src/GovernmentBodySection.jsx
|
|
3655
|
-
var
|
|
3576
|
+
var import_react20 = __toESM(require("react"));
|
|
3656
3577
|
function GovernmentBodySection({
|
|
3657
3578
|
title,
|
|
3658
3579
|
websiteUrl,
|
|
@@ -3661,7 +3582,7 @@ function GovernmentBodySection({
|
|
|
3661
3582
|
children
|
|
3662
3583
|
}) {
|
|
3663
3584
|
var _a;
|
|
3664
|
-
const [expanded, setExpanded] = (0,
|
|
3585
|
+
const [expanded, setExpanded] = (0, import_react20.useState)(defaultExpanded);
|
|
3665
3586
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
3666
3587
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
3667
3588
|
const styles2 = {
|
|
@@ -3701,7 +3622,7 @@ function GovernmentBodySection({
|
|
|
3701
3622
|
display: expanded ? "block" : "none"
|
|
3702
3623
|
}
|
|
3703
3624
|
};
|
|
3704
|
-
return /* @__PURE__ */
|
|
3625
|
+
return /* @__PURE__ */ import_react20.default.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ import_react20.default.createElement(
|
|
3705
3626
|
"div",
|
|
3706
3627
|
{
|
|
3707
3628
|
style: styles2.header,
|
|
@@ -3717,8 +3638,8 @@ function GovernmentBodySection({
|
|
|
3717
3638
|
"aria-expanded": expanded,
|
|
3718
3639
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
3719
3640
|
},
|
|
3720
|
-
/* @__PURE__ */
|
|
3721
|
-
websiteUrl && /* @__PURE__ */
|
|
3641
|
+
/* @__PURE__ */ import_react20.default.createElement("span", { style: styles2.title }, title),
|
|
3642
|
+
websiteUrl && /* @__PURE__ */ import_react20.default.createElement(
|
|
3722
3643
|
"a",
|
|
3723
3644
|
{
|
|
3724
3645
|
href: websiteUrl,
|
|
@@ -3728,14 +3649,14 @@ function GovernmentBodySection({
|
|
|
3728
3649
|
onClick: (e) => e.stopPropagation(),
|
|
3729
3650
|
"aria-label": `Visit ${title} website`
|
|
3730
3651
|
},
|
|
3731
|
-
/* @__PURE__ */
|
|
3652
|
+
/* @__PURE__ */ import_react20.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ import_react20.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react20.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" }))
|
|
3732
3653
|
),
|
|
3733
|
-
/* @__PURE__ */
|
|
3734
|
-
), /* @__PURE__ */
|
|
3654
|
+
/* @__PURE__ */ import_react20.default.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
3655
|
+
), /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.content }, children));
|
|
3735
3656
|
}
|
|
3736
3657
|
|
|
3737
3658
|
// src/SocialLinks.jsx
|
|
3738
|
-
var
|
|
3659
|
+
var import_react21 = __toESM(require("react"));
|
|
3739
3660
|
var SOCIAL_PLATFORMS = [
|
|
3740
3661
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
3741
3662
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -3807,7 +3728,7 @@ function SocialLinks({
|
|
|
3807
3728
|
}
|
|
3808
3729
|
};
|
|
3809
3730
|
const platformIconMap = {
|
|
3810
|
-
twitter: /* @__PURE__ */
|
|
3731
|
+
twitter: /* @__PURE__ */ import_react21.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3811
3732
|
"path",
|
|
3812
3733
|
{
|
|
3813
3734
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -3817,7 +3738,7 @@ function SocialLinks({
|
|
|
3817
3738
|
strokeLinejoin: "round"
|
|
3818
3739
|
}
|
|
3819
3740
|
)),
|
|
3820
|
-
facebook: /* @__PURE__ */
|
|
3741
|
+
facebook: /* @__PURE__ */ import_react21.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3821
3742
|
"path",
|
|
3822
3743
|
{
|
|
3823
3744
|
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",
|
|
@@ -3827,8 +3748,8 @@ function SocialLinks({
|
|
|
3827
3748
|
strokeLinejoin: "round"
|
|
3828
3749
|
}
|
|
3829
3750
|
)),
|
|
3830
|
-
instagram: /* @__PURE__ */
|
|
3831
|
-
linkedin: /* @__PURE__ */
|
|
3751
|
+
instagram: /* @__PURE__ */ import_react21.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
3752
|
+
linkedin: /* @__PURE__ */ import_react21.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3832
3753
|
"path",
|
|
3833
3754
|
{
|
|
3834
3755
|
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",
|
|
@@ -3837,8 +3758,8 @@ function SocialLinks({
|
|
|
3837
3758
|
strokeLinecap: "round",
|
|
3838
3759
|
strokeLinejoin: "round"
|
|
3839
3760
|
}
|
|
3840
|
-
), /* @__PURE__ */
|
|
3841
|
-
youtube: /* @__PURE__ */
|
|
3761
|
+
), /* @__PURE__ */ import_react21.default.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
3762
|
+
youtube: /* @__PURE__ */ import_react21.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react21.default.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
3842
3763
|
};
|
|
3843
3764
|
const links = [
|
|
3844
3765
|
{
|
|
@@ -3864,7 +3785,7 @@ function SocialLinks({
|
|
|
3864
3785
|
{
|
|
3865
3786
|
href: website,
|
|
3866
3787
|
label: "Website",
|
|
3867
|
-
icon: /* @__PURE__ */
|
|
3788
|
+
icon: /* @__PURE__ */ import_react21.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react21.default.createElement(
|
|
3868
3789
|
"path",
|
|
3869
3790
|
{
|
|
3870
3791
|
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",
|
|
@@ -3894,7 +3815,7 @@ function SocialLinks({
|
|
|
3894
3815
|
if (links.length === 0) {
|
|
3895
3816
|
return null;
|
|
3896
3817
|
}
|
|
3897
|
-
return /* @__PURE__ */
|
|
3818
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ import_react21.default.createElement(
|
|
3898
3819
|
"a",
|
|
3899
3820
|
{
|
|
3900
3821
|
key: link.label,
|
|
@@ -3917,7 +3838,7 @@ function SocialLinks({
|
|
|
3917
3838
|
}
|
|
3918
3839
|
|
|
3919
3840
|
// src/IssueTags.jsx
|
|
3920
|
-
var
|
|
3841
|
+
var import_react22 = __toESM(require("react"));
|
|
3921
3842
|
function IssueTags({
|
|
3922
3843
|
tags = [],
|
|
3923
3844
|
selectedTags = [],
|
|
@@ -3960,9 +3881,9 @@ function IssueTags({
|
|
|
3960
3881
|
onTagClick(tag.value);
|
|
3961
3882
|
}
|
|
3962
3883
|
};
|
|
3963
|
-
return /* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
3964
3885
|
const isSelected = selectedTags.includes(tag.value);
|
|
3965
|
-
return /* @__PURE__ */
|
|
3886
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
3966
3887
|
"span",
|
|
3967
3888
|
{
|
|
3968
3889
|
key: tag.value,
|
|
@@ -3991,7 +3912,7 @@ function IssueTags({
|
|
|
3991
3912
|
}
|
|
3992
3913
|
|
|
3993
3914
|
// src/CommitteeTable.jsx
|
|
3994
|
-
var
|
|
3915
|
+
var import_react23 = __toESM(require("react"));
|
|
3995
3916
|
var ROLE_ORDER = {
|
|
3996
3917
|
"chair": 0,
|
|
3997
3918
|
"co-chair": 1,
|
|
@@ -4018,7 +3939,7 @@ function CommitteeTable({
|
|
|
4018
3939
|
maxVisible = 6,
|
|
4019
3940
|
style = {}
|
|
4020
3941
|
}) {
|
|
4021
|
-
const [showAll, setShowAll] = (0,
|
|
3942
|
+
const [showAll, setShowAll] = (0, import_react23.useState)(false);
|
|
4022
3943
|
if (committees.length === 0) {
|
|
4023
3944
|
return null;
|
|
4024
3945
|
}
|
|
@@ -4080,7 +4001,7 @@ function CommitteeTable({
|
|
|
4080
4001
|
cursor: "pointer"
|
|
4081
4002
|
}
|
|
4082
4003
|
};
|
|
4083
|
-
return /* @__PURE__ */
|
|
4004
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ import_react23.default.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ import_react23.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react23.default.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ import_react23.default.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ import_react23.default.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ import_react23.default.createElement("table", { style: styles2.table }, /* @__PURE__ */ import_react23.default.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ import_react23.default.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ import_react23.default.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ import_react23.default.createElement(
|
|
4084
4005
|
"a",
|
|
4085
4006
|
{
|
|
4086
4007
|
href: committee.url,
|
|
@@ -4095,7 +4016,7 @@ function CommitteeTable({
|
|
|
4095
4016
|
}
|
|
4096
4017
|
},
|
|
4097
4018
|
committee.name
|
|
4098
|
-
) : committee.name), /* @__PURE__ */
|
|
4019
|
+
) : committee.name), /* @__PURE__ */ import_react23.default.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ import_react23.default.createElement(
|
|
4099
4020
|
"button",
|
|
4100
4021
|
{
|
|
4101
4022
|
type: "button",
|
|
@@ -4103,7 +4024,7 @@ function CommitteeTable({
|
|
|
4103
4024
|
onClick: () => setShowAll(!showAll)
|
|
4104
4025
|
},
|
|
4105
4026
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
4106
|
-
/* @__PURE__ */
|
|
4027
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
4107
4028
|
"svg",
|
|
4108
4029
|
{
|
|
4109
4030
|
width: "14",
|
|
@@ -4116,16 +4037,16 @@ function CommitteeTable({
|
|
|
4116
4037
|
strokeLinejoin: "round",
|
|
4117
4038
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
4118
4039
|
},
|
|
4119
|
-
/* @__PURE__ */
|
|
4040
|
+
/* @__PURE__ */ import_react23.default.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
4120
4041
|
)
|
|
4121
4042
|
));
|
|
4122
4043
|
}
|
|
4123
4044
|
|
|
4124
4045
|
// src/PoliticianProfile.jsx
|
|
4125
|
-
var
|
|
4046
|
+
var import_react26 = __toESM(require("react"));
|
|
4126
4047
|
|
|
4127
4048
|
// src/LegislativeInlineSummary.jsx
|
|
4128
|
-
var
|
|
4049
|
+
var import_react24 = __toESM(require("react"));
|
|
4129
4050
|
function normalizePosition(pos) {
|
|
4130
4051
|
if (!pos) return "";
|
|
4131
4052
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -4233,7 +4154,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
4233
4154
|
fontSize: fontSizes.sm,
|
|
4234
4155
|
fontWeight: fontWeights.medium
|
|
4235
4156
|
};
|
|
4236
|
-
return /* @__PURE__ */
|
|
4157
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ import_react24.default.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ import_react24.default.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ import_react24.default.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ import_react24.default.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ import_react24.default.createElement("div", null), /* @__PURE__ */ import_react24.default.createElement("div", { style: footerRow }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4237
4158
|
"button",
|
|
4238
4159
|
{
|
|
4239
4160
|
onClick: () => {
|
|
@@ -4258,12 +4179,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
4258
4179
|
}
|
|
4259
4180
|
},
|
|
4260
4181
|
"View Full Legislative Record",
|
|
4261
|
-
/* @__PURE__ */
|
|
4182
|
+
/* @__PURE__ */ import_react24.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_react24.default.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
4262
4183
|
)));
|
|
4263
4184
|
}
|
|
4264
4185
|
|
|
4265
4186
|
// src/JudicialScorecard.jsx
|
|
4266
|
-
var
|
|
4187
|
+
var import_react25 = __toESM(require("react"));
|
|
4267
4188
|
|
|
4268
4189
|
// src/judicialUtils.js
|
|
4269
4190
|
function formatDate(dateStr) {
|
|
@@ -4381,7 +4302,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
4381
4302
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
4382
4303
|
}
|
|
4383
4304
|
};
|
|
4384
|
-
return /* @__PURE__ */
|
|
4305
|
+
return /* @__PURE__ */ import_react25.default.createElement("section", { style: sectionStyle }, /* @__PURE__ */ import_react25.default.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ import_react25.default.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ import_react25.default.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ import_react25.default.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react25.default.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ import_react25.default.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ import_react25.default.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ import_react25.default.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
4385
4306
|
}
|
|
4386
4307
|
|
|
4387
4308
|
// src/PoliticianProfile.jsx
|
|
@@ -4407,10 +4328,12 @@ function stripRetain(s) {
|
|
|
4407
4328
|
return (s || "").replace(/\s*\(Retain\s+.+?\?\)/, "");
|
|
4408
4329
|
}
|
|
4409
4330
|
function qualifyLocalTitle(baseTitle, pol) {
|
|
4410
|
-
if (!
|
|
4331
|
+
if (!baseTitle) return baseTitle;
|
|
4411
4332
|
const dt = pol.district_type || "";
|
|
4412
4333
|
if (!dt.startsWith("LOCAL") && dt !== "COUNTY") return baseTitle;
|
|
4413
|
-
const
|
|
4334
|
+
const govRaw = pol.government_name || pol.representing_city || "";
|
|
4335
|
+
if (!govRaw) return baseTitle;
|
|
4336
|
+
const gov = govRaw.split(",")[0].trim();
|
|
4414
4337
|
const govCore = gov.replace(/^City of\s+/i, "").replace(/\s+County$/i, "").trim();
|
|
4415
4338
|
if (govCore && baseTitle.toLowerCase().includes(govCore.toLowerCase())) return baseTitle;
|
|
4416
4339
|
let prefix = dt === "COUNTY" ? gov : gov.replace(/^City of\s+/i, "");
|
|
@@ -4542,13 +4465,13 @@ function formatAddress(addr) {
|
|
|
4542
4465
|
if (cityStateZip) lines.push(cityStateZip);
|
|
4543
4466
|
return lines;
|
|
4544
4467
|
}
|
|
4545
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4546
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4547
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4548
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4549
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4550
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4551
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4468
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ import_react26.default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ import_react26.default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ import_react26.default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
4469
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react26.default.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
4470
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.default.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ import_react26.default.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
4471
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.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" }));
|
|
4472
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.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_react26.default.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
4473
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react26.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" }));
|
|
4474
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ import_react26.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.default.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ import_react26.default.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ import_react26.default.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
4552
4475
|
function PoliticianProfile({
|
|
4553
4476
|
politician = {},
|
|
4554
4477
|
onBack,
|
|
@@ -4576,8 +4499,8 @@ function PoliticianProfile({
|
|
|
4576
4499
|
return pol.photo_origin_url;
|
|
4577
4500
|
})();
|
|
4578
4501
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
4579
|
-
const [imgError, setImgError] = (0,
|
|
4580
|
-
(0,
|
|
4502
|
+
const [imgError, setImgError] = (0, import_react26.useState)(false);
|
|
4503
|
+
(0, import_react26.useEffect)(() => {
|
|
4581
4504
|
setImgError(false);
|
|
4582
4505
|
}, [profileImageUrl]);
|
|
4583
4506
|
const getSocialHandle = (type) => {
|
|
@@ -4877,7 +4800,7 @@ function PoliticianProfile({
|
|
|
4877
4800
|
borderRadius: borderRadius.full
|
|
4878
4801
|
}
|
|
4879
4802
|
};
|
|
4880
|
-
return /* @__PURE__ */
|
|
4803
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ import_react26.default.createElement(
|
|
4881
4804
|
"button",
|
|
4882
4805
|
{
|
|
4883
4806
|
type: "button",
|
|
@@ -4890,9 +4813,9 @@ function PoliticianProfile({
|
|
|
4890
4813
|
e.currentTarget.style.textDecoration = "none";
|
|
4891
4814
|
}
|
|
4892
4815
|
},
|
|
4893
|
-
/* @__PURE__ */
|
|
4816
|
+
/* @__PURE__ */ import_react26.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react26.default.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
4894
4817
|
label
|
|
4895
|
-
), /* @__PURE__ */
|
|
4818
|
+
), /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.card }, /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ import_react26.default.createElement(
|
|
4896
4819
|
"img",
|
|
4897
4820
|
{
|
|
4898
4821
|
src: profileImageUrl,
|
|
@@ -4900,7 +4823,7 @@ function PoliticianProfile({
|
|
|
4900
4823
|
style: styles2.photo,
|
|
4901
4824
|
onError: () => setImgError(true)
|
|
4902
4825
|
}
|
|
4903
|
-
) : /* @__PURE__ */
|
|
4826
|
+
) : /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react26.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react26.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react26.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react26.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react26.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_react26.default.createElement(
|
|
4904
4827
|
"a",
|
|
4905
4828
|
{
|
|
4906
4829
|
href: pol.web_form_url,
|
|
@@ -4914,9 +4837,9 @@ function PoliticianProfile({
|
|
|
4914
4837
|
e.currentTarget.style.background = colors.evTeal;
|
|
4915
4838
|
}
|
|
4916
4839
|
},
|
|
4917
|
-
/* @__PURE__ */
|
|
4840
|
+
/* @__PURE__ */ import_react26.default.createElement(ExternalLinkIcon, { size: 14 }),
|
|
4918
4841
|
"Submit a Message"
|
|
4919
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
4842
|
+
))), hasContactInfo && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react26.default.createElement("div", { style: sectionHeading }, /* @__PURE__ */ import_react26.default.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react26.default.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ import_react26.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ import_react26.default.createElement("br", null))))))), hasPhones && /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react26.default.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ import_react26.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ import_react26.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4920
4843
|
"a",
|
|
4921
4844
|
{
|
|
4922
4845
|
href: `tel:${phone}`,
|
|
@@ -4929,7 +4852,7 @@ function PoliticianProfile({
|
|
|
4929
4852
|
}
|
|
4930
4853
|
},
|
|
4931
4854
|
phone
|
|
4932
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
4855
|
+
)))))), hasEmails && /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react26.default.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ import_react26.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_react26.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4933
4856
|
"a",
|
|
4934
4857
|
{
|
|
4935
4858
|
href: `mailto:${email}`,
|
|
@@ -4942,7 +4865,7 @@ function PoliticianProfile({
|
|
|
4942
4865
|
}
|
|
4943
4866
|
},
|
|
4944
4867
|
email
|
|
4945
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
4868
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ import_react26.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react26.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react26.default.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ import_react26.default.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4946
4869
|
"a",
|
|
4947
4870
|
{
|
|
4948
4871
|
href: url,
|
|
@@ -4957,7 +4880,7 @@ function PoliticianProfile({
|
|
|
4957
4880
|
}
|
|
4958
4881
|
},
|
|
4959
4882
|
extractDomain(url)
|
|
4960
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
4883
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ import_react26.default.createElement(
|
|
4961
4884
|
SocialLinks,
|
|
4962
4885
|
{
|
|
4963
4886
|
twitter,
|
|
@@ -4969,14 +4892,14 @@ function PoliticianProfile({
|
|
|
4969
4892
|
darkMode,
|
|
4970
4893
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
4971
4894
|
}
|
|
4972
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
4895
|
+
)))), committees.length > 0 && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react26.default.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ import_react26.default.createElement(
|
|
4973
4896
|
JudicialScorecard,
|
|
4974
4897
|
{
|
|
4975
4898
|
judicialRecord,
|
|
4976
4899
|
politicianId,
|
|
4977
4900
|
onNavigateToRecord
|
|
4978
4901
|
}
|
|
4979
|
-
) : /* @__PURE__ */
|
|
4902
|
+
) : /* @__PURE__ */ import_react26.default.createElement(
|
|
4980
4903
|
LegislativeInlineSummary,
|
|
4981
4904
|
{
|
|
4982
4905
|
summary: legislativeSummary,
|
|
@@ -4987,7 +4910,7 @@ function PoliticianProfile({
|
|
|
4987
4910
|
}
|
|
4988
4911
|
|
|
4989
4912
|
// src/LegislativeRecord.jsx
|
|
4990
|
-
var
|
|
4913
|
+
var import_react27 = __toESM(require("react"));
|
|
4991
4914
|
var DEFAULT_LIMIT = 25;
|
|
4992
4915
|
function normalizeText(str) {
|
|
4993
4916
|
if (!str) return "";
|
|
@@ -5067,7 +4990,7 @@ function getPositionBadge(position) {
|
|
|
5067
4990
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
5068
4991
|
}
|
|
5069
4992
|
function Badge({ label, bg, text }) {
|
|
5070
|
-
return /* @__PURE__ */
|
|
4993
|
+
return /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5071
4994
|
display: "inline-block",
|
|
5072
4995
|
background: bg,
|
|
5073
4996
|
color: text,
|
|
@@ -5080,18 +5003,18 @@ function Badge({ label, bg, text }) {
|
|
|
5080
5003
|
} }, label);
|
|
5081
5004
|
}
|
|
5082
5005
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
5083
|
-
return /* @__PURE__ */
|
|
5006
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: {
|
|
5084
5007
|
display: "flex",
|
|
5085
5008
|
alignItems: "center",
|
|
5086
5009
|
justifyContent: "space-between",
|
|
5087
5010
|
marginBottom: spacing[4]
|
|
5088
|
-
} }, /* @__PURE__ */
|
|
5011
|
+
} }, /* @__PURE__ */ import_react27.default.createElement("h2", { style: {
|
|
5089
5012
|
fontFamily: fonts.primary,
|
|
5090
5013
|
fontSize: fontSizes.xl,
|
|
5091
5014
|
fontWeight: fontWeights.bold,
|
|
5092
5015
|
color: colors.evTeal,
|
|
5093
5016
|
margin: 0
|
|
5094
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
5017
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ import_react27.default.createElement(
|
|
5095
5018
|
"select",
|
|
5096
5019
|
{
|
|
5097
5020
|
value: yearFilter,
|
|
@@ -5107,13 +5030,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
5107
5030
|
cursor: "pointer"
|
|
5108
5031
|
}
|
|
5109
5032
|
},
|
|
5110
|
-
/* @__PURE__ */
|
|
5111
|
-
years.map((y) => /* @__PURE__ */
|
|
5033
|
+
/* @__PURE__ */ import_react27.default.createElement("option", { value: "All" }, "All years"),
|
|
5034
|
+
years.map((y) => /* @__PURE__ */ import_react27.default.createElement("option", { key: y, value: y }, y))
|
|
5112
5035
|
));
|
|
5113
5036
|
}
|
|
5114
5037
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
5115
5038
|
if (totalCount <= visibleCount) return null;
|
|
5116
|
-
return /* @__PURE__ */
|
|
5039
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ import_react27.default.createElement(
|
|
5117
5040
|
"button",
|
|
5118
5041
|
{
|
|
5119
5042
|
type: "button",
|
|
@@ -5141,7 +5064,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
5141
5064
|
));
|
|
5142
5065
|
}
|
|
5143
5066
|
function EmptyState({ message }) {
|
|
5144
|
-
return /* @__PURE__ */
|
|
5067
|
+
return /* @__PURE__ */ import_react27.default.createElement("p", { style: {
|
|
5145
5068
|
fontFamily: fonts.primary,
|
|
5146
5069
|
fontSize: fontSizes.sm,
|
|
5147
5070
|
color: colors.textMuted,
|
|
@@ -5151,24 +5074,24 @@ function EmptyState({ message }) {
|
|
|
5151
5074
|
} }, message);
|
|
5152
5075
|
}
|
|
5153
5076
|
function Spinner() {
|
|
5154
|
-
return /* @__PURE__ */
|
|
5077
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: {
|
|
5155
5078
|
display: "flex",
|
|
5156
5079
|
justifyContent: "center",
|
|
5157
5080
|
alignItems: "center",
|
|
5158
5081
|
padding: spacing[10]
|
|
5159
|
-
} }, /* @__PURE__ */
|
|
5082
|
+
} }, /* @__PURE__ */ import_react27.default.createElement("div", { style: {
|
|
5160
5083
|
width: "40px",
|
|
5161
5084
|
height: "40px",
|
|
5162
5085
|
borderRadius: borderRadius.full,
|
|
5163
5086
|
border: `3px solid ${colors.borderLight}`,
|
|
5164
5087
|
borderTopColor: colors.evTeal,
|
|
5165
5088
|
animation: "ev-spin 0.8s linear infinite"
|
|
5166
|
-
} }), /* @__PURE__ */
|
|
5089
|
+
} }), /* @__PURE__ */ import_react27.default.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
5167
5090
|
}
|
|
5168
5091
|
function CommitteesSection({ committees, leadership }) {
|
|
5169
|
-
const [showAll, setShowAll] = (0,
|
|
5092
|
+
const [showAll, setShowAll] = (0, import_react27.useState)(false);
|
|
5170
5093
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
5171
|
-
return /* @__PURE__ */
|
|
5094
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react27.default.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ import_react27.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ import_react27.default.createElement("div", { key: i, style: {
|
|
5172
5095
|
display: "inline-flex",
|
|
5173
5096
|
alignItems: "center",
|
|
5174
5097
|
gap: spacing[1],
|
|
@@ -5179,23 +5102,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
5179
5102
|
fontFamily: fonts.primary,
|
|
5180
5103
|
fontSize: fontSizes.sm,
|
|
5181
5104
|
fontWeight: fontWeights.semibold
|
|
5182
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
5105
|
+
} }, role.title, role.chamber && /* @__PURE__ */ import_react27.default.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ import_react27.default.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement("div", null, visible.map((c, i) => {
|
|
5183
5106
|
const badge = getRoleBadge(c.role);
|
|
5184
|
-
return /* @__PURE__ */
|
|
5107
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { key: i, style: {
|
|
5185
5108
|
display: "flex",
|
|
5186
5109
|
alignItems: "center",
|
|
5187
5110
|
justifyContent: "space-between",
|
|
5188
5111
|
padding: `${spacing[3]} 0`,
|
|
5189
5112
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
5190
5113
|
gap: spacing[3]
|
|
5191
|
-
} }, /* @__PURE__ */
|
|
5114
|
+
} }, /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5192
5115
|
fontFamily: fonts.primary,
|
|
5193
5116
|
fontSize: fontSizes.sm,
|
|
5194
5117
|
color: colors.textSecondary,
|
|
5195
5118
|
flex: 1,
|
|
5196
5119
|
minWidth: 0
|
|
5197
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
5198
|
-
})), !showAll && /* @__PURE__ */
|
|
5120
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ import_react27.default.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ import_react27.default.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
5121
|
+
})), !showAll && /* @__PURE__ */ import_react27.default.createElement(
|
|
5199
5122
|
ShowAllLink,
|
|
5200
5123
|
{
|
|
5201
5124
|
totalCount: committees.length,
|
|
@@ -5206,15 +5129,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
5206
5129
|
}
|
|
5207
5130
|
function LegislationSection({ bills, isMobile }) {
|
|
5208
5131
|
const years = getYears(bills, "introduced_at");
|
|
5209
|
-
const [yearFilter, setYearFilter] = (0,
|
|
5210
|
-
const [showAll, setShowAll] = (0,
|
|
5132
|
+
const [yearFilter, setYearFilter] = (0, import_react27.useState)("All");
|
|
5133
|
+
const [showAll, setShowAll] = (0, import_react27.useState)(false);
|
|
5211
5134
|
const handleYearChange = (y) => {
|
|
5212
5135
|
setYearFilter(y);
|
|
5213
5136
|
setShowAll(false);
|
|
5214
5137
|
};
|
|
5215
5138
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
5216
5139
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
5217
|
-
return /* @__PURE__ */
|
|
5140
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react27.default.createElement(
|
|
5218
5141
|
SectionHeader,
|
|
5219
5142
|
{
|
|
5220
5143
|
title: "Sponsored Legislation",
|
|
@@ -5222,42 +5145,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
5222
5145
|
years,
|
|
5223
5146
|
onYearChange: handleYearChange
|
|
5224
5147
|
}
|
|
5225
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
5148
|
+
), bills.length === 0 ? /* @__PURE__ */ import_react27.default.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement("div", null, visible.map((bill, i) => {
|
|
5226
5149
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
5227
|
-
return /* @__PURE__ */
|
|
5150
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { key: i, style: {
|
|
5228
5151
|
display: "flex",
|
|
5229
5152
|
flexDirection: isMobile ? "column" : "row",
|
|
5230
5153
|
alignItems: isMobile ? "flex-start" : "center",
|
|
5231
5154
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
5232
5155
|
padding: `${spacing[3]} 0`,
|
|
5233
5156
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
5234
|
-
} }, /* @__PURE__ */
|
|
5157
|
+
} }, /* @__PURE__ */ import_react27.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5235
5158
|
fontFamily: fonts.primary,
|
|
5236
5159
|
fontSize: fontSizes.xs,
|
|
5237
5160
|
fontWeight: fontWeights.bold,
|
|
5238
5161
|
color: colors.textSecondary,
|
|
5239
5162
|
marginRight: spacing[2]
|
|
5240
|
-
} }, bill.number), /* @__PURE__ */
|
|
5163
|
+
} }, bill.number), /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5241
5164
|
fontFamily: fonts.primary,
|
|
5242
5165
|
fontSize: fontSizes.sm,
|
|
5243
5166
|
color: colors.textSecondary
|
|
5244
|
-
} }, bill.title)), /* @__PURE__ */
|
|
5167
|
+
} }, bill.title)), /* @__PURE__ */ import_react27.default.createElement("div", { style: {
|
|
5245
5168
|
display: "flex",
|
|
5246
5169
|
alignItems: "center",
|
|
5247
5170
|
gap: spacing[2],
|
|
5248
5171
|
flexShrink: 0,
|
|
5249
5172
|
flexWrap: "wrap"
|
|
5250
|
-
} }, /* @__PURE__ */
|
|
5173
|
+
} }, /* @__PURE__ */ import_react27.default.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5251
5174
|
fontFamily: fonts.primary,
|
|
5252
5175
|
fontSize: fontSizes.xs,
|
|
5253
5176
|
color: colors.textMuted
|
|
5254
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
5177
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5255
5178
|
fontFamily: fonts.primary,
|
|
5256
5179
|
fontSize: fontSizes.xs,
|
|
5257
5180
|
color: colors.textMuted,
|
|
5258
5181
|
fontStyle: "italic"
|
|
5259
5182
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
5260
|
-
})), !showAll && /* @__PURE__ */
|
|
5183
|
+
})), !showAll && /* @__PURE__ */ import_react27.default.createElement(
|
|
5261
5184
|
ShowAllLink,
|
|
5262
5185
|
{
|
|
5263
5186
|
totalCount: filtered.length,
|
|
@@ -5268,15 +5191,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
5268
5191
|
}
|
|
5269
5192
|
function VotingSection({ votes, isMobile }) {
|
|
5270
5193
|
const years = getYears(votes, "vote_date");
|
|
5271
|
-
const [yearFilter, setYearFilter] = (0,
|
|
5272
|
-
const [showAll, setShowAll] = (0,
|
|
5194
|
+
const [yearFilter, setYearFilter] = (0, import_react27.useState)("All");
|
|
5195
|
+
const [showAll, setShowAll] = (0, import_react27.useState)(false);
|
|
5273
5196
|
const handleYearChange = (y) => {
|
|
5274
5197
|
setYearFilter(y);
|
|
5275
5198
|
setShowAll(false);
|
|
5276
5199
|
};
|
|
5277
5200
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
5278
5201
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
5279
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react27.default.createElement(
|
|
5280
5203
|
SectionHeader,
|
|
5281
5204
|
{
|
|
5282
5205
|
title: "Voting Record",
|
|
@@ -5284,38 +5207,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
5284
5207
|
years,
|
|
5285
5208
|
onYearChange: handleYearChange
|
|
5286
5209
|
}
|
|
5287
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
5210
|
+
), votes.length === 0 ? /* @__PURE__ */ import_react27.default.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement("div", null, visible.map((vote, i) => {
|
|
5288
5211
|
const positionBadge = getPositionBadge(vote.position);
|
|
5289
5212
|
const normPosition = normalizeText(vote.position);
|
|
5290
5213
|
const topic = vote.bill_title || vote.vote_question;
|
|
5291
5214
|
const sourceUrl = vote.bill_url;
|
|
5292
|
-
return /* @__PURE__ */
|
|
5215
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { key: i, style: {
|
|
5293
5216
|
display: "flex",
|
|
5294
5217
|
flexDirection: isMobile ? "column" : "row",
|
|
5295
5218
|
alignItems: isMobile ? "flex-start" : "center",
|
|
5296
5219
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
5297
5220
|
padding: `${spacing[3]} 0`,
|
|
5298
5221
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
5299
|
-
} }, /* @__PURE__ */
|
|
5222
|
+
} }, /* @__PURE__ */ import_react27.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5300
5223
|
fontFamily: fonts.primary,
|
|
5301
5224
|
fontSize: fontSizes.sm,
|
|
5302
5225
|
color: colors.textSecondary
|
|
5303
|
-
} }, topic)), /* @__PURE__ */
|
|
5226
|
+
} }, topic)), /* @__PURE__ */ import_react27.default.createElement("div", { style: {
|
|
5304
5227
|
display: "flex",
|
|
5305
5228
|
alignItems: "center",
|
|
5306
5229
|
gap: spacing[2],
|
|
5307
5230
|
flexShrink: 0,
|
|
5308
5231
|
flexWrap: "wrap"
|
|
5309
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
5232
|
+
} }, vote.vote_date && /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5310
5233
|
fontFamily: fonts.primary,
|
|
5311
5234
|
fontSize: fontSizes.xs,
|
|
5312
5235
|
color: colors.textMuted
|
|
5313
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
5236
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ import_react27.default.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ import_react27.default.createElement("span", { style: {
|
|
5314
5237
|
fontFamily: fonts.primary,
|
|
5315
5238
|
fontSize: fontSizes.xs,
|
|
5316
5239
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
5317
5240
|
fontWeight: fontWeights.medium
|
|
5318
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
5241
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ import_react27.default.createElement(
|
|
5319
5242
|
"a",
|
|
5320
5243
|
{
|
|
5321
5244
|
href: sourceUrl,
|
|
@@ -5336,7 +5259,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
5336
5259
|
},
|
|
5337
5260
|
"Source"
|
|
5338
5261
|
)));
|
|
5339
|
-
})), !showAll && /* @__PURE__ */
|
|
5262
|
+
})), !showAll && /* @__PURE__ */ import_react27.default.createElement(
|
|
5340
5263
|
ShowAllLink,
|
|
5341
5264
|
{
|
|
5342
5265
|
totalCount: filtered.length,
|
|
@@ -5355,20 +5278,20 @@ function LegislativeRecord({
|
|
|
5355
5278
|
}) {
|
|
5356
5279
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
5357
5280
|
if (loading) {
|
|
5358
|
-
return /* @__PURE__ */
|
|
5281
|
+
return /* @__PURE__ */ import_react27.default.createElement(Spinner, null);
|
|
5359
5282
|
}
|
|
5360
|
-
return /* @__PURE__ */
|
|
5283
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ import_react27.default.createElement("h1", { style: {
|
|
5361
5284
|
fontFamily: fonts.primary,
|
|
5362
5285
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
5363
5286
|
fontWeight: fontWeights.bold,
|
|
5364
5287
|
color: colors.evTeal,
|
|
5365
5288
|
marginBottom: spacing[8],
|
|
5366
5289
|
marginTop: 0
|
|
5367
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
5290
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ import_react27.default.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ import_react27.default.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ import_react27.default.createElement(VotingSection, { votes, isMobile }));
|
|
5368
5291
|
}
|
|
5369
5292
|
|
|
5370
5293
|
// src/JudicialRecordDetail.jsx
|
|
5371
|
-
var
|
|
5294
|
+
var import_react28 = __toESM(require("react"));
|
|
5372
5295
|
var containerStyle = {
|
|
5373
5296
|
fontFamily: "'Manrope', sans-serif",
|
|
5374
5297
|
maxWidth: "800px"
|
|
@@ -5453,7 +5376,7 @@ var emptyStateStyle = {
|
|
|
5453
5376
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
5454
5377
|
var _a;
|
|
5455
5378
|
if (!judicialRecord) {
|
|
5456
|
-
return /* @__PURE__ */
|
|
5379
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react28.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react28.default.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
5457
5380
|
}
|
|
5458
5381
|
const {
|
|
5459
5382
|
judge_detail: detail,
|
|
@@ -5462,13 +5385,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
5462
5385
|
disciplinary_records: disciplinary = []
|
|
5463
5386
|
} = judicialRecord;
|
|
5464
5387
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
5465
|
-
return /* @__PURE__ */
|
|
5388
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react28.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react28.default.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ import_react28.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_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ import_react28.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react28.default.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ import_react28.default.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ import_react28.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react28.default.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ import_react28.default.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ import_react28.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react28.default.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ import_react28.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_react28.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react28.default.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ import_react28.default.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ import_react28.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ import_react28.default.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ import_react28.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react28.default.createElement("thead", null, /* @__PURE__ */ import_react28.default.createElement("tr", null, /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ import_react28.default.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ import_react28.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react28.default.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ import_react28.default.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ import_react28.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ import_react28.default.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ import_react28.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ import_react28.default.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ import_react28.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react28.default.createElement("thead", null, /* @__PURE__ */ import_react28.default.createElement("tr", null, /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ import_react28.default.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ import_react28.default.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ import_react28.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react28.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react28.default.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ import_react28.default.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ import_react28.default.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ import_react28.default.createElement("div", { key: i, style: {
|
|
5466
5389
|
borderLeft: "3px solid #fc8181",
|
|
5467
5390
|
backgroundColor: "#fff5f5",
|
|
5468
5391
|
borderRadius: "0 6px 6px 0",
|
|
5469
5392
|
padding: "12px 16px",
|
|
5470
5393
|
marginBottom: "10px"
|
|
5471
|
-
} }, /* @__PURE__ */
|
|
5394
|
+
} }, /* @__PURE__ */ import_react28.default.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ import_react28.default.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ import_react28.default.createElement(
|
|
5472
5395
|
"a",
|
|
5473
5396
|
{
|
|
5474
5397
|
href: d.source_url,
|
|
@@ -5481,7 +5404,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
5481
5404
|
}
|
|
5482
5405
|
|
|
5483
5406
|
// src/AuthForm.jsx
|
|
5484
|
-
var
|
|
5407
|
+
var import_react29 = __toESM(require("react"));
|
|
5485
5408
|
function AuthForm({
|
|
5486
5409
|
logoSrc = "/EVLogo.svg",
|
|
5487
5410
|
appName = "Empowered Vote",
|
|
@@ -5492,11 +5415,11 @@ function AuthForm({
|
|
|
5492
5415
|
error = null,
|
|
5493
5416
|
submitting = false
|
|
5494
5417
|
}) {
|
|
5495
|
-
const [username, setUsername] = (0,
|
|
5496
|
-
const [password, setPassword] = (0,
|
|
5497
|
-
const [confirmPassword, setConfirmPassword] = (0,
|
|
5498
|
-
const [showPasswords, setShowPasswords] = (0,
|
|
5499
|
-
const [passwordMismatch, setPasswordMismatch] = (0,
|
|
5418
|
+
const [username, setUsername] = (0, import_react29.useState)("");
|
|
5419
|
+
const [password, setPassword] = (0, import_react29.useState)("");
|
|
5420
|
+
const [confirmPassword, setConfirmPassword] = (0, import_react29.useState)("");
|
|
5421
|
+
const [showPasswords, setShowPasswords] = (0, import_react29.useState)(false);
|
|
5422
|
+
const [passwordMismatch, setPasswordMismatch] = (0, import_react29.useState)(false);
|
|
5500
5423
|
const isLogin = mode === "login";
|
|
5501
5424
|
const handleSubmit = (e) => {
|
|
5502
5425
|
e.preventDefault();
|
|
@@ -5508,7 +5431,7 @@ function AuthForm({
|
|
|
5508
5431
|
setPasswordMismatch(false);
|
|
5509
5432
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
5510
5433
|
};
|
|
5511
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
5434
|
+
const EyeOpen = () => /* @__PURE__ */ import_react29.default.createElement(
|
|
5512
5435
|
"svg",
|
|
5513
5436
|
{
|
|
5514
5437
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5518,7 +5441,7 @@ function AuthForm({
|
|
|
5518
5441
|
stroke: "currentColor",
|
|
5519
5442
|
style: { width: "20px", height: "20px" }
|
|
5520
5443
|
},
|
|
5521
|
-
/* @__PURE__ */
|
|
5444
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
5522
5445
|
"path",
|
|
5523
5446
|
{
|
|
5524
5447
|
strokeLinecap: "round",
|
|
@@ -5526,7 +5449,7 @@ function AuthForm({
|
|
|
5526
5449
|
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"
|
|
5527
5450
|
}
|
|
5528
5451
|
),
|
|
5529
|
-
/* @__PURE__ */
|
|
5452
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
5530
5453
|
"path",
|
|
5531
5454
|
{
|
|
5532
5455
|
strokeLinecap: "round",
|
|
@@ -5535,7 +5458,7 @@ function AuthForm({
|
|
|
5535
5458
|
}
|
|
5536
5459
|
)
|
|
5537
5460
|
);
|
|
5538
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
5461
|
+
const EyeClosed = () => /* @__PURE__ */ import_react29.default.createElement(
|
|
5539
5462
|
"svg",
|
|
5540
5463
|
{
|
|
5541
5464
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5545,7 +5468,7 @@ function AuthForm({
|
|
|
5545
5468
|
stroke: "currentColor",
|
|
5546
5469
|
style: { width: "20px", height: "20px" }
|
|
5547
5470
|
},
|
|
5548
|
-
/* @__PURE__ */
|
|
5471
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
5549
5472
|
"path",
|
|
5550
5473
|
{
|
|
5551
5474
|
strokeLinecap: "round",
|
|
@@ -5554,17 +5477,17 @@ function AuthForm({
|
|
|
5554
5477
|
}
|
|
5555
5478
|
)
|
|
5556
5479
|
);
|
|
5557
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
5480
|
+
const PasswordToggle = () => /* @__PURE__ */ import_react29.default.createElement(
|
|
5558
5481
|
"button",
|
|
5559
5482
|
{
|
|
5560
5483
|
type: "button",
|
|
5561
5484
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
5562
5485
|
style: styles.passwordToggle
|
|
5563
5486
|
},
|
|
5564
|
-
showPasswords ? /* @__PURE__ */
|
|
5487
|
+
showPasswords ? /* @__PURE__ */ import_react29.default.createElement(EyeOpen, null) : /* @__PURE__ */ import_react29.default.createElement(EyeClosed, null)
|
|
5565
5488
|
);
|
|
5566
5489
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
5567
|
-
return /* @__PURE__ */
|
|
5490
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.container }, /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ import_react29.default.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ import_react29.default.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ import_react29.default.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ import_react29.default.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ import_react29.default.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react29.default.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ import_react29.default.createElement(
|
|
5568
5491
|
"input",
|
|
5569
5492
|
{
|
|
5570
5493
|
type: "text",
|
|
@@ -5581,7 +5504,7 @@ function AuthForm({
|
|
|
5581
5504
|
},
|
|
5582
5505
|
required: true
|
|
5583
5506
|
}
|
|
5584
|
-
)), /* @__PURE__ */
|
|
5507
|
+
)), /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react29.default.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react29.default.createElement(
|
|
5585
5508
|
"input",
|
|
5586
5509
|
{
|
|
5587
5510
|
type: showPasswords ? "text" : "password",
|
|
@@ -5597,7 +5520,7 @@ function AuthForm({
|
|
|
5597
5520
|
},
|
|
5598
5521
|
required: true
|
|
5599
5522
|
}
|
|
5600
|
-
), /* @__PURE__ */
|
|
5523
|
+
), /* @__PURE__ */ import_react29.default.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react29.default.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react29.default.createElement(
|
|
5601
5524
|
"input",
|
|
5602
5525
|
{
|
|
5603
5526
|
type: showPasswords ? "text" : "password",
|
|
@@ -5613,7 +5536,7 @@ function AuthForm({
|
|
|
5613
5536
|
},
|
|
5614
5537
|
required: true
|
|
5615
5538
|
}
|
|
5616
|
-
), /* @__PURE__ */
|
|
5539
|
+
), /* @__PURE__ */ import_react29.default.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ import_react29.default.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ import_react29.default.createElement(
|
|
5617
5540
|
"button",
|
|
5618
5541
|
{
|
|
5619
5542
|
type: "submit",
|
|
@@ -5631,7 +5554,7 @@ function AuthForm({
|
|
|
5631
5554
|
}
|
|
5632
5555
|
},
|
|
5633
5556
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
5634
|
-
), onModeSwitch && /* @__PURE__ */
|
|
5557
|
+
), onModeSwitch && /* @__PURE__ */ import_react29.default.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ import_react29.default.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ import_react29.default.createElement(
|
|
5635
5558
|
"button",
|
|
5636
5559
|
{
|
|
5637
5560
|
type: "button",
|
|
@@ -5804,9 +5727,9 @@ var styles = {
|
|
|
5804
5727
|
};
|
|
5805
5728
|
|
|
5806
5729
|
// src/TopicTierBadge.jsx
|
|
5807
|
-
var
|
|
5730
|
+
var import_react30 = __toESM(require("react"));
|
|
5808
5731
|
function LandmarkIcon({ size = 14 }) {
|
|
5809
|
-
return /* @__PURE__ */
|
|
5732
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5810
5733
|
"svg",
|
|
5811
5734
|
{
|
|
5812
5735
|
width: size,
|
|
@@ -5820,16 +5743,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
5820
5743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5821
5744
|
"aria-hidden": "true"
|
|
5822
5745
|
},
|
|
5823
|
-
/* @__PURE__ */
|
|
5824
|
-
/* @__PURE__ */
|
|
5825
|
-
/* @__PURE__ */
|
|
5826
|
-
/* @__PURE__ */
|
|
5827
|
-
/* @__PURE__ */
|
|
5828
|
-
/* @__PURE__ */
|
|
5746
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M10 18v-7" }),
|
|
5747
|
+
/* @__PURE__ */ import_react30.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" }),
|
|
5748
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M14 18v-7" }),
|
|
5749
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M18 18v-7" }),
|
|
5750
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M3 22h18" }),
|
|
5751
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M6 18v-7" })
|
|
5829
5752
|
);
|
|
5830
5753
|
}
|
|
5831
5754
|
function Building2Icon({ size = 14 }) {
|
|
5832
|
-
return /* @__PURE__ */
|
|
5755
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5833
5756
|
"svg",
|
|
5834
5757
|
{
|
|
5835
5758
|
width: size,
|
|
@@ -5843,17 +5766,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
5843
5766
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5844
5767
|
"aria-hidden": "true"
|
|
5845
5768
|
},
|
|
5846
|
-
/* @__PURE__ */
|
|
5847
|
-
/* @__PURE__ */
|
|
5848
|
-
/* @__PURE__ */
|
|
5849
|
-
/* @__PURE__ */
|
|
5850
|
-
/* @__PURE__ */
|
|
5851
|
-
/* @__PURE__ */
|
|
5852
|
-
/* @__PURE__ */
|
|
5769
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
5770
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
5771
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
5772
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M10 6h4" }),
|
|
5773
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M10 10h4" }),
|
|
5774
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M10 14h4" }),
|
|
5775
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "M10 18h4" })
|
|
5853
5776
|
);
|
|
5854
5777
|
}
|
|
5855
5778
|
function HomeIcon({ size = 14 }) {
|
|
5856
|
-
return /* @__PURE__ */
|
|
5779
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5857
5780
|
"svg",
|
|
5858
5781
|
{
|
|
5859
5782
|
width: size,
|
|
@@ -5867,8 +5790,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
5867
5790
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5868
5791
|
"aria-hidden": "true"
|
|
5869
5792
|
},
|
|
5870
|
-
/* @__PURE__ */
|
|
5871
|
-
/* @__PURE__ */
|
|
5793
|
+
/* @__PURE__ */ import_react30.default.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
5794
|
+
/* @__PURE__ */ import_react30.default.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
5872
5795
|
);
|
|
5873
5796
|
}
|
|
5874
5797
|
var TIER_INFO = {
|
|
@@ -5928,7 +5851,7 @@ function TopicTierBadge({
|
|
|
5928
5851
|
userSelect: "none"
|
|
5929
5852
|
};
|
|
5930
5853
|
};
|
|
5931
|
-
return /* @__PURE__ */
|
|
5854
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5932
5855
|
"span",
|
|
5933
5856
|
{
|
|
5934
5857
|
className: "ev-topic-tier-badge",
|
|
@@ -5938,13 +5861,13 @@ function TopicTierBadge({
|
|
|
5938
5861
|
},
|
|
5939
5862
|
effectiveTiers.map((tier) => {
|
|
5940
5863
|
const { label, Icon } = TIER_INFO[tier];
|
|
5941
|
-
return /* @__PURE__ */
|
|
5864
|
+
return /* @__PURE__ */ import_react30.default.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ import_react30.default.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ import_react30.default.createElement("span", null, label));
|
|
5942
5865
|
})
|
|
5943
5866
|
);
|
|
5944
5867
|
}
|
|
5945
5868
|
|
|
5946
5869
|
// src/CompassCoverageCallout.jsx
|
|
5947
|
-
var
|
|
5870
|
+
var import_react31 = __toESM(require("react"));
|
|
5948
5871
|
var TIER_LABELS = {
|
|
5949
5872
|
federal: "federal",
|
|
5950
5873
|
state: "state",
|
|
@@ -5957,7 +5880,7 @@ function CompassCoverageCallout({
|
|
|
5957
5880
|
compassUrl,
|
|
5958
5881
|
onDismiss
|
|
5959
5882
|
}) {
|
|
5960
|
-
const [dismissed, setDismissed] = (0,
|
|
5883
|
+
const [dismissed, setDismissed] = (0, import_react31.useState)(false);
|
|
5961
5884
|
if (dismissed) return null;
|
|
5962
5885
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
5963
5886
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -6008,15 +5931,15 @@ function CompassCoverageCallout({
|
|
|
6008
5931
|
setDismissed(true);
|
|
6009
5932
|
if (onDismiss) onDismiss();
|
|
6010
5933
|
};
|
|
6011
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
6012
5935
|
"div",
|
|
6013
5936
|
{
|
|
6014
5937
|
className: "ev-compass-coverage-callout",
|
|
6015
5938
|
role: "status",
|
|
6016
5939
|
style: containerStyle2
|
|
6017
5940
|
},
|
|
6018
|
-
/* @__PURE__ */
|
|
6019
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
5941
|
+
/* @__PURE__ */ import_react31.default.createElement("div", { style: textStyle }, /* @__PURE__ */ import_react31.default.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ import_react31.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_react31.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
5942
|
+
onDismiss !== void 0 && /* @__PURE__ */ import_react31.default.createElement(
|
|
6020
5943
|
"button",
|
|
6021
5944
|
{
|
|
6022
5945
|
onClick: handleDismiss,
|
|
@@ -6029,7 +5952,7 @@ function CompassCoverageCallout({
|
|
|
6029
5952
|
}
|
|
6030
5953
|
|
|
6031
5954
|
// src/ExpandCompassNudge.jsx
|
|
6032
|
-
var
|
|
5955
|
+
var import_react32 = __toESM(require("react"));
|
|
6033
5956
|
function ExpandCompassNudge({
|
|
6034
5957
|
politicianName,
|
|
6035
5958
|
missingCount,
|
|
@@ -6076,7 +5999,7 @@ function ExpandCompassNudge({
|
|
|
6076
5999
|
};
|
|
6077
6000
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
6078
6001
|
const speakerName = politicianName || "This politician";
|
|
6079
|
-
return /* @__PURE__ */
|
|
6002
|
+
return /* @__PURE__ */ import_react32.default.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ import_react32.default.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ import_react32.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_react32.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
6080
6003
|
}
|
|
6081
6004
|
|
|
6082
6005
|
// src/computeTierCoverage.js
|
|
@@ -6097,7 +6020,7 @@ function computeTierCoverage(topics) {
|
|
|
6097
6020
|
}
|
|
6098
6021
|
|
|
6099
6022
|
// src/useEvContextPromotion.js
|
|
6100
|
-
var
|
|
6023
|
+
var import_react33 = require("react");
|
|
6101
6024
|
function useEvContextPromotion({
|
|
6102
6025
|
domain,
|
|
6103
6026
|
isLoggedIn,
|
|
@@ -6106,23 +6029,23 @@ function useEvContextPromotion({
|
|
|
6106
6029
|
apiWriter,
|
|
6107
6030
|
enabled = true
|
|
6108
6031
|
}) {
|
|
6109
|
-
const [shouldPrompt, setShouldPrompt] = (0,
|
|
6110
|
-
const [payload, setPayload] = (0,
|
|
6111
|
-
const [status, setStatus] = (0,
|
|
6112
|
-
const [error, setError] = (0,
|
|
6113
|
-
const apiDataRef = (0,
|
|
6032
|
+
const [shouldPrompt, setShouldPrompt] = (0, import_react33.useState)(false);
|
|
6033
|
+
const [payload, setPayload] = (0, import_react33.useState)(null);
|
|
6034
|
+
const [status, setStatus] = (0, import_react33.useState)("idle");
|
|
6035
|
+
const [error, setError] = (0, import_react33.useState)(null);
|
|
6036
|
+
const apiDataRef = (0, import_react33.useRef)(apiData);
|
|
6114
6037
|
apiDataRef.current = apiData;
|
|
6115
|
-
const userIdRef = (0,
|
|
6038
|
+
const userIdRef = (0, import_react33.useRef)(userId);
|
|
6116
6039
|
userIdRef.current = userId;
|
|
6117
|
-
const isLoggedInRef = (0,
|
|
6040
|
+
const isLoggedInRef = (0, import_react33.useRef)(isLoggedIn);
|
|
6118
6041
|
isLoggedInRef.current = isLoggedIn;
|
|
6119
|
-
const enabledRef = (0,
|
|
6042
|
+
const enabledRef = (0, import_react33.useRef)(enabled);
|
|
6120
6043
|
enabledRef.current = enabled;
|
|
6121
|
-
const domainRef = (0,
|
|
6044
|
+
const domainRef = (0, import_react33.useRef)(domain);
|
|
6122
6045
|
domainRef.current = domain;
|
|
6123
|
-
const apiWriterRef = (0,
|
|
6046
|
+
const apiWriterRef = (0, import_react33.useRef)(apiWriter);
|
|
6124
6047
|
apiWriterRef.current = apiWriter;
|
|
6125
|
-
const detect = (0,
|
|
6048
|
+
const detect = (0, import_react33.useCallback)(async () => {
|
|
6126
6049
|
const _enabled = enabledRef.current;
|
|
6127
6050
|
const _isLoggedIn = isLoggedInRef.current;
|
|
6128
6051
|
const _userId = userIdRef.current;
|
|
@@ -6161,16 +6084,16 @@ function useEvContextPromotion({
|
|
|
6161
6084
|
setPayload(null);
|
|
6162
6085
|
}
|
|
6163
6086
|
}, []);
|
|
6164
|
-
(0,
|
|
6087
|
+
(0, import_react33.useEffect)(() => {
|
|
6165
6088
|
detect();
|
|
6166
6089
|
}, [detect, isLoggedIn, userId, apiData, enabled, domain]);
|
|
6167
|
-
(0,
|
|
6090
|
+
(0, import_react33.useEffect)(() => {
|
|
6168
6091
|
const unsub = evContext.subscribe(() => {
|
|
6169
6092
|
detect();
|
|
6170
6093
|
});
|
|
6171
6094
|
return unsub;
|
|
6172
6095
|
}, [detect]);
|
|
6173
|
-
const promote = (0,
|
|
6096
|
+
const promote = (0, import_react33.useCallback)(async () => {
|
|
6174
6097
|
const _userId = userIdRef.current;
|
|
6175
6098
|
const _domain = domainRef.current;
|
|
6176
6099
|
const _writer = apiWriterRef.current;
|
|
@@ -6197,7 +6120,7 @@ function useEvContextPromotion({
|
|
|
6197
6120
|
setError(err instanceof Error ? err : new Error(String(err)));
|
|
6198
6121
|
}
|
|
6199
6122
|
}, [payload]);
|
|
6200
|
-
const dismiss = (0,
|
|
6123
|
+
const dismiss = (0, import_react33.useCallback)(async () => {
|
|
6201
6124
|
const _userId = userIdRef.current;
|
|
6202
6125
|
const _domain = domainRef.current;
|
|
6203
6126
|
if (!_userId) return;
|
|
@@ -6256,14 +6179,14 @@ function isGuestPopulated(domain, fullEvContext) {
|
|
|
6256
6179
|
}
|
|
6257
6180
|
|
|
6258
6181
|
// src/StanceAccordion.jsx
|
|
6259
|
-
var
|
|
6182
|
+
var import_react35 = __toESM(require("react"));
|
|
6260
6183
|
|
|
6261
6184
|
// src/Favicon.jsx
|
|
6262
|
-
var
|
|
6185
|
+
var import_react34 = __toESM(require("react"));
|
|
6263
6186
|
function Favicon({ url, size = 16 }) {
|
|
6264
6187
|
try {
|
|
6265
6188
|
const domain = new URL(url).hostname;
|
|
6266
|
-
return /* @__PURE__ */
|
|
6189
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
6267
6190
|
"img",
|
|
6268
6191
|
{
|
|
6269
6192
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -6274,7 +6197,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
6274
6197
|
}
|
|
6275
6198
|
);
|
|
6276
6199
|
} catch {
|
|
6277
|
-
return /* @__PURE__ */
|
|
6200
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
6278
6201
|
"svg",
|
|
6279
6202
|
{
|
|
6280
6203
|
width: size,
|
|
@@ -6285,8 +6208,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
6285
6208
|
strokeWidth: "1.5",
|
|
6286
6209
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
6287
6210
|
},
|
|
6288
|
-
/* @__PURE__ */
|
|
6289
|
-
/* @__PURE__ */
|
|
6211
|
+
/* @__PURE__ */ import_react34.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
6212
|
+
/* @__PURE__ */ import_react34.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" })
|
|
6290
6213
|
);
|
|
6291
6214
|
}
|
|
6292
6215
|
}
|
|
@@ -6317,11 +6240,11 @@ function StanceAccordion({
|
|
|
6317
6240
|
apiUrl = "https://api.empowered.vote"
|
|
6318
6241
|
}) {
|
|
6319
6242
|
var _a;
|
|
6320
|
-
const [expandedTopicId, setExpandedTopicId] = (0,
|
|
6321
|
-
const [loadingId, setLoadingId] = (0,
|
|
6322
|
-
const [showAll, setShowAll] = (0,
|
|
6323
|
-
const contextCache = (0,
|
|
6324
|
-
const quotesCache = (0,
|
|
6243
|
+
const [expandedTopicId, setExpandedTopicId] = (0, import_react35.useState)(null);
|
|
6244
|
+
const [loadingId, setLoadingId] = (0, import_react35.useState)(null);
|
|
6245
|
+
const [showAll, setShowAll] = (0, import_react35.useState)(false);
|
|
6246
|
+
const contextCache = (0, import_react35.useRef)(/* @__PURE__ */ new Map());
|
|
6247
|
+
const quotesCache = (0, import_react35.useRef)(null);
|
|
6325
6248
|
const polAnswerMap = {};
|
|
6326
6249
|
if (polAnswers) {
|
|
6327
6250
|
polAnswers.forEach((a) => {
|
|
@@ -6380,7 +6303,7 @@ function StanceAccordion({
|
|
|
6380
6303
|
quotesCache.current = [];
|
|
6381
6304
|
}
|
|
6382
6305
|
}
|
|
6383
|
-
const handleToggle = (0,
|
|
6306
|
+
const handleToggle = (0, import_react35.useCallback)(
|
|
6384
6307
|
async (topicId) => {
|
|
6385
6308
|
if (expandedTopicId === topicId) {
|
|
6386
6309
|
setExpandedTopicId(null);
|
|
@@ -6397,7 +6320,7 @@ function StanceAccordion({
|
|
|
6397
6320
|
},
|
|
6398
6321
|
[expandedTopicId, politicianId, apiUrl]
|
|
6399
6322
|
);
|
|
6400
|
-
(0,
|
|
6323
|
+
(0, import_react35.useEffect)(() => {
|
|
6401
6324
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
6402
6325
|
handleToggle(String(initialExpandedTopicId));
|
|
6403
6326
|
}
|
|
@@ -6413,13 +6336,13 @@ function StanceAccordion({
|
|
|
6413
6336
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
6414
6337
|
}
|
|
6415
6338
|
}
|
|
6416
|
-
return /* @__PURE__ */
|
|
6339
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
6417
6340
|
"div",
|
|
6418
6341
|
{
|
|
6419
6342
|
className: "flex flex-col",
|
|
6420
6343
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
6421
6344
|
},
|
|
6422
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ import_react35.default.createElement(
|
|
6423
6346
|
"h3",
|
|
6424
6347
|
{
|
|
6425
6348
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -6442,15 +6365,15 @@ function StanceAccordion({
|
|
|
6442
6365
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
6443
6366
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
6444
6367
|
}) : [];
|
|
6445
|
-
return /* @__PURE__ */
|
|
6368
|
+
return /* @__PURE__ */ import_react35.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react35.default.createElement(
|
|
6446
6369
|
"button",
|
|
6447
6370
|
{
|
|
6448
6371
|
type: "button",
|
|
6449
6372
|
onClick: () => handleToggle(topicId),
|
|
6450
6373
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
6451
6374
|
},
|
|
6452
|
-
/* @__PURE__ */
|
|
6453
|
-
/* @__PURE__ */
|
|
6375
|
+
/* @__PURE__ */ import_react35.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react35.default.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ import_react35.default.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ import_react35.default.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
6376
|
+
/* @__PURE__ */ import_react35.default.createElement(
|
|
6454
6377
|
"svg",
|
|
6455
6378
|
{
|
|
6456
6379
|
width: "16",
|
|
@@ -6467,9 +6390,9 @@ function StanceAccordion({
|
|
|
6467
6390
|
transition: "transform 0.2s ease"
|
|
6468
6391
|
}
|
|
6469
6392
|
},
|
|
6470
|
-
/* @__PURE__ */
|
|
6393
|
+
/* @__PURE__ */ import_react35.default.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
6471
6394
|
)
|
|
6472
|
-
), /* @__PURE__ */
|
|
6395
|
+
), /* @__PURE__ */ import_react35.default.createElement(
|
|
6473
6396
|
"div",
|
|
6474
6397
|
{
|
|
6475
6398
|
style: {
|
|
@@ -6478,7 +6401,7 @@ function StanceAccordion({
|
|
|
6478
6401
|
transition: "grid-template-rows 0.25s ease"
|
|
6479
6402
|
}
|
|
6480
6403
|
},
|
|
6481
|
-
/* @__PURE__ */
|
|
6404
|
+
/* @__PURE__ */ import_react35.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react35.default.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ import_react35.default.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ import_react35.default.createElement(
|
|
6482
6405
|
"div",
|
|
6483
6406
|
{
|
|
6484
6407
|
style: {
|
|
@@ -6490,14 +6413,14 @@ function StanceAccordion({
|
|
|
6490
6413
|
animation: "ev-spin 0.8s linear infinite"
|
|
6491
6414
|
}
|
|
6492
6415
|
}
|
|
6493
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
6416
|
+
)), !isLoading && cached && /* @__PURE__ */ import_react35.default.createElement(import_react35.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react35.default.createElement(
|
|
6494
6417
|
"p",
|
|
6495
6418
|
{
|
|
6496
6419
|
className: "text-sm text-neutral-700 mb-3",
|
|
6497
6420
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
6498
6421
|
},
|
|
6499
6422
|
cached.reasoning
|
|
6500
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
6423
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react35.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react35.default.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ import_react35.default.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ import_react35.default.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ import_react35.default.createElement(
|
|
6501
6424
|
"a",
|
|
6502
6425
|
{
|
|
6503
6426
|
href: src,
|
|
@@ -6505,9 +6428,9 @@ function StanceAccordion({
|
|
|
6505
6428
|
rel: "noreferrer",
|
|
6506
6429
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
6507
6430
|
},
|
|
6508
|
-
/* @__PURE__ */
|
|
6509
|
-
/* @__PURE__ */
|
|
6510
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
6431
|
+
/* @__PURE__ */ import_react35.default.createElement(Favicon, { url: src }),
|
|
6432
|
+
/* @__PURE__ */ import_react35.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
6433
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react35.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react35.default.createElement(
|
|
6511
6434
|
"p",
|
|
6512
6435
|
{
|
|
6513
6436
|
style: {
|
|
@@ -6524,7 +6447,7 @@ function StanceAccordion({
|
|
|
6524
6447
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
6525
6448
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
6526
6449
|
const sourceName = quote.source_name || quote.sourceName;
|
|
6527
|
-
return /* @__PURE__ */
|
|
6450
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
6528
6451
|
"div",
|
|
6529
6452
|
{
|
|
6530
6453
|
key: quote.id,
|
|
@@ -6536,7 +6459,7 @@ function StanceAccordion({
|
|
|
6536
6459
|
marginBottom: "8px"
|
|
6537
6460
|
}
|
|
6538
6461
|
},
|
|
6539
|
-
/* @__PURE__ */
|
|
6462
|
+
/* @__PURE__ */ import_react35.default.createElement(
|
|
6540
6463
|
"p",
|
|
6541
6464
|
{
|
|
6542
6465
|
style: {
|
|
@@ -6549,7 +6472,7 @@ function StanceAccordion({
|
|
|
6549
6472
|
},
|
|
6550
6473
|
quote.text
|
|
6551
6474
|
),
|
|
6552
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
6475
|
+
verdict === "agreed" && /* @__PURE__ */ import_react35.default.createElement(
|
|
6553
6476
|
"span",
|
|
6554
6477
|
{
|
|
6555
6478
|
style: {
|
|
@@ -6566,10 +6489,10 @@ function StanceAccordion({
|
|
|
6566
6489
|
flexShrink: 0
|
|
6567
6490
|
}
|
|
6568
6491
|
},
|
|
6569
|
-
/* @__PURE__ */
|
|
6492
|
+
/* @__PURE__ */ import_react35.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_react35.default.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
6570
6493
|
"Agreed"
|
|
6571
6494
|
),
|
|
6572
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
6495
|
+
verdict === "disagreed" && /* @__PURE__ */ import_react35.default.createElement(
|
|
6573
6496
|
"span",
|
|
6574
6497
|
{
|
|
6575
6498
|
style: {
|
|
@@ -6586,10 +6509,10 @@ function StanceAccordion({
|
|
|
6586
6509
|
flexShrink: 0
|
|
6587
6510
|
}
|
|
6588
6511
|
},
|
|
6589
|
-
/* @__PURE__ */
|
|
6512
|
+
/* @__PURE__ */ import_react35.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_react35.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
6590
6513
|
"Disagreed"
|
|
6591
6514
|
),
|
|
6592
|
-
sourceName && /* @__PURE__ */
|
|
6515
|
+
sourceName && /* @__PURE__ */ import_react35.default.createElement(
|
|
6593
6516
|
"a",
|
|
6594
6517
|
{
|
|
6595
6518
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -6606,10 +6529,10 @@ function StanceAccordion({
|
|
|
6606
6529
|
sourceName
|
|
6607
6530
|
)
|
|
6608
6531
|
);
|
|
6609
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
6532
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react35.default.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
6610
6533
|
));
|
|
6611
6534
|
}),
|
|
6612
|
-
hasToggle && /* @__PURE__ */
|
|
6535
|
+
hasToggle && /* @__PURE__ */ import_react35.default.createElement(
|
|
6613
6536
|
"button",
|
|
6614
6537
|
{
|
|
6615
6538
|
type: "button",
|