{"version":3,"sources":["webpack:///./app/scripts/components/EmptyTable.js","webpack:///./app/scripts/components/Contest.tsx","webpack:///./app/scripts/components/HeadshotCandidateRow.tsx","webpack:///./app/scripts/utils/format-percent.ts","webpack:///./app/scripts/components/PureCanvas.tsx","webpack:///./app/scripts/components/CanvasLayer.tsx","webpack:///./app/scripts/components/Places.tsx","webpack:///./app/scripts/components/SvgLayer.tsx","webpack:///./app/scripts/components/MapLegend.tsx","webpack:///./app/scripts/colors.ts","webpack:///./app/scripts/components/Tooltip.tsx","webpack:///./app/scripts/components/TooltipTable.tsx","webpack:///./app/scripts/utils/get-point.ts","webpack:///./app/scripts/vendor/flatqueue.js","webpack:///./app/scripts/vendor/flatbush.js","webpack:///./app/scripts/utils/prepare-topojson.ts","webpack:///./app/scripts/components/LayeredMap.tsx","webpack:///./app/scripts/utils/clamp.js","webpack:///./app/scripts/utils/platform.ts","webpack:///./app/scripts/election-candidate-colors.ts","webpack:///./app/scripts/components/NewContestShowcase.tsx","webpack:///./config/modern-polyfills.js","webpack:///./app/scripts/components/Portal.js","webpack:///./app/scripts/kickstart.js","webpack:///../../src/util.js","webpack:///../../src/index.js","webpack:///./app/scripts/utils/debounce.js","webpack:///./app/scripts/utils/noop.js","webpack:///./app/scripts/components/Typeahead.js","webpack:///./app/scripts/components/YourRaces.js","webpack:///./app/scripts/utils/load-asset-url.js","webpack:///./app/scripts/utils/legislative-districts.js","webpack:///./app/scripts/components/Ad.js","webpack:///./app/scripts/ResultsApp.tsx","webpack:///./app/scripts/packs/main.js","webpack:///./app/scripts/endpoints.ts","webpack:///./app/scripts/utils/load-json-script.js","webpack:///./app/scripts/components/CandidateRow.tsx","webpack:///./app/scripts/utils/select-all.js","webpack:///./app/scripts/constants.ts","webpack:///./app/scripts/utils/select.js","webpack:///./app/scripts/packs/sticky-nav-bar.js","webpack:///./app/scripts/election-utils.ts","webpack:///./app/scripts/utils/get-json.js","webpack:///./app/scripts/components/OtherCandidate.js","webpack:///./app/scripts/components/SeatPartyDivider.tsx","webpack:///./app/scripts/utils/sum-values.js","webpack:///./app/scripts/utils/shallow-equal.ts","webpack:///./app/scripts/components/PureComponent.tsx","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./app/scripts/utils/find.ts","webpack:///./app/scripts/components/PartyPill.tsx"],"names":["EmptyTable","_ref","party","h","class","CandidateRow","Header","PreactHTMLConverter","Contest","Component","render","onePrimaryParty","contest","columnCount","contestTitle","isShowcaseRace","showContestTitleInShowcase","renderParty","hideEmptyParty","this","props","onePrimary","length","directory_slug","rowClass","cx","seat__races","seat__highlight_races","get_directory_slug","office","href","concat","title","xlinkHref","map","index","defaultProps","includeCountyRundown","HeadshotCandidateRow","PureComponent","getColor","totalVotesInContest","candidateColors","ballotName","find","colorObj","name","color","candidateId","contestIsCalled","contestResult","isIncumbent","isWinner","isViewable","numDelegates","votes","divStyle","checkStyle","checkClass","PartyPill","style","isCanvass","intcomma","formatPercent","cand","candidate","_defineProperty","isCalled","colSpan","Header_Prez","n","d","toFixed","PureCanvas","shouldComponentUpdate","ref","canvas","contextRef","getContext","CanvasLayer","constructor","super","setContextRef","bind","ctx","draw","geoPath","pixelRatio","scaleCanvas","width","height","window","devicePixelRatio","scale","updateCanvas","componentDidMount","d3GeoPath","projection","componentDidUpdate","position","top","left","zIndex","Places","places","place","idx","key","transform","centroid","dx","properties","dy","text-anchor","anchor","SvgLayer","handleMouseMove","handleMouseLeave","event","onMouseMove","onMouseLeave","setState","strokeLinecap","strokeLinejoin","pointerEvents","viewBox","preserveAspectRatio","state","MapLegend","candidates","includesNoResult","includesTie","backgroundColor","Tooltip","cls","isHidden","tooltipRef","klass","Portal","children","TooltipTable","candidatesMap","county","candidatesRender","source","sortedResults","entries","results","sort","a","b","value","pct_votes","total_votes","estimated_votes_mid","eevp","contestMetricsClass","contest__metrics__canvass","pct_votes_turnout","firstThreeResults","slice","county_pollinglocationsreporting","total_county_pollinglocations","countyHeader","result","get","candColor","filter","id","candidateColor","is_incumbent","is_winner","isMapRow","getPoint","node","x","y","rect","getBoundingClientRect","clientLeft","clientTop","FlatQueue","ids","values","clear","push","pos","parent","parentValue","pop","halfLength","right","bestIndex","bestValue","rightValue","peek","peekValue","ARRAY_TYPES","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Flatbush","data","ArrayBuffer","Error","magic","versionAndType","nodeSize","numItems","arguments","undefined","ArrayType","isNaN","Math","min","max","numNodes","_levelBounds","ceil","IndexArrayType","arrayTypeIndex","indexOf","nodesByteSize","BYTES_PER_ELEMENT","_boxes","_indices","_pos","minX","minY","maxX","maxY","Infinity","set","_queue","add","finish","hilbertValues","i","floor","hilbert","boxes","indices","pivot","j","swap","end","nodeMinX","nodeMinY","nodeMaxX","nodeMaxY","nodeIndex","search","filterFn","level","queue","neighbors","maxResults","maxDistance","q","maxDistSquared","upperBound","axisDist","dist","k","arr","m","temp","c","e","A","B","C","D","i0","i1","prepareTopoJSON","topology","object","objects","Object","keys","roadsObject","placesObject","urbanAreasObject","collection","feature","roads","urban_areas","bbox","getBBox","features","forEach","bounds","heightRatio","relocateTooltip","tooltip","innerWidth","innerHeight","LayeredMap","param","typeMap","activeBtn","activeGeometry","candidatesOnMap","geos","onDocumentTouch","getTooltipRef","canvasRenderer","xScale","scaleLinear","yScale","el","setUpCountyMap","counties","countyMap","fips","setUpCandidateMap","candidateMap","clientX","clientY","target","point","coords","invert","found","booleanPointInPolygon","activeCounty","base","contains","embedType","clearRect","fillStyle","leader","second","leadingId","beginPath","fill","closePath","lineCap","lineJoin","strokeStyle","lineWidth","stroke","places_mappable","arc","PI","componentWillReceiveProps","nextProps","getContainerDimensions","offsetWidth","rawWidth","clientWidth","domain","range","fitSize","bboxPolygon","document","addEventListener","precinctsReporting","totalVotes","boxSizing","stroke-width","totalPrecincts","mapType","invisible","Boolean","_ref2","has","userAgent","navigator","colors","raceCandidateColors","isIE","test","ContestShowcase","geoIdentity","reflectY","container","contestContainer","querySelector","mapContainer","countiesContainer","sourceMap","ShowcaseRaceWinner","asOf","notes","annotations","showDelegates","headerUsed","candidacies","colorLookup","office_slug","join","_contestPortal","determineContestTitle","SeatPartyDivider","partyName","partyBallot","tableHeader","renderCandidate","viewAllCandidates","is_called","contest_result","visibleCandidatesCount","_mapPortal","precincts_reporting","require","renderPortal","componentWillUnmount","defaultNode","body","removeChild","portal","createElement","appendChild","ttData","relatedContentContainer","getElementById","related_category","then","default","RelatedContent","AdLoader","targetingKey","targetingValue","init","getScroll","w","ret","method","documentElement","getScrollLeft","getScrollTop","getOffset","elem","box","doc","ownerDocument","docElem","getClientPosition","defaultView","parentWindow","getComputedStyleX","_RE_NUM_NO_PX","RegExp","RE_POS","LEFT","each","fn","isBorderBoxFn","getComputedStyle","computedStyle_","val","computedStyle","getPropertyValue","rsLeft","pixelLeft","BOX_MODELS","options","callback","old","hasOwnProperty","call","getPBMWidth","which","prop","cssProp","parseFloat","isWindow","obj","domUtils","getWH","extra","viewportWidth","viewportHeight","nodeType","docWidth","docHeight","borderBoxValue","offsetHeight","isBorderBox","cssBoxValue","Number","borderBoxValueOrIsBorderBox","padding","refWin","win","documentElementProp","compatMode","cssShow","visibility","display","getWHIgnoreDisplay","args","apply","css","v","_typeof","first","charAt","toUpperCase","includeMargin","util","_objectSpread2","getWindow","offset","current","setOffset","clone","overflow","_i","scrollLeft","scrollTo","scrollTop","config","allowHorizontalScroll","onlyScrollIfNeeded","alignWithTop","alignWithLeft","offsetTop","offsetLeft","offsetBottom","offsetRight","containerOffset","ch","cw","containerScroll","diffTop","diffBottom","winScroll","ww","wh","isWin","elemOffset","eh","outerHeight","ew","outerWidth","clientHeight","debounce","func","wait","immediate","timeout","context","timestamp","later","last","Date","now","setTimeout","callNow","Typeahead","highlightedIndex","isOpen","handleOnBlur","handleOnClear","handleOnFocus","handleOnInput","debouncedHandleOnInput","debounceDuration","handleKeyDown","setInputRef","setMenuRef","setItemRef","listRefs","_","prevState","count","getFilteredItems","maybeScrollItemIntoView","element","inputRef","menuRef","itemNode","menuNode","scrollIntoView","items","shouldItemRender","sortItems","item","highlightItemOnMouseEnter","selectItemOnClick","getItemValue","onSelect","blur","renderList","onMouseDown","preventDefault","cloneElement","renderItem","onClick","onMouseEnter","renderAttribution","onClear","onBlur","inputProps","onFocus","onChange","keyEvents","renderInput","_objectSpread","role","String","autocomplete","onInput","onKeyDown","type","aria-label","aria-hidden","noop","ArrowDown","itemsCount","newIndex","ArrowUp","Enter","keyCode","select","setSelectionRange","Escape","elementId","googleIMG","getAttribute","JSON","parse","textContent","asset_url","PlacesLib","east","west","south","north","YourRaces","contests","coordinates","lookupError","lookupPending","lookedFoundStored","redirectFish","placeholder","handleGeocode","debouncedHandleGeocode","sessionToken","input","async","trim","request","locationRestriction","includedPrimaryTypes","region","suggestions","AutocompleteSuggestion","fetchAutocompleteSuggestions","s","placePrediction","placeId","description","text","toString","place_id","_prediction","getPredictions","toPlace","Place","fetchFields","fields","latLng","location","latitude","lat","longitude","lng","getJSON","includeGeography","LOOKUP_URL","lookup","catch","google","maps","importLibrary","addressFeedback","matches","sboe","noteMatches","annoMatches","office_division","us_house","district","tx_senate","tx_house","findIsCalled","race","findContestResult","for","isHighlighted","src","alt","_extends","_resultsPortal","determineContestTitleYourRaces","_ref3","candidatesNum","_ref4","_ref5","_ref6","Ad","classes","App","timer","fetchData","console","info","lastUpdatedFormat","showLastUpdated","innerHTML","RESULTS_IN_USE","startTimer","LENGTH_OF_CHECK_INTERVAL","clearTimer","clearTimeout","seats_mapped","number","array","propertyName","texasHouseGroups","usHouseGroups","unique_seats","findIndex","texasHouse","usHouse","chunk","_yourPortal","NewContestShowcase","_supremePortal","_ref8","_usPortal","contestGroup","_ref0","_ref10","_ref12","_sboePortal","_ref14","_crimPortal","_ref16","_senatePortal","_ref18","_housePortal","_ref20","loadJsonScript","uncontested","IsAsterisk","includes","selectAll","Node","Window","Array","prototype","querySelectorAll","appNav","appNavHeight","round","appNavJumps","anchorJumps","pageYOffset","journalize","apdate","formatted_time","aptime","apmonth","getDate","size","reduce","acc","TT_directory_slugs","slug","CandidateColorsRace1","CandidateColorsRace2","PRESIDENT_ORDER","sort_candidates_presidential","alert_conditionals","vote_pct","cand_num","label_conditionals","alert_winners","winner_conditionals","text_conditionals","text_conditional_winner_zero","determineDistrictTitle","division_type","capfirst","jsonResponse","res","ok","status","statusText","json","fetch","OtherCandidate","candidateCount","onViewableToggle","firstShowcaseRace","isHomepage","converter","shouldDisplayResult","pct_votes_turnout_zero_winner","pct_votes_turnout_w_uncontested","pct_votes_explain","colorWinner","ManualoverrideSource","klaxon","homepage__metrics","precinctsClass","IsAnnotations","IsNoted","pollinglocationsreporting","total_pollinglocations","pollinglocations_reporting_percent","convert","hOP","is","shallowEqual","objA","objB","keysA","keysB","assign","t","r","predicate","TypeError","excludeInitial","partyPrefix","toLowerCase","partyInitial","memoize"],"mappings":"svrmDAiBeA,EAdIC,IAAgB,IAAf,MAAEC,GAAOD,EAC3B,OACEE,YAAA,OAAKC,MAAM,cACTD,YAAA,OAAKC,MAAM,QACTD,YAAA,MAAIC,MAAM,eACRD,YAAA,YAAOD,IAETC,YAAA,SAAOC,MAAM,oBAAoBC,IAAaC,QAC9CH,YAAA,OAAKC,MAAM,yBAAwB,oC,YCDzBG,gCAiBlB,MAAMC,UAAgBC,YACpBC,SACE,IAYIC,GAZE,QACJC,EAAO,YACPC,EAAW,aACXC,EAAY,eACZC,EAAc,2BACdC,EAA0B,YAC1BC,EAAW,eACXC,GACEC,KAAKC,MAEHC,EAA+B,GAAlBT,EAAQU,OAIvBD,IACFV,EAAkBC,EAAQ,GAAGV,OAG/B,IAKIqB,EALEC,EAAWC,IAAG,CAClBC,aAAcX,EACdY,sBAAuBZ,IASzB,OAJIH,EAAQ,KACVW,EAAiBK,YAAmBhB,EAAQ,GAAGiB,SAI/C1B,YAAA,OAAKC,MAAM,SACPW,GACAZ,YAAA,MAAIC,MAAM,eACRD,YAAA,YAAOW,GAEe,MAArBS,EAAe,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IAAIC,UAAU,gCAGtB,IAAK,IAAIhlB,EAAI,EAAGA,EAAI2B,EAAIxP,OAAQ6N,IAC9B,GAAI+kB,EAAUpjB,EAAI3B,GAAIA,EAAG2B,GACvB,OAAOA,EAAI3B,GAnBjB,mC,kCCAA,sEAYA,SAASxL,EAAS1D,GAA2C,IAA1C,eAAEm0B,EAAc,MAAEl0B,EAAK,MAAE0D,GAAc3D,EAClDo0B,EAAcn0B,EAAM8J,MAAM,EAAG,GAAGsqB,cAChCC,EAAer0B,EAAM,GAAGwf,cAExB8M,EAAU/qB,IAAG,cAAc,SAADM,OAAWsyB,IAE3C,OACEl0B,YAAA,QAAMC,MAAOosB,EAAS5oB,MAAOA,EAAO5B,MAAO2vB,mBAASzxB,KAChDk0B,GAAkBG,GAK1B5wB,EAAUvB,aAAe,CACvBgyB,gBAAgB,GAGHI,QAAQ7wB,EAAWyT,IAAA,IAAC,MAAElX,EAAK,MAAE0D,GAAOwT,EAAA,MAAM,CACvDlX,MAAOA,EACP0D,MAAOA,O","file":"main.abfab15ba1.mjs","sourcesContent":["import { h } from 'preact';\nimport CandidateRow from './CandidateRow';\n\nconst EmptyTable = ({ party }) => {\n  return (\n    <div class=\"seat__race\">\n      <div class=\"race\">\n        <h4 class=\"race__title\">\n          <span>{party}</span>\n        </h4>\n        <table class=\"race__candidates\">{CandidateRow.Header}</table>\n        <div class=\"no_primary_candidates\">No primary candidates running</div>\n      </div>\n    </div>\n  );\n};\n\nexport default EmptyTable;\n","import cx from 'classnames';\nimport { Component, h } from 'preact';\nimport { PreactHTMLConverter } from 'preact-html-converter';\n\n// components\nimport EmptyTable from './EmptyTable';\n\n// internal\nimport { get_directory_slug } from '../election-utils';\n\nconst converter = PreactHTMLConverter();\n\ntype Props = {\n  contest: { [key: string]: any };\n  columnCount: number;\n  contestTitle: string;\n  includeCountyRundown?: boolean;\n  isShowcaseRace?: boolean;\n  renderParty: any;\n  renderCandidate: any;\n  embedType: string;\n  broadcastHeaderImage: string;\n  activeContestId: string;\n  showContestTitleInShowcase?: boolean;\n  hideEmptyParty?: boolean;\n};\n\nclass Contest extends Component<Props> {\n  render() {\n    const {\n      contest,\n      columnCount,\n      contestTitle,\n      isShowcaseRace,\n      showContestTitleInShowcase,\n      renderParty,\n      hideEmptyParty,\n    } = this.props;\n\n    const onePrimary = contest.length == 1;\n\n    let onePrimaryParty;\n\n    if (onePrimary) {\n      onePrimaryParty = contest[0].party;\n    }\n\n    const rowClass = cx({\n      seat__races: !isShowcaseRace,\n      seat__highlight_races: isShowcaseRace,\n    });\n\n    let directory_slug;\n\n    if (contest[0]) {\n      directory_slug = get_directory_slug(contest[0].office);\n    }\n\n    return (\n      <div class=\"seat\">\n        {!isShowcaseRace && (\n          <h3 class=\"seat__title\">\n            <span>{contestTitle}</span>\n            {/* Let's not show U.S. House directory links because the redistricting boundaries have changed and will be reflected in our directory in 2027 */}\n            {directory_slug[0] != null && contest[0].office != 'U.S. House'  && (\n              <a\n                class=\"t-links-unset\"\n                href={`https://www.texastribune.org/directory/districts/${directory_slug[0]['directory-slug']}/${contest[0]['office_division']}`}\n              >\n                <span class=\"icon-div\" title=\"Click to learn more about this district\" >\n                  <svg class=\"icon icon-info\">\n                    <use xlinkHref=\"#icon-info\"></use>\n                  </svg>\n                </span>\n              </a>\n            )}\n          </h3>\n        )}\n        <div class={rowClass}>\n          {onePrimary &&\n            onePrimaryParty == 'Republican' &&\n            !isShowcaseRace &&\n        !hideEmptyParty && <EmptyTable party={'Democrat'} />}\n\n\n          {!isShowcaseRace &&\n        contest.map((party: any, index) => renderParty(party, index))}\n\n          {isShowcaseRace && (\n            <div>\n              {showContestTitleInShowcase && (\n                <h3 class=\"seat__title\">\n                  <span>{contest.office}</span>\n                </h3>\n              )}\n              {renderParty(contest)}\n            </div>\n          )}\n          {onePrimary &&            onePrimaryParty == 'Democrat' &&\n            !isShowcaseRace &&\n            !hideEmptyParty && <EmptyTable party={'Republican'} />}\n        </div>\n      </div>\n    );\n  }\n}\n\nContest.defaultProps = {\n  isShowcaseRace: false,\n  includeCountyRundown: false,\n};\n\nexport default Contest;\n","import cx from 'classnames';\nimport { intcomma } from 'journalize';\nimport { h, VNode } from 'preact';\n\nimport PureComponent from './PureComponent';\n\nimport formatPercent from '../utils/format-percent';\nimport { isCanvass } from '../endpoints';\nimport PartyPill from './PartyPill';\n\ninterface Props {\n  ballotName: string;\n  candidateId: string;\n  contestIsCalled: boolean;\n  contestResult: string;\n  isIncumbent: boolean;\n  isWinner: boolean;\n  numDelegates: any | null;\n  candidateColors: { [key: string]: any };\n  party: string;\n  totalVotesInContest: number;\n  votes: number;\n}\n\nclass HeadshotCandidateRow extends PureComponent<Props> {\n  static columnCount: number;\n  static Header: VNode;\n  static Header_Prez: VNode;\n\n  getColor(totalVotesInContest, candidateColors, ballotName, party) {\n    if (totalVotesInContest === 0) return '#bababa';\n\n    if (candidateColors.length === 0) {\n      return party === 'Republican' ? ['#EF564A'] : ['#1755c5'];\n    }\n\n    if (candidateColors.length > 0) {\n      const candidateMatch = candidateColors.find(colorObj => colorObj.name === ballotName)\n      return candidateMatch.color;\n    }\n\n    return '#EF564A';\n\n  }\n\n  render() {\n    const {\n      ballotName,\n      candidateId,\n      contestIsCalled,\n      contestResult,\n      isIncumbent,\n      isWinner,\n      party,\n      isViewable,\n      office,\n      numDelegates,\n      totalVotesInContest,\n      candidateColors,\n      votes,\n    } = this.props;\n\n    const color = this.getColor(totalVotesInContest, candidateColors, ballotName, party)\n\n    const divStyle = {\n      'background-color': color\n    };\n\n    const checkStyle = {\n      color: color\n    };\n\n    const IsAsterisk = false;\n\n    let rowClass = cx(\n      'candidate',\n      'contest__candidate-row',\n      'contest__candidate-row--headshot',\n      {\n        'contest__candidate-row--winner dem--border':\n          contestIsCalled && isWinner && party == 'Democrat',\n        'contest__candidate-row--winner rep--border':\n          contestIsCalled && isWinner && party == 'Republican',\n      }\n    );\n\n    let checkClass = cx('check', {\n      'dem-winner': party == 'Democrat',\n      'rep-winner': party == 'Republican',\n      'runoff-winner': contestResult == 'runoff',\n    });\n\n    if (!isViewable) {\n      rowClass += ' race__candidate-row--hidden';\n    }\n\n    const checkmark = '\\u2713';\n\n    return (\n      <tr class={rowClass}>\n        <td class=\"candidate__cell candidate__party\">\n          {party == 'Republican' && (\n            <PartyPill party={party} style={divStyle} />\n          )}\n          {party == 'Democrat' && <PartyPill party={party} style={divStyle} />}\n        </td>\n        <th class=\"candidate__cell candidate__name\">\n          {contestIsCalled && isWinner && contestResult != 'runoff' && (\n            <span class={checkClass} style={checkStyle}>\n              {checkmark}\n            </span>\n          )}\n          {contestIsCalled && isWinner && contestResult == 'runoff' && (\n            <span class={checkClass}>{checkmark}</span>\n          )}\n          {contestIsCalled &&\n          isWinner &&\n          isCanvass == true &&\n          contestResult != 'runoff' ? (\n            <span class={checkClass}>{ballotName}</span>\n          ) : (\n            ballotName\n          )}\n          {IsAsterisk && <span class=\"asterisk\">*</span>}{' '}\n          {isIncumbent && (\n            <span class=\"pill pill--basic\" title=\"Currently holds this seat\">\n              Incumbent\n            </span>\n          )}\n        </th>\n        <td class=\"candidate__cell candidate__votes\">{intcomma(votes)}</td>\n        <td class=\"candidate__cell candidate__pct\">\n          {formatPercent(votes, totalVotesInContest)}\n          <span class=\"candidate__pct-symbol\">%</span>\n        </td>\n        {numDelegates && (\n          <td class=\"candidate__cell candidate__votes\">\n            {\n              numDelegates.find(cand => cand.candidate == ballotName)[\n                'delegate-count'\n              ]\n            }\n          </td>\n        )}\n      </tr>\n    );\n  }\n}\n\nHeadshotCandidateRow.defaultProps = {\n  isIncumbent: false,\n  isCalled: false,\n  isWinner: false,\n  isViewable: true,\n};\n\nHeadshotCandidateRow.Header = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n    </tr>\n  </thead>\n);\n\nHeadshotCandidateRow.Header_Prez = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Delegates\n      </th>\n    </tr>\n  </thead>\n);\n\nHeadshotCandidateRow.columnCount = 6;\n\nexport default HeadshotCandidateRow;\n","function formatPercent(n: number, d: number): string {\n  if (d == null || d <= 0) return '0.0';\n\n  return ((n / d) * 100).toFixed(1);\n}\n\nexport default formatPercent;\n","import { Component, h } from 'preact';\n\ninterface Props {\n  style?: any;\n  contextRef: (\n    context: CanvasRenderingContext2D,\n    canvas: HTMLCanvasElement\n  ) => void;\n}\n\nclass PureCanvas extends Component<Props> {\n  shouldComponentUpdate() {\n    return false;\n  }\n\n  render() {\n    return (\n      <canvas\n        style={this.props.style}\n        ref={canvas =>\n          canvas ? this.props.contextRef(canvas.getContext('2d'), canvas) : null\n        }\n      />\n    );\n  }\n}\n\nPureCanvas.defaultProps = {\n  style: {},\n};\n\nexport default PureCanvas;\n","import {\n  geoPath as d3GeoPath,\n  GeoPath,\n  GeoProjection,\n  GeoIdentityTransform,\n} from 'd3-geo';\nimport { h } from 'preact';\n\nimport PureComponent from './PureComponent';\nimport PureCanvas from './PureCanvas';\n\nexport interface CanvasLayerProps {\n  projection: GeoProjection | GeoIdentityTransform;\n  width: number;\n  height: number;\n  typeMap: string;\n  render: (\n    ctx: CanvasRenderingContext2D,\n    geoPath: GeoPath,\n    pixelRatio: number\n  ) => void;\n}\n\nclass CanvasLayer extends PureComponent<CanvasLayerProps> {\n  ctx!: CanvasRenderingContext2D;\n  canvas!: HTMLCanvasElement;\n  geoPath!: GeoPath;\n  pixelRatio!: number;\n\n  constructor() {\n    super();\n\n    this.setContextRef = this.setContextRef.bind(this);\n  }\n\n  setContextRef(ctx: CanvasRenderingContext2D, canvas: HTMLCanvasElement) {\n    this.ctx = ctx;\n    this.canvas = canvas;\n  }\n\n  draw() {\n    const ctx = this.ctx;\n    const geoPath = this.geoPath;\n    const pixelRatio = this.pixelRatio;\n    const { render } = this.props;\n\n    render(ctx, geoPath, pixelRatio);\n  }\n\n  scaleCanvas(\n    canvas: HTMLCanvasElement,\n    ctx: CanvasRenderingContext2D,\n    width: number,\n    height: number\n  ) {\n    const pixelRatio = window.devicePixelRatio || 1;\n    this.pixelRatio = pixelRatio;\n\n    canvas.width = width * pixelRatio;\n    canvas.height = height * pixelRatio;\n\n    canvas.style.width = `${width}px`;\n    canvas.style.height = `${height}px`;\n\n    ctx.scale(pixelRatio, pixelRatio);\n  }\n\n  updateCanvas() {\n    this.scaleCanvas(\n      this.canvas,\n      this.ctx,\n      this.props.width,\n      this.props.height\n    );\n    this.draw();\n  }\n\n  componentDidMount() {\n    // we cannot set up our geoPath until we have a context\n    this.geoPath = d3GeoPath(this.props.projection, this.ctx);\n\n    this.updateCanvas();\n  }\n\n  componentDidUpdate() {\n    this.updateCanvas();\n  }\n\n  render() {\n    return (\n      <PureCanvas\n        style={{ position: 'absolute', top: 0, left: 0, zIndex: 1 }}\n        contextRef={this.setContextRef}\n      />\n    );\n  }\n}\n\nexport default CanvasLayer;\n","import { h } from 'preact';\nimport { GeoPath } from 'd3';\nimport PureComponent from './PureComponent';\nimport { Feature } from 'geojson';\n\nclass Places extends PureComponent<{ geoPath: GeoPath; places: Feature[] }> {\n  render() {\n    const { geoPath, places } = this.props;\n\n    return (\n      <g class=\"places\">\n        <g class=\"place-background-labels\">\n          {places.map((place, idx) => (\n            <text\n              key={`bg-${idx}`}\n              class=\"place-background-label\"\n              transform={`translate(${geoPath.centroid(place)})`}\n              dx={place.properties.dx}\n              dy={place.properties.dy}\n              text-anchor={place.properties.anchor}\n            >\n              {place.properties.name}\n            </text>\n          ))}\n        </g>\n        <g class=\"place-labels\">\n          {places.map((place, idx) => (\n            <text\n              key={`fg-${idx}`}\n              class=\"place-label\"\n              transform={`translate(${geoPath.centroid(place)})`}\n              dx={place.properties.dx}\n              dy={place.properties.dy}\n              text-anchor={place.properties.anchor}\n            >\n              {place.properties.name}\n            </text>\n          ))}\n        </g>\n      </g>\n    );\n  }\n}\n\nexport default Places;\n","import {\n  geoPath as d3GeoPath,\n  GeoPath,\n  GeoIdentityTransform,\n  GeoProjection,\n} from 'd3-geo';\nimport { Component, h, VNode } from 'preact';\n\nimport PureComponent from './PureComponent';\n\nexport interface SvgLayerProps {\n  projection: GeoProjection | GeoIdentityTransform;\n  width: number;\n  height: number;\n  render: (state: SvgLayerState) => VNode | null;\n  onMouseMove?: (event: MouseEvent) => void;\n  onMouseLeave?: (event: MouseEvent) => void;\n}\n\ninterface SvgLayerState {\n  geoPath: GeoPath;\n}\n\nclass SvgLayer extends PureComponent<SvgLayerProps, SvgLayerState> {\n  constructor() {\n    super();\n\n    this.handleMouseMove = this.handleMouseMove.bind(this);\n    this.handleMouseLeave = this.handleMouseLeave.bind(this);\n  }\n\n  handleMouseMove(event: MouseEvent) {\n    const { onMouseMove } = this.props;\n\n    if (onMouseMove) {\n      onMouseMove(event);\n    } else {\n      return;\n    }\n  }\n\n  handleMouseLeave(event: MouseEvent) {\n    const { onMouseLeave } = this.props;\n\n    if (onMouseLeave) {\n      onMouseLeave(event);\n    }\n  }\n\n  componentDidMount() {\n    const geoPath = d3GeoPath(this.props.projection);\n\n    this.setState({ geoPath });\n  }\n\n  render() {\n    const { width, height } = this.props;\n\n    return (\n      <svg\n        width={width}\n        height={height}\n        style={{\n          position: 'relative',\n          top: 0,\n          left: 0,\n          zIndex: 2,\n          strokeLinecap: 'round',\n          strokeLinejoin: 'round',\n          pointerEvents: 'none',\n        }}\n        viewBox={`0 0 ${width} ${height}`}\n        preserveAspectRatio=\"xMidYMid\"\n        onMouseMove={this.handleMouseMove}\n        onMouseLeave={this.handleMouseLeave}\n      >\n        <g>{this.props.render(this.state)}</g>\n      </svg>\n    );\n  }\n}\n\nexport default SvgLayer;\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nimport { DEMOCRAT, NEUTRAL, REPUBLICAN, TIE } from '../colors';\n\nfunction MapLegend({ candidates, includesNoResult, includesTie }) {\n  return (\n    <div class=\"results-map__legend\">\n      {/* <p class=\"results-map__legend-title\">Leader</p> */}\n      <div class=\"results-map__legend-items\">\n        {/* {candidates.map(candidate => {\n          return (\n            <div class=\"results-map__legend-item\">\n              <span\n                class={cx(\n                  'circle-pill',\n                  `pill--${candidate.party.slice(0, 3)}`\n                )}\n              />{' '}\n              <p class=\"results-map__legend-label\">\n                {candidate.ballot_sort_name}\n              </p>\n            </div>\n          );\n        })} */}\n        {includesTie && (\n          <div class=\"results-map__legend-item\">\n            <span class=\"circle-pill\" style={{ backgroundColor: TIE }} />{' '}\n            <p class=\"results-map__legend-label\">Tied</p>\n          </div>\n        )}\n        {includesNoResult && (\n          <div class=\"results-map__legend-item\">\n            <span class=\"circle-pill\" style={{ backgroundColor: NEUTRAL }} />{' '}\n            <p class=\"results-map__legend-label\">No votes</p>\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n\nexport default MapLegend;\n","const DEMOCRAT = [\n  '#1755c5',\n  '#ffc200',\n  '#91dfe5',\n  '#fcbec3',\n  '#5acc7d',\n  '#182b4b',\n];\n\nconst REPUBLICAN = [\n  '#1755c5',\n  '#ffc200',\n  '#91dfe5',\n  '#fcbec3',\n  '#5acc7d',\n  '#182b4b',\n];\n\nconst OTHER = '#888888';\n\nconst NEUTRAL = '#F2F2F2';\nconst TIE = '#ffc400';\n\nexport { DEMOCRAT, REPUBLICAN, NEUTRAL, TIE, OTHER };\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nimport Portal from './Portal';\n\ninterface Props {\n  class: string;\n  tooltipRef(any): void;\n  style?: { [key: string]: string };\n  isHidden?: boolean;\n}\n\nfunction Tooltip({ class: cls, style, isHidden, tooltipRef }: Props) {\n  const klass = cx(cls, { 'display-none': isHidden });\n\n  return (\n    <Portal>\n      <div class={klass} style={style} ref={tooltipRef}>\n        {this.props.children}\n      </div>\n    </Portal>\n  );\n}\n\nTooltip.defaultProps = {\n  class: 'tooltip',\n  isHidden: false,\n};\n\nexport default Tooltip;\n","// packages\nimport { entries } from 'd3-collection';\nimport cx from 'classnames';\nimport { h } from 'preact';\n\nimport { isCanvass } from '../endpoints';\n\n// components\nimport CandidateRow from './CandidateRow';\nimport PureComponent from './PureComponent';\n\n// internal\nimport formatPercent from '../utils/format-percent';\n\nclass TooltipTable extends PureComponent<any> {\n  render() {\n    const { candidatesMap, county, candidatesRender, source } = this.props;\n\n    const sortedResults = entries(county.results).sort(\n      (a, b) => b.value - a.value\n    );\n\n    const pct_votes =\n      source == 'Decision Desk HQ'\n        ? formatPercent(county.total_votes, county.estimated_votes_mid)\n        : county.eevp;\n\n    let contestMetricsClass = cx('contest__metrics', {\n      contest__metrics__canvass: isCanvass == true,\n    });\n\n    const pct_votes_turnout =\n      pct_votes < 100\n        ? `An estimated ${pct_votes}% of votes counted`\n        : `An estimated >99% of votes counted`;\n\n    const firstThreeResults = sortedResults.slice(0, 3);\n\n    return (\n      <div class=\"contest\">\n        <table class=\"contest__candidates contest__candidates--tooltip\">\n          <caption>\n            <p class=\"county__title\">{county.county} County</p>\n            <div class={contestMetricsClass}>\n              {isCanvass == false && (\n                <p class=\"contest__precincts\">\n                  {source != 'Associated Press' && source != 'Decision Desk HQ'\n                    ? `${formatPercent(\n                        county.county_pollinglocationsreporting,\n                        county.total_county_pollinglocations\n                      )}% reporting`\n                    : pct_votes_turnout}\n                </p>\n              )}\n            </div>\n          </caption>\n          {CandidateRow.countyHeader}\n          <tbody>\n            {firstThreeResults.map(result => {\n              const candidate = candidatesMap.get(result.key);\n\n              const candColor =\n                county.total_votes > 0\n                  ? candidatesRender.filter(cand => cand.name == candidate.name)\n                  : '#EF564A';\n\n              return (\n                <CandidateRow\n                  key={candidate.id}\n                  ballotName={candidate.name}\n                  candidateId={candidate.id}\n                  contestIsCalled={false}\n                  candidateColor={candColor[0]['color']}\n                  isIncumbent={candidate.is_incumbent}\n                  isWinner={candidate.is_winner}\n                  isMapRow\n                  party={candidate.party}\n                  totalVotesInContest={county.total_votes}\n                  votes={result.value}\n                />\n              );\n            })}\n          </tbody>\n        </table>\n      </div>\n    );\n  }\n}\n\nexport default TooltipTable;\n","function getPoint(node: HTMLElement, x: number, y: number): [number, number] {\n  const rect = node.getBoundingClientRect();\n  return [x - rect.left - node.clientLeft, y - rect.top - node.clientTop];\n}\n\nexport default getPoint;\n","export default class FlatQueue {\n  constructor() {\n    this.ids = [];\n    this.values = [];\n    this.length = 0;\n  }\n\n  clear() {\n    this.length = this.ids.length = this.values.length = 0;\n  }\n\n  push(id, value) {\n    this.ids.push(id);\n    this.values.push(value);\n\n    let pos = this.length++;\n    while (pos > 0) {\n      const parent = (pos - 1) >> 1;\n      const parentValue = this.values[parent];\n      if (value >= parentValue) break;\n      this.ids[pos] = this.ids[parent];\n      this.values[pos] = parentValue;\n      pos = parent;\n    }\n\n    this.ids[pos] = id;\n    this.values[pos] = value;\n  }\n\n  pop() {\n    if (this.length === 0) return undefined;\n\n    const top = this.ids[0];\n    this.length--;\n\n    if (this.length > 0) {\n      const id = (this.ids[0] = this.ids[this.length]);\n      const value = (this.values[0] = this.values[this.length]);\n      const halfLength = this.length >> 1;\n      let pos = 0;\n\n      while (pos < halfLength) {\n        let left = (pos << 1) + 1;\n        const right = left + 1;\n        let bestIndex = this.ids[left];\n        let bestValue = this.values[left];\n        const rightValue = this.values[right];\n\n        if (right < this.length && rightValue < bestValue) {\n          left = right;\n          bestIndex = this.ids[right];\n          bestValue = rightValue;\n        }\n        if (bestValue >= value) break;\n\n        this.ids[pos] = bestIndex;\n        this.values[pos] = bestValue;\n        pos = left;\n      }\n\n      this.ids[pos] = id;\n      this.values[pos] = value;\n    }\n\n    this.ids.pop();\n    this.values.pop();\n\n    return top;\n  }\n\n  peek() {\n    return this.ids[0];\n  }\n\n  peekValue() {\n    return this.values[0];\n  }\n}\n","import FlatQueue from './flatqueue';\n\nconst ARRAY_TYPES = [\n  Int8Array,\n  Uint8Array,\n  Uint8ClampedArray,\n  Int16Array,\n  Uint16Array,\n  Int32Array,\n  Uint32Array,\n  Float32Array,\n  Float64Array,\n];\n\nconst VERSION = 3; // serialized format version\n\nexport default class Flatbush {\n  static from(data) {\n    if (!(data instanceof ArrayBuffer)) {\n      throw new Error('Data must be an instance of ArrayBuffer.');\n    }\n    const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n    if (magic !== 0xfb) {\n      throw new Error('Data does not appear to be in a Flatbush format.');\n    }\n    if (versionAndType >> 4 !== VERSION) {\n      throw new Error(\n        `Got v${versionAndType >> 4} data when expected v${VERSION}.`\n      );\n    }\n    const [nodeSize] = new Uint16Array(data, 2, 1);\n    const [numItems] = new Uint32Array(data, 4, 1);\n\n    return new Flatbush(\n      numItems,\n      nodeSize,\n      ARRAY_TYPES[versionAndType & 0x0f],\n      data\n    );\n  }\n\n  constructor(numItems, nodeSize = 16, ArrayType = Float64Array, data) {\n    if (numItems === undefined)\n      throw new Error('Missing required argument: numItems.');\n    if (isNaN(numItems) || numItems <= 0)\n      throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n    this.numItems = +numItems;\n    this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n\n    // calculate the total number of nodes in the R-tree to allocate space for\n    // and the index of each tree level (used in search later)\n    let n = numItems;\n    let numNodes = n;\n    this._levelBounds = [n * 4];\n    do {\n      n = Math.ceil(n / this.nodeSize);\n      numNodes += n;\n      this._levelBounds.push(numNodes * 4);\n    } while (n !== 1);\n\n    this.ArrayType = ArrayType || Float64Array;\n    this.IndexArrayType = numNodes < 16384 ? Uint16Array : Uint32Array;\n\n    const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n    const nodesByteSize = numNodes * 4 * this.ArrayType.BYTES_PER_ELEMENT;\n\n    if (arrayTypeIndex < 0) {\n      throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n    }\n\n    if (data && data instanceof ArrayBuffer) {\n      this.data = data;\n      this._boxes = new this.ArrayType(this.data, 8, numNodes * 4);\n      this._indices = new this.IndexArrayType(\n        this.data,\n        8 + nodesByteSize,\n        numNodes\n      );\n\n      this._pos = numNodes * 4;\n      this.minX = this._boxes[this._pos - 4];\n      this.minY = this._boxes[this._pos - 3];\n      this.maxX = this._boxes[this._pos - 2];\n      this.maxY = this._boxes[this._pos - 1];\n    } else {\n      this.data = new ArrayBuffer(\n        8 + nodesByteSize + numNodes * this.IndexArrayType.BYTES_PER_ELEMENT\n      );\n      this._boxes = new this.ArrayType(this.data, 8, numNodes * 4);\n      this._indices = new this.IndexArrayType(\n        this.data,\n        8 + nodesByteSize,\n        numNodes\n      );\n      this._pos = 0;\n      this.minX = Infinity;\n      this.minY = Infinity;\n      this.maxX = -Infinity;\n      this.maxY = -Infinity;\n\n      new Uint8Array(this.data, 0, 2).set([\n        0xfb,\n        (VERSION << 4) + arrayTypeIndex,\n      ]);\n      new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n      new Uint32Array(this.data, 4, 1)[0] = numItems;\n    }\n\n    // a priority queue for k-nearest-neighbors queries\n    this._queue = new FlatQueue();\n  }\n\n  add(minX, minY, maxX, maxY) {\n    const index = this._pos >> 2;\n    this._indices[index] = index;\n    this._boxes[this._pos++] = minX;\n    this._boxes[this._pos++] = minY;\n    this._boxes[this._pos++] = maxX;\n    this._boxes[this._pos++] = maxY;\n\n    if (minX < this.minX) this.minX = minX;\n    if (minY < this.minY) this.minY = minY;\n    if (maxX > this.maxX) this.maxX = maxX;\n    if (maxY > this.maxY) this.maxY = maxY;\n  }\n\n  finish() {\n    if (this._pos >> 2 !== this.numItems) {\n      throw new Error(\n        `Added ${this._pos >> 2} items when expected ${this.numItems}.`\n      );\n    }\n\n    const width = this.maxX - this.minX;\n    const height = this.maxY - this.minY;\n    const hilbertValues = new Uint32Array(this.numItems);\n    const hilbertMax = (1 << 16) - 1;\n\n    // map item centers into Hilbert coordinate space and calculate Hilbert values\n    for (let i = 0; i < this.numItems; i++) {\n      let pos = 4 * i;\n      const minX = this._boxes[pos++];\n      const minY = this._boxes[pos++];\n      const maxX = this._boxes[pos++];\n      const maxY = this._boxes[pos++];\n      const x = Math.floor(\n        (hilbertMax * ((minX + maxX) / 2 - this.minX)) / width\n      );\n      const y = Math.floor(\n        (hilbertMax * ((minY + maxY) / 2 - this.minY)) / height\n      );\n      hilbertValues[i] = hilbert(x, y);\n    }\n\n    // sort items by their Hilbert value (for packing later)\n    sort(hilbertValues, this._boxes, this._indices, 0, this.numItems - 1);\n\n    // generate nodes at each tree level, bottom-up\n    for (let i = 0, pos = 0; i < this._levelBounds.length - 1; i++) {\n      const end = this._levelBounds[i];\n\n      // generate a parent node for each block of consecutive <nodeSize> nodes\n      while (pos < end) {\n        let nodeMinX = Infinity;\n        let nodeMinY = Infinity;\n        let nodeMaxX = -Infinity;\n        let nodeMaxY = -Infinity;\n        const nodeIndex = pos;\n\n        // calculate bbox for the new node\n        for (let i = 0; i < this.nodeSize && pos < end; i++) {\n          const minX = this._boxes[pos++];\n          const minY = this._boxes[pos++];\n          const maxX = this._boxes[pos++];\n          const maxY = this._boxes[pos++];\n          if (minX < nodeMinX) nodeMinX = minX;\n          if (minY < nodeMinY) nodeMinY = minY;\n          if (maxX > nodeMaxX) nodeMaxX = maxX;\n          if (maxY > nodeMaxY) nodeMaxY = maxY;\n        }\n\n        // add the new node to the tree data\n        this._indices[this._pos >> 2] = nodeIndex;\n        this._boxes[this._pos++] = nodeMinX;\n        this._boxes[this._pos++] = nodeMinY;\n        this._boxes[this._pos++] = nodeMaxX;\n        this._boxes[this._pos++] = nodeMaxY;\n      }\n    }\n  }\n\n  search(minX, minY, maxX, maxY, filterFn) {\n    if (this._pos !== this._boxes.length) {\n      throw new Error('Data not yet indexed - call index.finish().');\n    }\n\n    let nodeIndex = this._boxes.length - 4;\n    let level = this._levelBounds.length - 1;\n    const queue = [];\n    const results = [];\n\n    while (nodeIndex !== undefined) {\n      // find the end index of the node\n      const end = Math.min(\n        nodeIndex + this.nodeSize * 4,\n        this._levelBounds[level]\n      );\n\n      // search through child nodes\n      for (let pos = nodeIndex; pos < end; pos += 4) {\n        const index = this._indices[pos >> 2];\n\n        // check if node bbox intersects with query bbox\n        if (maxX < this._boxes[pos]) continue; // maxX < nodeMinX\n        if (maxY < this._boxes[pos + 1]) continue; // maxY < nodeMinY\n        if (minX > this._boxes[pos + 2]) continue; // minX > nodeMaxX\n        if (minY > this._boxes[pos + 3]) continue; // minY > nodeMaxY\n\n        if (nodeIndex < this.numItems * 4) {\n          if (filterFn === undefined || filterFn(index)) {\n            results.push(index); // leaf item\n          }\n        } else {\n          queue.push(index); // node; add it to the search queue\n          queue.push(level - 1);\n        }\n      }\n\n      level = queue.pop();\n      nodeIndex = queue.pop();\n    }\n\n    return results;\n  }\n\n  neighbors(x, y, maxResults = Infinity, maxDistance = Infinity, filterFn) {\n    if (this._pos !== this._boxes.length) {\n      throw new Error('Data not yet indexed - call index.finish().');\n    }\n\n    let nodeIndex = this._boxes.length - 4;\n    const q = this._queue;\n    const results = [];\n    const maxDistSquared = maxDistance * maxDistance;\n\n    while (nodeIndex !== undefined) {\n      // find the end index of the node\n      const end = Math.min(\n        nodeIndex + this.nodeSize * 4,\n        upperBound(nodeIndex, this._levelBounds)\n      );\n\n      // add child nodes to the queue\n      for (let pos = nodeIndex; pos < end; pos += 4) {\n        const index = this._indices[pos >> 2];\n\n        const dx = axisDist(x, this._boxes[pos], this._boxes[pos + 2]);\n        const dy = axisDist(y, this._boxes[pos + 1], this._boxes[pos + 3]);\n        const dist = dx * dx + dy * dy;\n\n        if (nodeIndex < this.numItems * 4) {\n          // leaf node\n          if (filterFn === undefined || filterFn(index)) {\n            // put a negative index if it's an item rather than a node, to recognize later\n            q.push(-index - 1, dist);\n          }\n        } else {\n          q.push(index, dist);\n        }\n      }\n\n      // pop items from the queue\n      while (q.length && q.peek() < 0) {\n        const dist = q.peekValue();\n        if (dist > maxDistSquared) {\n          q.clear();\n          return results;\n        }\n        results.push(-q.pop() - 1);\n\n        if (results.length === maxResults) {\n          q.clear();\n          return results;\n        }\n      }\n\n      nodeIndex = q.pop();\n    }\n\n    q.clear();\n    return results;\n  }\n}\n\nfunction axisDist(k, min, max) {\n  return k < min ? min - k : k <= max ? 0 : k - max;\n}\n\n// binary search for the first value in the array bigger than the given\nfunction upperBound(value, arr) {\n  let i = 0;\n  let j = arr.length - 1;\n  while (i < j) {\n    const m = (i + j) >> 1;\n    if (arr[m] > value) {\n      j = m;\n    } else {\n      i = m + 1;\n    }\n  }\n  return arr[i];\n}\n\n// custom quicksort that sorts bbox data alongside the hilbert values\nfunction sort(values, boxes, indices, left, right) {\n  if (left >= right) return;\n\n  const pivot = values[(left + right) >> 1];\n  let i = left - 1;\n  let j = right + 1;\n\n  while (true) {\n    do i++;\n    while (values[i] < pivot);\n    do j--;\n    while (values[j] > pivot);\n    if (i >= j) break;\n    swap(values, boxes, indices, i, j);\n  }\n\n  sort(values, boxes, indices, left, j);\n  sort(values, boxes, indices, j + 1, right);\n}\n\n// swap two values and two corresponding boxes\nfunction swap(values, boxes, indices, i, j) {\n  const temp = values[i];\n  values[i] = values[j];\n  values[j] = temp;\n\n  const k = 4 * i;\n  const m = 4 * j;\n\n  const a = boxes[k];\n  const b = boxes[k + 1];\n  const c = boxes[k + 2];\n  const d = boxes[k + 3];\n  boxes[k] = boxes[m];\n  boxes[k + 1] = boxes[m + 1];\n  boxes[k + 2] = boxes[m + 2];\n  boxes[k + 3] = boxes[m + 3];\n  boxes[m] = a;\n  boxes[m + 1] = b;\n  boxes[m + 2] = c;\n  boxes[m + 3] = d;\n\n  const e = indices[i];\n  indices[i] = indices[j];\n  indices[j] = e;\n}\n\n// Fast Hilbert curve algorithm by http://threadlocalmutex.com/\n// Ported from C++ https://github.com/rawrunprotected/hilbert_curves (public domain)\nfunction hilbert(x, y) {\n  let a = x ^ y;\n  let b = 0xffff ^ a;\n  let c = 0xffff ^ (x | y);\n  let d = x & (y ^ 0xffff);\n\n  let A = a | (b >> 1);\n  let B = (a >> 1) ^ a;\n  let C = (c >> 1) ^ (b & (d >> 1)) ^ c;\n  let D = (a & (c >> 1)) ^ (d >> 1) ^ d;\n\n  a = A;\n  b = B;\n  c = C;\n  d = D;\n  A = (a & (a >> 2)) ^ (b & (b >> 2));\n  B = (a & (b >> 2)) ^ (b & ((a ^ b) >> 2));\n  C ^= (a & (c >> 2)) ^ (b & (d >> 2));\n  D ^= (b & (c >> 2)) ^ ((a ^ b) & (d >> 2));\n\n  a = A;\n  b = B;\n  c = C;\n  d = D;\n  A = (a & (a >> 4)) ^ (b & (b >> 4));\n  B = (a & (b >> 4)) ^ (b & ((a ^ b) >> 4));\n  C ^= (a & (c >> 4)) ^ (b & (d >> 4));\n  D ^= (b & (c >> 4)) ^ ((a ^ b) & (d >> 4));\n\n  a = A;\n  b = B;\n  c = C;\n  d = D;\n  C ^= (a & (c >> 8)) ^ (b & (d >> 8));\n  D ^= (b & (c >> 8)) ^ ((a ^ b) & (d >> 8));\n\n  a = C ^ (C >> 1);\n  b = D ^ (D >> 1);\n\n  let i0 = x ^ y;\n  let i1 = b | (0xffff ^ (i0 | a));\n\n  i0 = (i0 | (i0 << 8)) & 0x00ff00ff;\n  i0 = (i0 | (i0 << 4)) & 0x0f0f0f0f;\n  i0 = (i0 | (i0 << 2)) & 0x33333333;\n  i0 = (i0 | (i0 << 1)) & 0x55555555;\n\n  i1 = (i1 | (i1 << 8)) & 0x00ff00ff;\n  i1 = (i1 | (i1 << 4)) & 0x0f0f0f0f;\n  i1 = (i1 | (i1 << 2)) & 0x33333333;\n  i1 = (i1 | (i1 << 1)) & 0x55555555;\n\n  return ((i1 << 1) | i0) >>> 0;\n}\n","import { feature, mesh } from 'topojson-client';\nimport getBBox from '@turf/bbox';\n\nimport Flatbush from '../vendor/flatbush';\n\nconst innerCompare = (a: TopoJSON.GeometryObject, b: TopoJSON.GeometryObject) =>\n  a !== b;\nconst outerCompare = (a: TopoJSON.GeometryObject, b: TopoJSON.GeometryObject) =>\n  a === b;\n\nfunction prepareTopoJSON(topology: TopoJSON.Topology, key?: string) {\n  const object = topology.objects[\n    key || Object.keys(topology.objects)[0]\n  ] as TopoJSON.GeometryCollection;\n  const roadsObject = topology.objects['roads'] as TopoJSON.GeometryCollection;\n  const placesObject = topology.objects[\n    'places'\n  ] as TopoJSON.GeometryCollection;\n  const urbanAreasObject = topology.objects[\n    'urban_areas'\n  ] as TopoJSON.GeometryCollection;\n\n  const collection = feature(topology, object);\n  const roads = feature(topology, roadsObject);\n  const places = feature(topology, placesObject);\n  const urban_areas = feature(topology, urbanAreasObject);\n  // const innerlines = mesh(topology, object, innerCompare);\n  // const outerlines = mesh(topology, object, outerCompare);\n  const bbox = topology.bbox || getBBox(collection);\n\n  const index = new Flatbush(collection.features.length);\n  collection.features.forEach(feature => {\n    const bounds = getBBox(feature);\n    index.add(...bounds);\n  });\n  index.finish();\n\n  const heightRatio = (bbox[3] - bbox[1]) / (bbox[2] - bbox[0]);\n\n  return {\n    collection,\n    // features,\n    // innerlines,\n    // outerlines,\n    bbox,\n    heightRatio,\n    index,\n    roads,\n    places,\n    urban_areas,\n  };\n}\n\nexport default prepareTopoJSON;\n","// packages\nimport cx from 'classnames';\nimport { entries, map, Map, set, Set } from 'd3-collection';\nimport { GeoPath, GeoIdentityTransform, GeoProjection } from 'd3-geo';\nimport { scaleLinear, ScaleLinear } from 'd3-scale';\nimport { Feature, Point } from 'geojson';\nimport { Component, h } from 'preact';\nimport bboxPolygon from '@turf/bbox-polygon';\nimport booleanPointInPolygon from '@turf/boolean-point-in-polygon';\n\n// components\nimport CanvasLayer from './CanvasLayer';\nimport Places from './Places';\nimport Portal from './Portal';\nimport SvgLayer from './SvgLayer';\nimport MapLegend from './MapLegend';\nimport Tooltip from './Tooltip';\nimport TooltipTable from './TooltipTable';\n\n// internal\nimport clamp from '../utils/clamp';\nimport * as colors from '../colors';\nimport find from '../utils/find';\nimport getPoint from '../utils/get-point';\nimport prepareTopoJSON from '../utils/prepare-topojson';\nimport { Topology } from 'topojson-specification';\n\ninterface LayeredMapProps {\n  projection: GeoProjection | GeoIdentityTransform;\n  topology: Topology;\n  precinctsReporting: number;\n  totalVotes: number;\n  source: string;\n  candidatesRender: { [key: string]: any };\n}\n\ninterface LayeredMapState {\n  activeGeometry: Feature | null;\n  candidatesOnMap: Set;\n  geos: any;\n  width: number;\n  height: number;\n  x: number;\n  y: number;\n  activeBtn: boolean;\n  includesTie: boolean;\n  typeMap: string;\n}\n\nconst tooltipPush = 20;\n\nconst relocateTooltip = (tooltip, x, y) => {\n  const { height, width } = tooltip.getBoundingClientRect();\n\n  const innerWidth = window.innerWidth;\n  const innerHeight = window.innerHeight;\n\n  const left = clamp(\n    x - width / 2,\n    tooltipPush,\n    innerWidth - width - tooltipPush\n  );\n  const top =\n    innerHeight > y + tooltipPush + height\n      ? y + tooltipPush\n      : y - height - tooltipPush;\n\n  tooltip.style.left = `${left}px`;\n  tooltip.style.top = `${top}px`;\n};\n\nclass LayeredMap extends Component<LayeredMapProps, LayeredMapState> {\n  xScale: ScaleLinear<number, number>;\n  yScale: ScaleLinear<number, number>;\n  tooltip!: HTMLElement;\n  candidateMap!: Map<any>;\n  countyMap!: Map<any>;\n  embedType: string;\n  candidatesRender: { [key: string]: any };\n\n  constructor() {\n    super();\n\n    this.state = {\n      activeGeometry: null,\n      candidatesOnMap: set(),\n      geos: {},\n      width: 0,\n      height: 0,\n      includesNoResult: false,\n      includesTie: false,\n      typeMap: 'categorical',\n      activeBtn: 'categorical',\n      x: 0,\n      y: 0,\n    };\n\n    this.onMouseMove = this.onMouseMove.bind(this);\n    this.onMouseLeave = this.onMouseLeave.bind(this);\n    this.onDocumentTouch = this.onDocumentTouch.bind(this);\n    this.getTooltipRef = this.getTooltipRef.bind(this);\n    this.canvasRenderer = this.canvasRenderer.bind(this);\n\n    this.xScale = scaleLinear();\n    this.yScale = scaleLinear();\n  }\n\n  getTooltipRef(el: HTMLElement) {\n    this.tooltip = el;\n  }\n\n  setUpCountyMap(counties: any) {\n    this.countyMap = map(counties, d => d.fips);\n  }\n\n  setUpCandidateMap(candidates: any) {\n    this.candidateMap = map(candidates, d => d.id);\n  }\n\n  handleClick = param => event => {\n    this.setState({\n      typeMap: param,\n      activeBtn: param,\n    });\n  };\n\n  onMouseMove(event: MouseEvent) {\n    const { clientX: x, clientY: y, target } = event;\n    const point = getPoint(target as HTMLElement, x, y);\n\n    const coords = [this.xScale.invert(point[0]), this.yScale.invert(point[1])];\n\n    const { collection, index } = this.state.geos;\n\n    const found = index\n      .search(...coords, ...coords)\n      .map((i: number) => collection.features[i]);\n\n    const activeGeometry = find(\n      found,\n      (feature: Feature<GeoJSON.Polygon | GeoJSON.MultiPolygon>) =>\n        booleanPointInPolygon(coords, feature)\n    );\n\n    let activeCounty = null;\n\n    if (activeGeometry) {\n      const { fips } = activeGeometry.properties;\n      activeCounty = this.countyMap.get(fips);\n    }\n\n    this.setState({ activeCounty, activeGeometry }, () =>\n      relocateTooltip(this.tooltip, x, y)\n    );\n  }\n\n  onMouseLeave() {\n    this.setState({ activeCounty: null, activeGeometry: null });\n  }\n\n  onDocumentTouch(e) {\n    if (!this.base.contains(e.target)) this.onMouseLeave();\n  }\n\n  canvasRenderer(ctx: CanvasRenderingContext2D, geoPath: GeoPath) {\n    const { geos, width, height, typeMap } = this.state;\n\n    const { candidatesRender, embedType } = this.props;\n\n    ctx.clearRect(0, 0, width, height);\n\n    if (!geos.collection) return;\n\n    const candidatesOnMap = set();\n    let includesNoResult = false;\n    let includesTie = false;\n\n    geos.collection.features.forEach((feature: Feature) => {\n      const { fips } = feature.properties;\n      const county = this.countyMap.get(fips);\n\n      let fillStyle;\n\n      if (county.total_votes <= 0) {\n        includesNoResult = true;\n        fillStyle = colors.NEUTRAL;\n      } else {\n        const sortedResults = entries(county.results).sort(\n          (a, b) => b.value - a.value\n        );\n\n        const leader = sortedResults[0];\n        const second = sortedResults[1];\n\n        if (leader.value === second.value) {\n          includesTie = true;\n          fillStyle = colors.TIE;\n        } else {\n          const leadingId = leader.key;\n          candidatesOnMap.add(leadingId);\n\n          const { id, name } = this.candidateMap.get(leadingId);\n          const result = candidatesRender.filter(cand => cand.name == name);\n          fillStyle = result[0]['color'];\n        }\n      }\n\n      ctx.beginPath();\n      geoPath(feature);\n\n      ctx.fillStyle = fillStyle;\n      ctx.fill();\n      ctx.closePath();\n    });\n\n    ctx.beginPath();\n    geoPath(geos.collection);\n\n    ctx.lineCap = 'round';\n    ctx.lineJoin = 'round';\n    ctx.strokeStyle = 'rgba(255, 255, 255, .6)'; //255, 255, 255\n    ctx.lineWidth = 0.8;\n\n    ctx.stroke();\n    ctx.closePath();\n\n    geos.roads.features.forEach((feature: Feature) => {\n      if (feature.properties.level !== 'Interstate') return;\n      ctx.beginPath();\n      geoPath(feature);\n\n      ctx.lineCap = 'round';\n      ctx.lineJoin = 'round';\n\n      if (feature.properties.level === 'Interstate') {\n        ctx.strokeStyle = 'rgba(0, 0, 0, .12)';\n        ctx.lineWidth = 1;\n      } else {\n        ctx.strokeStyle = 'rgba(0, 0, 0, .08)';\n        ctx.lineWidth = 0.8;\n      }\n\n      ctx.stroke();\n      ctx.closePath();\n    });\n\n    let places_mappable = geos.places;\n\n    geos.places = places_mappable;\n\n    geos.places.features.forEach((feature: Feature<Point>) => {\n      const [x, y] = geoPath.centroid(feature);\n\n      ctx.beginPath();\n      ctx.arc(x, y, 3, 0, Math.PI * 2, true);\n      ctx.strokeStyle = 'rgba(33, 33, 33, .75)';\n      ctx.lineWidth = 1.25;\n      ctx.stroke();\n      ctx.closePath();\n    });\n\n    geos.urban_areas.features.forEach((feature: Feature) => {\n      ctx.beginPath();\n      geoPath(feature);\n\n      ctx.fillStyle = 'rgba(153, 160, 175, 0.2)';\n      ctx.fill();\n      ctx.closePath();\n    });\n\n    this.setState({ candidatesOnMap, includesNoResult, includesTie });\n  }\n\n  componentWillReceiveProps(nextProps) {\n    const { candidates, counties } = nextProps;\n\n    this.setUpCandidateMap(candidates);\n    this.setUpCountyMap(counties);\n  }\n\n  getContainerDimensions() {\n    const base = this.base!;\n    const rawWidth = base.offsetWidth;\n\n    this.setState({ width });\n  }\n\n  componentDidMount() {\n    const { candidates, counties, candidatesRender } = this.props;\n\n    this.setUpCandidateMap(candidates);\n    this.setUpCountyMap(counties);\n\n    const base = this.base!;\n    const rawWidth = Math.floor(base.clientWidth);\n\n    const { topology } = this.props;\n    const geos = prepareTopoJSON(topology);\n\n    const { bbox, heightRatio } = geos;\n    const rawHeight = Math.floor(rawWidth * heightRatio);\n\n    const width = rawWidth;\n    const height = rawHeight;\n\n    this.xScale.domain([bbox[0], bbox[2]]).range([0, width]);\n    this.yScale.domain([bbox[1], bbox[3]]).range([height, 0]);\n\n    // Took away a few pixels from the fitSize because of the bubbles. There has to be a better way to do this.\n\n    this.props.projection.fitSize([width - 6, height - 20], bboxPolygon(bbox));\n\n    document.addEventListener('touchstart', this.onDocumentTouch, false);\n\n    this.setState({ geos, width, height });\n  }\n\n  render() {\n    const {\n      candidates,\n      projection,\n      precinctsReporting,\n      totalVotes,\n      candidatesRender,\n      embedType,\n      source,\n    } = this.props;\n    const {\n      activeCounty,\n      activeBtn,\n      activeGeometry,\n      candidatesOnMap,\n      geos,\n      includesNoResult,\n      includesTie,\n      width,\n      height,\n      x,\n      y,\n      typeMap,\n    } = this.state;\n\n    return (\n      <div class=\"all-map-stuff\">\n        <div\n          class=\"layers-map\"\n          style={{\n            boxSizing: 'border-box',\n            width: '100%',\n            height: '100%',\n            position: 'relative',\n          }}\n          onMouseMove={this.onMouseMove}\n          onMouseLeave={this.onMouseLeave}\n        >\n          <SvgLayer\n            width={width}\n            height={height}\n            projection={projection}\n            render={({ geoPath }) => (\n              <g>\n                {geos.places && (\n                  <Places geoPath={geoPath} places={geos.places.features} />\n                )}\n                {activeGeometry && (\n                  <path\n                    fill=\"none\"\n                    stroke=\"black\"\n                    stroke-width=\"2\"\n                    d={geoPath(activeGeometry) || undefined}\n                  />\n                )}\n              </g>\n            )}\n          />\n          <CanvasLayer\n            totalPrecincts={precinctsReporting}\n            totalVotes={totalVotes}\n            projection={projection}\n            width={width}\n            height={height}\n            render={this.canvasRenderer}\n            mapType={typeMap}\n          />\n          <Tooltip\n            class={cx('tooltip map__tooltip', {\n              invisible: !Boolean(activeCounty),\n            })}\n            tooltipRef={this.getTooltipRef}\n          >\n            {activeCounty && (\n              <TooltipTable\n                candidatesRender={candidatesRender}\n                candidatesMap={this.candidateMap}\n                county={activeCounty}\n                source={source}\n              />\n            )}\n          </Tooltip>\n        </div>\n        {/* <MapText\n          typeMap={typeMap}\n        /> */}\n        <MapLegend\n          candidates={candidates.filter(({ id }: { id: string }) =>\n            candidatesOnMap.has(id)\n          )}\n          includesNoResult={includesNoResult}\n          includesTie={includesTie}\n        />\n      </div>\n    );\n  }\n}\n\nexport default LayeredMap;\n","/**\n * Returns the minimum if n is less than the minimum.\n * Returns the maximum if n is more than the maximum.\n * Returns n if n is between the minimum and maximum.\n *\n * @param {Number} n\n * @param {Number} min\n * @param {Number} max\n * @return {Number}\n */\nexport default function clamp(n, min, max) {\n  return Math.min(Math.max(n, min), max);\n}\n","const userAgent = navigator.userAgent;\n\nexport function isThisIE(): boolean {\n  return /Trident|MSIE|IEMobile/i.test(userAgent);\n}\n","const colors = {\n  \"red\": \"#EF564A\",\n  \"pink\": \"#fcbec3\",\n  \"orange\": '#f5af76',\n  \"green\": \"#5acc7d\",\n  \"gray\": '#bababa',\n  \"blue\": '#1755c5'\n}\n\nconst raceCandidateColors = {\n  'us-senate-class-2-Republican': [\n    {\n      name: 'Ken Paxton',\n      color: colors.pink\n    },\n    {\n      name: 'Wesley Hunt',\n      color: colors.orange\n    },\n    {\n      name: 'John Cornyn',\n      color: colors.red\n    },\n    {\n      name: 'Virgil Bierschwale',\n      color: colors.gray\n    },\n    {\n      name: 'Anna Bender',\n      color: colors.gray\n    },\n    {\n      name: 'Gulrez \"Gus\" Khan',\n      color: colors.gray\n    },\n    {\n      name: 'Sara Canady',\n      color: colors.gray\n    },\n    {\n      name: 'John O. Adefope',\n      color: colors.gray\n    },\n    {\n      name: 'Uncommitted',\n      color: colors.gray\n    },\n  ],\n  'us-senate-class-2-Democrat': [\n    {\n      name: 'Jasmine Crockett',\n      color: colors.blue\n    },\n    {\n      name: 'James Talarico',\n      color: colors.green\n    },\n    {\n      name: 'Ahmad R. Hassan',\n      color: colors.pink\n    },\n  ],\n  'attorney-general-Republican': [\n    {\n      name: 'Aaron Reitz',\n      color: colors.orange\n    },\n    {\n      name: 'Chip Roy',\n      color: colors.red\n    },\n    {\n      name: 'Mayes Middleton',\n      color: colors.pink\n    },\n    {\n      name: 'Joan Huffman',\n      color: colors.green\n    },\n  ],\n  'comptroller-Republican': [\n    {\n      name: 'Kelly Hancock',\n      color: colors.red\n    },\n    {\n      name: 'Michael Berlanga',\n      color: colors.gray\n    },\n    {\n      name: 'Christi Craddick',\n      color: colors.orange\n    },\n    {\n      name: 'Don Huffines',\n      color: colors.pink\n    },\n  ],\n};\n\nexport default raceCandidateColors;\n","// packages\nimport { geoIdentity, GeoIdentityTransform } from 'd3-geo';\nimport { Component, h } from 'preact';\n\n// components\nimport Contest from './Contest';\nimport HeadshotCandidateRow from './HeadshotCandidateRow';\nimport SeatPartyDivider from './SeatPartyDivider';\nimport LayeredMap from './LayeredMap';\nimport Portal from './Portal';\n\n// utils\nimport { isThisIE } from '../utils/platform';\nimport {\n  determineContestTitle\n} from '../election-utils';\n\nimport raceCandidateColors from '../election-candidate-colors';\n\nimport { visibleCandidatesCount } from '../endpoints';\n\nimport find from '../utils/find';\n\nimport topology from 'Assets/geography/texas_urban.json';\n\nimport delegates from 'Data/delegates.json';\n\nconst isIE = isThisIE();\n\ninterface ContestShowcaseProps {\n  container: Element;\n  contest: any | null;\n  showDelegates: boolean;\n  showContestTitleInShowcase: boolean;\n  notes: { [key: string]: any };\n  asOf: string;\n  annotations: { [key: string]: any };\n}\n\ninterface ContestShowcaseState {\n  contestContainer: Element;\n  mapContainer: Element;\n  countiesContainer: Element;\n}\n\nclass ContestShowcase extends Component<\n  ContestShowcaseProps,\n  ContestShowcaseState\n> {\n  projection: GeoIdentityTransform;\n\n  constructor() {\n    super();\n\n    this.projection = geoIdentity().reflectY(true);\n  }\n\n  componentDidMount() {\n    const { container } = this.props;\n\n    const contestContainer = container.querySelector('.contest-container');\n    const mapContainer = container.querySelector('.contest-map-container');\n    const countiesContainer = container.querySelector(\n      '.contest-counties-container'\n    );\n\n    this.setState({ contestContainer, mapContainer, countiesContainer });\n  }\n\n  render() {\n    const {\n      contest,\n      asOf,\n      notes,\n      annotations,\n      showDelegates,\n      showContestTitleInShowcase,\n    } = this.props;\n    const { contestContainer, mapContainer, countiesContainer } = this.state;\n\n    // const firstShowcaseRace =\n    // const numDelegates = false;\n    //   contest && contest.office == 'President'\n    //     ? delegates[\n    //         `${contest.office.toLowerCase()}-${contest.party.toLowerCase()}`\n    //       ]\n    //     : false;\n\n\n    // const headerUsed =\n    //   showDelegates == true\n    //     ? HeadshotCandidateRow.Header_Prez\n    //     : HeadshotCandidateRow.Header;\n\n    const numDelegates = false;\n    const headerUsed = HeadshotCandidateRow.Header;\n\n    let candidateColors, sourceMap, ShowcaseRaceWinner;\n\n    if (!contest) return null;\n\n    if (contest) {\n      let candidates = contest.candidacies;\n\n      const colorLookup = [contest.office_slug, '-', contest.party].join('')\n\n      candidateColors = raceCandidateColors[colorLookup] || [];\n\n      sourceMap = contest.source;\n\n      ShowcaseRaceWinner = find(\n        candidates,\n        candidate => candidate.is_winner === true\n      );\n    }\n\n    return (\n      <span>\n        {contestContainer && (\n          <Portal\n            node={contestContainer}\n            ref={ref => (this._contestPortal = ref)}\n          >\n            <Contest\n              contest={contest}\n              contestTitle={determineContestTitle(contest)}\n              showContestTitleInShowcase={showContestTitleInShowcase}\n              isShowcaseRace\n              renderParty={party => (\n                <SeatPartyDivider\n                  partyName={party.party}\n                  partyBallot={party}\n                  isShowcaseRace\n                  annotations={annotations}\n                  notes={notes}\n                  asOf={asOf}\n                  showDelegates={showDelegates == true ? true : false}\n                  ShowcaseRaceWinner={ShowcaseRaceWinner}\n                  source={party.source}\n                  tableHeader={headerUsed}\n                  columnCount={HeadshotCandidateRow.columnCount}\n                  renderCandidate={(\n                    candidate: any,\n                    idx: number,\n                    candidatesRender: any,\n                    viewAllCandidates: any,\n                    { totalVotes }: { totalVotes: number }\n                  ) => (\n                    <HeadshotCandidateRow\n                      key={candidate.id}\n                      ballotName={candidate.name}\n                      candidateId={candidate.id}\n                      office={party['office']}\n                      contestIsCalled={contest.is_called}\n                      contestResult={contest.contest_result}\n                      isIncumbent={candidate.is_incumbent}\n                      isWinner={candidate.is_winner}\n                      numDelegates={numDelegates}\n                      isViewable={\n                        viewAllCandidates || idx < visibleCandidatesCount\n                      }\n                      party={candidate.party}\n                      candidateColors={candidateColors}\n                      totalVotesInContest={totalVotes}\n                      votes={candidate.votes}\n                    />\n                  )}\n                />\n              )}\n            />\n          </Portal>\n        )}\n        {!isIE && mapContainer && (\n          <Portal node={mapContainer} ref={ref => (this._mapPortal = ref)}>\n            <LayeredMap\n              topology={topology}\n              projection={this.projection}\n              candidates={contest.candidacies}\n              candidatesRender={candidateColors}\n              source={sourceMap}\n              counties={contest.counties}\n              precinctsReporting={contest.precincts_reporting}\n              totalVotes={contest.total_votes}\n            />\n          </Portal>\n        )}\n      </span>\n    );\n  }\n}\n\nexport default ContestShowcase;\n","'use strict';\n\n// We depend on intersection-observer enough that it should just be assumed as necessary\nrequire('intersection-observer');\n","import { Component, h, render } from 'preact';\n\nclass Portal extends Component {\n  componentDidMount() {\n    this.renderPortal();\n  }\n\n  componentWillUnmount() {\n    if (this.defaultNode) {\n      document.body.removeChild(this.defaultNode);\n    } else {\n      // Unmount the children rendered in custom node\n      render(null, this.props.node, this.portal);\n    }\n\n    this.defaultNode = null;\n    this.portal = null;\n  }\n\n  componentDidUpdate() {\n    this.renderPortal();\n  }\n\n  renderPortal() {\n    if (!this.props.node && !this.defaultNode) {\n      this.defaultNode = document.createElement('div');\n      document.body.appendChild(this.defaultNode);\n    }\n\n    const children = this.props.children;\n\n    this.portal = render(\n      (children && children[0]) || null,\n      this.props.node || this.defaultNode,\n      this.portal\n    );\n  }\n\n  render() {\n    return null;\n  }\n}\n\nexport default Portal;\n","import { h, render } from 'preact';\n\n// just in case this gets removed\nwindow.ttData = window.ttData || {};\n\n// related content\nconst relatedContentContainer = document.getElementById(\n  'related-content-container'\n);\n\nif (relatedContentContainer && window.ttData.related_category) {\n  import(\n    /* webpackChunkName: \"RelatedContent\" */ './components/RelatedContent'\n  ).then(({ default: RelatedContent }) =>\n    render(\n      <RelatedContent\n        title={'Read more'}\n        related_category={window.ttData.related_category}\n      />,\n      relatedContentContainer\n    )\n  );\n}\n\n// trending ribbon\n// const ribbonContainer = document.getElementById('ribbon-container');\n\n// if (ribbonContainer) {\n//   import(/* webpackChunkName: \"Ribbon\" */ './components/Ribbon').then(\n//     ({ default: Ribbon }) => render(<Ribbon />, ribbonContainer)\n//   );\n// }\n\n// ads\nimport(/* webpackChunkName: \"ads\" */ './utils/ad-loader').then(\n  ({ default: AdLoader }) => {\n    const ads = new AdLoader({\n      targetingKey: 'tribpedia',\n      targetingValue: window.ttData.targetingValue,\n    });\n    ads.init();\n  }\n);\n","const RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n  let box;\n  let x;\n  let y;\n  const doc = elem.ownerDocument;\n  const body = doc.body;\n  const docElem = doc && doc.documentElement;\n  // 根据 GBS 最新数据，A-Grade Browsers 都已支持 getBoundingClientRect 方法，不用再考虑传统的实现方式\n  box = elem.getBoundingClientRect();\n\n  // 注：jQuery 还考虑减去 docElem.clientLeft/clientTop\n  // 但测试发现，这样反而会导致当 html 和 body 有边距/边框样式时，获取的值不正确\n  // 此外，ie6 会忽略 html 的 margin 值，幸运地是没有谁会去设置 html 的 margin\n\n  x = box.left;\n  y = box.top;\n\n  // In IE, most of the time, 2 extra pixels are added to the top and left\n  // due to the implicit 2-pixel inset border.  In IE6/7 quirks mode and\n  // IE6 standards mode, this border can be overridden by setting the\n  // document element's border to zero -- thus, we cannot rely on the\n  // offset always being 2 pixels.\n\n  // In quirks mode, the offset can be determined by querying the body's\n  // clientLeft/clientTop, but in standards mode, it is found by querying\n  // the document element's clientLeft/clientTop.  Since we already called\n  // getClientBoundingRect we have already forced a reflow, so it is not\n  // too expensive just to query them all.\n\n  // ie 下应该减去窗口的边框吧，毕竟默认 absolute 都是相对窗口定位的\n  // 窗口边框标准是设 documentElement ,quirks 时设置 body\n  // 最好禁止在 body 和 html 上边框 ，但 ie < 9 html 默认有 2px ，减去\n  // 但是非 ie 不可能设置窗口边框，body html 也不是窗口 ,ie 可以通过 html,body 设置\n  // 标准 ie 下 docElem.clientTop 就是 border-top\n  // ie7 html 即窗口边框改变不了。永远为 2\n  // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框，即使设了 border-top 也为 0\n\n  x -= docElem.clientLeft || body.clientLeft || 0;\n  y -= docElem.clientTop || body.clientTop || 0;\n\n  return {\n    left: x,\n    top: y,\n  };\n}\n\nfunction getScroll(w, top) {\n  let ret = w[`page${top ? 'Y' : 'X'}Offset`];\n  const method = `scroll${top ? 'Top' : 'Left'}`;\n  if (typeof ret !== 'number') {\n    const d = w.document;\n    // ie6,7,8 standard mode\n    ret = d.documentElement[method];\n    if (typeof ret !== 'number') {\n      // quirks mode\n      ret = d.body[method];\n    }\n  }\n  return ret;\n}\n\nfunction getScrollLeft(w) {\n  return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n  return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n  const pos = getClientPosition(el);\n  const doc = el.ownerDocument;\n  const w = doc.defaultView || doc.parentWindow;\n  pos.left += getScrollLeft(w);\n  pos.top += getScrollTop(w);\n  return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n  let val = '';\n  const d = elem.ownerDocument;\n  const computedStyle =\n    computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n  // https://github.com/kissyteam/kissy/issues/61\n  if (computedStyle) {\n    val = computedStyle.getPropertyValue(name) || computedStyle[name];\n  }\n\n  return val;\n}\n\nconst _RE_NUM_NO_PX = new RegExp(`^(${RE_NUM})(?!px)[a-z%]+$`, 'i');\nconst RE_POS = /^(top|right|bottom|left)$/;\nconst CURRENT_STYLE = 'currentStyle';\nconst RUNTIME_STYLE = 'runtimeStyle';\nconst LEFT = 'left';\nconst PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n  // currentStyle maybe null\n  // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n  let ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n  // 当 width/height 设置为百分比时，通过 pixelLeft 方式转换的 width/height 值\n  // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n  // 在 ie 下不对，需要直接用 offset 方式\n  // borderWidth 等值也有问题，但考虑到 borderWidth 设为百分比的概率很小，这里就不考虑了\n\n  // From the awesome hack by Dean Edwards\n  // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n  // If we're not dealing with a regular pixel number\n  // but a number that has a weird ending, we need to convert it to pixels\n  // exclude left right for relativity\n  if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n    // Remember the original values\n    const style = elem.style;\n    const left = style[LEFT];\n    const rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n    // prevent flashing of content\n    elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n    // Put in the new values to get a computed value out\n    style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n    ret = style.pixelLeft + PX;\n\n    // Revert the changed values\n    style[LEFT] = left;\n\n    elem[RUNTIME_STYLE][LEFT] = rsLeft;\n  }\n  return ret === '' ? 'auto' : ret;\n}\n\nlet getComputedStyleX;\nif (typeof window !== 'undefined') {\n  getComputedStyleX = window.getComputedStyle\n    ? _getComputedStyle\n    : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n  for (let i = 0; i < arr.length; i++) {\n    fn(arr[i]);\n  }\n}\n\nfunction isBorderBoxFn(elem) {\n  return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nconst BOX_MODELS = ['margin', 'border', 'padding'];\nconst CONTENT_INDEX = -1;\nconst PADDING_INDEX = 2;\nconst BORDER_INDEX = 1;\nconst MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n  const old = {};\n  const style = elem.style;\n  let name;\n\n  // Remember the old values, and insert the new ones\n  for (name in options) {\n    if (options.hasOwnProperty(name)) {\n      old[name] = style[name];\n      style[name] = options[name];\n    }\n  }\n\n  callback.call(elem);\n\n  // Revert the old values\n  for (name in options) {\n    if (options.hasOwnProperty(name)) {\n      style[name] = old[name];\n    }\n  }\n}\n\nfunction getPBMWidth(elem, props, which) {\n  let value = 0;\n  let prop;\n  let j;\n  let i;\n  for (j = 0; j < props.length; j++) {\n    prop = props[j];\n    if (prop) {\n      for (i = 0; i < which.length; i++) {\n        let cssProp;\n        if (prop === 'border') {\n          cssProp = `${prop + which[i]}Width`;\n        } else {\n          cssProp = prop + which[i];\n        }\n        value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n      }\n    }\n  }\n  return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n  // must use == for ie8\n  /* eslint eqeqeq:0 */\n  return obj != null && obj == obj.window;\n}\n\nconst domUtils = {};\n\neach(['Width', 'Height'], name => {\n  domUtils[`doc${name}`] = refWin => {\n    const d = refWin.document;\n    return Math.max(\n      // firefox chrome documentElement.scrollHeight< body.scrollHeight\n      // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n      d.documentElement[`scroll${name}`],\n      // quirks : documentElement.scrollHeight 最大等于可视窗口多一点？\n      d.body[`scroll${name}`],\n      domUtils[`viewport${name}`](d),\n    );\n  };\n\n  domUtils[`viewport${name}`] = win => {\n    // pc browser includes scrollbar in window.innerWidth\n    const prop = `client${name}`;\n    const doc = win.document;\n    const body = doc.body;\n    const documentElement = doc.documentElement;\n    const documentElementProp = documentElement[prop];\n    // 标准模式取 documentElement\n    // backcompat 取 body\n    return (\n      (doc.compatMode === 'CSS1Compat' && documentElementProp) ||\n      (body && body[prop]) ||\n      documentElementProp\n    );\n  };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra]  'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n  if (isWindow(elem)) {\n    return name === 'width'\n      ? domUtils.viewportWidth(elem)\n      : domUtils.viewportHeight(elem);\n  } else if (elem.nodeType === 9) {\n    return name === 'width'\n      ? domUtils.docWidth(elem)\n      : domUtils.docHeight(elem);\n  }\n  const which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n  let borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n  const computedStyle = getComputedStyleX(elem);\n  const isBorderBox = isBorderBoxFn(elem, computedStyle);\n  let cssBoxValue = 0;\n  if (borderBoxValue == null || borderBoxValue <= 0) {\n    borderBoxValue = undefined;\n    // Fall back to computed then un computed css if necessary\n    cssBoxValue = getComputedStyleX(elem, name);\n    if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n      cssBoxValue = elem.style[name] || 0;\n    }\n    // Normalize '', auto, and prepare for extra\n    cssBoxValue = parseFloat(cssBoxValue) || 0;\n  }\n  if (extra === undefined) {\n    extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n  }\n  const borderBoxValueOrIsBorderBox =\n    borderBoxValue !== undefined || isBorderBox;\n  const val = borderBoxValue || cssBoxValue;\n  if (extra === CONTENT_INDEX) {\n    if (borderBoxValueOrIsBorderBox) {\n      return (\n        val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle)\n      );\n    }\n    return cssBoxValue;\n  }\n  if (borderBoxValueOrIsBorderBox) {\n    const padding =\n      extra === PADDING_INDEX\n        ? -getPBMWidth(elem, ['border'], which, computedStyle)\n        : getPBMWidth(elem, ['margin'], which, computedStyle);\n    return val + (extra === BORDER_INDEX ? 0 : padding);\n  }\n  return (\n    cssBoxValue +\n    getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle)\n  );\n}\n\nconst cssShow = {\n  position: 'absolute',\n  visibility: 'hidden',\n  display: 'block',\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n  let val;\n  const args = arguments;\n  // in case elem is window\n  // elem.offsetWidth === undefined\n  if (elem.offsetWidth !== 0) {\n    val = getWH.apply(undefined, args);\n  } else {\n    swap(elem, cssShow, () => {\n      val = getWH.apply(undefined, args);\n    });\n  }\n  return val;\n}\n\nfunction css(el, name, v) {\n  let value = v;\n  if (typeof name === 'object') {\n    for (const i in name) {\n      if (name.hasOwnProperty(i)) {\n        css(el, i, name[i]);\n      }\n    }\n    return undefined;\n  }\n  if (typeof value !== 'undefined') {\n    if (typeof value === 'number') {\n      value += 'px';\n    }\n    el.style[name] = value;\n    return undefined;\n  }\n  return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], name => {\n  const first = name.charAt(0).toUpperCase() + name.slice(1);\n  domUtils[`outer${first}`] = (el, includeMargin) => {\n    return (\n      el &&\n      getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX)\n    );\n  };\n  const which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n  domUtils[name] = (elem, val) => {\n    if (val !== undefined) {\n      if (elem) {\n        const computedStyle = getComputedStyleX(elem);\n        const isBorderBox = isBorderBoxFn(elem);\n        if (isBorderBox) {\n          val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n        }\n        return css(elem, name, val);\n      }\n      return undefined;\n    }\n    return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n  };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n  // set position first, in-case top/left are set even on static elem\n  if (css(elem, 'position') === 'static') {\n    elem.style.position = 'relative';\n  }\n\n  const old = getOffset(elem);\n  const ret = {};\n  let current;\n  let key;\n\n  for (key in offset) {\n    if (offset.hasOwnProperty(key)) {\n      current = parseFloat(css(elem, key)) || 0;\n      ret[key] = current + offset[key] - old[key];\n    }\n  }\n  css(elem, ret);\n}\n\nexport default {\n  getWindow(node) {\n    const doc = node.ownerDocument || node;\n    return doc.defaultView || doc.parentWindow;\n  },\n  offset(el, value) {\n    if (typeof value !== 'undefined') {\n      setOffset(el, value);\n    } else {\n      return getOffset(el);\n    }\n  },\n  isWindow,\n  each,\n  css,\n  clone(obj) {\n    const ret = {};\n    for (const i in obj) {\n      if (obj.hasOwnProperty(i)) {\n        ret[i] = obj[i];\n      }\n    }\n    const overflow = obj.overflow;\n    if (overflow) {\n      for (const i in obj) {\n        if (obj.hasOwnProperty(i)) {\n          ret.overflow[i] = obj.overflow[i];\n        }\n      }\n    }\n    return ret;\n  },\n  scrollLeft(w, v) {\n    if (isWindow(w)) {\n      if (v === undefined) {\n        return getScrollLeft(w);\n      }\n      window.scrollTo(v, getScrollTop(w));\n    } else {\n      if (v === undefined) {\n        return w.scrollLeft;\n      }\n      w.scrollLeft = v;\n    }\n  },\n  scrollTop(w, v) {\n    if (isWindow(w)) {\n      if (v === undefined) {\n        return getScrollTop(w);\n      }\n      window.scrollTo(getScrollLeft(w), v);\n    } else {\n      if (v === undefined) {\n        return w.scrollTop;\n      }\n      w.scrollTop = v;\n    }\n  },\n  viewportWidth: 0,\n  viewportHeight: 0,\n  ...domUtils,\n};\n","import util from './util';\n\nfunction scrollIntoView(elem, container, config) {\n  config = config || {};\n  // document 归一化到 window\n  if (container.nodeType === 9) {\n    container = util.getWindow(container);\n  }\n\n  let allowHorizontalScroll = config.allowHorizontalScroll;\n  const onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n  let alignWithTop = config.alignWithTop;\n  let alignWithLeft = config.alignWithLeft;\n  const offsetTop = config.offsetTop || 0;\n  const offsetLeft = config.offsetLeft || 0;\n  const offsetBottom = config.offsetBottom || 0;\n  const offsetRight = config.offsetRight || 0;\n\n  allowHorizontalScroll =\n    allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n  const isWin = util.isWindow(container);\n  const elemOffset = util.offset(elem);\n  const eh = util.outerHeight(elem);\n  const ew = util.outerWidth(elem);\n  let containerOffset;\n  let ch;\n  let cw;\n  let containerScroll;\n  let diffTop;\n  let diffBottom;\n  let win;\n  let winScroll;\n  let ww;\n  let wh;\n\n  if (isWin) {\n    win = container;\n    wh = util.height(win);\n    ww = util.width(win);\n    winScroll = {\n      left: util.scrollLeft(win),\n      top: util.scrollTop(win),\n    };\n    // elem 相对 container 可视视窗的距离\n    diffTop = {\n      left: elemOffset.left - winScroll.left - offsetLeft,\n      top: elemOffset.top - winScroll.top - offsetTop,\n    };\n    diffBottom = {\n      left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n      top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom,\n    };\n    containerScroll = winScroll;\n  } else {\n    containerOffset = util.offset(container);\n    ch = container.clientHeight;\n    cw = container.clientWidth;\n    containerScroll = {\n      left: container.scrollLeft,\n      top: container.scrollTop,\n    };\n    // elem 相对 container 可视视窗的距离\n    // 注意边框, offset 是边框到根节点\n    diffTop = {\n      left:\n        elemOffset.left -\n        (containerOffset.left +\n          (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) -\n        offsetLeft,\n      top:\n        elemOffset.top -\n        (containerOffset.top +\n          (parseFloat(util.css(container, 'borderTopWidth')) || 0)) -\n        offsetTop,\n    };\n    diffBottom = {\n      left:\n        elemOffset.left +\n        ew -\n        (containerOffset.left +\n          cw +\n          (parseFloat(util.css(container, 'borderRightWidth')) || 0)) +\n        offsetRight,\n      top:\n        elemOffset.top +\n        eh -\n        (containerOffset.top +\n          ch +\n          (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) +\n        offsetBottom,\n    };\n  }\n\n  if (diffTop.top < 0 || diffBottom.top > 0) {\n    // 强制向上\n    if (alignWithTop === true) {\n      util.scrollTop(container, containerScroll.top + diffTop.top);\n    } else if (alignWithTop === false) {\n      util.scrollTop(container, containerScroll.top + diffBottom.top);\n    } else {\n      // 自动调整\n      if (diffTop.top < 0) {\n        util.scrollTop(container, containerScroll.top + diffTop.top);\n      } else {\n        util.scrollTop(container, containerScroll.top + diffBottom.top);\n      }\n    }\n  } else {\n    if (!onlyScrollIfNeeded) {\n      alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n      if (alignWithTop) {\n        util.scrollTop(container, containerScroll.top + diffTop.top);\n      } else {\n        util.scrollTop(container, containerScroll.top + diffBottom.top);\n      }\n    }\n  }\n\n  if (allowHorizontalScroll) {\n    if (diffTop.left < 0 || diffBottom.left > 0) {\n      // 强制向上\n      if (alignWithLeft === true) {\n        util.scrollLeft(container, containerScroll.left + diffTop.left);\n      } else if (alignWithLeft === false) {\n        util.scrollLeft(container, containerScroll.left + diffBottom.left);\n      } else {\n        // 自动调整\n        if (diffTop.left < 0) {\n          util.scrollLeft(container, containerScroll.left + diffTop.left);\n        } else {\n          util.scrollLeft(container, containerScroll.left + diffBottom.left);\n        }\n      }\n    } else {\n      if (!onlyScrollIfNeeded) {\n        alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n        if (alignWithLeft) {\n          util.scrollLeft(container, containerScroll.left + diffTop.left);\n        } else {\n          util.scrollLeft(container, containerScroll.left + diffBottom.left);\n        }\n      }\n    }\n  }\n}\n\nexport default scrollIntoView;\n","export default function debounce(func, wait, immediate) {\n  var timeout, args, context, timestamp, result;\n\n  var later = function() {\n    var last = Date.now() - timestamp;\n\n    if (last < wait && last >= 0) {\n      timeout = setTimeout(later, wait - last);\n    } else {\n      timeout = null;\n      if (!immediate) {\n        result = func.apply(context, args);\n        if (!timeout) context = args = null;\n      }\n    }\n  };\n\n  return function() {\n    context = this;\n    args = arguments;\n    timestamp = Date.now();\n    var callNow = immediate && !timeout;\n    if (!timeout) timeout = setTimeout(later, wait);\n    if (callNow) {\n      result = func.apply(context, args);\n      context = args = null;\n    }\n\n    return result;\n  };\n}\n","export default () => {};\n","// packages\nimport { cloneElement, Component, h } from 'preact';\nimport scrollIntoView from 'dom-scroll-into-view';\n\n// internal\nimport debounce from '../utils/debounce';\nimport noop from '../utils/noop';\n\nclass Typeahead extends Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      highlightedIndex: null,\n      isOpen: false,\n    };\n\n    this.handleOnBlur = this.handleOnBlur.bind(this);\n    this.handleOnClear = this.handleOnClear.bind(this);\n    this.handleOnFocus = this.handleOnFocus.bind(this);\n    this.handleOnInput = this.handleOnInput.bind(this);\n    this.debouncedHandleOnInput = debounce(\n      this.handleOnInput,\n      this.props.debounceDuration\n    );\n    this.handleKeyDown = this.handleKeyDown.bind(this);\n    this.setInputRef = this.setInputRef.bind(this);\n    this.setMenuRef = this.setMenuRef.bind(this);\n    this.setItemRef = this.setItemRef.bind(this);\n\n    this.listRefs = {};\n  }\n\n  static getDerivedStateFromProps(_, prevState) {\n    if (prevState.highlightedIndex == null) {\n      return { highlightedIndex: 0 };\n    }\n  }\n\n  componentDidUpdate() {\n    const { highlightedIndex } = this.state;\n    const count = this.getFilteredItems(this.props).length;\n\n    if (Boolean(highlightedIndex) && highlightedIndex >= count) {\n      this.setState({ highlightedIndex: 0 });\n    }\n\n    this.maybeScrollItemIntoView();\n  }\n\n  setInputRef(element) {\n    this.inputRef = element;\n  }\n\n  setMenuRef(element) {\n    this.menuRef = element;\n  }\n\n  setItemRef(element, idx) {\n    this.listRefs[`item-${idx}`] = element;\n  }\n\n  maybeScrollItemIntoView() {\n    const { highlightedIndex, isOpen } = this.state;\n\n    if (isOpen && highlightedIndex != null) {\n      const itemNode = this.listRefs[`item-${this.state.highlightedIndex}`];\n      const menuNode = this.menuRef;\n\n      if (itemNode && menuNode) {\n        scrollIntoView(itemNode, menuNode, {\n          onlyScrollIfNeeded: true,\n        });\n      }\n    }\n  }\n\n  getFilteredItems(props) {\n    let { items } = props;\n\n    const { shouldItemRender, sortItems } = props;\n\n    if (shouldItemRender) {\n      items = items.filter(item => shouldItemRender(item, props.value));\n    }\n\n    if (sortItems) {\n      items = items.sort((a, b) => sortItems(a, b, props.value));\n    }\n\n    return items;\n  }\n\n  highlightItemOnMouseEnter(highlightedIndex) {\n    this.setState({ highlightedIndex });\n  }\n\n  selectItemOnClick(item) {\n    const { getItemValue, onSelect } = this.props;\n\n    const value = getItemValue(item);\n\n    this.setState(\n      {\n        highlightedIndex: null,\n        isOpen: false,\n      },\n      () => {\n        this.inputRef.blur();\n        onSelect(value, item);\n      }\n    );\n  }\n\n  renderList() {\n    const { highlightedIndex } = this.state;\n    const props = this.props;\n\n    if (!props.value) return null;\n\n    const items = this.getFilteredItems(props);\n\n    return (\n      <ul\n        class=\"listbox\"\n        ref={this.setMenuRef}\n        onMouseDown={event => event.preventDefault()}\n      >\n        {items.map((item, idx) => {\n          return cloneElement(\n            props.renderItem(item, idx === highlightedIndex),\n            {\n              onClick: () => this.selectItemOnClick(item),\n              onMouseEnter: () => this.highlightItemOnMouseEnter(idx),\n              ref: el => this.setItemRef(el, idx),\n            }\n          );\n        })}\n        {items.length > 0 && props.renderAttribution()}\n      </ul>\n    );\n  }\n\n  handleOnClear(event) {\n    this.setState({ isOpen: false });\n\n    this.props.onClear(event);\n  }\n\n  handleOnBlur() {\n    this.setState({ isOpen: false });\n\n    const { onBlur } = this.props.inputProps;\n    if (onBlur) onBlur(event);\n  }\n\n  handleOnFocus(event) {\n    const { value } = this.props;\n\n    if (value.length > 0) this.setState({ isOpen: true });\n\n    const { onFocus } = this.props.inputProps;\n    if (onFocus) onFocus(event);\n  }\n\n  handleOnInput(event) {\n    const { value } = event.target;\n\n    this.props.onChange(value, event);\n\n    if (value.length <= 0) {\n      this.setState({ highlightedIndex: null });\n    }\n  }\n\n  handleKeyDown(event) {\n    const { isOpen } = this.state;\n\n    if (isOpen && Typeahead.keyEvents[event.key]) {\n      Typeahead.keyEvents[event.key].call(this, event);\n    } else if (!isOpen) {\n      this.setState({ isOpen: true });\n    }\n  }\n\n  render() {\n    const { inputProps, onClear, renderInput, value } = this.props;\n    const { isOpen } = this.state;\n\n    return (\n      <div class=\"typeahead\">\n        <div class=\"typeahead__input-wrapper\">\n          {renderInput({\n            ...inputProps,\n            role: 'combobox',\n            'aria-autocomplete': 'list',\n            'aria-expanded': String(isOpen),\n            autocomplete: 'off',\n            onBlur: this.handleOnBlur,\n            onFocus: this.handleOnFocus,\n            onInput: this.handleOnInput,\n            onKeyDown: this.handleKeyDown,\n            value,\n            ref: this.setInputRef,\n          })}\n          {onClear && value && (\n            <button\n              onClick={this.handleOnClear}\n              type=\"button\"\n              class=\"close\"\n              aria-label=\"Clear\"\n            >\n              <span aria-hidden=\"true\">&times;</span>\n            </button>\n          )}\n        </div>\n        {isOpen && this.renderList()}\n      </div>\n    );\n  }\n}\n\nTypeahead.defaultProps = {\n  debounceDuration: 150,\n  inputProps: {},\n  onChange: noop,\n  onClear: noop,\n  onSelect: noop,\n  renderInput: props => <input {...props} />,\n  value: '',\n};\n\nTypeahead.keyEvents = {\n  ArrowDown(event) {\n    event.preventDefault();\n\n    const items = this.getFilteredItems(this.props);\n    const itemsCount = items.length;\n    if (itemsCount < 1) return;\n\n    const { highlightedIndex } = this.state;\n\n    const newIndex =\n      highlightedIndex < itemsCount - 1\n        ? highlightedIndex + 1\n        : highlightedIndex;\n\n    this.setState({ highlightedIndex: newIndex });\n  },\n\n  ArrowUp(event) {\n    event.preventDefault();\n\n    const items = this.getFilteredItems(this.props);\n    const itemsCount = items.length;\n    if (itemsCount < 1) return;\n\n    const { highlightedIndex } = this.state;\n\n    const newIndex =\n      highlightedIndex > 0 ? highlightedIndex - 1 : highlightedIndex;\n\n    this.setState({ highlightedIndex: newIndex });\n  },\n\n  Enter(event) {\n    // not the right kind of Enter, abort\n    if (event.keyCode !== 13) return;\n\n    const { highlightedIndex, isOpen } = this.state;\n\n    if (!isOpen) {\n      // the menu is not open\n      return;\n    } else if (highlightedIndex == null) {\n      // input has control, but there's nothing selected\n      this.setState({ isOpen: false }, () => this.inputRef.select());\n    } else {\n      // the input has control and we have an item\n      event.preventDefault();\n\n      const item = this.getFilteredItems(this.props)[highlightedIndex];\n      const value = this.props.getItemValue(item);\n\n      this.setState(\n        {\n          highlightedIndex: null,\n          isOpen: false,\n        },\n        () => {\n          this.inputRef.setSelectionRange(value.length, value.length);\n          this.props.onSelect(value, item);\n        }\n      );\n    }\n  },\n\n  Escape() {\n    this.setState({\n      highlightedIndex: null,\n      isOpen: false,\n    });\n  },\n};\n\nexport default Typeahead;\n","// packages\nimport cx from 'classnames';\nimport { get, set } from '../vendor/idb-keyval';\nimport { h } from 'preact';\n\n// components\nimport CandidateRow from './CandidateRow';\nimport Contest from './Contest';\nimport SeatPartyDivider from './SeatPartyDivider';\nimport Portal from './Portal';\nimport PureComponent from './PureComponent';\nimport Typeahead from './Typeahead';\n\n// internal\nimport debounce from '../utils/debounce';\nimport { determineContestTitleYourRaces } from '../election-utils';\nimport { visibleCandidatesCount } from '../endpoints';\nimport { lookup } from '../utils/legislative-districts';\nimport loadAssetURL from '../utils/load-asset-url';\n\nconst googleIMG = loadAssetURL('powered-by-google');\n\nlet PlacesLib = null; // { AutocompleteSessionToken, AutocompleteSuggestion, Place } loaded via importLibrary()\n\nconst bounds = {\n  east: -93.514764,\n  west: -106.662177,\n  south: 25.843902,\n  north: 36.500199,\n};\n\nconst toLocationRestriction = b => ({\n  west: b.west,\n  east: b.east,\n  south: b.south,\n  north: b.north,\n});\n\nconst getPredictions = async (input, sessionToken) => {\n  if (!input || input.trim().length < 2) return [];\n\n  const request = {\n    input,\n    locationRestriction: toLocationRestriction(bounds),\n    includedPrimaryTypes: ['street_address', 'premise', 'route'],\n    region: 'us',\n    sessionToken,\n  };\n\n  const {\n    suggestions,\n  } = await PlacesLib.AutocompleteSuggestion.fetchAutocompleteSuggestions(\n    request\n  );\n\n  return suggestions.map(s => ({\n    id: s.placePrediction.placeId,\n    description: s.placePrediction.text.toString(),\n    place_id: s.placePrediction.placeId,\n    _prediction: s.placePrediction,\n  }));\n};\n\n// always render what's provided, the geocoder decides\nconst shouldItemRender = () => true;\n\nclass YourRaces extends PureComponent {\n  constructor() {\n    super();\n\n    this.state = {\n      contests: [],\n      coordinates: null,\n      data: null,\n      lookupError: false,\n      lookupPending: false,\n      lookedFoundStored: false,\n      redirectFish: false,\n      results: [],\n      value: '',\n      // default placeholder\n      placeholder: '1010 Colorado St, Austin, TX, 78701',\n    };\n\n    this.handleGeocode = this.handleGeocode.bind(this);\n    this.debouncedHandleGeocode = debounce(this.handleGeocode, 300);\n    this.onChange = this.onChange.bind(this);\n    this.onClear = this.onClear.bind(this);\n    this.onSelect = this.onSelect.bind(this);\n    this.sessionToken = null;\n  }\n\n  onClear(value) {\n    this.setState({ value: '' });\n  }\n\n  onChange(value) {\n    this.setState({ value }, this.debouncedHandleGeocode);\n  }\n\n  async handleGeocode() {\n    if (!PlacesLib) return;\n    const { value: input } = this.state;\n    try {\n      const results = await getPredictions(input, this.sessionToken);\n      this.setState({ results });\n    } catch (e) {\n      this.setState({ results: [] });\n    }\n  }\n\n  async onSelect({ name, placeId, _prediction }) {\n    this.setState({ lookupError: false, lookupPending: true, value: name });\n\n    try {\n      // New flow: prediction -> Place -> fetchFields({ fields: ['location'] })\n      const place = _prediction\n        ? _prediction.toPlace()\n        : new PlacesLib.Place({ id: placeId });\n\n      await place.fetchFields({ fields: ['location'] }); // ends the session\n\n      const latLng = place.location;\n      const coordinates = {\n        latitude: typeof latLng.lat === 'function' ? latLng.lat() : latLng.lat,\n        longitude: typeof latLng.lng === 'function' ? latLng.lng() : latLng.lng,\n      };\n\n      // Reset session so the next keystroke starts a fresh token\n      this.sessionToken = null;\n\n      lookup(coordinates)\n        .then(({ data }) => {\n          this.setState({\n            coordinates,\n            data,\n            lookupPending: false,\n            lookedFoundStored: false,\n          });\n        })\n        .catch(() =>\n          this.setState({\n            data: null,\n            lookupError: true,\n            lookupPending: false,\n          })\n        );\n    } catch (e) {\n      this.setState({\n        data: null,\n        lookupError: true,\n        lookupPending: false,\n      });\n      this.sessionToken = null;\n    }\n  }\n\n  async componentDidMount() {\n    // New: load the modern Places library classes\n    // eslint-disable-next-line no-undef\n    PlacesLib = await google.maps.importLibrary('places');\n\n    // // If we ever wanted to show a default location, coordinates for Governor mansion in Austin\n    // let latitude = 30.2730665;\n    // let longitude = -97.74341629999999;\n    // let coordinates = { latitude, longitude };\n\n    // lookup(coordinates)\n    //   .then(({ data }) => {\n    //     this.setState({\n    //       coordinates,\n    //       data,\n    //       lookupPending: false,\n    //       lookedFoundStored: false,\n    //     });\n    //   })\n    //   .catch(() =>\n    //     this.setState({\n    //       data: null,\n    //       lookupError: true,\n    //       lookupPending: false,\n    //     })\n    //   );  }\n  }\n\n  render() {\n    const { contests, notes, annotations, asOf } = this.props;\n    const {\n      coordinates,\n      data,\n      lookupError,\n      lookupPending,\n      lookedFoundStored,\n      results,\n      value,\n      placeholder,\n      redirectFish,\n    } = this.state;\n\n    let addressFeedback = null;\n\n    const matches = {\n      'us-house': null,\n      sboe: null,\n      'tx-senate': null,\n      'tx-house': null,\n    };\n\n    const noteMatches = {\n      'us-house': null,\n      sboe: null,\n      'tx-senate': null,\n      'tx-house': null,\n    };\n\n    const annoMatches = {\n      'us-house': null,\n      sboe: null,\n      'tx-senate': null,\n      'tx-house': null,\n    };\n\n    if (data) {\n      matches['us-house'] = contests.filter(\n        contest =>\n          contest.office === 'U.S. House' &&\n          contest.office_division === data.us_house.district\n      );\n\n      matches['sboe'] = contests.filter(\n        contest =>\n          contest.office === 'State Board of Education' &&\n          contest.office_division === data.sboe.district\n      );\n\n      matches['tx-senate'] = contests.filter(\n        contest =>\n          contest.office === 'Texas Senate' &&\n          contest.office_division === data.tx_senate.district\n      );\n\n      matches['tx-house'] = contests.filter(\n        contest =>\n          contest.office === 'Texas House' &&\n          contest.office_division === data.tx_house.district\n      );\n\n      noteMatches['us-house'] = notes.filter(\n        contest =>\n          contest.type ===\n            'us-house-district-' + data.us_house.district + '-Democrat' ||\n          contest.type ===\n            'us-house-district-' + data.us_house.district + '-Republican'\n      );\n\n      noteMatches['sboe'] = notes.filter(\n        contest =>\n          contest.type ===\n            'state-board-of-education-district-' +\n              data.sboe.district +\n              '-Democrat' ||\n          contest.type ===\n            'state-board-of-education-district-' +\n              data.sboe.district +\n              '-Republican'\n      );\n\n      noteMatches['tx-senate'] = notes.filter(\n        contest =>\n          contest.type ===\n            'texas-senate-district-' + data.tx_senate.district + '-Democrat' ||\n          contest.type ===\n            'texas-senate-district-' + data.tx_senate.district + '-Republican'\n      );\n\n      noteMatches['tx-house'] = notes.filter(\n        contest =>\n          contest.type ===\n            'texas-house-district-' + data.tx_house.district + '-Democrat' ||\n          contest.type ===\n            'texas-house-district-' + data.tx_house.district + '-Republican'\n      );\n\n      annoMatches['us-house'] = annotations.filter(\n        contest =>\n          contest.type ===\n            'us-house-district-' + data.us_house.district + '-Democrat' ||\n          contest.type ===\n            'us-house-district-' + data.us_house.district + '-Republican'\n      );\n\n      annoMatches['sboe'] = annotations.filter(\n        contest =>\n          contest.type ===\n            'state-board-of-education-district-' +\n              data.sboe.district +\n              '-Democrat' ||\n          contest.type ===\n            'state-board-of-education-district-' +\n              data.sboe.district +\n              '-Republican'\n      );\n\n      annoMatches['tx-senate'] = annotations.filter(\n        contest =>\n          contest.type ===\n            'texas-senate-district-' + data.tx_senate.district + '-Democrat' ||\n          contest.type ===\n            'texas-senate-district-' + data.tx_senate.district + '-Republican'\n      );\n\n      annoMatches['tx-house'] = annotations.filter(\n        contest =>\n          contest.type ===\n            'texas-house-district-' + data.tx_house.district + '-Democrat' ||\n          contest.type ===\n            'texas-house-district-' + data.tx_house.district + '-Republican'\n      );\n    }\n\n    if (lookupPending) {\n      addressFeedback = (\n        <p class=\"has-padding t-serif t-weight-bold t-align-center\">\n          Finding your details...{' '}\n          <svg class=\"icon icon-spinner animate-pulse\">\n            <use xlinkHref=\"#icon-spinner\" />\n          </svg>\n        </p>\n      );\n    }\n\n    if (lookupError) {\n      addressFeedback = (\n        <p class=\"has-padding t-serif t-weight-bold t-align-center\">\n          Hmm... we were unable to find you in Texas. Please check your address\n          and try again!\n        </p>\n      );\n    }\n\n    if ((coordinates && !lookupPending && !lookupError) || redirectFish) {\n      addressFeedback = (\n        <p class=\"has-padding t-serif t-weight-bold t-align-center\">\n          We found your information! These races have been personalized for you.\n        </p>\n      );\n    }\n\n    if (lookedFoundStored && !lookupPending && !lookupError && !redirectFish) {\n      addressFeedback = (\n        <p class=\"has-padding t-serif t-weight-bold t-align-center\">\n          Welcome back! We remembered the districts you found last time.\n        </p>\n      );\n    }\n\n    const inputProps = {\n      id: 'address-input',\n      class: 'address-input__input',\n      placeholder: placeholder,\n    };\n\n    function findIsCalled(party, matches) {\n      const race = matches.filter(race => race.party === party);\n      return race[0].is_called;\n    }\n\n    function findContestResult(party, matches) {\n      const race = matches.filter(race => race.party === party);\n      return race[0].contest_result;\n    }\n\n    return (\n      <div class=\"address-input t-sans\">\n        <svg class=\"icon icon-drawn-left-arrow\">\n          <use xlinkHref=\"#icon-drawn-left-arrow\"></use>\n        </svg>\n        <label class=\"address-input__label\" for=\"address-input\">\n          Enter your address\n        </label>\n        <Typeahead\n          inputProps={inputProps}\n          items={results}\n          getItemValue={item => ({\n            name: item.description,\n            placeId: item.place_id,\n            _prediction: item._prediction,\n          })}\n          value={value}\n          onChange={this.onChange}\n          onClear={this.onClear}\n          onSelect={this.onSelect}\n          renderItem={(item, isHighlighted) => (\n            <li\n              class={cx('listbox__item', {\n                'listbox__item--highlighted': isHighlighted,\n              })}\n              key={item.id}\n            >\n              {item.description}\n            </li>\n          )}\n          renderAttribution={() => (\n            <li class=\"listbox__item listbox__item--attribution\">\n              <img src={googleIMG} alt=\"Powered by Google\" />\n            </li>\n          )}\n          shouldItemRender={shouldItemRender}\n          renderInput={props => (\n            <input\n              {...props}\n              ref={el => {\n                props.ref(el);\n                this.inputRef = el;\n              }}\n            />\n          )}\n        />\n        {addressFeedback}\n        {data && contests.length > 0 && (\n          <Portal\n            node={document.getElementById('your-races-results')}\n            ref={ref => (this._resultsPortal = ref)}\n          >\n            <div class=\"representative-districts contest-list\">\n              <Contest\n                key={matches['us-house'][0].office_slug}\n                contest={matches['us-house']}\n                contestTitle={determineContestTitleYourRaces(\n                  matches['us-house'][0]\n                )}\n                tableHeader={CandidateRow.Header}\n                columnCount={CandidateRow.columnCount}\n                renderParty={party => (\n                  <SeatPartyDivider\n                    partyName={party.party}\n                    partyBallot={party}\n                    tableHeader={CandidateRow.Header}\n                    annotations={annoMatches['us-house'].filter(\n                      contest =>\n                        contest.type === party.office_slug + '-' + party.party\n                    )}\n                    notes={noteMatches['us-house'].filter(\n                      contest =>\n                        contest.type === party.office_slug + '-' + party.party\n                    )}\n                    source={party.source}\n                    asOf={asOf}\n                    columnCount={CandidateRow.columnCount}\n                    renderCandidate={(\n                      candidate,\n                      idx,\n                      viewAllCandidates,\n                      { totalVotes }\n                    ) => (\n                      <CandidateRow\n                        key={candidate.id}\n                        ballotName={candidate.name}\n                        candidateId={candidate.id}\n                        contestIsCalled={findIsCalled(\n                          candidate.party,\n                          matches['us-house']\n                        )}\n                        isIncumbent={candidate.is_incumbent}\n                        contestResult={findContestResult(\n                          candidate.party,\n                          matches['us-house']\n                        )}\n                        candidatesNum={party.candidacies.length}\n                        isWinner={candidate.is_winner}\n                        isViewable={\n                          viewAllCandidates || idx < visibleCandidatesCount\n                        }\n                        party={candidate.party}\n                        totalVotesInContest={totalVotes}\n                        votes={candidate.votes}\n                      />\n                    )}\n                  />\n                )}\n              />\n              {matches['tx-senate'].length > 0 && (\n                <Contest\n                  key={matches['tx-senate'].id}\n                  contest={matches['tx-senate']}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitleYourRaces(\n                    matches['tx-senate'][0]\n                  )}\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annoMatches['tx-senate'].filter(\n                        contest =>\n                          contest.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={noteMatches['tx-senate'].filter(\n                        contest =>\n                          contest.type === party.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={findIsCalled(\n                            candidate.party,\n                            matches['tx-senate']\n                          )}\n                          contestResult={findContestResult(\n                            candidate.party,\n                            matches['tx-senate']\n                          )}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              )}\n              <Contest\n                key={matches['tx-house'].id}\n                contest={matches['tx-house']}\n                tableHeader={CandidateRow.Header}\n                columnCount={CandidateRow.columnCount}\n                contestTitle={determineContestTitleYourRaces(\n                  matches['tx-house'][0]\n                )}\n                renderParty={party => (\n                  <SeatPartyDivider\n                    partyName={party.party}\n                    partyBallot={party}\n                    tableHeader={CandidateRow.Header}\n                    annotations={annoMatches['tx-house'].filter(\n                      contest =>\n                        contest.type === party.office_slug + '-' + party.party\n                    )}\n                    notes={noteMatches['tx-house'].filter(\n                      contest =>\n                        contest.type === party.office_slug + '-' + party.party\n                    )}\n                    source={party.source}\n                    asOf={asOf}\n                    columnCount={CandidateRow.columnCount}\n                    renderCandidate={(\n                      candidate,\n                      idx,\n                      viewAllCandidates,\n                      { totalVotes }\n                    ) => (\n                      <CandidateRow\n                        key={candidate.id}\n                        ballotName={candidate.name}\n                        candidateId={candidate.id}\n                        contestIsCalled={findIsCalled(\n                          candidate.party,\n                          matches['tx-house']\n                        )}\n                        contestResult={findContestResult(\n                          candidate.party,\n                          matches['tx-house']\n                        )}\n                        candidatesNum={party.candidacies.length}\n                        isIncumbent={candidate.is_incumbent}\n                        isViewable={\n                          viewAllCandidates || idx < visibleCandidatesCount\n                        }\n                        isWinner={candidate.is_winner}\n                        party={candidate.party}\n                        totalVotesInContest={totalVotes}\n                        votes={candidate.votes}\n                      />\n                    )}\n                  />\n                )}\n              />\n              {matches['sboe'].length > 0 && (\n                <Contest\n                  key={matches['sboe'][0].office_slug}\n                  contest={matches['sboe']}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitleYourRaces(\n                    matches['sboe'][0]\n                  )}\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annoMatches['sboe'].filter(\n                        contest =>\n                          contest.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={noteMatches['sboe'].filter(\n                        contest =>\n                          contest.type === party.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={findIsCalled(\n                            candidate.party,\n                            matches['sboe']\n                          )}\n                          contestResult={findContestResult(\n                            candidate.party,\n                            matches['sboe']\n                          )}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              )}\n            </div>\n          </Portal>\n        )}\n      </div>\n    );\n  }\n}\n\nexport default YourRaces;\n","/**\n * Grabs the contents of a `jsonScript` created JSON inline string and returns\n * it as a JSON object. If the element does not exist, or if the script\n * element does not have the JSON MIME type, null is returned instead.\n *\n * @param  {String} elementId the ID of the JSON script element\n * @return {Object|null}\n */\nexport default function loadAssetURL(elementId) {\n  const element = document.getElementById(elementId);\n\n  if (element && element.getAttribute('type') === 'application/json') {\n    return JSON.parse(element.textContent).asset_url;\n  } else {\n    return null;\n  }\n}\n","import getJSON from './get-json';\n\nconst LOOKUP_URL = ({ latitude, longitude, includeGeography = false }) =>\n  `https://dv-dev.texastribune.org/legislative-lookup-2025/?latitude=${latitude}&longitude=${longitude}`;\n\nexport function lookup({ latitude, longitude }) {\n  return getJSON(LOOKUP_URL({ latitude, longitude }));\n}\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nfunction Ad() {\n  const classes = cx('c-ad-flex_bg--gray preact__ad');\n\n  return (\n    <div class=\"plugin plugin--centered\">\n      <div class={classes}>\n        <div class=\"c-ad-flex__inner\">\n          <p class=\"c-ad-flex__thanks\">\n            The Texas Tribune thanks its sponsors.\n            <a href=\"https://mediakit.texastribune.org/\">\n              <strong>Become one</strong>\n            </a>\n            .\n          </p>\n          <div class=\"c-ad-flex__unit\">\n            <div class=\"dv-gpt-ad\"></div>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport default Ad;\n","// packages\nimport cx from 'classnames';\nimport { Component, h } from 'preact';\n\n// components\nimport CandidateRow from './components/CandidateRow';\nimport Contest from './components/Contest';\nimport NewContestShowcase from './components/NewContestShowcase';\nimport YourRaces from './components/YourRaces';\nimport Portal from './components/Portal';\nimport SeatPartyDivider from './components/SeatPartyDivider';\nimport Ad from './components/Ad';\n\nimport find from './utils/find';\nimport {\n  determineContestTitle,\n  chunk,\n  lastUpdatedFormat,\n} from './election-utils';\nimport {\n  RESULTS_IN_USE,\n  visibleCandidatesCount,\n  showLastUpdated,\n} from './endpoints';\nimport getJSON from './utils/get-json';\nimport { LENGTH_OF_CHECK_INTERVAL } from './constants';\n\ntype State = {\n  data: { [key: string]: any };\n  now: Date | null;\n};\n\nclass App extends Component<{}, State> {\n  timer!: number;\n\n  constructor() {\n    super();\n\n    this.state = {\n      data: [],\n      now: null,\n      timer: 0,\n    };\n\n    this.fetchData = this.fetchData.bind(this);\n  }\n\n  fetchData() {\n    const now = new Date();\n    console.info('Requesting:', now);\n\n    const asOf = lastUpdatedFormat(now);\n\n    if (showLastUpdated) {\n      document.querySelector('.counter').innerHTML = asOf;\n      document.querySelector('.counter-mobile .counter').innerHTML = asOf;\n    }\n\n    getJSON(RESULTS_IN_USE).then(data =>\n      this.setState({ data, asOf }, this.startTimer)\n    );\n  }\n\n  startTimer() {\n    this.timer = window.setTimeout(this.fetchData, LENGTH_OF_CHECK_INTERVAL);\n  }\n\n  clearTimer() {\n    window.clearTimeout(this.timer);\n  }\n\n  componentDidMount() {\n    this.fetchData();\n  }\n\n  componentWillUnmount() {\n    this.clearTimer();\n  }\n\n  componentDidUpdate() {}\n\n  render() {\n    const { notes, annotations } = this.props;\n    const { data, asOf } = this.state;\n\n    const seats_mapped = data.map(number => ({\n      office: number.office,\n      office_slug: number.office_slug,\n    }));\n\n    function unique(array, propertyName) {\n      return array.filter(\n        (e, i) =>\n          array.findIndex(a => a[propertyName] === e[propertyName]) === i\n      );\n    }\n\n    let unique_seats = unique(seats_mapped, 'office_slug');\n\n    // In order to sprinkle ads between races in sections where there a lot of races like the Texas House, we need to divide them into groups of nth races to make it into different divs\n\n    const texasHouse = unique_seats.filter(\n      contest => contest.office === 'Texas House'\n    );\n\n    const usHouse = unique_seats.filter(\n      contest => contest.office === 'U.S. House'\n    );\n\n    let texasHouseGroups, usHouseGroups;\n\n    if (texasHouse.length) {\n      texasHouseGroups = chunk(texasHouse, 28);\n      usHouseGroups = chunk(usHouse, 24);\n    }\n\n    return (\n      <div class=\"results\">\n        <Portal\n          node={document.getElementById('lookup-select')}\n          ref={ref => (this._yourPortal = ref)}\n        >\n          <YourRaces\n            contests={data}\n            notes={notes}\n            annotations={annotations}\n            asOf={asOf}\n          />\n        </Portal>\n\n        {/* SENATE DEMS */}\n        <NewContestShowcase\n          contest={find(\n            data,\n            contest =>\n              contest.office === 'U.S. Senate' && contest.party === 'Democrat'\n          )}\n          container={document.querySelector('#us-senate .democrat')}\n          notes={notes.filter(item => item.type === 'us-senate-Democrat')}\n          annotations={annotations.filter(\n            item => item.type === 'us-senate-Democrat'\n          )}\n          asOf={asOf}\n        />\n\n        {/* SENATE GOP */}\n        <NewContestShowcase\n          contest={find(\n            data,\n            contest =>\n              contest.office === 'U.S. Senate' && contest.party === 'Republican'\n          )}\n          container={document.querySelector('#us-senate .republican')}\n          notes={notes.filter(item => item.type === 'us-senate-Republican')}\n          annotations={annotations.filter(item => item.type === 'us-senate-Republican')}\n          asOf={asOf}\n        />\n\n        <Portal\n          node={document.querySelector(\n            '#governor .contests'\n          )}\n          ref={ref => (this._supremePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Governor')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  // includeCountyRundown\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n\n        {/* AG GOP */}\n        <NewContestShowcase\n          contest={find(\n            data,\n            contest =>\n              contest.office === 'Attorney General' && contest.party === 'Republican')}\n          container={document.querySelector('#attorney-general .republican')}\n          asOf={asOf}\n        />\n\n        {/* AG DEM */}\n        <NewContestShowcase\n          contest={find(\n            data,\n            contest =>\n              contest.office === 'Attorney General' && contest.party === 'Democrat')}\n          container={document.querySelector('#attorney-general .democrat')}\n          asOf={asOf}\n        />\n\n        {/* comptroller GOP MAP */}\n        <NewContestShowcase\n          contest={find(\n            data,\n            contest =>\n              contest.office === 'Comptroller' && contest.party === 'Republican')}\n          container={document.querySelector('#comptroller .republican')}\n          asOf={asOf}\n        />\n\n        {/* comptroller DEM */}\n        <NewContestShowcase\n          contest={find(\n            data,\n            contest =>\n              contest.office === 'Comptroller' && contest.party === 'Democrat')}\n          container={document.querySelector('#comptroller .democrat')}\n          asOf={asOf}\n        />\n\n        <Portal\n          node={document.querySelector(\n            '#lieutenant-governor .contests'\n          )}\n          ref={ref => (this._supremePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Lieutenant Governor')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  // includeCountyRundown\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n\n        <Portal\n          node={document.querySelector(\n            '#agriculture-commissioner .contests'\n          )}\n          ref={ref => (this._supremePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Agriculture Commissioner')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  // includeCountyRundown\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n\n        <Portal\n          node={document.querySelector(\n            '#land-commissioner .contests'\n          )}\n          ref={ref => (this._supremePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Land Commissioner')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  // includeCountyRundown\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n\n        <Portal\n          node={document.querySelector('#us-house .contests')}\n          ref={ref => (this._usPortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {usHouse.length > 0 &&\n              usHouseGroups.map(contestGroup => (\n                <div class=\"contest-group\">\n                  <div class=\"seat__contests-double\">\n                    {contestGroup.map(contest => (\n                      <Contest\n                        key={contest.id}\n                        contest={data.filter(\n                          item => item.office_slug === contest.office_slug\n                        )}\n                        tableHeader={CandidateRow.Header}\n                        columnCount={CandidateRow.columnCount}\n                        contestTitle={determineContestTitle(\n                          data.filter(\n                            item => item.office_slug === contest.office_slug\n                          )[0]\n                        )}\n                        renderParty={party => (\n                          <SeatPartyDivider\n                            partyName={party.party}\n                            partyBallot={party}\n                            tableHeader={CandidateRow.Header}\n                            annotations={annotations.filter(\n                              item =>\n                                item.type ===\n                                party.office_slug + '-' + party.party\n                            )}\n                            notes={notes.filter(\n                              item =>\n                                item.type ===\n                                contest.office_slug + '-' + party.party\n                            )}\n                            source={party.source}\n                            columnCount={CandidateRow.columnCount}\n                            asOf={asOf}\n                            renderCandidate={(\n                              candidate,\n                              idx,\n                              viewAllCandidates,\n                              { totalVotes }\n                            ) => (\n                              <CandidateRow\n                                key={candidate.id}\n                                ballotName={candidate.name}\n                                candidateId={candidate.id}\n                                contestIsCalled={party.is_called}\n                                contestResult={party.contest_result}\n                                candidatesNum={party.candidacies.length}\n                                isIncumbent={candidate.is_incumbent}\n                                isWinner={candidate.is_winner}\n                                isViewable={\n                                  viewAllCandidates ||\n                                  idx < visibleCandidatesCount\n                                }\n                                party={candidate.party}\n                                totalVotesInContest={totalVotes}\n                                votes={candidate.votes}\n                              />\n                            )}\n                          />\n                        )}\n                      />\n                    ))}\n                  </div>\n                  <Ad />\n                </div>\n              ))}\n          </div>\n        </Portal>\n        <Portal\n          node={document.querySelector(\n            '#railroad-commission-of-texas .contests'\n          )}\n          ref={ref => (this._supremePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Texas Railroad Commission')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  // includeCountyRundown\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n        <Portal\n          node={document.querySelector('#texas-supreme-court .contests')}\n          ref={ref => (this._supremePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Texas Supreme Court')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n        <Portal\n          node={document.querySelector('#state-board-of-education .contests')}\n          ref={ref => (this._sboePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'State Board of Education')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n        <Portal\n          node={document.querySelector(\n            '#texas-court-of-criminal-appeals .contests'\n          )}\n          ref={ref => (this._crimPortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(\n                contest => contest.office === 'Texas Court of Criminal Appeals'\n              )\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n        <Portal\n          node={document.querySelector('#texas-senate .contests')}\n          ref={ref => (this._senatePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {unique_seats\n              .filter(contest => contest.office === 'Texas Senate')\n              .map(contest => (\n                <Contest\n                  key={contest.id}\n                  contest={data.filter(\n                    item => item.office_slug === contest.office_slug\n                  )}\n                  notes={notes.filter(\n                    item => item.type === contest.office_slug\n                  )}\n                  tableHeader={CandidateRow.Header}\n                  columnCount={CandidateRow.columnCount}\n                  contestTitle={determineContestTitle(\n                    data.filter(\n                      item => item.office_slug === contest.office_slug\n                    )[0]\n                  )}\n                  renderParty={party => (\n                    <SeatPartyDivider\n                      partyName={party.party}\n                      partyBallot={party}\n                      tableHeader={CandidateRow.Header}\n                      annotations={annotations.filter(\n                        item =>\n                          item.type === party.office_slug + '-' + party.party\n                      )}\n                      notes={notes.filter(\n                        item =>\n                          item.type === contest.office_slug + '-' + party.party\n                      )}\n                      source={party.source}\n                      asOf={asOf}\n                      columnCount={CandidateRow.columnCount}\n                      renderCandidate={(\n                        candidate,\n                        idx,\n                        viewAllCandidates,\n                        { totalVotes }\n                      ) => (\n                        <CandidateRow\n                          key={candidate.id}\n                          ballotName={candidate.name}\n                          candidateId={candidate.id}\n                          contestIsCalled={party.is_called}\n                          contestResult={party.contest_result}\n                          candidatesNum={party.candidacies.length}\n                          isIncumbent={candidate.is_incumbent}\n                          isWinner={candidate.is_winner}\n                          isViewable={\n                            viewAllCandidates || idx < visibleCandidatesCount\n                          }\n                          party={candidate.party}\n                          totalVotesInContest={totalVotes}\n                          votes={candidate.votes}\n                        />\n                      )}\n                    />\n                  )}\n                />\n              ))}\n          </div>\n        </Portal>\n        <Portal\n          node={document.querySelector('#texas-house .contests')}\n          ref={ref => (this._housePortal = ref)}\n        >\n          <div class=\"office__contests\">\n            {texasHouse.length > 0 &&\n              texasHouseGroups.map(contestGroup => (\n                <div class=\"contest-group\">\n                  <div class=\"seat__contests-double\">\n                    {contestGroup.map(contest => (\n                      <Contest\n                        key={contest.id}\n                        contest={data.filter(\n                          item => item.office_slug === contest.office_slug\n                        )}\n                        notes={notes.filter(\n                          item => item.type === contest.office_slug\n                        )}\n                        tableHeader={CandidateRow.Header}\n                        columnCount={CandidateRow.columnCount}\n                        contestTitle={determineContestTitle(\n                          data.filter(\n                            item => item.office_slug === contest.office_slug\n                          )[0]\n                        )}\n                        renderParty={party => (\n                          <SeatPartyDivider\n                            partyName={party.party}\n                            partyBallot={party}\n                            tableHeader={CandidateRow.Header}\n                            annotations={annotations.filter(\n                              item =>\n                                item.type ===\n                                party.office_slug + '-' + party.party\n                            )}\n                            notes={notes.filter(\n                              item =>\n                                item.type ===\n                                contest.office_slug + '-' + party.party\n                            )}\n                            source={party.source}\n                            asOf={asOf}\n                            columnCount={CandidateRow.columnCount}\n                            renderCandidate={(\n                              candidate,\n                              idx,\n                              viewAllCandidates,\n                              { totalVotes }\n                            ) => (\n                              <CandidateRow\n                                key={candidate.id}\n                                ballotName={candidate.name}\n                                candidateId={candidate.id}\n                                contestIsCalled={party.is_called}\n                                contestResult={party.contest_result}\n                                candidatesNum={party.candidacies.length}\n                                isIncumbent={candidate.is_incumbent}\n                                isWinner={candidate.is_winner}\n                                isViewable={\n                                  viewAllCandidates ||\n                                  idx < visibleCandidatesCount\n                                }\n                                party={candidate.party}\n                                totalVotesInContest={totalVotes}\n                                votes={candidate.votes}\n                              />\n                            )}\n                          />\n                        )}\n                      />\n                    ))}\n                  </div>\n                  <Ad />\n                </div>\n              ))}\n          </div>\n        </Portal>\n      </div>\n    );\n  }\n}\n\nexport default App;\n","// import JS files\nimport '../kickstart';\nimport './sticky-nav-bar';\n\nimport { h, render } from 'preact';\n\n// Components\nimport App from '../ResultsApp';\nimport loadJsonScript from '../utils/load-json-script';\n\nconst notes = loadJsonScript('notes_data');\n\nconst annotations = loadJsonScript('annotations_data');\n\nrender(\n  <App notes={notes} annotations={annotations} />,\n  document.getElementById('app')\n);\n","// Live results being updated by Republic\nconst FLAT_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT.json';\n\n// This has emptied out results i.e. is static\nconst STATIC_FLAT_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_STATIC.json';\n\n// This has the final certified results and is static\nconst FINAL_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_FINAL_RESULTS.json';\n\n// Includes fake results data for testing\nconst FAKE_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_TEST.json';\n\nconst FAKE_RESULTS_URL_TWO =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_AP_test.json';\n\nconst FAKE_RESULTS_MIDDLE =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_AP_test_middle.json';\n\nconst FAKE_RESULTS_LATE =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_AP_test_late_night.json';\n\nconst FAKE_RESULTS_LATE_2 =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_COMPLETE_FEB_23_test.json';\n\n// Used for homepage takeover\nconst HOMEPAGE_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/homepage_takeover/2024-primary.json';\n\n// Calls TT stories using the API\nconst STORY_API_URL = (id: number): string =>\n  `https://www.texastribune.org/api/v2/articles/${id}/?format=json&fields=sitewide_image,summary,authors,url,pub_date,updated_date,homepage_headline`;\n\n// This is for the other candidates for the hide/show toggle\nconst visibleCandidatesCount = 4;\n\n// This is for the other candidates for the hide/show toggle just in the homepage\nconst visibleCandidatesCountHomepage = 2;\n\n// Show bubble map toggle option. Set to false if we want to hide it.\nconst showBubbleMap = true;\n\n// Show precincts or estimated votes still being counted text\nconst showPrecinctsReporting = true;\n\n// Adds the checkmark if this is the final official results from local canvass\nconst isCanvass = false;\n\n// Show last updated timestamp, set to true to last updated text\nconst showLastUpdated = false;\n\n// What we are using across the ap\n// will be used on the results page, in the homepage takeover\n// and in the embeds\nconst RESULTS_IN_USE = FLAT_RESULTS_URL;\n\nexport {\n  RESULTS_IN_USE,\n  HOMEPAGE_URL,\n  STORY_API_URL,\n  visibleCandidatesCount,\n  visibleCandidatesCountHomepage,\n  showPrecinctsReporting,\n  isCanvass,\n  showLastUpdated,\n  showBubbleMap,\n};\n","/**\n * Grabs the contents of a `jsonScript` created JSON inline string and returns\n * it as a JSON object. If the element does not exist, or if the script\n * element does not have the JSON MIME type, null is returned instead.\n *\n * @param  {String} elementId the ID of the JSON script element\n * @return {Object|null}\n */\nexport default function loadJsonScript(elementId) {\n  const element = document.getElementById(elementId);\n\n  if (element && element.getAttribute('type') === 'application/json') {\n    return JSON.parse(element.textContent);\n  } else {\n    return null;\n  }\n}\n","import cx from 'classnames';\nimport { capfirst, intcomma } from 'journalize';\nimport { Component, h, VNode } from 'preact';\n\nimport PartyPill from './PartyPill';\nimport PureComponent from './PureComponent';\n\nimport { isCanvass } from '../endpoints';\n\nimport formatPercent from '../utils/format-percent';\n\ninterface Props {\n  ballotName: string;\n  candidateId: string;\n  contestIsCalled: boolean;\n  contestResult: string;\n  isIncumbent: boolean;\n  isWinner: boolean;\n  isMapRow: boolean;\n  candidatesNum: number;\n  party: string;\n  totalVotesInContest: number;\n  votes: number;\n}\n\nclass CandidateRow extends Component<Props> {\n  static Header: VNode;\n  static countyHeader: VNode;\n  static columnCount: number;\n\n  render() {\n    const {\n      ballotName,\n      contestIsCalled,\n      contestResult,\n      isIncumbent,\n      isWinner,\n      isViewable,\n      candidateColor,\n      candidatesNum,\n      isMapRow,\n      party,\n      totalVotesInContest,\n      votes,\n    } = this.props;\n\n    let divStyle;\n\n    let checkStyle;\n\n    if (candidateColor) {\n      divStyle = {\n        'background-color': candidateColor,\n      };\n      checkStyle = {\n        color: candidateColor,\n      };\n    }\n\n    let rowClass = cx('candidate', 'contest__candidate-row', {\n      'contest__candidate-row--winner dem--border':\n        contestIsCalled && isWinner && party == 'Democrat',\n      'contest__candidate-row--winner rep--border':\n        contestIsCalled && isWinner && party == 'Republican',\n    });\n\n    let checkClass = cx('check', {\n      'dem-winner': party == 'Democrat' && contestResult != 'runoff',\n      'rep-winner': party == 'Republican' && contestResult != 'runoff',\n      'runoff-winner': contestResult == 'runoff',\n    });\n\n    if (!isViewable) {\n      rowClass += ' race__candidate-row--hidden';\n    }\n\n    const checkmark = '\\u2713';\n\n    const uncontested = candidatesNum == 1;\n\n    const asteriskNames = [\n      'Andrew White',\n      'Amanda Edwards',\n      'Scott Mandel',\n      'Jay Nagy',\n    ];\n\n    const IsAsterisk = asteriskNames.includes(ballotName);\n\n    return (\n      <tr class={rowClass}>\n        <td class=\"candidate__cell candidate__party\">\n          {!candidateColor && <PartyPill party={party} />}\n          {candidateColor && <PartyPill party={party} style={divStyle} />}\n        </td>\n        <th class=\"candidate__cell candidate__name\">\n          {isWinner &&\n            (contestResult == 'winner' || contestResult == 'uncontested') && (\n              <span class={checkClass}>{checkmark}</span>\n            )}\n          {isWinner && contestResult == 'runoff' && (\n            <span class={checkClass}>{checkmark}</span>\n          )}\n          {isWinner &&\n          isMapRow == null &&\n          isCanvass == true &&\n          contestResult != 'runoff' ? (\n            <span class={checkClass}>{ballotName}</span>\n          ) : (\n            ballotName\n          )}\n          {IsAsterisk && <span class=\"asterisk_out\">*</span>}{' '}\n          {isIncumbent && (\n            <span class=\"pill pill--basic\" title=\"Currently holds this seat\">\n              Incumbent\n            </span>\n          )}\n        </th>\n        <td class=\"candidate__cell candidate__votes\">\n          {uncontested == false ? intcomma(votes) : '—'}\n        </td>\n        <td class=\"candidate__cell candidate__pct\">\n          {uncontested == false\n            ? formatPercent(votes, totalVotesInContest)\n            : '—'}\n          <span class=\"candidate__pct-symbol\">%</span>\n        </td>\n      </tr>\n    );\n  }\n}\n\nCandidateRow.defaultProps = {\n  contestIsCalled: false,\n  isViewable: true,\n};\n\nCandidateRow.Header = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n    </tr>\n  </thead>\n);\n\nCandidateRow.countyHeader = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n    </tr>\n  </thead>\n);\n\nCandidateRow.columnCount = 4;\n\nexport default CandidateRow;\n","/* global Node, Window */\n\n/**\n * Select all matching elements on the page. Uses `document.querySelectorAll`.\n *\n * @param {String} el The CSS selector to search for.\n * @param {Element} [context] The container to search within. Defaults to\n * `document`.\n * @returns {Element[]}\n */\nfunction selectAll(el, context) {\n  // if `el` is a Node or Window, return it in an Array\n  if (el instanceof Node || el instanceof Window) return [el];\n\n  return Array.prototype.slice.call(\n    typeof el === 'string'\n      ? (context || document).querySelectorAll(el)\n      : el || []\n  );\n}\n\nexport default selectAll;\n","const LENGTH_OF_CHECK_INTERVAL = 1000 * 60 * 2; // 2 minutes\nconst TIMERS_SHOULD_RUN = false;\n\nexport { LENGTH_OF_CHECK_INTERVAL, TIMERS_SHOULD_RUN };\n","/**\n * Select an element on the page. Uses `document.querySelector`, meaning it\n * will only return the first element that matches.\n *\n * @param {String} el The CSS selector to search for.\n * @param {Element} [context] The container to search within. Defaults to\n * `document`.\n * @returns {Element|null}\n */\nfunction select(el, context) {\n  return typeof el === 'string'\n    ? (context || document).querySelector(el)\n    : el || null;\n}\n\nexport default select;\n","// The sticky top nav bar\n\nimport select from '../utils/select';\nimport selectAll from '../utils/select-all';\n\nconst appNav = document.getElementById('app-nav');\nconst { height } = appNav.getBoundingClientRect();\nconst appNavHeight = Math.round(height) + 10;\n\nconst appNavJumps = selectAll('.navbar__item a', appNav);\n\n// These are for anchor links so that they also take into account the height of the sticky bar\nconst anchorJumps = selectAll('a.anchor', document);\n\nappNavJumps.concat(anchorJumps).forEach(el => {\n  el.addEventListener('click', e => {\n    e.preventDefault();\n    const target = select(e.target.getAttribute('href'));\n\n    // var current = appNav.getElementsByClassName('active-nav');\n\n    // current[0].className = current[0].className.replace(' active-nav', '');\n\n    // var path =\n    //   e.path || (e.composedPath && e.composedPath()) || composedPath(e.target);\n    // path[1].className += ' active-nav';\n\n    window.scrollTo(\n      0,\n      window.pageYOffset + target.getBoundingClientRect().top - appNavHeight\n    );\n  });\n});\n","var journalize = require('journalize');\n\nimport { capfirst, apdate, aptime, apmonth } from 'journalize';\n\nimport context from 'Data/text.json';\n\nexport function lastUpdatedFormat(now) {\n  // format dates to ap style\n  const formatted_date = journalize.apdate(now),\n    formatted_time = journalize.aptime(now),\n    formatted_month = journalize.apmonth(now),\n    just_day = now.getDate();\n\n  return formatted_time;\n}\n\nexport function format(num) {\n  return num < 10 ? '0' + num : num;\n}\n\nexport const chunk = (arr, size) =>\n  arr.reduce((acc, _, i) => {\n    if (i % size === 0) acc.push(arr.slice(i, i + size));\n    return acc;\n  }, []);\n\nexport const delay = (function() {\n  var timer = 0;\n  return function(callback, ms) {\n    clearTimeout(timer);\n    timer = setTimeout(callback, ms);\n  };\n})();\n\nconst PARTY_SORT_ORDER = [\n  'democrat',\n  'republican',\n  'libertarian',\n  'independent',\n  'write-in',\n];\n\nconst TT_directory_slugs = [\n  { office: 'Texas House', 'directory-slug': 'tx-house' },\n  { office: 'Texas Senate', 'directory-slug': 'tx-senate' },\n  { office: 'U.S. House', 'directory-slug': 'us-house' },\n  { office: 'State Board of Education', 'directory-slug': 'sboe' },\n];\n\nexport function get_directory_slug(office) {\n  return TT_directory_slugs.filter(slug => slug.office == office);\n}\n\nlet opacity = '0.4';\n\nexport const CandidateColorsRace1 = [\n  {\n    name: 'Ken Paxton',\n    color: '#f5af76',\n  },\n  {\n    name: 'Wesley Hunt',\n    color: '#bababa',\n  },\n  {\n    name: 'John Cornyn',\n    color: '#EF564A',\n  },\n  {\n    name: 'Virgil Bierschwale',\n    color: '#bababa',\n  },\n  {\n    name: 'Anne Bender',\n    color: '#bababa',\n  },\n  {\n    name: 'Gulrez \"Gus\" Khan',\n    color: '#bababa',\n  },\n  {\n    name: 'Sara Canady',\n    color: '#bababa',\n  },\n  {\n    name: 'John O. Adefope',\n    color: '#bababa',\n  },\n  {\n    name: 'Uncommitted',\n    color: '#bababa',\n  },\n];\n\nexport const CandidateColorsRace2 = [\n  {\n    name: 'Jasmine Crockett',\n    color: '#fcbec3',\n  },\n  {\n    name: 'James Talarico',\n    color: '#5acc7d',\n  },\n  {\n    name: 'Ahmad R. Hassan',\n    color: '#1755c5',\n  },\n];\n\n// If we need light blue #99d2da; background-color:rgba(153, 210, 218, .1)\n// If we need dark blue #325ba8; background-color:rgba(90, 137, 204, .1)\n\nexport function sort_candidates_by_party(candidates) {\n  return candidates.sort(\n    (a, b) =>\n      PARTY_SORT_ORDER.indexOf(a.party) - PARTY_SORT_ORDER.indexOf(b.party)\n  );\n}\n\nconst PRESIDENT_ORDER = [\n  'Donald J. Trump',\n  'Nikki Haley',\n  'Ron DeSantis',\n  'Vivek Ramaswamy',\n  'Ryan Binkley',\n  'Chris Christie',\n  'Asa Hutchinson',\n  'David Stuckenberg',\n  'Uncommitted',\n];\n\nexport function sort_candidates_presidential(candidates) {\n  return candidates.sort(\n    (a, b) => PRESIDENT_ORDER.indexOf(a.name) - PRESIDENT_ORDER.indexOf(b.name)\n  );\n}\n\nexport function alert_conditionals(vote_pct, cand_num) {\n  if (vote_pct == 0 && cand_num > 1) {\n    return context.label_conditionals['zero-results'];\n  } else if (vote_pct > 0 && vote_pct <= 50 && cand_num > 1) {\n    return context.label_conditionals['more-than-0-less-than-50'];\n  } else if (vote_pct > 50 && vote_pct < 99 && cand_num > 1) {\n    return context.label_conditionals['more-than-50-no-winner'];\n  } else if (vote_pct >= 99 && cand_num > 1) {\n    return context.label_conditionals['all-results-in-no-winner'];\n  } else if (cand_num == 1) {\n    return context.label_conditionals['uncontested'];\n  }\n}\n\nexport function alert_winners(result, office) {\n  if (result == 'winner' && office != 'President') {\n    return context.winner_conditionals['winner'];\n  } else if (result == 'winner' && office == 'President') {\n    return context.winner_conditionals['winner_prez'];\n  } else if (result == 'uncontested') {\n    return context.winner_conditionals['uncontested'];\n  } else if (result == 'runoff') {\n    return context.winner_conditionals['runoff'];\n  }\n}\n\nexport function text_conditionals(vote_pct, cand_num) {\n  if (vote_pct == 0 && cand_num > 1) {\n    return context.text_conditionals['zero-results'];\n  } else if (vote_pct > 1 && vote_pct <= 50 && cand_num > 1) {\n    return context.text_conditionals['more-than-0-less-than-50'];\n  } else if (vote_pct > 50 && vote_pct < 99 && cand_num > 1) {\n    return context.text_conditionals['more-than-50-no-winner'];\n  } else if (vote_pct >= 99 && cand_num > 1) {\n    return context.text_conditionals['all-results-in-no-winner'];\n  } else if (cand_num == 1) {\n    return context.text_conditionals['uncontested'];\n  }\n}\n\nexport function text_conditional_winner_zero(vote_pct, cand_num) {\n  if (vote_pct == 0 && cand_num > 1) {\n    return context.text_conditionals['zero-results_winner'];\n  } else {\n    return ``;\n  }\n}\n\nexport function determineDistrictTitle(contest) {\n  return `${contest.office} ${\n    contest.office === 'President' ||\n    contest.division_type === 'class' ||\n    contest.division_type === 'statewide'\n      ? ''\n      : contest.division_type === 'place' && contest.office_division === 1\n      ? 'Chief Justice'\n      : capfirst(contest.division_type) + ' ' + contest.office_division\n  }`.trim();\n}\n\nexport function determineContestTitle(contest) {\n  if (contest.division_type === 'statewide' || contest.division_type === 'seat')\n    return '';\n\n  return determineDistrictTitle(contest);\n}\n\nexport function determineContestTitleYourRaces(contest) {\n  return determineDistrictTitle(contest);\n}\n","/**\n * A wrapper for the initial response from a fetch call that funnels to\n * res.json().\n *\n * @private\n * @param {Response} res\n * @returns {Promise}\n */\nfunction jsonResponse(res) {\n  if (!res.ok) throw new Error(`${res.status}: ${res.statusText}`);\n\n  return res.json();\n}\n\n/**\n * A light wrapper around fetch that assumes you're seeking a JSON response.\n *\n * @param {String|Request} input\n * @param {Object} init\n * @returns {Promise}\n */\nexport default function getJSON(input, init) {\n  return fetch(input, init).then(jsonResponse);\n}\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nfunction OtherCandidate({\n  isViewable,\n  candidateCount,\n  embedType,\n  onClick,\n  showDelegates,\n}) {\n  const classes = cx('candidate race__candidate-row', {\n    'race__candidate-row--hidden': !isViewable,\n  });\n\n  return (\n    <tr class={classes}>\n      <td\n        class=\"candidate__cell candidate__party t-align-center\"\n        onClick={onClick}\n      >\n        <svg class=\"icon icon-angle-down\">\n          <use xlinkHref=\"#icon-angle-down\" />\n        </svg>\n      </td>\n      <th class=\"candidate__cell candidate__name\">\n        <button class={embedType} onClick={onClick}>\n          Show All ({candidateCount}){' '}\n        </button>\n      </th>\n      <th class=\"candidate__cell candidate__votes\"></th>\n      <th class=\"candidate__cell candidate__pct\"></th>\n      {showDelegates && <td class=\"candidate__cell candidate__votes\">{}</td>}\n    </tr>\n  );\n}\n\nexport default OtherCandidate;\n","import cx from 'classnames';\nimport { intcomma } from 'journalize';\nimport { Component, h } from 'preact';\n\nimport OtherCandidate from './OtherCandidate';\nimport { PreactHTMLConverter } from 'preact-html-converter';\n\n// internal\nimport {\n  sort_candidates_presidential,\n  CandidateColorsRace1,\n  CandidateColorsRace2,\n  alert_conditionals,\n  alert_winners,\n  text_conditionals,\n  text_conditional_winner_zero,\n} from '../election-utils';\nimport sumValues from '../utils/sum-values';\nimport formatPercent from '../utils/format-percent';\n\nimport find from '../utils/find';\n\nimport { isCanvass, visibleCandidatesCount } from '../endpoints';\n\ninterface Props {\n  partyName: string;\n  tableHeader: JSX.Element;\n  annotations: { [key: string]: any };\n  notes: { [key: string]: any };\n  isShowcaseRace?: boolean;\n  isHomepage?: boolean;\n  asOf: string;\n  source: string;\n  showDelegates: boolean;\n  columnCount: number;\n  ShowcaseRaceWinner: any;\n  partyBallot: { [key: string]: any };\n  renderCandidate: any;\n  contestTitle: string;\n  embedType: string;\n}\n\nclass SeatPartyDivider extends Component {\n  constructor() {\n    super();\n\n    this.state = {\n      viewAllCandidates: false,\n    };\n    this.onViewableToggle = this.onViewableToggle.bind(this);\n  }\n\n  onViewableToggle() {\n    this.setState(prevState => ({\n      viewAllCandidates: !prevState.viewAllCandidates, // set viewAllCandidates to what is wasn't before\n    }));\n  }\n  render() {\n    const {\n      partyName,\n      annotations,\n      notes,\n      partyBallot,\n      tableHeader,\n      isShowcaseRace,\n      isHomepage,\n      columnCount,\n      showDelegates,\n      ShowcaseRaceWinner,\n      asOf,\n      source,\n      renderCandidate,\n      contestTitle,\n      embedType,\n    } = this.props;\n\n    const { viewAllCandidates } = this.state;\n\n    const converter = PreactHTMLConverter();\n\n    const shouldDisplayResult = partyBallot.contest_result !== 'not called';\n\n    // console.log(partyBallot.contest_result);\n\n    const totalVotes = sumValues(partyBallot.candidacies, 'votes');\n\n    let candidates = partyBallot.candidacies;\n\n    const uncontested = candidates.length == 1;\n\n    let ap_eevp = partyBallot.eevp;\n\n    const pct_votes =\n      source == 'Decision Desk HQ'\n        ? formatPercent(totalVotes, partyBallot.estimated_votes_mid)\n        : partyBallot.eevp;\n\n    const pct_votes_turnout =\n      pct_votes < 100\n        ? `An estimated ${pct_votes}% of votes have been counted, according to the ${source}.`\n        : `An estimated >99% of votes have been counted, according to the ${source}.`;\n\n    const pct_votes_turnout_zero_winner =\n      pct_votes == 0 && shouldDisplayResult ? `` : pct_votes_turnout;\n\n    const pct_votes_turnout_w_uncontested =\n      uncontested == true\n        ? text_conditionals(pct_votes, partyBallot.candidacies.length)\n        : pct_votes_turnout_zero_winner;\n\n    const pct_votes_explain = !shouldDisplayResult\n      ? text_conditionals(pct_votes, partyBallot.candidacies.length)\n      : text_conditional_winner_zero(pct_votes, partyBallot.candidacies.length);\n\n    let candidatesRender;\n\n    let firstShowcaseRace;\n\n    let embedTypeUsable = 'none';\n\n    if (typeof embedType !== 'undefined') {\n      embedTypeUsable = embedType;\n    }\n\n    let checkStyle;\n\n    if (isShowcaseRace) {\n      firstShowcaseRace =\n        partyBallot.office == 'President' && partyBallot.party == 'Republican';\n      // !isHomepage;\n\n      candidatesRender = firstShowcaseRace\n        ? CandidateColorsRace1\n        : CandidateColorsRace2;\n\n      if (ShowcaseRaceWinner) {\n        const colorWinner = find(\n          candidatesRender,\n          candidate => candidate.name === ShowcaseRaceWinner['name']\n        );\n\n        if (colorWinner) {\n          checkStyle = {\n            color: colorWinner['color'],\n          };\n        }\n      }\n    }\n\n    if (\n      partyBallot.office == 'President' &&\n      partyBallot.party == 'Republican' &&\n      totalVotes == 0\n    ) {\n      candidates = sort_candidates_presidential(candidates);\n    }\n\n    const rowClass = cx('seat__race', {\n      'seat__race--Democrat': partyName == 'Democrat',\n      'seat__race--Republican': partyName == 'Republican',\n    });\n\n    const klaxon_sos = 'Race has been declared'; // if we switch sources to TX SOS and someone else has declared the winner\n\n    const klaxon = shouldDisplayResult\n      ? source == 'Decision Desk HQ' || source == 'Associated Press'\n        ? alert_winners(partyBallot.contest_result, partyBallot.office)\n        : klaxon_sos\n      : alert_conditionals(pct_votes, partyBallot.candidacies.length);\n\n    const checkmark = '\\u2713';\n\n    let checkClass = cx('check', {\n      'dem-winner':\n        partyBallot.party == 'Democrat' &&\n        partyBallot.contest_result != 'runoff',\n      'rep-winner':\n        partyBallot.party == 'Republican' &&\n        partyBallot.contest_result != 'runoff',\n      'runoff-winner': partyBallot.contest_result == 'runoff',\n    });\n\n    const contestMetricsClass = cx('contest__metrics', {\n      homepage__metrics: isHomepage,\n      'non-homepage__metrics': !isHomepage,\n    });\n\n    let hasTurnoutmodel =\n      source == 'Decision Desk HQ' || source == 'Associated Press'\n        ? true\n        : false;\n\n    const precinctsClass = cx('contest__precincts');\n\n    let ManualoverrideSource;\n\n    // If there is a race, that's being manually updated, you can change the Source to whatever the new votes are coming from here if you uncomment the code below. This is only if the source isn't Texas Secretary of State. If it is, then you don't have to do anything.\n\n    // if (partyBallot.office == 'U.S. House' && partyBallot.office_division == 37 && partyBallot.party == 'Republican') {\n    //   ManualoverrideSource = 'Travis County Elections'\n    // }\n    // else {\n    //   ManualoverrideSource = ''\n    // }\n\n    ManualoverrideSource = '';\n\n    const IsAnnotations =\n      annotations && annotations.length > 0 && annotations[0].value != ''\n        ? true\n        : false;\n\n    const IsNoted = notes && notes.length > 0 ? true : false;\n\n    return (\n      <div class={rowClass}>\n        <div class=\"race\">\n          {isHomepage ? (\n            <span>\n              <h2 class=\"office__title\">{contestTitle}</h2>\n              <h3 class=\"race__title\">\n                {partyName}\n                {partyName == 'Democrat' && <span>ic</span>} Primary{' '}\n              </h3>\n            </span>\n          ) : (\n            <span>\n              <h4 class=\"race__title\">{partyName} </h4>\n            </span>\n          )}\n\n          <div class={contestMetricsClass}>\n            {isCanvass == false && (\n              <h4 class=\"klaxon__text\">\n                {shouldDisplayResult &&\n                (source == 'Decision Desk HQ' ||\n                  source == 'Associated Press') ? (\n                  <span class={checkClass} style={checkStyle}>\n                    {checkmark}\n                  </span>\n                ) : (\n                  ''\n                )}\n                {klaxon}\n              </h4>\n            )}\n            {isCanvass == true &&\n              shouldDisplayResult &&\n              partyBallot.contest_result == 'runoff' && (\n                <h4 class=\"klaxon__text klaxon__runoff\">\n                  Nominee to be decided in May runoff\n                </h4>\n              )}\n            {ManualoverrideSource == '' && isCanvass == false && (\n              <p class={precinctsClass}>\n                {source == 'Texas Secretary of State'\n                  ? `${intcomma(\n                      partyBallot.pollinglocationsreporting\n                    )} of ${intcomma(\n                      partyBallot.total_pollinglocations\n                    )} polling locations reporting (${partyBallot.pollinglocations_reporting_percent.toFixed(\n                      1\n                    )}%)`\n                  : pct_votes_turnout_w_uncontested}{' '}\n                {converter.convert(pct_votes_explain)}\n              </p>\n            )}\n            {\n              (ManualoverrideSource = !'' &&\n                source != 'Texas Secretary of State' &&\n                source != 'Decision Desk HQ' &&\n                source != 'Associated Press' &&\n                isCanvass == false && (\n                  <p class={precinctsClass}>\n                    {`${intcomma(\n                      partyBallot.pollinglocationsreporting\n                    )} of ${intcomma(\n                      partyBallot.total_pollinglocations\n                    )} polling locations reporting (${partyBallot.pollinglocations_reporting_percent.toFixed(\n                      1\n                    )}%)`}\n\n                    {/* <span class=\"source\">{` Source: ${ManualoverrideSource}`}</span> */}\n                  </p>\n                ))\n            }\n          </div>\n\n          <table class=\"race__candidates\">\n            {tableHeader}\n            <tbody>\n              {isShowcaseRace &&\n                candidates.map((candidate: any, idx: any) =>\n                  renderCandidate(\n                    candidate,\n                    idx,\n                    candidatesRender,\n                    viewAllCandidates,\n                    { totalVotes }\n                  )\n                )}\n\n              {!isShowcaseRace &&\n                candidates.map((candidate: any, idx: any) =>\n                  renderCandidate(candidate, idx, viewAllCandidates, {\n                    totalVotes,\n                  })\n                )}\n              {candidates.length > visibleCandidatesCount && (\n                <OtherCandidate\n                  isViewable={!viewAllCandidates}\n                  candidateCount={candidates.length}\n                  embedType={embedType}\n                  onClick={() => {\n                    this.onViewableToggle();\n                  }}\n                  showDelegates={showDelegates}\n                />\n              )}\n            </tbody>\n\n            {candidates.length > visibleCandidatesCount && viewAllCandidates && (\n              <tr class=\"candidate race__candidate-row\">\n                <td\n                  class=\"candidate__cell candidate__party t-align-center\"\n                  onClick={() => {\n                    this.onViewableToggle();\n                  }}\n                >\n                  <svg class=\"icon icon-angle-up\">\n                    <use xlinkHref=\"#icon-angle-up\" />\n                  </svg>\n                </td>\n                <th class=\"candidate__cell candidate__name\">\n                  <button\n                    class={embedType}\n                    onClick={() => {\n                      this.onViewableToggle();\n                    }}\n                  >\n                    Show fewer ({visibleCandidatesCount})\n                  </button>\n                </th>\n                <th class=\"candidate__cell candidate__votes\"> </th>\n                <th class=\"candidate__cell candidate__pct\"></th>\n                {showDelegates && (\n                  <td class=\"candidate__cell candidate__votes\"></td>\n                )}\n              </tr>\n            )}\n          </table>\n\n          {IsNoted == true && (\n            <p class=\"note__text\">{converter.convert(notes[0].value)}</p>\n          )}\n          {IsAnnotations == true && (\n            <div class=\"anno-text notes-annotations\">\n              <span class=\"is-sr-only\">Note:</span>\n              <svg class=\"icon note-icon anno-div\" aria-hidden=\"true\">\n                <use xlinkHref=\"#note-icon\" />\n              </svg>\n\n              <p class=\"annotations t-links-underlined\">\n                <span class=\"font-weight-bold\">Noteworthy: </span>\n                {converter.convert(annotations[0].value)}\n              </p>\n            </div>\n          )}\n          <div class=\"below-races\">\n            <div class=\"source\">{` Source: ${source}`}</div>\n\n            {(isHomepage || embedType == 'internal') && (\n              <div class=\"countdown\">\n                <span class=\"counter-homepage\">LAST UPDATED {asOf}</span>\n              </div>\n            )}\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n\nSeatPartyDivider.defaultProps = {\n  isShowcaseRace: false,\n  isHomepage: false,\n};\n\nexport default SeatPartyDivider;\n","/**\n * Sums up values of a property across objects in an array.\n *\n * @param {Array} arr An array of objects.\n * @param {String} key The property to sum across objects.\n * @return {Number}\n */\nexport default function sumValues(arr, key) {\n  return arr.reduce((acc, obj) => acc + obj[key], 0);\n}\n","const hOP = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x: any, y: any): boolean {\n  // SameValue algorithm\n  if (x === y) {\n    // Steps 1-5, 7-10\n    // Steps 6.b-6.e: +0 != -0\n    // Added the nonzero y check to make Flow happy, but it is redundant\n    return x !== 0 || y !== 0 || 1 / x === 1 / y;\n  }\n  // Step 6.a: NaN == NaN\n  return x !== x && y !== y;\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA: object, objB: object): boolean {\n  if (is(objA, objB)) {\n    return true;\n  }\n\n  if (\n    typeof objA !== 'object' ||\n    objA === null ||\n    typeof objB !== 'object' ||\n    objB === null\n  ) {\n    return false;\n  }\n\n  const keysA = Object.keys(objA);\n  const keysB = Object.keys(objB);\n\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n\n  // Test for A's keys different from B.\n  for (let i = 0; i < keysA.length; i++) {\n    if (!hOP.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nexport default shallowEqual;\n","// packages\nimport { Component } from 'preact';\n\n// internal\nimport shallowEqual from '../utils/shallow-equal';\n\nabstract class PureComponent<P = {}, S = {}> extends Component<P, S> {\n  shouldComponentUpdate(props, state) {\n    const check =\n      shallowEqual(props, this.props) && shallowEqual(state, this.state);\n    // if (props.projection)\n    //   console.log(\n    //     'projection check:',\n    //     props.projection === this.props.projection,\n    //     !check\n    //   );\n    return !check;\n  }\n}\n\nexport default PureComponent;\n","function _extends() {\n  return _extends = Object.assign ? Object.assign.bind() : function (n) {\n    for (var e = 1; e < arguments.length; e++) {\n      var t = arguments[e];\n      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n    }\n    return n;\n  }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","/**\n * A for-loop version of Array.prototype.find so IE and friends can play.\n *\n * @private\n * @param  {Array} arr\n * @param  {Function} predicate\n * @return {*|undefined}\n * @throws {TypeError} Argument predicate must be a function\n */\nexport default function find(\n  arr: Array<any>,\n  predicate: Function\n): any | undefined {\n  if (typeof predicate !== 'function') {\n    throw new TypeError('predicate must be a function');\n  }\n\n  for (let i = 0; i < arr.length; i++) {\n    if (predicate(arr[i], i, arr)) {\n      return arr[i];\n    }\n  }\n\n  return undefined;\n}\n","// packages\nimport cx from 'classnames';\nimport { capfirst } from 'journalize';\nimport memoize from 'lodash/memoize';\nimport { h } from 'preact';\n\ntype Props = {\n  excludeInitial?: boolean;\n  party: string;\n  style: string;\n};\n\nfunction PartyPill({ excludeInitial, party, style }: Props) {\n  const partyPrefix = party.slice(0, 3).toLowerCase();\n  const partyInitial = party[0].toUpperCase();\n\n  const classes = cx('circle-pill', `pill--${partyPrefix}`);\n\n  return (\n    <span class={classes} style={style} title={capfirst(party)}>\n      {!excludeInitial && partyInitial}\n    </span>\n  );\n}\n\nPartyPill.defaultProps = {\n  excludeInitial: false,\n};\n\nexport default memoize(PartyPill, ({ party, style }) => ({\n  party: party,\n  style: style,\n}));\n"],"sourceRoot":""}