"use strict";var MeteoFR=MeteoFR||{};extend(MeteoFR,{atmogramme:{data:{ATMO_NAME:"atmo",BASE_HEIGHT:26,BASE_LINEHEIGHT:26,BASE_WIDTH:50,CHART_HEIGHT:180,CONTENT_NAME:"content",TABLE_NAME:"tableweather",FONT_MIN:10,HEIGHT_INCREMENT:10,LINEHEIGHT_INCREMENT:4,LINK_NAME:"links",AtmogrammeData:function(e){return new function(){this.tabLinks={},this.contentDivs={},this.charts={},this.atmoData={},this.zoomDisplay=[],this.currentZoom=0,this.addAtmogramme=function(e,t){this.tabLinks[MeteoFR.atmogramme.data.LINK_NAME+e]={},this.contentDivs[MeteoFR.atmogramme.data.CONTENT_NAME+e]={};for(var a=0;a-1;h=parseInt(h),n="undefined"!=typeof n?n:m.BASE_HEIGHT,i="undefined"!=typeof i?i:m.BASE_LINEHEIGHT,o="undefined"!=typeof o?o:h,r="undefined"==typeof r?h:r;var u=d>n+2,p=c>m.BASE_WIDTH;return(u||p)&&(h>m.FONT_MIN?(h--,i-=m.LINEHEIGHT_INCREMENT):u&&(n+=m.HEIGHT_INCREMENT,i-=m.LINEHEIGHT_INCREMENT,h=r),s.style.cssText="font-size: "+h+(g?"em":"px")+";min-height: "+n+"px; line-height: "+i+"px;",u||h>m.FONT_MIN)?m.calculateHeightAndFontSize(e,t,a,n,i,h,r,s):{height:n,lineHeight:i,fontSize:h+(g?"em":"px")}},launchResize:function(e){var t=MeteoFR.atmogramme.data;if(t.hasOwnProperty(e))if(Object.keys)for(var a=Object.keys(t[e]),n=0;n",{"class":"autocomplete needsclick",placeholder:"Insee, nom de commune ou de station"});m.append(''),$(e)[0].fire(Page.Event.caption.select,m);var l=t.listeInfo,d={};for(var c in t.listeInfo)d[t.listeInfo[c].insee]=t.listeInfo[c];if(t.nonAlpha)var h="order";else if(t.isTypeAero)var h="insee";else var h="info";var g=m.selectize({valueField:"insee",labelField:"info",searchField:["info","insee"],sortField:h,options:l,render:{item:function(e,a){return t.isTypeAero?"
"+(e.insee?''+a(e.insee)+"":"")+(e.info?' - '+e.info+"":"")+"
":"
"+(e.info?''+a(e.info)+"":"")+"
"},option:function(e,a){if(t.isTypeAero){var n=e.insee||e.info;return'
'+a(n)+""+(e.info?' - '+e.info+"":"")+"
"}var n=e.info||e.insee;return'
'+a(n)+""+(e.insee?' - '+e.insee+""}},create:!1,onDropdownOpen:function(){t.declutering&&u.removeOption(g[0].selectize.getValue()),this.$input.get(0).selectize.clear(!0)},onBlur:function(){u.addOption({insee:i,info:o}),""==g[0].selectize.getValue()&&i&&u.setValue([i],!0)},onChange:function(){var e=a+"/page/index/affiche/id/",t=g[0].selectize.getValue();if(t.length>0&&i!==t)if("undefined"==typeof d[t]||"undefined"!=typeof d[t]&&"undefined"==typeof d[t].page){var o=location.pathname.substr(location.pathname.lastIndexOf("/id/")+4);o=o.replace("insee",r);var m=o.lastIndexOf(r+"/"),l=o.substr(m);if(l.lastIndexOf(r+"/"+i)==-1){var c=l.substr(l.indexOf("/")+1);i=c.indexOf("/")==-1?c:c.substr(0,c.indexOf("/"))}if("/"!==o.substring(o.length-1,o.length)&&(o+="/"),"undefined"!=typeof s)for(var h in s[r])o.lastIndexOf(s[r][h]+"/"+i)==-1?o+=s[r][h]+"/"+t+"/":o=o.replace(s[r][h]+"/"+i,s[r][h]+"/"+t);if("EchbyEch"==i){var u=o.substr(o.lastIndexOf("/ech/")+5);o=o.replace("ech/"+u,"")}"EchbyEch"==t&&(t+="/ech/0"),o.lastIndexOf(r+"/"+i)==-1?o+=r+"/"+t+"/":o=o.replace(r+"/"+i,r+"/"+t),o=o.replace("mode/fenetre/",""),location.href=e+o+n}else if("undefined"!=typeof d[t]){var p=d[t].page;r="",$.ajax({type:"GET",url:a+"/atmogramme/index/contenu-page/?id="+p,dataType:"json"}).then(function(a){for(var i in a)r+=a[i]+"/"+t+"/";location.href=e+p+"/"+r+n})}},load:function(e,n){if(t.declutering){if(e.length<3)return n();e+="",$.ajax({url:a+"/atmogramme/index/select",type:"GET",dataType:"json",data:{info:e,type:t.typePoint,page:i,cond:t.metacond},error:function(){n()},success:function(e){n(e)}})}}}),u=g[0].selectize;0==t.listeInfo.length&&u.addOption({insee:i,info:o}),u.setValue([i],!0)}},e});var MeteoFR=MeteoFR||{};extend(MeteoFR,{atmogramme:{constantes:{CATEGORIES:"cat",DATA:"data",DESCR:"descr",HEIGHT:"height",HISTO_CAT:"histoCat",HISTO_DATA:"histoData",HISTO_MAX:"histoMax",MAX:"max",MIN:"min",PARAM:"param",PICTOS:"pictos",WEATHER:["TS","TSspe"],WIND:["DD","DDspe"],WIDTH:"width",URL:"url"}}});var MeteoFR=MeteoFR||{};if(extend(MeteoFR,{atmogramme:{graphics:{TRANSLATION:45,justifyColumns:function(e){for(var t=e.plotSizeX/(1+e.xAxis[0].max-e.xAxis[0].min),a=Highcharts.each,n=void 0,i=e.xAxis[0].categories,o=void 0,r=function(i){n=0,a(e.series,function(e,t){e.visible&&e.options&&"column"===e.options.type&&e.data&&e.data[i]&&0!==e.data[i].y&&null!==e.data[i].y&&e.userOptions&&e.userOptions.shift&&n++}),o=1,a(e.series,function(e,r){e.visible&&e.options&&"column"===e.options.type&&e.userOptions&&e.userOptions.shift&&a(e.data,function(a,r){if(i===r&&"undefined"!=typeof a.graphic&&e.data&&e.data[i]&&0!==e.data[i].y&&null!==e.data[i].y){var s=t/(n+1);a.graphic.element.width.baseVal.value=s,a.pointWidth=s,a.graphic.element.x.baseVal.value=(i+1)*t-(o-n/2)*s,o++}})})},s=0;s1){for(var o=1;o"+u+""),c.push(""+y+"")):l.push(""+u+"")}}var b=[],E=[],T=[],_=new RegExp(/.*(\s\(.{2,4}\)).*/);if(n)Highcharts.each(e.points,function(e){var t,a,n=e.series;if(t=n.userOptions.hasOwnProperty("shift")&&0!=r?Highcharts.pick(n.data[r-1].value,n.data[r-1].y):Highcharts.pick(e.point.value,e.y),a=Highcharts.pick(e.point.value,e.y),void 0!==t){var i=n.name,o=_.exec(i),s="";o&&(s=o[1],i=i.replace(o[1],""),s=s.replace("(",""),s=s.replace(")",""));var m=' '+i+': '+t+s+"",l=' '+i+': '+a+s+"";n.userOptions.hasOwnProperty("shift")?(E.push(m),T.push(l)):b.push(m)}});else{var M,A=e.point.series;if(M=Highcharts.pick(e.point.value,e.y),void 0!==M){var S=A.name,R=_.exec(S),x="";R&&(x=R[1],S=S.replace(R[1],""),x=x.replace("(",""),x=x.replace(")",""));var u=' '+S+': '+M+x+"";A.userOptions.hasOwnProperty("shift")?E.push(u):b.push(u)}}var N=o.getTime(e.x),F="",L="",I="";""!==N&&(L='',I='',0===r&&"None"!==m[0]?L+=i.data.atmogrammeJS.translation.before+o.getTime(m[r])+":":0===r&&"None"===m[0]?(L+=i.data.atmogrammeJS.translation.before+o.getTime(m[r+1])+":",I+=L):1===r&&"None"===m[0]?s?(F+=i.data.atmogrammeJS.translation.before+o.getTime(m[r])+":",L+=F,I+=i.data.atmogrammeJS.translation.between+o.getTime(m[r])+i.data.atmogrammeJS.translation.and+o.getTime(m[r+1])+":"):(F=i.data.atmogrammeJS.translation.between+o.getTime(m[r])+i.data.atmogrammeJS.translation.and+o.getTime(m[r+1])+":",L+=F,I=L):(F=s?i.data.atmogrammeJS.translation.between+o.getTime(m[r-1])+i.data.atmogrammeJS.translation.and+o.getTime(m[r])+":":i.data.atmogrammeJS.translation.between+o.getTime(m[r])+i.data.atmogrammeJS.translation.and+o.getTime(m[r+1])+":",L+=F,I+=i.data.atmogrammeJS.translation.between+o.getTime(m[r])+i.data.atmogrammeJS.translation.and+o.getTime(m[r+1])+":"),L+="",I+="");var H=o.getTooltipText(d,E,L);if(""!=H&&(H+="
"),""!==N)var O=''+N+":";else var O="";var w=o.getTooltipText(l,b,O);if(""==w){if(n){var H=o.getTooltipText(c,T,I);""!==H&&(H+="
")}}else H+=o.getTooltipText(l,b,O);return H||!1},getTooltipText:function(e,t,a){var n="",i=window.innerWidth0||t instanceof Array&&t.length>0){(e instanceof Array&&e.length>0&&i||!i)&&(n+=""+a+"");for(var o=0;o"+e[o];if(t instanceof Array&&t.length>0&&!i){n+="
";for(var o=0;o"}}return n},drawWeatherSymbols:function(e,t,a,n){var i=MeteoFR.atmogramme,o=i.data.atmogrammeJS.atmoData[t][a][MeteoFR.atmogramme.constantes.PICTOS],r=i.graphics;if(o)for(var s,m=r.calculateRange(e),l=0;l=0){var i=t.series[n];i.visible?(i.setVisible(!1,!1),e.classList.add("disabled")):(i.setVisible(!0,!1),e.classList.remove("disabled"))}})},_setLegendSymbol:function(e,t){if("undefined"!=typeof t.userOptions){var a=t.userOptions.type?t.userOptions.type:"line";e.classList.add(a)}},handleZoomOnLoad:function(e){var t=MeteoFR.atmogramme,a=t.data,n=a.atmogrammeJS.currentZoom,i=a.atmogrammeJS.zoomDisplay[n];i.threshold&&i.threshold.length>1&&(e.yAxis[0].addPlotLine({color:"red",width:2,value:i.threshold[0],label:{text:i.threshold[0],style:{color:"red",fontWeight:"bold"},x:30,y:-2},id:"lower-threshold-"+n}),e.yAxis[0].addPlotLine({color:"red",width:2,value:i.threshold[1],label:{text:i.threshold[1],style:{color:"red",fontWeight:"bold"},x:30,y:-2},id:"higher-threshold-"+n}))},xAxisLabelFormatter:function(){var e=this.value.indexOf("-");return"None"==this.value?this.value="":e>-1&&(this.value=""+this.value.slice(e+1)+""),this.value},xAxisLabelFormatterForZoom:function(){var e=this.value.indexOf("-");if("None"==this.value)this.value="";else if(e>-1){var t=this.value.slice(0,e);this.value=""+this.value.slice(this.value.indexOf("-")+1)+"
"+t+""}return this.value},yAxisLabelFormatter:function(){var e=this.y;return 0==e&&(e=""),e},checkIsEmpty:function(e){var t=!0;if(void 0!=e&&e[0].hasOwnProperty("data"))for(var a=e[0].data,n="",i=0;i");return"

"+a+'

'+n+""},track:!0,hide:!1,show:!1,delay:5})});var confinfobulleatmo=!0}var MeteoFR=MeteoFR||{};extend(MeteoFR,{atmogramme:{resize:{ELEMENT_HEIGHT_MAX:50,ELEMENT_HEIGHT_MIN:20,heightableElements:[".container_param:not(.incrementedHeight)","container_param_courbe_nodata",".container_value:not(.incrementedHeight)",".container_value_left:not(.seuil)",".container_value_big",".container_value_left_big",".container_decalage:not(.incrementedHeight)",".container_daily_empty",".container_day_text",".container_hour",".container_hour_big",".container_datas img",".time-caption",".label-empty",".container_decalage-days",".container_decalage-hours"],addEvent:function(){window.addEventListener("load",this.initScrollEvent.bind(this)),this.resizeHandler||(window.addEventListener("resize",this._onResize.debounce(200).bind(this)),this.resizeHandler=!0)},initScrollEvent:function(){var e=document.querySelectorAll(".tabsAtmo, .tableCssWeather");e.forEach(function(e){var t=e;if(t&&!t.hasAtmogrammeEvents){t.addEventListener("scroll",this._closeParametersPanel.bind(this,t,!1).debounce(100)),t.addEventListener("touchmove",this._openParametersPanel.bind(this,t,!1).debounce(100)),t.hasAtmogrammeEvents=!0;var a=t.querySelector(".container_params");a&&a.addEventListener("click",function(e){t.classList.contains("not-detailed")?this._closeParametersPanel(t,!0,e):this._openParametersPanel(t,!0,e)}.bind(this))}},this)},_onResize:function(){this.resize()},_openParametersPanel:function(e,t,a){if(this._isNotReset(e)||t&&"click"===a.type&&a.target&&null===a.target.closest(".atmogramme-legend-item")){e.classList.add("not-detailed");var n=e.querySelector(".container_params");n&&n.classList.add("not-detailed")}},_closeParametersPanel:function(e,t,a){if(!this._isNotReset(e)||t&&"click"===a.type&&a.target&&null===a.target.closest(".atmogramme-legend-item")){e.classList.remove("not-detailed");var n=e.querySelector(".container_params");n&&n.classList.remove("not-detailed")}},_isNotReset:function(e){return e.scrollLeft>0},resize:function(e){var t=e?[e]:document.querySelectorAll(".tabsAtmo, .tableCssWeather");if(window.innerWidth1?document.querySelector(".slider-wrapper").offsetHeight:0;t.forEach(function(e){this.isHidden(e)||(e.style.height="",setTimeout(function(){this._fitToHeight(e,a),this._reAdjustHeight(e),this._fixTimeline(e,a)}.bind(this),500))},this)}else t.forEach(function(e){e.style.height="",this.heightableElements.forEach(function(t){var a=e.querySelectorAll(t);this._resetElements(a)},this)},this);t.forEach(function(e){var t=window.innerWidth li > a");this._renameTabs(a,t)},this)},_fixTimeline:function(e,t){var a=e.getBoundingClientRect().top,n=window.innerHeight,i=n-a-t;e.style.height=i+"px"},_renameTabs:function(e,t){e&&t?e.forEach(function(e){e.textContent=e.getAttribute("data-mobile-name")}):e.forEach(function(e){e.textContent=e.getAttribute("data-desktop-name")})},_fitToHeight:function(e,t){var a=e.getBoundingClientRect().top,n=e.querySelectorAll(".container_param"),i=e.querySelectorAll(".container_param.seuil"),o=e.querySelectorAll(".container_param.incrementedHeight"),r=e.querySelectorAll(".container_param_courbe"),s=e.querySelectorAll(".container_param_courbe_nodata"),m=e.querySelector(".atmogramme-img-legend"),l=null!==m?m.offsetHeight:0,d=n.length,c=i.length,h=o.length,g=r.length,u=s.length,p=null!==e.querySelector(".container_hours")?1:0,f=1,v=c>0?2*e.querySelector(".container_value.seuil, .container_value_left.seuil, .container_value_left_big.seuil").getBoundingClientRect().height:0,y=g>0?r.item(0).getBoundingClientRect().height:0,b=u>0?s.item(0).getBoundingClientRect().height:0,E=h>0?o.item(0).getBoundingClientRect().height:0,T=(window.innerHeight-a-t-l-g*y-u*b-h*E-c*v)/(d+p+f),_=Math.min(Math.max(T,MeteoFR.atmogramme.data.BASE_HEIGHT),this.ELEMENT_HEIGHT_MAX);this.heightableElements.forEach(function(t){var a=e.querySelectorAll(t);this._resizeElements(a,_)},this)},_reAdjustHeight:function(e){var t=e.querySelectorAll(".label-empty"),a=e.querySelectorAll(".container-top .container_day_text"),n=e.querySelectorAll(".container_decalage-days"),i=void 0;t.forEach(function(t){i=void 0!==i?i:this._getFittedTopDivHeight(t,e),this._resizeElement(t,i)},this),a.forEach(function(t){i=void 0!==i?i:this._getFittedTopDivHeight(t,e),this._resizeElement(t,i)},this),n.forEach(function(t){i=void 0!==i?i:this._getFittedTopDivHeight(t,e),this._resizeElement(t,i)},this)},_getFittedTopDivHeight:function(e,t){var a=t.parentNode,n=a.querySelector("ul"),i=this.getComputedHeight(a),o=null!==n?this.getComputedHeight(n):0,r=this.getComputedHeight(t),s=i-o-r;return Math.max(Math.min(e.offsetHeight+s,this.ELEMENT_HEIGHT_MAX),this.ELEMENT_HEIGHT_MIN)},_resetElements:function(e){e.forEach(function(e){e instanceof HTMLImageElement?e.style["max-height"]="":(e.style["min-height"]="",e.style["line-height"]="")},this)},_resizeElements:function(e,t){e.forEach(function(e){this._resizeElement(e,t)},this)},_resizeElement:function(e,t){e instanceof HTMLImageElement?e.style["max-height"]=t-4+"px":(e.style["min-height"]=t+"px",e.style["line-height"]=t+"px",e.style["max-height"]=t+"px")},getComputedHeight:function(e){return parseFloat(window.getComputedStyle(e).height)},isHidden:function(e){return null===e.offsetParent}}}});var MeteoFR=MeteoFR||{};extend(MeteoFR,{atmogramme:{displayedTab:MeteoFR.atmogramme.displayedTab||[],tabbedPane:{init:function(e){var t=document.getElementById("tabs_"+e),a=MeteoFR.atmogramme,n=a.data,i=n.LINK_NAME+e,o=n.CONTENT_NAME+e;if(t){var r=t.childNodes;if(r.length>0){for(var s=0;s-1)){MeteoFR.atmogramme.displayedTab.push(e);var a=MeteoFR.atmogramme.data;if(a.hasOwnProperty(e))if(Object.keys)for(var n=Object.keys(a[e]),i=0;i