0&&void 0!==arguments[0]?arguments[0]:{},n=t.svgNode,o=void 0===n?void 0:n,i=t.coordinateSystem,r=void 0===i?void 0:i,a=t.x,c=void 0===a?0:a,f=t.y,d=void 0===f?0:f,p=t.width,h=void 0===p?100:p,v=t.height,m=void 0===v?100:v,g=t.style,w=void 0===g?{}:g,O=t.visible,_=void 0===O||O,P=t.events,S=void 0===P?{}:P,j=t.dataGroupIds,T=void 0===j?["temp","dewp","wetbulb"]:j,k=t.getCoordinatesByLevelData,x=void 0===k?function(e,t,n,o){if(void 0===n.pres)return{};var i=void 0;switch(e){case"temp":i=n.tmpk;break;case"dewp":i=n.dwpk;break;case"wetbulb":i=u(n.tmpk,n.dwpk,n.pres)}return void 0===i?{}:{x:o.coordinateSystem.getXByPT(n.pres,i),y:o.coordinateSystem.height-o.coordinateSystem.getYByPT(n.pres,i),value:Math.round(10*b(i))/10,unit:"℃"}}:k,E=t.insertDataGroupInto,R=void 0===E?function(e,t,n,o){if(!(t in n.options.diagram)||n.options.diagram[t].visible){var i=t in n.options.diagram?n.options.diagram[t].style:{};e.group().polyline(o.map((function(e){return[e.x,e.y]}))).fill("none").stroke(i)}}:E,N=t.filterDataPoint,C=void 0===N?void 0:N,B=t.minDataPointsDistance,I=void 0===B?0:B,D=t.isobars,L=void 0===D?{}:D,A=t.isotherms,M=void 0===A?{}:A,V=t.dryadiabats,G=void 0===V?{}:V,F=t.pseudoadiabats,Y=void 0===F?{}:F,z=t.mixingratio,X=void 0===z?{}:z,H=t.hoverLabels,q=void 0===H?{}:H,K=t.parcels,U=void 0===K?{}:K;return ul(this,l),e=s.call(this,{svgNode:o,coordinateSystem:r,x:c,y:d,width:h,height:m,style:w,visible:_,events:S,hoverLabels:q,getSoundingVisibility:function(e){return e.visible&&e.options.diagram.visible},dataGroupIds:T,getCoordinatesByLevelData:x,insertDataGroupInto:R,filterDataPoint:C,minDataPointsDistance:I}),e.options={isobars:ml(L),isotherms:ml(M,{highlightedLines:[y(0)]}),dryadiabats:ml(G),pseudoadiabats:ml(Y,{style:{color:"rgb(102, 51, 0)",dasharray:6}}),mixingratio:ml(X,{minPressure:500,style:{color:"rgb(102, 51, 0)",dasharray:2}})},e.svgGroups={border:e._svgNodeBackground.group(),isobars:e._svgNodeBackground.group(),isotherms:e._svgNodeBackground.group(),dryadiabats:e._svgNodeBackground.group(),mixingratio:e._svgNodeBackground.group(),pseudoadiabats:e._svgNodeBackground.group()},e._parcelsOptions=U,"visible"in e._parcelsOptions||(e._parcelsOptions.visible=!0),e._parcels=new Map,e.on("add:sounding",(function(t){var n={parcelsGroup:void 0,parcelsGroups:new Map,addItemListenerKey:void 0,removeItemListenerKey:void 0,changeVisibleListeners:[],changeOptionsListeners:[]},o=function(o){n.changeVisibleListeners.push({diagramParcel:o,listenerKey:o.on("change:visible",(function(){if(n.parcelsGroups.has(o)){var e=n.parcelsGroups.get(o);o.visible?e.show():e.hide()}}))}),n.changeOptionsListeners.push({diagramParcel:o,listenerKey:o.on("change:options",(function(){var n=e._parcels.get(t);if(void 0!==n){var i=n.parcelsGroups.get(o);void 0!==i&&(n.parcelsGroups.delete(o),i.remove())}e.drawParcel(t,o)}))})};n.addItemListenerKey=t.diagramParcelCollection.on("add:item",(function(n){o(n),e.drawParcel(t,n)})),n.removeItemListenerKey=t.diagramParcelCollection.on("remove:item",(function(e){var t=n.parcelsGroups.get(e);void 0!==t&&(n.parcelsGroups.delete(e),t.remove())}));var i,r=sl(t.diagramParcelCollection);try{for(r.s();!(i=r.n()).done;){var a=i.value;o(a)}}catch(e){r.e(e)}finally{r.f()}e._parcels.set(t,n)})),e.on("remove:sounding",(function(t){if(e._parcels.has(t)){var n=e._parcels.get(t);t.diagramParcelCollection.un("add:item",n.addItemListenerKey),t.diagramParcelCollection.un("remove:item",n.removeItemListenerKey),n.changeVisibleListeners.forEach((function(e){return e.diagramParcel.un("change:visible",e.listenerKey)})),n.changeOptionsListeners.forEach((function(e){return e.diagramParcel.un("change:options",e.listenerKey)}))}e._parcels.delete(t)})),e.init(),e}return n=l,o=[{key:"getIsobarsVisible",value:function(){return this.options.isobars.visible}},{key:"setIsobarsVisible",value:function(e){return this.options.isobars.visible=!!e,this.plotIsobars(),this}},{key:"getIsothermsVisible",value:function(){return this.options.isotherms.visible}},{key:"setIsothermsVisible",value:function(e){return this.options.isotherms.visible=!!e,this.plotIsotherms(),this}},{key:"getDryadiabatsVisible",value:function(){return this.options.dryadiabats.visible}},{key:"setDryadiabatsVisible",value:function(e){return this.options.dryadiabats.visible=!!e,this.plotDryadiabats(),this}},{key:"getPseudoadiabatsVisible",value:function(){return this.options.pseudoadiabats.visible}},{key:"setPseudoadiabatsVisible",value:function(e){return this.options.pseudoadiabats.visible=!!e,this.plotPseudoadiabats(),this}},{key:"getMixingratioVisible",value:function(){return this.options.mixingratio.visible}},{key:"setMixingratioVisible",value:function(e){return this.options.mixingratio.visible=!!e,this.plotMixingratio(),this}},{key:"drawSounding",value:function(e,t){if(fl(vl(l.prototype),"drawSounding",this).call(this,e,t),this._parcels.has(e)){var n=this._parcels.get(e);n.parcelsGroup=t.group(),e.options.parcels.visible||n.parcelsGroup.hide(),this._parcels.set(e,n)}this.drawParcels(e)}},{key:"drawParcels",value:function(e){if(this._parcelsOptions.visible&&this._parcels.has(e)){var t=this._parcels.get(e);t.parcelsGroup.clear(),t.parcelsGroups.clear();var n,o=sl(e.diagramParcelCollection);try{for(o.s();!(n=o.n()).done;){var i=n.value;this.drawParcel(e,i)}}catch(e){o.e(e)}finally{o.f()}}}},{key:"drawParcel",value:function(e,t){var n=this,o=t.parcel;if(void 0!==o.pres&&void 0!==o.tmpc&&void 0!==o.dwpc&&this._parcels.has(e)){var i=this._parcels.get(e),a=i.parcelsGroup.group();i.parcelsGroups.set(t,a),this._parcels.set(e,i);var s=r(y(o.tmpc),o.pres),l=d(y(o.dwpc),o.pres),u=p(s,l),f=v(y(o.tmpc),y(o.dwpc)),h=c(f,f,u),b=t.options;b.visible||a.hide();var m=a.group();b.temp.visible||m.hide();var g=a.group();b.dewp.visible||g.hide();var w=10,O=this.coordinateSystem.getYByPT(o.pres,y(o.tmpc)),_=this.coordinateSystem.getXByYPotentialTemperature(O,s),P=this.coordinateSystem.getYByPPotentialTemperatur(u,s),S=this.coordinateSystem.getXByYPotentialTemperature(P,s),j=[[_,O]];if(!this.coordinateSystem.isDryAdiabatStraightLine())for(var T=O+w;T500?100:i>50?10:1},(function(e){var n=t.coordinateSystem.getYByXP(0,e);return[[0,n],[t.coordinateSystem.width,n]]}),e)}},{key:"plotIsotherms",value:function(e){var t=this,n=b(this.coordinateSystem.getTByXY(0,this.coordinateSystem.height)),o=b(this.coordinateSystem.getTByXY(this.coordinateSystem.width,0)),i=o-n;this._plotLines(this.svgGroups.isotherms,this.options.isotherms,{min:n,max:o,interval:i>50?10:5},(function(e){e=y(e);var n=[[void 0,void 0],[void 0,void 0]];return t.coordinateSystem.isIsothermsVertical()?(n[0][1]=0,n[1][1]=t.coordinateSystem.height,n[0][0]=n[1][0]=t.coordinateSystem.getXByYT(n[0][1],e)):(n[0][1]=0,n[0][0]=t.coordinateSystem.getXByYT(n[0][1],e),n[0][0]<0&&(n[0][1]=t.coordinateSystem.getYByXT(n[0][0]=0,e)),n[1][0]=t.coordinateSystem.width,n[1][1]=t.coordinateSystem.getYByXT(n[1][0],e),void 0===n[1][1]?(n[1][0]=n[0][0],n[1][1]=t.coordinateSystem.height):n[1][1]>t.coordinateSystem.height&&(n[1][1]=t.coordinateSystem.height,n[1][0]=t.coordinateSystem.getXByYT(n[1][1],e))),n}),e)}},{key:"plotDryadiabats",value:function(e){var t=this;this._plotLines(this.svgGroups.dryadiabats,this.options.dryadiabats,{min:b(r(this.coordinateSystem.getTByXY(0,0),this.coordinateSystem.getPByXY(0,0))),max:b(r(this.coordinateSystem.getTByXY(this.coordinateSystem.width,this.coordinateSystem.height),this.coordinateSystem.getPByXY(this.coordinateSystem.width,this.coordinateSystem.height))),interval:10},(function(e){var n=y(e),o=0,i=t.coordinateSystem.getXByYPotentialTemperature(o,n);(void 0===i||i>t.coordinateSystem.width)&&(i=t.coordinateSystem.width,o=t.coordinateSystem.getYByXPotentialTemperature(i,n));var r=0,a=t.coordinateSystem.getYByXPotentialTemperature(r,n);if((void 0===a||a>t.coordinateSystem.height)&&(a=t.coordinateSystem.height,r=t.coordinateSystem.getXByYPotentialTemperature(a,n)),void 0!==i&&void 0!==o&&void 0!==r&&void 0!==a){if(t.coordinateSystem.isDryAdiabatStraightLine())return[[i,o],[r,a]];for(var s=[[i,o]],l=o+10;l3&&void 0!==arguments[3]?arguments[3]:{},r=i.length,a=void 0===r?60:r,s=i.align,l=void 0===s?"left":s,u=i.horizontalMargin,c=void 0===u?void 0:u,f=i.verticalMargin,d=void 0===f?void 0:f,p=i.style,h=void 0===p?{}:p,v=i.font,y=void 0===v?{}:v,b=i.fill,m=void 0===b?{}:b,g=0,w=a,O=/^([0-9]+)%$/.exec(w);O&&(w=O[1]/100*o.width),"right"==l&&(g=o.width,w=o.width-w);var _=o.height-o.getYByXP(0,n.pres);h=ca(h),e.line([[Math.min(g,w),_],[Math.max(g,w),_]]).stroke(h),(y=fa(y))["alignment-baseline"]="bottom",ya({node:e,text:"".concat(Math.round(n.pres)," hPa"),x:g,y:_,horizontalMargin:c,verticalMargin:d,font:y,fill:m}),y["alignment-baseline"]="top";var P=void 0===n.hght?"~".concat(Math.round(t(n.pres))," m"):"".concat(Math.round(n.hght)," m");ya({node:e,text:P,x:g,y:_,horizontalMargin:c,verticalMargin:d,font:y,fill:m})}(l,s,r.coordinateSystem,e),r.dataGroupIds.reverse().forEach((function(e){var t={visible:!1};switch(e){case"temp":t=n;break;case"dewp":t=o;break;case"wetbulb":t=i}if(t.visible){var u=r._getCoordinatesByLevelData(e,a,s,r),c=u.x,f=u.y,d=u.value,p=u.unit;if(void 0!==c&&void 0!==f){var h=e in r.hoverLabelsSounding.options.diagram?r.hoverLabelsSounding.options.diagram[e].style.width:3,v=void 0===t.radius?h+t.radiusPlus:t.radius,y=t.style;!("color"in y)&&e in r.hoverLabelsSounding.options.diagram&&(y.color=a.options.diagram[e].style.color),l.circle(2*v).attr({cx:c,cy:f}).fill(y),ya({node:l,text:"".concat(d," ").concat(p),x:c,y:f,horizontalMargin:t.horizontalMargin,verticalMargin:t.verticalMargin,font:t.font,fill:t.fill})}}})))}}}],o&&cl(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),l}(rl);const bl=yl;function ml(e){var t=e.highlightedLines,n=void 0===t?void 0:t,o=e.interval,i=void 0===o?void 0:o,r=e.lines,a=void 0===r?void 0:r,s=e.max,l=void 0===s?void 0:s,u=e.min,c=void 0===u?void 0:u,f=e.maxPressure,d=void 0===f?void 0:f,p=e.minPressure,h=void 0===p?void 0:p,v=e.style,y=void 0===v?void 0:v,b=e.visible,m=void 0===b?void 0:b,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{highlightedLines:va(n,g.highlightedLines),interval:va(i,g.interval),lines:va(a,g.lines),max:va(l,g.max),min:va(c,g.min),maxPressure:va(d,g.maxPressure),minPressure:va(h,g.minPressure),style:ca(y,g.style),visible:va(m,g.visible,!0)}}function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function wl(e,t){return wl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wl(e,t)}function Ol(e,t){if(t&&("object"===gl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _l(e){return _l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_l(e)}var Pl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wl(e,t)}(r,e);var t,n,o,i=(n=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_l(n);if(o){var i=_l(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return Ol(this,e)});function r(e){var t,n=e.svgNode,o=void 0===n?void 0:n,a=e.coordinateSystem,s=void 0===a?void 0:a,l=e.x,u=void 0===l?void 0:l,c=e.y,f=void 0===c?void 0:c,d=e.width,p=void 0===d?void 0:d,h=e.height,v=void 0===h?void 0:h,y=e.style,b=void 0===y?{}:y,m=e.visible,g=void 0===m||m,w=e.events,O=void 0===w?{}:w,_=e.hoverLabels,P=void 0===_?{}:_,S=e.windbarbLength,j=void 0===S?void 0:S,T=e.dataGroupIds,k=void 0===T?["windbarbs"]:T,x=e.getCoordinatesByLevelData,E=void 0===x?function(e,t,n,o){return void 0===n.pres||void 0===n.wspd||void 0===n.wdir?{}:{x:o.width/2,y:o.coordinateSystem.height-o.coordinateSystem.getYByXP(0,n.pres)}}:x,R=e.insertDataGroupInto,N=void 0===R?function(e,t,n,o,i){o.forEach((function(t){ba({node:e,x:i.width/2,y:t.y,wspd:t.levelData.wspd,wdir:t.levelData.wdir,length:i._windbarbLength,strokeStyle:n.options.windprofile.windbarbs.style})}))}:R,C=e.filterDataPoint,B=void 0===C?void 0:C,I=e.minDataPointsDistance,D=void 0===I?void 0:I;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t=i.call(this,{svgNode:o,coordinateSystem:s,x:u,y:f,width:p,height:v,style:b,visible:g,events:O,hoverLabels:P,getSoundingVisibility:function(e){return e.visible&&e.options.windprofile.windbarbs.visible},dataGroupIds:k,getCoordinatesByLevelData:E,insertDataGroupInto:N,filterDataPoint:B,minDataPointsDistance:void 0===D?0:D}),t._windbarbLength=j,void 0===t._windbarbLength&&(t._windbarbLength=2*t.width/5),void 0===D&&(t.minDataPointsDistance=t._windbarbLength/2),t.init(),t}return t=r,Object.defineProperty(t,"prototype",{writable:!1}),t}(rl);const Sl=Pl;function jl(e){return jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jl(e)}var Tl=["min","max","interval"];function kl(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function El(e){for(var t=1;t