!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f860a07d-8550-4d23-b337-593b944c3d03",e._sentryDebugIdIdentifier="sentry-dbid-f860a07d-8550-4d23-b337-593b944c3d03")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[612],{50612:(e,t,r)=>{r.r(t),r.d(t,{default:()=>M});var a=r(6029),s=r(76356),n=r(55729),l=r(48683),o=r(23727),i=r(75751),d=r(13266),c=r(21377),u=r(4967),p=r(37071),f=r(21501),m=r(28446),x=r(85685);let y="js-transfers-duration-graph-id",h="js-transfer-fees-graph-id";var v=r(93338),g=r(95342);r(14632);var j=r(98516);function w(e,t){let r=0;for(let a=0;a<=t;a++)r+=e[a].duration;return r}let b=(e,t,r,a,s,n)=>{if(e===a.length-1&&!s&&n){let e=0;for(let r=0;r{t+="".concat(e.x,",").concat(e.y," ")}),t}let S=e=>{let{playerTransfers:t,biggestMoney:r,height:a}=e,s=(null==r?void 0:r.value)||0,n=[...t],l=[],o=n[n.length-1].type===c.uDD.EndOfCareer?n.length:n.length-1;for(let e=0;e{if(t===e.length-1)return!1;let r=e[t+1],a=w(e,t);return a+r.duration-a>20},T=(0,s.I4)("svg",{base:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",transform:{_ltr:"scale(1, -1)",_rtl:"scale(-1, -1)"},overflow:"visible"}});function I(e){let{sport:t,playerId:r,transfers:l,highestTransfer:o,proposedMarketValueRaw:i}=e,d=(0,n.useRef)(null),[I,D]=(0,n.useState)(0),L=((null==o?void 0:o.value)||0)<((null==i?void 0:i.value)||0)?i:o,A=e=>{let a=function(e,t){let r=Date.now(),a=t.map(t=>{let a=1e3*t.transferDateTimestamp;return a>r&&(r=a),{timestamp:a,teamId:t.transferFrom?t.transferFrom.id:0,transferFeeRaw:t.transferFeeRaw,type:t.type,playerId:e}});return t[0].type!==c.uDD.EndOfCareer&&a.push({timestamp:r,teamId:t[0].transferTo?t[0].transferTo.id:0,transferFeeRaw:t[0].transferFeeRaw,type:t[0].type,playerId:e}),a.sort((e,t)=>e.timestamp-t.timestamp)}(r,l),s=(0,m.A)();s.range([0,e]),s.domain([a[0].timestamp,a[a.length-1].timestamp]);let n=a.length>2&&s(a[a.length-1].timestamp)-s(a[a.length-2].timestamp)>24,o=(0,u.ND)(l[0].transferDateTimestamp),d=a.map((t,r,a)=>({timestamp:t.timestamp,duration:b(r,s,e,a,n,o),teamId:t.teamId,transferFeeRaw:t.transferFeeRaw,type:t.type,playerId:t.playerId,index:r}));o&&!n&&(s.range([0,e-24]),d.forEach((t,r)=>{d[r].duration=b(r,s,e,d,n,o)})),function(e){let t=(0,g.A)("#".concat(y)),r=e.playerTransfers,a=t.selectAll("div").data(r,(e,t)=>e?"".concat(e.playerId,"-").concat(t):"".concat(t));a.selectAll("img").remove(),a.exit().remove();let s="rtl"===document.dir;a.enter().append("div").merge(a).style("position","relative").style("display","inline-block").style("padding-top","8px").style("height","".concat(144,"px")).style("text-align","center").style("width",e=>"".concat((0,j.M)(e.duration,2),"px")).append("img").attr("src",e=>c.cWY.image(e.teamId)).attr("onerror",'this.src="/static/images/placeholders/team.svg"').style("margin-bottom","16px").style("display",e=>e.duration>=24?"initial":"none").style("min-width","".concat(24,"px")).style("height","".concat(24,"px"));let n=t.selectAll("span").data(r);n.exit().remove(),n.enter().append("span").merge(n).text(e=>"'".concat(new Date(e.timestamp).getFullYear().toString().slice(-2))).style("position","absolute").style("bottom","-".concat(30,"px")).style("padding-bottom","8px").style("left",(e,t)=>s?"auto":"".concat(w(r,t),"px")).style("right",(e,t)=>s?"".concat(w(r,t),"px"):"auto").style("font-size","12px").style("color",v.S.var("colors.neutrals.nLv3")).style("transform","translateX(".concat("rtl"===document.dir?50:-50,"%)")).style("display",(e,t)=>E(r,t)?"block":"none")}({sport:t,playerTransfers:d}),!function(e,t,r,a){let s=[...r,{x:e,y:r[r.length-1].y}],n=(0,g.A)("#".concat(h)),l=n.append("defs").append("linearGradient").attr("id","gradient").attr("gradientTransform","rotate(90)");l.append("stop").attr("offset","0").attr("stop-color","rgba(20, 172, 35, 0)"),l.append("stop").attr("offset","1").attr("stop-color","rgba(20, 172, 35, 0.1)");let o={y:(0,j.M)(96),color:v.S.var("colors.neutrals.nLv4"),stroke:"0"},i={y:(0,j.M)(a||0),color:v.S.var("colors.status.val"),stroke:"3.3"},d=[{y:(0,j.M)(64),color:v.S.var("colors.neutrals.nLv4"),stroke:"0"},{y:(0,j.M)(t/3),color:v.S.var("colors.neutrals.nLv4"),stroke:"0"},{y:0,color:v.S.var("colors.neutrals.nLv4"),stroke:"0"}];i.y===o.y?d.push(i):i.y?(d.push(o),d.push(i)):d.push(o);let c=n.selectAll("line").data(d);c.exit().remove(),c.enter().append("line").merge(c).attr("x1",-16).attr("y1",e=>e.y).attr("x2",e+16).attr("y2",e=>e.y).attr("stroke",e=>e.color).attr("stroke-dasharray",e=>e.stroke).attr("shape-rendering","crispEdges");let u=n.selectAll("polyline").data([s]);u.exit().remove(),u.enter().append("polyline").merge(u).attr("points",k(s.map(e=>({x:e.x,y:0})))).transition().duration(300).attr("points",k(s)).attr("fill","none").attr("stroke",v.S.var("colors.secondary.default")).attr("stroke-width",3).attr("stroke-linecap","round").attr("stroke-linejoin","round");let p=[...s,{x:e,y:0}],f=n.selectAll("polygon").data(p);f.exit().remove(),f.enter().append("polygon").merge(f).attr("points",k(p.map(e=>({x:e.x,y:0})))).transition().duration(300).attr("points",k(p)).attr("fill","url(#gradient)");let m=n.selectAll("circle.year").data(r.filter(e=>e.y>4));m.exit().remove(),m.enter().append("circle").classed("year",!0).merge(m).attr("cx",e=>e.x).attr("r",3).attr("stroke",v.S.var("colors.neutrals.nLv3")).attr("stroke-width",2).attr("fill",v.S.var("colors.surface.s1")).attr("cy",0).attr("opacity",0).transition().delay(300).duration(300).attr("opacity",1);let x=n.selectAll("circle.point").data(r);x.exit().remove(),x.enter().append("circle").classed("point",!0).merge(x).attr("cx",e=>e.x).attr("r",3).attr("fill",v.S.var("colors.surface.s1")).attr("stroke",v.S.var("colors.secondary.default")).attr("stroke-width",2).attr("cy",e=>e.y).attr("opacity",0).transition().delay(300).duration(300).attr("opacity",1)}(e,96,S({playerTransfers:d,biggestMoney:L,height:96}),i&&L?i.value/L.value*96:null)},F=()=>{var e;let t=null==d||null==(e=d.current)?void 0:e.getBoundingClientRect().width;t&&A(t)};return(0,n.useEffect)(()=>{F()},[r,I]),(0,f.st)(()=>{var e;let t=null==d||null==(e=d.current)?void 0:e.getBoundingClientRect().width;t&&t!==I&&D(t)},200),(0,a.jsxs)(s.az,{position:"relative",br:"lg",bg:"surface.s2",m:"sm",style:{paddingBottom:30,paddingInlineStart:24,paddingInlineEnd:(null==L?void 0:L.value)?80:24},children:[(0,a.jsxs)(s.az,{ref:d,position:"relative",children:[(0,a.jsx)(s.so,{id:y}),(0,a.jsx)(T,{id:h})]}),!!(null==L?void 0:L.value)&&(0,a.jsxs)(s.so,{style:{height:112,width:80,bottom:30},position:"absolute",right:"0",direction:"column",justify:"space-between",align:"flex-end",pr:"sm",children:[(0,a.jsx)(p.EY,{translate:"auto",translateY:"1/2",textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,a.jsx)(x.o,{parsedMoney:(0,c.oaz)(L)})}),(0,a.jsx)(p.EY,{translate:"auto",translateY:"1/2",textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,a.jsx)(x.o,{parsedMoney:(0,c.oaz)({...L,value:2*L.value/3})})}),(0,a.jsx)(p.EY,{translate:"auto",translateY:"1/2",textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,a.jsx)(x.o,{parsedMoney:(0,c.oaz)({...L,value:Math.round(L.value/3)})})}),(0,a.jsx)(p.EY,{translate:"auto",translateY:"1/2",textStyle:"assistive.default",color:"[transparent]",children:"0"})]})]})}var D=r(90248);function L(e){let{proposedMarketValueRaw:t,highestTransfer:r}=e;return(0,a.jsxs)(s.az,{pt:"xl",children:[(0,a.jsxs)(s.so,{align:"center",h:"2xl",justify:"space-between",px:"lg",children:[(0,a.jsxs)(s.so,{align:"center",children:[(0,a.jsx)(s.az,{h:"xs",w:"[11px]",bg:"status.val",mr:"2xs"}),(0,a.jsx)(s.az,{h:"xs",w:"[11px]",bg:"status.val",mr:"sm"}),(0,a.jsx)(p.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,a.jsx)(D.A,{id:"market_value"})})]}),!!(null==t?void 0:t.value)&&(0,a.jsx)(p.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,a.jsx)(x.o,{parsedMoney:(0,c.oaz)(t)})})]}),(0,a.jsxs)(s.so,{align:"center",h:"2xl",justify:"space-between",px:"lg",children:[(0,a.jsxs)(s.so,{align:"center",children:[(0,a.jsx)(s.az,{h:"xs",w:"xl",bg:"secondary.default",mr:"sm"}),(0,a.jsx)(p.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,a.jsx)(D.A,{id:"transfer_fee"})})]}),!!(null==r?void 0:r.value)&&(0,a.jsxs)(p.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:[(0,a.jsx)(D.A,{id:"highestHint"})," ",(0,a.jsx)(x.o,{parsedMoney:(0,c.oaz)(r)})]})]})]})}var A=r(33144),F=r(90510),z=r(24159),R=r(82967);let Y=(0,n.memo)(e=>{let{teamLinks:t,index:r,transfers:n,Link:l}=e,o=n[r],i=o.transferTo?o.transferTo.id:null,d=o.transferTo?(0,a.jsx)(z.c,{entity:o.transferTo}):o.toTeamName,f=o.transferFrom?(0,a.jsx)(z.c,{entity:o.transferFrom}):o.fromTeamName;return(0,a.jsx)(l,{children:(0,a.jsxs)(s.so,{h:"5xl",pl:"lg",align:"center",bg:{_hover:"surface.s2"},children:[(0,a.jsx)(A.p,{id:i||-1,size:40,name:d}),(0,a.jsxs)(s.so,{grow:1,borderBottom:r===t.length-1?void 0:"1px solid {colors.neutrals.nLv4}",h:"100%",align:"center",justify:"space-between",ml:"lg",pr:"lg",children:[(0,a.jsxs)(s.az,{children:[(0,a.jsx)(p.EY,{mb:"xs",display:"block",children:d}),(0,a.jsxs)(p.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",display:"block",children:[(0,a.jsx)(F.XU,{value:1e3*o.transferDateTimestamp,...u.or.dateWithShortMonth})," ",r===n.length-1&&f&&o.type!==c.uDD.Draft&&(0,a.jsx)(D.A,{id:"player.from",values:{fromTeam:f}}),o.round&&o.pick&&(0,a.jsx)(D.A,{id:"player.draftInfo",values:{round:o.round,pick:o.pick}})]})]}),(0,a.jsxs)(s.az,{children:[(0,a.jsx)(p.EY,{color:"secondary.default",mb:"xs",textAlign:"end",display:"block",children:o.transferFeeDescription}),o.type!==c.uDD.Transfer&&(0,a.jsx)(p.EY,{textStyle:"body.small",color:"secondary.default",textAlign:"end",display:"block",children:(0,a.jsx)(R.u,{transfer:o})})]})]})]})})},function(e,t){let r=e.index===t.index,a=e.playerId===t.playerId,s=e.teamLinks.length===t.teamLinks.length;return r&&a&&s}),M=e=>{let{playerId:t,transfers:r,sport:c,proposedMarketValueRaw:u}=e,[p,f]=(0,n.useState)(!1),m=(0,n.useMemo)(()=>(r||[]).map(e=>e.transferTo&&e.transferTo.id&&!e.transferTo.disabled?t=>(0,a.jsx)(d.gT,{team:e.transferTo,sport:c,...t}):e=>(0,a.jsx)(s.az,{...e,children:e.children})),[r,c]),x=(0,n.useMemo)(()=>{let e=(r||[]).filter(e=>!!e.transferFeeRaw&&!isNaN(e.transferFeeRaw.value));return e.length?e.sort((e,t)=>t.transferFeeRaw.value-e.transferFeeRaw.value)[0].transferFeeRaw:{value:0,currency:"",description:"-"}},[r]),y=m.length>5,h=p?m:m.slice(0,5);return((0,n.useEffect)(()=>{f(!1)},[t]),null==r?void 0:r.length)?(0,a.jsx)(i.t,{tag:"transfers",children:(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)(l.Zp.Header,{titleId:"transfer_history"}),(0,a.jsxs)(s.so,{direction:{base:"column",md:"row"},children:[(0,a.jsxs)(s.az,{w:{base:"100%",md:"1/2"},children:[(0,a.jsx)(I,{sport:c,playerId:t,transfers:r,highestTransfer:x,proposedMarketValueRaw:u}),(0,a.jsx)(L,{highestTransfer:x,proposedMarketValueRaw:u})]}),(0,a.jsxs)(s.az,{w:{base:"100%",md:"1/2"},mdDown:{mt:"sm",pt:"sm",borderTop:"1px solid",borderTopColor:"neutrals.nLv4"},children:[h.map((e,s)=>(0,a.jsx)(Y,{Link:e,index:s,teamLinks:h,playerId:t,transfers:r},"".concat(t,"-").concat(s))),(0,a.jsx)(l.Zp.Footer,{ctaParams:y?{messageId:p?"show_less":"show_more",icon:p?o.X.Up:o.X.Down,onClick:()=>f(e=>!e)}:void 0})]})]})]})}):null}},95342:(e,t,r)=>{r.d(t,{A:()=>n});var a=r(86352),s=r(59371);function n(e){return"string"==typeof e?new s.LN([document.querySelectorAll(e)],[document.documentElement]):new s.LN([(0,a.A)(e)],s.zr)}}}]);