(function($,window,document){$(function(){$(".m-svgmap").each(function(ii,root){const panels=$(".panel");const gs=$(root).find("g[id]");var tooltip=$('#tooltip');var region=$('#svg-map g');var mapOffset=$('#svg-map').offset();region.each(function(){$(this).on('mouseenter',function(){var name=$(this).attr('data-name');name=name.replace(/_/g,' ');tooltip.html(`${name}`).show();}).on('mouseleave',function(){tooltip.css({'left':0,'top':0}).hide();});});tooltip.hide();$('#svg-map').on('mousemove',function(e){var relativeX=e.offsetX;var relativeY=e.offsetY;if(relativeX<0){relativeX=0;} if(relativeY<0){relativeY=0;} tooltip.css({left:relativeX+30,top:relativeY+30});});panels.each(function(jj,panel){let $this=$(panel);let $svgPart=$(root).find("#"+$this.data("id"));$svgPart.on("mouseover",function(){gs.find("g,path").not(".active").css("opacity","0.5");$(this).find("g,path").css("opacity","");$(this).find("g,path").addClass("hover");});$svgPart.on("mouseout",function(){if(!$this.hasClass("show")){if(!atLeastPanelShowing()){gs.find("g,path").not(".active").css("opacity","");$(this).find(".hover").removeClass("hover");}else{$(this).find(".hover").removeClass("hover");$(this).find("g,path").css("opacity","0.5");}}});$svgPart.on("click",function(){panels.removeClass("show");$(root).find("g,path").removeClass("active");$(root).find("g,path").removeClass("hover");gs.find("g,path").not(".active").css("opacity","0.5");$this.addClass("show");$(root).addClass("panelactive");$(this).find("g,path").addClass("active");$(this).find("g,path").css("opacity","");});$this.find(".close").on("click",function(e){e.preventDefault();panels.removeClass("show");$(root).removeClass("panelactive");$(root).find(".active").removeClass("active");$(root).find(".hover").removeClass("hover");$(root).find("*").css("opacity","");});}) function atLeastPanelShowing(){let result=false;panels.each(function(xx,pp){if($(pp).hasClass("show")){result=true;}}) return result;}})});})(window.jQuery,window,document);;;