@empoweredvote/ev-ui 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +799 -270
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +806 -267
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -170,9 +170,9 @@ function RadarChartCore({
|
|
|
170
170
|
const fSize = adaptiveFontSize(longestLine, baseFSize);
|
|
171
171
|
const lineHeight = fSize * 1.1;
|
|
172
172
|
const dynamicLabelOffset = lines.length > 1 ? labelOffset + 8 : labelOffset;
|
|
173
|
-
const
|
|
174
|
-
const labelX = centerX +
|
|
175
|
-
let labelY = centerY -
|
|
173
|
+
const offset2 = radius + dynamicLabelOffset;
|
|
174
|
+
const labelX = centerX + offset2 * Math.sin(angle);
|
|
175
|
+
let labelY = centerY - offset2 * Math.cos(angle);
|
|
176
176
|
if (isTop && lines.length > 1) {
|
|
177
177
|
labelY -= (lines.length - 1) * lineHeight;
|
|
178
178
|
}
|
|
@@ -1538,8 +1538,7 @@ function PoliticianCard({
|
|
|
1538
1538
|
},
|
|
1539
1539
|
imageWrapper: {
|
|
1540
1540
|
width: isHorizontal ? "90px" : "100%",
|
|
1541
|
-
height: isHorizontal ?
|
|
1542
|
-
maxHeight: isHorizontal ? "200px" : void 0,
|
|
1541
|
+
height: isHorizontal ? void 0 : "auto",
|
|
1543
1542
|
aspectRatio: isHorizontal ? void 0 : "4/5",
|
|
1544
1543
|
flexShrink: 0,
|
|
1545
1544
|
overflow: "hidden"
|
|
@@ -1757,8 +1756,618 @@ function PoliticianCard({
|
|
|
1757
1756
|
);
|
|
1758
1757
|
}
|
|
1759
1758
|
|
|
1759
|
+
// src/CompassCardHorizontal.jsx
|
|
1760
|
+
import React10, { useState as useState5, useEffect as useEffect5 } from "react";
|
|
1761
|
+
|
|
1762
|
+
// src/PlaceholderRadar.jsx
|
|
1763
|
+
import React6 from "react";
|
|
1764
|
+
function PlaceholderRadar({ size = 250, name = "" }) {
|
|
1765
|
+
const cx = size / 2;
|
|
1766
|
+
const cy = size / 2;
|
|
1767
|
+
const r = size / 2 * 0.65;
|
|
1768
|
+
const n = 8;
|
|
1769
|
+
const vertices = Array.from({ length: n }, (_, i) => {
|
|
1770
|
+
const a = 2 * Math.PI * i / n;
|
|
1771
|
+
return [cx + r * Math.sin(a), cy - r * Math.cos(a)];
|
|
1772
|
+
});
|
|
1773
|
+
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
1774
|
+
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
1775
|
+
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
1776
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1777
|
+
"svg",
|
|
1778
|
+
{
|
|
1779
|
+
width: size,
|
|
1780
|
+
height: size,
|
|
1781
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
1782
|
+
role: "img",
|
|
1783
|
+
"aria-label": name ? `${name} \u2014 compass data unavailable` : "compass data unavailable",
|
|
1784
|
+
style: {
|
|
1785
|
+
backgroundColor: colorScales.teal["050"],
|
|
1786
|
+
borderRadius: borderRadius.sm,
|
|
1787
|
+
flexShrink: 0
|
|
1788
|
+
}
|
|
1789
|
+
},
|
|
1790
|
+
vertices.map(([x, y], i) => /* @__PURE__ */ React6.createElement(
|
|
1791
|
+
"line",
|
|
1792
|
+
{
|
|
1793
|
+
key: i,
|
|
1794
|
+
x1: cx,
|
|
1795
|
+
y1: cy,
|
|
1796
|
+
x2: x,
|
|
1797
|
+
y2: y,
|
|
1798
|
+
stroke: colorScales.gray["200"],
|
|
1799
|
+
strokeWidth: "1",
|
|
1800
|
+
strokeDasharray: "2 3",
|
|
1801
|
+
opacity: "0.6"
|
|
1802
|
+
}
|
|
1803
|
+
)),
|
|
1804
|
+
/* @__PURE__ */ React6.createElement(
|
|
1805
|
+
"polygon",
|
|
1806
|
+
{
|
|
1807
|
+
points: innerPts,
|
|
1808
|
+
fill: "none",
|
|
1809
|
+
stroke: colorScales.gray["200"],
|
|
1810
|
+
strokeWidth: "1",
|
|
1811
|
+
strokeDasharray: "2 3",
|
|
1812
|
+
opacity: "0.5"
|
|
1813
|
+
}
|
|
1814
|
+
),
|
|
1815
|
+
/* @__PURE__ */ React6.createElement(
|
|
1816
|
+
"polygon",
|
|
1817
|
+
{
|
|
1818
|
+
points: midPts,
|
|
1819
|
+
fill: "none",
|
|
1820
|
+
stroke: colorScales.gray["200"],
|
|
1821
|
+
strokeWidth: "1",
|
|
1822
|
+
strokeDasharray: "3 3",
|
|
1823
|
+
opacity: "0.6"
|
|
1824
|
+
}
|
|
1825
|
+
),
|
|
1826
|
+
/* @__PURE__ */ React6.createElement(
|
|
1827
|
+
"polygon",
|
|
1828
|
+
{
|
|
1829
|
+
points: outerPts,
|
|
1830
|
+
fill: "none",
|
|
1831
|
+
stroke: colorScales.gray["200"],
|
|
1832
|
+
strokeWidth: "1.5",
|
|
1833
|
+
strokeDasharray: "4 3"
|
|
1834
|
+
}
|
|
1835
|
+
)
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
// src/CompassCardHorizontalMeta.jsx
|
|
1840
|
+
import React9 from "react";
|
|
1841
|
+
|
|
1842
|
+
// src/IconOverlay.jsx
|
|
1843
|
+
import React8, { useState as useState4 } from "react";
|
|
1844
|
+
import {
|
|
1845
|
+
useFloating,
|
|
1846
|
+
useHover,
|
|
1847
|
+
useFocus,
|
|
1848
|
+
useDismiss,
|
|
1849
|
+
useRole,
|
|
1850
|
+
useInteractions,
|
|
1851
|
+
FloatingPortal,
|
|
1852
|
+
offset,
|
|
1853
|
+
flip,
|
|
1854
|
+
shift,
|
|
1855
|
+
autoUpdate
|
|
1856
|
+
} from "@floating-ui/react";
|
|
1857
|
+
|
|
1858
|
+
// src/icons.js
|
|
1859
|
+
import React7 from "react";
|
|
1860
|
+
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
1861
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1862
|
+
"svg",
|
|
1863
|
+
{
|
|
1864
|
+
width: size,
|
|
1865
|
+
height: size,
|
|
1866
|
+
viewBox: "0 0 24 24",
|
|
1867
|
+
fill: "none",
|
|
1868
|
+
stroke: color,
|
|
1869
|
+
strokeWidth: "2",
|
|
1870
|
+
strokeLinecap: "round",
|
|
1871
|
+
strokeLinejoin: "round",
|
|
1872
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1873
|
+
},
|
|
1874
|
+
/* @__PURE__ */ React7.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
1875
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
1876
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M22 19H2" })
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
1880
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1881
|
+
"svg",
|
|
1882
|
+
{
|
|
1883
|
+
width: size,
|
|
1884
|
+
height: size,
|
|
1885
|
+
viewBox: "0 0 24 24",
|
|
1886
|
+
fill: "none",
|
|
1887
|
+
stroke: color,
|
|
1888
|
+
strokeWidth: "2",
|
|
1889
|
+
strokeLinecap: "round",
|
|
1890
|
+
strokeLinejoin: "round",
|
|
1891
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1892
|
+
},
|
|
1893
|
+
/* @__PURE__ */ React7.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1894
|
+
/* @__PURE__ */ React7.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" })
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
1898
|
+
let paths;
|
|
1899
|
+
switch (branch) {
|
|
1900
|
+
case "executive":
|
|
1901
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ React7.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ React7.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ React7.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ React7.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
1902
|
+
break;
|
|
1903
|
+
case "legislative":
|
|
1904
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.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__ */ React7.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ React7.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ React7.createElement("path", { d: "M15 12h-5" }));
|
|
1905
|
+
break;
|
|
1906
|
+
case "judicial":
|
|
1907
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ React7.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ React7.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React7.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React7.createElement("path", { d: "M8 21h8" }));
|
|
1908
|
+
break;
|
|
1909
|
+
default:
|
|
1910
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ React7.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__ */ React7.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ React7.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ React7.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ React7.createElement("path", { d: "M6 18v-7" }));
|
|
1911
|
+
break;
|
|
1912
|
+
}
|
|
1913
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1914
|
+
"svg",
|
|
1915
|
+
{
|
|
1916
|
+
width: size,
|
|
1917
|
+
height: size,
|
|
1918
|
+
viewBox: "0 0 24 24",
|
|
1919
|
+
fill: "none",
|
|
1920
|
+
stroke: color,
|
|
1921
|
+
strokeWidth: "2",
|
|
1922
|
+
strokeLinecap: "round",
|
|
1923
|
+
strokeLinejoin: "round",
|
|
1924
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1925
|
+
},
|
|
1926
|
+
paths
|
|
1927
|
+
);
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
// src/IconOverlay.jsx
|
|
1931
|
+
function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps = {}, onClick }) {
|
|
1932
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1933
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
1934
|
+
open: isOpen,
|
|
1935
|
+
onOpenChange: setIsOpen,
|
|
1936
|
+
middleware: [offset(8), flip(), shift({ padding: 4 })],
|
|
1937
|
+
whileElementsMounted: autoUpdate
|
|
1938
|
+
});
|
|
1939
|
+
const hover = useHover(context);
|
|
1940
|
+
const focus2 = useFocus(context);
|
|
1941
|
+
const dismiss = useDismiss(context);
|
|
1942
|
+
const role = useRole(context, { role: "tooltip" });
|
|
1943
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
1944
|
+
hover,
|
|
1945
|
+
focus2,
|
|
1946
|
+
dismiss,
|
|
1947
|
+
role
|
|
1948
|
+
]);
|
|
1949
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
1950
|
+
"span",
|
|
1951
|
+
{
|
|
1952
|
+
ref: refs.setReference,
|
|
1953
|
+
"aria-label": tooltip,
|
|
1954
|
+
tabIndex: 0,
|
|
1955
|
+
style: { display: "inline-flex", padding: spacing[1], ...onClick ? { cursor: "pointer" } : {} },
|
|
1956
|
+
...getReferenceProps(),
|
|
1957
|
+
onClick: onClick ? (e) => {
|
|
1958
|
+
e.stopPropagation();
|
|
1959
|
+
onClick(e);
|
|
1960
|
+
} : void 0
|
|
1961
|
+
},
|
|
1962
|
+
/* @__PURE__ */ React8.createElement(IconComponent, { size, color, ...extraProps })
|
|
1963
|
+
), isOpen && /* @__PURE__ */ React8.createElement(FloatingPortal, null, /* @__PURE__ */ React8.createElement(
|
|
1964
|
+
"div",
|
|
1965
|
+
{
|
|
1966
|
+
ref: refs.setFloating,
|
|
1967
|
+
style: {
|
|
1968
|
+
...floatingStyles,
|
|
1969
|
+
zIndex: 70,
|
|
1970
|
+
background: semanticTokens.light.tooltip.background,
|
|
1971
|
+
color: semanticTokens.light.tooltip.text,
|
|
1972
|
+
padding: "4px 8px",
|
|
1973
|
+
borderRadius: "6px",
|
|
1974
|
+
fontSize: "14px",
|
|
1975
|
+
fontFamily: "'Manrope', sans-serif",
|
|
1976
|
+
pointerEvents: "none",
|
|
1977
|
+
whiteSpace: "nowrap"
|
|
1978
|
+
},
|
|
1979
|
+
...getFloatingProps()
|
|
1980
|
+
},
|
|
1981
|
+
tooltip
|
|
1982
|
+
)));
|
|
1983
|
+
}
|
|
1984
|
+
function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
1985
|
+
if (!ballot && !hasStances && !branch) return null;
|
|
1986
|
+
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;
|
|
1987
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1988
|
+
"div",
|
|
1989
|
+
{
|
|
1990
|
+
style: {
|
|
1991
|
+
display: "flex",
|
|
1992
|
+
gap: 4,
|
|
1993
|
+
alignItems: "center",
|
|
1994
|
+
justifyContent: "flex-start",
|
|
1995
|
+
padding: 0,
|
|
1996
|
+
marginLeft: "-4px"
|
|
1997
|
+
// offset icon wrapper padding so icons align flush-left with text
|
|
1998
|
+
}
|
|
1999
|
+
},
|
|
2000
|
+
ballot && /* @__PURE__ */ React8.createElement(
|
|
2001
|
+
IconWithTooltip,
|
|
2002
|
+
{
|
|
2003
|
+
IconComponent: BallotIcon,
|
|
2004
|
+
color: colors.evMutedBlue,
|
|
2005
|
+
tooltip: ballotTooltip,
|
|
2006
|
+
size: 14
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
hasStances && /* @__PURE__ */ React8.createElement(
|
|
2010
|
+
IconWithTooltip,
|
|
2011
|
+
{
|
|
2012
|
+
IconComponent: CompassIcon,
|
|
2013
|
+
color: colors.evMutedBlue,
|
|
2014
|
+
tooltip: "Compare your views",
|
|
2015
|
+
size: 14,
|
|
2016
|
+
onClick: onCompassClick
|
|
2017
|
+
}
|
|
2018
|
+
),
|
|
2019
|
+
branch && /* @__PURE__ */ React8.createElement(
|
|
2020
|
+
IconWithTooltip,
|
|
2021
|
+
{
|
|
2022
|
+
IconComponent: BranchIcon,
|
|
2023
|
+
color: colors.evMutedBlue,
|
|
2024
|
+
tooltip: `${branch} branch`,
|
|
2025
|
+
size: 14,
|
|
2026
|
+
extraProps: { branch: branch.toLowerCase() }
|
|
2027
|
+
}
|
|
2028
|
+
)
|
|
2029
|
+
);
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
// src/CompassCardHorizontalMeta.jsx
|
|
2033
|
+
function CompassCardHorizontalMeta({
|
|
2034
|
+
politician,
|
|
2035
|
+
surface = "representatives",
|
|
2036
|
+
userAnswers
|
|
2037
|
+
}) {
|
|
2038
|
+
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2039
|
+
return /* @__PURE__ */ React9.createElement("div", { style: {
|
|
2040
|
+
flex: 1,
|
|
2041
|
+
minWidth: 0,
|
|
2042
|
+
display: "flex",
|
|
2043
|
+
flexDirection: "column",
|
|
2044
|
+
gap: spacing[1]
|
|
2045
|
+
} }, /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2046
|
+
fontFamily: fonts.primary,
|
|
2047
|
+
fontSize: fontSizes.lg,
|
|
2048
|
+
fontWeight: fontWeights.semibold,
|
|
2049
|
+
lineHeight: 1.4,
|
|
2050
|
+
color: colors.evMutedBlue,
|
|
2051
|
+
margin: 0
|
|
2052
|
+
} }, politician.full_name), /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2053
|
+
fontFamily: fonts.primary,
|
|
2054
|
+
fontSize: fontSizes.sm,
|
|
2055
|
+
fontWeight: fontWeights.semibold,
|
|
2056
|
+
lineHeight: 1.4,
|
|
2057
|
+
color: colors.textSecondary,
|
|
2058
|
+
margin: 0,
|
|
2059
|
+
overflow: "hidden",
|
|
2060
|
+
display: "-webkit-box",
|
|
2061
|
+
WebkitLineClamp: 2,
|
|
2062
|
+
WebkitBoxOrient: "vertical"
|
|
2063
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2064
|
+
fontFamily: fonts.primary,
|
|
2065
|
+
fontSize: fontSizes.sm,
|
|
2066
|
+
fontWeight: fontWeights.regular,
|
|
2067
|
+
lineHeight: 1.5,
|
|
2068
|
+
color: colors.textMuted,
|
|
2069
|
+
margin: 0,
|
|
2070
|
+
overflow: "hidden",
|
|
2071
|
+
textOverflow: "ellipsis",
|
|
2072
|
+
whiteSpace: "nowrap"
|
|
2073
|
+
} }, politician.district_label), /* @__PURE__ */ React9.createElement(
|
|
2074
|
+
IconOverlay,
|
|
2075
|
+
{
|
|
2076
|
+
ballot: politician.ballot || null,
|
|
2077
|
+
hasStances: Boolean(userAnswers && userAnswers.length > 0) || Boolean(politician.hasStances),
|
|
2078
|
+
branch: politician.branch || null
|
|
2079
|
+
}
|
|
2080
|
+
));
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
// src/compassHelpers.js
|
|
2084
|
+
function buildAnswerMapByShortTitle(allTopics, allAnswers, allowedShorts) {
|
|
2085
|
+
var _a;
|
|
2086
|
+
const allowed = new Set(allowedShorts.map((s) => s.toLowerCase()));
|
|
2087
|
+
const topicById = new Map(allTopics.map((t) => [t.id, t]));
|
|
2088
|
+
const shortById = new Map(allTopics.map((t) => [t.id, t.short_title]));
|
|
2089
|
+
const out = {};
|
|
2090
|
+
const topicByShortLower = new Map(allTopics.map((t) => [t.short_title.toLowerCase(), t]));
|
|
2091
|
+
for (const s of allowedShorts) {
|
|
2092
|
+
const t = topicByShortLower.get(s.toLowerCase());
|
|
2093
|
+
if (t) out[t.short_title] = 0;
|
|
2094
|
+
}
|
|
2095
|
+
for (const a of allAnswers) {
|
|
2096
|
+
const st = shortById.get(a.topic_id);
|
|
2097
|
+
if (!st) continue;
|
|
2098
|
+
if (allowed.has(String(st).toLowerCase())) {
|
|
2099
|
+
out[st] = (_a = a.value) != null ? _a : 0;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
const topicByShort = new Map(allTopics.map((t) => [t.short_title.toLowerCase(), t]));
|
|
2103
|
+
const topicsFiltered = allowedShorts.map((s) => topicByShort.get(s.toLowerCase())).filter(Boolean);
|
|
2104
|
+
return { topicsFiltered, answersByShort: out };
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
// src/CompassCardHorizontal.jsx
|
|
2108
|
+
var RADAR_SIZE = 250;
|
|
2109
|
+
var SLOT_WIDTH = 260;
|
|
2110
|
+
function CompassCardHorizontal({
|
|
2111
|
+
politician,
|
|
2112
|
+
userAnswers = null,
|
|
2113
|
+
tierVisuals = null,
|
|
2114
|
+
view = "compass",
|
|
2115
|
+
surface = "representatives",
|
|
2116
|
+
variant = "compass",
|
|
2117
|
+
onBuildCompass = null,
|
|
2118
|
+
onClick
|
|
2119
|
+
}) {
|
|
2120
|
+
var _a;
|
|
2121
|
+
const [hovered, setHovered] = useState5(false);
|
|
2122
|
+
const [focused, setFocused] = useState5(false);
|
|
2123
|
+
const [imgError, setImgError] = useState5(false);
|
|
2124
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = useState5(false);
|
|
2125
|
+
useEffect5(() => {
|
|
2126
|
+
setImgError(false);
|
|
2127
|
+
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2128
|
+
const cardStyle = {
|
|
2129
|
+
position: "relative",
|
|
2130
|
+
display: "flex",
|
|
2131
|
+
flexDirection: "row",
|
|
2132
|
+
alignItems: "center",
|
|
2133
|
+
backgroundColor: (_a = tierVisuals == null ? void 0 : tierVisuals.bg) != null ? _a : colors.bgWhite,
|
|
2134
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2135
|
+
borderRadius: borderRadius.xl,
|
|
2136
|
+
overflow: "hidden",
|
|
2137
|
+
// clips slot corners via card border-radius — no padding needed
|
|
2138
|
+
boxShadow: focused ? focus.ring : hovered ? shadows.cardHover : shadows.md,
|
|
2139
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
2140
|
+
transition: `box-shadow ${duration.normal} ease, transform ${duration.normal} ease`,
|
|
2141
|
+
cursor: onClick ? "pointer" : "default",
|
|
2142
|
+
fontFamily: fonts.primary,
|
|
2143
|
+
outline: "none"
|
|
2144
|
+
};
|
|
2145
|
+
const slotStyle = { width: SLOT_WIDTH, height: SLOT_WIDTH, flexShrink: 0, overflow: "hidden", position: "relative" };
|
|
2146
|
+
function renderCompass() {
|
|
2147
|
+
var _a2, _b, _c;
|
|
2148
|
+
if (!userAnswers || userAnswers.length === 0) {
|
|
2149
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2150
|
+
}
|
|
2151
|
+
let topics = [];
|
|
2152
|
+
let data = {};
|
|
2153
|
+
let compareData = {};
|
|
2154
|
+
try {
|
|
2155
|
+
if (Array.isArray(userAnswers) && userAnswers.length > 0) {
|
|
2156
|
+
const hasEmbeddedTopics = (_b = (_a2 = userAnswers[0]) == null ? void 0 : _a2.topic) == null ? void 0 : _b.short_title;
|
|
2157
|
+
if (hasEmbeddedTopics) {
|
|
2158
|
+
const allowedShorts = userAnswers.map((a) => a.topic.short_title);
|
|
2159
|
+
const allTopics = userAnswers.map((a) => a.topic);
|
|
2160
|
+
const { topicsFiltered, answersByShort } = buildAnswerMapByShortTitle(
|
|
2161
|
+
allTopics,
|
|
2162
|
+
userAnswers,
|
|
2163
|
+
allowedShorts
|
|
2164
|
+
);
|
|
2165
|
+
topics = topicsFiltered;
|
|
2166
|
+
data = answersByShort;
|
|
2167
|
+
} else {
|
|
2168
|
+
if (!Array.isArray(userAnswers[0])) {
|
|
2169
|
+
topics = userAnswers.filter((a) => a.short_title).map((a) => ({ id: a.topic_id || a.short_title, short_title: a.short_title, title: a.short_title }));
|
|
2170
|
+
data = {};
|
|
2171
|
+
for (const a of userAnswers) {
|
|
2172
|
+
if (a.short_title) data[a.short_title] = (_c = a.value) != null ? _c : 0;
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
if ((politician == null ? void 0 : politician.stances) && typeof politician.stances === "object") {
|
|
2178
|
+
compareData = Array.isArray(politician.stances) ? politician.stances.reduce((acc, s) => {
|
|
2179
|
+
var _a3;
|
|
2180
|
+
if (s.short_title) acc[s.short_title] = (_a3 = s.value) != null ? _a3 : 0;
|
|
2181
|
+
return acc;
|
|
2182
|
+
}, {}) : politician.stances;
|
|
2183
|
+
}
|
|
2184
|
+
if (topics.length === 0) {
|
|
2185
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2186
|
+
}
|
|
2187
|
+
} catch (err) {
|
|
2188
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2189
|
+
}
|
|
2190
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2191
|
+
RadarChartCore,
|
|
2192
|
+
{
|
|
2193
|
+
topics,
|
|
2194
|
+
data,
|
|
2195
|
+
compareData,
|
|
2196
|
+
invertedSpokes: {},
|
|
2197
|
+
onToggleInversion: () => {
|
|
2198
|
+
},
|
|
2199
|
+
onReplaceTopic: () => {
|
|
2200
|
+
},
|
|
2201
|
+
size: RADAR_SIZE,
|
|
2202
|
+
padding: 20,
|
|
2203
|
+
labelOffset: 5,
|
|
2204
|
+
labelFontSize: 12
|
|
2205
|
+
}
|
|
2206
|
+
);
|
|
2207
|
+
}
|
|
2208
|
+
function renderPortrait() {
|
|
2209
|
+
var _a2, _b, _c;
|
|
2210
|
+
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;
|
|
2211
|
+
if (imageSrc && !imgError) {
|
|
2212
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2213
|
+
"img",
|
|
2214
|
+
{
|
|
2215
|
+
src: imageSrc,
|
|
2216
|
+
alt: `${politician.full_name} portrait`,
|
|
2217
|
+
style: {
|
|
2218
|
+
width: "100%",
|
|
2219
|
+
height: "100%",
|
|
2220
|
+
objectFit: "cover",
|
|
2221
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2222
|
+
display: "block"
|
|
2223
|
+
},
|
|
2224
|
+
onError: () => setImgError(true)
|
|
2225
|
+
}
|
|
2226
|
+
);
|
|
2227
|
+
}
|
|
2228
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2229
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2230
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2231
|
+
width: "100%",
|
|
2232
|
+
height: "100%",
|
|
2233
|
+
backgroundColor: colors.evMutedBlue,
|
|
2234
|
+
color: colors.textWhite,
|
|
2235
|
+
display: "flex",
|
|
2236
|
+
alignItems: "center",
|
|
2237
|
+
justifyContent: "center",
|
|
2238
|
+
fontFamily: fonts.primary,
|
|
2239
|
+
fontWeight: fontWeights.bold,
|
|
2240
|
+
fontSize: fontSizes["4xl"]
|
|
2241
|
+
} }, initials);
|
|
2242
|
+
}
|
|
2243
|
+
function renderEmptyVariant() {
|
|
2244
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2245
|
+
width: "100%",
|
|
2246
|
+
height: "100%",
|
|
2247
|
+
display: "flex",
|
|
2248
|
+
flexDirection: "column",
|
|
2249
|
+
alignItems: "center",
|
|
2250
|
+
justifyContent: "center",
|
|
2251
|
+
gap: "8px",
|
|
2252
|
+
padding: "12px 14px",
|
|
2253
|
+
boxSizing: "border-box",
|
|
2254
|
+
backgroundColor: colorScales.teal["050"]
|
|
2255
|
+
} }, /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: 140, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ React10.createElement("p", { style: {
|
|
2256
|
+
margin: 0,
|
|
2257
|
+
fontSize: fontSizes.xs,
|
|
2258
|
+
color: colors.textMuted,
|
|
2259
|
+
textAlign: "center",
|
|
2260
|
+
lineHeight: 1.4,
|
|
2261
|
+
fontFamily: fonts.primary
|
|
2262
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ React10.createElement(
|
|
2263
|
+
"button",
|
|
2264
|
+
{
|
|
2265
|
+
type: "button",
|
|
2266
|
+
onClick: onBuildCompass || void 0,
|
|
2267
|
+
onMouseEnter: () => setEmptyCtaHovered(true),
|
|
2268
|
+
onMouseLeave: () => setEmptyCtaHovered(false),
|
|
2269
|
+
style: {
|
|
2270
|
+
minWidth: "160px",
|
|
2271
|
+
height: "40px",
|
|
2272
|
+
padding: "0 16px",
|
|
2273
|
+
backgroundColor: emptyCtaHovered ? semanticTokens.light.buttonPrimary.background.hovered : semanticTokens.light.buttonPrimary.background.default,
|
|
2274
|
+
color: colors.textWhite,
|
|
2275
|
+
fontSize: fontSizes.xs,
|
|
2276
|
+
fontWeight: fontWeights.semibold,
|
|
2277
|
+
fontFamily: fonts.primary,
|
|
2278
|
+
borderRadius: borderRadius.full,
|
|
2279
|
+
border: "none",
|
|
2280
|
+
cursor: onBuildCompass ? "pointer" : "default",
|
|
2281
|
+
whiteSpace: "nowrap",
|
|
2282
|
+
transition: `background ${duration.normal} ease`,
|
|
2283
|
+
flexShrink: 0
|
|
2284
|
+
}
|
|
2285
|
+
},
|
|
2286
|
+
"Calibrate your compass"
|
|
2287
|
+
));
|
|
2288
|
+
}
|
|
2289
|
+
function renderUnavailablePlate() {
|
|
2290
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2291
|
+
width: "100%",
|
|
2292
|
+
height: "100%",
|
|
2293
|
+
backgroundColor: colorScales.teal["050"],
|
|
2294
|
+
display: "flex",
|
|
2295
|
+
alignItems: "center",
|
|
2296
|
+
justifyContent: "center",
|
|
2297
|
+
padding: spacing[4],
|
|
2298
|
+
boxSizing: "border-box"
|
|
2299
|
+
} }, /* @__PURE__ */ React10.createElement("p", { style: {
|
|
2300
|
+
fontSize: fontSizes.sm,
|
|
2301
|
+
fontWeight: fontWeights.semibold,
|
|
2302
|
+
lineHeight: 1.4,
|
|
2303
|
+
color: colors.textMuted,
|
|
2304
|
+
textAlign: "center",
|
|
2305
|
+
maxWidth: "180px",
|
|
2306
|
+
margin: 0,
|
|
2307
|
+
fontFamily: fonts.primary
|
|
2308
|
+
} }, "Compass currently unavailable for this role."));
|
|
2309
|
+
}
|
|
2310
|
+
function renderSlotContent() {
|
|
2311
|
+
if (view === "portrait") return renderPortrait();
|
|
2312
|
+
if (variant === "empty") return renderEmptyVariant();
|
|
2313
|
+
if (variant === "administrative" || variant === "judicial") return renderUnavailablePlate();
|
|
2314
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2315
|
+
width: "100%",
|
|
2316
|
+
height: "100%",
|
|
2317
|
+
display: "flex",
|
|
2318
|
+
alignItems: "center",
|
|
2319
|
+
justifyContent: "center",
|
|
2320
|
+
padding: spacing[3],
|
|
2321
|
+
boxSizing: "border-box"
|
|
2322
|
+
} }, renderCompass());
|
|
2323
|
+
}
|
|
2324
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2325
|
+
"div",
|
|
2326
|
+
{
|
|
2327
|
+
role: "article",
|
|
2328
|
+
"aria-label": `${politician.full_name}, ${politician.office_title || ""}`,
|
|
2329
|
+
tabIndex: 0,
|
|
2330
|
+
style: cardStyle,
|
|
2331
|
+
onClick,
|
|
2332
|
+
onKeyDown: (e) => {
|
|
2333
|
+
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
2334
|
+
e.preventDefault();
|
|
2335
|
+
onClick();
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
onMouseEnter: () => setHovered(true),
|
|
2339
|
+
onMouseLeave: () => setHovered(false),
|
|
2340
|
+
onFocus: () => setFocused(true),
|
|
2341
|
+
onBlur: () => setFocused(false)
|
|
2342
|
+
},
|
|
2343
|
+
/* @__PURE__ */ React10.createElement("div", { style: slotStyle }, renderSlotContent(), surface === "elections" && politician.running_unopposed && /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2344
|
+
position: "absolute",
|
|
2345
|
+
bottom: "15px",
|
|
2346
|
+
left: 0,
|
|
2347
|
+
width: "100%",
|
|
2348
|
+
backgroundColor: "rgba(0,0,0,0.35)",
|
|
2349
|
+
color: "#fff",
|
|
2350
|
+
fontSize: "12px",
|
|
2351
|
+
fontWeight: 700,
|
|
2352
|
+
letterSpacing: "0.4px",
|
|
2353
|
+
textAlign: "center",
|
|
2354
|
+
textTransform: "uppercase",
|
|
2355
|
+
padding: "6px 0",
|
|
2356
|
+
pointerEvents: "none"
|
|
2357
|
+
} }, "Running Unopposed")),
|
|
2358
|
+
/* @__PURE__ */ React10.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ React10.createElement(
|
|
2359
|
+
CompassCardHorizontalMeta,
|
|
2360
|
+
{
|
|
2361
|
+
politician,
|
|
2362
|
+
surface,
|
|
2363
|
+
userAnswers
|
|
2364
|
+
}
|
|
2365
|
+
))
|
|
2366
|
+
);
|
|
2367
|
+
}
|
|
2368
|
+
|
|
1760
2369
|
// src/CategorySection.jsx
|
|
1761
|
-
import
|
|
2370
|
+
import React11, { useState as useState6 } from "react";
|
|
1762
2371
|
function CategorySection({
|
|
1763
2372
|
title,
|
|
1764
2373
|
infoTooltip,
|
|
@@ -1768,7 +2377,7 @@ function CategorySection({
|
|
|
1768
2377
|
tier
|
|
1769
2378
|
}) {
|
|
1770
2379
|
var _a, _b;
|
|
1771
|
-
const [showTooltip, setShowTooltip] =
|
|
2380
|
+
const [showTooltip, setShowTooltip] = useState6(false);
|
|
1772
2381
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
1773
2382
|
const styles2 = {
|
|
1774
2383
|
section: {
|
|
@@ -1836,7 +2445,7 @@ function CategorySection({
|
|
|
1836
2445
|
gap: spacing[4]
|
|
1837
2446
|
}
|
|
1838
2447
|
};
|
|
1839
|
-
return /* @__PURE__ */
|
|
2448
|
+
return /* @__PURE__ */ React11.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ React11.createElement("div", { style: styles2.header }, /* @__PURE__ */ React11.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ React11.createElement(
|
|
1840
2449
|
"button",
|
|
1841
2450
|
{
|
|
1842
2451
|
type: "button",
|
|
@@ -1848,8 +2457,8 @@ function CategorySection({
|
|
|
1848
2457
|
"aria-label": `Info about ${title}`
|
|
1849
2458
|
},
|
|
1850
2459
|
"i",
|
|
1851
|
-
showTooltip && /* @__PURE__ */
|
|
1852
|
-
), websiteUrl && /* @__PURE__ */
|
|
2460
|
+
showTooltip && /* @__PURE__ */ React11.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
2461
|
+
), websiteUrl && /* @__PURE__ */ React11.createElement(
|
|
1853
2462
|
"a",
|
|
1854
2463
|
{
|
|
1855
2464
|
href: websiteUrl,
|
|
@@ -1858,7 +2467,7 @@ function CategorySection({
|
|
|
1858
2467
|
style: styles2.externalLink,
|
|
1859
2468
|
"aria-label": `Visit official website for ${title}`
|
|
1860
2469
|
},
|
|
1861
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ React11.createElement(
|
|
1862
2471
|
"svg",
|
|
1863
2472
|
{
|
|
1864
2473
|
viewBox: "0 0 24 24",
|
|
@@ -1866,7 +2475,7 @@ function CategorySection({
|
|
|
1866
2475
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1867
2476
|
style: { width: "14px", height: "14px" }
|
|
1868
2477
|
},
|
|
1869
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ React11.createElement(
|
|
1870
2479
|
"path",
|
|
1871
2480
|
{
|
|
1872
2481
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -1877,11 +2486,11 @@ function CategorySection({
|
|
|
1877
2486
|
}
|
|
1878
2487
|
)
|
|
1879
2488
|
)
|
|
1880
|
-
)), /* @__PURE__ */
|
|
2489
|
+
)), /* @__PURE__ */ React11.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
1881
2490
|
}
|
|
1882
2491
|
|
|
1883
2492
|
// src/SubGroupSection.jsx
|
|
1884
|
-
import
|
|
2493
|
+
import React12 from "react";
|
|
1885
2494
|
function SubGroupSection({ title, websiteUrl, children }) {
|
|
1886
2495
|
const styles2 = {
|
|
1887
2496
|
section: {
|
|
@@ -1914,7 +2523,7 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
1914
2523
|
gap: spacing[2]
|
|
1915
2524
|
}
|
|
1916
2525
|
};
|
|
1917
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ React12.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ React12.createElement("div", { style: styles2.header }, /* @__PURE__ */ React12.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ React12.createElement(
|
|
1918
2527
|
"a",
|
|
1919
2528
|
{
|
|
1920
2529
|
href: websiteUrl,
|
|
@@ -1922,12 +2531,12 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
1922
2531
|
rel: "noopener noreferrer",
|
|
1923
2532
|
style: styles2.link
|
|
1924
2533
|
},
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
)), /* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ React12.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ React12.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React12.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" }))
|
|
2535
|
+
)), /* @__PURE__ */ React12.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
1927
2536
|
}
|
|
1928
2537
|
|
|
1929
2538
|
// src/GovernmentBodySection.jsx
|
|
1930
|
-
import
|
|
2539
|
+
import React13, { useState as useState7 } from "react";
|
|
1931
2540
|
function GovernmentBodySection({
|
|
1932
2541
|
title,
|
|
1933
2542
|
websiteUrl,
|
|
@@ -1936,7 +2545,7 @@ function GovernmentBodySection({
|
|
|
1936
2545
|
children
|
|
1937
2546
|
}) {
|
|
1938
2547
|
var _a;
|
|
1939
|
-
const [expanded, setExpanded] =
|
|
2548
|
+
const [expanded, setExpanded] = useState7(defaultExpanded);
|
|
1940
2549
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
1941
2550
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
1942
2551
|
const styles2 = {
|
|
@@ -1976,7 +2585,7 @@ function GovernmentBodySection({
|
|
|
1976
2585
|
display: expanded ? "block" : "none"
|
|
1977
2586
|
}
|
|
1978
2587
|
};
|
|
1979
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ React13.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ React13.createElement(
|
|
1980
2589
|
"div",
|
|
1981
2590
|
{
|
|
1982
2591
|
style: styles2.header,
|
|
@@ -1992,8 +2601,8 @@ function GovernmentBodySection({
|
|
|
1992
2601
|
"aria-expanded": expanded,
|
|
1993
2602
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
1994
2603
|
},
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
websiteUrl && /* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ React13.createElement("span", { style: styles2.title }, title),
|
|
2605
|
+
websiteUrl && /* @__PURE__ */ React13.createElement(
|
|
1997
2606
|
"a",
|
|
1998
2607
|
{
|
|
1999
2608
|
href: websiteUrl,
|
|
@@ -2003,14 +2612,14 @@ function GovernmentBodySection({
|
|
|
2003
2612
|
onClick: (e) => e.stopPropagation(),
|
|
2004
2613
|
"aria-label": `Visit ${title} website`
|
|
2005
2614
|
},
|
|
2006
|
-
/* @__PURE__ */
|
|
2615
|
+
/* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ React13.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React13.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" }))
|
|
2007
2616
|
),
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
), /* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ React13.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
2618
|
+
), /* @__PURE__ */ React13.createElement("div", { style: styles2.content }, children));
|
|
2010
2619
|
}
|
|
2011
2620
|
|
|
2012
2621
|
// src/SocialLinks.jsx
|
|
2013
|
-
import
|
|
2622
|
+
import React14 from "react";
|
|
2014
2623
|
var SOCIAL_PLATFORMS = [
|
|
2015
2624
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
2016
2625
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -2081,7 +2690,7 @@ function SocialLinks({
|
|
|
2081
2690
|
}
|
|
2082
2691
|
};
|
|
2083
2692
|
const platformIconMap = {
|
|
2084
|
-
twitter: /* @__PURE__ */
|
|
2693
|
+
twitter: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement(
|
|
2085
2694
|
"path",
|
|
2086
2695
|
{
|
|
2087
2696
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -2091,7 +2700,7 @@ function SocialLinks({
|
|
|
2091
2700
|
strokeLinejoin: "round"
|
|
2092
2701
|
}
|
|
2093
2702
|
)),
|
|
2094
|
-
facebook: /* @__PURE__ */
|
|
2703
|
+
facebook: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement(
|
|
2095
2704
|
"path",
|
|
2096
2705
|
{
|
|
2097
2706
|
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",
|
|
@@ -2101,8 +2710,8 @@ function SocialLinks({
|
|
|
2101
2710
|
strokeLinejoin: "round"
|
|
2102
2711
|
}
|
|
2103
2712
|
)),
|
|
2104
|
-
instagram: /* @__PURE__ */
|
|
2105
|
-
linkedin: /* @__PURE__ */
|
|
2713
|
+
instagram: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
2714
|
+
linkedin: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement(
|
|
2106
2715
|
"path",
|
|
2107
2716
|
{
|
|
2108
2717
|
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",
|
|
@@ -2111,8 +2720,8 @@ function SocialLinks({
|
|
|
2111
2720
|
strokeLinecap: "round",
|
|
2112
2721
|
strokeLinejoin: "round"
|
|
2113
2722
|
}
|
|
2114
|
-
), /* @__PURE__ */
|
|
2115
|
-
youtube: /* @__PURE__ */
|
|
2723
|
+
), /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React14.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
2724
|
+
youtube: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
2116
2725
|
};
|
|
2117
2726
|
const links = [
|
|
2118
2727
|
{
|
|
@@ -2138,7 +2747,7 @@ function SocialLinks({
|
|
|
2138
2747
|
{
|
|
2139
2748
|
href: website,
|
|
2140
2749
|
label: "Website",
|
|
2141
|
-
icon: /* @__PURE__ */
|
|
2750
|
+
icon: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement(
|
|
2142
2751
|
"path",
|
|
2143
2752
|
{
|
|
2144
2753
|
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",
|
|
@@ -2168,7 +2777,7 @@ function SocialLinks({
|
|
|
2168
2777
|
if (links.length === 0) {
|
|
2169
2778
|
return null;
|
|
2170
2779
|
}
|
|
2171
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ React14.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ React14.createElement(
|
|
2172
2781
|
"a",
|
|
2173
2782
|
{
|
|
2174
2783
|
key: link.label,
|
|
@@ -2191,7 +2800,7 @@ function SocialLinks({
|
|
|
2191
2800
|
}
|
|
2192
2801
|
|
|
2193
2802
|
// src/IssueTags.jsx
|
|
2194
|
-
import
|
|
2803
|
+
import React15 from "react";
|
|
2195
2804
|
function IssueTags({
|
|
2196
2805
|
tags = [],
|
|
2197
2806
|
selectedTags = [],
|
|
@@ -2234,9 +2843,9 @@ function IssueTags({
|
|
|
2234
2843
|
onTagClick(tag.value);
|
|
2235
2844
|
}
|
|
2236
2845
|
};
|
|
2237
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React15.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
2238
2847
|
const isSelected = selectedTags.includes(tag.value);
|
|
2239
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2240
2849
|
"span",
|
|
2241
2850
|
{
|
|
2242
2851
|
key: tag.value,
|
|
@@ -2265,7 +2874,7 @@ function IssueTags({
|
|
|
2265
2874
|
}
|
|
2266
2875
|
|
|
2267
2876
|
// src/CommitteeTable.jsx
|
|
2268
|
-
import
|
|
2877
|
+
import React16, { useState as useState8 } from "react";
|
|
2269
2878
|
var ROLE_ORDER = {
|
|
2270
2879
|
"chair": 0,
|
|
2271
2880
|
"co-chair": 1,
|
|
@@ -2292,7 +2901,7 @@ function CommitteeTable({
|
|
|
2292
2901
|
maxVisible = 6,
|
|
2293
2902
|
style = {}
|
|
2294
2903
|
}) {
|
|
2295
|
-
const [showAll, setShowAll] =
|
|
2904
|
+
const [showAll, setShowAll] = useState8(false);
|
|
2296
2905
|
if (committees.length === 0) {
|
|
2297
2906
|
return null;
|
|
2298
2907
|
}
|
|
@@ -2354,7 +2963,7 @@ function CommitteeTable({
|
|
|
2354
2963
|
cursor: "pointer"
|
|
2355
2964
|
}
|
|
2356
2965
|
};
|
|
2357
|
-
return /* @__PURE__ */
|
|
2966
|
+
return /* @__PURE__ */ React16.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ React16.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ React16.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React16.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ React16.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ React16.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ React16.createElement("table", { style: styles2.table }, /* @__PURE__ */ React16.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ React16.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ React16.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ React16.createElement(
|
|
2358
2967
|
"a",
|
|
2359
2968
|
{
|
|
2360
2969
|
href: committee.url,
|
|
@@ -2369,7 +2978,7 @@ function CommitteeTable({
|
|
|
2369
2978
|
}
|
|
2370
2979
|
},
|
|
2371
2980
|
committee.name
|
|
2372
|
-
) : committee.name), /* @__PURE__ */
|
|
2981
|
+
) : committee.name), /* @__PURE__ */ React16.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ React16.createElement(
|
|
2373
2982
|
"button",
|
|
2374
2983
|
{
|
|
2375
2984
|
type: "button",
|
|
@@ -2377,7 +2986,7 @@ function CommitteeTable({
|
|
|
2377
2986
|
onClick: () => setShowAll(!showAll)
|
|
2378
2987
|
},
|
|
2379
2988
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
2380
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ React16.createElement(
|
|
2381
2990
|
"svg",
|
|
2382
2991
|
{
|
|
2383
2992
|
width: "14",
|
|
@@ -2390,16 +2999,16 @@ function CommitteeTable({
|
|
|
2390
2999
|
strokeLinejoin: "round",
|
|
2391
3000
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
2392
3001
|
},
|
|
2393
|
-
/* @__PURE__ */
|
|
3002
|
+
/* @__PURE__ */ React16.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
2394
3003
|
)
|
|
2395
3004
|
));
|
|
2396
3005
|
}
|
|
2397
3006
|
|
|
2398
3007
|
// src/PoliticianProfile.jsx
|
|
2399
|
-
import
|
|
3008
|
+
import React19, { useState as useState9, useEffect as useEffect6 } from "react";
|
|
2400
3009
|
|
|
2401
3010
|
// src/LegislativeInlineSummary.jsx
|
|
2402
|
-
import
|
|
3011
|
+
import React17 from "react";
|
|
2403
3012
|
function normalizePosition(pos) {
|
|
2404
3013
|
if (!pos) return "";
|
|
2405
3014
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -2507,7 +3116,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
2507
3116
|
fontSize: fontSizes.sm,
|
|
2508
3117
|
fontWeight: fontWeights.medium
|
|
2509
3118
|
};
|
|
2510
|
-
return /* @__PURE__ */
|
|
3119
|
+
return /* @__PURE__ */ React17.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ React17.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ React17.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ React17.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ React17.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ React17.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ React17.createElement("div", null), /* @__PURE__ */ React17.createElement("div", { style: footerRow }, /* @__PURE__ */ React17.createElement(
|
|
2511
3120
|
"button",
|
|
2512
3121
|
{
|
|
2513
3122
|
onClick: () => {
|
|
@@ -2532,12 +3141,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
2532
3141
|
}
|
|
2533
3142
|
},
|
|
2534
3143
|
"View Full Legislative Record",
|
|
2535
|
-
/* @__PURE__ */
|
|
3144
|
+
/* @__PURE__ */ React17.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__ */ React17.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
2536
3145
|
)));
|
|
2537
3146
|
}
|
|
2538
3147
|
|
|
2539
3148
|
// src/JudicialScorecard.jsx
|
|
2540
|
-
import
|
|
3149
|
+
import React18 from "react";
|
|
2541
3150
|
|
|
2542
3151
|
// src/judicialUtils.js
|
|
2543
3152
|
function formatDate(dateStr) {
|
|
@@ -2655,7 +3264,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
2655
3264
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
2656
3265
|
}
|
|
2657
3266
|
};
|
|
2658
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ React18.createElement("section", { style: sectionStyle }, /* @__PURE__ */ React18.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ React18.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ React18.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ React18.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ React18.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ React18.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ React18.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ React18.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ React18.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ React18.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ React18.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ React18.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ React18.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ React18.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
2659
3268
|
}
|
|
2660
3269
|
|
|
2661
3270
|
// src/PoliticianProfile.jsx
|
|
@@ -2806,13 +3415,13 @@ function formatAddress(addr) {
|
|
|
2806
3415
|
if (cityStateZip) lines.push(cityStateZip);
|
|
2807
3416
|
return lines;
|
|
2808
3417
|
}
|
|
2809
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2810
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2811
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2812
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2813
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2814
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2815
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3418
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React19.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React19.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React19.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
3419
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React19.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
3420
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ React19.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
3421
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.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" }));
|
|
3422
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.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__ */ React19.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
3423
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React19.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" }));
|
|
3424
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ React19.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ React19.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
2816
3425
|
function PoliticianProfile({
|
|
2817
3426
|
politician = {},
|
|
2818
3427
|
onBack,
|
|
@@ -2839,8 +3448,8 @@ function PoliticianProfile({
|
|
|
2839
3448
|
return pol.photo_origin_url;
|
|
2840
3449
|
})();
|
|
2841
3450
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
2842
|
-
const [imgError, setImgError] =
|
|
2843
|
-
|
|
3451
|
+
const [imgError, setImgError] = useState9(false);
|
|
3452
|
+
useEffect6(() => {
|
|
2844
3453
|
setImgError(false);
|
|
2845
3454
|
}, [profileImageUrl]);
|
|
2846
3455
|
const getSocialHandle = (type) => {
|
|
@@ -3140,7 +3749,7 @@ function PoliticianProfile({
|
|
|
3140
3749
|
borderRadius: borderRadius.full
|
|
3141
3750
|
}
|
|
3142
3751
|
};
|
|
3143
|
-
return /* @__PURE__ */
|
|
3752
|
+
return /* @__PURE__ */ React19.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ React19.createElement(
|
|
3144
3753
|
"button",
|
|
3145
3754
|
{
|
|
3146
3755
|
type: "button",
|
|
@@ -3153,9 +3762,9 @@ function PoliticianProfile({
|
|
|
3153
3762
|
e.currentTarget.style.textDecoration = "none";
|
|
3154
3763
|
}
|
|
3155
3764
|
},
|
|
3156
|
-
/* @__PURE__ */
|
|
3765
|
+
/* @__PURE__ */ React19.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
3157
3766
|
label
|
|
3158
|
-
), /* @__PURE__ */
|
|
3767
|
+
), /* @__PURE__ */ React19.createElement("div", { style: styles2.card }, /* @__PURE__ */ React19.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ React19.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ React19.createElement(
|
|
3159
3768
|
"img",
|
|
3160
3769
|
{
|
|
3161
3770
|
src: profileImageUrl,
|
|
@@ -3163,7 +3772,7 @@ function PoliticianProfile({
|
|
|
3163
3772
|
style: styles2.photo,
|
|
3164
3773
|
onError: () => setImgError(true)
|
|
3165
3774
|
}
|
|
3166
|
-
) : /* @__PURE__ */
|
|
3775
|
+
) : /* @__PURE__ */ React19.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ React19.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ React19.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ React19.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ React19.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ React19.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ React19.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ React19.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ React19.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React19.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ React19.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React19.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ React19.createElement(
|
|
3167
3776
|
"a",
|
|
3168
3777
|
{
|
|
3169
3778
|
href: pol.web_form_url,
|
|
@@ -3177,9 +3786,9 @@ function PoliticianProfile({
|
|
|
3177
3786
|
e.currentTarget.style.background = colors.evTeal;
|
|
3178
3787
|
}
|
|
3179
3788
|
},
|
|
3180
|
-
/* @__PURE__ */
|
|
3789
|
+
/* @__PURE__ */ React19.createElement(ExternalLinkIcon, { size: 14 }),
|
|
3181
3790
|
"Submit a Message"
|
|
3182
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
3791
|
+
))), hasContactInfo && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", { style: divider }), /* @__PURE__ */ React19.createElement("div", { style: sectionHeading }, /* @__PURE__ */ React19.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ React19.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ React19.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ React19.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ React19.createElement(React19.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ React19.createElement("br", null))))))), hasPhones && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ React19.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ React19.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ React19.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ React19.createElement(
|
|
3183
3792
|
"a",
|
|
3184
3793
|
{
|
|
3185
3794
|
href: `tel:${phone}`,
|
|
@@ -3192,7 +3801,7 @@ function PoliticianProfile({
|
|
|
3192
3801
|
}
|
|
3193
3802
|
},
|
|
3194
3803
|
phone
|
|
3195
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
3804
|
+
)))))), hasEmails && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ React19.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ React19.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ React19.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ React19.createElement(
|
|
3196
3805
|
"a",
|
|
3197
3806
|
{
|
|
3198
3807
|
href: `mailto:${email}`,
|
|
@@ -3205,7 +3814,7 @@ function PoliticianProfile({
|
|
|
3205
3814
|
}
|
|
3206
3815
|
},
|
|
3207
3816
|
email
|
|
3208
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
3817
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ React19.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ React19.createElement(
|
|
3209
3818
|
"a",
|
|
3210
3819
|
{
|
|
3211
3820
|
href: url,
|
|
@@ -3220,7 +3829,7 @@ function PoliticianProfile({
|
|
|
3220
3829
|
}
|
|
3221
3830
|
},
|
|
3222
3831
|
extractDomain(url)
|
|
3223
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
3832
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ React19.createElement(
|
|
3224
3833
|
SocialLinks,
|
|
3225
3834
|
{
|
|
3226
3835
|
twitter,
|
|
@@ -3231,14 +3840,14 @@ function PoliticianProfile({
|
|
|
3231
3840
|
size: "sm",
|
|
3232
3841
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
3233
3842
|
}
|
|
3234
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
3843
|
+
)))), committees.length > 0 && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", { style: divider }), /* @__PURE__ */ React19.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ React19.createElement(
|
|
3235
3844
|
JudicialScorecard,
|
|
3236
3845
|
{
|
|
3237
3846
|
judicialRecord,
|
|
3238
3847
|
politicianId,
|
|
3239
3848
|
onNavigateToRecord
|
|
3240
3849
|
}
|
|
3241
|
-
) : /* @__PURE__ */
|
|
3850
|
+
) : /* @__PURE__ */ React19.createElement(
|
|
3242
3851
|
LegislativeInlineSummary,
|
|
3243
3852
|
{
|
|
3244
3853
|
summary: legislativeSummary,
|
|
@@ -3249,7 +3858,7 @@ function PoliticianProfile({
|
|
|
3249
3858
|
}
|
|
3250
3859
|
|
|
3251
3860
|
// src/LegislativeRecord.jsx
|
|
3252
|
-
import
|
|
3861
|
+
import React20, { useState as useState10 } from "react";
|
|
3253
3862
|
var DEFAULT_LIMIT = 25;
|
|
3254
3863
|
function normalizeText(str) {
|
|
3255
3864
|
if (!str) return "";
|
|
@@ -3329,7 +3938,7 @@ function getPositionBadge(position) {
|
|
|
3329
3938
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
3330
3939
|
}
|
|
3331
3940
|
function Badge({ label, bg, text }) {
|
|
3332
|
-
return /* @__PURE__ */
|
|
3941
|
+
return /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3333
3942
|
display: "inline-block",
|
|
3334
3943
|
background: bg,
|
|
3335
3944
|
color: text,
|
|
@@ -3342,18 +3951,18 @@ function Badge({ label, bg, text }) {
|
|
|
3342
3951
|
} }, label);
|
|
3343
3952
|
}
|
|
3344
3953
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
3345
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3346
3955
|
display: "flex",
|
|
3347
3956
|
alignItems: "center",
|
|
3348
3957
|
justifyContent: "space-between",
|
|
3349
3958
|
marginBottom: spacing[4]
|
|
3350
|
-
} }, /* @__PURE__ */
|
|
3959
|
+
} }, /* @__PURE__ */ React20.createElement("h2", { style: {
|
|
3351
3960
|
fontFamily: fonts.primary,
|
|
3352
3961
|
fontSize: fontSizes.xl,
|
|
3353
3962
|
fontWeight: fontWeights.bold,
|
|
3354
3963
|
color: colors.evTeal,
|
|
3355
3964
|
margin: 0
|
|
3356
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
3965
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ React20.createElement(
|
|
3357
3966
|
"select",
|
|
3358
3967
|
{
|
|
3359
3968
|
value: yearFilter,
|
|
@@ -3369,13 +3978,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
3369
3978
|
cursor: "pointer"
|
|
3370
3979
|
}
|
|
3371
3980
|
},
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
-
years.map((y) => /* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ React20.createElement("option", { value: "All" }, "All years"),
|
|
3982
|
+
years.map((y) => /* @__PURE__ */ React20.createElement("option", { key: y, value: y }, y))
|
|
3374
3983
|
));
|
|
3375
3984
|
}
|
|
3376
3985
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
3377
3986
|
if (totalCount <= visibleCount) return null;
|
|
3378
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ React20.createElement(
|
|
3379
3988
|
"button",
|
|
3380
3989
|
{
|
|
3381
3990
|
type: "button",
|
|
@@ -3403,7 +4012,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
3403
4012
|
));
|
|
3404
4013
|
}
|
|
3405
4014
|
function EmptyState({ message }) {
|
|
3406
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ React20.createElement("p", { style: {
|
|
3407
4016
|
fontFamily: fonts.primary,
|
|
3408
4017
|
fontSize: fontSizes.sm,
|
|
3409
4018
|
color: colors.textMuted,
|
|
@@ -3413,24 +4022,24 @@ function EmptyState({ message }) {
|
|
|
3413
4022
|
} }, message);
|
|
3414
4023
|
}
|
|
3415
4024
|
function Spinner() {
|
|
3416
|
-
return /* @__PURE__ */
|
|
4025
|
+
return /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3417
4026
|
display: "flex",
|
|
3418
4027
|
justifyContent: "center",
|
|
3419
4028
|
alignItems: "center",
|
|
3420
4029
|
padding: spacing[10]
|
|
3421
|
-
} }, /* @__PURE__ */
|
|
4030
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3422
4031
|
width: "40px",
|
|
3423
4032
|
height: "40px",
|
|
3424
4033
|
borderRadius: borderRadius.full,
|
|
3425
4034
|
border: `3px solid ${colors.borderLight}`,
|
|
3426
4035
|
borderTopColor: colors.evTeal,
|
|
3427
4036
|
animation: "ev-spin 0.8s linear infinite"
|
|
3428
|
-
} }), /* @__PURE__ */
|
|
4037
|
+
} }), /* @__PURE__ */ React20.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
3429
4038
|
}
|
|
3430
4039
|
function CommitteesSection({ committees, leadership }) {
|
|
3431
|
-
const [showAll, setShowAll] =
|
|
4040
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3432
4041
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
3433
|
-
return /* @__PURE__ */
|
|
4042
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ React20.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3434
4043
|
display: "inline-flex",
|
|
3435
4044
|
alignItems: "center",
|
|
3436
4045
|
gap: spacing[1],
|
|
@@ -3441,23 +4050,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
3441
4050
|
fontFamily: fonts.primary,
|
|
3442
4051
|
fontSize: fontSizes.sm,
|
|
3443
4052
|
fontWeight: fontWeights.semibold
|
|
3444
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
4053
|
+
} }, role.title, role.chamber && /* @__PURE__ */ React20.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", null, visible.map((c, i) => {
|
|
3445
4054
|
const badge = getRoleBadge(c.role);
|
|
3446
|
-
return /* @__PURE__ */
|
|
4055
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3447
4056
|
display: "flex",
|
|
3448
4057
|
alignItems: "center",
|
|
3449
4058
|
justifyContent: "space-between",
|
|
3450
4059
|
padding: `${spacing[3]} 0`,
|
|
3451
4060
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
3452
4061
|
gap: spacing[3]
|
|
3453
|
-
} }, /* @__PURE__ */
|
|
4062
|
+
} }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3454
4063
|
fontFamily: fonts.primary,
|
|
3455
4064
|
fontSize: fontSizes.sm,
|
|
3456
4065
|
color: colors.textSecondary,
|
|
3457
4066
|
flex: 1,
|
|
3458
4067
|
minWidth: 0
|
|
3459
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
3460
|
-
})), !showAll && /* @__PURE__ */
|
|
4068
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ React20.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ React20.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
4069
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3461
4070
|
ShowAllLink,
|
|
3462
4071
|
{
|
|
3463
4072
|
totalCount: committees.length,
|
|
@@ -3468,15 +4077,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
3468
4077
|
}
|
|
3469
4078
|
function LegislationSection({ bills, isMobile }) {
|
|
3470
4079
|
const years = getYears(bills, "introduced_at");
|
|
3471
|
-
const [yearFilter, setYearFilter] =
|
|
3472
|
-
const [showAll, setShowAll] =
|
|
4080
|
+
const [yearFilter, setYearFilter] = useState10("All");
|
|
4081
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3473
4082
|
const handleYearChange = (y) => {
|
|
3474
4083
|
setYearFilter(y);
|
|
3475
4084
|
setShowAll(false);
|
|
3476
4085
|
};
|
|
3477
4086
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
3478
4087
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
3479
|
-
return /* @__PURE__ */
|
|
4088
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(
|
|
3480
4089
|
SectionHeader,
|
|
3481
4090
|
{
|
|
3482
4091
|
title: "Sponsored Legislation",
|
|
@@ -3484,42 +4093,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
3484
4093
|
years,
|
|
3485
4094
|
onYearChange: handleYearChange
|
|
3486
4095
|
}
|
|
3487
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
4096
|
+
), bills.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", null, visible.map((bill, i) => {
|
|
3488
4097
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
3489
|
-
return /* @__PURE__ */
|
|
4098
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3490
4099
|
display: "flex",
|
|
3491
4100
|
flexDirection: isMobile ? "column" : "row",
|
|
3492
4101
|
alignItems: isMobile ? "flex-start" : "center",
|
|
3493
4102
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
3494
4103
|
padding: `${spacing[3]} 0`,
|
|
3495
4104
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
3496
|
-
} }, /* @__PURE__ */
|
|
4105
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3497
4106
|
fontFamily: fonts.primary,
|
|
3498
4107
|
fontSize: fontSizes.xs,
|
|
3499
4108
|
fontWeight: fontWeights.bold,
|
|
3500
4109
|
color: colors.textSecondary,
|
|
3501
4110
|
marginRight: spacing[2]
|
|
3502
|
-
} }, bill.number), /* @__PURE__ */
|
|
4111
|
+
} }, bill.number), /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3503
4112
|
fontFamily: fonts.primary,
|
|
3504
4113
|
fontSize: fontSizes.sm,
|
|
3505
4114
|
color: colors.textSecondary
|
|
3506
|
-
} }, bill.title)), /* @__PURE__ */
|
|
4115
|
+
} }, bill.title)), /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3507
4116
|
display: "flex",
|
|
3508
4117
|
alignItems: "center",
|
|
3509
4118
|
gap: spacing[2],
|
|
3510
4119
|
flexShrink: 0,
|
|
3511
4120
|
flexWrap: "wrap"
|
|
3512
|
-
} }, /* @__PURE__ */
|
|
4121
|
+
} }, /* @__PURE__ */ React20.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3513
4122
|
fontFamily: fonts.primary,
|
|
3514
4123
|
fontSize: fontSizes.xs,
|
|
3515
4124
|
color: colors.textMuted
|
|
3516
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
4125
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3517
4126
|
fontFamily: fonts.primary,
|
|
3518
4127
|
fontSize: fontSizes.xs,
|
|
3519
4128
|
color: colors.textMuted,
|
|
3520
4129
|
fontStyle: "italic"
|
|
3521
4130
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
3522
|
-
})), !showAll && /* @__PURE__ */
|
|
4131
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3523
4132
|
ShowAllLink,
|
|
3524
4133
|
{
|
|
3525
4134
|
totalCount: filtered.length,
|
|
@@ -3530,15 +4139,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
3530
4139
|
}
|
|
3531
4140
|
function VotingSection({ votes, isMobile }) {
|
|
3532
4141
|
const years = getYears(votes, "vote_date");
|
|
3533
|
-
const [yearFilter, setYearFilter] =
|
|
3534
|
-
const [showAll, setShowAll] =
|
|
4142
|
+
const [yearFilter, setYearFilter] = useState10("All");
|
|
4143
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3535
4144
|
const handleYearChange = (y) => {
|
|
3536
4145
|
setYearFilter(y);
|
|
3537
4146
|
setShowAll(false);
|
|
3538
4147
|
};
|
|
3539
4148
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
3540
4149
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
3541
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(
|
|
3542
4151
|
SectionHeader,
|
|
3543
4152
|
{
|
|
3544
4153
|
title: "Voting Record",
|
|
@@ -3546,38 +4155,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
3546
4155
|
years,
|
|
3547
4156
|
onYearChange: handleYearChange
|
|
3548
4157
|
}
|
|
3549
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
4158
|
+
), votes.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", null, visible.map((vote, i) => {
|
|
3550
4159
|
const positionBadge = getPositionBadge(vote.position);
|
|
3551
4160
|
const normPosition = normalizeText(vote.position);
|
|
3552
4161
|
const topic = vote.bill_title || vote.vote_question;
|
|
3553
4162
|
const sourceUrl = vote.bill_url;
|
|
3554
|
-
return /* @__PURE__ */
|
|
4163
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3555
4164
|
display: "flex",
|
|
3556
4165
|
flexDirection: isMobile ? "column" : "row",
|
|
3557
4166
|
alignItems: isMobile ? "flex-start" : "center",
|
|
3558
4167
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
3559
4168
|
padding: `${spacing[3]} 0`,
|
|
3560
4169
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
3561
|
-
} }, /* @__PURE__ */
|
|
4170
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3562
4171
|
fontFamily: fonts.primary,
|
|
3563
4172
|
fontSize: fontSizes.sm,
|
|
3564
4173
|
color: colors.textSecondary
|
|
3565
|
-
} }, topic)), /* @__PURE__ */
|
|
4174
|
+
} }, topic)), /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3566
4175
|
display: "flex",
|
|
3567
4176
|
alignItems: "center",
|
|
3568
4177
|
gap: spacing[2],
|
|
3569
4178
|
flexShrink: 0,
|
|
3570
4179
|
flexWrap: "wrap"
|
|
3571
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
4180
|
+
} }, vote.vote_date && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3572
4181
|
fontFamily: fonts.primary,
|
|
3573
4182
|
fontSize: fontSizes.xs,
|
|
3574
4183
|
color: colors.textMuted
|
|
3575
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
4184
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ React20.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3576
4185
|
fontFamily: fonts.primary,
|
|
3577
4186
|
fontSize: fontSizes.xs,
|
|
3578
4187
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
3579
4188
|
fontWeight: fontWeights.medium
|
|
3580
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
4189
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ React20.createElement(
|
|
3581
4190
|
"a",
|
|
3582
4191
|
{
|
|
3583
4192
|
href: sourceUrl,
|
|
@@ -3598,7 +4207,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
3598
4207
|
},
|
|
3599
4208
|
"Source"
|
|
3600
4209
|
)));
|
|
3601
|
-
})), !showAll && /* @__PURE__ */
|
|
4210
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3602
4211
|
ShowAllLink,
|
|
3603
4212
|
{
|
|
3604
4213
|
totalCount: filtered.length,
|
|
@@ -3617,20 +4226,20 @@ function LegislativeRecord({
|
|
|
3617
4226
|
}) {
|
|
3618
4227
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
3619
4228
|
if (loading) {
|
|
3620
|
-
return /* @__PURE__ */
|
|
4229
|
+
return /* @__PURE__ */ React20.createElement(Spinner, null);
|
|
3621
4230
|
}
|
|
3622
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ React20.createElement("h1", { style: {
|
|
3623
4232
|
fontFamily: fonts.primary,
|
|
3624
4233
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
3625
4234
|
fontWeight: fontWeights.bold,
|
|
3626
4235
|
color: colors.evTeal,
|
|
3627
4236
|
marginBottom: spacing[8],
|
|
3628
4237
|
marginTop: 0
|
|
3629
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
4238
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ React20.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ React20.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ React20.createElement(VotingSection, { votes, isMobile }));
|
|
3630
4239
|
}
|
|
3631
4240
|
|
|
3632
4241
|
// src/JudicialRecordDetail.jsx
|
|
3633
|
-
import
|
|
4242
|
+
import React21 from "react";
|
|
3634
4243
|
var containerStyle = {
|
|
3635
4244
|
fontFamily: "'Manrope', sans-serif",
|
|
3636
4245
|
maxWidth: "800px"
|
|
@@ -3715,7 +4324,7 @@ var emptyStateStyle = {
|
|
|
3715
4324
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
3716
4325
|
var _a;
|
|
3717
4326
|
if (!judicialRecord) {
|
|
3718
|
-
return /* @__PURE__ */
|
|
4327
|
+
return /* @__PURE__ */ React21.createElement("div", { style: containerStyle }, /* @__PURE__ */ React21.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ React21.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
3719
4328
|
}
|
|
3720
4329
|
const {
|
|
3721
4330
|
judge_detail: detail,
|
|
@@ -3724,13 +4333,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
3724
4333
|
disciplinary_records: disciplinary = []
|
|
3725
4334
|
} = judicialRecord;
|
|
3726
4335
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
3727
|
-
return /* @__PURE__ */
|
|
4336
|
+
return /* @__PURE__ */ React21.createElement("div", { style: containerStyle }, /* @__PURE__ */ React21.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ React21.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ React21.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__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ React21.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__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ React21.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ React21.createElement("table", { style: tableStyle }, /* @__PURE__ */ React21.createElement("thead", null, /* @__PURE__ */ React21.createElement("tr", null, /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ React21.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ React21.createElement("tr", { key: i }, /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ React21.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ React21.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ React21.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ React21.createElement("table", { style: tableStyle }, /* @__PURE__ */ React21.createElement("thead", null, /* @__PURE__ */ React21.createElement("tr", null, /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ React21.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ React21.createElement("tr", { key: i }, /* @__PURE__ */ React21.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ React21.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ React21.createElement("div", { key: i, style: {
|
|
3728
4337
|
borderLeft: "3px solid #fc8181",
|
|
3729
4338
|
backgroundColor: "#fff5f5",
|
|
3730
4339
|
borderRadius: "0 6px 6px 0",
|
|
3731
4340
|
padding: "12px 16px",
|
|
3732
4341
|
marginBottom: "10px"
|
|
3733
|
-
} }, /* @__PURE__ */
|
|
4342
|
+
} }, /* @__PURE__ */ React21.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ React21.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ React21.createElement(
|
|
3734
4343
|
"a",
|
|
3735
4344
|
{
|
|
3736
4345
|
href: d.source_url,
|
|
@@ -3743,7 +4352,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
3743
4352
|
}
|
|
3744
4353
|
|
|
3745
4354
|
// src/AuthForm.jsx
|
|
3746
|
-
import
|
|
4355
|
+
import React22, { useState as useState11 } from "react";
|
|
3747
4356
|
function AuthForm({
|
|
3748
4357
|
logoSrc = "/EVLogo.svg",
|
|
3749
4358
|
appName = "Empowered Vote",
|
|
@@ -3754,11 +4363,11 @@ function AuthForm({
|
|
|
3754
4363
|
error = null,
|
|
3755
4364
|
submitting = false
|
|
3756
4365
|
}) {
|
|
3757
|
-
const [username, setUsername] =
|
|
3758
|
-
const [password, setPassword] =
|
|
3759
|
-
const [confirmPassword, setConfirmPassword] =
|
|
3760
|
-
const [showPasswords, setShowPasswords] =
|
|
3761
|
-
const [passwordMismatch, setPasswordMismatch] =
|
|
4366
|
+
const [username, setUsername] = useState11("");
|
|
4367
|
+
const [password, setPassword] = useState11("");
|
|
4368
|
+
const [confirmPassword, setConfirmPassword] = useState11("");
|
|
4369
|
+
const [showPasswords, setShowPasswords] = useState11(false);
|
|
4370
|
+
const [passwordMismatch, setPasswordMismatch] = useState11(false);
|
|
3762
4371
|
const isLogin = mode === "login";
|
|
3763
4372
|
const handleSubmit = (e) => {
|
|
3764
4373
|
e.preventDefault();
|
|
@@ -3770,7 +4379,7 @@ function AuthForm({
|
|
|
3770
4379
|
setPasswordMismatch(false);
|
|
3771
4380
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
3772
4381
|
};
|
|
3773
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
4382
|
+
const EyeOpen = () => /* @__PURE__ */ React22.createElement(
|
|
3774
4383
|
"svg",
|
|
3775
4384
|
{
|
|
3776
4385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3780,7 +4389,7 @@ function AuthForm({
|
|
|
3780
4389
|
stroke: "currentColor",
|
|
3781
4390
|
style: { width: "20px", height: "20px" }
|
|
3782
4391
|
},
|
|
3783
|
-
/* @__PURE__ */
|
|
4392
|
+
/* @__PURE__ */ React22.createElement(
|
|
3784
4393
|
"path",
|
|
3785
4394
|
{
|
|
3786
4395
|
strokeLinecap: "round",
|
|
@@ -3788,7 +4397,7 @@ function AuthForm({
|
|
|
3788
4397
|
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"
|
|
3789
4398
|
}
|
|
3790
4399
|
),
|
|
3791
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ React22.createElement(
|
|
3792
4401
|
"path",
|
|
3793
4402
|
{
|
|
3794
4403
|
strokeLinecap: "round",
|
|
@@ -3797,7 +4406,7 @@ function AuthForm({
|
|
|
3797
4406
|
}
|
|
3798
4407
|
)
|
|
3799
4408
|
);
|
|
3800
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
4409
|
+
const EyeClosed = () => /* @__PURE__ */ React22.createElement(
|
|
3801
4410
|
"svg",
|
|
3802
4411
|
{
|
|
3803
4412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3807,7 +4416,7 @@ function AuthForm({
|
|
|
3807
4416
|
stroke: "currentColor",
|
|
3808
4417
|
style: { width: "20px", height: "20px" }
|
|
3809
4418
|
},
|
|
3810
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ React22.createElement(
|
|
3811
4420
|
"path",
|
|
3812
4421
|
{
|
|
3813
4422
|
strokeLinecap: "round",
|
|
@@ -3816,17 +4425,17 @@ function AuthForm({
|
|
|
3816
4425
|
}
|
|
3817
4426
|
)
|
|
3818
4427
|
);
|
|
3819
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
4428
|
+
const PasswordToggle = () => /* @__PURE__ */ React22.createElement(
|
|
3820
4429
|
"button",
|
|
3821
4430
|
{
|
|
3822
4431
|
type: "button",
|
|
3823
4432
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
3824
4433
|
style: styles.passwordToggle
|
|
3825
4434
|
},
|
|
3826
|
-
showPasswords ? /* @__PURE__ */
|
|
4435
|
+
showPasswords ? /* @__PURE__ */ React22.createElement(EyeOpen, null) : /* @__PURE__ */ React22.createElement(EyeClosed, null)
|
|
3827
4436
|
);
|
|
3828
4437
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
3829
|
-
return /* @__PURE__ */
|
|
4438
|
+
return /* @__PURE__ */ React22.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ React22.createElement("div", { style: styles.container }, /* @__PURE__ */ React22.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ React22.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ React22.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ React22.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ React22.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ React22.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ React22.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React22.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ React22.createElement(
|
|
3830
4439
|
"input",
|
|
3831
4440
|
{
|
|
3832
4441
|
type: "text",
|
|
@@ -3843,7 +4452,7 @@ function AuthForm({
|
|
|
3843
4452
|
},
|
|
3844
4453
|
required: true
|
|
3845
4454
|
}
|
|
3846
|
-
)), /* @__PURE__ */
|
|
4455
|
+
)), /* @__PURE__ */ React22.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React22.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ React22.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ React22.createElement(
|
|
3847
4456
|
"input",
|
|
3848
4457
|
{
|
|
3849
4458
|
type: showPasswords ? "text" : "password",
|
|
@@ -3859,7 +4468,7 @@ function AuthForm({
|
|
|
3859
4468
|
},
|
|
3860
4469
|
required: true
|
|
3861
4470
|
}
|
|
3862
|
-
), /* @__PURE__ */
|
|
4471
|
+
), /* @__PURE__ */ React22.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ React22.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React22.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ React22.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ React22.createElement(
|
|
3863
4472
|
"input",
|
|
3864
4473
|
{
|
|
3865
4474
|
type: showPasswords ? "text" : "password",
|
|
@@ -3875,7 +4484,7 @@ function AuthForm({
|
|
|
3875
4484
|
},
|
|
3876
4485
|
required: true
|
|
3877
4486
|
}
|
|
3878
|
-
), /* @__PURE__ */
|
|
4487
|
+
), /* @__PURE__ */ React22.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ React22.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ React22.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ React22.createElement(
|
|
3879
4488
|
"button",
|
|
3880
4489
|
{
|
|
3881
4490
|
type: "submit",
|
|
@@ -3893,7 +4502,7 @@ function AuthForm({
|
|
|
3893
4502
|
}
|
|
3894
4503
|
},
|
|
3895
4504
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
3896
|
-
), onModeSwitch && /* @__PURE__ */
|
|
4505
|
+
), onModeSwitch && /* @__PURE__ */ React22.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ React22.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ React22.createElement(
|
|
3897
4506
|
"button",
|
|
3898
4507
|
{
|
|
3899
4508
|
type: "button",
|
|
@@ -4066,9 +4675,9 @@ var styles = {
|
|
|
4066
4675
|
};
|
|
4067
4676
|
|
|
4068
4677
|
// src/TopicTierBadge.jsx
|
|
4069
|
-
import
|
|
4678
|
+
import React23 from "react";
|
|
4070
4679
|
function LandmarkIcon({ size = 14 }) {
|
|
4071
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4072
4681
|
"svg",
|
|
4073
4682
|
{
|
|
4074
4683
|
width: size,
|
|
@@ -4082,16 +4691,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
4082
4691
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4083
4692
|
"aria-hidden": "true"
|
|
4084
4693
|
},
|
|
4085
|
-
/* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4089
|
-
/* @__PURE__ */
|
|
4090
|
-
/* @__PURE__ */
|
|
4694
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 18v-7" }),
|
|
4695
|
+
/* @__PURE__ */ React23.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" }),
|
|
4696
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M14 18v-7" }),
|
|
4697
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M18 18v-7" }),
|
|
4698
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M3 22h18" }),
|
|
4699
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 18v-7" })
|
|
4091
4700
|
);
|
|
4092
4701
|
}
|
|
4093
4702
|
function Building2Icon({ size = 14 }) {
|
|
4094
|
-
return /* @__PURE__ */
|
|
4703
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4095
4704
|
"svg",
|
|
4096
4705
|
{
|
|
4097
4706
|
width: size,
|
|
@@ -4105,17 +4714,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
4105
4714
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4106
4715
|
"aria-hidden": "true"
|
|
4107
4716
|
},
|
|
4108
|
-
/* @__PURE__ */
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4114
|
-
/* @__PURE__ */
|
|
4717
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
4718
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
4719
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
4720
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 6h4" }),
|
|
4721
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 10h4" }),
|
|
4722
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 14h4" }),
|
|
4723
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 18h4" })
|
|
4115
4724
|
);
|
|
4116
4725
|
}
|
|
4117
4726
|
function HomeIcon({ size = 14 }) {
|
|
4118
|
-
return /* @__PURE__ */
|
|
4727
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4119
4728
|
"svg",
|
|
4120
4729
|
{
|
|
4121
4730
|
width: size,
|
|
@@ -4129,8 +4738,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
4129
4738
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4130
4739
|
"aria-hidden": "true"
|
|
4131
4740
|
},
|
|
4132
|
-
/* @__PURE__ */
|
|
4133
|
-
/* @__PURE__ */
|
|
4741
|
+
/* @__PURE__ */ React23.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
4742
|
+
/* @__PURE__ */ React23.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4134
4743
|
);
|
|
4135
4744
|
}
|
|
4136
4745
|
var TIER_INFO = {
|
|
@@ -4190,7 +4799,7 @@ function TopicTierBadge({
|
|
|
4190
4799
|
userSelect: "none"
|
|
4191
4800
|
};
|
|
4192
4801
|
};
|
|
4193
|
-
return /* @__PURE__ */
|
|
4802
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4194
4803
|
"span",
|
|
4195
4804
|
{
|
|
4196
4805
|
className: "ev-topic-tier-badge",
|
|
@@ -4200,13 +4809,13 @@ function TopicTierBadge({
|
|
|
4200
4809
|
},
|
|
4201
4810
|
effectiveTiers.map((tier) => {
|
|
4202
4811
|
const { label, Icon } = TIER_INFO[tier];
|
|
4203
|
-
return /* @__PURE__ */
|
|
4812
|
+
return /* @__PURE__ */ React23.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ React23.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ React23.createElement("span", null, label));
|
|
4204
4813
|
})
|
|
4205
4814
|
);
|
|
4206
4815
|
}
|
|
4207
4816
|
|
|
4208
4817
|
// src/CompassCoverageCallout.jsx
|
|
4209
|
-
import
|
|
4818
|
+
import React24, { useState as useState12 } from "react";
|
|
4210
4819
|
var TIER_LABELS = {
|
|
4211
4820
|
federal: "federal",
|
|
4212
4821
|
state: "state",
|
|
@@ -4219,7 +4828,7 @@ function CompassCoverageCallout({
|
|
|
4219
4828
|
compassUrl,
|
|
4220
4829
|
onDismiss
|
|
4221
4830
|
}) {
|
|
4222
|
-
const [dismissed, setDismissed] =
|
|
4831
|
+
const [dismissed, setDismissed] = useState12(false);
|
|
4223
4832
|
if (dismissed) return null;
|
|
4224
4833
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4225
4834
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -4270,15 +4879,15 @@ function CompassCoverageCallout({
|
|
|
4270
4879
|
setDismissed(true);
|
|
4271
4880
|
if (onDismiss) onDismiss();
|
|
4272
4881
|
};
|
|
4273
|
-
return /* @__PURE__ */
|
|
4882
|
+
return /* @__PURE__ */ React24.createElement(
|
|
4274
4883
|
"div",
|
|
4275
4884
|
{
|
|
4276
4885
|
className: "ev-compass-coverage-callout",
|
|
4277
4886
|
role: "status",
|
|
4278
4887
|
style: containerStyle2
|
|
4279
4888
|
},
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
4889
|
+
/* @__PURE__ */ React24.createElement("div", { style: textStyle }, /* @__PURE__ */ React24.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ React24.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__ */ React24.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
4890
|
+
onDismiss !== void 0 && /* @__PURE__ */ React24.createElement(
|
|
4282
4891
|
"button",
|
|
4283
4892
|
{
|
|
4284
4893
|
onClick: handleDismiss,
|
|
@@ -4291,7 +4900,7 @@ function CompassCoverageCallout({
|
|
|
4291
4900
|
}
|
|
4292
4901
|
|
|
4293
4902
|
// src/ExpandCompassNudge.jsx
|
|
4294
|
-
import
|
|
4903
|
+
import React25 from "react";
|
|
4295
4904
|
function ExpandCompassNudge({
|
|
4296
4905
|
politicianName,
|
|
4297
4906
|
missingCount,
|
|
@@ -4338,7 +4947,7 @@ function ExpandCompassNudge({
|
|
|
4338
4947
|
};
|
|
4339
4948
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
4340
4949
|
const speakerName = politicianName || "This politician";
|
|
4341
|
-
return /* @__PURE__ */
|
|
4950
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ React25.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ React25.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__ */ React25.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
4342
4951
|
}
|
|
4343
4952
|
|
|
4344
4953
|
// src/computeTierCoverage.js
|
|
@@ -4359,14 +4968,14 @@ function computeTierCoverage(topics) {
|
|
|
4359
4968
|
}
|
|
4360
4969
|
|
|
4361
4970
|
// src/StanceAccordion.jsx
|
|
4362
|
-
import
|
|
4971
|
+
import React27, { useState as useState13, useRef as useRef3, useCallback, useEffect as useEffect7 } from "react";
|
|
4363
4972
|
|
|
4364
4973
|
// src/Favicon.jsx
|
|
4365
|
-
import
|
|
4974
|
+
import React26 from "react";
|
|
4366
4975
|
function Favicon({ url, size = 16 }) {
|
|
4367
4976
|
try {
|
|
4368
4977
|
const domain = new URL(url).hostname;
|
|
4369
|
-
return /* @__PURE__ */
|
|
4978
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4370
4979
|
"img",
|
|
4371
4980
|
{
|
|
4372
4981
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -4377,7 +4986,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
4377
4986
|
}
|
|
4378
4987
|
);
|
|
4379
4988
|
} catch {
|
|
4380
|
-
return /* @__PURE__ */
|
|
4989
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4381
4990
|
"svg",
|
|
4382
4991
|
{
|
|
4383
4992
|
width: size,
|
|
@@ -4388,8 +4997,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
4388
4997
|
strokeWidth: "1.5",
|
|
4389
4998
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
4390
4999
|
},
|
|
4391
|
-
/* @__PURE__ */
|
|
4392
|
-
/* @__PURE__ */
|
|
5000
|
+
/* @__PURE__ */ React26.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5001
|
+
/* @__PURE__ */ React26.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" })
|
|
4393
5002
|
);
|
|
4394
5003
|
}
|
|
4395
5004
|
}
|
|
@@ -4420,9 +5029,9 @@ function StanceAccordion({
|
|
|
4420
5029
|
apiUrl = "https://api.empowered.vote"
|
|
4421
5030
|
}) {
|
|
4422
5031
|
var _a;
|
|
4423
|
-
const [expandedTopicId, setExpandedTopicId] =
|
|
4424
|
-
const [loadingId, setLoadingId] =
|
|
4425
|
-
const [showAll, setShowAll] =
|
|
5032
|
+
const [expandedTopicId, setExpandedTopicId] = useState13(null);
|
|
5033
|
+
const [loadingId, setLoadingId] = useState13(null);
|
|
5034
|
+
const [showAll, setShowAll] = useState13(false);
|
|
4426
5035
|
const contextCache = useRef3(/* @__PURE__ */ new Map());
|
|
4427
5036
|
const quotesCache = useRef3(null);
|
|
4428
5037
|
const polAnswerMap = {};
|
|
@@ -4500,7 +5109,7 @@ function StanceAccordion({
|
|
|
4500
5109
|
},
|
|
4501
5110
|
[expandedTopicId, politicianId, apiUrl]
|
|
4502
5111
|
);
|
|
4503
|
-
|
|
5112
|
+
useEffect7(() => {
|
|
4504
5113
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
4505
5114
|
handleToggle(String(initialExpandedTopicId));
|
|
4506
5115
|
}
|
|
@@ -4516,13 +5125,13 @@ function StanceAccordion({
|
|
|
4516
5125
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
4517
5126
|
}
|
|
4518
5127
|
}
|
|
4519
|
-
return /* @__PURE__ */
|
|
5128
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4520
5129
|
"div",
|
|
4521
5130
|
{
|
|
4522
5131
|
className: "flex flex-col",
|
|
4523
5132
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
4524
5133
|
},
|
|
4525
|
-
/* @__PURE__ */
|
|
5134
|
+
/* @__PURE__ */ React27.createElement(
|
|
4526
5135
|
"h3",
|
|
4527
5136
|
{
|
|
4528
5137
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -4544,15 +5153,15 @@ function StanceAccordion({
|
|
|
4544
5153
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
4545
5154
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
4546
5155
|
}) : [];
|
|
4547
|
-
return /* @__PURE__ */
|
|
5156
|
+
return /* @__PURE__ */ React27.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ React27.createElement(
|
|
4548
5157
|
"button",
|
|
4549
5158
|
{
|
|
4550
5159
|
type: "button",
|
|
4551
5160
|
onClick: () => handleToggle(topicId),
|
|
4552
5161
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
4553
5162
|
},
|
|
4554
|
-
/* @__PURE__ */
|
|
4555
|
-
/* @__PURE__ */
|
|
5163
|
+
/* @__PURE__ */ React27.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React27.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ React27.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ React27.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
5164
|
+
/* @__PURE__ */ React27.createElement(
|
|
4556
5165
|
"svg",
|
|
4557
5166
|
{
|
|
4558
5167
|
width: "16",
|
|
@@ -4569,9 +5178,9 @@ function StanceAccordion({
|
|
|
4569
5178
|
transition: "transform 0.2s ease"
|
|
4570
5179
|
}
|
|
4571
5180
|
},
|
|
4572
|
-
/* @__PURE__ */
|
|
5181
|
+
/* @__PURE__ */ React27.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
4573
5182
|
)
|
|
4574
|
-
), /* @__PURE__ */
|
|
5183
|
+
), /* @__PURE__ */ React27.createElement(
|
|
4575
5184
|
"div",
|
|
4576
5185
|
{
|
|
4577
5186
|
style: {
|
|
@@ -4580,7 +5189,7 @@ function StanceAccordion({
|
|
|
4580
5189
|
transition: "grid-template-rows 0.25s ease"
|
|
4581
5190
|
}
|
|
4582
5191
|
},
|
|
4583
|
-
/* @__PURE__ */
|
|
5192
|
+
/* @__PURE__ */ React27.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ React27.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ React27.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ React27.createElement(
|
|
4584
5193
|
"div",
|
|
4585
5194
|
{
|
|
4586
5195
|
style: {
|
|
@@ -4592,14 +5201,14 @@ function StanceAccordion({
|
|
|
4592
5201
|
animation: "ev-spin 0.8s linear infinite"
|
|
4593
5202
|
}
|
|
4594
5203
|
}
|
|
4595
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
5204
|
+
)), !isLoading && cached && /* @__PURE__ */ React27.createElement(React27.Fragment, null, cached.reasoning ? /* @__PURE__ */ React27.createElement(
|
|
4596
5205
|
"p",
|
|
4597
5206
|
{
|
|
4598
5207
|
className: "text-sm text-neutral-700 mb-3",
|
|
4599
5208
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
4600
5209
|
},
|
|
4601
5210
|
cached.reasoning
|
|
4602
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
5211
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ React27.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React27.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ React27.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ React27.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ React27.createElement(
|
|
4603
5212
|
"a",
|
|
4604
5213
|
{
|
|
4605
5214
|
href: src,
|
|
@@ -4607,9 +5216,9 @@ function StanceAccordion({
|
|
|
4607
5216
|
rel: "noreferrer",
|
|
4608
5217
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
4609
5218
|
},
|
|
4610
|
-
/* @__PURE__ */
|
|
4611
|
-
/* @__PURE__ */
|
|
4612
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ React27.createElement(Favicon, { url: src }),
|
|
5220
|
+
/* @__PURE__ */ React27.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
5221
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ React27.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ React27.createElement(
|
|
4613
5222
|
"p",
|
|
4614
5223
|
{
|
|
4615
5224
|
style: {
|
|
@@ -4626,7 +5235,7 @@ function StanceAccordion({
|
|
|
4626
5235
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
4627
5236
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
4628
5237
|
const sourceName = quote.source_name || quote.sourceName;
|
|
4629
|
-
return /* @__PURE__ */
|
|
5238
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4630
5239
|
"div",
|
|
4631
5240
|
{
|
|
4632
5241
|
key: quote.id,
|
|
@@ -4638,7 +5247,7 @@ function StanceAccordion({
|
|
|
4638
5247
|
marginBottom: "8px"
|
|
4639
5248
|
}
|
|
4640
5249
|
},
|
|
4641
|
-
/* @__PURE__ */
|
|
5250
|
+
/* @__PURE__ */ React27.createElement(
|
|
4642
5251
|
"p",
|
|
4643
5252
|
{
|
|
4644
5253
|
style: {
|
|
@@ -4651,7 +5260,7 @@ function StanceAccordion({
|
|
|
4651
5260
|
},
|
|
4652
5261
|
quote.text
|
|
4653
5262
|
),
|
|
4654
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
5263
|
+
verdict === "agreed" && /* @__PURE__ */ React27.createElement(
|
|
4655
5264
|
"span",
|
|
4656
5265
|
{
|
|
4657
5266
|
style: {
|
|
@@ -4668,10 +5277,10 @@ function StanceAccordion({
|
|
|
4668
5277
|
flexShrink: 0
|
|
4669
5278
|
}
|
|
4670
5279
|
},
|
|
4671
|
-
/* @__PURE__ */
|
|
5280
|
+
/* @__PURE__ */ React27.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React27.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
4672
5281
|
"Agreed"
|
|
4673
5282
|
),
|
|
4674
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
5283
|
+
verdict === "disagreed" && /* @__PURE__ */ React27.createElement(
|
|
4675
5284
|
"span",
|
|
4676
5285
|
{
|
|
4677
5286
|
style: {
|
|
@@ -4688,10 +5297,10 @@ function StanceAccordion({
|
|
|
4688
5297
|
flexShrink: 0
|
|
4689
5298
|
}
|
|
4690
5299
|
},
|
|
4691
|
-
/* @__PURE__ */
|
|
5300
|
+
/* @__PURE__ */ React27.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React27.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
4692
5301
|
"Disagreed"
|
|
4693
5302
|
),
|
|
4694
|
-
sourceName && /* @__PURE__ */
|
|
5303
|
+
sourceName && /* @__PURE__ */ React27.createElement(
|
|
4695
5304
|
"a",
|
|
4696
5305
|
{
|
|
4697
5306
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -4708,10 +5317,10 @@ function StanceAccordion({
|
|
|
4708
5317
|
sourceName
|
|
4709
5318
|
)
|
|
4710
5319
|
);
|
|
4711
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
5320
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ React27.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
4712
5321
|
));
|
|
4713
5322
|
}),
|
|
4714
|
-
hasToggle && /* @__PURE__ */
|
|
5323
|
+
hasToggle && /* @__PURE__ */ React27.createElement(
|
|
4715
5324
|
"button",
|
|
4716
5325
|
{
|
|
4717
5326
|
type: "button",
|
|
@@ -4723,90 +5332,20 @@ function StanceAccordion({
|
|
|
4723
5332
|
)
|
|
4724
5333
|
);
|
|
4725
5334
|
}
|
|
4726
|
-
|
|
4727
|
-
// src/icons.js
|
|
4728
|
-
import React23 from "react";
|
|
4729
|
-
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
4730
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4731
|
-
"svg",
|
|
4732
|
-
{
|
|
4733
|
-
width: size,
|
|
4734
|
-
height: size,
|
|
4735
|
-
viewBox: "0 0 24 24",
|
|
4736
|
-
fill: "none",
|
|
4737
|
-
stroke: color,
|
|
4738
|
-
strokeWidth: "2",
|
|
4739
|
-
strokeLinecap: "round",
|
|
4740
|
-
strokeLinejoin: "round",
|
|
4741
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4742
|
-
},
|
|
4743
|
-
/* @__PURE__ */ React23.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
4744
|
-
/* @__PURE__ */ React23.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
4745
|
-
/* @__PURE__ */ React23.createElement("path", { d: "M22 19H2" })
|
|
4746
|
-
);
|
|
4747
|
-
}
|
|
4748
|
-
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
4749
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4750
|
-
"svg",
|
|
4751
|
-
{
|
|
4752
|
-
width: size,
|
|
4753
|
-
height: size,
|
|
4754
|
-
viewBox: "0 0 24 24",
|
|
4755
|
-
fill: "none",
|
|
4756
|
-
stroke: color,
|
|
4757
|
-
strokeWidth: "2",
|
|
4758
|
-
strokeLinecap: "round",
|
|
4759
|
-
strokeLinejoin: "round",
|
|
4760
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4761
|
-
},
|
|
4762
|
-
/* @__PURE__ */ React23.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4763
|
-
/* @__PURE__ */ React23.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" })
|
|
4764
|
-
);
|
|
4765
|
-
}
|
|
4766
|
-
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
4767
|
-
let paths;
|
|
4768
|
-
switch (branch) {
|
|
4769
|
-
case "executive":
|
|
4770
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ React23.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ React23.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ React23.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ React23.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
4771
|
-
break;
|
|
4772
|
-
case "legislative":
|
|
4773
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.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__ */ React23.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ React23.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ React23.createElement("path", { d: "M15 12h-5" }));
|
|
4774
|
-
break;
|
|
4775
|
-
case "judicial":
|
|
4776
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ React23.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ React23.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React23.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React23.createElement("path", { d: "M8 21h8" }));
|
|
4777
|
-
break;
|
|
4778
|
-
default:
|
|
4779
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ React23.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__ */ React23.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ React23.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ React23.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ React23.createElement("path", { d: "M6 18v-7" }));
|
|
4780
|
-
break;
|
|
4781
|
-
}
|
|
4782
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4783
|
-
"svg",
|
|
4784
|
-
{
|
|
4785
|
-
width: size,
|
|
4786
|
-
height: size,
|
|
4787
|
-
viewBox: "0 0 24 24",
|
|
4788
|
-
fill: "none",
|
|
4789
|
-
stroke: color,
|
|
4790
|
-
strokeWidth: "2",
|
|
4791
|
-
strokeLinecap: "round",
|
|
4792
|
-
strokeLinejoin: "round",
|
|
4793
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4794
|
-
},
|
|
4795
|
-
paths
|
|
4796
|
-
);
|
|
4797
|
-
}
|
|
4798
5335
|
export {
|
|
4799
5336
|
AuthForm,
|
|
4800
5337
|
BallotIcon,
|
|
4801
5338
|
BranchIcon,
|
|
4802
5339
|
CategorySection,
|
|
4803
5340
|
CommitteeTable,
|
|
5341
|
+
CompassCardHorizontal,
|
|
4804
5342
|
CompassCoverageCallout,
|
|
4805
5343
|
CompassIcon,
|
|
4806
5344
|
ExpandCompassNudge,
|
|
4807
5345
|
FilterSidebar,
|
|
4808
5346
|
GovernmentBodySection,
|
|
4809
5347
|
Header,
|
|
5348
|
+
IconOverlay,
|
|
4810
5349
|
IssueTags,
|
|
4811
5350
|
JudicialRecordDetail,
|
|
4812
5351
|
JudicialScorecard,
|