PageSourceSearch

https://stonksup.io/assets/CongressPopup-B13YgCT4.js

js stonksup.io collected 2026-10-02 01:58:14 UTC 26,457 bytes, 1 lines download raw bytes

1import{r as y,ac as ke,ad as _e,B as L,ae as Re,j as r,D as G,E as K,af as le,O as Y,R as A,F as p,ag as We,ah as q,ai as Ie,aj as Ae,ak as Ee,a5 as Le,a7 as Fe,a8 as Be,a9 as Oe,J as Me,aa as X}from"./index-XMYwAgiZ.js";import{L as He}from"./Legend-BVh-Qyb3.js";var Ne=["axis","item"],ze=y.forwardRef((e,t)=>y.createElement(ke,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ne,tooltipPayloadSearcher:_e,categoricalChartProps:e,ref:t}));function $e(e,t){return e==="R"?t.loss:e==="I"?t.warn:e==="D"?t.seriesBlue:t.fg3}const Q=["nancy-pelosi","brian-mast","marjorie-taylor-greene","josh-gottheimer","scott-mr-franklin"];function Ce(e,t){const n=t.trim().toLowerCase();return n?[e.name,e.displayName].map(i=>String(i??"").trim().toLowerCase()).some(i=>i===n):!1}const J=34,De=44,Ve="clamp(220px, 28vw, 380px)",Pe=10,ae="112px 240px 110px 190px 680px 112px 50px",z=1530,C=6,Ge=112+C,Ke="min(64vh, 640px)",Ye=5,R=12,Ue=12,ce=10.5,Ze=18,T="transaction-history";function de(e){return Math.max(4,e/4)}function pe(e,t){const n=(t??"").trim().toLowerCase();return n.includes("conservative")?e.gain:n.includes("aggressive")?e.loss:"#0B83A5"}function qe({T:e,label:t,rawLabel:n=t}){const i=pe(e,n);return r.jsx("span",{style:{flexShrink:0,maxWidth:"100%",border:`1px solid ${i}33`,borderRadius:A.pill,background:`${i}12`,color:i,fontSize:p.xs,fontWeight:p.w500,lineHeight:1.25,padding:"2px 7px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})}function Xe({T:e,label:t,align:n="right"}){const{t:i}=L();return r.jsxs("span",{style:{display:"block",maxWidth:"100%",color:e.fg4,fontSize:11,fontWeight:p.w500,lineHeight:1.25,textAlign:n,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[i("popup.congress.focus","Focus")," ",t]})}function ue({T:e,slug:t,displayName:n,size:i}){const[l,s]=y.useState(!1),c=Ae[t.toLowerCase()],h={width:i,height:i,borderRadius:de(i),background:e.bgInput,flexShrink:0,overflow:"hidden",display:"inline-flex",alignItems:"center",justifyContent:"center"};if(c&&!l)return r.jsx("span",{style:h,children:r.jsx("img",{src:c,alt:n,width:i,height:i,onError:()=>s(!0),style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})});const x=n.split(/\s+/).slice(0,2).map(d=>{var a;return((a=d[0])==null?void 0:a.toUpperCase())??""}).join("");return r.jsx("span",{style:{...h,color:e.fg3,fontSize:p.sm,fontWeight:p.w500},children:x})}function ee({T:e,label:t,value:n}){return r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[r.jsx("div",{title:t,style:{fontSize:p.sm,color:e.fg2,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),r.jsx("div",{style:{width:56,height:4,borderRadius:4,background:e.bgInput,flexShrink:0},children:r.jsx("div",{style:{width:`${Math.min(100,n)}%`,height:"100%",borderRadius:4,background:e.blue}})}),r.jsxs("div",{style:{fontSize:p.sm,color:e.fg3,fontWeight:p.w500,width:44,textAlign:"right",flexShrink:0},children:[n.toFixed(1),"%"]})]})}function te({color:e,children:t}){return r.jsx("span",{style:{display:"inline-flex",alignItems:"center",minWidth:0,maxWidth:"100%",padding:"2px 8px",borderRadius:A.pill,border:`1px solid ${e}33`,background:`${e}14`,color:e,fontSize:11.5,fontWeight:p.w500,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})}function I({T:e,children:t,style:n}){return r.jsx("div",{style:{background:e.bgCardAlt,border:`1px solid ${e.hairline}`,borderRadius:A.md,minWidth:0,...n},children:t})}function N({T:e,title:t,trailing:n,style:i}){return r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:n?"space-between":"flex-start",gap:10,marginBottom:10,...i},children:[r.jsx("span",{style:{fontSize:13.5,fontWeight:p.w700,color:e.fg1,lineHeight:1.2,letterSpacing:0},children:t}),n]})}function re(e){if(!e)return"-";if(/^\d{4}-\d{2}-\d{2}/.test(e))return e.slice(0,10);const t=new Date(e);return isNaN(t.getTime())?e:t.toISOString().slice(0,10)}function Qe({symbol:e,size:t=Ze}){const[n,i]=y.useState(!1),l=(e??"").toUpperCase();return!l||n?r.jsx("span",{style:{width:t,height:t,flexShrink:0}}):r.jsx("img",{src:`https://images.financialmodelingprep.com/symbol/${l}.png`,width:t,height:t,alt:"",onError:()=>i(!0),style:{borderRadius:de(t),objectFit:"cover",flexShrink:0,display:"block"}})}
1function Je({T:e,symbol:t,asset:n,onSelectSymbol:i}){const l=!!t&&!!i,s=r.jsxs(r.Fragment,{children:[r.jsx(Qe,{symbol:t}),r.jsxs("span",{style:{minWidth:0},children:[r.jsx("span",{title:t||n,style:{display:"block",color:e.fg1,fontSize:Ue,fontWeight:p.w400,lineHeight:"16px",whiteSpace:"nowrap"},children:t||"-"}),n&&n!=="-"&&n!==t&&r.jsx("span",{title:n,style:{display:"block",color:e.fg5,fontSize:ce,fontWeight:p.w400,lineHeight:"14px",marginTop:1,whiteSpace:"normal",overflowWrap:"anywhere"},children:n})]})]});return l?r.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),i==null||i(t)},style:{display:"flex",alignItems:"center",gap:8,minWidth:0,width:"100%",border:"none",padding:0,background:"transparent",fontFamily:"inherit",cursor:"pointer",textAlign:"left",whiteSpace:"normal"},children:s}):r.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:s})}function Te(e){const t=(e??"").toLowerCase();return t==="buy"||t.includes("purchase")?"buy":t==="sell"||t.includes("sale")?"sell":"other"}function et({T:e,raw:t}){const{t:n}=L(),i=Te(t),l=i==="buy"?e.gain:i==="sell"?e.loss:e.fg3,s=i==="buy"?n("popup.congress.buy","Buy"):i==="sell"?n("popup.congress.sell","Sell"):t||"-";return r.jsx("span",{style:{color:l,fontSize:R,fontWeight:p.w400,lineHeight:1.2},children:s})}function tt({T:e,link:t}){return t?r.jsx("a",{href:t,"aria-label":"Open filing files",title:"Open filing files",target:"_blank",rel:"noopener noreferrer",onClick:n=>n.stopPropagation(),onKeyDown:n=>n.stopPropagation(),style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",textDecoration:"none"},children:r.jsx("img",{src:"/icons/page.svg",width:14,height:14,alt:"",style:{display:"block",filter:"invert(0.55)",opacity:.82}})}):r.jsx("span",{style:{color:e.fg5,fontSize:R},children:"-"})}function W(...e){for(const t of e){if(t==null)continue;const n=String(t).trim();if(n)return n}return""}function U(e){return W(e.symbol).toUpperCase()}function rt(e){return W(e.assetDescription,e.name,e.symbol)||"-"}function fe(e){return W(e.direction,e.typeTransacted,e.transactionType,e.type)}function ge(e){return W(e.amountTransacted,e.amountTransactedText,e.amount,e.value)||"-"}function Z(e){return W(e.description,e.transactionDescription,e.detail)||"-"}function he(e){return W(e.dateReported,e.disclosureDate,e.date)}function xe(e){return W(e.dateTransacted,e.transactionDate)}function me(e){return W(e.link,e.url)}function M(...e){const t=W(...e);return t?t.toLowerCase():null}function ne(...e){const t=W(...e);if(!t)return null;const n=Date.parse(t);return Number.isFinite(n)?n:null}function nt(e){const t=W(e);if(!t)return null;const n=t.match(/\d[\d,]*(?:\.\d+)?/g);if(!(n!=null&&n.length))return null;const i=n.map(l=>Number.parseFloat(l.replace(/,/g,""))).filter(Number.isFinite);return i.length?i.length===1?[i[0],i[0]]:[Math.max(i[0],i[1]),Math.min(i[0],i[1])]:null}function ie(e){return e==null?!0:typeof e=="string"?e.trim()==="":Array.isArray(e)?e.some(t=>!Number.isFinite(t)):!Number.isFinite(e)}function se(e,t,n){const i=ie(e),l=ie(t);if(i&&l)return 0;if(i)return 1;if(l)return-1;const s=n==="asc"?1:-1;if(Array.isArray(e)&&Array.isArray(t)){const c=e[0]-t[0];return c!==0?c*s:(e[1]-t[1])*s}return typeof e=="number"&&typeof t=="number"?e===t?0:(e-t)*s:String(e).localeCompare(String(t))*s}function it(e,t,n){const i=n==="asc"?"desc":"asc";return e.columnIndex!==t?{columnIndex:t,dir:n}:e.dir===n?{columnIndex:t,dir:i}:{columnIndex:null}}function ye(e,t,n,i,l,s){if(i.columnIndex!=null&&i.dir){const c=n[i.columnIndex];if(c){const h=se(c.sortValue(e),c.sortValue(t),i.dir);if(h!==0)return h;if(i.columnIndex===0&&i.dir==="desc"){const x=se(M(U(e)),M(U(t)),"asc");if(x!==0)return x}}}return l-s}function st(e,t){const n={columnIndex:0,dir:"desc"};return e.map((i,l)=>({row:i,index:l})).sort((i,l)=>ye(i.row,l.row,t,n,i.index,l.index)).map(i=>i.row)}function je(e){return[{label:e("popup.congress.traded"),firstSortDir:"desc",sortValue:t=>ne(xe(t))},{label:e("popup.congress.symbol"),firstSortDir:"asc",sortValue:t=>M(t.symbol)},{label:e("popup.congress.transaction"),firstSortDir:"asc",sortValue:t=>M(fe(t))},{label:e("popup.congress.amount"),firstSortDir:"desc",sortValue:t=>nt(ge(t))},{label:e("popup.congress.description"),firstSortDir:"asc",sortValue:t=>M(Z(t))},{label:e("popup.congress.reported"),firstSortDir:"desc",sortValue:t=>ne(he(t))},{label:e("popup.congress.files"),align:"right",firstSortDir:"asc",sortValue:t=>M(me(t))}]}function $(e,t,n=!1){return t>1?{}:{position:"sticky",left:t===0?0:Ge,zIndex:n?4:3,background:e.bgCardAlt,boxShadow:`${C}px 0 0 ${e.bgCardAlt}`,borderRight:t===1?`1px solid ${e.hairline}`:void 0}}function we({T:e,trade:t,onSelectSymbol:n}){const i=U(t),l=rt(t);return r.jsxs("div",{role:"row",style:{display:"grid",gridTemplateColumns:ae,alignItems:"start",padding:"8px 2px",columnGap:C,borderBottom:`1px solid ${e.hairline}`,borderRadius:A.xs},children:[r.jsx("div",{role:"cell",style:{color:e.fg2,fontSize:R,lineHeight:"18px",whiteSpace:"nowrap",...$(e,0)},children:re(xe(t))}),r.jsx("div",{role:"cell",style:{minWidth:0,...$(e,1)}
1,children:r.jsx(Je,{T:e,symbol:i,asset:l,onSelectSymbol:n})}),r.jsx("div",{role:"cell",style:{whiteSpace:"nowrap"},children:r.jsx(et,{T:e,raw:fe(t)})}),r.jsx("div",{role:"cell",style:{minWidth:0,color:e.fg2,fontSize:R,lineHeight:"18px",whiteSpace:"normal",overflowWrap:"anywhere"},children:ge(t)}),r.jsx("div",{role:"cell",title:Z(t),style:{minWidth:0,color:e.fg2,fontSize:R,lineHeight:"18px",whiteSpace:"normal",overflowWrap:"break-word"},children:Z(t)}),r.jsx("div",{role:"cell",style:{color:e.fg2,fontSize:R,lineHeight:"18px",whiteSpace:"nowrap"},children:re(he(t))}),r.jsx("div",{role:"cell",style:{whiteSpace:"nowrap",textAlign:"right"},children:r.jsx(tt,{T:e,link:me(t)})})]})}function Se({T:e,columns:t,sort:n,onSort:i,sticky:l}){return r.jsx("div",{role:"row",style:{display:"grid",gridTemplateColumns:ae,columnGap:C,padding:"0 2px 7px",borderBottom:`1px solid ${e.hairline}`,marginBottom:3,alignItems:"center",...l?{position:"sticky",top:0,zIndex:Ye,background:e.bgCardAlt}:{}},children:t.map((s,c)=>{const h=(n==null?void 0:n.columnIndex)===c,x=h?n==null?void 0:n.dir:void 0,d=r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{minWidth:0},children:s.label}),h&&x&&r.jsx("img",{src:`/icons/${x==="asc"?"nav-arrow-up":"nav-arrow-down"}.svg`,width:11,height:11,alt:"",style:{flex:"0 0 auto",filter:"invert(0.55)",opacity:.72,marginTop:1}})]});return i?r.jsx("button",{type:"button",role:"columnheader",onClick:()=>i(c),title:`Sort by ${s.label}`,style:{minWidth:0,border:"none",background:"transparent",color:h?e.fg2:e.fg5,cursor:"pointer",fontFamily:"inherit",fontSize:12,lineHeight:"18px",fontWeight:p.w400,letterSpacing:0,padding:0,display:"inline-flex",gap:4,alignItems:"center",justifyContent:s.align==="right"?"flex-end":"flex-start",textAlign:s.align??"left",whiteSpace:"nowrap",...$(e,c,!0)},children:d},s.label):r.jsx("div",{role:"columnheader",style:{minWidth:0,color:e.fg5,fontSize:12,lineHeight:"18px",fontWeight:p.w400,textAlign:s.align??"left",whiteSpace:"nowrap",...$(e,c,!0)},children:s.label},s.label)})})}function ot({T:e,trades:t,onSelectSymbol:n,onOpenFull:i}){const{t:l}=L(),s=y.useMemo(()=>je(l),[l]),[c,h]=y.useState(!1),x=y.useMemo(()=>st(t,s).slice(0,Pe),[s,t]);return r.jsx("div",{role:"button",tabIndex:0,"aria-label":l("popup.congress.transactionHistory"),onClick:i,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i())},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{minWidth:0,marginBottom:12,cursor:"pointer",fontFamily:"inherit"},children:r.jsx(I,{T:e,style:{overflow:"hidden",borderColor:c?e.border:e.hairline,transition:"border-color .15s"},children:r.jsx("div",{className:"su-scroll",style:{overflowX:"auto",padding:"14px 16px 4px"},children:r.jsxs("div",{role:"table",style:{width:z,minWidth:z},children:[r.jsx(Se,{T:e,columns:s}),x.map((d,a)=>r.jsx(we,{T:e,trade:d,onSelectSymbol:n},`${d.symbol??"trade"}-${d.dateReported??d.disclosureDate??a}-${a}`))]})})})})}function lt({T:e,onClick:t}){const{t:n}=L(),[i,l]=y.useState(!1);return r.jsxs("button",{type:"button",onClick:t,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),title:n("popup.congress.showLess","Show less"),style:{display:"inline-flex",alignItems:"center",gap:5,height:24,borderRadius:A.pill,border:`1px solid ${e.hairline}`,padding:"0 9px",background:i?e.bgControl:"transparent",color:e.fg3,fontSize:11,fontWeight:p.w500,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap",flexShrink:0,transition:"background .15s"},children:[r.jsx("img",{src:"/icons/nav-arrow-up.svg",width:11,height:11,alt:"",style:{filter:"invert(0.55)",opacity:.8}}),n("popup.congress.showLess","Show less")]})}function at({T:e,trades:t,onSelectSymbol:n,onCollapse:i}){const{t:l}=L(),s=y.useMemo(()=>je(l),[l]),[c,h]=y.useState({columnIndex:0,dir:"desc"}),x=y.useMemo(()=>t.map((d,a)=>({row:d,index:a})).sort((d,a)=>ye(d.row,a.row,s,c,d.index,a.index)).map(d=>d.row),[s,c,t]);return r.jsx("div",{children:r.jsxs(I,{T:e,style:{padding:"14px 16px",minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginBottom:8,minWidth:0},children:[r.jsx("div",{style:{fontSize:11,fontWeight:p.w500,color:e.fg1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l("popup.congress.transactionHistory")}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[r.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,height:20,borderRadius:A.pill,border:`1px solid ${e.hairline}`,padding:"0 8px",color:e.fg4,fontSize:10.5,fontWeight:p.w500,whiteSpace:"nowrap"},children:[l("popup.congress.rows")," ",x.length]}),i&&r.jsx(lt,{T:e,onClick:i})]})]}),r.jsx("div",{className:"su-scroll",style:{overflow:"auto",minWidth:0,maxHeight:Ke},children:r.jsxs("div",{role:"table",style:{width:z,minWidth:z},children:[r.jsx(Se,{T:e,columns:s,sort:c,sticky:!0,onSort:d=>{const a=s[d];a&&h(j=>it(j,d,a.firstSortDir))}}),x.map((d,a)=>r.jsx(we,{T:e,trade:d,onSelectSymbol:n},`${d.symbol??"trade"}-${d.dateReported??d.disclosureDate??a}-${a}`))]})})]})})}function ct(e){if(e==null)return 0;if(typeof e=="number")return e;const n=String(e).replace(/[$,\s]/g,"").split(/[-–]/).map(i=>parseFloat(i)).filter(i=>!isNaN(i));return n.length>=2?(n[0]+n[1])/2:n.length===1?n[0]:0}function oe(e){return Math.abs(e)>=1e9?`$${(e/1e9).toFixed(1)}B`:Math.abs(e)>=1e6?`$${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${e.toFixed(0)}`}function dt({T:e,active:t,label:n,onClick:i}){const[l,s]=y.useState(!1);return r.jsx("button",{type:"button","aria-pressed":t,onClick:i,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{minWidth:44,height:28,borderRadius:A.xs,padding:"0 10px",border:`1px solid ${t?e.hairline:"transparent"}`,background:t||l?e.bgControl:"transparent",color:t?e.fg1:e.fg4,fontSize:R,fontWeight:p.w400,fontFamily:"inherit",curs
1or:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",transition:"background .15s, color .15s, border-color .15s"},children:n})}function pt({T:e,trades:t}){const{t:n}=L(),[i,l]=y.useState("annual"),s=n("popup.congress.buy","Buy"),c=n("popup.congress.sell","Sell"),h=Ee.useMemo(()=>{const a={};for(const j of t){const o=j.dateReported??j.disclosureDate??"",w=new Date(o);if(isNaN(w.getTime()))continue;const F=(j.direction??"").toLowerCase()==="buy",B=(j.direction??"").toLowerCase()==="sell",E=ct(j.amountTransacted??j.amount);let k;if(i==="annual")k=String(w.getFullYear());else{const u=Math.floor(w.getMonth()/3)+1;k=`${String(w.getFullYear()).slice(-2)}-Q${u}`}a[k]||(a[k]={label:k,buy:0,sell:0}),F?a[k].buy+=E:B&&(a[k].sell+=E)}return Object.values(a).sort((j,o)=>j.label.localeCompare(o.label))},[t,i]),x=({active:a,payload:j,label:o})=>!a||!(j!=null&&j.length)?null:r.jsxs("div",{style:{background:e.bgMenu,border:`1px solid ${e.hairline}`,borderRadius:A.sm,padding:"8px 12px",fontSize:R,color:e.fg2},children:[r.jsx("div",{style:{color:e.fg1,marginBottom:4,fontWeight:p.w500},children:o}),j.map(w=>r.jsxs("div",{style:{display:"flex",gap:7,alignItems:"center",color:e.fg3,marginBottom:2,fontSize:ce},children:[r.jsx("span",{style:{width:8,height:8,borderRadius:2,background:w.fill,flexShrink:0}}),r.jsxs("span",{children:[w.dataKey==="buy"?s:c,": ",oe(w.value)]})]},w.dataKey))]}),d=r.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginTop:8,marginBottom:10},children:["annual","quarterly"].map(a=>r.jsx(dt,{T:e,active:i===a,label:a==="annual"?n("popup.congress.annual","Annual"):n("popup.congress.quarterly","Quarterly"),onClick:()=>l(a)},a))});return r.jsxs("div",{style:{marginBottom:20},children:[r.jsx(N,{T:e,title:n("popup.congress.transactionStatistics"),style:{marginBottom:0}}),d,r.jsx(I,{T:e,style:{padding:"10px 12px 8px"},children:r.jsx("div",{style:{background:e.bgCard,borderRadius:A.sm,padding:"10px 10px 6px",minWidth:0},children:r.jsx(Le,{width:"100%",height:180,children:r.jsxs(ze,{data:h,margin:{top:8,right:14,bottom:0,left:8},barCategoryGap:"30%",children:[r.jsx(Fe,{dataKey:"label",tick:{fill:e.fg3,fontSize:R},axisLine:!1,tickLine:!1}),r.jsx(Be,{tickFormatter:a=>oe(a),tick:{fill:e.fg3,fontSize:R},axisLine:!1,tickLine:!1,width:68}),r.jsx(Oe,{content:r.jsx(x,{}),cursor:{fill:Me(e,"rgba(255,255,255,0.08)","rgba(0,0,0,0.06)")}}),r.jsx(He,{wrapperStyle:{fontSize:R,color:e.fg3,paddingTop:4},formatter:a=>a==="buy"?s:c}),r.jsx(X,{dataKey:"buy",fill:e.gain,radius:[3,3,0,0],maxBarSize:24}),r.jsx(X,{dataKey:"sell",fill:e.loss,radius:[3,3,0,0],maxBarSize:24})]})})})})]})}function ut({T:e,member:t,onSelectSymbol:n,initialDetailTable:i,onDetailTableChange:l}){var H;const{t:s}=L(),[c,h]=y.useState([]),[x,d]=y.useState(!0),[a,j]=y.useState(null),o=t.full_analysis,w=((H=o==null?void 0:o.political_affiliation)==null?void 0:H[0])??"",F=(o==null?void 0:o.state)??(o==null?void 0:o.State)??"",B=(o==null?void 0:o.one_sentence_summary)??"",E=$e(w,e),k=(o==null?void 0:o.asset_type_distribution)??{},u=(o==null?void 0:o.sector_distribution)??{},f=Object.entries(k).sort((g,m)=>m[1]-g[1]),S=Object.entries(u).sort((g,m)=>m[1]-g[1]),b=w==="D"?s("popup.congress.democrat"):w==="R"?s("popup.congress.republican"):w?s("popup.congress.independent"):"";y.useEffect(()=>{let g=!1;return d(!0),j(null),We(t.name,t.houseSenate).then(m=>{g||(h((m==null?void 0:m.trades)??[]),d(!1))}).catch(m=>{g||(j((m==null?void 0:m.message)??"Failed"),d(!1))}),()=>{g=!0}},[t.name,t.houseSenate]);const v=[[s("popup.congress.strategy"),o!=null&&o.investment_strategy?q(s,o.investment_strategy):void 0,void 0,o==null?void 0:o.investment_strategy],[s("popup.congress.riskTolerance"),o!=null&&o.risk_tolerance?le(s,o.risk_tolerance):void 0,pe(e,(o==null?void 0:o.risk_tolerance)??""),o==null?void 0:o.risk_tolerance],[s("popup.congress.tradingHorizon"),o!=null&&o.trading_horizon?q(s,o.trading_horizon):void 0,void 0,o==null?void 0:o.trading_horizon]].filter(([,g])=>g),_=[[s("popup.congress.mostTradedAsset"),o==null?void 0:o.most_traded_asset],[s("popup.congress.mostTradedSector"),o!=null&&o.most_traded_sector?Y(s,o.most_traded_sector):void 0,o==null?void 0:o.most_traded_sector]].filter(([,g])=>g),O=v.length>0,D=_.length>0||f.length>0||S.length>0;return i===T?r.jsxs("div",{style:{marginBottom:20},children:[x&&r.jsx(G,{T:e,rows:5}),a&&r.jsx(K,{T:e,msg:s("popup.congress.loadFailed",{error:a})}),!x&&!a&&c.length===0&&r.jsx(I,{T:e,style:{padding:"13px 15px",color:e.fg3,fontSize:p.sm},children:s("popup.congress.noTrades")}),!x&&!a&&c.length>0&&r.jsx(at,{T:e,trades:c,onSelectSymbol:n,onCollapse:()=>l==null?void 0:l(null)})]}):r.jsxs("div",{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:12,minWidth:0},children:[r.jsx(ue,{T:e,slug:t.name,displayName:t.displayName,size:De}),r.jsxs("div",{style:{minWidth:0},children:[r.jsx("div",{style:{fontSize:22,fontWeight:p.w600,color:e.fg1,lineHeight:1.12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.displayName}),r.jsxs("div",{style:{display:"flex",gap:6,marginTop:7,alignItems:"center",flexWrap:"wrap"},children:[r.jsx(te,{color:e.fg3,children:t.houseSenate}),b&&r.jsx(te,{color:E,children:b}),F&&r.jsx("span",{style:{fontSize:12,color:e.fg4,lineHeight:1.25},children:F})]})]})]}),B&&r.jsxs("div",{style:{marginBottom:18},children:[r.jsx(N,{T:e,title:s("popup.congress.description")}),r.jsx(I,{T:e,style:{fontSize:p.sm,color:e.fg2,lineHeight:1.55,padding:"13px 15px"},children:B})]}),O&&r.jsxs("div",{style:{marginBottom:18},children:[r.jsx(N,{T:e,title:s("popup.congress.overview")}),v.length>0&&r.jsx(I,{T:e,style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:0,overflow:"hidden"},children:v.map(([g,m,P,ve],be)=>r.jsxs("div",{style:{padding:"11px 13px",borderLeft:be===0?"none":`1px solid ${e.hairline}`,minWidth:0},children:[r.jsx("div",{style:{fontSize:12,color:e.fg4,marginBottom:6,lineHeight:1.2},children:g}),r.jsx("div",{style:{fontSize:14,fontWeight:p.w600,color:P??e.fg1,lineHeight:1.25,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:ve||m,children:m})]},g))})]}),D&&r.jsxs("div",{style:{marginBottom:20},children:[r.jsx(N,{T:e,title:s("popup.congress.tradingFocus")}),_.length>0&&r.jsx(I,{T:e,style:{padding:"13px 15px 12px",marginBottom:f.length||S.length?12:0},children:r.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:14},children:_.map(([g,m,P])=>r.jsxs("div",{style:{minWidth:0},children:[r.jsx("div",{style:{fontSize:12,color:e.fg4,marginBottom:6,lineHeight:1.2},children:g}),r.jsx("div",{style:{fontSize:14,fontWeight:p.w600,color:e.fg1,lineHeight:1.25,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:P||m,children:m})]},g))})}),(f.length>0||S.length>0)&&r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:12},children:[f.length>0&&r.jsxs(I,{T:e,style:{padding:"13px 15px 12px"},children:[r.jsx("div",{style:{fontSize:12,fontWeight:p.w700,color:e.fg1,marginBottom:10},children:s("popup.congress.assetDistribution")}),f.slice(0,6).map(([g,m])=>r.jsx(ee,{T:e,label:Ie(s,g),value:Number(m)},g))]}),S.length>0&&r.jsxs(I,{T:e,style:{padding:"13px 15px 12px"},children:[r.jsx("div",{style:{fontSize:12,fontWeight:p.w700,color:e.fg1,marginBottom:10},children:s("popup.congress.sectorDistribution")}),S.slice(0,6).map(([g,m])=>r.jsx(ee,{T:e,label:Y(s,g),value:Number(m)},g))]})]})]}),!x&&!a&&c.length>0&&r.jsx(pt,{T:e,trades:c}),r.jsxs("div",{style:{marginBottom:20},children:[r.jsx(N,{T:e,title:s("popup.congress.transactionHistory")}),x&&r.jsx(G,{T:e,rows:5}),a&&r.jsx(K,{T:e,msg:s("popup.congress.loadFailed",{error:a})}),!x&&!a&&c.length===0&&r.jsx(I,{T:e,style:{padding:"13px 15px",color:e.fg3,fontSize:p.sm},children:s("popup.congress.noTrades")}),!x&&!a&&c.length>0&&r.jsx(ot,{T:e,trades:c,onSelectSymbol:n,onOpenFull:()=>l==null?void 0:l(T)})]})]})}function ht({T:e,onSelectSymbol:t,onDetailChange:n,initialDetailSymbol
1:i,onDetailSymbolChange:l,initialDetailTable:s,onDetailTableChange:c}){const{t:h}=L(),[x,d]=y.useState([]),[a,j]=y.useState(!0),[o,w]=y.useState(null),F=y.useRef(null),B=()=>{var f;let u=((f=F.current)==null?void 0:f.parentElement)??null;for(;u;){const S=getComputedStyle(u).overflowY;if((S==="auto"||S==="scroll")&&u.scrollHeight>u.clientHeight){u.scrollTo({top:0,behavior:"smooth"});return}u=u.parentElement}},E=y.useCallback(()=>{w(null),l==null||l(null),c==null||c(null),n==null||n(null,null),setTimeout(B,10)},[n,l,c]),k=y.useCallback(u=>{w(u),l==null||l(u.name),c==null||c(null),n==null||n(u.displayName,E),setTimeout(B,10)},[E,n,l,c]);return y.useEffect(()=>{let u=!1;return Re().then(f=>{if(u)return;const S=[...f].sort((b,v)=>{const _=Q.indexOf(b.name),O=Q.indexOf(v.name);return _!==-1&&O!==-1?_-O:_!==-1?-1:O!==-1?1:b.houseSenate!==v.houseSenate?b.houseSenate==="House"?-1:1:b.name.localeCompare(v.name)});if(d(S),i){const b=S.find(v=>Ce(v,i));b&&(w(b),n==null||n(b.displayName,E))}}).catch(()=>{u||d([])}).finally(()=>{u||j(!1)}),()=>{u=!0}},[]),a?r.jsx(G,{T:e,rows:7}):x.length?r.jsx("div",{ref:F,children:o?r.jsx(ut,{T:e,member:o,onSelectSymbol:t,initialDetailTable:s,onDetailTableChange:c}):r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:x.map(u=>{var g;const f=u.full_analysis,S=((g=f==null?void 0:f.political_affiliation)==null?void 0:g[0])??"",b=(f==null?void 0:f.state)??(f==null?void 0:f.State)??"",v=(f==null?void 0:f.risk_tolerance)??"",_=(f==null?void 0:f.most_traded_sector)??"",O=v?le(h,v):"",D=_?Y(h,_):"",V=b||u.houseSenate||"--",H=S==="D"?h("popup.congress.democrat"):S==="R"?h("popup.congress.republican"):S==="I"?h("popup.congress.independent"):"";return r.jsxs("button",{onClick:()=>k(u),style:{display:"grid",gridTemplateColumns:`${J}px minmax(0, 1fr) ${Ve} 14px`,alignItems:"center",gap:10,background:e.bgCardAlt,borderRadius:A.sm,padding:"10px 12px",border:`1px solid ${e.hairline}`,cursor:"pointer",textAlign:"left",fontFamily:"inherit",width:"100%",transition:"background .12s"},onMouseEnter:m=>m.currentTarget.style.background=e.bgControl,onMouseLeave:m=>m.currentTarget.style.background=e.bgCardAlt,children:[r.jsx(ue,{T:e,slug:u.name,displayName:u.displayName,size:J}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsx("div",{style:{fontSize:13.5,fontWeight:p.w500,color:e.fg1,lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.displayName}),r.jsx("div",{style:{fontSize:p.xs,color:e.fg5,marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H?`${H} · ${V}`:V})]}),r.jsxs("div",{style:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"center",gap:5},children:[v&&r.jsx(qe,{T:e,label:O,rawLabel:v}),_&&r.jsx(Xe,{T:e,label:D})]}),r.jsx("img",{src:"/icons/nav-arrow-right.svg",width:14,height:14,style:{filter:"invert(0.5)",flexShrink:0},alt:""})]},u.name)})})}):r.jsx(K,{T:e,msg:h("popup.congress.noData")})}export{ht as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.