1import{a as O}from"./chunk-MDE4MBX3.js";import{a as k}from"./chunk-IAWY5INA.js";import{a as z}from"./chunk-VG3H6ABL.js";import{a as A}from"./chunk-7H4USMMB.js";import"./chunk-5UQIUGH7.js";import"./chunk-6J2RMMQM.js";import{a as U}from"./chunk-W2BH6KKQ.js";import"./chunk-H5LBMRUP.js";import"./chunk-I5SLIUXT.js";import"./chunk-VWPATGG6.js";import{a as L}from"./chunk-KASXFZ6P.js";import{a as R}from"./chunk-DJYPL7W2.js";import{a as $}from"./chunk-EGCSG2G2.js";import{a as E}from"./chunk-ZA2VGKQE.js";import"./chunk-UWSAHVZU.js";import"./chunk-WVMIPZCG.js";import"./chunk-WM6N4WKG.js";import"./chunk-UENSDTAX.js";import"./chunk-AMSIJOHU.js";import{a as I,d as F}from"./chunk-VD3DNBDN.js";import{c as K,e as w}from"./chunk-VISZOBOM.js";import{Da as P,Ea as i,Ib as l,Jb as v,Ka as f,Kb as u,Lb as S,Qa as _,_b as N,ba as x,cb as d,db as m,e as j,hb as h,ib as s,jb as o,kb as y,la as T,ra as b,vb as g}from"./chunk-NPSW5S2Y.js";var c=j(K());function G(n,a){if(n&1&&(s(0,"div",5),l(1),o()),n&2){let e=g(2);i(),u(" Updated on ",e.dateUpdated,". ")}}function J(n,a){if(n&1&&(s(0,"div"),d(1,G,2,1,"div",5),o(),y(2,"favorite-sign",6)),n&2){let e=g();i(),m(e.loadingData()?-1:1),i(),h("pageName",e.pageName)("pType",e.pType)}}function B(n,a){if(n&1&&(s(0,"div")(1,"h4"),l(2),o()()),n&2){let e=g();i(2),u(" We currently do not have any data available for ",e.cycle,". ")}}function Y(n,a){if(n&1&&(s(0,"span")(1,"strong")(2,"em"),l(3),o()(),l(4," raised the most money, a total of "),s(5,"strong"),l(6),o(),l(7,". "),o()),n&2){let e=g(2);i(3),v(e.vizData[0].name),i(3),u("$",e.vizData[0].formattedDispVal)}}function W(n,a){if(n&1&&(s(0,"span")(1,"em"),l(2),o(),l(3),o()),n&2){let e=g(2);i(2),v(e.vizData[1].name),i(),u(" raised the second highest money, a total of $",e.vizData[1].formattedDispVal,". ")}}function q(n,a){if(n&1&&(s(0,"span")(1,"em"),l(2),o(),l(3),o()),n&2){let e=g(2);i(2),v(e.vizData[2].name),i(),u(" raised the third highest money, a total of $",e.vizData[2].formattedDispVal,". ")}}function Q(n,a){if(n&1&&y(0,"horiz-bar-incl-neg-grp-complex-chart",10),n&2){let e=g(2);h("chartData",e.vizData)("chartId",e.chartId)("chartTopTitle",e.chartTopTitle)("barPosFillColor",e.barPosFillColor)("barNegFillColor",e.barNegFillColor)("complexTooltips",e.complexTooltips)}}function X(n,a){if(n&1&&(s(0,"div",4)(1,"p"),l(2),d(3,Y,8,2,"span"),d(4,W,4,2,"span"),d(5,q,4,2,"span"),o(),s(6,"p"),l(7),o(),s(8,"p"),l(9," You can see details of individual campaign donations made to state-level candidates by all "),s(10,"a",7),l(11," individuals and committees"),o(),l(12),o(),s(13,"div",8)(14,"em"),l(15),o()(),y(16,"middle-1-ad-group",0),s(17,"div",9),d(18,Q,1,6,"horiz-bar-incl-neg-grp-complex-chart",10),o(),y(19,"name-value-3-cols-tbl",11),o()),n&2){let e=g();i(2),S(" According to recent campaign finance reports, among all ",e.state," state-level candidates in the ",e.cycle," election cycle, "),i(),m(e.vizData.length>=1?3:-1),i(),m(e.vizData.length>=2?4:-1),i(),m(e.vizData.length>=3?5:-1),i(2),S(" The chart below shows the top 10 ",e.state," state-level candidate fundraisers, and the table below shows the top ",e.nLen,". "),i(3),h("href",N("",e.mainLinkPrefix,"",e.cycle,"",e.otherIndvsLinkPostfix,"",e.stateLinkName,"/1"),P),i(2),u(" in ",e.state,". "),i(3),u(" Data Source: ",e.state," Secretary of State. "),i(),h("pageName",e.pageName),i(2),m(e.loadingData()?-1:18),i(),h("tableData",e.tableData)("tableId",e.tableId)("tableTitle",e.tableTitle)("tableHeaders",e.tableHeaders)("initialSortColumn",e.initialSortColumn)("showTotalRow",e.showTotalRow)("includeFilterNames",e.includeFilterNames)("filterPlaceHolder",e.filterPlaceHolder)}}var M=class n{constructor(a,e,t,r){this.activatedRoute=a;this.api=e;this.pageService=t;this.uSCountiesDataService=r}pageName="us_state_cands_top_fundraisers_per_cycle";dateCreated="December 31, 2024";dateUpdated="";pageTitle="";tableTitle="";chartTopTitle="";chartTopTitle2="";keywords=[];popYears=[2020];totalPopulation=0;state="";stateLinkName="";place="";placeLinkName="";fullPlaceName="";stateShort="";demogPercent=0;totalPercent="100%";USPopulation=0;totalPopDetails={totalName:"United States",value:0,percent:0};stats={};includeDC=!0;chartId=(0,c.kebabCase)(this.pageName);chartId2=`${(0,c.kebabCase)(this.pageName)}-2`;tableId=`table-${(0,c.kebabCase)(this.pageName)}`;complexTooltips={type:1,mainValueLabel:"Amount",mainValuePrefix:"$",mainValueSuffix:"",mainValueKey:"amount",yValueKey:"name",bottomLabelKey:"cycle",formattedMainValueKey:"formattedDispVal",formattedDisplayValueKey:"formattedVal",groupKey:"name",displayLabels:[]};chartData=[];nationalData=[];totalRowData={};nLen="";colsToFormat=["col4"];tableHeaders={col1:"Name",col2:"Office",col3:"Amount ($)"};tableColProps=["name","office","amount"];totalTableColProps=["name","office","amount"];tableData=[{col1:"",col2:0,col3:0}];tableTotalRow={col1:"",col2:"",col3:""};showTotalRow=!1;initialSortColumn="col3";includeFilterNames=!0;filterPlaceHolder="Type here to filter table";noDataExist=b(!0);loadingData=b(!0);paramsSubscription;ethnicity="";ethnicityLabel="";groupedPages1=[{title:"",url:""}];groupedPages2=[{title:"",url:""}];groupedPages3=[{title:"",url:""}];groupedPages4=[{title:"",url:""}];kebabEthnicity="";descVal1="popNum";descVal2="rate";descName="name";barPosFillColor="#258ab4";barPosFillColor2="#146e94";barNegFillColor="#ff6f88";dataSourceName="FEC";dataSourceURL="https://www.fec.gov/";mainLinkPrefix="/us-campaign-donations/state-level-campaigns/";otherIndvsLinkPostfix="/donations-by-individuals-and-committees-per-state-list-of-individuals-and-committees/";summarizedData={};vizData=[];donorName="";cycle="";pType="c";seeAlsoLinks=[];destroyRef=x(T);async ngOnInit(){try{this.loadingData.set(!0),this.paramsSubscription=this.activatedRoute.paramMap.subscribe(a=>{let e=a.get("cycle"),t=a.get("state");this.updatePageData(e,t)})}catch{}}async updatePageData(a,e){try{this.loadingData.set(!0);let t=(0,c.startCase)(e);
1this.state=t,this.stateLinkName=(0,c.kebabCase)((0,c.toLower)(t));let r=await this.uSCountiesDataService.getStateIndexAndName(t),p=r.stateShort;t=r.state,this.state=t,this.stateShort=p;let C=a,V=(0,c.snakeCase)(C);this.cycle=C;let H=(0,c.snakeCase)((0,c.toLower)(t));this.pageName=`us_state_candidates_top_fundraisers_per_state_${V}_${H}`,this.api.get("/page-data-x",{pageName:this.pageName,includeInfo:!0,pdType:"c"}).pipe(I(this.destroyRef)).subscribe({next:D=>{this.dataReceived(D,a,e)},error:D=>{}})}catch(t){console.log("error getting pop page.",t);let r=JSON.stringify({stage:"updatePageData",err:`${t}`});this.pageService.writePageError(this.pageName,r)}}async dataReceived(a,e,t){try{let r=a.data;if(this.dateUpdated=this.pageService.formatPageDate(a.updatedAt),!r||r.length==0){this.noDataExist.set(!0),this.stats=[],this.chartData=[];let C=JSON.stringify({cycle:e,state:t});this.pageService.updateNoDataPage(this.pageName,C),this.pageService.addNoIndexTag()}else this.noDataExist.set(!1),this.vizData=r[0].topNItems,this.chartData=r[0].allData,this.nLen=r[0].nLen;this.pageTitle=`${this.state} Top State-Level Candidate Campaign Fundraisers in the ${this.cycle} Election Cycle`,this.chartTopTitle=`${this.state} Top State-Level Candidate Campaign Fundraisers in the ${this.cycle} Election Cycle`,this.chartTopTitle2=`${this.state} Top State-Level Candidate Campaign Fundraisers in the ${this.cycle} Election Cycle`,this.tableTitle=`${this.state} Top State-Level Candidate Campaign Fundraisers in the ${this.cycle} Election Cycle`;let p=await this.composeShortPageDesc();this.pageService.performPrePageLoadTasks(this.pageName,this.pageTitle,p),this.loadingData.set(!1),await this.updateTableData()}catch(r){let p=JSON.stringify({stage:"dataReceived",err:`${r}`});this.pageService.writePageError(this.pageName,p),this.loadingData.set(!1)}}composeShortPageDesc(){let a="";return this.noDataExist()||(a=`chart and table showing the 2 top ${this.state} state-level candidates 3 by the total amount of money raised 4 in the ${this.cycle} election cycle.`),a}updateTableData(){try{let a=[],e={};if(this.tableData=a,this.tableTotalRow=this.tableTotalRow,this.tableData=[{col1:"",col2:0,col3:0}],this.chartData&&this.chartData.length>0)for(let t=0;t<this.chartData.length;t++){let r={};for(let p=0;p<this.tableColProps.length;p++)r[`col${p+1}`]=this.chartData[t][this.tableColProps[p]];a.push(r)}if(this.tableData=a,this.totalRowData)for(let t=0;t<this.totalTableColProps.length;t++)e[`col${t+1}`]=this.totalRowData[this.totalTableColProps[t]];this.tableTotalRow=e}catch(a){let e=JSON.stringify({stage:"updateTableData",err:`${a}`});this.pageService.writePageError(this.pageName,e)}}async ngOnDestroy(){this.paramsSubscription&&this.paramsSubscription.unsubscribe()}static \u0275fac=function(e){return new(e||n)(f(E),f(w),f(F),f(A))};static \u0275cmp=_({type:n,selectors:[["us-state-cands-top-fundraisers-per-cycle"]],decls:10,vars:7,consts:[[3,"pageName"],[1,"page-us-campaign-donations","rowFlex"],[1,"central-container","colFlex"],[1,"vis-page-title"],[1,"sub-section"],[1,"updated-at"],[3,"pageName","pType"],[3,"href"],[1,"interaction-data-info"],[1,"horiz-bar-group"],[3,"chartData","chartId","chartTopTitle","barPosFillColor","barNegFillColor","complexTooltips"],[3,"tableData","tableId","tableTitle","tableHeaders","initialSortColumn","showTotalRow","includeFilterNames","filterPlaceHolder"]],template:function(e,t){e&1&&(y(0,"top-ad-group",0),s(1,"div",1)(2,"div",2)(3,"h1",3),l(4),o(),d(5,J,3,3),d(6,B,3,1,"div"),d(7,X,20,24,"div",4),o(),y(8,"sidebar-ad-group",0),o(),y(9,"bottom-ad-group",0)),e&2&&(h("pageName",t.pageName),i(4),u(" ",t.pageTitle," "),i(),m(!t.noDataExist()&&!t.loadingData()?5:-1),i(),m(t.noDataExist()&&!t.loadingData()?6:-1),i(),m(!t.noDataExist()&&!t.loadingData()?7:-1),i(),h("pageName",t.pageName),i(),h("pageName",t.pageName))},dependencies:[L,R,$,U,z,O,k],styles:[".page-us-campaign-donations[_ngcontent-%COMP%]{display:flex}.page-us-campaign-donations[_ngcontent-%COMP%] .horiz-bar-group[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:50px}.page-us-campaign-donations[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:12px}.page-us-campaign-donations[_ngcontent-%COMP%] li[_ngcontent-%COMP%]::marker{position:absolute;
4left:-2rem;color:#0277bd;font-weight:600}"]})};export{M as USStatesTopFundraisersPerCycleComponent};
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.