1import{B as N,r as d,a0 as ft,j as i,D as q,E as J,R as $,F as g,a1 as pt,a2 as ht,a3 as V,a4 as xt,a5 as mt,a6 as gt,a7 as yt,a8 as C,a9 as wt,aa as jt,ab as vt,G as bt,_ as St}from"./index-XMYwAgiZ.js";import{L as It}from"./Legend-BVh-Qyb3.js";const K=["#5481EC","#7B61FF","#2DD4BF",V.warn,V.pos,"#F97316",V.neg,"#47AFD2"],G=34,kt=34,U=92,Wt=10,D="minmax(220px, 1fr) minmax(90px, .45fr)",T=380,tt="minmax(220px, 1.35fr) 96px 82px 82px 96px 96px 88px 82px",et=860,A=11;function Ft(t){return t.split(/\s+/).slice(0,2).map(e=>{var n;return((n=e[0])==null?void 0:n.toUpperCase())??""}).join("")}function $t(t){if(t==null)return"â";const e=typeof t=="string"?parseFloat(t.replace(/[^0-9.-]/g,"")):t;return isNaN(e)?String(t):Math.abs(e)>=1e9?`$${(e/1e9).toFixed(2)} Bn`:Math.abs(e)>=1e6?`$${(e/1e6).toFixed(2)} Mn`:Math.abs(e)>=1e3?`$${(e/1e3).toFixed(1)} K`:`$${e.toFixed(0)}`}function H(t){if(t==null)return"â";const e=typeof t=="string"?parseFloat(t.replace(/[^0-9.-]/g,"")):t;if(!Number.isFinite(e))return String(t);const n=e<0?"-":"",s=Math.abs(e);return s>=1e9?`${n}${(s/1e9).toFixed(2)} Bn`:s>=1e6?`${n}${(s/1e6).toFixed(2)} Mn`:s>=1e3?`${n}${(s/1e3).toFixed(2)} K`:`${n}${s.toFixed(2)}`}function L(t){const e=b(t);return e==null?"â":`${e.toFixed(2)}%`}function Nt(t){return t==null?"â":L(t*100)}function Rt(t){return Math.max(4,t/4)}function b(t){if(t==null||t==="")return null;const e=typeof t=="number"?t:Number.parseFloat(String(t).replace(/[^0-9.-]/g,""));return Number.isFinite(e)?e:null}function _(t,e=2){const n=b(t);return n==null?"â":`${n.toFixed(e)}%`}function Mt(t){const e=b(t);return e==null?"â":`${e>=0?"â²":"â¼"} ${Math.abs(e).toFixed(2)}%`}function E(t){const e=b(t.percentage??t.weight);if(e!=null)return e;const n=b(t.mkt_value_pct);return n==null?0:n*100}function Y(t){return t.toLowerCase().split(/\s+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(" ")}function k(...t){for(const e of t){if(e==null)continue;const n=String(e).trim();if(n)return n}return""}function At(t){return O(t).toLowerCase()}function Z(t,e){const n=e.trim().toLowerCase();return n?[t.cik,t.investor,t.name].map(s=>k(s).toLowerCase()).some(s=>s===n):!1}function Ot(t){return t==="industry"||t==="holdings"?t:null}function B({T:t,children:e,style:n}){return i.jsx("div",{style:{background:t.bgCardAlt,border:`1px solid ${t.hairline}`,borderRadius:$.md,minWidth:0,...n},children:e})}function it({T:t,title:e,trailing:n,style:s}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:n?"space-between":"flex-start",gap:10,marginBottom:8,...s},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",minWidth:0},children:i.jsx("span",{style:{fontSize:14,fontWeight:g.w500,color:t.fg1,lineHeight:1.2,letterSpacing:0},children:e})}),n]})}function nt({name:t,size:e,colorIndex:n,circular:s=!1}){const[r,o]=d.useState(!1),l=ht[t],u=K[n%K.length],f={width:e,height:e,borderRadius:s?"50%":Rt(e),flexShrink:0,overflow:"hidden",display:"inline-flex",alignItems:"center",justifyContent:"center"};return l&&!r?i.jsx("span",{style:f,children:i.jsx("img",{src:l,alt:t,width:e,height:e,onError:()=>o(!0),style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}):i.jsx("span",{style:{...f,background:`${u}33`,border:`1px solid ${u}66`,fontSize:e<=36?g.sm:g.base,fontWeight:g.w500,color:u},children:Ft(t)})}function Et(t){const e=new Date(t),n=Math.floor(e.getMonth()/3)+1;return`${String(e.getFullYear()).slice(-2)}Q${n}`}function Q(t){return Math.abs(t)>=1e9?`${(t/1e9).toFixed(1)}B`:Math.abs(t)>=1e6?`${(t/1e6).toFixed(1)}M`:Math.abs(t)>=1e3?`${(t/1e3).toFixed(0)}K`:String(t)}function Ht({T:t,cik:e,symbols:n}){const{t:s}=N(),[r,o]=d.useState(n[0]??""),[l,u]=d.useState([]),[f,p]=d.useState(!1),[a,h]=d.useState(null),[j,v]=d.useState(!1);d.useEffect(()=>{if(!r||!e)return;let m=!1;return p(!0),h(null),xt(e,r).then(y=>{if(m)return;const W=[...y].sort((c,x)=>new Date(c.date).getTime()-new Date(x.date).getTime()).slice(-10);u(W),p(!1)}).catch(y=>{m||(h((y==null?void 0:y.message)??"Failed"),p(!1))}),()=>{m=!0}},[e,r]);const S=({active:m,payload:y,label:W})=>{if(!m||!(y!=null&&y.length))return null;const c=y.find(w=>w.dataKey==="sharesNumber"),x=y.find(w=>w.dataKey==="weight");return i.jsxs("div",{style:{background:t.bgCard,border:`1px solid ${t.border}`,borderRadius:$.sm,padding:"8px 10px",fontSize:A,lineHeight:"15px"},children:[i.jsx("div",{style:{color:t.fg3,marginBottom:4},children:W}),c&&i.jsxs("div",{style:{color:t.blue},children:["Shares: ",Q(c.value)]}),x&&i.jsxs("div",{style:{color:t.fg1},children:["% Portfolio: ",Number(x.value).toFixed(2),"%"]})]})};return i.jsxs(i.Fragment,{children:[i.jsx(it,{T:t,title:s("popup.institutions.ownershipHistory")}),i.jsxs(B,{T:t,style:{padding:"13px 15px 12px",marginBottom:20},children:[i.jsx("div",{style:{marginBottom:12},children:i.jsxs("div",{style:{position:"relative",width:"100%"},children:[i.jsx("select",{value:r,onChange:m=>o(m.target.value),onFocus:()=>v(!0),onBlur:()=>v(!1),style:{appearance:"none",WebkitAppearance:"none",background:t.bgCardAlt,color:t.fg1,border:`1px solid ${j?t.border:t.borderWeak}`,borderRadius:$.sm,padding:"0 32px 0 10px",fontSize:12,lineHeight:"28px",height:30,fontFamily:"inherit",curs
1or:"pointer",outline:"none",width:"100%",overflow:"hidden",textOverflow:"ellipsis",transition:"border-color .15s"},children:n.map(m=>i.jsx("option",{value:m,style:{background:t.bgCardAlt,color:t.fg1,fontSize:12},children:m},m))}),i.jsx("img",{src:"/icons/nav-arrow-down.svg",width:12,height:12,alt:"",style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",filter:"invert(0.55)",opacity:.75,pointerEvents:"none"}})]})}),f&&i.jsx("div",{style:{height:200,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("div",{style:{fontSize:g.sm,color:t.fg3},children:s("popup.institutions.loadingChart")})}),a&&i.jsx("div",{style:{fontSize:g.sm,color:t.loss,marginBottom:12},children:a}),!f&&!a&&l.length>0&&i.jsx(mt,{width:"100%",height:220,children:i.jsxs(gt,{data:l,margin:{top:8,right:34,bottom:4,left:0},children:[i.jsx(yt,{dataKey:"date",tickFormatter:Et,tick:{fill:t.fg3,fontSize:A},axisLine:{stroke:t.borderWeak},tickLine:!1,minTickGap:8}),i.jsx(C,{yAxisId:"right",orientation:"right",tickFormatter:Q,tick:{fill:t.fg3,fontSize:A},axisLine:!1,tickLine:!1,width:38}),i.jsx(C,{yAxisId:"left",tickFormatter:m=>`${m.toFixed(1)}%`,tick:{fill:t.fg3,fontSize:A},axisLine:!1,tickLine:!1,width:34}),i.jsx(wt,{content:i.jsx(S,{}),cursor:{fill:`${t.blue}18`}}),i.jsx(It,{wrapperStyle:{fontSize:A,color:t.fg3,paddingTop:4,lineHeight:"14px"},formatter:m=>i.jsx("span",{style:{color:m==="sharesNumber"?t.blue:t.fg1},children:m==="sharesNumber"?"Shares":"% Portfolio"})}),i.jsx(jt,{yAxisId:"right",dataKey:"sharesNumber",fill:t.blue,radius:[3,3,0,0],maxBarSize:28}),i.jsx(vt,{yAxisId:"left",type:"monotone",dataKey:"weight",stroke:t.fg1,strokeWidth:2,dot:!1})]})}),!f&&!a&&l.length===0&&i.jsx("div",{style:{fontSize:g.sm,color:t.fg3,textAlign:"center",padding:"20px 0"},children:s("popup.institutions.noHistory",{symbol:r})})]})]})}function O(t){return k(t.investor,t.name,t.cik)}function rt(t,e){return t.name&&t.name!==e?t.name:""}function Lt(t,e,n){const s=t==null||typeof t=="string"&&!t.trim()||typeof t=="number"&&!Number.isFinite(t),r=e==null||typeof e=="string"&&!e.trim()||typeof e=="number"&&!Number.isFinite(e);if(s&&r)return 0;if(s)return 1;if(r)return-1;const o=n==="asc"?1:-1;return typeof t=="number"&&typeof e=="number"?(t-e)*o:String(t).localeCompare(String(e))*o}function zt(t,e,n){const s=n==="asc"?"desc":"asc";return t.columnIndex!==e?{columnIndex:e,dir:n}:t.dir===n?{columnIndex:e,dir:s}:{columnIndex:null}}function Bt(t,e,n){if(n.columnIndex==null||!n.dir)return t;const s=e[n.columnIndex];return s?[...t].map((r,o)=>({row:r,index:o})).sort((r,o)=>Lt(s.sortValue(r.row),s.sortValue(o.row),n.dir)||r.index-o.index).map(r=>r.row):t}function z(t,e){return[...t].map((n,s)=>({row:n,index:s})).sort((n,s)=>{const r=e(n.row),o=e(s.row);return r==null&&o==null?n.index-s.index:r==null?1:o==null?-1:o-r||n.index-s.index}).map(n=>n.row)}function Vt({T:t,label:e,value:n}){return i.jsxs("div",{style:{minWidth:0,display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"baseline",gap:12,padding:"9px 0",borderBottom:`1px solid ${t.hairline}`},children:[i.jsx("div",{style:{color:t.fg3,fontSize:12,fontWeight:g.w400,lineHeight:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e}),i.jsx("div",{style:{color:t.fg1,fontSize:13,fontWeight:g.w500,lineHeight:"18px",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:n||"--"})]})}function _t({T:t,overview:e,fallbackMarketValue:n}){const{t:s}=N(),r=d.useRef(null),[o,l]=d.useState(!1);d.useEffect(()=>{const f=r.current;if(!f)return;const p=()=>l(f.clientWidth<620);p();const a=new ResizeObserver(p);return a.observe(f),()=>a.disconnect()},[]);const u=[[s("popup.institutions.marketValueShort"),H(e.marketValue??n)],[s("popup.institutions.portfolioSize"),k(e.portfolioSize)||"â"],[s("popup.institutions.holdingPeriod"),e.averageHoldingPeriod==null?"â":s("popup.institutions.yearsValue",{count:e.averageHoldingPeriod})],[s("popup.institutions.turnover"),e.turnover==null?"â":Nt(e.turnover)],[s("popup.institutions.securitiesAdded"),e.securitiesAdded??"â"],[s("popup.institutions.securitiesRemoved"),e.securitiesRemoved??"â"],[s("popup.institutions.performance1y"),e.performance1y==null?"â":L(e.performance1y)],[s("popup.institutions.performance3y"),e.performance3y==null?"â":L(e.performance3y)],[s("popup.institutions.performance5y"),e.performance5y==null?"â":L(e.performance5y)]];
1return i.jsxs("div",{ref:r,style:{marginBottom:18},children:[i.jsx(it,{T:t,title:s("popup.institutions.overview")}),i.jsx(B,{T:t,style:{padding:"6px 16px 10px"},children:i.jsx("div",{style:{display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"repeat(2, minmax(0, 1fr))",columnGap:28,minWidth:0},children:u.map(([f,p])=>i.jsx(Vt,{T:t,label:f,value:p},f))})})]})}function st({T:t,visible:e,total:n}){return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",height:20,borderRadius:$.pill,border:`1px solid ${t.hairline}`,padding:"0 8px",color:t.fg4,fontSize:10.5,fontWeight:g.w600,whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:["Rows ",e,"/",n]})}function Pt({T:t,row:e,onSelectSymbol:n}){const s=k(e.symbol).toUpperCase(),r=k(e.securityName,e.name),o=e.isNew===!0;return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,minWidth:0},children:[i.jsx(St,{T:t,symbol:s,size:24}),i.jsxs("div",{style:{minWidth:0,flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0},children:[i.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),s&&(n==null||n(s))},disabled:!s||!n,style:{display:"block",minWidth:0,background:"none",border:"none",padding:0,color:t.fg1,fontSize:12,fontWeight:g.w500,fontFamily:"inherit",cursor:s&&n?"pointer":"default",lineHeight:"18px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s||"â"}),o&&i.jsx("span",{style:{padding:"1px 5px",borderRadius:$.badge,background:t.gainBg,color:t.gain,fontSize:10,fontWeight:g.w400,lineHeight:1.2,flexShrink:0},children:"NEW"})]}),i.jsx("div",{title:r,style:{marginTop:1,minWidth:0,color:t.fg5,fontSize:10.5,lineHeight:"14px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r||"â"})]})]})}function Ct({T:t,column:e,active:n,dir:s,align:r,onClick:o}){return i.jsxs("button",{type:"button",role:"columnheader",onClick:o,title:`Sort by ${e.label}`,style:{minWidth:0,border:"none",background:"transparent",color:n?t.fg2:t.fg5,cursor:"pointer",fontFamily:"inherit",fontSize:12,lineHeight:"18px",fontWeight:n?g.w600:g.w500,letterSpacing:0,padding:0,width:"100%",display:"flex",gap:4,alignItems:"center",justifyContent:r==="right"?"flex-end":"flex-start",textAlign:r,whiteSpace:"nowrap",overflow:"hidden"},children:[i.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),n&&s&&i.jsx("img",{src:`/icons/${s==="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}})]})}function ot({T:t,columns:e,rows:n,gridTemplateColumns:s,minWidth:r,sortable:o=!1,sort:l,onSort:u,stickyFirstColumn:f=!1}){const p=(a,h=!1)=>f&&a===0?{position:"sticky",left:0,zIndex:h?4:3,background:t.bgCardAlt,boxShadow:`1px 0 0 ${t.hairline}`}:{};return i.jsx("div",{className:"su-scroll",style:{overflowX:"auto",minWidth:0},children:i.jsxs("div",{role:"table",style:{minWidth:r,width:"100%"},children:[i.jsx("div",{role:"row",style:{display:"grid",gridTemplateColumns:s,columnGap:6,alignItems:"center",padding:"0 2px 7px",borderBottom:`1px solid ${t.hairline}`,marginBottom:3},children:e.map((a,h)=>{const j=a.align??(h===0?"left":"right"),v=(l==null?void 0:l.columnIndex)===h,S=v?l==null?void 0:l.dir:void 0;return o&&u?i.jsx("div",{style:p(h,!0),children:i.jsx(Ct,{T:t,column:a,active:v,dir:S,align:j,onClick:()=>u(h)})},a.label):i.jsx("div",{role:"columnheader",style:{minWidth:0,color:t.fg5,fontSize:12,lineHeight:"18px",fontWeight:g.w600,textAlign:j,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...p(h,!0)},children:a.label},a.label)})}),n.map((a,h)=>i.jsx("div",{role:"row",style:{display:"grid",gridTemplateColumns:s,columnGap:6,alignItems:"center",padding:"7px 2px",borderBottom:`1px solid ${t.hairline}`,borderRadius:$.xs},children:e.map((j,v)=>i.jsx("div",{role:"cell",style:{minWidth:0,color:t.fg2,fontSize:12,lineHeight:"18px",textAlign:j.align??(v===0?"left":"right"),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontVariantNumeric:v===0?void 0:"tabular-nums",...p(v)},children:j.cell(a)},`${h}-${v}`))},h))]})})}function lt({T:t,title:e,rows:n,columns:s,gridTemplateColumns:r,minWidth:o,onOpen:l,stickyFirstColumn:u=!1}){const[f,p]=d.useState(!1),a=n.slice(0,Wt);return i.jsxs("div",{style:{marginBottom:20,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginBottom:8,minWidth:0}
1,children:[i.jsx("div",{style:{fontSize:14,fontWeight:g.w500,color:t.fg1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e}),i.jsx(st,{T:t,visible:a.length,total:n.length})]}),i.jsx("div",{role:"button",tabIndex:0,"aria-label":`Open full ${e} table`,onClick:l,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onFocus:()=>p(!0),onBlur:()=>p(!1),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},style:{minWidth:0,fontFamily:"inherit",outline:"none"},children:i.jsx(B,{T:t,style:{padding:"14px 16px",cursor:"pointer",overflow:"hidden",border:`1px solid ${f?t.border:t.hairline}`,transition:"border-color .15s"},children:i.jsx(ot,{T:t,columns:s,rows:a,gridTemplateColumns:r,minWidth:o,stickyFirstColumn:u})})})]})}function X({T:t,rows:e,columns:n,gridTemplateColumns:s,minWidth:r,initialSort:o,stickyFirstColumn:l=!1}){const[u,f]=d.useState(o),p=d.useMemo(()=>Bt(e,n,u),[n,e,u]);return i.jsx("div",{children:i.jsxs(B,{T:t,style:{padding:"14px 16px",minWidth:0,overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginBottom:8,minWidth:0},children:[i.jsx("div",{style:{fontSize:11,fontWeight:g.w600,color:t.fg1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Full Table"}),i.jsx(st,{T:t,visible:p.length,total:e.length})]}),i.jsx(ot,{T:t,columns:n,rows:p,gridTemplateColumns:s,minWidth:r,sortable:!0,sort:u,stickyFirstColumn:l,onSort:a=>{const h=n[a];h&&f(j=>zt(j,a,h.firstSortDir))}})]})})}function ut(t){return Math.max(...t.map(e=>E(e)),0)}function Kt({T:t,value:e,maxValue:n}){const s=n>0?e/n*100:0,r=Math.max(0,Math.min(100,s));return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:7,maxWidth:"100%"},children:[i.jsx("span",{style:{width:38,height:4,borderRadius:4,background:t.bgControl,overflow:"hidden",flex:"0 0 38px"},children:i.jsx("span",{style:{display:"block",width:`${r}%`,height:"100%",borderRadius:4,background:t.blue}})}),i.jsx("span",{style:{minWidth:48,color:t.fg2,...bt},children:_(e)})]})}function ct(t,e){return[{label:"Industry",align:"left",firstSortDir:"asc",sortValue:n=>Y(k(n.industry,n.name)).toLowerCase(),cell:n=>Y(k(n.industry,n.name))||"â"},{label:"% Portfolio",align:"right",firstSortDir:"desc",sortValue:n=>E(n),cell:n=>i.jsx(Kt,{T:t,value:E(n),maxValue:e})}]}function dt(t,e,n){const s=r=>r==null?t.fg5:r>=0?t.gain:t.loss;return[{label:e("popup.institutions.symbol"),align:"left",firstSortDir:"asc",sortValue:r=>k(r.symbol,r.securityName,r.name).toLowerCase(),cell:r=>i.jsx(Pt,{T:t,row:r,onSelectSymbol:n})},{label:e("popup.institutions.mktValue"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.marketValue),cell:r=>H(r.marketValue)},{label:e("popup.institutions.pctPortfolio"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.weight),cell:r=>_(r.weight)},{label:e("popup.institutions.deltaWeight"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.changeInWeight),cell:r=>{const o=b(r.changeInWeight);return i.jsx("span",{style:{color:s(o)},children:Mt(o)})}},{label:e("popup.institutions.shares"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.sharesNumber),cell:r=>r.sharesNumber!=null?H(r.sharesNumber):"â"},{label:e("popup.institutions.sharesChg"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.changeInSharesNumber),cell:r=>{const o=b(r.changeInSharesNumber);return i.jsx("span",{style:{color:s(o)},children:o==null?"â":H(o)})}},{label:e("popup.institutions.pctShrsChg"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.changeInSharesNumberPercentage),cell:r=>{const o=b(r.changeInSharesNumberPercentage);return i.jsx("span",{style:{color:s(o)},children:o==null?"â":`${o>=0?"+":""}${o.toFixed(2)}%`})}},{label:e("popup.institutions.pctOwned"),align:"right",firstSortDir:"desc",sortValue:r=>b(r.ownership),cell:r=>i.jsx("span",{style:{color:t.fg3},children:_(r.ownership)})}]}function Gt({T:t,rows:e,onOpen:n}){const{t:s}=N();if(!e.length)return null;const r=z(e,E),o=ut(r);return i.jsx(lt,{T:t,title:s("popup.institutions.industryComposition"),rows:r,columns:ct(t,o),gridTemplateColumns:D,minWidth:T,onOpen:n})}function Ut({T:t,rows:e,onSelectSymbol:n,onOpen:s}){const{t:r}=N();if(!e.length)return null;const o=z(e,u=>b(u.weight)),l=dt(t,r,n);return i.jsx(lt,{T:t,title:r("popup.institutions.securitiesHoldings"),rows:o,columns:l,gridTemplateColumns:tt,minWidth:et,stickyFirstColumn:!0,onOpen:s})}function Yt({T:t,inv:e,colorIndex:n,onSelectSymbol:s,initialTableView:r,onTableViewChange:o}){const{t:l}
1=N(),[u,f]=d.useState(null),[p,a]=d.useState(!0),[h,j]=d.useState(null),[v,S]=d.useState(()=>r??null);d.useEffect(()=>{let I=!1;return a(!0),j(null),pt(e.cik).then(M=>{I||(f(M),a(!1))}).catch(M=>{I||(j((M==null?void 0:M.message)??"Failed to load"),a(!1))}),()=>{I=!0}},[e.cik]),d.useEffect(()=>{S(r??null)},[r,e.cik]);const m=d.useCallback(I=>{S(I),o==null||o(I)},[o]),y=O(e),W=rt(e,y),c=(u==null?void 0:u.overview)??{},x=d.useMemo(()=>u?z(u.industryComposition??[],E):[],[u]),w=d.useMemo(()=>u?z(u.securitiesHoldings??[],I=>b(I.weight)):[],[u]),F=d.useMemo(()=>ut(x),[x]),R=d.useMemo(()=>ct(t,F),[t,F]),at=d.useMemo(()=>dt(t,l,s),[t,l,s]),P=u?Array.from(new Set(u.securitiesHoldings.map(I=>k(I.symbol).toUpperCase()).filter(Boolean))).sort():[];return u&&v==="industry"?i.jsx(X,{T:t,rows:x,columns:R,gridTemplateColumns:D,minWidth:T,initialSort:{columnIndex:1,dir:"desc"}}):u&&v==="holdings"?i.jsx(X,{T:t,rows:w,columns:at,gridTemplateColumns:tt,minWidth:et,initialSort:{columnIndex:2,dir:"desc"},stickyFirstColumn:!0}):i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,margin:"2px 0 16px",minWidth:0},children:[i.jsx(nt,{name:y,size:kt,colorIndex:n}),i.jsxs("div",{style:{minWidth:0,maxWidth:"100%"},children:[i.jsx("div",{style:{fontSize:15,fontWeight:g.w500,color:t.fg1,lineHeight:1.15,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y}),W&&i.jsx("div",{style:{color:t.fg3,fontSize:11.5,lineHeight:1.15,marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W})]})]}),p&&i.jsx(q,{T:t,rows:6}),h&&i.jsx(J,{T:t,msg:`Failed to load - ${h}`}),u&&i.jsxs(i.Fragment,{children:[i.jsx(_t,{T:t,overview:c,fallbackMarketValue:e.mkt_value}),i.jsx(Gt,{T:t,rows:x,onOpen:()=>m("industry")}),i.jsx(Ut,{T:t,rows:w,onSelectSymbol:s,onOpen:()=>m("holdings")}),P.length>0&&i.jsx(Ht,{T:t,cik:e.cik,symbols:P})]})]})}function Xt({T:t,onSelectSymbol:e,onDetailChange:n,initialDetailSymbol
1:s,onDetailSymbolChange:r,initialDetailTable:o,onDetailTableChange:l}){const{t:u}=N(),[f,p]=d.useState([]),[a,h]=d.useState(!0),[j,v]=d.useState(null),S=d.useRef(null),m=()=>{var x,w;let c=((x=S.current)==null?void 0:x.parentElement)??null;for(;c;){const F=getComputedStyle(c).overflowY;if((F==="auto"||F==="scroll")&&c.scrollHeight>c.clientHeight){c.scrollTo({top:0,behavior:"smooth"});return}c=c.parentElement}(w=S.current)==null||w.scrollIntoView({behavior:"smooth",block:"start"})},y=d.useCallback(()=>{v(null),l==null||l(null),r==null||r(null),n==null||n(null,null),setTimeout(m,10)},[n,r,l]),W=d.useCallback((c,x)=>{const w=O(c);v({inv:c,idx:x}),l==null||l(null),r==null||r(At(c)),n==null||n(w,y),setTimeout(m,10)},[y,n,r,l]);return d.useEffect(()=>{let c=!1;return ft().then(x=>{c||p(x)}).catch(()=>{c||p([])}).finally(()=>{c||h(!1)}),()=>{c=!0}},[]),d.useEffect(()=>{const c=s==null?void 0:s.trim();if(!c||!f.length||j&&Z(j.inv,c))return;const x=f.findIndex(w=>Z(w,c));if(x>=0){const w=f[x];v({inv:w,idx:x}),n==null||n(O(w),y);return}l==null||l(null),r==null||r(null),n==null||n(null,null)},[y,s,f,n,r,l,j]),a?i.jsx(q,{T:t,rows:7}):f.length?i.jsx("div",{ref:S,children:j?i.jsx(Yt,{T:t,inv:j.inv,colorIndex:j.idx,onSelectSymbol:e,initialTableView:Ot(o),onTableViewChange:l}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:f.map((c,x)=>{const w=O(c),F=rt(c,w);return i.jsxs("button",{onClick:()=>W(c,x),style:{display:"grid",gridTemplateColumns:`${G}px minmax(0, 1fr) ${U}px 14px`,alignItems:"center",gap:10,background:t.bgCardAlt,borderRadius:$.sm,padding:"10px 12px",border:`1px solid ${t.hairline}`,cursor:"pointer",textAlign:"left",fontFamily:"inherit",width:"100%",transition:"background .12s"},onMouseEnter:R=>R.currentTarget.style.background=t.bgControl,onMouseLeave:R=>R.currentTarget.style.background=t.bgCardAlt,children:[i.jsx(nt,{name:w,size:G,colorIndex:x}),i.jsxs("div",{style:{minWidth:0},children:[i.jsx("div",{style:{fontSize:13.5,fontWeight:g.w500,color:t.fg1,lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w}),i.jsx("div",{style:{fontSize:g.xs,color:t.fg5,marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F||"--"})]}),i.jsx("div",{style:{width:U,color:t.fg2,fontSize:12.5,fontWeight:g.w500,textAlign:"right",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:$t(c.mkt_value)}),i.jsx("img",{src:"/icons/nav-arrow-right.svg",width:14,height:14,style:{filter:"invert(0.5)",flexShrink:0},alt:""})]},c.cik??x)})})}):i.jsx(J,{T:t,msg:u("popup.institutions.noData")})}export{Xt 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.