map-core-func 0.1.82 → 0.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -158,4 +158,4 @@ and limitations under the License.
|
|
|
158
158
|
* maptalks.animatemarker v0.4.1
|
|
159
159
|
* LICENSE : MIT
|
|
160
160
|
* (c) 2016-2017 maptalks.org
|
|
161
|
-
*/function dR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AR(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function yR(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var vR,mR={markerType:"ellipse",markerFill:(vR=[135,196,240],{type:"radial",colorStops:[[.7,"rgba("+vR.join()+", 0.5)"],[.3,"rgba("+vR.join()+", 1)"],[.2,"rgba("+vR.join()+", 1)"],[0,"rgba("+vR.join()+", 0)"]]}),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},_R=function(t){function n(){return dR(this,n),AR(this,t.apply(this,arguments))}return yR(n,t),n.prototype.addGeometry=function(n){return n instanceof r&&(n=[n]),n.forEach((function(t,r){if(!(t instanceof e))throw new Error("The geometry at "+r+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},n.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var e=new n(t.id,t.options),i=t.geometries,o=[],s=0;s<i.length;s++){var a=r.fromJSON(i[s]);a&&o.push(a)}return e.addGeometry(o),t.style&&e.setStyle(t.style),e},n}(n);_R.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),_R.registerJSONType("AnimateMarkerLayer"),_R.registerRenderer("canvas",function(t){function r(){return dR(this,r),AR(this,t.apply(this,arguments))}return yR(r,t),r.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},r.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},r.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},r.prototype.onCanvasCreate=function(){this._prepare()},r.prototype.onGeometryAdd=function(){this._redraw()},r.prototype.onGeometryRemove=function(){this._redraw()},r.prototype.onGeometrySymbolChange=function(){this._redraw()},r.prototype.onGeometryPositionChange=function(){this._redraw()},r.prototype.onGeometryShow=function(){this._redraw()},r.prototype.onGeometryHide=function(){this._redraw()},r.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},r.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},r.prototype._drawAllMarkers=function(t){var e=this,r=this.getMap(),n=r.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=r._prjToContainerPoint(t.coordinates);n.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=r._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},r.prototype._drawMarker=function(t,e,r,n){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(n-t.start)%i/i,u=r.fade&&a>=.5?2-2*a:1,l=r.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,g=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-g*l/2,p*l,g*l),o.globalAlpha=s)},r.prototype._prepare=function(){var t=this,e=[],r={},n=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?mR:i._getInternalSymbol(),s=JSON.stringify(o);r[s]||(r[s]=o),e.push({coordinates:n.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(r),this._currentMarkers=e},r.prototype._prepareSprites=function(t){for(var r in this._spriteCache={},t){var n=t[r],i=new e([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[r]=i}},r.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},r.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},r=this.layer.options.animation?this.layer.options.animation.split(","):[],n=0;n<r.length;n++){var i=(t=r[n]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},r}(i.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var IR=function(){function e(r,n,i){Qe(this,e),this.map=i;var o=n.color||[255,0,0],s=n.opacity||.8,a=n.width||20,u=n.height||20,l=n.animationDuration||3e3,h=n.markerDx||0,c=n.markerDy||0,f=t.GeoJSON.toGeometry(r);this.layer=new _R(t.Util.GUID(),f,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:h,markerDy:c}}]).addTo(i)}return Fe(e,[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}]),e}();const ER=Object.prototype.hasOwnProperty,xR="undefined"!=typeof Symbol?Symbol.toStringTag:void 0;function wR(t){if(!function(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}(t))return!1;const e=function(t){if(null===t)return void 0===t?"[object Undefined]":"[object Null]";if(!xR||!(xR in Object(t)))return toString.call(t);const e=ER.call(t,xR),r=t[xR];let n=!1;try{t[xR]=void 0,n=!0}catch(t){}const i=Object.prototype.toString.call(t);return n&&(e?t[xR]=r:delete t[xR]),i}(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}function CR(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)}function bR(t,...e){return Object.assign(t,...e)}const SR={};function BR(t,e){SR[e]||(!function(t,e){console.warn(`${e||"wind-layer"}: ${t}`)}(e,t),SR[e]=!0)}function MR(t){return null!=t&&!isNaN(t)}class TR{constructor(t,e){this.u=t,this.v=e,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u**2+this.v**2)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}}class LR{constructor(t){this.grid=[],this.xmin=t.xmin,this.xmax=t.xmax,this.ymin=t.ymin,this.ymax=t.ymax,this.cols=t.cols,this.rows=t.rows,this.us=t.us,this.vs=t.vs,this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.flipY=Boolean(t.flipY),this.ymin=Math.min(t.ymax,t.ymin),this.ymax=Math.max(t.ymax,t.ymin),this.deltaY<0&&this.ymin<this.ymax||(void 0===t.flipY&&(this.flipY=!0),console.warn("[wind-core]: The data is flipY")),this.isFields=!0;const e=Math.ceil((this.xmax-this.xmin)/t.deltaX),r=Math.ceil((this.ymax-this.ymin)/t.deltaY);e===this.cols&&r===this.rows||console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*t.deltaX)>=360,this.translateX="translateX"in t?t.translateX:this.xmax>180,"wrappedX"in t&&BR("[wind-core]: ","`wrappedX` namespace will deprecated please use `translateX` instead!"),this.wrapX=Boolean(t.wrapX),this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let t=[],e=0;const{rows:r,cols:n,us:i,vs:o}=this;for(let s=0;s<r;s++){const r=[];for(let t=0;t<n;t++,e++){let n=i[e],s=o[e],a=this.isValid(n)&&this.isValid(s);r[t]=a?new TR(n,s):null}this.isContinuous&&r.push(r[0]),t[s]=r}return t}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(t,e,r,n,i,o){const s=1-t,a=1-e,u=s*a,l=t*a,h=s*e,c=t*e,f=r.u*u+n.u*l+i.u*h+o.u*c,p=r.v*u+n.v*l+i.v*h+o.v*c;return new TR(f,p)}calculateRange(){if(!this.grid||!this.grid[0])return;const t=this.grid.length,e=this.grid[0].length;let r,n;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const e=this.grid[i][t];if(null!==e){const t=e.m||e.magnitude();void 0===r?r=t:void 0===n?(n=t,r=Math.min(r,n),n=Math.max(r,n)):(r=Math.min(t,r),n=Math.max(t,n))}}return[r,n]}isValid(t){return null!=t}getWrappedLongitudes(){let t=this.xmin,e=this.xmax;return this.translateX&&(this.isContinuous?(t=-180,e=180):(e=this.xmax-360,t=this.xmin-360)),[t,e]}contains(t,e){const[r,n]=this.getWrappedLongitudes();let i,o=t>=r&&t<=n;return i=this.deltaY>=0?e>=this.ymin&&e<=this.ymax:e>=this.ymax&&e<=this.ymin,o&&i}getDecimalIndexes(t,e){const r=function(t,e){return t-e*Math.floor(t/e)}(t-this.xmin,360)/this.deltaX;if(this.flipY){return[r,(this.ymax-e)/this.deltaY]}return[r,(this.ymin+e)/this.deltaY]}valueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;const n=this.getDecimalIndexes(t,e);let i=Math.floor(n[0]),o=Math.floor(n[1]);const s=this.clampColumnIndex(i),a=this.clampRowIndex(o);return this.valueAtIndexes(s,a)}interpolatedValueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;let[n,i]=this.getDecimalIndexes(t,e);return this.interpolatePoint(n,i)}hasValueAt(t,e){return null!==this.valueAt(t,e)}interpolatePoint(t,e){const r=this.getFourSurroundingIndexes(t,e),[n,i,o,s]=r;let a=this.getFourSurroundingValues(n,i,o,s);if(a){const[r,i,s,u]=a;return this.bilinearInterpolateVector(t-n,e-o,r,i,s,u)}return null}clampColumnIndex(t){let e=t;t<0&&(e=0);let r=this.cols-1;return t>r&&(e=r),e}clampRowIndex(t){let e=t;t<0&&(e=0);let r=this.rows-1;return t>r&&(e=r),e}getFourSurroundingIndexes(t,e){let r=Math.floor(t),n=r+1;this.isContinuous&&n>=this.cols&&(n=0),n=this.clampColumnIndex(n);let i=this.clampRowIndex(Math.floor(e));return[r,n,i,this.clampRowIndex(i+1)]}getFourSurroundingValues(t,e,r,n){let i;if(i=this.grid[r]){const r=i[t],o=i[e];if(this.isValid(r)&&this.isValid(o)&&(i=this.grid[n])){const n=i[t],s=i[e];if(this.isValid(n)&&this.isValid(s))return[r,o,n,s]}}return null}valueAtIndexes(t,e){return this.grid[e][t]}lonLatAtIndexes(t,e){return[this.longitudeAtX(t),this.latitudeAtY(e)]}longitudeAtX(t){let e=this.deltaX/2,r=this.xmin+e+t*this.deltaX;return this.translateX&&(r=r>180?r-360:r),r}latitudeAtY(t){let e=this.deltaY/2;return this.ymax-e-t*this.deltaY}randomize(t={},e,r,n){let i=Math.random()*(e||this.cols)|0,o=Math.random()*(r||this.rows)|0;const s=n([i,o]);return null!==s?(t.x=s[0],t.y=s[1]):(t.x=this.longitudeAtX(i),t.y=this.latitudeAtY(o)),t}checkFields(){return this.isFields}}const RR={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:.04,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0};function NR(t,e,r,n){return Math.max(0,Math.min(n.length-1,Math.round((t-e)/(r-e)*(n.length-1))))}class PR{constructor(t,e,r){if(this.particles=[],this.generated=!1,this.ctx=t,!this.ctx)throw new Error("ctx error");this.animate=this.animate.bind(this),this.setOptions(e),r&&this.updateData(r)}setOptions(t){this.options={...RR,...t};const{width:e,height:r}=this.ctx.canvas;"particleAge"in t&&!("maxAge"in t)&&CR(this.options.particleAge)&&(this.options.maxAge=this.options.particleAge),"particleMultiplier"in t&&!("paths"in t)&&CR(this.options.particleMultiplier)&&(this.options.paths=Math.round(e*r*this.options.particleMultiplier)),this.prerender()}getOptions(){return this.options}updateData(t){this.field=t,this.generated&&(this.particles=this.prepareParticlePaths())}project(...t){throw new Error("project must be overriden")}unproject(...t){throw new Error("unproject must be overriden")}intersectsCoordinate(t){throw new Error("must be overriden")}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this.then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);const t=Date.now(),e=t-this.then;e>this.options.frameRate&&(this.then=t-e%this.options.frameRate,this.render())}prerender(){this.generated=!1,this.field&&(this.particles=this.prepareParticlePaths(),this.generated=!0,this.starting||this.forceStop||(this.starting=!0,this.then=Date.now(),this.animate()))}render(){this.moveParticles(),this.drawParticles(),this.postrender()}postrender(){}moveParticles(){const{width:t,height:e}=this.ctx.canvas,r=this.particles,n=this.options.maxAge,i=wR(this.options.velocityScale)?this.options.velocityScale():this.options.velocityScale;let o=0;const s=r.length;for(;o<s;o++){const s=r[o];s.age>n&&(s.age=0,this.field.randomize(s,t,e,this.unproject));const a=s.x,u=s.y,l=this.field.interpolatedValueAt(a,u);if(null===l)s.age=n;else{const t=a+l.u*i,e=u+l.v*i;this.field.hasValueAt(t,e)?(s.xt=t,s.yt=e,s.m=l.m):(s.x=t,s.y=e,s.age=n)}s.age++}}fadeIn(){const t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t}drawParticles(){const t=this.particles;var e;this.fadeIn(),this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle=`rgba(0, 0, 0, ${this.options.globalAlpha})`,this.ctx.lineWidth=CR(this.options.lineWidth)?this.options.lineWidth:1,this.ctx.strokeStyle=null!=(e=this.options.colorScale)&&("string"==typeof e||null!==e.constructor&&e.constructor===String)?this.options.colorScale:"#fff";let r=0;const n=t.length;if(this.field&&n>0){let e,i;for(MR(this.options.minVelocity)&&MR(this.options.maxVelocity)?(e=this.options.minVelocity,i=this.options.maxVelocity):[e,i]=this.field.range;r<n;r++)this[this.options.useCoordsDraw?"drawCoordsParticle":"drawPixelParticle"](t[r],e,i)}}drawPixelParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&MR(i[0])&&MR(i[1])&&MR(n[0])&&MR(n[1])&&t.age<=this.options.maxAge){if(this.ctx.beginPath(),this.ctx.moveTo(n[0],n[1]),this.ctx.lineTo(i[0],i[1]),wR(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=NR(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}wR(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),t.x=t.xt,t.y=t.yt,this.ctx.stroke()}}drawCoordsParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&MR(i[0])&&MR(i[1])&&MR(n[0])&&MR(n[1])&&this.intersectsCoordinate(i)&&t.age<=this.options.maxAge){const o=this.project(n),s=this.project(i);if(o&&s){if(this.ctx.beginPath(),this.ctx.moveTo(o[0],o[1]),this.ctx.lineTo(s[0],s[1]),t.x=t.xt,t.y=t.yt,wR(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=NR(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}wR(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),this.ctx.stroke()}}}prepareParticlePaths(){const{width:t,height:e}=this.ctx.canvas,r="function"==typeof this.options.paths?this.options.paths(this):this.options.paths,n=[];if(!this.field)return[];let i=0;for(;i<r;i++)n.push(this.field.randomize({age:this.randomize()},t,e,this.unproject));return n}randomize(){return Math.floor(Math.random()*this.options.maxAge)}}PR.Field=LR;var DR=null;try{var QR="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");DR=QR.Worker}catch(t){}function kR(t,e,r){var n=void 0===e?null:e,i=function(t,e){return Buffer.from(t,"base64").toString(e?"utf16":"utf8")}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:"");return function(t){return new DR(s,Object.assign({},t,{eval:!0}))}}function FR(t,e,r){var n=void 0===e?null:e,i=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var OR="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var UR,GR,zR,jR=(UR="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgZnVuY3Rpb24gY2FsY01pbk1heChhcnJheSkgewogICAgbGV0IG1pbiA9IEluZmluaXR5OwogICAgbGV0IG1heCA9IEluZmluaXR5OwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICBjb25zdCB2YWwgPSBhcnJheVtpXTsKICAgICAgaWYgKG1pbiA9PT0gSW5maW5pdHkpIHsKICAgICAgICBtaW4gPSB2YWw7CiAgICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkgewogICAgICAgIG1heCA9IHZhbDsKICAgICAgICBtaW4gPSBNYXRoLm1pbihtaW4sIG1heCk7CiAgICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpOwogICAgICB9IGVsc2UgewogICAgICAgIG1pbiA9IE1hdGgubWluKHZhbCwgbWluKTsKICAgICAgICBtYXggPSBNYXRoLm1heCh2YWwsIG1heCk7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBbbWluLCBtYXhdOwogIH0KCiAgY29uc3QgY3R4ID0gc2VsZjsKICBjdHguYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsIGFzeW5jICh7IGRhdGE6IHBheWxvYWQgfSkgPT4gewogICAgY29uc3QgcmVuZGVyRm9ybSA9IHBheWxvYWRbMF07CiAgICBpZiAocmVuZGVyRm9ybSA9PT0gInJnIikgewogICAgICBjb25zdCB1RGF0YSA9IHBheWxvYWRbMV07CiAgICAgIGNvbnN0IHZEYXRhID0gcGF5bG9hZFsyXTsKICAgICAgY29uc3QgW3VNaW4sIHVNYXhdID0gY2FsY01pbk1he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lbG9jaXR5RGF0YS5idWZmZXJdKTsKICAgIH0KICB9KTsKCn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPURhdGFQcm9jZXNzZS5qcy5tYXAKCg==",GR="data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGF0YVByb2Nlc3NlLmpzIiwic291cmNlcyI6WyJ3b3JrZXI6Ly93ZWItd29ya2VyL3V0aWxzL2NvbW1vbi50cyIsIndvcmtlcjovL3dlYi13b3JrZXIvd29ya2Vycy9EYXRhUHJvY2Vzc2UudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGNhbGNNaW5NYXgoYXJyYXk6IG51bWJlcltdKTogW251bWJlciwgbnVtYmVyXSB7XG4gIGxldCBtaW4gPSBJbmZpbml0eTtcbiAgbGV0IG1heCA9IEluZmluaXR5O1xuICAvLyBAZnJvbTogaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMTM1NDQ0NzYvaG93LXRvLWZpbmQtbWF4LWFuZC1taW4taW4tYXJyYXktdXNpbmctbWluaW11bS1jb21wYXJpc29uc1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7XG4gICAgY29uc3QgdmFsID0gYXJyYXlbaV07XG5cbiAgICBpZiAobWluID09PSBJbmZpbml0eSkge1xuICAgICAgbWluID0gdmFsO1xuICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkge1xuICAgICAgbWF4ID0gdmFsO1xuICAgICAgLy8gdXBkYXRlIG1pbiBtYXhcbiAgICAgIC8vIDEuIFBpY2sgMiBlbGVtZW50cyhhLCBiKSwgY29tcGFyZSB0aGVtLiAoc2F5IGEgPiBiKVxuICAgICAgbWluID0gTWF0aC5taW4obWluLCBtYXgpO1xuICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpO1xuICAgIH0gZWxzZSB7XG4gICAgIC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TUFBYSxZQUFBLENBQUEsR0FBQSxDQUFJLENBQUMsQ0FBRyxFQUFBLENBQUEsRUFBRyxHQUFHLEdBQUcsQ0FBQSxFQUFHLElBQUksQ0FBQyxDQUFBLENBQUE7RUFBQSxLQUN4QztFQUVBLElBQUksR0FBQSxDQUFBLFdBQUEsQ0FBWSxDQUFDLFlBQUEsQ0FBYSxNQUFRLEVBQUEsR0FBQSxFQUFLLEdBQUcsQ0FBRyxFQUFBLENBQUMsWUFBYSxDQUFBLE1BQU0sQ0FBQyxDQUFBLENBQUE7RUFBQSxHQUN4RTtFQUNGLENBQUMsQ0FBQTs7Ozs7OyJ9",zR=!1,OR?kR(UR,GR,zR):function(t,e,r){var n;return function(i){return n=n||FR(t,e,r),new Worker(n,i)}}(UR,GR,zR));function VR(t){return"number"==typeof t&&!isNaN(t)}function HR(t){return t-Math.fround(t)}function qR(t,e){if(!t)return!1;if(e=e||devicePixelRatio||1,t instanceof HTMLCanvasElement){const r=t.clientWidth*e,n=t.clientHeight*e;if(r<=0||n<=0)return!1;if(t.width!==r||t.height!==n)return t.width=r,t.height=n,!0}return!1}function YR(t,e,r){const n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(n)||"";throw t.deleteShader(n),new Error(e)}return n}function XR(t,e,r,n,i){const o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),r instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,r):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.bindTexture(t.TEXTURE_2D,null),o}function WR(t,e){const r=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,r),e&&t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),r}function JR(t,e,r=1,n=0,i){const[o,s,a,u]=e;let l=0;t.clearColor(o,s,a,u),l|=t.COLOR_BUFFER_BIT,void 0!==r&&(t.clearDepth(r),l|=t.DEPTH_BUFFER_BIT),void 0!==n&&(t.clearStencil(0|n),l|=t.STENCIL_BUFFER_BIT),t.clear(l)}class KR{constructor(t,e,r,n){this.vertShader="",this.fragShader="",e&&(this.vertShader=e),r&&(this.fragShader=r),this.program=function(t,e,r){const n=YR(t,t.VERTEX_SHADER,e),i=YR(t,t.FRAGMENT_SHADER,r),o=t.createProgram();if(null!==o&&(t.attachShader(o,n),t.attachShader(o,i),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)))throw new Error(t.getProgramInfoLog(o)||"");return o}(t,function(t,e={}){return Object.keys(e).map((r=>{e[r]&&(t=t.replace(new RegExp(r,"g"),`${e[r]} \n`))})),t}(this.vertShader,n),this.fragShader),this.gl=t,this.textureUnit=0,this.uniformSetters=this.createUniformSetters(),this.attribSetters=this.createAttributeSetters(),this.transfromStack=[]}active(){return this.gl.useProgram(this.program),this}deactive(){return this.gl.deleteProgram(this.program),this}getBindPointForSamplerType(t,e){return e===t.SAMPLER_2D?t.TEXTURE_2D:e===t.SAMPLER_CUBE?t.TEXTURE_CUBE_MAP:void 0}createUniformSetter(t,e){const{gl:r}=this,n=r.getUniformLocation(t,e.name),i=e.type,o=e.size>1&&"[0]"===e.name.substr(-3);if(i===r.FLOAT&&o)return function(t){r.uniform1fv(n,t)};if(i===r.FLOAT)return function(t){r.uniform1f(n,t)};if(i===r.FLOAT_VEC2)return function(t){r.uniform2fv(n,t)};if(i===r.FLOAT_VEC3)return function(t){r.uniform3fv(n,t)};if(i===r.FLOAT_VEC4)return function(t){r.uniform4fv(n,t)};if(i===r.INT&&o)return function(t){r.uniform1iv(n,t)};if(i===r.INT)return function(t){r.uniform1i(n,t)};if(i===r.INT_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.INT_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.INT_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.BOOL)return function(t){r.uniform1iv(n,t)};if(i===r.BOOL_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.BOOL_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.BOOL_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.FLOAT_MAT2)return function(t){r.uniformMatrix2fv(n,!1,t)};if(i===r.FLOAT_MAT3)return function(t){r.uniformMatrix3fv(n,!1,t)};if(i===r.FLOAT_MAT4)return function(t){r.uniformMatrix4fv(n,!1,t)};if((i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)&&o){const t=[];for(let r=0;r<e.size;++r)t.push(this.textureUnit++);return s=this.getBindPointForSamplerType(r,i),a=t,function(t){r.uniform1iv(n,a),t.forEach((function(t,e){r.activeTexture(r.TEXTURE0+a[e]),void 0!==s&&r.bindTexture(s,t)}))}}var s,a;if(i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)return function(t,e){return function(i){r.uniform1i(n,e),r.activeTexture(r.TEXTURE0+e),void 0!==t&&r.bindTexture(t,i)}}(this.getBindPointForSamplerType(r,i),this.textureUnit++);throw new Error("unknown type: 0x"+i.toString(16))}createUniformSetters(){const{gl:t}=this;this.textureUnit=0;const e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);for(let n=0;n<r;++n){const r=t.getActiveUniform(this.program,n);if(!r)break;let i=r.name;"[0]"===i.substr(-3)&&(i=i.substr(0,i.length-3));const o=this.createUniformSetter(this.program,r);e[i]=o}}return e}createAttribSetter(t){const{gl:e}=this;return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer),e.enableVertexAttribArray(t),void 0===r.numComponents&&void 0===r.size||e.vertexAttribPointer(t,r.numComponents||r.size,r.type||e.FLOAT,r.normalize||!1,r.stride||0,r.offset||0)}}createAttributeSetters(){const{gl:t}=this,e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);for(let n=0;n<r;++n){const r=t.getActiveAttrib(this.program,n);if(!r)break;const i=t.getAttribLocation(this.program,r.name);e[r.name]=this.createAttribSetter(i)}}return e}setAttributes(t,e){return e=e?e.attribSetters||e:this.attribSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}setUniforms(t,e){return e=e?e.uniformSetters||e:this.uniformSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}elements(t){return this.elementsBuffer||(this.elementsBuffer=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.elementsBuffer),t.data&&this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t.data,t.usage||this.gl.STATIC_DRAW),void 0!==t.count&&this.runTimes(t.count),t.primitive&&this.setPrimitive(t.primitive),this}clear(t){return JR(this.gl,t),this.transfromStack=[],this}runTimes(t){return this.count=t||0,this}setPrimitive(t){return this.primitive=t||this.gl.TRIANGLES,this}resize(t,e){return void 0===t||void 0===e?(qR(this.gl.canvas),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height)):this.gl.viewport(0,0,t,e),this}draw(){throw new Error("should override")}translate(){throw new Error("should override")}rotate(){throw new Error("should override")}scale(){throw new Error("should override")}destroyed(){throw new Error("should override")}}var ZR="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_range.x;float max=u_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",$R="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_image;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_mapping_range.x;float max=u_mapping_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class tN extends KR{constructor(t,e,r,n){super(t,e||$R,r||ZR,n||{}),this.vertShader=$R,this.fragShader=ZR}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}}function eN(t,e){const r=document.createElement("canvas"),n=r.getContext("2d");r.width=256,r.height=1;const{input:i}=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(e);if(n&&i&&Array.isArray(i)){const e=i.map((t=>parseFloat(t.key))),r=[Math.min(...e),Math.max(...e)],[o,s]=[t[0]||r[0],t[1]||r[1]],a=n.createLinearGradient(0,0,256,0);for(let t=0;t<i.length;t+=1){const e=i[t].key,r=i[t].value;a.addColorStop((e-o)/(s-o),r)}return n.fillStyle=a,n.fillRect(0,0,256,1),{data:new Uint8Array(n.getImageData(0,0,256,1).data),colorRange:r}}return{}}function rN(t,e,r,n){const i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}const nN={};function iN(t,e,r,n,i){const o=`${t}_${r}`,s=n[r];if(VR(s))return nN[o]&&delete nN[o],s;if(s&&Array.isArray(s)&&(!nN[o]||i)&&(nN[o]=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(s)),nN[o]){const{input:t,interpolation:r}=nN[o]||{};if(t&&Array.isArray(t)){const n=t.map((t=>t.key)),i=t.map((t=>t.value));if(e<=n[0])return i[0];const o=n.length;if(e>=n[o-1])return i[o-1];const s=function(t,e){const r=t.length-1;let n,i,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],i=t[a+1],n<=e){if(a===r||e<i)return a;o=a+1}else{if(!(n>e))throw new Error("Input is not a number.");s=a-1}return 0}(n,e),a=n.length-1,u=function(t,e,r,n){let i=0;return"exponential"===t.name?i=rN(e,t.base,r,n):"linear"===t.name?i=rN(e,1,r,n):"cubic-bezier"===t.name&&console.warn("interpolationFactor"),i}(r,e,n[s],n[s>=a?a:s+1]);return function(t,e,r){return t*(1-r)+e*r}(i[s],i[s>=a?a:s+1],u)}return 1}return 1}var oN="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_wind;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);return length(vec2(u,v));}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",sN="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_wind;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);float min=u_mapping_range.x;float max=u_mapping_range.y;float val=length(vec2(u,v));return val*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class aN extends KR{constructor(t,e,r,n){super(t,e||sN,r||oN,n||{}),this.vertShader=sN,this.fragShader=oN}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}destroyed(){}}const uN={renderForm:"r",styleSpec:{"fill-color":["interpolate",["linear"],["get","value"],0,"#3288bd",10,"#66c2a5",20,"#abdda4",30,"#e6f598",40,"#fee08b",50,"#fdae61",60,"#f46d43",100,"#d53e4f"],opacity:1},displayRange:[1/0,1/0],mappingRange:[0,0],widthSegments:1,heightSegments:1,wireframe:!1,createPlaneBuffer:(t,e,r)=>{const[n,i,o,s]=[t[0][0],t[2][0],t[0][1],t[1][1]];return function(t,e,r,n,i,o){const s=e-t,a=n-r,u=s/2,l=a/2,h=Math.floor(i),c=Math.floor(o),f=h+1,p=c+1,g=s/h,d=a/c,A=[],y=[],v=[],m=[],_=[];for(let e=0;e<p;e++){const n=e*d;for(let i=0;i<f;i++){const o=t+i*g/u/2*s,f=r+n/l/2*a;v.push(o,f,0),m.push(HR(o),HR(f),0),_.push(i/h,e/c)}}for(let t=0;t<c;t++)for(let e=0;e<h;e++){const r=e+f*t,n=e+f*(t+1),i=e+1+f*(t+1),o=e+1+f*t;A.push(r,n,o),A.push(n,i,o)}for(let t=0,e=A.length;t<e;t+=3){const e=A[t],r=A[t+1],n=A[t+2];y.push(e,r,r,n,n,e)}return{uvs:{data:_,size:2},elements:{data:A,count:A.length},wireframeElements:{data:y,count:y.length},position:{data:v,size:3},positionLow:{data:m,size:3}}}(n,i,o,s,e,r)},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return 0.0;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}};let lN=0;class hN{constructor(t,e){if(this.gl=t,this.uid=`ScalarFill_${lN}`,lN++,!this.gl)throw new Error("initialize error");e||(e={}),this.options={...uN,...e},this.opacity=this.options.opacity||1}updateOptions(t){this.options={...this.options,...t},this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(iN(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec,!0))}setFillColor(){this.buildColorRamp()}setOpacity(t){this.opacity=t}handleZoom(){"function"==typeof this.options.getZoom&&this.setOpacity(iN(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}buildColorRamp(){var t;const{data:e,colorRange:r}=eN([],null==(t=this.options.styleSpec)?void 0:t["fill-color"]);r&&(this.colorRange=r),e&&(this.colorRampTexture=XR(this.gl,this.gl.NEAREST,e,16,16))}initialize(t){this.drawCommand||("rg"===this.options.renderForm?this.drawCommand=new aN(t,void 0,void 0,this.options.injectShaderModules):"r"===this.options.renderForm?this.drawCommand=new tN(t,void 0,void 0,this.options.injectShaderModules):console.warn("This type is not supported temporarily")),this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(iN(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}initializeVertex(t){let e=0;const r=t.length,n=[];for(;e<r;e++){const r=t[e],i=this.getMercatorCoordinate(r);n.push([i[0],i[1]])}const i=(this.options.createPlaneBuffer||uN.createPlaneBuffer)(n,this.options.widthSegments||1,this.options.heightSegments||1);return{indexes:i.elements.data,wireframeIndexes:i.wireframeElements.data,quadBuffer:WR(this.gl,new Float32Array(i.position.data)),quad64LowBuffer:WR(this.gl,new Float32Array(i.positionLow.data)),texCoordBuffer:WR(this.gl,new Float32Array(i.uvs.data))}}getTextureData(t){return new Promise(((e,r)=>{if("image"===t.type&&t.url)(function(t){return new Promise(((e,r)=>{t||r(new Event("url is null"));const n=new Image;n.crossOrigin="anonymous",n.onload=()=>e(n),n.onerror=r,n.src=t,n.complete&&e(n)}))})(t.url).then((r=>{const n={width:r.width,height:r.height,texture:XR(this.gl,this.gl.LINEAR,r,r.width,r.height),...this.initializeVertex(t.extent)};"rg"===this.options.renderForm?(n.uMin=t.uMin,n.uMax=t.uMax,n.vMin=t.vMin,n.vMax=t.vMax):"r"===this.options.renderForm?(n.min=t.min,n.max=t.max):console.warn("This type is not supported temporarily"),e(n)})).catch((t=>r(t)));else if("jsonArray"===t.type&&t.data){const r=t.data;let n;n=t.extent?t.extent:[[r[0].header.lo1,r[0].header.la1],[r[0].header.lo1,r[0].header.la2],[r[0].header.lo2,r[0].header.la1],[r[0].header.lo2,r[0].header.la2]];const i={width:r[0].header.nx,height:r[0].header.ny,...this.initializeVertex(n)};if(this.worker||(this.worker=new jR,this.worker.addEventListener("message",(({data:t})=>{"rg"===this.options.renderForm?(i.uMin=t[1],i.uMax=t[2],i.vMin=t[3],i.vMax=t[4],i.texture=XR(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):"r"===this.options.renderForm?(i.min=t[1],i.max=t[2],i.texture=XR(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):console.warn("This type is not supported temporarily"),e(i)}))),"rg"===this.options.renderForm){let t,e;r.forEach((r=>{switch(r.header.parameterCategory+","+r.header.parameterNumber){case"1,2":case"2,2":t=r;break;case"1,3":case"2,3":e=r}}));const n=new Float32Array(t.data),i=new Float32Array(e.data);this.worker.postMessage(["rg",n,i])}else if("r"===this.options.renderForm){const t=new Float32Array(r[0].data);this.worker.postMessage(["r",t])}else console.warn("This type is not supported temporarily")}}))}setData(t,e){this.gl&&t&&this.getTextureData(t).then((t=>{this.data=t,e&&e(!0),this.data&&this.initialize(this.gl),this.options.triggerRepaint&&(this.handleZoom(),this.options.triggerRepaint())})).catch((t=>{e&&e(!1),console.error(t)}))}getData(){return this.data}getMercatorCoordinate([t,e]){return[t,e]}prerender(){}render(t,e,r){if(this.data&&this.drawCommand&&this.data.texture&&this.colorRampTexture){const n=this.opacity,i={u_opacity:VR(n)?n:1,u_image_res:[this.data.width,this.data.height],u_matrix:t,u_offset:VR(e)?e:0,u_color_ramp:this.colorRampTexture,u_color_range:this.colorRange,u_mapping_range:this.options.mappingRange||[0,0]};if(r&&(i.u_cameraEye=r.cameraEye,i.u_cameraEye64Low=r.cameraEye64Low),"rg"===this.options.renderForm){i.u_wind_min=[this.data.uMin,this.data.vMin],i.u_wind_max=[this.data.uMax,this.data.vMax],i.u_wind=this.data.texture;const t=[Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMin*this.data.vMin),Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMin*this.data.vMin)],e=0,r=Math.max(...t);i.u_display_range=this.options.displayRange||[e,r]}else"r"===this.options.renderForm?(i.u_range=[this.data.min,this.data.max],i.u_image=this.data.texture,i.u_display_range=this.options.displayRange||[i.u_range[0]-1,i.u_range[1]+1]):console.warn("This type is not supported temporarily");const o=this.gl.isEnabled(this.gl.DEPTH_TEST);this.gl.enable(this.gl.DEPTH_TEST),this.gl.depthMask(!0),this.gl.depthFunc(this.gl.LEQUAL);const s=this.options.wireframe?this.data.wireframeIndexes:this.data.indexes;this.drawCommand.active().setUniforms(i).setAttributes({instancePositions:{buffer:this.data.quadBuffer,numComponents:3},instancePositions64Low:{buffer:this.data.quad64LowBuffer,numComponents:3},a_texCoord:{buffer:this.data.texCoordBuffer,numComponents:2}}).elements({data:new Uint32Array(s),primitive:this.options.wireframe?this.gl.LINES:this.gl.TRIANGLES,count:null==s?void 0:s.length,usage:this.gl.STATIC_DRAW}).draw(),o||this.gl.disable(this.gl.DEPTH_TEST)}}postrender(){}destroyData(){this.data}destroyed(){this.destroyData(),this.worker&&this.worker.terminate()}}function cN(t,e,r){const n=t.length,i=r>1?r:2;let o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(let e=0;e<n;e+=i)o[e]=180*t[e]/20037508.342789244,o[e+1]=360*Math.atan(Math.exp(t[e+1]/6378137))/Math.PI-90;return o}function fN(t,e,r,n){let i=[];if(n>1){const e=t[2]-t[0],r=t[3]-t[1];for(let o=0;o<n;++o)i.push(t[0]+e*o/n,t[1],t[2],t[1]+r*o/n,t[2]-e*o/n,t[3],t[0],t[3]-r*o/n)}else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);const o=[],s=[];for(let t=0,e=i.length;t<e;t+=2)o.push(i[t]),s.push(i[t+1]);return function(t,e,r){return function(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(o,s,r)}function pN(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function gN(t,e,r,n){return t.coordToPointAtRes?t.coordToPointAtRes(e,r,n):t.coordinateToPoint(e,r,n)}const dN={renderer:"gl",doubleBuffer:!1,animation:!1,glOptions:{antialias:!0,depth:!0,stencil:!0,alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0}};class AN extends i.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}clearCanvas(){this.gl&&JR(this.gl,[0,0,0,0])}createContext(){this.gl&&this.gl.canvas===this.canvas||(this.gl=function(t,e={}){const r=["webgl","experimental-webgl"];let n=null;function i(t){console.error(t.statusMessage)}t.addEventListener("webglcontextcreationerror",i,!1);for(let i=0;i<r.length;++i){try{n=t.getContext(r[i],e)}catch(t){}if(n)break}return t.removeEventListener("webglcontextcreationerror",i,!1),n&&n.getExtension("OES_texture_float")?n:null}(this.canvas,this.layer.options.glOptions))}resizeCanvas(t){if(this.canvas&&this.gl){const e=this.getMap(),r=e.getDevicePixelRatio(),n=t||e.getSize();this.canvas.height=r*n.height,this.canvas.width=r*n.width,this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}}getMatrix(){return this.getMap().projViewMatrix}handleZoom(){this.scalarRender&&this.scalarRender.handleZoom()}drawWind(){const t=this.getMap();if(null!==this.gl){const e=this.layer,r=e.getOptions(),n=e.getData();if(!this.scalarRender&&t&&(this.scalarRender=new hN(this.gl,{opacity:r.opacity,renderForm:r.renderForm,styleSpec:r.styleSpec,displayRange:r.displayRange,mappingRange:r.mappingRange,widthSegments:r.widthSegments,heightSegments:r.heightSegments,createPlaneBuffer:r.createPlaneBuffer,wireframe:r.wireframe,getZoom:()=>this.getMap().getZoom(),triggerRepaint:()=>{this._redraw()},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return value;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}}),this.scalarRender.getMercatorCoordinate=([e,r])=>{const n=gN(t,new o(e,r),pN(t));return[n.x,n.y]},this.getMap().on("zoom",this.handleZoom,this),this.scalarRender.setData(n)),this.scalarRender){const t=this.getMatrix(),e=[0,0,0,1],r=e.map((t=>HR(t))),n=this.getWrappedWorlds();for(let i=0;i<n.length;i++)this.scalarRender.render(t,n[i],{cameraEye:e,cameraEye64Low:r})}}this.completeRender()}getWrappedWorlds(){const t=this.getMap(),e=t.getProjection().fullExtent,r=[e.left,e.bottom,e.right,e.top],n=t.getProjExtent(),i=[n.xmin,n.ymin,n.xmax,n.ymax];let s=i[0];const a=function(t){return t[2]-t[0]}(r),u=Math.abs(gN(t,t.getProjection().unprojectCoords(new o([r[0],r[1]])),pN(t)).x-gN(t,t.getProjection().unprojectCoords(new o([r[2],r[3]])),pN(t)).x);let l=0;const h=[];if(this.layer.getOptions().wrapX){for(;s<r[0];)--l,h.push(l*u),s+=a;for(l=0,s=i[2];s>r[2];)++l,h.push(l*u),s-=a}return h.push(0),h}drawOnInteracting(){this.draw()}onZoomStart(...t){super.onZoomStart.apply(this,t)}onZoomEnd(...t){super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){super.onMoveStart.apply(this,t)}onMoveEnd(...t){super.onMoveEnd.apply(this,t)}remove(){delete this._drawContext,super.remove()}getMap(){return super.getMap()}completeRender(){return super.completeRender()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}}(class extends a{constructor(t,e,r){super(t,{...dN,...r}),this.data=null,this._map=null,e&&this.setData(e)}getData(){return this.data}setData(t){return new Promise(((e,r)=>{this.data=t;const n=this._getRenderer();this.data&&n&&n.scalarFill?n.scalarFill.setData(this.data,(t=>{t?e(!0):r(!1)})):e(!1)}))}setOptions(t){this.options={...this.options,...t||{}};const e=this._getRenderer();e&&e.scalarRender&&(e.scalarRender.updateOptions(this.options),e.setToRedraw())}getOptions(){return this.options||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}).registerRenderer("gl",AN);const yN={renderer:"canvas",doubleBuffer:!1,animation:!1,windOptions:{}};class vN extends i.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}drawWind(){const t=this.getMap();if(this.context){const e=this.layer,r=e.getWindOptions();if(!this.wind&&t){const t=e.getData();this.wind=new PR(this.context,r,t),this.wind.project=this.project.bind(this),this.wind.unproject=this.unproject.bind(this),this.wind.intersectsCoordinate=this.intersectsCoordinate.bind(this),this.wind.postrender=()=>{this.setCanvasUpdated()},this.wind.prerender()}this.wind&&(this.wind.prerender(),this.wind.render())}this.completeRender()}project(t){const e=this.getMap().coordinateToContainerPoint(new o(t[0],t[1]));return[e.x,e.y]}unproject(t){return this.getMap().containerPointToCoordinate(new s(t[0],t[1])).toArray()}intersectsCoordinate(t){var e;if(!this.layer)return!1;const r=null==(e=this.layer)?void 0:e.getProjection();if(r&&"EPSG:3857"!==r.code)return!0;const n=this.getMap().getProjExtent(),i=function(t,e){return fN(t,cN,void 0,e)}([n.xmin,n.ymin,n.xmax,n.ymax],0);return function(t,e){const r=e[0],n=e[1];return t[0]<=r&&r<=t[2]&&t[1]<=n&&n<=t[3]}(i,[t[0],t[1]])}drawOnInteracting(){}onZoomStart(...t){this.wind&&this.wind.stop(),super.onZoomStart.apply(this,t)}onZoomEnd(...t){this.wind&&this.wind.start(),super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){this.wind&&this.wind.stop(),super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){this.wind&&this.wind.start(),super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){this.wind&&this.wind.stop(),super.onMoveStart.apply(this,t)}onMoveEnd(...t){this.wind&&this.wind.start(),super.onMoveEnd.apply(this,t)}remove(){this.wind&&this.wind.stop(),delete this._drawContext,super.remove()}getMap(){return super.getMap()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}completeRender(){return super.completeRender()}}class mN extends a{constructor(t,e,r={}){super(t,bR({},yN,r)),this._map=null,this.pickWindOptions(),e&&this.setData(e,r.fieldOptions)}pickWindOptions(){Object.keys(RR).forEach((t=>{this.options&&t in this.options&&(void 0===this.options.windOptions&&(this.options.windOptions={}),this.options.windOptions[t]=this.options[t])}))}getData(){return this.field}setData(t,e={}){var r;t&&t.checkFields&&t.checkFields()?this.field=t:(r=t,Array.isArray(r)?this.field=function(t,e={}){let r,n;if(t.forEach((function(t){switch(t.header.parameterCategory+","+t.header.parameterNumber){case"1,2":case"2,2":r=t;break;case"1,3":case"2,3":n=t}})),!n||!r)return;const i=r.header;return new LR({xmin:i.lo1,ymin:i.la1,xmax:i.lo2,ymax:i.la2,deltaX:i.dx,deltaY:i.dy,cols:i.nx,rows:i.ny,us:r.data,vs:n.data,...e})}(t,e):console.error("Illegal data"));const n=this._getRenderer();return n&&n.wind&&this.field&&n.wind.updateData(this.field),this}setWindOptions(t){const e=this.options.windOptions||{};this.options=bR(this.options,{windOptions:bR(e,t||{})});const r=this._getRenderer();if(r&&r.wind){const t=this.options.windOptions;r.wind.setOptions(t)}}getWindOptions(){return this.options.windOptions||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}mN.registerRenderer("canvas",vN);const _N=mN;var IN={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a=17976931348623157e292,u=NaN,l="[object Arguments]",h="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",g="[object Function]",d="[object GeneratorFunction]",A="[object Map]",y="[object Number]",v="[object Object]",m="[object Promise]",_="[object RegExp]",I="[object Set]",E="[object String]",x="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",b="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B=/^\w*$/,M=/^\./,T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/^\s+|\s+$/g,R=/\\(\\)?/g,N=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,D=/^\[object .+?Constructor\]$/,Q=/^0o[0-7]+$/i,k=/^(?:0|[1-9]\d*)$/,F={};F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F[l]=F[h]=F[C]=F[c]=F[b]=F[f]=F[p]=F[g]=F[A]=F[y]=F[v]=F[_]=F[I]=F[E]=F[w]=!1;var O=parseInt,U="object"==typeof an&&an&&an.Object===Object&&an,G="object"==typeof self&&self&&self.Object===Object&&self,z=U||G||Function("return this")(),j=e&&!e.nodeType&&e,V=j&&t&&!t.nodeType&&t,H=V&&V.exports===j&&U.process,q=function(){try{return H&&H.binding("util")}catch(t){}}(),Y=q&&q.isTypedArray;function X(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function W(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function J(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Z,$=Array.prototype,tt=Function.prototype,et=Object.prototype,rt=z["__core-js_shared__"],nt=(Z=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||""))?"Symbol(src)_1."+Z:"",it=tt.toString,ot=et.hasOwnProperty,st=et.toString,at=RegExp("^"+it.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=z.Symbol,lt=z.Uint8Array,ht=et.propertyIsEnumerable,ct=$.splice,ft=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),pt=Math.max,gt=Vt(z,"DataView"),dt=Vt(z,"Map"),At=Vt(z,"Promise"),yt=Vt(z,"Set"),vt=Vt(z,"WeakMap"),mt=Vt(Object,"create"),_t=Zt(gt),It=Zt(dt),Et=Zt(At),xt=Zt(yt),wt=Zt(vt),Ct=ut?ut.prototype:void 0,bt=Ct?Ct.valueOf:void 0,St=Ct?Ct.toString:void 0;function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Mt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Lt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Tt;++e<r;)this.add(t[e])}function Rt(t){this.__data__=new Mt(t)}function Nt(t,e){var r=ie(t)||ne(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!ot.call(t,o)||i&&("length"==o||qt(o,n))||r.push(o);return r}function Pt(t,e){for(var r=t.length;r--;)if(re(t[r][0],e))return r;return-1}function Dt(t,e){for(var r=0,n=(e=Yt(e,t)?[e]:Gt(e)).length;null!=t&&r<n;)t=t[Kt(e[r++])];return r&&r==n?t:void 0}function Qt(t,e){return null!=t&&e in Object(t)}function kt(t,e,r,o,s){return t===e||(null==t||null==e||!ue(t)&&!le(e)?t!=t&&e!=e:function(t,e,r,o,s,a){var u=ie(t),g=ie(e),d=h,m=h;u||(d=(d=Ht(t))==l?v:d);g||(m=(m=Ht(e))==l?v:m);var w=d==v&&!W(t),S=m==v&&!W(e),B=d==m;if(B&&!w)return a||(a=new Rt),u||fe(t)?zt(t,e,r,o,s,a):function(t,e,r,o,s,a,u){switch(r){case b:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new lt(t),new lt(e)));case c:case f:case y:return re(+t,+e);case p:return t.name==e.name&&t.message==e.message;case _:case E:return t==e+"";case A:var l=J;case I:var h=a&i;if(l||(l=K),t.size!=e.size&&!h)return!1;var g=u.get(t);if(g)return g==e;a|=n,u.set(t,e);var d=zt(l(t),l(e),o,s,a,u);return u.delete(t),d;case x:if(bt)return bt.call(t)==bt.call(e)}return!1}(t,e,d,r,o,s,a);if(!(s&i)){var M=w&&ot.call(t,"__wrapped__"),T=S&&ot.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return a||(a=new Rt),r(L,R,o,s,a)}}if(!B)return!1;return a||(a=new Rt),function(t,e,r,n,o,s){var a=o&i,u=pe(t),l=u.length,h=pe(e),c=h.length;if(l!=c&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:ot.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,a)}(t,e,kt,r,o,s))}function Ft(t){return!(!ue(t)||(e=t,nt&&nt in e))&&(se(t)||W(t)?at:D).test(Zt(t));var e}function Ot(t){return"function"==typeof t?t:null==t?ge:"object"==typeof t?ie(t)?function(t,e){if(Yt(t)&&Xt(e))return Wt(Kt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Dt(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=Yt(e,t)?[e]:Gt(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Kt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ae(o)&&qt(s,o)&&(ie(t)||ne(t))}(t,e,Qt)}(r,t):kt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=pe(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Xt(i)]}return e}(t);if(1==e.length&&e[0][2])return Wt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var h=(l=r[s])[0],c=t[h],f=l[1];if(u&&l[2]){if(void 0===c&&!(h in t))return!1}else{var p=new Rt;if(o)var g=o(c,f,h,t,e,p);if(!(void 0===g?kt(f,c,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):Yt(e=t)?(r=Kt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Dt(e,t)}}(e);var e,r}function Ut(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||et,e!==n)return ft(t);var e,r,n,i=[];for(var o in Object(t))ot.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Gt(t){return ie(t)?t:Jt(t)}function zt(t,e,r,o,s,a){var u=s&i,l=t.length,h=e.length;if(l!=h&&!(u&&h>l))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,p=!0,g=s&n?new Lt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!X(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function jt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Vt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ft(r)?r:void 0}Bt.prototype.clear=function(){this.__data__=mt?mt(null):{}},Bt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Bt.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return n===r?void 0:n}return ot.call(e,t)?e[t]:void 0},Bt.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:ot.call(e,t)},Bt.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?r:e,this},Mt.prototype.clear=function(){this.__data__=[]},Mt.prototype.delete=function(t){var e=this.__data__,r=Pt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ct.call(e,r,1),!0)},Mt.prototype.get=function(t){var e=this.__data__,r=Pt(e,t);return r<0?void 0:e[r][1]},Mt.prototype.has=function(t){return Pt(this.__data__,t)>-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=Pt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new Bt,map:new(dt||Mt),string:new Bt}},Tt.prototype.delete=function(t){return jt(this,t).delete(t)},Tt.prototype.get=function(t){return jt(this,t).get(t)},Tt.prototype.has=function(t){return jt(this,t).has(t)},Tt.prototype.set=function(t,e){return jt(this,t).set(t,e),this},Lt.prototype.add=Lt.prototype.push=function(t){return this.__data__.set(t,r),this},Lt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.clear=function(){this.__data__=new Mt},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!dt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Tt(n)}return r.set(t,e),this};var Ht=function(t){return st.call(t)};function qt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||k.test(t))&&t>-1&&t%1==0&&t<e}function Yt(t,e){if(ie(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!he(t))||(B.test(t)||!S.test(t)||null!=e&&t in Object(e))}function Xt(t){return t==t&&!ue(t)}function Wt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(gt&&Ht(new gt(new ArrayBuffer(1)))!=b||dt&&Ht(new dt)!=A||At&&Ht(At.resolve())!=m||yt&&Ht(new yt)!=I||vt&&Ht(new vt)!=w)&&(Ht=function(t){var e=st.call(t),r=e==v?t.constructor:void 0,n=r?Zt(r):void 0;if(n)switch(n){case _t:return b;case It:return A;case Et:return m;case xt:return I;case wt:return w}return e});var Jt=ee((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(he(t))return St?St.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return M.test(t)&&r.push(""),t.replace(T,(function(t,e,n,i){r.push(n?i.replace(R,"$1"):e||t)})),r}));function Kt(t){if("string"==typeof t||he(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function Zt(t){if(null!=t){try{return it.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var $t,te=($t=function(t,e,r){var n=t?t.length:0;if(!n)return-1;var i,s,l=null==r?0:(i=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(he(t))return u;if(ue(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ue(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(L,"");var r=P.test(t);return r||Q.test(t)?O(t.slice(2),r?2:8):N.test(t)?u:+t}(t))===o||t===-o?(t<0?-1:1)*a:t==t?t:0:0===t?t:0}(r),s=i%1,i==i?s?i-s:i:0);return l<0&&(l=pt(n+l,0)),function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Ot(e),l)},function(t,e,r){var n=Object(t);if(!oe(t)){var i=Ot(e);t=pe(t),e=function(t){return i(n[t],t,n)}}var o=$t(t,e,r);return o>-1?n[i?t[o]:o]:void 0});function ee(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(ee.Cache||Tt),r}function re(t,e){return t===e||t!=t&&e!=e}function ne(t){return function(t){return le(t)&&oe(t)}(t)&&ot.call(t,"callee")&&(!ht.call(t,"callee")||st.call(t)==l)}ee.Cache=Tt;var ie=Array.isArray;function oe(t){return null!=t&&ae(t.length)&&!se(t)}function se(t){var e=ue(t)?st.call(t):"";return e==g||e==d}function ae(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function ue(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function le(t){return!!t&&"object"==typeof t}function he(t){return"symbol"==typeof t||le(t)&&st.call(t)==x}var ce,fe=Y?(ce=Y,function(t){return ce(t)}):function(t){return le(t)&&ae(t.length)&&!!F[st.call(t)]};function pe(t){return oe(t)?Nt(t):Ut(t)}function ge(t){return t}t.exports=te}(IN,IN.exports);var EN=IN.exports,xN={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a="[object Arguments]",u="[object Array]",l="[object Boolean]",h="[object Date]",c="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",d="[object Number]",A="[object Object]",y="[object Promise]",v="[object RegExp]",m="[object Set]",_="[object String]",I="[object Symbol]",E="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,S=/^\./,B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[a]=R[u]=R[x]=R[l]=R[w]=R[h]=R[c]=R[f]=R[g]=R[d]=R[A]=R[v]=R[m]=R[_]=R[E]=!1;var N="object"==typeof an&&an&&an.Object===Object&&an,P="object"==typeof self&&self&&self.Object===Object&&self,D=N||P||Function("return this")(),Q=e&&!e.nodeType&&e,k=Q&&t&&!t.nodeType&&t,F=k&&k.exports===Q&&N.process,O=function(){try{return F&&F.binding("util")}catch(t){}}(),U=O&&O.isTypedArray;function G(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function z(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function j(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var q,Y=Array.prototype,X=Function.prototype,W=Object.prototype,J=D["__core-js_shared__"],K=(q=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Z=X.toString,$=W.hasOwnProperty,tt=W.toString,et=RegExp("^"+Z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=D.Symbol,nt=D.Uint8Array,it=W.propertyIsEnumerable,ot=Y.splice,st=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),at=zt(D,"DataView"),ut=zt(D,"Map"),lt=zt(D,"Promise"),ht=zt(D,"Set"),ct=zt(D,"WeakMap"),ft=zt(Object,"create"),pt=Jt(at),gt=Jt(ut),dt=Jt(lt),At=Jt(ht),yt=Jt(ct),vt=rt?rt.prototype:void 0,mt=vt?vt.valueOf:void 0,_t=vt?vt.toString:void 0;function It(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function wt(t){var e=-1,r=t?t.length:0;for(this.__data__=new xt;++e<r;)this.add(t[e])}function Ct(t){this.__data__=new Et(t)}function bt(t,e){var r=te(t)||$t(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!$.call(t,o)||i&&("length"==o||Vt(o,n))||r.push(o);return r}function St(t,e){for(var r=t.length;r--;)if(Zt(t[r][0],e))return r;return-1}It.prototype.clear=function(){this.__data__=ft?ft(null):{}},It.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},It.prototype.get=function(t){var e=this.__data__;if(ft){var n=e[t];return n===r?void 0:n}return $.call(e,t)?e[t]:void 0},It.prototype.has=function(t){var e=this.__data__;return ft?void 0!==e[t]:$.call(e,t)},It.prototype.set=function(t,e){return this.__data__[t]=ft&&void 0===e?r:e,this},Et.prototype.clear=function(){this.__data__=[]},Et.prototype.delete=function(t){var e=this.__data__,r=St(e,t);return!(r<0)&&(r==e.length-1?e.pop():ot.call(e,r,1),!0)},Et.prototype.get=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]},Et.prototype.has=function(t){return St(this.__data__,t)>-1},Et.prototype.set=function(t,e){var r=this.__data__,n=St(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new It,map:new(ut||Et),string:new It}},xt.prototype.delete=function(t){return Gt(this,t).delete(t)},xt.prototype.get=function(t){return Gt(this,t).get(t)},xt.prototype.has=function(t){return Gt(this,t).has(t)},xt.prototype.set=function(t,e){return Gt(this,t).set(t,e),this},wt.prototype.add=wt.prototype.push=function(t){return this.__data__.set(t,r),this},wt.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.clear=function(){this.__data__=new Et},Ct.prototype.delete=function(t){return this.__data__.delete(t)},Ct.prototype.get=function(t){return this.__data__.get(t)},Ct.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Et){var n=r.__data__;if(!ut||n.length<199)return n.push([t,e]),this;r=this.__data__=new xt(n)}return r.set(t,e),this};var Bt,Mt,Tt=(Bt=function(t,e){return t&&Lt(t,e,le)},function(t,e){if(null==t)return t;if(!ee(t))return Bt(t,e);for(var r=t.length,n=Mt?r:-1,i=Object(t);(Mt?n--:++n<r)&&!1!==e(i[n],n,i););return t}),Lt=function(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===r(o[u],u,o))break}return e}}();function Rt(t,e){for(var r=0,n=(e=Ht(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Wt(e[r++])];return r&&r==n?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Pt(t,e,r,o,s){return t===e||(null==t||null==e||!ie(t)&&!oe(e)?t!=t&&e!=e:function(t,e,r,o,s,f){var p=te(t),y=te(e),E=u,C=u;p||(E=(E=jt(t))==a?A:E);y||(C=(C=jt(e))==a?A:C);var b=E==A&&!j(t),S=C==A&&!j(e),B=E==C;if(B&&!b)return f||(f=new Ct),p||ue(t)?Ut(t,e,r,o,s,f):function(t,e,r,o,s,a,u){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!o(new nt(t),new nt(e)));case l:case h:case d:return Zt(+t,+e);case c:return t.name==e.name&&t.message==e.message;case v:case _:return t==e+"";case g:var f=V;case m:var p=a&i;if(f||(f=H),t.size!=e.size&&!p)return!1;var A=u.get(t);if(A)return A==e;a|=n,u.set(t,e);var y=Ut(f(t),f(e),o,s,a,u);return u.delete(t),y;case I:if(mt)return mt.call(t)==mt.call(e)}return!1}(t,e,E,r,o,s,f);if(!(s&i)){var M=b&&$.call(t,"__wrapped__"),T=S&&$.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return f||(f=new Ct),r(L,R,o,s,f)}}if(!B)return!1;return f||(f=new Ct),function(t,e,r,n,o,s){var a=o&i,u=le(t),l=u.length,h=le(e),c=h.length;if(l!=c&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:$.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,f)}(t,e,Pt,r,o,s))}function Dt(t){return!(!ie(t)||(e=t,K&&K in e))&&(re(t)||j(t)?et:T).test(Jt(t));var e}function Qt(t){return"function"==typeof t?t:null==t?he:"object"==typeof t?te(t)?function(t,e){if(Ht(t)&&qt(e))return Yt(Wt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Rt(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=Ht(e,t)?[e]:Ot(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Wt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ne(o)&&Vt(s,o)&&(te(t)||$t(t))}(t,e,Nt)}(r,t):Pt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=le(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,qt(i)]}return e}(t);if(1==e.length&&e[0][2])return Yt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var h=(l=r[s])[0],c=t[h],f=l[1];if(u&&l[2]){if(void 0===c&&!(h in t))return!1}else{var p=new Ct;if(o)var g=o(c,f,h,t,e,p);if(!(void 0===g?Pt(f,c,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):Ht(e=t)?(r=Wt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Rt(e,t)}}(e);var e,r}function kt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||W,e!==n)return st(t);var e,r,n,i=[];for(var o in Object(t))$.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Ft(t,e){var r=-1,n=ee(t)?Array(t.length):[];return Tt(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function Ot(t){return te(t)?t:Xt(t)}function Ut(t,e,r,o,s,a){var u=s&i,l=t.length,h=e.length;if(l!=h&&!(u&&h>l))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,p=!0,g=s&n?new wt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!z(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function Gt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function zt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Dt(r)?r:void 0}var jt=function(t){return tt.call(t)};function Vt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t,e){if(te(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!se(t))||(b.test(t)||!C.test(t)||null!=e&&t in Object(e))}function qt(t){return t==t&&!ie(t)}function Yt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(at&&jt(new at(new ArrayBuffer(1)))!=w||ut&&jt(new ut)!=g||lt&&jt(lt.resolve())!=y||ht&&jt(new ht)!=m||ct&&jt(new ct)!=E)&&(jt=function(t){var e=tt.call(t),r=e==A?t.constructor:void 0,n=r?Jt(r):void 0;if(n)switch(n){case pt:return w;case gt:return g;case dt:return y;case At:return m;case yt:return E}return e});var Xt=Kt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(se(t))return _t?_t.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return S.test(t)&&r.push(""),t.replace(B,(function(t,e,n,i){r.push(n?i.replace(M,"$1"):e||t)})),r}));function Wt(t){if("string"==typeof t||se(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function Jt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Kt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Kt.Cache||xt),r}function Zt(t,e){return t===e||t!=t&&e!=e}function $t(t){return function(t){return oe(t)&&ee(t)}(t)&&$.call(t,"callee")&&(!it.call(t,"callee")||tt.call(t)==a)}Kt.Cache=xt;var te=Array.isArray;function ee(t){return null!=t&&ne(t.length)&&!re(t)}function re(t){var e=ie(t)?tt.call(t):"";return e==f||e==p}function ne(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function ie(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function oe(t){return!!t&&"object"==typeof t}function se(t){return"symbol"==typeof t||oe(t)&&tt.call(t)==I}var ae,ue=U?(ae=U,function(t){return ae(t)}):function(t){return oe(t)&&ne(t.length)&&!!R[tt.call(t)]};function le(t){return ee(t)?bt(t):kt(t)}function he(t){return t}t.exports=function(t,e){return(te(t)?G:Ft)(t,Qt(e))}}(xN,xN.exports);var wN={0:.05,1:.05,2:.05,3:.03,4:.02,5:.01,6:.006,7:.003,8:.002,9:.001,10:5e-4,11:3e-4,12:15e-5,13:1e-4,14:5e-5,15:25e-6,16:1e-5,16.99:1e-5,17:5e-6,18:2e-6,19:1e-6,20:5e-7,21:2e-7,22:1e-7},CN=(0,xN.exports)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var r=22.5,n=r*e;return{bearing:n,range:[n-11.25,n+11.25],label:t}})),bN=function(t,e,r){return t>=e&&t<r},SN=function(t){return EN(CN,(function(e){return bN(t,e.range[0],e.range[1])||bN(t-360,e.range[0],e.range[1])}))},BN=function(){function e(t,r,n){var i=this;Qe(this,e),console.log(n.options.devicePixelRatio),this.map=n,this._zIndex=r.zIndex;var o=2===n.options.devicePixelRatio?4:1;r.mulnum&&(o=r.mulnum),this.windLayer=this.map.getLayer("windLayer"),this.windLayer?this.windLayer.setData(t):(this.windLayer=new _N("windLayer",t,{windOptions:{colorScale:["rgb(36,104, 180)","rgb(60,157, 194)","rgb(128,205,193 )","rgb(151,218,168 )","rgb(198,231,181)","rgb(238,247,217)","rgb(255,238,159)","rgb(252,217,125)","rgb(255,182,100)","rgb(252,150,75)","rgb(250,112,52)","rgb(245,64,32)","rgb(237,45,28)","rgb(220,24,32)","rgb(180,0,35)"],lineWidth:2,velocityScale:function(){var t=i.map.getZoom();return wN[parseInt(t)]||1/40},frameRate:16,maxAge:60,globalAlpha:.9,paths:3782*o}}),this.map.addLayer(this.windLayer)),r.zIndex&&this.windLayer.setZIndex(r.zIndex),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}return Fe(e,[{key:"getZIndex",value:function(){this.windLayer&&this.windLayer.getZIndex()}},{key:"setZIndex",value:function(t){this.windLayer&&this.windLayer.setZIndex(t)}},{key:"_bindMapEvents",value:function(){this.map.on("mousemove",this._onWind,this)}},{key:"_closeEvent",value:function(){this.map.off("mousemove",this._onWind,this)}},{key:"_onWind",value:function(t){var e,r=this.windLayer.field.interpolatedValueAt(t.coordinate.x,t.coordinate.y);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");this.toolTip._content="".concat(null===(e=SN(n))||void 0===e?void 0:e.label).concat(this.windLevel(i),"级;速度").concat(i.toFixed(2),"m/s;高度10米")}}},{key:"getWindValue",value:function(t,e){var r=this.windLayer.field.interpolatedValueAt(t,e);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");return{direction:SN(n),speed:this.windLevel(i)}}}},{key:"windLevel",value:function(t){return t>=0&&t<.3?0:t>=.3&&t<1.6?1:t>=1.6&&t<3.4?2:t>=3.4&&t<5.5?3:t>=5.5&&t<8?4:t>=8&&t<10.8?5:t>=10.8&&t<13.9?6:t>=13.9&&t<17.2?7:t>=17.2&&t<20.8?8:t>=20.8&&t<24.5?9:t>=24.5&&t<28.5?10:t>=28.5&&t<32.7?11:12}},{key:"hide",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.hide(),this.removeToolTip(),this._closeEvent()}},{key:"show",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.show(),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}},{key:"setToolTip",value:function(e,r){this.removeToolTip(),this.toolTip=new t.ui.ToolTip(e,r),this.toolTip.addTo(this.map)}},{key:"removeToolTip",value:function(){var t;this.toolTip&&(null===(t=this.toolTip)||void 0===t||t.remove(),this.toolTip=null)}},{key:"vectorToDegrees",value:function(t,e,r){r.endsWith("CCW")&&(e=e>0?e=-e:Math.abs(e));var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i=180*Math.atan2(t/n,e/n)/Math.PI+180;return"bearingCW"!==r&&"meteoCCW"!==r||(i+=180)>=360&&(i-=360),i}},{key:"vectorToSpeed",value:function(t,e,r){var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return"k/h"===r?3.6*n:"kt"===r?n/.514:n}},{key:"closeWind",value:function(){this._closeEvent(),this.removeToolTip(),this.map.removeLayer(this.windLayer),delete this.windLayer,this.windLayer=null}}]),e}();export{uT as Arrow3D,pR as CoordinateTransform,XM as LineGeometry,bM as LineMaterial,gx as TextureAnimator,nR as bloomClass,vT as bloomLine,XE as calIntersection,$E as calPointColor,fR as drawTool,HE as getCirGeojson,VE as getPsByCircle,YE as getVPointGeojson,_x as gisCommon,vB as gltfLoadClass,rx as imgClass,hR as layerClass,cR as layerClassNoOverride,sT as line2Object,ZE as line2Polygon,zE as lineLength,iR as outlineBloomClass,gR as overLayer,eT as planeGifClass,Qx as planeMark,dx as planeSectorClass,gT as polygonClass,SM as polylineClass,ox as radarClass,EM as rippleWallClass,cx as sectorClass,vx as shockClass,IR as shockMarkerClass,PE as sleep,dB as tileClass,lT as tripHeight,hT as tripHeight1,cT as tripLineClass,iT as tubeClass,BE as turf,ZM as verticalFatLineClass,BN as windClass};
|
|
161
|
+
*/function dR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AR(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function yR(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var vR,mR={markerType:"ellipse",markerFill:(vR=[135,196,240],{type:"radial",colorStops:[[.7,"rgba("+vR.join()+", 0.5)"],[.3,"rgba("+vR.join()+", 1)"],[.2,"rgba("+vR.join()+", 1)"],[0,"rgba("+vR.join()+", 0)"]]}),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},_R=function(t){function n(){return dR(this,n),AR(this,t.apply(this,arguments))}return yR(n,t),n.prototype.addGeometry=function(n){return n instanceof r&&(n=[n]),n.forEach((function(t,r){if(!(t instanceof e))throw new Error("The geometry at "+r+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},n.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var e=new n(t.id,t.options),i=t.geometries,o=[],s=0;s<i.length;s++){var a=r.fromJSON(i[s]);a&&o.push(a)}return e.addGeometry(o),t.style&&e.setStyle(t.style),e},n}(n);_R.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),_R.registerJSONType("AnimateMarkerLayer"),_R.registerRenderer("canvas",function(t){function r(){return dR(this,r),AR(this,t.apply(this,arguments))}return yR(r,t),r.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},r.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},r.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},r.prototype.onCanvasCreate=function(){this._prepare()},r.prototype.onGeometryAdd=function(){this._redraw()},r.prototype.onGeometryRemove=function(){this._redraw()},r.prototype.onGeometrySymbolChange=function(){this._redraw()},r.prototype.onGeometryPositionChange=function(){this._redraw()},r.prototype.onGeometryShow=function(){this._redraw()},r.prototype.onGeometryHide=function(){this._redraw()},r.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},r.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},r.prototype._drawAllMarkers=function(t){var e=this,r=this.getMap(),n=r.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=r._prjToContainerPoint(t.coordinates);n.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=r._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},r.prototype._drawMarker=function(t,e,r,n){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(n-t.start)%i/i,u=r.fade&&a>=.5?2-2*a:1,l=r.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,g=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-g*l/2,p*l,g*l),o.globalAlpha=s)},r.prototype._prepare=function(){var t=this,e=[],r={},n=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?mR:i._getInternalSymbol(),s=JSON.stringify(o);r[s]||(r[s]=o),e.push({coordinates:n.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(r),this._currentMarkers=e},r.prototype._prepareSprites=function(t){for(var r in this._spriteCache={},t){var n=t[r],i=new e([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[r]=i}},r.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},r.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},r=this.layer.options.animation?this.layer.options.animation.split(","):[],n=0;n<r.length;n++){var i=(t=r[n]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},r}(i.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var IR=function(){function e(r,n,i){Qe(this,e),this.map=i;var o=n.color||[255,0,0],s=n.opacity||.8,a=n.width||20,u=n.height||20,l=n.animationDuration||3e3,h=n.markerDx||0,c=n.markerDy||0,f=t.GeoJSON.toGeometry(r);this.layer=new _R(t.Util.GUID(),f,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:h,markerDy:c}}]).addTo(i)}return Fe(e,[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}]),e}();const ER=Object.prototype.hasOwnProperty,xR="undefined"!=typeof Symbol?Symbol.toStringTag:void 0;function wR(t){if(!function(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)}(t))return!1;const e=function(t){if(null===t)return void 0===t?"[object Undefined]":"[object Null]";if(!xR||!(xR in Object(t)))return toString.call(t);const e=ER.call(t,xR),r=t[xR];let n=!1;try{t[xR]=void 0,n=!0}catch(t){}const i=Object.prototype.toString.call(t);return n&&(e?t[xR]=r:delete t[xR]),i}(t);return"[object Function]"===e||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object Proxy]"===e}function CR(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)}function bR(t,...e){return Object.assign(t,...e)}const SR={};function BR(t,e){SR[e]||(!function(t,e){console.warn(`${e||"wind-layer"}: ${t}`)}(e,t),SR[e]=!0)}function MR(t){return null!=t&&!isNaN(t)}class TR{constructor(t,e){this.u=t,this.v=e,this.m=this.magnitude()}magnitude(){return Math.sqrt(this.u**2+this.v**2)}directionTo(){let t=Math.atan2(this.u,this.v)*(180/Math.PI);return t<0&&(t+=360),t}directionFrom(){return(this.directionTo()+180)%360}}class LR{constructor(t){this.grid=[],this.xmin=t.xmin,this.xmax=t.xmax,this.ymin=t.ymin,this.ymax=t.ymax,this.cols=t.cols,this.rows=t.rows,this.us=t.us,this.vs=t.vs,this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.flipY=Boolean(t.flipY),this.ymin=Math.min(t.ymax,t.ymin),this.ymax=Math.max(t.ymax,t.ymin),this.deltaY<0&&this.ymin<this.ymax||(void 0===t.flipY&&(this.flipY=!0),console.warn("[wind-core]: The data is flipY")),this.isFields=!0;const e=Math.ceil((this.xmax-this.xmin)/t.deltaX),r=Math.ceil((this.ymax-this.ymin)/t.deltaY);e===this.cols&&r===this.rows||console.warn("[wind-core]: The data grid not equal"),this.isContinuous=Math.floor(this.cols*t.deltaX)>=360,this.translateX="translateX"in t?t.translateX:this.xmax>180,"wrappedX"in t&&BR("[wind-core]: ","`wrappedX` namespace will deprecated please use `translateX` instead!"),this.wrapX=Boolean(t.wrapX),this.grid=this.buildGrid(),this.range=this.calculateRange()}buildGrid(){let t=[],e=0;const{rows:r,cols:n,us:i,vs:o}=this;for(let s=0;s<r;s++){const r=[];for(let t=0;t<n;t++,e++){let n=i[e],s=o[e],a=this.isValid(n)&&this.isValid(s);r[t]=a?new TR(n,s):null}this.isContinuous&&r.push(r[0]),t[s]=r}return t}release(){this.grid=[]}extent(){return[this.xmin,this.ymin,this.xmax,this.ymax]}bilinearInterpolateVector(t,e,r,n,i,o){const s=1-t,a=1-e,u=s*a,l=t*a,h=s*e,c=t*e,f=r.u*u+n.u*l+i.u*h+o.u*c,p=r.v*u+n.v*l+i.v*h+o.v*c;return new TR(f,p)}calculateRange(){if(!this.grid||!this.grid[0])return;const t=this.grid.length,e=this.grid[0].length;let r,n;for(let i=0;i<t;i++)for(let t=0;t<e;t++){const e=this.grid[i][t];if(null!==e){const t=e.m||e.magnitude();void 0===r?r=t:void 0===n?(n=t,r=Math.min(r,n),n=Math.max(r,n)):(r=Math.min(t,r),n=Math.max(t,n))}}return[r,n]}isValid(t){return null!=t}getWrappedLongitudes(){let t=this.xmin,e=this.xmax;return this.translateX&&(this.isContinuous?(t=-180,e=180):(e=this.xmax-360,t=this.xmin-360)),[t,e]}contains(t,e){const[r,n]=this.getWrappedLongitudes();let i,o=t>=r&&t<=n;return i=this.deltaY>=0?e>=this.ymin&&e<=this.ymax:e>=this.ymax&&e<=this.ymin,o&&i}getDecimalIndexes(t,e){const r=function(t,e){return t-e*Math.floor(t/e)}(t-this.xmin,360)/this.deltaX;if(this.flipY){return[r,(this.ymax-e)/this.deltaY]}return[r,(this.ymin+e)/this.deltaY]}valueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;const n=this.getDecimalIndexes(t,e);let i=Math.floor(n[0]),o=Math.floor(n[1]);const s=this.clampColumnIndex(i),a=this.clampRowIndex(o);return this.valueAtIndexes(s,a)}interpolatedValueAt(t,e){let r=!1;if((this.wrapX||this.contains(t,e))&&(r=!0),!r)return null;let[n,i]=this.getDecimalIndexes(t,e);return this.interpolatePoint(n,i)}hasValueAt(t,e){return null!==this.valueAt(t,e)}interpolatePoint(t,e){const r=this.getFourSurroundingIndexes(t,e),[n,i,o,s]=r;let a=this.getFourSurroundingValues(n,i,o,s);if(a){const[r,i,s,u]=a;return this.bilinearInterpolateVector(t-n,e-o,r,i,s,u)}return null}clampColumnIndex(t){let e=t;t<0&&(e=0);let r=this.cols-1;return t>r&&(e=r),e}clampRowIndex(t){let e=t;t<0&&(e=0);let r=this.rows-1;return t>r&&(e=r),e}getFourSurroundingIndexes(t,e){let r=Math.floor(t),n=r+1;this.isContinuous&&n>=this.cols&&(n=0),n=this.clampColumnIndex(n);let i=this.clampRowIndex(Math.floor(e));return[r,n,i,this.clampRowIndex(i+1)]}getFourSurroundingValues(t,e,r,n){let i;if(i=this.grid[r]){const r=i[t],o=i[e];if(this.isValid(r)&&this.isValid(o)&&(i=this.grid[n])){const n=i[t],s=i[e];if(this.isValid(n)&&this.isValid(s))return[r,o,n,s]}}return null}valueAtIndexes(t,e){return this.grid[e][t]}lonLatAtIndexes(t,e){return[this.longitudeAtX(t),this.latitudeAtY(e)]}longitudeAtX(t){let e=this.deltaX/2,r=this.xmin+e+t*this.deltaX;return this.translateX&&(r=r>180?r-360:r),r}latitudeAtY(t){let e=this.deltaY/2;return this.ymax-e-t*this.deltaY}randomize(t={},e,r,n){let i=Math.random()*(e||this.cols)|0,o=Math.random()*(r||this.rows)|0;const s=n([i,o]);return null!==s?(t.x=s[0],t.y=s[1]):(t.x=this.longitudeAtX(i),t.y=this.latitudeAtY(o)),t}checkFields(){return this.isFields}}const RR={globalAlpha:.9,lineWidth:1,colorScale:"#fff",velocityScale:.04,maxAge:90,paths:800,frameRate:20,useCoordsDraw:!0,gpet:!0};function NR(t,e,r,n){return Math.max(0,Math.min(n.length-1,Math.round((t-e)/(r-e)*(n.length-1))))}class PR{constructor(t,e,r){if(this.particles=[],this.generated=!1,this.ctx=t,!this.ctx)throw new Error("ctx error");this.animate=this.animate.bind(this),this.setOptions(e),r&&this.updateData(r)}setOptions(t){this.options={...RR,...t};const{width:e,height:r}=this.ctx.canvas;"particleAge"in t&&!("maxAge"in t)&&CR(this.options.particleAge)&&(this.options.maxAge=this.options.particleAge),"particleMultiplier"in t&&!("paths"in t)&&CR(this.options.particleMultiplier)&&(this.options.paths=Math.round(e*r*this.options.particleMultiplier)),this.prerender()}getOptions(){return this.options}updateData(t){this.field=t,this.generated&&(this.particles=this.prepareParticlePaths())}project(...t){throw new Error("project must be overriden")}unproject(...t){throw new Error("unproject must be overriden")}intersectsCoordinate(t){throw new Error("must be overriden")}clearCanvas(){this.stop(),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.forceStop=!1}start(){this.starting=!0,this.forceStop=!1,this.then=Date.now(),this.animate()}stop(){cancelAnimationFrame(this.animationLoop),this.starting=!1,this.forceStop=!0}animate(){this.animationLoop&&cancelAnimationFrame(this.animationLoop),this.animationLoop=requestAnimationFrame(this.animate);const t=Date.now(),e=t-this.then;e>this.options.frameRate&&(this.then=t-e%this.options.frameRate,this.render())}prerender(){this.generated=!1,this.field&&(this.particles=this.prepareParticlePaths(),this.generated=!0,this.starting||this.forceStop||(this.starting=!0,this.then=Date.now(),this.animate()))}render(){this.moveParticles(),this.drawParticles(),this.postrender()}postrender(){}moveParticles(){const{width:t,height:e}=this.ctx.canvas,r=this.particles,n=this.options.maxAge,i=wR(this.options.velocityScale)?this.options.velocityScale():this.options.velocityScale;let o=0;const s=r.length;for(;o<s;o++){const s=r[o];s.age>n&&(s.age=0,this.field.randomize(s,t,e,this.unproject));const a=s.x,u=s.y,l=this.field.interpolatedValueAt(a,u);if(null===l)s.age=n;else{const t=a+l.u*i,e=u+l.v*i;this.field.hasValueAt(t,e)?(s.xt=t,s.yt=e,s.m=l.m):(s.x=t,s.y=e,s.age=n)}s.age++}}fadeIn(){const t=this.ctx.globalCompositeOperation;this.ctx.globalCompositeOperation="destination-in",this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.globalCompositeOperation=t}drawParticles(){const t=this.particles;var e;this.fadeIn(),this.ctx.globalAlpha=this.options.globalAlpha,this.ctx.fillStyle=`rgba(0, 0, 0, ${this.options.globalAlpha})`,this.ctx.lineWidth=CR(this.options.lineWidth)?this.options.lineWidth:1,this.ctx.strokeStyle=null!=(e=this.options.colorScale)&&("string"==typeof e||null!==e.constructor&&e.constructor===String)?this.options.colorScale:"#fff";let r=0;const n=t.length;if(this.field&&n>0){let e,i;for(MR(this.options.minVelocity)&&MR(this.options.maxVelocity)?(e=this.options.minVelocity,i=this.options.maxVelocity):[e,i]=this.field.range;r<n;r++)this[this.options.useCoordsDraw?"drawCoordsParticle":"drawPixelParticle"](t[r],e,i)}}drawPixelParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&MR(i[0])&&MR(i[1])&&MR(n[0])&&MR(n[1])&&t.age<=this.options.maxAge){if(this.ctx.beginPath(),this.ctx.moveTo(n[0],n[1]),this.ctx.lineTo(i[0],i[1]),wR(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=NR(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}wR(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),t.x=t.xt,t.y=t.yt,this.ctx.stroke()}}drawCoordsParticle(t,e,r){const n=[t.x,t.y],i=[t.xt,t.yt];if(i&&n&&MR(i[0])&&MR(i[1])&&MR(n[0])&&MR(n[1])&&this.intersectsCoordinate(i)&&t.age<=this.options.maxAge){const o=this.project(n),s=this.project(i);if(o&&s){if(this.ctx.beginPath(),this.ctx.moveTo(o[0],o[1]),this.ctx.lineTo(s[0],s[1]),t.x=t.xt,t.y=t.yt,wR(this.options.colorScale))this.ctx.strokeStyle=this.options.colorScale(t.m);else if(Array.isArray(this.options.colorScale)){const n=NR(t.m,e,r,this.options.colorScale);this.ctx.strokeStyle=this.options.colorScale[n]}wR(this.options.lineWidth)&&(this.ctx.lineWidth=this.options.lineWidth(t.m)),this.ctx.stroke()}}}prepareParticlePaths(){const{width:t,height:e}=this.ctx.canvas,r="function"==typeof this.options.paths?this.options.paths(this):this.options.paths,n=[];if(!this.field)return[];let i=0;for(;i<r;i++)n.push(this.field.randomize({age:this.randomize()},t,e,this.unproject));return n}randomize(){return Math.floor(Math.random()*this.options.maxAge)}}PR.Field=LR;var DR=null;try{var QR="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");DR=QR.Worker}catch(t){}function kR(t,e,r){var n=void 0===e?null:e,i=function(t,e){return Buffer.from(t,"base64").toString(e?"utf16":"utf8")}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:"");return function(t){return new DR(s,Object.assign({},t,{eval:!0}))}}function FR(t,e,r){var n=void 0===e?null:e,i=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var OR="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var UR,GR,zR,jR=(UR="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgZnVuY3Rpb24gY2FsY01pbk1heChhcnJheSkgewogICAgbGV0IG1pbiA9IEluZmluaXR5OwogICAgbGV0IG1heCA9IEluZmluaXR5OwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICBjb25zdCB2YWwgPSBhcnJheVtpXTsKICAgICAgaWYgKG1pbiA9PT0gSW5maW5pdHkpIHsKICAgICAgICBtaW4gPSB2YWw7CiAgICAgIH0gZWxzZSBpZiAobWF4ID09PSBJbmZpbml0eSkgewogICAgICAgIG1heCA9IHZhbDsKICAgICAgICBtaW4gPSBNYXRoLm1pbihtaW4sIG1heCk7CiAgICAgICAgbWF4ID0gTWF0aC5tYXgobWluLCBtYXgpOwogICAgICB9IGVsc2UgewogICAgICAgIG1pbiA9IE1hdGgubWluKHZhbCwgbWluKTsKICAgICAgICBtYXggPSBNYXRoLm1heCh2YWwsIG1heCk7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBbbWluLCBtYXhdOwogIH0KCiAgY29uc3QgY3R4ID0gc2VsZjsKICBjdHguYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsIGFzeW5jICh7IGRhdGE6IHBheWxvYWQgfSkgPT4gewogICAgY29uc3QgcmVuZGVyRm9ybSA9IHBheWxvYWRbMF07CiAgICBpZiAocmVuZGVyRm9ybSA9PT0gInJnIikgewogICAgICBjb25zdCB1RGF0YSA9IHBheWxvYWRbMV07CiAgICAgIGNvbnN0IH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sQ0FBQSxDQUFBLEdBQUssUUFBUSxHQUFNLEdBQUEsR0FBQSxDQUFBLENBQUE7RUFDL0MsTUFBYSxZQUFBLENBQUEsR0FBQSxDQUFJLENBQUMsQ0FBRyxFQUFBLENBQUEsRUFBRyxHQUFHLEdBQUcsQ0FBQSxFQUFHLElBQUksQ0FBQyxDQUFBLENBQUE7RUFBQSxLQUN4QztFQUVBLElBQUksR0FBQSxDQUFBLFdBQUEsQ0FBWSxDQUFDLFlBQUEsQ0FBYSxNQUFRLEVBQUEsR0FBQSxFQUFLLEdBQUcsQ0FBRyxFQUFBLENBQUMsWUFBYSxDQUFBLE1BQU0sQ0FBQyxDQUFBLENBQUE7RUFBQSxHQUN4RTtFQUNGLENBQUMsQ0FBQTs7Ozs7OyJ9",zR=!1,OR?kR(UR,GR,zR):function(t,e,r){var n;return function(i){return n=n||FR(t,e,r),new Worker(n,i)}}(UR,GR,zR));function VR(t){return"number"==typeof t&&!isNaN(t)}function HR(t){return t-Math.fround(t)}function qR(t,e){if(!t)return!1;if(e=e||devicePixelRatio||1,t instanceof HTMLCanvasElement){const r=t.clientWidth*e,n=t.clientHeight*e;if(r<=0||n<=0)return!1;if(t.width!==r||t.height!==n)return t.width=r,t.height=n,!0}return!1}function YR(t,e,r){const n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){const e=t.getShaderInfoLog(n)||"";throw t.deleteShader(n),new Error(e)}return n}function XR(t,e,r,n,i){const o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),r instanceof Uint8Array?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,r):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.bindTexture(t.TEXTURE_2D,null),o}function WR(t,e){const r=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,r),e&&t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),r}function JR(t,e,r=1,n=0,i){const[o,s,a,u]=e;let l=0;t.clearColor(o,s,a,u),l|=t.COLOR_BUFFER_BIT,void 0!==r&&(t.clearDepth(r),l|=t.DEPTH_BUFFER_BIT),void 0!==n&&(t.clearStencil(0|n),l|=t.STENCIL_BUFFER_BIT),t.clear(l)}class KR{constructor(t,e,r,n){this.vertShader="",this.fragShader="",e&&(this.vertShader=e),r&&(this.fragShader=r),this.program=function(t,e,r){const n=YR(t,t.VERTEX_SHADER,e),i=YR(t,t.FRAGMENT_SHADER,r),o=t.createProgram();if(null!==o&&(t.attachShader(o,n),t.attachShader(o,i),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)))throw new Error(t.getProgramInfoLog(o)||"");return o}(t,function(t,e={}){return Object.keys(e).map((r=>{e[r]&&(t=t.replace(new RegExp(r,"g"),`${e[r]} \n`))})),t}(this.vertShader,n),this.fragShader),this.gl=t,this.textureUnit=0,this.uniformSetters=this.createUniformSetters(),this.attribSetters=this.createAttributeSetters(),this.transfromStack=[]}active(){return this.gl.useProgram(this.program),this}deactive(){return this.gl.deleteProgram(this.program),this}getBindPointForSamplerType(t,e){return e===t.SAMPLER_2D?t.TEXTURE_2D:e===t.SAMPLER_CUBE?t.TEXTURE_CUBE_MAP:void 0}createUniformSetter(t,e){const{gl:r}=this,n=r.getUniformLocation(t,e.name),i=e.type,o=e.size>1&&"[0]"===e.name.substr(-3);if(i===r.FLOAT&&o)return function(t){r.uniform1fv(n,t)};if(i===r.FLOAT)return function(t){r.uniform1f(n,t)};if(i===r.FLOAT_VEC2)return function(t){r.uniform2fv(n,t)};if(i===r.FLOAT_VEC3)return function(t){r.uniform3fv(n,t)};if(i===r.FLOAT_VEC4)return function(t){r.uniform4fv(n,t)};if(i===r.INT&&o)return function(t){r.uniform1iv(n,t)};if(i===r.INT)return function(t){r.uniform1i(n,t)};if(i===r.INT_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.INT_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.INT_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.BOOL)return function(t){r.uniform1iv(n,t)};if(i===r.BOOL_VEC2)return function(t){r.uniform2iv(n,t)};if(i===r.BOOL_VEC3)return function(t){r.uniform3iv(n,t)};if(i===r.BOOL_VEC4)return function(t){r.uniform4iv(n,t)};if(i===r.FLOAT_MAT2)return function(t){r.uniformMatrix2fv(n,!1,t)};if(i===r.FLOAT_MAT3)return function(t){r.uniformMatrix3fv(n,!1,t)};if(i===r.FLOAT_MAT4)return function(t){r.uniformMatrix4fv(n,!1,t)};if((i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)&&o){const t=[];for(let r=0;r<e.size;++r)t.push(this.textureUnit++);return s=this.getBindPointForSamplerType(r,i),a=t,function(t){r.uniform1iv(n,a),t.forEach((function(t,e){r.activeTexture(r.TEXTURE0+a[e]),void 0!==s&&r.bindTexture(s,t)}))}}var s,a;if(i===r.SAMPLER_2D||i===r.SAMPLER_CUBE)return function(t,e){return function(i){r.uniform1i(n,e),r.activeTexture(r.TEXTURE0+e),void 0!==t&&r.bindTexture(t,i)}}(this.getBindPointForSamplerType(r,i),this.textureUnit++);throw new Error("unknown type: 0x"+i.toString(16))}createUniformSetters(){const{gl:t}=this;this.textureUnit=0;const e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);for(let n=0;n<r;++n){const r=t.getActiveUniform(this.program,n);if(!r)break;let i=r.name;"[0]"===i.substr(-3)&&(i=i.substr(0,i.length-3));const o=this.createUniformSetter(this.program,r);e[i]=o}}return e}createAttribSetter(t){const{gl:e}=this;return function(r){e.bindBuffer(e.ARRAY_BUFFER,r.buffer),e.enableVertexAttribArray(t),void 0===r.numComponents&&void 0===r.size||e.vertexAttribPointer(t,r.numComponents||r.size,r.type||e.FLOAT,r.normalize||!1,r.stride||0,r.offset||0)}}createAttributeSetters(){const{gl:t}=this,e={};if(null!==this.program){const r=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);for(let n=0;n<r;++n){const r=t.getActiveAttrib(this.program,n);if(!r)break;const i=t.getAttribLocation(this.program,r.name);e[r.name]=this.createAttribSetter(i)}}return e}setAttributes(t,e){return e=e?e.attribSetters||e:this.attribSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}setUniforms(t,e){return e=e?e.uniformSetters||e:this.uniformSetters,Object.keys(t).forEach((function(r){const n=e[r];n&&n(t[r])})),this}elements(t){return this.elementsBuffer||(this.elementsBuffer=this.gl.createBuffer()),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.elementsBuffer),t.data&&this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t.data,t.usage||this.gl.STATIC_DRAW),void 0!==t.count&&this.runTimes(t.count),t.primitive&&this.setPrimitive(t.primitive),this}clear(t){return JR(this.gl,t),this.transfromStack=[],this}runTimes(t){return this.count=t||0,this}setPrimitive(t){return this.primitive=t||this.gl.TRIANGLES,this}resize(t,e){return void 0===t||void 0===e?(qR(this.gl.canvas),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height)):this.gl.viewport(0,0,t,e),this}draw(){throw new Error("should override")}translate(){throw new Error("should override")}rotate(){throw new Error("should override")}scale(){throw new Error("should override")}destroyed(){throw new Error("should override")}}var ZR="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_range.x;float max=u_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",$R="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_image;uniform vec2 u_image_res;uniform vec2 u_range;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;float calcTexture(const vec2 uv){return texture2D(u_image,uv).r;}float bilinear(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=calcTexture(vc);float tr=calcTexture(vc+vec2(px.x,0));float bl=calcTexture(vc+vec2(0,px.y));float br=calcTexture(vc+px);return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getValue(const vec2 uv){float min=u_mapping_range.x;float max=u_mapping_range.y;float r=bilinear(uv);return r*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=getValue(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class tN extends KR{constructor(t,e,r,n){super(t,e||$R,r||ZR,n||{}),this.vertShader=$R,this.fragShader=ZR}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}}function eN(t,e){const r=document.createElement("canvas"),n=r.getContext("2d");r.width=256,r.height=1;const{input:i}=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(e);if(n&&i&&Array.isArray(i)){const e=i.map((t=>parseFloat(t.key))),r=[Math.min(...e),Math.max(...e)],[o,s]=[t[0]||r[0],t[1]||r[1]],a=n.createLinearGradient(0,0,256,0);for(let t=0;t<i.length;t+=1){const e=i[t].key,r=i[t].value;a.addColorStop((e-o)/(s-o),r)}return n.fillStyle=a,n.fillRect(0,0,256,1),{data:new Uint8Array(n.getImageData(0,0,256,1).data),colorRange:r}}return{}}function rN(t,e,r,n){const i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}const nN={};function iN(t,e,r,n,i){const o=`${t}_${r}`,s=n[r];if(VR(s))return nN[o]&&delete nN[o],s;if(s&&Array.isArray(s)&&(!nN[o]||i)&&(nN[o]=function(t){if(Array.isArray(t)&&t.length>3){const e=t[0],r=t[1],n=[];for(let e=3;e<t.length;e+=2){const r=t[e],i=t[e+1];n.push({key:r,value:i})}return{operator:e,interpolation:{name:r[0],base:r[1]},input:n}}return console.warn("[wind-core]: style-parser style config invalid"),{}}(s)),nN[o]){const{input:t,interpolation:r}=nN[o]||{};if(t&&Array.isArray(t)){const n=t.map((t=>t.key)),i=t.map((t=>t.value));if(e<=n[0])return i[0];const o=n.length;if(e>=n[o-1])return i[o-1];const s=function(t,e){const r=t.length-1;let n,i,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],i=t[a+1],n<=e){if(a===r||e<i)return a;o=a+1}else{if(!(n>e))throw new Error("Input is not a number.");s=a-1}return 0}(n,e),a=n.length-1,u=function(t,e,r,n){let i=0;return"exponential"===t.name?i=rN(e,t.base,r,n):"linear"===t.name?i=rN(e,1,r,n):"cubic-bezier"===t.name&&console.warn("interpolationFactor"),i}(r,e,n[s],n[s>=a?a:s+1]);return function(t,e,r){return t*(1-r)+e*r}(i[s],i[s>=a?a:s+1],u)}return 1}return 1}var oN="precision highp float;\n#define GLSLIFY 1\nuniform sampler2D u_wind;uniform sampler2D u_color_ramp;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_color_range;uniform vec2 u_display_range;uniform float u_opacity;varying vec2 v_tex_pos;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);return length(vec2(u,v));}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}void main(){vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float value_t=(value-u_color_range.x)/(u_color_range.y-u_color_range.x);vec2 ramp_pos=vec2(fract(16.0*value_t),floor(16.0*value_t)/16.0);vec4 color=texture2D(u_color_ramp,ramp_pos);bool display=value<u_display_range.y&&value>u_display_range.x;if(display){gl_FragColor=vec4(floor(255.0*color*u_opacity)/255.0);}else{gl_FragColor=vec4(0.0,0.0,0.0,0.0);}}",sN="#define GLSLIFY 1\nattribute vec3 instancePositions;attribute vec3 instancePositions64Low;attribute vec2 a_texCoord;uniform mat4 u_matrix;uniform vec4 u_cameraEye;uniform vec4 u_cameraEye64Low;uniform float u_offset;uniform sampler2D u_wind;uniform vec2 u_image_res;uniform vec2 u_wind_min;uniform vec2 u_wind_max;uniform vec2 u_mapping_range;varying vec2 v_tex_pos;varying float v_value;vec2 windTexture(const vec2 uv){return texture2D(u_wind,uv).rg;}float bilinearU(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).r;float tr=windTexture(vc+vec2(px.x,0)).r;float bl=windTexture(vc+vec2(0,px.y)).r;float br=windTexture(vc+px).r;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float bilinearV(const vec2 uv){vec2 px=1.0/u_image_res;vec2 vc=(floor(uv*u_image_res))*px;vec2 f=fract(uv*u_image_res);float tl=windTexture(vc).g;float tr=windTexture(vc+vec2(px.x,0.0)).g;float bl=windTexture(vc+vec2(0.0,px.y)).g;float br=windTexture(vc+px).g;return mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);}float getV(const vec2 uv){float min=u_wind_min.y;float max=u_wind_max.y;float r=bilinearV(uv);return r*(max-min)+min;}float getU(const vec2 uv){float min=u_wind_min.x;float max=u_wind_max.x;float r=bilinearU(uv);return r*(max-min)+min;}float windSpeed(const vec2 uv){float u=getU(uv);float v=getV(uv);float min=u_mapping_range.x;float max=u_mapping_range.y;float val=length(vec2(u,v));return val*(max-min)+min;}const float PI=3.14159265359;vec2 mercatorToWGS84(vec2 xy){float y=radians(180.0-xy.y*360.0);y=360.0/PI*atan(exp(y))-90.0;y=y/-180.0+0.5;return vec2(xy.x,y);}\n#modules-transformZ\nvoid main(){v_tex_pos=a_texCoord;vec2 globalWGS84=mercatorToWGS84(v_tex_pos);float value=windSpeed(globalWGS84);float z=transformZ(value,instancePositions);vec4 pos=vec4(instancePositions-u_cameraEye.xyz,0.0);pos+=vec4(instancePositions64Low-u_cameraEye64Low.xyz,0.0);\n#modules-project\n}";class aN extends KR{constructor(t,e,r,n){super(t,e||sN,r||oN,n||{}),this.vertShader=sN,this.fragShader=oN}draw(){if(void 0!==this.checkExt){const t=this.primitive||this.gl.TRIANGLES;this.checkExt?this.gl.drawElements(t,this.count,this.gl.UNSIGNED_INT,0):this.gl.drawElements(t,this.count,this.gl.UNSIGNED_SHORT,0)}else this.checkExt=this.gl.getExtension("OES_element_index_uint");return this}translate(){return this}rotate(){return this}scale(){return this}destroyed(){}}const uN={renderForm:"r",styleSpec:{"fill-color":["interpolate",["linear"],["get","value"],0,"#3288bd",10,"#66c2a5",20,"#abdda4",30,"#e6f598",40,"#fee08b",50,"#fdae61",60,"#f46d43",100,"#d53e4f"],opacity:1},displayRange:[1/0,1/0],mappingRange:[0,0],widthSegments:1,heightSegments:1,wireframe:!1,createPlaneBuffer:(t,e,r)=>{const[n,i,o,s]=[t[0][0],t[2][0],t[0][1],t[1][1]];return function(t,e,r,n,i,o){const s=e-t,a=n-r,u=s/2,l=a/2,h=Math.floor(i),c=Math.floor(o),f=h+1,p=c+1,g=s/h,d=a/c,A=[],y=[],v=[],m=[],_=[];for(let e=0;e<p;e++){const n=e*d;for(let i=0;i<f;i++){const o=t+i*g/u/2*s,f=r+n/l/2*a;v.push(o,f,0),m.push(HR(o),HR(f),0),_.push(i/h,e/c)}}for(let t=0;t<c;t++)for(let e=0;e<h;e++){const r=e+f*t,n=e+f*(t+1),i=e+1+f*(t+1),o=e+1+f*t;A.push(r,n,o),A.push(n,i,o)}for(let t=0,e=A.length;t<e;t+=3){const e=A[t],r=A[t+1],n=A[t+2];y.push(e,r,r,n,n,e)}return{uvs:{data:_,size:2},elements:{data:A,count:A.length},wireframeElements:{data:y,count:y.length},position:{data:v,size:3},positionLow:{data:m,size:3}}}(n,i,o,s,e,r)},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return 0.0;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}};let lN=0;class hN{constructor(t,e){if(this.gl=t,this.uid=`ScalarFill_${lN}`,lN++,!this.gl)throw new Error("initialize error");e||(e={}),this.options={...uN,...e},this.opacity=this.options.opacity||1}updateOptions(t){this.options={...this.options,...t},this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(iN(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec,!0))}setFillColor(){this.buildColorRamp()}setOpacity(t){this.opacity=t}handleZoom(){"function"==typeof this.options.getZoom&&this.setOpacity(iN(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}buildColorRamp(){var t;const{data:e,colorRange:r}=eN([],null==(t=this.options.styleSpec)?void 0:t["fill-color"]);r&&(this.colorRange=r),e&&(this.colorRampTexture=XR(this.gl,this.gl.NEAREST,e,16,16))}initialize(t){this.drawCommand||("rg"===this.options.renderForm?this.drawCommand=new aN(t,void 0,void 0,this.options.injectShaderModules):"r"===this.options.renderForm?this.drawCommand=new tN(t,void 0,void 0,this.options.injectShaderModules):console.warn("This type is not supported temporarily")),this.buildColorRamp(),"function"==typeof this.options.getZoom&&this.setOpacity(iN(this.uid,this.options.getZoom(),"opacity",this.options.styleSpec))}initializeVertex(t){let e=0;const r=t.length,n=[];for(;e<r;e++){const r=t[e],i=this.getMercatorCoordinate(r);n.push([i[0],i[1]])}const i=(this.options.createPlaneBuffer||uN.createPlaneBuffer)(n,this.options.widthSegments||1,this.options.heightSegments||1);return{indexes:i.elements.data,wireframeIndexes:i.wireframeElements.data,quadBuffer:WR(this.gl,new Float32Array(i.position.data)),quad64LowBuffer:WR(this.gl,new Float32Array(i.positionLow.data)),texCoordBuffer:WR(this.gl,new Float32Array(i.uvs.data))}}getTextureData(t){return new Promise(((e,r)=>{if("image"===t.type&&t.url)(function(t){return new Promise(((e,r)=>{t||r(new Event("url is null"));const n=new Image;n.crossOrigin="anonymous",n.onload=()=>e(n),n.onerror=r,n.src=t,n.complete&&e(n)}))})(t.url).then((r=>{const n={width:r.width,height:r.height,texture:XR(this.gl,this.gl.LINEAR,r,r.width,r.height),...this.initializeVertex(t.extent)};"rg"===this.options.renderForm?(n.uMin=t.uMin,n.uMax=t.uMax,n.vMin=t.vMin,n.vMax=t.vMax):"r"===this.options.renderForm?(n.min=t.min,n.max=t.max):console.warn("This type is not supported temporarily"),e(n)})).catch((t=>r(t)));else if("jsonArray"===t.type&&t.data){const r=t.data;let n;n=t.extent?t.extent:[[r[0].header.lo1,r[0].header.la1],[r[0].header.lo1,r[0].header.la2],[r[0].header.lo2,r[0].header.la1],[r[0].header.lo2,r[0].header.la2]];const i={width:r[0].header.nx,height:r[0].header.ny,...this.initializeVertex(n)};if(this.worker||(this.worker=new jR,this.worker.addEventListener("message",(({data:t})=>{"rg"===this.options.renderForm?(i.uMin=t[1],i.uMax=t[2],i.vMin=t[3],i.vMax=t[4],i.texture=XR(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):"r"===this.options.renderForm?(i.min=t[1],i.max=t[2],i.texture=XR(this.gl,this.gl.LINEAR,new Uint8Array(t[0]),i.width,i.height)):console.warn("This type is not supported temporarily"),e(i)}))),"rg"===this.options.renderForm){let t,e;r.forEach((r=>{switch(r.header.parameterCategory+","+r.header.parameterNumber){case"1,2":case"2,2":t=r;break;case"1,3":case"2,3":e=r}}));const n=new Float32Array(t.data),i=new Float32Array(e.data);this.worker.postMessage(["rg",n,i])}else if("r"===this.options.renderForm){const t=new Float32Array(r[0].data);this.worker.postMessage(["r",t])}else console.warn("This type is not supported temporarily")}}))}setData(t,e){this.gl&&t&&this.getTextureData(t).then((t=>{this.data=t,e&&e(!0),this.data&&this.initialize(this.gl),this.options.triggerRepaint&&(this.handleZoom(),this.options.triggerRepaint())})).catch((t=>{e&&e(!1),console.error(t)}))}getData(){return this.data}getMercatorCoordinate([t,e]){return[t,e]}prerender(){}render(t,e,r){if(this.data&&this.drawCommand&&this.data.texture&&this.colorRampTexture){const n=this.opacity,i={u_opacity:VR(n)?n:1,u_image_res:[this.data.width,this.data.height],u_matrix:t,u_offset:VR(e)?e:0,u_color_ramp:this.colorRampTexture,u_color_range:this.colorRange,u_mapping_range:this.options.mappingRange||[0,0]};if(r&&(i.u_cameraEye=r.cameraEye,i.u_cameraEye64Low=r.cameraEye64Low),"rg"===this.options.renderForm){i.u_wind_min=[this.data.uMin,this.data.vMin],i.u_wind_max=[this.data.uMax,this.data.vMax],i.u_wind=this.data.texture;const t=[Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMin*this.data.vMin),Math.sqrt(this.data.uMin*this.data.uMin+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMax*this.data.vMax),Math.sqrt(this.data.uMax*this.data.uMax+this.data.vMin*this.data.vMin)],e=0,r=Math.max(...t);i.u_display_range=this.options.displayRange||[e,r]}else"r"===this.options.renderForm?(i.u_range=[this.data.min,this.data.max],i.u_image=this.data.texture,i.u_display_range=this.options.displayRange||[i.u_range[0]-1,i.u_range[1]+1]):console.warn("This type is not supported temporarily");const o=this.gl.isEnabled(this.gl.DEPTH_TEST);this.gl.enable(this.gl.DEPTH_TEST),this.gl.depthMask(!0),this.gl.depthFunc(this.gl.LEQUAL);const s=this.options.wireframe?this.data.wireframeIndexes:this.data.indexes;this.drawCommand.active().setUniforms(i).setAttributes({instancePositions:{buffer:this.data.quadBuffer,numComponents:3},instancePositions64Low:{buffer:this.data.quad64LowBuffer,numComponents:3},a_texCoord:{buffer:this.data.texCoordBuffer,numComponents:2}}).elements({data:new Uint32Array(s),primitive:this.options.wireframe?this.gl.LINES:this.gl.TRIANGLES,count:null==s?void 0:s.length,usage:this.gl.STATIC_DRAW}).draw(),o||this.gl.disable(this.gl.DEPTH_TEST)}}postrender(){}destroyData(){this.data}destroyed(){this.destroyData(),this.worker&&this.worker.terminate()}}function cN(t,e,r){const n=t.length,i=r>1?r:2;let o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(let e=0;e<n;e+=i)o[e]=180*t[e]/20037508.342789244,o[e+1]=360*Math.atan(Math.exp(t[e+1]/6378137))/Math.PI-90;return o}function fN(t,e,r,n){let i=[];if(n>1){const e=t[2]-t[0],r=t[3]-t[1];for(let o=0;o<n;++o)i.push(t[0]+e*o/n,t[1],t[2],t[1]+r*o/n,t[2]-e*o/n,t[3],t[0],t[3]-r*o/n)}else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);const o=[],s=[];for(let t=0,e=i.length;t<e;t+=2)o.push(i[t]),s.push(i[t+1]);return function(t,e,r){return function(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(o,s,r)}function pN(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function gN(t,e,r,n){return t.coordToPointAtRes?t.coordToPointAtRes(e,r,n):t.coordinateToPoint(e,r,n)}const dN={renderer:"gl",doubleBuffer:!1,animation:!1,glOptions:{antialias:!0,depth:!0,stencil:!0,alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0}};class AN extends i.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}clearCanvas(){this.gl&&JR(this.gl,[0,0,0,0])}createContext(){this.gl&&this.gl.canvas===this.canvas||(this.gl=function(t,e={}){const r=["webgl","experimental-webgl"];let n=null;function i(t){console.error(t.statusMessage)}t.addEventListener("webglcontextcreationerror",i,!1);for(let i=0;i<r.length;++i){try{n=t.getContext(r[i],e)}catch(t){}if(n)break}return t.removeEventListener("webglcontextcreationerror",i,!1),n&&n.getExtension("OES_texture_float")?n:null}(this.canvas,this.layer.options.glOptions))}resizeCanvas(t){if(this.canvas&&this.gl){const e=this.getMap(),r=e.getDevicePixelRatio(),n=t||e.getSize();this.canvas.height=r*n.height,this.canvas.width=r*n.width,this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height)}}getMatrix(){return this.getMap().projViewMatrix}handleZoom(){this.scalarRender&&this.scalarRender.handleZoom()}drawWind(){const t=this.getMap();if(null!==this.gl){const e=this.layer,r=e.getOptions(),n=e.getData();if(!this.scalarRender&&t&&(this.scalarRender=new hN(this.gl,{opacity:r.opacity,renderForm:r.renderForm,styleSpec:r.styleSpec,displayRange:r.displayRange,mappingRange:r.mappingRange,widthSegments:r.widthSegments,heightSegments:r.heightSegments,createPlaneBuffer:r.createPlaneBuffer,wireframe:r.wireframe,getZoom:()=>this.getMap().getZoom(),triggerRepaint:()=>{this._redraw()},injectShaderModules:{"#modules-transformZ":"\nfloat transformZ(float value, vec3 pos) {\n return value;\n}\n ","#modules-project":"\ngl_Position = u_matrix * vec4(pos.xy + vec2(u_offset, 0.0), pos.z + z, 1.0);\n "}}),this.scalarRender.getMercatorCoordinate=([e,r])=>{const n=gN(t,new o(e,r),pN(t));return[n.x,n.y]},this.getMap().on("zoom",this.handleZoom,this),this.scalarRender.setData(n)),this.scalarRender){const t=this.getMatrix(),e=[0,0,0,1],r=e.map((t=>HR(t))),n=this.getWrappedWorlds();for(let i=0;i<n.length;i++)this.scalarRender.render(t,n[i],{cameraEye:e,cameraEye64Low:r})}}this.completeRender()}getWrappedWorlds(){const t=this.getMap(),e=t.getProjection().fullExtent,r=[e.left,e.bottom,e.right,e.top],n=t.getProjExtent(),i=[n.xmin,n.ymin,n.xmax,n.ymax];let s=i[0];const a=function(t){return t[2]-t[0]}(r),u=Math.abs(gN(t,t.getProjection().unprojectCoords(new o([r[0],r[1]])),pN(t)).x-gN(t,t.getProjection().unprojectCoords(new o([r[2],r[3]])),pN(t)).x);let l=0;const h=[];if(this.layer.getOptions().wrapX){for(;s<r[0];)--l,h.push(l*u),s+=a;for(l=0,s=i[2];s>r[2];)++l,h.push(l*u),s-=a}return h.push(0),h}drawOnInteracting(){this.draw()}onZoomStart(...t){super.onZoomStart.apply(this,t)}onZoomEnd(...t){super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){super.onMoveStart.apply(this,t)}onMoveEnd(...t){super.onMoveEnd.apply(this,t)}remove(){delete this._drawContext,super.remove()}getMap(){return super.getMap()}completeRender(){return super.completeRender()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}}(class extends a{constructor(t,e,r){super(t,{...dN,...r}),this.data=null,this._map=null,e&&this.setData(e)}getData(){return this.data}setData(t){return new Promise(((e,r)=>{this.data=t;const n=this._getRenderer();this.data&&n&&n.scalarFill?n.scalarFill.setData(this.data,(t=>{t?e(!0):r(!1)})):e(!1)}))}setOptions(t){this.options={...this.options,...t||{}};const e=this._getRenderer();e&&e.scalarRender&&(e.scalarRender.updateOptions(this.options),e.setToRedraw())}getOptions(){return this.options||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}).registerRenderer("gl",AN);const yN={renderer:"canvas",doubleBuffer:!1,animation:!1,windOptions:{}};class vN extends i.CanvasLayerRenderer{checkResources(){return[]}getDrawParams(){return[]}hitDetect(){return!1}draw(){this.prepareCanvas(),this.prepareDrawContext(),this.drawWind()}_redraw(){this.prepareRender(),this.draw()}drawWind(){const t=this.getMap();if(this.context){const e=this.layer,r=e.getWindOptions();if(!this.wind&&t){const t=e.getData();this.wind=new PR(this.context,r,t),this.wind.project=this.project.bind(this),this.wind.unproject=this.unproject.bind(this),this.wind.intersectsCoordinate=this.intersectsCoordinate.bind(this),this.wind.postrender=()=>{this.setCanvasUpdated()},this.wind.prerender()}this.wind&&(this.wind.prerender(),this.wind.render())}this.completeRender()}project(t){const e=this.getMap().coordinateToContainerPoint(new o(t[0],t[1]));return[e.x,e.y]}unproject(t){return this.getMap().containerPointToCoordinate(new s(t[0],t[1])).toArray()}intersectsCoordinate(t){var e;if(!this.layer)return!1;const r=null==(e=this.layer)?void 0:e.getProjection();if(r&&"EPSG:3857"!==r.code)return!0;const n=this.getMap().getProjExtent(),i=function(t,e){return fN(t,cN,void 0,e)}([n.xmin,n.ymin,n.xmax,n.ymax],0);return function(t,e){const r=e[0],n=e[1];return t[0]<=r&&r<=t[2]&&t[1]<=n&&n<=t[3]}(i,[t[0],t[1]])}drawOnInteracting(){}onZoomStart(...t){this.wind&&this.wind.stop(),super.onZoomStart.apply(this,t)}onZoomEnd(...t){this.wind&&this.wind.start(),super.onZoomEnd.apply(this,t)}onDragRotateStart(...t){this.wind&&this.wind.stop(),super.onDragRotateStart.apply(this,t)}onDragRotateEnd(...t){this.wind&&this.wind.start(),super.onDragRotateEnd.apply(this,t)}onMoveStart(...t){this.wind&&this.wind.stop(),super.onMoveStart.apply(this,t)}onMoveEnd(...t){this.wind&&this.wind.start(),super.onMoveEnd.apply(this,t)}remove(){this.wind&&this.wind.stop(),delete this._drawContext,super.remove()}getMap(){return super.getMap()}prepareCanvas(){return super.prepareCanvas()}prepareDrawContext(){super.prepareDrawContext()}prepareRender(){return super.prepareRender()}completeRender(){return super.completeRender()}}class mN extends a{constructor(t,e,r={}){super(t,bR({},yN,r)),this._map=null,this.pickWindOptions(),e&&this.setData(e,r.fieldOptions)}pickWindOptions(){Object.keys(RR).forEach((t=>{this.options&&t in this.options&&(void 0===this.options.windOptions&&(this.options.windOptions={}),this.options.windOptions[t]=this.options[t])}))}getData(){return this.field}setData(t,e={}){var r;t&&t.checkFields&&t.checkFields()?this.field=t:(r=t,Array.isArray(r)?this.field=function(t,e={}){let r,n;if(t.forEach((function(t){switch(t.header.parameterCategory+","+t.header.parameterNumber){case"1,2":case"2,2":r=t;break;case"1,3":case"2,3":n=t}})),!n||!r)return;const i=r.header;return new LR({xmin:i.lo1,ymin:i.la1,xmax:i.lo2,ymax:i.la2,deltaX:i.dx,deltaY:i.dy,cols:i.nx,rows:i.ny,us:r.data,vs:n.data,...e})}(t,e):console.error("Illegal data"));const n=this._getRenderer();return n&&n.wind&&this.field&&n.wind.updateData(this.field),this}setWindOptions(t){const e=this.options.windOptions||{};this.options=bR(this.options,{windOptions:bR(e,t||{})});const r=this._getRenderer();if(r&&r.wind){const t=this.options.windOptions;r.wind.setOptions(t)}}getWindOptions(){return this.options.windOptions||{}}draw(){return this._getRenderer()&&this._getRenderer()._redraw(),this}prepareToDraw(){return[]}drawOnInteracting(){this.draw()}_getRenderer(){return super._getRenderer()}}mN.registerRenderer("canvas",vN);const _N=mN;var IN={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a=17976931348623157e292,u=NaN,l="[object Arguments]",h="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",g="[object Function]",d="[object GeneratorFunction]",A="[object Map]",y="[object Number]",v="[object Object]",m="[object Promise]",_="[object RegExp]",I="[object Set]",E="[object String]",x="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",b="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B=/^\w*$/,M=/^\./,T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/^\s+|\s+$/g,R=/\\(\\)?/g,N=/^[-+]0x[0-9a-f]+$/i,P=/^0b[01]+$/i,D=/^\[object .+?Constructor\]$/,Q=/^0o[0-7]+$/i,k=/^(?:0|[1-9]\d*)$/,F={};F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F[l]=F[h]=F[C]=F[c]=F[b]=F[f]=F[p]=F[g]=F[A]=F[y]=F[v]=F[_]=F[I]=F[E]=F[w]=!1;var O=parseInt,U="object"==typeof an&&an&&an.Object===Object&&an,G="object"==typeof self&&self&&self.Object===Object&&self,z=U||G||Function("return this")(),j=e&&!e.nodeType&&e,V=j&&t&&!t.nodeType&&t,H=V&&V.exports===j&&U.process,q=function(){try{return H&&H.binding("util")}catch(t){}}(),Y=q&&q.isTypedArray;function X(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function W(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function J(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Z,$=Array.prototype,tt=Function.prototype,et=Object.prototype,rt=z["__core-js_shared__"],nt=(Z=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||""))?"Symbol(src)_1."+Z:"",it=tt.toString,ot=et.hasOwnProperty,st=et.toString,at=RegExp("^"+it.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=z.Symbol,lt=z.Uint8Array,ht=et.propertyIsEnumerable,ct=$.splice,ft=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),pt=Math.max,gt=Vt(z,"DataView"),dt=Vt(z,"Map"),At=Vt(z,"Promise"),yt=Vt(z,"Set"),vt=Vt(z,"WeakMap"),mt=Vt(Object,"create"),_t=Zt(gt),It=Zt(dt),Et=Zt(At),xt=Zt(yt),wt=Zt(vt),Ct=ut?ut.prototype:void 0,bt=Ct?Ct.valueOf:void 0,St=Ct?Ct.toString:void 0;function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Mt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Lt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Tt;++e<r;)this.add(t[e])}function Rt(t){this.__data__=new Mt(t)}function Nt(t,e){var r=ie(t)||ne(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!ot.call(t,o)||i&&("length"==o||qt(o,n))||r.push(o);return r}function Pt(t,e){for(var r=t.length;r--;)if(re(t[r][0],e))return r;return-1}function Dt(t,e){for(var r=0,n=(e=Yt(e,t)?[e]:Gt(e)).length;null!=t&&r<n;)t=t[Kt(e[r++])];return r&&r==n?t:void 0}function Qt(t,e){return null!=t&&e in Object(t)}function kt(t,e,r,o,s){return t===e||(null==t||null==e||!ue(t)&&!le(e)?t!=t&&e!=e:function(t,e,r,o,s,a){var u=ie(t),g=ie(e),d=h,m=h;u||(d=(d=Ht(t))==l?v:d);g||(m=(m=Ht(e))==l?v:m);var w=d==v&&!W(t),S=m==v&&!W(e),B=d==m;if(B&&!w)return a||(a=new Rt),u||fe(t)?zt(t,e,r,o,s,a):function(t,e,r,o,s,a,u){switch(r){case b:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new lt(t),new lt(e)));case c:case f:case y:return re(+t,+e);case p:return t.name==e.name&&t.message==e.message;case _:case E:return t==e+"";case A:var l=J;case I:var h=a&i;if(l||(l=K),t.size!=e.size&&!h)return!1;var g=u.get(t);if(g)return g==e;a|=n,u.set(t,e);var d=zt(l(t),l(e),o,s,a,u);return u.delete(t),d;case x:if(bt)return bt.call(t)==bt.call(e)}return!1}(t,e,d,r,o,s,a);if(!(s&i)){var M=w&&ot.call(t,"__wrapped__"),T=S&&ot.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return a||(a=new Rt),r(L,R,o,s,a)}}if(!B)return!1;return a||(a=new Rt),function(t,e,r,n,o,s){var a=o&i,u=pe(t),l=u.length,h=pe(e),c=h.length;if(l!=c&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:ot.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,a)}(t,e,kt,r,o,s))}function Ft(t){return!(!ue(t)||(e=t,nt&&nt in e))&&(se(t)||W(t)?at:D).test(Zt(t));var e}function Ot(t){return"function"==typeof t?t:null==t?ge:"object"==typeof t?ie(t)?function(t,e){if(Yt(t)&&Xt(e))return Wt(Kt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Dt(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=Yt(e,t)?[e]:Gt(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Kt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ae(o)&&qt(s,o)&&(ie(t)||ne(t))}(t,e,Qt)}(r,t):kt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=pe(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,Xt(i)]}return e}(t);if(1==e.length&&e[0][2])return Wt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var h=(l=r[s])[0],c=t[h],f=l[1];if(u&&l[2]){if(void 0===c&&!(h in t))return!1}else{var p=new Rt;if(o)var g=o(c,f,h,t,e,p);if(!(void 0===g?kt(f,c,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):Yt(e=t)?(r=Kt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Dt(e,t)}}(e);var e,r}function Ut(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||et,e!==n)return ft(t);var e,r,n,i=[];for(var o in Object(t))ot.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Gt(t){return ie(t)?t:Jt(t)}function zt(t,e,r,o,s,a){var u=s&i,l=t.length,h=e.length;if(l!=h&&!(u&&h>l))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,p=!0,g=s&n?new Lt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!X(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function jt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Vt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ft(r)?r:void 0}Bt.prototype.clear=function(){this.__data__=mt?mt(null):{}},Bt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Bt.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return n===r?void 0:n}return ot.call(e,t)?e[t]:void 0},Bt.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:ot.call(e,t)},Bt.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?r:e,this},Mt.prototype.clear=function(){this.__data__=[]},Mt.prototype.delete=function(t){var e=this.__data__,r=Pt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ct.call(e,r,1),!0)},Mt.prototype.get=function(t){var e=this.__data__,r=Pt(e,t);return r<0?void 0:e[r][1]},Mt.prototype.has=function(t){return Pt(this.__data__,t)>-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=Pt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new Bt,map:new(dt||Mt),string:new Bt}},Tt.prototype.delete=function(t){return jt(this,t).delete(t)},Tt.prototype.get=function(t){return jt(this,t).get(t)},Tt.prototype.has=function(t){return jt(this,t).has(t)},Tt.prototype.set=function(t,e){return jt(this,t).set(t,e),this},Lt.prototype.add=Lt.prototype.push=function(t){return this.__data__.set(t,r),this},Lt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.clear=function(){this.__data__=new Mt},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!dt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Tt(n)}return r.set(t,e),this};var Ht=function(t){return st.call(t)};function qt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||k.test(t))&&t>-1&&t%1==0&&t<e}function Yt(t,e){if(ie(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!he(t))||(B.test(t)||!S.test(t)||null!=e&&t in Object(e))}function Xt(t){return t==t&&!ue(t)}function Wt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(gt&&Ht(new gt(new ArrayBuffer(1)))!=b||dt&&Ht(new dt)!=A||At&&Ht(At.resolve())!=m||yt&&Ht(new yt)!=I||vt&&Ht(new vt)!=w)&&(Ht=function(t){var e=st.call(t),r=e==v?t.constructor:void 0,n=r?Zt(r):void 0;if(n)switch(n){case _t:return b;case It:return A;case Et:return m;case xt:return I;case wt:return w}return e});var Jt=ee((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(he(t))return St?St.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return M.test(t)&&r.push(""),t.replace(T,(function(t,e,n,i){r.push(n?i.replace(R,"$1"):e||t)})),r}));function Kt(t){if("string"==typeof t||he(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function Zt(t){if(null!=t){try{return it.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var $t,te=($t=function(t,e,r){var n=t?t.length:0;if(!n)return-1;var i,s,l=null==r?0:(i=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(he(t))return u;if(ue(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ue(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(L,"");var r=P.test(t);return r||Q.test(t)?O(t.slice(2),r?2:8):N.test(t)?u:+t}(t))===o||t===-o?(t<0?-1:1)*a:t==t?t:0:0===t?t:0}(r),s=i%1,i==i?s?i-s:i:0);return l<0&&(l=pt(n+l,0)),function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Ot(e),l)},function(t,e,r){var n=Object(t);if(!oe(t)){var i=Ot(e);t=pe(t),e=function(t){return i(n[t],t,n)}}var o=$t(t,e,r);return o>-1?n[i?t[o]:o]:void 0});function ee(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(ee.Cache||Tt),r}function re(t,e){return t===e||t!=t&&e!=e}function ne(t){return function(t){return le(t)&&oe(t)}(t)&&ot.call(t,"callee")&&(!ht.call(t,"callee")||st.call(t)==l)}ee.Cache=Tt;var ie=Array.isArray;function oe(t){return null!=t&&ae(t.length)&&!se(t)}function se(t){var e=ue(t)?st.call(t):"";return e==g||e==d}function ae(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function ue(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function le(t){return!!t&&"object"==typeof t}function he(t){return"symbol"==typeof t||le(t)&&st.call(t)==x}var ce,fe=Y?(ce=Y,function(t){return ce(t)}):function(t){return le(t)&&ae(t.length)&&!!F[st.call(t)]};function pe(t){return oe(t)?Nt(t):Ut(t)}function ge(t){return t}t.exports=te}(IN,IN.exports);var EN=IN.exports,xN={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",n=1,i=2,o=1/0,s=9007199254740991,a="[object Arguments]",u="[object Array]",l="[object Boolean]",h="[object Date]",c="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",d="[object Number]",A="[object Object]",y="[object Promise]",v="[object RegExp]",m="[object Set]",_="[object String]",I="[object Symbol]",E="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,S=/^\./,B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[a]=R[u]=R[x]=R[l]=R[w]=R[h]=R[c]=R[f]=R[g]=R[d]=R[A]=R[v]=R[m]=R[_]=R[E]=!1;var N="object"==typeof an&&an&&an.Object===Object&&an,P="object"==typeof self&&self&&self.Object===Object&&self,D=N||P||Function("return this")(),Q=e&&!e.nodeType&&e,k=Q&&t&&!t.nodeType&&t,F=k&&k.exports===Q&&N.process,O=function(){try{return F&&F.binding("util")}catch(t){}}(),U=O&&O.isTypedArray;function G(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function z(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function j(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var q,Y=Array.prototype,X=Function.prototype,W=Object.prototype,J=D["__core-js_shared__"],K=(q=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Z=X.toString,$=W.hasOwnProperty,tt=W.toString,et=RegExp("^"+Z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=D.Symbol,nt=D.Uint8Array,it=W.propertyIsEnumerable,ot=Y.splice,st=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),at=zt(D,"DataView"),ut=zt(D,"Map"),lt=zt(D,"Promise"),ht=zt(D,"Set"),ct=zt(D,"WeakMap"),ft=zt(Object,"create"),pt=Jt(at),gt=Jt(ut),dt=Jt(lt),At=Jt(ht),yt=Jt(ct),vt=rt?rt.prototype:void 0,mt=vt?vt.valueOf:void 0,_t=vt?vt.toString:void 0;function It(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function wt(t){var e=-1,r=t?t.length:0;for(this.__data__=new xt;++e<r;)this.add(t[e])}function Ct(t){this.__data__=new Et(t)}function bt(t,e){var r=te(t)||$t(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!$.call(t,o)||i&&("length"==o||Vt(o,n))||r.push(o);return r}function St(t,e){for(var r=t.length;r--;)if(Zt(t[r][0],e))return r;return-1}It.prototype.clear=function(){this.__data__=ft?ft(null):{}},It.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},It.prototype.get=function(t){var e=this.__data__;if(ft){var n=e[t];return n===r?void 0:n}return $.call(e,t)?e[t]:void 0},It.prototype.has=function(t){var e=this.__data__;return ft?void 0!==e[t]:$.call(e,t)},It.prototype.set=function(t,e){return this.__data__[t]=ft&&void 0===e?r:e,this},Et.prototype.clear=function(){this.__data__=[]},Et.prototype.delete=function(t){var e=this.__data__,r=St(e,t);return!(r<0)&&(r==e.length-1?e.pop():ot.call(e,r,1),!0)},Et.prototype.get=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]},Et.prototype.has=function(t){return St(this.__data__,t)>-1},Et.prototype.set=function(t,e){var r=this.__data__,n=St(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new It,map:new(ut||Et),string:new It}},xt.prototype.delete=function(t){return Gt(this,t).delete(t)},xt.prototype.get=function(t){return Gt(this,t).get(t)},xt.prototype.has=function(t){return Gt(this,t).has(t)},xt.prototype.set=function(t,e){return Gt(this,t).set(t,e),this},wt.prototype.add=wt.prototype.push=function(t){return this.__data__.set(t,r),this},wt.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.clear=function(){this.__data__=new Et},Ct.prototype.delete=function(t){return this.__data__.delete(t)},Ct.prototype.get=function(t){return this.__data__.get(t)},Ct.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Et){var n=r.__data__;if(!ut||n.length<199)return n.push([t,e]),this;r=this.__data__=new xt(n)}return r.set(t,e),this};var Bt,Mt,Tt=(Bt=function(t,e){return t&&Lt(t,e,le)},function(t,e){if(null==t)return t;if(!ee(t))return Bt(t,e);for(var r=t.length,n=Mt?r:-1,i=Object(t);(Mt?n--:++n<r)&&!1!==e(i[n],n,i););return t}),Lt=function(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===r(o[u],u,o))break}return e}}();function Rt(t,e){for(var r=0,n=(e=Ht(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Wt(e[r++])];return r&&r==n?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Pt(t,e,r,o,s){return t===e||(null==t||null==e||!ie(t)&&!oe(e)?t!=t&&e!=e:function(t,e,r,o,s,f){var p=te(t),y=te(e),E=u,C=u;p||(E=(E=jt(t))==a?A:E);y||(C=(C=jt(e))==a?A:C);var b=E==A&&!j(t),S=C==A&&!j(e),B=E==C;if(B&&!b)return f||(f=new Ct),p||ue(t)?Ut(t,e,r,o,s,f):function(t,e,r,o,s,a,u){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!o(new nt(t),new nt(e)));case l:case h:case d:return Zt(+t,+e);case c:return t.name==e.name&&t.message==e.message;case v:case _:return t==e+"";case g:var f=V;case m:var p=a&i;if(f||(f=H),t.size!=e.size&&!p)return!1;var A=u.get(t);if(A)return A==e;a|=n,u.set(t,e);var y=Ut(f(t),f(e),o,s,a,u);return u.delete(t),y;case I:if(mt)return mt.call(t)==mt.call(e)}return!1}(t,e,E,r,o,s,f);if(!(s&i)){var M=b&&$.call(t,"__wrapped__"),T=S&&$.call(e,"__wrapped__");if(M||T){var L=M?t.value():t,R=T?e.value():e;return f||(f=new Ct),r(L,R,o,s,f)}}if(!B)return!1;return f||(f=new Ct),function(t,e,r,n,o,s){var a=o&i,u=le(t),l=u.length,h=le(e),c=h.length;if(l!=c&&!a)return!1;var f=l;for(;f--;){var p=u[f];if(!(a?p in e:$.call(e,p)))return!1}var g=s.get(t);if(g&&s.get(e))return g==e;var d=!0;s.set(t,e),s.set(e,t);var A=a;for(;++f<l;){var y=t[p=u[f]],v=e[p];if(n)var m=a?n(v,y,p,e,t,s):n(y,v,p,t,e,s);if(!(void 0===m?y===v||r(y,v,n,o,s):m)){d=!1;break}A||(A="constructor"==p)}if(d&&!A){var _=t.constructor,I=e.constructor;_==I||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof I&&I instanceof I||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,o,s,f)}(t,e,Pt,r,o,s))}function Dt(t){return!(!ie(t)||(e=t,K&&K in e))&&(re(t)||j(t)?et:T).test(Jt(t));var e}function Qt(t){return"function"==typeof t?t:null==t?he:"object"==typeof t?te(t)?function(t,e){if(Ht(t)&&qt(e))return Yt(Wt(t),e);return function(r){var o=function(t,e,r){var n=null==t?void 0:Rt(t,e);return void 0===n?r:n}(r,t);return void 0===o&&o===e?function(t,e){return null!=t&&function(t,e,r){e=Ht(e,t)?[e]:Ot(e);var n,i=-1,o=e.length;for(;++i<o;){var s=Wt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}if(n)return n;o=t?t.length:0;return!!o&&ne(o)&&Vt(s,o)&&(te(t)||$t(t))}(t,e,Nt)}(r,t):Pt(e,o,void 0,n|i)}}(t[0],t[1]):function(t){var e=function(t){var e=le(t),r=e.length;for(;r--;){var n=e[r],i=t[n];e[r]=[n,i,qt(i)]}return e}(t);if(1==e.length&&e[0][2])return Yt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<a;){var h=(l=r[s])[0],c=t[h],f=l[1];if(u&&l[2]){if(void 0===c&&!(h in t))return!1}else{var p=new Ct;if(o)var g=o(c,f,h,t,e,p);if(!(void 0===g?Pt(f,c,o,n|i,p):g))return!1}}return!0}(r,t,e)}}(t):Ht(e=t)?(r=Wt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return Rt(e,t)}}(e);var e,r}function kt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||W,e!==n)return st(t);var e,r,n,i=[];for(var o in Object(t))$.call(t,o)&&"constructor"!=o&&i.push(o);return i}function Ft(t,e){var r=-1,n=ee(t)?Array(t.length):[];return Tt(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function Ot(t){return te(t)?t:Xt(t)}function Ut(t,e,r,o,s,a){var u=s&i,l=t.length,h=e.length;if(l!=h&&!(u&&h>l))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,p=!0,g=s&n?new wt:void 0;for(a.set(t,e),a.set(e,t);++f<l;){var d=t[f],A=e[f];if(o)var y=u?o(A,d,f,e,t,a):o(d,A,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(g){if(!z(e,(function(t,e){if(!g.has(e)&&(d===t||r(d,t,o,s,a)))return g.add(e)}))){p=!1;break}}else if(d!==A&&!r(d,A,o,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function Gt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function zt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Dt(r)?r:void 0}var jt=function(t){return tt.call(t)};function Vt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t,e){if(te(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!se(t))||(b.test(t)||!C.test(t)||null!=e&&t in Object(e))}function qt(t){return t==t&&!ie(t)}function Yt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(at&&jt(new at(new ArrayBuffer(1)))!=w||ut&&jt(new ut)!=g||lt&&jt(lt.resolve())!=y||ht&&jt(new ht)!=m||ct&&jt(new ct)!=E)&&(jt=function(t){var e=tt.call(t),r=e==A?t.constructor:void 0,n=r?Jt(r):void 0;if(n)switch(n){case pt:return w;case gt:return g;case dt:return y;case At:return m;case yt:return E}return e});var Xt=Kt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(se(t))return _t?_t.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var r=[];return S.test(t)&&r.push(""),t.replace(B,(function(t,e,n,i){r.push(n?i.replace(M,"$1"):e||t)})),r}));function Wt(t){if("string"==typeof t||se(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}function Jt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Kt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Kt.Cache||xt),r}function Zt(t,e){return t===e||t!=t&&e!=e}function $t(t){return function(t){return oe(t)&&ee(t)}(t)&&$.call(t,"callee")&&(!it.call(t,"callee")||tt.call(t)==a)}Kt.Cache=xt;var te=Array.isArray;function ee(t){return null!=t&&ne(t.length)&&!re(t)}function re(t){var e=ie(t)?tt.call(t):"";return e==f||e==p}function ne(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function ie(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function oe(t){return!!t&&"object"==typeof t}function se(t){return"symbol"==typeof t||oe(t)&&tt.call(t)==I}var ae,ue=U?(ae=U,function(t){return ae(t)}):function(t){return oe(t)&&ne(t.length)&&!!R[tt.call(t)]};function le(t){return ee(t)?bt(t):kt(t)}function he(t){return t}t.exports=function(t,e){return(te(t)?G:Ft)(t,Qt(e))}}(xN,xN.exports);var wN={0:.05,1:.05,2:.05,3:.03,4:.02,5:.01,6:.006,7:.003,8:.002,9:.001,10:5e-4,11:3e-4,12:15e-5,13:1e-4,14:5e-5,15:25e-6,16:1e-5,16.99:1e-5,17:5e-6,18:2e-6,19:1e-6,20:5e-7,21:2e-7,22:1e-7},CN=(0,xN.exports)(["南","东南偏南","东南","东南偏东","东","东北偏东","东北","东北偏北","北","西北偏北","西北","西北偏西","西","西南偏西","西南","西南偏南"],(function(t,e){var r=22.5,n=r*e;return{bearing:n,range:[n-11.25,n+11.25],label:t}})),bN=function(t,e,r){return t>=e&&t<r},SN=function(t){return EN(CN,(function(e){return bN(t,e.range[0],e.range[1])||bN(t-360,e.range[0],e.range[1])}))},BN=function(){function e(t,r,n){var i=this;Qe(this,e),console.log(n.options.devicePixelRatio),this.map=n,this._zIndex=r.zIndex;var o=2===n.options.devicePixelRatio?4:1;r.mulnum&&(o=r.mulnum),this.windLayer=this.map.getLayer("windLayer"),this.windLayer?this.windLayer.setData(t):(this.windLayer=new _N("windLayer",t,{windOptions:{colorScale:["rgb(36,104, 180)","rgb(60,157, 194)","rgb(128,205,193 )","rgb(151,218,168 )","rgb(198,231,181)","rgb(238,247,217)","rgb(255,238,159)","rgb(252,217,125)","rgb(255,182,100)","rgb(252,150,75)","rgb(250,112,52)","rgb(245,64,32)","rgb(237,45,28)","rgb(220,24,32)","rgb(180,0,35)"],lineWidth:2,velocityScale:function(){var t=i.map.getZoom();return wN[parseInt(t)]||1/40},frameRate:16,maxAge:60,globalAlpha:.9,paths:3782*o}}),this.map.addLayer(this.windLayer)),r.zIndex&&this.windLayer.setZIndex(r.zIndex),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}return Fe(e,[{key:"getZIndex",value:function(){this.windLayer&&this.windLayer.getZIndex()}},{key:"setZIndex",value:function(t){this.windLayer&&this.windLayer.setZIndex(t)}},{key:"_bindMapEvents",value:function(){this.map.on("mousemove",this._onWind,this)}},{key:"_closeEvent",value:function(){this.map.off("mousemove",this._onWind,this)}},{key:"_onWind",value:function(t){var e,r=this.windLayer.field.interpolatedValueAt(t.coordinate.x,t.coordinate.y);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");this.toolTip._content="".concat(null===(e=SN(n))||void 0===e?void 0:e.label).concat(this.windLevel(i),"级;速度").concat(i.toFixed(2),"m/s;高度10米")}}},{key:"getWindValue",value:function(t,e){var r=this.windLayer.field.interpolatedValueAt(t,e);if(r){var n=this.vectorToDegrees(r.u,r.v,"bearingCCW"),i=this.vectorToSpeed(r.u,r.v,"m/s");return{direction:SN(n),speed:this.windLevel(i)}}}},{key:"windLevel",value:function(t){return t>=0&&t<.3?0:t>=.3&&t<1.6?1:t>=1.6&&t<3.4?2:t>=3.4&&t<5.5?3:t>=5.5&&t<8?4:t>=8&&t<10.8?5:t>=10.8&&t<13.9?6:t>=13.9&&t<17.2?7:t>=17.2&&t<20.8?8:t>=20.8&&t<24.5?9:t>=24.5&&t<28.5?10:t>=28.5&&t<32.7?11:12}},{key:"hide",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.hide(),this.removeToolTip(),this._closeEvent()}},{key:"show",value:function(){var t;null===(t=this.windLayer)||void 0===t||t.show(),this.setToolTip("hello",{showTimeout:0,eventsPropagation:!0,dx:10}),this._bindMapEvents()}},{key:"setToolTip",value:function(e,r){this.removeToolTip(),this.toolTip=new t.ui.ToolTip(e,r),this.toolTip.addTo(this.map)}},{key:"removeToolTip",value:function(){var t;this.toolTip&&(null===(t=this.toolTip)||void 0===t||t.remove(),this.toolTip=null)}},{key:"vectorToDegrees",value:function(t,e,r){r.endsWith("CCW")&&(e=e>0?e=-e:Math.abs(e));var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i=180*Math.atan2(t/n,e/n)/Math.PI+180;return"bearingCW"!==r&&"meteoCCW"!==r||(i+=180)>=360&&(i-=360),i}},{key:"vectorToSpeed",value:function(t,e,r){var n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return"k/h"===r?3.6*n:"kt"===r?n/.514:n}},{key:"closeWind",value:function(){this._closeEvent(),this.removeToolTip(),this.map.removeLayer(this.windLayer),delete this.windLayer,this.windLayer=null}}]),e}();export{uT as Arrow3D,pR as CoordinateTransform,XM as LineGeometry,bM as LineMaterial,gx as TextureAnimator,nR as bloomClass,vT as bloomLine,XE as calIntersection,$E as calPointColor,fR as drawTool,kE as getCenterOfPoints,HE as getCirGeojson,VE as getPsByCircle,YE as getVPointGeojson,_x as gisCommon,vB as gltfLoadClass,rx as imgClass,hR as layerClass,cR as layerClassNoOverride,sT as line2Object,ZE as line2Polygon,zE as lineLength,iR as outlineBloomClass,gR as overLayer,eT as planeGifClass,Qx as planeMark,dx as planeSectorClass,gT as polygonClass,SM as polylineClass,ox as radarClass,EM as rippleWallClass,cx as sectorClass,vx as shockClass,IR as shockMarkerClass,PE as sleep,dB as tileClass,lT as tripHeight,hT as tripHeight1,cT as tripLineClass,iT as tubeClass,BE as turf,ZM as verticalFatLineClass,BN as windClass};
|