$(document).ready(function(){var t,e="#c3b8b4",a=["en","it","de","fr"],r=!1,n=!1,i=!1,l=1,o=3,s=4,c=5,d=3,p=7,u=-1,f=-1,x=null,y=null,h=null,m=null,g=null,v=null,b=null,w=null,k=null,A=!1,z=-1,M="https://ecdc.europa.eu/",L="https://www.efsa.europa.eu",S=45,E=22,R=45,P=24,T=58,N=335,O=220,F=29,I=200,C=30,G=950,j=940,B=220,U=120,q=320,W=400,X=10,D=E,V=15,H=T,Q="#333",Y="#95b863",J="#008192",K="#e8ebed",Z=K,tt=2*Math.PI,et=.52,at=22,rt=null,nt=null,it=null,lt=null,ot=0,st=0,ct="",dt="",pt=0,ut=0,ft="All antimicrobials",xt="All countries",yt="DATA NOT REPORTED",ht={en:1,it:1,fr:6,de:2},mt=["E","S","W","N"],gt=["EASTERN EUROPE","SOUTHERN EUROPE","WESTERN EUROPE","NORTHERN EUROPE"],vt={E:0,S:0,W:0,N:0},bt=0,wt=0,_t=navigator.userAgent.indexOf("hrome")>1,kt=!1;if(_t){var At=navigator.userAgent.indexOf("hrome")+6,zt=navigator.userAgent.indexOf(".",At);Number(navigator.userAgent.substring(At,zt))<53&&(kt=!0)}var Mt,Lt,St,Et=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Rt=navigator.userAgent.indexOf("Trident")>0,Pt=$(window).outerWidth()<700,Tt=null,Nt=[],Ot=-1,Ft=1,It=1,Ct=0,$t=It,Gt=null,jt=null,Bt=null,Ut=null,qt=function(t){return t<-1?e:t<.1?"#9bcbcb":t<1?"#f09800":t<10?"#ffce3b":t<20?"#246899":t<50?"#86488b":t<70?"#ea5d91":"#85746c"},Wt=function(t){return"#ffffff"};function Xt(t,e){var a=$t===It?"https://www.efsa.europa.eu/sites/default/files/interactive_tools/dataviz_2018/data/data-countries.json":"https://www.efsa.europa.eu/sites/default/files/interactive_tools/dataviz_2018/data/data-bacteria.json";$.ajax({url:a,dataType:"json",method:"GET",success:function(a){nt=a.antimicrobials,rt=a.countries,it=a.bacteria,lt=a.species,Tt=a.data,t&&function(){var t,e=(x=d3.select("#bacteria-div")).append("defs");De()||((t=e.append("filter").attr("id","filterGlass")).append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",12).attr("color-interpolation-filters","sRGB").attr("result","blur"),t.append("feColorMatrix").attr("in","blur").attr("mode","matrix").attr("values","1 0 0 0 0 0 1 0 0.05 0 0 0 1 0.1 0 0 0 0 18 -7").attr("result","gooey"),(t=e.append("filter").attr("id","filterS2")).append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",8).attr("color-interpolation-filters","sRGB").attr("result","blur").attr("id","blurf"),t.append("feColorMatrix").attr("in","blur").attr("mode","matrix").attr("values",re(20)).attr("result","gooey"));e.append("clipPath").attr("id","clipper").append("circle").attr("cx",G/2).attr("cy",j/2).attr("r",B-X),e.append("clipPath").attr("id","clipper2").append("circle").attr("cx",G/2).attr("cy",j/2).attr("r",U+5),e.append("clipPath").attr("id","clipper3").append("circle").attr("cx",G/2).attr("cy",j/2).attr("r",165),e.append("clipPath").attr("id","clipper4").append("rect").attr("x",175).attr("y",330).attr("width",600).attr("height",437)}(),bt=0,wt=Tt.length,t&&(ot=_.size(nt)-1),he(!1),t&&function(t){(function(){x.append("circle").attr("id","nations-line").attr("r",0).attr("fill",Z).attr("cx",G/2).attr("cy",j/2),x.append("circle").attr("id","central-border").attr("fill","#00b18b").attr("cx",G/2).attr("cy",j/2).attr("r",0),x.append("circle").attr("class","comparison-circle-guide").attr("fill","transparent").attr("stroke","#f0f0f0").attr("stroke-width",26).attr("cx",G/2).attr("cy",j/2).attr("r",N-11).attr("opacity",0),x.append("circle").attr("class","comparison-circle-guide").attr("fill","transparent").attr("stroke","#e6e6e6").attr("stroke-width",10).attr("cx",G/2).attr("cy",j/2).attr("r",N-11).attr("opacity",0),x.append("circle").attr("class","comparison-circle-guide").attr("fill","transparent").attr("stroke","#f0f0f0").attr("stroke-width",26).attr("cx",G/2).attr("cy",j/2).attr("r",O).attr("opacity",0),x.append("circle").attr("class","comparison-circle-guide").attr("fill","transparent").attr("stroke","#e6e6e6").attr("stroke-width",10).attr("cx",G/2).attr("cy",j/2).attr("r",O).attr("opacity",0),x.append("path").attr("id","comparison-circle-guide-text-1").attr("class","comparison-circle-guide").attr("d","M"+(G/2-85)+" "+(j/2-N+20)+" C "+(G/2-30)+" "+(j/2-N+5)+", "+(G/2+30)+" "+(j/2-N+5)+", "+(G/2+85)+" "+(j/2-N+20)).attr("fill","transparent"),x.append("text").attr("class","comparison-circle-guide").attr("text-anchor","middle").attr("fill",J).attr("font-size","15px").attr("font-weight","bold").attr("opacity",0).append("textPath").attr("id","comparison-circle-guide-text-1-text").attr("startOffset","50%").attr("xlink:href","#comparison-circle-guide-text-1"),x.append("path").attr("id","comparison-circle-guide-text-2").attr("class","comparison-circle-guide").attr("d","M"+(G/2-90)+" "+(j/2-O+15)+" C "+(G/2-60)+" "+(j/2-O-5)+", "+(G/2+60)+" "+(j/2-O-5)+", "+(G/2+90)+" "+(j/2-O+15)).attr("fill","transparent"),x.append("text").attr("class","comparison-circle-guide").attr("text-anchor","middle").attr("fill",J).attr("font-size","15px").attr("font-weight","bold").attr("opacity",0).append("textPath").attr("id","comparison-circle-guide-text-2-text").attr("startOffset","50%").attr("xlink:href","#comparison-circle-guide-text-2");for(var t=0;t<15;t++)x.append("line").attr("class","comparison-circle-guide comparison-circle-guide-line").attr("stroke",Y).attr("stroke-dasharray","5,8").attr("stroke-width",2)})(),function(t,e,a){var r=[{x:0,y:0,color:"transparent"}],n=[];_.each(r,function(e,a){for(var r=2;r--;)_.each(t,function(t,r){n.push({ox:e.x,oy:e.y,x:e.x+40*Math.random(),y:e.y+40*Math.random(),color:e.color,p:a,value:t.value,name:t.name,code:t.code})})}),_.each(n,function(t,r){t.ox+=e/2,t.oy+=a/2,t.x+=e/2,t.y+=a/2}),r=n,x.append("g").attr("id","internal-area").append("circle").attr("class","glass-int").attr("cx",e/2).attr("cy",a/2).attr("r",B).attr("fill",J).attr("stroke","#00b18b").attr("stroke-width",X);var i=d3.select("#internal-area").html();v=x.append("g"),b=v.append("g").html(i).style("display","none");var l=d3.arc().innerRadius(U).outerRadius(U-20).startAngle(-.7).endAngle(.7);x.append("path").attr("id","switch-button-text-arc").attr("class","switch-button glass-int").attr("d",l).attr("fill","#00b18b").attr("transform","translate("+e/2+", "+(a/2-1)+")").attr("opacity",1).attr("cursor","pointer").on("mouseover",function(){d3.select(this).attr("fill","#f5f7f7"),d3.select("#switch-button-text").attr("fill","#00b18b")}).on("mouseout",function(){d3.select(this).attr("fill","#00b18b"),d3.select("#switch-button-text").attr("fill","#f5f7f7")}).on("click",function(){ae()}),x.append("text").attr("id","switch-button-text-container").attr("class","switch-button").attr("text-anchor","middle").attr("dy",15).attr("fill","#fff").attr("font-size",Ut.other_labels.switch_button[Qt]).attr("letter-spacing","1.5px").attr("font-weight","bold").attr("pointer-events","none").append("textPath").attr("id","switch-button-text").attr("startOffset","24.5%").attr("xlink:href","#switch-button-text-arc"),d3.selectAll(".switch-button").style("display","none"),l=d3.arc().innerRadius((O+N)/2).outerRadius((O+N)/2).startAngle(-.8).endAngle(.8),x.append("path").attr("id","data-not-available-message-arc").attr("class","data-not-available-message").attr("d",l).attr("fill","transparent").attr("transform","translate("+e/2+", "+(a/2-1)+")"),x.append("text").attr("id","data-not-available-message-container").attr("class","data-not-available-message").attr("text-anchor","middle").attr("dy",15).attr("fill",J).attr("font-size","28px").attr("letter-spacing","1.5px").attr("font-weight","bold").attr("pointer-events","none").append("textPath").attr("id","data-not-available-message-text").attr("startOffset","25%").attr("xlink:href","#data-not-available-message-arc").text(yt),d3.selectAll(".data-not-available-message").style("display","none"),De()||v.style("filter","url(#filterS2)");v.selectAll(".gooey").data(r).enter().append("circle").attr("class","gooey").attr("id",function(t,e){return"gooey-"+e}).attr("clip-path","url(#clipper)").style("cursor","pointer").attr("data-code",function(t,e){return t.code}).attr("cx",function(t,e){return r[e].x}).attr("cy",function(t,e){return r[e].y}).attr("r",function(t,e){return 0}).attr("fill",function(t,e){return t.color});var o=x.append("g").attr("id","menu-central").attr("opacity",0),s=null;if(Rt){var l=Be(e/2,a/2+U,20,-90,90);(s=o.append("path")).attr("d",l).attr("fill","#00b18b").attr("cursor","pointer")}else(s=o.append("circle")).attr("cx",e/2).attr("cy",a/2+U).attr("r",20).attr("fill","#00b18b").attr("cursor","pointer").attr("clip-path","url(#clipper2)");s.on("click",function(t){d3.event.stopPropagation(),Ne(3)}).on("mouseover",function(){d3.select(this).attr("fill","#fff"),o.selectAll("line").attr("stroke",J)}).on("mouseout",function(){d3.select(this).attr("fill","#00b18b"),o.selectAll("line").attr("stroke","#fff")}),o.append("line").attr("x1",e/2-7).attr("y1",a/2+U-11).attr("x2",e/2+7).attr("y2",a/2+U-11).attr("stroke","#fff").attr("stroke-width",3).attr("pointer-events","none"),o.append("line").attr("x1",e/2-7).attr("y1",a/2+U-6).attr("x2",e/2+7).attr("y2",a/2+U-6).attr("stroke","#fff").attr("stroke-width",3).attr("pointer-events","none"),o.append("line").attr("x1",e/2-7).attr("y1",a/2+U-1).attr("x2",e/2+7).attr("y2",a/2+U-1).attr("stroke","#fff").attr("stroke-width",3).attr("pointer-events","none"),x.append("text").attr("class","intro-text intro-title").attr("x",e/2).attr("y",a/2-140).text(Bt.home.title_line_1).attr("font-weight","400").attr("font-size",Ut.home.title[Qt]).attr("text-anchor","middle").attr("fill","#fff").attr("opacity","1").attr("pointer-events","none"),x.append("text").attr("class","intro-text intro-title").attr("x",e/2).attr("y",a/2-110).text(Bt.home.title_line_2).attr("font-weight","400").attr("font-size",Ut.home.title[Qt]).attr("text-anchor","middle").attr("fill","#fff").attr("opacity","1").attr("pointer-events","none");var c=[];c=Rt||Et?[Bt.home.text_part_1+Bt.home.text_part_2+Bt.home.text_part_3+Bt.home.text_part_4,Bt.home.text_part_5,Bt.home.text_part_6," ",Bt.home.text_part_7,Bt.home.text_part_8,Bt.home.text_part_9,Bt.home.text_part_10," ",Bt.home.text_part_11,Bt.home.text_part_12,Bt.home.text_part_13]:[Bt.home.text_part_1+""+Bt.home.text_part_2+" "+Bt.home.text_part_3+""+Bt.home.text_part_4+"",Bt.home.text_part_5,Bt.home.text_part_6," ",Bt.home.text_part_7,Bt.home.text_part_8,Bt.home.text_part_9,Bt.home.text_part_10," ",Bt.home.text_part_11,Bt.home.text_part_12,Bt.home.text_part_13];_.each(c,function(t,r){Rt||Et?(t=(t=t.replace("","")).replace("",""),x.append("text").text(t).attr("dy",r+"em").attr("class","intro-text intro-text-content").attr("id","intro-text-"+r).attr("x",e/2).attr("y",a/2-70).attr("font-size",Ut.home.text[Qt]).attr("text-anchor","middle").attr("fill","#fff").attr("opacity","1").attr("pointer-events","none")):x.append("text").html(t).attr("dy",r+"em").attr("class","intro-text intro-text-content").attr("id","intro-text-"+r).attr("x",e/2).attr("y",a/2-70).attr("font-size",Ut.home.text[Qt]).attr("text-anchor","middle").attr("fill","#fff").attr("opacity","1").attr("pointer-events","none")}),x.append("rect").attr("id","starter").attr("x",e/2-90).attr("width",180).attr("y",a/2+125).attr("height",53).attr("fill","#e6e6e6").attr("rx",8).attr("ry",8).attr("cursor","pointer").on("mouseover",function(t){$(this).attr("fill","#f0f0f0")}).on("mouseout",function(t){$(this).attr("fill","#e0e0e0")}),x.append("text").attr("id","starter-text").attr("x",e/2).attr("y",a/2+159).attr("text-anchor","middle").attr("fill",J).text(Bt.home.start_button).attr("font-size","22px").attr("font-weight","700").attr("pointer-events","none");var l=d3.arc().innerRadius(B+140).outerRadius(B+150).startAngle(1).endAngle(5.28);x.append("path").attr("class","intro-element").attr("d",l).attr("fill","#e6e6e6").attr("transform","translate("+e/2+", "+(a/2-10)+")").attr("opacity",1),x.append("image").attr("class","intro-element").attr("xlink:href","https://www.efsa.europa.eu/sites/default/files/interactive_tools/dataviz_2018/img/ECDC_logo.png").attr("x",e/2+45).attr("y",a/2-B-180).attr("width","245px").attr("height","118px").attr("opacity",1).attr("cursor","pointer").on("mouseover",function(){d3.select(this).attr("opacity",.8)}).on("mouseout",function(){d3.select(this).attr("opacity",1)}).on("click",function(){window.open(M,"_blank")}),x.append("image").attr("class","intro-element").attr("xlink:href","https://www.efsa.europa.eu/sites/default/files/interactive_tools/dataviz_2018/img/logo efsa.png").attr("x",e/2-260).attr("y",a/2-B-180).attr("width","250px").attr("height","118px").attr("opacity",1).attr("cursor","pointer").on("mouseover",function(){d3.select(this).attr("opacity",.8)}).on("mouseout",function(){d3.select(this).attr("opacity",1)}).on("click",function(){window.open(L,"_blank")}),d3.select("#starter").on("click",function(){if(!A){window.activateBox&&window.activateBox(),d3.selectAll(".intro-text").attr("opacity",0),d3.selectAll(".intro-element").transition().duration(400).ease(d3.easeLinear).attr("opacity",0).on("end",function(){d3.select(this).remove()}),A=!0;var e=d3.select("#gooey-0");e.p=0,function(e,a){d3.selectAll(".column p").transition().duration(4e3).style("color","#e0e0e0");var r=e.p,n=0;_t?x.selectAll(".gooey").filter(function(t,e){return t.p!=r}).transition().duration(300).attr("r",0):(n=0,x.selectAll(".gooey").filter(function(t,e){return t.p!=r}).attr("r",0));d3.select("#nations-line").transition().delay(2e3).duration(5e3).attr("r",q),x.selectAll(".gooey").filter(function(t,e){return t.p==r}).attr("class","gooey gooey-nationed").attr("stroke","#fff").attr("stroke-width",0).attr("clip-path","none"),x.selectAll(".gooey").filter(function(t,e){return t.p!=r}).attr("class","gooey gooey-unnationed").attr("stroke","#fff").attr("stroke-width",0).attr("clip-path","none"),z=r,ge(n),d3.select("#central-border").transition().duration(1e3).attr("r",U+5),d3.selectAll(".glass-int").transition().duration(1e3).attr("stroke-width",0),window.setTimeout(function(){!function(){if(De())return;var t=20,e=setInterval(function(){d3.select("#filterS2 feColorMatrix").attr("values",re(t)),++t>100&&clearInterval(e)},10)}(),x.selectAll(".gooey").filter(function(t,e){return t.p!=r}).attr("r",0),function(){for(var e,a,r=me(et,q),n=_.size(r),i=0,l=0;l<2*n;l++)e=r[i].x,a=r[i].y,x.append("circle").attr("class","gooey-border").attr("stroke","#fff").attr("stroke-width",1.5).attr("fill","transparent").attr("opacity",0).attr("cx",e).attr("cy",a).style("pointer-events","none"),++i===n&&(i=0);Ie(),d3.select("#glass-ext").transition().duration(2e3).ease(d3.easeLinear).attr("opacity",0).attr("stroke",0),d3.selectAll(".circular-selector").transition().delay(1800).duration(1800).ease(d3.easeLinear).attr("r",at),d3.selectAll(".central-text").style("display","block").transition().delay(1800).duration(2e3).attr("opacity",1),d3.select("#glass-intra").transition().delay(1400).duration(1400).attr("r",W).attr("opacity",0),d3.selectAll("circle.glass-int").transition().delay(1400).duration(1400).ease(d3.easeLinear).attr("r",U),window.setTimeout(function(){d3.selectAll(".nation-text").attr("x",function(t,e){return r[e].x}).attr("y",function(t,e){var a=r[e].y+5;return d3.select(this).attr("oy",a),a}),d3.selectAll(".nation-text-perc").attr("opacity",0).attr("x",function(t,e){return r[e].x}).attr("y",function(t,e){return r[e].y+20}),d3.selectAll(".gooey-nationed").on("mouseover",function(e,a){if(!Ee()){if(d3.select("#N10shared").transition().delay(0).duration(0).attr("font-size","0"),"EU"===e.code)return Lt=a,void ke(me(et,q),a);if(Mt!==a){Lt=a;var r=Ae(me(et,q),Lt);Mt&&(r=Ae(r,Mt)),ke(r,a);var n=pe(t[a].value);if(n<-1){var i=+this.getAttribute("cx"),l=+this.getAttribute("cy")-3;d3.select("#N10shared").transition().delay(0).duration(0).attr("transform","translate("+i+","+l+")").attr("font-size","1px");var i=r[Lt].x,l=r[Lt].y-3;d3.select("#N10shared").transition().duration(250).attr("transform","translate("+i+","+l+")").attr("font-size","16px")}}}}).on("mouseout",function(t,e){if(d3.select("#N10shared").transition().delay(0).duration(0).attr("font-size","0"),Mt!==e){Lt=null;var a=me(et,q);Mt&&(a=Ae(a,Mt)),ke(a,e)}}).on("click",function(t,e){if(Ee())return!1;d3.select("#N10shared").transition().delay(0).duration(0).attr("font-size","0"),Me(),Re(),Ue(t,e,d3.select(this),e),window.setTimeout(Pe,600)}),w.style("display","block"),k.style("display","block"),window.setTimeout(function(){!function(){if(De())return;var t=100,e=setInterval(function(){d3.select("#filterS2 feColorMatrix").attr("values",re(t)),--t<7&&clearInterval(e)},30)}(),window.setTimeout(function(){d3.selectAll(".switch-button").style("display","block"),x.selectAll(".gooey-border").attr("opacity",1),d3.select("#menu-central").attr("opacity",1),d3.selectAll(".gooey-unnationed").remove(),w.attr("opacity",1),k.attr("opacity",1),le(),Ce(),b.style("display","block"),v.exit().remove(),d3.selectAll(".macronations-line").transition().duration(1e3).ease(d3.easeLinear).attr("opacity",1),d3.selectAll(".macronations-line-text").transition().duration(2e3).ease(d3.easeLinear).attr("opacity",1),d3.select("#blurf").transition().duration(300).ease(d3.easeLinear).attr("stdDeviation",3)},2e3)},1e3)},1e3)}()},1e3),window.setTimeout(function(){var t=me(et,q);ke(t,-1)},6e3)}(e),d3.select("#starter").remove(),d3.select("#starter-text").remove()}})}(t,G,j),function(){var t=x.append("g");w=t.append("g").attr("id","central-text-lines-top").attr("opacity",0).style("display","none"),k=t.append("g").attr("id","central-text-lines-bottom").attr("opacity",0).style("display","none"),w.append("line").attr("x1",G/2-.9*U).attr("y1",j/2-20).attr("x2",G/2+.9*U).attr("y2",j/2-20).attr("stroke","#fff").attr("stroke-width",1.5),w.append("circle").attr("cx",G/2).attr("cy",j/2-20).attr("r",4).attr("fill","#fff"),w.append("line").attr("class","central-text-lines-top-arrow-component").attr("x1",G/2-2).attr("y1",j/2-43).attr("x2",G/2+8).attr("y2",j/2-33).attr("stroke","#fff").attr("stroke-width","6px").attr("pointer-events","none"),w.append("line").attr("class","central-text-lines-top-arrow-component").attr("x1",G/2+2).attr("y1",j/2-43).attr("x2",G/2-8).attr("y2",j/2-33).attr("stroke","#fff").attr("stroke-width","6px").attr("pointer-events","none"),w.append("rect").attr("x",G/2-20).attr("y",j/2-70).attr("width",40).attr("height",40).attr("fill","transparent").attr("cursor","pointer").on("mouseover",function(){d3.selectAll(".central-text-lines-top-arrow-component").attr("stroke","#ddd")}).on("mouseout",function(){d3.selectAll(".central-text-lines-top-arrow-component").attr("stroke","#fff")}).on("click",function(t,e){ie(-1),ne(!0,Ot)}),k.append("line").attr("x1",G/2-.9*U).attr("y1",j/2+25).attr("x2",G/2+.9*U).attr("y2",j/2+25).attr("stroke","#fff").attr("stroke-width",1.5),k.append("circle").attr("cx",G/2).attr("cy",j/2+25).attr("r",4).attr("fill","#fff"),k.append("line").attr("class","central-text-lines-bottom-arrow-component").attr("x1",G/2-2).attr("y1",j/2+48).attr("x2",G/2+8).attr("y2",j/2+38).attr("stroke","#fff").attr("stroke-width","6px").attr("pointer-events","none"),k.append("line").attr("class","central-text-lines-bottom-arrow-component").attr("x1",G/2+2).attr("y1",j/2+48).attr("x2",G/2-8).attr("y2",j/2+38).attr("stroke","#fff").attr("stroke-width","6px").attr("pointer-events","none"),k.append("rect").attr("x",G/2-20).attr("y",j/2+35).attr("width",40).attr("height",40).attr("fill","transparent").attr("cursor","pointer").on("mouseover",function(){d3.selectAll(".central-text-lines-bottom-arrow-component").attr("stroke","#ddd")}).on("mouseout",function(){d3.selectAll(".central-text-lines-bottom-arrow-component").attr("stroke","#fff")}).on("click",function(t,e){ie(1),ne(!0,Ft)}),t.append("text").attr("class","central-text").attr("id","central-text").attr("x",G/2).attr("y",j/2+10).attr("text-anchor","middle").attr("font-size",Ut.other_labels.central_text[Qt]).text(Bt.generic.antimicrobials[nt[ot].trim()].capitalizeFirstLetter()).attr("opacity",0).attr("font-weight","400").attr("fill","#fff").attr("clip-path","url(#clipper2)").style("display","none"),t.append("text").attr("class","central-text").attr("id","central-text-pre").attr("x",G/2).attr("y",j/2-10).attr("text-anchor","middle").attr("font-size",Ut.other_labels.central_text[Qt]).text("").attr("opacity",0).attr("font-weight","400").attr("fill","#fff").attr("clip-path","url(#clipper2)").style("display","none"),t.append("text").attr("class","central-text").attr("id","central-text-post").attr("x",G/2).attr("y",j/2+30).attr("text-anchor","middle").attr("font-size",Ut.other_labels.central_text[Qt]).text("").attr("opacity",0).attr("font-weight","400").attr("fill","#fff").attr("clip-path","url(#clipper2)").style("display","none"),(m=v.append("g").attr("text-anchor","middle").attr("opacity",0)).append("circle").attr("id","central").attr("cx",G/2).attr("cy",j/2).attr("r",0).attr("fill",J).attr("stroke",Q).attr("stroke-width",0),x.append("circle").attr("id","central-dotted").attr("cx",G/2).attr("cy",j/2).attr("r",0).attr("fill","transparent").attr("stroke",Y).attr("stroke-dasharray","3,3").attr("stroke-width","4"),x.append("path").attr("id","central-dotted-arced").attr("fill","transparent").attr("stroke",Y).attr("stroke-dasharray","2,2").attr("stroke-width","10"),x.append("rect").attr("id","central-dotted-arced-mask").attr("x",G/2-120).attr("width",0).attr("y",j/2+55).attr("height",120).attr("fill",J).attr("opacity",0),x.append("rect").attr("id","comparison-top-mask").attr("x",G/2-180).attr("width",360).attr("y",j/2-2.2*U).attr("height",1.8*U).attr("fill",Y).attr("rx",110).attr("clip-path","url(#clipper3)").style("display","none"),(g=x.append("g")).attr("text-anchor","middle").attr("opacity",0).style("display","none").attr("id","central-group-text"),g.append("text").attr("id","central-text-1").attr("x",G/2).attr("y",j/2-(q-145)).attr("fill","white").attr("font-size",Ut.other_labels.central_area_name[Qt]).attr("font-weight","700").style("display","none"),g.append("text").attr("id","central-text-2").attr("x",G/2).attr("y",j/2-(q-175)).attr("fill","white").attr("font-size",Ut.other_labels.central_area_composite_text[Qt]).attr("font-weight","400").style("display","none"),g.append("text").attr("id","central-text-3").attr("x",G/2).attr("y",j/2-(q-195)).attr("fill","white").attr("font-size",Ut.other_labels.central_area_composite_text[Qt]).attr("font-weight","400").style("display","none"),g.append("text").attr("id","central-text-4").attr("x",G/2).attr("y",j/2-40).attr("fill","white").attr("font-size","18px").style("display","none"),g.append("text").attr("id","central-text-4b").attr("x",G/2).attr("y",j/2-15).attr("fill","white").attr("font-size","18px"),g.append("text").attr("id","central-text-4c").attr("x",G/2).attr("y",j/2+10).attr("fill","white").attr("font-size","18px"),g.append("text").attr("id","central-text-6").attr("x",G/2).attr("y",j/2+110).attr("fill","white").attr("font-size","24px").attr("font-weight","700").style("display","none"),g.append("text").attr("id","central-text-perc").attr("x",G/2).attr("y",j/2+45).attr("fill","white").attr("font-size","56px").attr("font-weight","700").style("display","none"),g.append("rect").attr("id","central-text-5-rect").attr("x",G/2-120).attr("y",j/2+130).attr("width",240).attr("height",40).attr("fill","#d0d0d0").style("cursor","pointer").attr("rx",7).attr("ry",7).style("display","none").on("mouseover",function(){d3.select(this).attr("fill","#f0f0f0")}).on("mouseout",function(){d3.select(this).attr("fill","#d0d0d0")}).on("click",ae),g.append("text").attr("id","central-text-5b").attr("x",G/2).attr("y",j/2+157).attr("fill","#555").text(Bt.other_labels.compare_antimicrobials).attr("font-size",Ut.other_labels.switch_comparison_button[Qt]).attr("pointer-events","none").style("display","none");var e=g.append("g");e.attr("id","central-comparison-texts");for(var a=(I-C-10)/C,r=0;r-1?"it":Vt.indexOf("en")>-1?"en":Vt.indexOf("fr")>-1?"fr":Vt.indexOf("de")>-1?"de":null;Qt=Yt||Ht;var Jt=function(t,e){t=t||"",e=e||"";for(var r=0;r-1)return n}return null}(window.location.href,"/");Qt=Jt||Qt;var Kt=window.location.search,Zt=null;function te(t){gt=[t.macroregions.eastern_europe,t.macroregions.southern_europe,t.macroregions.western_europe,t.macroregions.northern_europe],ft=t.other_labels.all_antimicrobials,xt=t.other_labels.all_countries,yt=t.other_labels.data_not_available}function ee(t){var e=window.location.href;return e=e.replace(window.location.search,""),void(window.location=e+"?lang="+t)}function ae(){$t=1-$t,$("#central-text-5b").html($t===It?Bt.other_labels.compare_antimicrobials:Bt.other_labels.compare_countries),d3.selectAll(".macronation-all").style("display",function(){return $t===It?"block":"none"}),d3.selectAll(".macronation-all-text").style("display",function(){return $t===It?"block":"none"}),Oe(),ze(),Mt=null,Gt=null,Lt=null,Xt(!1,function(){$t===Ct?(bt=0,wt=_.size(nt),ot=null,_.each(rt,function(t,e){t.toLowerCase()===dt.toLowerCase()&&(ot=e)}),null===ot&&(ot=ht[Qt]),ot>_.size(rt)-1&&(ot=_.size(rt)-1)):(bt=0,wt=_.size(rt),ot=null,_.each(nt,function(t,e){t.toLowerCase()===ct.toLowerCase()&&(ot=e)}),null===ot&&(ot=_.size(nt)-1),ot>_.size(nt)-1&&(ot=_.size(nt)-1)),he(!1),ne(!1,null),se(),d3.select("#central-text").attr("opacity",1),d3.select("#central-text-pre").attr("opacity",1),d3.select("#central-text-post").attr("opacity",1),oe(),window.setTimeout(function(){le(),d3.selectAll(".macronations-line").attr("opacity",1),d3.selectAll(".macronations-line-text").attr("opacity",1),Ce(),Ie(),Me()},500)})}function re(t){return"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 "+t+" -5"}function ne(t,e){if(Ee())return!1;var a=e?e===Ft?-300:300:0;d3.select("#central-text").transition().duration(100).attr("x",G/2+a),d3.select("#central-text-pre").transition().duration(100).attr("x",G/2+a),d3.select("#central-text-post").transition().duration(100).attr("x",G/2+a),window.setTimeout(function(){var e="";switch($t){case It:e=Bt.generic.antimicrobials[nt[ot].trim()],St=nt[ot].trim(),ct=St;break;case Ct:e=Bt.generic.countries[rt[ot].trim()],St=rt[ot].trim(),dt=St}var r=e.indexOf(" "),n=e.indexOf(" ",r+1);if(r>0&&n>0){var i=e.substring(0,r);if(d3.select("#central-text-pre").text(i.capitalizeFirstLetter()),(r=(l=e.substring(r+1,e.length)).indexOf(" "))>0){i=l.substring(0,r);d3.select("#central-text").text(i.capitalizeFirstLetter());var l=l.substring(r+1,l.length);d3.select("#central-text-post").text(l.capitalizeFirstLetter())}else d3.select("#central-text").text(l.capitalizeFirstLetter()),d3.select("#central-text-post").text("");d3.selectAll("#central-text-lines-top line").each(function(t){d3.select(this).attr("position")||d3.select(this).attr("position","low"),d3.select(this).attr("position")&&"high"!==d3.select(this).attr("position")&&(d3.select(this).attr("y1",Number(d3.select(this).attr("y1"))-15),d3.select(this).attr("y2",Number(d3.select(this).attr("y2"))-15)),d3.select(this).attr("position","high")}),d3.selectAll("#central-text-lines-top circle").each(function(t){d3.select(this).attr("position")||d3.select(this).attr("position","low"),d3.select(this).attr("position")&&"high"!==d3.select(this).attr("position")&&d3.select(this).attr("cy",Number(d3.select(this).attr("cy"))-15),d3.select(this).attr("position","high")}),d3.selectAll("#central-text-lines-bottom line").each(function(t){d3.select(this).attr("position")||d3.select(this).attr("position","low"),d3.select(this).attr("position")&&"high"!==d3.select(this).attr("position")&&(d3.select(this).attr("y1",Number(d3.select(this).attr("y1"))+15),d3.select(this).attr("y2",Number(d3.select(this).attr("y2"))+15)),d3.select(this).attr("position","high")}),d3.selectAll("#central-text-lines-bottom circle").each(function(t){d3.select(this).attr("position")||d3.select(this).attr("position","low"),d3.select(this).attr("position")&&"high"!==d3.select(this).attr("position")&&d3.select(this).attr("cy",Number(d3.select(this).attr("cy"))+15),d3.select(this).attr("position","high")})}else d3.select("#central-text-pre").text(""),d3.select("#central-text").text(e.capitalizeFirstLetter()),d3.select("#central-text-post").text(""),d3.selectAll("#central-text-lines-top line").each(function(t){d3.select(this).attr("position")&&"low"!==d3.select(this).attr("position")&&(d3.select(this).attr("y1",Number(d3.select(this).attr("y1"))+15),d3.select(this).attr("y2",Number(d3.select(this).attr("y2"))+15)),d3.select(this).attr("position","low")}),d3.selectAll("#central-text-lines-top circle").each(function(t){d3.select(this).attr("position")&&"low"!==d3.select(this).attr("position")&&d3.select(this).attr("cy",Number(d3.select(this).attr("cy"))+15),d3.select(this).attr("position","low")}),d3.selectAll("#central-text-lines-bottom line").each(function(t){d3.select(this).attr("position")&&"low"!==d3.select(this).attr("position")&&(d3.select(this).attr("y1",Number(d3.select(this).attr("y1"))-15),d3.select(this).attr("y2",Number(d3.select(this).attr("y2"))-15)),d3.select(this).attr("position","low")}),d3.selectAll("#central-text-lines-bottom circle").each(function(t){d3.select(this).attr("position")&&"low"!==d3.select(this).attr("position")&&d3.select(this).attr("cy",Number(d3.select(this).attr("cy"))-15),d3.select(this).attr("position","low")});if(t)switch($t){case It:$("#circular-selector-"+ot).d3Trigger("click");case Ct:$("#circular-selector-"+ot).d3Trigger("click")}d3.select("#central-text").attr("x",G/2-a),d3.select("#central-text-pre").attr("x",G/2-a),d3.select("#central-text-post").attr("x",G/2-a),window.setTimeout(function(){d3.select("#central-text").transition().duration(200).attr("x",G/2),d3.select("#central-text-pre").transition().duration(200).attr("x",G/2),d3.select("#central-text-post").transition().duration(200).attr("x",G/2)},100)},130),se(),Le()}function ie(t){var e=$t===It?Bt.generic.antimicrobials[nt[ot].trim()]:Bt.generic.countries[rt[ot].trim()],a=[];_.each($t===It?nt:rt,function(t){var e=$t===It?Bt.generic.antimicrobials[t.trim()]:Bt.generic.countries[t.trim()];a.push(e)});var r=a.sort(),n=r.indexOf(e);t<0?--n<0&&(n=r.length-1):t>0&&++n>r.length-1&&(n=0),e=r[n],_.each($t===It?nt:rt,function(t,a){var r=$t===It?Bt.generic.antimicrobials[t.trim()]:Bt.generic.countries[t.trim()];e===r&&(ot=a)})}function le(){if(null===Gt){x.selectAll("#macronations-line-text-zoomed").remove(),x.selectAll(".macronations-line").remove(),x.selectAll(".macronations-line-text").remove(),x.selectAll(".macronation-all").remove(),x.selectAll(".macronation-all-text").remove(),x.selectAll(".macronation-all-guide").remove();var t=d3.arc().innerRadius(W-3).outerRadius(W-8).startAngle(.5).endAngle(5.83);if(x.append("path").attr("class","macronation-all-guide").attr("d",t).attr("fill","#f0f0f0").attr("transform","translate("+G/2+", "+j/2+")").attr("opacity",0),$t===It){vt.E=vt.S=vt.W=vt.N=0;var e=me(et,q),a=0,r=[.5,0,0,0,0];_.each(e,function(t,n){t&&e[n-1]&&t.region!==mt[a]?(vt[mt[a]]++,r[a+1]=(t.radiant+e[n-1].radiant)/2,a++):vt[mt[a]]++}),r[4]=tt-.5,vt.E--,vt.S+=vt.E,vt.W+=vt.S,vt.N+=vt.W+1;for(var n=0;n<4;n++){var i=d3.arc().innerRadius(W).outerRadius(W+40).startAngle(r[0]+.03+.16*n).endAngle(r[0]+.17+.16*n);x.append("path").attr("id","macronation-all-"+n).attr("class","macronation-all").attr("d",i).attr("fill",K).style("display","none").attr("cursor","pointer").attr("transform","translate("+G/2+", "+j/2+" )").on("mouseover",function(t,e){d3.select(this).attr("fill","#f0f0f0")}).on("mouseout",function(t,e){d3.select(this).attr("fill",K)}),x.append("text").attr("id","macronation-all-text-"+n).attr("class","macronation-all-text").attr("fill","#888888").attr("text-anchor","middle").attr("dy",25).attr("font-size","18px").attr("font-weight",700).style("display","none").attr("pointer-events","none").append("textPath").attr("class","textpath").attr("startOffset","15%").attr("xlink:href","#macronation-all-"+n).text("")}x.selectAll(".macronation-all").on("click",function(t,e){if(0===e)Mt=null,Lt=null,ze(),qe(t,jt,d3.select("#macronation2-"+jt),function(){We(t,Gt,d3.select("#macronation2-"+Gt),function(){Me()})});else{Mt=null,Lt=null,ze();var a=d3.select(this).attr("key"),r=[];for(var n in mt)r.push(Bt.macroregions[mt[n].toLowerCase()]);var i=r.indexOf(a);qe(t,i,d3.select("#macronation2-"+i),function(){})}});for(n=0;n<4;n++){var l=d3.arc().innerRadius(W).outerRadius(W+50).startAngle(r[n]+.05).endAngle(r[n+1]-.05),o=d3.arc().innerRadius(W).outerRadius(W+50).startAngle(r[n]+(n?.02:.05)).endAngle(r[n+1]-(n-3?.02:.05)),s=l().split("L")[0],c=o().split("L")[1];l=function(){return s+"L"+c};var d=d3.arc().innerRadius(W).outerRadius(W+8).startAngle(r[n]+(n?.025:.05)).endAngle(r[n+1]-(n-3?.025:.05)),p=(o=d3.arc().innerRadius(W).outerRadius(W+8).startAngle(r[n]+(n?.02:.05)).endAngle(r[n+1]-(n-3?.02:.05)),d().split("L")[0]),u=o().split("L")[1];d=function(){return p+"L"+u},x.append("path").attr("class","macronations-line macronation-line-"+n).attr("d",l).attr("id","macronation2-"+n).attr("fill",J).attr("stroke",J).attr("i",n).attr("opacity",0).attr("startAngle",r[n]+.03).attr("endAngle",r[n+1]-.03).attr("key",function(){return mt[n]}).attr("cursor","pointer").attr("transform","translate("+G/2+", "+j/2+" )").on("mouseover",function(t,e){null===Gt&&d3.select(this).attr("fill",Y)}).on("mouseout",function(t,e){null===Gt&&d3.select(this).attr("fill",J)}),x.append("path").attr("class","macronations-line macronations-line-sec macronation-line-"+n).attr("d",d).attr("id","macronation2b-"+n).attr("stroke","#95b863").attr("fill","#95b863").attr("i",n).attr("opacity",0).attr("startAngle",r[n]+.03).attr("endAngle",r[n+1]-.03).attr("key",function(){return mt[n]}).attr("transform","translate("+G/2+", "+j/2+" )");var f=0===n||3===n?"23%":"74%",y=0===n||3===n?27:32;x.append("text").attr("class","macronations-line-text macronation-line-text-"+n).attr("fill","#ffffff").attr("text-anchor","middle").attr("dy",y).attr("ody",y).attr("font-size","18px").attr("font-weight",700).attr("opacity",0).attr("pointer-events","none").attr("key",function(){return mt[n]}).append("textPath").attr("class","textpath").attr("startOffset",f).attr("ostartOffset",f).attr("xlink:href","#macronation2-"+n).text(gt[n])}d3.selectAll(".macronations-line").on("click",function(t){if(null===Gt){var e=parseInt(d3.select(this).attr("i"));d3.select(this).attr("fill",J),jt=e,Mt=null,Lt=null,ze(),We(t,e,d3.select(this),function(){Me()})}})}}}function oe(){var t=x.append("g").attr("id","N10shared").attr("text-anchor","middle").attr("pointer-events","none").attr("fill","white").attr("font-size","0").attr("transform","translate(-100,-100)");t.append("text").text(Bt.other_labels.less_than_10_short_advice_1).attr("x",0).attr("y","10px"),t.append("text").text(Bt.other_labels.less_than_10_short_advice_2).attr("x",0).attr("y","26px"),y||(y=x.append("g")),h||(h=x.append("g")),h.selectAll(".nation-text").remove(),h.selectAll(".nation-text-cmp").remove(),h.selectAll(".nation-text").data(Nt).enter().append("text").attr("class","nation-text").attr("text-anchor","middle").attr("x",G/2).attr("y",j/2).style("pointer-events","none").attr("font-size","14px").attr("font-weight","bold").attr("opacity",0).text(function(t){return $t===Ct?Bt.generic.antimicrobials[t.code.trim()].capitalizeFirstLetter():t.code}),h.selectAll(".nation-text-cmp").data(Nt).enter().append("text").attr("class","nation-text-cmp").attr("text-anchor","middle").attr("x",G/2).attr("y",j/2).style("pointer-events","none").attr("font-size","14px").attr("font-weight","bold").attr("opacity",0).text(function(t){return t.code}),h.selectAll(".nation-text-perc").remove(),h.selectAll(".nation-text-perc-cmp").remove(),h.selectAll(".nation-text-perc").data(Nt).enter().append("text").attr("class","nation-text-perc").attr("text-anchor","middle").attr("x",G/2).attr("y",j/2).attr("fill","#fff").style("pointer-events","none").attr("font-size",F+"px").attr("font-weight","bold").attr("opacity",0).text(function(t,e){var a=i?ue(Nt[e].value,u):pe(Nt[e].value);return a<0&&a>-9999?"":a<=100?(+a.toFixed(1)).toLocaleString(Qt)+"%":void 0}),h.selectAll(".nation-text-perc-cmp").data(Nt).enter().append("text").attr("class","nation-text-perc-cmp").attr("text-anchor","middle").attr("x",G/2).attr("y",j/2).attr("fill","#fff").style("pointer-events","none").attr("font-size",F+"px").attr("font-weight","bold").attr("opacity",0).text(function(t,e){if(!i)return"?%";var a=ue(Nt[e].value,f);return a<0&&a>-9999?"":a<=100?(+a.toFixed(1)).toLocaleString(Qt)+"%":void 0})}function se(){100,t=D/100}function ce(e){return pe(e)<-1?Math.round(V+(D-V)/2):pe(e)<0?0:Math.round(V+pe(e)*t)}function de(e,a){return ue(e)<-1?Math.round(V+(D-V)/2):ue(e,a)<0?0:Math.round(V+ue(e,a)*t)}function pe(t){return t["lev0_"+st]["lev1_"+pt]["lev2_"+ot]}function ue(t,e){return t["lev0_"+st]["lev1_"+e]["lev2_"+ot]}function fe(t,e){return Math.round(G/2+Math.sin(t)*e)}function xe(t,e){return Math.round(j/2-Math.cos(t)*e)}function ye(t,e){return{x:fe(t,e),y:xe(t,e)}}function he(t){var e,a,r,n;e=0,a=_.size(Tt),r=new Array(a),n=mt.concat(["X"]),_.each(n,function(t){for(var n=0;n=bt&&a<=wt&&e>0?t+2*e+8:t+4},0),o=wt-bt,s=1/e,c=s*((tt-t)*e-l)/o;c+=.006,o<10&&(c/=5,c*=4);for(var d=(2*Math.PI-2*et)/(o+1),p=[],x=t,y=0,h=0,m=0;m=bt&&a0?s*n[a-1]:0,x+=y+s*t,x+=c),p.push(ye(x,e)),p[h].radiant=x,p[h].region=Nt[a].region,"EU"===Nt[a].code&&(p[h].radiant=0,p[h].x=G/2,p[h].y=j/2-q,i&&(p[h].y=-3e3)),h++)});for(m=wt;m<_.size(rt);m++)Nt[m]&&"EU"===Nt[m].code?i?p.push({x:G/2,y:-3e3,radiant:0,region:"X"}):p.push({x:G/2,y:j/2-q,radiant:0,region:"X"}):p.push({x:G/2,y:-500,radiant:0,region:"X"}),h++;if(i){x=t,y=0,0;for(m=0;m=bt&&e0?s*r[e-1]:0,x+=y+c+s*t),p.push(ye(x,O)),p[h].radiant=x,p[h].region=Nt[e].region,"EU"===Nt[e].code&&(p[h].radiant=0,p[h].x=G/2,p[h].y=-3e3),h++)});for(m=h;m<2*_.size(rt);m++)Nt[m]&&"EU"===Nt[m].code?i?p.push({x:G/2,y:-3e3,radiant:0,region:"X"}):p.push({x:G/2,y:j/2-O,radiant:0,region:"X"}):p.push({x:G/2,y:-500,radiant:0,region:"X"}),h++}return p}var g=_.size(nt),v=Math.ceil(g/2);for(p=[],m=0;ma?20+0*(e-a):20+0*(a-e):null===a||a<0?20:e>a?20+20*(e-a):20+20*(a-e)}function be(){return $t===Ct?"18px":"14px"}function we(){return $t===Ct?"400":"700"}function _e(t,e){return $t===Ct?t-9999)return 0}else if(!Nt[a]||pe(Nt[a].value)<0&&pe(Nt[a].value)>-9999)return 0;return $t===Ct?1:a!==Mt&&a!==Mt-l&&t[a]?1:0}).attr("fill",function(e,a){return $t===Ct?"#888":t[a]?a===Mt||a===Lt||a+l===Mt||a+l===Lt?"white":Wt(i?ue(Nt[a].value,u):pe(Nt[a].value)):"white"}).attr("x",function(e,a){var r=t[a]?t[a].x:d3.select(this).attr("x");return $t===Ct&&(ant.length-2)&&(r-=10),a>o-2&&a-9999?0:$t===Ct?1:a!==Mt&&a!==Mt-l&&t[a]?1:0}).attr("fill",function(e,a){if(i)return $t===Ct?"#fff":t[a]?a===Mt||a===Lt||a+l===Mt||a+l===Lt?"white":Wt(ue(Nt[a].value,f)):"white"}).attr("x",function(e,a){var r=+(t[a+l]?t[a+l].x:d3.select(this).attr("x"));return $t===Ct&&(a=bt&&el/2&&(e-=l/2),_.each(t,function(a,o){if(a&&(o>=bt&&o=l/2+bt&&o=wt?O:q,c=i&&o>=wt?e+l/2:e;oc&&(a.x=fe(a.radiant+n,s),a.y=xe(a.radiant+n,s),t[o].radiant+=n)}}),t}function ze(t,e){m.transition().duration(1e3).attr("opacity",0),g.attr("opacity",0).style("display","none"),w.style("display","block"),k.style("display","block"),d3.select("#central").transition().duration(1e3).attr("r",0),d3.select("#central-dotted").transition().duration(1e3).attr("r",0),Et?d3.select("#central-dotted-arced").transition().delay(300).attr("d","M0,0"):d3.select("#central-dotted-arced").transition().delay(300).attr("d",""),d3.select("#central-dotted-arced-mask").transition().duration(300).attr("opacity",0).attr("width",0),d3.selectAll(".central-text").style("display","block").attr("opacity",1),d3.selectAll(".central-text-pre").style("display","block").attr("opacity",1),d3.selectAll(".central-text-post").style("display","block").attr("opacity",1),d3.select("#central-text-5-rect").style("display","none"),d3.select("#central-text-5a").style("display","none"),d3.select("#central-text-5b").style("display","none"),d3.select("#central-text-1").style("display","none").attr("fill","#fff"),d3.select("#central-text-2").style("display","none").attr("fill","#fff"),d3.select("#central-text-3").style("display","none").attr("fill","#fff"),d3.select("#central-text-4").style("display","none"),d3.select("#central-text-6").style("display","none"),d3.select("#menu-central").attr("display","block"),d3.select("#central-text").style("transform","none").attr("fill","#fff"),d3.select("#central-text").style("display","block"),d3.select("#central-text-arrow-right").style("display","block"),d3.select("#central-text-arrow-left").style("display","block"),d3.select("#central-text-perc").style("display","none"),d3.select("#comparison-top-mask").style("display","none"),d3.selectAll(".switch-button").style("display",i?"none":"block")}function Me(){i?(h.selectAll(".nation-text-perc").attr("font-weight","bold").attr("font-size",F+"px").text(function(t,e){if(Nt[e]){var a=ue(Nt[e].value,u);if(a<-1)return"";if(a<0)return"";if(a<=100)return(+a.toFixed(1)).toLocaleString(Qt)+"%"}return e+"?"}),h.selectAll(".nation-text-perc-cmp").attr("font-weight","bold").attr("font-size",F+"px").text(function(t,e){if(Nt[e]){var a=ue(Nt[e].value,f);if(a<-1)return"";if(a<0)return"";if(a<=100)return(+a.toFixed(1)).toLocaleString(Qt)+"%"}return e+"?"})):h.selectAll(".nation-text-perc").attr("font-weight","bold").attr("font-size",function(t,e){if(Nt[e]&&pe(Nt[e].value)<-1)return"13px";return F+"px"}).text(function(t,e){if(Nt[e]){var a=pe(Nt[e].value);if(a<-1)return"";if(a<0)return"";if(a<=100)return(+a.toFixed(1)).toLocaleString(Qt)+"%"}return"?"})}function Le(){Ee()||(Re(),d3.selectAll(".gooey-nationed").transition().duration(500).attr("r",function(t,e){return e=(i?2*wt:wt)?0:20}).attr("fill",qt(10)),d3.selectAll(".gooey-border").transition().duration(500).attr("r",function(t,e){return e=(i?2*wt:wt)?0:20}),ge(0),window.setTimeout(function(){ke(me(et,q),-1),Me(),Pe(),Ie(),le(),d3.selectAll(".macronations-line").attr("opacity",1),d3.selectAll(".macronations-line-text").attr("opacity",1),Ce(),d3.selectAll(".switch-button").style("display",i?"none":"block"),window.setTimeout(Se,600)},300))}function Se(){var t=!1;d3.selectAll(".gooey").each(function(e){d3.select(this).attr("r")>4&&(t=!0)}),d3.selectAll(".data-not-available-message").style("display",t?"none":"block")}function Ee(){return r}function Re(){r=!0}function Pe(){r=!1}function Te(t){1===t||2===t?d3.selectAll(".sel"+t+"-menu-item").transition().ease(d3.easeLinear).duration(200).style("height","0px").style("transform","translate(0, 0)"):Et||kt?(d3.selectAll(".top-menu.sel3-menu").attr("opacity",0).style("display","none"),d3.select("#menu-3-box").attr("opacity",0).style("transform","matrix(0.25, 0, 0, 0.08, 357, 435)")):(d3.select("#menu-3-box").transition().duration(300).attr("opacity",1).style("transform","matrix(1, 0, 0, 0.08, 0, 435)"),window.setTimeout(function(){d3.select("#menu-3-box").transition().duration(300).attr("opacity",0).style("transform","matrix(0.25, 0, 0, 0.08, 357, 435)"),window.setTimeout(function(){d3.selectAll(".top-menu.sel3-menu").attr("opacity",0).style("display","none")},300)},300))}function Ne(t){if(Ee())return!1;if(t<3&&"0px"!==d3.select(".sel"+t+"-menu-item").style("height"))Te(t);else{switch(t){case 1:Te(2),Te(3);break;case 2:Te(1),Te(3);break;case 3:Te(1),Te(2)}!function(t){1===t||2===t?d3.selectAll(".sel"+t+"-menu-item").transition().ease(d3.easeLinear).duration(200).style("height",S+"px").style("transform","translate(0, "+S+"px)"):Et||kt?(d3.selectAll(".top-menu.sel3-menu").attr("opacity",1).style("display","block"),d3.select("#menu-3-box").attr("opacity",1).style("transform","scale(1,1)")):(d3.selectAll(".top-menu.sel3-menu").attr("opacity",0).style("display","block").transition().duration(400).attr("opacity",1),d3.select("#menu-3-box").transition().duration(400).attr("opacity",1).style("transform","matrix(1, 0, 0, 0.08, 0, 435)"),window.setTimeout(function(){d3.select("#menu-3-box").transition().duration(400).attr("opacity",1).style("transform","matrix(1, 0, 0, 1, 0, 0)")},400))}(t)}}function Oe(){D=$t===It?i?R:E:P}function Fe(t,e){if(Ee())return!1;Te(t);var a=0;if(null!=Mt){var r=Mt;$($(".gooey-nationed")[Mt]).d3Trigger("click"),$($(".gooey-nationed")[r]).d3Trigger("mouseout"),a=800}window.setTimeout(function(){switch(t){case 1:st=e;break;case 2:pt=e,ut=e;break;case 3:ot=e,ne(!1,null)}2===t&&(pt===d?(i=pt,u=l,f=o):pt===p?(i=pt,u=s,f=c):i=null),Oe(),i?(d3.select("#nations-line").attr("display","none"),d3.selectAll(".comparison-circle-guide").transition().ease(d3.easeExp).duration(1500).attr("opacity",1),d3.select("#macronation-all-0").style("display","none"),d3.select("#macronation-all-text-0").style("display","none")):(d3.select("#nations-line").attr("display","block"),d3.selectAll(".comparison-circle-guide").transition().ease(d3.easeExp).duration(1500).attr("opacity",0),d3.select("#macronation-all-0").style("display","block"),d3.select("#macronation-all-text-0").style("display","block")),2===t&&i&&null===Gt&&$("#macronation2-3").d3Trigger("click"),2===t&&(pt>d&&pt--,pt>p&&pt--),i||se(),Le()},a)}function Ie(){$t===It?d3.select("#switch-button-text").text(ft):d3.select("#switch-button-text").text(xt)}function Ce(){if(A){d3.select("#top-menu").remove(),d3.selectAll(".sel3-menu").remove();var t=d3.select("#container").append("div").attr("id","top-menu").style("height",S+"px"),e=t.append("div").attr("class","menu-part left-part").style("font-size",Ut.top_menu.item[Qt]).style("line-height",S+"px").html('"),a=t.append("div").attr("class","menu-part right-part").style("font-size",Ut.top_menu.item[Qt]).style("line-height",S+"px").html('");e.on("click",function(){d3.event.stopPropagation(),Ne(1)}),a.on("click",function(){d3.event.stopPropagation(),Ne(2)}),_.each(it,function(t,a){var r=+a===st?"bold":"normal";e.append("div").attr("class","menu-item top-menu sel1-menu-item").style("font-weight",r).style("line-height",S+"px").style("bottom",-(S-1)*a+"px").style("height","0").html(Bt.generic.bacteria[t].text).on("click",function(t){d3.event.stopPropagation(),Fe(1,a)})});var r=0;_.each(lt,function(t,e){if(e!==d&&e!==p){var n=+r===pt?"bold":"normal";!function(e,r){a.append("div").attr("class","menu-item top-menu sel2-menu-item").style("font-weight",n).style("line-height",S+"px").style("bottom",-(S-1)*e+"px").style("height","0").html(Bt.generic.species[t]).on("click",function(t){d3.event.stopPropagation(),Fe(2,r)})}(r,e),r++}});var n=$t===It?Bt.other_labels.select_antimicrobial:Bt.other_labels.select_country,i=x.append("g").attr("class","top-menu sel3-menu").style("display","none").append("g").attr("id","menu-3-box");i.attr("opacity",0),i.style("transform","matrix(0.25, 0, 0, 0.08, 357, 435)"),i.append("rect").attr("x",G/2-300).attr("y",j/2-300).attr("width",600).attr("height",600).attr("fill","white").attr("stroke","#00b18b").attr("stroke-width",5).on("click",function(){d3.event.stopPropagation()}),i.append("circle").attr("cx",G/2).attr("cy",j/2-300).attr("r",30).attr("fill","white").attr("stroke",J).attr("stroke-width",5).attr("cursor","pointer").on("mouseover",function(){d3.select(this).attr("fill","#f6f6f6")}).on("mouseout",function(){d3.select(this).attr("fill","#ffffff")}),i.append("line").attr("x1",G/2-15).attr("y1",j/2-315).attr("x2",G/2+15).attr("y2",j/2-285).attr("stroke","#00b18b").attr("stroke-width",5).attr("pointer-events","none"),i.append("line").attr("x1",G/2-15).attr("y1",j/2-285).attr("x2",G/2+15).attr("y2",j/2-315).attr("stroke","#00b18b").attr("stroke-width",5).attr("pointer-events","none"),i.append("text").attr("id","third-menu-title").attr("x",G/2).attr("y",j/2-220).attr("text-anchor","middle").attr("font-size","26px").attr("font-weight","bold").attr("fill","#888").text(n),i.append("circle").attr("cx",G/2-30).attr("cy",j/2-175).attr("r",20).attr("fill","white").attr("stroke","#00b18b").attr("stroke-width",3).attr("cursor","pointer").on("mouseover",function(){d3.select(this).attr("fill","#f6f6f6")}).on("mouseout",function(){d3.select(this).attr("fill","#ffffff")}).on("click",function(){d3.event.stopPropagation(),Ge(40)}),i.append("line").attr("x1",G/2-37).attr("y1",j/2-170).attr("x2",G/2-28).attr("y2",j/2-178).attr("stroke",J).attr("stroke-width",5).attr("pointer-events","none"),i.append("line").attr("x1",G/2-23).attr("y1",j/2-170).attr("x2",G/2-32).attr("y2",j/2-178).attr("stroke",J).attr("stroke-width",5).attr("pointer-events","none"),i.append("circle").attr("cx",G/2+30).attr("cy",j/2-175).attr("r",20).attr("fill","white").attr("stroke","#00b18b").attr("stroke-width",3).attr("cursor","pointer").on("mouseover",function(){d3.select(this).attr("fill","#f6f6f6")}).on("mouseout",function(){d3.select(this).attr("fill","#ffffff")}).on("click",function(){d3.event.stopPropagation(),Ge(-40)}),i.append("line").attr("x1",G/2+37).attr("y1",j/2-178).attr("x2",G/2+28).attr("y2",j/2-170).attr("stroke",J).attr("stroke-width",5).attr("pointer-events","none"),i.append("line").attr("x1",G/2+23).attr("y1",j/2-178).attr("x2",G/2+32).attr("y2",j/2-170).attr("stroke",J).attr("stroke-width",5).attr("pointer-events","none");var l=[];$t===It?(_.each(nt,function(t,e){l.push({value:Bt.generic.antimicrobials[t.trim()],index:e})}),l=l.sort(function(t,e){return t.value>e.value?1:t.value(r=r.replace("Ö","O"))?1:a0?-30:30)})}}""!==Kt&&(Zt=Kt.split("=")[1])&&(Qt=Zt),Dt(Qt,function(t){te(Bt=t),Xt(!0,function(){})}),$(document).on("translate",function(t,e){ee(e)}),d3.elasticGooeys=function t(e,a){var r=2*Math.PI,n=Math.asin(1/(e=Math.max(1,e)))*(a/=r);function i(t){return 1-e*Math.pow(2,-10*(t=+t))*Math.sin((t+n)/a)}return i.amplitude=function(e){return t(e,a*r)},i.period=function(a){return t(e,a)},i}(1,.85);var $e=0;function Ge(t){var e=$t===It?-30*_.size(nt):-37*_.size(rt);(t>0&&$e<0||t<0&&$e>=e)&&($e+=t,d3.selectAll(".menu3-item").attr("y",function(t){return+d3.select(this).attr("oy")+$e}))}function je(t,e,a,r){var n=(r-90)*Math.PI/180;return{x:t+a*Math.cos(n),y:e+a*Math.sin(n)}}function Be(t,e,a,r,n){var i=je(t,e,a,n),l=je(t,e,a,r),o=n-r<=180?"0":"1";return["M",i.x,i.y,"A",a,a,0,o,0,l.x,l.y].join(" ")}function Ue(t,a,r,n){if(Te(1),Te(2),Te(3),Mt===a)n>Nt.length&&(n-=Nt.length),Mt=null,ze(),d3.selectAll(".nation-text-perc").filter(function(t,e){return e==a||e+rt.length==a}).text(function(t,e){var a=i?ue(Nt[n].value,u):pe(Nt[n].value);return a<0?"":a<=100?(+a.toFixed(1)).toLocaleString(Qt)+"%":void 0}).attr("font-weight","bold").attr("font-size",F+"px"),d3.selectAll(".nation-text-perc-cmp").filter(function(t,e){return e==a||e+rt.length==a}).text(function(t,e){if(!i)return"?%";var a=ue(Nt[n].value,f);return a<0?"":a<=100?(+a.toFixed(1)).toLocaleString(Qt)+"%":void 0});else{Mt=a;$t===It?_.size(rt):_.size(nt);var l=n>Nt.length?n-Nt.length:n;St=Nt[l].name,$t===It?dt=Nt[l].name:ct=Nt[l].name,i?function(t,e,a,r){if(i){r>Nt.length&&(r-=Nt.length);var n=ue(Nt[r].value,u),l=ue(Nt[r].value,f),o=I/100*n;o>0&&o<1?o=1:o<0&&o>-9999&&(o=0);var s=I/100*l;if(s>0&&s<1?s=1:s<0&&s>-9999&&(s=0),d3.selectAll(".switch-button").style("display","none"),w.style("display","none"),k.style("display","none"),Rt||Et){g.style("-webkit-transform","translate(0px, 60px)"),d3.select("#central-comparison-texts").style("-webkit-transform","translate(0px, -40px)"),$("#central-group-text").attr("class","t60");var c=document.querySelector(".t60"),p=getComputedStyle(c).getPropertyValue("transform");c.setAttribute("transform",p),$("#central-comparison-texts").attr("class","t_30"),c=document.querySelector(".t_30"),p=getComputedStyle(c).getPropertyValue("transform"),c.setAttribute("transform",p)}else g.style("transform","translate(0px, 60px)"),d3.select("#central-comparison-texts").style("transform","translate(0px, -40px)");d3.select("#central-comparison-texts").attr("display","block"),d3.select("#central-text-4").style("display","none"),d3.select("#central-text-6").style("display","none"),d3.select("#central-text-perc").style("display","none"),d3.select("#central-text").style("transform","translate(0px, -25px)").attr("fill","#ffffff"),d3.select("#central-text-arrow-right").style("display","none"),d3.select("#central-text-arrow-left").style("display","none"),d3.select("#comparison-text-bar-text-1").text(Bt.generic.species[i===d?"Broilers":"Meat from broilers"]),d3.select("#comparison-text-bar-text-2").text(Bt.generic.species[i===d?"Fattening turkeys":"Meat from turkeys"]);var x=100/C;if(d3.select("#menu-central").attr("display","none"),d3.selectAll(".central-comparison-bar-1-part").attr("height",function(t,e){return e*x-x?17/x*-(n-e*x):0}).attr("transform",function(t,e){return e*x-x?"translate(0,"+17/x*(x+(n-e*x))+")":"translate(0,0)"}),d3.selectAll(".central-comparison-bar-2-part").attr("height",function(t,e){return e*x-9999)d3.select("#central-comparison-value-1").text(Bt.other_labels.na);else{var y=parseInt(d3.select("#central-comparison-value-1").text());isNaN(y)&&(y=0);var h=setInterval(function(){if(Math.abs(y-n)<2)return d3.select("#central-comparison-value-1").text((+n.toFixed(0)).toLocaleString(Qt)+"%"),void clearInterval(h);y=(y=(y+n)/2)>1?Math.round(y):y.toFixed(1),d3.select("#central-comparison-value-1").text((+y.toFixed(0)).toLocaleString(Qt)+"%")},70)}if(l<0&&l>-9999)d3.select("#central-comparison-value-2").text(Bt.other_labels.na);else{var v=parseInt(d3.select("#central-comparison-value-2").text());isNaN(v)&&(v=0);var b=setInterval(function(){if(Math.abs(v-l)<2)return d3.select("#central-comparison-value-2").text((+l.toFixed(0)).toLocaleString(Qt)+"%"),void clearInterval(b);v=(v=(v+l)/2)>1?Math.round(v):v.toFixed(1),d3.select("#central-comparison-value-2").text((+v.toFixed(0)).toLocaleString(Qt)+"%")},70)}m.transition().attr("opacity",1),g.transition().delay(200).duration(500).attr("opacity",1).style("display","block"),d3.select("#central").transition().ease(d3.easeLinear).duration(300).attr("cx",G/2).attr("cy",j/2).attr("r",q-H-90),d3.select("#central-text-1").style("display","block").text(Bt.generic.countries[e.name]).attr("fill","#555");var _="",A="",z="",M="";$t===It?("ESBL"===nt[ot]||"AmpC"===nt[ot]?Bt.central_area.producing_sequence_code&&1!==Bt.central_area.producing_sequence_code?(_=Bt.central_area.prevalence_of+Bt.generic.bacteria[it[st]].plain_text+Bt.central_area.producing+Bt.generic.antimicrobials[nt[ot]],A=Bt.central_area.prevalence_of+" "+Bt.generic.bacteria[it[st]].plain_text+" "+Bt.central_area.producing+Bt.generic.antimicrobials[nt[ot]]):(_=Bt.central_area.prevalence_of+Bt.generic.antimicrobials[nt[ot]]+Bt.central_area.producing+" "+Bt.generic.bacteria[it[st]].plain_text,A=Bt.central_area.prevalence_of+Bt.generic.antimicrobials[nt[ot]]+Bt.central_area.producing+" "+Bt.generic.bacteria[it[st]].plain_text+""):(_=Bt.central_area.resistance_of+Bt.generic.bacteria[it[st]].plain_text,A=Bt.central_area.resistance_of+" "+Bt.generic.bacteria[it[st]].plain_text+""),"ESBL"===nt[ot]||nt[ot],z=" "+Bt.central_area.in[lt[ut]]+Bt.generic.species_after_in[lt[ut]],M=" "+Bt.central_area.in[lt[ut]]+Bt.generic.species_after_in[lt[ut]]):("ESBL"===Nt[r].name||"AmpC"===Nt[r].name?(_=Bt.central_area.prevalence_of+Nt[r].name+Bt.central_area.producing+Bt.generic.bacteria[it[st]].plain_text,A=Bt.central_area.prevalence_of+Nt[r].name+Bt.central_area.producing+" "+Bt.generic.bacteria[it[st]].plain_text+""):(_=Bt.central_area.resistance_of+Bt.generic.bacteria[it[st]].plain_text,A=Bt.central_area.resistance_of+" "+Bt.generic.bacteria[it[st]].plain_text+""),"ESBL"===Nt[r].name||Nt[r].name,z=" "+Bt.central_area.in[lt[ut]]+Bt.generic.species_after_in[lt[ut]],M=" "+Bt.central_area.in[lt[ut]]+Bt.generic.species_after_in[lt[ut]]),Et||Rt?(d3.select("#central-text-2").style("display","block").text(_).attr("fill","#555"),d3.select("#central-text-3").style("display","block").text(z).attr("fill","#555")):(d3.select("#central-text-2").style("display","block").html(A).attr("fill","#555"),d3.select("#central-text-3").style("display","block").html(M).attr("fill","#555")),window.setTimeout(function(){d3.select("#comparison-top-mask").style("display","block")},150)}}(0,t,0,n):function(t,a,r){var n=pe(Nt[r].value);if(w.style("display","none"),k.style("display","none"),d3.selectAll(".switch-button").style("display","none"),d3.select("#comparison-top-mask").style("display","none"),Rt||Et){g.style("-webkit-transform","translate(0px, 0px)"),d3.select("#central-comparison-texts").style("-webkit-transform","translate(0px, 0px)"),$("#central-group-text").attr("class","tnone");var i=document.querySelector(".tnone"),l=getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",l),$("#central-comparison-texts").attr("class","tnone"),i=document.querySelector(".tnone"),l=getComputedStyle(i).getPropertyValue("transform"),i.setAttribute("transform",l)}else g.style("transform","none"),d3.select("#central-comparison-texts").style("transform","none");d3.select("#menu-central").attr("display","none"),d3.select("#central-comparison-texts").attr("display","none"),m.transition().attr("opacity",1),g.transition().delay(200).duration(500).attr("opacity",1).style("display","block"),d3.select("#central").attr("fill",n<-1?e:J).transition().ease(d3.easeLinear).duration(300).attr("cx",G/2).attr("cy",j/2).attr("r",q-H),d3.select("#central-dotted").attr("stroke",n<-1?e:Y).transition().delay(200).duration(500).attr("r",q-H-15),d3.select("#central-dotted-arced-mask").attr("fill",n<-1?e:J).transition().delay(500).duration(0).attr("opacity",1).attr("width",240),d3.selectAll(".central-text").transition().duration(300).attr("opacity",0).delay(300).style("display","none"),d3.select("#central-text").style("display","none");var o="",s="",c="",d="",p="",u=Bt.central_area.prevalence_of,f=Bt.central_area.resistance_of,x=Bt.generic.species_after_in[lt[ut]],y=Bt.central_area.in[lt[ut]],h=Bt.central_area.producing,v=Bt.generic.bacteria[it[st]],b=nt[ot];if($t===It){var _=Bt.generic.antimicrobials[b];if("ESBL"===b||"AmpC"===b){var A=h;"fr"===Qt&&"AmpC"===b&&(A=" productrices d'"),Bt.central_area.producing_sequence_code&&1!==Bt.central_area.producing_sequence_code?(o=u+v.plain_text+" "+A+_,s=u+v.svg_text+" "+A+_):(o=u+_+A+" "+v.plain_text,s=u+_+A+" "+v.svg_text),p=""}else o=f+v.plain_text,s=f+v.svg_text,p=Bt.central_area.resistance;"ESBL"===b||"AmpC"===b?(c=" "+y+x,d=" "+y+x):(c=" "+Bt.central_area.to[b.trim()]+Bt.generic.antimicrobials[b.trim()]+" "+y+x,d=" "+Bt.central_area.to[b.trim()]+Bt.generic.antimicrobials[b.trim()]+" "+y+x)}else _=Bt.generic.antimicrobials[Nt[r].name.trim()],"ESBL"===Nt[r].name||"AmpC"===Nt[r].name?(o=u+_+h+" "+v.plain_text,s=u+_+h+" "+v.svg_text,p=""):(o=f+v.plain_text,s=f+v.svg_text,p=Bt.central_area.resistance),"ESBL"===Nt[r].name||"AmpC"===Nt[r].name?(c=" "+y+x,d=" "+y+x):(c=" "+Bt.central_area.to[Nt[r].name.trim()]+_+" "+y+x,d=" "+Bt.central_area.to[Nt[r].name.trim()]+_+" "+y+x);if(Et||Rt?(c=c.replace("+",Bt.central_area.to["+"]),d3.select("#central-text-2").style("display","block").text(o).attr("fill","#fff"),d3.select("#central-text-3").style("display","block").text(c).attr("fill","#fff")):(d=d.replace("+",Bt.central_area.to["+"]),d3.select("#central-text-2").style("display","block").html(s).attr("fill","#fff"),d3.select("#central-text-3").style("display","block").html(d).attr("fill","#fff")),n<-1?(d3.select("#central-text-4").style("display","block"),d3.select("#central-text-4").text(Bt.other_labels.less_than_10_long_advice_1),d3.select("#central-text-4b").text(Bt.other_labels.less_than_10_long_advice_2),d3.select("#central-text-4c").text(Bt.other_labels.less_than_10_long_advice_3)):(d3.select("#central-text-4").style("display","block").text(p),d3.select("#central-text-4b").text(""),d3.select("#central-text-4c").text("")),d3.select("#central-text-5-rect").style("display","block"),d3.select("#central-text-5a").style("display","block"),d3.select("#central-text-5b").style("display","block"),$t===It){var z=Bt.generic.antimicrobials[nt[ot].trim()];d3.select("#central-text-6").style("display","block").text(z.capitalizeFirstLetter()),d3.select("#central-text-1").style("display","block").text(Bt.generic.countries[Nt[r].name]).attr("fill","#fff")}else{var M=Bt.generic.countries[rt[ot]];d3.select("#central-text-6").style("display","block").text(Bt.generic.antimicrobials[Nt[r].name.trim()].capitalizeFirstLetter()),d3.select("#central-text-1").style("display","block").text(M).attr("fill","#fff")}(t=d3.select("#central-text-perc")).style("display","block");var L=d3.select("#central-dotted-arced");if(L.style("display","block"),n<-1)return t.style("display","none"),void L.style("display","none");var S=parseFloat(d3.select("#central-text-perc").text());isNaN(S)&&(S=0);var E=2.1*S,R=parseFloat(n),P=2.1*R;if(S===R)t.text(S+"%"),t.text((+n.toFixed(1)).toLocaleString(Qt)+"%"),L.attr("d",Be(G/2,j/2+20,110,-105,-105+E));else{var T=R-S>0?1:-1,N=6;Et&&(N=3);var O=setInterval(function(){S+=T,t.text((+S.toFixed(1)).toLocaleString(Qt)+"%"),E+=(P-E)/10,L.attr("d",Be(G/2,j/2+20,110,-105,-105+E)),1===T&&S>=R?(t.text((+n.toFixed(1)).toLocaleString(Qt)+"%"),L.attr("d",Be(G/2,j/2+20,110,-105,-105+P)),clearInterval(O)):-1===T&&S<=R&&(t.text((+n.toFixed(1)).toLocaleString(Qt)+"%"),L.attr("d",Be(G/2,j/2+20,110,-105,-105+P)),clearInterval(O))},N)}}(r,0,n),d3.selectAll(".nation-text-perc").filter(function(t,e){return e==a||e+rt.length==a}).text("x").attr("font-weight",100).attr("font-size",40),d3.selectAll(".nation-text-perc-cmp").filter(function(t,e){return e==a||e+rt.length==a}).text("");var o=me(et,q);"EU"!==t.code&&Mt&&(o=Ae(o,Mt)),ke(o,a)}}function qe(t,e,a,r){var n,i,l=a.attr("key");switch(d3.select(".macronation-line-text-"+jt).select("textPath").text(gt[e]),Gt=e,Xe(),l){case"E":n=0,i=vt[l];break;case"S":n=vt.E,i=vt[l];break;case"W":n=vt.S,i=vt[l];break;case"N":n=vt.W,i=vt[l]}bt=n,wt=i,ne(!1,null),he(!1),ke(me(et,q),-1),r()}function We(t,e,a,r){if(!n){Mt&&(Lt=null,Ue(null,Mt,null,Mt),Mt=null);var i=.03,l=.031;if((Rt||Et)&&(i=.06,l=.062),null!==Gt){x.selectAll(".macronation-all-guide").attr("opacity",0),n=!0;var o=a.attr("key"),s=0,c=Tt.length;switch(o){case"E":z=0,M=vt[o];break;case"S":z=vt.E,M=vt[o];break;case"W":z=vt.S,M=vt[o];break;case"N":z=vt.W,M=vt[o]}if(Rt||Et||Pt)bt=s,wt=c;else var d=setInterval(function(){z>s&&z--,M=c&&clearInterval(d)},50);var p=2.2,u=2*Math.PI-2.2,f=+d3.select("#macronation2-"+e).attr("startAngle"),y=+d3.select("#macronation2-"+e).attr("endAngle"),h=2.2,m=2*Math.PI-2.2,g=+d3.select("#macronation2b-"+e).attr("startAngle"),v=+d3.select("#macronation2b-"+e).attr("endAngle"),b=d3.select("#macronation2-"+e),w=d3.select("#macronation2b-"+e),_=setInterval(function(){var t=d3.arc().innerRadius(W).outerRadius(W+45).startAngle(p).endAngle(u);b.attr("d",t);t=d3.arc().innerRadius(W).outerRadius(W+8).startAngle(h).endAngle(m);w.attr("d",t);var e=!0;if(Math.abs(f-p)>l&&(f>p?p+=i:p-=i,e=!1),Math.abs(g-h)>l&&(g>h?h+=i:h-=i,e=!1),Math.abs(y-u)>l&&(yl&&(vc&&M--,z>=s&&M<=c&&clearInterval(d)},50);p=2.2,u=2*Math.PI-2.2,f=+A.attr("startAngle"),y=+A.attr("endAngle"),h=2.2,m=2*Math.PI-2.2,g=+A.attr("startAngle"),v=+A.attr("endAngle"),b=d3.select("#macronation2-"+e),w=d3.select("#macronation2b-"+e);if(Et||Pt){var L=d3.arc().innerRadius(W).outerRadius(W+45).startAngle(p).endAngle(u);b.attr("d",L);L=d3.arc().innerRadius(W).outerRadius(W+8).startAngle(h).endAngle(m);w.attr("d",L)}else _=setInterval(function(){var t=d3.arc().innerRadius(W).outerRadius(W+45).startAngle(f).endAngle(y);b.attr("d",t);t=d3.arc().innerRadius(W).outerRadius(W+8).startAngle(g).endAngle(v);if(w.attr("d",t),Math.abs(g-h)>l&&(h>g?g+=i:g-=i),Math.abs(v-m)>l&&(m>v?v+=i:v-=i),Math.abs(f-p)>l&&(p>f?f+=i:f-=i),Math.abs(y-u)>l&&(u>y?y+=i:y-=i),g<=h&&v>=m){t=d3.arc().innerRadius(W).outerRadius(W+45).startAngle(p).endAngle(u);b.attr("d",t);t=d3.arc().innerRadius(W).outerRadius(W+8).startAngle(h).endAngle(m);w.attr("d",t),clearInterval(_)}},6);Xe(),window.setTimeout(function(){n=!1,r()},1e3)}}}function Xe(){var t=[Bt.macroregions.all,Bt.macroregions.e,Bt.macroregions.s,Bt.macroregions.w,Bt.macroregions.n],e=0;_.each(t,function(t,a){a-1!=Gt&&(d3.select("#macronation-all-text-"+e).select("textPath").text(t),d3.select("#macronation-all-"+e).attr("key",t),e++)}),d3.selectAll(".macronation-all").style("display","block"),d3.selectAll(".macronation-all-text").style("display","block"),i&&(d3.select("#macronation-all-0").style("display","none"),d3.select("#macronation-all-text-0").style("display","none"))}jQuery.fn.d3Trigger=function(t){this.each(function(e,a){var r=document.createEvent("MouseEvent");r.initMouseEvent(t,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(r)})},String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)};var De=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e||navigator.userAgent.indexOf("iPad")>0||navigator.userAgent.indexOf("Android")>0};$(window).on("click",function(){Te(1),Te(2),Te(3)})});