1(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[5714],{1595:(e,t,l)=>{"use strict";l.d(t,{R:()=>n});var a=l(10467),o=l(18873),n=function(){var e=(0,a.A)((function*(){var e=new AbortController,t=yield(0,o.h)("https://static.aftonbladet-cdn.se/static/os/sportlist.json",{signal:e.signal});if(t.ok)return yield t.json()}));return function(){return e.apply(this,arguments)}}()},7218:e=>{e.exports={section:"sportathletecarousel-section_592f",root:"sportathletecarousel-root_592f",nextSlideShadow:"sportathletecarousel-nextSlideShadow_592f"}},31564:e=>{e.exports={root:"badge-root_e346",container:"badge-container_e346"}},34884:e=>{e.exports={container:"sportathleteoverview-container_f55f",widgetHeader:"sportathleteoverview-widgetHeader_f55f",selectContainer:"sportathleteoverview-selectContainer_f55f",listContainer:"sportathleteoverview-listContainer_f55f",noAthletes:"sportathleteoverview-noAthletes_f55f"}},37316:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>S});var a=l(96540),o=l(96744),n=l(34884),r=l.n(n),s=l(66207),i=l(49379),c=l(55870),d=l(56448),p=l(7218),h=l.n(p),m=l(46942),v=l.n(m),u=l(15435),g=l(89074),f=l.n(g),N=l(10467),b=l(77867),_=l(18873),I=e=>{var t,l;return null!==(t=e.nextEvent)&&void 0!==t&&t.date?(0,b.p6)(null===(l=e.nextEvent)||void 0===l?void 0:l.date).toLocaleString("sv-SE",{hour:"numeric",minute:"numeric"}):""},C=function(){var e=(0,N.A)((function*(e){var t=new AbortController,l="/hyper-api/v1/fetch-olympics-athlete-stats?q=".concat(e),a=yield(0,_.h)(l,{signal:t.signal});if(!a.ok){if(404===a.status)return;throw new Error("Error fetching , status ".concat(a.status))}return yield a.json()}));return function(t){return e.apply(this,arguments)}}(),Y=l(2445);const D=e=>{var t,l,o,n,r,i,c,d,p,h,m,g,N,_,D,k,F,S,y,A,{athlete:x,sports:w}=e,[L,R]=(0,a.useState)(void 0),[E,B]=(0,a.useState)(!1);return(0,Y.Y)("button",{className:f().athlete,onClick:()=>{return e=x.id,B(!E),void(e&&!E&&C(e).then((e=>{R(e)})).catch((()=>{})));var e},type:"button",children:(0,Y.Y)("div",{className:v()(f().card,{[f().flipped]:E}),children:(0,Y.FD)("div",{className:f().innerCard,children:[(0,Y.FD)("div",{className:f().front,children:[x.isCompeting&&(0,Y.FD)("div",{className:f().liveCompetition,children:[(0,Y.Y)(u.A,{name:"circle",size:"small",externalClassName:f().liveIcon}),(0,Y.Y)("p",{children:"LIVE"})]}),x.competesSoon&&!x.isCompeting&&(0,Y.FD)("div",{className:f().nextCompetition,children:[(0,Y.Y)(s.A,{title:"Senare idag",htmlTag:"div"}),(0,Y.FD)("p",{children:[(0,Y.FD)("span",{children:[I(x)," - "]}),null===(t=x.nextEvent)||void 0===t?void 0:t.phaseInfo]})]}),(0,Y.Y)("div",{className:f().flipIcon,children:(0,Y.Y)(u.A,{name:"flip-card",size:"medium"})}),(0,Y.FD)("div",{className:f().athleteImageAndCountry,children:[(0,Y.Y)("img",{src:"https://images.sports.gracenote.com/images/lib/basic/person/og2024/large/".concat(x.id,".jpg"),alt:"".concat(x.name)}),(0,Y.Y)("img",{src:"https://images.sports.gracenote.com/images/lib/basic/geo/country/flag/SVG/".concat(x.nocGeoId,".svg"),alt:"Country flag"})]}),(0,Y.FD)("div",{className:f().athleteFrontInformation,children:[(0,Y.FD)("div",{className:f().athleteFrontName,children:[x.firstName," ",x.lastName]}),(0,Y.Y)("div",{className:f().sportFlex,children:null===(l=x.sports)||void 0===l?void 0:l.map((e=>(0,Y.FD)("div",{className:f().athleteSport,children:[(0,Y.Y)("div",{className:f().sportIconWrapper,children:(0,Y.Y)("div",{className:f().sportIcon,style:{maskImage:"url(https://cdn.aftonbladet.se/olympics/pictograms/".concat(e.sportId,".svg)")}})}),(0,Y.Y)("p",{children:e.sport})]},e.sportId)))})]})]}),(0,Y.FD)("div",{className:f().back,children:[(0,Y.FD)("div",{className:f().athleteBackInformation,children:[(0,Y.FD)("div",{className:f().athleteDetails,children:[(0,Y.FD)("p",{children:[x.firstName," ",x.lastName]}),(0,Y.FD)("p",{children:[x.birthDate," (",(k=x.birthDate,F=(0,b.p6)(k),S=(0,b.p6)(),y=S.getFullYear()-F.getFullYear(),A=S.getMonth()-F.getMonth(),(A<0||0===A&&S.getDate()<F.getDate())&&y--,y)," år)"]})]}),(0,Y.Y)("div",{className:f().medalFlex,children:(0,Y.FD)("div",{className:f().athleteTotalMedalsContainer,children:[(0,Y.FD)("div",{className:f().athleteMedalsContainer,children:[(0,Y.Y)("span",{className:v()(f().medal,f().gold,!L&&f().loading),children:null==L?void 0:L.goldMedals}),(0,Y.Y)("span",{className:v()(f().medal,f().silver,!L&&f().loading),children:null==L?void 0:L.silverMedals}),(0,Y.Y)("span",{className:v()(f().medal,f().bronze,!L&&f().loading),children:null==L?void 0:L.bronzeMedals})]}),(0,Y.Y)("p",{children:"OS- & VM-medaljer"})]})})]}),(0,Y.FD)("div",{className:f().bestPlacingContainer,children:[(0,Y.Y)(s.A,{title:"Bästa placering",htmlTag:"div"}),null!=L&&null!==(o=L.bestRanking)&&void 0!==o&&o.rank?(0,Y.FD)("div",{className:f().championshipContainer,children:[(0,Y.Y)("div",{className:v()(f().medal,{[f().gold]:1===(null===(n=L.bestRanking)||void 0===n?void 0:n.rank),[f().silver]:2===(null===(r=L.bestRanking)||void 0===r?void 0:r.rank),[f().bronze]:3===(null===(i=L.bestRanking)||void 0===i?void 0:i.rank),[f().noPodium]:![1,2,3].includes(null===(c=L.bestRanking)||void 0===c?void 0:c.rank)}),children:null==L||null===(d=L.bestRanking)||void 0===d?void 0:d.rank}),(0,Y.FD)("div",{className:f().championship,children:[(0,Y.FD)("div",{children:[(0,Y.Y)("span",{children:"".concat(null==L||null===(p=L.bestRanking)||void 0===p?void 0:p.competitionName," ").concat(null==L||null===(h=L.bestRanking)||void 0===h?void 0:h.year)}),"Olympiska Spelen"===(null==L||null===(m=L.bestRanking)||void 0===m?void 0:m.competitionName)&&(0,Y.Y)("div",{className:f().backIcon,children:(0,Y.Y)("div",{className:f().sportIcon,style:{maskImage:"url(https://cdn.aftonbladet.se/olympics/pictograms/000.svg)"}})})]}),w&&(0,Y.FD)("div",{children:[(0,Y.Y)("span",{children:null!==(g=null===(N=w.find((e=>{var t;return e.sportId===(null==L||null===(t=L.bestRanking)||void 0===t?void 0:t.sportId)})))||void 0===N?void 0:N.sport)&&void 0!==g?g:null==L||null===(_=L.bestRanking)||void 0===_?void 0:_.sportName}),(0,Y.Y)("div",{className:f().backIcon,children:(0,Y.Y)("div",{className:f().sportIcon,style:{maskImage:"url(https://cdn.aftonbladet.se/olympics/pictograms/".concat(null==L||null===(D=L.bestRanking)||void 0===D?void 0:D.sportId,".svg)")}})})]})]})]}):"Ingen information om tidigare tävlingar."]})]})]})})},x.id)},k=e=>{var{items:t=[],slidesToScroll:l=1,sports:o=[]}=e,n=(0,a.useRef)(null),[r,s]=(0,a.useState)(!1),[i,p]=(0,a.useState)(!1),[m,v]=(0,a.useState)(!1),[u,g]=(0,a.useState)(!1),f=(0,c.fH)(),N=(0,a.useCallback)((e=>{var{current:t}=n;if(t&&!r){s(!0);var a=Array.from(t.children),o=t.scrollLeft,i=a.filter((e=>e.offsetLeft+e.clientWidth>o&&e.offsetLeft<o+t.clientWidth)),c=a.indexOf(i[0]),d=a[e?i[0].offsetLeft<o?c:Math.max(0,c-l):Math.min(a.length-1,c+l)],p=0,h=t.children[0];if(h){var m=window.getComputedStyle(h);p=parseInt(m.marginRight,10)}var v=d.offsetLeft-p;t.scrollTo({left:v,behavior:"smooth"}),setTimeout((()=>s(!1)),300)}}),[r,l]);return(0,a.useEffect)((()=>
1{if(f&&n.current){var{current:e}=n;e.scrollTo({left:0,behavior:"smooth"});var{scrollLeft:t,offsetWidth:l,scrollWidth:a}=e;v(t+l<a)}}),[f,t]),(0,a.useEffect)((()=>{if(r){var e=setTimeout((()=>s(!1)),300);return()=>clearTimeout(e)}}),[r,t]),(0,Y.FD)("section",{className:h().section,children:[i&&(0,Y.Y)(d.A,{scrollDirection:"left",onClick:()=>N(!0)}),(0,Y.Y)("div",{className:h().root,ref:n,onScroll:e=>{if(g(!0),f){var{scrollLeft:t,offsetWidth:l}=e.currentTarget;p(t>0);var a=Array.from(e.currentTarget.children),o=a[a.length-1],n=o.offsetLeft+o.clientWidth;v(n>t+l)}},children:t.map((e=>(0,Y.Y)(D,{athlete:e,sports:o},e.id)))}),!u&&(0,Y.Y)("div",{className:h().nextSlideShadow}),m&&(0,Y.Y)(d.A,{scrollDirection:"right",onClick:()=>N(!1)})]})};var F=l(1595);const S=e=>{var{athletes:t}=e,[l,n]=(0,a.useState)(),[c,d]=(0,a.useState)([]),p=(0,o.ic)({elementIdentifier:"sport-athelete-overview",elementName:"sport-athelete-overview",elementType:"widget"}),h=l?t.filter((e=>{var t;return null===(t=e.sports)||void 0===t?void 0:t.some((e=>e.sportId===l.sportId))})):t;return(0,a.useEffect)((()=>{(0,F.R)().then((e=>{d(null!=e?e:[])})).catch((()=>{}))}),[]),(0,Y.FD)("div",{className:r().container,ref:p,children:[(0,Y.FD)("div",{className:r().widgetHeader,children:[(0,Y.Y)(s.A,{title:"Sveriges OS-trupp",htmlTag:"h2"}),(0,Y.Y)("div",{className:r().selectContainer,children:(0,Y.Y)(i.A,{setSelectedSport:n,selectedSport:l,saveState:!1})})]}),(0,Y.Y)("div",{className:r().listContainer,children:0===h.length?(0,Y.Y)("p",{className:r().noAthletes,children:"Inga deltagare tillgängliga för vald sport."}):(0,Y.Y)(k,{items:h,sports:c})})]})}},49379:(e,t,l)=>{"use strict";l.d(t,{A:()=>d});var a=l(96540),o=l(59293),n=l(15435),r=l(50294),s=l.n(r),i=l(1595),c=l(2445);const d=e=>{var t,{selectedSport:l,setSelectedSport:r,saveState:d=!1}=e,p=(0,a.useRef)(null),[h,m]=(0,a.useState)(!1),[v,u]=(0,a.useState)([]);return(0,a.useEffect)((()=>{document.body.style.overflow=h?"hidden":"auto"}),[h]),(0,a.useEffect)((()=>{(0,i.R)().then((e=>{null==e||e.sort(((e,t)=>{var l;return null===(l=e.abName)||void 0===l?void 0:l.localeCompare(t.abName)})),u(null!=e?e:[])})).catch((()=>{}))}),[]),(0,c.FD)("div",{className:s().container,children:[(0,c.FD)("button",{ref:p,type:"button",onClick:()=>m(!h),className:s().button,children:[(0,c.FD)("span",{children:["Sport: ",null!==(t=null==l?void 0:l.abName)&&void 0!==t?t:"Alla"]}),(0,c.Y)(n.A,{name:"chevron-down"})]}),h&&(0,c.Y)(c.FK,{children:(0,c.Y)("div",{className:s().overlay,onClick:()=>{m(!1),p.current&&p.current.focus()},onKeyDown:e=>{"Escape"===e.key&&m(!1)},children:(0,c.FD)("div",{className:s().modal,children:[(0,c.FD)("div",{className:s().modalHeader,children:[(0,c.Y)("h3",{children:"Välj sport"}),(0,c.Y)("button",{type:"button",onClick:()=>m(!1),className:s().closeButton,"aria-label":"stäng",children:(0,c.Y)(n.A,{name:"close"})})]}),(0,c.Y)("div",{className:s().scrollWrapper,children:(0,c.FD)("div",{className:s().modalContent,children:[(0,c.FD)("button",{className:s().sportButton,type:"button",value:"",onClick:()=>{r(void 0),m(!1),d&&(0,o.Ai)("sportCalendarSelectedSport")},children:[(0,c.Y)("div",{className:s().sportIconWrapper,children:(0,c.Y)("div",{className:s().sportIcon,style:{maskImage:"url(https://cdn.aftonbladet.se/olympics/pictograms/000.svg)"}})}),"Alla sporter"]}),v.length>0&&v.map((e=>(0,c.FD)("button",{className:s().sportButton,type:"button",value:e.sportId,onClick:()=>{r(e),m(!1),d&&(0,o.SO)("sportCalendarSelectedSport",e)},children:[(0,c.Y)("div",{className:s().sportIconWrapper,children:(0,c.Y)("div",{className:s().sportIcon,style:{maskImage:"url(https://cdn.aftonbladet.se/olympics/pictograms/".concat(e.sportId,".svg)")}})}),e.abName]},e.sportId)))]})})]})})})]})}},50294:e=>{e.exports={button:"sportselect-button_9348",container:"sportselect-container_9348",overlay:"sportselect-overlay_9348",modal:"sportselect-modal_9348",modalHeader:"sportselect-modalHeader_9348",closeButton:"sportselect-closeButton_9348",scrollWrapper:"sportselect-scrollWrapper_9348",modalContent:"sportselect-modalContent_9348",sportButton:"sportselect-sportButton_9348",sportIconWrapper:"sportselect-sportIconWrapper_9348",sportIcon:"sportselect-sportIcon_9348"}},56448:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var a=l(46942),o=l.n(a),n=l(8102),r=l(98296),s=l.n(r),i=l(2445);const c=e=>{var{scrollDirection:t,onClick:l}=e;return(0,i.Y)("button",{type:"button",className:o()(s().scrollButton,s()[t]),onClick:l,children:(0,i.Y)(n.A,{name:"chevron-".concat(t)})})}},66207:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var a=l(31564),o=l.n(a),n=l(2445);const r=e=>{var{title:t,htmlTag:l="div"}=e,a=l;return(0,n.Y)("div",{className:o().container,children:(0,n.Y)(a,{className:o().root,children:t})})}},89074:e=>{e.exports={athlete:"sportathlete-athlete_cd2d",athleteImageAndCountry:"sportathlete-athleteImageAndCountry_cd2d",athleteFrontInformation:"sportathlete-athleteFrontInformation_cd2d",athleteFrontName:"sportathlete-athleteFrontName_cd2d",sportFlex:"sportathlete-sportFlex_cd2d",athleteSport:"sportathlete-athleteSport_cd2d",sportIconWrapper:"sportathlete-sportIconWrapper_cd2d",sportIcon:"sportathlete-sportIcon_cd2d",athleteBackInformation:"sportathlete-athleteBackInformation_cd2d",athleteDetails:"sportathlete-athleteDetails_cd2d",medalFlex:"sportathlete-medalFlex_cd2d",athleteTotalMedalsContainer:"sportathlete-athleteTotalMedalsContainer_
1cd2d",athleteMedalsContainer:"sportathlete-athleteMedalsContainer_cd2d",medal:"sportathlete-medal_cd2d",gold:"sportathlete-gold_cd2d",loading:"sportathlete-loading_cd2d",goldLoading:"sportathlete-goldLoading_cd2d",silver:"sportathlete-silver_cd2d",silverLoading:"sportathlete-silverLoading_cd2d",bronze:"sportathlete-bronze_cd2d",bronzeLoading:"sportathlete-bronzeLoading_cd2d",noPodium:"sportathlete-noPodium_cd2d",card:"sportathlete-card_cd2d",flipped:"sportathlete-flipped_cd2d",innerCard:"sportathlete-innerCard_cd2d",back:"sportathlete-back_cd2d",front:"sportathlete-front_cd2d",bestPlacingContainer:"sportathlete-bestPlacingContainer_cd2d",championshipContainer:"sportathlete-championshipContainer_cd2d",championship:"sportathlete-championship_cd2d",backIcon:"sportathlete-backIcon_cd2d",flipIcon:"sportathlete-flipIcon_cd2d",nextCompetition:"sportathlete-nextCompetition_cd2d",liveCompetition:"sportathlete-liveCompetition_cd2d",liveIcon:"sportathlete-liveIcon_cd2d"}},98296:e=>{e.exports={scrollButton:"scrollbutton-scrollButton_5c3e",left:"scrollbutton-left_5c3e",right:"scrollbutton-right_5c3e"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.