| 12345678 |
- /*!
- *
- * iclient-leaflet
- * Copyright© 2000 - 2023 SuperMap Software Co.Ltd
- * license: Apache-2.0
- * version: v11.1.0
- *
- */(()=>{var e={550:e=>{"use strict";function t(e,t){this.x=e,this.y=t}e.exports=t,t.prototype={clone:function(){return new t(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,s=i*this.x+t*this.y;return this.x=r,this.y=s,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),s=t.x+i*(this.x-t.x)-r*(this.y-t.y),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=s,this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e}},929:(e,t,i)=>{e.exports.VectorTile=i(779),i(24),i(701)},779:(e,t,i)=>{"use strict";var r=i(701);function s(e,t,i){if(3===e){var s=new r(i,i.readVarint()+i.pos);s.length&&(t[s.name]=s)}}e.exports=function(e,t){this.layers=e.readFields(s,{},t)}},24:(e,t,i)=>{"use strict";var r=i(550);function s(e,t,i,r,s){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=s,e.readFields(n,this,t)}function n(e,t,i){1==e?t.id=i.readVarint():2==e?function(e,t){var i=e.readVarint()+e.pos;for(;e.pos<i;){var r=t._keys[e.readVarint()],s=t._values[e.readVarint()];t.properties[r]=s}}(i,t):3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function a(e){for(var t,i,r=0,s=0,n=e.length,a=n-1;s<n;a=s++)t=e[s],r+=((i=e[a]).x-t.x)*(t.y+i.y);return r}e.exports=s,s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,s=1,n=0,a=0,o=0,l=[];e.pos<i;){if(n<=0){var h=e.readVarint();s=7&h,n=h>>3}if(n--,1===s||2===s)a+=e.readSVarint(),o+=e.readSVarint(),1===s&&(t&&l.push(t),t=[]),t.push(new r(a,o));else{if(7!==s)throw new Error("unknown command "+s);t&&t.push(t[0].clone())}}return t&&l.push(t),l},s.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,s=0,n=0,a=1/0,o=-1/0,l=1/0,h=-1/0;e.pos<t;){if(r<=0){var u=e.readVarint();i=7&u,r=u>>3}if(r--,1===i||2===i)s+=e.readSVarint(),n+=e.readSVarint(),s<a&&(a=s),s>o&&(o=s),n<l&&(l=n),n>h&&(h=n);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,o,h]},s.prototype.toGeoJSON=function(e,t,i){var r,n,o=this.extent*Math.pow(2,i),l=this.extent*e,h=this.extent*t,u=this.loadGeometry(),c=s.types[this.type];function d(e){for(var t=0;t<e.length;t++){var i=e[t],r=180-360*(i.y+h)/o;e[t]=[360*(i.x+l)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(r=0;r<u.length;r++)p[r]=u[r][0];d(u=p);break;case 2:for(r=0;r<u.length;r++)d(u[r]);break;case 3:for(u=function(e){var t=e.length;if(t<=1)return[e];for(var i,r,s=[],n=0;n<t;n++){var o=a(e[n]);0!==o&&(void 0===r&&(r=o<0),r===o<0?(i&&s.push(i),i=[e[n]]):i.push(e[n]))}i&&s.push(i);return s}(u),r=0;r<u.length;r++)for(n=0;n<u[r].length;n++)d(u[r][n])}1===u.length?u=u[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f}},701:(e,t,i)=>{"use strict";var r=i(24);function s(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(n,this,t),this.length=this._features.length}function n(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){var t=null,i=e.readVarint()+e.pos;for(;e.pos<i;){var r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(i))}e.exports=s,s.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}},693:function(e){!function(t){"use strict";if(t.__disableNativeFetch||!t.fetch){o.prototype.append=function(e,t){e=n(e),t=a(t);var i=this.map[e];i||(i=[],this.map[e]=i),i.push(t)},o.prototype.delete=function(e){delete this.map[n(e)]},o.prototype.get=function(e){var t=this.map[n(e)];return t?t[0]:null},o.prototype.getAll=function(e){return this.map[n(e)]||[]},o.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},o.prototype.set=function(e,t){this.map[n(e)]=[a(t)]},o.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(i){this.map[i].forEach(function(r){e.call(t,r,i,this)},this)},this)};var i={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},r=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},c.call(d.prototype),c.call(f.prototype),f.prototype.clone=function(){return new f(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},f.error=function(){var e=new f(null,{status:0,statusText:""});return e.type="error",e};var s=[301,302,303,307,308];f.redirect=function(e,t){if(-1===s.indexOf(t))throw new RangeError("Invalid status code");return new f(null,{status:t,headers:{location:e}})},t.Headers=o,t.Request=d,t.Response=f,t.fetch=function(e,t){return new Promise(function(r,s){var n;n=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t);var a=new XMLHttpRequest;var l=!1;function h(){if(4===a.readyState){var e=1223===a.status?204:a.status;if(e<100||e>599){if(l)return;return l=!0,void s(new TypeError("Network request failed"))}var t={status:e,statusText:a.statusText,headers:function(e){var t=new o;return e.getAllResponseHeaders().trim().split("\n").forEach(function(e){var i=e.trim().split(":"),r=i.shift().trim(),s=i.join(":").trim();t.append(r,s)}),t}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},i="response"in a?a.response:a.responseText;l||(l=!0,r(new f(i,t)))}}a.onreadystatechange=h,a.onload=h,a.onerror=function(){l||(l=!0,s(new TypeError("Network request failed")))},a.open(n.method,n.url,!0);try{"include"===n.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(e){console&&console.warn&&console.warn("set withCredentials error:"+e)}"responseType"in a&&i.blob&&(a.responseType="blob"),n.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send(void 0===n._bodyInit?null:n._bodyInit)})},t.fetch.polyfill=!0,e.exports&&(e.exports=t.fetch)}function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise(function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}})}function u(e){var t=new FileReader;return t.readAsArrayBuffer(e),h(t)}function c(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(i.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(i.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!i.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},i.blob?(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(u)},this.text=function(){var e,t,i,r,s,n,a,o=l(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,i=new FileReader,r=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",s=/charset\=[0-9a-zA-Z\-\_]*;?/,n=e.type.match(s)||r.match(s),a=[e],n&&a.push(n[0].replace(/^charset\=/,"").replace(/;$/,"")),i.readAsText.apply(i,a),h(i);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=l(this);return e||Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(e,t){var i,s,n=(t=t||{}).body;if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=(i=t.method||this.method||"GET",s=i.toUpperCase(),r.indexOf(s)>-1?s:i),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n,t)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var i=e.split("="),r=i.shift().replace(/\+/g," "),s=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(s))}}),t}function f(e,t){t||(t={}),this._initBody(e,t),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof o?t.headers:new o(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:this)},144:function(e,t){var i,r,s;r=[t,e],void 0===(s="function"==typeof(i=function(e,t){"use strict";var i={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function s(e){var t=document.getElementById(e);t&&document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=e,a=t.timeout||i.timeout,o=t.jsonpCallback||i.jsonpCallback,l=void 0;return new Promise(function(i,h){var u=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=o+"_"+u;window[u]=function(e){i({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),s(c),r(u)},n+=-1===n.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",""+n+o+"="+u),t.charset&&d.setAttribute("charset",t.charset),d.id=c,document.getElementsByTagName("head")[0].appendChild(d),l=setTimeout(function(){h(new Error("JSONP request to "+e+" timed out")),r(u),s(c),window[u]=function(){r(u)}},a),d.onerror=function(){h(new Error("JSONP request to "+e+" failed")),r(u),s(c),l&&clearTimeout(l)}})}})?i.apply(t,r):i)||(e.exports=s)},962:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;var r=i(505),s=i(147),n=function(){function e(e){var t;this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,t=e||1024,this.bb=r.ByteBuffer.allocate(t),this.space=t}return e.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null},e.prototype.forceDefaults=function(e){this.force_defaults=e},e.prototype.dataBuffer=function(){return this.bb},e.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},e.prototype.prep=function(t,i){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+i)&t-1;this.space<r+t+i;){var s=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(r)},e.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)},e.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)},e.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)},e.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)},e.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)},e.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)},e.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)},e.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)},e.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)},e.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)},e.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)},e.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)},e.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)},e.prototype.addFieldInt8=function(e,t,i){(this.force_defaults||t!=i)&&(this.addInt8(t),this.slot(e))},e.prototype.addFieldInt16=function(e,t,i){(this.force_defaults||t!=i)&&(this.addInt16(t),this.slot(e))},e.prototype.addFieldInt32=function(e,t,i){(this.force_defaults||t!=i)&&(this.addInt32(t),this.slot(e))},e.prototype.addFieldInt64=function(e,t,i){(this.force_defaults||t!==i)&&(this.addInt64(t),this.slot(e))},e.prototype.addFieldFloat32=function(e,t,i){(this.force_defaults||t!=i)&&(this.addFloat32(t),this.slot(e))},e.prototype.addFieldFloat64=function(e,t,i){(this.force_defaults||t!=i)&&(this.addFloat64(t),this.slot(e))},e.prototype.addFieldOffset=function(e,t,i){(this.force_defaults||t!=i)&&(this.addOffset(t),this.slot(e))},e.prototype.addFieldStruct=function(e,t,i){t!=i&&(this.nested(t),this.slot(e))},e.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},e.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},e.prototype.slot=function(e){null!==this.vtable&&(this.vtable[e]=this.offset())},e.prototype.offset=function(){return this.bb.capacity()-this.space},e.growByteBuffer=function(e){var t=e.capacity();if(3221225472&t)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=t<<1,s=r.ByteBuffer.allocate(i);return s.setPosition(i-t),s.bytes().set(e.bytes(),i-t),s},e.prototype.addOffset=function(e){this.prep(s.SIZEOF_INT,0),this.writeInt32(this.offset()-e+s.SIZEOF_INT)},e.prototype.startObject=function(e){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()},e.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&0==this.vtable[t];t--);for(var i=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var r=(i+2)*s.SIZEOF_SHORT;this.addInt16(r);var n=0,a=this.space;e:for(t=0;t<this.vtables.length;t++){var o=this.bb.capacity()-this.vtables[t];if(r==this.bb.readInt16(o)){for(var l=s.SIZEOF_SHORT;l<r;l+=s.SIZEOF_SHORT)if(this.bb.readInt16(a+l)!=this.bb.readInt16(o+l))continue e;n=this.vtables[t];break}}return n?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,n-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e},e.prototype.finish=function(e,t,i){var r=i?s.SIZE_PREFIX_LENGTH:0;if(t){var n=t;if(this.prep(this.minalign,s.SIZEOF_INT+s.FILE_IDENTIFIER_LENGTH+r),n.length!=s.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+s.FILE_IDENTIFIER_LENGTH);for(var a=s.FILE_IDENTIFIER_LENGTH-1;a>=0;a--)this.writeInt8(n.charCodeAt(a))}this.prep(this.minalign,s.SIZEOF_INT+r),this.addOffset(e),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},e.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},e.prototype.requiredField=function(e,t){var i=this.bb.capacity()-e,r=i-this.bb.readInt32(i);if(!(0!=this.bb.readInt16(r+t)))throw new Error("FlatBuffers: field "+t+" must be set")},e.prototype.startVector=function(e,t,i){this.notNested(),this.vector_num_elems=t,this.prep(s.SIZEOF_INT,e*t),this.prep(i,e*t)},e.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},e.prototype.createSharedString=function(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);var t=this.createString(e);return this.string_maps.set(e,t),t},e.prototype.createString=function(e){if(null===e||void 0===e)return 0;var t;if(e instanceof Uint8Array)t=e;else{t=[];for(var i=0;i<e.length;){var r=void 0,s=e.charCodeAt(i++);if(s<55296||s>=56320)r=s;else r=(s<<10)+e.charCodeAt(i++)+-56613888;r<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);i=0;for(var n=this.space,a=this.bb.bytes();i<t.length;i++)a[n++]=t[i];return this.endVector()},e.prototype.createObjectOffset=function(e){return null===e?0:"string"==typeof e?this.createString(e):e.pack(this)},e.prototype.createObjectOffsetList=function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];if(null===r)throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");t.push(this.createObjectOffset(r))}return t},e.prototype.createStructOffsetList=function(e,t){return t(this,e.length),this.createObjectOffsetList(e),this.endVector()},e}();t.Builder=n},505:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ByteBuffer=void 0;var r=i(147),s=i(766),n=i(650),a=function(){function e(e){this.bytes_=e,this.position_=0}return e.allocate=function(t){return new e(new Uint8Array(t))},e.prototype.clear=function(){this.position_=0},e.prototype.bytes=function(){return this.bytes_},e.prototype.position=function(){return this.position_},e.prototype.setPosition=function(e){this.position_=e},e.prototype.capacity=function(){return this.bytes_.length},e.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},e.prototype.readUint8=function(e){return this.bytes_[e]},e.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},e.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},e.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},e.prototype.readUint32=function(e){return this.readInt32(e)>>>0},e.prototype.readInt64=function(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))},e.prototype.readUint64=function(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))},e.prototype.readFloat32=function(e){return s.int32[0]=this.readInt32(e),s.float32[0]},e.prototype.readFloat64=function(e){return s.int32[s.isLittleEndian?0:1]=this.readInt32(e),s.int32[s.isLittleEndian?1:0]=this.readInt32(e+4),s.float64[0]},e.prototype.writeInt8=function(e,t){this.bytes_[e]=t},e.prototype.writeUint8=function(e,t){this.bytes_[e]=t},e.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},e.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},e.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},e.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},e.prototype.writeInt64=function(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))},e.prototype.writeUint64=function(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))},e.prototype.writeFloat32=function(e,t){s.float32[0]=t,this.writeInt32(e,s.int32[0])},e.prototype.writeFloat64=function(e,t){s.float64[0]=t,this.writeInt32(e,s.int32[s.isLittleEndian?0:1]),this.writeInt32(e+4,s.int32[s.isLittleEndian?1:0])},e.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+t));return e},e.prototype.__offset=function(e,t){var i=e-this.readInt32(e);return t<this.readInt16(i)?this.readInt16(i+t):0},e.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e},e.prototype.__string=function(e,t){e+=this.readInt32(e);var i=this.readInt32(e),s="",a=0;if(e+=r.SIZEOF_INT,t===n.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+i);for(;a<i;){var o=void 0,l=this.readUint8(e+a++);if(l<192)o=l;else{var h=this.readUint8(e+a++);if(l<224)o=(31&l)<<6|63&h;else{var u=this.readUint8(e+a++);if(l<240)o=(15&l)<<12|(63&h)<<6|63&u;else o=(7&l)<<18|(63&h)<<12|(63&u)<<6|63&this.readUint8(e+a++)}}o<65536?s+=String.fromCharCode(o):(o-=65536,s+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return s},e.prototype.__union_with_string=function(e,t){return"string"==typeof e?this.__string(t):this.__union(e,t)},e.prototype.__indirect=function(e){return e+this.readInt32(e)},e.prototype.__vector=function(e){return e+this.readInt32(e)+r.SIZEOF_INT},e.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},e.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+r.SIZEOF_INT+t))return!1;return!0},e.prototype.createScalarList=function(e,t){for(var i=[],r=0;r<t;++r)null!==e(r)&&i.push(e(r));return i},e.prototype.createObjList=function(e,t){for(var i=[],r=0;r<t;++r){var s=e(r);null!==s&&i.push(s.unpack())}return i},e}();t.ByteBuffer=a},147:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SIZE_PREFIX_LENGTH=t.FILE_IDENTIFIER_LENGTH=t.SIZEOF_INT=t.SIZEOF_SHORT=void 0,t.SIZEOF_SHORT=2,t.SIZEOF_INT=4,t.FILE_IDENTIFIER_LENGTH=4,t.SIZE_PREFIX_LENGTH=4},650:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoding=void 0,function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"}(t.Encoding||(t.Encoding={}))},903:(e,t,i)=>{"use strict";t.cZ=t.XU=void 0;var r=i(147);var s=i(147);var n=i(147);var a=i(147);Object.defineProperty(t,"XU",{enumerable:!0,get:function(){return a.SIZE_PREFIX_LENGTH}});var o=i(766);var l=i(650);var h=i(962);var u=i(505);Object.defineProperty(t,"cZ",{enumerable:!0,get:function(){return u.ByteBuffer}})},766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=t.float64=t.float32=t.int32=void 0,t.int32=new Int32Array(2),t.float32=new Float32Array(t.int32.buffer),t.float64=new Float64Array(t.int32.buffer),t.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0]},645:(e,t)=>{t.read=function(e,t,i,r,s){var n,a,o=8*s-r-1,l=(1<<o)-1,h=l>>1,u=-7,c=i?s-1:0,d=i?-1:1,p=e[t+c];for(c+=d,n=p&(1<<-u)-1,p>>=-u,u+=o;u>0;n=256*n+e[t+c],c+=d,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=r;u>0;a=256*a+e[t+c],c+=d,u-=8);if(0===n)n=1-h;else{if(n===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),n-=h}return(p?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,s,n){var a,o,l,h=8*n-s-1,u=(1<<h)-1,c=u>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:n-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+c>=1?d/l:d*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=u?(o=0,a=u):a+c>=1?(o=(t*l-1)*Math.pow(2,s),a+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,s),a=0));s>=8;e[i+p]=255&o,p+=f,o/=256,s-=8);for(a=a<<s|o,h+=s;h>0;e[i+p]=255&a,p+=f,a/=256,h-=8);e[i+p-f]|=128*m}},186:e=>{var t=[],i=[],r="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function s(e,s){if(s=s||{},void 0===e)throw new Error(r);var n,a=!0===s.prepend?"prepend":"append",o=void 0!==s.container?s.container:document.querySelector("head"),l=t.indexOf(o);return-1===l&&(l=t.push(o)-1,i[l]={}),void 0!==i[l]&&void 0!==i[l][a]?n=i[l][a]:(n=i[l][a]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===a?o.insertBefore(n,o.childNodes[0]):o.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}e.exports=s,e.exports.insertCss=s},545:(e,t,i)=>{var r=i(820),s="&&",n="||",a="and",o="or",l="=",h="~",u="!"+l,c="!"+h,d=">",p=">=",f="<",m="<=",y="*",g=",",v=".",b="(",_=")",S="where",x={pathway:[],groups:{}},w={},C={},M=console.log;function A(e){var t=E(e,S),i=t[0],r=t[1];x.pathway=E(i,g);for(var a=0,o=x.pathway.length;a<o;a++)x.pathway[a]=E(x.pathway[a],v),x.pathway[a][0]==y&&x.pathway[a].shift(),0===x.pathway[a].length&&x.pathway.splice(a,1);for(var C=-1,M=-1,A=0;A<r.length;){if(r[A]===b)C=A;else if(r[A]===_&&(M=A)>C&&-1!==C){var O="gr_"+(new Date).getTime();x.groups[O]=r.substring(C+1,M),r=r.replace(b+x.groups[O]+_,O),A=-1}A+=1}!function e(t,i){var r=T(i,s),a=T(i,n);if(r!==Number.MAX_VALUE||a!==Number.MAX_VALUE)if(r<a){t.and=t.and||[];var o=E(i,s);t.and.push(o[0]),e(t.and,o[1])}else{t.or=t.or||[];var o=E(i,n);t.or.push(o[0]),e(t.or,o[1])}else x.groups[i]?(i=x.groups[i],e(t,i)):(Array.isArray(t)?t.push(i):t.or=[i],function e(t){for(var i in t)if(t.hasOwnProperty(i))if(Array.isArray(t[i]))e(t[i]);else if("string"==typeof t[i])if(L(t[i],u)){var r=E(t[i],u);t[i]={ne:[r[0],r[1]]}}else if(L(t[i],c)){var r=E(t[i],c);t[i]={nreq:[r[0],r[1]]}}else if(L(t[i],h)){var r=E(t[i],h);t[i]={req:[r[0],r[1]]}}else if(L(t[i],p)){var r=E(t[i],p);t[i]={ge:[r[0],r[1]]}}else if(L(t[i],d)){var r=E(t[i],d);t[i]={gt:[r[0],r[1]]}}else if(L(t[i],m)){var r=E(t[i],m);t[i]={le:[r[0],r[1]]}}else if(L(t[i],f)){var r=E(t[i],f);t[i]={lt:[r[0],r[1]]}}else if(L(t[i],l)){var r=E(t[i],l);t[i]={eq:[r[0],r[1]]}}}(w.or?w.or:w.and))}(w,r)}function T(e,t){var i=e.indexOf(t);return-1===i?Number.MAX_VALUE:i}function E(e,t){return e.split(t).map(function(e){return e.trim()})}function L(e,t){return e.indexOf(t)>-1}function O(e,t){var i=E(t,v),s=e;for(var n in i){if(!s.hasOwnProperty(i[n]))return"";s=s[i[n]]}return s=r.isDate(s)?s.valueOf():r.isDateString(s)?r.parseDateFromString(s):s.toString()}function P(e,t){var i=!1;for(var r in e){if(i=i||(r===a?N:r===o?P:I)(e[r],t),C.trace&&M(x.step,"======((( or",e[r],i),i)return i}return i}function N(e,t){var i=!0;for(var r in e){if(i=i&&(r===a?N:r===o?P:I)(e[r],t),C.trace&&M(x.step,"======((( and",e[r],i),!i)return i}return i}function I(e,t){if(x.step+=1,e.or){var i=P(e.or,t);return C.trace&&M(x.step,"OR",e,i),i}if(e.and){i=N(e.and,t);return C.trace&&M(x.step,"AND",e,i),i}if("object"==typeof e)return e.eq?O(t,e.eq[0])===e.eq[1]:e.ne?O(t,e.ne[0])!==e.ne[1]:e.req?L(O(t,e.req[0]),e.req[1]):e.nreq?!L(O(t,e.nreq[0]),e.nreq[1]):e.gt?O(t,e.gt[0])>e.gt[1]:e.ge?O(t,e.ge[0])>=e.ge[1]:e.lt?O(t,e.lt[0])<e.lt[1]:e.le?O(t,e.le[0])<=e.le[1]:I(e,t)}function F(e,t,i){return x={pathway:[],groups:{},step:0},w={},C=i=i||{trace:!1},A(t),(r=function(e){var t=[];for(var i in e)I(w,e[i])&&t.push(e[i]);return t}(e))&&x.pathway.length>0?r.map(function(e){for(var t={},i=0,r=x.pathway.length;i<r;i++){var s=x.pathway[i].join(v);t[s]=O(e,s)}return t}):r;var r}void 0!==e.exports&&(e.exports=F),"undefined"!=typeof window&&(window.Query=F)},820:e=>{function t(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===t(e)}e.exports={getObjectType:t,isDate:function(e){return"[object Date]"===t(e)},isString:i,isDateString:function(e){return i(e)&&!isNaN(Date.parse(e))},parseDateFromString:function(e){return Date.parse(e)},isNumber:function(e){return"number"==typeof e}}},465:(e,t,i)=>{e=i.nmd(e);var r=200,s="__lodash_hash_undefined__",n=9007199254740991,a="[object Arguments]",o="[object Boolean]",l="[object Date]",h="[object Function]",u="[object GeneratorFunction]",c="[object Map]",d="[object Number]",p="[object Object]",f="[object RegExp]",m="[object Set]",y="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",x="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",M="[object Uint8Array]",A="[object Uint8ClampedArray]",T="[object Uint16Array]",E="[object Uint32Array]",L=/\w*$/,O=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,N={};N[a]=N["[object Array]"]=N[v]=N[b]=N[o]=N[l]=N[_]=N[S]=N[x]=N[w]=N[C]=N[c]=N[d]=N[p]=N[f]=N[m]=N[y]=N[g]=N[M]=N[A]=N[T]=N[E]=!0,N["[object Error]"]=N[h]=N["[object WeakMap]"]=!1;var I="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,F="object"==typeof self&&self&&self.Object===Object&&self,k=I||F||Function("return this")(),D=t&&!t.nodeType&&t,R=D&&e&&!e.nodeType&&e,B=R&&R.exports===D;function G(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function j(e,t,i,r){var s=-1,n=e?e.length:0;for(r&&n&&(i=e[++s]);++s<n;)i=t(i,e[s],s,e);return i}function z(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function J(e,t){return function(i){return e(t(i))}}function q(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var H=Array.prototype,W=Function.prototype,Y=Object.prototype,X=k["__core-js_shared__"],Q=function(){var e=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Z=W.toString,K=Y.hasOwnProperty,$=Y.toString,ee=RegExp("^"+Z.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=B?k.Buffer:void 0,ie=k.Symbol,re=k.Uint8Array,se=J(Object.getPrototypeOf,Object),ne=Object.create,ae=Y.propertyIsEnumerable,oe=H.splice,le=Object.getOwnPropertySymbols,he=te?te.isBuffer:void 0,ue=J(Object.keys,Object),ce=De(k,"DataView"),de=De(k,"Map"),pe=De(k,"Promise"),fe=De(k,"Set"),me=De(k,"WeakMap"),ye=De(Object,"create"),ge=je(ce),ve=je(de),be=je(pe),_e=je(fe),Se=je(me),xe=ie?ie.prototype:void 0,we=xe?xe.valueOf:void 0;function Ce(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Me(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Te(e){this.__data__=new Me(e)}function Ee(e,t){var i=Ve(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Je(e)}(e)&&K.call(e,"callee")&&(!ae.call(e,"callee")||$.call(e)==a)}(e)?function(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}(e.length,String):[],r=i.length,s=!!r;for(var n in e)!t&&!K.call(e,n)||s&&("length"==n||Ge(n,r))||i.push(n);return i}function Le(e,t,i){var r=e[t];K.call(e,t)&&ze(r,i)&&(void 0!==i||t in e)||(e[t]=i)}function Oe(e,t){for(var i=e.length;i--;)if(ze(e[i][0],t))return i;return-1}function Pe(e,t,i,r,s,n,O){var P;if(r&&(P=n?r(e,s,n,O):r(e)),void 0!==P)return P;if(!We(e))return e;var I=Ve(e);if(I){if(P=function(e){var t=e.length,i=e.constructor(t);t&&"string"==typeof e[0]&&K.call(e,"index")&&(i.index=e.index,i.input=e.input);return i}(e),!t)return function(e,t){var i=-1,r=e.length;t||(t=Array(r));for(;++i<r;)t[i]=e[i];return t}(e,P)}else{var F=Be(e),k=F==h||F==u;if(qe(e))return function(e,t){if(t)return e.slice();var i=new e.constructor(e.length);return e.copy(i),i}(e,t);if(F==p||F==a||k&&!n){if(z(e))return n?e:{};if(P=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=se(e),We(t)?ne(t):{});var t}(k?{}:e),!t)return function(e,t){return Fe(e,Re(e),t)}(e,function(e,t){return e&&Fe(t,Ye(t),e)}(P,e))}else{if(!N[F])return n?e:{};P=function(e,t,i,r){var s=e.constructor;switch(t){case v:return Ie(e);case o:case l:return new s(+e);case b:return function(e,t){var i=t?Ie(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,r);case _:case S:case x:case w:case C:case M:case A:case T:case E:return function(e,t){var i=t?Ie(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(e,r);case c:return function(e,t,i){return j(t?i(V(e),!0):V(e),G,new e.constructor)}(e,r,i);case d:case y:return new s(e);case f:return(h=new(a=e).constructor(a.source,L.exec(a))).lastIndex=a.lastIndex,h;case m:return function(e,t,i){return j(t?i(q(e),!0):q(e),U,new e.constructor)}(e,r,i);case g:return n=e,we?Object(we.call(n)):{}}var n;var a,h}(e,F,Pe,t)}}O||(O=new Te);var D=O.get(e);if(D)return D;if(O.set(e,P),!I)var R=i?function(e){return function(e,t,i){var r=t(e);return Ve(e)?r:function(e,t){for(var i=-1,r=t.length,s=e.length;++i<r;)e[s+i]=t[i];return e}(r,i(e))}(e,Ye,Re)}(e):Ye(e);return function(e,t){for(var i=-1,r=e?e.length:0;++i<r&&!1!==t(e[i],i,e););}(R||e,function(s,n){R&&(s=e[n=s]),Le(P,n,Pe(s,t,i,r,n,e,O))}),P}function Ne(e){return!(!We(e)||Q&&Q in e)&&(He(e)||z(e)?ee:O).test(je(e))}function Ie(e){var t=new e.constructor(e.byteLength);return new re(t).set(new re(e)),t}function Fe(e,t,i,r){i||(i={});for(var s=-1,n=t.length;++s<n;){var a=t[s],o=r?r(i[a],e[a],a,i,e):void 0;Le(i,a,void 0===o?e[a]:o)}return i}function ke(e,t){var i,r,s=e.__data__;return("string"==(r=typeof(i=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function De(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return Ne(i)?i:void 0}Ce.prototype.clear=function(){this.__data__=ye?ye(null):{}},Ce.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ce.prototype.get=function(e){var t=this.__data__;if(ye){var i=t[e];return i===s?void 0:i}return K.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:K.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?s:t,this},Me.prototype.clear=function(){this.__data__=[]},Me.prototype.delete=function(e){var t=this.__data__,i=Oe(t,e);return!(i<0||(i==t.length-1?t.pop():oe.call(t,i,1),0))},Me.prototype.get=function(e){var t=this.__data__,i=Oe(t,e);return i<0?void 0:t[i][1]},Me.prototype.has=function(e){return Oe(this.__data__,e)>-1},Me.prototype.set=function(e,t){var i=this.__data__,r=Oe(i,e);return r<0?i.push([e,t]):i[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ce,map:new(de||Me),string:new Ce}},Ae.prototype.delete=function(e){return ke(this,e).delete(e)},Ae.prototype.get=function(e){return ke(this,e).get(e)},Ae.prototype.has=function(e){return ke(this,e).has(e)},Ae.prototype.set=function(e,t){return ke(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Me},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Me){var s=i.__data__;if(!de||s.length<r-1)return s.push([e,t]),this;i=this.__data__=new Ae(s)}return i.set(e,t),this};var Re=le?J(le,Object):function(){return[]},Be=function(e){return $.call(e)};function Ge(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||P.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function je(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ze(e,t){return e===t||e!=e&&t!=t}(ce&&Be(new ce(new ArrayBuffer(1)))!=b||de&&Be(new de)!=c||pe&&"[object Promise]"!=Be(pe.resolve())||fe&&Be(new fe)!=m||me&&"[object WeakMap]"!=Be(new me))&&(Be=function(e){var t=$.call(e),i=t==p?e.constructor:void 0,r=i?je(i):void 0;if(r)switch(r){case ge:return b;case ve:return c;case be:return"[object Promise]";case _e:return m;case Se:return"[object WeakMap]"}return t});var Ve=Array.isArray;function Je(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!He(e)}var qe=he||function(){return!1};function He(e){var t=We(e)?$.call(e):"";return t==h||t==u}function We(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return Je(e)?Ee(e):function(e){if(!Ue(e))return ue(e);var t=[];for(var i in Object(e))K.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}e.exports=function(e){return Pe(e,!0,!0)}},52:(e,t,i)=>{var r=9007199254740991,s="[object Arguments]",n="[object Function]",a="[object GeneratorFunction]",o="[object Map]",l="[object Set]",h=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function f(e,t){return function(e,t){for(var i=-1,r=e?e.length:0,s=Array(r);++i<r;)s[i]=t(e[i],i,e);return s}(t,function(t){return[t,e[t]]})}var m=Function.prototype,y=Object.prototype,g=p["__core-js_shared__"],v=function(){var e=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),b=m.toString,_=y.hasOwnProperty,S=y.toString,x=RegExp("^"+b.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=y.propertyIsEnumerable,C=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),M=B(p,"DataView"),A=B(p,"Map"),T=B(p,"Promise"),E=B(p,"Set"),L=B(p,"WeakMap"),O=j(M),P=j(A),N=j(T),I=j(E),F=j(L);function k(e,t){var i=z(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&V(e)}(e)&&_.call(e,"callee")&&(!w.call(e,"callee")||S.call(e)==s)}(e)?function(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}(e.length,String):[],r=i.length,n=!!r;for(var a in e)!t&&!_.call(e,a)||n&&("length"==a||U(a,r))||i.push(a);return i}function D(e){return!(!q(e)||v&&v in e)&&(J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?x:h).test(j(e))}function R(e){if(i=(t=e)&&t.constructor,r="function"==typeof i&&i.prototype||y,t!==r)return C(e);var t,i,r,s=[];for(var n in Object(e))_.call(e,n)&&"constructor"!=n&&s.push(n);return s}function B(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return D(i)?i:void 0}var G=function(e){return S.call(e)};function U(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function j(e){if(null!=e){try{return b.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(M&&"[object DataView]"!=G(new M(new ArrayBuffer(1)))||A&&G(new A)!=o||T&&"[object Promise]"!=G(T.resolve())||E&&G(new E)!=l||L&&"[object WeakMap]"!=G(new L))&&(G=function(e){var t=S.call(e),i="[object Object]"==t?e.constructor:void 0,r=i?j(i):void 0;if(r)switch(r){case O:return"[object DataView]";case P:return o;case N:return"[object Promise]";case I:return l;case F:return"[object WeakMap]"}return t});var z=Array.isArray;function V(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!J(e)}function J(e){var t=q(e)?S.call(e):"";return t==n||t==a}function q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var H=function(e){return function(t){var i,r,s,n=G(t);return n==o?(i=t,r=-1,s=Array(i.size),i.forEach(function(e,t){s[++r]=[t,e]}),s):n==l?function(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=[e,e]}),i}(t):f(t,e(t))}}(function(e){return V(e)?k(e):R(e)});e.exports=H},618:(e,t,i)=>{e=i.nmd(e);var r=200,s="Expected a function",n="__lodash_hash_undefined__",a=1,o=2,l=1/0,h=9007199254740991,u="[object Arguments]",c="[object Array]",d="[object Boolean]",p="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",g="[object Map]",v="[object Number]",b="[object Object]",_="[object RegExp]",S="[object Set]",x="[object String]",w="[object Symbol]",C="[object ArrayBuffer]",M="[object DataView]",A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,E=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,P=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[u]=I[c]=I[C]=I[d]=I[M]=I[p]=I[f]=I[m]=I[g]=I[v]=I[b]=I[_]=I[S]=I[x]=I["[object WeakMap]"]=!1;var F="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,k="object"==typeof self&&self&&self.Object===Object&&self,D=F||k||Function("return this")(),R=t&&!t.nodeType&&t,B=R&&e&&!e.nodeType&&e,G=B&&B.exports===R&&F.process,U=function(){try{return G&&G.binding("util")}catch(e){}}(),j=U&&U.isTypedArray;function z(e,t){return!!(e?e.length:0)&&function(e,t,i){if(t!=t)return function(e,t,i,r){var s=e.length,n=i+(r?1:-1);for(;r?n--:++n<s;)if(t(e[n],n,e))return n;return-1}(e,q,i);var r=i-1,s=e.length;for(;++r<s;)if(e[r]===t)return r;return-1}(e,t,0)>-1}function V(e,t,i){for(var r=-1,s=e?e.length:0;++r<s;)if(i(t,e[r]))return!0;return!1}function J(e,t){for(var i=-1,r=e?e.length:0;++i<r;)if(t(e[i],i,e))return!0;return!1}function q(e){return e!=e}function H(e,t){return e.has(t)}function W(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function Y(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function X(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var Q=Array.prototype,Z=Function.prototype,K=Object.prototype,$=D["__core-js_shared__"],ee=function(){var e=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),te=Z.toString,ie=K.hasOwnProperty,re=K.toString,se=RegExp("^"+te.call(ie).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=D.Symbol,ae=D.Uint8Array,oe=K.propertyIsEnumerable,le=Q.splice,he=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),ue=je(D,"DataView"),ce=je(D,"Map"),de=je(D,"Promise"),pe=je(D,"Set"),fe=je(D,"WeakMap"),me=je(Object,"create"),ye=Xe(ue),ge=Xe(ce),ve=Xe(de),be=Xe(pe),_e=Xe(fe),Se=ne?ne.prototype:void 0,xe=Se?Se.valueOf:void 0,we=Se?Se.toString:void 0;function Ce(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Me(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}function Te(e){var t=-1,i=e?e.length:0;for(this.__data__=new Ae;++t<i;)this.add(e[t])}function Ee(e){this.__data__=new Me(e)}function Le(e,t){var i=$e(e)||Ke(e)?function(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}(e.length,String):[],r=i.length,s=!!r;for(var n in e)!t&&!ie.call(e,n)||s&&("length"==n||Ve(n,r))||i.push(n);return i}function Oe(e,t){for(var i=e.length;i--;)if(Ze(e[i][0],t))return i;return-1}function Pe(e,t){for(var i=0,r=(t=Je(t,e)?[t]:Re(t)).length;null!=e&&i<r;)e=e[Ye(t[i++])];return i&&i==r?e:void 0}function Ne(e,t){return null!=e&&t in Object(e)}function Ie(e,t,i,r,s){return e===t||(null==e||null==t||!rt(e)&&!st(t)?e!=e&&t!=t:function(e,t,i,r,s,n){var l=$e(e),h=$e(t),m=c,y=c;l||(m=(m=ze(e))==u?b:m);h||(y=(y=ze(t))==u?b:y);var A=m==b&&!W(e),T=y==b&&!W(t),E=m==y;if(E&&!A)return n||(n=new Ee),l||at(e)?Ge(e,t,i,r,s,n):function(e,t,i,r,s,n,l){switch(i){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C:return!(e.byteLength!=t.byteLength||!r(new ae(e),new ae(t)));case d:case p:case v:return Ze(+e,+t);case f:return e.name==t.name&&e.message==t.message;case _:case x:return e==t+"";case g:var h=Y;case S:var u=n&o;if(h||(h=X),e.size!=t.size&&!u)return!1;var c=l.get(e);if(c)return c==t;n|=a,l.set(e,t);var m=Ge(h(e),h(t),r,s,n,l);return l.delete(e),m;case w:if(xe)return xe.call(e)==xe.call(t)}return!1}(e,t,m,i,r,s,n);if(!(s&o)){var L=A&&ie.call(e,"__wrapped__"),O=T&&ie.call(t,"__wrapped__");if(L||O){var P=L?e.value():e,N=O?t.value():t;return n||(n=new Ee),i(P,N,r,s,n)}}if(!E)return!1;return n||(n=new Ee),function(e,t,i,r,s,n){var a=s&o,l=ot(e),h=l.length,u=ot(t).length;if(h!=u&&!a)return!1;for(var c=h;c--;){var d=l[c];if(!(a?d in t:ie.call(t,d)))return!1}var p=n.get(e);if(p&&n.get(t))return p==t;var f=!0;n.set(e,t),n.set(t,e);for(var m=a;++c<h;){d=l[c];var y=e[d],g=t[d];if(r)var v=a?r(g,y,d,t,e,n):r(y,g,d,e,t,n);if(!(void 0===v?y===g||i(y,g,r,s,n):v)){f=!1;break}m||(m="constructor"==d)}if(f&&!m){var b=e.constructor,_=t.constructor;b!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(f=!1)}return n.delete(e),n.delete(t),f}(e,t,i,r,s,n)}(e,t,Ie,i,r,s))}function Fe(e){return!(!rt(e)||ee&&ee in e)&&(tt(e)||W(e)?se:P).test(Xe(e))}function ke(e){return"function"==typeof e?e:null==e?lt:"object"==typeof e?$e(e)?function(e,t){if(Je(e)&&qe(t))return He(Ye(e),t);return function(i){var r=function(e,t,i){var r=null==e?void 0:Pe(e,t);return void 0===r?i:r}(i,e);return void 0===r&&r===t?function(e,t){return null!=e&&function(e,t,i){var r,s=-1,n=(t=Je(t,e)?[t]:Re(t)).length;for(;++s<n;){var a=Ye(t[s]);if(!(r=null!=e&&i(e,a)))break;e=e[a]}if(r)return r;return!!(n=e?e.length:0)&&it(n)&&Ve(a,n)&&($e(e)||Ke(e))}(e,t,Ne)}(i,e):Ie(t,r,void 0,a|o)}}(e[0],e[1]):function(e){var t=function(e){var t=ot(e),i=t.length;for(;i--;){var r=t[i],s=e[r];t[i]=[r,s,qe(s)]}return t}(e);if(1==t.length&&t[0][2])return He(t[0][0],t[0][1]);return function(i){return i===e||function(e,t,i,r){var s=i.length,n=s,l=!r;if(null==e)return!n;for(e=Object(e);s--;){var h=i[s];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++s<n;){var u=(h=i[s])[0],c=e[u],d=h[1];if(l&&h[2]){if(void 0===c&&!(u in e))return!1}else{var p=new Ee;if(r)var f=r(c,d,u,e,t,p);if(!(void 0===f?Ie(d,c,r,a|o,p):f))return!1}}return!0}(i,e,t)}}(e):Je(t=e)?(i=Ye(t),function(e){return null==e?void 0:e[i]}):function(e){return function(t){return Pe(t,e)}}(t);var t,i}function De(e){if(i=(t=e)&&t.constructor,r="function"==typeof i&&i.prototype||K,t!==r)return he(e);var t,i,r,s=[];for(var n in Object(e))ie.call(e,n)&&"constructor"!=n&&s.push(n);return s}function Re(e){return $e(e)?e:We(e)}Ce.prototype.clear=function(){this.__data__=me?me(null):{}},Ce.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ce.prototype.get=function(e){var t=this.__data__;if(me){var i=t[e];return i===n?void 0:i}return ie.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ie.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},Me.prototype.clear=function(){this.__data__=[]},Me.prototype.delete=function(e){var t=this.__data__,i=Oe(t,e);return!(i<0||(i==t.length-1?t.pop():le.call(t,i,1),0))},Me.prototype.get=function(e){var t=this.__data__,i=Oe(t,e);return i<0?void 0:t[i][1]},Me.prototype.has=function(e){return Oe(this.__data__,e)>-1},Me.prototype.set=function(e,t){var i=this.__data__,r=Oe(i,e);return r<0?i.push([e,t]):i[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ce,map:new(ce||Me),string:new Ce}},Ae.prototype.delete=function(e){return Ue(this,e).delete(e)},Ae.prototype.get=function(e){return Ue(this,e).get(e)},Ae.prototype.has=function(e){return Ue(this,e).has(e)},Ae.prototype.set=function(e,t){return Ue(this,e).set(e,t),this},Te.prototype.add=Te.prototype.push=function(e){return this.__data__.set(e,n),this},Te.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.clear=function(){this.__data__=new Me},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Me){var s=i.__data__;if(!ce||s.length<r-1)return s.push([e,t]),this;i=this.__data__=new Ae(s)}return i.set(e,t),this};var Be=pe&&1/X(new pe([,-0]))[1]==l?function(e){return new pe(e)}:function(){};function Ge(e,t,i,r,s,n){var l=s&o,h=e.length,u=t.length;if(h!=u&&!(l&&u>h))return!1;var c=n.get(e);if(c&&n.get(t))return c==t;var d=-1,p=!0,f=s&a?new Te:void 0;for(n.set(e,t),n.set(t,e);++d<h;){var m=e[d],y=t[d];if(r)var g=l?r(y,m,d,t,e,n):r(m,y,d,e,t,n);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!J(t,function(e,t){if(!f.has(t)&&(m===e||i(m,e,r,s,n)))return f.add(t)})){p=!1;break}}else if(m!==y&&!i(m,y,r,s,n)){p=!1;break}}return n.delete(e),n.delete(t),p}function Ue(e,t){var i,r,s=e.__data__;return("string"==(r=typeof(i=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function je(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return Fe(i)?i:void 0}var ze=function(e){return re.call(e)};function Ve(e,t){return!!(t=null==t?h:t)&&("number"==typeof e||N.test(e))&&e>-1&&e%1==0&&e<t}function Je(e,t){if($e(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!nt(e))||(T.test(e)||!A.test(e)||null!=t&&e in Object(t))}function qe(e){return e==e&&!rt(e)}function He(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}(ue&&ze(new ue(new ArrayBuffer(1)))!=M||ce&&ze(new ce)!=g||de&&"[object Promise]"!=ze(de.resolve())||pe&&ze(new pe)!=S||fe&&"[object WeakMap]"!=ze(new fe))&&(ze=function(e){var t=re.call(e),i=t==b?e.constructor:void 0,r=i?Xe(i):void 0;if(r)switch(r){case ye:return M;case ge:return g;case ve:return"[object Promise]";case be:return S;case _e:return"[object WeakMap]"}return t});var We=Qe(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(nt(e))return we?we.call(e):"";var t=e+"";return"0"==t&&1/e==-l?"-0":t}(t);var i=[];return E.test(e)&&i.push(""),e.replace(L,function(e,t,r,s){i.push(r?s.replace(O,"$1"):t||e)}),i});function Ye(e){if("string"==typeof e||nt(e))return e;var t=e+"";return"0"==t&&1/e==-l?"-0":t}function Xe(e){if(null!=e){try{return te.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Qe(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(s);var i=function(){var r=arguments,s=t?t.apply(this,r):r[0],n=i.cache;if(n.has(s))return n.get(s);var a=e.apply(this,r);return i.cache=n.set(s,a),a};return i.cache=new(Qe.Cache||Ae),i}function Ze(e,t){return e===t||e!=e&&t!=t}function Ke(e){return function(e){return st(e)&&et(e)}(e)&&ie.call(e,"callee")&&(!oe.call(e,"callee")||re.call(e)==u)}Qe.Cache=Ae;var $e=Array.isArray;function et(e){return null!=e&&it(e.length)&&!tt(e)}function tt(e){var t=rt(e)?re.call(e):"";return t==m||t==y}function it(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function rt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function st(e){return!!e&&"object"==typeof e}function nt(e){return"symbol"==typeof e||st(e)&&re.call(e)==w}var at=j?function(e){return function(t){return e(t)}}(j):function(e){return st(e)&&it(e.length)&&!!I[re.call(e)]};function ot(e){return et(e)?Le(e):De(e)}function lt(e){return e}e.exports=function(e,t){return e&&e.length?function(e,t,i){var s=-1,n=z,a=e.length,o=!0,l=[],h=l;if(i)o=!1,n=V;else if(a>=r){var u=t?null:Be(e);if(u)return X(u);o=!1,n=H,h=new Te}else h=t?[]:l;e:for(;++s<a;){var c=e[s],d=t?t(c):c;if(c=i||0!==c?c:0,o&&d==d){for(var p=h.length;p--;)if(h[p]===d)continue e;t&&h.push(d),l.push(c)}else n(h,d,i)||(h!==l&&h.push(d),l.push(c))}return l}(e,ke(t)):[]}},614:(e,t,i)=>{"use strict";e.exports=s;var r=i(645);function s(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var n="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(e){return e.type===s.Bytes?e.readVarint()+e.pos:e.pos+1}function o(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function l(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var s=i.pos-1;s>=e;s--)i.buf[s+r]=i.buf[s]}function h(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function u(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function c(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function d(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function p(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function f(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function m(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function y(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function g(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function v(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function b(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function _(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}s.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),s=r>>3,n=this.pos;this.type=7&r,e(s,t,this),this.pos===n&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=v(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=_(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=v(this.buf,this.pos)+4294967296*v(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=v(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,s,n=i.buf;if(s=n[i.pos++],r=(112&s)>>4,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<3,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<10,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<17,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<24,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(1&s)<<31,s<128)return o(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&n?function(e,t,i){return n.decode(e.subarray(t,i))}(this.buf,t,e):function(e,t,i){var r="",s=t;for(;s<i;){var n,a,o,l=e[s],h=null,u=l>239?4:l>223?3:l>191?2:1;if(s+u>i)break;1===u?l<128&&(h=l):2===u?128==(192&(n=e[s+1]))&&(h=(31&l)<<6|63&n)<=127&&(h=null):3===u?(n=e[s+1],a=e[s+2],128==(192&n)&&128==(192&a)&&((h=(15&l)<<12|(63&n)<<6|63&a)<=2047||h>=55296&&h<=57343)&&(h=null)):4===u&&(n=e[s+1],a=e[s+2],o=e[s+3],128==(192&n)&&128==(192&a)&&128==(192&o)&&((h=(15&l)<<18|(63&n)<<12|(63&a)<<6|63&o)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,u=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),s+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==s.Bytes)return e.push(this.readVarint(t));var i=a(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==s.Bytes)return e.push(this.readSVarint());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==s.Bytes)return e.push(this.readBoolean());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==s.Bytes)return e.push(this.readFloat());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==s.Bytes)return e.push(this.readDouble());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==s.Bytes)return e.push(this.readFixed32());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==s.Bytes)return e.push(this.readSFixed32());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==s.Bytes)return e.push(this.readFixed64());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==s.Bytes)return e.push(this.readSFixed64());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===s.Varint)for(;this.buf[this.pos++]>127;);else if(t===s.Bytes)this.pos=this.readVarint()+this.pos;else if(t===s.Fixed32)this.pos+=4;else{if(t!==s.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var i,r;e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,s,n=0;n<t.length;n++){if((r=t.charCodeAt(n))>55295&&r<57344){if(!s){r>56319||n+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):s=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(e[i++]=239,e[i++]=191,e[i++]=189,s=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;i>=128&&l(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;r>=128&&l(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,s.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,u,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,s.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,s.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,s.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,s.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,s.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,s.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,s.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,s.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,s.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,s.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},785:function(e){e.exports=function(){"use strict";var e=1,t=2,i=3,r=4,s=5,n=484813681109536e-20,a=Math.PI/2,o=.16666666666666666,l=.04722222222222222,h=.022156084656084655,u=1e-10,c=.017453292519943295,d=57.29577951308232,p=Math.PI/4,f=2*Math.PI,m=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},g={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},v=/[\s_\-\/\(\)]/g;function b(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),s=t.toLowerCase().replace(v,""),n=-1;++n<r.length;)if((i=r[n]).toLowerCase().replace(v,"")===s)return e[i]}var _=function(e){var t,i,r,s={},n=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e},{}),a={proj:"projName",datum:"datumCode",rf:function(e){s.rf=parseFloat(e)},lat_0:function(e){s.lat0=e*c},lat_1:function(e){s.lat1=e*c},lat_2:function(e){s.lat2=e*c},lat_ts:function(e){s.lat_ts=e*c},lon_0:function(e){s.long0=e*c},lon_1:function(e){s.long1=e*c},lon_2:function(e){s.long2=e*c},alpha:function(e){s.alpha=parseFloat(e)*c},gamma:function(e){s.rectified_grid_angle=parseFloat(e)},lonc:function(e){s.longc=e*c},x_0:function(e){s.x0=parseFloat(e)},y_0:function(e){s.y0=parseFloat(e)},k_0:function(e){s.k0=parseFloat(e)},k:function(e){s.k0=parseFloat(e)},a:function(e){s.a=parseFloat(e)},b:function(e){s.b=parseFloat(e)},r_a:function(){s.R_A=!0},zone:function(e){s.zone=parseInt(e,10)},south:function(){s.utmSouth=!0},towgs84:function(e){s.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){s.to_meter=parseFloat(e)},units:function(e){s.units=e;var t=b(g,e);t&&(s.to_meter=t.to_meter)},from_greenwich:function(e){s.from_greenwich=e*c},pm:function(e){var t=b(y,e);s.from_greenwich=(t||parseFloat(e))*c},nadgrids:function(e){"@null"===e?s.datumCode="none":s.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(s.axis=e)},approx:function(){s.approx=!0}};for(t in n)i=n[t],t in a?"function"==typeof(r=a[t])?r(i):s[r]=i:s[t]=i;return"string"==typeof s.datumCode&&"WGS84"!==s.datumCode&&(s.datumCode=s.datumCode.toLowerCase()),s},S=1,x=/\s/,w=/[A-Za-z]/,C=/[A-Za-z84_]/,M=/[,\]]/,A=/[\d\.E\-\+]/;function T(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=S}function E(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,s=i.reduce(function(e,t){return L(t,e),e},r);t&&(e[t]=s)}function L(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void L(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var r;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&L(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&L(e[3],t[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void E(t,i,e);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return L(e,t[i]);return E(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}T.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;x.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case S:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},T.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(M.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},T.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=S)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=S,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},T.prototype.number=function(e){if(!A.test(e)){if(M.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},T.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},T.prototype.keyword=function(e){if(C.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=S)}if(!M.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},T.prototype.neutral=function(e){if(w.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(A.test(e))return this.word=e,void(this.state=3);if(!M.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},T.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var O=.017453292519943295;function P(e){return e*O}var N=function(e){var t=new T(e).output(),i=t.shift(),r=t.shift();t.unshift(["name",r]),t.unshift(["type",i]);var s={};return L(t,s),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",i=0,r=e.AXIS.length;i<r;++i){var s=[e.AXIS[i][0].toLowerCase(),e.AXIS[i][1].toLowerCase()];-1!==s[0].indexOf("north")||("y"===s[0]||"lat"===s[0])&&"north"===s[1]?t+="n":-1!==s[0].indexOf("south")||("y"===s[0]||"lat"===s[0])&&"south"===s[1]?t+="s":-1!==s[0].indexOf("east")||("x"===s[0]||"lon"===s[0])&&"east"===s[1]?t+="e":-1===s[0].indexOf("west")&&("x"!==s[0]&&"lon"!==s[0]||"west"!==s[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var n=e.GEOGCS;function a(t){var i=e.to_meter||1;return t*i}"GEOGCS"===e.type&&(n=e),n&&(n.DATUM?e.datumCode=n.DATUM.name.toLowerCase():e.datumCode=n.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(e.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=n.DATUM.SPHEROID.a,e.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(e.datum_params=n.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",P],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",P],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",P],["lat0","latitude_of_origin",P],["lat0","standard_parallel_1",P],["lat1","standard_parallel_1",P],["lat2","standard_parallel_2",P],["azimuth","Azimuth"],["alpha","azimuth",P],["srsCode","name"]].forEach(function(t){return i=e,s=(r=t)[0],n=r[1],void(!(s in i)&&n in i&&(i[s]=i[n],3===r.length&&(i[s]=r[2](i[s]))));var i,r,s,n}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName||(e.lat0=P(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(s),s};function I(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?I[e]=_(arguments[1]):I[e]=N(arguments[1]):I[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?I.apply(t,e):I(e)});if("string"==typeof e){if(e in I)return I[e]}else"EPSG"in e?I["EPSG:"+e.EPSG]=e:"ESRI"in e?I["ESRI:"+e.ESRI]=e:"IAU2000"in e?I["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(I);var F=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],k=["3857","900913","3785","102113"];function D(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in I}(e))return I[e];if(function(e){return F.some(function(t){return e.indexOf(t)>-1})}(e)){var t=N(e);if(function(e){var t=b(e,"authority");if(t){var i=b(t,"epsg");return i&&k.indexOf(i)>-1}}(t))return I["EPSG:3857"];var i=function(e){var t=b(e,"extension");if(t)return b(t,"proj4")}(t);return i?_(i):t}return function(e){return"+"===e[0]}(e)?_(e):void 0}var R=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},B=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},G=function(e){return e<0?-1:1},U=function(e){return Math.abs(e)<=m?e:e-G(e)*f},j=function(e,t,i){var r=e*i,s=.5*e;return r=Math.pow((1-r)/(1+r),s),Math.tan(.5*(a-t))/r},z=function(e,t){for(var i,r,s=.5*e,n=a-2*Math.atan(t),o=0;o<=15;o++)if(i=e*Math.sin(n),r=a-2*Math.atan(t*Math.pow((1-i)/(1+i),s))-n,n+=r,Math.abs(r)<=1e-10)return n;return-9999};function V(e){return e}var J=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=B(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,i,r=e.x,s=e.y;if(s*d>90&&s*d<-90&&r*d>180&&r*d<-180)return null;if(Math.abs(Math.abs(s)-a)<=u)return null;if(this.sphere)t=this.x0+this.a*this.k0*U(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(p+.5*s));else{var n=Math.sin(s),o=j(this.e,s,n);t=this.x0+this.a*this.k0*U(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,s=e.y-this.y0;if(this.sphere)i=a-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var n=Math.exp(-s/(this.a*this.k0));if(-9999===(i=z(this.e,n)))return null}return t=U(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:V,inverse:V,names:["longlat","identity"]}],q={},H=[];function W(e,t){var i=H.length;return e.names?(H[i]=e,e.names.forEach(function(e){q[e.toLowerCase()]=i}),this):(console.log(t),!0)}var Y={start:function(){J.forEach(W)},add:W,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==q[t]&&H[q[t]]?H[q[t]]:void 0}},X={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Q=X.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};X.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Z={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},K={};function $(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:K[e]||null,isNull:!1}}function ee(e){return e/3600*Math.PI/180}function te(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function ie(e){return e.map(function(e){return[ee(e.longitudeShift),ee(e.latitudeShift)]})}function re(e,t,i){return{name:te(e,t+8,t+16).trim(),parent:te(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function se(e,t,i,r){for(var s=t+176,n=[],a=0;a<i.gridNodeCount;a++){var o={latitudeShift:e.getFloat32(s+16*a,r),longitudeShift:e.getFloat32(s+16*a+4,r),latitudeAccuracy:e.getFloat32(s+16*a+8,r),longitudeAccuracy:e.getFloat32(s+16*a+12,r)};n.push(o)}return n}function ne(a,c){if(!(this instanceof ne))return new ne(a);c=c||function(e){if(e)throw e};var d,p,f,m,y,g,v,_=D(a);if("object"==typeof _){var S=ne.projections.get(_.projName);if(S){if(_.datumCode&&"none"!==_.datumCode){var x=b(Z,_.datumCode);x&&(_.datum_params=_.datum_params||(x.towgs84?x.towgs84.split(","):null),_.ellps=x.ellipse,_.datumName=x.datumName?x.datumName:_.datumCode)}_.k0=_.k0||1,_.axis=_.axis||"enu",_.ellps=_.ellps||"wgs84",_.lat1=_.lat1||_.lat0;var w=function(e,t,i,r,s){if(!e){var n=b(X,r);n||(n=Q),e=n.a,t=n.b,i=n.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<u)&&(s=!0,t=e),{a:e,b:t,rf:i,sphere:s}}(_.a,_.b,_.rf,_.ellps,_.sphere),C=(d=w.a,p=w.b,w.rf,f=_.R_A,g=((m=d*d)-(y=p*p))/m,v=0,f?(m=(d*=1-g*(o+g*(l+g*h)))*d,g=0):v=Math.sqrt(g),{es:g,e:v,ep2:(m-y)/y}),M=function(e){return void 0===e?null:e.split(",").map($)}(_.nadgrids),A=_.datum||function(a,o,l,h,u,c,d){var p={};return p.datum_type=void 0===a||"none"===a?s:r,o&&(p.datum_params=o.map(parseFloat),0===p.datum_params[0]&&0===p.datum_params[1]&&0===p.datum_params[2]||(p.datum_type=e),p.datum_params.length>3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=t,p.datum_params[3]*=n,p.datum_params[4]*=n,p.datum_params[5]*=n,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=i,p.grids=d),p.a=l,p.b=h,p.es=u,p.ep2=c,p}(_.datumCode,_.datum_params,w.a,w.b,C.es,C.ep2,M);R(this,_),R(this,S),this.a=w.a,this.b=w.b,this.rf=w.rf,this.sphere=w.sphere,this.es=C.es,this.e=C.e,this.ep2=C.ep2,this.datum=A,this.init(),c(null,this)}else c(a)}else c(a)}function ae(e,t,i){var r,s,n,o,l=e.x,h=e.y,u=e.z?e.z:0;if(h<-a&&h>-1.001*a)h=-a;else if(h>a&&h<1.001*a)h=a;else{if(h<-a)return{x:-1/0,y:-1/0,z:e.z};if(h>a)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),s=Math.sin(h),o=Math.cos(h),n=s*s,{x:((r=i/Math.sqrt(1-t*n))+u)*o*Math.cos(l),y:(r+u)*o*Math.sin(l),z:(r*(1-t)+u)*s}}function oe(e,t,i,r){var s,n,o,l,h,u,c,d,p,f,m,y,g,v,b,_,S=e.x,x=e.y,w=e.z?e.z:0;if(s=Math.sqrt(S*S+x*x),n=Math.sqrt(S*S+x*x+w*w),s/i<1e-12){if(v=0,n/i<1e-12)return b=a,_=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(x,S);o=w/n,l=s/n,h=1/Math.sqrt(1-t*(2-t)*l*l),d=l*(1-t)*h,p=o*h,g=0;do{g++,c=i/Math.sqrt(1-t*p*p),u=t*c/(c+(_=s*d+w*p-c*(1-t*p*p))),h=1/Math.sqrt(1-u*(2-u)*l*l),y=(m=o*h)*d-(f=l*(1-u)*h)*p,d=f,p=m}while(y*y>1e-24&&g<30);return b=Math.atan(m/Math.abs(f)),{x:v,y:b,z:_}}function le(i){return i===e||i===t}ne.projections=Y,ne.projections.start();var he=function(r,n,a){if(function(i,r){return i.datum_type===r.datum_type&&!(i.a!==r.a||Math.abs(i.es-r.es)>5e-11)&&(i.datum_type===e?i.datum_params[0]===r.datum_params[0]&&i.datum_params[1]===r.datum_params[1]&&i.datum_params[2]===r.datum_params[2]:i.datum_type!==t||i.datum_params[0]===r.datum_params[0]&&i.datum_params[1]===r.datum_params[1]&&i.datum_params[2]===r.datum_params[2]&&i.datum_params[3]===r.datum_params[3]&&i.datum_params[4]===r.datum_params[4]&&i.datum_params[5]===r.datum_params[5]&&i.datum_params[6]===r.datum_params[6])}(r,n))return a;if(r.datum_type===s||n.datum_type===s)return a;var o=r.a,l=r.es;if(r.datum_type===i){var h=ue(r,!1,a);if(0!==h)return;o=6378137,l=.0066943799901413165}var u=n.a,c=n.b,d=n.es;if(n.datum_type===i&&(u=6378137,c=6356752.314,d=.0066943799901413165),l===d&&o===u&&!le(r.datum_type)&&!le(n.datum_type))return a;if(a=ae(a,l,o),le(r.datum_type)&&(a=function(i,r,s){if(r===e)return{x:i.x+s[0],y:i.y+s[1],z:i.z+s[2]};if(r===t){var n=s[0],a=s[1],o=s[2],l=s[3],h=s[4],u=s[5],c=s[6];return{x:c*(i.x-u*i.y+h*i.z)+n,y:c*(u*i.x+i.y-l*i.z)+a,z:c*(-h*i.x+l*i.y+i.z)+o}}}(a,r.datum_type,r.datum_params)),le(n.datum_type)&&(a=function(i,r,s){if(r===e)return{x:i.x-s[0],y:i.y-s[1],z:i.z-s[2]};if(r===t){var n=s[0],a=s[1],o=s[2],l=s[3],h=s[4],u=s[5],c=s[6],d=(i.x-n)/c,p=(i.y-a)/c,f=(i.z-o)/c;return{x:d+u*p-h*f,y:-u*d+p+l*f,z:h*d-l*p+f}}}(a,n.datum_type,n.datum_params)),a=oe(a,d,u,c),n.datum_type===i){var p=ue(n,!0,a);if(0!==p)return}return a};function ue(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},s={x:Number.NaN,y:Number.NaN},n=[],a=0;a<e.grids.length;a++){var o=e.grids[a];if(n.push(o.name),o.isNull){s=r;break}if(null!==o.grid){var l=o.grid.subgrids[0],h=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,u=l.ll[0]-h,c=l.ll[1]-h,p=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,f=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(c>r.y||u>r.x||f<r.y||p<r.x||(s=ce(r,t,l),isNaN(s.x))))break}else if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*d+" "+r.y*d+" tried: '"+n+"'"),-1):(i.x=-s.x,i.y=s.y,0)}function ce(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var s={x:e.x,y:e.y};s.x-=i.ll[0],s.y-=i.ll[1],s.x=U(s.x-Math.PI)+Math.PI;var n=de(s,i);if(t){if(isNaN(n.x))return r;n.x=s.x-n.x,n.y=s.y-n.y;var a,o,l=9;do{if(o=de(n,i),isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a={x:s.x-(o.x+n.x),y:s.y-(o.y+n.y)},n.x+=a.x,n.y+=a.y}while(l--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=U(n.x+i.ll[0]),r.y=n.y+i.ll[1]}else isNaN(n.x)||(r.x=e.x+n.x,r.y=e.y+n.y);return r}function de(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},s={x:Math.floor(r.x),y:Math.floor(r.y)},n={x:r.x-1*s.x,y:r.y-1*s.y},a={x:Number.NaN,y:Number.NaN};if(s.x<0||s.x>=t.lim[0])return a;if(s.y<0||s.y>=t.lim[1])return a;i=s.y*t.lim[0]+s.x;var o={x:t.cvs[i][0],y:t.cvs[i][1]};i++;var l={x:t.cvs[i][0],y:t.cvs[i][1]};i+=t.lim[0];var h={x:t.cvs[i][0],y:t.cvs[i][1]};i--;var u={x:t.cvs[i][0],y:t.cvs[i][1]},c=n.x*n.y,d=n.x*(1-n.y),p=(1-n.x)*(1-n.y),f=(1-n.x)*n.y;return a.x=p*o.x+d*l.x+f*u.x+c*h.x,a.y=p*o.y+d*l.y+f*u.y+c*h.y,a}var pe=function(e,t,i){var r,s,n,a=i.x,o=i.y,l=i.z||0,h={};for(n=0;n<3;n++)if(!t||2!==n||void 0!==i.z)switch(0===n?(r=a,s=-1!=="ew".indexOf(e.axis[n])?"x":"y"):1===n?(r=o,s=-1!=="ns".indexOf(e.axis[n])?"y":"x"):(r=l,s="z"),e.axis[n]){case"e":h[s]=r;break;case"w":h[s]=-r;break;case"n":h[s]=r;break;case"s":h[s]=-r;break;case"u":void 0!==i[s]&&(h.z=r);break;case"d":void 0!==i[s]&&(h.z=-r);break;default:return null}return h},fe=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},me=function(e){ye(e.x),ye(e.y)};function ye(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function ge(r,s,n,a){var o,l=void 0!==(n=Array.isArray(n)?fe(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(me(n),r.datum&&s.datum&&function(r,s){return(r.datum.datum_type===e||r.datum.datum_type===t||r.datum.datum_type===i)&&"WGS84"!==s.datumCode||(s.datum.datum_type===e||s.datum.datum_type===t||s.datum.datum_type===i)&&"WGS84"!==r.datumCode}(r,s)&&(o=new ne("WGS84"),n=ge(r,o,n,a),r=o),a&&"enu"!==r.axis&&(n=pe(r,!1,n)),"longlat"===r.projName)n={x:n.x*c,y:n.y*c,z:n.z||0};else if(r.to_meter&&(n={x:n.x*r.to_meter,y:n.y*r.to_meter,z:n.z||0}),!(n=r.inverse(n)))return;if(r.from_greenwich&&(n.x+=r.from_greenwich),n=he(r.datum,s.datum,n))return s.from_greenwich&&(n={x:n.x-s.from_greenwich,y:n.y,z:n.z||0}),"longlat"===s.projName?n={x:n.x*d,y:n.y*d,z:n.z||0}:(n=s.forward(n),s.to_meter&&(n={x:n.x/s.to_meter,y:n.y/s.to_meter,z:n.z||0})),a&&"enu"!==s.axis?pe(s,!0,n):(l||delete n.z,n)}var ve=ne("WGS84");function be(e,t,i,r){var s,n,a;return Array.isArray(i)?(s=ge(e,t,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof s.z?[s.x,s.y,s.z].concat(i.splice(3)):[s.x,s.y,i[2]].concat(i.splice(3)):[s.x,s.y].concat(i.splice(2)):[s.x,s.y]):(n=ge(e,t,i,r),2===(a=Object.keys(i)).length?n:(a.forEach(function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;n[r]=i[r]}),n))}function _e(e){return e instanceof ne?e:e.oProj?e.oProj:ne(e)}function Se(e,t,i){e=_e(e);var r,s=!1;return void 0===t?(t=e,e=ve,s=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=ve,s=!0),t=_e(t),i?be(e,t,i):(r={forward:function(i,r){return be(e,t,i,r)},inverse:function(i,r){return be(t,e,i,r)}},s&&(r.oProj=t),r)}var xe=6,we="AJSAJS",Ce="AFAFAF",Me=65,Ae=73,Te=79,Ee=86,Le=90,Oe={forward:Pe,inverse:function(e){var t=ke(Re(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]},toPoint:Ne};function Pe(e,t){return t=t||5,function(e,t){var i,r,s,n,a,o,l,h,u,c,d,p,f,m,y="00000"+e.easting,g="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(u=e.easting,c=e.northing,d=e.zoneNumber,p=De(d),f=Math.floor(u/1e5),m=Math.floor(c/1e5)%20,i=f,r=m,s=p-1,n=we.charCodeAt(s),a=Ce.charCodeAt(s),l=a+r,h=!1,(o=n+i-1)>Le&&(o=o-Le+Me-1,h=!0),(o===Ae||n<Ae&&o>Ae||(o>Ae||n<Ae)&&h)&&o++,(o===Te||n<Te&&o>Te||(o>Te||n<Te)&&h)&&++o===Ae&&o++,o>Le&&(o=o-Le+Me-1),l>Ee?(l=l-Ee+Me-1,h=!0):h=!1,(l===Ae||a<Ae&&l>Ae||(l>Ae||a<Ae)&&h)&&l++,(l===Te||a<Te&&l>Te||(l>Te||a<Te)&&h)&&++l===Ae&&l++,l>Ee&&(l=l-Ee+Me-1),String.fromCharCode(o)+String.fromCharCode(l))+y.substr(y.length-5,t)+g.substr(g.length-5,t)}(function(e){var t,i,r,s,n,a,o,l=e.lat,h=e.lon,u=6378137,c=Ie(l),d=Ie(h);o=Math.floor((h+180)/6)+1,180===h&&(o=60),l>=56&&l<64&&h>=3&&h<12&&(o=32),l>=72&&l<84&&(h>=0&&h<9?o=31:h>=9&&h<21?o=33:h>=21&&h<33?o=35:h>=33&&h<42&&(o=37)),a=Ie(6*(o-1)-180+3),t=u/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),i=Math.tan(c)*Math.tan(c),r=.006739496752268451*Math.cos(c)*Math.cos(c),s=Math.cos(c)*(d-a),n=u*(.9983242984503243*c-.002514607064228144*Math.sin(2*c)+2639046602129982e-21*Math.sin(4*c)-3.418046101696858e-9*Math.sin(6*c));var p,f,m=.9996*t*(s+(1-i+r)*s*s*s/6+(5-18*i+i*i+72*r-.39089081163157013)*s*s*s*s*s/120)+5e5,y=.9996*(n+t*Math.tan(c)*(s*s/2+(5-i+9*r+4*r*r)*s*s*s*s/24+(61-58*i+i*i+600*r-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(m),zoneNumber:o,zoneLetter:(p=l,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:e[1],lon:e[0]}),t)}function Ne(e){var t=ke(Re(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Ie(e){return e*(Math.PI/180)}function Fe(e){return e/Math.PI*180}function ke(e){var t=e.northing,i=e.easting,r=e.zoneLetter,s=e.zoneNumber;if(s<0||s>60)return null;var n,a,o,l,h,u,c,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=t;r<"N"&&(y-=1e7),u=6*(s-1)-180+3,d=(c=y/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*c)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*c)+151*f*f*f/96*Math.sin(6*c),n=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),o=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*n);var g=d-n*Math.tan(d)/l*(h*h/2-(5+3*a+10*o-4*o*o-.06065547077041606)*h*h*h*h/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*h*h*h*h*h*h/720);g=Fe(g);var v,b=(h-(1+2*a+o)*h*h*h/6+(5-2*o+28*a-3*o*o+.05391597401814761+24*a*a)*h*h*h*h*h/120)/Math.cos(d);if(b=u+Fe(b),e.accuracy){var _=ke({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:_.lat,right:_.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function De(e){var t=e%xe;return 0===t&&(t=xe),t}function Re(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,s="",n=0;!/[A-Z]/.test(t=e.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+e;s+=t,n++}var a=parseInt(s,10);if(0===n||n+3>i)throw"MGRSPoint bad conversion from: "+e;var o=e.charAt(n++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+e;r=e.substring(n,n+=2);for(var l=De(a),h=function(e,t){for(var i=we.charCodeAt(t-1),r=1e5,s=!1;i!==e.charCodeAt(0);){if(++i===Ae&&i++,i===Te&&i++,i>Le){if(s)throw"Bad character: "+e;i=Me,s=!0}r+=1e5}return r}(r.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var i=Ce.charCodeAt(t-1),r=0,s=!1;i!==e.charCodeAt(0);){if(++i===Ae&&i++,i===Te&&i++,i>Ee){if(s)throw"Bad character: "+e;i=Me,s=!0}r+=1e5}return r}(r.charAt(1),l);u<Be(o);)u+=2e6;var c=i-n;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var d,p,f,m=c/2,y=0,g=0;return m>0&&(d=1e5/Math.pow(10,m),p=e.substring(n,n+m),y=parseFloat(p)*d,f=e.substring(n+m),g=parseFloat(f)*d),{easting:y+h,northing:g+u,zoneLetter:o,zoneNumber:a,accuracy:d}}function Be(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Ge(e,t,i){if(!(this instanceof Ge))return new Ge(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ge.fromMGRS=function(e){return new Ge(Ne(e))},Ge.prototype.toMGRS=function(e){return Pe([this.x,this.y],e)};var Ue=.01068115234375,je=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Ue))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Ue)));var i=e*e;return t[2]=i*(.46875-e*(.013020833333333334+.007120768229166667*e)),i*=e,t[3]=i*(.3645833333333333-.005696614583333333*e),t[4]=i*e*.3076171875,t},ze=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},Ve=function(e,t,i){for(var r=1/(1-t),s=e,n=20;n;--n){var a=Math.sin(s),o=1-t*a*a;if(o=(ze(s,a,Math.cos(s),i)-e)*(o*Math.sqrt(o))*r,s-=o,Math.abs(o)<u)return s}return s},Je={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=je(this.es),this.ml0=ze(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,s=e.x,n=e.y,a=U(s-this.long0),o=Math.sin(n),l=Math.cos(n);if(this.es){var h=l*a,c=Math.pow(h,2),d=this.ep2*Math.pow(l,2),p=Math.pow(d,2),f=Math.abs(l)>u?Math.tan(n):0,m=Math.pow(f,2),y=Math.pow(m,2);t=1-this.es*Math.pow(o,2),h/=Math.sqrt(t);var g=ze(n,o,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-m+d+c/20*(5-18*m+y+14*d-58*m*d+c/42*(61+179*y-y*m-479*m)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+o*a*h/2*(1+c/12*(5-m+9*d+4*p+c/30*(61+y-58*m+270*d-330*m*d+c/56*(1385+543*y-y*m-3111*m))))))+this.y0}else{var v=l*Math.sin(a);if(Math.abs(Math.abs(v)-1)<u)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(a)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>u)return 93;r=0}else r=Math.acos(r);n<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e},inverse:function(e){var t,i,r,s,n=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=Ve(t,this.es,this.en),Math.abs(i)<a){var l=Math.sin(i),h=Math.cos(i),c=Math.abs(h)>u?Math.tan(i):0,d=this.ep2*Math.pow(h,2),p=Math.pow(d,2),f=Math.pow(c,2),m=Math.pow(f,2);t=1-this.es*Math.pow(l,2);var y=n*Math.sqrt(t)/this.k0,g=Math.pow(y,2);r=i-(t*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*f-9*d*f+d-4*p-g/30*(61+90*f-252*d*f+45*m+46*d-g/56*(1385+3633*f+4095*m+1574*m*f)))),s=U(this.long0+y*(1-g/6*(1+2*f+d-g/20*(5+28*f+24*m+8*d*f+6*d-g/42*(61+662*f+1320*m+720*m*f))))/h)}else r=a*G(o),s=0;else{var v=Math.exp(n/this.k0),b=.5*(v-1/v),_=this.lat0+o/this.k0,S=Math.cos(_);t=Math.sqrt((1-Math.pow(S,2))/(1+Math.pow(b,2))),r=Math.asin(t),o<0&&(r=-r),s=0===b&&0===S?0:U(Math.atan2(b,S)+this.long0)}return e.x=s,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},qe=function(e){var t=Math.exp(e);return t=(t-1/t)/2},He=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},We=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i}(t*(1+t/(He(1,t)+1))),e<0?-t:t},Ye=function(e,t){for(var i,r=2*Math.cos(2*t),s=e.length-1,n=e[s],a=0;--s>=0;)i=r*n-a+e[s],a=n,n=i;return t+i*Math.sin(2*t)},Xe=function(e,t){for(var i,r=2*Math.cos(t),s=e.length-1,n=e[s],a=0;--s>=0;)i=r*n-a+e[s],a=n,n=i;return Math.sin(t)*i},Qe=function(e,t,i){for(var r,s,n=Math.sin(t),a=Math.cos(t),o=qe(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*a*l,u=-2*n*o,c=e.length-1,d=e[c],p=0,f=0,m=0;--c>=0;)r=f,s=p,d=h*(f=d)-r-u*(p=m)+e[c],m=u*f-s+h*p;return[(h=n*l)*d-(u=a*o)*m,h*m+u*d]},Ze={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Je.init.apply(this),this.forward=Je.forward,this.inverse=Je.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=Ye(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Xe(this.gtu,2*r))},forward:function(e){var t=U(e.x-this.long0),i=e.y;i=Ye(this.cbg,i);var r=Math.sin(i),s=Math.cos(i),n=Math.sin(t),a=Math.cos(t);i=Math.atan2(r,a*s),t=Math.atan2(n*s,He(r,s*a)),t=We(Math.tan(t));var o,l,h=Qe(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(o=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(o=1/0,l=1/0),e.x=o,e.y=l,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(s=(s-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var n=Qe(this.utg,2*s,2*r);s+=n[0],r+=n[1],r=Math.atan(qe(r));var a=Math.sin(s),o=Math.cos(s),l=Math.sin(r),h=Math.cos(r);s=Math.atan2(a*h,He(l,h*o)),r=Math.atan2(l,h*o),t=U(r+this.long0),i=Ye(this.cgb,s)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Ke=function(e,t){if(void 0===e){if((e=Math.floor(30*(U(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e},$e={init:function(){var e=Ke(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*c,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ze.init.apply(this),this.forward=Ze.forward,this.inverse=Ze.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},et=function(e,t){return Math.pow((1-e)/(1+e),t)},tt=20,it={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+p)/(Math.pow(Math.tan(.5*this.lat0+p),this.C)*et(this.e*e,this.ratexp))},forward:function(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+p),this.C)*et(this.e*Math.sin(i),this.ratexp))-a,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+p)/this.K,1/this.C),s=tt;s>0&&(i=2*Math.atan(r*et(this.e*Math.sin(e.y),-.5*this.e))-a,!(Math.abs(i-e.y)<1e-14));--s)e.y=i;return s?(e.x=t,e.y=i,e):null},names:["gauss"]},rt={init:function(){it.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,i,r,s;return e.x=U(e.x-this.long0),it.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),s=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=s*i*Math.sin(e.x),e.y=s*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,i,r,s,n;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,n=Math.sqrt(e.x*e.x+e.y*e.y)){var a=2*Math.atan2(n,this.R2);t=Math.sin(a),i=Math.cos(a),s=Math.asin(i*this.sinc0+e.y*t*this.cosc0/n),r=Math.atan2(e.x*t,n*this.cosc0*i-e.y*this.sinc0*t)}else s=this.phic0,r=0;return e.x=r,e.y=s,it.inverse.apply(this,[e]),e.x=U(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},st={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=u&&(this.k0=.5*(1+G(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=u&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=u&&(this.k0=.5*this.cons*B(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/j(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=B(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,i,r,s,n,o,l=e.x,h=e.y,c=Math.sin(h),d=Math.cos(h),p=U(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=u&&Math.abs(h+this.lat0)<=u?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*c+this.coslat0*d*Math.cos(p)),e.x=this.a*t*d*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*c-this.sinlat0*d*Math.cos(p))+this.y0,e):(i=2*Math.atan(this.ssfn_(h,c,this.e))-a,s=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=u?(n=j(this.e,h*this.con,this.con*c),o=2*this.a*this.k0*n/this.cons,e.x=this.x0+o*Math.sin(l-this.long0),e.y=this.y0-this.con*o*Math.cos(l-this.long0),e):(Math.abs(this.sinlat0)<u?(t=2*this.a*this.k0/(1+s*Math.cos(p)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*s*Math.cos(p))),e.y=t*(this.cosX0*r-this.sinX0*s*Math.cos(p))+this.y0),e.x=t*s*Math.sin(p)+this.x0,e))},inverse:function(e){var t,i,r,s,n;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var l=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,i=this.lat0,o<=u?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(l)*this.sinlat0+e.y*Math.sin(l)*this.coslat0/o),t=Math.abs(this.coslat0)<u?this.lat0>0?U(this.long0+Math.atan2(e.x,-1*e.y)):U(this.long0+Math.atan2(e.x,e.y)):U(this.long0+Math.atan2(e.x*Math.sin(l),o*this.coslat0*Math.cos(l)-e.y*this.sinlat0*Math.sin(l))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=u){if(o<=u)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*z(this.e,r),t=this.con*U(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else s=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=u?n=this.X0:(n=Math.asin(Math.cos(s)*this.sinX0+e.y*Math.sin(s)*this.cosX0/o),t=U(this.long0+Math.atan2(e.x*Math.sin(s),o*this.cosX0*Math.cos(s)-e.y*this.sinX0*Math.sin(s)))),i=-1*z(this.e,Math.tan(.5*(a+n)));return e.x=t,e.y=i,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,i){return t*=i,Math.tan(.5*(a+e))*Math.pow((1-t)/(1+t),.5*i)}},nt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,s=2*r-Math.pow(r,2),n=this.e=Math.sqrt(s);this.R=this.k0*i*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+n*t)/(1-n*t));this.K=a-this.alpha*o+this.alpha*n/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,s=2*(Math.atan(Math.exp(r))-Math.PI/4),n=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(n))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(n));return e.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,s=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+a/this.alpha,l=0,h=n,u=-1e3,c=0;Math.abs(h-u)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),u=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=o,e.y=h,e},names:["somerc"]},at=1e-7,ot={init:function(){var e,t,i,r,s,n,o,l,h,d,m,y,g,v=0,b=0,_=0,S=0,x=0,w=0,C=0;this.no_off=(g="object"==typeof(y=this).PROJECTION?Object.keys(y.PROJECTION)[0]:y.PROJECTION,"no_uoff"in y||"no_off"in y||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var A=!1;if("rectified_grid_angle"in this&&(A=!0),M&&(C=this.alpha),A&&(v=this.rectified_grid_angle*c),M||A)b=this.longc;else if(_=this.long1,x=this.lat1,S=this.long2,w=this.lat2,Math.abs(x-w)<=at||(e=Math.abs(x))<=at||Math.abs(e-a)<=at||Math.abs(Math.abs(this.lat0)-a)<=at||Math.abs(Math.abs(w)-a)<=at)throw new Error;var T=1-this.es;t=Math.sqrt(T),Math.abs(this.lat0)>u?(l=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*l*l,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/T),this.A=this.B*this.k0*t/e,r=this.B*t/(i*Math.sqrt(e)),(s=r*r-1)<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=r,this.E*=Math.pow(j(this.e,this.lat0,l),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=s=1),M||A?(M?(m=Math.asin(Math.sin(C)/r),A||(v=C)):(m=v,C=Math.asin(r*Math.sin(m))),this.lam0=b-Math.asin(.5*(s-1/s)*Math.tan(m))/this.B):(n=Math.pow(j(this.e,x,Math.sin(x)),this.B),o=Math.pow(j(this.e,w,Math.sin(w)),this.B),s=this.E/n,h=(o-n)/(o+n),d=((d=this.E*this.E)-o*n)/(d+o*n),(e=_-S)<-Math.pi?S-=f:e>Math.pi&&(S+=f),this.lam0=U(.5*(_+S)-Math.atan(d*Math.tan(.5*this.B*(_-S))/h)/this.B),m=Math.atan(2*Math.sin(this.B*U(_-this.lam0))/(s-1/s)),v=C=Math.asin(r*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(C))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(p-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(p+s))},forward:function(e){var t,i,r,s,n,o,l,h,c={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-a)>u){if(n=this.E/Math.pow(j(this.e,e.y,Math.sin(e.y)),this.B),t=.5*(n-(o=1/n)),i=.5*(n+o),s=Math.sin(this.B*e.x),r=(t*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(r)-1)<u)throw new Error;h=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*e.x),l=Math.abs(o)<at?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+s*this.singam,o)}else h=e.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(c.x=l,c.y=h):(l-=this.u_0,c.x=h*this.cosrot+l*this.sinrot,c.y=l*this.cosrot-h*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(e){var t,i,r,s,n,o,l,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*i),s=.5*(r-1/r),n=.5*(r+1/r),o=Math.sin(this.BrA*t),l=(o*this.cosgam+s*this.singam)/n,Math.abs(Math.abs(l)-1)<u)h.x=0,h.y=l<0?-a:a;else{if(h.y=this.E/Math.sqrt((1+l)/(1-l)),h.y=z(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(s*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},lt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<u)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),r=B(this.e,t,i),s=j(this.e,this.lat1,t),n=Math.sin(this.lat2),a=Math.cos(this.lat2),o=B(this.e,n,a),l=j(this.e,this.lat2,n),h=j(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>u?this.ns=Math.log(r/o)/Math.log(s/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=u&&(i=G(i)*(a-2*u));var r,s,n=Math.abs(Math.abs(i)-a);if(n>u)r=j(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(r,this.ns);else{if((n=i*this.ns)<=0)return null;s=0}var o=this.ns*U(t-this.long0);return e.x=this.k0*(s*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,e},inverse:function(e){var t,i,r,s,n,o=(e.x-this.x0)/this.k0,l=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+l*l),i=1):(t=-Math.sqrt(o*o+l*l),i=-1);var h=0;if(0!==t&&(h=Math.atan2(i*o,i*l)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(s=z(this.e,r)))return null}else s=-a;return n=U(h/this.ns+this.long0),e.x=n,e.y=s,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},ht={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,i,r,s,n,a,o,l=e.x,h=e.y,u=U(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),r=-u*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(s)),a=this.n*n,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),e.y=o*Math.cos(a)/1,e.x=o*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,s,n,a,o,l,h=e.x;e.x=e.y,e.y=h,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x),s=n/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),i=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=t,l=0;var u=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(l=1),o=e.y,u+=1}while(0===l&&u<15);return u>=15?null:e},names:["Krovak","krovak"]},ut=function(e,t,i,r,s){return e*s-t*Math.sin(2*s)+i*Math.sin(4*s)-r*Math.sin(6*s)},ct=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},dt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},pt=function(e){return.05859375*e*e*(1+.75*e)},ft=function(e){return e*e*e*(35/3072)},mt=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},yt=function(e){return Math.abs(e)<a?e:e-G(e)*Math.PI},gt=function(e,t,i,r,s){var n,a;n=e/t;for(var o=0;o<15;o++)if(a=(e-(t*n-i*Math.sin(2*n)+r*Math.sin(4*n)-s*Math.sin(6*n)))/(t-2*i*Math.cos(2*n)+4*r*Math.cos(4*n)-6*s*Math.cos(6*n)),n+=a,Math.abs(a)<=1e-10)return n;return NaN},vt={init:function(){this.sphere||(this.e0=ct(this.es),this.e1=dt(this.es),this.e2=pt(this.es),this.e3=ft(this.es),this.ml0=this.a*ut(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,s=e.y;if(r=U(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(s)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(s),Math.cos(r))-this.lat0);else{var n=Math.sin(s),a=Math.cos(s),o=mt(this.a,this.e,n),l=Math.tan(s)*Math.tan(s),h=r*Math.cos(s),u=h*h,c=this.es*a*a/(1-this.es),d=this.a*ut(this.e0,this.e1,this.e2,this.e3,s);t=o*h*(1-u*l*(1/6-(8-l+8*c)*u/120)),i=d-this.ml0+o*n/a*u*(.5+(5-l+6*c)*u/24)}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r=e.x/this.a,s=e.y/this.a;if(this.sphere){var n=s+this.lat0;t=Math.asin(Math.sin(n)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(n))}else{var o=this.ml0/this.a+s,l=gt(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(l)-a)<=u)return e.x=this.long0,e.y=a,s<0&&(e.y*=-1),e;var h=mt(this.a,this.e,Math.sin(l)),c=h*h*h/this.a/this.a*(1-this.es),d=Math.pow(Math.tan(l),2),p=r*this.a/h,f=p*p;t=l-h*Math.tan(l)/c*p*p*(.5-(1+3*d)*p*p/24),i=p*(1-f*(d/3+(1+3*d)*d*f/15))/Math.cos(l)}return e.x=U(i+this.long0),e.y=yt(t),e},names:["Cassini","Cassini_Soldner","cass"]},bt=function(e,t){var i;return e>1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t},_t=.3333333333333333,St=.17222222222222222,xt=.10257936507936508,wt=.06388888888888888,Ct=.0664021164021164,Mt=.016415012942191543,At={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-a)<u?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<u?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=bt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*_t,t=e*e,i[0]+=t*St,i[1]=t*wt,t*=e,i[0]+=t*xt,i[1]+=t*Ct,i[2]=t*Mt,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=bt(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,i,r,s,n,o,l,h,c,d,f=e.x,m=e.y;if(f=U(f-this.long0),this.sphere){if(n=Math.sin(m),d=Math.cos(m),r=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+d*r:1+this.sinph0*n+this.cosph0*d*r)<=u)return null;i=Math.sqrt(2/i),t=i*d*Math.sin(f),i*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*d*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(m+this.lat0)<u)return null;i=p-.5*m,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),t=i*Math.sin(f),i*=r}}else{switch(l=0,h=0,c=0,r=Math.cos(f),s=Math.sin(f),n=Math.sin(m),o=bt(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(l=o/this.qp,h=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:c=1+this.sinb1*l+this.cosb1*h*r;break;case this.EQUIT:c=1+h*r;break;case this.N_POLE:c=a+m,o=this.qp-o;break;case this.S_POLE:c=m-a,o=this.qp+o}if(Math.abs(c)<u)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),i=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*l-this.sinb1*h*r):(c=Math.sqrt(2/(1+h*r)))*l*this.ymf,t=this.xmf*c*h*s;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(c=Math.sqrt(o))*s,i=r*(this.mode===this.S_POLE?c:-c)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,s,n,o,l,h,c,d,p=e.x/this.a,f=e.y/this.a;if(this.sphere){var m,y=0,g=0;if(m=Math.sqrt(p*p+f*f),(i=.5*m)>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(i),y=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(m)<=u?0:Math.asin(f*g/m),p*=g,f=y*m;break;case this.OBLIQ:i=Math.abs(m)<=u?this.lat0:Math.asin(y*this.sinph0+f*g*this.cosph0/m),p*=g*this.cosph0,f=(y-Math.sin(i)*this.sinph0)*m;break;case this.N_POLE:f=-f,i=a-i;break;case this.S_POLE:i-=a}t=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))<u)return e.x=this.long0,e.y=this.lat0,e;s=2*Math.asin(.5*o/this.rq),r=Math.cos(s),p*=s=Math.sin(s),this.mode===this.OBLIQ?(l=r*this.sinb1+f*s*this.cosb1/o,n=this.qp*l,f=o*this.cosb1*r-f*this.sinb1*s):(l=f*s/o,n=this.qp*l,f=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),!(n=p*p+f*f))return e.x=this.long0,e.y=this.lat0,e;l=1-n/this.qp,this.mode===this.S_POLE&&(l=-l)}t=Math.atan2(p,f),h=Math.asin(l),c=this.apa,d=h+h,i=h+c[0]*Math.sin(d)+c[1]*Math.sin(d+d)+c[2]*Math.sin(d+d+d)}return e.x=U(this.long0+t),e.y=i,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Tt=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)},Et={init:function(){Math.abs(this.lat1+this.lat2)<u||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=B(this.e3,this.sin_po,this.cos_po),this.qs1=bt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=B(this.e3,this.sin_po,this.cos_po),this.qs2=bt(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=bt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>u?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=bt(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,n=this.ns0*U(t-this.long0),a=s*Math.sin(n)+this.x0,o=this.rh-s*Math.cos(n)+this.y0;return e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s,n,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),s=0,0!==t&&(s=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,i)),n=U(s/this.ns0+this.long0),e.x=n,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,s,n,a,o=Tt(.5*t);if(e<u)return o;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(o),r=Math.cos(o),a=.5*(n=1-(s=e*i)*s)*n/r*(t/(1-l)-i/n+.5/e*Math.log((1-s)/(1+s))),o+=a,Math.abs(a)<=1e-7)return o;return null}},Lt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,i,r,s,n,a,o,l=e.x,h=e.y;return r=U(l-this.long0),t=Math.sin(h),i=Math.cos(h),s=Math.cos(r),(n=this.sin_p14*t+this.cos_p14*i*s)>0||Math.abs(n)<=u?(a=this.x0+1*this.a*i*Math.sin(r)/n,o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*s)/n):(a=this.x0+this.infinity_dist*i*Math.sin(r),o=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*s)),e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s,n,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(s=Math.atan2(t,this.rc),i=Math.sin(s),r=Math.cos(s),a=Tt(r*this.sin_p14+e.y*i*this.cos_p14/t),n=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),n=U(this.long0+n)):(a=this.phic0,n=0),e.x=n,e.y=a,e},names:["gnom"]},Ot=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*a:a;for(var r,s,n,o,l=Math.asin(.5*t),h=0;h<30;h++)if(s=Math.sin(l),n=Math.cos(l),o=e*s,r=Math.pow(1-o*o,2)/(2*n)*(t/(1-e*e)-s/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),l+=r,Math.abs(r)<=1e-10)return l;return NaN},Pt={init:function(){this.sphere||(this.k0=B(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,s=e.y,n=U(r-this.long0);if(this.sphere)t=this.x0+this.a*n*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var a=bt(this.e,Math.sin(s));t=this.x0+this.a*this.k0*n,i=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=i,e},inverse:function(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=U(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Ot(this.e,2*e.y*this.k0/this.a),t=U(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]},Nt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,i=e.y,r=U(t-this.long0),s=yt(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*s,e},inverse:function(e){var t=e.x,i=e.y;return e.x=U(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=yt(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},It=20,Ft={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ct(this.es),this.e1=dt(this.es),this.e2=pt(this.es),this.e3=ft(this.es),this.ml0=this.a*ut(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,s=e.x,n=e.y,a=U(s-this.long0);if(r=a*Math.sin(n),this.sphere)Math.abs(n)<=u?(t=this.a*a,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(n),i=this.a*(yt(n-this.lat0)+(1-Math.cos(r))/Math.tan(n)));else if(Math.abs(n)<=u)t=this.a*a,i=-1*this.ml0;else{var o=mt(this.a,this.e,Math.sin(n))/Math.tan(n);t=o*Math.sin(r),i=this.a*ut(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,i,r,s,n,a,o,l,h;if(r=e.x-this.x0,s=e.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=u)t=U(r/this.a+this.long0),i=0;else{var c;for(a=this.lat0+s/this.a,o=r*r/this.a/this.a+a*a,l=a,n=It;n;--n)if(c=Math.tan(l),l+=h=-1*(a*(l*c+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),Math.abs(h)<=u){i=l;break}t=U(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(s+this.ml0)<=u)i=0,t=U(this.long0+r/this.a);else{var d,p,f,m,y;for(a=(this.ml0+s)/this.a,o=r*r/this.a/this.a+a*a,l=a,n=It;n;--n)if(y=this.e*Math.sin(l),d=Math.sqrt(1-y*y)*Math.tan(l),p=this.a*ut(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=p/this.a,h=(a*(d*m+1)-m-.5*d*(m*m+o))/(this.es*Math.sin(2*l)*(m*m+o-2*a*m)/(4*d)+(a-m)*(d*f-2/Math.sin(2*l))-f),l-=h,Math.abs(h)<=u){i=l;break}d=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=U(this.long0+Math.asin(r*d/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]},kt={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,i=e.x,r=e.y-this.lat0,s=i-this.long0,a=r/n*1e-5,o=s,l=1,h=0;for(t=1;t<=10;t++)l*=a,h+=this.A[t]*l;var u,c=h,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)u=f*c+p*d,p=p*c-f*d,f=u,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,s=e.y,a=r-this.x0,o=(s-this.y0)/this.a,l=a/this.a,h=1,u=0,c=0,d=0;for(t=1;t<=6;t++)i=u*o+h*l,h=h*o-u*l,u=i,c=c+this.C_re[t]*h-this.C_im[t]*u,d=d+this.C_im[t]*h+this.C_re[t]*u;for(var p=0;p<this.iterations;p++){var f,m=c,y=d,g=o,v=l;for(t=2;t<=6;t++)f=y*c+m*d,m=m*c-y*d,y=f,g+=(t-1)*(this.B_re[t]*m-this.B_im[t]*y),v+=(t-1)*(this.B_im[t]*m+this.B_re[t]*y);m=1,y=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=y*c+m*d,m=m*c-y*d,y=f,b+=t*(this.B_re[t]*m-this.B_im[t]*y),_+=t*(this.B_im[t]*m+this.B_re[t]*y);var S=b*b+_*_;c=(g*b+v*_)/S,d=(v*b-g*_)/S}var x=c,w=d,C=1,M=0;for(t=1;t<=9;t++)C*=x,M+=this.D[t]*C;var A=this.lat0+M*n*1e5,T=this.long0+w;return e.x=T,e.y=A,e},names:["New_Zealand_Map_Grid","nzmg"]},Dt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=U(t-this.long0),s=this.x0+this.a*r,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=s,e.y=n,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=U(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e},names:["Miller_Cylindrical","mill"]},Rt=20,Bt={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=je(this.es)},forward:function(e){var t,i,r=e.x,s=e.y;if(r=U(r-this.long0),this.sphere){if(this.m)for(var n=this.n*Math.sin(s),a=Rt;a;--a){var o=(this.m*s+Math.sin(s)-n)/(this.m+Math.cos(s));if(s-=o,Math.abs(o)<u)break}else s=1!==this.n?Math.asin(this.n*Math.sin(s)):s;t=this.a*this.C_x*r*(this.m+Math.cos(s)),i=this.a*this.C_y*s}else{var l=Math.sin(s),h=Math.cos(s);i=this.a*ze(s,l,h,this.en),t=this.a*r*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r,s;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=Tt((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Tt(Math.sin(t)/this.n)),r=U(r+this.long0),t=yt(t)):(t=Ve(e.y/this.a,this.es,this.en),(s=Math.abs(t))<a?(s=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(t)),r=U(i)):s-u<a&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]},Gt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=U(t-this.long0),s=i,n=Math.PI*Math.sin(i);;){var a=-(s+Math.sin(s)-n)/(1+Math.cos(s));if(s+=a,Math.abs(a)<u)break}s/=2,Math.PI/2-Math.abs(i)<u&&(r=0);var o=.900316316158*this.a*r*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return e.x=o,e.y=l,e},inverse:function(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var r=U(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var s=Math.asin(i);return e.x=r,e.y=s,e},names:["Mollweide","moll"]},Ut={init:function(){Math.abs(this.lat1+this.lat2)<u||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ct(this.es),this.e1=dt(this.es),this.e2=pt(this.es),this.e3=ft(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=B(this.e,this.sinphi,this.cosphi),this.ml1=ut(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<u?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=B(this.e,this.sinphi,this.cosphi),this.ml2=ut(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ut(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,i=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var s=ut(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-s)}var n=this.ns*U(i-this.long0),a=this.x0+t*Math.sin(n),o=this.y0+this.rh-t*Math.cos(n);return e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var n=0;if(0!==i&&(n=Math.atan2(t*e.x,t*e.y)),this.sphere)return s=U(this.long0+n/this.ns),r=yt(this.g-i/this.a),e.x=s,e.y=r,e;var a=this.g-i/this.a;return r=gt(a,this.e0,this.e1,this.e2,this.e3),s=U(this.long0+n/this.ns),e.x=s,e.y=r,e},names:["Equidistant_Conic","eqdc"]},jt={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,s=e.y,n=U(r-this.long0);Math.abs(s)<=u&&(t=this.x0+this.R*n,i=this.y0);var o=Tt(2*Math.abs(s/Math.PI));(Math.abs(n)<=u||Math.abs(Math.abs(s)-a)<=u)&&(t=this.x0,i=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var l=.5*Math.abs(Math.PI/n-n/Math.PI),h=l*l,c=Math.sin(o),d=Math.cos(o),p=d/(c+d-1),f=p*p,m=p*(2/c-1),y=m*m,g=Math.PI*this.R*(l*(p-y)+Math.sqrt(h*(p-y)*(p-y)-(y+h)*(f-y)))/(y+h);n<0&&(g=-g),t=this.x0+g;var v=h+p;return g=Math.PI*this.R*(m*v-l*Math.sqrt((y+h)*(h+1)-v*v))/(y+h),i=s>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,s,n,a,o,l,h,c,d,p,f;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,s=e.y/d,n=r*r+s*s,a=-Math.abs(s)*(1+n),f=s*s/(l=-2*a+1+2*s*s+n*n)+(2*(o=a-2*s*s+r*r)*o*o/l/l/l-9*a*o/l/l)/27,h=(a-o*o/3/l)/l,c=2*Math.sqrt(-h/3),d=3*f/h/c,Math.abs(d)>1&&(d=d>=0?1:-1),p=Math.acos(d)/3,i=e.y>=0?(-c*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI,t=Math.abs(r)<u?this.long0:U(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(r*r-s*s)+n*n))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},zt={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,s,n,o,l,h,c,d,p,f,m,y,g,v,b,_,S,x,w,C,M=e.x,A=e.y,T=Math.sin(e.y),E=Math.cos(e.y),L=U(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=u?(e.x=this.x0+this.a*(a-A)*Math.sin(L),e.y=this.y0-this.a*(a-A)*Math.cos(L),e):Math.abs(this.sin_p12+1)<=u?(e.x=this.x0+this.a*(a+A)*Math.sin(L),e.y=this.y0+this.a*(a+A)*Math.cos(L),e):(_=this.sin_p12*T+this.cos_p12*E*Math.cos(L),v=Math.acos(_),b=v?v/Math.sin(v):1,e.x=this.x0+this.a*b*E*Math.sin(L),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*E*Math.cos(L)),e):(t=ct(this.es),i=dt(this.es),r=pt(this.es),s=ft(this.es),Math.abs(this.sin_p12-1)<=u?(n=this.a*ut(t,i,r,s,a),o=this.a*ut(t,i,r,s,A),e.x=this.x0+(n-o)*Math.sin(L),e.y=this.y0-(n-o)*Math.cos(L),e):Math.abs(this.sin_p12+1)<=u?(n=this.a*ut(t,i,r,s,a),o=this.a*ut(t,i,r,s,A),e.x=this.x0+(n+o)*Math.sin(L),e.y=this.y0+(n+o)*Math.cos(L),e):(l=T/E,h=mt(this.a,this.e,this.sin_p12),c=mt(this.a,this.e,T),d=Math.atan((1-this.es)*l+this.es*h*this.sin_p12/(c*E)),p=Math.atan2(Math.sin(L),this.cos_p12*Math.tan(d)-this.sin_p12*Math.cos(L)),S=0===p?Math.asin(this.cos_p12*Math.sin(d)-this.sin_p12*Math.cos(d)):Math.abs(Math.abs(p)-Math.PI)<=u?-Math.asin(this.cos_p12*Math.sin(d)-this.sin_p12*Math.cos(d)):Math.asin(Math.sin(L)*Math.cos(d)/Math.sin(p)),f=this.e*this.sin_p12/Math.sqrt(1-this.es),m=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es),v=h*S*(1-(x=S*S)*(g=m*m)*(1-g)/6+(w=x*S)/8*(y=f*m)*(1-2*g)+(C=w*S)/120*(g*(4-7*g)-3*f*f*(1-7*g))-C*S/48*y),e.x=this.x0+v*Math.sin(p),e.y=this.y0+v*Math.cos(p),e))},inverse:function(e){var t,i,r,s,n,o,l,h,c,d,p,f,m,y,g,v,b,_,S,x,w,C,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*a*this.a)return;return i=t/this.a,r=Math.sin(i),s=Math.cos(i),n=this.long0,Math.abs(t)<=u?o=this.lat0:(o=Tt(s*this.sin_p12+e.y*r*this.cos_p12/t),l=Math.abs(this.lat0)-a,n=Math.abs(l)<=u?this.lat0>=0?U(this.long0+Math.atan2(e.x,-e.y)):U(this.long0-Math.atan2(-e.x,e.y)):U(this.long0+Math.atan2(e.x*r,t*this.cos_p12*s-e.y*this.sin_p12*r))),e.x=n,e.y=o,e}return h=ct(this.es),c=dt(this.es),d=pt(this.es),p=ft(this.es),Math.abs(this.sin_p12-1)<=u?(f=this.a*ut(h,c,d,p,a),t=Math.sqrt(e.x*e.x+e.y*e.y),o=gt((f-t)/this.a,h,c,d,p),n=U(this.long0+Math.atan2(e.x,-1*e.y)),e.x=n,e.y=o,e):Math.abs(this.sin_p12+1)<=u?(f=this.a*ut(h,c,d,p,a),t=Math.sqrt(e.x*e.x+e.y*e.y),o=gt((t-f)/this.a,h,c,d,p),n=U(this.long0+Math.atan2(e.x,e.y)),e.x=n,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),m=mt(this.a,this.e,this.sin_p12),v=Math.cos(g),b=this.e*this.cos_p12*v,_=-b*b/(1-this.es),S=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),w=(x=t/m)-_*(1+_)*Math.pow(x,3)/6-S*(1+3*_)*Math.pow(x,4)/24,C=1-_*w*w/2-x*w*w*w/6,y=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*v),n=U(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(y))),M=Math.sin(y),o=Math.atan2((M-this.es*C*this.sin_p12)*Math.tan(y),M*(1-this.es)),e.x=n,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]},Vt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,s,n,a,o,l=e.x,h=e.y;return r=U(l-this.long0),t=Math.sin(h),i=Math.cos(h),s=Math.cos(r),((n=this.sin_p14*t+this.cos_p14*i*s)>0||Math.abs(n)<=u)&&(a=1*this.a*i*Math.sin(r),o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*s)),e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s,n,o,l;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Tt(t/this.a),r=Math.sin(i),s=Math.cos(i),o=this.long0,Math.abs(t)<=u?(l=this.lat0,e.x=o,e.y=l,e):(l=Tt(s*this.sin_p14+e.y*r*this.cos_p14/t),n=Math.abs(this.lat0)-a,Math.abs(n)<=u?(o=this.lat0>=0?U(this.long0+Math.atan2(e.x,-e.y)):U(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=l,e):(o=U(this.long0+Math.atan2(e.x*r,t*this.cos_p14*s-e.y*this.sin_p14*r)),e.x=o,e.y=l,e))},names:["ortho"]},Jt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},qt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ht(e,t,i,r){var s;return e<u?(r.value=qt.AREA_0,s=0):(s=Math.atan2(t,i),Math.abs(s)<=p?r.value=qt.AREA_0:s>p&&s<=a+p?(r.value=qt.AREA_1,s-=a):s>a+p||s<=-(a+p)?(r.value=qt.AREA_2,s=s>=0?s-m:s+m):(r.value=qt.AREA_3,s+=a)),s}function Wt(e,t){var i=e+t;return i<-m?i+=f:i>+m&&(i-=f),i}var Yt,Xt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=a-p/2?this.face=Jt.TOP:this.lat0<=-(a-p/2)?this.face=Jt.BOTTOM:Math.abs(this.long0)<=p?this.face=Jt.FRONT:Math.abs(this.long0)<=a+p?this.face=this.long0>0?Jt.RIGHT:Jt.LEFT:this.face=Jt.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,i,r,s,n,o,l={x:0,y:0},h={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===Jt.TOP)s=a-t,i>=p&&i<=a+p?(h.value=qt.AREA_0,r=i-a):i>a+p||i<=-(a+p)?(h.value=qt.AREA_1,r=i>0?i-m:i+m):i>-(a+p)&&i<=-p?(h.value=qt.AREA_2,r=i+a):(h.value=qt.AREA_3,r=i);else if(this.face===Jt.BOTTOM)s=a+t,i>=p&&i<=a+p?(h.value=qt.AREA_0,r=-i+a):i<p&&i>=-p?(h.value=qt.AREA_1,r=-i):i<-p&&i>=-(a+p)?(h.value=qt.AREA_2,r=-i-a):(h.value=qt.AREA_3,r=i>0?-i+m:-i-m);else{var u,c,d,f,y,g,v;this.face===Jt.RIGHT?i=Wt(i,+a):this.face===Jt.BACK?i=Wt(i,+m):this.face===Jt.LEFT&&(i=Wt(i,-a)),f=Math.sin(t),y=Math.cos(t),g=Math.sin(i),v=Math.cos(i),u=y*v,c=y*g,d=f,this.face===Jt.FRONT?(s=Math.acos(u),r=Ht(s,d,c,h)):this.face===Jt.RIGHT?(s=Math.acos(c),r=Ht(s,d,-u,h)):this.face===Jt.BACK?(s=Math.acos(-u),r=Ht(s,d,-c,h)):this.face===Jt.LEFT?(s=Math.acos(-c),r=Ht(s,d,u,h)):(s=r=0,h.value=qt.AREA_0)}return o=Math.atan(12/m*(r+Math.acos(Math.sin(r)*Math.cos(p))-a)),n=Math.sqrt((1-Math.cos(s))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===qt.AREA_1?o+=a:h.value===qt.AREA_2?o+=m:h.value===qt.AREA_3&&(o+=1.5*m),l.x=n*Math.cos(o),l.y=n*Math.sin(o),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,e.x=l.x,e.y=l.y,e},inverse:function(e){var t,i,r,s,n,o,l,h,u,c,d,p,f={lam:0,phi:0},y={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?y.value=qt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(y.value=qt.AREA_1,t-=a):e.x<0&&-e.x>=Math.abs(e.y)?(y.value=qt.AREA_2,t=t<0?t+m:t-m):(y.value=qt.AREA_3,t+=a),u=m/12*Math.tan(t),n=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),o=Math.atan(n),r=Math.cos(t),s=Math.tan(i),(l=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?l=-1:l>1&&(l=1),this.face===Jt.TOP)h=Math.acos(l),f.phi=a-h,y.value===qt.AREA_0?f.lam=o+a:y.value===qt.AREA_1?f.lam=o<0?o+m:o-m:y.value===qt.AREA_2?f.lam=o-a:f.lam=o;else if(this.face===Jt.BOTTOM)h=Math.acos(l),f.phi=h-a,y.value===qt.AREA_0?f.lam=-o+a:y.value===qt.AREA_1?f.lam=-o:y.value===qt.AREA_2?f.lam=-o-a:f.lam=o<0?-o-m:-o+m;else{var g,v,b;b=(u=(g=l)*g)>=1?0:Math.sqrt(1-u)*Math.sin(o),v=(u+=b*b)>=1?0:Math.sqrt(1-u),y.value===qt.AREA_1?(u=v,v=-b,b=u):y.value===qt.AREA_2?(v=-v,b=-b):y.value===qt.AREA_3&&(u=v,v=b,b=-u),this.face===Jt.RIGHT?(u=g,g=-v,v=u):this.face===Jt.BACK?(g=-g,v=-v):this.face===Jt.LEFT&&(u=g,g=v,v=-u),f.phi=Math.acos(-b)-a,f.lam=Math.atan2(v,g),this.face===Jt.RIGHT?f.lam=Wt(f.lam,-a):this.face===Jt.BACK?f.lam=Wt(f.lam,-m):this.face===Jt.LEFT&&(f.lam=Wt(f.lam,+a))}0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(f.phi=-f.phi));return f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Qt=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Zt=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Kt=.8487,$t=1.3523,ei=d/5,ti=1/ei,ii=18,ri=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},si=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])},ni={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=U(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*ei);r<0?r=0:r>=ii&&(r=ii-1),i=d*(i-ti*r);var s={x:ri(Qt[r],i)*t,y:ri(Zt[r],i)};return e.y<0&&(s.y=-s.y),s.x=s.x*this.a*Kt+this.x0,s.y=s.y*this.a*$t+this.y0,s},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Kt),y:Math.abs(e.y-this.y0)/(this.a*$t)};if(t.y>=1)t.x/=Qt[ii][0],t.y=e.y<0?-a:a;else{var i=Math.floor(t.y*ii);for(i<0?i=0:i>=ii&&(i=ii-1);;)if(Zt[i][0]>t.y)--i;else{if(!(Zt[i+1][0]<=t.y))break;++i}var r=Zt[i],s=5*(t.y-r[0])/(Zt[i+1][0]-r[0]);s=function(e,t,i,r){for(var s=t;r;--r){var n=e(s);if(s-=n,Math.abs(n)<i)break}return s}(function(e){return(ri(r,e)-t.y)/si(r,e)},s,u,100),t.x/=ri(Qt[i],s),t.y=(5*i+s)*c,e.y<0&&(t.y=-t.y)}return t.x=U(t.x+this.long0),t},names:["Robinson","robin"]},ai={init:function(){this.name="geocent"},forward:function(e){return ae(e,this.es,this.a)},inverse:function(e){return oe(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},oi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},li={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},hi={init:function(){if(Object.keys(li).forEach(function(e){if(void 0===this[e])this[e]=li[e].def;else{if(li[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);li[e].num&&(this[e]=parseFloat(this[e]))}li[e].degrees&&(this[e]=this[e]*c)}.bind(this)),Math.abs(Math.abs(this.lat0)-a)<u?this.mode=this.lat0<0?oi.S_POLE:oi.N_POLE:Math.abs(this.lat0)<u?this.mode=oi.EQUIT:(this.mode=oi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,i,r,s,n=Math.sin(e.y),a=Math.cos(e.y),o=Math.cos(e.x);switch(this.mode){case oi.OBLIQ:i=this.sinph0*n+this.cosph0*a*o;break;case oi.EQUIT:i=a*o;break;case oi.S_POLE:i=-n;break;case oi.N_POLE:i=n}switch(i=this.pn1/(this.p-i),t=i*a*Math.sin(e.x),this.mode){case oi.OBLIQ:i*=this.cosph0*n-this.sinph0*a*o;break;case oi.EQUIT:i*=n;break;case oi.N_POLE:i*=-a*o;break;case oi.S_POLE:i*=a*o}return r=i*this.cg+t*this.sg,s=1/(r*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*s,i=r*s,e.x=t*this.a,e.y=i*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,i,r,s={x:e.x,y:e.y};r=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*r,i=this.pn1*e.y*this.cw*r,e.x=t*this.cg+i*this.sg,e.y=i*this.cg-t*this.sg;var n=He(e.x,e.y);if(Math.abs(n)<u)s.x=0,s.y=e.y;else{var a,o;switch(o=1-n*n*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/n+n/this.pn1),a=Math.sqrt(1-o*o),this.mode){case oi.OBLIQ:s.y=Math.asin(a*this.sinph0+e.y*o*this.cosph0/n),e.y=(a-this.sinph0*Math.sin(s.y))*n,e.x*=o*this.cosph0;break;case oi.EQUIT:s.y=Math.asin(e.y*o/n),e.y=a*n,e.x*=o;break;case oi.N_POLE:s.y=Math.asin(a),e.y=-e.y;break;case oi.S_POLE:s.y=-Math.asin(a)}s.x=Math.atan2(e.x,e.y)}return e.x=s.x+this.long0,e.y=s.y,e},names:["Tilted_Perspective","tpers"]},ui={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,i,r,s,n=e.x,a=e.y;if(n-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var o=this.radius_p/He(this.radius_p*Math.cos(a),Math.sin(a));if(i=o*Math.cos(n)*Math.cos(a),r=o*Math.sin(n)*Math.cos(a),s=o*Math.sin(a),(this.radius_g-i)*i-r*r-s*s*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/He(s,t)),e.y=this.radius_g_1*Math.atan(s/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(s/He(r,t)))}else"sphere"===this.shape&&(t=Math.cos(a),i=Math.cos(n)*t,r=Math.sin(n)*t,s=Math.sin(a),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/He(s,t)),e.y=this.radius_g_1*Math.atan(s/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(s/He(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,s,n=-1,a=0,o=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*He(1,o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*He(1,a));var l=o/this.radius_p;if(t=a*a+l*l+n*n,i=2*this.radius_g*n,(r=i*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+s*n,a*=s,o*=s,e.x=Math.atan2(a,n),e.y=Math.atan(o*Math.cos(e.x)/n),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+o*o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+o*o+n*n,i=2*this.radius_g*n,(r=i*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+s*n,a*=s,o*=s,e.x=Math.atan2(a,n),e.y=Math.atan(o*Math.cos(e.x)/n)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};return Se.defaultDatum="WGS84",Se.Proj=ne,Se.WGS84=new Se.Proj("WGS84"),Se.Point=Ge,Se.toPoint=fe,Se.defs=I,Se.nadgrid=function(e,t){var i=new DataView(t),r=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),s=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:te(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,r);s.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n=function(e,t,i){for(var r=[],s=0;s<t.nSubgrids;s++){var n=re(e,176,i),a=se(e,176,n,i),o=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),l=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[ee(n.lowerLongitude),ee(n.lowerLatitude)],del:[ee(n.longitudeInterval),ee(n.latitudeInterval)],lim:[o,l],count:n.gridNodeCount,cvs:ie(a)})}return r}(i,s,r),a={header:s,subgrids:n};return K[e]=a,a},Se.transform=ge,Se.mgrs=Oe,Se.version="2.9.0",(Yt=Se).Proj.projections.add(Je),Yt.Proj.projections.add(Ze),Yt.Proj.projections.add($e),Yt.Proj.projections.add(rt),Yt.Proj.projections.add(st),Yt.Proj.projections.add(nt),Yt.Proj.projections.add(ot),Yt.Proj.projections.add(lt),Yt.Proj.projections.add(ht),Yt.Proj.projections.add(vt),Yt.Proj.projections.add(At),Yt.Proj.projections.add(Et),Yt.Proj.projections.add(Lt),Yt.Proj.projections.add(Pt),Yt.Proj.projections.add(Nt),Yt.Proj.projections.add(Ft),Yt.Proj.projections.add(kt),Yt.Proj.projections.add(Dt),Yt.Proj.projections.add(Bt),Yt.Proj.projections.add(Gt),Yt.Proj.projections.add(Ut),Yt.Proj.projections.add(jt),Yt.Proj.projections.add(zt),Yt.Proj.projections.add(Vt),Yt.Proj.projections.add(Xt),Yt.Proj.projections.add(ni),Yt.Proj.projections.add(ai),Yt.Proj.projections.add(hi),Yt.Proj.projections.add(ui),Se}()},107:function(e,t,i){!function(){"use strict";function e(e){var t=this.constructor;return this.then(function(i){return t.resolve(e()).then(function(){return i})},function(i){return t.resolve(e()).then(function(){return t.reject(i)})})}function t(e){return new this(function(t,i){if(!e||void 0===e.length)return i(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var s=r.length;function n(e,i){if(i&&("object"==typeof i||"function"==typeof i)){var a=i.then;if("function"==typeof a)return void a.call(i,function(t){n(e,t)},function(i){r[e]={status:"rejected",reason:i},0==--s&&t(r)})}r[e]={status:"fulfilled",value:i},0==--s&&t(r)}for(var a=0;a<r.length;a++)n(a,r[a])})}var r=setTimeout;function s(e){return Boolean(e&&void 0!==e.length)}function n(){}function a(e){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn(function(){var i=1===e._state?t.onFulfilled:t.onRejected;if(null!==i){var r;try{r=i(e._value)}catch(e){return void h(t.promise,e)}l(t.promise,r)}else(1===e._state?l:h)(t.promise,e._value)})):e._deferreds.push(t)}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var i=t.then;if(t instanceof a)return e._state=3,e._value=t,void u(e);if("function"==typeof i)return void c((r=i,s=t,function(){r.apply(s,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){h(e,t)}var r,s}function h(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&a._immediateFn(function(){e._handled||a._unhandledRejectionFn(e._value)});for(var t=0,i=e._deferreds.length;t<i;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t){var i=!1;try{e(function(e){i||(i=!0,l(t,e))},function(e){i||(i=!0,h(t,e))})}catch(e){if(i)return;i=!0,h(t,e)}}a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var i=new this.constructor(n);return o(this,new function(e,t,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=i}(e,t,i)),i},a.prototype.finally=e,a.all=function(e){return new a(function(t,i){if(!s(e))return i(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var n=r.length;function a(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var o=s.then;if("function"==typeof o)return void o.call(s,function(t){a(e,t)},i)}r[e]=s,0==--n&&t(r)}catch(e){i(e)}}for(var o=0;o<r.length;o++)a(o,r[o])})},a.allSettled=t,a.resolve=function(e){return e&&"object"==typeof e&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(e){return new a(function(t,i){i(e)})},a.race=function(e){return new a(function(t,i){if(!s(e))return i(new TypeError("Promise.race accepts an array"));for(var r=0,n=e.length;r<n;r++)a.resolve(e[r]).then(t,i)})},a._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){r(e,0)},a._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var d=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i.g)return i.g;throw new Error("unable to locate global object")}();"function"!=typeof d.Promise?d.Promise=a:(d.Promise.prototype.finally||(d.Promise.prototype.finally=e),d.Promise.allSettled||(d.Promise.allSettled=t))}()},166:function(e){e.exports=function(){"use strict";function e(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function t(e,t){return e<t?-1:e>t?1:0}return function(i,r,s,n,a){!function t(i,r,s,n,a){for(;n>s;){if(n-s>600){var o=n-s+1,l=r-s+1,h=Math.log(o),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(o-u)/o)*(l-o/2<0?-1:1),d=Math.max(s,Math.floor(r-l*u/o+c)),p=Math.min(n,Math.floor(r+(o-l)*u/o+c));t(i,r,d,p,a)}var f=i[r],m=s,y=n;for(e(i,s,r),a(i[n],f)>0&&e(i,s,n);m<y;){for(e(i,m,y),m++,y--;a(i[m],f)<0;)m++;for(;a(i[y],f)>0;)y--}0===a(i[s],f)?e(i,s,y):e(i,++y,n),y<=r&&(s=y+1),r<=y&&(n=y-1)}}(i,r,s||0,n||i.length-1,a||t)}}()},510:(e,t,i)=>{"use strict";e.exports=s,e.exports.default=s;var r=i(166);function s(e,t){if(!(this instanceof s))return new s(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function n(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function a(e,t){o(e,0,e.children.length,t,e)}function o(e,t,i,r,s){s||(s=m(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var n,a=t;a<i;a++)n=e.children[a],l(s,e.leaf?r(n):n);return s}function l(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function h(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function f(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,i,s,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=s||(a=t+Math.ceil((i-t)/s/2)*s,r(e,a,t,i,n),o.push(t,a,a,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!f(e,t))return i;for(var s,n,a,o,l=[];t;){for(s=0,n=t.children.length;s<n;s++)a=t.children[s],f(e,o=t.leaf?r(a):a)&&(t.leaf?i.push(a):p(e,o)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!f(e,t))return!1;for(var r,s,n,a,o=[];t;){for(r=0,s=t.children.length;r<s;r++)if(n=t.children[r],f(e,a=t.leaf?i(n):n)){if(t.leaf||p(e,a))return!0;o.push(n)}t=o.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var s=this.data;this.data=r,r=s}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(e,t){if(!e)return this;for(var i,r,s,a,o=this.data,l=this.toBBox(e),h=[],u=[];o||h.length;){if(o||(o=h.pop(),r=h[h.length-1],i=u.pop(),a=!0),o.leaf&&-1!==(s=n(e,o.children,t)))return o.children.splice(s,1),h.push(o),this._condense(h),this;a||o.leaf||!p(o,l)?r?(i++,o=r.children[i],a=!1):o=null:(h.push(o),u.push(i),i=0,r=o,o=o.children[0])}return this},toBBox:function(e){return e},compareMinX:h,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var s,n=i-t+1,o=this._maxEntries;if(n<=o)return a(s=m(e.slice(t,i+1)),this.toBBox),s;r||(r=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,r-1))),(s=m([])).leaf=!1,s.height=r;var l,h,u,c,d=Math.ceil(n/o),p=d*Math.ceil(Math.sqrt(o));for(y(e,t,i,p,this.compareMinX),l=t;l<=i;l+=p)for(y(e,l,u=Math.min(l+p-1,i),d,this.compareMinY),h=l;h<=u;h+=d)c=Math.min(h+d-1,u),s.children.push(this._build(e,h,c,r-1));return a(s,this.toBBox),s},_chooseSubtree:function(e,t,i,r){for(var s,n,a,o,l,h,u,d,p,f;r.push(t),!t.leaf&&r.length-1!==i;){for(u=d=1/0,s=0,n=t.children.length;s<n;s++)l=c(a=t.children[s]),p=e,f=a,(h=(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l)<d?(d=h,u=l<u?l:u,o=a):h===d&&l<u&&(u=l,o=a);t=o||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,s=i?e:r(e),n=[],a=this._chooseSubtree(s,this.data,t,n);for(a.children.push(e),l(a,s);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(s,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=m(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,s,n,a,l,h,u,d,p,f,m,y,g,v;for(h=u=1/0,r=t;r<=i-t;r++)s=o(e,0,r,this.toBBox),n=o(e,r,i,this.toBBox),p=s,f=n,void 0,void 0,void 0,void 0,m=Math.max(p.minX,f.minX),y=Math.max(p.minY,f.minY),g=Math.min(p.maxX,f.maxX),v=Math.min(p.maxY,f.maxY),a=Math.max(0,g-m)*Math.max(0,v-y),l=c(s)+c(n),a<h?(h=a,d=r,u=l<u?l:u):a===h&&l<u&&(u=l,d=r);return d},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:h,s=e.leaf?this.compareMinY:u;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,s)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var s,n,a=this.toBBox,h=o(e,0,t,a),u=o(e,i-t,i,a),c=d(h)+d(u);for(s=t;s<i-t;s++)n=e.children[s],l(h,e.leaf?a(n):n),c+=d(h);for(s=i-t-1;s>=t;s--)n=e.children[s],l(u,e.leaf?a(n):n),c+=d(u);return c},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)l(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():a(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},901:function(e){e.exports=function(){"use strict";var e=new Uint8Array(0);function t(t){this._source=t,this._array=e,this._index=0}return t.prototype.read=function(){var t=this,i=t._array.subarray(t._index);return t._source.read().then(function(r){return t._array=e,t._index=0,r.done?i.length>0?{done:!1,value:i}:{done:!0,value:void 0}:{done:!1,value:function(e,t){if(!e.length)return t;if(!t.length)return e;var i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}(i,r.value)}})},t.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var i=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var s=new Uint8Array(t);return s.set(this._array.subarray(this._index)),function n(){return i._source.read().then(function(a){return a.done?(i._array=e,i._index=0,r>0?s.subarray(0,r):null):r+a.value.length>=t?(i._array=a.value,i._index=t-r,s.set(a.value.subarray(0,t-r),r),s):(s.set(a.value,r),r+=a.value.length,n())})}()},t.prototype.cancel=function(){return this._source.cancel()},function(e){return"function"==typeof e.slice?e:new t("function"==typeof e.read?e:e.getReader())}}()},982:(e,t)=>{"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function r(e,t,i,r){return new(i||(i=Promise))(function(s,n){function a(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})}function s(e,t){var i,r,s,n,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(s=2&n[0]?r.return:n[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,n[1])).done)return s;switch(r=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(s=(s=a.trys).length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){a.label=n[1];break}if(6===n[0]&&a.label<s[1]){a.label=s[1],s=n;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(n);break}s[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],r=0}finally{i=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}}function n(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e){return this instanceof a?(this.v=e,this):new a(e)}function o(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=i.apply(e,t||[]),n=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){s[e]&&(r[e]=function(t){return new Promise(function(i,r){n.push([e,t,i,r])>1||l(e,t)})})}function l(e,t){try{(i=s[e](t)).value instanceof a?Promise.resolve(i.value.v).then(h,u):c(n[0][2],i)}catch(e){c(n[0][3],e)}var i}function h(e){l("next",e)}function u(e){l("throw",e)}function c(e,t){e(t),n.shift(),n.length&&l(n[0][0],n[0][1])}}var l=function(e){function t(t){var i=e.call(this,t)||this;return Object.defineProperty(i,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(i,i.constructor.prototype):i.__proto__=i.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error),h=function(){function e(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),e.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}(),u=function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}(),c=function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){this._q.length<this._c&&this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}();function d(e){null!=e&&"function"==typeof e.then&&e.then(b,b)}var p=0,f=1,m=2,y=3,g=4,v=1024,b=function(){};function _(e){var t=e.err,i=Promise.resolve(e.execution).then(function(e){if(null!=t)throw t;return e});return e.err=void 0,e.execution=i.then(function(){},function(){}),void 0===e.pending?i:e.pending.then(function(){return i})}function S(e,t){var i=e.state>=y;return Promise.resolve(t).then(function(t){return!i&&e.state>=g?_(e).then(function(e){return{value:e,done:!0}}):{value:t,done:i}})}function x(e,t){var i,r;if(!(e.state>=m))if(e.state=m,e.onnext(),e.onstop(),null==e.err&&(e.err=t),0!==e.pushes.length||void 0!==e.buffer&&!e.buffer.empty)try{for(var s=n(e.pushes),a=s.next();!a.done;a=s.next()){a.value.resolve()}}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}else w(e)}function w(e){var t,i;if(!(e.state>=y)){e.state<m&&x(e),e.state=y,e.buffer=void 0;try{for(var r=n(e.nexts),s=r.next();!s.done;s=r.next()){var a=s.value,o=void 0===e.pending?_(e):e.pending.then(function(){return _(e)});a.resolve(S(e,o))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}e.pushes=[],e.nexts=[]}}function C(e){e.state>=g||(e.state<y&&w(e),e.state=g)}function M(e){if(!(e.state>=f)){e.state=f;var t=function(e,t){if(d(t),e.pushes.length>=v)throw new l("No more than "+v+" pending calls to push are allowed on a single repeater.");if(e.state>=m)return Promise.resolve(void 0);var i,r=void 0===e.pending?Promise.resolve(t):e.pending.then(function(){return t});r=r.catch(function(t){e.state<m&&(e.err=t),C(e)}),e.nexts.length?(e.nexts.shift().resolve(S(e,r)),i=e.nexts.length?Promise.resolve(e.nexts[0].value):new Promise(function(t){return e.onnext=t})):void 0===e.buffer||e.buffer.full?i=new Promise(function(t){return e.pushes.push({resolve:t,value:r})}):(e.buffer.add(r),i=Promise.resolve(void 0));var s=!0,n={},a=i.catch(function(e){if(s)throw e});return n.then=function(e,t){return s=!1,Promise.prototype.then.call(i,e,t)},n.catch=function(e){return s=!1,Promise.prototype.catch.call(i,e)},n.finally=i.finally.bind(i),e.pending=r.then(function(){return a}).catch(function(t){e.err=t,C(e)}),n}.bind(null,e),i=function(e){var t=x.bind(null,e),i=new Promise(function(t){return e.onstop=t});return t.then=i.then.bind(i),t.catch=i.catch.bind(i),t.finally=i.finally.bind(i),t}(e);e.execution=new Promise(function(r){return r(e.executor(t,i))}),e.execution.catch(function(){return x(e)})}}var A=new WeakMap,T=function(){function e(e,t){A.set(this,{executor:e,buffer:t,err:void 0,state:p,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:b,onstop:b})}return e.prototype.next=function(e){d(e);var t=A.get(this);if(void 0===t)throw new Error("WeakMap error");if(t.nexts.length>=v)throw new l("No more than "+v+" pending calls to next are allowed on a single repeater.");if(t.state<=p&&M(t),t.onnext(e),void 0!==t.buffer&&!t.buffer.empty){var i=S(t,t.buffer.remove());if(t.pushes.length){var r=t.pushes.shift();t.buffer.add(r.value),t.onnext=r.resolve}return i}if(t.pushes.length){var s=t.pushes.shift();return t.onnext=s.resolve,S(t,s.value)}return t.state>=m?(w(t),S(t,_(t))):new Promise(function(i){return t.nexts.push({resolve:i,value:e})})},e.prototype.return=function(e){d(e);var t=A.get(this);if(void 0===t)throw new Error("WeakMap error");return w(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),S(t,_(t))},e.prototype.throw=function(e){var t=A.get(this);if(void 0===t)throw new Error("WeakMap error");return t.state<=p||t.state>=m||void 0!==t.buffer&&!t.buffer.empty?(w(t),null==t.err&&(t.err=e),S(t,_(t))):this.next(Promise.reject(e))},e.prototype[Symbol.asyncIterator]=function(){return this},e.race=L,e.merge=O,e.zip=P,e.latest=N,e}();function E(e,t){var i,r,l=[],h=function(e){null!=e&&"function"==typeof e[Symbol.asyncIterator]?l.push(e[Symbol.asyncIterator]()):null!=e&&"function"==typeof e[Symbol.iterator]?l.push(e[Symbol.iterator]()):l.push(function(){return o(this,arguments,function(){return s(this,function(i){switch(i.label){case 0:return t.yieldValues?[4,a(e)]:[3,3];case 1:return[4,i.sent()];case 2:i.sent(),i.label=3;case 3:return t.returnValues?[4,a(e)]:[3,5];case 4:return[2,i.sent()];case 5:return[2]}})})}())};try{for(var u=n(e),c=u.next();!c.done;c=u.next()){h(c.value)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}return l}function L(e){var t=this,i=E(e,{returnValues:!0});return new T(function(e,a){return r(t,void 0,void 0,function(){var t,r,o,l,h,u;return s(this,function(c){switch(c.label){case 0:if(!i.length)return a(),[2];r=!1,a.then(function(){t(),r=!0}),c.label=1;case 1:c.trys.push([1,,5,7]),l=void 0,h=0,u=function(){var r,u,c,d,p,f;return s(this,function(s){switch(s.label){case 0:r=h;try{for(p=void 0,u=n(i),c=u.next();!c.done;c=u.next())d=c.value,Promise.resolve(d.next()).then(function(e){e.done?(a(),void 0===o&&(o=e)):h===r&&(h++,t(e))},function(e){return a(e)})}catch(e){p={error:e}}finally{try{c&&!c.done&&(f=u.return)&&f.call(u)}finally{if(p)throw p.error}}return[4,new Promise(function(e){return t=e})];case 1:return void 0===(l=s.sent())?[3,3]:[4,e(l.value)];case 2:s.sent(),s.label=3;case 3:return[2]}})},c.label=2;case 2:return r?[3,4]:[5,u()];case 3:return c.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return a(),[4,Promise.race(i.map(function(e){return e.return&&e.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}function O(e){var t=this,i=E(e,{yieldValues:!0});return new T(function(e,a){return r(t,void 0,void 0,function(){var t,o,l,h=this;return s(this,function(u){switch(u.label){case 0:if(!i.length)return a(),[2];t=[],o=!1,a.then(function(){var e,i;o=!0;try{for(var r=n(t),s=r.next();!s.done;s=r.next()){(0,s.value)()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,Promise.all(i.map(function(i,n){return r(h,void 0,void 0,function(){var r;return s(this,function(s){switch(s.label){case 0:s.trys.push([0,,6,9]),s.label=1;case 1:return o?[3,5]:(Promise.resolve(i.next()).then(function(e){return t[n](e)},function(e){return a(e)}),[4,new Promise(function(e){t[n]=e})]);case 2:return void 0===(r=s.sent())?[3,4]:r.done?(l=r,[2]):[4,e(r.value)];case 3:s.sent(),s.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return i.return?[4,i.return()]:[3,8];case 7:s.sent(),s.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return u.sent(),[2,l&&l.value];case 3:return a(),[7];case 4:return[2]}})})})}function P(e){var t=this,i=E(e,{returnValues:!0});return new T(function(e,n){return r(t,void 0,void 0,function(){var t,r,a,o;return s(this,function(s){switch(s.label){case 0:if(!i.length)return n(),[2,[]];r=!1,n.then(function(){t(),r=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return r?[3,5]:(Promise.all(i.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return n(e)}),[4,new Promise(function(e){return t=e})]);case 3:return void 0===(a=s.sent())?[2]:(o=a.map(function(e){return e.value}),a.some(function(e){return e.done})?[2,o]:[4,e(o)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(i.map(function(e){return e.return&&e.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function N(e){var t=this,i=E(e,{yieldValues:!0,returnValues:!0});return new T(function(e,a){return r(t,void 0,void 0,function(){var t,o,l,h,u,c=this;return s(this,function(d){switch(d.label){case 0:if(!i.length)return a(),[2,[]];o=[],l=!1,a.then(function(){var e,i;t();try{for(var r=n(o),s=r.next();!s.done;s=r.next()){(0,s.value)()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}l=!0}),d.label=1;case 1:return d.trys.push([1,,5,7]),Promise.all(i.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return a(e)}),[4,new Promise(function(e){return t=e})];case 2:return void 0===(h=d.sent())?[2]:(u=h.map(function(e){return e.value}),h.every(function(e){return e.done})?[2,u]:[4,e(u.slice())]);case 3:return d.sent(),[4,Promise.all(i.map(function(t,i){return r(c,void 0,void 0,function(){var r;return s(this,function(s){switch(s.label){case 0:if(h[i].done)return[2,h[i].value];s.label=1;case 1:return l?[3,4]:(Promise.resolve(t.next()).then(function(e){return o[i](e)},function(e){return a(e)}),[4,new Promise(function(e){return o[i]=e})]);case 2:return void 0===(r=s.sent())?[2,h[i].value]:r.done?[2,r.value]:(u[i]=r.value,[4,e(u.slice())]);case 3:return s.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,d.sent()];case 5:return a(),[4,Promise.all(i.map(function(e){return e.return&&e.return()}))];case 6:return d.sent(),[7];case 7:return[2]}})})})}t.ZN=T}},t={};function i(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t}),i.d=((e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),i.nmd=(e=>(e.paths=[],e.children||(e.children=[]),e)),(()=>{"use strict";var e=window.SuperMap=window.SuperMap||{};e.Components=window.SuperMap.Components||{};var t={GEOJSON:"GEOJSON",ISERVER:"ISERVER",FGB:"FGB"},r={ISERVER:"ISERVER",IPORTAL:"IPORTAL",ONLINE:"ONLINE"},s={LINE:"LINE",LINEM:"LINEM",POINT:"POINT",REGION:"REGION",POINTEPS:"POINTEPS",LINEEPS:"LINEEPS",REGIONEPS:"REGIONEPS",ELLIPSE:"ELLIPSE",CIRCLE:"CIRCLE",TEXT:"TEXT",RECTANGLE:"RECTANGLE",UNKNOWN:"UNKNOWN",GEOCOMPOUND:"GEOCOMPOUND"},n={ATTRIBUTE:"ATTRIBUTE",ATTRIBUTEANDGEOMETRY:"ATTRIBUTEANDGEOMETRY",GEOMETRY:"GEOMETRY"},a={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"},o={DISTANCE:"DISTANCE",AREA:"AREA"},l={METER:"METER",KILOMETER:"KILOMETER",MILE:"MILE",YARD:"YARD",DEGREE:"DEGREE",MILLIMETER:"MILLIMETER",CENTIMETER:"CENTIMETER",INCH:"INCH",DECIMETER:"DECIMETER",FOOT:"FOOT",SECOND:"SECOND",MINUTE:"MINUTE",RADIAN:"RADIAN"},h={CENTIMETER:"CENTIMETER",DECIMETER:"DECIMETER",FOOT:"FOOT",INCH:"INCH",KILOMETER:"KILOMETER",METER:"METER",MILE:"MILE",MILLIMETER:"MILLIMETER",YARD:"YARD"},u={CAPTION:"CAPTION",CAPTION_PERCENT:"CAPTION_PERCENT",CAPTION_VALUE:"CAPTION_VALUE",PERCENT:"PERCENT",VALUE:"VALUE"},c={AREA:"AREA",BAR:"BAR",BAR3D:"BAR3D",LINE:"LINE",PIE:"PIE",PIE3D:"PIE3D",POINT:"POINT",RING:"RING",ROSE:"ROSE",ROSE3D:"ROSE3D",STACK_BAR:"STACK_BAR",STACK_BAR3D:"STACK_BAR3D",STEP:"STEP"},d={ALL:"ALL",NONE:"NONE",YAXES:"YAXES"},p={CONSTANT:"CONSTANT",LOGARITHM:"LOGARITHM",SQUAREROOT:"SQUAREROOT"},f={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"},m={BLACK_WHITE:"BLACKWHITE",BLUE_BLACK:"BLUEBLACK",BLUE_RED:"BLUERED",BLUE_WHITE:"BLUEWHITE",CYAN_BLACK:"CYANBLACK",CYAN_BLUE:"CYANBLUE",CYAN_GREEN:"CYANGREEN",CYAN_WHITE:"CYANWHITE",GREEN_BLACK:"GREENBLACK",GREEN_BLUE:"GREENBLUE",GREEN_ORANGE_VIOLET:"GREENORANGEVIOLET",GREEN_RED:"GREENRED",GREEN_WHITE:"GREENWHITE",PINK_BLACK:"PINKBLACK",PINK_BLUE:"PINKBLUE",PINK_RED:"PINKRED",PINK_WHITE:"PINKWHITE",RAIN_BOW:"RAINBOW",RED_BLACK:"REDBLACK",RED_WHITE:"REDWHITE",SPECTRUM:"SPECTRUM",TERRAIN:"TERRAIN",YELLOW_BLACK:"YELLOWBLACK",YELLOW_BLUE:"YELLOWBLUE",YELLOW_GREEN:"YELLOWGREEN",YELLOW_RED:"YELLOWRED",YELLOW_WHITE:"YELLOWWHITE"},y={TOPLEFT:"TOPLEFT",TOPCENTER:"TOPCENTER",TOPRIGHT:"TOPRIGHT",BASELINELEFT:"BASELINELEFT",BASELINECENTER:"BASELINECENTER",BASELINERIGHT:"BASELINERIGHT",BOTTOMLEFT:"BOTTOMLEFT",BOTTOMCENTER:"BOTTOMCENTER",BOTTOMRIGHT:"BOTTOMRIGHT",MIDDLELEFT:"MIDDLELEFT",MIDDLECENTER:"MIDDLECENTER",MIDDLERIGHT:"MIDDLERIGHT"},g={NORMAL:"ALONG_LINE_NORMAL",LB_TO_RT:"LEFT_BOTTOM_TO_RIGHT_TOP",LT_TO_RB:"LEFT_TOP_TO_RIGHT_BOTTOM",RB_TO_LT:"RIGHT_BOTTOM_TO_LEFT_TOP",RT_TO_LB:"RIGHT_TOP_TO_LEFT_BOTTOM"},v={DIAMOND:"DIAMOND",ELLIPSE:"ELLIPSE",MARKER:"MARKER",NONE:"NONE",RECT:"RECT",ROUNDRECT:"ROUNDRECT",TRIANGLE:"TRIANGLE"},b={NEWLINE:"NEWLINE",NONE:"NONE",OMIT:"OMIT"},_={FLAT:"FLAT",ROUND:"ROUND"},S={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"},x={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},w={BSPLINE:"BSPLINE",POLISH:"POLISH"},C={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"},M={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"},A={ADD:"add",UPDATE:"update",DELETE:"delete"},T={LESS_TIME:"LESS_TIME",LESS_TRANSFER:"LESS_TRANSFER",LESS_WALK:"LESS_WALK",MIN_DISTANCE:"MIN_DISTANCE"},E={BUS:"BUS",SUBWAY:"SUBWAY",NO_SUBWAY:"NO_SUBWAY",NONE:"NONE"},O={EXPONENTIAL:"EXPONENTIAL",GAUSSIAN:"GAUSSIAN",SPHERICAL:"SPHERICAL"},P={EXP1:"EXP1",EXP2:"EXP2"},N={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"},I={CLIP:"clip",INTERSECT:"intersect"},F={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"},k={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"},D={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},R={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},B={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"},G={GEOHASH_GRID:"geohash_grid"},U={AVG:"avg",MAX:"max",MIN:"min",SUM:"sum"},j={NDVI:"NDVI",HILLSHADE:"HILLSHADE"};class z{constructor(e,t){this.w=e?parseFloat(e):0,this.h=e?parseFloat(t):0,this.CLASS_NAME="SuperMap.Size"}toString(){return"w="+this.w+",h="+this.h}clone(){return new z(this.w,this.h)}equals(e){var t=!1;return null!=e&&(t=this.w===e.w&&this.h===e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t}destroy(){this.w=null,this.h=null}}class V{constructor(e,t,i){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=i,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new V(this.x,this.y,this.mode)}equals(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){if(null==e||null==t)throw new TypeError("Pixel.add cannot receive null values");return new V(this.x+e,this.y+t)}offset(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t}destroy(){this.x=null,this.y=null,this.mode=null}}V.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var J=function(...e){class t{constructor(t){for(var i=0;i<e.length;i++)s(this,new e[i](t))}}for(var i=0;i<e.length;i++){var r=e[i];s(t,r),s(t.prototype,r.prototype),s(t.prototype,new r)}return t;function s(e,t){var i=Object.getOwnPropertyNames(t);Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t)));for(var r=0;r<i.length;r++){var s=i[r];if("constructor"!==s&&"prototype"!==s&&"name"!==s&&"length"!==s){let i=Object.getOwnPropertyDescriptor(t,s);window.ActiveXObject?Object.defineProperty(e,s,i||{}):Object.defineProperty(e,s,i)}}}},q={startsWith:function(e,t){return 0==e.indexOf(t)},contains:function(e,t){return-1!=e.indexOf(t)},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(e){for(var t=e.split("-"),i=t[0],r=1,s=t.length;r<s;r++){var n=t[r];i+=n.charAt(0).toUpperCase()+n.substring(1)}return i},format:function(e,t,i){t||(t=window);return e.replace(q.tokenRegEx,function(e,r){for(var s,n=r.split(/\.+/),a=0;a<n.length;a++)0==a&&(s=t),s=s[n[a]];return"function"==typeof s&&(s=i?s.apply(null,i):s()),void 0===s?"undefined":s})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(e){return q.numberRegEx.test(e)},numericIf:function(e){return q.isNumeric(e)?parseFloat(e):e}},H={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,t){var i=0;return t>0&&(i=parseFloat(e.toPrecision(t))),i},format:function(e,t,i,r){t=void 0!==t?t:0,i=void 0!==i?i:H.thousandsSeparator,r=void 0!==r?r:H.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var s=e.toString().split(".");1===s.length&&null==t&&(t=0);var n,a=s[0];if(i)for(var o=/(-?[0-9]+)([0-9]{3})/;o.test(a);)a=a.replace(o,"$1"+i+"$2");if(0==t)n=a;else{var l=s.length>1?s[1]:"0";null!=t&&(l+=new Array(t-l.length+1).join("0")),n=a+r+l}return n}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return H.limitSigDigs(this,e)});var W={bind:function(e,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var r=i.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,r)}},bindAsEventListener:function(e,t){return function(i){return e.call(t,i||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},Y={filter:function(e,t,i){var r=[];if(Array.prototype.filter)r=e.filter(t,i);else{var s=e.length;if("function"!=typeof t)throw new TypeError;for(var n=0;n<s;n++)if(n in e){var a=e[n];t.call(i,a,n,e)&&r.push(a)}}return r}};class X{constructor(){this.CLASS_NAME="SuperMap.Geometry",this.id=ee.createUniqueID(this.CLASS_NAME+"_"),this.parent=null,this.bounds=null,this.SRID=null}destroy(){this.id=null,this.bounds=null,this.SRID=null}clone(){return new X}setBounds(e){e&&(this.bounds=e.clone())}clearBounds(){this.bounds=null,this.parent&&this.parent.clearBounds()}extendBounds(e){this.getBounds()?this.bounds.extend(e):this.setBounds(e)}getBounds(){return null==this.bounds&&this.calculateBounds(),this.bounds}calculateBounds(){}getVertices(e){}getArea(){return 0}}const Q=function(){var e,t="",i="",r="pc",s=navigator.userAgent.toLowerCase();return s.indexOf("msie")>-1||s.indexOf("trident")>-1&&s.indexOf("rv")>-1?(t="msie",e=s.match(/msie ([\d.]+)/)||s.match(/rv:([\d.]+)/)):s.indexOf("chrome")>-1?(t="chrome",e=s.match(/chrome\/([\d.]+)/)):s.indexOf("firefox")>-1?(t="firefox",e=s.match(/firefox\/([\d.]+)/)):s.indexOf("opera")>-1?(t="opera",e=s.match(/version\/([\d.]+)/)):s.indexOf("safari")>-1&&(t="safari",e=s.match(/version\/([\d.]+)/)),i=e?e[1]:"",s.indexOf("ipad")>-1||s.indexOf("ipod")>-1||s.indexOf("iphone")>-1?r="apple":s.indexOf("android")>-1&&(i=(e=s.match(/version\/([\d.]+)/))?e[1]:"",r="android"),{name:t,version:i,device:r}}(),Z=function(){var e=!0,t=Q;return document.createElement("canvas").getContext?("firefox"===t.name&&parseFloat(t.version)<5&&(e=!1),"safari"===t.name&&parseFloat(t.version)<4&&(e=!1),"opera"===t.name&&parseFloat(t.version)<10&&(e=!1),"msie"===t.name&&parseFloat(t.version)<9&&(e=!1)):e=!1,e}(),K=function(){var e=navigator.userAgent.toLowerCase();return-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")}(),$=96,ee={assign(e){for(var t=0;t<Object.getOwnPropertyNames(arguments).length;t++){var i=Object.getOwnPropertyNames(arguments)[t];if("caller"!=i&&"callee"!=i&&"length"!=i&&"arguments"!=i){var r=arguments[i];if(r)for(var s=0;s<Object.getOwnPropertyNames(r).length;s++){var n=Object.getOwnPropertyNames(r)[s];"caller"!=i&&"callee"!=i&&"length"!=i&&"arguments"!=i&&(e[n]=r[n])}}}return e},extend:function(e,t){if(e=e||{},t){for(var i in t){var r=t[i];void 0!==r&&(e[i]=r)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},copy:function(e,t){var i;if(e=e||{},t)for(var r in e)void 0!==(i=t[r])&&(e[r]=i)},reset:function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"==typeof e[t]&&e[t]instanceof Array){for(var i in e[t])e[t][i].destroy&&e[t][i].destroy();e[t].length=0}else"object"==typeof e[t]&&e[t]instanceof Object&&e[t].destroy&&e[t].destroy();e[t]=null}},getElement:function(){for(var e=[],t=0,i=arguments.length;t<i;t++){var r=arguments[t];if("string"==typeof r&&(r=document.getElementById(r)),1===arguments.length)return r;e.push(r)}return e},isElement:function(e){return!(!e||1!==e.nodeType)},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},removeItem:function(e,t){for(var i=e.length-1;i>=0;i--)e[i]===t&&e.splice(i,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},modifyDOMElement:function(e,t,i,r,s,n,a,o){t&&(e.id=t),i&&(e.style.left=i.x+"px",e.style.top=i.y+"px"),r&&(e.style.width=r.w+"px",e.style.height=r.h+"px"),s&&(e.style.position=s),n&&(e.style.border=n),a&&(e.style.overflow=a),parseFloat(o)>=0&&parseFloat(o)<1?(e.style.filter="alpha(opacity="+100*o+")",e.style.opacity=o):1===parseFloat(o)&&(e.style.filter="",e.style.opacity="")},applyDefaults:function(e,t){e=e||{};var i="function"==typeof window.Event&&t instanceof window.Event;for(var r in t)(void 0===e[r]||!i&&t.hasOwnProperty&&t.hasOwnProperty(r)&&!e.hasOwnProperty(r))&&(e[r]=t[r]);return!i&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var i in e){var r,s=e[i];if(null!=s&&"function"!=typeof s)r=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(i)+"="+r)}return t.join("&")},urlAppend:function(e,t){var i=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var r=(e+" ").split(/[?&]/);i+=" "===r.pop()?t:r.length?"&"+t:"?"+t}return i},urlPathAppend:function(e,t){let i=e;if(!t)return i;0===t.indexOf("/")&&(t=t.substring(1));const r=e.split("?");return r[0].indexOf("/",r[0].length-1)<0&&(r[0]+="/"),i=`${r[0]}${t}${r.length>1?`?${r[1]}`:""}`},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=ee.DEFAULT_PRECISION),"number"!=typeof e&&(e=parseFloat(e)),0===t?e:parseFloat(e.toPrecision(t))},rad:function(e){return e*Math.PI/180},getParameters:function(e){e=null===e||void 0===e?window.location.href:e;var t="";if(q.contains(e,"?")){var i=e.indexOf("?")+1,r=q.contains(e,"#")?e.indexOf("#"):e.length;t=e.substring(i,r)}for(var s={},n=t.split(/[&;]/),a=0,o=n.length;a<o;++a){var l=n[a].split("=");if(l[0]){var h=l[0];try{h=decodeURIComponent(h)}catch(e){h=unescape(h)}var u=(l[1]||"").replace(/\+/g," ");try{u=decodeURIComponent(u)}catch(e){u=unescape(u)}1==(u=u.split(",")).length&&(u=u[0]),s[h]=u}}return s},lastSeqID:0,createUniqueID:function(e){return null==e&&(e="id_"),ee.lastSeqID+=1,e+ee.lastSeqID},normalizeScale:function(e){return e>1?1/e:e},getResolutionFromScale:function(e,t){var i;e&&(null==t&&(t="degrees"),i=1/(ee.normalizeScale(e)*te[t]*$));return i},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*te[t]*$},getBrowser:function(){return Q},isSupportCanvas:Z,supportCanvas:function(){return ee.isSupportCanvas},isInTheSameDomain:function(e){if(!e)return!0;var t=e.indexOf("//"),i=document.location.toString(),r=i.indexOf("//");if(-1===t)return!0;var s,n=s=e.substring(0,t),a=i.substring(r+2);r=a.indexOf("/");var o=a.indexOf(":"),l=a.substring(0,r),h=document.location.protocol;if(-1!==o||(l+=":"+("http:"===h.toLowerCase()?80:443)),h.toLowerCase()!==n.toLowerCase())return!1;var u=(n=e.substring(t+2)).indexOf(":");t=n.indexOf("/");var c,d=n.substring(0,t);return-1!==u?c=n.substring(0,u):(c=n.substring(0,t),d+=":"+("http:"===s.toLowerCase()?80:443)),c===document.domain&&d===l},calculateDpi:function(e,t,i,r,s){if(e&&t&&i){var n,a=e.getWidth(),o=e.getHeight(),l=t.w,h=t.h;if(s=s||6378137,"degree"===(r=r||"degrees").toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()){let e=a/l,t=o/h;n=254/(e>t?e:t)/i/(2*Math.PI*s/360)/1e4}else{n=254/(a/l)/i/1e4}return n}},toJSON:function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return t=(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var i="",r=0,s=t.length;r<s;r++)i+=ee.toJSON(t[r]),r!==t.length-1&&(i+=",");return"["+i+"]";case Number:return isFinite(t)?String(t):null;case Boolean:return String(t);case Date:return"{'__type':\"System.DateTime\",'Year':"+t.getFullYear()+",'Month':"+(t.getMonth()+1)+",'Day':"+t.getDate()+",'Hour':"+t.getHours()+",'Minute':"+t.getMinutes()+",'Second':"+t.getSeconds()+",'Millisecond':"+t.getMilliseconds()+",'TimezoneOffset':"+t.getTimezoneOffset()+"}";default:if(null!=t.toJSON&&"function"==typeof t.toJSON)return t.toJSON();if("object"==typeof t){if(t.length){let e=[];for(let i=0,r=t.length;i<r;i++)e.push(ee.toJSON(t[i]));return"["+e.join(",")+"]"}let e=[];for(let i in t)"function"!=typeof t[i]&&"CLASS_NAME"!==i&&"parent"!==i&&e.push("'"+i+"':"+ee.toJSON(t[i]));return e.length>0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,i,r){return r=r||6378137,i=i||"",e>0&&t>0?(e=ee.normalizeScale(e),"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,i,r){return r=r||6378137,i=i||"",e>0&&t>0?"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4:-1},transformResult:function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},copyAttributes:function(e,t){if(e=e||{},t)for(var i in t){var r=t[i];void 0!==r&&"CLASS_NAME"!==i&&"function"!=typeof r&&(e[i]=r)}return e},copyAttributesWithClip:function(e,t,i){if(e=e||{},t)for(var r in t){var s=!1;if(i&&i.length)for(var n=0,a=i.length;n<a;n++)if(r===i[n]){s=!0;break}if(!0!==s){var o=t[r];void 0!==o&&"CLASS_NAME"!==r&&"function"!=typeof o&&(e[r]=o)}}return e},cloneObject:function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date){let t=new Date;return t.setTime(e.getTime()),t}if(e instanceof Array){return e.slice(0)}if(e instanceof Object){let i={};for(var t in e)e.hasOwnProperty(t)&&(i[t]=ee.cloneObject(e[t]));return i}throw new Error("Unable to copy obj! Its type isn't supported.")},lineIntersection:function(e,t,i,r){var s,n,a=null,o=(r.x-i.x)*(e.y-i.y)-(r.y-i.y)*(e.x-i.x),l=(t.x-e.x)*(e.y-i.y)-(t.y-e.y)*(e.x-i.x),h=(r.y-i.y)*(t.x-e.x)-(r.x-i.x)*(t.y-e.y);if(0!=h)n=l/h,a=(s=o/h)>=0&&n<=1&&s<=1&&n>=0?new X.Point(e.x+s*(t.x-e.x),e.y+s*(t.y-e.y)):"No Intersection";else if(0==o&&0==l){var u=Math.max(e.y,t.y),c=Math.min(e.y,t.y),d=Math.max(e.x,t.x),p=Math.min(e.x,t.x);a=(i.y>=c&&i.y<=u||r.y>=c&&r.y<=u)&&i.x>=p&&i.x<=d||r.x>=p&&r.x<=d?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,i){document.body.appendChild(i),i.style.width="auto",i.style.height="auto",e.fontSize&&(i.style.fontSize=e.fontSize),e.fontFamily&&(i.style.fontFamily=e.fontFamily),e.fontWeight&&(i.style.fontWeight=e.fontWeight),i.style.position="relative",i.style.visibility="hidden",i.style.display="inline-block",i.innerHTML=t;var r=i.clientWidth,s=i.clientHeight;return document.body.removeChild(i),{textWidth:r,textHeight:s}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,(e,i)=>{var r;return r=t.hasOwnProperty(i)?function(e){if(void 0==e||null==e)return"";if(e instanceof Date)return e.toJSON();if(function(e){if("string"!=typeof e&&"object"!=typeof e)return!1;try{const t=e.toString();return"[object Object]"===t||"[object Array]"===t}catch(e){return!1}}(e))return JSON.stringify(e);return e.toString()}(t[i]):e,encodeURIComponent(r)}):e}},te={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};te.in=te.inches,te.degrees=te.dd,te.nmi=1852*te.m;const ie=.0254000508001016;ee.extend(te,{Inch:te.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),ee.extend(te,{mm:te.Meter/1e3,cm:te.Meter/100,dm:100*te.Meter,km:1e3*te.Meter,kmi:te.nmi,fath:te.Fathom,ch:te.IntnlChain,link:te.IntnlLink,"us-in":te.inches,"us-ft":te.Foot,"us-yd":te.Yard,"us-ch":te.GunterChain,"us-mi":te.Mile,"ind-yd":te.IndianYd37,"ind-ft":te.IndianFt37,"ind-ch":791.9942845122}),te.degree=te.dd,te.meter=te.m,te.foot=te.ft,te.inch=te.inches,te.mile=te.mi,te.kilometer=te.km,te.yard=te.yd;class re{constructor(e,t){ee.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?ee.toFloat(e):0,this.lat=t?ee.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new re(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new re(this.lon+ee.toFloat(e),this.lat+ee.toFloat(t))}equals(e){var t=!1;return null!=e&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lon<e.left;)t.lon+=e.getWidth();for(;t.lon>e.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new re(t[0],t[1])}static fromArray(e){var t=ee.isArray(e),i=t&&e[0],r=t&&e[1];return new re(i,r)}}class se{constructor(e,t,i,r){ee.isArray(e)&&(r=e[3],i=e[2],t=e[1],e=e[0]),this.left=null!=e?ee.toFloat(e):this.left,this.bottom=null!=t?ee.toFloat(t):this.bottom,this.right=null!=i?ee.toFloat(i):this.right,this.top=null!=r?ee.toFloat(r):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new se(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return null!=e&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return!0===e?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){null==e&&(e=6);var i=Math.pow(10,e),r=Math.round(this.left*i)/i,s=Math.round(this.bottom*i)/i,n=Math.round(this.right*i)/i,a=Math.round(this.top*i)/i;return!0===t?s+","+r+","+a+","+n:r+","+s+","+n+","+a}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new z(this.getWidth(),this.getHeight())}getCenterPixel(){return new V((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new re((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){var i,r;e=e||1,null==t&&(t=this.getCenterLonLat()),"SuperMap.LonLat"===t.CLASS_NAME?(i=t.lon,r=t.lat):(i=t.x,r=t.y);var s=(this.left-i)*e+i,n=(this.bottom-r)*e+r,a=(this.right-i)*e+i,o=(this.top-r)*e+r;return new se(s,n,a,o)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new se(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new se(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new se(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e}t&&(this.centerLonLat=null,(null==this.left||t.left<this.left)&&(this.left=t.left),(null==this.bottom||t.bottom<this.bottom)&&(this.bottom=t.bottom),(null==this.right||t.right>this.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var i=this.contains(e.lon,e.lat,t.inclusive),r=t.worldBounds;if(r&&!i){var s=r.getWidth(),n=(r.left+r.right)/2,a=Math.round((e.lon-n)/s);i=this.containsLonLat({lon:e.lon-a*s,lat:e.lat},{inclusive:t.inclusive})}return i}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,i){if(null==i&&(i=!0),null==e||null==t)return!1;return i?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&e<this.right&&t>this.bottom&&t<this.top}intersectsBounds(e,t){if("boolean"==typeof t&&(t={inclusive:t}),(t=t||{}).worldBounds){var i=this.wrapDateLine(t.worldBounds);e=e.wrapDateLine(t.worldBounds)}else i=this;null==t.inclusive&&(t.inclusive=!0);var r=!1,s=i.left===e.right||i.right===e.left||i.top===e.bottom||i.bottom===e.top;if(t.inclusive||!s){var n=e.bottom>=i.bottom&&e.bottom<=i.top||i.bottom>=e.bottom&&i.bottom<=e.top,a=e.top>=i.bottom&&e.top<=i.top||i.top>e.bottom&&i.top<e.top,o=e.left>=i.left&&e.left<=i.right||i.left>=e.left&&i.left<=e.right,l=e.right>=i.left&&e.right<=i.right||i.right>=e.left&&i.right<=e.right;r=(n||a)&&(o||l)}if(t.worldBounds&&!r){var h=t.worldBounds,u=h.getWidth(),c=!h.containsBounds(i),d=!h.containsBounds(e);c&&!d?(e=e.add(-u,0),r=i.intersectsBounds(e,{inclusive:t.inclusive})):d&&!c&&(i=i.add(-u,0),r=e.intersectsBounds(i,{inclusive:t.inclusive}))}return r}containsBounds(e,t,i){null==t&&(t=!1),null==i&&(i=!0);var r=this.contains(e.left,e.bottom,i),s=this.contains(e.right,e.bottom,i),n=this.contains(e.left,e.top,i),a=this.contains(e.right,e.top,i);return t?r||s||n||a:r&&s&&n&&a}determineQuadrant(e){var t="",i=this.getCenterLonLat();return t+=e.lat<i.lat?"b":"t",t+=e.lon<i.lon?"l":"r"}wrapDateLine(e,t){var i=(t=t||{}).leftTolerance||0,r=t.rightTolerance||0,s=this.clone();if(e){for(var n=e.getWidth();s.left<e.left&&s.right-r<=e.left;)s=s.add(n,0);for(;s.left+i>=e.right&&s.right>e.right;)s=s.add(-n,0);var a=s.left+i;a<e.right&&a>e.left&&s.right-r>e.right&&(s=s.add(-n,0))}return s}toServerJSONObject(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}destroy(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}static fromString(e,t){var i=e.split(",");return se.fromArray(i,t)}static fromArray(e,t){return!0===t?new se(e[1],e[0],e[3],e[2]):new se(e[0],e[1],e[2],e[3])}static fromSize(e){return new se(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return t+="t"===e.charAt(0)?"b":"t",t+="l"===e.charAt(1)?"r":"l"}}class ne extends X{constructor(e){super(),this.components=[],this.componentTypes=null,null!=e&&this.addComponents(e),this.CLASS_NAME="SuperMap.Geometry.Collection",this.geometryType="Collection"}destroy(){this.components.length=0,this.components=null,super.destroy()}clone(){for(var e=new ne,t=0,i=this.components.length;t<i;t++)e.addComponent(this.components[t].clone());return ee.applyDefaults(e,this),e}getComponentsString(){for(var e=[],t=0,i=this.components.length;t<i;t++)e.push(this.components[t].toShortString());return e.join(",")}calculateBounds(){this.bounds=null;var e=new se,t=this.components;if(t)for(var i=0,r=t.length;i<r;i++)e.extend(t[i].getBounds());null!=e.left&&null!=e.bottom&&null!=e.right&&null!=e.top&&this.setBounds(e)}addComponents(e){ee.isArray(e)||(e=[e]);for(var t=0,i=e.length;t<i;t++)this.addComponent(e[t])}addComponent(e,t){var i=!1;if(e&&(null==this.componentTypes||ee.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(null!=t&&t<this.components.length){var r=this.components.slice(0,t),s=this.components.slice(t,this.components.length);r.push(e),this.components=r.concat(s)}else this.components.push(e);e.parent=this,this.clearBounds(),i=!0}return i}removeComponents(e){var t=!1;ee.isArray(e)||(e=[e]);for(var i=e.length-1;i>=0;--i)t=this.removeComponent(e[i])||t;return t}removeComponent(e){return ee.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,i=this.components.length;t<i;t++)e+=this.components[t].getArea();return e}equals(e){var t=!0;if(e&&e.CLASS_NAME&&this.CLASS_NAME===e.CLASS_NAME)if(ee.isArray(e.components)&&e.components.length===this.components.length){for(var i=0,r=this.components.length;i<r;++i)if(!this.components[i].equals(e.components[i])){t=!1;break}}else t=!1;else t=!1;return t}getVertices(e){for(var t=[],i=0,r=this.components.length;i<r;++i)Array.prototype.push.apply(t,this.components[i].getVertices(e));return t}}class ae extends ne{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.MultiPoint",this.geometryType="MultiPoint"}addPoint(e,t){this.addComponent(e,t)}removePoint(e){this.removeComponent(e)}}class oe extends ae{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point","SuperMap.PointWithMeasure"],this.CLASS_NAME="SuperMap.Geometry.Curve",this.geometryType="Curve"}}class le extends X{constructor(e,t,i,r){super(e,t,i,r),this.x=parseFloat(e),this.y=parseFloat(t),this.tag=r||0==r?parseFloat(r):null,this.type=i||"Point",this.CLASS_NAME="SuperMap.Geometry.Point",this.geometryType="Point"}clone(e){return null==e&&(e=new le(this.x,this.y)),ee.applyDefaults(e,this),e}calculateBounds(){this.bounds=new se(this.x,this.y,this.x,this.y)}equals(e){var t=!1;return null!=e&&(t=this.x===e.x&&this.y===e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}move(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()}toShortString(){return this.x+", "+this.y}destroy(){this.x=null,this.y=null,this.tag=null,super.destroy()}getVertices(){return[this]}}class he extends oe{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry.LineString",this.geometryType="LineString"}removeComponent(e){var t=this.components&&this.components.length>2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e,t,i=this.components.length-1,r=new Array(i),s=0;s<i;++s)e=this.components[s],t=this.components[s+1],e.x<t.x?r[s]={x1:e.x,y1:e.y,x2:t.x,y2:t.y}:r[s]={x1:t.x,y1:t.y,x2:e.x,y2:e.y};return r.sort(function(e,t){return e.x1-t.x1})}getVertices(e){return!0===e?[this.components[0],this.components[this.components.length-1]]:!1===e?this.components.slice(1,this.components.length-1):this.components.slice()}static calculateCircle(e){if(e.length<3)return e;var t={},i=e[0],r=e[1],s=e[2],n=0,a=0,o=!0,l=0,h=0,u=0,c=[],d=(s.y-i.y)/(s.x-i.x),p=s.y-d*s.x;if(s.x!=i.x&&s.y!=i.y&&r.y==d*r.x+p||s.x==i.x&&r.x==i.x||s.y==i.y&&r.y==i.y||s.x==i.x&&s.y==i.y||s.x==r.x&&s.y==r.y||i.x==r.x&&i.y==r.y)c.push(i),c.push(r),c.push(s);else{var f=(r.x*r.x+r.y*r.y-(i.x*i.x+i.y*i.y))*(2*(s.y-i.y))-(s.x*s.x+s.y*s.y-(i.x*i.x+i.y*i.y))*(2*(r.y-i.y)),m=2*(r.x-i.x)*(s.x*s.x+s.y*s.y-(i.x*i.x+i.y*i.y))-2*(s.x-i.x)*(r.x*r.x+r.y*r.y-(i.x*i.x+i.y*i.y)),y=4*((r.x-i.x)*(s.y-i.y)-(s.x-i.x)*(r.y-i.y));t.x=f/y,t.y=m/y;var g=(2*(n=Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)))*n-((i.x-s.x)*(i.x-s.x)+(i.y-s.y)*(i.y-s.y)))/(2*n*n);g=(g=g>=1?1:g)<=-1?-1:g,u=180*Math.acos(g)/Math.PI,a=(u=s.x==i.x?t.x>i.x&&r.x>i.x||t.x<i.x&&r.x<i.x?360-u:u:t.y>d*t.x+p&&r.y>d*r.x+p||t.y<d*t.x+p&&r.y<d*r.x+p?360-u:u)/72,s.y!=i.y?s.x==i.x?s.y>i.y?r.x<i.x&&(o=!1):r.x>i.x&&(o=!1):s.x<i.x?r.y<d*r.x+p&&(o=!1):r.y>d*r.x+p&&(o=!1):s.x>i.x?r.y>i.y&&(o=!1):r.y<i.y&&(o=!1);var v=(i.y-t.y)/(i.x-t.x),b=v>=0?180*Math.atan(v)/Math.PI:Math.abs(180*Math.atan(v)/Math.PI)+90,_=Math.abs(t.y);i.y==_&&_==s.y&&i.x<s.x&&(b+=180);var S=i.y-t.y;c.push(i);for(var x=1;x<72;x++){l=a*x,h=b,o?S>=0?v>=0?h+=l:h=180-(h-90)+l:h=v>0?h-180+l:90-h+l:S>=0?v>=0?h-=l:h=180-(h-90)-l:h=v>=0?h-180-l:90-h-l,h=h*Math.PI/180;var w=t.x+n*Math.cos(h),C=t.y+n*Math.sin(h);c.push(new le(w,C))}c.push(s)}return c}static createLineEPS(e){var t=[],i=e.length;if(i<2)return e;for(var r=0;r<i;){if("LTypeArc"==e[r].type){var s=he.createLineArc(t,r,i,e);t=s[0],r=s[1]}else t.push(e[r]),r++}return t}static createLineArc(e,t,i,r){if(0==t){let s=he.addPointEPS(r,t,i,"LTypeArc");Array.prototype.push.apply(e,s[0]),t=s[1]+1}else if(t==i-1){var s=[r[t-1],r[t]],n=he.calculateCircle(s);Array.prototype.push.apply(e,n),t++}else{let s=he.addPointEPS(r,t,i,"LTypeArc");e.pop(),Array.prototype.push.apply(e,s[0]),t=s[1]+1}return[e,t]}static addPointEPS(e,t,i,r){var s,n=[],a=t+1;return 0==t?Array.prototype.push.apply(n,[e[t],e[t+1]]):t==i-1?Array.prototype.push.apply(n,[e[t-1],e[t]]):Array.prototype.push.apply(n,[e[t-1],e[t],e[t+1]]),"LTypeCurve"==r?s=he.calculatePointsFBZN(n):"LTypeArc"==r&&(s=he.calculateCircle(n)),[s,a]}}class ue extends X{constructor(e,t,i){super(e,t,i),this.x=parseFloat(e),this.y=parseFloat(t),this.text=i.toString(),this.bsInfo={h:null,w:null},this.element=document.createElement("span"),this.CLASS_NAME="SuperMap.Geometry.GeoText",this.geometryType="GeoText"}destroy(){super.destroy(),this.x=null,this.y=null,this.text=null}getCentroid(){return new le(this.x,this.y)}clone(e){return null==e&&(e=new ue(this.x,this.y,this.text)),ee.applyDefaults(e,this),e}calculateBounds(){this.bounds=new se(this.x,this.y,this.x,this.y)}getLabelPxBoundsByLabel(e,t,i,r){var s,n,a,o,l=ee.cloneObject(e),h=(r.label||this.text).split("\n").length;if(t=parseFloat(t),i=parseFloat(i),h>1&&(i=parseFloat(i)*h),r.labelAlign&&"cm"!==r.labelAlign)switch(r.labelAlign){case"lt":l.x+=t/2,l.y+=i/2;break;case"lm":l.x+=t/2;break;case"lb":l.x+=t/2,l.y-=i/2;break;case"ct":l.y+=i/2;break;case"cb":l.y-=i/2;break;case"rt":l.x-=t/2,l.y+=i/2;break;case"rm":l.x-=t/2;break;case"rb":l.x-=t/2,l.y-=i/2}return this.bsInfo.h=i,this.bsInfo.w=t,s=l.x-parseFloat(t)/2,n=l.y+parseFloat(i)/2,o=l.x+parseFloat(t)/2,a=l.y-parseFloat(i)/2,new se(s,n,o,a)}getLabelPxBoundsByText(e,t){var i,r,s,n,a=this.getLabelPxSize(t),o=ee.cloneObject(e);if(t.labelAlign&&"cm"!==t.labelAlign)switch(t.labelAlign){case"lt":o.x+=a.w/2,o.y+=a.h/2;break;case"lm":o.x+=a.w/2;break;case"lb":o.x+=a.w/2,o.y-=a.h/2;break;case"ct":o.y+=a.h/2;break;case"cb":o.y-=a.h/2;break;case"rt":o.x-=a.w/2,o.y+=a.h/2;break;case"rm":o.x-=a.w/2;break;case"rb":o.x-=a.w/2,o.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,i=o.x-a.w/2,r=o.y+a.h/2,n=t.fontStyle&&"italic"===t.fontStyle?o.x+a.w/2+parseInt(parseFloat(t.fontSize)/2):o.x+a.w/2,s=o.y-a.h/2,new se(i,r,n,s)}getLabelPxSize(e){var t,i,r,s,n=parseFloat(e.strokeWidth);t=e.label||this.text,i=e.fontSize?parseFloat(e.fontSize):parseFloat("12px");var a=t.split("\n"),o=a.length;s=o>1?i*o+o+n+.2*i:i+n+.2*i+1,r=0,this.labelWTmp&&r<this.labelWTmp&&(r=this.labelWTmp);for(var l=0;l<o;l++){var h=this.getTextCount(a[l]),u=this.labelWTmp=ee.getTextBounds(e,a[l],this.element).textWidth+1*h.textC+n;r<u&&(r=u)}var c=new Object;return c.h=s,c.w=r,c}getTextCount(e){for(var t={},i=0,r=0,s=0;s<e.length;s++)e.charCodeAt(s)>255?i++:r++;return t.cnC=i,t.enC=r,t.textC=e.length,t}}class ce extends he{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var i=!1,r=this.components.pop();null==t&&e.equals(r)||(i=super.addComponent.apply(this,arguments));var s=this.components[0];return super.addComponent.apply(this,[s]),i}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var i=this.components[0];super.addComponent.apply(this,[i])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,i=0,r=this.components.length;i<r-1;i++){var s=this.components[i],n=this.components[i+1];t+=(s.x+n.x)*(n.y-s.y)}e=-t/2}return e}getVertices(e){return!0===e?[]:this.components.slice(0,this.components.length-1)}}class de extends ne{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LineString"],this.CLASS_NAME="SuperMap.Geometry.MultiLineString",this.geometryType="MultiLineString"}}class pe extends ne{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Polygon"],this.CLASS_NAME="SuperMap.Geometry.MultiPolygon",this.geometryType="MultiPolygon"}}class fe extends ne{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LinearRing"],this.CLASS_NAME="SuperMap.Geometry.Polygon",this.geometryType="Polygon"}getArea(){var e=0;if(this.components&&this.components.length>0){e+=Math.abs(this.components[0].getArea());for(var t=1,i=this.components.length;t<i;t++)e-=Math.abs(this.components[t].getArea())}return e}}class me extends X{constructor(e,t,i,r){super(e,t,i,r),this.x=e,this.y=t,this.width=i,this.height=r,this.CLASS_NAME="SuperMap.Geometry.Rectangle",this.geometryType="Rectangle"}calculateBounds(){this.bounds=new se(this.x,this.y,this.x+this.width,this.y+this.height)}getArea(){return this.width*this.height}}class ye{constructor(e,t){this.value=e||"",this.name=t||"token",this.CLASS_NAME="SuperMap.Credential"}getUrlParameters(){return this.name+"="+this.value}getValue(){return this.value}destroy(){this.value=null,this.name=null}}ye.CREDENTIAL=null;var ge={toISOString:function(){if("toISOString"in Date.prototype)return function(e){return e.toISOString()};{function e(e,t){for(var i=e+"";i.length<t;)i="0"+i;return i}return function(t){return isNaN(t.getTime())?"Invalid Date":t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1,2)+"-"+e(t.getUTCDate(),2)+"T"+e(t.getUTCHours(),2)+":"+e(t.getUTCMinutes(),2)+":"+e(t.getUTCSeconds(),2)+"."+e(t.getUTCMilliseconds(),3)+"Z"}}}(),parse:function(e){var t,i=e.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);if(i&&(i[1]||i[7])){var r=parseInt(i[1],10)||0,s=parseInt(i[2],10)-1||0,n=parseInt(i[3],10)||1;t=new Date(Date.UTC(r,s,n));var a=i[7];if(a){var o=parseInt(i[4],10),l=parseInt(i[5],10),h=parseFloat(i[6]),u=0|h,c=Math.round(1e3*(h-u));if(t.setUTCHours(o,l,u,c),"Z"!==a){var d=-1e3*(60*parseInt(a,10)*60+60*(parseInt(i[8],10)||0));t=new Date(t.getTime()+d)}}}else t=new Date("invalid");return t}},ve={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(e){return e.target||e.srcElement},isSingleTouch:function(e){return e.touches&&1===e.touches.length},isMultiTouch:function(e){return e.touches&&e.touches.length>1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var i=ve.element(e);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=t.toUpperCase());)i=i.parentNode;return i},observe:function(e,t,i,r){var s=ee.getElement(e);if(r=r||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!s._eventCacheID){var n="eventCacheID_";s.id&&(n=s.id+"_"+n),s._eventCacheID=ee.createUniqueID(n)}var a=s._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:s,name:t,observer:i,useCapture:r}),s.addEventListener?"mousewheel"===t?s.addEventListener(t,i,{useCapture:r,passive:!1}):s.addEventListener(t,i,r):s.attachEvent&&s.attachEvent("on"+t,i)},stopObservingElement:function(e){var t=ee.getElement(e)._eventCacheID;this._removeElementObservers(ve.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var i=e[t],r=new Array(i.element,i.name,i.observer,i.useCapture);ve.stopObserving.apply(this,r)}},stopObserving:function(e,t,i,r){r=r||!1;var s=ee.getElement(e),n=s._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.detachEvent)&&(t="keydown");var a=!1,o=ve.observers[n];if(o)for(var l=0;!a&&l<o.length;){var h=o[l];if(h.name===t&&h.observer===i&&h.useCapture===r){o.splice(l,1),0==o.length&&delete ve.observers[n],a=!0;break}l++}return a&&(s.removeEventListener?s.removeEventListener(t,i,r):s&&s.detachEvent&&s.detachEvent("on"+t,i)),a},unloadCache:function(){if(ve&&ve.observers){for(var e in ve.observers){var t=ve.observers[e];ve._removeElementObservers.apply(this,[t])}ve.observers=!1}},CLASS_NAME:"SuperMap.Event"};ve.observe(window,"resize",ve.unloadCache,!1);class be{constructor(e,t,i,r,s){if(this.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"],this.listeners={},this.object=e,this.element=null,this.eventTypes=[],this.eventHandler=null,this.fallThrough=r,this.includeXY=!1,this.extensions={},this.extensionCount={},this.clearMouseListener=null,ee.extend(this,s),null!=i)for(var n=0,a=i.length;n<a;n++)this.addEventType(i[n]);null!=t&&this.attachToElement(t),this.CLASS_NAME="SuperMap.Events"}destroy(){for(var e in this.extensions)"boolean"!=typeof this.extensions[e]&&this.extensions[e].destroy();this.extensions=null,this.element&&(ve.stopObservingElement(this.element),this.element.hasScrollEvent&&ve.stopObserving(window,"scroll",this.clearMouseListener)),this.element=null,this.listeners=null,this.object=null,this.eventTypes=null,this.fallThrough=null,this.eventHandler=null}addEventType(e){this.listeners[e]||(this.eventTypes.push(e),this.listeners[e]=[])}attachToElement(e){this.element?ve.stopObservingElement(this.element):(this.eventHandler=W.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=W.bind(this.clearMouseCache,this)),this.element=e;for(var t=0,i=this.BROWSER_EVENTS.length;t<i;t++){var r=this.BROWSER_EVENTS[t];this.addEventType(r),ve.observe(e,r,this.eventHandler)}ve.observe(e,"dragstart",ve.stop)}on(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])}register(e,t,i,r){if(e in be&&!this.extensions[e]&&(this.extensions[e]=new be[e](this)),null!=i&&-1!==ee.indexOf(this.eventTypes,e)){null==t&&(t=this.object);var s=this.listeners[e];s||(s=[],this.listeners[e]=s,this.extensionCount[e]=0);var n={obj:t,func:i};r?(s.splice(this.extensionCount[e],0,n),"object"==typeof r&&r.extension&&this.extensionCount[e]++):s.push(n)}}registerPriority(e,t,i){this.register(e,t,i,!0)}un(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])}unregister(e,t,i){null==t&&(t=this.object);var r=this.listeners[e];if(null!=r)for(var s=0,n=r.length;s<n;s++)if(r[s].obj===t&&r[s].func===i){r.splice(s,1);break}}remove(e){null!=this.listeners[e]&&(this.listeners[e]=[])}triggerEvent(e,t){var i=this.listeners[e];if(i&&0!=i.length){var r;null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var s=0,n=(i=i.slice()).length;s<n;s++){var a=i[s];if(void 0!=(r=a.func.apply(a.obj,[t]))&&!1===r)break}return this.fallThrough||ve.stop(t,!0),r}}handleBrowserEvent(e){var t=e.type,i=this.listeners[t];if(i&&0!=i.length){var r=e.touches;if(r&&r[0]){for(var s,n=0,a=0,o=r.length,l=0;l<o;++l)n+=(s=r[l]).clientX,a+=s.clientY;e.clientX=n/o,e.clientY=a/o}this.includeXY&&(e.xy=this.getMousePosition(e)),this.triggerEvent(t,e)}}clearMouseCache(){this.element.scrolls=null,this.element.lefttop=null;var e=document.body;e&&(0==e.scrollTop&&0==e.scrollLeft||!navigator.userAgent.match(/iPhone/i))&&(this.element.offsets=null)}getMousePosition(e){if(this.includeXY?this.element.hasScrollEvent||(ve.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=ee.getViewportElement();this.element.scrolls=[t.scrollLeft,t.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=ee.pagePosition(this.element)),new V(e.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],e.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])}}be.prototype.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"];class _e{constructor(e,t,i){this.CLASS_NAME="SuperMap.Feature",this.layer=e,this.id=ee.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=t,this.data=null!=i?i:{}}destroy(){this.id=null,this.lonlat=null,this.data=null}}const Se={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};class xe extends _e{constructor(e,t,i){super(null,null,t),this.fid=null,this.geometry=e||null,this.attributes={},t&&(this.attributes=ee.extend(this.attributes,t)),this.bounds=null,this.state=null,this.style=i||null,this.url=null,this.lonlat=null,this.CLASS_NAME="SuperMap.Feature.Vector",xe.style={default:{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"default",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},delete:{display:"none"}}}destroy(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.geometry=null,super.destroy()}clone(){return new xe(this.geometry?this.geometry.clone():null,this.attributes,this.style)}toState(e){if(e===Se.UPDATE)switch(this.state){case Se.UNKNOWN:case Se.DELETE:this.state=e;break;case Se.UPDATE:case Se.INSERT:}else if(e===Se.INSERT)switch(this.state){case Se.UNKNOWN:break;default:this.state=e}else if(e===Se.DELETE)switch(this.state){case Se.INSERT:case Se.DELETE:break;case Se.UNKNOWN:case Se.UPDATE:this.state=e}else e===Se.UNKNOWN&&(this.state=e)}}class we{constructor(e){this.data=null,this.keepData=!1,ee.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class Ce extends we{constructor(e){super(e),this.indent=" ",this.space=" ",this.newline="\n",this.level=0,this.pretty=!1,this.nativeJSON=!(!window.JSON||"function"!=typeof JSON.parse||"function"!=typeof JSON.stringify),this.CLASS_NAME="SuperMap.Format.JSON",this.serialize={object:function(e){if(null==e)return"null";if(e.constructor===Date)return this.serialize.date.apply(this,[e]);if(e.constructor===Array)return this.serialize.array.apply(this,[e]);var t,i,r,s=["{"];this.level+=1;var n=!1;for(t in e)e.hasOwnProperty(t)&&(i=this.write.apply(this,[t,this.pretty]),r=this.write.apply(this,[e[t],this.pretty]),null!=i&&null!=r&&(n&&s.push(","),s.push(this.writeNewline(),this.writeIndent(),i,":",this.writeSpace(),r),n=!0));return this.level-=1,s.push(this.writeNewline(),this.writeIndent(),"}"),s.join("")},array:function(e){var t,i=["["];this.level+=1;for(var r=0,s=e.length;r<s;++r)null!=(t=this.write.apply(this,[e[r],this.pretty]))&&(r>0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,function(e,i){var r=t[i];return r||(r=i.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))})+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}}}read(e,t){var i;if(this.nativeJSON)try{i=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=i),i}write(e,t){this.pretty=!!t;var i=null,r=typeof e;if(this.serialize[r])try{i=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[r].apply(this,[e])}catch(e){}return i}writeIndent(){var e=[];if(this.pretty)for(var t=0;t<this.level;++t)e.push(this.indent);return e.join("")}writeNewline(){return this.pretty?this.newline:""}writeSpace(){return this.pretty?this.space:""}}class Me{constructor(e,t,i){this.red=e||0==e?e:255,this.green=t||0,this.blue=i||0,this.CLASS_NAME="SuperMap.ServerColor"}destroy(){this.red=null,this.green=null,this.blue=null}static fromJson(e){if(e){var t=new Me,i=255;null!==e.red&&(i=Number(e.red)),t.red=i;var r=0;null!==e.green&&(r=Number(e.green)),t.green=r;var s=0;return null!==e.blue&&(s=Number(e.blue)),t.blue=s,t}}}class Ae{constructor(e){this.fillBackColor=new Me(255,255,255),this.fillBackOpaque=!1,this.fillForeColor=new Me(255,0,0),this.fillGradientMode=null,this.fillGradientAngle=0,this.fillGradientOffsetRatioX=0,this.fillGradientOffsetRatioY=0,this.fillOpaqueRate=100,this.fillSymbolID=0,this.lineColor=new Me(0,0,0),this.lineSymbolID=0,this.lineWidth=1,this.markerAngle=0,this.markerSize=1,this.markerSymbolID=-1,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ServerStyle"}destroy(){var e=this;e.fillBackColor&&(e.fillBackColor.destroy(),e.fillBackColor=null),e.fillBackOpaque=null,e.fillForeColor&&(e.fillForeColor.destroy(),e.fillForeColor=null),e.fillGradientMode=null,e.fillGradientAngle=null,e.fillGradientOffsetRatioX=null,e.fillGradientOffsetRatioY=null,e.fillOpaqueRate=null,e.fillSymbolID=null,e.lineColor&&(e.lineColor.destroy(),e.lineColor=null),e.lineSymbolID=null,e.lineWidth=null,e.markerAngle=null,e.markerSize=null,e.markerSymbolID=null}toServerJSONObject(){var e={};return e=ee.copyAttributes(e,this)}static fromJson(e){if(e)return new Ae({fillBackColor:Me.fromJson(e.fillBackColor),fillBackOpaque:e.fillBackOpaque,fillForeColor:Me.fromJson(e.fillForeColor),fillGradientMode:e.fillGradientMode,fillGradientAngle:e.fillGradientAngle,fillGradientOffsetRatioX:e.fillGradientOffsetRatioX,fillGradientOffsetRatioY:e.fillGradientOffsetRatioY,fillOpaqueRate:e.fillOpaqueRate,fillSymbolID:e.fillSymbolID,lineColor:Me.fromJson(e.lineColor),lineSymbolID:e.lineSymbolID,lineWidth:e.lineWidth,markerAngle:e.markerAngle,markerSize:e.markerSize,markerSymbolID:e.markerSymbolID})}}class Te extends le{constructor(e){super(e),this.measure=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.PointWithMeasure"}equals(e){var t=!1;if(null!=e){var i=this.x===e.x&&this.y===e.y&&this.measure===e.measure,r=isNaN(this.x)&&isNaN(this.y)&&isNaN(this.measure),s=isNaN(e.x)&&isNaN(e.y)&&isNaN(e.measure);t=i||r&&s}return t}toJson(){var e="{";return null!=this.measure&&void 0!=this.measure&&(e+='"measure":'+this.measure+","),e+='"x":'+this.x+",",e+='"y":'+this.y,e+="}"}destroy(){this.measure=null,this.x=null,this.y=null}static fromJson(e){if(e)return new Te({x:e.x,y:e.y,measure:e.measure})}}class Ee extends ne{constructor(e,t){super(e,t),this.id=null,this.center=null,this.style=null,this.length=null,this.maxM=null,this.minM=null,this.parts=null,this.points=null,this.type=null,this.componentTypes=["SuperMap.Geometry.LinearRing","SuperMap.Geometry.LineString"],t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.Route",this.geometryType="LINEM"}toJson(){var e="{";if(null!=this.id&&void 0!=this.id&&(e+='"id":'+this.id+","),null!=this.center&&void 0!=this.center&&(e+='"center":'+this.center+","),null!=this.style&&void 0!=this.style&&(e+='"style":'+this.style+","),null!=this.length&&void 0!=this.length&&(e+='"length":'+this.length+","),null!=this.maxM&&void 0!=this.maxM&&(e+='"maxM":'+this.maxM+","),null!=this.minM&&void 0!=this.minM&&(e+='"minM":'+this.minM+","),null!=this.type&&void 0!=this.type&&(e+='"type":"'+this.type+'",'),null!=this.parts&&void 0!=this.parts){e+='"parts":['+this.parts[0];for(var t=1;t<this.parts.length;t++)e+=","+this.parts[t];e+="],"}if(null!=this.components&&this.components.length>0){e+='"points":[';for(var i=0,r=this.components.length;i<r;i++)for(var s=0,n=this.components[i].components.length;s<n;s++)e+=this.components[i].components[s].toJson()+",";e=e.replace(/,$/g,""),e+="]"}return e=e.replace(/,$/g,""),e+="}"}destroy(){var e=this;e.id=null,e.center=null,e.style=null,e.length=null,e.maxM=null,e.minM=null,e.type=null,e.parts=null,e.components.length=0,e.components=null,e.componentTypes=null}static fromJson(e){if(e){var t=e.parts||[],i=e.points||[],r=t.length,s=[];if(!(r>0))return null;for(var n=0,a=0,o=[];n<r;n++){for(var l=0;l<t[n];l++)o.push(Te.fromJson(i[a+l]));a+=t[n],o[0].equals(o[t[n]-1])?s.push(new ce(o)):s.push(new he(o)),o=[]}return new Ee(s,{id:e.id,center:e.center,style:e.style,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type,parts:e.parts})}}}class Le{constructor(e){this.id=0,this.style=null,this.parts=null,this.points=null,this.type=null,this.prjCoordSys=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ServerGeometry"}destroy(){var e=this;e.id=null,e.style=null,e.parts=null,e.partTopo=null,e.points=null,e.type=null,e.prjCoordSys=null}toGeometry(){var e=this;switch(e.type.toUpperCase()){case s.POINT:return e.toGeoPoint();case s.LINE:return e.toGeoLine();case s.LINEM:return e.toGeoLinem();case s.REGION:return e.toGeoRegion();case s.POINTEPS:return e.toGeoPoint();case s.LINEEPS:return e.toGeoLineEPS();case s.REGIONEPS:return e.toGeoRegionEPS();case s.GEOCOMPOUND:return e.transformGeoCompound()}}toGeoPoint(){var e=this.parts||[],t=this.points||[],i=e.length;if(i>0){if(1===i)return new le(t[0].x,t[0].y);var r=[];for(let e=0;e<i;e++)r.push(new le(t[e].x,t[e].y));return new ae(r)}return null}toGeoLine(){var e=this.parts||[],t=this.points||[],i=e.length;if(i>0){if(1===i){let i=[];for(let r=0;r<e[0];r++)i.push(new le(t[r].x,t[r].y));return i[0].equals(i[e[0]-1])?new ce(i):new he(i)}{let r=[];for(let s=0;s<i;s++){let i=[];for(let r=0;r<e[s];r++)i.push(new le(t[r].x,t[r].y));r.push(new he(i)),t.splice(0,e[s])}return new de(r)}}return null}toGeoLineEPS(){var e,t,i,r,s,n=this.parts||[],a=this.points||[],o=n.length;if(o>0){if(1===o){for(e=0,i=[];e<n[0];e++)i.push(new le(a[e].x,a[e].y,a[e].type));return i[0].equals(i[n[0]-1])?(s=he.createLineEPS(i),new ce(s)):(s=he.createLineEPS(i),new he(s))}for(e=0,r=[];e<o;e++){for(t=0,i=[];t<n[e];t++)i.push(new le(a[t].x,a[t].y));s=he.createLineEPS(i),r.push(new he(s)),a.splice(0,n[e])}return new de(r)}return null}toGeoLinem(){return Ee.fromJson(this)}toGeoRegion(){var e=this.parts||[],t=this.partTopo||[],i=this.points||[],r=e.length;if(r<=0)return null;var s=[],n=[];if(1==r){for(let e=0;e<i.length;e++)n.push(new le(i[e].x,i[e].y));return s.push(new fe([new ce(n)])),new pe(s)}var a=[],o=[],l=[],h=[],u=[];for(let s=0,a=0;s<r;s++){for(let t=0;t<e[s];t++)n.push(new le(i[a+t].x,i[a+t].y));a+=e[s];var c=new fe([new ce(n)]);n=[],l.push(c),0===t.length&&h.push(c.getBounds()),u.push(1),o.push(c.getArea())}if(0===t.length){Le.bubbleSort(o,l,t,h);var d=[];for(let e=1;e<l.length;e++)for(let t=e-1;t>=0;t--)if(d[e]=-1,h[t].containsBounds(h[e])){u[e]=-1*u[t],u[e]<0&&(d[e]=t);break}for(let e=0;e<l.length;e++)u[e]>0?s.push(l[e]):(s[d[e]].components=s[d[e]].components.concat(l[e].components),s.push(""))}else{s=new Array;for(let e=0;e<l.length;e++)if(t[e]&&-1==t[e]?a=a.concat(l[e].components):(a.length>0&&s.length>0&&(s[s.length-1].components=s[s.length-1].components.concat(a),a=[]),s.push(l[e])),e==r-1){var p=s.length;if(p)s[p-1].components=s[p-1].components.concat(a);else for(let e=0,t=a.length;e<t;e++)s.push(new fe(a))}}return new pe(s)}toGeoRegionEPS(){var e=this.parts||[],t=this.partTopo||[],i=this.points||[],r=e.length;if(r<=0)return null;var s,n=[],a=[];if(1==r){for(var o=0;o<i.length;o++)a.push(new le(i[o].x,i[o].y));return s=he.createLineEPS(a),n.push(new fe([new ce(s)])),new pe(n)}var l=[],h=[],u=[],c=[],d=[];for(let n=0,o=0;n<r;n++){for(let t=0;t<e[n];t++)a.push(new le(i[o+t].x,i[o+t].y));o+=e[n],s=he.createLineEPS(a);var p=new fe([new ce(s)]);a=[],u.push(p),0===t.length&&c.push(p.getBounds()),d.push(1),h.push(p.getArea())}if(0===t.length){Le.bubbleSort(h,u,t,c);var f=[];for(let e=1;e<u.length;e++)for(let t=e-1;t>=0;t--)if(f[e]=-1,c[t].containsBounds(c[e])){d[e]=-1*d[t],d[e]<0&&(f[e]=t);break}for(let e=0;e<u.length;e++)d[e]>0?n.push(u[e]):(n[f[e]].components=n[f[e]].components.concat(u[e].components),n.push(""))}else{n=new Array;for(let e=0;e<u.length;e++)if(t[e]&&-1==t[e]?l=l.concat(u[e].components):(l.length>0&&n.length>0&&(n[n.length-1].components=n[n.length-1].components.concat(l),l=[]),n.push(u[e])),e==r-1){var m=n.length;if(m)n[m-1].components=n[m-1].components.concat(l);else for(let e=0,t=l.length;e<t;e++)n.push(new fe(l))}}return new pe(n)}transformGeoCompound(){const e=this.geoParts||[],t=e.length;if(t<=0)return null;const i=[];for(let r=0;r<t;r++){const t=e[r];i.push(new Le(t).toGeometry())}return new ne(i)}static fromJson(e){if(e)return new Le({id:e.id,style:Ae.fromJson(e.style),parts:e.parts,partTopo:e.partTopo,points:e.points,center:e.center,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type})}static fromGeometry(e){if(e){var t=0,i=[],r=[],n=null,a=e.components,o=e.CLASS_NAME,l={epsgCode:e.SRID};if(isNaN(e.id)||(t=e.id),"SuperMap.Geometry.LinearRing"!=o&&"SuperMap.Geometry.LineString"!=o&&(e instanceof ae||e instanceof de)){let e=a.length;for(let t=0;t<e;t++){const e=a[t].getVertices();let s=e.length;i.push(s);for(let t=0;t<s;t++)r.push(new le(e[t].x,e[t].y))}n="SuperMap.Geometry.MultiPoint"==o?s.POINT:s.LINE}else if(e instanceof pe){let e=a.length;for(let t=0;t<e;t++){let e=a[t].components,s=e.length;for(let t=0;t<s;t++){const s=e[t].getVertices(),n=s.length+1;i.push(n);for(let e=0;e<n-1;e++)r.push(new le(s[e].x,s[e].y));r.push(new le(s[0].x,s[0].y))}}n=s.REGION}else if(e instanceof fe){let e=a.length;for(let t=0;t<e;t++){const e=a[t].getVertices();let s=e.length+1;i.push(s);for(let t=0;t<s-1;t++)r.push(new le(e[t].x,e[t].y));r.push(new le(e[0].x,e[0].y))}n=s.REGION}else{const t=e.getVertices();let a=t.length;for(let e=0;e<a;e++)r.push(new le(t[e].x,t[e].y));e instanceof ce&&(r.push(new le(t[0].x,t[0].y)),a++),i.push(a),n=e instanceof le?s.POINT:s.LINE}return new Le({id:t,style:null,parts:i,points:r,type:n,prjCoordSys:l})}}static IsClockWise(e){var t=e.length;if(t<3)return 0;var i=e[0].y*(e[t-1].x-e[1].x);e.push(e[0]);for(var r=1;r<t;r++)i+=e[r].y*(e[r-1].x-e[r+1].x);return.5*i}static bubbleSort(e,t,i,r){for(var s=0;s<e.length;s++)for(var n=0;n<e.length;n++)if(e[s]>e[n]){var a=e[n];e[n]=e[s],e[s]=a;var o=t[n];if(t[n]=t[s],t[s]=o,i&&i.length>0){var l=i[n];i[n]=i[s],i[s]=l}if(r&&r.length>0){var h=r[n];r[n]=r[s],r[s]=h}}}}class Oe extends Ce{constructor(e){super(e),this.ignoreExtraDims=!0,this.CLASS_NAME="SuperMap.Format.GeoJSON",this.parseCoords={point:function(e){if(!1===this.ignoreExtraDims&&2!=e.length)throw"Only 2D points are supported: "+e;return new le(e[0],e[1])},multipoint:function(e){for(var t=[],i=null,r=0,s=e.length;r<s;++r){try{i=this.parseCoords.point.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new ae(t)},linestring:function(e){for(var t=[],i=null,r=0,s=e.length;r<s;++r){try{i=this.parseCoords.point.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new he(t)},multilinestring:function(e){for(var t=[],i=null,r=0,s=e.length;r<s;++r){try{i=this.parseCoords.linestring.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new de(t)},polygon:function(e){for(var t,i,r=[],s=0,n=e.length;s<n;++s){try{i=this.parseCoords.linestring.apply(this,[e[s]])}catch(e){throw e}t=new ce(i.components),r.push(t)}return new fe(r)},multipolygon:function(e){for(var t=[],i=null,r=0,s=e.length;r<s;++r){try{i=this.parseCoords.polygon.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new pe(t)},box:function(e){if(2!=e.length)throw"GeoJSON box coordinates must have 2 elements";return new fe([new ce([new le(e[0][0],e[0][1]),new le(e[1][0],e[0][1]),new le(e[1][0],e[1][1]),new le(e[0][0],e[1][1]),new le(e[0][0],e[0][1])])])}},this.extract={feature:function(e){var t=this.extract.geometry.apply(this,[e.geometry]),i={type:"Feature",properties:this.createAttributes(e),geometry:t};return e.geometry&&"TEXT"===e.geometry.type&&(i.properties.texts=e.geometry.texts,i.properties.textStyle=e.geometry.textStyle),e.fid&&(i.id=e.fid),e.ID&&(i.id=e.ID),i},geometry:function(e){if(null==e)return null;!e.parts&&e.points&&(e.parts=[e.points.length]);var t,i=e.hasOwnProperty("geometryType")?e:new Le(e).toGeometry()||e,r=i.geometryType||i.type;return"LinearRing"===r&&(r="LineString"),"LINEM"===r&&(r="MultiLineString"),t=this.extract[r.toLowerCase()].apply(this,[i]),"Collection"===(r="TEXT"===r?"Point":r)?{type:"GeometryCollection",geometries:t}:{type:r,coordinates:t}},point:function(e){var t=[e.x,e.y];for(var i in e)"x"===i||"y"===i||null===e[i]||isNaN(e[i])||t.push(e[i]);return t},text:function(e){return[e.points[0].x,e.points[0].y]},multipoint:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t},linestring:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t},multilinestring:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.linestring.apply(this,[e.components[i]]));return t},polygon:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.linestring.apply(this,[e.components[i]]));return t},multipolygon:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.polygon.apply(this,[e.components[i]]));return t},collection:function(e){for(var t=e.components.length,i=new Array(t),r=0;r<t;++r)i[r]=this.extract.geometry.apply(this,[e.components[r]]);return i}}}read(e,t,i){t=t||"FeatureCollection";var r=null,s=null;if(s="string"==typeof e?super.read(e,i):e){if("string"!=typeof s.type);else if(this.isValidType(s,t))switch(t){case"Geometry":try{r=this.parseGeometry(s)}catch(e){}break;case"Feature":try{(r=this.parseFeature(s)).type="Feature"}catch(e){}break;case"FeatureCollection":switch(r=[],s.type){case"Feature":try{r.push(this.parseFeature(s))}catch(e){r=null}break;case"FeatureCollection":for(var n=0,a=s.features.length;n<a;++n)try{r.push(this.parseFeature(s.features[n]))}catch(e){r=null}break;default:try{var o=this.parseGeometry(s);r.push(new xe(o))}catch(e){r=null}}}}else;return r}write(e,t){return super.write(this.toGeoJSON(e),t)}fromGeoJSON(e,t,i){let r=this.read(e,t,i);return ee.isArray(r)?r.map(e=>this._toiSevrerFeature(e)):this._toiSevrerFeature(r)}toGeoJSON(e){var t={type:null};if(ee.isArray(e)){t.type="FeatureCollection";var i=e.length;t.features=new Array(i);for(var r=0;r<i;++r){var s=e[r];if(n(s)){let e={};e.geometry=s,t.features[r]=this.extract.feature.apply(this,[e])}else t.features[r]=this.extract.feature.apply(this,[s])}}else if(n(e)){let i={};i.geometry=e,t=this.extract.feature.apply(this,[i])}else t=this.extract.feature.apply(this,[e]);function n(e){return e.hasOwnProperty("parts")&&e.hasOwnProperty("points")||e.hasOwnProperty("geoParts")}return t}isValidType(e,t){var i=!1;switch(t){case"Geometry":-1==ee.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],e.type)||(i=!0);break;case"FeatureCollection":i=!0;break;default:e.type==t&&(i=!0)}return i}parseFeature(e){var t,i,r,s;r=e.properties?e.properties:{},s=e.geometry&&e.geometry.bbox||e.bbox;try{i=this.parseGeometry(e.geometry)}catch(e){throw e}return t=new xe(i,r),s&&(t.bounds=se.fromArray(s)),e.id&&(t.geometry.id=e.id,t.fid=e.id),t}parseGeometry(e){if(null==e)return null;var t;if("GeometryCollection"==e.type){if(!ee.isArray(e.geometries))throw"GeometryCollection must have geometries array: "+e;for(var i=e.geometries.length,r=new Array(i),s=0;s<i;++s)r[s]=this.parseGeometry.apply(this,[e.geometries[s]]);t=new ne(r)}else{if(!ee.isArray(e.coordinates))throw"Geometry must have coordinates array: "+e;if(!this.parseCoords[e.type.toLowerCase()])throw"Unsupported geometry type: "+e.type;try{t=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(e){throw e}}return t}createCRSObject(e){var t=e.layer.projection.toString(),i={};if(t.match(/epsg:/i)){var r=parseInt(t.substring(t.indexOf(":")+1));i=4326==r?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+r}}}return i}_toiSevrerFeature(e){const t=e.attributes,i=[],r=[];for(var s in t)i.push(s),r.push(t[s]);const n={fieldNames:i,fieldValues:r,geometry:Le.fromGeometry(e.geometry)};return n.geometry.id=e.fid,n}createAttributes(e){if(!e)return null;var t={};!function(e,t){if(!e.hasOwnProperty("fieldNames")||!e.hasOwnProperty("fieldValues"))return;var i=e.fieldNames,r=e.fieldValues;for(var s in i)t[i[s]]=r[s]}(e,t);var i=["fieldNames","fieldValues","geometry","stringID","ID"];for(var r in e)i.indexOf(r)>-1||(t[r]=e[r]);return t}}class Pe{constructor(e){var t=this;e=e||{},this.speed=e.speed&&e.speed>=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=t.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],t.events=new be(this,null,this.EVENT_TYPES),t.speed=Number(t.speed),t.frequency=Number(t.frequency),t.startTime=Number(t.startTime),t.endTime=Number(t.endTime),t.startTime=Date.parse(new Date(t.startTime)),t.endTime=Date.parse(new Date(t.endTime)),t.currentTime=t.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"}updateOptions(e){var t=this;(e=e||{}).speed&&e.speed>=0&&(t.speed=e.speed,t.speed=Number(t.speed)),e.speed&&e.frequency>=0&&(t.frequency=e.frequency,t.frequency=Number(t.frequency)),e.startTime&&null!=e.startTime&&(t.startTime=e.startTime,t.startTime=Date.parse(new Date(t.startTime))),e.endTime&&null!=e.endTime&&e.endTime>=t.startTime&&(t.endTime=e.endTime,t.endTime=Date.parse(new Date(t.endTime))),null!=e.repeat&&(t.repeat=e.repeat),null!=e.reverse&&(t.reverse=e.reverse)}start(){var e=this;e.running||(e.running=!0,e.tick(),e.events.triggerEvent("start",e.currentTime))}pause(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}stop(){var e=this;e.currentTime=e.startTime,e.running&&(e.running=!1),e.events.triggerEvent("stop",e.currentTime)}toggle(){this.running?this.pause():this.start()}setSpeed(e){return e>=0&&(this.speed=e,!0)}getSpeed(){return this.speed}setFrequency(e){return e>=0&&(this.frequency=e,!0)}getFrequency(){return this.frequency}setStartTime(e){var t=this;return!((e=Date.parse(new Date(e)))>t.endTime)&&(t.startTime=e,t.currentTime<t.startTime&&(t.currentTime=t.startTime,t.tick()),!0)}getStartTime(){return this.startTime}setEndTime(e){var t=this;return t.endTime=Date.parse(new Date(t.endTime)),!(e<t.startTime)&&(t.endTime=e,t.currentTime>=t.endTime&&(t.currentTime=t.startTime,t.tick()),!0)}getEndTime(){return this.endTime}setCurrentTime(e){var t=this;return t.currentTime=Date.parse(new Date(t.currentTime)),e>=t.startTime&&e<=t.endTime&&(t.currentTime=e,t.startTime=t.currentTime,t.tick(),!0)}getCurrentTime(){return this.currentTime}setRepeat(e){this.repeat=e}getRepeat(){return this.repeat}setReverse(e){this.reverse=e}getReverse(){return this.reverse}getRunning(){return this.running}destroy(){var e=this;e.speed=null,e.frequency=null,e.startTime=null,e.endTime=null,e.currentTime=null,e.repeat=null,e.running=!1,e.reverse=null}tick(){}}i(107),i(693);var Ne=i(144),Ie=i.n(Ne);let Fe=window.fetch;var ke,De,Re={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=ee.toJSON(e[t]));var i=encodeURIComponent(e[t]);this.queryValues.push(i)}},issue:function(e){for(var t=this,i=t.getUid(),r=e.url,s=[],n=r,a=0,o=t.queryKeys?t.queryKeys.length:0,l=0;l<o;l++)if(n.length+t.queryKeys[l].length+2>=t.limitLength){if(0==a)return!1;s.push(n),n=r,a=0,l--}else if(n.length+t.queryKeys[l].length+2+t.queryValues[l].length>t.limitLength)for(var h=t.queryValues[l];h.length>0;){var u=t.limitLength-n.length-t.queryKeys[l].length-2;n.indexOf("?")>-1?n+="&":n+="?";var c=h.substring(0,u);"%"===c.substring(u-1,u)?(u-=1,c=h.substring(0,u)):"%"===c.substring(u-2,u-1)&&(u-=2,c=h.substring(0,u)),n+=t.queryKeys[l]+"="+c,h=h.substring(u),c.length>0&&(s.push(n),n=r,a=0)}else a++,n.indexOf("?")>-1?n+="&":n+="?",n+=t.queryKeys[l]+"="+t.queryValues[l];return s.push(n),t.send(s,"SuperMapJSONPCallbacks_"+i,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,i){var r=e.length;if(r>0)return new Promise(s=>{for(var n=(new Date).getTime(),a=0;a<r;a++){var o=e[a];o.indexOf("?")>-1?o+="&":o+="?",o+="sectionCount="+r,o+="§ionIndex="+a,o+="&jsonpUserID="+n,i&&(o=decodeURIComponent(o),o=i+encodeURIComponent(o)),Ie()(o,{jsonpCallbackFunction:t,timeout:3e4}).then(e=>{s(e.json())})}})},GET:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(e.params),this.issue(e)},POST:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},PUT:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},DELETE:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)}},Be=function(){return void 0!=ke?ke:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},Ge=function(){return De||45e3},Ue={commit:function(e,t,i,r){switch(e=e?e.toUpperCase():e){case"GET":return this.get(t,i,r);case"POST":return this.post(t,i,r);case"PUT":return this.put(t,i,r);case"DELETE":return this.delete(t,i,r);default:return this.get(t,i,r)}},supportDirectRequest:function(e,t){return!!ee.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:Be()||t.proxy)},get:function(e,t,i){i=i||{};if(e=ee.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){var r={url:e=e.replace(".json",".jsonp"),data:t};return Re.GET(r)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,i):this._fetch(e,t,i,"GET")},delete:function(e,t,i){i=i||{};if(e=ee.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){e=e.replace(".json",".jsonp");var r={url:e+="&_method=DELETE",data:t};return Re.DELETE(r)}return this.urlIsLong(e)?this._postSimulatie("DELETE",e.substring(0,e.indexOf("?")),t,i):this._fetch(e,t,i,"DELETE")},post:function(e,t,i){if(i=i||{},e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){e=e.replace(".json",".jsonp");var r={url:ee.urlAppend(e,"_method=POST"),data:t};return Re.POST(r)}return this._fetch(e,t,i,"POST")},put:function(e,t,i){if(i=i||{},e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){e=e.replace(".json",".jsonp");var r={url:e+="&_method=PUT",data:t};return Re.PUT(r)}return this._fetch(e,t,i,"PUT")},urlIsLong:function(e){for(var t=0,i=null,r=0,s=e.length;r<s;r++)(i=e.charCodeAt(r))<127?t++:128<=i&&i<=2047?t+=2:2048<=i&&i<=65535&&(t+=3);return!(t<2e3)},_postSimulatie:function(e,t,i,r){return t+=(t.indexOf("?")>-1?"&":"?")+"_method="+e,"string"!=typeof i&&(i=JSON.stringify(i)),this.post(t,i,r)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var i=e.split("?");2===i.length&&(e=i[0]+".json?"+i[1])}return t&&t.proxy&&("function"==typeof t.proxy?e=t.proxy(e):(e=decodeURIComponent(e),e=t.proxy+encodeURIComponent(e))),e},_fetch:function(e,t,i,r){return(i=i||{}).headers=i.headers||{},i.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(i.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),i.timeout?this._timeout(i.timeout,Fe(e,{method:r,headers:i.headers,body:"PUT"===r||"POST"===r?t:void 0,credentials:this._getWithCredentials(i),mode:"cors",timeout:Ge()}).then(function(e){return e})):Fe(e,{method:r,body:"PUT"===r||"POST"===r?t:void 0,headers:i.headers,credentials:this._getWithCredentials(i),mode:"cors",timeout:Ge()}).then(function(e){return e})},_getWithCredentials:function(e){return!0===e.withCredentials?"include":!1===e.withCredentials?"omit":"same-origin"},_fetchJsonp:function(e,t){return t=t||{},Ie()(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(i,r){setTimeout(function(){r(new Error("timeout"))},e),t.then(i,r)})},_getParameterString:function(e){var t=[];for(var i in e){var r,s=e[i];if(null!=s&&"function"!=typeof s)r=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(i)+"="+r)}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class je{static generateToken(e,t){var i=this.servers[e];if(i)return Ue.post(i.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(e){return e.text()})}static registerServers(e){this.servers=this.servers||{},ee.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i=e[t];this.servers[i.server]=i}}static registerToken(e,t){if(this.tokens=this.tokens||{},e&&t){var i=this._getTokenStorageKey(e);this.tokens[i]=t}}static registerKey(e,t){if(this.keys=this.keys||{},e&&!(e.length<1)&&t){e=ee.isArray(e)?e:[e];for(var i=0;i<e.length;i++){var r=this._getUrlRestString(e[0])||e[0];this.keys[r]=t}}}static getServerInfo(e){return this.servers=this.servers||{},this.servers[e]}static getToken(e){if(e){this.tokens=this.tokens||{};var t=this._getTokenStorageKey(e);return this.tokens[t]}}static getKey(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;return this.keys[t]}static loginiServer(e,t,i,r){e=ee.urlPathAppend(e,"services/security/login");var s={username:t&&t.toString(),password:i&&i.toString(),rememberme:r};s=JSON.stringify(s);return Ue.post(e,s,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then(function(e){return e.json()})}static logoutiServer(e){e=ee.urlPathAppend(e,"services/security/logout");return Ue.get(e,"",{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withoutFormatSuffix:!0}).then(function(){return!0}).catch(function(){return!1})}static loginOnline(e,t){var i=je.SSO+"/login?service="+e;this._open(i,t)}static loginiPortal(e,t,i){e=ee.urlPathAppend(e,"web/login");var r={username:t&&t.toString(),password:i&&i.toString()};r=JSON.stringify(r);return Ue.post(e,r,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!0}).then(function(e){return e.json()})}static logoutiPortal(e){e=ee.urlPathAppend(e,"services/security/logout");return Ue.get(e,"",{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!0,withoutFormatSuffix:!0}).then(function(){return!0}).catch(function(){return!1})}static loginManager(e,t,i){if(ee.isInTheSameDomain(e)){var r=ee.urlPathAppend(e,"icloud/security/tokens"),s=t||{},n={username:s.userName&&s.userName.toString(),password:s.password&&s.password.toString()};n=JSON.stringify(n);var a=this;return Ue.post(r,n,{headers:{Accept:"*/*","Content-Type":"application/json"}}).then(function(e){e.text().then(function(e){return a.imanagerToken=e,e})})}var o=!i||i.isNewTab;this._open(e,o)}static destroyAllCredentials(){this.keys=null,this.tokens=null,this.servers=null}static destroyToken(e){if(e){var t=this._getTokenStorageKey(e);this.tokens=this.tokens||{},this.tokens[t]&&delete this.tokens[t]}}static destroyKey(e){if(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;this.keys[t]&&delete this.keys[t]}}static appendCredential(e){var t=e,i=this.getToken(e),r=i?new ye(i,"token"):null;return r||(r=(i=this.getKey(e))?new ye(i,"key"):null),r&&(t=ee.urlAppend(t,r.getUrlParameters())),t}static _open(e,t){t=null==t||t;var i=window.screen.availWidth/2-this.INNER_WINDOW_WIDTH/2,r=window.screen.availHeight/2-this.INNER_WINDOW_HEIGHT/2,s="height="+this.INNER_WINDOW_HEIGHT+", width="+this.INNER_WINDOW_WIDTH+",top="+r+", left="+i+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";t?window.open(e,"login"):window.open(e,"login",s)}static _getTokenStorageKey(e){var t=e.match(/(.*?):\/\/([^\/]+)/i);return t?t[0]:e}static _getUrlRestString(e){if(!e)return e;var t=e.match(/(http|https):\/\/(.*\/rest)/i);return t?t[0]:e}}je.INNER_WINDOW_WIDTH=600,je.INNER_WINDOW_HEIGHT=600,je.SSO="https://sso.supermap.com",je.ONLINE="https://www.supermapol.com";class ze{constructor(e,t){if(e){var i=e.substr(e.length-1,1);this.serviceUrl="/"===i?e.substr(0,e.length-2):e}this.options=t||{},this.CLASS_NAME="SuperMap.iManagerServiceBase"}request(e,t,i,r){(r=r||{headers:{Accept:"*/*","Content-Type":"application/json"}}).hasOwnProperty("withCredentials")||(r.withCredentials=!0),r.crossOrigin=this.options.crossOrigin,r.headers=this.options.headers;var s=je.imanagerToken;return s&&(r.headers||(r.headers=[]),r.headers["X-Auth-Token"]=s),i&&(i=JSON.stringify(i)),Ue.commit(e,t,i,r).then(function(e){return e.json()})}}class Ve{constructor(e){e=e||{},this.nodeSpec="SMALL",this.nodeCount=1,this.nodeName="",this.password="",this.description="",this.physicalMachineName="",this.ips=[],this.userName="",ee.extend(this,e)}}class Je{constructor(e,t){t=t||{},this.serviceUrl=e,this.CLASS_NAME="SuperMap.iPortalServiceBase",this.withCredentials=t.withCredentials||!1,this.crossOrigin=t.crossOrigin,this.headers=t.headers}request(e,t,i,r={headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials}){return t=je.appendCredential(t),Ue.commit(e,t,i,r).then(function(e){return e.json()})}}class qe{constructor(e){e=e||{},this.resourceType="",this.pageSize=12,this.currentPage=1,this.orderBy="UPDATETIME",this.orderType="DESC",this.searchType="PUBLIC",this.tags=[],this.dirIds=[],this.resourceSubTypes=[],this.aggregationTypes=[],this.text="",this.groupIds=[],this.departmentIds=[],ee.extend(this,e)}}class He{constructor(e){e=e||{},this.content=[],this.total=0,this.currentPage=1,this.pageSize=12,this.aggregations=null,ee.extend(this,e)}}class We extends Je{constructor(e,t){super(e),t=t||{},this.authorizeSetting=[],this.bounds="",this.bounds4326="",this.checkStatus="",this.createTime=0,this.description=null,this.dirId=null,this.epsgCode=0,this.heatLevel=0,this.id=0,this.name="",this.personalDirId=null,this.resourceId=0,this.resourceSubType=null,this.resourceType=null,this.serviceRootUrlId=null,this.tags=null,this.thumbnail=null,this.updateTime=0,this.userName="",this.sourceJSON={},ee.extend(this,t),this.resourceUrl=e+"/web/"+this.resourceType.replace("_","").toLowerCase()+"s/"+this.resourceId,this.withCredentials&&(this.resourceUrl=e+"/web/mycontent/"+this.resourceType.replace("_","").toLowerCase()+"s/"+this.resourceId)}load(){var e=this;return e.request("GET",e.resourceUrl+".json").then(function(t){if(t.error)return t;e.sourceJSON=t})}update(){var e=this.resourceType.replace("_","").toLowerCase();"data"===e&&(this.resourceUrl=this.resourceUrl+"/attributes.json");var t=JSON.stringify(this.sourceJSON);if("service"===e){var i={authorizeSetting:this.sourceJSON.authorizeSetting,metadata:this.sourceJSON.metadata,tags:this.sourceJSON.tags,thumbnail:this.sourceJSON.thumbnail,tokenRefreshUrl:this.sourceJSON.tokenRefreshUrl};t=JSON.stringify(i)}return this.request("PUT",this.resourceUrl,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})}}class Ye{constructor(e){e=e||{},this.ids=[],this.entities=[],this.resourceType="",ee.extend(this,e)}}class Xe{constructor(e){e=e||{},this.rootUrl="",this.tags=[],this.entities=[],ee.extend(this,e)}}class Qe{constructor(e){e=e||{},this.type="",this.tags=[],this.entities=[],this.metadata={},this.addedMapNames=[],this.addedSceneNames=[],ee.extend(this,e)}}class Ze{constructor(e){e=e||{},this.fileName="",this.type="",this.tags=[],this.dataMetaInfo={},ee.extend(this,e)}}class Ke{constructor(e){e=e||{},this.xField="",this.yField="",this.fileEncoding="UTF-8",this.xIndex=1,this.yIndex=1,this.fieldTypes=[],this.separator="",this.firstRowIsHead=!0,this.url="",this.dataStoreInfo={},ee.extend(this,e)}}class $e{constructor(e){e=e||{},this.type="",this.url="",this.connectionInfo={},ee.extend(this,e)}}class et{constructor(e){e=e||{},this.dataBase="",this.server="",ee.extend(this,e)}}class tt{constructor(e,t){let i=this;this.EVENT_TYPES=["processCompleted","processFailed"],this.events=null,this.eventListeners=null,this.url=null,this.urls=null,this.proxy=null,this.index=null,this.length=null,this.totalTimes=null,this.POLLING_TIMES=3,this.isInTheSameDomain=null,this.withCredentials=!1,ee.isArray(e)?(i.urls=e,i.length=e.length,i.totalTimes=i.length,1===i.length?i.url=e[0]:(i.index=parseInt(Math.random()*i.length),i.url=e[i.index])):(i.totalTimes=1,i.url=e),ee.isArray(e)&&!i.isServiceSupportPolling()&&(i.url=e[0],i.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,ee.extend(this,t),i.isInTheSameDomain=ee.isInTheSameDomain(i.url),i.events=new be(i,null,i.EVENT_TYPES,!0),i.eventListeners instanceof Object&&i.events.on(i.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;ee.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e._processSuccess=null,e._processFailed=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){const t=e.scope.format;if(t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let i=this;e.url=e.url||i.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=ee.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||i.proxy,e.withCredentials=void 0!=e.withCredentials?e.withCredentials:i.withCredentials,e.crossOrigin=void 0!=e.crossOrigin?e.crossOrigin:i.crossOrigin,e.headers=e.headers||i.headers,e.isInTheSameDomain=i.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=je.appendCredential(e.url),i.calculatePollingTimes(),e.scope=i;var r=e.scope?e.success.bind(e.scope):e.success,s=e.scope?e.failure.bind(e.scope):e.failure;e.success=i.getUrlCompleted(r,e),e.failure=i.getUrlFailed(s,e),i._commit(e)}getUrlCompleted(e,t){return function(i){e&&e(i,t)}}getUrlFailed(e,t){const i=this;return function(r){i.totalTimes>0?(i.totalTimes--,i.ajaxPolling(t)):e&&e(r,t)}}ajaxPolling(e){let t=this,i=e.url,r=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],i=i.replace(r,r.exec(t.url)[0]),e.url=i,e.isInTheSameDomain=ee.isInTheSameDomain(i),t._commit(e)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.times<e.totalTimes&&(e.totalTimes=e.times):e.totalTimes>e.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}serviceProcessCompleted(e,t){e=ee.transformResult(e),this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let i=(e=ee.transformResult(e)).error||e;this.events.triggerEvent("processFailed",{error:i,options:t})}_returnContent(e){return e.scope.format!==t.FGB&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[t.GEOJSON,t.ISERVER]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=ee.urlAppend(e.url,ee.getParameterString(e.params||{}))),"object"==typeof e.data)try{e.params=ee.toJSON(e.data)}catch(e){console.log("不是json对象")}else e.params=e.data;Ue.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then(function(e){return e.text?e.text():e.json?e.json():e}).then(function(i){let r=i;return"string"==typeof i&&(r=(new Ce).read(i)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&e.scope.format===t.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(e){return{error:e}}).then(t=>{t.error?(e.scope?W.bind(e.failure,e.scope):e.failure)(t):(t.succeed=void 0==t.succeed||t.succeed,(e.scope?W.bind(e.success,e.scope):e.success)(t))})}}class it{constructor(e){e.filters&&"string"==typeof e.filters&&(e.filters=e.filters.split(",")),this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,ee.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class rt{constructor(e){e.filters&&(e.filters=e.filters.split(",")),this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null,ee.extend(this,e)}destroy(){this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null}}class st extends tt{constructor(e,t){super(e,t),this.options=t||{},this.eventCount=0,this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,i){t instanceof it&&this.processAsync(e,t,i)}decode(e,t,i){t instanceof rt&&this.processAsync(e,t,i)}processAsync(e,t,i){let r=++this.eventCount,s={scope:this,processCompleted:function(e){if(r===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(s),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&i)return i(e),this.events&&this.events.un(s),!1}};this.events.on(s),this.request({method:"GET",url:e,params:t,scope:this,success(e,t){e.eventId=r,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=r),e.eventId=r,this.serviceProcessFailed(e,t)}})}serviceProcessCompleted(e,t){e.succeed&&delete e.succeed,super.serviceProcessCompleted(e,t)}serviceProcessFailed(e,t){super.serviceProcessFailed(e,t)}}class nt{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",ee.extend(this,e)}destroy(){this.aggName=null,this.aggFieldName=null,this.aggType=null}}class at extends nt{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",ee.extend(this,e)}destroy(){this.subAggs&&(this.subAggs=null)}}class ot{constructor(e){this.dataset=null,this.targetDatasourceName=null,this.totalGridName=null,this.diffuseDatasetGridName=null,this.durationDatasetGridName=null,this.directDatasetGridName=null,this.latitude=null,this.timeMode="MULTIDAYS",this.dayStart=null,this.dayEnd=null,this.hourStart=null,this.hourEnd=null,this.transmittance=null,this.hourInterval=null,this.dayInterval=null,this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.AreaSolarRadiationParameters"}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){var i={};for(var r in e){if("dataset"!==r)"latitude"===r||"timeMode"===r||"dayStart"===r||("dayEnd"===r||"hourStart"===r||"hourEnd"===r)||("transmittance"===r||"hourInterval"===r||"dayInterval"===r)?i[r]=e[r]:t[r]=e[r]}t.parameter=i}}class lt extends tt{constructor(e,i){super(e,i),this.format=i.format||t.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e,i){var r,s=this;if((e=ee.transformResult(e))&&s.format===t.GEOJSON&&"function"==typeof s.toGeoJSONResult)if(ee.isArray(e)){for(var n=0;n<e.length;n++)e[n]=s.toGeoJSONResult(e[n]);r=e}else r=s.toGeoJSONResult(e);r||(r=e),s.events.triggerEvent("processCompleted",{result:r,options:i})}toGeoJSONResult(e){if(!e)return null;e.result&&e.result.resultGeometry&&(e=e.result);var t=new Oe;if(e.recordsets)for(var i=0,r=e.recordsets,s=r.length;i<s;i++)r[i].features&&(r[i].features=t.toGeoJSON(r[i].features));else e.recordset&&e.recordset.features&&(e.recordset.features=t.toGeoJSON(e.recordset.features));return e.resultGeometry&&(e.resultGeometry=t.toGeoJSON(e.resultGeometry)),e.regions&&(e.regions=t.toGeoJSON(e.regions)),e}}class ht extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.AreaSolarRadiationService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ot){var t=this,i={};e instanceof ot&&(t.url=ee.urlPathAppend(t.url,`datasets/${e.dataset}/solarradiation`)),t.url=ee.urlAppend(t.url,"returnContent=true"),ot.toObject(e,i);var r=ee.toJSON(i);t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class ut{constructor(e){this.exp=null,this.value=100,ee.extend(this,e),this.CLASS_NAME="SuperMap.BufferDistance"}destroy(){this.exp=null,this.value=null}}class ct{constructor(e){this.endType=_.FLAT,this.leftDistance=new ut,this.rightDistance=new ut,this.semicircleLineSegment=4,this.radiusUnit=h.METER,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.BufferSetting"}destroy(){let e=this;e.endType=null,e.leftDistance&&(e.leftDistance.destroy(),e.leftDistance=null),e.rightDistance&&(e.rightDistance.destroy(),e.rightDistance=null),e.semicircleLineSegment=null,e.radiusUnit=null}}class dt{constructor(e){this.bufferSetting=new ct,ee.extend(this,e),this.CLASS_NAME="SuperMap.BufferAnalystParameters"}destroy(){this.bufferSetting&&(this.bufferSetting.destroy(),this.bufferSetting=null)}}class pt{constructor(e){this.expectCount=1e3,this.dataset=null,this.dataReturnMode=M.RECORDSET_ONLY,this.deleteExistResultDataset=!0,ee.extend(this,e),this.CLASS_NAME="SuperMap.DataReturnOption"}destroy(){this.expectCount=null,this.dataset=null,this.dataReturnMode=null,this.deleteExistResultDataset=null}}class ft{constructor(e){this.attributeFilter=null,this.name=null,this.joinItems=null,this.linkItems=null,this.ids=null,this.orderBy=null,this.groupBy=null,this.fields=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.FilterParameter"}destroy(){var e=this;if(e.attributeFilter=null,e.name=null,e.joinItems){for(let t=0,i=e.joinItems,r=i.length;t<r;t++)i[t].destroy();e.joinItems=null}if(e.linkItems){for(let t=0,i=e.linkItems,r=i.length;t<r;t++)i[t].destroy();e.linkItems=null}e.ids=null,e.orderBy=null,e.groupBy=null,e.fields=null}}class mt extends dt{constructor(e){super(e),this.dataset=null,this.filterQueryParameter=new ft,this.resultSetting=new pt,this.isAttributeRetained=!0,this.isUnion=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.DatasetBufferAnalystParameters"}destroy(){super.destroy();var e=this;e.dataset=null,e.filterQueryParameter&&(e.filterQueryParameter.destroy(),e.filterQueryParameter=null),e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.isAttributeRetained=null,e.isUnion=null}static toObject(e,t){for(var i in e)if("bufferSetting"===i)e.bufferSetting.radiusUnit=e.bufferSetting.radiusUnit.toUpperCase(),t.bufferAnalystParameter=e.bufferSetting;else if("resultSetting"===i)t.dataReturnOption=e.resultSetting;else{if("dataset"===i)continue;t[i]=e[i]}}}class yt extends dt{constructor(e){super(e),this.sourceGeometry=null,this.sourceGeometrySRID=null,e&&ee.extend(this,e),this.CLASS_NAME=" SuperMap.GeometryBufferAnalystParameters"}destroy(){super.destroy();this.sourceGeometry&&(this.sourceGeometry.destroy(),this.sourceGeometry=null)}static toObject(e,t){for(var i in e)if("bufferSetting"===i){var r={};for(var s in e.bufferSetting)r[s]=e.bufferSetting[s];t.analystParameter=r}else"sourceGeometry"===i?t.sourceGeometry=Le.fromGeometry(e.sourceGeometry):t[i]=e[i]}}class gt extends lt{constructor(e,t){super(e,t),this.mode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.BufferAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t={},i=this;e instanceof mt?(i.mode="datasets",i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/buffer"),mt.toObject(e,t)):e instanceof yt&&(i.mode="geometry",i.url=ee.urlPathAppend(i.url,"geometry/buffer"),yt.toObject(e,t));var r=ee.toJSON(t);this.returnContent=!0,i.request({method:"POST",data:r,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class vt{constructor(e){this.alias=null,this.connect=null,this.dataBase=null,this.driver=null,this.engineType=null,this.exclusive=null,this.OpenLinkTable=null,this.password=null,this.readOnly=null,this.server=null,this.user=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.DatasourceConnectionInfo"}destroy(){var e=this;e.alias=null,e.connect=null,e.dataBase=null,e.driver=null,e.engineType=null,e.exclusive=null,e.OpenLinkTable=null,e.password=null,e.readOnly=null,e.server=null,e.user=null}}class bt{constructor(e){this.type=x.UDB,this.datasetName="analystResult",this.datasourceInfo=null,this.outputPath="",ee.extend(this,e),this.CLASS_NAME="SuperMap.OutputSetting"}destroy(){var e=this;e.type=null,e.datasetName=null,e.outputPath=null,e.datasourceInfo instanceof vt&&(e.datasourceInfo.destroy(),e.datasourceInfo=null)}}class _t{constructor(e){this.items=null,this.numericPrecision=1,this.rangeMode=f.EQUALINTERVAL,this.rangeCount="",this.colorGradientType=m.YELLOW_RED,ee.extend(this,e),this.CLASS_NAME="SuperMap.MappingParameters"}destroy(){var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}class St{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=k.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;ee.extend(this,e),this.CLASS_NAME="SuperMap.BuffersAnalystJobsParameter"}destroy(){this.datasetName=null,this.bounds=null,this.distance=null,this.distanceField=null,this.distanceUnit=null,this.dissolveField=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},"bounds"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class xt extends tt{constructor(e,t){(t=t||{}).EVENT_TYPES=["processCompleted","processFailed","processRunning"],super(e,t),this.CLASS_NAME="SuperMap.ProcessingServiceBase"}destroy(){super.destroy()}getJobs(e){var t=this;Ue.get(je.appendCredential(e),null,{proxy:t.proxy}).then(function(e){return e.json()}).then(function(e){t.events.triggerEvent("processCompleted",{result:e})}).catch(function(e){t.eventListeners.processFailed({error:e})})}addJob(e,t,i,r){var s=this,n=null;t&&t instanceof i&&(n=new Object,i.toObject(t,n));let a=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s.headers||{});var o={proxy:s.proxy,headers:a,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,isInTheSameDomain:s.isInTheSameDomain};Ue.post(je.appendCredential(e),JSON.stringify(n),o).then(function(e){return e.json()}).then(function(e){e.succeed?s.serviceProcessCompleted(e,r):s.serviceProcessFailed(e)}).catch(function(e){s.serviceProcessFailed({error:e})})}serviceProcessCompleted(e,t){e=ee.transformResult(e),t=t||1e3;var i=this;if(e)var r=setInterval(function(){Ue.get(je.appendCredential(e.newResourceLocation),{_t:(new Date).getTime()}).then(function(e){return e.json()}).then(function(e){i.events.triggerEvent("processRunning",{id:e.id,state:e.state}),"LOST"!==e.state.runState&&"KILLED"!==e.state.runState&&"FAILED"!==e.state.runState||(clearInterval(r),i.events.triggerEvent("processFailed",{error:e.state.errorMsg,state:e.state.runState})),"FINISHED"===e.state.runState&&e.setting.serviceInfo&&(clearInterval(r),i.events.triggerEvent("processCompleted",{result:e}))}).catch(function(e){clearInterval(r),i.events.triggerEvent("processFailed",{error:e})})},t)}serviceProcessFailed(e){super.serviceProcessFailed(e)}}class wt extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(){super.getJobs(this.url)}getBuffersJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addBuffersJob(e,t){super.addJob(this.url,e,St,t)}}class Ct{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=null}}class Mt extends tt{constructor(e,i){super(e,i),this.format=t.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e,i){var r;(e=ee.transformResult(e))&&this.format===t.GEOJSON&&"function"==typeof this.toGeoJSONResult&&(r=this.toGeoJSONResult(e)),r||(r=e),this.events.triggerEvent("processCompleted",{result:r,options:i})}toGeoJSONResult(e){return null}}class At extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e){if(!(e instanceof Ct))return null;var t,i=this;if(i.url=ee.urlPathAppend(i.url,"burstAnalyse"),t={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},null!==e.edgeID&&null!==e.nodeID)throw new Error("edgeID and nodeID cannot be null at the same time.");if(null===e.edgeID&&null===e.nodeID)throw new Error("edgeID and nodeID cannot be null at the same time.");null!==e.edgeID?t.edgeID=e.edgeID:t.nodeID=e.nodeID,i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}class Tt extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ChartFeatureInfoSpecsService"}destroy(){super.destroy(),ee.reset(this)}processAsync(){var e=this;e.isTempLayers||ee.urlPathAppend(e.url,"chartFeatureInfoSpecs"),e.request({method:"GET",params:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class Et{constructor(e){this.isQueryPoint=null,this.isQueryLine=null,this.isQueryRegion=null,this.attributeFilter=null,this.chartFeatureInfoSpecCode=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryFilterParameter"}destroy(){var e=this;e.isQueryPoint=null,e.isQueryLine=null,e.isQueryRegion=null,e.attributeFilter=null,e.chartFeatureInfoSpecCode=null}toJson(){var e="";return e+='"isQueryPoint":'+this.isQueryPoint+",",e+='"isQueryLine":'+this.isQueryLine+",",e+='"isQueryRegion":'+this.isQueryRegion+",",this.attributeFilter&&(e+='"attributeFilter": "'+this.attributeFilter+'",'),e="{"+(e+='"chartFeatureInfoSpecCode":'+this.chartFeatureInfoSpecCode)+"}"}}class Lt{constructor(e){this.queryMode=null,this.bounds=null,this.chartLayerNames=null,this.chartQueryFilterParameters=null,this.returnContent=!0,this.startRecord=0,this.expectCount=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryParameters"}destroy(){var e=this;e.queryMode=null,e.bounds=null,e.chartLayerNames=null,e.chartQueryFilterParameters=null,e.returnContent=!0,e.startRecord=0,e.expectCount=null}getVariablesJson(){var e="";if(e+='"queryMode":"'+this.queryMode+'",',this.chartLayerNames&&this.chartLayerNames.length){for(var t=[],i=this.chartLayerNames.length,r=0;r<i;r++)t.push('"'+this.chartLayerNames[r]+'"');e+='"chartLayerNames":'+("["+t.join(",")+"]")+","}if("ChartBoundsQuery"===this.queryMode&&this.bounds&&(e+='"bounds":{"leftBottom":{"x":'+this.bounds.left+',"y":'+this.bounds.bottom+'},"rightTop":{"x":'+this.bounds.right+',"y":'+this.bounds.top+"}},"),this.chartQueryFilterParameters&&this.chartQueryFilterParameters.length){for(var s=[],n=this.chartQueryFilterParameters.length,a=0;a<n;a++){var o=this.chartQueryFilterParameters[a];o instanceof Et&&s.push(o.toJson())}var l="["+s.join(",")+"]";l='"chartQueryParams":'+l+",",l+='"startRecord":'+this.startRecord+",",e+='"chartQueryParameters":'+(l="{"+(l+='"expectCount":'+this.expectCount)+"}")}return e="{"+e+"}"}}class Ot{constructor(e){e&&(this.customParams=null,this.prjCoordSys=null,this.expectCount=1e5,this.networkType=s.LINE,this.queryOption=n.ATTRIBUTEANDGEOMETRY,this.queryParams=null,this.startRecord=0,this.holdTime=10,this.returnCustomResult=!1,this.returnFeatureWithFieldCaption=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryParameters")}destroy(){var e=this;if(e.customParams=null,e.expectCount=null,e.networkType=null,e.queryOption=null,e.queryParams){for(var t=0,i=e.queryParams,r=i.length;t<r;t++)i[t].destroy();e.queryParams=null}e.startRecord=null,e.holdTime=null,e.returnCustomResult=null,e.prjCoordSys=null}}class Pt extends tt{constructor(e,i){super(e,i),i=i||{},this.returnContent=null,this.format=t.GEOJSON,ee.extend(this,i);i.format&&(this.format=i.format.toUpperCase()),this.url&&(this.url=ee.urlPathAppend(this.url,"queryResults"),this.CLASS_NAME="SuperMap.ChartQueryService")}destroy(){tt.prototype.destroy.apply(this,arguments),this.returnContent=null,this.format=null}processAsync(e){if(e instanceof Lt){var t,i=this;i.returnContent=e.returnContent,t=e.getVariablesJson(),i.returnContent&&(i.url=ee.urlAppend(i.url,"returnContent=true")),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}serviceProcessCompleted(e,i){if((e=ee.transformResult(e))&&e.recordsets&&this.format===t.GEOJSON)for(var r=0,s=e.recordsets,n=s.length;r<n;r++)if(s[r].features){var a=new Oe;s[r].features=a.toGeoJSON(s[r].features)}this.events.triggerEvent("processCompleted",{result:e,options:i})}getQueryParameters(e){return new Ot({queryMode:e.queryMode,bounds:e.bounds,chartLayerNames:e.chartLayerNames,chartQueryFilterParameters:e.chartQueryFilterParameters,returnContent:e.returnContent})}}class Nt{constructor(e){e=e||{},this.elevation=null,this.color=null,ee.extend(this,e);var t=this.color;t&&(this.color=new Me(t.red,t.green,t.blue)),this.CLASS_NAME="SuperMap.ColorDictionary"}destroy(){ee.reset(this)}toServerJSONObject(){var e={};return e=ee.copyAttributes(e,this)}}class It{constructor(e){e&&(this.returnEdgeFeatures=!1,this.returnEdgeGeometry=!1,this.returnEdgeIDs=!1,this.returnNodeFeatures=!1,this.returnNodeGeometry=!1,this.returnNodeIDs=!1,this.returnPathGuides=!1,this.returnRoutes=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransportationAnalystResultSetting")}destroy(){var e=this;e.returnEdgeFeatures=null,e.returnEdgeGeometry=null,e.returnEdgeIDs=null,e.returnNodeFeatures=null,e.returnNodeGeometry=null,e.returnNodeIDs=null,e.returnPathGuides=null,e.returnRoutes=null}}class Ft{constructor(e){e&&(this.barrierEdgeIDs=null,this.barrierNodeIDs=null,this.barrierPoints=null,this.weightFieldName=null,this.turnWeightField=null,this.resultSetting=new It,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransportationAnalystParameter")}destroy(){var e=this;if(e.barrierEdgeIDs=null,e.barrierNodeIDs=null,e.weightFieldName=null,e.turnWeightField=null,e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.barrierPoints&&e.barrierPoints.length)for(var t in e.barrierPoints)e.barrierPoints[t].destroy();e.barrierPoints=null}}class kt{constructor(e){this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,ee.extend(this,e),this.CLASS_NAME="SuperMap.ComputeWeightMatrixParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class Dt extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ComputeWeightMatrixService"}destroy(){super.destroy()}processAsync(e){if(e instanceof kt){var t,i=this;i.url=ee.urlPathAppend(i.url,"weightmatrix"),t={parameter:ee.toJSON(e.parameter),nodes:i.getJson(e.isAnalyzeById,e.nodes)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+=t[e];return i+="]"}}class Rt extends tt{constructor(e,t){(t=t||{}).EVENT_TYPES=["broadcastSocketConnected","broadcastSocketClosed","broadcastSocketError","broadcastFailed","broadcastSucceeded","subscribeSocketConnected","subscribeSocketClosed","subscribeSocketError","messageSucceeded","setFilterParamSucceeded"],super(e,t),this.geometry=null,this.prjCoordSys=null,this.excludeField=null,ee.extend(this,t),this.CLASS_NAME="SuperMap.DataFlowService"}initBroadcast(){var e=this;return this.broadcastWebSocket=this._connect(ee.urlPathAppend(e.url,"broadcast")),this.broadcastWebSocket.onopen=function(t){e.broadcastWebSocket.isOpen=!0,t.eventType="broadcastSocketConnected",e.events.triggerEvent("broadcastSocketConnected",t)},this.broadcastWebSocket.onclose=function(t){e.broadcastWebSocket&&(e.broadcastWebSocket.isOpen=!1),t.eventType="broadcastSocketClosed",e.events.triggerEvent("broadcastSocketClosed",t)},this.broadcastWebSocket.onerror=function(t){t.eventType="broadcastSocketError",e.events.triggerEvent("broadcastSocketError",t)},this}broadcast(e){this.broadcastWebSocket&&this.broadcastWebSocket.isOpen?(this.broadcastWebSocket.send(JSON.stringify(e)),this.events.triggerEvent("broadcastSucceeded")):this.events.triggerEvent("broadcastFailed")}initSubscribe(){var e=this;return this.subscribeWebSocket=this._connect(ee.urlPathAppend(e.url,"subscribe")),this.subscribeWebSocket.onopen=function(t){e.subscribeWebSocket.send(e._getFilterParams()),t.eventType="subscribeSocketConnected",e.events.triggerEvent("subscribeSocketConnected",t)},this.subscribeWebSocket.onclose=function(t){t.eventType="subscribeWebSocketClosed",e.events.triggerEvent("subscribeWebSocketClosed",t)},this.subscribeWebSocket.onerror=function(t){t.eventType="subscribeSocketError",e.events.triggerEvent("subscribeSocketError",t)},this.subscribeWebSocket.onmessage=function(t){e._onMessage(t)},this}setExcludeField(e){return this.excludeField=e,this.subscribeWebSocket.send(this._getFilterParams()),this}setGeometry(e){return this.geometry=e,this.subscribeWebSocket.send(this._getFilterParams()),this}unSubscribe(){this.subscribeWebSocket&&(this.subscribeWebSocket.close(),this.subscribeWebSocket=null)}unBroadcast(){this.broadcastWebSocket&&(this.broadcastWebSocket.close(),this.broadcastWebSocket=null)}destroy(){tt.prototype.destroy.apply(this,arguments);this.geometry=null,this.prjCoordSys=null,this.excludeField=null,this.unBroadcast(),this.unSubscribe()}_getFilterParams(){var e={filterParam:{prjCoordSys:this.prjCoordSys,excludeField:this.excludeField,geometry:this.geometry}};return ee.toJSON(e)}_onMessage(e){if(e.data&&e.data.indexOf("filterParam")>=0){var t=JSON.parse(e.data);return e.filterParam=t,e.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",e)}var i=JSON.parse(e.data);e.featureResult=i,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}_connect(e){return e=je.appendCredential(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}}class Bt{constructor(e){e=e||{},this.bounds=null,this.dataSourceName=null,this.description=null,this.encodeType=null,this.isReadOnly=null,this.name=null,this.prjCoordSys=null,this.tableName=null,this.type=null,ee.extend(this,e);var t=this.bounds;t&&(this.bounds=new se(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y)),this.CLASS_NAME="SuperMap.DatasetInfo"}destroy(){ee.reset(this)}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class Gt{constructor(e){this.operation=S.UNION,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.OverlayAnalystParameters"}destroy(){this.operation=null}}class Ut extends Gt{constructor(e){super(e),this.operateDataset=null,this.operateDatasetFields=[],this.operateDatasetFilter=new ft,this.operateRegions=[],this.sourceDataset=null,this.sourceDatasetFields=[],this.sourceDatasetFilter=new ft,this.tolerance=0,this.resultSetting=new pt,ee.extend(this,e),this.CLASS_NAME="SuperMap.DatasetOverlayAnalystParameters"}destroy(){super.destroy();var e=this;if(e.operateDataset=null,e.operateDatasetFields=null,e.operateDatasetFilter&&(e.operateDatasetFilter.destroy(),e.operateDatasetFilter=null),e.operateRegions){for(var t=0,i=e.operateRegions,r=i.length;t<r;t++)i[t].destroy();e.operateRegions=null}e.sourceDataset=null,e.sourceDatasetFields=null,e.sourceDatasetFilter&&(e.sourceDatasetFilter.destroy(),e.sourceDatasetFilter=null),e.tolerance=null,e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null)}static toObject(e,t){for(var i in e)if("sourceDataset"!==i)if("operateRegions"===i){t.operateRegions=[];var r=e.operateRegions;for(var s in r)r.hasOwnProperty(s)&&(t.operateRegions[s]=Le.fromGeometry(r[s]))}else"resultSetting"===i?t.dataReturnOption=e.resultSetting:t[i]=e[i]}}class jt{constructor(e){this.clipRegion=null,this.datumValue=0,this.expectedZValues=null,this.interval=0,this.resampleTolerance=0,this.smoothMethod=w.BSPLINE,this.smoothness=0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.SurfaceAnalystParametersSetting"}destroy(){var e=this;e.clipRegion&&(e.clipRegion.destroy(),e.clipRegion=null),e.datumValue=null,e.expectedZValues=null,e.interval=null,e.resampleTolerance=null,e.smoothMethod=null,e.smoothness=null}toJSON(){let e="'datumValue':"+ee.toJSON(this.datumValue);if(e+=",'interval':"+ee.toJSON(this.interval),e+=",'resampleTolerance':"+ee.toJSON(this.resampleTolerance),e+=",'smoothMethod':"+ee.toJSON(this.smoothMethod),e+=",'smoothness':"+ee.toJSON(this.smoothness),null!=this.expectedZValues&&(e+=",'expectedZValues':"+ee.toJSON(this.expectedZValues)),null!=this.clipRegion){var t=this.clipRegion;this.clipRegion instanceof X&&this.clipRegion.components&&(t=Le.fromGeometry(this.clipRegion)),e+=",'clipRegion':"+ee.toJSON(t)}return"{"+e+"}"}}class zt{constructor(e){this.resolution=0,this.extractParameter=new jt,this.resultSetting=new pt,this.surfaceAnalystMethod=C.ISOLINE,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.SurfaceAnalystParameters"}destroy(){var e=this;e.resolution=null,e.extractParameter&&(e.extractParameter.destroy(),e.extractParameter=null),e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.surfaceAnalystMethod=null}}class Vt extends zt{constructor(e){super(e),this.dataset=null,this.filterQueryParameter=new ft,this.zValueFieldName=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.DatasetSurfaceAnalystParameters"}destroy(){super.destroy();var e=this;e.dataset=null,e.filterQueryParameter&&(e.filterQueryParameter.destroy(),e.filterQueryParameter=null),e.zValueFieldName=null}static toObject(e,t){for(var i in e)if("filterQueryParameter"===i&&(t.filterQueryParameter=e.filterQueryParameter),"extractParameter"===i)e.extractParameter.clipRegion instanceof X&&e.extractParameter.clipRegion.components&&(e.extractParameter.clipRegion=Le.fromGeometry(e.extractParameter.clipRegion)),t.extractParameter=e.extractParameter;else{if("dataset"===i)continue;if("surfaceAnalystMethod"===i)continue;t[i]=e[i]}}}class Jt{constructor(e){e&&(this.clipRegion=null,this.createResultDataset=!1,this.resultDatasetName=null,this.resultDatasourceName=null,this.returnResultRegion=!0,ee.extend(this,e),this.CLASS_NAME="SuperMap.ThiessenAnalystParameters")}destroy(){var e=this;e.clipRegion&&(e.clipRegion.destroy(),e.clipRegion=null),e.createResultDataset=null,e.resultDatasetName=null,e.resultDatasourceName=null,e.returnResultRegion=null}}class qt extends Jt{constructor(e){super(e),this.filterQueryParameter=null,this.dataset=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.DatasetThiessenAnalystParameters"}destroy(){super.destroy();this.filterQueryParameter&&(this.filterQueryParameter.destroy(),this.filterQueryParameter=null)}static toObject(e,t){for(var i in e)"clipRegion"===i?t.clipRegion=Le.fromGeometry(e.clipRegion):t[i]=e[i]}}class Ht extends tt{constructor(e,t){super(e,t),t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.DatasourceService"}destroy(){this.eventCount=0,super.destroy()}getDatasourceService(e,t){let i=ee.urlPathAppend(this.url,`datasources/name/${e}`);this.processAsync(i,"GET",t)}getDatasourcesService(e){let t=ee.urlPathAppend(this.url,"datasources");this.processAsync(t,"GET",e)}setDatasourceService(e,t){if(!e)return;const i=ee.urlPathAppend(this.url,`datasources/name/${e.datasourceName}`);this.processAsync(i,"PUT",t,e)}processAsync(e,t,i,r){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(e),this.events&&this.events.un(n),!1}};this.events.on(n);let a={url:e,method:t,scope:this,success(e,t){e.eventId=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,this.serviceProcessFailed(e,t)}};r&&(a.data=ee.toJSON(r)),this.request(a)}}class Wt{constructor(e){this.dataset=null,this.bounds=null,this.fieldName=null,this.resultGridDatasetResolution=null,this.searchRadius=null,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.DensityKernelAnalystParameters"}destroy(){var e=this;e.dataset=null,e.bounds=null,e.fieldName=null,e.resultGridDatasetResolution=null,e.searchRadius=null,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var i in e)"dataset"!==i&&(t[i]=e[i])}}class Yt extends lt{constructor(e,t){super(e,t),this.mode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.DensityAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t=this,i=new Object;e instanceof Wt&&(t.url=ee.urlPathAppend(t.url,"datasets/"+e.dataset+"/densityanalyst/kernel"),t.mode="kernel"),Wt.toObject(e,i);var r=ee.toJSON(i);t.url=ee.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}class Xt{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.features=null,this.editType=A.ADD,this.IDs=null,this.returnContent=!1,this.isUseBatch=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.EditFeaturesParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.features=null,e.editType=null,e.IDs=null,e.returnContent=null}static toJsonParameters(e){var t,i,r;if(e.editType===A.DELETE){if(null===e.IDs)return;r={ids:e.IDs}}else if(r=[],e.features){i=e.features.length;for(var s=0;s<i;s++)(t=e.features[s]).geometry=Le.fromGeometry(t.geometry),r.push(t)}return ee.toJSON(r)}}class Qt extends tt{constructor(e,t){super(e,t),this.returnContent=!1,this.isUseBatch=!1,t&&ee.extend(this,t),this.url=ee.urlPathAppend(this.url,"features"),this.CLASS_NAME="SuperMap.EditFeaturesService"}destroy(){super.destroy();this.returnContent=null,this.isUseBatch=null,this.fromIndex=null,this.toIndex=null}processAsync(e){if(e instanceof Xt){var t=this,i="POST",r="",s=e.editType,n=null;if(t.returnContent=e.returnContent,t.isUseBatch=e.isUseBatch,n=Xt.toJsonParameters(e),s===A.DELETE){n=r=ee.toJSON(e.IDs);var a=ee.urlAppend(t.url,ee.getParameterString({ids:r}));Ue.urlIsLong(a)?(t.url=ee.urlAppend(t.url,ee.getParameterString({_method:"DELETE"})),i="POST"):(t.url=a,i="DELETE")}else s===A.UPDATE?i="PUT":(t.isUseBatch&&(t.url=ee.urlAppend(t.url,`isUseBatch=${t.isUseBatch}`),t.returnContent=!1),t.returnContent&&(t.url=ee.urlAppend(t.url,"returnContent=true"),i="POST"));t.request({method:i,data:n,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class Zt{constructor(e){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalyst3DParameters"}destroy(){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=null}}class Kt extends Zt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DParameters"}destroy(){super.destroy()}}class $t extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DService"}destroy(){tt.prototype.destroy.apply(this,arguments)}processAsync(e){if(e instanceof Kt){var t,i=this;i.url=ee.urlPathAppend(i.url,"sinks"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class ei extends Zt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DParameters"}destroy(){super.destroy()}}class ti extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ei){var t,i=this;i.url=ee.urlPathAppend(i.url,"sources"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class ii{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,this.queryType=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystStreamParameters"}destroy(){var e=this;e.edgeID=null,e.nodeID=null,e.weightName=null,e.isUncertainDirectionValid=null,e.type=null}}class ri extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystStreamService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ii){var t,i=this;if(0===e.queryType)i.url=ee.urlPathAppend(i.url,"upstreamcirticalfaclilities");else{if(1!==e.queryType)return;i.url=ee.urlPathAppend(i.url,"downstreamcirticalfaclilities")}t={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},null!==e.edgeID&&null!==e.nodeID||null===e.edgeID&&null===e.nodeID||(null!==e.edgeID?t.edgeID=e.edgeID:t.nodeID=e.nodeID,i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed}))}}}class si extends Zt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DParameters"}destroy(){super.destroy()}}class ni extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof si){var t,i=this;i.url=ee.urlPathAppend(i.url,"tracedownresult"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class ai extends Zt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DParameters"}destroy(){super.destroy()}}class oi extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ai){var t,i=this;i.url=ee.urlPathAppend(i.url,"traceupresult"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class li extends Zt{constructor(e){super(e),e=e||{},this.sourceNodeIDs=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DParameters"}destroy(){super.destroy(),this.sourceNodeIDs=null}}class hi extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof li){var t,i=this;i.url=ee.urlPathAppend(i.url,"upstreamcirticalfaclilities"),t={sourceNodeIDs:e.sourceNodeIDs,edgeID:e.edgeID,nodeID:e.nodeID,isUncertainDirectionValid:e.isUncertainDirectionValid},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class ui{constructor(e){this.datasource=null,this.dataset=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.FieldParameters"}destroy(){this.datasource=null,this.dataset=null}}class ci extends ui{constructor(e){super(e),this.fieldName=null,this.statisticMode=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.FieldStatisticsParameters"}destroy(){this.fieldName=null,this.statisticMode=null}}class di extends tt{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.FieldStatisticService"}destroy(){super.destroy();this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null}processAsync(){var e=this,t="datasources/"+e.datasource+"/datasets/"+e.dataset+"/fields/"+e.field+"/"+e.statisticMode;e.url=ee.urlPathAppend(e.url,t),e.request({method:"GET",data:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class pi{constructor(e){this.event=null,this.expectFacilityCount=1,this.facilities=null,this.fromEvent=!1,this.isAnalyzeById=!1,this.maxWeight=0,this.parameter=new Ft,ee.extend(this,e),this.CLASS_NAME="SuperMap.FindClosestFacilitiesParameters"}destroy(){var e=this;e.event=null,e.expectFacilityCount=null,e.facilities=null,e.fromEvent=null,e.isAnalyzeById=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class fi extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindClosestFacilitiesService"}destroy(){super.destroy()}processAsync(e){if(e instanceof pi){var t,i=this;i.url=ee.urlPathAppend(i.url,"closestfacility"),t={expectFacilityCount:e.expectFacilityCount,fromEvent:e.fromEvent,maxWeight:e.maxWeight,parameter:ee.toJSON(e.parameter),event:ee.toJSON(e.event),facilities:i.getJson(e.isAnalyzeById,e.facilities)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.facilityPathList)return e;var t=new Oe;return e.facilityPathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}class mi{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.FindLocationParameters"}destroy(){var e=this;if(e.expectedSupplyCenterCount=null,e.isFromCenter=null,e.turnWeightField=null,e.weightName=null,e.supplyCenters){for(var t=0,i=e.supplyCenters,r=i.length;t<r;t++)i[t].destroy();e.supplyCenters=null}}}class yi extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindLocationService"}destroy(){super.destroy()}processAsync(e){if(e instanceof mi){var t,i=this;i.url=ee.urlPathAppend(i.url,"location"),t={isFromCenter:e.isFromCenter,expectedSupplyCenterCount:e.expectedSupplyCenterCount,weightName:e.weightName,turnWeightField:e.turnWeightField,returnEdgeFeature:!0,returnEdgeGeometry:!0,returnNodeFeature:!0,mapParameter:ee.toJSON(e.mapParameter),supplyCenters:i.getCentersJson(e.supplyCenters)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getCentersJson(e){for(var t="[",i=e?e.length:0,r=0;r<i;r++)r>0&&(t+=","),t+=ee.toJSON(e[r]);return t+="]"}toGeoJSONResult(e){if(!e)return null;var t=new Oe;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class gi{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,ee.extend(this,e),this.CLASS_NAME="SuperMap.FindMTSPPathsParameters"}destroy(){var e=this;e.centers=null,e.hasLeastTotalCost=null,e.isAnalyzeById=null,e.nodes=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class vi extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof gi){var t,i=this,r=i.getJson(e.isAnalyzeById,e.centers),s=i.getJson(e.isAnalyzeById,e.nodes);i.url=ee.urlPathAppend(i.url,"mtsppath"),t={centers:r,nodes:s,parameter:ee.toJSON(e.parameter),hasLeastTotalCost:e.hasLeastTotalCost},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.pathList)return null;var t=new Oe;return e.pathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}class bi{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new Ft,ee.extend(this,e),this.CLASS_NAME="SuperMap.FindPathParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.hasLeastEdgeCount=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class _i extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof bi){var t,i=this;i.url=ee.urlPathAppend(i.url,"path"),t={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:ee.toJSON(e.parameter),nodes:i.getJson(e.isAnalyzeById,e.nodes)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new Oe;return e.pathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}class Si{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new Ft,ee.extend(this,e),this.CLASS_NAME="SuperMap.FindServiceAreasParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.isCenterMutuallyExclusive=null,e.centers=null,e.isFromCenter=null,e.weights=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class xi extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Si){var t,i=this;i.url=ee.urlPathAppend(i.url,"servicearea"),t={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:ee.toJSON(e.parameter),centers:i.getJson(e.isAnalyzeById,e.centers),weights:i.getJson(!0,e.weights)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<r;e++)e>0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.serviceAreaList)return e;var t=new Oe;return e.serviceAreaList.map(function(e){return e.serviceRegion&&(e.serviceRegion=t.toGeoJSON(e.serviceRegion)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e.routes&&(e.routes=t.toGeoJSON(e.routes)),e}),e}}class wi{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,ee.extend(this,e),this.CLASS_NAME="SuperMap.FindTSPPathsParameters"}destroy(){var e=this;e.endNodeAssigned=null,e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class Ci extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof wi){var t,i=this;i.url=ee.urlPathAppend(i.url,"tsppath"),t={parameter:ee.toJSON(e.parameter),endNodeAssigned:e.endNodeAssigned,nodes:i.getNodesJson(e)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getNodesJson(e){var t,i,r,s,n="";if(!1===e.isAnalyzeById){for(t="[",i=0,r=(s=e.nodes).length;i<r;i++)i>0&&(t+=","),t+='{"x":'+s[i].x+',"y":'+s[i].y+"}";n+=t+="]"}else if(!0===e.isAnalyzeById){let t="[",i=e.nodes,r=i.length;for(let e=0;e<r;e++)e>0&&(t+=","),t+=i[e];n+=t+="]"}return n}toGeoJSONResult(e){if(!e||!e.tspPathList)return null;var t=new Oe;return e.tspPathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}class Mi{constructor(e){this.routeTable=null,this.routeIDField=null,this.attributeFilter=null,this.eventTable=null,this.eventRouteIDField=null,this.measureField=null,this.measureStartField=null,this.measureEndField=null,this.measureOffsetField=null,this.errorInfoField=null,this.retainedFields=null,this.dataReturnOption=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GenerateSpatialDataParameters"}destroy(){var e=this;e.routeTable&&(e.routeTable=null),e.routeIDField=null,e.attributeFilter=null,e.eventTable=null,e.eventRouteIDField=null,e.measureField=null,e.measureStartField=null,e.measureEndField=null,e.measureOffsetField=null,e.errorInfoField=null,e.dataReturnOption&&(e.dataReturnOption.destroy(),e.dataReturnOption=null)}}class Ai extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GenerateSpatialDataService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Mi){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){var t="datasets/"+e.routeTable+"/linearreferencing/generatespatialdata";return this.url=ee.urlPathAppend(this.url,t),this.url=ee.urlAppend(this.url,"returnContent=true"),ee.toJSON(e)}}class Ti extends Gt{constructor(e){super(e),e&&e.operateGeometry&&(this.operateGeometry=e.operateGeometry),e&&e.sourceGeometry&&(this.sourceGeometry=e.sourceGeometry),e&&e.operateGeometries&&(this.operateGeometries=e.operateGeometries),e&&e.sourceGeometries&&(this.sourceGeometries=e.sourceGeometries),e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GeometryOverlayAnalystParameters"}destroy(){super.destroy();var e=this;e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.sourceGeometries&&(e.sourceGeometries.destroy(),e.sourceGeometries=null),e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.operateGeometries&&(e.operateGeometries.destroy(),e.operateGeometries=null)}static toObject(e,t){for(var i in e)if("sourceGeometry"===i)t.sourceGeometry=Le.fromGeometry(e.sourceGeometry);else if("sourceGeometries"===i){for(var r=[],s=0;s<e.sourceGeometries.length;s++)r.push(Le.fromGeometry(e.sourceGeometries[s]));t.sourceGeometries=r}else if("operateGeometry"===i)t.operateGeometry=Le.fromGeometry(e.operateGeometry);else if("operateGeometries"===i){for(var n=[],a=0;a<e.operateGeometries.length;a++)n.push(Le.fromGeometry(e.operateGeometries[a]));t.operateGeometries=n}else t[i]=e[i]}}class Ei extends zt{constructor(e){super(e),this.points=null,this.zValues=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GeometrySurfaceAnalystParameters"}destroy(){super.destroy();if(this.points){for(var e=0,t=this.points,i=t.length;e<i;e++)t[e].destroy();this.points=null}this.zValues=null}}class Li extends Jt{constructor(e){super(e),this.points=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GeometryThiessenAnalystParameters"}destroy(){super.destroy();if(this.points){for(var e=this.points.length-1;e>=0;e--)this.points[e].destroy();this.points=null}}static toObject(e,t){for(var i in e)"clipRegion"===i?t.clipRegion=Le.fromGeometry(e.clipRegion):t[i]=e[i]}}class Oi extends tt{constructor(e,t){(t=t||{}).EVENT_TYPES=["processCompleted","processFailed","processRunning"],super(e,t),this.CLASS_NAME="SuperMap.GeoprocessingService",this.headers={},this.crossOrigin=!0,this.eventCount=0}getTools(e){this._processAsync({url:`${this.url}/list`,callback:e})}getTool(e,t){this._processAsync({url:`${this.url}/${e}`,callback:t})}execute(e,t,i,r){const s={parameter:t=t||null,environment:i=i||null};this._processAsync({url:`${this.url}/${e}/execute`,executeParamter:s,callback:r})}submitJob(e,t,i,r){t=t||null,i=i||null;const s=JSON.stringify({parameter:t,environments:i});this._processAsync({url:`${this.url}/${e}/jobs`,method:"POST",callback:r,params:s})}waitForJobCompletion(e,t,i,r){const s=this,n=setInterval(function(){s._processAsync({url:`${s.url}/${t}/jobs/${e}`,serviceProcessCompleted:function(e,t){const i=e.state.runState;switch(t.statusCallback&&t.statusCallback(i),i){case"FINISHED":clearInterval(n),s.events.triggerEvent("processCompleted",{result:e,options:t});break;case"FAILED":case"CANCELED":clearInterval(n),s.events.triggerEvent("processFailed",{result:e,options:t})}},callback:r})},i.interval)}getJobInfo(e,t,i){this._processAsync({url:`${this.url}/${e}/jobs/${t}`,callback:i})}cancelJob(e,t,i){this._processAsync({url:`${this.url}/${e}/jobs/${t}/cancel`,callback:i})}getJobs(e,t){let i=`${this.url}/jobs`;e&&(i=`${this.url}/${e}/jobs`),this._processAsync({url:i,callback:t})}getResults(e,t,i,r){let s=`${this.url}/${e}/jobs/${t}/results`;i&&(s=`${s}/${i}`),this._processAsync({url:s,callback:r})}_processAsync({url:e,method:t,callback:i,paramter:r,serviceProcessCompleted:s,serviceProcessFailed:n}){let a=++this.eventCount,o={scope:this,processCompleted:function(e){if(a===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(o),!1},processFailed:function(e){if((a===e.error.eventId||a===e.eventId)&&i)return i(e),this.events&&this.events.un(o),!1}};this.events.on(o),this.request({url:e,method:t||"GET",params:r,headers:{"Content-type":"application/json"},scope:this,success(e,t){e.eventId=a,(s||this.serviceProcessCompleted.bind(this))(e,t)},failure(e,t){e.error&&(e.error.eventId=a),e.eventId=a,(n||this.serviceProcessFailed.bind(this))(e,t)}})}}class Pi{constructor(e){this.dataset=null,this.sourceFilter=null,this.referenceFilter=null,this.spatialRelationType=null,this.isBorderInside=null,this.returnFeature=null,this.returnGeoRelatedOnly=null,this.startRecord=0,this.expectCount=500,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GeoRelationAnalystParameters"}destroy(){var e=this;e.sourceFilter&&e.sourceFilter.destroy(),e.sourceFilter=null,e.referenceFilter&&e.referenceFilter.destroy(),e.referenceFilter=null,e.dataset=null,e.spatialRelationType=null,e.isBorderInside=null,e.returnFeature=null,e.returnGeoRelatedOnly=null,e.startRecord=null,e.expectCount=null}}class Ni extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GeoRelationAnalystService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Pi){var t=this;t.url=ee.urlPathAppend(t.url,"datasets/"+e.dataset+"/georelation");var i=ee.toJSON(e);t.url=ee.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:i,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class Ii extends tt{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,this.eventCount=0,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();this.datasource=null,this.dataset=null}getDatasetsService(e,t){const i=ee.urlPathAppend(this.url,`datasources/name/${e}/datasets`);this.processAsync(i,"GET",t)}getDatasetService(e,t,i){const r=ee.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(r,"GET",i)}setDatasetService(e,t){if(!e)return;const i=ee.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);delete e.datasourceName,this.processAsync(i,"PUT",t,e)}deleteDatasetService(e,t,i){const r=ee.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(r,"DELETE",i)}processAsync(e,t,i,r){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(e),this.events&&this.events.un(n),!1}};this.events.on(n);var a=this;let o={url:e,method:t,scope:a,success(e,t){e.eventId=s,a.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,a.serviceProcessFailed(e,t)}};r&&(o.data=ee.toJSON(r)),a.request(o)}}class Fi{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnCountOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class ki extends Fi{constructor(e){super(e),this.getFeatureMode=ki.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsParameters"}destroy(){super.destroy();var e=this;if(e.bounds&&(e.bounds.destroy(),e.bounds=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,i,r;return i={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},r={datasetNames:e.datasetNames,getFeatureMode:ki.getFeatureMode.BOUNDS,bounds:i,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new ft).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode=ki.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),e.aggregations&&(r.aggregations=e.aggregations),ee.toJSON(r)}}ki.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class Di extends tt{constructor(e,i){super(e,i),i=i||{},this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=t.GEOJSON,ee.extend(this,i),this.url=ee.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e){if(e){var t,i=this,r=!0;i.returnContent=e.returnContent,i.fromIndex=e.fromIndex,i.toIndex=e.toIndex,i.maxFeatures=e.maxFeatures,i.hasGeometry=e.hasGeometry,i.returnContent&&(r=!1),null!=i.fromIndex&&null!=i.toIndex&&!isNaN(i.fromIndex)&&!isNaN(i.toIndex)&&i.fromIndex>=0&&i.toIndex>=0&&!r&&(i.url=ee.urlAppend(i.url,`fromIndex=${i.fromIndex}&toIndex=${i.toIndex}`)),e.returnCountOnly&&(i.url=ee.urlAppend(i.url,"&returnCountOnly="+e.returnContent)),t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}serviceProcessCompleted(e,i){if(e=ee.transformResult(e),this.format===t.GEOJSON&&e.features){var r=new Oe;e.features=r.toGeoJSON(e.features)}this.events.triggerEvent("processCompleted",{result:e,options:i})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ri extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return ki.toJsonParameters(e)}}class Bi extends Fi{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBufferParameters"}destroy(){super.destroy();var e=this;if(e.bufferDistance=null,e.attributeFilter=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}static toJsonParameters(e){var t,i,r;return r=Le.fromGeometry(e.geometry),i={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:r},e.fields&&((t=new ft).name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(i.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(i.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(i.targetPrj=e.targetPrj),ee.toJSON(i)}}class Gi extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Bi)return Bi.toJsonParameters(e)}}class Ui extends Fi{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryParameters"}destroy(){super.destroy();var e=this;if(e.geometry&&(e.geometry.destroy(),e.geometry=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,i,r;return i=Le.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:i,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new ft).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),e.aggregations&&(r.aggregations=e.aggregations),ee.toJSON(r)}}class ji extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return Ui.toJsonParameters(e)}}class zi extends Fi{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,i;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((i=new ft).name=e.datasetNames,i.fields=e.fields,t.queryParameter=i),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),ee.toJSON(t)}}class Vi extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return zi.toJsonParameters(e)}}class Ji extends Fi{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesBySQLParameters"}destroy(){super.destroy();this.getFeatureMode=null,this.queryParameter&&(this.queryParameter.destroy(),this.queryParameter=null)}static toJsonParameters(e){var t={datasetNames:e.datasetNames,getFeatureMode:"SQL",queryParameter:e.queryParameter};return e.maxFeatures&&!isNaN(e.maxFeatures)&&(t.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),e.aggregations&&(t.aggregations=e.aggregations),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),ee.toJSON(t)}}class qi extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return Ji.toJsonParameters(e)}}class Hi extends tt{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();this.datasource=null,this.dataset=null}processAsync(){var e=this;e.url=ee.urlPathAppend(e.url,`datasources/${e.datasource}/datasets/${e.dataset}/fields`),e.request({method:"GET",data:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class Wi{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null}}class Yi extends tt{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.GetGridCellInfosService"}destroy(){super.destroy();var e=this;e.X=null,e.Y=null,e.datasetName=null,e.dataSourceName=null,e.datasetType=null}processAsync(e,t){if(e instanceof Wi){ee.extend(this,e);var i=this;i.url=ee.urlPathAppend(i.url,`datasources/${i.dataSourceName}/datasets/${i.datasetName}`),i.queryRequest(i.getDatasetInfoCompleted.bind(i),i.getDatasetInfoFailed.bind(i),t)}}queryRequest(e,t,i){let r=++this.eventCount,s={scope:this,processCompleted:function(e){if(r===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(s),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&i)return i(e),this.events&&this.events.un(s),!1}};this.events.on(s);this.request({method:"GET",data:null,scope:this,success(t,s){t.eventId=r,e(t,s,i)},failure(e,i){e.error&&(e.error.eventId=r),e.eventId=r,t(e,i)}})}getDatasetInfoCompleted(e,t,i){e=ee.transformResult(e),this.datasetType=e.datasetInfo.type,this.queryGridInfos(i)}queryGridInfos(e){var t=this;t.url=ee.urlPathAppend(t.url,"GRID"==t.datasetType?"gridValue":"imageValue"),null!=t.X&&null!=t.Y&&(t.url=ee.urlAppend(t.url,`x=${t.X}&y=${t.Y}`)),t.queryRequest(t.serviceProcessCompleted.bind(t),t.serviceProcessFailed.bind(t),e)}getDatasetInfoFailed(e,t){this.serviceProcessFailed(e,t)}}class Xi{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){this.memoryData&&(this.memoryData.destroy(),this.memoryData=null),this.type=null}toServerJSONObject(){}}class Qi{constructor(e){this.align=y.BASELINECENTER,this.backColor=new Me(255,255,255),this.foreColor=new Me(0,0,0),this.backOpaque=!1,this.sizeFixed=!0,this.fontHeight=6,this.fontWidth=0,this.fontWeight=400,this.fontName="Times New Roman",this.bold=!1,this.italic=!1,this.italicAngle=0,this.shadow=!1,this.strikeout=!1,this.outline=!1,this.opaqueRate=0,this.underline=!1,this.rotation=0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ServerTextStyle"}destroy(){var e=this;e.align=null,e.backColor&&(e.backColor.destroy(),e.backColor=null),e.foreColor&&(e.foreColor.destroy(),e.foreColor=null),e.backOpaque=null,e.sizeFixed=null,e.fontHeight=null,e.fontWidth=null,e.fontWeight=null,e.fontName=null,e.bold=null,e.italic=null,e.italicAngle=null,e.shadow=null,e.strikeout=null,e.outline=null,e.opaqueRate=null,e.underline=null,e.rotation=null}static fromObj(e){var t=new Qi(e);return ee.copy(t,e),t.backColor=Me.fromJson(e.backColor),t.foreColor=Me.fromJson(e.foreColor),t}}class Zi{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new Qi,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}static fromObj(e){if(e){var t=new Zi;return ee.copy(t,e),t}}}class Ki{constructor(e){this.caption=null,this.style=new Ae,this.unique=null,this.visible=!0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeUniqueItem"}destroy(){var e=this;e.caption=null,e.unique=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new Ki;return ee.copy(t,e),t.style=Ae.fromJson(e.style),t}}class $i{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeOffset"}destroy(){this.offsetFixed=null,this.offsetX=null,this.offsetY=null}static fromObj(e){if(e){var t=new $i;return ee.copy(t,e),t}}}class er{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new Qi,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LabelMixedTextStyle"}destroy(){var e=this;if(e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null),e.separator=null,e.separatorEnabled=null,e.splitIndexes&&(e.splitIndexes=null),e.styles){for(var t=0,i=e.styles,r=i.length;t<r;t++)i[t].destroy();e.styles=null}}static fromObj(e){if(e){var t=new er,i=e.styles;if(ee.copy(t,e),t.defaultStyle=new Qi(e.defaultStyle),i){t.styles=[];for(var r=0,s=i.length;r<s;r++)t.styles.push(new Qi(i[r]))}return t}}}class tr{constructor(e){this.maxTextHeight=0,this.maxTextWidth=0,this.minTextHeight=0,this.minTextWidth=0,this.uniformStyle=new Qi,this.uniformMixedStyle=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelText"}destroy(){var e=this;e.maxTextHeight=null,e.maxTextWidth=null,e.minTextHeight=null,e.minTextWidth=null,e.uniformStyle&&(e.uniformStyle.destroy(),e.uniformStyle=null),e.uniformMixedStyle&&(e.uniformMixedStyle.destroy(),e.uniformMixedStyle=null)}static fromObj(e){if(e){var t=new tr;return ee.copy(t,e),t.uniformStyle=Qi.fromObj(e.uniformStyle),t.uniformMixedStyle=er.fromObj(e.uniformMixedStyle),t}}}class ir{constructor(e){this.isAlongLine=!0,this.alongLineDirection=g.LB_TO_RT,this.angleFixed=!1,this.repeatedLabelAvoided=!1,this.repeatIntervalFixed=!1,this.labelRepeatInterval=0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelAlongLine"}destroy(){var e=this;e.isAlongLine=null,e.alongLineDirection=null,e.angleFixed=null,e.repeatedLabelAvoided=null,e.repeatIntervalFixed=null,e.labelRepeatInterval=null}static fromObj(e){if(e){var t=new ir;return ee.copy(t,e),t}}}class rr{constructor(e){this.labelBackShape=v.NONE,this.backStyle=new Ae,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelBackground"}destroy(){this.labelBackShape=null,this.backStyle&&(this.backStyle.destroy(),this.backStyle=null)}static fromObj(e){if(e){var t=new rr;return t.labelBackShape=e.labelBackShape,t.backStyle=Ae.fromJson(e.backStyle),t}}}class sr extends Xi{constructor(e){super("LABEL",e),this.alongLine=new ir,this.background=new rr,this.items=null,this.uniqueItems=null,this.labelExpression=null,this.labelOverLengthMode=b.NONE,this.matrixCells=null,this.maxLabelLength=256,this.numericPrecision=0,this.offset=new $i,this.overlapAvoided=!0,this.rangeExpression=null,this.uniqueExpression=null,this.smallGeometryLabeled=!1,this.text=new tr,this.textSpace=0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabel"}destroy(){super.destroy();var e=this;if(e.alongLine=null,e.background&&(e.background.destroy(),e.background=null),e.items){for(var t=0,i=e.items,r=i.length;t<r;t++)i[t].destroy();e.items=null}if(e.uniqueItems){for(var s=0,n=e.uniqueItems,a=n.length;s<a;s++)n[s].destory();e.uniqueItems=null}e.labelExpression=null,e.labelOverLengthMode=null,e.matrixCells=null,e.maxLabelLength=null,e.numericPrecision=null,e.overlapAvoided=null,e.rangeExpression=null,e.uniqueExpression=null,e.offset&&(e.offset.destroy(),e.offset=null),e.overlapAvoided=null,e.smallGeometryLabeled=null,e.text&&(e.text.destroy(),e.text=null),e.textSpace=null}toJSON(){return ee.toJSON(this.toServerJSONObject())}toServerJSONObject(){var e={};return e.type=this.type,e.memoryData=this.memoryData,this.alongLine&&(e.alongLine=this.alongLine.isAlongLine,e.alongLineDirection=this.alongLine.alongLineDirection,e.angleFixed=this.alongLine.angleFixed,e.isLabelRepeated=this.alongLine.isLabelRepeated,e.labelRepeatInterval=this.alongLine.labelRepeatInterval,e.repeatedLabelAvoided=this.alongLine.repeatedLabelAvoided,e.repeatIntervalFixed=this.alongLine.repeatIntervalFixed),this.offset&&(e.offsetFixed=this.offset.offsetFixed,e.offsetX=this.offset.offsetX,e.offsetY=this.offset.offsetY),this.text&&(e.maxTextHeight=this.text.maxTextHeight,e.maxTextWidth=this.text.maxTextWidth,e.minTextHeight=this.text.minTextHeight,e.minTextWidth=this.text.minTextWidth,e.uniformStyle=this.text.uniformStyle,e.uniformMixedStyle=this.text.uniformMixedStyle),this.background&&(e.labelBackShape=this.background.labelBackShape,e.backStyle=this.background.backStyle),e.labelOverLengthMode=this.labelOverLengthMode,e.maxLabelLength=this.maxLabelLength,e.smallGeometryLabeled=this.smallGeometryLabeled,e.rangeExpression=this.rangeExpression,e.uniqueExpression=this.uniqueExpression,e.numericPrecision=this.numericPrecision,e.items=this.items,e.uniqueItems=this.uniqueItems,e.labelExpression=this.labelExpression,e.overlapAvoided=this.overlapAvoided,e.matrixCells=this.matrixCells,e.textSpace=this.textSpace,e}static fromObj(e){if(e){var t=new sr,i=e.items,r=e.uniqueItems,s=e.matrixCells;if(e.matrixCells=null,ee.copy(t,e),t.alongLine=ir.fromObj(e),t.background=rr.fromObj(e),i){t.items=[];for(var n=0,a=i.length;n<a;n++)t.items.push(Zi.fromObj(i[n]))}if(r){t.uniqueItems=[];for(let e=0,i=r.length;e<i;e++)t.uniqueItems.push(Ki.fromObj(r[e]))}if(s){t.matrixCells=[];for(let e=0,t=s.length;e<t;e++);}return t.offset=$i.fromObj(e),t.text=tr.fromObj(e),t}}}class nr extends Xi{constructor(e){super("UNIQUE",e),this.defaultStyle=new Ae,this.items=null,this.uniqueExpression=null,this.colorGradientType=m.YELLOW_RED,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeUnique"}destroy(){super.destroy();var e=this;if(e.uniqueExpression=null,e.colorGradientType=null,e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null)}toServerJSONObject(){var e={};if((e=ee.copyAttributes(e,this)).defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],i=e.items.length,r=0;r<i;r++)t.push(e.items[r].toServerJSONObject());e.items=t}return e}static fromObj(e){var t=new nr,i=e.items,r=i?i.length:0;ee.extend(t,e),t.items=[],t.defaultStyle=Ae.fromJson(e.defaultStyle);for(var s=0;s<r;s++)t.items.push(Ki.fromObj(i[s]));return t}}class ar{constructor(e){this.axesColor=new Me(0,0,0),this.axesDisplayed=!1,this.axesGridDisplayed=!1,this.axesTextDisplayed=!1,this.axesTextStyle=new Qi,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphAxes"}destroy(){var e=this;e.axesColor&&(e.axesColor.destroy(),e.axesColor=null),e.axesDisplayed=null,e.axesGridDisplayed=null,e.axesTextDisplayed=null,e.axesTextStyle&&(e.axesTextStyle.destroy(),e.axesTextStyle=null)}static fromObj(e){if(e){var t=new ar;return ee.copy(t,e),t.axesColor=Me.fromJson(e.axesColor),t.axesTextStyle=Qi.fromObj(e.axesTextStyle),t}}}class or{constructor(e){this.maxGraphSize=0,this.minGraphSize=0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphSize"}destroy(){this.maxGraphSize=null,this.minGraphSize=null}static fromObj(e){var t=new or;return ee.copy(t,e),t}}class lr{constructor(e){this.graphTextDisplayed=!1,this.graphTextFormat=u.CAPTION,this.graphTextStyle=new Qi,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphText"}destroy(){var e=this;e.graphTextDisplayed=null,e.graphTextFormat=null,e.graphTextStyle&&(e.graphTextStyle.destroy(),e.graphTextStyle=null)}static fromObj(e){var t=new lr;return ee.copy(t,e),t.graphTextStyle=Qi.fromObj(e.graphTextStyle),t}}class hr{constructor(e){this.caption=null,this.graphExpression=null,this.memoryDoubleValues=null,this.uniformStyle=new Ae,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphItem"}destroy(){this.caption=null,this.graphExpression=null,this.memoryDoubleValues=null,this.uniformStyle=null}static fromObj(e){if(e){var t=new hr;return ee.copy(t,e),t.uniformStyle=Ae.fromJson(e.uniformStyle),t}}}class ur extends Xi{constructor(e){super("GRAPH",e),this.barWidth=0,this.graduatedMode=p.CONSTANT,this.graphAxes=new ar,this.graphSize=new or,this.graphSizeFixed=!1,this.graphText=new lr,this.graphType=c.AREA,this.graphAxesTextDisplayMode=d.NONE,this.items=null,this.memoryKeys=null,this.negativeDisplayed=!1,this.offset=new $i,this.overlapAvoided=!0,this.roseAngle=0,this.startAngle=0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraph"}destroy(){super.destroy();var e=this;if(e.barWidth=null,e.graduatedMode=null,e.graphAxes&&(e.graphAxes.destroy(),e.graphAxes=null),e.graphSize&&(e.graphSize.destroy(),e.graphSize=null),e.graphSizeFixed=null,e.graphText&&(e.graphText.destroy(),e.graphText=null),e.graphType=null,e.items){for(var t=0,i=e.items,r=i.length;t<r;t++)i[t].destroy();e.items=null}e.memoryKeys=null,e.negativeDisplayed=null,e.offset&&(e.offset.destroy(),e.offset=null),e.overlapAvoided=null,e.roseAngle=null,e.startAngle=null,e.graphAxesTextDisplayMode=null}toJSON(){return ee.toJSON(this.toServerJSONObject())}toServerJSONObject(){var e={};return e.type=this.type,this.graphText&&(e.graphTextDisplayed=this.graphText.graphTextDisplayed,e.graphTextFormat=this.graphText.graphTextFormat,e.graphTextStyle=this.graphText.graphTextStyle),this.graphAxes&&(e.axesColor=this.graphAxes.axesColor,e.axesDisplayed=this.graphAxes.axesDisplayed,e.axesGridDisplayed=this.graphAxes.axesGridDisplayed,e.axesTextDisplayed=this.graphAxes.axesTextDisplayed,e.axesTextStyle=this.graphAxes.axesTextStyle),this.graphSize&&(e.maxGraphSize=this.graphSize.maxGraphSize,e.minGraphSize=this.graphSize.minGraphSize),this.offset&&(e.offsetFixed=this.offset.offsetFixed,e.offsetX=this.offset.offsetX,e.offsetY=this.offset.offsetY),e.barWidth=this.barWidth,e.graduatedMode=this.graduatedMode,e.graphSizeFixed=this.graphSizeFixed,e.graphType=this.graphType,e.graphAxesTextDisplayMode=this.graphAxesTextDisplayMode,e.items=this.items,e.memoryKeys=this.memoryKeys,e.negativeDisplayed=this.negativeDisplayed,e.overlapAvoided=this.overlapAvoided,e.roseAngle=this.roseAngle,e.startAngle=this.startAngle,e}static fromObj(e){var t=new ur,i=e.items,r=i?i.length:0;ee.copy(t,e),t.items=[],t.graphAxes=ar.fromObj(e),t.graphSize=or.fromObj(e),t.graphText=lr.fromObj(e),t.offset=$i.fromObj(e);for(var s=0;s<r;s++)t.items.push(hr.fromObj(i[s]));return t}}class cr extends Xi{constructor(e){super("DOTDENSITY",e),this.dotExpression=null,this.style=new Ae,this.value=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeDotDensity"}destroy(){var e=this;e.dotExpression=null,e.value=null,e.style&&(e.style.destroy(),e.style=null)}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){if(e){var t=new cr;return ee.copy(t,e),t.style=Ae.fromJson(e.style),t}}}class dr{constructor(e){this.negativeDisplayed=!1,this.negativeStyle=new Ae,this.positiveStyle=new Ae,this.zeroDisplayed=!1,this.zeroStyle=new Ae,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraduatedSymbolStyle"}destroy(){var e=this;e.negativeDisplayed=null,e.negativeStyle=null,e.positiveStyle=null,e.zeroDisplayed=null,e.zeroStyle=null}static fromObj(e){if(e){var t=new dr;return ee.copy(t,e),t.negativeStyle=Ae.fromJson(e.negativeStyle),t.positiveStyle=Ae.fromJson(e.positiveStyle),t.zeroStyle=Ae.fromJson(e.zeroStyle),t}}}class pr extends Xi{constructor(e){super("GRADUATEDSYMBOL",e),this.baseValue=0,this.expression=null,this.graduatedMode=p.CONSTAN,this.offset=new $i,this.style=new dr,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraduatedSymbol"}destroy(){super.destroy();var e=this;e.expression=null,e.graduatedMode=p.CONSTANT,e.offset&&(e.offset.destroy(),e.offset=null),e.style&&(e.style.destroy(),e.style=null)}toJSON(){return ee.toJSON(this.toServerJSONObject())}toServerJSONObject(){var e={};return e.type=this.type,e.memoryData=this.memoryData,e.baseValue=this.baseValue,e.expression=this.expression,e.graduatedMode=this.graduatedMode,this.offset&&(e.offsetFixed=this.offset.offsetFixed,e.offsetX=this.offset.offsetX,e.offsetY=this.offset.offsetY),this.style&&(e.negativeStyle=this.style.negativeStyle,e.negativeDisplayed=this.style.negativeDisplayed,e.positiveStyle=this.style.positiveStyle,e.zeroDisplayed=this.style.zeroDisplayed,e.zeroStyle=this.style.zeroStyle),e}static fromObj(e){if(e){var t=new pr;return ee.copy(t,e),t.offset=$i.fromObj(e),t.style=dr.fromObj(e),t}}}class fr{constructor(e){this.caption=null,this.end=0,this.start=0,this.style=new Ae,this.visible=!0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeRangeItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){if(e){var t=new fr;return ee.copy(t,e),t.style=Ae.fromJson(e.style),t}}}class mr extends Xi{constructor(e){super("RANGE",e),this.precision="1.0E-12",this.items=null,this.rangeExpression=null,this.rangeMode=f.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=m.YELLOW_RED,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeRange"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.rangeExpression=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(e){var t=new mr;ee.copy(t,e);var i=e.items,r=i?i.length:0;t.items=[];for(var s=0;s<r;s++)t.items.push(fr.fromObj(i[s]));return t}}}class yr{constructor(e){e=e||{},this.bounds=null,this.caption=null,this.description=null,this.name=null,this.queryable=null,this.subLayers=null,this.type=null,this.visible=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.UGCLayer"}destroy(){ee.reset(this)}fromJson(e){e=e||{},ee.extend(this,e);var t=this.bounds;t&&(this.bounds=new se(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y))}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class gr extends yr{constructor(e){super(e=e||{}),this.completeLineSymbolDisplayed=null,this.maxScale=null,this.minScale=null,this.minVisibleGeometrySize=null,this.opaqueRate=null,this.symbolScalable=null,this.symbolScale=null,this.overlapDisplayed=null,this.overlapDisplayedOptions=null,this.CLASS_NAME="SuperMap.UGCMapLayer"}destroy(){super.destroy(),ee.reset(this)}fromJson(e){super.fromJson(e)}toServerJSONObject(){return super.toServerJSONObject()}}class vr{constructor(e){this.foreignTableName=null,this.joinFilter=null,this.joinType=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.JoinItem"}destroy(){this.foreignTableName=null,this.joinFilter=null,this.joinType=null}toServerJSONObject(){var e={};return e=ee.copyAttributes(e,this)}}class br extends gr{constructor(e){super(e=e||{}),this.datasetInfo=null,this.displayFilter=null,this.joinItems=null,this.representationField=null,this.ugcLayerType=null,this.CLASS_NAME="SuperMap.UGCSubLayer"}fromJson(e){if(super.fromJson(e),this.datasetInfo&&(this.datasetInfo=new Bt(this.datasetInfo)),this.joinItems&&this.joinItems.length){for(var t=[],i=0;i<this.joinItems.length;i++)t[i]=new vr(this.joinItems[i]);this.joinItems=t}}destroy(){super.destroy(),ee.reset(this)}toServerJSONObject(){var e=super.toServerJSONObject();if(e.joinItems){for(var t=[],i=0;i<e.joinItems.length;i++)e.joinItems[i].toServerJSONObject&&(t[i]=e.joinItems[i].toServerJSONObject());e.joinItems=t}return e.datasetInfo&&e.datasetInfo.toServerJSONObject&&(e.datasetInfo=e.datasetInfo.toServerJSONObject()),e}}class _r extends br{constructor(e){super(e=e||{}),this.theme=null,this.themeElementPosition=null,this.CLASS_NAME="SuperMap.ServerTheme"}destroy(){super.destroy(),ee.reset(this)}fromJson(e){super.fromJson(e);var t=this.theme;switch(t&&t.type){case"LABEL":this.theme=sr.fromObj(t);break;case"UNIQUE":this.theme=nr.fromObj(t);break;case"GRAPH":this.theme=ur.fromObj(t);break;case"DOTDENSITY":this.theme=cr.fromObj(t);break;case"GRADUATEDSYMBOL":this.theme=pr.fromObj(t);break;case"RANGE":this.theme=mr.fromObj(t)}this.themeElementPosition&&(this.themeElementPosition=new re(this.themeElementPosition.x,this.themeElementPosition.y))}toServerJSONObject(){var e=super.toServerJSONObject();return e.themeElementPosition&&e.themeElementPosition.toServerJSONObject&&(e.themeElementPosition=e.themeElementPosition.toServerJSONObject()),e.theme&&e.theme.toServerJSONObject&&(e.theme=e.theme.toServerJSONObject()),e}}class Sr extends br{constructor(e){super(e=e||{}),this.colorDictionarys=null,this.brightness=null,this.colorGradientType=null,this.colors=null,this.contrast=null,this.dashStyle=null,this.gridType=null,this.horizontalSpacing=null,this.sizeFixed=null,this.solidStyle=null,this.specialColor=null,this.specialValue=null,this.specialValueTransparent=null,this.verticalSpacing=null,this.CLASS_NAME="SuperMap.Grid"}destroy(){super.destroy(),ee.reset(this)}fromJson(e){if(super.fromJson(e),this.specialColor&&(this.specialColor=new Me(this.specialColor.red,this.specialColor.green,this.specialColor.blue)),this.colors){var t,i=[];for(var r in this.colors)t=this.colors[r],i.push(new Me(t.red,t.green,t.blue));this.colors=i}if(this.dashStyle&&(this.dashStyle=new Ae(this.dashStyle)),this.solidStyle&&(this.solidStyle=new Ae(this.solidStyle)),this.colorDictionary){var s,n=[];for(var a in this.colorDictionary)s=this.colorDictionary[a],n.push(new Nt({elevation:a,color:s}));this.colorDictionarys=n}delete this.colorDictionary}toServerJSONObject(){var e=super.toServerJSONObject();return e.dashStyle&&e.dashStyle.toServerJSONObject&&(e.dashStyle=e.dashStyle.toServerJSONObject()),e.solidStyle&&e.solidStyle.toServerJSONObject&&(e.solidStyle=e.solidStyle.toServerJSONObject()),e}}class xr extends br{constructor(e){super(e=e||{}),this.brightness=null,this.colorSpaceType=null,this.contrast=null,this.displayBandIndexes=null,this.transparent=null,this.transparentColor=null,this.transparentColorTolerance=null,this.CLASS_NAME="SuperMap.Image"}destroy(){super.destroy(),ee.reset(this)}fromJson(e){super.fromJson(e),this.transparentColor&&(this.transparentColor=new Me(this.transparentColor.red,this.transparentColor.green,this.transparentColor.blue))}toServerJSONObject(){return super.toServerJSONObject()}}class wr extends br{constructor(e){super(e=e||{}),this.style=null,this.CLASS_NAME="SuperMap.Vector"}destroy(){super.destroy(),ee.reset(this)}fromJson(e){super.fromJson(e);var t=this.style;t&&(this.style=new Ae(t))}toServerJSONObject(){var e=super.toServerJSONObject();return e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}}class Cr extends tt{constructor(e,t){super(e,t),this.isTempLayers=!1,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.GetLayersInfoService"}destroy(){super.destroy(),ee.reset(this)}processAsync(){var e=this;e.isTempLayers||(e.url=ee.urlPathAppend(e.url,"layers")),e.request({method:"GET",params:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}serviceProcessCompleted(e,t){var i,r;r=(i=!!(e=ee.transformResult(e))&&e.length>0?e[0].subLayers.layers:null)?i.length:0,this.handleLayers(r,i),this.events.triggerEvent("processCompleted",{result:e[0],options:t})}handleLayers(e,t){var i;if(e)for(var r=0;r<e;r++){if(t[r].subLayers&&t[r].subLayers.layers&&t[r].subLayers.layers.length>0)this.handleLayers(t[r].subLayers.layers.length,t[r].subLayers.layers);else switch(t[r].ugcLayerType){case"THEME":(i=new _r).fromJson(t[r]),t[r]=i;break;case"GRID":(i=new Sr).fromJson(t[r]),t[r]=i;break;case"IMAGE":(i=new xr).fromJson(t[r]),t[r]=i;break;case"VECTOR":(i=new wr).fromJson(t[r]),t[r]=i}}}}class Mr{constructor(e){e&&(this.bounds=null,this.searchRadius=0,this.zValueFieldName=null,this.zValueScale=1,this.resolution=null,this.filterQueryParameter=null,this.outputDatasetName=null,this.outputDatasourceName=null,this.pixelFormat=null,this.dataset=null,this.inputPoints=null,this.InterpolationAnalystType="dataset",this.clipParam=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationAnalystParameters")}destroy(){var e=this;e.bounds=null,e.searchRadius=null,e.zValueFieldName=null,e.zValueScale=null,e.resolution=null,e.filterQueryParameter=null,e.outputDatasetName=null,e.pixelFormat=null}static toObject(e,t){for(var i in e)if("inputPoints"===i&&"geometry"===e.InterpolationAnalystType){for(var r=[],s=0;s<e.inputPoints.length;s++){var n=e.inputPoints[s],a={x:n.x,y:n.y,z:n.tag};r.push(a)}t[i]=r}else t[i]=e[i]}}class Ar extends Mr{constructor(e){super(e),this.smooth=.1,this.tension=40,this.searchMode=null,this.expectedCount=12,this.maxPointCountForInterpolation=200,this.maxPointCountInNode=50,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationRBFAnalystParameters"}destroy(){super.destroy();var e=this;e.smooth=null,e.tension=null,e.searchMode=null,e.expectedCount=null,e.maxPointCountForInterpolation=null,e.maxPointCountInNode=null}static toObject(e,t){for(var i in e)t[i]=e[i]}}class Tr extends Mr{constructor(e){super(e),e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationDensityAnalystParameters"}destroy(){super.destroy()}}class Er extends Mr{constructor(e){super(e),this.power=2,this.searchMode=null,this.expectedCount=12,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationIDWAnalystParameters"}destroy(){super.destroy();this.power=null,this.searchMode=null,this.expectedCount=null}}class Lr extends Mr{constructor(e){super(e),this.type=null,this.mean=null,this.angle=0,this.nugget=0,this.range=0,this.sill=0,this.variogramMode=O.SPHERICAL,this.exponent=P.EXP1,this.searchMode=null,this.expectedCount=12,this.maxPointCountForInterpolation=200,this.maxPointCountInNode=50,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationKrigingAnalystParameters"}destroy(){super.destroy();var e=this;e.type=null,e.mean=null,e.angle=null,e.nugget=null,e.range=null,e.sill=null,e.variogramMode=null,e.exponent=null,e.searchMode=null,e.expectedCount=null,e.maxPointCountForInterpolation=null,e.maxPointCountInNode=null}}class Or extends lt{constructor(e,t){super(e,t),this.mode=null,t&&ee.extend(this,t)}destroy(){super.destroy(),this.mode=null,this.CLASS_NAME="SuperMap.InterpolationAnalystService"}processAsync(e){var t={},i=this;e instanceof Tr?(i.mode="Density","geometry"===e.InterpolationAnalystType?i.url=ee.urlPathAppend(i.url,"geometry/interpolation/density"):i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/density")):e instanceof Er?(i.mode="IDW","geometry"===e.InterpolationAnalystType?i.url=ee.urlPathAppend(i.url,"geometry/interpolation/idw"):i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/idw")):e instanceof Ar?(i.mode="RBF","geometry"===e.InterpolationAnalystType?i.url=ee.urlPathAppend(i.url,"geometry/interpolation/rbf"):i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/rbf")):e instanceof Lr&&(i.mode="Kriging","geometry"===e.InterpolationAnalystType?i.url=ee.urlPathAppend(i.url,"geometry/interpolation/kriging"):i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/kriging")),Mr.toObject(e,t);var r=ee.toJSON(t);i.url=ee.urlAppend(i.url,"returnContent=true"),i.request({method:"POST",data:r,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}class Pr{constructor(e){e&&(this.datasetName="",this.query="",this.resolution=80,this.method=0,this.meshType=0,this.fields="",this.radius=300,this.meshSizeUnit=k.METER,this.radiusUnit=k.METER,this.areaUnit=F.SQUAREMILE,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.KernelDensityJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.method=null,this.radius=null,this.meshType=null,this.fields=null,this.meshSizeUnit=null,this.radiusUnit=null,this.areaUnit=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},"query"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class Nr extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/density"),this.CLASS_NAME="SuperMap.KernelDensityJobsService"}destroy(){super.destroy()}getKernelDensityJobs(){super.getJobs(this.url)}getKernelDensityJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addKernelDensityJob(e,t){super.addJob(this.url,e,Pr,t)}}class Ir{constructor(){this.CLASS_NAME="LabelMatrixCell"}}class Fr extends tt{constructor(e,t){super(e,t),this.projection=null,this.CLASS_NAME="SuperMap.MapService",t&&ee.extend(this,t);var i=this;if(i.projection){var r=i.projection.split(":");r instanceof Array&&(2===r.length&&(i.url=ee.urlAppend(i.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${r[1]}"}`)}`)),1===r.length&&(i.url=ee.urlAppend(i.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${r[0]}"}`)}`)))}this.eventCount=0}destroy(){super.destroy();var e=this;e.events&&(e.events.un(e.eventListeners),e.events.listeners=null,e.events.destroy(),e.events=null,e.eventListeners=null)}processAsync(e){let t=++this.eventCount,i={scope:this,processCompleted:function(r){if(t===r.result.eventId&&e)return delete r.result.eventId,e(r),this.events&&this.events.un(i),!1},processFailed:function(r){if((t===r.error.eventId||t===r.eventId)&&e)return e(r),this.events&&this.events.un(i),!1}};this.events.on(i);this.request({method:"GET",scope:this,success(e,i){e.eventId=t,this.serviceProcessCompleted(e,i)},failure(e,i){e.error&&(e.error.eventId=t),e.eventId=t,this.serviceProcessFailed(e,i)}})}serviceProcessCompleted(e,t){var i=(e=ee.transformResult(e)).code>=200&&e.code<300||0==e.code||304===e.code,r=e.code&&i;!e.code||r?this.events&&this.events.triggerEvent("processCompleted",{result:e,options:t}):this.events.triggerEvent("processFailed",{error:e,options:t})}}class kr{constructor(e){e&&(this.dataset=null,this.extractRegion=null,this.expression=null,this.isZip=!1,this.ignoreNoValue=!1,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.MathExpressionAnalysisParameters")}destroy(){var e=this;e.dataset=null,e.bounds=null,e.expression=null,e.isZip=!0,e.ignoreNoValue=!0,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var i in e)if("dataset"!==i&&(t[i]=e[i]),"extractRegion"===i&&e[i]){for(var r=e[i].components[0].components,s={},n=[],a=r.length,o=0;o<a-1;o++){var l={};l.x=r[o].x,l.y=r[o].y,n.push(l)}s.points=n,s.type="REGION",t[i]=s}}}class Dr extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.MathExpressionAnalysisService"}destroy(){super.destroy()}processAsync(e){var t=this,i={};e instanceof kr&&(t.url=ee.urlPathAppend(t.url,"datasets/"+e.dataset+"/mathanalyst")),kr.toObject(e,i);var r=ee.toJSON(i);t.url=ee.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}class Rr{constructor(e,t){e&&(this.geometry=e,this.unit=l.METER,this.prjCoordSys=null,this.distanceMode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.MeasureParameters")}destroy(){this.geometry=null,this.unit=null,this.prjCoordSys=null}}class Br extends tt{constructor(e,t){super(e,t),this.measureMode=o.DISTANCE,t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.MeasureService"}destroy(){super.destroy();this.measureMode=null}processAsync(e,t){if(!(e instanceof Rr))return;let i=++this.eventCount,r={scope:this,processCompleted:function(e){if(i===e.result.eventId&&t)return delete e.result.eventId,t(e),this.events&&this.events.un(r),!1},processFailed:function(e){if((i===e.error.eventId||i===e.eventId)&&t)return t(e),this.events&&this.events.un(r),!1}};this.events.on(r);var s,n,a=this,l=e.geometry;if(l){a.url=ee.urlPathAppend(a.url,a.measureMode===o.AREA?"area":"distance");var h,u,c,d=Le.fromGeometry(l);if(d)s=d.parts[0],n=d.points.splice(0,s),e.prjCoordSys?("object"==typeof e.prjCoordSys?h='{"epsgCode"'+(u=e.prjCoordSys.projCode).substring(u.indexOf(":"),u.length)+"}":"string"==typeof e.prjCoordSys&&(h='{"epsgCode"'+e.prjCoordSys.substring(e.prjCoordSys.indexOf(":"),e.prjCoordSys.length)+"}"),c={point2Ds:ee.toJSON(n),unit:e.unit,prjCoordSys:h,distanceMode:e.distanceMode||"Geodesic"}):c={point2Ds:ee.toJSON(n),unit:e.unit,distanceMode:e.distanceMode||"Geodesic"},a.request({method:"GET",params:c,scope:a,success(e,t){e.eventId=i,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=i),e.eventId=i,this.serviceProcessFailed(e,t)}})}}}class Gr extends lt{constructor(e,t){super(e,t),this.mode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.OverlayAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t={},i=this;e instanceof Ut?(i.mode="datasets",i.url=ee.urlPathAppend(i.url,"datasets/"+e.sourceDataset+"/overlay"),Ut.toObject(e,t)):e instanceof Ti&&(i.mode="geometry",e.operateGeometries&&e.sourceGeometries?(i.url=ee.urlPathAppend(i.url,"geometry/overlay/batch"),i.url=ee.urlAppend(i.url,"ignoreAnalystParam=true")):i.url=ee.urlPathAppend(i.url,"geometry/overlay"),Ti.toObject(e,t)),this.returnContent=!0;var r=ee.toJSON(t);i.request({method:"POST",data:r,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ur{constructor(e){e&&(this.datasetName="",this.datasetOverlay="",this.mode="",this.srcFields="",this.overlayFields="",this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.OverlayGeoJobParameter")}destroy(){this.datasetName=null,this.datasetOverlay=null,this.mode=null,this.srcFields=null,this.overlayFields=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!=i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class jr extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/overlay"),this.CLASS_NAME="SuperMap.OverlayGeoJobsService"}destroy(){super.destroy()}getOverlayGeoJobs(){super.getJobs(this.url)}getOverlayGeoJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addOverlayGeoJob(e,t){super.addJob(this.url,e,Ur,t)}}class zr extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,this.bounds=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryByBoundsParameters"}destroy(){super.destroy();this.returnContent=null,this.bounds&&(this.bounds=null)}}class Vr extends tt{constructor(e,i){super(e,i),this.returnContent=!1,this.format=t.GEOJSON,this.returnFeatureWithFieldCaption=!1,i&&ee.extend(this,i),this.CLASS_NAME="SuperMap.QueryService",this.url&&(i&&i.format&&(this.format=i.format.toUpperCase()),this.url=ee.urlPathAppend(this.url,"queryResults"))}destroy(){super.destroy();this.returnContent=null,this.format=null}processAsync(e){if(e instanceof Ot){var t,i=this,r=null;i.returnContent=e.returnContent,t=i.getJsonParameters(e),i.returnContent||(r=e.returnCustomResult)&&(i.url=ee.urlAppend(i.url,"returnCustomResult="+r)),i.returnFeatureWithFieldCaption=e.returnFeatureWithFieldCaption,i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}serviceProcessCompleted(e,i){e=ee.transformResult(e);var r=new Oe;if(e&&e.recordsets)for(var s=0,n=e.recordsets,a=n.length;s<a;s++)n[s].features&&(!0===this.returnFeatureWithFieldCaption&&n[s].features.map(e=>(e.fieldNames=n[s].fieldCaptions,e)),this.format===t.GEOJSON&&(n[s].features=r.toGeoJSON(n[s].features)));this.events.triggerEvent("processCompleted",{result:e,options:i})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}getQueryParameters(e){return new Ot({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class Jr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof zr))return null;var t,i="",r=e.bounds;return t=this.getQueryParameters(e),i+="'queryMode':'BoundsQuery','queryParameters':",i+=ee.toJSON(t),i="{"+(i+=",'bounds': {'rightTop':{'y':"+r.top+",'x':"+r.right+"},'leftBottom':{'y':"+r.bottom+",'x':"+r.left+"}}")+"}"}}class qr extends Ot{constructor(e){super(e=e||{}),this.geometry=null,this.isNearest=null,this.returnContent=!0,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryByDistanceParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.distance=null,e.isNearest=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}}class Hr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof qr){var t="",i=this.getQueryParameters(e),r=Le.fromGeometry(e.geometry);return t+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",t+=ee.toJSON(i),t="{"+(t+=",'geometry':"+ee.toJSON(r)+",'distance':"+e.distance)+"}"}}}class Wr extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=a.INTERSECT,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();this.returnContent=null,this.geometry=null,this.spatialQueryMode=null}}class Yr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Wr){var t,i="",r=e.geometry,s=Le.fromGeometry(r);return t=this.getQueryParameters(e),i+="'queryMode':'SpatialQuery','queryParameters':",i="{"+(i+=ee.toJSON(t)+",'geometry':"+ee.toJSON(s)+",'spatialQueryMode':"+ee.toJSON(e.spatialQueryMode))+"}"}}}class Xr extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();this.returnContent=null}}class Qr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Xr){var t,i="";return t=this.getQueryParameters(e),i+="'queryMode':'SqlQuery','queryParameters':",i="{"+(i+=ee.toJSON(t))+"}"}}}class Zr{constructor(e,t){this.options=t||{},this.url=e}queryByBounds(e,t,i){var r=this;new Jr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}queryByDistance(e,t,i){var r=this;new Hr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:i}).processAsync(e)}queryBySQL(e,t,i){var r=this;new Qr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:i}).processAsync(e)}queryByGeometry(e,t,i){var r=this;new Yr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:i}).processAsync(e)}_processFormat(e){return e||t.GEOJSON}}class Kr{constructor(e){if(!e)return this;this.sourceRoute=null,this.point=null,this.tolerance=null,this.isIgnoreGap=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.RouteCalculateMeasureParameters"}destroy(){var e=this;e.sourceRoute=null,e.point=null,e.tolerance&&(e.tolerance=null),e.isIgnoreGap&&(e.isIgnoreGap=!1)}}class $r extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteCalculateMeasureService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Kr){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){return this.url=ee.urlPathAppend(this.url,"geometry/calculatemeasure"),this.url=ee.urlAppend(this.url,"returnContent=true"),ee.toJSON(e)}}class es{constructor(e){if(!e)return this;this.sourceRoute=null,this.dataset=null,this.routeIDField=null,this.routeID=null,this.type=null,this.measure=null,this.offset=0,this.isIgnoreGap=!1,this.startMeasure=null,this.endMeasure=null;var t=e.sourceRoute,i={};if(t&&t instanceof X&&t.components){i.type=t.type,i.parts=t.parts;for(var r=[],s=0,n=t.components.length;s<n;s++)r=r.concat(t.components[s].components);i.points=r,e.sourceRoute=i}ee.extend(this,e),this.CLASS_NAME="SuperMap.RouteLocatorParameters"}destroy(){var e=this;e.sourceRoute=null,e.type=null,e.measure=null,e.offset=0,e.isIgnoreGap=!1,e.startMeasure=null,e.endMeasure=null,e.dataset=null,e.routeID=null,e.routeIDField=null}}class ts extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteLocatorService"}destroy(){super.destroy()}processAsync(e){if(e instanceof es){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){var t="geometry/routelocator";return e.dataset&&(t="datasets/"+e.dataset+"/linearreferencing/routelocator",e.sourceRoute=null),this.url=ee.urlPathAppend(this.url,t),this.url=ee.urlAppend(this.url,"returnContent=true"),ee.toJSON(e)}}class is{constructor(e){this.fieldNames=null,this.fieldValues=null,this.geometry=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ServerFeature"}destroy(){var e=this;e.fieldNames=null,e.fieldValues=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}toFeature(){var e,t,i,r,s={},n=this;for(var a in e=n.fieldNames,t=n.fieldValues,e)s[e[a]]=t[a];return n.geometry&&(i=n.geometry.toGeometry()),r=new xe(i,s),n.geometry&&n.geometry.id&&(r.fid=n.geometry.id),r}static fromJson(e){var t=null;if(e)return(t=e.geometry)&&(t=Le.fromJson(t)),new is({fieldNames:e.fieldNames,fieldValues:e.fieldValues,geometry:t})}}class rs{constructor(e){e&&(this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.SetDatasourceParameters")}destroy(){this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null}}class ss extends tt{constructor(e,t){super(e,t),t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerInfoService"}destroy(){super.destroy(),ee.reset(this)}processAsync(e){if(e){var t=ee.toJSON(e);this.request({method:"PUT",data:t,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}}class ns extends tt{constructor(e,t){super(e,t),this.resourceID=null,this.isTempLayers=!1,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.SetLayersInfoService"}destroy(){super.destroy(),ee.reset(this)}processAsync(e){if(e){var t,i=[],r=this,s="";r.isTempLayers?(r.url=ee.urlPathAppend(r.url,"tempLayersSet/"+r.resourceID),s="PUT"):(r.url=ee.urlPathAppend(r.url,"tempLayersSet"),s="POST"),e.subLayers||(e.subLayers={layers:[]}),e.subLayers.layers||(e.subLayers.layers=[]);var n=e.subLayers.layers,a=n.length;for(let e in n){if("GRID"===n[e].ugcLayerType){var o={},l=n[e].colorDictionarys;for(var h in l){o[l[h].elevation]=l[h].color}}n[e].colorDictionary=o,delete n[e].colorDictionarys}for(let e=0;e<a;e++)n[e].toJsonObject?i.push(n[e].toJsonObject()):i.push(n[e]);(t=ee.extend(t,e)).subLayers={layers:i},t.object=null;var u=ee.toJSON([t]);r.request({method:s,data:u,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class as{constructor(e){this.layerStatusList=[],this.holdTime=15,this.resourceID=null,e&&ee.extend(this,e)}destroy(){this.layerStatusList=null,this.holdTime=null,this.resourceID=null}toJSON(){var e="{";e+='"layers":[';for(var t=[],i=0,r=this.layerStatusList.length;i<r;i++)t.push(this.layerStatusList[i].toJSON());return e+=t,e+="]",e+="}"}}class os extends tt{constructor(e,t){super(e,t),this.lastparams=null,this.mapUrl=e,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerStatusService"}destroy(){super.destroy(),ee.reset(this)}processAsync(e){if(e instanceof as){var t=this;if(t.url=t.mapUrl,null==e.resourceID)t.url=ee.urlPathAppend(t.url,"tempLayersSet"),t.lastparams=e,t.request({method:"POST",scope:t,success:t.createTempLayerComplete,failure:t.serviceProcessFailed});else{t.url=ee.urlPathAppend(t.url,"tempLayersSet/"+e.resourceID),t.url=ee.urlAppend(t.url,"elementRemain=true&reference="+e.resourceID+"&holdTime="+e.holdTime.toString());var i="[{";i+='"type":"UGC",',null!=e.layerStatusList&&e.layerStatusList.length>0&&(i+='"subLayers":'+e.toJSON()),i+=',"visible":true,',i+='"name":"'+this.getMapName(this.mapUrl)+'"',i+="}]",t.request({method:"PUT",data:i,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}createTempLayerComplete(e){(e=ee.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams)}getMapName(e){var t=e;"/"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1));var i=t.lastIndexOf("/");return t.substring(i+1,t.length)}serviceProcessCompleted(e,t){null!=(e=ee.transformResult(e))&&null!=this.lastparams&&(e.newResourceID=this.lastparams.resourceID),this.events.triggerEvent("processCompleted",{result:e,options:t})}}class ls{constructor(e){e&&(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=a.CONTAIN,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class hs extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(){super.getJobs(this.url)}getQueryJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addQueryJob(e,t){super.addJob(this.url,e,ls,t)}}class us{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){ee.reset(this)}}class cs extends tt{constructor(e,t){super(e,t),t=t||{},ee.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),ee.reset(this)}processAsync(e){if(e instanceof us){var t=this;t.url=ee.urlPathAppend(t.url,"stops/keyword/"+e.keyWord),t.request({method:"GET",params:{returnPosition:e.returnPosition},scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class ds{constructor(e){e&&(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class ps extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(){super.getJobs(this.url)}getSummaryAttributesJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addSummaryAttributesJob(e,t){super.addJob(this.url,e,ds,t)}}class fs{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=D.AVERAGE,this.fields="",this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SummaryMeshJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.statisticModes=null,this.meshType=null,this.fields=null,this.regionDataset=null,this.type=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"type"!==i?"output"!==i?("SUMMARYMESH"===e.type&&"regionDataset"!==i||"SUMMARYREGION"===e.type&&!r(["meshType","resolution","query"],i))&&(t.analyst=t.analyst||{},"query"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):t.type=e[i]:(t.input=t.input||{},t.input[i]=e[i]);function r(e,t){for(var i=e.length;i--;)if(e[i]===t)return!0;return!1}}}class ms extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(){super.getJobs(this.url)}getSummaryMeshJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addSummaryMeshJob(e,t){super.addJob(this.url,e,fs,t)}}class ys{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.sumShape=!0,this.query="",this.standardSummaryFields=!1,this.standardFields="",this.standardStatisticModes="",this.weightedSummaryFields=!1,this.weightedFields="",this.weightedStatisticModes="",this.meshType=0,this.resolution=100,this.meshSizeUnit=k.METER,this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SummaryRegionJobParameter")}destroy(){this.datasetName=null,this.sumShape=null,this.regionDataset=null,this.query=null,this.standardSummaryFields=null,this.standardFields=null,this.standardStatisticModes=null,this.weightedSummaryFields=null,this.weightedFields=null,this.weightedStatisticModes=null,this.meshType=null,this.resolution=null,this.meshSizeUnit=null,this.type=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"type"!==i&&"type"!==i?"output"!==i?("SUMMARYREGION"===e.type||"SUMMARYMESH"===e.type&&"regionDataset"!==i)&&(t.analyst=t.analyst||{},"query"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):t.type=e[i]:(t.input=t.input||{},t.input[i]=e[i])}}class gs extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(){super.getJobs(this.url)}getSummaryRegionJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addSummaryRegionJob(e,t){super.addJob(this.url,e,ys,t)}}class vs{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.SupplyCenter"}destroy(){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null}static fromJson(e){if(e)return new vs({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class bs extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.SurfaceAnalystService"}destroy(){super.destroy()}processAsync(e){if(e instanceof zt){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){var t="",i={};if(e instanceof Vt)this.url=ee.urlPathAppend(this.url,"datasets/"+e.dataset+"/"+e.surfaceAnalystMethod.toLowerCase()),Vt.toObject(e,i),t=ee.toJSON(i);else{if(!(e instanceof Ei))return;this.url=ee.urlPathAppend(this.url,"geometry/"+e.surfaceAnalystMethod.toLowerCase()),t=ee.toJSON(e)}return this.returnContent=!0,t}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class _s{constructor(e){e&&(this.dataset=null,this.zFactor=1,this.averageCurvatureName=null,this.profileCurvatureName="",this.planCurvatureName="",this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationParameters")}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){for(var i in e)"dataset"!==i&&(t[i]=e[i])}}class Ss extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationService"}destroy(){super.destroy()}processAsync(e){var t=this,i={};e instanceof _s&&(t.url=ee.urlPathAppend(t.url,"datasets/"+e.dataset+"/terraincalculation/curvature")),_s.toObject(e,i);var r=ee.toJSON(i);t.url=ee.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}class xs{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new Ae,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeFlow"}destroy(){var e=this;e.flowEnabled=null,e.leaderLineDisplayed=null,e.leaderLineStyle&&(e.leaderLineStyle.destroy(),e.leaderLineStyle=null)}static fromObj(e){if(e){var t=new xs;return ee.copy(t,e),t.leaderLineStyle=Ae.fromJson(e.leaderLineStyle),t}}}class ws{constructor(e){this.caption=null,this.color=new Me,this.end=0,this.start=0,this.visible=!0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRangeItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.color&&(e.color.destroy(),e.color=null),e.visible=null}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(e){var t=new ws;return ee.copy(t,e),t.color=Me.fromJson(e.color),t}}}class Cs extends Xi{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=f.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=m.YELLOW_RED,this.reverseColor=!1,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRange"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.reverseColor=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(e){var t=new Cs;ee.copy(t,e);var i=e.items,r=i?i.length:0;t.items=[];for(var s=0;s<r;s++)t.items.push(ws.fromObj(i[s]));return t}}}class Ms{constructor(e){this.caption=null,this.color=new Me,this.unique=null,this.visible=!0,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridUniqueItem"}destroy(){var e=this;e.caption=null,e.unique=null,e.color&&(e.color.destroy(),e.color=null),e.visible=null}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){var t=new Ms;return ee.copy(t,e),t.color=Me.fromJson(e.color),t}}class As extends Xi{constructor(e){super("GRIDUNIQUE",e),this.defaultcolor=new Me,this.items=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridUnique"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultcolor&&(e.defaultcolor.destroy(),e.defaultcolor=null)}toServerJSONObject(){var e={};if((e=ee.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],i=e.items.length,r=0;r<i;r++)t.push(e.items[r].toServerJSONObject());e.items=t}return e}static fromObj(e){var t=new As,i=e.items,r=i?i.length:0;ee.extend(t,e),t.items=[],t.defaultcolor=Me.fromJson(e.defaultcolor);for(var s=0;s<r;s++)t.items.push(Ms.fromObj(i[s]));return t}}class Ts{constructor(e){this.caption=null,this.unique=null,this.offsetX=0,this.offsetY=0,this.visible=!0,this.style=new Qi,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelUniqueItem"}destroy(){var e=this;e.unique=null,e.caption=null,e.offsetX=null,e.offsetY=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}static fromObj(e){if(e){var t=new Ts;return ee.copy(t,e),t}}}class Es{constructor(e){this.datasetNames=null,this.dataSourceNames=null,this.joinItems=null,this.themes=null,this.displayFilters=null,this.displayOrderBys=null,this.fieldValuesDisplayFilter=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ThemeParameters"}destroy(){var e=this;if(e.datasetNames=null,e.dataSourceNames=null,e.joinItems){for(let t=0,i=e.joinItems,r=i.length;t<r;t++)i[t].destroy();e.joinItems=null}if(e.themes){for(let t=0,i=e.themes,r=i.length;t<r;t++)i[t].destroy();e.themes=null}}}class Ls extends tt{constructor(e,t){super(e,t),t&&ee.extend(this,t),this.eventCount=0,this.url=ee.urlPathAppend(this.url,"tempLayersSet"),this.CLASS_NAME="SuperMap.ThemeService"}destroy(){super.destroy()}processAsync(e,t){if(!(e instanceof Es))return;var i;i=this.getJsonParameters(e);let r=++this.eventCount,s={scope:this,processCompleted:function(e){if(r===e.result.eventId&&t)return delete e.result.eventId,t(e),this.events&&this.events.un(s),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&t)return t(e),this.events&&this.events.un(s),!1}};this.events.on(s),this.request({method:"POST",data:i,scope:this,success(e,t){e.eventId=r,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=r),e.eventId=r,this.serviceProcessFailed(e,t)}})}getJsonParameters(e){var t,i="",r=null,s=null,n=null;i+="[{'type': 'UGC','subLayers': {'layers': [";for(var a=0;a<e.themes.length;a++){r=e.themes[a];var o=ee.toJSON(r);if(i+="{'theme': "+(o=o.slice(0,-1))+"},'type': 'UGC','ugcLayerType': 'THEME',",(s=e.displayFilters)&&s.length>0&&(1===s.length?i+="'displayFilter':\""+s[0]+'",':i+="'displayFilter':\""+s[a]+'",'),(n=e.displayOrderBy)&&n.length>0&&(1===n.length?i+="'displayOrderBy':'"+n[0]+"',":i+="'displayOrderBy':'"+n[a]+"',"),(t=e.fieldValuesDisplayFilter)&&(i+="'fieldValuesDisplayFilter':"+ee.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[a]&&(i+="'joinItems':["+ee.toJSON(e.joinItems[a])+"],"),e.datasetNames&&e.dataSourceNames){var l=e.datasetNames[a]?a:e.datasetNames.length-1,h=e.dataSourceNames[a]?a:e.dataSourceNames.length-1;i+="'datasetInfo': {'name': '"+e.datasetNames[l]+"','dataSourceName': '"+e.dataSourceNames[h]+"'}},"}else i+="},"}e.themes&&e.themes.length>0&&(i=i.substring(0,i.length-1)),i+="]},";var u=this.url.split("/");return i+="'name': '"+u[u.length-2]+"'}]"}}class Os extends lt{constructor(e,t){super(e,t),this.mode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t={},i=this;e instanceof qt?(i.mode="datasets",i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/thiessenpolygon"),qt.toObject(e,t)):e instanceof Li&&(i.mode="geometry",i.url=ee.urlPathAppend(i.url,"geometry/thiessenpolygon"),Li.toObject(e,t));var r=ee.toJSON(t);this.returnContent=!0,i.request({method:"POST",data:r,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ps extends lt{constructor(e,t){super(e,t),t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e){var t=this;t.url=ee.urlPathAppend(t.url,"geometry/batchanalyst"),t.url=ee.urlAppend(t.url,"returnContent=true&ignoreAnalystParam=true");var i=t._processParams(e),r=ee.toJSON(i);t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}_processParams(e){var t=this;if(ee.isArray(e)){var i=[];return e.map(function(e){return i.push(t._toJSON(e)),e}),i}}_toJSON(e){var t={};if("buffer"===e.analystName)t.analystName="buffer",t.param={},yt.toObject(e.param,t.param);else if("overlay"===e.analystName)t.analystName="overlay",t.param={},Ti.toObject(e.param,t.param);else if("interpolationDensity"===e.analystName)t.analystName="interpolationDensity",t.param={},Mr.toObject(e.param,t.param);else if("interpolationidw"===e.analystName)t.analystName="interpolationidw",t.param={},Mr.toObject(e.param,t.param);else if("interpolationRBF"===e.analystName)t.analystName="interpolationRBF",t.param={},Mr.toObject(e.param,t.param);else if("interpolationKriging"===e.analystName)t.analystName="interpolationKriging",t.param={},Mr.toObject(e.param,t.param);else{if("thiessenpolygon"!==e.analystName)return e;t.analystName="thiessenpolygon",t.param={},Li.toObject(e.param,t.param)}return t}destroy(){super.destroy()}}class Ns extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(){if(this.url){var e=this;e.url=ee.urlPathAppend(e.url,"tilesets"),e.request({method:"GET",scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}}class Is{constructor(e){e&&(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=B.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class Fs extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(){super.getJobs(this.url)}getTopologyValidatorJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addTopologyValidatorJob(e,t){super.addJob(this.url,e,Is,t)}}class ks{constructor(e){e=e||{},this.lineID=null,this.lineName=null,this.lineAliasName=null,this.startStopIndex=null,this.startStopName=null,this.startStopAliasName=null,this.endStopIndex=null,this.endStopName=null,this.endStopAliasName=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransferLine"}destroy(){ee.reset(this)}static fromJson(e){if(e)return new ks({lineID:e.lineID,lineName:e.lineName,lineAliasName:e.lineAliasName,startStopIndex:e.startStopIndex,startStopName:e.startStopName,startStopAliasName:e.startStopAliasName,endStopIndex:e.endStopIndex,endStopName:e.endStopName,endStopAliasName:e.endStopAliasName})}}class Ds{constructor(e){e=e||{},this.transferLines=null,this.points=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){ee.reset(this)}static toJson(e){if(e)return ee.toJSON(e)}}class Rs extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ds){var t,i=this;i.url=ee.urlPathAppend(i.url,"path"),t={points:ee.toJSON(e.points),transferLines:ee.toJSON(e.transferLines)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class Bs{constructor(e){e=e||{},this.solutionCount=6,this.transferPreference=E.NONE,this.transferTactic=T.LESS_TIME,this.walkingRatio=null,this.points=!1,this.evadeLines=null,this.evadeStops=null,this.priorLines=null,this.priorStops=null,this.travelTime=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){ee.reset(this)}static toJson(e){if(e)return ee.toJSON(e)}}class Gs extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Bs){var t,i=this;i.url=ee.urlPathAppend(i.url,"solutions"),t={points:ee.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(t.evadeLines=ee.toJSON(e.evadeLines)),e.evadeStops&&(t.evadeStops=ee.toJSON(e.evadeStops)),e.priorLines&&(t.priorLines=ee.toJSON(e.priorLines)),e.priorStops&&(t.priorStops=ee.toJSON(e.priorStops)),e.travelTime&&(t.travelTime=e.travelTime),i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class Us{constructor(e){e&&(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",ee.extend(this,e),this.CLASS_NAME="SuperMap.UpdateEdgeWeightParameters")}destroy(){this.edgeId=null,this.fromNodeId=null,this.toNodeId=null,this.weightField=null,this.edgeWeight=null}}class js{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){this.datasourceName=null,this.datasetName=null,this.datasetType=null}}class zs extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Us){var t=this,i=t.parse(e);t.url=ee.urlPathAppend(t.url,i);var r=e.edgeWeight?e.edgeWeight:null;t.request({method:"PUT",scope:t,data:r,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}parse(e){if(e){var t="";for(var i in e)if(""!==e[i]&&"edgeWeight"!==e[i])switch(i){case"edgeId":t+="/edgeweight/"+e[i];break;case"fromNodeId":t+="/fromnode/"+e[i];break;case"toNodeId":t+="/tonode/"+e[i];break;case"weightField":t+="/weightfield/"+e[i]}return t}}}class Vs{constructor(e){e&&(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",ee.extend(this,e),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightParameters")}destroy(){this.nodeId=null,this.fromEdgeId=null,this.toEdgeId=null,this.weightField=null,this.turnNodeWeight=null}}class Js extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Vs){var t=this,i=t.parse(e);t.url=ee.urlPathAppend(t.url,i);var r=e.turnNodeWeight?e.turnNodeWeight:null;t.request({method:"PUT",scope:t,data:r,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}parse(e){if(e){var t="";for(var i in e)if(""!==e[i]&&"turnNodeWeight"!==e[i])switch(i){case"nodeId":t+="/turnnodeweight/"+e[i];break;case"fromEdgeId":t+="/fromedge/"+e[i];break;case"toEdgeId":t+="/toedge/"+e[i];break;case"weightField":t+="/weightfield/"+e[i]}return t}}}class qs{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.isFileCache=null,this.description=null,this.prjCoordSys=null,this.charset=null,this.palette=null,this.noValue=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.UpdateDatasetParameters")}destroy(){var e=this;e.datasourceName=null,e.datasetName=null,e.isFileCache=null,e.prjCoordSys=null,e.charset=null,e.palette=null,e.noValue=null}}class Hs{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=I.CLIP,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class Ws extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(){super.getJobs(this.url)}getVectorClipJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addVectorClipJob(e,t){super.addJob(this.url,e,Hs,t)}}class Ys{constructor(e){e=e||{},this.type=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.RasterFunctionParameter"}destroy(){this.type=null}}class Xs{constructor(e){this.name=null,this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobCustomItems",ee.extend(this,e)}destroy(){this.name=null,this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={name:this.name};return this.title&&(e.title=this.title),this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),ee.toJSON(e)}}class Qs{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobImage",ee.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl&&(e.picAsUrl=this.picAsUrl),this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),ee.toJSON(e)}}class Zs{constructor(e){this.name=null,this.layerType=null,this.url=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayers",ee.extend(this,e)}destroy(){this.name=null,this.layerType=null,this.url=null}}class Ks{constructor(e){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers=null,this.customItems=null,this.CLASS_NAME="SuperMap.WebPrintingJobLegendOptions",ee.extend(this,e)}destroy(){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers instanceof Zs&&(this.layers.destroy(),this.layers=null),this.customItems instanceof Xs&&(this.customItems.destroy(),this.customItems=null)}toJSON(){var e={title:this.title||""};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64?e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,""):this.customItems&&(e.customItems=this.customItems),ee.toJSON(e)}}class $s{constructor(e){this.center=null,this.scale=null,this.layerNames=null,this.image=null,this.layers=null,this.CLASS_NAME="SuperMap.WebPrintingJobLittleMapOptions",ee.extend(this,e)}destroy(){this.center=null,this.scale=null,this.layerNames=null,this.image instanceof Qs&&(this.image.destroy(),this.image=null),this.layers instanceof Zs&&(this.layers.destroy(),this.layers=null)}toJSON(){var e={scale:this.scale,center:this.center};return this.layerNames?e.layerNames=this.layerNames:this.layers&&(e.layers=this.layers),this.image&&(e.image=this.image),ee.toJSON(e)}}class en{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobNorthArrowOptions",ee.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),ee.toJSON(e)}}class tn{constructor(e){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null,this.CLASS_NAME="SuperMap.WebPrintingJobScaleBarOptions",ee.extend(this,e)}destroy(){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null}toJSON(){var e={scaleText:this.scaleText||"",type:this.type||"BAR",intervals:this.intervals||"",unit:this.unit||"METER"};return this.orientation&&(e.orientation=this.orientation),ee.toJSON(e)}}class rn{constructor(e){this.type=null,this.url=null,this.token=null,this.value=null,this.CLASS_NAME="SuperMap.WebPrintingJobContent",ee.extend(this,e)}destroy(){this.type="WEBMAP",this.url=null,this.token=null,this.value=null}toJSON(){var e={type:this.type};return this.token&&(e.token=this.token),this.url?e.url=this.url:this.value&&(e.value=this.value),ee.toJSON(e)}}class sn{constructor(e){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions=null,this.northArrowOptions=null,this.littleMapOptions=null,this.legendOptions=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayoutOptions",ee.extend(this,e)}destroy(){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions instanceof tn&&(this.scaleBarOptions.destroy(),this.scaleBarOptions=null),this.northArrowOptions instanceof en&&(this.northArrowOptions.destroy(),this.northArrowOptions=null),this.littleMapOptions instanceof $s&&(this.littleMapOptions.destroy(),this.littleMapOptions=null),this.legendOptions instanceof Ks&&(this.legendOptions.destroy(),this.legendOptions=null)}toJSON(){var e={templateName:this.templateName,title:this.title,subTitle:this.subTitle,author:this.author,copyright:this.copyright};return this.scaleBarOptions&&(e.scaleBarOptions=this.scaleBarOptions),this.northArrowOptions&&(e.northArrowOptions=this.northArrowOptions),this.littleMapOptions&&(e.littleMapOptions=this.littleMapOptions),this.legendOptions&&(e.legendOptions=this.legendOptions),ee.toJSON(e)}}class nn{constructor(e){this.format=null,this.dpi=96,this.scale=null,this.rotation=null,this.center=null,this.CLASS_NAME="SuperMap.WebPrintingJobExportOptions",ee.extend(this,e)}destroy(){this.format=null,this.dpi=null,this.scale=null,this.rotation=null,this.center=null,this.outputSize=null}toJSON(){var e={format:this.format||"PDF",dpi:this.dpi,scale:this.scale,center:this.center};return this.rotation&&(e.rotation=this.rotation),this.outputSize&&(e.outputSize=this.outputSize),ee.toJSON(e)}}class an extends tt{constructor(e,t){super(e,t),t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.WebPrintingService",this.url}destroy(){super.destroy()}createWebPrintingJob(e,t){e&&(e.layoutOptions&&e.layoutOptions.legendOptions&&(!e.layoutOptions.legendOptions.title&&(e.layoutOptions.legendOptions.title=""),e.layoutOptions.legendOptions.picAsBase64=e.layoutOptions.legendOptions.picAsBase64&&e.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/,""),e.layoutOptions.legendOptions.customItems&&e.layoutOptions.legendOptions.customItems.hasOwnProperty("picAsBase64")&&(e.layoutOptions.legendOptions.customItems.picAsBase64=e.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/,""))),this.processAsync("jobs","POST",t,e))}getPrintingJob(e,t){var i=this;i.processAsync(`jobs/${e}`,"GET",function(r){i.rollingProcess(r,i._processUrl(`jobs/${e}`),t)})}getPrintingJobResult(e,t){this.processAsync(`jobs/${e}/result`,"GET",t)}getLayoutTemplates(e){this.processAsync("layouts","GET",e)}rollingProcess(e,t,i){var r=this;if(e)var s=setInterval(function(){let e=++r.eventCount,n={scope:this,processCompleted:function(t){if(e===t.result.eventId&&i)return delete t.result.eventId,i(t),r.events.un(n),!1},processFailed:function(t){if((e===t.error.eventId||e===t.eventId)&&i)return i(t),r.events.un(n),!1}};r.events.on(n),r.request({url:t,method:"GET",scope:r,success:function(t,i){switch(t.eventId=e,t.status){case"FINISHED":clearInterval(s),r.serviceProcessCompleted(t,i);break;case"ERROR":clearInterval(s),r.serviceProcessFailed(t,i);break;case"RUNNING":r.events.triggerEvent("processRunning",t)}},failure:r.serviceProcessFailed})},1e3)}processAsync(e,t,i,r){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if(s===e.error.eventId||s===e.eventId)return i(e),this.events&&this.events.un(n),!1}};this.events.on(n);let a={url:this._processUrl(e),method:t,scope:this,success(e,t){e.eventId=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,this.serviceProcessFailed(e,t)}};r&&(a.data=ee.toJSON(r)),this.request(a)}_processUrl(e){return e?ee.urlPathAppend(this.url,e):this.url}}class on extends tt{constructor(e,t){super(e,t),this.options=t||{},t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e,t){var i={collectionId:this.options.collectionId},r=ee.convertPath("/collections/{collectionId}/legend",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"GET",params:e,callback:t})}getStatistics(e){var t={collectionId:this.options.collectionId},i=ee.convertPath("/collections/{collectionId}/statistics",t),r=ee.urlPathAppend(this.url,i);this._processAsync({url:r,method:"GET",callback:e})}getTileInfo(e){var t={collectionId:this.options.collectionId},i=ee.convertPath("/collections/{collectionId}/tileInfo",t),r=ee.urlPathAppend(this.url,i);this._processAsync({url:r,method:"GET",callback:e})}deleteItemByID(e,t){var i={collectionId:this.options.collectionId,featureId:e},r=ee.convertPath("/collections/{collectionId}/items/{featureId}",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"DELETE",callback:t})}getItemByID(e,t){var i={collectionId:this.options.collectionId,featureId:e},r=ee.convertPath("/collections/{collectionId}/items/{featureId}",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"GET",callback:t})}_processAsync({url:e,method:t,callback:i,params:r}){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(e),this.events&&this.events.un(n),!1}};this.events.on(n),this.request({method:t||"GET",url:e,params:r,scope:this,success(e,t){e.eventId=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,this.serviceProcessFailed(e,t)}})}}class ln extends tt{constructor(e,t){super(e,t),this.options=t||{},t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(e){var t=ee.convertPath("/collections"),i=ee.urlPathAppend(this.url,t);this._processAsync({url:i,mehtod:"GET",callback:e})}getCollectionByID(e,t){var i={collectionId:e},r=ee.convertPath("/collections/{collectionId}",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,mehtod:"GET",callback:t})}search(e,t){var i={...e||{}},r=ee.convertPath("/search"),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"POST",data:i,callback:t})}_processAsync({url:e,method:t,callback:i,data:r}){let s=++this.eventCount,n=this,a={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(a),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(e),this.events&&this.events.un(a),!1}};this.events.on(a),this.request({method:t||"GET",url:e,data:r,scope:this,success(e,t){e.eventId=s,n.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,n.serviceProcessFailed(e,t)}})}}class hn{constructor(e){this.include=void 0,this.exclude=void 0,this.CLASS_NAME="SuperMap.FieldsFilter",ee.extend(this,e)}destroy(){this.include=void 0,this.exclude=void 0}static constructFromObject(e,t){return e&&(t=t||new hn,e.hasOwnProperty("include")&&(t.include=e.include),e.hasOwnProperty("exclude")&&(t.exclude=e.exclude)),t}}class un{constructor(e){this.field=void 0,this.direction=un.Direction.ASC,this.CLASS_NAME="SuperMap.Sortby",ee.extend(this,e)}destroy(){this.field=void 0,this.direction="ASC"}static constructFromObject(e,t){return e&&(t=t||new un,e.hasOwnProperty("field")&&(t.field=e.field),e.hasOwnProperty("direction")&&(t.direction=e.direction)),t}}un.Direction={ASC:"ASC",DESC:"DESC"};class cn{constructor(e){this.bbox=void 0,this.collections=void 0,this.ids=void 0,this.limit=void 0,this.fields=void 0,this.query=void 0,this.sortby=void 0,this.CLASS_NAME="SuperMap.ImageSearchParameter",ee.extend(this,e)}destroy(){var e=this;e.bbox=void 0,e.collections=void 0,e.ids=void 0,e.limit=void 0,e.fields=void 0,e.query=void 0,e.sortby=void 0}static constructFromObject(e,t){return e&&(t=t||new cn,e.hasOwnProperty("bbox")&&(t.bbox=e.bbox),e.hasOwnProperty("collections")&&(t.collections=e.collections),e.hasOwnProperty("ids")&&(t.ids=e.ids),e.hasOwnProperty("limit")&&(t.limit=e.limit),e.hasOwnProperty("fields")&&(t.fields=hn.constructFromObject&&hn.constructFromObject(e.fields,{})||e.fields),e.hasOwnProperty("query")&&(t.query=e.query),e.hasOwnProperty("sortby")&&(t.sortby=e.sortby,e.sortby&&(t.sortby=e.sortby.map(e=>un.constructFromObject&&un.constructFromObject(e,{})||e)))),t}}class dn{constructor(e){this.stretchType=void 0,this.stdevCoefficient=void 0,this.gaussianCoefficient=void 0,this.useMedianValue=void 0,this.minPercent=void 0,this.maxPercent=void 0,this.CLASS_NAME="SuperMap.ImageStretchOption",ee.extend(this,e)}destroy(){var e=this;e.stretchType=void 0,e.stdevCoefficient=void 0,e.gaussianCoefficient=void 0,e.useMedianValue=void 0,e.minPercent=void 0,e.maxPercent=void 0}static constructFromObject(e,t){return e&&(t=t||new dn,e.hasOwnProperty("stretchType")&&(t.stretchType=e.stretchType),e.hasOwnProperty("stdevCoefficient")&&(t.stdevCoefficient=e.stdevCoefficient),e.hasOwnProperty("gaussianCoefficient")&&(t.gaussianCoefficient=e.gaussianCoefficient),e.hasOwnProperty("useMedianValue")&&(t.useMedianValue=e.useMedianValue),e.hasOwnProperty("minPercent")&&(t.minPercent=e.minPercent),e.hasOwnProperty("maxPercent")&&(t.maxPercent=e.maxPercent)),t}}dn.StretchType={NONE:"NONE",GAUSSIAN:"GAUSSIAN",PERCENTCLIP:"PERCENTCLIP",MINIMUMMAXIMUM:"MINIMUMMAXIMUM",STANDARDDEVIATION:"STANDARDDEVIATION"};class pn{constructor(e){this.displayMode=void 0,this.displayBands=void 0,this.stretchOption=void 0,this.interpolationMode=void 0,this.colorScheme=void 0,this.colorTable=void 0,this.brightness=void 0,this.contrast=void 0,this.noData=void 0,this.noDataColor=void 0,this.noDataTransparent=void 0,this.backgroundValue=void 0,this.backgroundColor=void 0,this.backgroundTransparent=void 0,this.gridFunctions=void 0,this.CLASS_NAME="SuperMap.ImageRenderingRule",ee.extend(this,e)}destroy(){var e=this;e.displayMode=void 0,e.displayBands=void 0,e.stretchOption=void 0,e.interpolationMode=void 0,e.colorScheme=void 0,e.colorTable=void 0,e.brightness=void 0,e.contrast=void 0,e.noData=void 0,e.noDataColor=void 0,e.noDataTransparent=void 0,e.backgroundValue=void 0,e.backgroundColor=void 0,e.backgroundTransparent=void 0,e.gridFuncOptions=void 0}static constructFromObject(e,t){return e&&(t=t||new pn,e.hasOwnProperty("displayMode")&&(t.displayMode=e.displayMode),e.hasOwnProperty("displayBands")&&(t.displayBands=e.displayBands),e.hasOwnProperty("stretchOption")&&(t.stretchOption=dn.constructFromObject&&dn.constructFromObject(e.stretchOption,{})||e.stretchOption),e.hasOwnProperty("interpolationMode")&&(t.interpolationMode=e.interpolationMode),e.hasOwnProperty("colorScheme")&&(t.colorScheme=e.colorScheme),e.hasOwnProperty("colorTable")&&(t.colorTable=e.colorTable),e.hasOwnProperty("brightness")&&(t.brightness=e.brightness),e.hasOwnProperty("contrast")&&(t.contrast=e.contrast),e.hasOwnProperty("noData")&&(t.noData=e.noData),e.hasOwnProperty("noDataColor")&&(t.noDataColor=e.noDataColor),e.hasOwnProperty("backgroundValue")&&(t.backgroundValue=e.backgroundValue),e.hasOwnProperty("noDataTransparent")&&(t.noDataTransparent=e.noDataTransparent),e.hasOwnProperty("backgroundColor")&&(t.backgroundColor=e.backgroundColor),e.hasOwnProperty("backgroundTransparent")&&(t.backgroundTransparent=e.backgroundTransparent),e.hasOwnProperty("gridFunctions")&&(t.gridFunctions=e.gridFunctions)),t}}pn.DisplayMode={COMPOSITE:"COMPOSITE",STRETCHED:"Stretched"},pn.InterpolationMode={NEARESTNEIGHBOR:"NEARESTNEIGHBOR",HIGHQUALITYBILINEAR:"HIGHQUALITYBILINEAR",DEFAULT:"DEFAULT"};class fn{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",ee.extend(this,e)}destroy(){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new fn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class mn{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",ee.extend(this,e)}destroy(){this.girdFuncName="GFAspect",this.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new mn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class yn{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",ee.extend(this,e)}destroy(){this.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new yn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class gn{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",ee.extend(this,e)}destroy(){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new gn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class vn{constructor(e){e=e||{},ee.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,i,r={}){return t=je.appendCredential(t),r.crossOrigin=this.options.crossOrigin,r.headers=this.options.headers,Ue.commit(e,t,i,r).then(function(e){return e.json()})}}class bn extends vn{constructor(e,t){super(e),t=t||{},this.MD5=null,this.type=null,this.userName=null,this.fileName=null,this.size=null,this.serviceStatus=null,this.serviceId=null,this.id=null,this.lastModfiedTime=null,this.status=null,this.storageId=null,this.publishInfo=null,this.authorizeSetting=null,this.nickname=null,this.tags=[],this.description=null,this.dataItemServices=null,this.coordType=null,this.dataCheckResult=null,this.dataMetaInfo=null,this.thumbnail=null,ee.extend(this,t),this.id&&(this.serviceUrl=e+"/"+this.id),this.CLASS_NAME="SuperMap.OnlineData"}load(){if(this.serviceUrl){var e=this;return e.request("GET",this.serviceUrl).then(function(t){ee.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}const _n=function(){try{return elasticsearch}catch(e){return{}}}();var Sn=i.n(_n);class xn{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Util"}clone(e){var t=this.BUILTIN_OBJECT;if("object"==typeof e&&null!==e){var i=e;if(e instanceof Array){i=[];for(var r=0,s=e.length;r<s;r++)i[r]=this.clone(e[r])}else if(!t[Object.prototype.toString.call(e)])for(var n in i={},e)e.hasOwnProperty(n)&&(i[n]=this.clone(e[n]));return i}return e}mergeItem(e,t,i,r){var s=this.BUILTIN_OBJECT;t.hasOwnProperty(i)&&("object"!=typeof e[i]||s[Object.prototype.toString.call(e[i])]?!r&&i in e||(e[i]=t[i]):this.merge(e[i],t[i],r))}merge(e,t,i){for(var r in t)this.mergeItem(e,t,r,i);return e}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(e,t){var i,r=this._canvas,s=this._pixelCtx,n=this._width,a=this._height,o=this._offsetX,l=this._offsetY;e+o>n&&(n=e+o+100,r.width=n,i=!0),t+l>a&&(a=t+l+100,r.height=a,i=!0),e<-o&&(n+=o=100*Math.ceil(-e/100),r.width=n,i=!0),t<-l&&(a+=l=100*Math.ceil(-t/100),r.height=a,i=!0),i&&s.translate(o,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1}inherits(e,t){var i=e.prototype;function r(){}for(var s in r.prototype=t.prototype,e.prototype=new r,i)e.prototype[s]=i[s];e.constructor=e}}class wn{constructor(){this.util=new xn,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Color"}customPalette(e){this.palette=e}resetPalette(){this.palette=this._palette}getColor(e,t){return e|=0,(t=t||this.palette)[e%t.length]}customHighlight(e){this.highlightColor=e}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(e,t,i,r,s,n,a){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var l=this._ctx.createRadialGradient(e,t,i,r,s,n),h=0,u=a.length;h<u;h++)l.addColorStop(a[h][0],a[h][1]);return l.__nonRecursion=!0,l}getLinearGradient(e,t,i,r,s){var n=this.util;this._ctx||(this._ctx=n.getContext());for(var a=this._ctx.createLinearGradient(e,t,i,r),o=0,l=s.length;o<l;o++)a.addColorStop(s[o][0],s[o][1]);return a.__nonRecursion=!0,a}getStepColors(e,t,i){e=this.toRGBA(e),t=this.toRGBA(t),e=this.getData(e);for(var r=[],s=((t=this.getData(t))[0]-e[0])/i,n=(t[1]-e[1])/i,a=(t[2]-e[2])/i,o=(t[3]-e[3])/i,l=0,h=e[0],u=e[1],c=e[2],d=e[3];l<i;l++)r[l]=this.toColor([this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(c),[0,255]),d.toFixed(4)-0],"rgba"),h+=s,u+=n,c+=a,d+=o;return h=t[0],u=t[1],c=t[2],d=t[3],r[l]=this.toColor([h,u,c,d],"rgba"),r}getGradientColors(e,t){var i=[],r=e.length;if(void 0===t&&(t=20),1===r)i=this.getStepColors(e[0],e[0],t);else if(r>1)for(var s=0,n=r-1;s<n;s++){var a=this.getStepColors(e[s],e[s+1],t);s<n-1&&a.pop(),i=i.concat(a)}return i}toColor(e,t){if(t=t||"rgb",e&&(3===e.length||4===e.length)){if(e=this.map(e,function(e){return e>1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var i=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=i[0],e[2]=i[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}toArray(e){(e=this.trim(e)).indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],i=0;return e.replace(/[\d.]+/g,function(e){i<3?e|=0:e=+e,t[i++]=e}),t}convert(e,t){if(!this.isCalculableColor(e))return e;var i=this.getData(e),r=i[3];return void 0===r&&(r=1),e.indexOf("hsb")>-1?i=this._HSV_2_RGB(i):e.indexOf("hsl")>-1&&(i=this._HSL_2_RGB(i)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?i=this._RGB_2_HSB(i):t.indexOf("hsl")>-1&&(i=this._RGB_2_HSL(i)),i[3]=r,this.toColor(i,t)}toRGBA(e){return this.convert(e,"rgba")}toRGB(e){return this.convert(e,"rgb")}toHex(e){return this.convert(e,"hex")}toHSVA(e){return this.convert(e,"hsva")}toHSV(e){return this.convert(e,"hsv")}toHSBA(e){return this.convert(e,"hsba")}toHSB(e){return this.convert(e,"hsb")}toHSLA(e){return this.convert(e,"hsla")}toHSL(e){return this.convert(e,"hsl")}toName(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}trim(e){return String(e).replace(/\s+/g,"")}normalize(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,i=(240&e)<<4,r=15&e;e="#"+((1<<24)+(t<<4)+t+(i<<4)+i+(r<<4)+r).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var i=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var r=this.getData(e),s=0;s<3;s++)r[s]=1===i?r[s]*(1-t)|0:(255-r[s])*t+r[s]|0;return"rgb("+r.join(",")+")"}reverse(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,function(e){return 255-e}),this.toColor(t,"rgb")}mix(e,t,i){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===i&&(i=.5);for(var r=2*(i=1-this.adjust(i,[0,1]))-1,s=this.getData(this.toRGBA(e)),n=this.getData(this.toRGBA(t)),a=s[3]-n[3],o=((r*a==-1?r:(r+a)/(1+r*a))+1)/2,l=1-o,h=[],u=0;u<3;u++)h[u]=s[u]*o+n[u]*l;var c=s[3]*i+n[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===s[3]&&1===n[3]?this.toColor(h,"rgb"):(h[3]=c,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(e){var t,i,r=(e=this.normalize(e)).match(this.colorRegExp);if(null===r)throw new Error("The color format error");var s,n=[];if(r[2])s=[(t=r[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],n=this.map(s,function(e){return wn.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(r[4]){var a=r[4].split(",");i=a[3],s=a.slice(0,3),n=this.map(s,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),wn.prototype.adjust.call(this,e,[0,255])}),void 0!==i&&n.push(this.adjust(parseFloat(i),[0,1]))}else if(r[5]||r[6]){var o=(r[5]||r[6]).split(","),l=parseInt(o[0],0)/360,h=o[1],u=o[2];i=o[3],(n=this.map([h,u],function(e){return wn.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==i&&n.push(this.adjust(parseFloat(i),[0,1]))}return n}alpha(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var i=this.getData(this.toRGBA(e));return i[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(i,"rgba")}map(e,t){if("function"!=typeof t)throw new TypeError;for(var i=e?e.length:0,r=0;r<i;r++)e[r]=t(e[r]);return e}adjust(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||"string"==typeof e}_HSV_2_RGB(e){var t,i,r,s=e[0],n=e[1],a=e[2];if(0===n)t=255*a,i=255*a,r=255*a;else{var o=6*s;6===o&&(o=0);var l=0|o,h=a*(1-n),u=a*(1-n*(o-l)),c=a*(1-n*(1-(o-l))),d=0,p=0,f=0;0===l?(d=a,p=c,f=h):1===l?(d=u,p=a,f=h):2===l?(d=h,p=a,f=c):3===l?(d=h,p=u,f=a):4===l?(d=c,p=h,f=a):(d=a,p=h,f=u),t=255*d,i=255*p,r=255*f}return[t,i,r]}_HSL_2_RGB(e){var t,i,r,s=e[0],n=e[1],a=e[2];if(0===n)t=255*a,i=255*a,r=255*a;else{var o,l=2*a-(o=a<.5?a*(1+n):a+n-n*a);t=255*this._HUE_2_RGB(l,o,s+1/3),i=255*this._HUE_2_RGB(l,o,s),r=255*this._HUE_2_RGB(l,o,s-1/3)}return[t,i,r]}_HUE_2_RGB(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}_RGB_2_HSB(e){var t,i,r=e[0]/255,s=e[1]/255,n=e[2]/255,a=Math.min(r,s,n),o=Math.max(r,s,n),l=o-a,h=o;if(0===l)t=0,i=0;else{i=l/o;var u=((o-r)/6+l/2)/l,c=((o-s)/6+l/2)/l,d=((o-n)/6+l/2)/l;r===o?t=d-c:s===o?t=1/3+u-d:n===o&&(t=2/3+c-u),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,i*=100,h*=100]}_RGB_2_HSL(e){var t,i,r=e[0]/255,s=e[1]/255,n=e[2]/255,a=Math.min(r,s,n),o=Math.max(r,s,n),l=o-a,h=(o+a)/2;if(0===l)t=0,i=0;else{i=h<.5?l/(o+a):l/(2-o-a);var u=((o-r)/6+l/2)/l,c=((o-s)/6+l/2)/l,d=((o-n)/6+l/2)/l;r===o?t=d-c:s===o?t=1/3+u-d:n===o&&(t=2/3+c-u),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,i*=100,h*=100]}}var Cn=new wn;var Mn=function(e){var t;if(e===l.METER)t=1;else if(e===l.DEGREE)t=2*Math.PI*6378137/360;else if(e===l.KILOMETER)t=.001;else if(e===l.INCH)t=1/.025399999918;else{if(e!==l.FOOT)return t;t=.3048}return t};function An(e,t,i,r,s=22){var n=[];if(e&&e.length>0)for(let t=0;t<e.length;t++)n.push(Tn(e[t],i,r));else{const e=Math.abs(t.left-t.right)/256;for(let t=0;t<s;t++)n.push(e/Math.pow(2,t))}return n.sort(function(e,t){return t-e})}function Tn(e,t,i){return 1/(e*t*(1/.0254)*Mn(i))}var En=i(52),Ln=i.n(En);class On{constructor(e){this.env=null,this.parser=null,this.ruleSet=null,this.cartoStr="",this.shaders=null,"string"==typeof e&&(this.cartoStr=e,this.env={frames:[],errors:[],error:function(e){this.errors.push(e)}},this.parser=this.getParser(this.env),this.parse(e),this.shaders=this.toShaders())}getParser(e){var t,i,r,s,n,a,o,l,h,u=this;function c(){s=o[r],n=i,l=i}function d(){o[r]=s,l=i=n}function p(){i>l&&(o[r]=o[r].slice(i-l),l=i)}function f(e){var s,n,a,u;if(e instanceof Function)return e.call(h.parsers);if("string"==typeof e)s=t.charAt(i)===e?e:null,n=1,p();else{if(p(),!(s=e.exec(o[r])))return null;n=s[0].length}if(s){var c=i+=n;for(u=i+o[r].length-n;i<u&&(32===(a=t.charCodeAt(i))||10===a||9===a);)i++;return o[r]=o[r].slice(n+(i-c)),l=i,0===o[r].length&&r<o.length-1&&r++,"string"==typeof s?s:1===s.length?s[0]:s}}function m(i){var r,s={index:a,filename:e.filename,message:"Parse error.",line:0,column:-1};for(var n in s)0===i[n]&&(i[n]=s[n]);r=i.filename&&u.env.inputs&&u.env.inputs[i.filename]?u.env.inputs[i.filename]:t,i.line=(r.slice(0,i.index).match(/\n/g)||"").length+1;for(var o=i.index;o>=0&&"\n"!==r.charAt(o);o--)i.column++;return new Error([i.filename,i.line,i.column,i.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},h={parse:function(s){var n,h=null;if(i=r=l=a=0,o=[],t=s.replace(/\r\n/g,"\n"),e.filename&&(u.env.inputs[e.filename]=t),o=function(e){for(var i,r,s,n,a=0,o=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,l=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,u=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,c=0,d=e[0],p=0;p<t.length;)if(o.lastIndex=p,(i=o.exec(t))&&i.index===p&&(p+=i[0].length,d.push(i[0])),s=t.charAt(p),l.lastIndex=u.lastIndex=p,(i=u.exec(t))&&i.index===p)p+=i[0].length,d.push(i[0]);else if(r||"/"!==s||"/"!==(n=t.charAt(p+1))&&"*"!==n||!(i=l.exec(t))||i.index!==p){switch(s){case"{":if(!r){c++,d.push(s);break}case"}":if(!r){c--,d.push(s),e[++a]=d=[];break}case"(":if(!r){r=!0,d.push(s);break}case")":if(r){r=!1,d.push(s);break}default:d.push(s)}p++}else p+=i[0].length,d.push(i[0]);return 0!==c&&(h={index:p-1,type:"Parse",message:c>0?"missing closing `}`":"missing opening `{`"}),e.map(function(e){return e.join("")})}([[]]),h)throw m(h);var c=function(e,t){var i=e.specificity,r=t.specificity;return i[0]!=r[0]?r[0]-i[0]:i[1]!=r[1]?r[1]-i[1]:i[2]!=r[2]?r[2]-i[2]:r[3]-i[3]};return(n=new On.Tree.Ruleset([],f(this.parsers.primary))).root=!0,n.toList=function(e){e.error=function(t){e.errors||(e.errors=new Error("")),e.errors.message?e.errors.message+="\n"+m(t).message:e.errors.message=m(t).message},e.frames=e.frames||[];var t=this.flatten([],[],e);return t.sort(c),t},n},parsers:{primary:function(){for(var e,t=[];(e=f(this.rule)||f(this.ruleset)||f(this.comment))||f(/^[\s\n]+/)||(e=f(this.invalid));)e&&t.push(e);return t},invalid:function(){var e=f(/^[^;\n]*[;\n]/);if(e)return new On.Tree.Invalid(e,n)},comment:function(){var e;if("/"===t.charAt(i))return"/"===t.charAt(i+1)?new On.Tree.Comment(f(/^\/\/.*/),!0):(e=f(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new On.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===t.charAt(i)||"'"===t.charAt(i)){var e=f(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new On.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(f("[")){var e=f(/(^[^\]]+)/);if(f("]"))return e?new On.Tree.Field(e[1]):void 0}},comparison:function(){var e=f(/^=~|=|!=|<=|>=|<|>/);if(e)return e},keyword:function(){var e=f(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new On.Tree.Keyword(e)},call:function(){var e,t;if(e=/^([\w\-]+|%)\(/.exec(o[r])){if("url"===(e=e[1]))return null;i+=e.length;if(f("("),t=f(this.entities.arguments),f(")"))return e?new On.Tree.Call(e,t,i):void 0}},arguments:function(){for(var e,t=[];e=f(this.expression);){t.push(e);if(!f(","))break}return t},literal:function(){return f(this.entities.dimension)||f(this.entities.keywordcolor)||f(this.entities.hexcolor)||f(this.entities.quoted)},url:function(){var e;if("u"===t.charAt(i)&&f(/^url\(/)){e=f(this.entities.quoted)||f(this.entities.variable)||f(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return f(")")?new On.Tree.URL(void 0!==e.value||e instanceof On.Tree.Variable?e:new On.Tree.Quoted(e)):new On.Tree.Invalid(e,n,"Missing closing ) in URL.")}},variable:function(){var r,s=i;if("@"===t.charAt(i)&&(r=f(/^@[\w-]+/)))return new On.Tree.Variable(r,s,e.filename)},hexcolor:function(){var e;if("#"===t.charAt(i)&&(e=f(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new On.Tree.Color(e[1])},keywordcolor:function(){var e=o[r].match(/^[a-z]+/);if(e&&e[0]in On.Tree.Reference.data.colors)return new On.Tree.Color(On.Tree.Reference.data.colors[f(/^[a-z]+/)])},dimension:function(){var e=t.charCodeAt(i);if(!(e>57||e<45||47===e)){var r=f(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return r?new On.Tree.Dimension(r[1],r[2],n):void 0}}},variable:function(){var e;if("@"===t.charAt(i)&&(e=f(/^(@[\w-]+)\s*:/)))return e[1]},entity:function(){var e=f(this.entities.call)||f(this.entities.literal),t=f(this.entities.field)||f(this.entities.variable),i=f(this.entities.url)||f(this.entities.keyword);return e||t||i},end:function(){var e;return f(";")||("string"==typeof(e="}")?t.charAt(i)===e:!!e.test(o[r]))},element:function(){var e=f(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new On.Tree.Element(e)},attachment:function(){var e=f(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(e)return e[1]},selector:function(){for(var e,r,s,a,o,l=[],h=new On.Tree.Filterset,u=[],c=0,d=0;(s=f(this.element))||(o=f(this.zoom))||(a=f(this.filter))||(e=f(this.attachment));){if(c++,s)l.push(s);else if(o)u.push(o),d++;else if(a){var p=h.add(a);if(p)throw m({message:p,index:i-1});d++}else{if(r)throw m({message:"Encountered second attachment name.",index:i-1});r=e}var y=t.charAt(i);if("{"===y||"}"===y||";"===y||","===y)break}if(c)return new On.Tree.Selector(h,u,l,r,d,n)},filter:function(){c();var t,i,r;if(f("[")&&(t=f(/^[a-zA-Z0-9\-_]+/)||f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.keyword)||f(this.entities.field))&&(t instanceof On.Tree.Quoted&&(t=new On.Tree.Field(t.toString())),(i=f(this.entities.comparison))&&(r=f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.dimension)||f(this.entities.keyword)||f(this.entities.field)))){if(!f("]"))throw m({message:"Missing closing ] of filter.",index:n-1});return t.is||(t=new On.Tree.Field(t)),new On.Tree.Filter(t,i,r,n,e.filename)}},zoom:function(){c();var e,t;if(f(/^\[\s*zoom/g)&&(e=f(this.entities.comparison))&&(t=f(this.entities.variable)||f(this.entities.dimension))&&f("]"))return new On.Tree.Zoom(e,t,n);d()},block:function(){var e;if(f("{")&&(e=f(this.primary))&&f("}"))return e},ruleset:function(){var e,t,i=[];for(c();e=f(this.selector);){for(i.push(e);f(this.comment););if(!f(","))break;for(;f(this.comment););}if(e)for(;f(this.comment););if(i.length>0&&(t=f(this.block))){if(1===i.length&&i[0].elements.length&&"Map"===i[0].elements[0].value){var r=new On.Tree.Ruleset(i,t);return r.isMap=!0,r}return new On.Tree.Ruleset(i,t)}d()},rule:function(){var r,s,o=t.charAt(i);if(c(),"."!==o&&"#"!==o&&(r=f(this.variable)||f(this.property))){if((s=f(this.value))&&f(this.end))return new On.Tree.Rule(r,s,n,e.filename);a=i,d()}},font:function(){for(var e,t=[],i=[];e=f(this.entity);)i.push(e);if(t.push(new On.Tree.Expression(i)),f(","))for(;(e=f(this.expression))&&(t.push(e),f(",")););return new On.Tree.Value(t)},value:function(){for(var e,t=[];(e=f(this.expression))&&(t.push(e),f(",")););return t.length>1?new On.Tree.Value(t.map(function(e){return e.value[0]})):1===t.length?new On.Tree.Value(t):void 0},sub:function(){var e;if(f("(")&&(e=f(this.expression))&&f(")"))return e},multiplication:function(){var e,t,i,r;if(e=f(this.operand)){for(;(i=f("/")||f("*")||f("%"))&&(t=f(this.operand));)r=new On.Tree.Operation(i,[r||e,t],n);return r||e}},addition:function(){var e,r,s,a;if(e=f(this.multiplication)){for(;(s=f(/^[-+]\s+/)||" "!=t.charAt(i-1)&&(f("+")||f("-")))&&(r=f(this.multiplication));)a=new On.Tree.Operation(s,[a||e,r],n);return a||e}},operand:function(){return f(this.sub)||f(this.entity)},expression:function(){for(var e,t=[];e=f(this.addition)||f(this.entity);)t.push(e);if(t.length>0)return new On.Tree.Expression(t)},property:function(){var e=f(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(e)return e[1]}}}}parse(e){var t=this.parser;return this.ruleSet=t.parse(e)}toShaders(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var i={},r=[];this._toShaders(i,r,t);for(var s=[],n={},a=0,o=t.length;a<o;++a){var l=t[a],h=l.attachment,u=i[r[a]],c=[];if(!n[h]){var d=0;for(var p in u)if("zoom"!==p&&"frames"!==p&&"attachment"!==p&&"elements"!=p)if("layer-index"===p){var f=(u[p].join("\n"),null);Object.defineProperty(c,"layerIndex",{configurable:!0,enumerable:!1,value:f})}else c[d++]=function(e,t){if(!Array.isArray(e))return e;var i=e.join("\n"),r='attributes["FEATUREID"]&&attributes["FEATUREID"]',s=i.indexOf(r);if(s>=0){if(!t.featureFilter){var n=s+r.length,a=i.indexOf(")",n+1),o="featureId&&(featureId"+i.substring(n,a)+")";Object.defineProperty(t,"featureFilter",{configurable:!0,enumerable:!1,value:function(e){return!!o}})}return{property:p,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+i+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+i+"; return _value; ")}}(u[p],c);Object.defineProperty(c,"attachment",{configurable:!0,enumerable:!1,value:h}),Object.defineProperty(c,"elements",{configurable:!0,enumerable:!1,value:l.elements}),s.push(c),n[r[a]]=!0}Object.defineProperty(c,"zoom",{configurable:!0,enumerable:!1,value:l.zoom})}return s}}return null}_toShaders(e,t,i){for(let r=0,s=i.length;r<s;++r){let s=i[r],n=[];for(let e=0,t=s.elements.length;e<t;e++)n.push(s.elements[e]);let a=s.filters.filters,o=[];for(let e in a)o.push(a[e].id);let l=n.join("/")+"::"+s.attachment+"_"+o.join("_");t.push(l);let h=e[l]=e[l]||{};h.zoom=On.Tree.Zoom.all;let u=s.toJS(this.env);for(let e in u)(h[e]=h[e]||[]).push(u[e].join("\n"))}}getShaders(){return this.shaders}destroy(){this.cartoStr=null,this.env=null,this.ruleSet=null,this.parser=null,this.shaders=null}}var Pn={version:"2.1.1",style:{"filter-mode":{type:["all","first"],doc:"Control the processing behavior of Rule filters within a Style. If 'all' is used then all Rules are processed sequentially independent of whether any previous filters matched. If 'first' is used then it means processing ends after the first match (a positive filter evaluation) and no further Rules in the Style are processed ('first' is usually the default for CSS implementations on top of Mapnik to simplify translation from CSS to Mapnik XML)","default-value":"all","default-meaning":"All Rules in a Style are processed whether they have filters or not and whether or not the filter conditions evaluate to true."},"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},layer:{name:{"default-value":"",type:"string",required:!0,"default-meaning":"No layer name has been provided",doc:"The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"},srs:{"default-value":"",type:"string","default-meaning":"No srs value is provided and the value will be inherited from the Map's srs",doc:"The spatial reference system definition for the layer, aka the projection. Can either be a proj4 literal string like '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' or, if the proper proj4 epsg/nad/etc identifier files are installed, a string that uses an id like: '+init=epsg:4326'"},status:{"default-value":!0,type:"boolean","default-meaning":"This layer will be marked as active and available for processing",doc:"A property that can be set to false to disable this layer from being processed"},minzoom:{"default-value":"0",type:"float","default-meaning":"The layer will be visible at the minimum possible scale",doc:"The minimum scale denominator that this layer will be visible at. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};On.mapnik_reference={version:{latest:Pn,"2.1.1":Pn}},On.Tree={},On.Tree.operate=function(e,t,i){switch(e){case"+":return t+i;case"-":return t-i;case"*":return t*i;case"%":return t%i;case"/":return t/i}},On.Tree.functions={rgb:function(e,t,i){return this.rgba(e,t,i,1)},rgba:function(e,t,i,r){var s=this,n=[e,t,i].map(function(e){return s.number(e)});return r=s.number(r),n.some(isNaN)||isNaN(r)?null:new On.Tree.Color(n,r)},stop:function(e){var t,i;return arguments.length>1&&(t=arguments[1]),arguments.length>2&&(i=arguments[2]),{is:"tag",val:e,color:t,mode:i,toString:r=>'\n\t<stop value="'+e.ev(r)+'"'+(t?' color="'+t.ev(r)+'" ':"")+(i?' mode="'+i.ev(r)+'" ':"")+"/>"}},hsl:function(e,t,i){return this.hsla(e,t,i,1)},hsla:function(e,t,i,r){if([e=this.number(e)%360/360,t=this.number(t),i=this.number(i),r=this.number(r)].some(isNaN))return null;var s=i<=.5?i*(t+1):i+t-i*t,n=2*i-s;return this.rgba(255*a(e+1/3),255*a(e),255*a(e-1/3),r);function a(e){return 6*(e=e<0?e+1:e>1?e-1:e)<1?n+(s-n)*e*6:2*e<1?s:3*e<2?n+(s-n)*(2/3-e)*6:n}},hue:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new On.Tree.Dimension(e.toHSL().a):null},saturate:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.s+=t.value/100,i.s=this.clamp(i.s),this.hsla_simple(i)},desaturate:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.s-=t.value/100,i.s=this.clamp(i.s),this.hsla_simple(i)},lighten:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.l+=t.value/100,i.l=this.clamp(i.l),this.hsla_simple(i)},darken:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.l-=t.value/100,i.l=this.clamp(i.l),this.hsla_simple(i)},fadein:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.a+=t.value/100,i.a=this.clamp(i.a),this.hsla_simple(i)},fadeout:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.a-=t.value/100,i.a=this.clamp(i.a),this.hsla_simple(i)},spin:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL(),r=(i.h+t.value)%360;return i.h=r<0?360+r:r,this.hsla_simple(i)},replace:function(e,t,i){return"field"===e.is?e.toString+".replace("+t.toString()+", "+i.toString()+")":e.replace(t,i)},mix:function(e,t,i){var r=i.value/100,s=2*r-1,n=e.toHSL().a-t.toHSL().a,a=((s*n==-1?s:(s+n)/(1+s*n))+1)/2,o=1-a,l=[e.rgb[0]*a+t.rgb[0]*o,e.rgb[1]*a+t.rgb[1]*o,e.rgb[2]*a+t.rgb[2]*o],h=e.alpha*r+t.alpha*(1-r);return new On.Tree.Color(l,h)},greyscale:function(e){return this.desaturate(e,new On.Tree.Dimension(100))},"%":function(e){for(var t=Array.prototype.slice.call(arguments,1),i=e.value,r=0;r<t.length;r++)i=i.replace(/%s/,t[r].value).replace(/%[da]/,t[r].toString());return i=i.replace(/%%/g,"%"),new On.Tree.Quoted(i)},hsla_simple:function(e){return this.hsla(e.h,e.s,e.l,e.a)},number:function(e){return e instanceof On.Tree.Dimension?parseFloat("%"===e.unit?e.value/100:e.value):"number"==typeof e?e:NaN},clamp:function(e){return Math.min(1,Math.max(0,e))}},On.Tree.Call=class{constructor(e,t,i){this.is="call",this.name=e,this.args=t,this.index=i}ev(e){for(var t=this.args.map(function(t){return t.ev(e)}),i=0;i<t.length;i++)if("undefined"===t[i].is)return{is:"undefined",value:"undefined"};if(this.name in On.Tree.functions){if(On.Tree.functions[this.name].length<=t.length){var r=On.Tree.functions[this.name].apply(On.Tree.functions,t);return null===r?(e.error({message:"incorrect arguments given to "+this.name+"()",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r}return e.error({message:"incorrect number of arguments for "+this.name+"(). "+On.Tree.functions[this.name].length+" expected.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}}var s=On.Tree.Reference.mapnikFunctions[this.name];if(void 0===s){var n=Ln()(On.Tree.Reference.mapnikFunctions),a=this.name,o=n.map(function(e){return[e[0],On.Tree.Reference.editDistance(a,e[0]),e[1]]}).sort(function(e,t){return e[1]-t[1]});return e.error({message:"unknown function "+this.name+"(), did you mean "+o[0][0]+"("+o[0][2]+")",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}}return s!==t.length&&-1!==s?(e.error({message:"function "+this.name+"() takes "+s+" arguments and was given "+t.length,index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):(this.args=t,this)}toString(e,t){return this.args.length?this.name+"("+this.args.join(",")+")":this.name}},On.Tree.Color=class{constructor(e,t){this.is="color",Array.isArray(e)?this.rgb=e.slice(0,3):6==e.length?this.rgb=e.match(/.{2}/g).map(function(e){return parseInt(e,16)}):this.rgb=e.split("").map(function(e){return parseInt(e+e,16)}),"number"==typeof t?this.alpha=t:4===e.length?this.alpha=e[3]:this.alpha=1}ev(){return this}toString(){return"rgba("+this.rgb.map(function(e){return Math.round(e)}).concat(this.alpha).join(", ")+")"}operate(e,t,i){var r=[];i instanceof On.Tree.Color||(i=i.toColor());for(var s=0;s<3;s++)r[s]=On.Tree.operate(t,this.rgb[s],i.rgb[s]);return new On.Tree.Color(r)}toHSL(){var e,t,i=this.rgb[0]/255,r=this.rgb[1]/255,s=this.rgb[2]/255,n=this.alpha,a=Math.max(i,r,s),o=Math.min(i,r,s),l=(a+o)/2,h=a-o;if(a===o)e=t=0;else{switch(t=l>.5?h/(2-a-o):h/(a+o),a){case i:e=(r-s)/h+(r<s?6:0);break;case r:e=(s-i)/h+2;break;case s:e=(i-r)/h+4}e/=6}return{h:360*e,s:t,l,a:n}}},On.Tree.Comment=class{constructor(e,t){this.value=e,this.silent=!!t}toString(e){return"\x3c!--"+this.value+"--\x3e"}ev(){return this}},On.Tree.Definition=class{constructor(e,t){this.elements=e.elements,this.rules=t,this.ruleIndex={};for(var i=0;i<this.rules.length;i++)"zoom"in this.rules[i]&&(this.rules[i]=this.rules[i].clone()),this.rules[i].zoom=e.zoom,this.ruleIndex[this.rules[i].updateID()]=!0;this.filters=e.filters,this.zoom=e.zoom,this.attachment=e.attachment||"__default__",this.specificity=e.specificity()}toString(){for(var e=this.filters.toString(),t=0;t<this.rules.length;t++)e+="\n "+this.rules[t];return e}toJS(e){var t={},i=this.zoom,r=this.filters.toJS(e),s=[i];function n(i){if(i instanceof On.Tree.Rule)t[i.name]=t[i.name]||[],r?t[i.name].push("if("+r+"){"+i.value.toJS(e)+"}"):t[i.name].push(i.value.toJS(e));else if(i instanceof On.Tree.Ruleset){var s=i.toJS(e);for(var n in s)for(var a in t[n]=t[n]||[],s[n])t[n].push(s[n][a])}}for(var a in r&&s.push(r),r=s.join(" && "),this.rules)n(this.rules[a]);return t}},On.Tree.Dimension=class{constructor(e,t,i){this.is="float",this.physical_units=["m","cm","in","mm","pt","pc"],this.screen_units=["px","%"],this.all_units=["m","cm","in","mm","pt","pc","px","%"],this.densities={m:.0254,mm:25.4,cm:2.54,pt:72,pc:6},this.value=parseFloat(e),this.unit=t||null,this.index=i}ev(e){if(this.unit&&this.all_units.indexOf(this.unit)<0)return e.error({message:"Invalid unit: '"+this.unit+"'",index:this.index}),{is:"undefined",value:"undefined"};if(this.unit&&this.physical_units.indexOf(this.unit)>=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}toColor(){return new On.Tree.Color([this.value,this.value,this.value])}round(){return this.value=Math.round(this.value),this}toString(){return this.value.toString()}operate(e,t,i){return"%"===this.unit&&"%"!==i.unit?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===i.unit?"*"===t||"/"===t||"%"===t?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new On.Tree.Dimension(On.Tree.operate(t,this.value,this.value*i.value*.01),this.unit):new On.Tree.Dimension(On.Tree.operate(t,this.value,i.value),this.unit||i.unit)}},On.Tree.Element=class{constructor(e){this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")}specificity(){return["id"===this.type?1:0,"class"===this.type?1:0]}toString(){return this.value}},On.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new On.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}toString(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}},On.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}},On.Tree.Filter=class{constructor(e,t,i,r,s){this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=t,this.val=i,this.index=r,this.filename=s,this.id=this.key+this.op+this.val}ev(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}toString(){return"["+this.id+"]"}},On.Tree.Filterset=class{constructor(){this.filters={}}toJS(e){function t(e){var t=e.op;"="===t&&(t="==");var i=e.val;void 0!==e._val&&(i=e._val.toString(!0)),e.key&&"scale"===e.key.value?i=+i:"string"!=typeof i&&"object"!=typeof i||(i="'"+i+"'");var r="attributes";return r+"&&"+r+e.key+"&&"+r+e.key+" "+t+i}var i=[];for(var r in this.filters)i.push(t(this.filters[r]));return i.join(" && ")}toString(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join("\t")}ev(e){for(var t in this.filters)this.filters[t].ev(e);return this}clone(){var e=new On.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}cloneWith(e){var t=[];for(var i in e.filters){var r=this.addable(e.filters[i]);if(!1===r)return!1;!0===r&&t.push(e.filters[i])}if(!t.length)return null;var s=new On.Tree.Filterset;for(i in this.filters)s.filters[i]=this.filters[i];for(;i=t.shift();)s.add(i);return s}addable(e){var t=e.key.toString(),i=e.val.toString();switch(i.match(/^[0-9]+(\.[0-9]*)?_match/)&&(i=parseFloat(i)),e.op){case"=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val.toString()==i&&null:void 0===this.filters[t+"!="+i]&&(!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i)&&(!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i)&&!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<i))));case"=~":return!0;case"!=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val!==i&&null:void 0!==this.filters[t+"!="+i]?null:void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i?null:void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i?null:void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<i)||null;case">":return t+"="in this.filters?!(this.filters[t+"="].val<=i)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=i)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i)||null));case">=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val<i)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<i)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=i)||null));case"<":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>=i)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=i)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<i)||null));case"<=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>i)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=i)||null))}}conflict(e){var t=e.key.toString(),i=e.val.toString();return isNaN(parseFloat(i))||(i=parseFloat(i)),("="===e.op&&void 0!==this.filters[t+"="]&&i!=this.filters[t+"="].val.toString()||"!="===e.op&&void 0!==this.filters[t+"="]&&i==this.filters[t+"="].val.toString()||"="===e.op&&void 0!==this.filters[t+"!="]&&i===this.filters[t+"!="].val.toString())&&e.toString()+" added to "+this.toString()+" produces an invalid filter"}add(e,t){var i,r=e.key.toString(),s=e.op,n=this.conflict(e);if(n)return n;if("="===s){for(var a in this.filters)this.filters[a].key===r&&delete this.filters[a];this.filters[r+"="]=e}else if("!="===s)this.filters[r+"!="+e.val]=e;else if("=~"===s)this.filters[r+"=~"+e.val]=e;else if(">"===s){for(var o in this.filters)this.filters[o].key===r&&this.filters[o].val<=e.val&&delete this.filters[o];this.filters[r+">"]=e}else if(">="===s){for(var l in this.filters)i=+this.filters[l].val.toString(),this.filters[l].key===r&&i<e.val&&delete this.filters[l];void 0!==this.filters[r+"!="+e.val]?(delete this.filters[r+"!="+e.val],e.op=">",this.filters[r+">"]=e):this.filters[r+">="]=e}else if("<"===s){for(var h in this.filters)i=+this.filters[h].val.toString(),this.filters[h].key===r&&i>=e.val&&delete this.filters[h];this.filters[r+"<"]=e}else if("<="===s){for(var u in this.filters)i=+this.filters[u].val.toString(),this.filters[u].key===r&&i>e.val&&delete this.filters[u];void 0!==this.filters[r+"!="+e.val]?(delete this.filters[r+"!="+e.val],e.op="<",this.filters[r+"<"]=e):this.filters[r+"<="]=e}}},On.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}},On.Tree.Invalid=class{constructor(e,t,i){this.is="invalid",this.chunk=e,this.index=t,this.type="syntax",this.message=i||"Invalid code: "+this.chunk}ev(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}},On.Tree.Keyword=class{ev(){return this}constructor(e){this.value=e;var t={transparent:"color",true:"boolean",false:"boolean"};this.is=t[e]?t[e]:"keyword"}toString(){return this.value}},On.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}},On.Tree.Operation=class{constructor(e,t,i){this.is="operation",this.op=e.trim(),this.operands=t,this.index=i}ev(e){var t,i=this.operands[0].ev(e),r=this.operands[1].ev(e);return"undefined"===i.is||"undefined"===r.is?{is:"undefined",value:"undefined"}:(i instanceof On.Tree.Dimension&&r instanceof On.Tree.Color&&("*"===this.op||"+"===this.op?(t=r,r=i,i=t):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),i instanceof On.Tree.Quoted&&r instanceof On.Tree.Quoted&&"+"!==this.op?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):i instanceof On.Tree.Field||r instanceof On.Tree.Field||i instanceof On.Tree.Literal||r instanceof On.Tree.Literal?"color"===i.is||"color"===r.is?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new On.Tree.Literal(i.ev(e).toString(!0)+this.op+r.ev(e).toString(!0)):void 0===i.operate?(e.error({message:"Cannot do math with type "+i.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):i.operate(e,this.op,r))}},On.Tree.Quoted=class{constructor(e){this.is="string",this.value=e||""}toString(e){var t=this.value.replace(/&/g,"&"),i=t.replace(/\'/g,"\\'").replace(/\"/g,""").replace(/</g,"<").replace(/\>/g,">");return!0===e?"'"+i+"'":t}ev(){return this}operate(e,t,i){return new On.Tree.Quoted(On.Tree.operate(t,this.toString(),i.toString(this.contains_field)))}},On.Tree.Reference={_validateValue:{font:function(e,t){return!e.validation_data||!e.validation_data.fonts||-1!=e.validation_data.fonts.indexOf(t)}},setData:function(e){this.data=e,this.selector_cache=function(e){var t={};for(var i in e.symbolizers)for(var r in e.symbolizers[i])e.symbolizers[i][r].hasOwnProperty("css")&&(t[e.symbolizers[i][r].css]=[e.symbolizers[i][r],i,r]);return t}(e),this.mapnikFunctions=function(e){var t={};for(var i in e.symbolizers)for(var r in e.symbolizers[i])if("functions"===e.symbolizers[i][r].type)for(var s=0;s<e.symbolizers[i][r].functions.length;s++){var n=e.symbolizers[i][r].functions[s];t[n[0]]=n[1]}return t}(e),this.required_cache=function(e){var t={};for(var i in e.symbolizers)for(var r in t[i]=[],e.symbolizers[i])e.symbolizers[i][r].required&&t[i].push(e.symbolizers[i][r].css);return t}(e)},setVersion:function(e){return!!On.mapnik_reference.version.hasOwnProperty(e)&&(this.setData(On.mapnik_reference.version[e]),!0)},selectorData:function(e,t){if(this.selector_cache&&this.selector_cache[e])return this.selector_cache[e][t]},validSelector:function(e){return!!this.selector_cache[e]},selectorName:function(e){return this.selectorData(e,2)},selector:function(e){return this.selectorData(e,0)},symbolizer:function(e){return this.selectorData(e,1)},requiredProperties:function(e,t){var i=this.required_cache[e];for(var r in i)if(!(i[r]in t))return"Property "+i[r]+" required for defining "+e+" styles."},isFont:function(e){return"font"===this.selector(e).validate},editDistance:function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;for(var i=[],r=0;r<=t.length;r++)i[r]=[r];for(var s=0;s<=e.length;s++)i[0][s]=s;for(r=1;r<=t.length;r++)for(s=1;s<=e.length;s++)t.charAt(r-1)===e.charAt(s-1)?i[r][s]=i[r-1][s-1]:i[r][s]=Math.min(i[r-1][s-1]+1,Math.min(i[r][s-1]+1,i[r-1][s]+1));return i[t.length][e.length]},validValue:function(e,t,i){var r;if(this.selector(t)){if("keyword"===i.value[0].is)return function(e,t){return"object"==typeof this.selector(t).type?-1!==this.selector(t).type.indexOf(e.value[0].value):"string"===this.selector(t).type}(i,t);if("undefined"===i.value[0].is)return!0;if("numbers"===this.selector(t).type){for(r in i.value)if("float"!==i.value[r].is)return!1;return!0}if("tags"===this.selector(t).type){if(!i.value)return!1;if(!i.value[0].value)return"tag"===i.value[0].is;for(r=0;r<i.value[0].value.length;r++)if("tag"!==i.value[0].value[r].is)return!1;return!0}if("functions"==this.selector(t).type)return function(e,t){if("string"===e.value[0].is)return!0;for(var i in e.value)for(var r in e.value[i].value){if("call"!==e.value[i].value[r].is)return!1;var s=find(this.selector(t).functions,function(t){return t[0]===e.value[i].value[r].name});if(!(s&&-1===s[1]||s&&s[1]===e.value[i].value[r].args.length))return!1}return!0}(i,t);if("expression"===this.selector(t).type)return!0;if("unsigned"===this.selector(t).type)return"float"===i.value[0].is&&(i.value[0].round(),!0);if(this.selector(t).validate){for(r=0;r<i.value.length;r++)if(this.selector(t).type===i.value[r].is&&this._validateValue[this.selector(t).validate](e,i.value[r].value))return!0;return!1}return this.selector(t).type===i.value[0].is}return!1}},On.Tree.Reference.setVersion("latest"),On.Tree.Rule=class{constructor(e,t,i,r){this.is="rule";var s=e.split("/");this.name=s.pop(),this.instance=s.length?s[0]:"__default__",this.value=t instanceof On.Tree.Value?t:new On.Tree.Value([t]),this.index=i,this.symbolizer=On.Tree.Reference.symbolizer(this.name),this.filename=r,this.variable="@"===e.charAt(0)}clone(){var e=Object.create(On.Tree.Rule.prototype);return e.name=this.name,e.value=this.value,e.index=this.index,e.instance=this.instance,e.symbolizer=this.symbolizer,e.filename=this.filename,e.variable=this.variable,e}updateID(){return this.id=this.zoom+"#"+this.instance+"#"+this.name}toString(){return"["+On.Tree.Zoom.toString(this.zoom)+"] "+this.name+": "+this.value}ev(e){return new On.Tree.Rule(this.name,this.value.ev(e),this.index,this.filename)}},On.Tree.Ruleset=class{constructor(e,t){this.is="ruleset",this.selectors=e,this.rules=t,this._lookups={}}ev(e){var t,i,r=new On.Tree.Ruleset(this.selectors,this.rules.slice(0));for(r.root=this.root,e.frames.unshift(r),t=0;t<r.rules.length;t++)i=r.rules[t],r.rules[t]=i.ev?i.ev(e):i;return e.frames.shift(),r}match(e){return!e||0===e.length}variables(){return this._variables?this._variables:this._variables=this.rules.reduce(function(e,t){return t instanceof On.Tree.Rule&&!0===t.variable&&(e[t.name]=t),e},{})}variable(e){return this.variables()[e]}rulesets(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(e){return e instanceof On.Tree.Ruleset})}find(e,t){t=t||this;var i=[],r=e.toString();return r in this._lookups?this._lookups[r]:(this.rulesets().forEach(function(r){if(r!==t)for(var s=0;s<r.selectors.length;s++)if(e.match(r.selectors[s])){e.elements.length>1?Array.prototype.push.apply(i,r.find(new On.Tree.Selector(null,null,e.elements.slice(1)),t)):i.push(r);break}}),this._lookups[r]=i)}evZooms(e){for(var t=0;t<this.selectors.length;t++){for(var i=On.Tree.Zoom.all,r=0;r<this.selectors[t].zoom.length;r++)i=this.selectors[t].zoom[r].ev(e).zoom;this.selectors[t].zoom=i}}flatten(e,t,i){var r,s,n=[];for(0===this.selectors.length&&(i.frames=i.frames.concat(this.rules)),this.evZooms(i),r=0;r<this.selectors.length;r++){var a=this.selectors[r];if(a.filters)if(t.length)for(s=0;s<t.length;s++){var o=t[s],l=o.filters.cloneWith(a.filters);if(null===l){if(o.zoom===a.zoom&&o.attachment===a.attachment&&o.elements.join()===a.elements.join()){n.push(o);continue}l=o.filters}else if(!l)continue;var h=Object.create(On.Tree.Selector.prototype);h.filters=l,h.zoom=a.zoom,h.elements=o.elements.concat(a.elements),o.attachment&&a.attachment?h.attachment=o.attachment+"/"+a.attachment:h.attachment=a.attachment||o.attachment,h.conditions=o.conditions+a.conditions,h.index=a.index,n.push(h)}else n.push(a)}var u=[];for(r=0;r<this.rules.length;r++){var c=this.rules[r];c instanceof On.Tree.Ruleset?c.flatten(e,n,i):c instanceof On.Tree.Rule?u.push(c):c instanceof On.Tree.Invalid&&i.error(c)}var d=!!u.length&&u[0].index;for(r=0;r<n.length;r++)!1!==d&&(n[r].index=d),e.push(new On.Tree.Definition(n[r],u.slice()));return e}},On.Tree.Selector=class{constructor(e,t,i,r,s,n){this.elements=i||[],this.attachment=r,this.filters=e||{},this.zoom=void 0!==t?t:On.Tree.Zoom.all,this.conditions=s,this.index=n}specificity(){return this.elements.reduce(function(e,t){var i=t.specificity();return e[0]+=i[0],e[1]+=i[1],e},[0,0,this.conditions,this.index])}},On.Tree.URL=class{constructor(e,t){this.is="uri",this.value=e,this.paths=t}toString(){return this.value.toString()}ev(e){return new On.Tree.URL(this.value.ev(e),this.paths)}},On.Tree.Value=class{constructor(e){this.is="value",this.value=e}ev(e){return 1===this.value.length?this.value[0].ev(e):new On.Tree.Value(this.value.map(function(t){return t.ev(e)}))}toJS(e){var t=this.ev(e),i=t.toString();return"color"===t.is||"uri"===t.is||"string"===t.is||"keyword"===t.is?i="'"+i+"'":"field"===t.is?i=i.replace(/\[(.*)\]/g,"attributes['_match1']"):t.value&&"object"==typeof t.value&&(i="["+i+"]"),"_value = "+i+";"}toString(e,t,i,r){return this.value.map(function(t){return t.toString(e,r)}).join(i||", ")}clone(){var e=Object.create(On.Tree.Value.prototype);return Array.isArray(e)?e.value=this.value.slice():e.value=this.value,e.is=this.is,e}},On.Tree.Variable=class{constructor(e,t,i){this.is="variable",this.name=e,this.index=t,this.filename=i}toString(){return this.name}ev(e){if(this._css)return this._css;var t=e.frames.filter(function(e){return e.name===this.name}.bind(this));return t.length?t[0].value.ev(e):(e.error({message:"variable "+this.name+" is undefined",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"})}},On.Tree.Zoom=class{constructor(e,t,i){this.op=e,this.value=t,this.index=i}setZoom(e){return this.zoom=e,this}ev(e){var t=parseInt(this.value.ev(e).toString(),10);switch((t>On.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+On.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t}return this}toString(){for(var e="",t=0;t<=On.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<<t?"X":".";return e}},On.Tree.Zoom.all=23,On.Tree.Zoom.maxZoom=22,On.Tree.Zoom.ranges={0:1e9,1:5e8,2:2e8,3:1e8,4:5e7,5:25e6,6:125e5,7:65e5,8:3e6,9:15e5,10:75e4,11:4e5,12:2e5,13:1e5,14:5e4,15:25e3,16:12500,17:5e3,18:2500,19:1500,20:750,21:500,22:250,23:100};class Nn{constructor(e){e=e||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,ee.extend(this,e)}}class In{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="SuperMap.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class Fn extends In{constructor(e,t){super(e,t),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=6,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class kn extends In{constructor(e){super(e),this.pointList=e,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class Dn extends In{constructor(e){super(e),this.pointList=e,this.holePolygonPointLists=null,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class Rn extends In{constructor(e,t,i,r){super(e,t,i,r),this.x=isNaN(e)?0:e,this.y=isNaN(e)?0:t,this.width=isNaN(i)?0:i,this.height=isNaN(r)?0:r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class Bn extends In{constructor(e,t,i,r,s,n,a){super(e,t,i,r,s,n,a),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(i)?0:i,this.startAngle=isNaN(r)?0:r,this.endAngle=isNaN(s)?0:s,this.r0=isNaN(n)?0:n,this.clockWise=a,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class Gn extends In{constructor(e,t,i){super(e,t,i),this.x=e,this.y=t,this.text=i,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class Un extends In{constructor(e,t,i,r,s,n,a,o,l){super(e,t,i,r,s,n,a,o,l),this.x=e,this.y=t,this.image=i,this.width=r,this.height=s,this.sx=n,this.sy=a,this.sWidth=o,this.sHeight=l,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class jn extends In{constructor(e,t,i){super(e,t,i),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(i)?0:i,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class zn{constructor(){this._handlers={},this.CLASS_NAME="SuperMap.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(e,t,i){var r=this._handlers;return t&&e?(r[e]||(r[e]=[]),r[e].push({h:t,one:!0,ctx:i||this}),this):this}bind(e,t,i){var r=this._handlers;return t&&e?(r[e]||(r[e]=[]),r[e].push({h:t,one:!1,ctx:i||this}),this):this}unbind(e,t){var i=this._handlers;if(!e)return this._handlers={},this;if(t){if(i[e]){for(var r=[],s=0,n=i[e].length;s<n;s++)i[e][s].h!=t&&r.push(i[e][s]);i[e]=r}i[e]&&0===i[e].length&&delete i[e]}else delete i[e];return this}dispatch(e){if(this._handlers[e]){var t=arguments,i=t.length;i>3&&(t=Array.prototype.slice.call(t,1));for(var r=this._handlers[e],s=r.length,n=0;n<s;){switch(i){case 1:r[n].h.call(r[n].ctx);break;case 2:r[n].h.call(r[n].ctx,t[1]);break;case 3:r[n].h.call(r[n].ctx,t[1],t[2]);break;default:r[n].h.apply(r[n].ctx,t)}r[n].one?(r.splice(n,1),s--):n++}}return this}dispatchWithContext(e){if(this._handlers[e]){var t=arguments,i=t.length;i>4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var r=t[t.length-1],s=this._handlers[e],n=s.length,a=0;a<n;){switch(i){case 1:s[a].h.call(r);break;case 2:s[a].h.call(r,t[1]);break;case 3:s[a].h.call(r,t[1],t[2]);break;default:s[a].h.apply(r,t)}s[a].one?(s.splice(a,1),n--):a++}}return this}}class Vn{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Vector"}create(e,t){var i=new(0,this.ArrayCtor)(2);return i[0]=e||0,i[1]=t||0,i}copy(e,t){return e[0]=t[0],e[1]=t[1],e}set(e,t,i){return e[0]=t,e[1]=i,e}add(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}scaleAndAdd(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e}sub(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}len(e){return Math.sqrt(this.lenSquare(e))}lenSquare(e){return e[0]*e[0]+e[1]*e[1]}mul(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}div(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}dot(e,t){return e[0]*t[0]+e[1]*t[1]}scale(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}normalize(e,t){var i=this.len(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e}distance(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}distanceSquare(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}lerp(e,t,i,r){return e[0]=t[0]+r*(i[0]-t[0]),e[1]=t[1]+r*(i[1]-t[1]),e}applyTransform(e,t,i){var r=t[0],s=t[1];return e[0]=i[0]*r+i[2]*s+i[4],e[1]=i[1]*r+i[3]*s+i[5],e}min(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}max(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}length(e){return this.len(e)}lengthSquare(e){return this.lenSquare(e)}dist(e,t){return this.distance(e,t)}distSquare(e,t){return this.distanceSquare(e,t)}}class Jn{constructor(){this.vector=new Vn,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Curve"}isAroundZero(e){return e>-this.EPSILON&&e<this.EPSILON}isNotAroundZero(e){return e>this.EPSILON||e<-this.EPSILON}cubicAt(e,t,i,r,s){var n=1-s;return n*n*(n*e+3*s*t)+s*s*(s*r+3*n*i)}cubicDerivativeAt(e,t,i,r,s){var n=1-s;return 3*(((t-e)*n+2*(i-t)*s)*n+(r-i)*s*s)}cubicRootAt(e,t,i,r,s,n){var a=r+3*(t-i)-e,o=3*(i-2*t+e),l=3*(t-e),h=e-s,u=o*o-3*a*l,c=o*l-9*a*h,d=l*l-3*o*h,p=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(o))n[0]=0;else{let e=-l/o;e>=0&&e<=1&&(n[p++]=e)}else{var f=c*c-4*u*d;if(this.isAroundZero(f)){var m=c/u;let e=-o/a+m,t=-m/2;e>=0&&e<=1&&(n[p++]=e),t>=0&&t<=1&&(n[p++]=t)}else if(f>0){let e=Math.sqrt(f),t=u*o+1.5*a*(-c+e),i=u*o+1.5*a*(-c-e),r=(-o-((t=t<0?-Math.pow(-t,this.ONE_THIRD):Math.pow(t,this.ONE_THIRD))+(i=i<0?-Math.pow(-i,this.ONE_THIRD):Math.pow(i,this.ONE_THIRD))))/(3*a);r>=0&&r<=1&&(n[p++]=r)}else{var y=(2*u*o-3*a*c)/(2*Math.sqrt(u*u*u)),g=Math.acos(y)/3,v=Math.sqrt(u),b=Math.cos(g);let e=(-o-2*v*b)/(3*a),t=(-o+v*(b+this.THREE_SQRT*Math.sin(g)))/(3*a),i=(-o+v*(b-this.THREE_SQRT*Math.sin(g)))/(3*a);e>=0&&e<=1&&(n[p++]=e),t>=0&&t<=1&&(n[p++]=t),i>=0&&i<=1&&(n[p++]=i)}}return p}cubicExtrema(e,t,i,r,s){var n=6*i-12*t+6*e,a=9*t+3*r-3*e-9*i,o=3*t-3*e,l=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(n)){let e=-o/n;e>=0&&e<=1&&(s[l++]=e)}}else{var h=n*n-4*a*o;if(this.isAroundZero(h))s[0]=-n/(2*a);else if(h>0){let e=Math.sqrt(h),t=(-n+e)/(2*a),i=(-n-e)/(2*a);t>=0&&t<=1&&(s[l++]=t),i>=0&&i<=1&&(s[l++]=i)}}return l}cubicSubdivide(e,t,i,r,s,n){var a=(t-e)*s+e,o=(i-t)*s+t,l=(r-i)*s+i,h=(o-a)*s+a,u=(l-o)*s+o,c=(u-h)*s+h;n[0]=e,n[1]=a,n[2]=h,n[3]=c,n[4]=c,n[5]=u,n[6]=l,n[7]=r}cubicProjectPoint(e,t,i,r,s,n,a,o,l,h,u){var c,d=this.vector.create(),p=this.vector.create(),f=this.vector.create(),m=.005,y=1/0;d[0]=l,d[1]=h;for(let l=0;l<1;l+=.05){p[0]=this.cubicAt(e,i,s,a,l),p[1]=this.cubicAt(t,r,n,o,l);let h=this.vector.distSquare(d,p);h<y&&(c=l,y=h)}y=1/0;for(let l=0;l<32&&!(m<this.EPSILON);l++){let l=c-m,h=c+m;p[0]=this.cubicAt(e,i,s,a,l),p[1]=this.cubicAt(t,r,n,o,l);let u=this.vector.distSquare(p,d);if(l>=0&&u<y)c=l,y=u;else{f[0]=this.cubicAt(e,i,s,a,h),f[1]=this.cubicAt(t,r,n,o,h);let l=this.vector.distSquare(f,d);h<=1&&l<y?(c=h,y=l):m*=.5}}return u&&(u[0]=this.cubicAt(e,i,s,a,c),u[1]=this.cubicAt(t,r,n,o,c)),Math.sqrt(y)}quadraticAt(e,t,i,r){var s=1-r;return s*(s*e+2*r*t)+r*r*i}quadraticDerivativeAt(e,t,i,r){return 2*((1-r)*(t-e)+r*(i-t))}quadraticRootAt(e,t,i,r,s){var n=e-2*t+i,a=2*(t-e),o=e-r,l=0;if(this.isAroundZero(n)){if(this.isNotAroundZero(a)){var h=-o/a;h>=0&&h<=1&&(s[l++]=h)}}else{var u=a*a-4*n*o;if(this.isAroundZero(u)){let e=-a/(2*n);e>=0&&e<=1&&(s[l++]=e)}else if(u>0){let e=Math.sqrt(u),t=(-a+e)/(2*n),i=(-a-e)/(2*n);t>=0&&t<=1&&(s[l++]=t),i>=0&&i<=1&&(s[l++]=i)}}return l}quadraticExtremum(e,t,i){var r=e+i-2*t;return 0===r?.5:(e-t)/r}quadraticProjectPoint(e,t,i,r,s,n,a,o,l){var h,u=this.vector.create(),c=this.vector.create(),d=this.vector.create(),p=.005,f=1/0;u[0]=a,u[1]=o;for(let a=0;a<1;a+=.05){c[0]=this.quadraticAt(e,i,s,a),c[1]=this.quadraticAt(t,r,n,a);let o=this.vector.distSquare(u,c);o<f&&(h=a,f=o)}f=1/0;for(let a=0;a<32&&!(p<this.EPSILON);a++){let a=h-p,o=h+p;c[0]=this.quadraticAt(e,i,s,a),c[1]=this.quadraticAt(t,r,n,a);let l=this.vector.distSquare(c,u);if(a>=0&&l<f)h=a,f=l;else{d[0]=this.quadraticAt(e,i,s,o),d[1]=this.quadraticAt(t,r,n,o);let a=this.vector.distSquare(d,u);o<=1&&a<f?(h=o,f=a):p*=.5}}return l&&(l[0]=this.quadraticAt(e,i,s,h),l[1]=this.quadraticAt(t,r,n,h)),Math.sqrt(f)}}class qn{}qn.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},qn.catchBrushException=!1,qn.debugMode=0;class Hn{static SUtil_smoothBezier(e,t,i,r,s){s&&2===s.length||(s=[0,0]);var n,a,o=s,l=[],h=[],u=[],c=[],d=!!r;if(d){n=[1/0,1/0],a=[-1/0,-1/0];let t=e.length;for(let i=0;i<t;i++)Hn.Util_vector.min(n,n,[e[i][0]+o[0],e[i][1]+o[1]]),Hn.Util_vector.max(a,a,[e[i][0]+o[0],e[i][1]+o[1]]);Hn.Util_vector.min(n,n,r[0]),Hn.Util_vector.max(a,a,r[1])}let p=e.length;for(let r=0;r<p;r++){let s,f,m=[e[r][0]+o[0],e[r][1]+o[1]];if(i)s=[e[r?r-1:p-1][0]+o[0],e[r?r-1:p-1][1]+o[1]],f=[e[(r+1)%p][0]+o[0],e[(r+1)%p][1]+o[1]];else{if(0===r||r===p-1){l.push([e[r][0]+o[0],e[r][1]+o[1]]);continue}s=[e[r-1][0]+o[0],e[r-1][1]+o[1]],f=[e[r+1][0]+o[0],e[r+1][1]+o[1]]}Hn.Util_vector.sub(h,f,s),Hn.Util_vector.scale(h,h,t);let y=Hn.Util_vector.distance(m,s),g=Hn.Util_vector.distance(m,f),v=y+g;0!==v&&(y/=v,g/=v),Hn.Util_vector.scale(u,h,-y),Hn.Util_vector.scale(c,h,g);let b=Hn.Util_vector.add([],m,u),_=Hn.Util_vector.add([],m,c);d&&(Hn.Util_vector.max(b,b,n),Hn.Util_vector.min(b,b,a),Hn.Util_vector.max(_,_,n),Hn.Util_vector.min(_,_,a)),l.push(b),l.push(_)}return i&&l.push(l.shift()),l}static SUtil_smoothSpline(e,t,i,r){r&&2===r.length||(r=[0,0]);var s=r,n=e.length,a=[],o=0;for(let t=1;t<n;t++)o+=Hn.Util_vector.distance([e[t-1][0]+s[0],e[t-1][1]+s[1]],[e[t][0]+s[0],e[t][1]+s[1]]);var l=o/5;l=l<n?n:l;for(let i=0;i<l;i++){let r,o,u,c=i/(l-1)*(t?n:n-1),d=Math.floor(c),p=c-d,f=[e[d%n][0]+s[0],e[d%n][1]+s[1]];t?(r=[e[(d-1+n)%n][0]+s[0],e[(d-1+n)%n][1]+s[1]],o=[e[(d+1)%n][0]+s[0],e[(d+1)%n][1]+s[1]],u=[e[(d+2)%n][0]+s[0],e[(d+2)%n][1]+s[1]]):(r=[e[0===d?d:d-1][0]+s[0],e[0===d?d:d-1][1]+s[1]],o=[e[d>n-2?n-1:d+1][0]+s[0],e[d>n-2?n-1:d+1][1]+s[1]],u=[e[d>n-3?n-1:d+2][0]+s[0],e[d>n-3?n-1:d+2][1]+s[1]]);let m=p*p,y=p*m;a.push([h(r[0],f[0],o[0],u[0],p,m,y),h(r[1],f[1],o[1],u[1],p,m,y)])}return a;function h(e,t,i,r,s,n,a){var o=.5*(i-e),l=.5*(r-t);return(2*(t-i)+o+l)*a+(-3*(t-i)-2*o-l)*n+o*s+t}}static SUtil_dashedLineTo(e,t,i,r,s,n,a){var o=[5,5];if(n="number"!=typeof n?5:n,e.setLineDash)return o[0]=n,o[1]=n,a&&a instanceof Array?e.setLineDash(a):e.setLineDash(o),e.moveTo(t,i),void e.lineTo(r,s);var l=r-t,h=s-i,u=Math.floor(Math.sqrt(l*l+h*h)/n);l/=u,h/=u;for(var c=!0,d=0;d<u;++d)c?e.moveTo(t,i):e.lineTo(t,i),c=!c,t+=l,i+=h;e.lineTo(r,s)}}Hn.Util_area=new class{constructor(){this.util=new xn,this.curve=new Jn,this._ctx=null,this._textWidthCache={},this._textHeightCache={},this._textWidthCacheCounter=0,this._textHeightCacheCounter=0,this.TEXT_CACHE_MAX=5e3,this.PI2=2*Math.PI,this.roots=[-1,-1,-1],this.extrema=[-1,-1],this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Area"}normalizeRadian(e){return(e%=this.PI2)<0&&(e+=this.PI2),e}isInside(e,t,i,r){if(!t||!e)return!1;var s=e.type;this._ctx=this._ctx||this.util.getContext();var n=this._mathMethod(e,t,i,r);if(void 0!==n)return n;if(e.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(e,this._ctx,t,i,r);switch(s){case"ellipse":case"smicellipse":return!0;case"trochoid":var a="out"==t.location?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return this.isInsideCircle(t,i,r,a);case"rose":return this.isInsideCircle(t,i,r,t.maxr);default:return!1}}_mathMethod(e,t,i,r){switch(e.type){case"bezier-curve":return void 0===t.cpX2?this.isInsideQuadraticStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,i,r):this.isInsideCubicStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,i,r);case"line":return this.isInsideLine(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,i,r);case"broken-line":return this.isInsideBrokenLine(t.pointList,t.lineWidth,i,r);case"smicbroken-line":{let s=i,n=r;return e.refOriginalPosition&&(s=i-e.refOriginalPosition[0],n=r-e.refOriginalPosition[1]),this.isInsideBrokenLine(t.pointList,t.lineWidth,s,n)}case"ring":return this.isInsideRing(t.x,t.y,t.r0,t.r,i,r);case"smicring":{let s=t.x,n=t.y;return e.refOriginalPosition&&(s=t.x+e.refOriginalPosition[0],n=t.y+e.refOriginalPosition[1]),this.isInsideRing(s,n,t.r0,t.r,i,r)}case"circle":return this.isInsideCircle(t.x,t.y,t.r,i,r);case"smicpoint":{let s=i,n=r;return e.refOriginalPosition&&(s=i-e.refOriginalPosition[0],n=r-e.refOriginalPosition[1]),this.isInsideCircle(t.x,t.y,t.r,s,n)}case"sector":{let e=t.startAngle*Math.PI/180,s=t.endAngle*Math.PI/180;return t.clockWise||(e=-e,s=-s),this.isInsideSector(t.x,t.y,t.r0,t.r,e,s,!t.clockWise,i,r)}case"smicsector":{let s=t.startAngle*Math.PI/180,n=t.endAngle*Math.PI/180;t.clockWise||(s=-s,n=-n);let a=t.x,o=t.y;return e.refOriginalPosition&&(a=t.x+e.refOriginalPosition[0],o=t.y+e.refOriginalPosition[1]),this.isInsideSector(a,o,t.r0,t.r,s,n,!t.clockWise,i,r)}case"path":return this.isInsidePath(t.pathArray,Math.max(t.lineWidth,5),t.brushType,i,r);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(t.pointList,i,r);case"smicpolygon":{let u=i,c=r;if(e.refOriginalPosition&&(u=i-e.refOriginalPosition[0],c=r-e.refOriginalPosition[1]),e.holePolygonPointLists&&e.holePolygonPointLists.length>0){for(var s=this.isInsidePolygon(t.pointList,u,c),n=e.holePolygonPointLists,a=!1,o=0,l=n.length;o<l;o++){var h=n[o];!0===this.isInsidePolygon(h,u,c)&&(a=!0)}return!0===s&&!1===a}return this.isInsidePolygon(t.pointList,u,c)}case"text":var u=t.__rect||e.getRect(t);return this.isInsideRect(u.x,u.y,u.width,u.height,i,r);case"smictext":var c=e.getTextBackground(t);return this.isInsidePolygon(c,i,r);case"rectangle":case"image":return this.isInsideRect(t.x,t.y,t.width,t.height,i,r);case"smicimage":{let s=t.x,n=t.y;return e.refOriginalPosition&&(s=t.x+e.refOriginalPosition[0],n=t.y+e.refOriginalPosition[1]),this.isInsideRect(s,n,t.width,t.height,i,r)}}}_buildPathMethod(e,t,i,r,s){return t.beginPath(),e.buildPath(t,i),t.closePath(),t.isPointInPath(r,s)}isOutside(e,t,i,r){return!this.isInside(e,t,i,r)}isInsideLine(e,t,i,r,s,n,a){if(0===s)return!1;var o=Math.max(s,5),l=0;if(a>t+o&&a>r+o||a<t-o&&a<r-o||n>e+o&&n>i+o||n<e-o&&n<i-o)return!1;if(e===i)return Math.abs(n-e)<=o/2;var h=(l=(t-r)/(e-i))*n-a+(e*r-i*t)/(e-i);return h*h/(l*l+1)<=o/2*o/2}isInsideCubicStroke(e,t,i,r,s,n,a,o,l,h,u){if(0===l)return!1;var c=Math.max(l,5);return!(u>t+c&&u>r+c&&u>n+c&&u>o+c||u<t-c&&u<r-c&&u<n-c&&u<o-c||h>e+c&&h>i+c&&h>s+c&&h>a+c||h<e-c&&h<i-c&&h<s-c&&h<a-c)&&this.curve.cubicProjectPoint(e,t,i,r,s,n,a,o,h,u,null)<=c/2}isInsideQuadraticStroke(e,t,i,r,s,n,a,o,l){if(0===a)return!1;var h=Math.max(a,5);return!(l>t+h&&l>r+h&&l>n+h||l<t-h&&l<r-h&&l<n-h||o>e+h&&o>i+h&&o>s+h||o<e-h&&o<i-h&&o<s-h)&&this.curve.quadraticProjectPoint(e,t,i,r,s,n,o,l,null)<=h/2}isInsideArcStroke(e,t,i,r,s,n,a,o,l){var h=this.PI2;if(0===a)return!1;var u=Math.max(a,5);o-=e,l-=t;var c=Math.sqrt(o*o+l*l);if(c-u>i||c+u<i)return!1;if(Math.abs(r-s)>=h)return!0;if(n){var d=r;r=this.normalizeRadian(s),s=this.normalizeRadian(d)}else r=this.normalizeRadian(r),s=this.normalizeRadian(s);r>s&&(s+=h);var p=Math.atan2(l,o);return p<0&&(p+=h),p>=r&&p<=s||p+h>=r&&p+h<=s}isInsideBrokenLine(e,t,i,r){for(var s=Math.max(t,10),n=0,a=e.length-1;n<a;n++){var o=e[n][0],l=e[n][1],h=e[n+1][0],u=e[n+1][1];if(this.isInsideLine(o,l,h,u,s,i,r))return!0}return!1}isInsideRing(e,t,i,r,s,n){var a=(s-e)*(s-e)+(n-t)*(n-t);return a<r*r&&a>i*i}isInsideRect(e,t,i,r,s,n){return s>=e&&s<=e+i&&n>=t&&n<=t+r}isInsideCircle(e,t,i,r,s){return(r-e)*(r-e)+(s-t)*(s-t)<i*i}isInsideSector(e,t,i,r,s,n,a,o,l){return this.isInsideArcStroke(e,t,(i+r)/2,s,n,a,r-i,o,l)}isInsidePolygon(e,t,i){for(var r=e.length,s=0,n=0,a=r-1;n<r;n++){var o=e[a][0],l=e[a][1],h=e[n][0],u=e[n][1];s+=this.windingLine(o,l,h,u,t,i),a=n}return 0!==s}windingLine(e,t,i,r,s,n){return n>t&&n>r||n<t&&n<r?0:r==t?0:(n-t)/(r-t)*(i-e)+e>s?r<t?1:-1:0}swapExtrema(){var e=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=e}windingCubic(e,t,i,r,s,n,a,o,l,h){var u=this.curve,c=this.roots,d=this.extrema;if(h>t&&h>r&&h>n&&h>o||h<t&&h<r&&h<n&&h<o)return 0;var p=u.cubicRootAt(t,r,n,o,h,c);if(0===p)return 0;for(var f,m,y=0,g=-1,v=0;v<p;v++){var b=c[v];u.cubicAt(e,i,s,a,b)<l||(g<0&&(g=u.cubicExtrema(t,r,n,o,d),d[1]<d[0]&&g>1&&this.swapExtrema(),f=u.cubicAt(t,r,n,o,d[0]),g>1&&(m=u.cubicAt(t,r,n,o,d[1]))),2==g?b<d[0]?y+=f<t?1:-1:b<d[1]?y+=m<f?1:-1:y+=o<m?1:-1:b<d[0]?y+=f<t?1:-1:y+=o<f?1:-1)}return y}windingQuadratic(e,t,i,r,s,n,a,o){var l=this.curve,h=this.roots;if(o>t&&o>r&&o>n||o<t&&o<r&&o<n)return 0;var u=l.quadraticRootAt(t,r,n,o,h);if(0===u)return 0;var c=l.quadraticExtremum(t,r,n);if(c>=0&&c<=1){var d=0,p=l.quadraticAt(t,r,n,c);for(let r=0;r<u;r++)l.quadraticAt(e,i,s,h[r])>a||(h[r]<c?d+=p<t?1:-1:d+=n<p?1:-1);return d}return l.quadraticAt(e,i,s,h[0])>a?0:n<t?1:-1}windingArc(e,t,i,r,s,n,a,o){var l=this.roots,h=this.PI2;if((o-=t)>i||o<-i)return 0;let u=Math.sqrt(i*i-o*o);if(l[0]=-u,l[1]=u,Math.abs(r-s)>=h){r=0,s=h;var c=n?1:-1;return a>=l[0]+e&&a<=l[1]+e?c:0}if(n){let e=r;r=this.normalizeRadian(s),s=this.normalizeRadian(e)}else r=this.normalizeRadian(r),s=this.normalizeRadian(s);r>s&&(s+=h);var d=0;for(let t=0;t<2;t++){var p=l[t];if(p+e>a){let e=Math.atan2(o,p),t=n?1:-1;e<0&&(e=h+e),(e>=r&&e<=s||e+h>=r&&e+h<=s)&&(e>Math.PI/2&&e<1.5*Math.PI&&(t=-t),d+=t)}}return d}isInsidePath(e,t,i,r,s){for(var n=0,a=0,o=0,l=0,h=0,u=!0,c=!0,d="stroke"===(i=i||"fill")||"both"===i,p="fill"===i||"both"===i,f=0;f<e.length;f++){var m=e[f],y=m.points;if(u||"M"===m.command){if(f>0&&(p&&(n+=this.windingLine(a,o,l,h,r,s)),0!==n))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==m.command&&(c=!1,a=l,o=h)}switch(m.command){case"M":a=y[0],o=y[1];break;case"L":if(d&&this.isInsideLine(a,o,y[0],y[1],t,r,s))return!0;p&&(n+=this.windingLine(a,o,y[0],y[1],r,s)),a=y[0],o=y[1];break;case"C":if(d&&this.isInsideCubicStroke(a,o,y[0],y[1],y[2],y[3],y[4],y[5],t,r,s))return!0;p&&(n+=this.windingCubic(a,o,y[0],y[1],y[2],y[3],y[4],y[5],r,s)),a=y[4],o=y[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(a,o,y[0],y[1],y[2],y[3],t,r,s))return!0;p&&(n+=this.windingQuadratic(a,o,y[0],y[1],y[2],y[3],r,s)),a=y[2],o=y[3];break;case"A":var g=y[0],v=y[1],b=y[2],_=y[3],S=y[4],x=y[5],w=Math.cos(S)*b+g,C=Math.sin(S)*_+v;c?(c=!1,l=w,h=C):n+=this.windingLine(a,o,w,C);var M=(r-g)*_/b+g;if(d&&this.isInsideArcStroke(g,v,_,S,S+x,1-y[7],t,M,s))return!0;p&&(n+=this.windingArc(g,v,_,S,S+x,1-y[7],M,s)),a=Math.cos(S+x)*b+g,o=Math.sin(S+x)*_+v;break;case"z":if(d&&this.isInsideLine(a,o,l,h,t,r,s))return!0;u=!0}}return p&&(n+=this.windingLine(a,o,l,h,r,s)),0!==n}getTextWidth(e,t){var i=e+":"+t;if(this._textWidthCache[i])return this._textWidthCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t);for(var r=0,s=0,n=(e=(e+"").split("\n")).length;s<n;s++)r=Math.max(this._ctx.measureText(e[s]).width,r);return this._ctx.restore(),this._textWidthCache[i]=r,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),r}getTextHeight(e,t){var i=e+":"+t;if(this._textHeightCache[i])return this._textHeightCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split("\n");var r=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[i]=r,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),r}},Hn.Util_color=new wn,Hn.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="SuperMap.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(e,t,i){if(0!==e.length){for(var r=e[0][0],s=e[0][0],n=e[0][1],a=e[0][1],o=1;o<e.length;o++){var l=e[o];l[0]<r&&(r=l[0]),l[0]>s&&(s=l[0]),l[1]<n&&(n=l[1]),l[1]>a&&(a=l[1])}t[0]=r,t[1]=n,i[0]=s,i[1]=a}}cubeBezier(e,t,i,r,s,n){var a=new Jn,o=[];a.cubicExtrema(e[0],t[0],i[0],r[0],o);for(let s=0;s<o.length;s++)o[s]=a.cubicAt(e[0],t[0],i[0],r[0],o[s]);var l=[];a.cubicExtrema(e[1],t[1],i[1],r[1],l);for(let s=0;s<l.length;s++)l[s]=a.cubicAt(e[1],t[1],i[1],r[1],l[s]);o.push(e[0],r[0]),l.push(e[1],r[1]);var h=Math.min.apply(null,o),u=Math.max.apply(null,o),c=Math.min.apply(null,l),d=Math.max.apply(null,l);s[0]=h,s[1]=c,n[0]=u,n[1]=d}quadraticBezier(e,t,i,r,s){var n=new Jn,a=n.quadraticExtremum(e[0],t[0],i[0]),o=n.quadraticExtremum(e[1],t[1],i[1]),l=1-(a=Math.max(Math.min(a,1),0)),h=1-(o=Math.max(Math.min(o,1),0)),u=l*l*e[0]+2*l*a*t[0]+a*a*i[0],c=l*l*e[1]+2*l*a*t[1]+a*a*i[1],d=h*h*e[0]+2*h*o*t[0]+o*o*i[0],p=h*h*e[1]+2*h*o*t[1]+o*o*i[1];r[0]=Math.min(e[0],i[0],u,d),r[1]=Math.min(e[1],i[1],c,p),s[0]=Math.max(e[0],i[0],u,d),s[1]=Math.max(e[1],i[1],c,p)}arc(e,t,i,r,s,n,a,o){var l=new Vn,h=l.create(),u=l.create(),c=l.create();if(h[0]=Math.cos(r)*i+e,h[1]=Math.sin(r)*i+t,u[0]=Math.cos(s)*i+e,u[1]=Math.sin(s)*i+t,l.min(a,h,u),l.max(o,h,u),(r%=2*Math.PI)<0&&(r+=2*Math.PI),(s%=2*Math.PI)<0&&(s+=2*Math.PI),r>s&&!n?s+=2*Math.PI:r<s&&n&&(r+=2*Math.PI),n){var d=s;s=r,r=d}for(var p=0;p<s;p+=Math.PI/2)p>r&&(c[0]=Math.cos(p)*i+e,c[1]=Math.sin(p)*i+t,l.min(a,c,a),l.max(o,c,o))}},Hn.Util_curve=new Jn,Hn.Util_env=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Env";var e,t,i,r,s,n,a,o,l,h,u,c,d,p,f,m,y,g,v,b,_,S=this;return e=navigator.userAgent,t=S.os={},i=S.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),s=e.match(/(Android);?[\s\/]+([\d.]+)?/),n=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),o=!n&&e.match(/(iPhone\sOS)\s([\d_]+)/),l=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),h=l&&e.match(/TouchPad/),u=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),d=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),f=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),m=e.match(/PlayBook/),y=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!y,_=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!y,(i.webkit=!!r)&&(i.version=r[1]),s&&(t.android=!0,t.version=s[2]),o&&!a&&(t.ios=t.iphone=!0,t.version=o[2].replace(/_/g,".")),n&&(t.ios=t.ipad=!0,t.version=n[2].replace(/_/g,".")),a&&(t.ios=t.ipod=!0,t.version=a[3]?a[3].replace(/_/g,"."):null),l&&(t.webos=!0,t.version=l[2]),h&&(t.touchpad=!0),d&&(t.blackberry=!0,t.version=d[2]),p&&(t.bb10=!0,t.version=p[2]),f&&(t.rimtabletos=!0,t.version=f[2]),m&&(i.playbook=!0),u&&(t.kindle=!0,t.version=u[1]),c&&(i.silk=!0,i.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(i.silk=!0),y&&(i.chrome=!0,i.version=y[1]),g&&(i.firefox=!0,i.version=g[1]),v&&(i.ie=!0,i.version=v[1]),b&&(e.match(/Safari/)||t.ios)&&(i.safari=!0),_&&(i.webview=!0),v&&(i.ie=!0,i.version=v[1]),t.tablet=!!(n||m||s&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(s||o||l||d||p||y&&e.match(/Android/)||y&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:i,os:t,canvasSupported:!!document.createElement("canvas").getContext}}destory(){return!0}},Hn.Util_event=new class{constructor(){this.stop="function"==typeof window.addEventListener?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Event"}getX(e){return void 0!==e.zrenderX&&e.zrenderX||void 0!==e.offsetX&&e.offsetX||void 0!==e.layerX&&e.layerX||void 0!==e.clientX&&e.clientX}getY(e){return void 0!==e.zrenderY&&e.zrenderY||void 0!==e.offsetY&&e.offsetY||void 0!==e.layerY&&e.layerY||void 0!==e.clientY&&e.clientY}getDelta(e){return void 0!==e.zrenderDelta&&e.zrenderDelta||void 0!==e.wheelDelta&&e.wheelDelta||void 0!==e.detail&&-e.detail}},Hn.Util_http=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Http"}get(e,t,i){if("object"==typeof e){var r=e;e=r.url,t=r.onsuccess,i=r.onerror}var s=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");s.open("GET",e,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status>=200&&s.status<300||304===s.status?t&&t(s.responseText):i&&i(),s.onreadystatechange=new Function,s=null)},s.send(null)}},Hn.Util_log=new class{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(0!=+qn.debugMode)if(1==+qn.debugMode)for(let e in arguments)throw new Error(arguments[e]);else if(+qn.debugMode>1)for(let e in arguments)console.log(arguments[e])}}destory(){return!0}},Hn.Util_math=new class{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Math"}sin(e,t){return window.Math.sin(t?e*this._radians:e)}cos(e,t){return window.Math.cos(t?e*this._radians:e)}degreeToRadian(e){return e*this._radians}radianToDegree(e){return e/this._radians}},Hn.Util_matrix=new class{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Matrix"}create(){var e=new(0,this.ArrayCtor)(6);return this.identity(e),e}identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}mul(e,t,i){return e[0]=t[0]*i[0]+t[2]*i[1],e[1]=t[1]*i[0]+t[3]*i[1],e[2]=t[0]*i[2]+t[2]*i[3],e[3]=t[1]*i[2]+t[3]*i[3],e[4]=t[0]*i[4]+t[2]*i[5]+t[4],e[5]=t[1]*i[4]+t[3]*i[5]+t[5],e}translate(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e}rotate(e,t,i){var r=t[0],s=t[2],n=t[4],a=t[1],o=t[3],l=t[5],h=Math.sin(i),u=Math.cos(i);return e[0]=r*u+a*h,e[1]=-r*h+a*u,e[2]=s*u+o*h,e[3]=-s*h+u*o,e[4]=u*n+h*l,e[5]=u*l-h*n,e}scale(e,t,i){var r=i[0],s=i[1];return e[0]=t[0]*r,e[1]=t[1]*s,e[2]=t[2]*r,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*s,e}invert(e,t){var i=t[0],r=t[2],s=t[4],n=t[1],a=t[3],o=t[5],l=i*a-n*r;return l?(l=1/l,e[0]=a*l,e[1]=-n*l,e[2]=-r*l,e[3]=i*l,e[4]=(r*o-a*s)*l,e[5]=(n*s-i*o)*l,e):null}mulVector(e,t,i){var r=t[0],s=t[2],n=t[4],a=t[1],o=t[3],l=t[5];return e[0]=i[0]*r+i[1]*s+n,e[1]=i[0]*a+i[1]*o+l,e}},Hn.Util=new xn,Hn.Util_vector=new Vn;class Wn{constructor(){var e;this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="SuperMap.LevelRenderer.Transformable",this.lookAt=(e=Hn.Util_vector.create(),function(t){this.transform||(this.transform=Hn.Util_matrix.create());var i=this.transform;function r(e){return e>-5e-5&&e<5e-5}Hn.Util_vector.sub(e,t,this.position),r(e[0])&&r(e[1])||(Hn.Util_vector.normalize(e,e),i[2]=e[0]*this.scale[1],i[3]=e[1]*this.scale[1],i[0]=e[1]*this.scale[0],i[1]=-e[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform())})}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){function e(e){return e>5e-5||e<-5e-5}this.needLocalTransform=e(this.rotation[0])||e(this.position[0])||e(this.position[1])||e(this.scale[0]-1)||e(this.scale[1]-1)}updateTransform(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var e=[0,0],t=this.transform||Hn.Util_matrix.create();if(Hn.Util_matrix.identity(t),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;let r=i(e[0])||i(e[1]);r&&Hn.Util_matrix.translate(t,t,e),Hn.Util_matrix.scale(t,t,this.scale),r&&(e[0]=-e[0],e[1]=-e[1],Hn.Util_matrix.translate(t,t,e))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){e[0]=-this.rotation[1]||0,e[1]=-this.rotation[2]||0;let r=i(e[0])||i(e[1]);r&&Hn.Util_matrix.translate(t,t,e),Hn.Util_matrix.rotate(t,t,this.rotation[0]),r&&(e[0]=-e[0],e[1]=-e[1],Hn.Util_matrix.translate(t,t,e))}}else 0!=+this.rotation&&Hn.Util_matrix.rotate(t,t,this.rotation);(i(this.position[0])||i(this.position[1]))&&Hn.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Hn.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Hn.Util_matrix.copy(this.transform,this.parent.transform))}function i(e){return e>5e-5||e<-5e-5}}setTransform(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}decomposeTransform(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],i=this.position,r=this.scale,s=this.rotation;a(t-1)&&(t=Math.sqrt(t));var n=e[2]*e[2]+e[3]*e[3];a(n-1)&&(n=Math.sqrt(n)),i[0]=e[4],i[1]=e[5],r[0]=t,r[1]=n,r[2]=r[3]=0,s[0]=Math.atan2(-e[1]/n,e[0]/t),s[1]=s[2]=0}function a(e){return e>5e-5||e<-5e-5}}}class Yn extends(J(zn,Wn)){constructor(e){var t;super(e),e=e||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,ee.extend(this,e),this.id=this.id||ee.createUniqueID("smShape_"),this.CLASS_NAME="SuperMap.LevelRenderer.Shape",this.getTansform=(t=[],function(e,i){var r=[e,i];return this.needTransform&&this.transform&&(Hn.Util_matrix.invert(t,this.transform),Hn.Util_matrix.mulVector(r,t,[e,i,1]),e==r[0]&&i==r[1]&&this.updateNeedTransform()),r})}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(e,t){var i=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,i),i.brushType){case"both":this.setCtxGlobalAlpha(e,"fill",i),e.fill(),i.lineWidth>0&&(this.setCtxGlobalAlpha(e,"stroke",i),e.stroke()),this.setCtxGlobalAlpha(e,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",i),i.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",i);break;default:this.setCtxGlobalAlpha(e,"fill",i),e.fill(),this.setCtxGlobalAlpha(e,"reset",i)}this.drawText(e,i,this.style),this.afterBrush(e)}beforeBrush(e,t){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),t&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i}afterBrush(e){e.restore()}setContext(e,t){for(var i=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],r=0,s=i.length;r<s;r++){var n=t[i[r][0]],a=i[r][1];void 0!==n&&(e[a]=n)}}doClip(e){var t=Hn.Util_matrix.create();if(this.__clipShapes)for(var i=0;i<this.__clipShapes.length;i++){var r=this.__clipShapes[i];if(r.needTransform){let i=r.transform;Hn.Util_matrix.invert(t,i),e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}if(e.beginPath(),r.buildPath(e,r.style),e.clip(),r.needTransform){let i=t;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}}}getHighlightStyle(e,t,i){var r={};for(let t in e)r[t]=e[t];var s=Hn.Util_color.getHighlightColor();"stroke"!=e.brushType?(r.strokeColor=s,r.lineWidth=e.lineWidth||1,r.brushType="both"):"stroke"!=i?(r.strokeColor=s,r.lineWidth=e.lineWidth||1):r.strokeColor=t.strokeColor||Hn.Util_color.mix(e.strokeColor,Hn.Util_color.toRGB(s));for(let e in t)void 0!==t[e]&&(r[e]=t[e]);return r}getHighlightZoom(){return"text"!=this.type?6:2}drift(e,t){this.position[0]+=e,this.position[1]+=t}buildPath(e,t){Hn.Util_log("buildPath not implemented in "+this.type)}getRect(e){Hn.Util_log("getRect not implemented in "+this.type)}isCover(e,t){var i=this.getTansform(e,t);e=i[0],t=i[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height&&Hn.Util_area.isInside(this,this.style,e,t)}drawText(e,t,i){if(void 0!==t.text&&!1!==t.text){var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var s,n,a,o,l=10,h=t.textPosition||this.textPosition||"top",u=[];switch(u=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(i||t).__rect||this.getRect(i||t);switch(h){case"inside":a=c.x+c.width/2,o=c.y+c.height/2,s="center",n="middle","stroke"!=t.brushType&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-l,o=c.y+c.height/2,s="end",n="middle";break;case"right":a=c.x+c.width+l,o=c.y+c.height/2,s="start",n="middle";break;case"top":a=c.x+c.width/2,o=c.y-l,s="center",n="bottom";break;case"bottom":a=c.x+c.width/2,o=c.y+c.height+l,s="center",n="top"}}break;case"start":case"end":var d=0,p=0,f=0,m=0;if(void 0!==t.pointList){var y=t.pointList;if(y.length<2)return;var g=y.length;switch(h){case"start":d=y[0][0]+u[0],p=y[1][0]+u[0],f=y[0][1]+u[1],m=y[1][1]+u[1];break;case"end":d=y[g-2][0]+u[0],p=y[g-1][0]+u[0],f=y[g-2][1]+u[1],m=y[g-1][1]+u[1]}}else d=t.xStart+u[0]||0,p=t.xEnd+u[0]||0,f=t.yStart+u[1]||0,m=t.yEnd+u[1]||0;switch(h){case"start":s=d<p?"end":"start",n=f<m?"bottom":"top",a=d,o=f;break;case"end":s=d<p?"start":"end",n=f<m?"top":"bottom",a=p,o=m}l-=4,d&&p&&d!=p?a-="end"==s?l:-l:s="center",f!=m?o-="bottom"==n?l:-l:n="middle";break;case"specific":a=t.textX||0,o=t.textY||0,s="start",n="middle"}t.labelXOffset&&!isNaN(t.labelXOffset)&&(a+=t.labelXOffset),t.labelYOffset&&!isNaN(t.labelYOffset)&&(o+=t.labelYOffset),null!=a&&null!=o&&Yn._fillText(e,t.text,a,o,t.textFont,t.textAlign||s,t.textBaseline||n)}}modSelf(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)}isSilent(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)}setCtxGlobalAlpha(e,t,i){e.globalAlpha="fill"===t?void 0===i.fillOpacity?void 0===i.opacity?1:i.opacity:i.fillOpacity:"stroke"===t?void 0===i.strokeOpacity?void 0===i.opacity?1:i.opacity:i.strokeOpacity:void 0===i.opacity?1:i.opacity}static _fillText(e,t,i,r,s,n,a){s&&(e.font=s),e.textAlign=n,e.textBaseline=a;var o=Yn._getTextRect(t,i,r,s,n,a);t=(t+"").split("\n");var l=Hn.Util_area.getTextHeight("ZH",s);switch(a){case"top":r=o.y;break;case"bottom":r=o.y+l;break;default:r=o.y+l/2}for(var h=0,u=t.length;h<u;h++)e.fillText(t[h],i,r),r+=l}static _getTextRect(e,t,i,r,s,n){var a=Hn.Util_area.getTextWidth(e,r),o=Hn.Util_area.getTextHeight("ZH",r);switch(e=(e+"").split("\n"),s){case"end":case"right":t-=a;break;case"center":t-=a/2}switch(n){case"top":break;case"bottom":i-=o*e.length;break;default:i-=o*e.length/2}return{x:t,y:i,width:a,height:o*e.length}}}class Xn extends Yn{constructor(e){super(e),this.type="smicpoint",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;e.arc(t.x+i[0],t.y+i[1],t.r,0,2*Math.PI,!0)}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,i=this.refOriginalPosition;return e.__rect?e.__rect:(t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x+i[0]-e.r-t/2),y:Math.round(e.y+i[1]-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect)}}class Qn extends Yn{constructor(e){super(e),this.type="smictext",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicText"}destroy(){this.type=null,super.destroy()}brush(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,r=this.style;if(t&&(r=this.getHighlightStyle(r,this.highlightStyle||{})),void 0!==r.text&&!1!==r.text){e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";var s,n=(r.text+"").split("\n"),a=Hn.Util_area.getTextHeight("ZH",r.textFont),o=this.getRectNoRotation(r),l=r.x+i[0];s="top"==r.textBaseline?o.y:"bottom"==r.textBaseline?o.y+a:o.y+a/2;for(var h=r.x+i[0],u=r.y+i[1],c=0,d=n.length;c<d;c++){switch(r.labelRect&&(e.fillRect(o.x-2,o.y,o.width+4,o.height),e.fillStyle=r.strokeColor,e.strokeRect(o.x-2,o.y,o.width+4,o.height),e.fillStyle=r.textColor),r.brushType){case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.textRotation&&0!==r.textRotation?(e.save(),e.translate(h,u),e.rotate(r.textRotation*Math.PI/180),"top"==r.textBaseline?r.maxWidth?e.strokeText(n[c],0,a*c,r.maxWidth):e.strokeText(n[c],0,a*c):"bottom"==r.textBaseline?r.maxWidth?e.strokeText(n[c],0,a*(c+1)-o.height,r.maxWidth):e.strokeText(n[c],0,a*(c+1)-o.height):r.maxWidth?e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2,r.maxWidth):e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2),e.restore()):r.maxWidth?e.strokeText(n[c],l,s,r.maxWidth):e.strokeText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",r);break;case"both":r.textRotation&&0!==r.textRotation?(e.save(),e.translate(h,u),e.rotate(r.textRotation*Math.PI/180),"top"==r.textBaseline?r.maxWidth?(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],0,a*c,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],0,a*c,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r)):(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],0,a*c),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],0,a*c),this.setCtxGlobalAlpha(e,"reset",r)):"bottom"==r.textBaseline?r.maxWidth?(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],0,a*(c+1)-o.height,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],0,a*(c+1)-o.height,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r)):(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],0,a*(c+1)-o.height),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],0,a*(c+1)-o.height),this.setCtxGlobalAlpha(e,"reset",r)):r.maxWidth?(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],0,a*(c+1)-o.height/2-a/2,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r)):(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],0,a*(c+1)-o.height/2-a/2),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2),this.setCtxGlobalAlpha(e,"reset",r)),e.restore()):r.maxWidth?(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],l,s,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],l,s,r.maxWidth),this.setCtxGlobalAlpha(e,"reset",r)):(this.setCtxGlobalAlpha(e,"fill",r),e.fillText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",r),this.setCtxGlobalAlpha(e,"stroke",r),e.strokeText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",r));break;default:this.setCtxGlobalAlpha(e,"fill",r),r.textRotation&&0!==r.textRotation?(e.save(),e.translate(h,u),e.rotate(r.textRotation*Math.PI/180),"top"==r.textBaseline?r.maxWidth?e.fillText(n[c],0,a*c,r.maxWidth):e.fillText(n[c],0,a*c):"bottom"==r.textBaseline?r.maxWidth?e.fillText(n[c],0,a*(c+1)-o.height,r.maxWidth):e.fillText(n[c],0,a*(c+1)-o.height):r.maxWidth?e.fillText(n[c],0,a*(c+1)-o.height/2-a/2,r.maxWidth):e.fillText(n[c],0,a*(c+1)-o.height/2-a/2),e.restore()):r.maxWidth?e.fillText(n[c],l,s,r.maxWidth):e.fillText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",r)}s+=a}e.restore()}}getRect(e){if(e.__rect)return e.__rect;for(var t,i,r,s,n=this.getTextBackground(e,!0),a=0,o=n.length;a<o;a++){var l=n[a];0==a?(t=l[0],r=l[0],i=l[1],s=l[1]):(l[0]<t&&(t=l[0]),l[0]>r&&(r=l[0]),l[1]<i&&(i=l[1]),l[1]>s&&(s=l[1]))}return e.__rect={x:t,y:i,width:r-t,height:s-i},e.__rect}getRectNoRotation(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,i=this.refOriginalPosition,r=Hn.Util_area.getTextHeight("ZH",e.textFont),s=Hn.Util_area.getTextWidth(e.text,e.textFont),n=Hn.Util_area.getTextHeight(e.text,e.textFont),a=e.x+i[0];"end"==e.textAlign||"right"==e.textAlign?a-=s:"center"==e.textAlign&&(a-=s/2),t="top"==e.textBaseline?e.y+i[1]:"bottom"==e.textBaseline?e.y+i[1]-n:e.y+i[1]-n/2;var o,l=!1;if(e.maxWidth){var h=parseInt(e.maxWidth);h<s&&(o=s,l=!0,s=h),a=e.x+i[0],"end"==e.textAlign||"right"==e.textAlign?a-=s:"center"==e.textAlign&&(a-=s/2)}e.textFont&&(e.textFont.toLowerCase().indexOf("italic")>-1&&(s+=!0===l?r/3*(s/o):r/3));return{x:a,y:t,width:s,height:n}}getTextBackground(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var r=this.getRectNoRotation(e),s=e.x+i[0],n=e.y+i[1],a=[];if(e.textRotation&&0!==e.textRotation){let t=e.textRotation,i=this.getRotatedLocation(r.x,r.y,s,n,t),o=this.getRotatedLocation(r.x+r.width,r.y,s,n,t),l=this.getRotatedLocation(r.x+r.width,r.y+r.height,s,n,t),h=this.getRotatedLocation(r.x,r.y+r.height,s,n,t);a.push(i),a.push(o),a.push(l),a.push(h)}else{let e=[r.x,r.y],t=[r.x+r.width,r.y],i=[r.x+r.width,r.y+r.height],s=[r.x,r.y+r.height];a.push(e),a.push(t),a.push(i),a.push(s)}return e.__textBackground=a,e.__textBackground}getRotatedLocation(e,t,i,r,s){var n,a,o=new Array;return t=-t,r=-r,s=-s,n=(e-i)*Math.cos(s/180*Math.PI)-(t-r)*Math.sin(s/180*Math.PI)+i,a=(e-i)*Math.sin(s/180*Math.PI)+(t-r)*Math.cos(s/180*Math.PI)+r,o[0]=n,o[1]=-a,o}}class Zn extends Yn{constructor(e){super(e),this.type="smiccircle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,r=t.x+i[0],s=t.y+i[1];return e.moveTo(r+t.r,s),e.arc(r,s,t.r,0,2*Math.PI,!0),!0}getRect(e){if(e.__rect)return e.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,i=this.refOriginalPosition,r=e.x+i[0],s=e.y+i[1],n=e.r;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(r-n-t/2),y:Math.round(s-n-t/2),width:2*n+t,height:2*n+t},e.__rect}}class Kn extends Yn{constructor(e){super(e),this.type="smicpolygon",this.holePolygonPointLists=null,this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.style;t&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),e.save(),this.setContext(e,i),this.setTransform(e);var r=!1;"fill"!=i.brushType&&"both"!=i.brushType&&void 0!==i.brushType||(e.beginPath(),"dashed"==i.lineType||"dotted"==i.lineType||"dot"==i.lineType||"dash"==i.lineType||"dashdot"==i.lineType||"longdash"==i.lineType||"longdashdot"==i.lineType?this.buildPath(e,{lineType:"solid",lineWidth:i.lineWidth,pointList:i.pointList}):(this.buildPath(e,i),r=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",i),e.fill(),this.setCtxGlobalAlpha(e,"reset",i)),i.lineWidth>0&&("stroke"==i.brushType||"both"==i.brushType)&&(r||(e.beginPath(),this.buildPath(e,i)),this.setCtxGlobalAlpha(e,"stroke",i),e.stroke(),this.setCtxGlobalAlpha(e,"reset",i)),this.drawText(e,i,this.style);var s=ee.cloneObject(i);if(s.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var n=this.holePolygonPointLists,a=n.length,o=0;o<a;o++){var l=n[o];s.pointList=l,e.globalCompositeOperation="destination-out",r=!1,"fill"!=s.brushType&&"both"!=s.brushType&&void 0!==s.brushType||(e.beginPath(),"dashed"==s.lineType||"dotted"==s.lineType||"dot"==s.lineType||"dash"==s.lineType||"dashdot"==s.lineType||"longdash"==s.lineType||"longdashdot"==s.lineType?this.buildPath(e,{lineType:"solid",lineWidth:s.lineWidth,pointList:s.pointList}):(this.buildPath(e,s),r=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",s),e.fill(),this.setCtxGlobalAlpha(e,"reset",s)),s.lineWidth>0&&("stroke"==s.brushType||"both"==s.brushType)?(r||(e.beginPath(),this.buildPath(e,s)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",s),e.stroke(),this.setCtxGlobalAlpha(e,"reset",s)):e.globalCompositeOperation="source-over"}e.restore()}buildPath(e,t){t.showShadow&&(e.shadowBlur=t.shadowBlur,e.shadowColor=t.shadowColor,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,r=t.pointList;if(!(r.length<2))if(t.smooth&&"spline"!==t.smooth){var s,n,a,o=Hn.SUtil_smoothBezier(r,t.smooth,!0,t.smoothConstraint,i);e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(var l=r.length,h=0;h<l;h++)s=o[2*h],n=o[2*h+1],a=[r[(h+1)%l][0]+i[0],r[(h+1)%l][1]+i[1]],e.bezierCurveTo(s[0],s[1],n[0],n[1],a[0],a[1])}else if("spline"===t.smooth&&(r=Hn.SUtil_smoothSpline(r,!0,null,i)),t.lineType&&"solid"!=t.lineType){if("dashed"===t.lineType||"dotted"===t.lineType||"dot"===t.lineType||"dash"===t.lineType||"longdash"===t.lineType){let s=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=s;let n=t.lineWidth||1,a=n,o=n;"dashed"===t.lineType&&(a*=5,o*=5,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n)),"dotted"===t.lineType&&t.lineCap&&"butt"!==t.lineCap&&(a=1,o+=n),"dot"===t.lineType&&(o*=4,t.lineCap&&"butt"!==t.lineCap&&(a=1,o+=n)),"dash"===t.lineType&&(a*=4,o*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n)),"longdash"===t.lineType&&(a*=8,o*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n)),e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=1;t<r.length;t++)Hn.SUtil_dashedLineTo(e,r[t-1][0]+i[0],r[t-1][1]+i[1],r[t][0]+i[0],r[t][1]+i[1],n,[a,o]);Hn.SUtil_dashedLineTo(e,r[r.length-1][0]+i[0],r[r.length-1][1]+i[1],r[0][0]+i[0],r[0][1]+i[1],n,[a,o])}else if("dashdot"===t.lineType||"longdashdot"===t.lineType){let s=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=s;let n=t.lineWidth||1,a=n,o=n,l=n,h=n;"dashdot"===t.lineType&&(a*=4,o*=4,h*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n,l=1,h+=n)),"longdashdot"===t.lineType&&(a*=8,o*=4,h*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n,l=1,h+=n)),e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=1;t<r.length;t++)Hn.SUtil_dashedLineTo(e,r[t-1][0]+i[0],r[t-1][1]+i[1],r[t][0]+i[0],r[t][1]+i[1],n,[a,o,l,h]);Hn.SUtil_dashedLineTo(e,r[r.length-1][0]+i[0],r[r.length-1][1]+i[1],r[0][0]+i[0],r[0][1]+i[1],n,[a,o,l,h])}}else{e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=1;t<r.length;t++)e.lineTo(r[t][0]+i[0],r[t][1]+i[1]);e.lineTo(r[0][0]+i[0],r[0][1]+i[1])}}getRect(e,t){var i;if(t?i=t:(this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),i=this.refOriginalPosition),e.__rect)return e.__rect;for(var r,s=Number.MAX_VALUE,n=Number.MIN_VALUE,a=Number.MAX_VALUE,o=Number.MIN_VALUE,l=e.pointList,h=0,u=l.length;h<u;h++)l[h][0]+i[0]<s&&(s=l[h][0]+i[0]),l[h][0]+i[0]>n&&(n=l[h][0]+i[0]),l[h][1]+i[1]<a&&(a=l[h][1]+i[1]),l[h][1]+i[1]>o&&(o=l[h][1]+i[1]);return r="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(s-r/2),y:Math.round(a-r/2),width:n-s+r,height:o-a+r},e.__rect}}class $n extends Yn{constructor(e){super(e),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,r=t.pointList;if(!(r.length<2)){var s=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var n,a,o,l=Hn.SUtil_smoothBezier(r,t.smooth,!1,t.smoothConstraint,i);e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=0;t<s-1;t++)n=l[2*t],a=l[2*t+1],o=[r[t+1][0]+i[0],r[t+1][1]+i[1]],e.bezierCurveTo(n[0],n[1],a[0],a[1],o[0],o[1])}else if("spline"===t.smooth&&(s=(r=Hn.SUtil_smoothSpline(r,null,null,i)).length),t.lineType&&"solid"!==t.lineType){if("dashed"===t.lineType||"dotted"===t.lineType||"dot"===t.lineType||"dash"===t.lineType||"longdash"===t.lineType){let n=t.lineWidth||1,a=n,o=n;"dashed"===t.lineType&&(a*=5,o*=5,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n)),"dotted"===t.lineType&&t.lineCap&&"butt"!==t.lineCap&&(a=1,o+=n),"dot"===t.lineType&&(o*=4,t.lineCap&&"butt"!==t.lineCap&&(a=1,o+=n)),"dash"===t.lineType&&(a*=4,o*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n)),"longdash"===t.lineType&&(a*=8,o*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n)),e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(var h=1;h<s;h++)Hn.SUtil_dashedLineTo(e,r[h-1][0]+i[0],r[h-1][1]+i[1],r[h][0]+i[0],r[h][1]+i[1],n,[a,o])}else if("dashdot"===t.lineType||"longdashdot"===t.lineType){let n=t.lineWidth||1,a=n,o=n,l=n,h=n;"dashdot"===t.lineType&&(a*=4,o*=4,h*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n,l=1,h+=n)),"longdashdot"===t.lineType&&(a*=8,o*=4,h*=4,t.lineCap&&"butt"!==t.lineCap&&(a-=n,o+=n,l=1,h+=n)),n=(t.lineWidth||1)*("dashed"===t.lineType?5:1),e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=1;t<s;t++)Hn.SUtil_dashedLineTo(e,r[t-1][0]+i[0],r[t-1][1]+i[1],r[t][0]+i[0],r[t][1]+i[1],n,[a,o,l,h])}}else{e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=1;t<s;t++)e.lineTo(r[t][0]+i[0],r[t][1]+i[1])}}}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;return Kn.prototype.getRect.apply(this,[e,t])}}class ea extends Yn{constructor(e){super(e),this.type="smicimage",this._imageCache={},this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicImage"}destroy(){this.type=null,this._imageCache=null,super.destroy()}brush(e,t,i){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,s=this.style||{};t&&(s=this.getHighlightStyle(s,this.highlightStyle||{}));var n=s.image,a=this;if("string"==typeof n){var o=n;this._imageCache[o]?n=this._imageCache[o]:((n=new Image).onload=function(){n.onload=null,clearTimeout(ea._refreshTimeout),ea._needsRefresh.push(a),ea._refreshTimeout=setTimeout(function(){i&&i(ea._needsRefresh),ea._needsRefresh=[]},10)},n.src=o,this._imageCache[o]=n)}if(n){if("IMG"==n.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!=n.readyState)return}else if(!n.complete)return;var l=s.width||n.width,h=s.height||n.height,u=s.x+r[0],c=s.y+r[1];if(!n.width||!n.height)return;if(e.save(),this.doClip(e),this.setContext(e,s),this.setTransform(e),s.sWidth&&s.sHeight){let t=s.sx+r[0]||0,i=s.sy+r[1]||0;e.drawImage(n,t,i,s.sWidth,s.sHeight,u,c,l,h)}else if(s.sx&&s.sy){let t=s.sx+r[0],i=s.sy+r[1];var d=l-t,p=h-i;e.drawImage(n,t,i,d,p,u,c,l,h)}else e.drawImage(n,u,c,l,h);s.width||(s.width=l),s.height||(s.height=h),this.style.width||(this.style.width=l),this.style.height||(this.style.height=h),this.drawText(e,s,this.style),e.restore()}}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;return{x:e.x+t[0],y:e.y+t[1],width:e.width,height:e.height}}clearCache(){this._imageCache={}}}ea._needsRefresh=[],ea._refreshTimeout=null;class ta extends Yn{constructor(e){super(e),this.type="smicrectangle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicRectangle"}destroy(){this.type=null,super.destroy()}_buildRadiusPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i,r,s,n,a,o=this.refOriginalPosition,l=t.x+o[0],h=t.y+o[1],u=t.width,c=t.height,d=t.radius;"number"==typeof d?i=r=s=n=d:d instanceof Array?1===d.length?i=r=s=n=d[0]:2===d.length?(i=s=d[0],r=n=d[1]):3===d.length?(i=d[0],r=n=d[1],s=d[2]):(i=d[0],r=d[1],s=d[2],n=d[3]):i=r=s=n=0,i+r>u&&(i*=u/(a=i+r),r*=u/a),s+n>u&&(s*=u/(a=s+n),n*=u/a),r+s>c&&(r*=c/(a=r+s),s*=c/a),i+n>c&&(i*=c/(a=i+n),n*=c/a),e.moveTo(l+i,h),e.lineTo(l+u-r,h),0!==r&&e.quadraticCurveTo(l+u,h,l+u,h+r),e.lineTo(l+u,h+c-s),0!==s&&e.quadraticCurveTo(l+u,h+c,l+u-s,h+c),e.lineTo(l+n,h+c),0!==n&&e.quadraticCurveTo(l,h+c,l,h+c-n),e.lineTo(l,h+i),0!==i&&e.quadraticCurveTo(l,h,l+i,h)}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+i[0],t.y+i[1]),e.lineTo(t.x+i[0]+t.width,t.y+i[1]),e.lineTo(t.x+i[0]+t.width,t.y+i[1]+t.height),e.lineTo(t.x+i[0],t.y+i[1]+t.height),e.lineTo(t.x+i[0],t.y+i[1])),e.closePath()}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,i=this.refOriginalPosition;return e.__rect?e.__rect:(t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x+i[0]-t/2),y:Math.round(e.y+i[1]-t/2),width:e.width+t,height:e.height+t},e.__rect)}}class ia extends Yn{constructor(e){super(e),this.type="smicsector",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,r=t.x+i[0],s=t.y+i[1],n=t.r0||0,a=t.r,o=t.startAngle,l=t.endAngle,h=t.clockWise||!1;o=Hn.Util_math.degreeToRadian(o),l=Hn.Util_math.degreeToRadian(l),h||(o=-o,l=-l);var u=Hn.Util_math.cos(o),c=Hn.Util_math.sin(o);e.moveTo(u*n+r,c*n+s),e.lineTo(u*a+r,c*a+s),e.arc(r,s,a,o,l,!h),e.lineTo(Hn.Util_math.cos(l)*n+r,Hn.Util_math.sin(l)*n+s),0!==n&&e.arc(r,s,n,l,o,h),e.closePath()}getRect(e){if(e.__rect)return e.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,i=Hn.Util_vector.create(),r=Hn.Util_vector.create(),s=Hn.Util_vector.create(),n=Hn.Util_vector.create(),a=e.x+t[0],o=e.y+t[1],l=e.r0||0,h=e.r,u=Hn.Util_math.degreeToRadian(e.startAngle),c=Hn.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(u=-u,c=-c),l>1?Hn.Util_computeBoundingBox.arc(a,o,l,u,c,!d,i,s):(i[0]=s[0]=a,i[1]=s[1]=o),Hn.Util_computeBoundingBox.arc(a,o,h,u,c,!d,r,n),Hn.Util_vector.min(i,i,r),Hn.Util_vector.max(s,s,n),e.__rect={x:i[0],y:i[1],width:s[0]-i[0],height:s[1]-i[1]},e.__rect}}class ra{constructor(e){this.shapeParameters=e,this.CLASS_NAME="SuperMap.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(e){if(e&&(this.shapeParameters=e),!this.shapeParameters)return null;var t=this.shapeParameters;if(t instanceof Fn){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e=ee.copyAttributesWithClip(e,t.style,["x","y"]);let i=new Xn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","style","highlightStyle"]),i}if(t instanceof kn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=ee.copyAttributesWithClip(e,t.style,["pointList"]);let i=new $n;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}if(t instanceof Dn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=ee.copyAttributesWithClip(e,t.style,["pointList"]);let i=new Kn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}if(t instanceof Rn){if(!t.x&&!t.y&!t.width&!t.height)return null;let e=new Object;e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e=ee.copyAttributesWithClip(e,t.style,["x","y","width","height"]);let i=new ta;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","width","height","style","highlightStyle"]),i}if(t instanceof Bn){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e.startAngle=t.startAngle,e.endAngle=t.endAngle,t.r0&&(e.r0=t.r0),t.clockWise&&(e.clockWise=t.clockWise),e=ee.copyAttributesWithClip(e,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new ia;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}if(t instanceof Gn){let e=new Object;e.x=t.x,e.y=t.y,e.text=t.text,e=ee.copyAttributesWithClip(e,t.style,["x","y","text"]);let i=new Qn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","text","style","highlightStyle"]),i}if(t instanceof Un){let e=new Object;e.x=t.x,e.y=t.y,t.image&&(e.image=t.image),t.width&&(e.width=t.width),t.height&&(e.height=t.height),t.sx&&(e.sx=t.sx),t.sy&&(e.sy=t.sy),t.sWidth&&(e.sWidth=t.sWidth),t.sHeight&&(e.sHeight=t.sHeight),e=ee.copyAttributesWithClip(e,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new ea;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","image","width","height","style","highlightStyle"]),i}if(t instanceof jn){let e=new Object;e.x=t.x,e.r=t.r,e.y=t.y,e=ee.copyAttributesWithClip(e,t.style,["x","y","r"]);let i=new Zn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(e){var t={},i=["normal","normal","normal","12","arial,sans-serif"],r=[!0,!1];for(var s in e)switch(s){case"fill":r[0]=e[s];break;case"fillColor":t.color=e[s];break;case"stroke":r[1]=e[s];break;case"strokeWidth":t.lineWidth=e[s];break;case"strokeLinecap":t.lineCap=e[s];break;case"strokeLineJoin":t.lineJoin=e[s];break;case"strokeDashstyle":t.lineType=e[s];break;case"pointRadius":t.r=e[s];break;case"label":t.text=e[s];break;case"labelRect":t.labelRect=e[s];break;case"fontColor":t.textColor=e[s];break;case"fontStyle":i[0]=e[s];break;case"fontVariant":i[1]=e[s];break;case"fontWeight":i[2]=e[s];break;case"fontSize":var n="";e[s]&&e[s].toString().indexOf("px")<0&&(n="px"),i[3]=e[s]+n;break;case"fontFamily":i[4]=e[s];break;case"fontOpacity":t.opacity=e[s];break;case"labelPosition":t.textPosition=e[s];break;case"labelAlign":t.textAlign=e[s];break;case"labelBaseline":t.textBaseline=e[s];break;case"labelRotation":t.textRotation=e[s];break;default:t[s]=e[s]}return t.textFont=i.join(" "),!0===r[0]&&!1===r[1]?t.brushType="fill":!1===r[0]&&!0===r[1]?t.brushType="stroke":!0===r[0]&&!0===r[1]?t.brushType="both":t.brushType="fill",null==t.lineWidth&&(t.lineWidth=1),t}static Background(e,t,i){var r=i||{},s=new Rn(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return s.style={fillColor:"#f3f3f3"},r.backgroundStyle&&ee.copyAttributesWithClip(s.style,r.backgroundStyle),r.backgroundRadius&&(s.style.radius=r.backgroundRadius),s.clickable=!1,s.hoverable=!1,e.createShape(s)}static GraphAxis(e,t,i,r){var s=t,n=i||{},a=[],o=[],l=!!n.useXReferenceLine&&n.useXReferenceLine,h=n.axisYTick&&!isNaN(n.axisYTick)?n.axisYTick:0,u=[],c=[];if(0==h){if(c.push([s[0],s[3]-5]),c.push([s[0],s[1]]),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){let e=parseInt(n.axis3DParameter),t=[s[0]-e,s[1]+e];n.axisUseArrow?(u.push([t[0]+1.5,t[1]-7.5]),u.push([t[0]-1,t[1]+1]),u.push([t[0]+7.5,t[1]-1.5]),c.push([t[0],t[1]])):c.push([t[0],t[1]]),c.push([s[0],s[1]])}c.push([s[2]+5,s[1]])}else{var d=Math.abs(s[1]-s[3])/h,p=s[3];c.push([s[0],p-5]);for(var f=0;f<h;f++){if(c.push([s[0],p]),c.push([s[0]-5,p]),c.push([s[0],p]),l){var m=new kn([[s[0],p],[s[2],p]]);m.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},m.clickable=!1,m.hoverable=!1,n.xReferenceLineStyle&&ee.copyAttributesWithClip(m.style,n.xReferenceLineStyle),a.push(e.createShape(m))}p+=d}if(c.push([s[0],s[1]]),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){let e=parseInt(n.axis3DParameter),t=[s[0]-e,s[1]+e];n.axisUseArrow?(u.push([t[0]+1.5,t[1]-7.5]),u.push([t[0]-1,t[1]+1]),u.push([t[0]+7.5,t[1]-1.5]),c.push([t[0],t[1]])):c.push([t[0],t[1]]),c.push([s[0],s[1]])}c.push([s[2]+5,s[1]])}if(n.axisUseArrow){var y=[[s[2]+5,s[1]+4],[s[2]+13,s[1]],[s[2]+5,s[1]-4]],g=[[s[0]-4,s[3]-5],[s[0],s[3]-13],[s[0]+4,s[3]-5]],v=new Dn(y);v.style={fillColor:"#008acd"},ee.copyAttributesWithClip(v.style,n.axisStyle),o.push(e.createShape(v));var b=new Dn(g);if(b.style={fillColor:"#008acd"},ee.copyAttributesWithClip(b.style,n.axisStyle),o.push(e.createShape(b)),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){var _=new Dn(u);_.style={fillColor:"#008acd"},ee.copyAttributesWithClip(_.style,n.axisStyle),o.push(e.createShape(_))}}var S=new kn(c);S.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},n.axisStyle&&ee.copyAttributesWithClip(S.style,n.axisStyle),S.clickable=!1,S.hoverable=!1;var x=[e.createShape(S)],w=[];if(n.axisYLabels&&n.axisYLabels.length&&n.axisYLabels.length>0){var C=n.axisYLabels;let t=C.length;var M=[0,0];if(n.axisYLabelsOffset&&n.axisYLabelsOffset.length&&(M=n.axisYLabelsOffset),1==t){let t=new Gn(s[0]-5+M[0],s[3]+M[1],C[0]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&ee.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,w.push(e.createShape(t))}else for(var A=s[3],T=Math.abs(s[1]-s[3])/(t-1),E=0;E<t;E++){let t=new Gn(s[0]-5+M[0],A+M[1],C[E]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&ee.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,w.push(e.createShape(t)),A+=T}}var L=[];if(n.axisXLabels&&n.axisXLabels.length&&n.axisXLabels.length>0){let t=n.axisXLabels,i=t.length,a=[0,0];if(n.axisXLabelsOffset&&n.axisXLabelsOffset.length&&(a=n.axisXLabelsOffset),r&&r.xPositions&&r.xPositions.length&&r.xPositions.length==i){let o=r.xPositions;for(let r=0;r<i;r++){let i=new Gn(o[r]+a[0],s[1]+a[1],t[r]);i.style={labelAlign:"center",labelBaseline:"top"},n.axisXLabelsStyle&&ee.copyAttributesWithClip(i.style,n.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,L.push(e.createShape(i))}}else if(1==i){let i=new Gn(s[0]-5+a[0],s[1]+a[0],t[0]);i.style={labelAlign:"center",labelBaseline:"top"},n.axisXLabelsStyle&&ee.copyAttributesWithClip(i.style,n.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,L.push(e.createShape(i))}else{let r=s[0],o=Math.abs(s[2]-s[0])/(i-1);for(let l=0;l<i;l++){let i=new Gn(r+a[0],s[1]+a[1],t[l]);i.style={labelAlign:"center",labelBaseline:"top"},n.axisXLabelsStyle&&ee.copyAttributesWithClip(i.style,n.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,L.push(e.createShape(i)),r+=o}}}return a.concat(x).concat(w).concat(L).concat(o)}static ShapeStyleTool(e,t,i,r,s,n){var a=e||{};if(t&&ee.copyAttributesWithClip(a,t),i&&i.length&&void 0!==s&&!isNaN(s)&&s>=0&&i[s]&&ee.copyAttributesWithClip(a,i[s]),r&&r.length&&void 0!==n)for(var o=r,l=o.length,h=parseFloat(n),u=0;u<l;u++)if(o[u].start<=h&&h<o[u].end){ee.copyAttributesWithClip(a,o[u].style);break}return a}}class sa{constructor(e,t){e&&t&&t.map&&t.renderer&&(this.id=ee.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=null,this.location=[],this.data=e,this.shapes=[],this.layer=t,this.CLASS_NAME="SuperMap.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}getLocalXY(e){var t=this.layer.map.getResolution(),i=this.layer.map.getExtent();if(e instanceof le||e instanceof ue){return[e.x/t+-i.left/t,i.top/t-e.y/t]}if(e instanceof re){return[e.lon/t+-i.left/t,i.top/t-e.lat/t]}return null}}class na extends sa{constructor(e,t,i,r,s,n){super(e,t,i,r,s,n),this.shapeFactory=new ra,this.shapeParameters=null,this.RelativeCoordinate=!1,this.setting=null,this.origonPoint=null,this.chartBox=null,this.chartBounds=null,this.width=null,this.height=null,this.XOffset=0,this.YOffset=0,this.DVBParameter=null,this.dataViewBox=null,this.DVBCodomain=null,this.DVBCenterPoint=null,this.DVBUnitValue=null,this.DVBOrigonPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.origonPointOffset=null,this.fields=i||[],this.dataValues=null,this.lonlat=s||this.data.geometry.getBounds().getCenterLonLat(),r&&r.width&&r.height&&r.codomain&&(this.setting=r),this.CLASS_NAME="SuperMap.Feature.Theme.Graph"}destroy(){this.shapeFactory=null,this.shapeParameters=null,this.width=null,this.height=null,this.origonPoint=null,this.chartBox=null,this.dataViewBox=null,this.chartBounds=null,this.DVBParameter=null,this.DVBOrigonPoint=null,this.DVBCenterPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.DVBCodomain=null,this.DVBUnitValue=null,this.origonPointOffset=null,this.XOffset=null,this.YOffset=null,this.fields=null,this.dataValues=null,this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var e=this.setting;if(!(e.width&&e.height&&e.codomain))return!1;var t=void 0===e.decimalNumber||isNaN(e.decimalNumber)?-1:e.decimalNumber,i=sa.getDataValues(this.data,this.fields,t);this.dataValues=i||[],this.width=parseFloat(e.width),this.height=parseFloat(e.height),this.DVBCodomain=e.codomain,this.XOffset=e.XOffset?e.XOffset:0,this.YOffset=e.YOffset?e.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=e.dataViewBoxParameter?e.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var r=this.width,s=this.height,n=this.location;this.origonPoint=[n[0]-r/2,n[1]-s/2];var a=this.origonPoint;this.chartBox=[a[0],a[1]+s,a[0]+r,a[1]];var o=this.chartBox,l=this.DVBParameter;this.dataViewBox=[o[0]+l[0],o[1]-l[1],o[2]-l[2],o[3]+l[3]];var h=this.dataViewBox;return!(h[0]>=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}resetLocation(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var i=this.width,r=this.height,s=this.location;return this.chartBounds=new se(s[0]-i/2,s[1]+r/2,s[0]+i/2,s[1]-r/2),this.resetLinearGradient(),s}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var e=this.shapes,t=this.location,i=0,r=e.length;i<r;i++){e[i].refOriginalPosition=t;var s=e[i].style;for(var n in s)switch(n){case"pointList":for(var a=s[n],o=0,l=a.length;o<l;o++)a[o][0]-=t[0],a[o][1]-=t[1];break;case"x":s[n]-=t[0];break;case"y":s[n]-=t[1]}}this.RelativeCoordinate=!0}assembleShapes(){}getLocalXY(e){return this.layer.getLocalXY(e)}}sa.getDataValues=function(e,t,i){if(!e.attributes)return!1;for(var r=[],s=e.attributes,n=0;n<t.length;n++)for(var a in s)if(a===t[n])try{!isNaN(i)&&i>=0?r.push(parseFloat(s[a].toString()).toFixed(i)):r.push(parseFloat(s[a].toString()))}catch(e){throw new Error("not a number")}return r.length===t.length&&r};class aa extends na{constructor(e,t,i,r,s,n){super(e,t,i,r,s,n),this.setting=null,r&&r.codomain&&(this.setting=r,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="SuperMap.Feature.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var e=this.setting;e.XOffset&&(this.XOffset=e.XOffset),e.YOffset&&(this.YOffset=e.YOffset),this.XOffset=e.XOffset?e.XOffset:0,this.YOffset=e.YOffset?e.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=e.dataViewBoxParameter?e.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var t=this.width,i=this.height,r=this.location;this.origonPoint=[r[0]-t/2,r[1]-i/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+i,s[0]+t,s[1]];var n=this.chartBox,a=this.DVBParameter;this.dataViewBox=[n[0]+a[0],n[1]-a[1],n[2]-a[2],n[3]+a[3]];var o=this.dataViewBox;return!(o[0]>=o[2]||o[1]<=o[3])&&(this.DVBOrigonPoint=[o[0],o[3]],this.DVBWidth=Math.abs(o[2]-o[0]),this.DVBHeight=Math.abs(o[1]-o[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}}class oa extends sa{constructor(e,t,i,r,s){if(super(e,t),e.geometry&&e.geometry instanceof X){this.dataBounds=e.geometry.getBounds(),this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=i||{},this.CLASS_NAME="SuperMap.Feature.Theme.Vector",this.style=i||{},r&&ee.copyAttributesWithClip(this,r,["shapeOptions","dataBounds"]),s&&ee.copyAttributesWithClip(this.shapeOptions,s);var n=e.geometry;this.lonlat=this.dataBounds.getCenterLonLat(),this.location=this.getLocalXY(this.lonlat),n instanceof ce?this.lineToTF(n):n instanceof he?this.lineToTF(n):n instanceof oe||(n instanceof ae?this.multiPointToTF(n):n instanceof de?this.multiLineStringToTF(n):n instanceof pe?this.multiPolygonToTF(n):n instanceof fe?this.polygonToTF(n):n instanceof ne||(n instanceof le?this.pointToTF(n):n instanceof me?this.rectangleToTF(n):n instanceof ue&&this.geoTextToTF(n)))}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}lineToTF(e){for(var t=e.components,i=[],r=[],s=this.location,n=[],a=this.nodesClipPixel,o=0;o<t.length;o++){var l=t[o];if(r=[],i=this.getLocalXY(l),r[0]=i[0]-s[0],r[1]=i[1]-s[1],n.length>0){var h=n[n.length-1];if(Math.abs(h[0]-r[0])<=a&&Math.abs(h[1]-r[1])<=a)continue}n.push(r)}if(n.length<2)return null;var u=new Object;(u=ee.copyAttributesWithClip(u,this.style,["pointList"])).pointList=n;var c=new $n({style:u,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(c.highlightStyle=this.highlightStyle),c.refOriginalPosition=this.location,c.refDataID=this.data.id,c.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}multiPointToTF(e){for(var t=e.components,i=[],r=[],s=this.location,n=[],a=this.nodesClipPixel,o=0;o<t.length;o++){var l=t[o];if(r=[],i=this.getLocalXY(l),r[0]=i[0]-s[0],r[1]=i[1]-s[1],n.length>0){var h=n[n.length-1];if(Math.abs(h[0]-r[0])<=a&&Math.abs(h[1]-r[1])<=a)continue}n.push(r);var u=new Object;u.r=6,(u=ee.copyAttributesWithClip(u,this.style)).x=r[0],u.y=r[1];var c=new Xn({style:u,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(c.highlightStyle=this.highlightStyle),c.refOriginalPosition=s,c.refDataID=this.data.id,c.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}}multiLineStringToTF(e){for(var t=e.components,i=0;i<t.length;i++){var r=t[i];this.lineToTF(r)}}multiPolygonToTF(e){for(var t=e.components,i=0;i<t.length;i++){var r=t[i];this.polygonToTF(r)}}pointToTF(e){var t=this.location,i=this.getLocalXY(e),r=new Object;r.r=6,(r=ee.copyAttributesWithClip(r,this.style)).x=i[0]-t[0],r.y=i[1]-t[1];var s=new Xn({style:r,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(s.highlightStyle=this.highlightStyle),s.refOriginalPosition=t,s.refDataID=this.data.id,s.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}polygonToTF(e){for(var t=e.components,i=[],r=[],s=this.location,n=[],a=[],o=[],l=this.nodesClipPixel,h=0;h<t.length;h++){var u=t[h].components;if(0===h){n=[];for(var c=0;c<u.length;c++){if(r=[],i=this.getLocalXY(u[c]),r[0]=i[0]-s[0],r[1]=i[1]-s[1],n.length>0){var d=n[n.length-1];if(Math.abs(d[0]-r[0])<=l&&Math.abs(d[1]-r[1])<=l)continue}n.push(r)}}else{a=[];for(var p=0;p<u.length;p++){if(r=[],i=this.getLocalXY(u[p]),r[0]=i[0]-s[0],r[1]=i[1]-s[1],a.length>0){var f=a[a.length-1];if(Math.abs(f[0]-r[0])<=l&&Math.abs(f[1]-r[1])<=l)continue}a.push(r)}}a.length<2||o.push(a)}if(!(n.length<2)){var m={};(m=ee.copyAttributesWithClip(m,this.style,["pointList"])).pointList=n;var y=new Kn({style:m,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(y.highlightStyle=this.highlightStyle),y.refOriginalPosition=this.location,y.refDataID=this.data.id,y.isHoverByRefDataID=this.isMultiHover,o.length>0&&(y.holePolygonPointLists=o),this.shapeOptions&&ee.copyAttributesWithClip(y,this.shapeOptions),this.shapes.push(y)}}rectangleToTF(e){var t=this.location,i=new re(e.x,e.y),r=this.layer.map.getResolution(),s=this.getLocalXY(i),n=new Object;n.r=6,(n=ee.copyAttributesWithClip(n,this.style)).x=s[0]-t[0],n.y=s[1]-t[1]-2*e.width/r,n.width=e.width/r,n.height=e.height/r;var a=new ta({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=t,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}geoTextToTF(e){var t=this.location,i=this.getLocalXY(e),r=new Object;r.r=6,(r=ee.copyAttributesWithClip(r,this.style,["x","y","text"])).x=i[0]-t[0],r.y=i[1]-t[1],r.text=e.text;var s=new Qn({style:r,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(s.highlightStyle=this.highlightStyle),s.refOriginalPosition=t,s.refDataID=this.data.id,s.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}updateAndAddShapes(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,i=0,r=this.shapes.length;i<r;i++){var s=this.shapes[i];s.refOriginalPosition=e,t.addShape(s)}}getShapesCount(){return this.shapes.length}getLocalXY(e){return this.layer.getLocalXY(e)}}class la extends(J(zn,Wn)){constructor(e){super(e),e=e||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,ee.extend(this,e),this.id=this.id||ee.createUniqueID("smShapeGroup_"),this.CLASS_NAME="SuperMap.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(e){return this._children[e]}addChild(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof la&&e.addChildrenToStorage(this._storage)))}removeChild(e){var t=ee.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof la&&e.delChildrenFromStorage(this._storage))}eachChild(e,t){for(var i=!!t,r=0;r<this._children.length;r++){var s=this._children[r];i?e.call(t,s):e(s)}}traverse(e,t){for(var i=!!t,r=0;r<this._children.length;r++){var s=this._children[r];i?e.call(t,s):e(s),"group"===s.type&&s.traverse(e,t)}}addChildrenToStorage(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.addToMap(i),"group"===i.type&&i.addChildrenToStorage(e)}}delChildrenFromStorage(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.delFromMap(i.id),"group"===i.type&&i.delChildrenFromStorage(e)}}modSelf(){this.__dirty=!0}}class ha{constructor(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0,this.CLASS_NAME="SuperMap.LevelRenderer.Storage"}destroy(){this.dispose(),this._shapeList=null,this._shapeListOffset=null}iterShape(e,t){if(!t){t={hover:!1,normal:"down",update:!1}}if(t.hover)for(var i=0,r=this._hoverElements.length;i<r;i++){var s=this._hoverElements[i];if(s.updateTransform(),e(s))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":{let t=this._shapeList.length;for(;t--;)if(e(this._shapeList[t]))return this;break}default:for(let t=0,i=this._shapeList.length;t<i;t++)if(e(this._shapeList[t]))return this}return this}getHoverShapes(e){var t=[],i=this._hoverElements.length;for(let e=0;e<i;e++){t.push(this._hoverElements[e]);var r=this._hoverElements[e].hoverConnect;if(r)for(var s,n=0,a=(r=r instanceof Array?r:[r]).length;n<a;n++)(s=r[n].id?r[n]:this.get(r[n]))&&t.push(s)}if(t.sort(ha.shapeCompareFunc),e)for(let e=0,i=t.length;e<i;e++)t[e].updateTransform();return t}getShapeList(e){return e&&this.updateShapeList(),this._shapeList}updateShapeList(){this._shapeListOffset=0;var e=this._roots.length;for(let t=0;t<e;t++){let e=this._roots[t];this._updateAndAddShape(e)}this._shapeList.length=this._shapeListOffset;var t=this._shapeList.length;for(let e=0;e<t;e++)this._shapeList[e].__renderidx=e;this._shapeList.sort(ha.shapeCompareFunc)}_updateAndAddShape(e,t){if(!e.ignore)if(e.updateTransform(),"group"==e.type){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice()).push(e.clipShape):t=[e.clipShape]);for(var i=0;i<e._children.length;i++){var r=e._children[i];r.__dirty=e.__dirty||r.__dirty,this._updateAndAddShape(r,t)}e.__dirty=!1}else e.__clipShapes=t,this._shapeList[this._shapeListOffset++]=e}mod(e,t){var i=this._elements[e];if(i&&(i.modSelf(),t))if(t.parent||t._storage||t.__startClip){var r={};for(var s in t)"parent"!=s&&"_storage"!=s&&"__startClip"!=s&&t.hasOwnProperty(s)&&(r[s]=t[s]);(new xn).merge(i,r,!0)}else(new xn).merge(i,t,!0);return this}drift(e,t,i){var r=this._elements[e];return r&&(r.needTransform=!0,"horizontal"===r.draggable?i=0:"vertical"===r.draggable&&(t=0),(!r.ondrift||r.ondrift&&!r.ondrift(t,i))&&r.drift(t,i)),this}addHover(e){return e.updateNeedTransform(),this._hoverElements.push(e),this}delHover(){return this._hoverElements=[],this}hasHoverShape(){return this._hoverElements.length>0}addRoot(e){e instanceof la&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}delRoot(e){if(void 0===e){for(var t=0;t<this._roots.length;t++){var i=this._roots[t];i instanceof la&&i.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],void(this._roots=[])}if(e instanceof Array){var r=e.length;for(let t=0;t<r;t++)this.delRoot(e[t])}else{var s;s="string"==typeof e?this._elements[e]:e;var n=(new xn).indexOf(this._roots,s);n>=0&&(this.delFromMap(s.id),this._roots.splice(n,1),s instanceof la&&s.delChildrenFromStorage(this))}}addToMap(e){return e instanceof la&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this}get(e){return this._elements[e]}delFromMap(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof la&&(t._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}}class ua{constructor(e,t){this.root=e,this.storage=t,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,ua.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="SuperMap.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",this.root.appendChild(i),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=ua.createDom(ee.createUniqueID("SuperMap.Theme_background_"),"div",this),i.appendChild(this._bgDom),this._bgDom.onselectstart=n,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var r=new ca(ee.createUniqueID("_highLightLayer_"),this);this._layers.hover=r,i.appendChild(r.dom),r.initContext(),r.dom.onselectstart=n,r.dom.style["-webkit-user-select"]="none",r.dom.style["user-select"]="none",r.dom.style["-webkit-touch-callout"]="none";var s=this;function n(){return!1}this.updatePainter=function(e,t){s.refreshShapes(e,t)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(e){return this.refresh(e,!0),this}refresh(e,t){var i=this.storage.getShapeList(!0);return this._paintList(i,t),"function"==typeof e&&e(),this}_paintList(e,t){var i,r,s;for(var n in void 0===t&&(t=!1),this._updateLayerStatus(e),this._layers)"hover"!==n&&(this._layers[n].unusedCount++,this._layers[n].updateTransform());for(var a=[],o=0,l=e.length;o<l;o++){var h=e[o];if(r!==h.zlevel&&(i&&i.needTransform&&s.restore(),s=(i=this.getLayer(h.zlevel)).ctx,r=h.zlevel,i.unusedCount=0,(i.dirty||t)&&i.clear(),i.needTransform&&(s.save(),i.setTransform(s))),s&&h.__startClip){var u=h.__startClip;if(s.save(),u.needTransform){let e=u.transform;Hn.Util_matrix.invert(a,e),s.transform(e[0],e[1],e[2],e[3],e[4],e[5])}if(s.beginPath(),u.buildPath(s,u.style),s.clip(),u.needTransform){let e=a;s.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}if((i&&i.dirty||t)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(s,!1)))if(qn.catchBrushException)try{h.brush(s,!1,this.updatePainter)}catch(e){Hn.Util_log(e,"brush error of "+h.type,h)}else h.brush(s,!1,this.updatePainter);s&&h.__stopClip&&s.restore(),h.__dirty=!1}s&&i&&i.needTransform&&s.restore();for(let e in this._layers)if("hover"!==e){var c=this._layers[e];c.dirty=!1,1==c.unusedCount&&c.clear()}}getLayer(e){var t=this._layers[e];if(!t){var i=this._zlevelList.length,r=null,s=-1;if(i>0&&e>this._zlevelList[0]){for(s=0;s<i-1&&!(this._zlevelList[s]<e&&this._zlevelList[s+1]>e);s++);r=this._layers[this._zlevelList[s]]}this._zlevelList.splice(s+1,0,e),t=new ca(ee.createUniqueID("_levelLayer_"+e),this);var n=r?r.dom:this._bgDom;n.nextSibling?n.parentNode.insertBefore(t.dom,n.nextSibling):n.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&(new xn).merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}getLayers(){return this._layers}_updateLayerStatus(e){var t=this._layers,i={};for(let e in t)"hover"!==e&&(i[e]=t[e].elCount,t[e].elCount=0);for(let i=0;i<e.length;i++){var r=e[i],s=t[r.zlevel];if(s){if(s.elCount++,s.dirty)continue;s.dirty=r.__dirty}}for(let e in t)"hover"!==e&&i[e]!==t[e].elCount&&(t[e].dirty=!0)}refreshShapes(e,t){for(var i=0,r=e.length;i<r;i++){var s=e[i];this.storage.mod(s.id)}return this.refresh(t),this}clear(){for(var e in this._layers)"hover"!=e&&this._layers[e].clear();return this}modLayer(e,t){if(t){this._layerConfig[e]?(new xn).merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var i=this._layers[e];i&&(new xn).merge(i,this._layerConfig[e],!0)}}delLayer(e){var t=this._layers[e];t&&(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice((new xn).indexOf(this._zlevelList,e),1))}refreshHover(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,i=e.length;t<i;t++)this._brushHover(e[t]);return this.storage.delHover(),this}clearHover(){var e=this._layers.hover;return e&&e.clear(),this}resize(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),i=this._getHeight();if(e.style.display="",this._width!=t||i!=this._height){for(var r in this._width=t,this._height=i,e.style.width=t+"px",e.style.height=i+"px",this._layers)this._layers[r].resize(t,i);this.refresh(null,!0)}return this}clearLayer(e){var t=this._layers[e];t&&t.clear()}dispose(){this.root.innerHTML="",this.root=null,this.storage=null,this._domRoot=null,this._layers=null}getDomHover(){return this._layers.hover.dom}toDataURL(e,t,i){var r=ua.createDom(ee.createUniqueID("SuperMap.Theme.image_"),"canvas",this);this._bgDom.appendChild(r);var s=r.getContext("2d");1!=ua.devicePixelRatio&&s.scale(ua.devicePixelRatio,ua.devicePixelRatio),s.fillStyle=t||"#fff",s.rect(0,0,this._width*ua.devicePixelRatio,this._height*ua.devicePixelRatio),s.fill();var n=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(s,!1)))if(qn.catchBrushException)try{e.brush(s,!1,n.updatePainter)}catch(t){Hn.Util_log(t,"brush error of "+e.type,e)}else e.brush(s,!1,n.updatePainter)},{normal:"up",update:!0});var a=r.toDataURL(e,i);return s=null,this._bgDom.removeChild(r),a}getWidth(){return this._width}getHeight(){return this._height}_getWidth(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0}_getHeight(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0}_brushHover(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var i=this.getLayer(e.zlevel);if(i.needTransform&&(t.save(),i.setTransform(t)),qn.catchBrushException)try{e.brush(t,!0,this.updatePainter)}catch(t){Hn.Util_log(t,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.updatePainter);i.needTransform&&t.restore()}}_shapeToImage(e,t,i,r,s){var n=document.createElement("canvas"),a=n.getContext("2d"),o=s||window.devicePixelRatio||1;n.style.width=i+"px",n.style.height=r+"px",n.setAttribute("width",i*o),n.setAttribute("height",r*o),a.clearRect(0,0,i*o,r*o);var l={position:t.position,rotation:t.rotation,scale:t.scale};t.position=[0,0,0],t.rotation=0,t.scale=[1,1],t&&t.brush(a,!1);var h=new ea({id:e,style:{x:0,y:0,image:n}});return null!=l.position&&(h.position=t.position=l.position),null!=l.rotation&&(h.rotation=t.rotation=l.rotation),null!=l.scale&&(h.scale=t.scale=l.scale),h}_createShapeToImageProcessor(){var e=this;return function(t,i,r,s){return e._shapeToImage(t,i,r,s,ua.devicePixelRatio)}}updateHoverLayer(e){if(!(e instanceof Array))return this;this.clearHover(),this.storage.delHover();for(var t=0;t<e.length;t++)this.storage.addHover(e[t]),this._brushHover(e[t])}static createDom(e,t,i){var r=document.createElement(t),s=i._width,n=i._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=s+"px",r.style.height=n+"px",r.setAttribute("width",s*ua.devicePixelRatio),r.setAttribute("height",n*ua.devicePixelRatio),r.setAttribute("id",e),r}}class ca extends Wn{constructor(e,t){super(e,t),this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=t,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,this.ctx=null,this.dom=ua.createDom(ee.createUniqueID("SuperMap.Theme"+e),"canvas",t),this.dom.onselectstart=function(){return!1},this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.CLASS_NAME="SuperMap.LevelRenderer.Painter.Layer"}destroy(){this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=null,this.unusedCount=null,this.config=null,this.dirty=null,this.elCount=null,this.clearColor=null,this.motionBlur=null,this.lastFrameAlpha=null,this.zoomable=null,this.panable=null,this.maxZoom=null,this.minZoom=null,this.ctx=null,Wn.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),1!=ua.devicePixelRatio&&this.ctx.scale(ua.devicePixelRatio,ua.devicePixelRatio)}createBackBuffer(){this.domBack=ua.createDom(ee.createUniqueID("SuperMap.Theme.back-"+this.id),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!=ua.devicePixelRatio&&this.ctxBack.scale(ua.devicePixelRatio,ua.devicePixelRatio)}resize(e,t){this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*ua.devicePixelRatio),this.dom.setAttribute("height",t*ua.devicePixelRatio),1!=ua.devicePixelRatio&&this.ctx.scale(ua.devicePixelRatio,ua.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",e*ua.devicePixelRatio),this.domBack.setAttribute("height",t*ua.devicePixelRatio),1!=ua.devicePixelRatio&&this.ctxBack.scale(ua.devicePixelRatio,ua.devicePixelRatio))}clear(){var e=this.dom,t=this.ctx,i=e.width,r=e.height,s=this.clearColor,n=this.motionBlur,a=this.lastFrameAlpha;if(n&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,i/ua.devicePixelRatio,r/ua.devicePixelRatio)),s?(t.save(),t.fillStyle=this.config.clearColor,t.fillRect(0,0,i/ua.devicePixelRatio,r/ua.devicePixelRatio),t.restore()):t.clearRect(0,0,i/ua.devicePixelRatio,r/ua.devicePixelRatio),n){var o=this.domBack;t.save(),t.globalAlpha=a,t.drawImage(o,0,0,i/ua.devicePixelRatio,r/ua.devicePixelRatio),t.restore()}}}class da extends zn{constructor(e,t,i){var r,s;super(e,t,i),this.root=e,this.storage=t,this.painter=i,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=(r=function(e,t,i){var r=this;if(r._draggingTarget&&r._draggingTarget.id==e.id||e.isSilent())return!1;var s=r._event;if(e.isCover(t,i)){if(e.hoverable)if(e.isHoverByRefDataID&&!0===e.isHoverByRefDataID){if(e.refDataID){var n=e.refDataID,a=null;e.refDataHoverGroup&&(a=e.refDataHoverGroup);for(var o=r.storage._shapeList,l=0,h=o.length;l<h;l++){var u=o[l];u.refDataID&&n===u.refDataID&&(a?u.refDataHoverGroup&&a===u.refDataHoverGroup&&r.storage.addHover(u):r.storage.addHover(u))}}}else r.storage.addHover(e);for(var c=e.parent;c;){if(c.clipShape&&!c.clipShape.isCover(r._mouseX,r._mouseY))return!1;c=c.parent}return r._lastHover!=e&&(r._processOutShape(s),r._processDragLeave(s),r._lastHover=e,r._processDragEnter(s)),r._processOverShape(s),r._processDragOver(s),r._hasfound=1,!0}return!1},s=this,function(e,t,i){return r.call(s,e,t,i)}),this._domHover=i.getDomHover(),this.CLASS_NAME="SuperMap.LevelRenderer.Handler";var n={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(qn.EVENT.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<10&&this._dispatchAgency(t,qn.EVENT.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=e||window.event,e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,qn.EVENT.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){var t=((e=this._zrenderEventFixed(e)).wheelDelta||-e.detail)>0?1.1:1/1.1,i=this.painter.getLayers(),r=!1;for(var s in i)if("hover"!==s){var n=i[s],a=n.position;if(n.zoomable){n.__zoom=n.__zoom||1;var o=n.__zoom;o*=t,t=(o=Math.max(Math.min(n.maxZoom,o),n.minZoom))/n.__zoom,n.__zoom=o,a[0]-=(this._mouseX-a[0])*(t-1),a[1]-=(this._mouseY-a[1])*(t-1),n.scale[0]*=t,n.scale[1]*=t,n.dirty=!0,r=!0}}r&&this.painter.refresh(),this._dispatchAgency(this._lastHover,qn.EVENT.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){this._clickThreshold++,e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=Hn.Util_event.getX(e),this._mouseY=Hn.Util_event.getY(e);var t=this._mouseX-this._lastX,i=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var r="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var s=this.painter.getLayers(),n=!1;for(var a in s)if("hover"!==a){var o=s[a];o.panable&&(r="move",o.position[0]+=t,o.position[1]+=i,n=!0,o.dirty=!0)}n&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?r="move":this._hasfound&&this._lastHover.clickable&&(r="pointer"),this.root.style.cursor=r,this._dispatchAgency(this._lastHover,qn.EVENT.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){var t=(e=this._zrenderEventFixed(e)).toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.refreshHover(),this.dispatch(qn.EVENT.GLOBALOUT,e)},mousedown:function(e){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=e.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,qn.EVENT.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,qn.EVENT.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&Hn.Util_event.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment<qn.EVENT.touchClickDelay&&(this._mobildFindFixed(e),this._clickHandler(e),t-this._lastClickMoment<qn.EVENT.touchClickDelay/2&&(this._dblclickHandler(e),this._lastHover&&this._lastHover.clickable&&Hn.Util_event.stop(e)),this._lastClickMoment=t),this.painter.clearHover()}};function a(e,t){return function(i){return e.call(t,i)}}!function(e){var t=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],i=t.length;for(;i--;){var r=t[i];e["_"+r+"Handler"]=a(n[r],e)}}(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),Hn.Util_env.os.tablet||Hn.Util_env.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("dblclick",this._dblclickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.ondblclick=this._dblclickHandler,e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))}destroy(){this.dispose(),this._lastX=null,this._lastY=null,this._mouseX=null,this._mouseY=null,this._findHover=null,zn.prototype.destroy.apply(this,arguments)}on(e,t){return this.bind(e,t),this}un(e,t){return this.unbind(e,t),this}trigger(e,t){var i=qn.EVENT;switch(e){case i.RESIZE:case i.CLICK:case i.DBLCLICK:case i.MOUSEWHEEL:case i.MOUSEMOVE:case i.MOUSEDOWN:case i.MOUSEUP:case i.MOUSEOUT:this["_"+e+"Handler"](t)}}dispose(){var e=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),Hn.Util_env.os.tablet||Hn.Util_env.os.phone?(e.removeEventListener("touchstart",this._touchstartHandler),e.removeEventListener("touchmove",this._touchmoveHandler),e.removeEventListener("touchend",this._touchendHandler)):(e.removeEventListener("click",this._clickHandler),e.removeEventListener("dblclick",this._dblclickHandler),e.removeEventListener("mousewheel",this._mousewheelHandler),e.removeEventListener("mousemove",this._mousemoveHandler),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("mouseup",this._mouseupHandler)),e.removeEventListener("DOMMouseScroll",this._mousewheelHandler),e.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),e.detachEvent("onclick",this._clickHandler),e.detachEvent("dblclick",this._dblclickHandler),e.detachEvent("onmousewheel",this._mousewheelHandler),e.detachEvent("onmousemove",this._mousemoveHandler),e.detachEvent("onmouseout",this._mouseoutHandler),e.detachEvent("onmousedown",this._mousedownHandler),e.detachEvent("onmouseup",this._mouseupHandler)),this.root=null,this._domHover=null,this.storage=null,this.painter=null,this.un()}_processDragStart(e){var t=this._lastHover;if(this._isMouseDown&&t&&t.draggable&&!this._draggingTarget&&this._mouseDownTarget==t){if(t.dragEnableTime&&new Date-this._lastMouseDownMoment<t.dragEnableTime)return;var i=t;this._draggingTarget=i,this._isDragging=1,i.invisible=!0,this.storage.mod(i.id),this._dispatchAgency(i,qn.EVENT.DRAGSTART,e),this.painter.refresh()}}_processDragEnter(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,qn.EVENT.DRAGENTER,e,this._draggingTarget)}_processDragOver(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,qn.EVENT.DRAGOVER,e,this._draggingTarget)}_processDragLeave(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,qn.EVENT.DRAGLEAVE,e,this._draggingTarget)}_processDrop(e){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,qn.EVENT.DROP,e,this._draggingTarget))}_processDragEnd(e){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,qn.EVENT.DRAGEND,e),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(e){this._dispatchAgency(this._lastHover,qn.EVENT.MOUSEOVER,e)}_processOutShape(e){this._dispatchAgency(this._lastHover,qn.EVENT.MOUSEOUT,e)}_dispatchAgency(e,t,i,r){var s="on"+t,n={type:t,event:i,target:e,cancelBubble:!1},a=e;for(r&&(n.dragged=r);a&&(a[s]&&(n.cancelBubble=a[s](n)),a.dispatch(t,n),a=a.parent,!n.cancelBubble););e?n.cancelBubble||this.dispatch(t,n):r||this.dispatch(t,{type:t,event:i})}_iterateAndFindHover(){for(var e,t=Hn.Util_matrix.create(),i=this.storage.getShapeList(),r=[0,0],s=i.length-1;s>=0;s--){var n=i[s];if(void 0!==n.zlevel&&(e=this.painter.getLayer(n.zlevel,e),r[0]=this._mouseX,r[1]=this._mouseY,e.needTransform&&(Hn.Util_matrix.invert(t,e.transform),Hn.Util_vector.applyTransform(r,r,t))),this._findHover(n,r[0],r[1]))break}}_mobildFindFixed(e){var t=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var i=0;!this._lastHover&&i<t.length;i++){var r=t[i];r.x&&(this._mouseX+=r.x),r.y&&(this._mouseX+=r.y),this._iterateAndFindHover()}this._lastHover&&(e.zrenderX=this._mouseX,e.zrenderY=this._mouseY)}_zrenderEventFixed(e,t){if(e.zrenderFixed)return e;if(t){var i="touchend"!=e.type?e.targetTouches[0]:e.changedTouches[0];if(i){var r=this.root.getBoundingClientRect();e.zrenderX=i.clientX-r.left,e.zrenderY=i.clientY-r.top}}else{var s=(e=e||window.event).toElement||e.relatedTarget||e.srcElement||e.target;s&&s!=this._domHover&&(e.zrenderX=(void 0!==e.offsetX?e.offsetX:e.layerX)+s.offsetLeft,e.zrenderY=(void 0!==e.offsetY?e.offsetY:e.layerY)+s.offsetTop)}return e.zrenderFixed=1,e}getLastHoverOne(){return this._lastHover?this._lastHover:null}}class pa{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Animation.easing"}destroy(){}Linear(e){return e}QuadraticIn(e){return e*e}QuadraticOut(e){return e*(2-e)}QuadraticInOut(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}CubicIn(e){return e*e*e}CubicOut(e){return--e*e*e+1}CubicInOut(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}QuarticIn(e){return e*e*e*e}QuarticOut(e){return 1- --e*e*e*e}QuarticInOut(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}QuinticIn(e){return e*e*e*e*e}QuinticOut(e){return--e*e*e*e*e+1}QuinticInOut(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}SinusoidalIn(e){return 1-Math.cos(e*Math.PI/2)}SinusoidalOut(e){return Math.sin(e*Math.PI/2)}SinusoidalInOut(e){return.5*(1-Math.cos(Math.PI*e))}ExponentialIn(e){return 0===e?0:Math.pow(1024,e-1)}ExponentialOut(e){return 1===e?1:1-Math.pow(2,-10*e)}ExponentialInOut(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}CircularIn(e){return 1-Math.sqrt(1-e*e)}CircularOut(e){return Math.sqrt(1- --e*e)}CircularInOut(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}ElasticIn(e){var t,i=.1;return 0===e?0:1===e?1:(i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))}ElasticOut(e){var t,i=.1;return 0===e?0:1===e?1:(i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)}ElasticInOut(e){var t,i=.1;return 0===e?0:1===e?1:(i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*.5+1)}BackIn(e){var t=1.70158;return e*e*((t+1)*e-t)}BackOut(e){var t=1.70158;return--e*e*((t+1)*e+t)+1}BackInOut(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}BounceIn(e){return 1-this.BounceOut(1-e)}BounceOut(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}BounceInOut(e){return e<.5?.5*this.BounceIn(2*e):.5*this.BounceOut(2*e-1)+.5}}class fa{constructor(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop=void 0!==e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this.CLASS_NAME="SuperMap.LevelRenderer.Animation.Clip"}destroy(){}step(e){var t=new pa,i=(e-this._startTime)/this._life;if(!(i<0)){i=Math.min(i,1);var r="string"==typeof this.easing?t[this.easing]:this.easing,s="function"==typeof r?r(i):i;return this.fire("frame",s),1==i?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var e=((new Date).getTime()-this._startTime)%this._life;this._startTime=(new Date).getTime()-e+this.gap}fire(e,t){for(var i=0,r=this._targetPool.length;i<r;i++)this["on"+e]&&this["on"+e](this._targetPool[i],t)}}class ma extends zn{constructor(e){super(e),e=e||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,ee.extend(this,e),this.CLASS_NAME="SuperMap.LevelRenderer.Animation"}add(e){this._clips.push(e)}remove(e){var t=(new xn).indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)}_update(){var e=(new Date).getTime(),t=e-this._time,i=this._clips,r=i.length,s=[],n=[];for(let t=0;t<r;t++){var a=i[t],o=a.step(e);o&&(s.push(o),n.push(a))}this.stage.update&&this.stage.update();for(let e=0;e<r;)i[e]._needsRemove?(i[e]=i[r-1],i.pop(),r--):e++;r=s.length;for(let e=0;e<r;e++)n[e].fire(s[e]);this._time=e,this.onframe(t),this.dispatch("frame",t)}start(){var e=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},t=this;this._running=!0,this._time=(new Date).getTime(),e(function i(){t._running&&(t._update(),e(i))})}stop(){this._running=!1}clear(){this._clips=[]}animate(e,t){var i=new ya(e,(t=t||{}).loop,t.getter,t.setter);return i.animation=this,i}static _interpolateNumber(e,t,i){return(t-e)*i+e}static _interpolateArray(e,t,i,r,s){var n=e.length;if(1==s)for(let s=0;s<n;s++)r[s]=ma._interpolateNumber(e[s],t[s],i);else{var a=e[0].length;for(let s=0;s<n;s++)for(let n=0;n<a;n++)r[s][n]=ma._interpolateNumber(e[s][n],t[s][n],i)}}static _isArrayLike(e){switch(typeof e){case"undefined":case"string":return!1}return void 0!==e.length}static _catmullRomInterpolateArray(e,t,i,r,s,n,a,o,l){var h=e.length;if(1==l)for(let l=0;l<h;l++)o[l]=ma._catmullRomInterpolate(e[l],t[l],i[l],r[l],s,n,a);else{var u=e[0].length;for(let l=0;l<h;l++)for(var c=0;c<u;c++)o[l][c]=ma._catmullRomInterpolate(e[l][c],t[l][c],i[l][c],r[l][c],s,n,a)}}static _catmullRomInterpolate(e,t,i,r,s,n,a){var o=.5*(i-e),l=.5*(r-t);return(2*(t-i)+o+l)*a+(-3*(t-i)-2*o-l)*n+o*s+t}static _cloneValue(e){var t=Array.prototype.slice;if(ma._isArrayLike(e)){var i=e.length;if(ma._isArrayLike(e[0])){for(var r=[],s=0;s<i;s++)r.push(t.call(e[s]));return r}return t.call(e)}return e}static rgba2String(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}}class ya{constructor(e,t,i,r){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||function(e,t){return e[t]},this._setter=r||function(e,t,i){e[t]=i},this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="SuperMap.LevelRenderer.Animation.Animator"}when(e,t){for(var i in t)this._tracks[i]||(this._tracks[i]=[],0!==e&&this._tracks[i].push({time:0,value:ma._cloneValue(this._getter(this._target,i))})),this._tracks[i].push({time:parseInt(e,10),value:t[i]});return this}during(e){return this._onframeList.push(e),this}start(e){var t=this,i=this._setter,r=this._getter,s=t._onframeList.length,n="spline"===e,a=function(){if(t._clipCount--,0===t._clipCount){t._tracks={};for(var e=t._doneList.length,i=0;i<e;i++)t._doneList[i].call(t)}},o=function(o,l){var h=o.length;if(h){var u=o[0].value,c=ma._isArrayLike(u),d=!1,p=c&&ma._isArrayLike(u[0])?2:1;o.sort(function(e,t){return e.time-t.time});var f=o[h-1].time,m=[],y=[];for(let e=0;e<h;e++){m.push(o[e].time/f);var g=o[e].value;"string"==typeof g&&(0===(g=Hn.Util_color.toArray(g)).length&&(g[0]=g[1]=g[2]=0,g[3]=1),d=!0),y.push(g)}var v,b,_,S,x,w,C,M=0,A=0;if(d)var T=[0,0,0,0];var E=new fa({target:t._target,life:f,loop:t._loop,delay:t._delay,onframe:function(e,a){if(a<A){for(v=Math.min(M+1,h-1),b=v;b>=0&&!(m[b]<=a);b--);b=Math.min(b,h-2)}else{for(b=M;b<h&&!(m[b]>a);b++);b=Math.min(b-1,h-2)}M=b,A=a;var o=m[b+1]-m[b];if(0!==o){if(_=(a-m[b])/o,n)if(x=y[b],S=y[0===b?b:b-1],w=y[b>h-2?h-1:b+1],C=y[b>h-3?h-1:b+2],c)ma._catmullRomInterpolateArray(S,x,w,C,_,_*_,_*_*_,r(e,l),p);else{let t;t=d?ma.rgba2String(T):ma._catmullRomInterpolate(S,x,w,C,_,_*_,_*_*_),i(e,l,t)}else if(c)ma._interpolateArray(y[b],y[b+1],_,r(e,l),p);else{let t;d?(ma._interpolateArray(y[b],y[b+1],_,T,1),t=ma.rgba2String(T)):t=ma._interpolateNumber(y[b],y[b+1],_),i(e,l,t)}for(b=0;b<s;b++)t._onframeList[b](e,a)}},ondestroy:a});e&&"spline"!==e&&(E.easing=e),t._clipList.push(E),t._clipCount++,t.animation.add(E)}};for(var l in this._tracks)o(this._tracks[l],l);return this}stop(){for(var e=0;e<this._clipList.length;e++){var t=this._clipList[e];this.animation.remove(t)}this._clipList=[]}delay(e){return this._delay=e,this}done(e){return e&&this._doneList.push(e),this}}class ga{constructor(e,t){this.id=e,this.storage=new ha,this.painter=new ua(t,this.storage),this.handler=new da(t,this.storage,this.painter),this.animatingElements=[],this.animation=new ma({stage:{update:ga.getFrameCallback(this)}}),this._needsRefreshNextFrame=!1,this.animation.start(),this.CLASS_NAME="SuperMap.LevelRenderer.Render"}destroy(){this.id=null,this.storage=null,this.painter=null,this.handler=null,this.animatingElements=null,this.animation=null,this._needsRefreshNextFrame=null}getId(){return this.id}addShape(e){return this.storage.addRoot(e),this}addGroup(e){return this.storage.addRoot(e),this}delShape(e){return this.storage.delRoot(e),this}delGroup(e){return this.storage.delRoot(e),this}modShape(e,t){return this.storage.mod(e,t),this}modGroup(e,t){return this.storage.mod(e,t),this}modLayer(e,t){return this.painter.modLayer(e,t),this}addHoverShape(e){return this.storage.addHover(e),this}render(e){return this.painter.render(e),this._needsRefreshNextFrame=!1,this}refresh(e){return this.painter.refresh(e),this._needsRefreshNextFrame=!1,this}refreshNextFrame(){return this._needsRefreshNextFrame=!0,this}refreshHover(e){return this.painter.refreshHover(e),this}refreshShapes(e,t){return this.painter.refreshShapes(e,t),this}resize(){return this.painter.resize(),this}animate(e,t,i){if("string"==typeof e&&(e=this.storage.get(e)),e){var r;if(t){for(var s=t.split("."),n=e,a=0,o=s.length;a<o;a++)n&&(n=n[s[a]]);n&&(r=n)}else r=e;if(!r)return void Hn.Util_log('Property "'+t+'" is not existed in element '+e.id);var l=this.animatingElements;return void 0===e.__aniCount&&(e.__aniCount=0),0===e.__aniCount&&l.push(e),e.__aniCount++,this.animation.animate(r,{loop:i}).done(function(){if(e.__aniCount--,0===e.__aniCount){var t=(new xn).indexOf(l,e);l.splice(t,1)}})}Hn.Util_log("Element not existed")}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(e,t,i){return this.painter.toDataURL(e,t,i)}shapeToImage(e,t,i){var r=ee.createUniqueID("SuperMap.LevelRenderer.ToImage_");return this.painter.shapeToImage(r,e,t,i)}on(e,t){return this.handler.on(e,t),this}un(e,t){return this.handler.un(e,t),this}trigger(e,t){return this.handler.trigger(e,t),this.handler.dispatch(e,t),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(e){return this.painter.updateHoverLayer(e),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(e){return function(){var t=e.animatingElements;if(t instanceof Array){for(var i=0,r=t.length;i<r;i++)e.storage.mod(t[i].id);(t.length||e._needsRefreshNextFrame)&&e.refresh()}}}}class va{constructor(){va._instances={},va.Tool={},this.version="2.0.4",this.CLASS_NAME="SuperMap.LevelRenderer"}destroy(){this.dispose(),this.version=null}init(e){var t=new ga(ee.createUniqueID("LRenderer_"),e);return va._instances[t.id]=t,t}dispose(e){if(e)e.dispose(),this.delInstance(e.id);else{for(var t in va._instances)va._instances[t].dispose();va._instances={}}return this}getInstance(e){return va._instances[e]}delInstance(e){return delete va._instances[e],this}}function ba(e,t,i){if(e===i||e===t)return e;let r=i-t;return((e-t)%r+r)%r+t}function _a(e){return e*Math.PI/180}Math.PI,Math.PI;const Sa={EXCEL:"EXCEL",CSV:"CSV",ISERVER:"ISERVER",GEOJSON:"GEOJSON",JSON:"JSON"},xa={fileMaxSize:10485760};class wa{constructor(){this._initView()}_initView(){const e=document.createElement("div");e.hidden=!0,e.setAttribute("class","component-messageboxcontainer component-border-bottom-orange");const t=document.createElement("div");t.setAttribute("class","icon"),this.icon=document.createElement("span"),this.icon.setAttribute("class","supermapol-icons-message-warning"),t.appendChild(this.icon),e.appendChild(t);const i=document.createElement("div");i.setAttribute("class","component-messagebox"),i.innerHTML="",e.appendChild(i),this.messageBox=i;const r=document.createElement("div");r.setAttribute("class","component-messagebox__cancelbtncontainer");const s=document.createElement("button");s.setAttribute("class","component-messagebox__cancelBtn"),s.innerHTML="x",s.onclick=this.closeView.bind(this),r.appendChild(s),e.appendChild(r),this.messageBoxContainer=e,document.body.appendChild(this.messageBoxContainer)}closeView(){this.messageBoxContainer.hidden=!0}showView(e,t="warring"){"success"===t?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===t?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===t&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=e,this.messageBoxContainer.hidden=!1}}const Ca=function(){try{return echarts}catch(e){return{}}}();let Ma={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return Ma.code||Ma.setCode(),Ma.code},setCode:function(){var e=this.getLanguageFromCookie();e||(e=Ma.defaultCode,e="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===e.indexOf("zh")&&(e="zh-CN"),0===e.indexOf("en")&&(e="en-US"),Ma.code=e},getLanguageFromCookie(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){for(var i=e[t];" "===i.charAt(0);)i=i.substring(1);if(-1!==i.indexOf("language="))return i.substring("language=".length,i.length)}return""},i18n:function(e){var t=Ma[Ma.getCode()],i=t&&t[e];return i||(i=e),i}};const Aa=function(){try{return XLSX}catch(e){return{}}}();let Ta={rABS:"undefined"!=typeof FileReader&&FileReader.prototype&&FileReader.prototype.readAsBinaryString,rABF:"undefined"!=typeof FileReader&&FileReader.prototype&&FileReader.prototype.readAsArrayBuffer,rAT:"undefined"!=typeof FileReader&&FileReader.prototype&&FileReader.prototype.readAsText,readFile(e,t,i,r,s){Sa.JSON===e||Sa.GEOJSON===e?this.readTextFile(t,i,r,s):Sa.EXCEL!==e&&Sa.CSV!==e||this.readXLSXFile(t,i,r,s)},readTextFile(e,t,i,r){let s=new FileReader;s.onloadend=function(e){t&&t.call(r,e.target.result)},s.onerror=function(e){i&&i.call(r,e)},this.rAT?s.readAsText(e.file,"utf-8"):s.readAsBinaryString(e.file)},readXLSXFile(e,t,i,r){let s=new FileReader;s.onloadend=function(e){let s=new Uint8Array(e.target.result),n=Aa.read(s,{type:"array"});try{if(n&&n.SheetNames&&n.SheetNames.length>0){let e=n.SheetNames[0],i=Aa.utils.sheet_to_csv(n.Sheets[e]);t&&t.call(r,i)}}catch(e){i&&i.call(r,e)}},s.onerror=function(e){i&&i.call(r,e)},this.rABF&&s.readAsArrayBuffer(e.file)},processDataToGeoJson(e,t,i,r,s){let n=null;if("EXCEL"===e||"CSV"===e)n=this.processExcelDataToGeoJson(t),i&&i.call(s,n);else if("JSON"===e||"GEOJSON"===e){let e=t;"string"==typeof e&&(e=JSON.parse(e)),"ISERVER"===e.type?n=e.data.recordsets[0].features:"FeatureCollection"===e.type?n=e:r&&r.call(s,Ma.i18n("msg_dataInWrongGeoJSONFormat")),i&&i.call(s,n)}else r&&r.call(s,Ma.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson(e){let t=this.string2Csv(e),i=t.colTitles,r=-1,s=-1;for(let e=0,t=i.length;e<t;e++)this.isXField(i[e])&&(r=e),this.isYField(i[e])&&(s=e);let n=[];for(let e=0,i=t.rows.length;e<i;e++){let i=t.rows[e],a=Number(i[r]),o=Number(i[s]),l={};for(let i in t.colTitles){l[t.colTitles[i]]=t.rows[e][i]}let h={type:"Feature",geometry:{type:"Point",coordinates:[a,o]},properties:l};n.push(h)}return n},isXField(e){var t=e.toLowerCase();return"x"===t||"smx"===t||"jd"===t||"经度"===t||"东经"===t||"longitude"===t||"lot"===t||"lon"===t||"lng"===t||"x坐标"===t},isYField(e){var t=e.toLowerCase();return"y"===t||"smy"===t||"wd"===t||"纬度"===t||"北纬"===t||"latitude"===t||"lat"===t||"y坐标"===t},string2Csv(e,t){let i=e.split("\n"),r={};r.colTitles=t?[]:i[0].split(","),r.rows=[];for(let e=t?0:1;e<i.length;e++)i[e]&&r.rows.push(i[e].split(","));return r}};class Ea{constructor(e){this.datasets=e,this.EVENT_TYPES=["getdatafailed"],this.events=new be(this,null,this.EVENT_TYPES)}getDatasetInfo(e){let t=this.datasets.url,i=this;Ue.get(t).then(function(e){return e.json()}).then(function(t){if(t.datasetInfo){let r=t.datasetInfo;i.datasetsInfo={dataSourceName:r.dataSourceName,datasetName:r.name,mapName:t.name},e({result:i.datasetsInfo})}}).catch(function(e){console.log(e),i._fireFailedEvent(e)})}getDataFeatures(e,t){let i,r,s,n=e.result,a={name:n.datasetName+"@"+n.dataSourceName};Object.assign(a,this.datasets.queryInfo),i=new ft(a),r=new Ji({queryParameter:i,datasetNames:[n.dataSourceName+":"+n.datasetName],fromIndex:0,toIndex:1e5}),(s=new qi(n.dataUrl,{eventListeners:{processCompleted:t,processFailed:function(){}}})).processAsync(r)}getLayerFeatures(e,t){let i,r,s,n=e.result,a={name:n.mapName};Object.assign(a,this.datasets.queryInfo),i=new ft(a),r=new Xr({queryParams:[i],expectCount:1e5}),(s=new Qr(n.dataUrl,{eventListeners:{processCompleted:t,processFailed:function(){}}})).processAsync(r)}getDataInfoByIptl(e){this.getServiceInfo(this.datasets.url,e)}getServiceInfo(e,t){let i=this;Ue.get(e,null,{withCredentials:this.datasets.withCredentials}).then(e=>e.json()).then(r=>{if(!1!==r.succeed)if(r.dataItemServices&&r.dataItemServices.length>0){let s;r.dataItemServices.forEach(r=>{if("RESTDATA"===r.serviceType&&"PUBLISHED"===r.serviceStatus)s=r;else{if("RESTMAP"!==r.serviceType||"PUBLISHED"!==r.serviceStatus)return void i.getDatafromContent(e,t);s=r}}),s&&i.getDatafromRest(s.serviceType,s.address,t)}else i.getDatafromContent(e,t);else i._fireFailedEvent(r)}).catch(e=>{console.log(e),i._fireFailedEvent(e)})}getDatafromContent(e,t){let i={result:{}},r=this;e+="/content.json?pageSize=9999999¤tPage=1",Ue.get(e,null,{withCredentials:this.datasets.withCredentials}).then(e=>e.json()).then(e=>{if(!1!==e.succeed){if(e.type){if("JSON"===e.type||"GEOJSON"===e.type){if(e.content=JSON.parse(e.content.trim()),!e.content.features)return void console.log(Ma.i18n("msg_jsonResolveFiled"));let t=this._formatGeoJSON(e.content);i.result.features={type:e.content.type,features:t}}else if("EXCEL"===e.type||"CSV"===e.type){let t=this._excelData2Feature(e.content);i.result.features={type:"FeatureCollection",features:t}}t(i,"content")}}else r._fireFailedEvent(e)},this).catch(e=>{console.log(e),r._fireFailedEvent(e)})}getDatafromRest(e,t,i){let r=this,s=this.datasets.withCredentials;if("RESTDATA"===e){let e,n,a=`${t}/data/datasources`;Ue.get(a,null,{withCredentials:s}).then(e=>e.json()).then(o=>{e=o.datasourceNames[0],a=`${t}/data/datasources/${e}/datasets`,Ue.get(a,null,{withCredentials:s}).then(e=>e.json()).then(s=>(n=s.datasetNames[0],r.getDatafromRestData(`${t}/data`,[e+":"+n],i),[e+":"+n])).catch(function(e){r._fireFailedEvent(e)})}).catch(function(e){r._fireFailedEvent(e)})}else{let e,n,a,o=`${t}/maps`;Ue.get(o,null,{withCredentials:s}).then(e=>e.json()).then(l=>{e=l[0].name,a=l[0].path,o=o=`${t}/maps/${e}/layers`,Ue.get(o,null,{withCredentials:s}).then(e=>e.json()).then(e=>(n=e[0].subLayers.layers[0].caption,r.getDatafromRestMap(n,a,i),n)).catch(function(e){r._fireFailedEvent(e)})}).catch(function(e){r._fireFailedEvent(e)})}}getDatafromRestData(e,t,i){let r=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,e=>{i(e,"RESTDATA")},e=>{console.log(e),r._fireFailedEvent(e)})}getDatafromRestMap(e,t,i){let r=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,e=>{i(e,"RESTMAP")},e=>{console.log(e),r._fireFailedEvent(e)})}_getFeatureBySQL(e,t,i,r,s){let n,a,o,l={name:t.join().replace(":","@")};Object.assign(l,i),n=new ft(l),o=new Ji({queryParameter:n,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),(a=new qi(e,{eventListeners:{processCompleted:e=>{r&&r(e)},processFailed:e=>{s&&s(e)}}})).processAsync(o)}_queryFeatureBySQL(e,t,i,r,s,a,o,l,h,u){var c,d,p={name:t};Object.assign(p,i),c=new ft(p),r&&(c.fields=r);var f={queryParams:[c]};u&&(f.queryOption=n.ATTRIBUTE),l&&(f.startRecord=l),h&&(f.expectCount=h),s&&(f.prjCoordSys={epsgCode:s}),d=new Xr(f),this._queryBySQL(e,d,e=>{"processCompleted"===e.type?a(e):o(e)})}_queryBySQL(e,t,i,r){new Qr(e,{eventListeners:{scope:this,processCompleted:i,processFailed:i},format:this._processFormat(r)}).processAsync(t)}_processFormat(e){return e||t.GEOJSON}_formatGeoJSON(e){let t=e.features;return t.forEach((e,t)=>{e.properties.index=t}),t}_excelData2Feature(e){let t=e.colTitles,i=-1,r=-1;for(let e=0,s=t.length;e<s;e++)Ta.isXField(t[e])&&(i=e),Ta.isYField(t[e])&&(r=e);let s=[];for(let t=0,n=e.rows.length;t<n;t++){let n=e.rows[t],a=Number(n[i]),o=Number(n[r]),l={};for(let i in e.colTitles){l[e.colTitles[i]]=e.rows[t][i]}l.index=t+"";let h={type:"Feature",geometry:{type:"Point",coordinates:[a,o]},properties:l};s.push(h)}return s}_fireFailedEvent(e){let t=e?{error:e,message:Ma.i18n("msg_getdatafailed")}:{message:Ma.i18n("msg_getdatafailed")};this.events.triggerEvent("getdatafailed",t)}}class La{constructor(e){this.datasets=e.datasets,this.xField=[],this.yField=[],this.grid={top:"50px",bottom:"50px",left:"50px",right:"60px"},this.chartType=e.type||"bar",this._initXYField(e.chartOptions),this.EVENT_TYPES=["getdatafailed"],this.events=new be(this,null,this.EVENT_TYPES)}_initXYField(e){let t=this;e&&e.length>0&&e.forEach(function(e){e.xAxis&&t.xField.push({field:e.xAxis.field,name:e.xAxis.name}),e.yAxis&&t.yField.push({field:e.yAxis.field,name:e.yAxis.name})})}getDatasetInfo(e){this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new Ea(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:e=>{this.events.triggerEvent("getdatafailed",e)}}))}_getDatasetInfoSuccess(e){let t=this.datasets.url,i=t.indexOf("rest");if(i>0){let r=t.indexOf("/",i+5),s=t.substring(i+5,r),n=t.substring(0,i+4)+"/data";if("maps"===s){let s=t.indexOf("/",r+1),a=t.substring(r+1,s);n=t.substring(0,i+4)+"/maps/"+a,e.result.dataUrl=n,this._getLayerFeatures(e)}else"data"===s&&(e.result.dataUrl=n,this._getDataFeatures(e))}}_getDataInfoSuccess(e,t){let i=this;"RESTMAP"===t?i._getChartDatasFromLayer(e):i._getChartDatas(e)}_getDataFeatures(e){this.chartModel.getDataFeatures(e,this._getChartDatas.bind(this))}_getLayerFeatures(e){this.chartModel.getLayerFeatures(e,this._getChartDatasFromLayer.bind(this))}_getChartDatas(e){if(e){this.features=e.result.features;let t=this.features.features,i={};if(t.length){let e=t[0],r=[],s=[];for(let t in e.properties)r.push(t),s.push(this._getDataType(e.properties[t]));i={features:t,fieldCaptions:r,fieldTypes:s,fieldValues:[]};for(let e in s){let r=[];for(let s in t){let n=t[s],a=i.fieldCaptions[e],o=n.properties[a];r.push(o)}i.fieldValues.push(r)}this.createChart(i)}}}_getChartDatasFromLayer(e){if(e.result.recordsets){let t=e.result.recordsets[0],i=t.features.features;this.features=t.features;let r={};if(i.length){r={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]};for(let e in r.fieldCaptions){let t=[];for(let s in i){let n=i[s],a=r.fieldCaptions[e],o=n.properties[a];t.push(o)}r.fieldValues.push(t)}this.createChart(r)}}}_createChartOptions(e){return this.calculatedData=this._createChartDatas(e),this.updateChartOptions(this.chartType)}changeType(e){if(e!==this.chartType)return this.chartType=e,this.updateChartOptions(this.chartType)}updateData(e,t,i){this.updateChart=i,this.xField=[],this.yField=[],this._initXYField(t),e.type=e.type||"iServer",e.withCredentials=e.withCredentials||!1,this.datasets=e,this.getDatasetInfo(this._updateDataSuccess.bind(this))}_updateDataSuccess(e){let t=this._createChartOptions(e);this.updateChart(t)}updateChartOptions(e,t){if(this.calculatedData){let i=this.grid,r=this._createChartSeries(this.calculatedData,e),s=[];for(let e in this.calculatedData.XData)s.push({value:this.calculatedData.XData[e].fieldsData});let n={type:"category",name:this.xField[0].name||"X",data:s,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},a={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},o={formatter:"{b0}: {c0}"},l="#404a59";return t&&(t.grid&&(i=t.grid),t.tooltip&&(o=t.tooltip),t.backgroundColor&&(l=t.backgroundColor)),{backgroundColor:l,grid:i,series:r,xAxis:n,yAxis:a,tooltip:o}}}_createChartDatas(e){let t=0,i=[],r=e.fieldCaptions,s=this;r.forEach(function(e,i){s.xField[0]&&e===s.xField[0].field&&(t=i)}),this.yFieldName="",this.yField.forEach(function(e,t){0!==t&&(s.yFieldName=s.yFieldName+","),s.yFieldName=s.yFieldName+e.name,r.forEach(function(t,r){t===e.field&&i.push(r)})});let n=this._getAttrData(e,t),a=[];if(i.length>0)i.forEach(function(t){let i=[];for(let r in e.fieldValues[t])i.push({value:e.fieldValues[t][r]});a.push(i)});else{let e=[],t=[],i=n.length;for(let r=0;r<i;r++){let i=!1;for(let s=0,a=t.length;s<a;s++)if(n[r].fieldsData===t[s].fieldsData){e[s].value++,t[s].recordIndexs.push(r),i=!0;break}i||n[r].fieldsData&&(t.push({fieldsData:n[r].fieldsData,recordIndexs:[r]}),e.push({value:1}))}n=t,a=[e]}return{XData:n,YData:a}}_getAttrData(e,t){0===t&&(this.xField=[{field:e.fieldCaptions[t],name:e.fieldCaptions[t]}]);let i=[];for(let r=0,s=e.fieldValues[t].length;r<s;r++){let s=e.fieldValues[t][r];i.push({recordIndexs:r,fieldsData:s})}return i}_createChartSeries(e,t){let i=[];return e.YData.forEach(function(e){let r=0,s=[];for(let t of e)r=t.value,s.push({value:r});let n={type:t,data:s,name:"y"};i.push(n)}),i}_isDate(e){return/((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/gi.test(e)}_isNumber(e){let t=Number(e);return 0===t||!isNaN(t)}_getDataType(e){if(null!==e&&void 0!==e&&""!==e){if(this._isDate(e))return"DATE";if(this._isNumber(e))return"NUMBER"}return"STRING"}_checkUrl(e){let t;return t=!(""===e||!this._isMatchUrl(e))&&(!/^http[s]?:\/\/localhost/.test(e)&&!/^http[s]?:\/\/127.0.0.1/.test(e))}_isMatchUrl(e){return new RegExp("(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]").test(e)}getStyle(){return{grid:this.grid,tooltip:this.tooltip,backgroundColor:this.backgroundColor}}getFeatures(){return this.features}setStyle(e){return this.updateChartOptions(this.chartType,e)}}class Oa{constructor(e){e=e||{},this.id=e.id?e.id:null,this.rootContainer=null}getElement(){return this.id&&(this.rootContainer.id=this.id),this.rootContainer}_initView(){}showView(){this.rootContainer.hidden=!1}closeView(){this.rootContainer.hidden=!0}}class Pa extends Oa{constructor(e){super(e);let t=e.title?e.title:"";this._initView(t)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-container");const i=document.createElement("div");i.setAttribute("class","component-title");const r=document.createElement("div");r.innerHTML=e,i.appendChild(r),t.appendChild(i);const s=document.createElement("div");return s.setAttribute("class","component-content"),t.appendChild(s),this.content=s,this.rootContainer=t,t}getContentElement(){return this.content}appendContent(e){this.content.appendChild(e)}}class Na extends Oa{constructor(e){super(e),this._initView(e)}_initView(e){let t=this._createElement("div","component-selecttool");if(e.labelName){this._createElement("label","component-selecttool__lable--describe",t).innerHTML=e.labelName}let i=this._createElement("div","component-selecttool--chart",t);i.setAttribute("tabindex","1");let r=this._createElement("div","component-selecttool__name",i);r.title=e.optionsArr[0],r.innerHTML=e.optionsArr[0];let s=this._createElement("div","component-selecttool__trianglebtn--chart",i),n=this._createElement("div","component-triangle-down-img",s),a=this._createElement("div","component-selecttool__content",i),o=this._createElement("div","component-selecttool__content--chart",a),l=this._createElement("div","component-selecttool__scrollarea__content",o);l.setAttribute("tabindex","1"),this.createOptions(l,e.optionsArr),this.optionClickEvent(l,r,e.optionsClickCb),this._selectClickEvent(i,a,n),this.rootContainer=t}createOptions(e,t){for(let i in t){let r=this._createElement("div","component-selecttool__option",e);r.title=t[i],r.innerHTML=t[i]}}_selectClickEvent(e,t,i){e.onclick=function(e){"block"===t.style.display?(t.style.display="none",i.className="component-triangle-down-img"):(t.style.display="block",i.className="triangle-up-img"),e.preventDefault(),e.stopPropagation()},e.onmousedown=function(e){e.target!==this&&(this.focus(),e.preventDefault(),e.stopPropagation())},e.onblur=function(){t.style.display="none",i.className="component-triangle-down-img"}}_createElement(e,t,i){let r=document.createElement(e||"div");return t&&(r.className=t),i&&i.appendChild(r),r}optionClickEvent(e,t,i){for(let r=0;r<e.children.length;r++){let s=e.children[r];s.onclick=function(){t.innerHTML=s.innerHTML,t.title=s.title,s.getAttribute("data-value")&&t.setAttribute("data-value",s.getAttribute("data-value")),i&&i(s)}}}}class Ia extends Oa{constructor(e){super(e),this._initView(e)}_initView(e){let t=document.createElement("div");t.className="component-dropdownbox--container";let i=document.createElement("div");i.setAttribute("tabindex","1"),i.className="component-dropdownbox",t.appendChild(i);let r=document.createElement("div");i.appendChild(r),this._createDropDownOption(e[0],r);let s=document.createElement("div");s.className="component-dropdownbox__triangle-btn",i.appendChild(s);let n=document.createElement("div");n.className="component-triangle-down-img",s.appendChild(n);let a={parentEle:i,dropDownContent:["component-dropdownbox__content component-dropdownbox__content--chart","dropDownContent"],scrollareaContent:"component-selecttool__scrollarea__content",optionsArr:e,triangleBtn:n,dropDownTopContainer:r};this._createDropDownBox(a),this.rootContainer=t}_createDropDownBox(e){let t=e.parentEle,i=e.dropDownTopContainer,r=document.createElement("div");r.className=e.dropDownContent[0],t.appendChild(r);let s=document.createElement("div");s.className=e.scrollareaContent,r.appendChild(s);let n=e.optionsArr;for(let e=0;e<n.length;e++)this._createDropDownOption(n[e],s);let a=e.triangleBtn;this._dropDownClickEvent(t,r,a),this._eleOnblur(t,r,a);let o=s.children;for(let e=0;e<o.length;e++)o[e].onclick=function(){i.innerHTML=o[e].outerHTML}}_createDropDownOption(e,t){let i=document.createElement("div");i.className="component-dropdownbox__item";let r=e;r.dataValue&&i.setAttribute("data-value",r.dataValue),t.appendChild(i);let s=document.createElement("div");s.className="component-dropdownbox__item__img",i.appendChild(s);let n=document.createElement("div");r.icon.className&&(n.className=r.icon.className),r.icon.background&&(n.style.background=r.icon.background),s.appendChild(n);let a=document.createElement("div");a.className="component-dropdownbox__item__title",a.title=r.title,a.innerHTML=r.title,i.appendChild(a);let o=document.createElement("div");o.className="component-dropdownbox__item__remark",o.title=r.remark,o.innerHTML=r.remark,i.appendChild(o)}_dropDownClickEvent(e,t,i){e.onclick=function(e){"block"===t.style.display?(t.style.display="none",i.className="component-triangle-down-img"):(t.style.display="block",i.className="triangle-up-img"),e.preventDefault(),e.stopPropagation()},e.onmousedown=function(e){e.target!==this&&(this.focus(),e.preventDefault(),e.stopPropagation())}}_eleOnblur(e,t,i){e.onblur=function(){t.style.display="none",i.className="component-triangle-down-img"}}_createElement(e,t,i){let r=document.createElement(e||"div");return t&&(r.className=t),i&&i.appendChild(r),r}}class Fa extends Oa{constructor(e){super(e=e||{}),e.title=e.title?e.title:"",this._initView(e.title)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-popcontainer");const i=document.createElement("div");i.setAttribute("class","component-popcontainer__header");const r=document.createElement("label");r.setAttribute("class","component-popcontainer__header__title"),r.innerHTML=e,i.appendChild(r);const s=document.createElement("span");s.setAttribute("class","supermapol-icons-clear component-popcontainer__header__close"),s.onclick=this.closeView.bind(this),t.appendChild(s),t.appendChild(i);const n=document.createElement("div");n.setAttribute("class","component-popcontainer__content"),this.content=n,t.appendChild(n),this.rootContainer=t}appendContent(e){this.content.appendChild(e)}}class ka extends Fa{constructor(e){e.title=e.title?e.title:"属性",super(e),this.rootContainer.firstChild.hidden=!0,e.attributes=e.attributes?e.attributes:[],this._createAttributesTable(e.attributes)}_createAttributesTable(e){const t=document.createElement("table");t.setAttribute("class","component-popcontainer__content__table");const i=document.createElement("tbody");let r=!0;for(let t in e){const s=document.createElement("tr");r&&s.setAttribute("class","component-popcontainer__content__td--color");const n=document.createElement("td"),a=document.createElement("Span");a.innerHTML=t,n.appendChild(a);const o=document.createElement("td");o.innerHTML=e[t],s.appendChild(n),s.appendChild(o),i.appendChild(s),r=!r}t.appendChild(i),this.appendContent(t)}}class Da extends Oa{constructor(e){super(e),this._initView()}_initView(){const e=document.createElement("div");e.setAttribute("class","component-tabpage");const t=document.createElement("ul");this.header=t;const i=document.createElement("div");i.setAttribute("class","component-tabpage__content"),this.content=i,e.appendChild(t),e.appendChild(i),this.rootContainer=e}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t<e.length;t++){let i=document.createElement("span");i.index=t,i.appendChild(document.createTextNode(e[t].title)),i.onclick=this._changeTabsPage.bind(this);let r=e[t].content;r.index=t,r.hidden=!0,this.header.appendChild(i),this.content.appendChild(r)}this.header.firstChild.setAttribute("class","on"),this.content.firstChild.hidden=!1}removeTab(e){this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}removeAllTabs(){for(let e=this.header.children.length;e>0;e--)this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}_changeTabsPage(e){const t=e.target.index;for(let e=0;e<this.header.children.length;e++)this.header.children[e].setAttribute("class",""),this.content.children[e].hidden=!0,e===t&&(this.header.children[e].setAttribute("class","on"),this.content.children[e].hidden=!1)}}class Ra extends Da{constructor(e){super(e),this.rootContainer.classList.add("component-citytabpage--noneBoxShadow"),this.config=e.config,ee.isArray(this.config)?(this.header.hidden=!0,this._createCityItem("城市",this.config),this.content.style.border="none"):(this._createTabs(),this.header.onclick=(e=>{for(let e=0;e<this.header.children.length;e++)this.header.children[e].setAttribute("class","");e.target.setAttribute("class","on"),this._createCityContent(e.target.innerHTML)}))}_createTabs(){if(ee.isArray(this.config))for(let e=0;e<this.config.length;e++){let t="";for(const i in this.config[e])t+=i;let i=document.createElement("li");i.innerHTML=t,this.header.appendChild(i)}else for(const e in this.config){let t=document.createElement("li");t.innerHTML=e,this.header.appendChild(t)}this.header.firstChild.setAttribute("class","on"),this._createCityContent(this.header.firstChild.innerHTML)}_createCityContent(e){for(let e=this.content.children.length;e>0;e--)this.content.removeChild(this.content.children[e-1]);const t=this.config[e];for(let e in t)this._createCityItem(e,t[e])}_createCityItem(e,t){const i=document.createElement("div"),r=document.createElement("div");r.setAttribute("class","component-citytabpag__py-key"),r.innerHTML=e,i.appendChild(r);const s=document.createElement("div");s.setAttribute("class","component-citytabpag__content");for(let e=0;e<t.length;e++){let i=document.createElement("span");i.innerHTML=t[e],s.appendChild(i)}"HOT"===e&&(s.style.width="428px"),i.appendChild(s),this.content.appendChild(i)}}class Ba extends Oa{constructor(e){super(e),this.navTabsTitle=null,this.navTabsContent=null,e.tabs=e.tabs?e.tabs:[],this._initView(e.tabs)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-navtabspage");const i=document.createElement("span");i.setAttribute("class","supermapol-icons-close"),i.onclick=this.closeView.bind(this),t.appendChild(i);const r=document.createElement("div");this.navTabsTitle=r,r.setAttribute("class","component-navtabspage__title"),t.appendChild(r);const s=document.createElement("div");this.navTabsContent=s,s.setAttribute("class","component-navtabspage__content"),t.appendChild(s),e.length>0&&this.appendTabs(e),this.rootContainer=t}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t<e.length;t++){let i=document.createElement("span");i.index=t,i.appendChild(document.createTextNode(e[t].title)),i.onclick=this._changeTabsPage.bind(this);let r=e[t].content;r.index=t,r.hidden=!0,this.navTabsTitle.appendChild(i),this.navTabsContent.appendChild(r)}this.navTabsTitle.firstChild.setAttribute("class","component-navtabspage__tabs--select"),this.navTabsContent.firstChild.hidden=!1}removeTab(e){this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}removeAllTabs(){for(let e=this.navTabsTitle.children.length;e>0;e--)this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}_changeTabsPage(e){const t=e.target.index;for(let e=0;e<this.navTabsTitle.children.length;e++)this.navTabsTitle.children[e].setAttribute("class",""),this.navTabsContent.children[e].hidden=!0,e===t&&(this.navTabsTitle.children[e].setAttribute("class","component-navtabspage__tabs--select"),this.navTabsContent.children[e].hidden=!1)}}class Ga extends Oa{constructor(e){super(e=e||{}),this.currentPage=0,this.pageNumberLis=[],this.currentPageNumberLis=[],this.linkageEvent=null,e.contents=e.contents?e.contents:null,e.pageCounts=e.pageCounts?e.pageCounts:0,this._initView(e.contents,e.pageCounts)}setLinkageEvent(e){this.linkageEvent=e}_initView(e,t){const i=document.createElement("div");i.setAttribute("class","component-pagination");const r=document.createElement("div");r.setAttribute("class","component-pagination__content"),i.appendChild(r),this.content=r;const s=document.createElement("ul");s.setAttribute("class","component-pagination__link"),s.onclick=this._changePageEvent.bind(this),i.appendChild(s),this._createLink(s),this.link=s,e&&this.setContent(e),0!==t&&this.setPageLink(t),this.rootContainer=i}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){this.content.appendChild(e)}clearContent(){for(let e=this.content.children.length-1;e>=0;e--)this.content.removeChild(this.content.children[e])}setPageLink(e){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(e),this._appendPageLink()}_createPageLi(e){for(let t=0;t<e;t++){const e=document.createElement("li");e.innerHTML=t+1,this.pageNumberLis.push(e)}if(this.pageNumberLis[0].setAttribute("class","active"),this.currentPage=1,e<5)this.currentPageNumberLis=this.pageNumberLis;else for(let e=0;e<5;e++)this.currentPageNumberLis.push(this.pageNumberLis[e])}_appendPageLink(){for(let e=0;e<this.currentPageNumberLis.length;e++)this.link.insertBefore(this.currentPageNumberLis[e],this.link.childNodes[this.link.children.length-2]);for(let e=0;e<this.currentPageNumberLis.length;e++)this.currentPageNumberLis[e].setAttribute("class",""),Number(this.currentPageNumberLis[e].innerHTML)===this.currentPage&&this.currentPageNumberLis[e].setAttribute("class","active");this._changeDisableState(),this.linkageEvent&&this.linkageEvent(this.currentPage)}clearPageLink(){for(let e=this.link.children.length-3;e>1;e--)this.link.removeChild(this.link.children[e])}_createLink(e){for(let t=0;t<4;t++){const i=document.createElement("li");i.setAttribute("class","disable");const r=document.createElement("span");i.appendChild(r),0===t?(r.id="first",r.setAttribute("class","supermapol-icons-first")):1===t?(r.id="prev",r.setAttribute("class","supermapol-icons-prev")):2===t?(r.id="next",r.setAttribute("class","supermapol-icons-next")):3===t&&(r.id="last",r.setAttribute("class","supermapol-icons-last")),e.appendChild(i)}}_changePageEvent(e){const t=e.target;if("disable"===t.parentElement.classList[0])return;let i;if(t.id)i=t.id;else{if(!Number(t.innerHTML))return;i=Number(t.innerHTML)}this._prePageNum(i),this.clearPageLink(),this._appendPageLink()}_changeDisableState(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}_prePageNum(e){const t=[];if(this.currentPage="first"===e?1:"last"===e?this.pageNumberLis.length:"prev"===e?this.currentPage-1:"next"===e?this.currentPage+1:e,this.pageNumberLis.length<=5)for(let e=0;e<this.pageNumberLis.length;e++)t.push(this.pageNumberLis[e]);else if(this.currentPage<=3)for(let e=0;e<5;e++)t.push(this.pageNumberLis[e]);else if(this.currentPage>=this.pageNumberLis.length-3)for(let e=this.pageNumberLis.length-5;e<this.pageNumberLis.length;e++)t.push(this.pageNumberLis[e]);else for(let e=this.currentPage-3;e<=this.currentPage+1;e++)t.push(this.pageNumberLis[e]);t.length>0&&(this.currentPageNumberLis=t)}}let Ua={getFileType:e=>/^.*\.(?:xls|xlsx)$/i.test(e)?Sa.EXCEL:/^.*\.(?:csv)$/i.test(e)?Sa.CSV:/^.*\.(?:geojson|json)$/i.test(e)?Sa.GEOJSON:null};var ja=i(618),za=i.n(ja);function Va(e,t){const i=t&&t.styles&&t.styles.style,r=t&&t.captionFields&&t.captionFields.captionField,s={nodes:[],edges:[]};return e.forEach(e=>{const t=e.path;if(t){const{nodes:e,edges:n}=function(e,t,i){const r={nodes:[],edges:[]};return e.forEach(e=>{if(qa(e)){const i=Wa(e,t);r.edges.push(i)}else{const s=Ha(e,t,i);r.nodes.push(s)}}),r}(t,i,r);s.nodes.push(...e),s.edges.push(...n)}else if(qa(e)){const t=Wa(e,i);s.edges.push(t)}else{const t=Ha(e,i,r);s.nodes.push(t)}}),{nodes:Ja(s.nodes),edges:Ja(s.edges,"edgeId")}}function Ja(e,t="id"){return za()(e,t)}function qa(e){return e.hasOwnProperty("start")&&e.hasOwnProperty("end")}function Ha(e,t,i){const{id:r,properties:s,lables:n}=e,a=t?function(e,t){if(!t)return{};const{id:i,labels:r}=e,s=t.filter(e=>"entity"===e.type);for(let e=0;e<s.length;e++){const{color:t,textColor:n,font:a,size:o,entityTypes:l,entityIds:h}=s[e],u=JSON.parse(h||"[]"),c=JSON.parse(l||"[]");if(u.includes(i)||c.includes(r[0]))return{fillColor:t,fontSize:Xa(a.fontSize),fontFamily:a.fontName,fill:n,size:o,...Ya(a.fontStyle)}}return{}}(e,t):{},o=function(e,t){const{id:i,labels:r,properties:s}=e;if(t){const e=t instanceof Array?t:[t];for(let t=0;t<e.length;t++){const{name:n,entityTypes:a,entityIds:o}=e[t],l=JSON.parse(o||"[]"),h=JSON.parse(a||"[]");if(l.includes(i)||h.includes(r[0]))return s[n]||""}}return s[s._labelfieldname]||""}(e,i),l=a.fillColor||"",h={id:r+"",label:o,properties:s,lables:n};return a.size&&(h.size=a.size,delete a.size),a.fillColor&&(h.style={fill:l,stroke:l},delete a.fillColor),0!==Object.keys(a).length&&(h.labelCfg={style:a}),h}function Wa(e,t){const{start:i,end:r,id:s,type:n,properties:a}=e;return{source:i+"",target:r+"",edgeId:s+"",label:n,labelCfg:{style:t?function(e,t){if(!t)return{};const{id:i,type:r}=e,s=t.filter(e=>"relationShip"===e.type);for(let e=0;e<s.length;e++){const{textColor:t,font:n,relationTypes:a,relationIds:o}=s[e],l=JSON.parse(o||"[]"),h=JSON.parse(a||"[]");if(l.includes(i)||h.includes(r))return{fontSize:Xa(n.fontSize),fontFamily:n.fontName,fill:t,...Ya(n.fontStyle)}}return{}}(e,t):{}},properties:a}}function Ya(e){return 1===e?{fontWeight:600}:2===e?{fontStyle:"italic"}:{}}function Xa(e){return.8*e}const Qa=function(){try{return G6}catch(e){return{}}}();var Za=i.n(Qa),Ka=i(186),$a=i.n(Ka);class eo{constructor(){this.config=null,this.graph=null,this.data=null,this.collpasedData={},this.importG6(),this.CLASS_NAME="SuperMap.G6Render"}importG6(){Za()||console.log("please import g6, eg:https://gw.alipayobjects.com/os/lib/antv/g6/4.3.2/dist/g6.min.js")}initGraph(e){const t=new(Za().Graph)(e);return this.graph=t,e&&!1===e.highlightNode||this.highlightNode(t),e&&!1===e.highlightEdge||this.highlightEdge(t),!1===e.dragCanvas&&!1===e.dragNode||this.stopDefaultEventPropagation(),t}_getContextMenu(){return new(Za().Menu)({shouldBegin:e=>!!(e.target&&e.target.isCanvas&&e.target.isCanvas())||!!e.item,getContent:e=>{const{item:t}=e;if(e.target&&e.target.isCanvas&&e.target.isCanvas())return;if(!t)return;const i=t.getType(),r=t.getModel();return i&&r&&"node"===i?this.isCollpased(r.id)?"<ul>\n <li id='expand'>展开</li>\n <li id='hide'>隐藏</li>\n </ul>":"<ul>\n <li id='collapse'>折叠</li>\n <li id='hide'>隐藏</li>\n </ul>":void 0},handleMenuClick:(e,t)=>{switch(e.id.split("-")[0]){case"hide":this.hideItem(t);break;case"expand":this.expandNode(t);break;case"collapse":this.collapseNode(t);break;case"show":this.showItem(t)}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}_getGraphConfig(e){const t={speed:120,maxIteration:83,tick:()=>{this.refreshPositions()}},i={type:"fruchterman",gravity:5},r={},s={type:"line",style:{endArrow:{path:"M 0,0 L 2,1 L 2,-1 Z"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},n={default:["drag-canvas","zoom-canvas","drag-node"]},a=this._getContextMenu(),o=[new(Za().ToolBar),a],l={lineWidth:3,stroke:"#b4d6ff"},h={stroke:"#b4d6ff",lineWidth:2,endArrow:{path:"M 0,0 L 2,1 L 2,-1 Z",fill:"#b4d6ff"}};if(!e)return this._setToolBarStyle(),((e="knowledgeGraph")=>{const a=document.querySelector(`#${e}`);return{container:e,width:a.scrollWidth,height:a.scrollHeight,plugins:o,modes:n,layout:{...i,...t},defaultNode:r,defaultEdge:s,nodeStateStyles:{hover:l},edgeStateStyles:{hover:h}}})();e.container=e.container||"knowledgeGraph";const u="string"==typeof e.container?document.querySelector(`#${e.container}`):e.container;return e.width=e.width||u.scrollWidth,e.height=e.height||u.scrollHeight,e.layout={...i,...e.layout||{},...!1!==e.animate?t:{}},e.defaultNode={...r,...e.defaultNode||{}},e.defaultEdge={...s,...e.defaultEdge||{}},e.modes={default:[!1!==e.dragCanvas&&"drag-canvas",!1!==e.zoomCanvas&&"zoom-canvas",!1!==e.dragNode&&"drag-node"]},e.nodeStateStyles={hover:{...l,...e.nodeHighlightStyle||{}}},e.edgeStateStyles={hover:{...h,...e.edgeHighlightStyle||{}}},!1!==e.showToolBar&&(e.plugins=[new(Za().ToolBar)],this._setToolBarStyle()),!1!==e.showContextMenu&&(e.plugins=[...e.plugins||[],a],this._setToolBarStyle()),e}changeSize(e,t){return this.graph.changeSize(e,t)}autoResize(){const e=this.getContainer();window.addEventListener("resize",()=>{const t=e.scrollWidth,i=e.scrollHeight;this.graph.changeSize(t,i),this.graph.refresh()})}zoom(e,t,i,r){this.graph.zoom(e,t,i,r)}zoomTo(e,t,i,r){this.graph.zoomTo(e,t,i,r)}fitView(e,t,i,r){this.graph.fitView(e,t,i,r)}fitCenter(e,t){this.graph.fitCenter(e,t)}getGraphCenterPoint(){return this.graph.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graph.getViewPortCenterPoint()}getZoom(){return this.graph.getZoom()}getMinZoom(){return this.graph.getMinZoom()}setMinZoom(e){this.graph.setMinZoom(e)}getMaxZoom(){return this.graph.getMaxZoom()}setMaxZoom(e){this.graph.setMaxZoom(e)}getWidth(){return this.graph.getWidth()}getHeight(){return this.graph.getHeight()}setCenter(e){var t=this.graph.getWidth()/2,i=this.graph.getHeight()/2,r=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-r.x,i-r.y)}_setToolBarStyle(){$a()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}highlightNode(e=this.graph){e.on("node:mouseenter",function(t){const i=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(i,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("node:mouseleave",function(){e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.paint(),e.setAutoPaint(!0)})}highlightEdge(e=this.graph){e.on("edge:mouseenter",function(t){const i=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(i,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("edge:mouseleave",function(){e.setAutoPaint(!1),e.getEdges().forEach(function(t){e.clearItemStates(t)}),e.paint(),e.setAutoPaint(!0)})}setData(e,t=this.graph){this.data?t.changeData(e):t.data(e),this.data=e}render(e=this.graph){return e.render()}updateGraph(e,t=this.graph){this.data=e,t.changeData(e)}refresh(e=this.graph){e.refresh()}getContainer(e=this.graph){return e.getContainer()}getCanvas(e=this.graph){return e.get("canvas")}getNodes(e=this.graph){return e.getNodes()}getEdges(e=this.graph){return e.getEdges()}getNeighbors(e,t,i=this.graph){return i.getNeighbors(e,t)}findById(e,t=this.graph){return t.findById(e)}find(e,t,i=this.graph){return i.find(e,t)}findAll(e,t,i=this.graph){return i.findAll(e,t)}getEdgesByNode(e){return e.getEdges()}getInEdges(e){return e.getInEdges()}getOutEdges(e){return e.getOutEdges()}getSourceByEdge(e){return e.getSource()}getTargetByEdge(e){return e.getTarget()}expandNode(e){const t=e.getModel().id;this._expandCollapseNode(this.collpasedData[t],"show"),delete this.collpasedData[t]}collapseNode(e){const t=e.getModel().id,i=[];this._collapseFunc(e,i),this.collpasedData[t]=i,this._expandCollapseNode(i)}isCollpased(e){return!!this.collpasedData[e]}_collapseFunc(e,t=[]){const i=this.getNeighbors(e,"target"),r=this.getNeighbors(e,"source");for(let e=0;e<i.length;e++){const r=i[e],s=r.getModel();1===this.getNeighbors(r).length&&t.push({id:s.id})}for(let e=0;e<r.length;e++){const i=r[e],s=i.getModel();let n=this.getNeighbors(i),a=this.getNeighbors(i,"source");if(1===n.length||0===a.length)t.push({id:s.id});else{const e=[];this._collapseFunc(i,e),t.push({id:s.id,children:e})}}return t}_expandCollapseNode(e,t="hide"){e&&e.forEach(e=>{"hide"===t?this.hideItem(e.id):(this.showItem(e.id),this.isCollpased(e.id)&&delete this.collpasedData[e.id]),e.children&&this._expandCollapseNode(e.children,t)})}showItem(e,t,i=this.graph){i.showItem(e,t)}hideItem(e,t,i=this.graph){i.hideItem(e,t)}show(e){e.show()}hide(e){e.hide()}changeVisibility(e,t){e.changeVisibility(t)}isVisible(e){return e.isVisible()}getModel(e){return e.getModel()}addItem(e,t,i=this.graph){i.addItem(e,t)}removeItem(e,t=this.graph){t.removeItem(e)}updateItem(e,t,i=this.graph){i.updateItem(e,t)}refreshItem(e,t=this.graph){t.refreshItem(e)}refreshPositions(e=this.graph){e.refreshPositions()}on(e,t,i=this.graph){i.on(e,t)}off(e,t,i=this.graph){i.off(e,t)}toDataURL(e,t,i=this.graph){i.toDataURL(e,t)}bindNodeDefaultDragEvent(e=this.graph){e.on("node:dragstart",function(e){to(e)}),e.on("node:drag",function(e){to(e)}),e.on("node:dragend",function(e){e.item.get("model").fx=null,e.item.get("model").fy=null})}stopDefaultEventPropagation(e=this.graph){e.on("click",function(e){e.stopPropagation()}),e.on("mousedown",function(e){e.stopPropagation()}),e.on("mouseover",function(e){e.stopPropagation()}),e.on("mouseout",function(e){e.stopPropagation()})}clear(e=this.graph){e.clear()}destroy(e=this.graph){e.destroy()}}function to(e){const t=e.item.get("model");return t.fx=e.x,t.fy=e.y,t.x=e.x,t.y=e.y,t}var io=i(465),ro=i.n(io);class so{constructor(e,t="G6"){this.graph=null,this.config=ro()(e),this.graphRender=null,this.type=t,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"}static dataFromGraphMap(e,t){return Va(e,t)}static dataFromKnowledgeGraphQuery(e){return Va(e)}handleNodeStatus(e){const{expand:t,collapse:i,hidden:r}=e;this.expandNodes(t),this.collapseNodes(i),this.hideNodes(r)}expandNodes(e){e&&e.forEach(e=>{this.expandNode(e+"")})}collapseNodes(e){e&&e.forEach(e=>{this.collapseNode(e+"")})}hideNodes(e){e&&e.forEach(e=>{this.hideItem(e+"")})}createGraphRender(e){"G6"===e&&(this.graphRender=new eo)}createGraph(e){const t=this.initGraph(e);return this.graph=t,this.autoResize(),t}getGraph(){return this.graph}autoResize(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}zoom(e,t,i,r){this.graphRender.zoom(e,t,i,r)}zoomTo(e,t,i,r){this.graphRender.zoomTo(e,t,i,r)}fitView(e,t,i,r){this.graphRender.fitView(e,t,i,r)}fitCenter(e,t){this.graphRender.fitCenter(e,t)}getGraphCenterPoint(){return this.graphRender.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graphRender.getViewPortCenterPoint()}getZoom(){return this.graphRender.getZoom()}getMinZoom(){return this.graphRender.getMinZoom()}setMinZoom(e){this.graphRender.setMinZoom(e)}getMaxZoom(){return this.graphRender.getMaxZoom()}setMaxZoom(e){this.graphRender.setMaxZoom(e)}getWidth(){return this.graphRender.getWidth()}getHeight(){return this.graphRender.getHeight()}initGraph(e){const t=this.graphRender.initGraph(e);this.graph=t;return this.graph.on("beforelayout",()=>{void 0!==this.config.zoom&&this.zoom(this.config.zoom),void 0!==this.config.center&&this.graphRender.setCenter({x:this.config.center[0],y:this.config.center[1]})}),t}setData(e,t=this.graph){e=e||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(e.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,e.nodes)),this.graphRender.setData(e,t),this.render(t),this.data=e}render(e=this.graph){e&&this.graphRender.render(e)}updateGraph(e,t=this.graph){t&&this.graphRender.updateGraph(e,t)}refresh(){return this.graphRender.refresh()}changeSize(e,t){return this.graphRender.changeSize(e,t)}resize(e,t){this.graphRender.changeSize(e,t),this.graphRender.refresh()}getContainer(){return this.graphRender.getContainer()}getCanvas(){return this.graphRender.getCanvas()}getNodes(){return this.graphRender.getNodes()}getEdges(){return this.graphRender.getEdges()}getNeighbors(e,t){return this.graphRender.getNeighbors(e,t)}findById(e){return this.graphRender.findById(e)}find(e,t){return this.graphRender.find(e,t)}findAll(e,t){return this.graphRender.findAll(e,t)}getEdgesByNode(e){return this.graphRender.getEdgesByNode(e)}getInEdges(e){return this.graphRender.getInEdges(e)}getOutEdges(e){return this.graphRender.getOutEdges(e)}getSourceByEdge(e){return this.graphRender.getSourceByEdge(e)}getTargetByEdge(e){return this.graphRender.getTargetByEdge(e)}expandNode(e){const t=this.findById(e);t&&this.graphRender.expandNode(t)}collapseNode(e){const t=this.findById(e);t&&this.graphRender.collapseNode(t)}showItem(e,t){this.graphRender.showItem(e,t)}hideItem(e,t){this.graphRender.hideItem(e,t)}show(e){this.graphRender.show(e)}hide(e){this.graphRender.hide(e)}changeVisibility(e,t){this.graphRender.changeVisibility(e,t)}isVisible(e){return this.graphRender.isVisible(e)}getModel(e){return this.graphRender.getModel(e)}addItem(e,t){return this.graphRender.addItem(e,t)}removeItem(e){return this.graphRender.removeItem(e)}updateItem(e,t){return this.graphRender.updateItem(e,t)}refreshItem(e){return this.graphRender.refreshItem(e)}refreshPositions(){return this.graphRender.refreshPositions()}on(e,t){this.graphRender.on(e,t)}off(e,t){this.graphRender.off(e,t)}toDataURL(e,t){this.graphRender.toDataURL(e,t)}nodeLabelOpenEllipsis(e,t){return t?e?t.map(t=>{const i=t.labelCfg&&t.labelCfg.fontSize||this.defaultNode&&this.defaultNode.labelCfg&&this.defaultNode.labelCfg.fontSize||14;return t.label=function(e,t,i){const r=1*i;t*=1.6;if((e=>{let t=0;for(let i=0;i<e.length;i++)e.charCodeAt(i)>0&&e.charCodeAt(i)<128?t++:t+=2;return t})(e)*r>t){const i=Math.floor((t-20)/r),s=e.substring(0,i);return(e.substring(i).length+"…".length)*r>t?s+"\n"+e.substring(i,i+i-2)+"…":0==e.substring(i).length?s:s+"\n"+e.substring(i)}return e}(t.label,e,i),t}):t:[]}clear(e=this.graph){e&&e.clear()}destroy(e=this.graph){e&&e.destroy()}}e.Lang=Ma,e.i18n=e.Lang.i18n,e.Util={...e.Util,...ee},e.Browser=Q,e.INCHES_PER_UNIT=te,e.METERS_PER_INCH=ie,e.DOTS_PER_INCH=$,e.IS_GECKO=K,e.setCORS=function(e){ke=e},e.isCORS=Be,e.setRequestTimeout=function(e){return De=e},e.getRequestTimeout=Ge,e.FetchRequest=Ue,e.inherit=function(e,t){var i,r,s,n=function(){};for(n.prototype=t.prototype,e.prototype=new n,i=2,r=arguments.length;i<r;i++)"function"==typeof(s=arguments[i])&&(s=s.prototype),ee.extend(e.prototype,s)},e.mixin=J,e.String=q,e.Number=H,e.Function=W,e.Array=Y,e.Date=ge,e.Event=ve,e.Bounds=se,e.Credential=ye,e.Events=be,e.Feature=_e,e.Geometry=X,e.Pixel=V,e.Size=z,e.Feature.Vector=xe,e.Geometry.Collection=ne,e.Geometry.Curve=oe,e.Geometry.GeoText=ue,e.Geometry.LinearRing=ce,e.Geometry.LineString=he,e.Geometry.MultiLineString=de,e.Geometry.MultiPoint=ae,e.Geometry.MultiPolygon=pe,e.Geometry.Point=le,e.Geometry.Polygon=fe,e.Geometry.Rectangle=me,e.Components.Chart=class{constructor(e,t){this.domID=e,this.chartType=t.type||"bar",t.datasets.type=t.datasets.type||"iServer",t.datasets.withCredentials=t.datasets.withCredentials||!1,this.viewModel=new La(t),this._fillDataToView()}onAdd(e){this.addChart=e}_fillDataToView(){let e=new wa;this.viewModel.getDatasetInfo(this._createChart.bind(this)),this.viewModel.events.on({getdatafailed:t=>{e.showView(t.message)}})}getStyle(){return this.viewModel.getStyle()}getFeatures(){return this.viewModel.getFeatures()}setStyle(e){let t=this.viewModel.setStyle(e);this._updateChart(t)}changeType(e){if(this.chartType!==e){this.chartType=e;let t=this.viewModel.changeType(e);this._updateChart(t)}}updateData(e,t){let i=this;this.viewModel.updateData(e,t,function(e){i._updateChart(e),i.addChart&&i.addChart()})}_createChart(e){this.echart=Ca.init(document.getElementById(this.domID),null,{renderer:"canvas"});let t=this.viewModel._createChartOptions(e);this.echart.setOption(t),this.addChart&&this.addChart()}_updateChart(e){this.echart&&(this.echart.clear(),this.echart.setOption(e))}},e.Components.ChartViewModel=La,e.Components.MessageBox=wa,e.Components.AttributesPopContainer=ka,e.Components.CityTabsPage=Ra,e.Components.CommonContainer=Pa,e.Components.DropDownBox=Ia,e.Components.IndexTabsPageContainer=Da,e.Components.NavTabsPage=Ba,e.Components.PaginationContainer=Ga,e.Components.PopContainer=Fa,e.Components.Select=Na,e.Components.TemplateBase=Oa,e.Components.FileReaderUtil=Ta,e.TimeControlBase=Pe,e.TimeFlowControl=class extends Pe{constructor(e,t){super(t);var i=this;i.callback=e,Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),i=this,r=function(){},s=function(){return i.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,s.prototype=new r,s}),i.update=i.update.bind(i),i.oldTime=i.currentTime,i.CLASS_NAME="SuperMap.TimeFlowControl"}updateOptions(e){e=e||{},super.updateOptions(e)}start(){var e=this;e.running||(e.running=!0,e.reverse?e.currentTime===e.startTime&&(e.oldTime=e.endTime,e.currentTime=e.oldTime):e.oldTime===e.endTime&&(e.currentTime=e.startTime,e.oldTime=e.currentTime),e.tick())}stop(){super.stop();var e=this;e.oldTime=e.currentTime,e.running&&(e.running=!1),e.intervalId&&window.clearTimeout(e.intervalId)}destroy(){super.destroy(),this.oldTime=null,this.callback=null}tick(){var e=this;e.intervalId&&window.clearInterval(e.intervalId),e.intervalId=null,e.update(),e.intervalId=window.setInterval(e.update,e.frequency)}update(){var e=this;if(e.running)if(e.callback&&e.callback(e.currentTime),e.reverse){if(e.currentTime===e.startTime){if(!e.repeat)return e.running=!1,null;e.oldTime=e.endTime,e.currentTime=e.oldTime}else e.currentTime=e.oldTime,e.oldTime-=e.speed;e.oldTime<=e.startTime&&(e.oldTime=e.startTime)}else{if(e.currentTime===e.endTime){if(!e.repeat)return e.running=!1,e.stop(),null;e.stop(),e.currentTime=e.startTime,e.oldTime=e.currentTime,e.start()}else e.oldTime=e.currentTime,e.currentTime+=e.speed;e.currentTime>=e.endTime&&(e.currentTime=e.endTime)}}},e.Format=e.Format||we,e.Format.GeoJSON=Oe,e.Format.JSON=Ce,e.Format.WKT=class extends we{constructor(e){super(e),this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},this.CLASS_NAME="SuperMap.Format.WKT",this.extract={point:function(e){return e.x+" "+e.y},multipoint(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push("("+this.extract.point.apply(this,[e.components[i]])+")");return t.join(",")},linestring(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t.join(",")},multilinestring(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push("("+this.extract.linestring.apply(this,[e.components[i]])+")");return t.join(",")},polygon(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push("("+this.extract.linestring.apply(this,[e.components[i]])+")");return t.join(",")},multipolygon(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push("("+this.extract.polygon.apply(this,[e.components[i]])+")");return t.join(",")},collection(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extractGeometry.apply(this,[e.components[i]]));return t.join(",")}},this.parse={point:function(e){var t=q.trim(e).split(this.regExes.spaces);return new xe(new le(t[0],t[1]))},multipoint:function(e){for(var t,i=q.trim(e).split(","),r=[],s=0,n=i.length;s<n;++s)t=i[s].replace(this.regExes.trimParens,"$1"),r.push(this.parse.point.apply(this,[t]).geometry);return new xe(new ae(r))},linestring:function(e){for(var t=q.trim(e).split(","),i=[],r=0,s=t.length;r<s;++r)i.push(this.parse.point.apply(this,[t[r]]).geometry);return new xe(new he(i))},multilinestring:function(e){for(var t,i=q.trim(e).split(this.regExes.parenComma),r=[],s=0,n=i.length;s<n;++s)t=i[s].replace(this.regExes.trimParens,"$1"),r.push(this.parse.linestring.apply(this,[t]).geometry);return new xe(new de(r))},polygon:function(e){for(var t,i,r,s=q.trim(e).split(this.regExes.parenComma),n=[],a=0,o=s.length;a<o;++a)t=s[a].replace(this.regExes.trimParens,"$1"),i=this.parse.linestring.apply(this,[t]).geometry,r=new ce(i.components),n.push(r);return new xe(new fe(n))},multipolygon:function(e){for(var t,i=q.trim(e).split(this.regExes.doubleParenComma),r=[],s=0,n=i.length;s<n;++s)t=i[s].replace(this.regExes.trimParens,"$1"),r.push(this.parse.polygon.apply(this,[t]).geometry);return new xe(new pe(r))},geometrycollection:function(e){e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var t=q.trim(e).split("|"),i=[],r=0,s=t.length;r<s;++r)i.push(this.read(t[r]));return i}}}read(e){var t,i,r;e=e.replace(/[\n\r]/g," ");var s=this.regExes.typeStr.exec(e);return s&&(i=s[1].toLowerCase(),r=s[2],this.parse[i]&&(t=this.parse[i].apply(this,[r]))),t}write(e){var t,i,r;e.constructor===Array?(t=e,r=!0):(t=[e],r=!1);var s=[];r&&s.push("GEOMETRYCOLLECTION(");for(var n=0,a=t.length;n<a;++n)r&&n>0&&s.push(","),i=t[n].geometry,s.push(this.extractGeometry(i));return r&&s.push(")"),s.join("")}extractGeometry(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")":null}},e.iManager=class extends ze{constructor(e){super(e)}load(){return this.request("GET",this.serviceUrl+"/web/api/service.json")}createIServer(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/server.json",new Ve(e))}createIPortal(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/portal.json",new Ve(e))}iServerList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/server.json")}iPortalList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/portal.json")}startNodes(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/started.json",e)}stopNodes(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/stopped.json",e)}},e.iManagerCreateNodeParam=Ve,e.iManagerServiceBase=ze,e.iPortal=class extends Je{constructor(e,t){super(e,t),this.iportalUrl=e,t=t||{},this.withCredentials=t.withCredentials||!1}load(){return Ue.get(this.iportalUrl+"/web")}queryResources(e){if(!(e instanceof qe))return new Promise(function(e){e("queryParams is not instanceof iPortalQueryParam !")});var t=this,i=this.iportalUrl+"/gateway/catalog/resource/search.json";return e.t=(new Date).getTime(),this.request("GET",i,e).then(function(e){var i=[];(e.content||[]).forEach(function(e){i.push(new We(t.iportalUrl,e))});let r=new He;return r.content=i,r.total=e.total,r.currentPage=e.currentPage,r.pageSize=e.pageSize,r.aggregations=e.aggregations,r})}updateResourcesShareSetting(e){if(!(e instanceof Ye))return new Promise(function(e){e("shareParams is not instanceof iPortalShareParam !")});var t=e.resourceType.replace("_","").toLowerCase()+"s";"datas"===t&&(t="mycontent/"+t);var i={ids:e.ids,entities:e.entities},r=this.iportalUrl+"/web/"+t+"/sharesetting.json";return this.request("PUT",r,JSON.stringify(i)).then(function(e){return e})}},e.iPortalAddDataParam=Ze,e.iPortalAddResourceParam=Xe,e.iPortalDataConnectionInfoParam=et,e.iPortalDataMetaInfoParam=Ke,e.iPortalDataStoreInfoParam=$e,e.iPortalQueryParam=qe,e.iPortalQueryResult=He,e.iPortalRegisterServiceParam=Qe,e.iPortalResource=We,e.iPortalServiceBase=Je,e.iPortalShareEntity=class{constructor(e){e=e||{},this.permissionType="",this.entityType="",this.entityName="GUEST",this.entityId=null,ee.extend(this,e)}},e.iPortalShareParam=Ye,e.iPortalUser=class extends Je{constructor(e){super(e),this.iportalUrl=e}deleteResources(e){var t=e.resourceType.replace("_","").toLowerCase(),i=this.iportalUrl+"/web/"+t+"s.json?ids="+encodeURI(JSON.stringify(e.ids));return"data"===t?(i=this.iportalUrl+"/web/mycontent/datas/delete.json",this.request("POST",i,JSON.stringify(e.ids))):this.request("DELETE",i)}addMap(e){if(!(e instanceof Xe))return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},i=this.iportalUrl+"/web/maps/batchaddmaps.json";return this.request("POST",i,JSON.stringify(t)).then(function(e){return e})}addScene(e){if(!(e instanceof Xe))return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},i=this.iportalUrl+"/web/scenes/batchaddscenes.json";return this.request("POST",i,JSON.stringify(t)).then(function(e){return e})}registerService(e){if(!(e instanceof Qe))return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");let t={type:e.type,tags:e.tags,authorizeSetting:e.entities,metadata:e.metadata,addedMapNames:e.addedMapNames,addedSceneNames:e.addedSceneNames},i=this.iportalUrl+"/web/services.json";return this.request("POST",i,JSON.stringify(t)).then(e=>e)}getErrMsgPromise(e){return new Promise(t=>{t(e)})}uploadDataRequest(e,t){var i=this.iportalUrl+"/web/mycontent/datas/"+e+"/upload.json";return this.request("POST",i,t)}addData(e,t){if(!(e instanceof Ze))return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");var i,r=this.iportalUrl+"/web/mycontent/datas.json",s={fileName:e.fileName,tags:e.tags,type:e.type},n=e.type.toLowerCase();if("excel"===n||"csv"===n){if(!(e.dataMetaInfo instanceof Ke))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");i={xField:e.dataMetaInfo.xField,yField:e.dataMetaInfo.yField},"csv"===n&&(i.fileEncoding=e.dataMetaInfo.fileEncoding),s.coordType="WGS84",s.dataMetaInfo=i}else if("hdfs"===n||"hbase"===n){if(!(e.dataMetaInfo instanceof Ke))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof $e))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");var a={type:e.dataMetaInfo.dataStoreInfo.type};switch(n){case"hdfs":a.url=e.dataMetaInfo.dataStoreInfo.url,i={url:e.dataMetaInfo.url,dataStoreInfo:a};break;case"hbase":if(!(e.dataMetaInfo.dataStoreInfo.connectionInfo instanceof et))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");a.connectionInfo={dataBase:e.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,server:e.dataMetaInfo.dataStoreInfo.connectionInfo.server,engineType:"HBASE"},a.datastoreType="SPATIAL",i={dataStoreInfo:a}}s.dataMetaInfo=i}return this.request("POST",r,JSON.stringify(s)).then(e=>"hdfs"===n||"hbase"===n?e:e.childID?this.uploadDataRequest(e.childID,t):e.customResult)}publishOrUnpublish(e,t){if(!e.dataId||!e.serviceType)return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");var i=e.dataId,r=e.dataServiceId,s=e.serviceType,n=this.iportalUrl+"/web/mycontent/datas/"+i+"/publishstatus.json?serviceType="+s;return r&&(n+="&dataServiceId="+r),this.request("PUT",n,JSON.stringify(t)).then(e=>t?(r||(r=e.customResult),r):e)}getDataPublishedStatus(e,t){var i=this.iportalUrl+"/web/mycontent/datas/"+e+"/publishstatus.json?dataServiceId="+t+"&forPublish=true";return this.request("GET",i)}unPublishDataService(e){return this.publishOrUnpublish(e,!1)}publishDataService(e){return this.publishOrUnpublish(e,!0)}},e.AddressMatchService=st,e.AggregationParameter=nt,e.AreaSolarRadiationParameters=ot,e.AreaSolarRadiationService=ht,e.BucketAggParameter=at,e.BufferAnalystParameters=dt,e.BufferAnalystService=gt,e.BufferDistance=ut,e.BuffersAnalystJobsParameter=St,e.BuffersAnalystJobsService=wt,e.BufferSetting=ct,e.BurstPipelineAnalystParameters=Ct,e.BurstPipelineAnalystService=At,e.ChartFeatureInfoSpecsService=Tt,e.ChartQueryFilterParameter=Et,e.ChartQueryParameters=Lt,e.ChartQueryService=Pt,e.ClipParameter=class{constructor(e){this.clipDatasetName=null,this.clipDatasourceName=null,this.clipRegion=null,this.isClipInRegion=!0,this.isExactClip=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.ClipParameter"}destroy(){var e=this;e.clipDatasetName=null,e.clipDatasourceName=null,e.clipRegion=null,e.isClipInRegion=null,e.isExactClip=null}toJSON(){return ee.toJSON({isClipInRegion:this.isClipInRegion,clipDatasetName:this.clipDatasetName,clipDatasourceName:this.clipDatasourceName,isExactClip:this.isExactClip,clipRegion:Le.fromGeometry(this.clipRegion)})}},e.ColorDictionary=Nt,e.CommonServiceBase=tt,e.ComputeWeightMatrixParameters=kt,e.ComputeWeightMatrixService=Dt,e.CreateDatasetParameters=js,e.DataFlowService=Rt,e.DataReturnOption=pt,e.DatasetBufferAnalystParameters=mt,e.DatasetInfo=Bt,e.DatasetOverlayAnalystParameters=Ut,e.DatasetService=Ii,e.DatasetSurfaceAnalystParameters=Vt,e.DatasetThiessenAnalystParameters=qt,e.DatasourceConnectionInfo=vt,e.DatasourceService=Ht,e.DensityAnalystService=Yt,e.DensityKernelAnalystParameters=Wt,e.EditFeaturesParameters=Xt,e.EditFeaturesService=Qt,e.FacilityAnalyst3DParameters=Zt,e.FacilityAnalystSinks3DParameters=Kt,e.FacilityAnalystSinks3DService=$t,e.FacilityAnalystSources3DParameters=ei,e.FacilityAnalystSources3DService=ti,e.FacilityAnalystStreamParameters=ii,e.FacilityAnalystStreamService=ri,e.FacilityAnalystTracedown3DParameters=si,e.FacilityAnalystTracedown3DService=ni,e.FacilityAnalystTraceup3DParameters=ai,e.FacilityAnalystTraceup3DService=oi,e.FacilityAnalystUpstream3DParameters=li,e.FacilityAnalystUpstream3DService=hi,e.FieldParameters=ui,e.FieldsFilter=hn,e.FieldStatisticService=di,e.FieldStatisticsParameters=ci,e.FilterParameter=ft,e.FindClosestFacilitiesParameters=pi,e.FindClosestFacilitiesService=fi,e.FindLocationParameters=mi,e.FindLocationService=yi,e.FindMTSPPathsParameters=gi,e.FindMTSPPathsService=vi,e.FindPathParameters=bi,e.FindPathService=_i,e.FindServiceAreasParameters=Si,e.FindServiceAreasService=xi,e.FindTSPPathsParameters=wi,e.FindTSPPathsService=Ci,e.GenerateSpatialDataParameters=Mi,e.GenerateSpatialDataService=Ai,e.GeoCodingParameter=it,e.GeoDecodingParameter=rt,e.GeoHashGridAggParameter=class extends at{constructor(e){super(),this.precision=5,ee.extend(this,e),this.aggType=G.GEOHASH_GRID,this.CLASS_NAME="SuperMap.GeoHashGridAggParameter"}destroy(){super.destroy(),this.aggType=null,this.precision=null}static toJsonParameters(e){var t={aggName:e.aggName,aggFieldName:e.aggFieldName,aggType:e.aggType,precision:e.precision};return ee.toJson(t)}},e.GeometryBatchAnalystService=Ps,e.GeometryBufferAnalystParameters=yt,e.GeometryOverlayAnalystParameters=Ti,e.GeometrySurfaceAnalystParameters=Ei,e.GeometryThiessenAnalystParameters=Li,e.GeoprocessingService=Oi,e.GeoRelationAnalystParameters=Pi,e.GeoRelationAnalystService=Ni,e.GetFeaturesByBoundsParameters=ki,e.GetFeaturesByBoundsService=Ri,e.GetFeaturesByBufferParameters=Bi,e.GetFeaturesByBufferService=Gi,e.GetFeaturesByGeometryParameters=Ui,e.GetFeaturesByGeometryService=ji,e.GetFeaturesByIDsParameters=zi,e.GetFeaturesByIDsService=Vi,e.GetFeaturesBySQLParameters=Ji,e.GetFeaturesBySQLService=qi,e.GetFeaturesParametersBase=Fi,e.GetFeaturesServiceBase=Di,e.GetFieldsService=Hi,e.GetGridCellInfosParameters=Wi,e.GetGridCellInfosService=Yi,e.GetLayersInfoService=Cr,e.Grid=Sr,e.HillshadeParameter=class extends Ys{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=j.HILLSHADE,ee.extend(this,e),this.CLASS_NAME="SuperMap.HillshadeParameter"}destroy(){super.destroy(),this.altitude=null,this.azimuth=null,this.zFactor=null}toJSON(){return{altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,type:this.type}}},e.Image=xr,e.ImageCollectionService=on,e.ImageGFAspect=mn,e.ImageGFHillShade=fn,e.ImageGFOrtho=yn,e.ImageGFSlope=gn,e.ImageRenderingRule=pn,e.ImageSearchParameter=cn,e.ImageService=ln,e.ImageStretchOption=dn,e.InterpolationAnalystParameters=Mr,e.InterpolationAnalystService=Or,e.InterpolationDensityAnalystParameters=Tr,e.InterpolationIDWAnalystParameters=Er,e.InterpolationKrigingAnalystParameters=Lr,e.InterpolationRBFAnalystParameters=Ar,e.JoinItem=vr,e.KernelDensityJobParameter=Pr,e.KernelDensityJobsService=Nr,e.LabelImageCell=class extends Ir{constructor(e){super(e),this.height=0,this.pathField=null,this.rotation=0,this.width=0,this.sizeFixed=!1,this.type="IMAGE",e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LabelImageCell"}destroy(){var e=this;e.height=null,e.pathField=null,e.rotation=null,e.width=null,e.sizeFixed=null}},e.LabelMatrixCell=Ir,e.LabelMixedTextStyle=er,e.LabelSymbolCell=class extends Ir{constructor(e){super(e),this.style=new Ae,this.symbolIDField=null,this.type="SYMBOL",e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LabelSymbolCell"}destroy(){this.style&&(this.style.destroy(),this.style=null),this.symbolIDField=null}},e.LabelThemeCell=class extends Ir{constructor(e){super(e),this.themeLabel=new sr,this.type="THEME",e&&ee.extend(this,e),this.CLASS_NAME=" SuperMap.LabelThemeCell"}destroy(){this.themeLabel&&(this.themeLabel.destroy(),this.themeLabel=null)}},e.LayerStatus=class{constructor(e){this.layerName=null,this.isVisible=null,this.displayFilter=null,this.fieldValuesDisplayFilter=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LayerStatus"}destroy(){this.layerName=null,this.isVisible=null,this.displayFilter=null}toJSON(){var e="{";e+='"type":"UGC",';var t=[];return this.layerName&&(t.push('"name":"'+this.layerName+'"'),t.push('"visible":'+this.isVisible)),this.displayFilter&&t.push('"displayFilter":"'+this.displayFilter+'"'),(this.minScale||0==this.minScale)&&t.push('"minScale":'+this.minScale),(this.maxScale||0==this.maxScale)&&t.push('"maxScale":'+this.maxScale),this.fieldValuesDisplayFilter&&t.push('"fieldValuesDisplayFilter":'+ee.toJSON(this.fieldValuesDisplayFilter)),e+=t,e+="}"}},e.LinkItem=class{constructor(e){this.datasourceConnectionInfo=null,this.foreignKeys=null,this.foreignTable=null,this.linkFields=null,this.linkFilter=null,this.name=null,this.primaryKeys=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LinkItem"}destroy(){var e=this;e.datasourceConnectionInfo instanceof vt&&(e.datasourceConnectionInfo.destroy(),e.datasourceConnectionInfo=null),e.foreignKeys=null,e.foreignTable=null,e.linkFields=null,e.linkFilter=null,e.name=null,e.primaryKeys=null}},e.MappingParameters=_t,e.MapService=Fr,e.MathExpressionAnalysisParameters=kr,e.MathExpressionAnalysisService=Dr,e.MeasureParameters=Rr,e.MeasureService=Br,e.MetricsAggParameter=class extends nt{constructor(e){super(),this.aggType=U.AVG,ee.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy(),this.aggType=null}},e.NDVIParameter=class extends Ys{constructor(e){super(e),this.redIndex=0,this.nirIndex=1,this.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff",this.type=j.NDVI,ee.extend(this,e),this.CLASS_NAME="SuperMap.NDVIParameter"}destroy(){super.destroy(),this.redIndex=null,this.nirIndex=null,this.colorMap=null}toJSON(){return{redIndex:this.redIndex,nirIndex:this.nirIndex,colorMap:this.colorMap,type:this.type}}},e.NetworkAnalystServiceBase=Mt,e.OutputSetting=bt,e.OverlapDisplayedOptions=class{constructor(e){e=e||{},this.allowPointOverlap=!0,this.allowPointWithTextDisplay=!0,this.allowTextOverlap=!1,this.allowTextAndPointOverlap=!0,this.allowThemeGraduatedSymbolOverlap=!1,this.allowThemeGraphOverlap=!1,this.horizontalOverlappedSpaceSize=0,this.verticalOverlappedSpaceSize=0,ee.extend(this,e),this.ugcLayer=new yr(e),this.CLASS_NAME="SuperMap.OverlapDisplayedOptions"}destroy(){ee.reset(this)}fromJson(e){this.ugcLayer.fromJson.apply(this,[e])}toServerJSONObject(){return this.ugcLayer.toServerJSONObject.apply(this,arguments)}toString(){var e=this.ugcLayer.toServerJSONObject.apply(this,arguments),t="{";for(var i in e)e.hasOwnProperty(i)&&(t+="'"+i+"':"+e[i]+",");return t=t.substr(0,t.length-1),t+="}"}},e.OverlayAnalystParameters=Gt,e.OverlayAnalystService=Gr,e.OverlayGeoJobParameter=Ur,e.OverlayGeoJobsService=jr,e.PointWithMeasure=Te,e.ProcessingServiceBase=xt,e.QueryByBoundsParameters=zr,e.QueryByBoundsService=Jr,e.QueryByDistanceParameters=qr,e.QueryByDistanceService=Hr,e.QueryByGeometryParameters=Wr,e.QueryByGeometryService=Yr,e.QueryBySQLParameters=Xr,e.QueryBySQLService=Qr,e.QueryParameters=Ot,e.QueryService=Zr,e.RasterFunctionParameter=Ys,e.Route=Ee,e.RouteCalculateMeasureParameters=Kr,e.RouteCalculateMeasureService=$r,e.RouteLocatorParameters=es,e.RouteLocatorService=ts,e.ServerColor=Me,e.ServerFeature=is,e.ServerGeometry=Le,e.ServerStyle=Ae,e.ServerTextStyle=Qi,e.ServerTheme=_r,e.SetDatasourceParameters=rs,e.SetLayerInfoParameters=class{constructor(e){e=e||{},this.resourceID=null,this.tempLayerName=null,this.layerInfo=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SetLayerInfoParameters"}destroy(){this.resourceID=null,this.tempLayerName=null,this.layerInfo=null}},e.SetLayerInfoService=ss,e.SetLayersInfoParameters=class{constructor(e){e=e||{},this.isTempLayers=null,this.resourceID=null,this.layersInfo=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SetLayersInfoParameters"}destroy(){this.isTempLayers=null,this.resourceID=null,this.layersInfo=null}},e.SetLayersInfoService=ns,e.SetLayerStatusParameters=as,e.SetLayerStatusService=os,e.SingleObjectQueryJobsParameter=ls,e.SingleObjectQueryJobsService=hs,e.Sortby=un,e.SpatialAnalystBase=lt,e.StopQueryParameters=us,e.StopQueryService=cs,e.SummaryAttributesJobsParameter=ds,e.SummaryAttributesJobsService=ps,e.SummaryMeshJobParameter=fs,e.SummaryMeshJobsService=ms,e.SummaryRegionJobParameter=ys,e.SummaryRegionJobsService=gs,e.SupplyCenter=vs,e.SurfaceAnalystParameters=zt,e.SurfaceAnalystParametersSetting=jt,e.SurfaceAnalystService=bs,e.TerrainCurvatureCalculationParameters=_s,e.TerrainCurvatureCalculationService=Ss,e.Theme=Xi,e.ThemeDotDensity=cr,e.ThemeFlow=xs,e.ThemeGraduatedSymbol=pr,e.ThemeGraduatedSymbolStyle=dr,e.ThemeGraph=ur,e.ThemeGraphAxes=ar,e.ThemeGraphItem=hr,e.ThemeGraphSize=or,e.ThemeGraphText=lr,e.ThemeGridRange=Cs,e.ThemeGridRangeItem=ws,e.ThemeGridUnique=As,e.ThemeGridUniqueItem=Ms,e.ThemeLabel=sr,e.ThemeLabelAlongLine=ir,e.ThemeLabelBackground=rr,e.ThemeLabelItem=Zi,e.ThemeLabelText=tr,e.ThemeLabelUniqueItem=Ts,e.ThemeMemoryData=class{constructor(e,t){this.srcData=e,this.targetData=t,this.CLASS_NAME="SuperMap.ThemeMemoryData"}destroy(){this.srcData=null,this.targetData=null}toJSON(){if(this.srcData&&this.targetData){for(var e="",t=Math.min(this.srcData.length,this.targetData.length),i=0;i<t;i++)e+="'"+this.srcData[i]+"':'"+this.targetData[i]+"',";return i>0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}return null}},e.ThemeOffset=$i,e.ThemeParameters=Es,e.ThemeRange=mr,e.ThemeRangeItem=fr,e.ThemeService=Ls,e.ThemeUnique=nr,e.ThemeUniqueItem=Ki,e.ThiessenAnalystParameters=Jt,e.ThiessenAnalystService=Os,e.TilesetsService=Ns,e.TopologyValidatorJobsParameter=Is,e.TopologyValidatorJobsService=Fs,e.TransferLine=ks,e.TransferPathParameters=Ds,e.TransferPathService=Rs,e.TransferSolutionParameters=Bs,e.TransferSolutionService=Gs,e.TransportationAnalystParameter=Ft,e.TransportationAnalystResultSetting=It,e.UGCLayer=yr,e.UGCMapLayer=gr,e.UGCSubLayer=br,e.UpdateDatasetParameters=qs,e.UpdateEdgeWeightParameters=Us,e.UpdateEdgeWeightService=zs,e.UpdateTurnNodeWeightParameters=Vs,e.UpdateTurnNodeWeightService=Js,e.Vector=wr,e.VectorClipJobsParameter=Hs,e.VectorClipJobsService=Ws,e.WebPrintingJobContent=rn,e.WebPrintingJobCustomItems=Xs,e.WebPrintingJobExportOptions=nn,e.WebPrintingJobImage=Qs,e.WebPrintingJobLayers=Zs,e.WebPrintingJobLayoutOptions=sn,e.WebPrintingJobLegendOptions=Ks,e.WebPrintingJobLittleMapOptions=$s,e.WebPrintingJobNorthArrowOptions=en,e.WebPrintingJobParameters=class{constructor(e){e&&(this.content=null,this.layoutOptions=null,this.exportOptions=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof rn&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof sn&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof nn&&(this.exportOptions.destroy(),this.exportOptions=null)}},e.WebPrintingJobScaleBarOptions=tn,e.WebPrintingService=an,e.Online=class{constructor(){this.rootUrl="https://www.supermapol.com",this.webUrl=this.rootUrl+"/web";var e=this.webUrl+"/mycontent";this.mDatasUrl=e+"/datas",this.CLASS_NAME="SuperMap.Online"}load(){return Ue.get(this.rootUrl).then(function(e){return e})}login(){je.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,i=t.mDatasUrl;return e&&(e=e.toJSON()),Ue.get(i,e).then(function(e){if(e&&e.content&&!(e.content.length<1)){for(var i=[],r=e.content,s=r.length,n=0;n<s;n++){var a=r[n],o=new bn(t.mDatasUrl,a);i.push(o)}return i}})}},e.OnlineData=bn,e.OnlineQueryDatasParameter=class{constructor(e){e=e||{},this.userNames=null,this.types=null,this.fileName=null,this.serviceStatuses=null,this.serviceId=null,this.ids=null,this.keywords=null,this.orderBy=null,this.tags=null,this.filterFields=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.OnlineQueryDatasParameter"}toJSON(){var e=this,t={types:e.types,fileName:e.fileName,serviceStatuses:e.serviceStatuses,serviceId:e.serviceId,ids:e.ids,keywords:e.keywords,orderBy:e.orderBy,tags:e.tags,filterFields:e.filterFields};for(var i in t)null==t[i]&&delete t[i];return t}},e.ServiceStatus={DOES_NOT_INVOLVE:"DOES_NOT_INVOLVE",PUBLISH_FAILED:"PUBLISH_FAILED",PUBLISHED:"PUBLISHED",PUBLISHING:"PUBLISHING",UNPUBLISHED:"UNPUBLISHED",UNPUBLISHED_FAILED:"UNPUBLISHED_FAILED"},e.DataItemType={GEOJSON:"GEOJSON",UGCV5_MVT:"UGCV5_MVT",JSON:"JSON",AUDIO:"AUDIO",COLOR:"COLOR",COLORSCHEME:"COLORSCHEME",CSV:"CSV",EXCEL:"EXCEL",FILLSYMBOL:"FILLSYMBOL",IMAGE:"IMAGE",LAYERTEMPLATE:"LAYERTEMPLATE",LAYOUTTEMPLATE:"LAYOUTTEMPLATE",LINESYMBOL:"LINESYMBOL",MAPTEMPLATE:"MAPTEMPLATE",MARKERSYMBOL:"MARKERSYMBOL",MBTILES:"MBTILES",PHOTOS:"PHOTOS",SHP:"SHP",SMTILES:"SMTILES",SVTILES:"SVTILES",THEMETEMPLATE:"THEMETEMPLATE",TPK:"TPK",UDB:"UDB",UGCV5:"UGCV5",UNKNOWN:"UNKNOWN",VIDEO:"VIDEO",WORKENVIRONMENT:"WORKENVIRONMENT",WORKSPACE:"WORKSPACE"},e.DataItemOrderBy={FILENAME:"FILENAME",ID:"ID",LASTMODIFIEDTIME:"LASTMODIFIEDTIME",NICKNAME:"NICKNAME",SERVICESTATUS:"SERVICESTATUS",SIZE:"SIZE",STATUS:"STATUS",TYPE:"TYPE",UPDATETIME:"UPDATETIME",USERNAME:"USERNAME"},e.FilterField={LINKPAGE:"LINKPAGE",MAPTITLE:"MAPTITLE",NICKNAME:"NICKNAME",RESTITLE:"RESTITLE",USERNAME:"USERNAME"},e.OnlineServiceBase=vn,e.Feature=e.Feature||{},e.Feature.Theme=sa,e.Feature.Theme.Bar=class extends na{constructor(e,t,i,r,s){super(e,t,i,r,s),this.CLASS_NAME="SuperMap.Feature.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){var e={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},t=this.setting;if(t.barLinearGradient||(t.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var r=this.dataViewBox,s=this.dataValues;if(!(s.length<1)){for(let e=0,t=s.length;e<t;e++)if(s[e]<i[0]||s[e]>i[1])return;var n=this.calculateXShapeInfo();if(n){var a=n.xPositions,o=n.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,r,t,n)));for(var l=0;l<s.length;l++){var h=r[1]-(s[l]-i[0])/this.DVBUnitValue,u=[[a[l]-o/2,r[1]-1],[a[l]+o/2,r[1]-1],[a[l]+o/2,h],[a[l]-o/2,h]],c=new Dn(u);if(void 0===t.showShadow||t.showShadow){if(t.barShadowStyle){var d=t.barShadowStyle;d.shadowBlur&&(e.shadowBlur=d.shadowBlur),d.shadowColor&&(e.shadowColor=d.shadowColor),d.shadowOffsetX&&(e.shadowOffsetX=d.shadowOffsetX),d.shadowOffsetY&&(e.shadowOffsetY=d.shadowOffsetY)}c.style={},ee.copyAttributesWithClip(c.style,e)}c.refDataID=this.data.id,c.dataInfo={field:this.fields[l],value:s[l]},void 0!==t.barHoverAble&&(c.hoverable=t.barHoverAble),void 0!==t.barClickAble&&(c.clickable=t.barClickAble),this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,i=this.setting,r=this.dataValues.length;if(r<1)return null;var s=[],n=0,a=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3==i.xShapeBlank.length){var o=a-((e=i.xShapeBlank)[0]+e[2]+(r-1)*e[1]);if(o<=r)return null;n=o/r}else e=[n=a/(2*r+1),n,n];for(var l=0,h=0;h<r;h++)0==h?l=e[0]+n/2:l+=n+e[1],s.push(t[0]+l);return{xPositions:s,width:n}}resetLinearGradient(){if(this.RelativeCoordinate)for(var e=this.shapes.length,t=this.setting.barLinearGradient,i=-1,r=0;r<e;r++){var s=this.shapes[r];if("SuperMap.LevelRenderer.Shape.SmicPolygon"===s.CLASS_NAME){var n=s.style,a=this.location[0]+n.pointList[0][0],o=this.location[0]+n.pointList[1][0];++i>=t.length&&(i%=t.length);var l=t[i][0],h=t[i][1],u=(new wn).getLinearGradient(a,0,o,0,[[0,l],[1,h]]);s.style.color=u}}}},e.Feature.Theme.Bar3D=class extends na{constructor(e,t,i,r,s){super(e,t,i,r,s),this.CLASS_NAME="SuperMap.Feature.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,25,20,20]:e.dataViewBoxParameter=[5,5,5,5]),e.axisUseArrow=void 0===e.axisUseArrow||e.axisUseArrow,e.axisXLabelsOffset=void 0!==e.axisXLabelsOffset?e.axisXLabelsOffset:[-10,10],this.initBaseParameter()){var t=this.DVBCodomain;this.DVBUnitValue=(t[1]-t[0])/this.DVBHeight;var i=this.dataViewBox,r=this.dataValues;if(!(r.length<1)){for(let e=0,i=r.length;e<i;e++)if(r[e]<t[0]||r[e]>t[1])return;var s=this.calculateXShapeInfo();if(s){var n=s.xPositions,a=s.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,e)),(!e.axis3DParameter||isNaN(e.axis3DParameter)||e.axis3DParameter<15)&&(e.axis3DParameter=20),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,i,e,s)));var o=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10;for(let s=0;s<r.length;s++){var l=i[1]-(r[s]-t[0])/this.DVBUnitValue,h=n[s]-a/2,u=n[s]+a/2,c=[[h,l],[u,l],[u-o,l+o],[h-o,l+o]],d=[[u,l],[u-o,l+o],[u-o,i[1]+o],[u,i[1]]],p=[[h-o,i[1]+o],[u-o,i[1]+o],[u-o,l+o],[h-o,l+o]];o<=0&&(p=[[h,i[1]],[u,i[1]],[u,l],[h,l]]);var f=new Dn(c),m=new Dn(d),y=new Dn(p);e.barSideStyle=e.barSideStyle?e.barSideStyle:e.barFaceStyle,e.barSideStyleByFields=e.barSideStyleByFields?e.barSideStyleByFields:e.barFaceStyleByFields,e.barSideStyleByCodomain=e.barSideStyleByCodomain?e.barSideStyleByCodomain:e.barFaceStyleByCodomain,e.barTopStyle=e.barTopStyle?e.barTopStyle:e.barFaceStyle,e.barTopStyleByFields=e.barTopStyleByFields?e.barTopStyleByFields:e.barFaceStyleByFields,e.barTopStyleByCodomain=e.barTopStyleByCodomain?e.barTopStyleByCodomain:e.barFaceStyleByCodomain,y.style=ra.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barFaceStyle,e.barFaceStyleByFields,e.barFaceStyleByCodomain,s,r[s]),m.style=ra.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barSideStyle,e.barSideStyleByFields,e.barSideStyleByCodomain,s,r[s]),f.style=ra.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barTopStyle,e.barTopStyleByFields,e.barTopStyleByCodomain,s,r[s]),e.barSideHoverStyle=e.barSideHoverStyle?e.barSideHoverStyle:e.barFaceHoverStyle,e.barTopHoverStyle=e.barTopHoverStyle?e.barTopHoverStyle:e.barFaceHoverStyle,y.highlightStyle=ra.ShapeStyleTool({stroke:!0},e.barFaceHoverStyle),m.highlightStyle=ra.ShapeStyleTool({stroke:!0},e.barSideHoverStyle),f.highlightStyle=ra.ShapeStyleTool({stroke:!0},e.barTopHoverStyle),f.refDataID=m.refDataID=y.refDataID=this.data.id,f.isHoverByRefDataID=m.isHoverByRefDataID=y.isHoverByRefDataID=!0,f.refDataHoverGroup=m.refDataHoverGroup=y.refDataHoverGroup=ee.createUniqueID("lr_shg"),f.dataInfo=m.dataInfo=y.dataInfo={field:this.fields[s],value:r[s]},void 0!==e.barHoverAble&&(f.hoverable=m.hoverable=y.hoverable=e.barHoverAble),void 0!==e.barClickAble&&(f.clickable=m.clickable=y.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(m)),this.shapes.push(this.shapeFactory.createShape(f)),this.shapes.push(this.shapeFactory.createShape(y))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,i=this.setting,r=this.dataValues.length;if(r<1)return null;var s=[],n=0,a=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3==i.xShapeBlank.length){var o=a-((e=i.xShapeBlank)[0]+e[2]+(r-1)*e[1]);if(o<=r)return null;n=o/r}else e=[n=a/(2*r+1),n,n];for(var l=0,h=0;h<r;h++)0==h?l=e[0]+n/2:l+=n+e[1],s.push(t[0]+l);return{xPositions:s,width:n}}},e.Feature.Theme.Circle=class extends aa{constructor(e,t,i,r,s){super(e,t,i,r,s),this.CLASS_NAME="SuperMap.Feature.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){if(!this.setting)return!1;var e=this.setting;if(!e.codomain)return!1;var t=void 0===e.decimalNumber||isNaN(e.decimalNumber)?-1:e.decimalNumber,i=sa.getDataValues(this.data,this.fields,t);this.dataValues=i||[];var r=this.dataValues;e.maxR||(e.maxR=100),e.minR||(e.minR=0);var s=this.DVBCodomain;s&&s[1]-s[0]>0?this.DVBUnitValue=e.maxR/(s[1]-s[0]):this.DVBUnitValue=e.maxR;var n=this.DVBUnitValue,a=r[0]*n+e.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!s||!(r[0]<s[0]||r[0]>s[1]))){var o=this.DVBCenterPoint,l=new jn(o[0],o[1],a);l.style=ra.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?l.style.fillColor=e.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=ra.ShapeStyleTool(null,e.circleHoverStyle),void 0!==e.circleHoverAble&&(l.hoverable=e.circleHoverAble),void 0!==e.circleClickAble&&(l.clickable=e.circleClickAble),l.refDataID=this.data.id,l.dataInfo={field:this.fields[0],r:a,value:r[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}},e.Feature.Theme.Graph=na,e.Feature.Theme.Line=class extends na{constructor(e,t,i,r,s,n){super(e,t,i,r,s,n),this.CLASS_NAME="SuperMap.Feature.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var t=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var r=this.DVBUnitValue,s=this.dataValues;if(!(s.length<1)){var n=this.calculateXShapeInfo();if(n){var a,o,l=n.xPositions;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,t,e,n));for(var h=[],u=[],c=0,d=s.length;c<d;c++){if(s[c]<i[0]||s[c]>i[1])return null;a=l[c],o=t[1]-(s[c]-i[0])/r;var p=new Fn(a,o);p.style=ra.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,c,s[c]),p.highlightStyle=ra.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(p.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(p.clickable=e.pointClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[c],value:s[c]},u.push(this.shapeFactory.createShape(p));var f=[a,o];h.push(f)}var m=new kn(h);m.style=ra.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),m.clickable=!1,m.hoverable=!1;var y=this.shapeFactory.createShape(m);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,i=this.setting,r=this.dataValues.length;if(r<1)return null;var s=[],n=this.DVBWidth,a=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2==i.xShapeBlank.length){var o=n-((e=i.xShapeBlank)[0]+e[1]);if(o<=r)return null;a=o/(r-1)}else e=[a=n/(r+1),a,a];for(var l=0,h=0;h<r;h++)0==h?l=e[0]:l+=a,s.push(t[0]+l);return{xPositions:s,width:0}}},e.Feature.Theme.Pie=class extends na{constructor(e,t,i,r,s){super(e,t,i,r,s),this.CLASS_NAME="SuperMap.Feature.Theme.Pie"}destroy(){super.destroy()}assembleShapes(){var e=this.setting,t=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}];if(this.initBaseParameter()){e.useBackground&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,e));var i=this.dataValues;if(!(i.length<1)){var r=this.DVBCodomain;for(let e=0;e<i.length;e++)if(i[e]<r[0]||i[e]>r[1])return;var s=0;for(let e=0;e<i.length;e++)s+=Math.abs(i[e]);this.DVBUnitValue=360/s;for(var n=this.DVBUnitValue,a=this.DVBCenterPoint,o=0,l=0,h=o,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=0;c<i.length;c++){var d=Math.abs(i[c]);(l=0===c?o+d*n:c===d.length-1?h:o+d*n)-o>=360&&(l=359.9999999);var p=new Bn(a[0],a[1],u,o,l);if(void 0===e.sectorStyleByFields){var f=c%t.length;p.style=ra.ShapeStyleTool(null,e.sectorStyle,t,null,f)}else p.style=ra.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,c,i[c]);p.highlightStyle=ra.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(p.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(p.clickable=e.sectorClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[c],value:i[c]},this.shapes.push(this.shapeFactory.createShape(p)),o=l}this.shapesConvertToRelativeCoordinate()}}}},e.Feature.Theme.Point=class extends na{constructor(e,t,i,r,s,n){super(e,t,i,r,s,n),this.CLASS_NAME="SuperMap.Feature.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var t=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var r=this.DVBUnitValue,s=this.dataValues,n=this.calculateXShapeInfo();if(n){var a,o,l=n.xPositions;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,t,e,n));for(var h=0,u=s.length;h<u;h++){if(s[h]<i[0]||s[h]>i[1])return null;a=l[h],o=t[1]-(s[h]-i[0])/r;var c=new Fn(a,o);c.style=ra.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,s[h]),c.highlightStyle=ra.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(c.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(c.clickable=e.pointClickAble),c.refDataID=this.data.id,c.dataInfo={field:this.fields[h],value:s[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var e,t=this.dataViewBox,i=this.setting,r=this.dataValues.length;if(r<1)return null;var s=[],n=this.DVBWidth,a=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2==i.xShapeBlank.length){var o=n-((e=i.xShapeBlank)[0]+e[1]);if(o<=r)return null;a=o/(r-1)}else e=[a=n/(r+1),a,a];for(var l=0,h=0;h<r;h++)0==h?l=e[0]:l+=a,s.push(t[0]+l);return{xPositions:s,width:0}}},e.Feature.Theme.RankSymbol=aa,e.Feature.Theme.Ring=class extends na{constructor(e,t,i,r,s){super(e,t,i,r,s),this.CLASS_NAME="SuperMap.Feature.Theme.Ring"}destroy(){super.destroy()}assembleShapes(){if(this.initBaseParameter()){var e=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}],t=this.setting;t.useBackground&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,t));var i=this.dataValues;if(!(i.length<1)){var r=this.DVBCodomain;for(let e=0;e<i.length;e++)if(i[e]<r[0]||i[e]>r[1])return;var s=0;for(let e=0;e<i.length;e++)s+=Math.abs(i[e]);this.DVBUnitValue=360/s;for(var n=this.DVBUnitValue,a=this.DVBCenterPoint,o=0,l=0,h=o,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=t.innerRingRadius>=0&&t.innerRingRadius<u,d=void 0!==t.innerRingRadius&&!isNaN(t.innerRingRadius)&&c?t.innerRingRadius:0,p=0;p<i.length;p++){var f=Math.abs(i[p]);l=0===p?o+f*n:p===f.length-1?h:o+f*n;var m=new Bn(a[0],a[1],u,o,l,d);if(void 0===t.sectorStyleByFields){var y=p%e.length;m.style=ra.ShapeStyleTool(null,t.sectorStyle,e,null,y)}else m.style=ra.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,p,i[p]);m.highlightStyle=ra.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(m.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(m.clickable=t.sectorClickAble),m.refDataID=this.data.id,m.dataInfo={field:this.fields[p],value:i[p]},this.shapes.push(this.shapeFactory.createShape(m)),o=l}this.shapesConvertToRelativeCoordinate()}}}},e.Feature.Theme.ThemeVector=oa,e.Feature.ShapeParameters=In,e.Feature.ShapeParameters.Circle=jn,e.Feature.ShapeParameters.Image=Un,e.Feature.ShapeParameters.Label=Gn,e.Feature.ShapeParameters.Line=kn,e.Feature.ShapeParameters.Point=Fn,e.Feature.ShapeParameters.Polygon=Dn,e.Feature.ShapeParameters.Rectangle=Rn,e.Feature.ShapeParameters.Sector=Bn,e.Feature.ShapeFactory=ra,e.LevelRenderer=va,e.KeyServiceParameter=class{constructor(e){this.name=null,this.serviceIds=null,this.clientType=N.SERVER,this.limitation=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.KeyServiceParameter"}toJSON(){return{name:this.name,serviceIds:this.serviceIds,clientType:this.clientType,limitation:this.limitation}}},e.SecurityManager=je,e.ServerInfo=class{constructor(e,t){this.type=e,this.server=null,this.tokenServiceUrl=null,this.keyServiceUrl=null,ee.extend(this,t),this.CLASS_NAME="SuperMap.ServerInfo",this.type=this.type||r.ISERVER,this.server||console.error("server url require is not undefined");var i="/services/security/tokens";this.type===r.ISERVER&&this.server.indexOf("iserver")<0&&(i="/iserver"+i),this.tokenServiceUrl||(this.tokenServiceUrl=ee.urlPathAppend(this.server,i)),this.keyServiceUrl||(this.type===r.IPORTAL?this.keyServiceUrl=ee.urlPathAppend(this.server,"/web/mycontent/keys/register"):this.type===r.ONLINE&&(this.keyServiceUrl=ee.urlPathAppend(this.server,"/web/mycontent/keys")))}},e.TokenServiceParameter=class{constructor(e){this.userName=null,this.password=null,this.clientType=N.NONE,this.ip=null,this.referer=null,this.expiration=60,ee.extend(this,e),this.CLASS_NAME="SuperMap.TokenServiceParameter"}toJSON(){return{userName:this.userName,password:this.password,clientType:this.clientType,ip:this.ip,referer:this.referer,expiration:this.expiration}}},e.ThemeStyle=Nn,e.CartoCSS=On,e.ElasticSearch=class{constructor(e,t){t=t||{},this.url=e;try{this.client=new(Sn().Client)({host:this.url})}catch(e){this.client=new(Sn().Client)({node:{url:new URL(this.url)}})}this.change=null,this.openGeoFence=!1,this.outOfGeoFence=null,this.geoFence=null,this.EVENT_TYPES=["change","error","outOfGeoFence"],this.events=new be(this,null,this.EVENT_TYPES),this.eventListeners=null,ee.extend(this,t),this.eventListeners instanceof Object&&this.events.on(this.eventListeners)}setGeoFence(e){this.geoFence=e}bulk(e,t){return this.client.bulk(e,this._handleCallback(t))}clearScroll(e,t){return this.client.clearScroll(e,this._handleCallback(t))}count(e,t){return this.client.count(e,this._handleCallback(t))}create(e,t){return this.client.create(e,this._handleCallback(t))}delete(e,t){return this.client.delete(e,this._handleCallback(t))}deleteByQuery(e,t){return this.client.deleteByQuery(e,this._handleCallback(t))}deleteScript(e,t){return this.client.deleteScript(e,this._handleCallback(t))}deleteTemplate(e,t){return this.client.deleteTemplate(e,this._handleCallback(t))}exists(e,t){return this.client.exists(e,this._handleCallback(t))}existsSource(e,t){return this.client.existsSource(e,this._handleCallback(t))}explain(e,t){return this.client.explain(e,this._handleCallback(t))}fieldCaps(e,t){return this.client.fieldCaps(e,this._handleCallback(t))}get(e,t){return this.client.get(e,this._handleCallback(t))}getScript(e,t){return this.client.getScript(e,this._handleCallback(t))}getSource(e,t){return this.client.getSource(e,this._handleCallback(t))}getTemplate(e,t){return this.client.getTemplate(e,this._handleCallback(t))}index(e,t){return this.client.index(e,this._handleCallback(t))}info(e,t){return this.client.info(e,this._handleCallback(t))}mget(e,t){return this.client.mget(e,this._handleCallback(t))}msearch(e,t){let i=this;return i.client.msearch(e).then(function(e){return e=e.body||e,i._update(e.responses,t),e},function(e){return t(e),i.events.triggerEvent("error",{error:e}),e})}msearchTemplate(e,t){return this.client.msearchTemplate(e,this._handleCallback(t))}mtermvectors(e,t){return this.client.mtermvectors(e,this._handleCallback(t))}ping(e,t){return this.client.ping(e,this._handleCallback(t))}putScript(e,t){return this.client.putScript(e,this._handleCallback(t))}putTemplate(e,t){return this.client.putTemplate(e,this._handleCallback(t))}reindex(e,t){return this.client.reindex(e,this._handleCallback(t))}reindexRessrottle(e,t){return this.client.reindexRessrottle(e,this._handleCallback(t))}renderSearchTemplate(e,t){return this.client.renderSearchTemplate(e,this._handleCallback(t))}scroll(e,t){return this.client.scroll(e,this._handleCallback(t))}search(e,t){let i=this;return i.client.search(e).then(function(e){return e=e.body||e,i._update(e,t),e},function(e){return t&&t(e),i.events.triggerEvent("error",{error:e}),e})}searchShards(e,t){return this.client.searchShards(e,this._handleCallback(t))}searchTemplate(e,t){return this.client.searchTemplate(e,this._handleCallback(t))}suggest(e,t){return this.client.suggest(e,this._handleCallback(t))}termvectors(e,t){return this.client.termvectors(e,this._handleCallback(t))}update(e,t){return this.client.update(e,this._handleCallback(t))}updateByQuery(e,t){return this.client.updateByQuery(e,this._handleCallback(t))}_handleCallback(e){return function(){let t=Array.from(arguments);const i=t.shift();let r=t.shift();const s=r&&r.body;if(s){const{statusCode:e,headers:i}=r;t=[e,i],r=s}e.call(this,i,r,...t)}}_update(e,t){let i=this;e&&(i.data=e,i.openGeoFence&&i.geoFence&&i._validateDatas(e),i.events.triggerEvent("change",{data:i.data}),i.change?i.change&&i.change(e):t&&t(void 0,{responses:e}))}_validateDatas(e){if(e){e instanceof Array||(e=[e]);var t,i=e.length;for(t=0;t<i;t++)this._validateData(e[t])}}_validateData(e){let t=this;e.hits.hits.map(function(i){let r=i._source,s=t._getMeterPerMapUnit(t.geoFence.unit),n=t.geoFence.center[0]*s,a=t.geoFence.center[1]*s,o=r.x*s,l=r.y*s;return t._distance(o,l,n,a)>t.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),i})}_distance(e,t,i,r){return Math.sqrt((e-i)*(e-i)+(t-r)*(t-r))}_getMeterPerMapUnit(e){let t;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}},e.ArrayStatistic=class{static newInstance(){return this.geostatsInstance||(this.geostatsInstance=new window.geostats),this.geostatsInstance}static getInstance(e){let t=this.newInstance();return t.setSerie(e),t}static getArrayStatistic(e,t){return e.length?"Sum"===t||"求和"===t?this.getSum(e):"Maximum"===t||"最大值"===t?this.getMax(e):"Minimum"===t||"最小值"===t?this.getMin(e):"Average"===t||"平均值"===t?this.getMean(e):"Median"===t||"中位数"===t?this.getMedian(e):"times"===t||"计数"===t?this.getTimes(e):void 0:0}static getArraySegments(e,t,i){return"offset"===t?this.getEqInterval(e,i):"jenks"===t?this.getJenks(e,i):"square"===t?this.getMin(e)>=0&&this.getSqrtInterval(e,i):"logarithm"===t?this.getMin(e)>0&&this.getGeometricProgression(e,i):void 0}static getSum(e){return this.getInstance(e).sum()}static getMax(e){return this.getInstance(e).max()}static getMin(e){return this.getInstance(e).min()}static getMean(e){return this.getInstance(e).mean()}static getMedian(e){return this.getInstance(e).median()}static getTimes(e){return e.length}static getEqInterval(e,t){return this.getInstance(e).getClassEqInterval(t)}static getJenks(e,t){return this.getInstance(e).getClassJenks(t)}static getSqrtInterval(e,t){return e=e.map(function(e){return Math.sqrt(e)}),this.getInstance(e).getClassEqInterval(t).map(function(e){return e*e})}static getGeometricProgression(e,t){return this.getInstance(e).getClassGeometricProgression(t)}},e.ColorsPickerUtil=class{static createCanvas(e,t){var i=document.createElement("canvas");return i.height=e,i.width=t,i.getContext("2d")}static getLinearGradient(e,t,i,r,s){this._ctx||(this._ctx=this.getContext());for(var n=this._ctx.createLinearGradient(e,t,i,r),a=s.length,o=1/(a-1),l=0,h=0;h<a;h++)n.addColorStop(l,s[h]),l+=o;return n.__nonRecursion=!0,n}static getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}static getStepColors(e,t,i){e=Cn.toRGBA(e),t=Cn.toRGBA(t),e=Cn.getData(e);for(var r=[],s=((t=Cn.getData(t))[0]-e[0])/i,n=(t[1]-e[1])/i,a=(t[2]-e[2])/i,o=(t[3]-e[3])/i,l=0,h=e[0],u=e[1],c=e[2],d=e[3];l<i;l++)r[l]=Cn.toColor([Cn.adjust(Math.floor(h),[0,255]),Cn.adjust(Math.floor(u),[0,255]),Cn.adjust(Math.floor(c),[0,255]),d.toFixed(4)-0],"hex"),h+=s,u+=n,c+=a,d+=o;return h=t[0],u=t[1],c=t[2],d=t[3],r[l]=Cn.toColor([h,u,c,d],"hex"),r}static getGradientColors(e,t,i){var r,s,n,a=[],o=e.length;if(void 0!==t){if(o>=t)if("RANGE"===i)for(s=0;s<t;s++)a.push(e[s]);else for(s=0;s<t;s++){let t=Math.floor(s/2);if(s%2==0)a.push(e[t]);else{let i=e.length-1-t;a.push(e[i])}}else{for(r=Math.ceil(t/(o-1)),s=0,n=o-1;s<n;s++){var l=this.getStepColors(e[s],e[s+1],r);s<n-1&&l.pop(),a=a.concat(l)}for(var h=a.length-t,u=0;u<h;u++)a.splice(2,1)}return a}}},e.DataFormat=t,e.ServerType=r,e.GeometryType=s,e.QueryOption=n,e.JoinType={INNERJOIN:"INNERJOIN",LEFTJOIN:"LEFTJOIN"},e.SpatialQueryMode=a,e.SpatialRelationType={CONTAIN:"CONTAIN",INTERSECT:"INTERSECT",WITHIN:"WITHIN"},e.MeasureMode=o,e.Unit=l,e.BufferRadiusUnit=h,e.EngineType={IMAGEPLUGINS:"IMAGEPLUGINS",OGC:"OGC",ORACLEPLUS:"ORACLEPLUS",SDBPLUS:"SDBPLUS",SQLPLUS:"SQLPLUS",UDB:"UDB"},e.ThemeGraphTextFormat=u,e.ThemeGraphType=c,e.GraphAxesTextDisplayMode=d,e.GraduatedMode=p,e.RangeMode=f,e.ThemeType={DOTDENSITY:"DOTDENSITY",GRADUATEDSYMBOL:"GRADUATEDSYMBOL",GRAPH:"GRAPH",LABEL:"LABEL",RANGE:"RANGE",UNIQUE:"UNIQUE"},e.ColorGradientType=m,e.TextAlignment=y,e.FillGradientMode={NONE:"NONE",LINEAR:"LINEAR",RADIAL:"RADIAL",CONICAL:"CONICAL",SQUARE:"SQUARE"},e.AlongLineDirection=g,e.LabelBackShape=v,e.LabelOverLengthMode=b,e.DirectionType={EAST:"EAST",NONE:"NONE",NORTH:"NORTH",SOURTH:"SOURTH",WEST:"WEST"},e.OverlayOperationType=S,e.OutputType=x,e.SideType={LEFT:"LEFT",MIDDLE:"MIDDLE",NONE:"NONE",RIGHT:"RIGHT"},e.SupplyCenterType={FIXEDCENTER:"FIXEDCENTER",NULL:"NULL",OPTIONALCENTER:"OPTIONALCENTER"},e.TurnType={AHEAD:"AHEAD",BACK:"BACK",END:"END",LEFT:"LEFT",NONE:"NONE",RIGHT:"RIGHT"},e.BufferEndType=_,e.SmoothMethod=w,e.SurfaceAnalystMethod=C,e.DataReturnMode=M,e.EditType=A,e.TransferTactic=T,e.TransferPreference=E,e.GridType={CROSS:"CROSS",GRID:"GRID",POINT:"POINT"},e.ColorSpaceType={CMYK:"CMYK",RGB:"RGB"},e.LayerType={UGC:"UGC",WMS:"WMS",WFS:"WFS",CUSTOM:"CUSTOM"},e.UGCLayerType={THEME:"THEME",VECTOR:"VECTOR",GRID:"GRID",IMAGE:"IMAGE"},e.StatisticMode={AVERAGE:"AVERAGE",MAX:"MAX",MIN:"MIN",STDDEVIATION:"STDDEVIATION",SUM:"SUM",VARIANCE:"VARIANCE"},e.PixelFormat={BIT16:"BIT16",BIT32:"BIT32",BIT64:"BIT64",SINGLE:"SINGLE",DOUBLE:"DOUBLE",UBIT1:"UBIT1",UBIT4:"UBIT4",UBIT8:"UBIT8",UBIT24:"UBIT24",UBIT32:"UBIT32"},e.SearchMode={KDTREE_FIXED_COUNT:"KDTREE_FIXED_COUNT",KDTREE_FIXED_RADIUS:"KDTREE_FIXED_RADIUS",NONE:"NONE",QUADTREE:"QUADTREE"},e.InterpolationAlgorithmType={KRIGING:"KRIGING",SimpleKriging:"SimpleKriging",UniversalKriging:"UniversalKriging"},e.VariogramMode=O,e.Exponent=P,e.ClientType=N,e.ChartType={BAR:"Bar",BAR3D:"Bar3D",CIRCLE:"Circle",PIE:"Pie",POINT:"Point",LINE:"Line",RING:"Ring"},e.ClipAnalystMode=I,e.AnalystAreaUnit=F,e.AnalystSizeUnit=k,e.StatisticAnalystMode=D,e.SummaryType=R,e.TopologyValidatorRule=B,e.BucketAggType=G,e.MetricsAggType=U,e.GetFeatureMode={BOUNDS:"BOUNDS",BUFFER:"BUFFER",ID:"ID",SPATIAL:"SPATIAL",SQL:"SQL"},e.RasterFunctionType=j,e.ResourceType={MAP:"MAP",SERVICE:"SERVICE",SCENE:"SCENE",DATA:"DATA",INSIGHTS_WORKSPACE:"INSIGHTS_WORKSPACE",MAP_DASHBOARD:"MAP_DASHBOARD"},e.OrderBy={UPDATETIME:"UPDATETIME",HEATLEVEL:"HEATLEVEL",RELEVANCE:"RELEVANCE"},e.OrderType={ASC:"ASC",DESC:"DESC"},e.SearchType={PUBLIC:"PUBLIC",MY_RES:"MY_RES",MYGROUP_RES:"MYGROUP_RES",MYDEPARTMENT_RES:"MYDEPARTMENT_RES",SHARETOME_RES:"SHARETOME_RES"},e.AggregationTypes={TAG:"TAG",TYPE:"TYPE"},e.PermissionType={SEARCH:"SEARCH",READ:"READ",READWRITE:"READWRITE",DELETE:"DELETE",DOWNLOAD:"DOWNLOAD"},e.EntityType={DEPARTMENT:"DEPARTMENT",GROUP:"GROUP",IPORTALGROUP:"IPORTALGROUP",ROLE:"ROLE",USER:"USER"},e.WebExportFormatType={PNG:"PNG",PDF:"PDF"},e.WebScaleOrientationType={HORIZONTALLABELSBELOW:"HORIZONTALLABELSBELOW",HORIZONTALLABELSABOVE:"HORIZONTALLABELSABOVE",VERTICALLABELSLEFT:"VERTICALLABELSLEFT",VERTICALLABELSRIGHT:"VERTICALLABELSRIGHT"},e.WebScaleType={LINE:"LINE",BAR:"BAR",BAR_SUB:"BAR_SUB"},e.WebScaleUnit={METER:"METER",FOOT:"FOOT",DEGREES:"DEGREES"},e.KnowledgeGraph=so;const no=L;var ao=i.n(no),oo=i(785),lo=i.n(oo);window.proj4=lo(),window.Proj4js=lo(),ao().Proj=ao().Proj||{},ao().Proj._isProj4Obj=function(e){return void 0!==e.inverse&&void 0!==e.forward},ao().Proj.Projection=ao().Class.extend({initialize:function(e,t,i,r){var s=ao().Proj._isProj4Obj(e);this._proj=s?e:this._projFromCodeDef(e,t);var n=i;ao().Util.isArray(i)&&(n=ao().bounds(i)),this.bounds=s?t:n,this.wrapLng=r},project:function(e){var t=this._proj.forward([e.lng,e.lat]);return new(ao().Point)(t[0],t[1])},unproject:function(e,t){this.bounds&&!this.wrapLng&&(e.x=e.x<this.bounds.min.x?this.bounds.min.x:e.x>this.bounds.max.x?this.bounds.max.x:e.x,e.y=e.y<this.bounds.min.y?this.bounds.min.y:e.y>this.bounds.max.y?this.bounds.max.y:e.y);var i=this._proj.inverse([e.x,e.y]);return new(ao().LatLng)(i[1],i[0],t)},_projFromCodeDef:function(e,t){if(t)lo().defs(e,t);else if(void 0===lo().defs[e]){var i=e.split(":");if(i.length>3&&(e=i[i.length-3]+":"+i[i.length-1]),void 0===lo().defs[e])throw"No projection definition for code "+e}return lo()(e)},getUnits:function(){return this._proj.oProj.units||"degrees"}});var ho=ao().Class.extend({includes:ao().CRS,options:{transformation:new(ao().Transformation)(1,0,-1,0)},initialize:function(e,t){var i,r,s;if(t.bounds&&4===t.bounds.length){const[e,i,r,s]=t.bounds;t.bounds=[[e,i],[r,s]]}if(ao().Proj._isProj4Obj(e)?(i=(r=e).srsCode,t=t||{},this.projection=new(ao().Proj.Projection)(r,t.bounds,t.wrapLng)):(i=e,s=(t=t||{}).def||"",this.projection=new(ao().Proj.Projection)(i,s,t.bounds,t.wrapLng)),ao().Util.setOptions(this,t),this.options.wrapLng&&(this.wrapLng=this.options.wrapLng),this.code=i,this.transformation=this.options.transformation,this.options.dpi=this.options.dpi||96,this.options.bounds&&(this.options.bounds=ao().bounds(this.options.bounds)),!this.options.origin&&this.options.bounds&&(this.options.origin=[this.options.bounds.min.x,this.options.bounds.max.y]),this.options.origin&&(this.options.origin instanceof ao().Point&&(this.options.origin=[this.options.origin.x,this.options.origin.y]),this.transformation=new(ao().Transformation)(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales&&this.options.scales.length>0)this.scales=this.options.scales,this._scales=this._toProj4Scales(this.options.scales,this.options.dpi);else if(this.options.scaleDenominators&&this.options.scaleDenominators.length>0){this.scales=[];for(let e=0;e<this.options.scaleDenominators.length;e++)this.scales[e]=1/this.options.scaleDenominators[e];this._scales=this._toProj4Scales(this.scales,this.options.dpi)}else if(this.options.resolutions&&this.options.resolutions.length>0){this._scales=[];for(let e=this.options.resolutions.length-1;e>=0;e--)this.options.resolutions[e]&&(this._scales[e]=1/this.options.resolutions[e])}else this.options.bounds&&(this._scales=this._getDefaultProj4ScalesByBounds(this.options.bounds));this._rectify(),this.infinite=!this.options.bounds},_rectify:function(){if(this._scales&&(this.resolutions||(this.resolutions=[],this.resolutions=this._proj4ScalesToResolutions(this._scales)),!this.scales)){this.scales=[];for(let t=0;t<this.resolutions.length;t++){var e=this.resolutions[t]*this.options.dpi*(1/.0254)*this._getMeterPerMapUnit(this.projection.getUnits());this.scales[t]=1/e}}},scale:function(e){var t,i=Math.floor(e);return e===i?this._scales[e]:(t=this._scales[i])+(this._scales[i+1]-t)*(e-i)},zoom:function(e){var t,i,r=this._closestElement(this._scales,e),s=this._scales.indexOf(r);return r?e===r?s:(i=s+1,void 0===(t=this._scales[i])?s:(e-r)/(t-r)+s):0},distance:ao().CRS.Earth.distance,R:ao().CRS.Earth.R,_closestElement:function(e,t){for(var i,r=e.length;r--;)e[r]<=t&&(void 0===i||i<e[r])&&(i=e[r]);return i},_proj4ScalesToResolutions(e){var t=[];if(!e)return t;for(var i=0;i<e.length;i++)t[i]=1/e[i];return t},_toProj4Scales:function(e,t){var i=[];if(!e)return i;for(var r=0;r<e.length;r++){var s=this.projection?this._getMeterPerMapUnit(this.projection.getUnits()):1;i[r]=1/(.0254/((t||96)*e[r])/s)}return i},_getMeterPerMapUnit:function(e){var t=1;return"meter"===e?t=1:"degrees"===e||"degree"===e?t=2*Math.PI*6378137/360:"kilometer"===e?t=.001:"inch"===e?t=1/.025399999918:"feet"===e&&(t=.3048),t},_getDefaultProj4ScalesByBounds:function(e){if(!e)return[];for(var t=e.getSize(),i=Math.max(t.x,t.y)/256,r=[],s=0;s<23;s++)r[s]=Math.pow(2,s)/i;return r}}),uo=function(e,t){return new ho(e,t)};const co={Prefix:"Leaflet with <span>© <a href='https://iclient.supermap.io' title='SuperMap iClient' target='_blank'>SuperMap iClient</a></span>",Common:{attribution:"Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>"},Online:{attribution:"Map Data <span>© <a href='https://www.supermapol.com' title='SuperMap Online' target='_blank'>SuperMap Online</a></span>"},ECharts:{attribution:"© 2018 百度 ECharts"},MapV:{attribution:"© 2018 百度 MapV "},Turf:{attribution:"<span>© <a href='https://turfjs.org/' title='turfjs' target='_blank'>turfjs</a></span>"},Baidu:{attribution:"Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方"},Cloud:{attribution:"Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo"},Tianditu:{attribution:"Map Data <a href='https://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='https://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a>"}};ao().Control.Attribution.include({options:{position:"bottomright",prefix:co.Prefix}}),ao().Map.include({latLngToAccurateContainerPoint:function(e){var t=this.project(ao().latLng(e))._subtract(this.getPixelOrigin());return ao().point(t).add(this._getMapPanePos())}}),function(e){e.map(e=>(e.defaultFunction=e.prototype.toGeoJSON,e.include({toGeoJSON:function(t){return e.defaultFunction.call(this,t||10)}}),e))}([ao().Polyline,ao().Polygon,ao().Marker,ao().CircleMarker,ao().Circle,ao().LayerGroup]);var po=ao().Evented.extend({options:{url:null,proxy:null,withCredentials:!1,crossOrigin:null},initialize:function(e,t){e&&(e=e.indexOf("/")!==e.length-1?e:e.substr(0,e.length-1)),this.url=e,ao().setOptions(this,t),this.fire("initialized",this)},destroy:function(){this.fire("destroy",this)}}),fo=po.extend({options:{projection:null},initialize:function(e,t){t=t||{},ao().setOptions(this,t),t.projection&&(this.options.projection=t.projection),po.prototype.initialize.call(this,e,t)},getMapInfo:function(e){var t=this;new Fr(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection}).processAsync(e)},getWkt(e){var t=this;new Fr(`${t.url}/prjCoordSys.wkt`,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,withoutFormatSuffix:!0,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection}).processAsync(e)},getTilesets:function(e){var t=this;new Ns(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).processAsync()}}),mo=ao().Control.extend({options:{layer:null,position:"topleft",title:"switch tile version",tooltip:"top",collapsed:!0,nextText:"+",lastText:"-",ico:"V",orientation:"horizontal",switch:!0},onAdd:function(){"vertical"!==this.options.orientation&&(this.options.orientation="horizontal");var e=this._initLayout();return this.options.layer&&this.setLayer(this.options.layer),e},setContent:function(e){var t=ao().Util.extend({},e);this.setVersionName(t.desc).setToolTip(t.desc)},setVersionName:function(e){var t=e;return e||(t=this.getValue()),this._sliderValue.innerHTML=t,this},setToolTip:function(e){return this.tooltip.innerHTML=e,this},updateLength:function(e){e>0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))},setLayer:function(e){e&&(this.options.layer=e);var t=this,i=t.options.layer;i.on("tilesetsinfoloaded",function(e){var i=e&&e.tileVersions;t.update(i)}),i.on("tileversionschanged",function(e){var i=e&&e.tileVersion;t.setContent(i)}),t.getTileSetsInfo()},update:function(e){this.tileVersions=e||[],this.updateLength(this.tileVersions.length)},getTileSetsInfo:function(){var e=this;e.options.layer&&new fo(e.options.layer._url).getTilesets(function(t){e.options.layer.setTileSetsInfo(t.result)})},removeLayer:function(){this.options.layer=null},nextTilesVersion:function(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)},lastTilesVersion:function(){return parseInt(this.slider.value)<this.min+1?this:(this.slider.value=parseInt(this.slider.value)-1,this.options.layer.lastTilesVersion(),this)},tilesVersion:function(e){for(var t=this.options.layer,i=this.tileVersions,r=i.length,s=0;s<r;s++)if(i[s].name==e){t.updateCurrentTileSetsIndex(s),t.changeTilesVersion();break}},getValue:function(){return this.slider.value},getVersion:function(){var e=this.tileVersions[this.getValue()];return e&&e.name},_initLayout:function(){var e="leaflet-control-ctv";this._container=ao().DomUtil.create("div",e+" "+e+"-"+this.options.orientation),this._sliderBtn=ao().DomUtil.create("a",e+"-toggle",this._container),this._sliderBtn.setAttribute("title",this.options.title),this._sliderBtn.innerHTML=this.options.ico,this._sliderValue=ao().DomUtil.create("p",e+"-value",this._container),this._sliderValue.innerHTML=this.options.ico;return this._sliderContent=ao().DomUtil.create("div","leaflet-ctv-slider-main tooltip",this._container),this.tooltip=ao().DomUtil.create("span","tooltip-text tooltip-"+this.options.tooltip,this._sliderContent),this.tooltip.innerHTML=this.options.ico,this.options.switch&&(this._next=ao().DomUtil.create("a","leaflet-ctv-slider-incdec leaflet-ctv-slider-next",this._sliderContent),this._next.innerHTML=this.options.nextText,ao().DomEvent.on(this._next,"click",this.nextTilesVersion,this),ao().DomUtil.addClass(this._container,e+"-incdec")),this._sliderContainer=ao().DomUtil.create("div","leaflet-ctv-slider-container",this._sliderContent),this.slider=ao().DomUtil.create("input","leaflet-ctv-slider",this._sliderContainer),this.min=null==this.min||isNaN(this.min)?0:parseInt(this.min),this.slider.setAttribute("title",this.options.title),this.slider.setAttribute("id","slider"),this.slider.setAttribute("type","range"),this.slider.setAttribute("min",this.min),this.slider.setAttribute("max",0),this.slider.setAttribute("step",1),this.slider.setAttribute("value",0),this.firstLoad=!0,"oninput"in this.slider||"onchange"in this.slider?ao().DomEvent.on(this.slider,"change",this._tilesVersion,this):this.slider.onpropertychange=this._tilesVersion,this.options.switch&&(this._last=ao().DomUtil.create("a","leaflet-ctv-slider-incdec leaflet-ctv-slider-last",this._sliderContent),this._last.innerHTML=this.options.lastText,ao().DomEvent.on(this._last,"click",this.lastTilesVersion,this)),"vertical"===this.options.orientation?(this.slider.style.width="170px",this._sliderContainer.style.height="170px"):this._sliderContainer.style.width="150px",ao().DomEvent.disableClickPropagation(this._container),this.options.collapsed?(ao().Browser.android||ao().DomEvent.on(this._container,"mouseenter",this._expand,this).on(this._container,"mouseleave",this._collapse,this),ao().Browser.touch?ao().DomEvent.on(this._sliderBtn,"click",ao().DomEvent.stop).on(this._sliderBtn,"click",this._expand,this):ao().DomEvent.on(this._sliderBtn,"focus",this._expand,this)):this._expand(),this._container},_expand:function(){ao().DomUtil.addClass(this._container,"leaflet-control-ctv-expanded")},_collapse:function(){ao().DomUtil.removeClass(this._container,"leaflet-control-ctv-expanded")},_tilesVersion:function(){var e=this.getVersion();this.tilesVersion(e)}});ao().Map.mergeOptions({changeTileVersionControl:!1}),ao().Map.addInitHook(function(){this.options.changeTileVersionControl&&(this.changeTileVersionControl=new mo,this.addControl(this.changeTileVersionControl))});var yo=ao().Control.extend({options:{position:"bottomright",imageUrl:null,link:null,width:null,height:null,alt:"SuperMap iClient"},onAdd:function(){var e=ao().DomUtil.create("div","iclient-leaflet-logo");e.style.marginTop=0,e.style.marginBottom=0,e.style.marginLeft=0,e.style.marginRight=0;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII=";this.options.imageUrl&&(t=this.options.imageUrl);var i=this.options.alt,r="94px",s="29px",n="width:"+r+";height:"+s+";";this.options.imageUrl&&(n="width:"+(r=this.options.width)+";height:"+(s=this.options.height)+";",r&&s||(n=""));var a=this.options.link;return e.innerHTML="<a href='"+a+"' target='_blank' style='border: none;display: block;'><img src="+t+" alt='"+i+"' style='border: none;"+n+"margin-right:5px;margin-bottom:2px;white-space: nowrap'></a>",e}});ao().Map.mergeOptions({logoControl:!0}),ao().Map.addInitHook(function(){!this._logoAdded&&this.options.logoControl&&(!0===this.options.logoControl?this.logoControl=new yo:this.options.logoControl instanceof ao().Control&&(this.logoControl=this.options.logoControl),this.logoControl&&(this.addControl(this.logoControl),this._logoAdded=!0))});const go=function(e){return"[object Array]"==Object.prototype.toString.call(e)},vo={toSuperMapBounds:e=>(e&&-1!==["FeatureCollection","Feature"].indexOf(e.type)&&(e=ao().geoJSON(e).getBounds()),e instanceof ao().LatLngBounds?new se(e.getSouthWest().lng,e.getSouthWest().lat,e.getNorthEast().lng,e.getNorthEast().lat):e instanceof ao().Bounds?new se(e.min.x,e.min.y,e.max.x,e.max.y):go(e)?new se(e[0],e[1],e[2],e[3]):new se),isArray:go,toProcessingParam(e){var t={};if(e.length<1)t="";else{for(var i=[],r=0;r<e.length;r++){var s={};s.x=e[r][0],s.y=e[r][1],i.push(s)}t.type="REGION",t.points=i}return t}};var bo=ao().extend({},ao().CRS.EPSG3857,{code:"Baidu",scale:function(e){return 6378137*Math.PI*2/Math.pow(2,18-e)},transformation:function(){var e=.5/(6378137*Math.PI);return new(ao().Transformation)(e,0,-e,0)}()}),_o=[];for(let e=1;e<19;e++)_o.push(1.40625/Math.pow(2,e));var So=uo("EPSG:4326",{origin:[-180,90],resolutions:_o,bounds:ao().bounds([-180,-90],[180,90]),wrapLng:[-180,180]});const xo=2*Math.PI*6378137,wo=xo/2;var Co=[];for(let e=1;e<19;e++)Co.push(xo/256/Math.pow(2,e));var Mo=uo("EPSG:3857",{origin:[-wo,wo],resolutions:Co,bounds:ao().bounds([-wo,-wo],[wo,wo]),wrapLng:[-180,180]}),Ao=ao().Class.extend({initialize:function(e){this.bounds=e},project:function(e){return new(ao().Point)(e.lng,e.lat)},unproject:function(e){return new(ao().LatLng)(e.y,e.x)}}),To=function(e){return new Ao(e)},Eo=ao().Class.extend({includes:ao().CRS,initialize:function(e){e.origin&&(this.transformation=new(ao().Transformation)(1,-e.origin.x,-1,e.origin.y)),this.projection=To(e.bounds),this.bounds=e.bounds,this.origin=e.origin,this.resolutions=e.resolutions},scale:function(e){let t;if(!this.resolutions||0===this.resolutions.length){return(t=1/(Math.max(this.bounds.getSize().x,this.bounds.getSize().y)/256))*Math.pow(2,e)}return this.resolutions[e]?1/this.resolutions[e]:1/this.resolutions[0]*Math.pow(2,e)},zoom:function(e){let t;if(!this.resolutions||0===this.resolutions.length){return t=1/(Math.max(this.bounds.getSize().x,this.bounds.getSize().y)/256),Math.log(e/t)/Math.LN2}const i=this.resolutions.indexOf(1/e);return i>-1?i:Math.log(e/(1/this.resolutions[0]))/Math.LN2},distance:function(e,t){var i=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(i*i+r*r)},infinite:!1}),Lo=function(e){return new Eo(e)},Oo=function(e){return e?(new Oe).toGeoJSON(e):e},Po=function(e){if(!e)return e;var t,i=new Oe;if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(e.type))t=i.read(e,e.type);else if("function"==typeof e.toGeoJSON){var r=e.toGeoJSON();t=r?i.read(r,r.type):e}var s=t||e;return ao().Util.isArray(t)&&(1===t.length?s=t[0]:t.length>1&&(s=[],t.map(function(e){return s.push(e.geometry),e}))),s&&s.geometry?s.geometry:s},No=Mn,Io=function(e,t,i){var r=e*t*(1/.0254)*No(i);return r=1/r},Fo=function(e,t,i){var r=e*t*(1/.0254)*No(i);return r=1/r},ko=function(e){return e>1?1/e:e},Do=function(e,t,i,r){return r=r||6378137,i=i||"",e>0&&t>0?(e=ko(e),"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4):-1},Ro=function(e,t=ao().CRS.EPSG4326,i){let r=null,s=null;if(-1===["FeatureCollection","Feature","Geometry"].indexOf(e.type))if(e.toGeoJSON)e=e.toGeoJSON();else if(e instanceof ao().LatLngBounds)e=ao().rectangle(e).toGeoJSON();else{if(!(e instanceof ao().Bounds))throw new Error("This tool only supports data conversion in geojson format or Vector Layers of Leaflet.");e=ao().rectangle([[e.getTopLeft().x,e.getTopLeft().y],[e.getBottomRight().x,e.getBottomRight().y]]).toGeoJSON()}const n={point:function(e){return s(e)},multipoint:function(e){return n.linestring.apply(this,[e])},linestring:function(e){let t=[],i=null;for(let r=0,s=e.length;r<s;++r){try{i=n.point.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return t},multilinestring:function(e){return n.polygon.apply(this,[e])},polygon:function(e){let t,i=[];for(let r=0,s=e.length;r<s;++r){try{t=n.linestring.apply(this,[e[r]])}catch(e){throw e}i.push(t)}return i},multipolygon:function(e){let t=[],i=null;for(let r=0,s=e.length;r<s;++r){try{i=n.polygon.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return t}};return function(e,t){if(r=e,s=t,"Feature"===e.type)r=a(e);else if("FeatureCollection"===e.type){let t=[];for(let i=0;i<e.features.length;++i)try{t.push(a(e.features[i]))}catch(e){t=null}r.features=t}return r}(e,function(e){var r=t.unproject({x:e[0],y:e[1]});const s=i.project(r);return[s.x,s.y]});function a(e){const t=e.geometry;if(!ee.isArray(t.coordinates))throw"Geometry must have coordinates array: "+t;if(!n[t.type.toLowerCase()])throw"Unsupported geometry type: "+t.type;try{t.coordinates=n[t.type.toLowerCase()].apply(this,[t.coordinates])}catch(e){throw e}return e.geometry=t,e}},Bo=ao().TileLayer.extend({url:"http://online{num}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20150815&scaler=1",options:{minZoom:3,maxZoom:19,bounds:ao().latLngBounds(ao().latLng(-85.0511287798,-180),ao().latLng(85.0511287798,180)),retina:ao().Browser.retina,attribution:co.Baidu.attribution},initialize:function(e,t){e&&(this.url=e),ao().setOptions(this,t),this.options.retina&&(this.options.maxZoom=18),ao().stamp(this)},getTileUrl:function(e){var t=ao().Util.template(this.url,{num:Math.abs((e.x+e.y)%8)+1,x:e.x,y:-e.y-1,z:this._getZoomForUrl(),styles:this.options.retina?"ph":"pl"});return this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),t}}),Go=function(e,t){return new Bo(e,t)},Uo=ao().TileLayer.extend({defaultURL:"http://t2.dituhui.com/FileService/image",options:{mapName:"quanguo",type:"web",minZoom:3,maxZoom:18,attribution:co.Cloud.attribution},initialize:function(e,t){ao().setOptions(this,t);var i=e||this.defaultURL;this._url=i+"?map="+this.options.mapName+"&type="+this.options.type,ao().stamp(this)},getTileUrl:function(e){var t=this._url+"&x="+e.x+"&y="+e.y+"&z="+e.z;return this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),t}}),jo=function(e,t){return new Uo(e,t)},zo=no.Layer.extend({options:{layersID:null,redirect:!1,transparent:!0,cacheEnabled:!0,clipRegionEnabled:!1,clipRegion:null,prjCoordSys:null,overlapDisplayed:!1,overlapDisplayedOptions:null,opacity:1,alt:"",pane:"tilePane",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",attribution:co.Common.attribution,updateInterval:150,tileProxy:null,format:"png"},initialize:function(e,t){this._url=e,no.Util.setOptions(this,t)},onAdd:function(e){this.update=no.Util.throttle(this.update,this.options.updateInterval,this),e.on("moveend",this.update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?e.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this.update()},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage),this._map.off("moveend",this.update,this)},bringToFront:function(){return this.options.position="front",this._currentImage&&this._currentImage.bringToFront(),this},bringToBack:function(){return this.options.position="back",this._currentImage&&this._currentImage.bringToBack(),this},getOpacity:function(){return this.options.opacity},setOpacity:function(e){return this.options.opacity=e,this._currentImage&&this._currentImage.setOpacity(e),this},getImageUrl:function(e){let t=ee.urlPathAppend(this._url,`image.${this.options.format}`),i=t+no.Util.getParamString(Object.assign({},this._initAllRequestParams(),e),t);return i=je.appendCredential(i),this.options.tileProxy&&(i=this.options.tileProxy+encodeURIComponent(i)),this.options.cacheEnabled||(i+="&_t="+(new Date).getTime()),i},_getImageParams:function(e){var t=this._calculateImageSize(e);return{viewBounds:this._compriseBounds(this._calculateBounds(e)),width:t.x,height:t.y}},_initAllRequestParams:function(){var e=this.options||{},t={},i=!0===e.redirect&&e.redirect;t.redirect=i;var r=!0===e.transparent&&e.transparent;t.transparent=r;var s=!1!==e.cacheEnabled||e.cacheEnabled;return t.cacheEnabled=s,e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(t.layersID=e.layersID),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),e.clipRegionEnabled&&e.clipRegion&&(t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(Le.fromGeometry(Po(e.clipRegion)))),!1===e.overlapDisplayed?(t.overlapDisplayed=!1,e.overlapDisplayedOptions&&(t.overlapDisplayedOptions=this.overlapDisplayedOptions.toString())):t.overlapDisplayed=!0,t},_requestImage:function(e,t){var i=this.getImageUrl(e);this._loadImage(i,t)},_loadImage:function(e,t){if(this._map){var i=new no.ImageOverlay(e,t,{opacity:0,alt:this.options.alt,zIndex:this.options.zIndex,className:this.options.className,errorOverlayUrl:this.options.error,crossOrigin:this.options.crossOrigin,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),r=function(e){i.off("error",s,this);var r=this._map;if(r){var n=e.target,a=this._currentImage;n._bounds&&n._bounds.equals(t)&&n._bounds.equals(r.getBounds())?(this._currentImage=n,"front"===this.options.position&&this.bringToFront(),"back"===this.options.position&&this.bringToBack(),this._currentImage._map&&this._currentImage.setOpacity(this.options.opacity),a&&r.removeLayer(a),a&&a._map&&a._map.removeLayer(a)):r.removeLayer(n),this.fire("load",{bounds:t})}},s=function(){this._map.removeLayer(i),this.fire("error"),i.off("load",r,this)};i.once("load",r,this),i.once("error",s,this),this.fire("loading",{bounds:t})}},update:function(){if(this._map){var e=this._map.getZoom(),t=this._map.getBounds();if(e>(this._map.options.maxZoom||18)||e<(this._map.options.minZoom||0))this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null);else{var i=this._getImageParams(t);i?this._requestImage(i,t):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_calculateBounds:function(e){var t=this._map.options.crs.project(e.getNorthEast()),i=this._map.options.crs.project(e.getSouthWest());return ao().bounds(t,i)},_compriseBounds:function(e){var t={leftBottom:{x:e.getBottomLeft().x,y:e.getTopRight().y},rightTop:{x:e.getTopRight().x,y:e.getBottomLeft().y}};return JSON.stringify(t)},_calculateImageSize:function(e){return new(ao().Bounds)(this._map.latLngToLayerPoint(e.getNorthWest()),this._map.latLngToLayerPoint(e.getSouthEast())).getSize()}}),Vo=ao().TileLayer.extend({options:{version:"1.0.0",style:"",tilematrixSet:"",format:"image/png",tileSize:256,matrixIds:null,layer:"",requestEncoding:"KVP",attribution:"",noWrap:!0},initialize:function(e,t){this._url=e,ao().setOptions(this,t);var i=this.options;if("REST"===i.requestEncoding){this.formatSuffix="."+({"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"}[i.format]||i.format.split("/").pop()||"png")}else i.requestEncoding="KVP"},getTileUrl:function(e){var t=this._getZoomForUrl(),i=this.options.matrixIds?this.options.matrixIds[t].identifier:t,r=this._url.indexOf("?"),s=r>-1?this._url.substring(0,this._url.indexOf("?")):this._url,n=r>-1?this._url.substring(this._url.indexOf("?")):"";s=ao().Util.template(s,{s:this._getSubdomain(e)});var a={service:"WMTS",request:"GetTile",version:this.options.version,style:this.options.style,tilematrixSet:this.options.tilematrixSet,format:this.options.format,width:this.options.tileSize,height:this.options.tileSize,layer:this.options.layer,tilematrix:i,tilerow:e.y,tilecol:e.x};if(this.options.tileProxy&&(s=this.options.tileProxy+s),"KVP"===this.options.requestEncoding)s+=ao().Util.getParamString(a,s);else if("REST"===this.options.requestEncoding){s+="/"+a.layer+"/"+a.style+"/"+a.tilematrixSet+"/"+a.tilematrix+"/"+a.tilerow+"/"+a.tilecol+this.formatSuffix}return s=ee.urlAppend(s,n),s=je.appendCredential(s)}}),Jo=function(e,t){return new Vo(e,t)},qo=Vo.extend({layerLabelMap:{vec:"cva",ter:"cta",img:"cia"},layerZoomMap:{vec:18,ter:14,img:18},options:{layerType:"vec",isLabel:!1,attribution:co.Tianditu.attribution,url:"https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?",zoomOffset:1,key:"",dpi:96,style:"default",format:"tiles",subdomains:[0,1,2,3,4,5,6,7],bounds:[[-90,-180],[90,180]],noWrap:!0},initialize:function(e){e=e||{},ao().setOptions(this,e),this.options.layer=this.options.isLabel?this.layerLabelMap[this.options.layerType]:this.options.layerType,this.options.maxZoom=this.layerZoomMap[this.options.layerType]-1,Vo.prototype.initialize.call(this,this.options.url,this.options),ao().stamp(this),this.options.key&&(this._url=`${this._url}tk=${this.options.key}`)},onAdd:function(e){this.options.tilematrixSet="EPSG:4326"===e.options.crs.code?"c":"w",this._url=this._url.replace("{layer}",this.options.layer).replace("{proj}",this.options.tilematrixSet),Vo.prototype.onAdd.call(this,e)},_isValidTile:function(e){const t=this._map.options.crs;if(!t.infinite){const i=this._globalTileRange;if((!t.wrapLng||this.options.noWrap)&&(e.x<i.min.x||e.x>i.max.x)||!t.wrapLat&&(e.y<i.min.y||e.y>i.max.y))return!1}if(!this.options.bounds)return!0;const i=this._tileCoordsToBounds(e);return ao().latLngBounds(this.options.bounds).overlaps(i)}}),Ho=ao().TileLayer.extend({options:{layersID:null,redirect:!1,transparent:!0,cacheEnabled:!0,clipRegionEnabled:!1,clipRegion:null,prjCoordSys:null,overlapDisplayed:!1,overlapDisplayedOptions:null,tileversion:null,crs:null,format:"png",tileProxy:null,attribution:co.Common.attribution,subdomains:null},initialize:function(e,t){this._url=e,ao().TileLayer.prototype.initialize.apply(this,arguments),ao().setOptions(this,t),ao().stamp(this),this.tileSetsIndex=-1,this.tempIndex=-1},onAdd:function(e){this._crs=this.options.crs||e.options.crs,ao().TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this.getScaleFromCoords(e),i=this._getLayerUrl()+"&scale="+t+"&x="+e.x+"&y="+e.y;return this.options.tileProxy&&(i=this.options.tileProxy+encodeURIComponent(i)),this.options.cacheEnabled||(i+="&_t="+(new Date).getTime()),this.options.subdomains&&(i=ao().Util.template(i,{s:this._getSubdomain(e)})),i},getScale:function(e){var t=e||this._map.getZoom();return this.scales[t]},getScaleFromCoords:function(e){var t,i=this;return i.scales&&i.scales[e.z]?i.scales[e.z]:(i.scales=i.scales||{},t=i.getDefaultScale(e),i.scales[e.z]=t,t)},getDefaultScale:function(e){var t=this._crs;if(t.scales)return t.scales[e.z];var i=this._tileCoordsToBounds(e),r=t.project(i.getNorthEast()),s=t.project(i.getSouthWest()),n=this.options.tileSize,a=Math.max(Math.abs(r.x-s.x)/n,Math.abs(r.y-s.y)/n),o=l.METER;if(t.code){var h=t.code.split(":");if(h&&h.length>1){var u=parseInt(h[1]);o=u&&u>=4e3&&u<=5e3?l.DEGREE:l.METER}}return Io(a,96,o)},setTileSetsInfo:function(e){this.tileSets=e,ao().Util.isArray(this.tileSets)&&(this.tileSets=this.tileSets[0]),this.tileSets&&(this.fire("tilesetsinfoloaded",{tileVersions:this.tileSets.tileVersions}),this.changeTilesVersion())},lastTilesVersion:function(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()},nextTilesVersion:function(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()},changeTilesVersion:function(){var e=this;if(null!=e.tileSets&&!(e.tempIndex===e.tileSetsIndex||this.tempIndex<0)){var t=e.tileSets.tileVersions;if(t&&e.tempIndex<t.length&&e.tempIndex>=0){var i=t[e.tempIndex].name;e.mergeTileVersionParam(i)&&(e.tileSetsIndex=e.tempIndex,e.fire("tileversionschanged",{tileVersion:t[e.tempIndex]}))}}},updateCurrentTileSetsIndex:function(e){this.tempIndex=e},mergeTileVersionParam:function(e){return!!e&&(this.requestParams.tileversion=e,this._paramsChanged=!0,this.redraw(),this._paramsChanged=!1,!0)},_getLayerUrl:function(){return this._paramsChanged&&(this._layerUrl=this._createLayerUrl()),this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){let e=ee.urlPathAppend(this._url,`tileImage.${this.options.format}`);return this.requestParams=this.requestParams||this._getAllRequestParams(),e=ee.urlAppend(e,no.Util.getParamString(this.requestParams)),e=je.appendCredential(e),this._layerUrl=e,e},_getAllRequestParams:function(){var e=this.options||{},t={},i=this.options.tileSize;i instanceof ao().Point||(i=ao().point(i,i)),t.width=i.x,t.height=i.y,t.redirect=!0===e.redirect,t.transparent=!0===e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(t.layersID=e.layersID.toString()),e.clipRegionEnabled&&e.clipRegion&&(e.clipRegion=Le.fromGeometry(Po(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion));var r=this._crs;if(r.options&&r.options.origin)t.origin=JSON.stringify({x:r.options.origin[0],y:r.options.origin[1]});else if(r.projection&&r.projection.bounds){var s=r.projection.bounds,n=ao().point(s.min.x,s.max.y);t.origin=JSON.stringify({x:n.x,y:n.y})}return!1===e.overlapDisplayed?(t.overlapDisplayed=!1,e.overlapDisplayedOptions&&(t.overlapDisplayedOptions=e.overlapDisplayedOptions)):t.overlapDisplayed=!0,!0===t.cacheEnabled&&e.tileversion&&(t.tileversion=e.tileversion.toString()),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),t}}),Wo=function(e,t){return new Ho(e,t)},Yo=i(545),Xo=i.n(Yo),Qo={TEXT:{fontSize:"14px",fontFamily:"Arial Unicode MS Regular,Microsoft YaHei",textAlign:"left",color:"rgba(255,255,255,0)",fillColor:"rgba(80,80,80,1)",weight:1,globalAlpha:1},POINT:{fillColor:"#ffcc00",color:"#cc3333",weight:1,radius:3,opacity:1},LINE:{color:"rgba(0,0,0,0)",weight:1,lineCap:"butt",lineJoin:"round",dashOffset:0,dashArray:[],opacity:1},REGION:{color:"rgba(0,0,0,0)",fillColor:"rgba(0,0,0,0)",weight:1,lineCap:"butt",lineJoin:"round",dashOffset:0,opacity:1,fillOpacity:1,dashArray:[]}},Zo={TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-name":"textName","text-weight":"fontWeight","text-halo-color":"color","text-fill":"fillColor","text-comp-op":"globalCompositeOperation"},POINT:{"point-file":"iconUrl","point-fill":"fillColor","point-radius":"radius","point-halo-color":"color","point-comp-op":"globalCompositeOperation"},LINE:{"line-color":"color","line-width":"weight","line-cap":"lineCap","line-join":"lineJoin","line-dash-offset":"dashOffset","line-opacity":"opacity","line-dasharray":"dashArray","line-comp-op":"globalCompositeOperation"},REGION:{"line-color":"color","line-width":"weight","line-cap":"lineCap","line-join":"lineJoin","line-dash-offset":"dashOffset","line-opacity":"opacity","line-dasharray":"dashArray","polygon-fill":"fillColor","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"}},Ko={lineWidth:{leafletStyle:"weight",type:"number",unit:"mm",defaultValue:.1},fillForeColor:{leafletStyle:"fillColor",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{leafletStyle:"color",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{leafletStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},lineColor:{leafletStyle:"color",type:"color",defaultValue:"#000000"}},$o={clear:"",src:"",dst:"","src-over":"source-over","dst-over":"destination-over","src-in":"source-in","dst-in":"destination-in","src-out":"source-out","dst-out":"destination-out","src-atop":"source-atop","dst-atop":"destination-atop",xor:"xor",plus:"lighter",minus:"",multiply:"",screen:"",overlay:"",darken:"",lighten:"lighter","color-dodge":"","color-burn":"","hard-light":"","soft-light":"",difference:"",exclusion:"",contrast:"",invert:"","invert-rgb":"","grain-merge":"","grain-extract":"",hue:"",saturation:"",color:"",value:""};class el{constructor(e){this.cartoCSS=null,this.mapUrl=e}pretreatedCartoCSS(e,t){t&&(e=this.processCharacters(e)),this.cartoCSS=this.cartoCSS||{};var i=new On(e).getShaders();if(i)for(var r=0;r<i.length;r++){var s=i[r].elements[0],n=i[r].attachment;this.cartoCSS[s.clean]=this.cartoCSS[s.clean]||{},this.cartoCSS[s.clean][n]=this.cartoCSS[s.clean][n]||[],this.cartoCSS[s.clean][n].push(i[r])}}processCharacters(e){var t=e;if(t){t=(t=t.replace(/[@]/gi,"___")).replace(/\\#/gi,"#");var i={};return this.layersInfo&&Object.keys(this.layersInfo).sort().forEach(function(e){var r=e.replace(/[@#\s]/gi,"___"),s=e,n=Object.keys(i);for(let t=n.length;t>-1;t--)if(e.indexOf(n[t])>-1){s=e.replace(n[t],i[n[t]]);break}s=s.replace(/[#]/gi,"#"),i[e]=r,t=t.replace(new RegExp(s,"g"),r)}),t=(t=t.replace(/[#]/gi,"\n#")).replace(/\[zoom/gi,"[scale")}}pickShader(e){if(!this.cartoCSS)return null;var t=e.replace(/[@#\s]/gi,"___");return this.cartoCSS[t]}getDefaultStyle(e){var t={},i=Qo[e];for(var r in i){var s=i[r];t[r]=s}return t}getStyleFromiPortalMarker(e){return 0==e.indexOf("./")?null:ao().icon({iconUrl:e,iconSize:ao().point(48,43),iconAnchor:ao().point(24,43),popupAnchor:ao().point(0,-43)})}getStyleFromiPortalStyle(e,t,i){var r=i?JSON.parse(i):null,s={};if("Point"===t||"MultiPoint"===t){var n=r||e.pointStyle;return n.externalGraphic?0==n.externalGraphic.indexOf("./")?null:ao().icon({iconUrl:n.externalGraphic,iconSize:ao().point(n.graphicWidth,n.graphicHeight),iconAnchor:ao().point(-n.graphicXOffset,-n.graphicYOffset),popupAnchor:ao().point(0,-n.graphicHeight)}):(s.radius=n.pointRadius,s.color=n.strokeColor,s.opacity=n.strokeOpacity,s.lineCap=n.strokeLineCap,s.weight=n.strokeWidth,s.fillColor=n.fillColor,s.fillOpacity=n.fillOpacity,s.dashArray=this.dashStyle(n,1),s)}if("LineString"===t||"MultiLineString"===t||"Box"===t){var a=r||e.lineStyle;return s.color=a.strokeColor,s.opacity=a.strokeOpacity,s.fillOpacity=a.fillOpacity,s.lineCap=a.strokeLineCap,s.weight=a.strokeWidth,s.dashArray=this.dashStyle(a,1),s}if("Polygon"===t||"MultiPolygon"===t){var o=r||e.polygonStyle;return s.color=o.strokeColor,s.opacity=o.strokeOpacity,s.lineCap=o.strokeLineCap,s.weight=o.strokeWidth,s.fillColor=o.fillColor,s.fillOpacity=o.fillOpacity,s.dashArray=this.dashStyle(o,1),s}}dashStyle(e,t){if(!e)return[];var i=e.strokeWidth*t,r=e.strokeDashstyle;switch(r){case"solid":return[];case"dot":return[1,4*i];case"dash":return[4*i,4*i];case"dashdot":return[4*i,4*i,1,4*i];case"longdash":return[8*i,4*i];case"longdashdot":return[8*i,4*i,1,4*i];default:return r?ee.isArray(r)?r:(r=q.trim(r).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}}getValidStyleFromCarto(e,t,i,r,s){if(!i)return null;var n=r.type,a=r.properties.attributes||{},o=this.getDefaultStyle(n);s=void 0===s||s,a.FEATUREID=r.properties.id,a.SCALE=t;for(var l,h,u=Zo[n],c=0,d=i.length;c<d;c++){var p=i[c],f=u[p.property],m=p.getValue(a,e,!0);if(null!==m&&f)if("fontSize"===f)s&&(m*=.8),l=m+"px",o.fontSize=l;else if("fontName"===f)h=m,o.fontName=h;else{if("globalCompositeOperation"===f){if(!(m=$o[m]))continue}else if(s&&"iconUrl"===f){m=(m=this.mapUrl+"/tileFeature/symbols/"+m.replace(/(___)/gi,"@")).replace(/(__0__0__)/gi,"__8__8__"),o.iconUrl=m;continue}"weight"===f&&m<1&&(m=Math.ceil(m)),o[f]=m}}return o}getValidStyleFromLayerInfo(e,t){var i=e.type,r=this.getDefaultStyle(i),s=t&&t.layerStyle;if(!s)return r;if("POINT"===i){var n=Math.ceil(s.markerSize*$*te.mm)||8,a={transparent:!0,resourceType:"SYMBOLMARKER",picWidth:n,picHeight:n,style:JSON.stringify(s)};return r.iconUrl=ee.urlAppend(this.mapUrl+"/symbol.png",ee.getParameterString(a)),r.iconSize=[n,n],r}if("TEXT"===i){if(s=e.properties.textStyle||t.layerStyle,r.fontWeight=s.bold?s.fontWeight:"normal",s.fontHeight){var o=s.fontHeight*$*te.mm*.85;r.fontSize=o+"px",r.textHeight=o}if(s.fontName&&(r.fontFamily=s.fontName.indexOf("@")?s.fontName.replace(/@/g,""):s.fontName),s.align){var l=s.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/,"");r.textAlign=l.toLowerCase()}return r.weight=s.outline?s.outlineWidth:0,s.backColor&&(r.color="rgba("+s.backColor.red+","+s.backColor.green+","+s.backColor.blue+",1)"),s.foreColor&&(r.fillColor="rgba("+s.foreColor.red+","+s.foreColor.green+","+s.foreColor.blue+",1)"),r.rotation=s.rotation||0,r}var h=s.fillSymbolID>7?0:s.fillSymbolID,u=s.lineSymbolID>5?0:s.lineSymbolID;for(var c in s){var d=Ko[c];if(d){var p=d.leafletStyle;switch(d.type){case"number":{let e=s[c];d.unit&&(e=e*$*te[d.unit]*2.5),r[p]=e;break}case"color":{var f=s[c];let e,t=1;if("fillColor"===p)0!==h&&1!==h||(t=1-h,e="rgba("+f.red+","+f.green+","+f.blue+","+t+")");else if("color"===p){if(0===u||5===u)t=0===u?1:0;else{var m=[1,0];switch(u){case 1:m=[9.7,3.7];break;case 2:m=[3.7,3.7];break;case 3:m=[9.7,3.7,2.3,3.7];break;case 4:m=[9.7,3.7,2.3,3.7,2.3,3.7]}r.lineDasharray=m}e="rgba("+f.red+","+f.green+","+f.blue+","+t+")"}r[p]=e;break}}}}return t.textField&&(r.textAlign="LEFT"),r}}var tl=ao().Class.extend({initialize:function(e){var t=(e=e||{}).latLng||e._latLng;this._latLng=ao().latLng(t.lat,t.lng),this._style=e.style||e._canvas,this.attributes=e.attributes,this.id=e.id?e.id:null},getId(){return this.id},setId(e){this.id=e},setLatLng:function(e){this._latLng=e},setCanvas:function(e){this._style=e},setAttributes:function(e){this.attributes=e},getLatLng:function(){return this._latLng},getCanvas:function(){return this._style},getAttributes:function(){return this.attributes},setStyle:function(e){this._style=e},getStyle:function(){return this._style}}),il=ao().Class.extend({initialize:function(e,t){this.geometry=e,this.attributes=t},toFeature:function(){let e=this.geometry;if(e.toGeoJSON){const t=e.toGeoJSON();return t.properties=this.attributes,(new Oe).read(t)[0]}if(3===e.length)e=new ue(e[1],e[0],e[2]);else if(2===e.length)e=new le(e[0],e[1]);else if(e instanceof ao().LatLng)e=new le(e.lng,e.lat);else if(e instanceof ao().Point)e=new le(e.x,e.y);else if(e instanceof ao().CircleMarker){var t=e.getLatLng();e=new le(t.lng,t.lat)}return new xe(e,this.attributes)},reverseLatLngs:function(e){ao().Util.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)e[t]=[e[t].lng,e[t].lat];return e}}),rl=ao().Layer.extend({options:{alwaysMapCRS:!1,id:ee.createUniqueID("themeLayer_"),opacity:1,TFEvents:[],attribution:co.Common.attribution},initialize:function(e,t){ao().Util.setOptions(this,t),this.name=e,this.features=[],this.TFEvents=this.options.TFEvents,this.levelRenderer=new va,this.movingOffset=[0,0]},getEvents:function(){var e={zoomend:this._reset,moveend:this._reset,resize:this._resize};return this._map._zoomAnimated&&(e.zoomanim=this._zoomAnim),e},onRemove:function(e){ao().DomUtil.remove(this.container),e.off("mousemove",this.mouseMoveHandler)},onAdd:function(e){var t=this;if(t.map=t._map=e,t._initContainer(),t.levelRenderer){var i=e.getSize();t.container.style.width=i.x+"px",t.container.style.height=i.y+"px",t._updateOpacity(),t.renderer=t.levelRenderer.init(t.container),t.renderer.clear(),t.features&&t.features.length>0&&t._reset(),t.addTFEvents(),t.mouseMoveHandler=function(e){var i=e.layerPoint;t.currentMousePosition=ao().point(i.x+t.movingOffset[0],i.y+t.movingOffset[1])},e.on("mousemove",t.mouseMoveHandler),t.update(e.getBounds())}else e.removeLayer(t)},addFeatures:function(e){},redrawThematicFeatures:function(e){},destroyFeatures:function(e){if(void 0===e&&(e=this.features),e){this.removeFeatures(e),Array.isArray(e)||(e=[e]);for(var t=e.length-1;t>=0;t--)e[t].destroy()}},removeFeatures:function(e){var t=this;if(e){if(e===t.features)return t.removeAllFeatures();ao().Util.isArray(e)||"function"==typeof e||(e=[e]);for(var i=[],r=0;r<t.features.length;r++){var s=t.features[r];if(e&&"function"==typeof e)e(s)&&t.features.splice(r--,1);else-1===ao().Util.indexOf(e,s)?i.push(s):t.features.splice(r--,1)}for(var n=[],a=0,o=t.features.length;a<o;a++)s=t.features[a],n.push(s);t.features=[],t.addFeatures(n),t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures());var l=0==i.length;t.fire("featuresremoved",{features:i,succeed:l})}},removeAllFeatures:function(){this.renderer&&this.renderer.clear(),this.features=[],this.fire("featuresremoved",{features:[],succeed:!0})},getFeatures:function(e){for(var t=this.features.length,i=[],r=0;r<t;++r)(!e||e&&"function"==typeof e&&e(this.features[r]))&&i.push(this.features[r]);return i},getFeatureBy:function(e,t){var i=null;for(var r in this.features)if(this.features[r][e]===t){i=this.features[r];break}return i},getFeatureById:function(e){return this.getFeatureBy("id",e)},getFeaturesByAttribute:function(e,t){var i,r=[];for(var s in this.features)(i=this.features[s])&&i.attributes&&i.attributes[e]===t&&r.push(i);return r},update:function(e){var t=this._map.containerPointToLayerPoint([0,0]);ao().DomUtil.setPosition(this.container,t);var i=this;i.renderer&&i.redrawThematicFeatures(e),i.currentMousePosition&&(i.currentMousePosition=ao().point(i.currentMousePosition.x-i.movingOffset[0],i.currentMousePosition.y-i.movingOffset[1])),i.movingOffset=[0,0],i._zoom=i._map.getZoom(),i._center=i._map.getCenter()},setOpacity:function(e){e!==this.options.opacity&&(isNaN(e)||(this.options.opacity=e,this._updateOpacity()))},redraw:function(){var e=this;return!!e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures(),!0)},on:function(e,t,i){return this.renderer?this.renderer.on(e,t):ao().Layer.prototype.on.call(this,e,t),this},off:function(e,t,i){return this.renderer?this.renderer.un(e,t):ao().Layer.prototype.off.call(this,e,t),this},fire:function(e,t,i){return this.renderer&&this.renderer.trigger(e,t),ao().Layer.prototype.fire.call(this,e,t,i),this},addTFEvents:function(){for(var e=this.TFEvents,t=e.length,i=0;i<t;i++)this.renderer.on(e[i][0],e[i][1])},getLocalXY:function(e){if(!this._map)return e;var t=e;ao().Util.isArray(e)&&(t=ao().point(e[0],e[1])),e instanceof ao().Point||(t=e instanceof le||e instanceof ue?ao().point(e.x,e.y):ao().point(e.lon,e.lat));var i=this._map.latLngToAccurateContainerPoint(this.options.alwaysMapCRS?this._map.options.crs.unproject(t):ao().latLng(t.y,t.x));return[i.x,i.y]},toiClientFeature:function(e){ee.isArray(e)||(e=[e]);let t=[];for(let i=0;i<e.length;i++)if(e[i]instanceof il)t.push(e[i].toFeature());else if(e[i]instanceof xe)t.push(e[i]);else if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(e[i].type)){const r=new Oe;t=t.concat(r.read(e[i]))}else{if(!e[i].geometry||!e[i].geometry.parts)throw new Error(`features[${i}]'s type is not be supported.`);t.push(is.fromJson(e[i]).toFeature())}return t},toFeature:function(e){return this.toiClientFeature(e)},_initContainer:function(){var e=this.getPane(),t="themeLayer leaflet-layer leaflet-zoom-"+(this._map.options.zoomAnimation&&ao().Browser.any3d?"animated":"hide");this.container=ao().DomUtil.create("div",t,e);var i=ao().DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);this.container.id=this.options.id,this.container.style[i]="50% 50%",this.container.style.position="absolute",this.container.style.zIndex=200},_zoomAnim:function(e){var t=this._map.getZoomScale(e.zoom),i=this._map._getCenterOffset(e.center)._multiplyBy(-t).subtract(this._map._getMapPanePos());ao().DomUtil.setTransform?ao().DomUtil.setTransform(this.container,i,t):this.container.style[ao().DomUtil.TRANSFORM]=ao().DomUtil.getTranslateString(i)+" scale("+t+")"},_updateOpacity:function(){var e=this;ee.modifyDOMElement(e.container,null,null,null,null,null,null,e.options.opacity),null!==e._map&&e._map.fire("changelayer",{layer:e,property:"opacity"})},_reset:function(){var e=this,t=e._map.getBounds();e.update(t);var i=e._map.getSize(),r=this._map.containerPointToLayerPoint([0,0]);ao().DomUtil.setPosition(this.container,r),parseFloat(e.container.width)!==parseFloat(i.x)&&(e.container.width=i.x+"px"),parseFloat(e.container.height)!==parseFloat(i.y)&&(e.container.height=i.y+"px"),e.redraw()},_resize:function(){var e=this._map.getSize();this.container.style.width=e.x+"px",this.container.style.height=e.y+"px",this.renderer.resize()}}),sl=rl.extend({options:{nodesClipPixel:2,isHoverAble:!1,isMultiHover:!1,isClickAble:!0,isAllowFeatureStyle:!1},initialize:function(e,t){rl.prototype.initialize.call(this,e,t),ao().Util.setOptions(this,t);this.cache={},this.cacheFields=[],this.style={},this.highlightStyle={}},addFeatures:function(e){var t=this;t.fire("beforefeaturesadded",{features:e}),this.features=this.toiClientFeature(e),t.isCustomSetMaxCacheCount||(t.maxCacheCount=5*t.features.length),t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures())},removeFeatures:function(e){this.clearCache(),rl.prototype.removeFeatures.call(this,e)},removeAllFeatures:function(){this.clearCache(),rl.prototype.removeAllFeatures.call(this,arguments)},redrawThematicFeatures:function(e){var t=this,i=t.renderer.getHoverOne(),r=null;if(i&&i.refDataID&&(r=i.refDataID),this.options.alwaysMapCRS&&e&&e instanceof ao().LatLngBounds){var s=this._map.options.crs;e=ao().bounds(s.project(e.getSouthWest()),s.project(e.getNorthEast()))}e=vo.toSuperMapBounds(e),t.renderer.clearAll();for(var n=t.features,a=t.cache,o=t.cacheFields,l=t._map.getZoom(),h=t.maxCacheCount,u=0,c=n.length;u<c;u++){var d=n[u],p=d.geometry.getBounds();if(!e||e.intersectsBounds(p)){var f=d.id+"_zoom_"+l.toString();if(a[f])a[f].updateAndAddShapes();else{var m=t.createThematicFeature(n[u]);if(!(m.getShapesCount()<1)&&(a[f]=m,o.push(f),o.length>h)){var y=o[0];o.splice(0,1),delete a[y]}}}}if(t.renderer.render(),r&&t.options.isHoverAble&&t.options.isMultiHover){var g=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(g)}},createThematicFeature:function(e){var t=this,i=t.getStyleByData(e);e.style&&t.isAllowFeatureStyle&&(i=ee.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=t.options.nodesClipPixel,r.isHoverAble=t.options.isHoverAble,r.isMultiHover=t.options.isMultiHover,r.isClickAble=t.options.isClickAble,r.highlightStyle=ra.transformStyle(t.highlightStyle);for(var s=new oa(e,t,ra.transformStyle(i),r),n=0;n<s.shapes.length;n++)t.renderer.addShape(s.shapes[n]);return s},redraw:function(){return this.clearCache(),rl.prototype.redraw.apply(this,arguments)},clearCache:function(){this.cache={},this.cacheFields=[]},clear:function(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()},getCacheCount:function(){return this.cacheFields.length},setMaxCacheCount:function(e){isNaN(e)||(this.maxCacheCount=e,this.isCustomSetMaxCacheCount=!0)},getShapesByFeatureID:function(e){var t=[],i=this.renderer.getAllShapes();if(!e)return i;for(var r=0,s=i.length;r<s;r++){var n=i[r];n.refDataID&&e===n.refDataID&&t.push(n)}return t}}),nl=sl.extend({initialize:function(e,t){sl.prototype.initialize.call(this,e,t),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData:function(e){var t=this,i=e,r=ee.copyAttributesWithClip({},t.style),s=t.styleGroups,n=!1,a=null,o=t.styleGroups&&t.styleGroups.length>0;if(t.themeField&&o&&i.attributes){var l=t.themeField,h=i.attributes;for(var u in h)if(l===u){n=!0,a=h[u];break}}if(n)for(var c=0,d=s.length;c<d;c++)if(a.toString()===s[c].value.toString()){var p=s[c].style;r=ee.copyAttributesWithClip(r,p)}return r}}),al=sl.extend({initialize:function(e,t){sl.prototype.initialize.call(this,e,t),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData:function(e){var t=this,i=e,r=ee.copyAttributesWithClip({},t.style),s=t.styleGroups,n=!1,a=null,o=t.styleGroups&&t.styleGroups.length>0;if(t.themeField&&o&&i.attributes){var l=t.themeField,h=i.attributes;for(var u in h)if(l===u){n=!0,a=h[u];break}}if(n)for(var c=0,d=s.length;c<d;c++){if(c===d-1?a>=s[c].start&&a<=s[c].end:a>=s[c].start&&a<s[c].end){var p=s[c].style;r=ee.copyAttributesWithClip(r,p)}}return r}}),ol=sl.extend({options:{isOverLay:!0,isAvoid:!0},initialize:function(e,t){sl.prototype.initialize.call(this,e,t),ao().Util.setOptions(this,t),this.style=[],this.themeField=null,this.styleGroups=[],this.defaultStyle={fontColor:"#000000",fontOpacity:1,fontSize:"12px",fontStyle:"normal",fontWeight:"normal",labelAlign:"cm",labelXOffset:0,labelYOffset:0,labelRotation:0,fill:!1,fillColor:"#ee9900",fillOpacity:.4,stroke:!1,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",labelRect:!0,labelSelect:!0,_isGeoTextStrategyStyle:!0},this.getPxBoundsMode=0,this.labelFeatures=[]},onAdd:function(e){sl.prototype.onAdd.call(this,e),this.container.style.zIndex=200},redrawThematicFeatures:function(e){if(this.features.length>0&&0==this.labelFeatures.length)for(var t=this.setLabelsStyle(this.features),i=0,r=t.length;i<r;i++)this.labelFeatures.push(t[i]);this.features=this.getDrawnLabels(this.labelFeatures),sl.prototype.redrawThematicFeatures.call(this,e)},removeFeatures:function(e){this.labelFeatures=[],sl.prototype.removeFeatures.call(this,e)},removeAllFeatures:function(){this.labelFeatures=[],sl.prototype.removeAllFeatures.call(this,arguments)},getDrawnLabels:function(e){for(var t,i,r,s,n=[],a=[],o={labelAlign:"cm",labelXOffset:0,labelYOffset:0},l=this._map,h=l.getSize(),u=l.getZoom(),c=0,d=e.length;c<d;c++){((i=e[c]).isStyleChange||void 0===i.isStyleChange)&&(i=this.setStyle(i));var p=this.getLabelPxLocation(i);if(p.x>=0&&p.x<=h.x&&p.y>=0&&p.y<=h.y){if(i.style.minZoomLevel>-1&&u<=i.style.minZoomLevel)continue;if(i.style.maxZoomLevel>-1&&u>i.style.maxZoomLevel)continue;var f=null;i.isStyleChange?(i.isStyleChange=null,f=this.calculateLabelBounds(i,p)):f=i.geometry.bsInfo.w&&i.geometry.bsInfo.h?this.calculateLabelBounds2(i,p):this.calculateLabelBounds(i,p);var m=new se(0,h.y,h.x,0),y=f.length;if(this.options.isAvoid){var g=this.getAvoidInfo(m,f);if(g){if("left"===g.aspectW){i.style.labelXOffset+=g.offsetX;for(let e=0;e<y;e++)f[e].x+=g.offsetX}else if("right"===g.aspectW){i.style.labelXOffset+=-g.offsetX;for(let e=0;e<y;e++)f[e].x+=-g.offsetX}if("top"===g.aspectH){i.style.labelYOffset+=g.offsetY;for(let e=0;e<y;e++)f[e].y+=g.offsetY}else if("bottom"===g.aspectH){i.style.labelYOffset+=-g.offsetY;for(let e=0;e<y;e++)f[e].y+=-g.offsetY}i.isStyleChange=!0}}if(this.options.isOverLay){var v=!1;if(0!=c)for(let e=0;e<a.length;e++)if(this.isQuadrilateralOverLap(f,a[e])){v=!0;break}if(v)continue;a.push(f)}var b=[];for(let e=0;e<y-1;e++)b.push(l.containerPointToLatLng(f[e]));var _=b[3],S=b[1],x=new se(_.lng,_.lat,S.lng,S.lat).getCenterLonLat(),w=new ue(x.lon,x.lat,i.attributes[this.themeField]);w.calculateBounds(),r=ee.cloneObject(i.style),s=ee.cloneObject(ee.copyAttributes(r,o)),(t=new xe(w,i.attributes,s)).id=i.id,t.fid=i.fid,n.push(t)}}return n},getStyleByData:function(e){var t=e;if(t.style=ee.copyAttributes(t.style,this.defaultStyle),this.style&&this.style.fontSize&&parseFloat(this.style.fontSize)<12&&(this.style.fontSize="12px"),t.style=ee.copyAttributes(t.style,this.style),this.themeField&&this.styleGroups&&t.attributes){var i=this.themeField,r=t.attributes,s=this.styleGroups,n=!1,a=null;for(var o in r)if(i===o){n=!0,a=r[o];break}if(n)for(var l=0,h=s.length;l<h;l++)if(a>=s[l].start&&a<s[l].end){var u=s[l].style;u&&u.fontSize&&parseFloat(u.fontSize)<12&&(u.fontSize="12px"),t.style=ee.copyAttributes(t.style,u)}t.style.label=t.attributes[this.themeField]}return t.style},setLabelsStyle:function(e){for(var t,i=[],r=0,s=e.length;r<s;r++){var n=e[r];if("SuperMap.Geometry.GeoText"!==n.geometry.CLASS_NAME)return e;(n.geometry.bsInfo.w||n.geometry.bsInfo.h)&&(n.geometry.bsInfo.w=null,n.geometry.bsInfo.h=null,n.geometry.labelWTmp=null),(t=this.setStyle(n)).layer=this.layer,i.push(t)}return i},setStyle:function(e){var t=e;if(t.style=ee.copyAttributes(t.style,this.defaultStyle),this.style&&this.style.fontSize&&parseFloat(this.style.fontSize)<12&&(this.style.fontSize="12px"),t.style=ee.copyAttributes(t.style,this.style),this.groupField&&this.styleGroups&&t.attributes){var i=this.groupField,r=t.attributes,s=this.styleGroups,n=!1,a=null;for(var o in r)if(i===o){n=!0,a=r[o];break}if(n)for(var l=0,h=s.length;l<h;l++)if(a>=s[l].start&&a<s[l].end){var u=s[l].style;u&&u.fontSize&&parseFloat(u.fontSize)<12&&(u.fontSize="12px"),t.style=ee.copyAttributes(t.style,u)}}return t.style.label=t.geometry.text,t},getLabelPxLocation:function(e){var t=e.geometry,i=e.style,r=t.getCentroid(),s=this._map.latLngToContainerPoint(this.options.alwaysMapCRS?this._map.options.crs.unproject(ao().point(r.x,r.y)):ao().latLng(r.y,r.x)),n=ao().point(s.x,s.y);if(i.labelXOffset||i.labelYOffset){var a=isNaN(i.labelXOffset)?0:i.labelXOffset,o=isNaN(i.labelYOffset)?0:i.labelYOffset,l=n.add(ao().point(a,-o));return ao().point(l.x,l.y)}return ao().point(n.x,n.y)},calculateLabelBounds:function(e,t){var i=e.geometry,r=null,s=null;if(0==this.getPxBoundsMode)r=i.getLabelPxBoundsByText(t,e.style);else{if(1!==this.getPxBoundsMode)return null;s=this.getLabelInfo(e.geometry.getCentroid(),e.style),r=i.getLabelPxBoundsByLabel(t,s.w,s.h,e.style)}var n=[];return n=e.style.labelRotation%180==0?[{x:r.left,y:r.top},{x:r.right,y:r.top},{x:r.right,y:r.bottom},{x:r.left,y:r.bottom},{x:r.left,y:r.top}]:this.rotationBounds(r,t,e.style.labelRotation),i.bounds=new se(n[1].x,n[3].y,n[2].x,n[4].y),n},calculateLabelBounds2:function(e,t){var i,r,s,n,a,o=e.geometry.bsInfo,l=e.style,h=ee.cloneObject(t);if(l.labelAlign&&"cm"!==l.labelAlign)switch(l.labelAlign){case"lt":h.x+=o.w/2,h.y+=o.h/2;break;case"lm":h.x+=o.w/2;break;case"lb":h.x+=o.w/2,h.y-=o.h/2;break;case"ct":h.y+=o.h/2;break;case"cb":h.y-=o.h/2;break;case"rt":h.x-=o.w/2,h.y+=o.h/2;break;case"rm":h.x-=o.w/2;break;case"rb":h.x-=o.w/2,h.y-=o.h/2}r=h.x-o.w/2,s=h.y+o.h/2,a=l.fontStyle&&"italic"===l.fontStyle?h.x+o.w/2+parseInt(parseFloat(l.fontSize)/2):h.x+o.w/2,n=h.y-o.h/2,i=new se(r,s,a,n);var u=[];return u=l.labelRotation%180==0?[{x:i.left,y:i.top},{x:i.right,y:i.top},{x:i.right,y:i.bottom},{x:i.left,y:i.bottom},{x:i.left,y:i.top}]:this.rotationBounds(i,t,l.labelRotation),e.geometry.bounds=new se(u[1].x,u[3].y,u[2].x,u[4].y),u},getLabelInfo:function(e,t){var i={l:"left",r:"right",t:"top",b:"bottom"},r={l:0,r:-1,t:0,b:-1};t=ee.extend({fontColor:"#000000",labelAlign:"cm"},t);var s=this.getLocalXY(e),n=0;if(t.labelXOffset||t.labelYOffset){var a=isNaN(t.labelXOffset)?0:t.labelXOffset,o=isNaN(t.labelYOffset)?0:t.labelYOffset;s[0]+=a,s[1]-=o}var l=document.createElement("canvas");l.globalAlpha=0,l.lineWidth=1;var h=l.getContext("2d");h.fillStyle=t.fontColor,h.globalAlpha=t.fontOpacity||1;var u,c,d,p=[t.fontStyle?t.fontStyle:"normal","normal",t.fontWeight?t.fontWeight:"normal",t.fontSize?t.fontSize:"1em",t.fontFamily?t.fontFamily:"sans-serif"].join(" "),f=t.label.split("\n"),m=f.length;if(h.fillText){h.font=p,h.textAlign=i[t.labelAlign[0]]||"center",h.textBaseline=i[t.labelAlign[1]]||"middle",null==(u=r[t.labelAlign[1]])&&(u=-.5),c=h.measureText("Mg").height||h.measureText("xx").width,s[1]+=c*u*(m-1);for(let e=0;e<m;e++)n<(d=h.measureText(f[e]).width)&&(n=d)}else if(h.mozDrawText){h.mozTextStyle=p,null==(u=r[t.labelAlign[1]])&&(u=-.5),c=h.mozMeasureText("xx"),s[1]+=c*(1+u*m);for(let e=0;e<m;e++)n<(d=h.measureText(f[e]).width)&&(n=d)}var y={};return n?(y.w=n,y.h=t.fontSize,y.rows=f.length,y):null},rotationBounds:function(e,t,i){var r=ao().point(e.left,e.top),s=ao().point(e.right,e.top),n=ao().point(e.right,e.bottom),a=ao().point(e.left,e.bottom),o=[];o.push(this.getRotatedLocation(r.x,r.y,t.x,t.y,i)),o.push(this.getRotatedLocation(s.x,s.y,t.x,t.y,i)),o.push(this.getRotatedLocation(n.x,n.y,t.x,t.y,i)),o.push(this.getRotatedLocation(a.x,a.y,t.x,t.y,i));for(var l=[],h=0;h<o.length;h++)l.push({x:o[h].x,y:o[h].y});return l.push({x:o[0].x,y:o[0].y}),l},getRotatedLocation:function(e,t,i,r,s){var n,a,o={};return t=-t,r=-r,s=-s,n=(e-i)*Math.cos(s/180*Math.PI)-(t-r)*Math.sin(s/180*Math.PI)+i,a=(e-i)*Math.sin(s/180*Math.PI)+(t-r)*Math.cos(s/180*Math.PI)+r,o.x=n,o.y=-a,o},getAvoidInfo:function(e,t){if(5!==t.length)return null;for(var i=[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.right,y:e.bottom},{x:e.left,y:e.bottom},{x:e.left,y:e.top}],r=!1,s=i.length,n=t.length,a=0,o=0,l="",h="",u=0;u<s-1;u++)for(var c=0;c<n-1;c++){"SuperMap.Geometry.Point"===ee.lineIntersection(i[u],i[u+1],t[c],t[c+1]).CLASS_NAME&&(d(t[c]),d(t[c+1]),r=!0)}return r?{aspectW:h,aspectH:l,offsetX:a,offsetY:o}:null;function d(t){if(!e.contains(t.x,t.y)){if(t.y<e.top){let i=Math.abs(e.top-t.y);i>o&&(o=i,l="top")}if(t.y>e.bottom){let i=Math.abs(t.y-e.bottom);i>o&&(o=i,l="bottom")}if(t.x<e.left){let i=Math.abs(e.left-t.x);i>a&&(a=i,h="left")}if(t.x>e.right){let i=Math.abs(t.x-e.right);i>a&&(a=i,h="right")}}}},isQuadrilateralOverLap:function(e,t){var i=e.length,r=t.length;if(5!==i||5!==r)return null;var s=!1;for(let r=0;r<i;r++)if(this.isPointInPoly(e[r],t)){s=!0;break}for(let i=0;i<r;i++)if(this.isPointInPoly(t[i],e)){s=!0;break}for(let a=0;a<i-1&&!s;a++)for(var n=0;n<r-1;n++){if("SuperMap.Geometry.Point"===ee.lineIntersection(e[a],e[a+1],t[n],t[n+1]).CLASS_NAME){s=!0;break}}return s},isPointInPoly:function(e,t){for(var i=!1,r=-1,s=t.length,n=s-1;++r<s;n=r)(t[r].y<=e.y&&e.y<t[n].y||t[n].y<=e.y&&e.y<t[r].y)&&e.x<(t[n].x-t[r].x)*(e.y-t[r].y)/(t[n].y-t[r].y)+t[r].x&&(i=!i);return i}});var ll=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._featureService=new class{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,i){var r=this;new Vi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:i}).processAsync(e)}getFeaturesByBounds(e,t,i){var r=this;new Ri(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}getFeaturesByBuffer(e,t,i){var r=this;new Gi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}getFeaturesBySQL(e,t,i){var r=this;new qi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}getFeaturesByGeometry(e,t,i){var r=this;new ji(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var i=this,r=i.url,s=e.dataSourceName,n=e.dataSetName;r=ee.urlPathAppend(r,"datasources/"+s+"/datasets/"+n),new Qt(r,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(e)}}_processFormat(e){return e||t.GEOJSON}}(e,i)},getFeaturesByIDs:function(e,t,i){e=this._processParams(e),this._featureService.getFeaturesByIDs(e,t,i)},getFeaturesByBounds:function(e,t,i){e=this._processParams(e),this._featureService.getFeaturesByBounds(e,t,i)},getFeaturesByBuffer:function(e,t,i){e=this._processParams(e),this._featureService.getFeaturesByBuffer(e,t,i)},getFeaturesBySQL:function(e,t,i){e=this._processParams(e),this._featureService.getFeaturesBySQL(e,t,i)},getFeaturesByGeometry:function(e,t,i){e=this._processParams(e),this._featureService.getFeaturesByGeometry(e,t,i)},editFeatures:function(e,t){if(e&&e.dataSourceName&&e.dataSetName){var i=this,r=i.url,s=e.dataSourceName,n=e.dataSetName;r=ee.urlPathAppend(r,"datasources/"+s+"/datasets/"+n),new Qt(r,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(i._processParams(e))}},_processParams:function(e){if(!e)return{};e.returnContent=null==e.returnContent||e.returnContent,e.fromIndex=e.fromIndex?e.fromIndex:0,e.toIndex=e.toIndex?e.toIndex:-1,e.isUseBatch=null!=e.isUseBatch&&e.isUseBatch,e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry=Po(e.geometry)),e.editType&&(e.editType=e.editType.toLowerCase());var t=this;if(e.features){var i=[];ao().Util.isArray(e.features)?e.features.map(function(e){return i.push(t._createServerFeature(e)),e}):i.push(t._createServerFeature(e.features)),e.features=i}return e},_createServerFeature:function(e){var t,i={},r=[],s=[];for(var n in(t=e||{}).properties)r.push(n),s.push(t.properties[n]);return i.fieldNames=r,i.fieldValues=s,t.id&&(i.id=t.id),i.geometry=Po(t),i},_processFormat:function(e){return e||t.GEOJSON}}),hl=function(e,t){return new ll(e,t)},ul=ao().Path.extend({options:{fontStyle:"normal",fontWeight:"normal",fontSize:"1em",fontFamily:"sans-serif",textAlign:"center",textBaseline:"middle",vfactor:-.5,labelRotation:0,globalAlpha:1,label:""},initialize:function(e,t){ao().Util.setOptions(this,t),this._latlng=e},setLatLng:function(e){return this._latlng=e,this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._clickTolerance(),t=[e,e];this._pxBounds=new(ao().Bounds)(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateUnicode(this)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._clickTolerance()}});ao().Canvas.include({_updateUnicode:function(e){if(!this._drawing)return;let t={x:e._point.x,y:e._point.y},i=this._ctx,r=[e.options.fontStyle,"normal",e.options.fontWeight,e.options.fontSize,e.options.fontFamily].join(" "),s=e.options.label.replace(/^&#x/,""),n=(s=String.fromCharCode(parseInt(s,16))).split("\n"),a=n.length;if(i.fillStyle=e.options.fontColor,i.globalAlpha=1,e.options.fontOpacity>=0&&e.options.fontOpacity<1&&(i.globalAlpha=e.options.fontOpacity),i.fillText){i.font=r,i.textAlign=e.options.textAlign,i.textBaseline=e.options.textBaseline;let s=e.options.vfactor,o=i.measureText("Mg").height||i.measureText("xx").width;t.y+=o*s*(a-1);for(let r=0;r<a;r++)0!=e.options.labelRotation?(i.save(),i.translate(t.x,t.y),i.rotate(e.options.labelRotation*Math.PI/180),i.fillText(n[r],0,o*r),i.restore()):i.fillText(n[r],t.x,t.y)}else if(i.mozDrawText){i.mozTextStyle=r;let s=e.options.textAlign,o=e.options.vfactor,l=i.mozMeasureText("xx");t.y+=l*(1+o*a);for(let e=0;e<a;e++){let r=t.x+s*i.mozMeasureText(n[e]),a=t.y+e*l;i.translate(r,a),i.mozDrawText(n[e]),i.translate(-r,-a)}}}});var cl=ao().LayerGroup.extend({options:{map:"map",server:"",featureLayerPopupEnable:!0,featureLayerPopup:null,credentialValue:null,credentialKey:"key",attribution:co.Online.attribution},defaultFeatureLayerPopup:function(e){return e.feature.properties.attributes.title+":"+e.feature.properties.attributes.description},initialize:function(e,t){(e||t)&&(this._layers={},ao().setOptions(this,t),this.id=e,this.load(),this.cartoCSSToLeaflet=new el)},load:function(){this.options.server.indexOf("http://")<0&&this.options.server.indexOf("https://")<0&&(this.options.server="http://"+this.options.server);var e=this.options.server+"/web/maps/"+this.id+".json";this.options.credentialValue&&(e+="?"+this.options.credentialKey+"="+this.options.credentialValue);var t=this;Ue.get(e).then(function(e){return e.json()}).then(function(e){if(e){var i=e.layers;t.mapInfo=e,t.createLayersByJson(i)}})},addLayerWrapper:function(e,t,i){return t&&this.createMap(i),this.addLayer(e),e.labelLayer&&this.addLayer(e.labelLayer),this},createLayersByJson:function(e){if(ao().Util.isArray(e)&&0!==e.length){this.layers=[];for(var t=[],i=0;i<e.length;i++){var r=e[i];r._originIndex=i,"BASE_LAYER"===(r.layerType=r.layerType||"BASE_LAYER")?(r.isBaseLayer=!0,this.createLayer(r.type,r)):t.unshift(r)}for(;t.length>0;){var s=t.pop(),n=s.type,a=s.layerType=s.layerType||"BASE_LAYER";"OVERLAY_LAYER"!==a&&(n=a),this.createLayer(n,s)}this.fire("maploaded",{map:this._map})}},createCRS:function(e,t,i,r,s){return e<0?new Eo({bounds:s,origin:r,resolutions:i}):910112===e||910102===e?bo:(910111===e&&(e=3857),910101===e&&(e=4326),uo("EPSG:"+e,{origin:r,resolutions:i,bounds:s}))},createMap:function(e){var t=e.crs||ao().CRS.EPSG3857,i=ao().latLngBounds(t.unproject(e.bounds.min),t.unproject(e.bounds.max));this._map=ao().map(this.options.map,{center:i.getCenter(),maxZoom:e.maxZoom||22,minZoom:e.minZoom||0,zoom:e.zoom||0,crs:t,renderer:ao().canvas()}),t instanceof Eo?this._map.setZoom(e.zoom?e.zoom+2:2,{maxZoom:e.maxZoom||22}):this._map.fitBounds(i,{maxZoom:e.maxZoom||22})},getResolutionsFromScales:function(e,t,i,r){for(var s=[],n=0;n<e.length;n++)s.push(Do(e[n],t,i,r));return s},createLayer:function(e,t){var i=t.prjCoordSys,r=i&&i.epsgCode||this.mapInfo.epsgCode,s=this.mapInfo.center||t.center,n=this.mapInfo.level||t.level,a=this.mapInfo.extent||t.bounds,o=t.scales,l=t.isBaseLayer,h=t.opacity,u=ao().bounds([a.leftBottom.x,a.leftBottom.y],[a.rightTop.x,a.rightTop.y]),c=t.bounds?ao().bounds([t.bounds.leftBottom.x,t.bounds.leftBottom.y],[t.bounds.rightTop.x,t.bounds.rightTop.y]):u;s||(s=c.getCenter());var d,p=ao().point(c.min.x,c.max.y),f=o?this.getResolutionsFromScales(o,96,t.units):null,m=this.createCRS(r,i?i.type:"",f,p,c),y={bounds:u,center:ao().point(s.x,s.y),crs:m,zoom:n};switch(e){case"SUPERMAP_REST":d=Wo(t.url,{transparent:!0,opacity:h});break;case"SUPERMAP_REST_VECTOR":break;case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":y.crs=4326===r?So:Mo,y.minZoom=1,y.zoom=1+y.zoom,d=this.createTiandituLayer(t);break;case"BAIDU":y.crs=bo,y.zoom=3+y.zoom,y.minZoom=3,d=Go();break;case"BING":break;case"WMS":d=this.createWmsLayer(t);break;case"WMTS":y.resolutions=this.getResolutionsFromScales(o,90.71446714322,t.units);var g=t.identifier,v=g.substring(g.indexOf("_")+1);d=Jo(t.url,{layer:v,style:"default",tilematrixSet:g,format:"image/png"});break;case"CLOUD":y.crs=ao().CRS.EPSG3857,y.zoom=3+y.zoom,y.minZoom=3,d=jo(t.url,{opacity:h});break;case"MARKER_LAYER":d=this.createMarkersLayer(t,m);break;case"FEATURE_LAYER":"ANIMATORVECTOR"==t.identifier||(d="THEME"==t.identifier?this.createThemeLayer(t):this.createVectorLayer(t,m));break;default:throw new Error("unSupported Layer Type")}d&&t.isVisible&&this.addLayerWrapper(d,l,y)},createTiandituLayer:function(e){var t=e.type.split("_")[1].toLowerCase(),i="OVERLAY_LAYER"===e.layerType;return new qo({layerType:t,isLabel:i})},createMarkersLayer:function(e,t){var i=this,r=e.markers||[],s=ao().geoJSON(Oo(r),{pointToLayer:function(e,t){var i=new(ao().Marker)(t);return i.setStyle=function(e){e&&i.setIcon(e)},i},coordsToLatLng:function(e){var i=t.unproject(ao().point(e[0],e[1]));return new(ao().LatLng)(i.lat,i.lng,e[2])},style:function(e){return i.cartoCSSToLeaflet.getStyleFromiPortalMarker(e.properties.icon)}});return this.options.featureLayerPopupEnable&&s.bindPopup(this.options.featureLayerPopup||this.defaultFeatureLayerPopup),s},createWmsLayer:function(e){var t=e.url,i=e.opacity,r=e.subLayers;return r&&"undefined"!==r&&"null"!==r||(r="0"),ao().tileLayer.wms(t,{layers:r,format:"image/png",transparent:!0,noWrap:!0,opacity:i})},createVectorLayer:function(e,i){var r=e.style,s=e.opacity,n=this,a=function(e){var t=i.unproject(ao().point(e[0],e[1]));return new(ao().LatLng)(t.lat,t.lng,e[2])};if(!e.url){var o=ao().geoJSON(Oo(e.features),{pointToLayer:function(e,t){var i=new(ao().Marker)(t);return i.setStyle=function(e){e&&i.setIcon(e)},i},coordsToLatLng:a,style:function(e){let t=n.cartoCSSToLeaflet.getStyleFromiPortalStyle(r||{},e.geometry.type,e.properties.style);return t&&t.dashArray&&0==t.dashArray.length&&(t.dashArray=null),t},opacity:s});return this.options.featureLayerPopupEnable&&o.bindPopup(this.options.featureLayerPopup||this.defaultFeatureLayerPopup),o}for(var l=e.url,h=e.name,u=e.features,c=0;c<u.length;c++){var d=u[c];d.visible&&this.getFeaturesBySQL(l,h,d.name,"",t.GEOJSON,e=>{var t=ao().geoJSON(e.result,{pointToLayer:function(e,t){var i=new(ao().Marker)(t);return i.setStyle=function(e){e&&i.setIcon(e)},i},coordsToLatLng:a,style:function(e){return this.cartoCSSToLeaflet.getStyleFromiPortalStyle(r||{},e.geometry.type,e.properties.style)},opacity:s});this.options.featureLayerPopupEnable&&t.bindPopup(n.options.featureLayerPopup||n.defaultFeatureLayerPopup),this.addLayer(t)})}},getFeaturesBySQL:function(e,t,i,r,s,n){var a=new Ji({queryParameter:{name:i+"@"+t,attributeFilter:r=r||"SMID > 0"},datasetNames:[t+":"+i],fromIndex:0,toIndex:1e5});hl(e).getFeaturesBySQL(a,n,s)},createThemeLayer:function(e){var t,i=e.themeSettings&&JSON.parse(e.themeSettings),r=i.type;if(e.themeSettings=i,(t="HEAT"===r?this.createHeatLayer(e,i):"UNIQUE"===r?this.createUniqueLayer(e,i):"RANGE"===r?this.createRangeLayer(e,i):this.createBaseThemeLayer(e,i))&&(this.addFeature2ThemeLayer(e,t),t.on("add",e=>{this.registerThemeEvent(e.target)})),i&&i.labelField){var s=this.createLabelLayer(e,i);s.on("add",e=>{this.registerThemeEvent(e.target)}),t.labelLayer=s}return t},createBaseThemeLayer:function(e,t){let i=e.style,r=e.opacity,s=t.vectorType,n=i.pointStyle;n.fill="LINE"!==s;var a={};a.radius=n.pointRadius,a.color=n.strokeColor,a.opacity=n.strokeOpacity,a.lineCap=n.strokeLineCap,a.weight=n.strokeWidth,a.fillColor=n.fillColor,a.fillOpacity=n.fillOpacity;var o=(e,t)=>ao().circleMarker(t,a);return n.unicode&&(o=((e,t)=>new ul(t,n))),ao().geoJSON({type:"GeometryCollection",geometries:[]},{pointToLayer:o,opacity:r})},createUniqueLayer:function(e,t){for(var i=e.title,r=t.field,s=[],n=t.settings,a=e.isVisible,o=e.opacity,l=t.vectorType,h=0;h<n.length;h++){var u={};u.value=n[h].value,u.style=n[h].style,s.push(u)}var c=new nl(i,{opacity:o,visibility:a});this.registerThemeEvent(c),c.style=e.style.pointStyle,c.style.fill="LINE"!==l,c.style.stroke=!0,c.themeField=r,c.styleGroups=s;var d=this;return c.on("click",function(e){if(e.target&&e.target.refDataID){var t=c.getFeatureById(e.target.refDataID);d.events.triggerEvent("uniquefeatureclicked",t,c)}}),c},createRangeLayer:function(e,t){var i=e.title,r=t.field,s=[],n=t.settings,a=e.isVisible,o=e.opacity,l=t.vectorType,h=e.style.pointStyle;h.fill="LINE"!==l;for(var u=0;u<n.length;u++){var c={};c.start=n[u].start,c.end=n[u].end,c.style=n[u].style,s.push(c)}var d=new al(i,{visibility:a,opacity:o});return this.registerThemeEvent(d),d.style=e.style.pointStyle,d.style.stroke=!0,d.themeField=r,d.styleGroups=s,d},createLabelLayer:function(e,t){var i,r=e.title,s=t.labelField,n=t.settings,a=e.isVisible;i=!n||n.length>0?{fillColor:"#ffffff"}:n[0].style;var o=ao().Util.extend(new Nn,i);o.fontWeight="bold",o.fontSize="14px",o.labelRect=!0,o.strokeColor=o.fillColor,o.fontColor=t.labelColor,t.labelFont&&(o.fontFamily=t.labelFont);var l=new ol(r,{visibility:a,opacity:.7});return this.registerThemeEvent(l),l.style=o,l.themeField=s,l.styleGroups=[],l},createHeatLayer:function(e,t){let i,r=t.colors||["blue","cyan","lime","yellow","red"],s={};for(let e=0,t=r.length,i=1;e<t;e++)s[i/t]=r[e],i++;let n=t.settings[0].radius;return"千米"!==t.heatUnit&&"km"!==t.heatUnit||(n=1e3*t.heatRadius),t.settings[0]&&t.settings[0].featureWeight&&(i=t.settings[0].featureWeight),ao().heatLayer([],{radius:n/2,minOpacity:e.opacity,gradient:s,blur:n/2,featureWeight:i})},addFeature2ThemeLayer:function(e,i){if("FEATURE_LAYER"===e.layerType&&"THEME"===e.identifier){var r=this,s=!!e.datasourceName,n=e.cartoCSS;if(n)var a=this.getCartoCSS2Obj(n).needTransform,o=this.getCartoCSS2Obj(n).isAddFile;var l,h,u,c=e.url,d=e.credential,p=e.themeSettings,f=p.filter;if(o){var m=JSON.parse(e.datasourceName),y=this.getSQLFromFilter(f);if(c)this.getFeatureFromFileAdded(e,function(t){var s,n=[];if("EXCEL"===t.type||"CSV"===t.type)for(var o=0,l=(s=r.parseFeatureFromEXCEL.apply(r,[t.content.rows,t.content.colTitles,!1,m])).length;o<l;o++)Xo()({attr:s[o].attributes},y).length>0&&n.push(s[o]);else for(var h=0,u=(s=r.parseFeatureFromJson(t.content)).length;h<u;h++)Xo()({attr:s[h].attributes},y).length>0&&n.push(s[h]);var c=e.prjCoordSys&&e.prjCoordSys.epsgCode;a?r.changeFeatureLayerEpsgCode(c,"4326",i,n,function(e){E(e)}):E(n)},function(){});else{for(var g=[],v=e.features,b=0,_=v.length;b<_;b++){var S=v[b];if(Xo()({attr:S.attributes},y).length>0){var x=S.geometry.points[0].x,w=S.geometry.points[0].y,C=new le(x,w),M=new xe(C,S.attributes,S.style);g.push(M)}}E(g)}}else if(s){var A=e.datasourceName;u=(h=(l=e.subLayers&&JSON.parse(e.subLayers)).length&&l.length>0?l[0]:l)&&h.name,this.getFeaturesBySQL(e.url,A,u,p.filter,t.ISERVER,t=>{var r,s,n=t.result,o=[];if(n&&n.features){for(var l=0,h=(r=n.features).length;l<h;l++)s=is.fromJson(r[l]).toFeature(),o.push(s);var u=e.prjCoordSys&&e.prjCoordSys.epsgCode;a?this.changeFeatureLayerEpsgCode(u,"4326",i,o,function(e){E(e)}):E(r)}})}else{u=(h=(l=e.subLayers&&JSON.parse(e.subLayers)).length&&l.length>0?l[0]:l)&&h.name;var T=e.prjCoordSys&&e.prjCoordSys.epsgCode;this.getFeaturesBySQL(c,d,u,f,t.ISERVER,function(e){a?r.changeFeatureLayerEpsgCode(T,"4326",i,e,function(e){E(e)}):E(e)})}}function E(t){if(i&&i.labelLayer instanceof ol&&r.addFeature2LabelLayer(i.labelLayer,t,e),ao().HeatLayer&&i instanceof ao().HeatLayer){var s=[];for(let e=0,r=t.length;e<r;e++){let r=t[e].geometry;s[e]=ao().latLng(r.y,r.x),i.options.featureWeight&&(s[e]=[s[e].lat,s[e].lng,parseFloat(t[e].attributes[i.options.featureWeight])])}i.setLatLngs(s)}else i instanceof ao().GeoJSON?i.addData((new Oe).toGeoJSON(t)):i.addFeatures(t)}},addFeature2LabelLayer:function(e,t,i){if(t){for(var r,s,n=i.themeSettings,a=(n="string"==typeof n?JSON.parse(i.themeSettings):i.themeSettings).labelField,o=e.style,l=[],h=i.styleString&&JSON.parse(i.styleString),u=0;u<t.length;u++){s=this.getLabelLngLat(n.vectorType,t[u]),this.setLabelOffset(n.vectorType,h,t[u],o);var c=t[u].attributes;r=new il([s.lat,s.lng,c[a]],c),l.push(r)}e.style=o,e.addFeatures(l)}},setLabelOffset:function(e,t,i,r){if("POINT"===e){var s=t.pointStyle.pointRadius||0,n=t.pointStyle.strokeWidth||0,a=parseInt(t.pointStyle.fontSize)||0;r.labelXOffset=0,r.labelYOffset=t.pointStyle.unicode?20+a:25+(s+n)}},getLabelLngLat:function(e,t){var i={};if("POINT"===e){var r=t.geometry;i.lng=r.x,i.lat=r.y}else if("LINE"===e){var s,n,a=t.geometry.components;if(a[0].x)s=a.length,n=parseInt(s/2),i.lng=a[n].x,i.lat=a[n].y;else{var o=a[0].components;s=o.length,n=parseInt(s/2),i.lng=o[n].x,i.lat=o[n].y}}else{var l=t.geometry.getCentroid();i.lng=l.x,i.lat=l.y}return i},changeFeatureLayerEpsgCode:function(e,t,i,r,s){var n,a,o=this,l=[];if(e&&t){if(r&&r.length>0){for(n=0,a=r.length;n<a;n++){var h=r[n].geometry.getVertices();l=l.concat(h)}e="EPSG:"+e,t="EPSG:"+t,o.coordsTransform(e,t,l,function(e,t){return function(e){var i=e.length;for(n=0;n<i;n++){var r=l[n],a=e[n];r.x=a.x,r.y=a.y,r.calculateBounds()}for(n=0,i=t.length;n<i;n++){var h=t[n].geometry;h.components&&o.calculateComponents(h.components),h.calculateBounds()}s&&s.call(o,t)}}(0,r))}return!0}},calculateComponents:function(e){if(e)if(e.components)this.calculateComponents(e.components);else for(var t=0,i=e.length;t<i;t++){var r=e[t];r.components&&this.calculateComponents(r.components),r.calculateBounds()}},coordsTransform:function(e,t,i,r){var s,n=this.SERVER_TYPE_MAP[e],a=this.SERVER_TYPE_MAP[t];if(e!==t&&n&&a){var o=this.SERVER_TYPE_MAP["EPSG:3857"],l=this.SERVER_TYPE_MAP["EPSG:4326"];if(n!==o&&n!==l||a!==o&&a!==l){var h=n+"_"+a;this.postTransform(h,i,r)}else this.projTransform(e,t,i,r)}else{if(i&&void 0!==i.length){s=[];for(var u=0,c=i.length;u<c;u++){var d={x:i[u].x,y:i[u].y};s.push(d)}}else s={x:i.x,y:i.y};r&&r.call(this,s)}},projTransform:function(e,t,i,r){var s;if(lo()){if(i&&void 0!==i.length){s=[];for(var n=0,a=i.length;n<a;n++){var o=lo()(e,t,[i[n].x,i[n].y]);s.push({x:o[0],y:o[1]})}}else s={x:(s=lo()(e,t,[i.x,i.y]))[0],y:s[1]};r&&(this.fire("coordconvertsuccess",{newCoor:s}),r.call(this,s))}},postTransform:function(e,t,i){var r=[];if(!e)return i.call(this,null);if(t&&void 0!==t.length)for(var s=0,n=t.length;s<n;s++)r.push({x:t[s].x,y:t[s].y});else r=[{x:t.x,y:t.y}];if(0===r.length)return i.call(this,null);var a={convertType:e,points:r},o=this.server+"/apps/viewer/coordconvert.json";a=JSON.stringify(a);var l={};!ee.isInTheSameDomain(o)&&this.proxy&&(l.proxy=this.proxy),Ue.post(o,a,l).then(e=>e.json()).then(e=>{var r=e;t||void 0===t.length||(r=r[0]),this.fire("coordconvertsuccess",{newCoors:r}),i.call(this,r)}).catch(e=>{this.actived&&this.fire("coordconvertfailed",{err:e})})},getSQLFromFilter:function(e){return e?" * where ("+(e=e.replace(/=/g,"==").replace(/and|AND/g,"&&").replace(/or|OR/g,"||").replace(/>==/g,">=").replace(/<==/g,"<="))+")":" * where (1==1||1>=0)"},getAttributesObjFromTable:function(e,t){if(0!==e.length&&0!==t.length){for(var i=[],r=0;r<e.length;r++){for(var s={},n=0;n<t.length;n++)s[t[n]]=e[r][n];i.push(s)}return i}},parseFeatureFromEXCEL:function(e,t,i,r){for(var s=this.getAttributesObjFromTable(e,t),n=[],a=0,o=s.length;a<o;a++){var l=s[a][r.lon],h=s[a][r.lat];if(l&&h){l=parseFloat(l),h=parseFloat(h);var u,c=new le(l,h);u=i?new tl(c,s[a],null):new xe(c,s[a],null),n.push(u)}}return n},parseFeatureFromJson:function(e){var t=new Oe,i=t.read(e);if(null==i){var r=JSON.parse(e.replace(/'/,'"'));(r.isAnalyseResult||"MapEditor"===r.type||"DataInsights"===r.type||"ISERVER"===r.type)&&(r=r.data.recordsets[0].features),i=(t=new Oe).read(r)}for(var s=0,n=i.length;s<n;s++)i[s].attributes=i[s].attributes.properties||i[s].attributes;return i},getFeatureFromFileAdded:function(e,t,i,r){var s=r?e.url+"?currentPage=1&&pageSize=9999999":e.url;Ue.get(s).then(e=>e.json()).then(e=>{t&&t(e)}).catch(e=>i&&i(e))},getCartoCSS2Obj:function(e){var t,i=!1;return e.indexOf("}")>-1?(i=(e=JSON.parse(e)).needTransform,t=e.isAddFile):"needTransform"===e?(i=!0,t=!1):t="true"===e,{isAddFile:t,needTransform:i}},registerThemeEvent:function(e){e.on("click",t=>{if(!e.map)return;let i;this.selectedFeature&&(this.fire("featureunselected",{feature:this.selectedFeature}),this.selectedFeature=null),t.target&&t.target.refDataID&&(i=e.getFeatureById(t.target.refDataID)),i&&(this.selectedFeature=i,this.fire("featureselected",{feature:i}))}),e.on("mousemove",t=>{if(e.map&&t.target&&t.target.refDataID){let i;t.target&&t.target.refDataID&&(i=e.getFeatureById(t.target.refDataID)),i&&this.fire("featuremousemove",{feature:i})}})},SERVER_TYPE_MAP:{"EPSG:4326":"WGS84","EPSG:3857":"MERCATOR","EPSG:900913":"MERCATOR","EPSG:102113":"MERCATOR","EPSG:910101":"GCJ02","EPSG:910111":"GCJ02MERCATOR","EPSG:910102":"BD","EPSG:910112":"BDMERCATOR"}}),dl=ao().TileLayer.extend({options:{collectionId:null,sqlFilter:null,ids:null,names:null,renderingRule:null,format:"png",zoomOffset:1,transparent:!0,cacheEnabled:!0,tileProxy:null,attribution:co.Common.attribution,subdomains:null},initialize:function(e,t){this._url=e,ao().TileLayer.prototype.initialize.apply(this,arguments),ao().setOptions(this,t),ao().stamp(this)},onAdd:function(e){ao().TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._getLayerUrl()+"&z="+this._getZoomForUrl()+"&x="+e.x+"&y="+e.y;return this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),this.options.cacheEnabled||(t+="&_t="+(new Date).getTime()),this.options.subdomains&&(t=ao().Util.template(t,{s:this._getSubdomain(e)})),t},_getLayerUrl:function(){return this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){let e=ee.urlPathAppend(this._url,`/collections/${this.options.collectionId}/tile.${this.options.format}`);return this.requestParams=this.requestParams||this._getAllRequestParams(),e=ee.urlAppend(e,no.Util.getParamString(this.requestParams)),e=je.appendCredential(e),this._layerUrl=e,e},_getAllRequestParams:function(){var e=this.options||{},t={};return t.transparent=!0===e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),e.sqlFilter&&(t.sqlFilter=e.sqlFilter),e.renderingRule&&(t.renderingRule=JSON.stringify(e.renderingRule)),e.ids&&(t.ids=e.ids.join(",")),e.names&&(t.names=e.names.join(",")),t}});function pl(e,t){const{maxZoom:i=22}=t||{},{bounds:r,prjCoordSys:s,dpi:n,visibleScales:a,coordUnit:o}=e,l=An(a,r,n,o,i);if(fl(s))return function(e){let t={bounds:ao().bounds([e.left,e.bottom],[e.right,e.top]),origin:ao().point(e.left,e.top)};return new Eo(t)}(r);const h=yl(s);return ml(h)?function(e,{bounds:t,dpi:i,resolutions:r}){const s=lo()(e,"EPSG:4326").forward([t.left,0],!0),n=lo()(e,"EPSG:4326").forward([t.right,0],!0);let a={wrapLng:[parseInt(s[0]),parseInt(n[0])],bounds:ao().bounds([t.left,t.bottom],[t.right,t.top]),origin:[t.left,t.top],dpi:i};r&&r.length>0&&(a.resolutions=r);return new ho(e,a)}(h,{bounds:r,dpi:n,resolutions:l}):void 0}function fl(e){return"PCS_NON_EARTH"===e.type}function ml(e,t=!0){try{lo()(e)}catch(i){return t&&console.error(`The projection of ${e} is missing, please register the projection of ${e} first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection`),!1}return!0}function yl(e){const{type:t,epsgCode:i}=e;return"PCS_NON_EARTH"==t?"":"EPSG:"+i}var gl=po.extend({options:{geometry:null,prjCoordSys:null,excludeField:null},initialize:function(e,t){t=t||{},ao().setOptions(this,t),t.projection&&(this.options.prjCoordSys=t.projection),po.prototype.initialize.call(this,e,t),this.dataFlow=new Rt(e,t),this.dataFlow.events.on({broadcastSocketConnected:this._defaultEvent,broadcastSocketError:this._defaultEvent,broadcastFailed:this._defaultEvent,broadcastSucceeded:this._defaultEvent,subscribeSocketConnected:this._defaultEvent,subscribeSocketError:this._defaultEvent,messageSucceeded:this._defaultEvent,setFilterParamSucceeded:this._defaultEvent,scope:this})},initBroadcast:function(){return this.dataFlow.initBroadcast(),this},broadcast:function(e){this.dataFlow.broadcast(e)},initSubscribe:function(){return this.dataFlow.initSubscribe(),this},setExcludeField:function(e){return this.dataFlow.setExcludeField(e),this.options.excludeField=e,this},setGeometry:function(e){return this.dataFlow.setGeometry(e),this.options.geometry=e,this},unSubscribe:function(){this.dataFlow.unSubscribe()},unBroadcast:function(){this.dataFlow.unBroadcast()},_defaultEvent:function(e){this.fire(e.eventType||e.type,e)}});const vl=function(){try{return mapv}catch(e){return{}}}();var bl=vl.baiduMapLayer?vl.baiduMapLayer.__proto__:Function;var _l=ao().Layer.extend({options:{attributionPrefix:null,attribution:co.MapV.attribution},initialize:function(e,t,i){i=i||{},this.dataSet=e||{},this.mapVOptions=t||{},this.render=this.render.bind(this),ao().Util.setOptions(this,i),this.options.attributionPrefix&&(this.options.attribution=this.options.attributionPrefix+this.options.attribution),this.canvas=this._createCanvas(),ao().stamp(this)},onAdd:function(e){this._map=e;var t=this.getPane(),i=this.container=ao().DomUtil.create("div","leaflet-layer leaflet-zoom-animated",t);i.appendChild(this.canvas);var r=e.getSize();i.style.width=r.x+"px",i.style.height=r.y+"px",this.renderer=new class extends bl{constructor(e,t,i,r){super(e,i,r),bl&&(r=r||{},this.init(r),this.argCheck(r),this.canvasLayer=t,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this._moveStartEvent=this.moveStartEvent.bind(this),this._moveEndEvent=this.moveEndEvent.bind(this),this._zoomStartEvent=this.zoomStartEvent.bind(this),this.bindEvent())}clickEvent(e){var t=this.map.containerPointToLayerPoint([0,0]),i=this.devicePixelRatio=this.canvasLayer.devicePixelRatio=window.devicePixelRatio||1,r=e.layerPoint;super.clickEvent(ao().point((r.x-t.x)/i,(r.y-t.y)/i),e)}mousemoveEvent(e){var t=e.layerPoint;super.mousemoveEvent(t,e)}bindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.on("click",this.clickEvent),this.options.methods.mousemove&&e.on("mousemove",this.mousemoveEvent)),this.map.on("movestart",this._moveStartEvent),this.map.on("moveend",this._moveEndEvent),this.map.on("zoomstart",this._zoomStartEvent)}destroy(){this.unbindEvent(),this.clearData(),this.animator&&this.animator.stop(),this.animator=null,this.canvasLayer=null}unbindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent)),this.map.off("movestart",this._moveStartEvent),this.map.off("moveend",this._moveEndEvent),this.map.off("zoomstart",this._zoomStartEvent)}getContext(){return this.canvasLayer.getCanvas().getContext(this.context)}addData(e,t){var i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}update(e){var t=e||{},i=t.data;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t.options})}getData(){return this.dataSet}removeData(e){if(this.dataSet){var t=this.dataSet.get({filter:function(t){return null==e||"function"!=typeof e||!e(t)}});this.dataSet.set(t),this.update({options:null})}}clearData(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}_canvasUpdate(e){if(this.canvasLayer){var t=this,i=t.options.animation,r=this.getContext(),s=this.map;if(t.isEnabledTime()){if(void 0===e)return void this.clear(r);"2d"===this.context&&(r.save(),r.globalCompositeOperation="destination-out",r.fillStyle="rgba(0, 0, 0, .1)",r.fillRect(0,0,r.canvas.width,r.canvas.height),r.restore())}else this.clear(r);if("2d"===this.context)for(var n in t.options)r[n]=t.options[n];else r.clear(r.COLOR_BUFFER_BIT);if(!(t.options.minZoom&&s.getZoom()<t.options.minZoom||t.options.maxZoom&&s.getZoom()>t.options.maxZoom)){var a=s.getBounds(),o=a.getEast()-a.getWest(),l=a.getNorth()-a.getSouth(),h=s.getSize(),u=o/h.x,c=l/h.y,d=No("DEGREE")*u,p=this.canvasLayer.getTopLeft(),f=s.latLngToAccurateContainerPoint(p),m={transferCoordinate:function(e){var i,r={x:(i="2d"===t.context?s.latLngToAccurateContainerPoint(ao().latLng(e[1],e[0])):{x:(e[0]-p.lng)/u,y:(p.lat-e[1])/c}).x-f.x,y:i.y-f.y};return[r.x,r.y]}};void 0!==e&&(m.filter=function(t){var r=i.trails||10;return e&&t.time>e-r&&t.time<e});var y=t.dataSet.get(m);this.processData(y);var g=s.latLngToContainerPoint(ao().latLng(0,0)),v={x:g.x-f.x,y:g.y-f.y};"m"===t.options.unit?(t.options.size&&(t.options._size=t.options.size/d),t.options.width&&(t.options._width=t.options.width/d),t.options.height&&(t.options._height=t.options.height/d)):(t.options._size=t.options.size,t.options._height=t.options.height,t.options._width=t.options.width),this.drawContext(r,y,t.options,v),t.options.updateCallback&&t.options.updateCallback(e)}}}init(e){this.options=e,this.initDataRange(e),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}addAnimatorEvent(){}moveStartEvent(){var e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start,this._hide())}moveEndEvent(){this.canvasLayer.draw(),this._show()}zoomStartEvent(){this._hide()}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}_hide(){this.canvasLayer.canvas.style.display="none"}_show(){this.canvasLayer.canvas.style.display="block"}draw(){this.canvasLayer.draw()}}(e,this,this.dataSet,this.mapVOptions),this.draw(),this.fire("loaded")},onRemove:function(){ao().DomUtil.remove(this.container),this.renderer.destroy()},addData:function(e,t){this.renderer.addData(e,t)},update:function(e){this.renderer.update(e)},getData:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet},removeData:function(e){this.renderer&&this.renderer.removeData(e)},clearData:function(){this.renderer.clearData()},draw:function(){return this._reset()},setZIndex:function(e){this.canvas.style.zIndex=e},render:function(){this.renderer._canvasUpdate()},getCanvas:function(){return this.canvas},getContainer:function(){return this.container},getTopLeft:function(){var e,t=this._map;t&&(e=t.getBounds().getNorthWest());return e},_createCanvas:function(){var e=document.createElement("canvas");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.options.zIndex||600;var t="undefined"==typeof window?{}:window,i=this.devicePixelRatio=t.devicePixelRatio||1;return this.mapVOptions.context&&"2d"!==this.mapVOptions.context||e.getContext("2d").scale(i,i),e},_resize:function(){var e=this.canvas;if(e){var t=this._map,i=t.getSize();"heatmap"===this.mapVOptions.draw?(e.width=parseInt(i.x)*this.devicePixelRatio,e.height=parseInt(i.y)*this.devicePixelRatio):(e.width=parseInt(i.x),e.height=parseInt(i.y)),e.style.width=i.x+"px",e.style.height=i.y+"px";var r=t.getBounds(),s=t.latLngToLayerPoint(r.getNorthWest());ao().DomUtil.setPosition(e,s)}},_reset:function(){this._resize(),this._render()},redraw:function(){this._resize(),this._render()},_render:function(){this.render()}}),Sl=_l.extend({initialize:function(e,t){t=t||{},ao().Util.setOptions(this,t),this.data=[],this.mapVOptions={draw:"simple"},_l.prototype.initialize.call(this,new window.mapv.DataSet([]),this.mapVOptions,t),this.idCache={},this.url=e,this._last=new Date,this._imageCache={}},onMessageSuccessed:function(e){const t=e.featureResult.properties.id,i=e.featureResult.geometry,r={geometry:e.featureResult.geometry};if("Point"===i.type&&this.options.pointToLayer){const s=this.options.pointToLayer(e.featureResult,ao().latLng(i.coordinates[1],i.coordinates[0]));if(s instanceof ao().Marker){this.mapVOptions.draw="icon";let n=s.options.icon;const a=`${n._getIconUrl("icon")}_${n.options.iconSize?n.options.iconSize[0]:null}_${n.options.iconSize?n.options.iconSize[1]:null}`;let o=this._imageCache[a];o||(o=n.createIcon(),this._imageCache[a]=o,o.onload=(()=>{this.update({data:this.data,options:this.mapVOptions})})),r.icon=o,(n.options.iconSize||o.style.height)&&(this.mapVOptions.offset={x:0,y:-(n.options.iconSize[1]||o.style.height)/2}),this.options.deg&&(r.deg=this.options.deg,"function"==typeof r.deg&&this.idCache[t]&&this.data[this.idCache[t]]&&(r.deg=r.deg(e.featureResult,ao().latLng(i.coordinates[1],i.coordinates[0]),this.data[this.idCache[t]])))}if(s instanceof ao().CircleMarker){this.mapVOptions.draw="simple";const e=this._toMapvStyle(s);for(const t in e)e.hasOwnProperty(t)&&(r[t]=e[t])}}else if(this.options.style){const t=this._toMapvStyle(this.options.style(e.featureResult));for(const e in t)t.hasOwnProperty(e)&&(r[e]=t[e])}void 0==this.idCache[t]?(this.data.push(r),this.idCache[t]=this.data.length-1):this.data[this.idCache[t]]=r,new Date-this._last>200&&(this._last=new Date,this.update({data:this.data,options:this.mapVOptions}))},_toMapvStyle:function(e){const t={draw:"simple"};return t.strokeStyle=e.color,t.lineWidth=e.width,t.globalAlpha=e.fillOpacity||e.opacity,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.fillStyle=e.fillColor,t.size=e.radius,t}}),xl=ao().GeoJSON.extend({initialize:function(e,t){(t=t||{}).style&&!t.pointToLayer&&(t.pointToLayer=function(e,i){return ao().circleMarker(i,t.style())}),ao().Util.setOptions(this,t),this._layers={},ao().stamp(this),this.url=e,this.idCache={}},onMessageSuccessed:function(e){const t=e.featureResult,i=e.featureResult.properties[this.options.idField];let r=null;void 0!==i&&this.idCache[i]?(r=this.getLayer(this.idCache[i]),this._updateLayerData(r,t)):((r=ao().GeoJSON.geometryToLayer(t,this.options)).feature=ao().GeoJSON.asFeature(t),this.addLayer(r),void 0!==i&&(this.idCache[i]=this.getLayerId(r))),this.options.onEachFeature&&this.options.onEachFeature(t,r)},_updateLayerData:function(e,t){t.properties&&(e.feature.properties=t.properties);var i=[];switch(t.geometry.type){case"Point":i=ao().GeoJSON.coordsToLatLng(t.geometry.coordinates),e.setLatLng(i);break;case"LineString":i=ao().GeoJSON.coordsToLatLngs(t.geometry.coordinates,0),e.setLatLngs(i);break;case"MultiLineString":case"Polygon":i=ao().GeoJSON.coordsToLatLngs(t.geometry.coordinates,1),e.setLatLngs(i);break;case"MultiPolygon":i=ao().GeoJSON.coordsToLatLngs(t.geometry.coordinates,2),e.setLatLngs(i)}}}),wl=ao().LayerGroup.extend({options:{geometry:null,prjCoordSys:null,excludeField:null,idField:"id",render:"normal"},initialize:function(e,t){t=t||{},ao().Util.setOptions(this,t),this.url=e,this._layers={},this.dataService=new gl(this.url,{geometry:this.options.geometry,prjCoordSys:this.options.prjCoordSys,excludeField:this.options.excludeField})},onAdd:function(e){this.dataService.initSubscribe(),this.dataService.on("subscribeSocketConnected",e=>this.fire("subscribesucceeded",e)),this.dataService.on("subscribeSocketError",e=>this.fire("subscribefailed",e)),this.dataService.on("messageSucceeded",e=>this._onMessageSuccessed(e)),this.dataService.on("setFilterParamSucceeded",e=>this.fire("setfilterparamsucceeded",e)),"mapv"===this.options.render?this.addLayer(new Sl(this.url,this.options)):this.addLayer(new xl(this.url,this.options)),ao().LayerGroup.prototype.onAdd.call(this,e)},onRemove:function(e){ao().LayerGroup.prototype.onRemove.call(this,e),this.dataService&&this.dataService.unSubscribe()},setExcludeField:function(e){return this.dataService.setExcludeField(e),this.options.excludeField=e,this},setGeometry:function(e){return this.dataService.setGeometry(e),this.options.geometry=e,this},_onMessageSuccessed:function(e){this.getLayers().map(t=>(t.onMessageSuccessed&&(t.onMessageSuccessed(e),this.fire("dataupdated",{layer:t,data:e.featureResult})),t))}});const Cl=ao().Layer.extend({includes:[],_echartsContainer:null,_map:null,_ec:null,_echartsOptions:null,options:{attribution:co.ECharts.attribution,loadWhileAnimating:!1},initialize:function(e,t){ao().Util.setOptions(this,t),this.setOption(e)},setOption:function(e,t,i){const r=e.baseOption||e;r.LeafletMap=r.LeafletMap||{roam:!0},r.animation=!0===r.animation,this._echartsOptions=e,this._ec&&this._ec.setOption(e,t,i)},getEcharts:function(){return this._ec},_disableEchartsContainer:function(){this._echartsContainer.style.visibility="hidden"},_enableEchartsContainer:function(){this._echartsContainer.style.visibility="visible"},onAdd:function(e){this._map=e,this._initEchartsContainer(),this._ec=Ca.init(this._echartsContainer),this._ec.leafletMap=e;const t=this;e.on("zoomstart",function(){t._disableEchartsContainer()}),!t.options.loadWhileAnimating&&e.on("movestart",function(){t._disableEchartsContainer()}),Ca.registerAction({type:"LeafletMapLayout",event:"LeafletMapLayout",update:"updateLayout"},function(e){}),Ca.registerCoordinateSystem("leaflet",Ml),Ca.extendComponentModel({type:"LeafletMap",getBMap:function(){return this.__LeafletMap},defaultOption:{roam:!1}}),Ca.extendComponentView({type:"LeafletMap",render:function(e,i,r){let s=!0,n=i.scheduler.ecInstance.leafletMap;const a=r.getZr().painter.getViewportRoot(),o=n.options.zoomAnimation&&ao().Browser.any3d;a.className=" leaflet-layer leaflet-zoom-"+(o?"animated":"hide")+" echarts-layer";const l=ao().DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);a.style[l]="50% 50%";const h=e.coordinateSystem,u=r.getZr().painter.getLayers();Tl(t._map,a);const c=function(){if(s)return;const i=Tl(t._map,a);if(!t.options.loadWhileAnimating){for(let e in u)u.hasOwnProperty(e)&&u[e]&&(n=u[e].ctx)&&n.clearRect&&n.clearRect(0,0,n.canvas.width,n.canvas.height);t._enableEchartsContainer()}var n;h.setMapOffset(i),e.__mapOffset=i,r.dispatchAction({type:"LeafletMapLayout"})};function d(){s||(r.dispatchAction({type:"LeafletMapLayout"}),t._enableEchartsContainer())}t._oldMoveHandler&&n.off(t.options.loadWhileAnimating?"move":"moveend",t._oldMoveHandler),t._oldZoomEndHandler&&n.off("zoomend",t._oldZoomEndHandler),n.on(t.options.loadWhileAnimating?"move":"moveend",c),n.on("zoomend",d),t._oldMoveHandler=c,t._oldZoomEndHandler=d,s=!1}}),this._ec.setOption(this._echartsOptions)},onRemove:function(){this._ec.clear(),this._ec.dispose(),delete this._ec,ao().DomUtil.remove(this._echartsContainer),this._oldZoomEndHandler&&(this._map.off("zoomend",this._oldZoomEndHandler),this._oldZoomEndHandler=null),this._oldMoveHandler&&(this._map.off(this.options.loadWhileAnimating?"move":"moveend",this._oldMoveHandler),this._oldMoveHandler=null),this._resizeHandler&&(this._map.off("resize",this._resizeHandler),this._resizeHandler=null),delete this._map},_initEchartsContainer:function(){const e=this._map.getSize(),t=document.createElement("div");t.style.position="absolute",t.style.height=e.y+"px",t.style.width=e.x+"px",t.style.zIndex=10,this._echartsContainer=t,this.getPane().appendChild(this._echartsContainer);const i=this;function r(e){let t=e.newSize;i._echartsContainer.style.width=t.x+"px",i._echartsContainer.style.height=t.y+"px",i._ec.resize()}this._map.on("resize",r),this._resizeHandler=r}});function Ml(e){this._LeafletMap=e,this.dimensions=["lng","lat"],this._mapOffset=Al(e)}function Al(e){const t=e.containerPointToLayerPoint([0,0]);return[t.x||0,t.y||0]}function Tl(e,t){const i=Al(e);return t.style.left=i[0]+"px",t.style.top=i[1]+"px",i}Ml.prototype.dimensions=["lng","lat"],Ml.prototype.setMapOffset=function(e){this._mapOffset=e},Ml.prototype.getBMap=function(){return this._LeafletMap},Ml.prototype.prepareCustoms=function(){const e=Ca.util,t=this.getViewRect();return{coordSys:{type:"leaflet",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){const r=i[e],s=t[e]/2,n=[],a=[];return n[e]=r-s,a[e]=r+s,n[1-e]=a[1-e]=i[1-e],Math.abs(this.dataToPoint(n)[e]-this.dataToPoint(a)[e])},this)},this)}}},Ml.prototype.dataToPoint=function(e){null===e[1]&&(e[1]=ao().CRS.EPSG3857.projection.MAX_LATITUDE);const t=this._LeafletMap.latLngToLayerPoint([e[1],e[0]]),i=this._mapOffset;return[t.x-i[0],t.y-i[1]]},Ml.prototype.fixLat=function(e){return e>=90?89.99999999999999:e<=-90?-89.99999999999999:e},Ml.prototype.pointToData=function(e){let t=this._mapOffset,i=this._LeafletMap.layerPointToLatLng([e[0]+t[0],e[1]+t[1]]);return[i.lng,i.lat]},Ml.prototype.getViewRect=function(){const e=this._LeafletMap.getSize();return new Ca.graphic.BoundingRect(0,0,e.x,e.y)},Ml.prototype.getRoamTransform=function(){return Ca.matrix.create()},Ml.dimensions=Ml.prototype.dimensions,Ml.create=function(e){let t,i=e.scheduler.ecInstance.leafletMap;e.eachComponent("LeafletMap",function(e){t||(t=new Ml(i)),e.coordinateSystem=t,e.coordinateSystem.setMapOffset(e.__mapOffset||Al(i))}),e.eachSeries(function(e){"leaflet"===e.get("coordinateSystem")&&(t||(t=new Ml(i)),e.coordinateSystem=t,e.animation=!0===e.animation)})};function El(e){var t=document.createElement("canvas");return t&&t.getContext(e)}var Ll=ao().Class.extend({options:{radius:10,angele:60,spaceAngle:0,count:3,fill:!1,stroke:!0,color:"#3388ff",weight:1,lineCap:"round",lineJoin:"round",fillColor:"#66ccff",fillOpacity:.2,fillRule:"evenodd",opacity:1,strokeWidth:1},initialize:function(e){e=e||{},ao().Util.setOptions(this,e),this._canvas=document.createElement("canvas"),this._canvas.width=2*(this.options.radius+this.options.weight),this._canvas.height=2*(this.options.radius+this.options.weight),this._ctx=this._canvas.getContext("2d");var t=void 0===this.options.strokeWidth?1:this.options.strokeWidth;this.options.width=2*(this.options.radius+t)+1,this._initStyle()},getStyle:function(){return this._canvas},drawSector:function(e,t,i,r,s,n){s=s/180*Math.PI,n=n/180*Math.PI,e.moveTo(t,i),e.lineTo(t+r*Math.cos(s),i+r*Math.sin(s)),e.arc(t,i,r,s,n),e.lineTo(t,i)},_initStyle:function(){var e=0,t=this.options,i=t.angle;if(t.spaceAngle=360/t.count-t.angle,!(t.spaceAngle<0)){this._ctx.beginPath(),this.anchor=[t.width/2,t.width/2];for(var r=0;r<t.count;r++)this.drawSector(this._ctx,this.anchor[0],this.anchor[1],t.radius,e,i),i=(e=i+t.spaceAngle)+t.angle;this._fillStroke()}},_fillStroke:function(){var e=this.options;e.fill&&(this._ctx.globalAlpha=e.fillOpacity,this._ctx.fillStyle=e.fillColor||e.color,this._ctx.fill(e.fillRule||"evenodd")),e.stroke&&0!==e.weight&&(this._ctx.globalAlpha=e.opacity,this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color,this._ctx.lineCap=e.lineCap,this._ctx.lineJoin=e.lineJoin,this._ctx.stroke())}}),Ol=ao().Class.extend({options:{stroke:!0,color:"#3388ff",weight:1,opacity:1,lineCap:"round",lineJoin:"round",fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",radius:3},initialize:function(e){e=e||{},ao().Util.setOptions(this,e),this._canvas=document.createElement("canvas"),this._canvas.width=2*(this.options.radius+this.options.weight),this._canvas.height=2*(this.options.radius+this.options.weight),this._ctx=this._canvas.getContext("2d"),this._initStyle()},getCanvas:function(){return this._canvas},getStyle:function(){return this._canvas},_initStyle:function(){this._ctx.beginPath(),this._ctx.arc(this._canvas.width/2,this._canvas.height/2,this.options.radius,0,2*Math.PI),this._fillStroke()},_fillStroke:function(){var e=this.options;e.fill&&(this._ctx.globalAlpha=e.fillOpacity,this._ctx.fillStyle=e.fillColor||e.color,this._ctx.fill(e.fillRule||"evenodd")),e.stroke&&0!==e.weight&&(this._ctx.globalAlpha=e.opacity,this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color,this._ctx.lineCap=e.lineCap,this._ctx.lineJoin=e.lineJoin,this._ctx.stroke())}}),Pl=ao().Class.extend({options:{img:null,origin:[0,0],anchor:null,size:null},initialize:function(e){e=e||{},ao().Util.setOptions(this,e),this._canvas=document.createElement("canvas"),this._canvas.width=2*(this.options.radius+this.options.weight),this._canvas.height=2*(this.options.radius+this.options.weight),this._ctx=this._canvas.getContext("2d")},getStyle:function(){return this.options}});const Nl=ao().Util.falseFn;var Il=ao().Class.extend({initialize:function(e,t){this.layer=e,t=t||{},ao().Util.setOptions(this,t)},getRenderer:function(){return this.options.renderer},update:function(){this.getRenderer()._clear(),this.getRenderer()._draw()},_getGraphicAtPoint:function(e){const t=this.layer,i=t._map;let r=t._getGraphicsInBounds();for(let t=r.length-1;t>=0;t--){let s,n,a;const o=i.latLngToLayerPoint(r[t].getLatLng());let l=r[t].getStyle();if(!l&&this.defaultStyle&&(l=this.defaultStyle),l.img){let e=l.img.width,t=l.img.height;l.size&&l.size[0]&&l.size[1]&&(e=l.size[0],t=l.size[1]);const i=l.anchor||[e/2,t/2];s=ao().point(o.x-i[0],o.y-i[1]),n=ao().point(s.x+e,s.y+t)}else s=ao().point(o.x-l.width/2,o.y-l.height/2),n=ao().point(o.x+l.width/2,o.y+l.height/2);if((a=ao().bounds(s,n)).contains(e))return r[t]}return null},containsPoint:function(e){return!!this._getGraphicAtPoint(e)},_handleClick:function(e){e.target=null;const t=this.layer,i=t._map,r=this._getGraphicAtPoint(i.latLngToLayerPoint(e.latlng));if(r)return this.layer._renderer._ctx.canvas.style.cursor="pointer",e.target=r,void("click"===e.type&&t.options.onClick&&t.options.onClick.call(t,r,e));this.layer._renderer._ctx.canvas.style.cursor="auto"},_clearBuffer:Nl});ao().Canvas.include({drawGraphics:function(e,t){var i=this;i._drawing&&e.forEach(function(e){var r=e.getStyle();!r&&t&&(r=t),r.img?i._drawImage.call(i,i._ctx,r,e.getLatLng()):i._drawCanvas.call(i,i._ctx,r,e.getLatLng())})},_drawCanvas:function(e,t,i){var r=t,s=this._map.latLngToLayerPoint(i),n=s.x-r.width/2,a=s.y-r.height/2,o=r.width,l=r.height;e.drawImage(r,n,a,o,l)},_drawImage:function(e,t,i){var r,s;if(t.size){var n=t.size;r=n[0],s=n[1]}else r=t.img.width,s=t.img.height;var a=this._coordinateToPoint(i),o=ao().point(a),l=ao().point(t.anchor||[r/2,s/2]);a=[o.x-l.x,o.y-l.y],e.drawImage(t.img,a[0],a[1],r,s)},_coordinateToPoint:function(e){if(!this._map)return e;var t=e;ao().Util.isArray(e)?t=ao().latLng(e[0],e[1]):e instanceof ao().LatLng&&(t=ao().latLng(e.lat,e.lng));var i=this._map.latLngToLayerPoint(t);return[i.x,i.y]}});const Fl=ao().Util.falseFn,kl=function(){let e=document.createElement("div"),t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(let i=0;i<t.length;i++){let r=t[i];if(void 0!==e.style[r])return r}return t[0]}();var Dl=ao().Class.extend({initialize:function(e,t){this.layer=e;let i=t||{};ao().Util.setOptions(this,i),this.options.radius=this._pixelToMeter(this.options.radius),this._initContainer()},getRenderer:function(){return this},update:function(e){e&&e.length>-1&&(this._data=e),this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();let t=this._getLayerState();t.data=this._data||[],this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)},drawGraphics:function(e){this._clearBuffer();let t=this.layer._map.getSize();this._container.width!==t.x&&(this._container.width=t.x),this._container.height!==t.y&&(this._container.height=t.y);let i=this.layer._map.getPanes().mapPane._leaflet_pos;this._container.style[kl]="translate("+-Math.round(i.x)+"px,"+-Math.round(i.y)+"px)",this._data=e||[],this._renderLayer||this._createInnerRender(),this._draw()},_initContainer:function(){this._container=this._createCanvas(this.options.width,this.options.height),this._layerContainer=this.options.container,this._wrapper=ao().DomUtil.create("div","deck-wrapper",this._layerContainer),this._wrapper.appendChild(this._container)},_createCanvas:function(e,t){let i=ao().DomUtil.create("canvas","graphicLayer leaflet-layer leaflet-zoom-hide");return i.oncontextmenu=ao().Util.falseFn,i.width=e,i.height=t,i.style.width=e+"px",i.style.height=t+"px",i},_pixelToMeter:function(e){const t=this.layer._map.getBounds();return e*((t.getEast()-t.getWest())/this.layer._map.getSize().x*(6378137*Math.PI/180))},_createInnerRender:function(){let e=this,t=this._getLayerState(),{color:i,radius:r,opacity:s,highlightColor:n,radiusScale:a,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,outline:u}=t,c={id:"scatter-plot",data:e._data,pickable:Boolean(this.options.onClick)||Boolean(this.options.onHover),autoHighlight:!0,color:i,opacity:s,radius:r,radiusScale:a,highlightColor:n,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,coordinateSystem:this._isWGS84()?window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS:window.DeckGL.COORDINATE_SYSTEM.LNGLAT,isGeographicCoordinateSystem:this._isWGS84(),outline:u,getPosition:function(e){if(!e)return[0,0,0];let t=e.getLatLng();return t&&[t.lng,t.lat,0]},getColor:function(t){let i=e._getLayerDefaultStyle(),r=t&&t.options;return r&&r.color||i.color},getRadius:function(t){let i=e._getLayerDefaultStyle(),r=t&&t.getStyle();return r&&r.radius||i.radius},updateTriggers:{getColor:[i],getRadius:[r]}},d=this;this.options.onClick&&(c.onClick=function(){d._container.style.cursor="pointer",d.options.onClick.apply(d,arguments)}),this.options.onHover&&(c.onHover=function(){d._container.style.cursor="pointer",d.options.onHover.apply(d,arguments)}),e._renderLayer=new window.DeckGL.ScatterplotLayer(c)},_getLayerDefaultStyle:function(){if(this._layerDefaultStyleCache)return this._layerDefaultStyleCache;let{color:e,opacity:t,radius:i,radiusScale:r,radiusMinPixels:s,radiusMaxPixels:n,strokeWidth:a,outline:o}=this.layer.options;return i=this._pixelToMeter(i),this._layerDefaultStyleCache={color:e,opacity:t,radius:i,radiusScale:r,radiusMinPixels:s,radiusMaxPixels:n,strokeWidth:a,outline:o},this._layerDefaultStyleCache},_getLayerState:function(){let e=this.layer.getState();return e.zoom=e.zoom-1,e},_draw:function(){let e=this._getLayerState();this._refreshData(),e.data=this._data||[];let t={};for(let i in e)t[i]=e[i];this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._container,t.onBeforeRender=this._onBeforeRender.bind(this),t.onAfterRender=this._onAfterRender.bind(this),t.coordinateSystem=this._isWGS84()?window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS:window.DeckGL.COORDINATE_SYSTEM.LNGLAT,t.isGeographicCoordinateSystem=this._isWGS84(),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)},_clearBuffer:function(){if(this.deckGL){let e=this.deckGL.layerManager;e&&e.context.gl.clear(e.context.gl.COLOR_BUFFER_BIT)}return this},_refreshData:function(){let e=this._data||[],t=ao().Util.isArray(e)?[].concat(e):[e];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(let e=0;e<t.length;e++)this._renderLayer.props.data.push(t[e]);this._data=this._renderLayer.props.data},_handleClick:Fl,_onBeforeRender:Fl,_onAfterRender:Fl,_removePath:function(){return this._wrapper.parentElement.removeChild(this._wrapper),this._container=null,this._wrapper=null,this},_initPath:Fl,_addPath:Fl,containsPoint:Fl,_isWGS84(){return"EPSG:4326"===this.layer._map.options.crs.code}});const Rl=["canvas","webgl"],Bl={color:[0,0,0,255],opacity:.8,radius:10,radiusScale:1,radiusMinPixels:0,radiusMaxPixels:Number.MAX_SAFE_INTEGER,strokeWidth:1,outline:!1},Gl={"EPSG:4326":1.40625,"EPSG:3857":156543.03392804688},Ul={"EPSG:4326":1,"EPSG:3857":0};var jl=ao().Path.extend({initialize:function(e,t){this.graphics=[].concat(e);let i=t||{};i.pane="overlayPane",ao().Util.setOptions(this,i),this.options.render=this.options.render||Rl[0],class{static supportWebGL(){return El("webgl")}static supportWebGL2(){return El("webgl2")}static supportCanvas(){return El("2d")}}.supportWebGL2()||(this.options.render=Rl[0]),this.options.interactive&&this.on("click mousemove dblclick mousedown mouseup mouseout contextmenu",this._handleClick,this)},getEvents:function(){return{resize:this._resize.bind(this),moveend:this._moveEnd.bind(this)}},onAdd:function(e){this._map=e,this._crs=e.options.crs,this.defaultStyle=this._getDefaultStyle(this.options),this._renderer=this._createRenderer(),this._container=this._renderer._container,ao().Path.prototype.onAdd.call(this)},onRemove:function(){this.off("click mousemove dblclick mousedown mouseup contextmenu",this._handleClick,this),this._renderer._removePath(this)},setGraphics:function(e){this.graphics=this.graphics||[],this.graphics.length=0;let t=ao().Util.isArray(e)?[].concat(e):[e];this.graphics=[].concat(t),this.update()},addGraphics:function(e){this.graphics=this.graphics||[];let t=ao().Util.isArray(e)?[].concat(e):[e];this.graphics=this.graphics.concat(t),this.update()},getGraphicBy(e,t){let i=null;for(let r in this.graphics)if(this.graphics[r][e]===t){i=this.graphics[r];break}return i},getGraphicById(e){return this.getGraphicBy("id",e)},getGraphicsByAttribute(e,t){var i,r=[];for(let s in this.graphics)(i=this.graphics[s])&&i.attributes&&i.attributes[e]===t&&r.push(i);return r},removeGraphics(e=null){if(!e||0===e.length||e===this.graphics)return this.graphics.length=0,void this.update();ee.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--){let i=e[t],r=ee.indexOf(this.graphics,i);-1!==r&&this.graphics.splice(r,1)}this.update()},setStyle:function(e){let t=this.options,i={color:t.color,radius:t.radius,opacity:t.opacity,highlightColor:t.highlightColor,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline};this.options=ao().Util.extend(this.options,i,e),this.defaultStyle=this._getDefaultStyle(this.options),this.update()},update:function(){this._layerRenderer.update(this.graphics)},clear:function(){this.removeGraphics()},getRenderer:function(){return this._renderer},getState:function(){let e=this._map,t=e.getSize().x,i=e.getSize().y,r=e.getCenter(),s=r.lng,n=r.lat,a=Ul[this._crs.code]||0;Gl[this._crs.code]&&this._crs.resolutions&&this._crs.resolutions.length>0&&(a=Math.round(Math.log2(Gl[this._crs.code]/this._crs.resolutions[0])));let o={longitude:s,latitude:n,zoom:e.getZoom()+a,maxZoom:e.getMaxZoom()+a,pitch:0,bearing:0},l={};for(let e in o)l[e]=o[e];l.width=t,l.height=i;let h=this.options;return l.color=h.color,l.radius=h.radius,l.opacity=h.opacity,l.highlightColor=h.highlightColor,l.radiusScale=h.radiusScale,l.radiusMinPixels=h.radiusMinPixels,l.radiusMaxPixels=h.radiusMaxPixels,l.strokeWidth=h.strokeWidth,l.outline=h.outline,l},_resize:function(){let e=this._map.getSize();this._container.width=e.x,this._container.height=e.y,this._container.style.width=e.x+"px",this._container.style.height=e.y+"px";let t=this._map.containerPointToLayerPoint([0,0]);ao().DomUtil.setPosition(this._container,t),this._update()},_moveEnd:function(){this._layerRenderer instanceof Dl&&this._update()},_createRenderer:function(){let e,t=this._map,i=t.getSize().x,r=t.getSize().y;if(this.options.render===Rl[0])e=new Il(this,{width:i,height:r,renderer:t.getRenderer(this)});else{let s=ao().Util.setOptions({},Bl),n=ao().Util.setOptions({options:s},this.options);(n=ao().Util.setOptions(this,n)).container=t.getPane("overlayPane"),n.width=i,n.height=r,e=new Dl(this,n)}return e.defaultStyle=this.defaultStyle,this._layerRenderer=e,this._layerRenderer.getRenderer()},_update:function(){this._map&&this._updatePath()},_updatePath:function(){let e=this._getGraphicsInBounds();this._renderer.drawGraphics(e,this.defaultStyle)},_project:function(){let e=this;e._getGraphicsInBounds().map(function(t){let i=e._map.latLngToLayerPoint(t.getLatLng()),r=e._clickTolerance(),s=[t._anchor+r,t._anchor+r];return t._pxBounds=new(ao().Bounds)(i.subtract(s),i.add(s)),t}),e._pxBounds=ao().bounds(ao().point(0,0),ao().point(this._container.width,this._container.height))},_getDefaultStyle:function(e){const t={};if(e.color){t.fill=!0;const i=this.toRGBA(e.color);t.color=i,t.fillColor=i}return e.opacity&&(t.opacity=e.opacity,t.fillOpacity=e.opacity),e.radius&&(t.radius=e.radius),e.strokeWidth&&(t.weight=e.strokeWidth),e.outline&&(t.stroke=e.outline),new Ol(t).getStyle()},toRGBA:e=>`rgba(${e[0]},${e[1]},${e[2]},${(e[3]||255)/255})`,_getGraphicsInBounds:function(){let e=[],t=this._map.getBounds();return this.graphics.map(function(i){return t.contains(i.getLatLng())&&e.push(i),i}),e},_handleClick:function(e){this._layerRenderer._handleClick(e)},beforeAdd:ao().Util.falseFn,_containsPoint:function(e){return this._layerRenderer.containsPoint(e)}});var zl=rl.extend({options:{isOverLay:!0},initialize:function(e,t,i){var r=[];r.push(e),r.push(i),rl.prototype.initialize.apply(this,r),this.chartsType=t,this.themeFields=i&&i.themeFields?i.themeFields:null,this.charts=i&&i.charts?i.charts:[],this.cache=i&&i.cache?i.cache:{},this.chartsSetting=i&&i.chartsSetting?i.chartsSetting:{}},setChartsType:function(e){this.chartsType=e,this.redraw()},addFeatures:function(e){var t=this;t.fire("beforefeaturesadded",{features:e}),this.features=this.toiClientFeature(e),t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures())},redrawThematicFeatures:function(e){var t=this;t.renderer.clearAll();var i=t.features;if(this.options.alwaysMapCRS&&e&&e instanceof ao().LatLngBounds){var r=this._map.options.crs;e=ao().bounds(r.project(e.getSouthWest()),r.project(e.getNorthEast()))}e=vo.toSuperMapBounds(e);for(var s=0,n=i.length;s<n;s++){var a=i[s],o=a.geometry.getBounds();if(!e||e.intersectsBounds(o)){var l=t.cache,h=a.id;if(!l[h]){l[h]=h;var u=t.createThematicFeature(a),c=t.overlayWeightField&&a.attributes[t.overlayWeightField]&&!isNaN(a.attributes[t.overlayWeightField]);u&&c&&(u.__overlayWeight=a.attributes[t.overlayWeightField]),u&&t.charts.push(u)}}}t.drawCharts()},createThematicFeature:function(e){var t,i=this;return sa[i.chartsType]&&i.themeFields&&i.chartsSetting&&(t=new sa[i.chartsType](e,i,i.themeFields,i.chartsSetting)),!!t&&(t.assembleShapes(),t)},drawCharts:function(){var e=this;e.renderer&&(e.overlayWeightField&&e._sortChart(),e.options&&!e.options.isOverLay?e._addOverlayShape():e._addNoOverlayShape(),e.renderer.render())},getShapesByFeatureID:function(e){var t=[],i=this.renderer.getAllShapes();if(!e)return i;for(var r=0,s=i.length;r<s;r++){var n=i[r];n.refDataID&&e===n.refDataID&&t.push(n)}return t},isQuadrilateralOverLap:function(e,t){var i=e.length,r=t.length;if(5!==i||5!==r)return null;for(var s=!1,n=0;n<i;n++)if(this.isPointInPoly(e[n],t)){s=!0;break}for(let i=0;i<r;i++)if(this.isPointInPoly(t[i],e)){s=!0;break}for(let n=0;n<i-1&&!s;n++)for(let i=0;i<r-1;i++){if("SuperMap.Geometry.Point"===ee.lineIntersection(e[n],e[n+1],t[i],t[i+1]).CLASS_NAME){s=!0;break}}return s},isPointInPoly:function(e,t){for(var i=!1,r=-1,s=t.length,n=s-1;++r<s;n=r)(t[r].y<=e.y&&e.y<t[n].y||t[n].y<=e.y&&e.y<t[r].y)&&e.x<(t[n].x-t[r].x)*(e.y-t[r].y)/(t[n].y-t[r].y)+t[r].x&&(i=!i);return i},isChartInMap:function(e,t){for(var i=e,r=!1,s=0,n=t.length;s<n;s++){var a=t[s];if(a.x>=i.left&&a.x<=i.right&&a.y>=i.top&&a.y<=i.bottom){r=!0;break}}return r},clearCache:function(){this.cache={},this.charts=[]},removeFeatures:function(e){this.clearCache(),rl.prototype.removeFeatures.call(this,e)},removeAllFeatures:function(){this.clearCache(),rl.prototype.removeAllFeatures.apply(this,arguments)},redraw:function(){return this.clearCache(),rl.prototype.redraw.apply(this,arguments)},clear:function(){var e=this;e.renderer&&(e.renderer.clearAll(),e.renderer.refresh()),e.removeAllFeatures(),e.clearCache()},getWeightFieldValue:function(e,t,i){if((void 0===i||isNaN(i))&&(i=0),!e.attributes)return i;var r=e.attributes[t];return(void 0===r||isNaN(r))&&(r=i),r},_sortChart:function(){this.charts&&this.charts.sort(function(e,t){return void 0===e.__overlayWeight&&void 0===t.__overlayWeight?0:void 0!==e.__overlayWeight&&void 0===t.__overlayWeight?-1:void 0===e.__overlayWeight&&void 0!==t.__overlayWeight?1:void 0!==e.__overlayWeight&&void 0!==t.__overlayWeight?parseFloat(e.__overlayWeight)<parseFloat(t.__overlayWeight)?1:-1:0})},_addOverlayShape:function(){for(var e=this.charts,t=0,i=e.length;t<i;t++)for(var r=e[t],s=r.resetLocation(),n=r.shapes,a=0,o=n.length;a<o;a++)n[a].refOriginalPosition=s,this.renderer.addShape(n[a])},_addNoOverlayShape:function(){var e=this,t=e._map.getBounds(),i=this._map.options.crs;this.options.alwaysMapCRS&&(t=ao().bounds(i.project(t.getSouthWest()),i.project(t.getNorthEast()))),t=vo.toSuperMapBounds(t);for(var r=e.charts,s=[],n=e.getLocalXY(new re(t.left,t.top)),a=e.getLocalXY(new re(t.right,t.bottom)),o=new se(n[0],a[1],a[0],n[1]),l=0,h=r.length;l<h;l++){var u=r[l],c=u.resetLocation(),d=u.chartBounds,p=[{x:d.left,y:d.top},{x:d.left,y:d.bottom},{x:d.right,y:d.bottom},{x:d.right,y:d.top},{x:d.left,y:d.top}];if(!o||e.isChartInMap(o,p)){var f=!1;for(let t=0;t<s.length;t++)if(e.isQuadrilateralOverLap(p,s[t])){f=!0;break}if(!f){s.push(p);var m=u.shapes;for(let t=0,i=m.length;t<i;t++)m[t].refOriginalPosition=c,e.renderer.addShape(m[t])}}}}}),Vl=zl.extend({initialize:function(e,t,i){zl.prototype.initialize.apply(this,arguments),this.symbolType=t,this.symbolSetting={}},setSymbolType:function(e){this.symbolType=e,this.redraw()},createThematicFeature:function(e){var t,i=this;return sa[i.symbolType]&&i.themeField&&i.symbolSetting&&(t=new sa[i.symbolType](e,i,[i.themeField],i.symbolSetting)),!!t&&(t.assembleShapes(),t)}}),Jl=ao().SVG.extend({initialize:function(e,t,i){ao().SVG.prototype.initialize.call(this,i),this._tileCoord=e,this._size=t,this._initContainer(),this._container.setAttribute("width",this._size.x),this._container.setAttribute("height",this._size.y),this._container.setAttribute("viewBox",[0,0,this._size.x,this._size.y].join(" ")),this._layers={}},getCoord:function(){return this._tileCoord},getContainer:function(){return this._container},onAdd:ao().Util.falseFn,addTo:function(e){if(this._map=e,this.options.interactive)for(var t in this._layers){var i=this._layers[t];i._path.style.pointerEvents="auto",this._map._targets[ao().stamp(i._path)]=i}},removeFrom:function(e){var t=e||this._map;if(this.options.interactive)for(var i in this._layers){var r=this._layers[i];delete t._targets[ao().stamp(r._path)]}delete this._map},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup||(this._rootGroup=this._container),this._rootGroup.appendChild(e._path),this._layers[ao().stamp(e)]=e},_updateIcon:function(e){var t=e._path=ao().SVG.create("image"),i=e.options,r=i.iconUrl;if(i.iconSize){var s=ao().point(i.iconSize),n=s&&s.divideBy(2,!0),a=e._point.subtract(n);t.setAttribute("x",a.x),t.setAttribute("y",a.y),t.setAttribute("width",s.x+"px"),t.setAttribute("height",s.y+"px")}else{var o=new Image;o.src=r,ao().DomEvent.on(o,"load",function(){var i=ao().point([o.width,o.height]),r=i&&i.divideBy(2,!0),s=e._point.subtract(r);t.setAttribute("x",s.x),t.setAttribute("y",s.y),t.setAttribute("width",i.x+"px"),t.setAttribute("height",i.y+"px")})}t.setAttribute("href",r)}}),ql=ao().Canvas.extend({initialize:function(e,t,i){ao().Canvas.prototype.initialize.call(this,i),this._tileCoord=e,this._size=t,this._initContainer(),this._container.setAttribute("width",this._size.x),this._container.setAttribute("height",this._size.y),this._layers={},this._drawnLayers={},this._drawing=!0,i.interactive&&(this._container.style.pointerEvents="auto")},getCoord:function(){return this._tileCoord},getContainer:function(){return this._container},getOffset:function(){return this._tileCoord.scaleBy(this._size).subtract(this._map.getPixelOrigin())},onAdd:ao().Util.falseFn,addTo:function(e){this._map=e},removeFrom:function(e){delete this._map},_updateDashArray:function(e){var t=e.options.dashArray;if(t&&"string"==typeof t){var i,r=t.split(","),s=[];for(i=0;i<r.length;i++)s.push(Number(r[i]));e.options._dashArray=s}else e.options._dashArray=t},_onClick:function(e){var t,i,r=this._map.mouseEventToLayerPoint(e).subtract(this.getOffset());for(var s in this._layers)(t=this._layers[s]).options.interactive&&t._containsPoint(r)&&!this._map._draggableMoved(t)&&(i=t);i&&(ao().DomEvent.stop(e),this._fireEvent([i],e))},_onMouseMove:function(e){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e).subtract(this.getOffset());this._handleMouseHover(e,t)}},_updateIcon:function(e){if(this._drawing){var t=e.options,i=this._ctx,r=e._getImage();if(t.iconSize&&r.complete){var s=ao().point(t.iconSize),n=s&&s.divideBy(2,!0),a=e._point.subtract(n);i.drawImage(r,a.x,a.y,s.x,s.y)}else ao().DomEvent.on(r,"load",function(){var t=ao().point([r.width,r.height]),s=t&&t.divideBy(2,!0),n=e._point.subtract(s);i.drawImage(r,n.x,n.y,t.x,t.y)});this._drawnLayers[e._leaflet_id]=e}}}),Hl="LABEL",Wl="TEXT",Yl="POINT",Xl="LINE",Ql="REGION",Zl=ao().Class.extend({initialize:function(e){this.properties=e.properties,this.type=e.type,this.layerName=e.layerName},render:function(e,t){this._renderer=e,this._container=e._container,this.options=t,e._initPath(this),e._updateStyle(this);var i=this.getElement();i&&this.layerName&&ao().DomUtil.addClass(i,this.layerName)},updateStyle:function(e,t){this.options=t,e._updateStyle(this)},getElement:function(){return this._path||this._renderer._container},_getPixelBounds:function(){for(var e=this._parts,t=ao().bounds([]),i=0;i<e.length;i++)for(var r=e[i],s=0;s<r.length;s++)t.extend(r[s]);var n=this._clickTolerance(),a=new(ao().Point)(n,n);return t.min._subtract(a),t.max._add(a),t},_clickTolerance:ao().Path.prototype._clickTolerance}),Kl=ao().Path.extend({includes:Zl.prototype,options:{color:"white",fillColor:"black",fill:!0,fillOpacity:1,opacity:.6,weight:1,rotation:0,stroke:!0,fontFamily:"Arial Unicode MS Regular",fontSize:14,fontWeight:"normal",textAlign:"center",offsetX:1,offsetY:1},initialize:function(e,t){Zl.prototype.initialize.call(this,e),this._makeFeatureParts(e,t),this.options.offsetX=t||1,this.options.offsetY=t||1},render:function(e,t){if(this.properties.texts&&(this._text=this.properties.texts[0]),!this._text){var i=this.properties.attributes;this._text=i&&this.properties.textField&&i[this.properties.textField]||""}var r=this.options;this._pxBounds=ao().bounds(this._point,this._point),Zl.prototype.render.apply(this,[e,t]),this.options=ao().Util.extend(r,t),this._updatePath()},_makeFeatureParts:function(e,t){t=t||{x:1,y:1};var i=e.geometry[0];"object"==typeof i[0]&&"x"in i[0]?(this._point=ao().point(i[0]).scaleBy(t),this._empty=ao().Util.falseFn):(this._point=ao().point(i).scaleBy(t),this._empty=ao().Util.falseFn)},makeInteractive:function(){this._updateBounds()},updateStyle:function(e,t){return this._updateBounds(),Zl.prototype.updateStyle.call(this,e,t)},_updateBounds:function(){var e=this._renderer._getTextWidth(this),t=[e/2,e/2];this._pxBounds=ao().bounds(this._point.subtract(t),this._point.add(t))},_updatePath:function(){this._renderer._updateText(this)},_containsPoint:function(e){return!1}});ql.include({_getTextWidth:function(e){return this._ctx.measureText(e._text).width},_updateText:function(e){if(this._drawing&&!e._empty()){var t=this.getContainer(),i=this._map.getSize();t.width=i.x,t.height=i.y,t.style.width=i.x+"px",t.style.height=i.y+"px";var r=this._ctx,s=e.options,n=s.offsetX||1,a=s.offsetY||1,o=e._point.subtract(ao().point(n,a));s.fill&&(this._drawnLayers[e._leaflet_id]=e,r.fillRect(0,0,i.x,i.y),r.font=[s.fontWeight?s.fontWeight:"normal",s.fontSize?s.fontSize:"14px",s.fontFamily?s.fontFamily:"Arial Unicode MS Regular,Microsoft Yahei"].join(" "),r.textAlign=s.textAlign,r.lineWidth=s.weight,r.fillStyle=s.fillColor,r.fillText(e._text,o.x,o.y),r.strokeStyle=s.color,r.strokeText(e._text,o.x,o.y),r.rotate(s.rotation))}}}),Jl.include({_getTextWidth:function(e){return e._path.getComputedTextLength()||0},_initPath:function(e){var t;Kl&&e instanceof Kl?(t=e._path=ao().SVG.create("text")).textContent=e._text:t=e._path=ao().SVG.create("path"),e.options.className&&ao().DomUtil.addClass(t,e.options.className),e.options.interactive&&ao().DomUtil.addClass(t,"leaflet-interactive"),this._updateStyle(e),this._layers[ao().stamp(e)]=e},_updateText:function(e){var t=e._path,i=e.options,r=i.offsetX||1,s=i.offsetY||1,n=e._point.subtract(ao().point(r,s));t.setAttribute("x",n.x),t.setAttribute("y",n.y),i.rotation=i.rotation||0,t.setAttribute("transform","rotate("+i.rotation/Math.PI*180+" "+n.x+" "+n.y+")"),t.setAttribute("text-anchor","center"===i.textAlign?"middle":i.textAlign),t.style.fontSize=i.fontSize,t.style.fontFamily=i.fontFamily,t.style.fontWeight=i.fontWeight||"normal",t.style.glyphOrientationVertical=i.rotation||"",i.stroke?(t.setAttribute("stroke",i.color),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("stroke-opacity",i.opacity),t.setAttribute("stroke-width",i.weight>1?i.weight/10:i.weight)):t.setAttribute("stroke","none"),i.fill?(t.setAttribute("fill",i.fillColor||i.color),t.setAttribute("fill-opacity",i.fillOpacity)):t.setAttribute("fill","none")}});var $l=ao().CircleMarker.extend({includes:Zl.prototype,statics:{iconCache:{}},initialize:function(e,t){Zl.prototype.initialize.call(this,e),this._makeFeatureParts(e,t)},getLatLng:void 0,render:function(e,t){Zl.prototype.render.call(this,e,t),this._radius=t.radius||ao().CircleMarker.prototype.options.radius,this._updatePath()},_makeFeatureParts:function(e,t){t=t||{x:1,y:1};var i=e.geometry[0];"object"==typeof i[0]&&"x"in i[0]?(this._point=ao().point(i[0]).scaleBy(t),this._empty=ao().Util.falseFn):(this._point=ao().point(i).scaleBy(t),this._empty=ao().Util.falseFn)},makeInteractive:function(){this._updateBounds()},updateStyle:function(e,t){return this._radius=t.radius||this._radius,this._updateBounds(),Zl.prototype.updateStyle.call(this,e,t)},_updateBounds:function(){if(this.options.iconUrl&&this.options.iconSize){var e=ao().point(this.options.iconSize),t=e&&e.divideBy(2,!0),i=this._point.subtract(t);this._pxBounds=new(ao().Bounds)(i,i.add(e))}else ao().CircleMarker.prototype._updateBounds.call(this)},_updatePath:function(){this.options.iconUrl?this._renderer._updateIcon(this):ao().CircleMarker.prototype._updatePath.call(this)},_getImage:function(){if(!this.options.iconUrl)return null;var e=this.options.iconUrl,t=$l.iconCache[e];if(!t){var i=this.options.iconSize||[50,50];t=$l.iconCache[e]=this._createIcon(e,i)}return t},_createIcon:function(e,t){var i=e;if(!i)throw new Error("iconUrl not set in Icon options (see the docs).");var r=document.createElement("img");r.src=i,r.className="leaflet-marker-icon "+(this.layerName||"");var s=t;if("number"==typeof s&&(s=[s,s]),s){var n=ao().point(s),a=ao().point(n&&n.divideBy(2,!0));n&&(r.style.width=n.x+"px",r.style.height=n.y+"px"),a&&(r.style.marginLeft=-a.x+"px",r.style.marginTop=-a.y+"px")}return r.onload=function(){s||(r.style.width=this.width+"px",r.style.height=this.height+"px")},r},_containsPoint:function(e){return this.options.iconUrl?this._pxBounds.contains(e):ao().CircleMarker.prototype._containsPoint.call(this,e)}}),eh={_makeFeatureParts:function(e,t){t=t||{x:1,y:1};var i,r=e.geometry;this._parts=[];for(var s=0;s<r.length;s++){for(var n=r[s],a=[],o=0;o<n.length;o++)i=n[o],a.push(ao().point(i).scaleBy(t));this._parts.push(a)}},makeInteractive:function(){this._pxBounds=this._getPixelBounds()}},th=ao().Polyline.extend({includes:[Zl.prototype,eh],initialize:function(e,t){Zl.prototype.initialize.call(this,e),this._makeFeatureParts(e,t)},render:function(e,t){t.fill=!1,Zl.prototype.render.call(this,e,t),this._updatePath()},updateStyle:function(e,t){t.fill=!1,Zl.prototype.updateStyle.call(this,e,t)}}),ih=ao().Polygon.extend({includes:[Zl.prototype,eh],initialize:function(e,t){Zl.prototype.initialize.call(this,e),this._makeFeatureParts(e,t)},render:function(e,t){Zl.prototype.render.call(this,e,t),this._updatePath()}}),rh=i(614),sh=i.n(rh),nh=i(929),ah=ao().Class.extend({initialize:function(e){this.url=e},getTile:function(){var e=this;return Ue.get(e.url,null,{timeout:1e4}).then(function(e){return e.ok?e.blob().then(function(e){var t=new FileReader;return new Promise(function(i){t.addEventListener("loadend",function(){var e=new(sh())(t.result);return i(new nh.VectorTile(e))}),t.readAsArrayBuffer(e)})}):{layers:[]}}).then(function(t){return e._processVectorTileSpec(t)})},_processVectorTileSpec:function(e){var t=[];for(var i in e.layers){for(var r=[],s=0;s<e.layers[i].length;s++){var n=e.layers[i].feature(s);switch(n.geometry=n.loadGeometry(),n.layerName=i,n.properties={attributes:ao().Util.extend({},n.properties),id:n.id},n.type){case 1:n.type=Yl;break;case 2:n.type=Xl;break;case 3:n.type=Ql}r.push(n)}var a={};a.features=r,a.layerName=i,a.extent=e.layers[i].extent,t.push(a)}return t}}),oh=ao().Class.extend({initialize:function(e){this.url=e},getTile:function(){var e=this;return Ue.get(e.url,null,{timeout:1e4}).then(function(e){return e.json()}).then(function(t){return e._processRecordSets(t,e)})},_processRecordSets:function(e,t){var i=e.recordsets;if(!(i=t._convertToGeoJSON(i)))return null;for(var r=0;r<i.length;r++){for(var s=i[r],n=0;n<s.features.length;n++){var a=s.features[n];(a=t._convertToVectorLayerFeature(a,t)).layerName=s.layerName,s.features[n]=a}s.extent=256,delete s.fieldTypes,delete s.fields}return i},_convertToVectorLayerFeature:function(e,t){if(e.geometry){var i,r,s,n,a={},o=e.geometry,l=o.type,h=o.coordinates,u=e.properties,c=u.id;if("Point"===l)a=u&&u.texts?t._createFeature(c,Wl,[h],u):t._createFeature(c,Yl,[h],u);else if("MultiPoint"===l)a=t._createFeature(c,Yl,h,u);else if("LineString"===l)a=t._createFeature(c,Xl,[h],u);else if("MultiLineString"===l||"Polygon"===l){for(s=[],i=0;i<h.length;i++)n=h[i],"Polygon"===l&&(n.outer=0===i),s.push(n);var d="Polygon"===l?Ql:Xl;a=t._createFeature(c,d,s,u)}else{if("MultiPolygon"!==l)throw new Error("Illegal GeoJSON object");for(s=[],i=0;i<h.length;i++)for(r=0;r<h[i].length;r++)(n=h[i][r]).outer=0===r,s.push(n);a=t._createFeature(c,Ql,s,u)}return a}},_convertToGeoJSON:function(e){if(e){for(var t=0;t<e.length;t++){for(var i=e[t],r=0;r<i.features.length;r++){for(var s=i.features[r],n=[],a=0,o=0;o<s.geometry.parts.length;o++){for(var l=2*s.geometry.parts[o],h=0,u=a;h<l;h+=2,u+=2){var c=s.geometry.points[u],d=s.geometry.points[u+1];n.push({x:c,y:d})}a+=l}s.geometry.points=n}i.features=Oo(i.features).features}return e}},_createFeature:function(e,t,i,r){return{id:e,type:t,geometry:i,properties:r}}}),lh={JSON:"JSON",MVT:"MVT",PBF:"PBF"},hh=ao().Class.extend({initialize:function(e,t){this.layer=e.layer,this.tileSize=e.layer.getTileSize(),this.format=e.format,this.coords=e.coords,this.renderer=e.renderer,this.done=t,this.layer._textVectorTiles={}},renderTile:function(){var e=this,t=e.layer,i=e.coords,r=t._getTileUrl(i);([lh.MVT,lh.PBF].indexOf(e.format.toUpperCase())>-1?new ah(r):new oh(r)).getTile().then(function(t){e.render(t,i)})},render:function(e,t){if(e){for(var i=this,r=i.renderer,s=i.layer,n=0;n<e.length;n++){var a=e[n],o=a.layerName;s._dataLayerNames[o]=!0;for(var l=i.tileSize.divideBy(a.extent),h=s.getLayerStyleInfo(a.layerName),u=0;u<a.features.length;u++){var c=a.features[u];if(c){h&&h.type===Hl&&c.type===Yl&&c.properties.attributes&&(c.type=Wl);var d=i._getStyleOptions(t,c,o,i);if(d.length){var p=i._createFeatureLayer(c,l);if(p){var f={scope:i,coords:t,renderer:r};if(!i._extractTextLayer(c,p,d,f)){for(var m=0;m<d.length;m++){var y=i._validateStyle(d[m],c.type);p.render(r,y),r._addPath(p)}s.options.interactive&&p.makeInteractive();var g=s._getFeatureKey(c.id,o);r._features[g]={layerName:o,feature:p}}}}}}}s._map&&r.addTo(s._map),ao().Util.requestAnimFrame(i.done.bind(t,null,i.layer._vectorTiles[i.layer._tileCoordsToKey(t)]))}},_extractTextLayer:function(e,t,i,r){if(e.type!==Wl)return!1;var s=r.scope,n=r.coords,a=s.layer,o=a._tileCoordsToKey(n),l=e.id,h=e.layerName,u=a._textVectorTiles[o];return u||(u={layers:{},coords:n,renderer:r.renderer}),u.layers[l]={layer:t,style:i,layerName:h},a._textVectorTiles[o]=u,!0},_getStyleOptions:function(e,t,i,r){var s=r,n=s.layer,a=n.getVectorTileLayerStyle(e,t)||s._defaultStyle(t.type),o=t.id,l=n._getFeatureKey(o,i),h=n._overriddenStyles[l];return a=(a=(a=h||a)instanceof Function?a(t.properties,e.z):a)instanceof Array?a:[a]},_createFeatureLayer:function(e,t){var i;switch(e.type){case Yl:i=new $l(e,t);break;case Xl:i=new th(e,t);break;case Ql:i=new ih(e,t);break;case Wl:i=new Kl(e,t)}var r=this.layer;return i&&r.options.interactive&&i.addEventParent(r),i},_validateStyle:function(e,t){switch(ao().Path.prototype.options.weight=1,ao().Path.prototype.options.fillOpacity=1,t){case Yl:return ao().extend({},ao().CircleMarker.prototype.options,e);case Xl:return ao().extend({},ao().Polyline.prototype.options,e);case Ql:return ao().extend({},ao().Polygon.prototype.options,e);case Wl:return ao().extend({},Kl.prototype.options,e)}},_defaultStyle:function(e){var t=ao().Path.prototype.options;switch(t.weight=1,t.fillOpacity=1,t.radius=3,e){case Yl:return ao().extend({},t,ao().CircleMarker.prototype.options);case Xl:return ao().extend({},t,ao().Polyline.prototype.options);case Ql:return ao().extend({},t,ao().Polygon.prototype.options);case Wl:return ao().extend({},t,Kl.prototype.options)}}}),uh=ao().GridLayer.extend({options:{vectorTileLayerStyles:null,renderer:"SVG",format:lh.JSON,interactive:!0,maxZoom:23},initialize:function(e){var t=this;ao().setOptions(t,e),ao().GridLayer.prototype.initialize.call(t,e),t._vectorTiles={},t._overriddenStyles={},t.vectorTileLayerStyles=t.options.vectorTileLayerStyles,t.on("tileunload",function(e){var i=t._tileCoordsToKey(e.coords),r=t._vectorTiles[i];r&&t._map&&r.removeFrom(t._map),delete t._vectorTiles[i]},t),t.on("tileerror ",t._renderText,t),t.on("load",t._renderText,t),t._dataLayerNames={}},createTile:function(e,t){var i=this,r=i.getTileSize(),s=null;return s="Canvas"===i.options.renderer?new ql(e,r,i.options):new Jl(e,r,i.options),i._vectorTiles[i._tileCoordsToKey(e)]=s,s._features={},new hh({layer:i,format:i.options.format,coords:e,renderer:s},t).renderTile(),s.getContainer()},getStyles:function(){return this.vectorTileLayerStyles},getStyle:function(e){return this.vectorTileLayerStyles&&this.vectorTileLayerStyles[e]},setFeatureStyle:function(e,t,i){var r=this._getFeatureKey(e,t);for(var s in this._overriddenStyles[r]=i,this._vectorTiles){var n=this._vectorTiles[s],a=n._features[r];if(a){var o=a.feature;this._updateStyles(o,n,i)}}return this},resetFeatureStyle:function(e,t){var i=this._getFeatureKey(e,t);for(var r in delete this._overriddenStyles[i],this._vectorTiles){var s=this._vectorTiles[r],n=s._features[i];if(n){var a=n.feature,o=this.vectorTileLayerStyles[n.layerName];this._updateStyles(a,s,o)}}return this},getDataLayerNames:function(){return Object.keys(this._dataLayerNames)},_removeAllTiles:function(){ao().GridLayer.prototype._removeAllTiles.call(this),this._textVectorTiles={}},_renderText:function(){var e=this._textVectorTiles;for(var t in e){var i=e[t],r=i.renderer;for(var s in i.layers){for(var n=i.layers[s],a=n.style,o=n.layer,l=0;l<a.length;l++)o.render(r,a[l]),r._addPath(o);this.options.interactive&&o.makeInteractive()}}},_getFeatureKey:function(e,t){return(e=e||0)+"_"+(t=t||"null")},_updateStyles:function(e,t,i){(i=i instanceof Function?i(e.properties,t.getCoord().z):i)instanceof Array||(i=[i]);for(var r=0;r<i.length;r++){var s=this._extendStyle(i[r],e.type);e.updateStyle(t,s)}},_extendStyle:function(e,t){switch(t){case Yl:return ao().extend({},ao().CircleMarker.prototype.options,e);case Xl:return ao().extend({},ao().Polyline.prototype.options,e);case Ql:return ao().extend({},ao().Polygon.prototype.options,e);case Wl:return ao().extend({},Kl.prototype.options,e)}}}),ch=uh.extend({options:{crs:null,cartoCSS:null,layerNames:null,layersID:null,serverCartoCSSStyle:!0,processCharacters:!1,returnAttributes:!1,expands:null,cacheEnabled:!1,tileTemplate:null,subdomains:"abc",timeout:1e4,attribution:co.Common.attribution},initialize:function(e,t){(t=t||{}).noWrap=null==t.noWrap||t.noWrap,ao().setOptions(this,t),uh.prototype.initialize.call(this,t),ao().stamp(this);var i=this;if(!e||e.indexOf("http")<0)return e="",this;i.url=e,e.indexOf("/")===e.length-1&&(e=e.substr(0,e.length-1),i.url=e),this.cartoCSSToLeaflet=new el(i.url),i.initLayersInfo(),!i.options.serverCartoCSSStyle&&i.options.cartoCSS&&i.setClientCartoCSS(i.options.cartoCSS)},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._map=e,this._initLayerUrl(),!this.options.tileTemplate&&this.options.serverCartoCSSStyle||this._initGrid()},initLayersInfo:function(){var e=this,t=ee.urlPathAppend(e.url,"layers");Ue.get(je.appendCredential(t),null,{timeout:e.options.timeout}).then(function(e){return e.json()}).then(function(t){if(e.layersInfoInitialized=!0,e.layersInfo=t,e.layersInfo){for(var i={},r=0,s=e.layersInfo.length;r<s;r++)for(var n=e.layersInfo[r].subLayers.layers,a=0,o=n.length;a<o;a++)n[a].layerIndex=o-a,i[n[a].name]=n[a];e.layersInfo=i,e.cartoCSSToLeaflet.layersInfo=i,e.options.serverCartoCSSStyle&&e.getVectorStylesFromServer()}}).catch(function(e){console.error("error",e)})},getLayerStyleInfo:function(e){var t,i=this;if(i.layersStyles=i.layersStyles||{},t=i.layersStyles[e])return t;if(!i.layersInfo)return{};var r=i.layersInfo[e];if(!r)return null;switch(t={layerIndex:r.layerIndex,ugcLayerType:r.ugcLayerType},r.ugcLayerType){case"VECTOR":t.layerStyle=r.style?r.style:null;break;case"THEME":var s=r.theme;t.layerStyle=s?s.defaultStyle:null,s&&"LABEL"===s.type&&(t.type=s.type,t.textField=s.labelExpression);break;default:r.style&&(t.layerStyle=r.style)}return i.layersStyles[e]=t,t},getVectorStylesFromServer:function(){var e=this,t=ee.urlPathAppend(e.url,"tileFeature/vectorstyles");Ue.get(je.appendCredential(t),null,{timeout:e.options.timeout}).then(function(e){return e.json()}).then(function(t){if(!t||!t.style)return null;t.style&&"cartoCSS"===t.type&&e.setServerCartoCSS(t.style),e.options&&e.setClientCartoCSS(e.options.cartoCSS),e._initGrid()}).catch(function(e){console.error("error",e)})},setServerCartoCSS:function(e){this.cartoCSSToLeaflet.pretreatedCartoCSS(e,!0)},setClientCartoCSS:function(e){let t=!1;this.options.processCharacters&&(t=this.options.processCharacters),this.cartoCSSToLeaflet.pretreatedCartoCSS(e,t)},getVectorTileLayerStyle:function(e,t){if(!t)return null;var i=this,r=t.layerName,s=i.getLayerStyleInfo(r);if(s&&s.textField){var n=s.textField;if(n&&n.indexOf(".")){var a=n.split(".");n=a&&a.length>0&&a[a.length-1]}t.properties.textField=n}i.vectorTileLayerStyles=i.vectorTileLayerStyles||{};var o=i.vectorTileLayerStyles[r];if(o)return t=this._mergeFeatureTextField(t,o),o;var l=this.getScaleFromCoords(e),h=this.cartoCSSToLeaflet.pickShader(r)||[];for(var u in o=[],h)for(var c=h[u],d=0;d<c.length;d++){var p=this.cartoCSSToLeaflet.getValidStyleFromCarto(e.z,l,c[d],t,this.options.serverCartoCSSStyle);p&&o.push(p)}return"TEXT"!==(t=this._mergeFeatureTextField(t,o)).type&&0!==o.length||(o=this.cartoCSSToLeaflet.getValidStyleFromLayerInfo(t,s),"TEXT"===t.type&&(o.textName="["+t.properties.textField+"]")),i.vectorTileLayerStyles[r]=o,o},getScale:function(e){var t=e||this._map.getZoom();return this.scales[t]},getScaleFromCoords:function(e){var t,i=this;return i.scales&&i.scales[e.z]?i.scales[e.z]:(i.scales=i.scales||{},t=i.getDefaultScale(e),i.scales[e.z]=t,t)},getDefaultScale:function(e){var t=this._crs;if(t.scales)return t.scales[e.z];var i=this._tileCoordsToBounds(e),r=t.project(i.getNorthEast()),s=t.project(i.getSouthWest()),n=this.options.tileSize,a=Math.max(Math.abs(r.x-s.x)/n,Math.abs(r.y-s.y)/n),o=l.METER;if(t.code){var h=t.code.split(":");if(h&&h.length>1){var u=parseInt(h[1]);o=u&&u>=4e3&&u<=5e3?l.DEGREE:l.METER}}return Io(a,96,o)},_mergeFeatureTextField:function(e,t){if(!this.options.serverCartoCSSStyle||!t||"TEXT"!==e.type)return e;var i=t;ao().Util.isArray(t)||(i=[t]);for(var r=0;r<i.length;r++){var s=i[r].textName;s&&e.properties&&(e.properties.textField=s.substring(1,s.length-1))}return e},_getTileUrl:function(e){return this.options.tileTemplate?this._getTileTemplateUrl(e):this._getDefaultTileUrl(e)},_getTileTemplateUrl:function(e){var t=this,i=t.options.tileTemplate,r={s:t._getSubdomain(e),x:e.x,y:e.y,z:e.z};if(t._map&&!t._map.options.crs.infinite){var s=t._globalTileRange.max.y-e.y;t.options.tms&&(r.y=s),r["-y"]=s}return ao().Util.template(i,ao().extend(r,t.options))},_initGrid:function(){uh.prototype.onAdd.call(this,this._map)},_getSubdomain:ao().TileLayer.prototype._getSubdomain,_getDefaultTileUrl:function(e){var t=e.x,i=e.y,r=this._tileUrl+"&x="+t+"&y="+i;return r+="&scale="+this.getScaleFromCoords(e)},_initLayerUrl:function(){var e=this.options;if(this.url){var t=e.format.toString().toLowerCase();this._tileUrl=ee.urlPathAppend(this.url,"tileFeature."+t),this._tileUrl=ee.urlAppend(this._tileUrl,encodeURI(this._createURLParam(e)))}},_createURLParam:function(e){var t=[],i=this._getCredential(this._tileUrl);if(i&&t.push(i),e.layersID&&t.push("layersID="+e.layersID),e.layerNames){ao().Util.isArray(e.layerNames)||(e.layerNames=[e.layerNames]);var r="["+e.layerNames.join(",")+"]";t.push("layerNames="+r)}var s=this._crs;if(s.options&&s.options.origin)t.push("origin="+JSON.stringify({x:s.options.origin[0],y:s.options.origin[1]}));else if(s.projection&&s.projection.bounds){var n=s.projection.bounds,a=ao().point(n.min.x,n.max.y);t.push("origin="+JSON.stringify({x:a.x,y:a.y}))}e.expands&&t.push("expands="+e.expands),t.push("returnAttributes="+e.returnAttributes),t.push("cacheEnabled="+e.cacheEnabled);var o=this.options.tileSize;return t.push("width="+o),t.push("height="+o),t.join("&")},_getCredential:function(e){var t=je.getToken(e),i=t?new ye(t,"token")||new ye(t,"key"):null;return i?i.getUrlParameters():null}});const dh=function(){try{return turf}catch(e){return{}}}();var ph,fh=ao().GeoJSON.extend({turfMap:{"Measurement.along":["line","distance","units"],"Measurement.area":["geojson"],"Measurement.bbox":["geojson"],"Measurement.bboxPolygon":["bbox"],"Measurement.bearing":["start","end","final"],"Measurement.center":["geojson","properties"],"Measurement.centerOfMass":["geojson","properties"],"Measurement.centroid":["geojson","properties"],"Measurement.destination":["origin","distance","bearing","units"],"Measurement.distance":["from","to","units"],"Measurement.envelope":["geojson"],"Measurement.length":["geojson","units"],"Measurement.midpoint":["point1","point2"],"Measurement.pointOnFeature":["geojson"],"Measurement.polygonTangents":["point","polygon"],"Measurement.rhumbBearing":["start","end","final"],"Measurement.rhumbDestination":["origin","distance","bearing","units"],"Measurement.rhumbDistance":["from","to","units"],"Measurement.square":["bbox"],"Measurement.greatCircle":["start","end","properties","npoints","offset"],"CoordinateMutation.cleanCoords":["geojson","mutate"],"CoordinateMutation.flip":["geojson","mutate"],"CoordinateMutation.rewind":["geojson","reverse","mutate"],"CoordinateMutation.round":["num","precision"],"CoordinateMutation.truncate":["geojson","precision","coordinates","mutate"],"Transformation.bboxClip":["feature","bbox"],"Transformation.bezierSpline":["line","resolution","sharpness"],"Transformation.buffer":["geojson","radius","units","steps"],"Transformation.circle":["center","radius","steps","units","properties"],"Transformation.clone":["geojson"],"Transformation.concave":["points","maxEdge","units"],"Transformation.convex":["geojson","concavity"],"Transformation.difference":["polygon1","polygon2"],"Transformation.dissolve":["featureCollection","propertyName"],"Transformation.intersect":["poly1","poly2"],"Transformation.lineOffset":["geojson","distance","units"],"Transformation.simplify":["feature","tolerance","highQuality"],"Transformation.tesselate":["poly"],"Transformation.transformRotate":["geojson","angle","pivot","mutate"],"Transformation.transformTranslate":["geojson","distance","direction","units","zTranslation","mutate"],"Transformation.transformScale":["geojson","factor","origin","mutate"],"Transformation.union":["A"],"Transformation.voronoi":["points","bbox"],"featureConversion.combine":["fc"],"featureConversion.explode":["geojson"],"featureConversion.flatten":["geojson"],"featureConversion.lineStringToPolygon":["lines","properties","autoComplete","orderCoords"],"featureConversion.polygonize":["geojson"],"featureConversion.polygonToLineString":["polygon","properties"],"Misc.kinks":["featureIn"],"Misc.lineArc":["center","radius","bearing1","bearing2","steps","units"],"Misc.lineChunk":["geojson","segmentLength","units","reverse"],"Misc.lineIntersect":["line1","line2"],"Misc.lineOverlap":["line1","line2"],"Misc.lineSegment":["geojson"],"Misc.lineSlice":["startPt","stopPt","line"],"Misc.lineSliceAlong":["line","startDist","stopDist","units"],"Misc.lineSplit":["line","splitter"],"Misc.mask":["polygon","mask"],"Misc.pointOnLine":["lines","pt","units"],"Misc.sector":["center","radius","bearing1","bearing2","steps","units"],"Misc.shortestPath":["start","end","obstacles","units","resolution"],"Misc.unkinkPolygon":["geojson"],"Helper.featureCollection":["features","bbox","id"],"Helper.feature":["geometry","properties","bbox","id"],"Helper.geometryCollection":["geometries","properties","bbox","id"],"Helper.lineString":["coordinates","properties","bbox","id"],"Helper.multiLineString":["coordinates","properties","bbox","id"],"Helper.multiPoint":["coordinates","properties","bbox","id"],"Helper.multiPolygon":["coordinates","properties","bbox","id"],"Helper.point":["coordinates","properties","bbox","id"],"Helper.polygon":["coordinates","properties","bbox","id"],"Data.sample":["featurecollection","num"],"Interpolation.interpolate":["points","cellSize","gridType","property","units","weight"],"Interpolation.isobands":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.isolines":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.planepoint":["point","triangle"],"Interpolation.tin":["points","z"],"Joins.pointsWithinPolygon":["points","polygons"],"Joins.tag":["points","polygons","field","outField","mask","properties"],"Grids.hexGrid":["bbox","cellSide","units","triangles"],"Grids.pointGrid":["bbox","cellSide","units","mask","properties"],"Grids.squareGrid":["bbox","cellSide","units","mask","properties"],"Grids.triangleGrid":["bbox","cellSide","units","mask","properties"],"Classification.nearestPoint":["targetPoint","points"],"Aggregation.collect":["polygons","points","inProperty","outProperty"],"Aggregation.clustersDbscan":["points","maxDistance","units","minPoints","mutate"],"Aggregation.clustersKmeans":["points","numberOfClusters","mutate"],"Meta.coordAll":["geojson"],"Meta.coordEach":["geojson","callback","excludeWrapCoord"],"Meta.coordReduce":["geojson","callback","initialValue","excludeWrapCoord"],"Meta.featureEach":["geojson","callback"],"Meta.featureReduce":["geojson","callback","initialValue"],"Meta.flattenEach":["geojson","callback"],"Meta.flattenReduce":["geojson","callback","initialValue"],"Meta.getCoord":["coord"],"Meta.getCoords":["coords"],"Meta.getGeom":["geojson"],"Meta.getGeomType":["geojson","name"],"Meta.geomEach":["geojson","callback"],"Meta.geomReduce":["geojson","callback","initialValue"],"Meta.propEach":["geojson","callback"],"Meta.propReduce":["geojson","callback","initialValue"],"Meta.segmentEach":["geojson","callback"],"Meta.segmentReduce":["geojson","callback","initialValue"],"Meta.getCluster":["geojson","filter"],"Meta.clusterEach":["geojson","property","callback"],"Meta.clusterReduce":["geojson","property","callback","initialValue"],"Assertions.collectionOf":["featureCollection","type","name"],"Assertions.containsNumber":["coordinates"],"Assertions.geojsonType":["value","type","name"],"Assertions.featureOf":["feature","type","name"],"Booleans.booleanClockwise":["line"],"Booleans.booleanContains":["feature1","feature2"],"Booleans.booleanCrosses":["feature1","feature2"],"Booleans.booleanDisjoint":["feature1","feature2"],"Booleans.booleanEqual":["feature1","feature2"],"Booleans.booleanOverlap":["feature1","feature2"],"Booleans.booleanParallel":["feature1","feature2"],"Booleans.booleanPointInPolygon":["point","polygon","ignoreBoundary"],"Booleans.booleanPointOnLine":["point","linestring","ignoreEndVertices"],"UnitConversion.bearingToAngle":["bearing"],"UnitConversion.convertArea":["area","originalUnit","finalUnit"],"UnitConversion.convertLength":["length","originalUnit","finalUnit"],"UnitConversion.degreesToradians":["degrees"],"UnitConversion.lengthToRadians":["distance","units"],"UnitConversion.lengthToDegrees":["distance","units"],"UnitConversion.radiansToLength":["radians","units"],"UnitConversion.radiansToDegrees":["radians"],"UnitConversion.toMercator":["geojson","mutate"],"UnitConversion.toWgs84":["geojson","mutate"]},options:{attribution:co.Turf.attribution},initialize:function(e){e=e||{},ao().Util.setOptions(this,e),ao().stamp(this),this._layers={}},turfOptionMap:{"Measurement.along":["line","distance",{units:""}],"Measurement.bboxPolygon":["bbox",{properties:"",id:""}],"Measurement.bearing":["start","end",{final:""}],"Measurement.center":["geojson",{properties:""}],"Measurement.destination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.distance":["from","to",{units:""}],"Measurement.length":["geojson",{units:""}],"Measurement.rhumbBearing":["start","end",{final:""}],"Measurement.rhumbDestination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.rhumbDistance":["from","to",{units:""}],"Measurement.greatCircle":["start","end",{properties:"",npoints:"",offset:""}],"CoordinateMutation.cleanCoords":["geojson",{mutate:""}],"CoordinateMutation.flip":["geojson",{mutate:""}],"CoordinateMutation.rewind":["geojson",{mutate:"",reverse:""}],"CoordinateMutation.truncate":["geojson",{precision:"",coordinates:"",mutate:""}],"Transformation.bezierSpline":["line",{resolution:"",sharpness:""}],"Transformation.buffer":["geojson","radius",{units:"",steps:""}],"Transformation.circle":["center","radius",{units:"",steps:"",properties:""}],"Transformation.concave":["points",{maxEdge:"",units:""}],"Transformation.convex":["geojson",{concavity:""}],"Transformation.dissolve":["featureCollection",{propertyName:""}],"Transformation.lineOffset":["geojson","distance",{units:""}],"Transformation.simplify":["geojson",{tolerance:"",highQuality:""}],"Transformation.transformRotate":["geojson","angle",{pivot:"",mutate:""}],"Transformation.transformTranslate":["geojson","distance","direction",{units:"",zTranslation:"",mutate:""}],"Transformation.transformScale":["geojson","factor",{origin:"",mutate:""}],"Transformation.voronoi":["points",{bbox:""}],"featureConversion.lineStringToPolygon":["lines",{properties:"",autoComplete:"",orderCoords:""}],"featureConversion.polygonToLineString":["polygon",{properties:""}],"Misc.lineArc":["center","radius","bearing1","bearing2",{steps:"",units:""}],"Misc.lineChunk":["geojson","segmentLength",{units:"",reverse:""}],"Misc.lineOverlap":["line1","line2",{tolerance:""}],"Misc.lineSliceAlong":["line","startDist","stopDist",{units:""}],"Misc.pointOnLine":["lines","pt",{units:""}],"Misc.sector":["center","radius","bearing1","bearing2",{units:"",steps:"",properties:""}],"Misc.shortestPath":["start","end",{obstacles:"",units:"",resolution:""}],"Helper.feature":["geometry","properties",{bbox:"",id:""}],"Helper.geometryCollection":["geometries","properties",{bbox:"",id:""}],"Helper.lineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiLineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPoint":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPolygon":["coordinates","properties",{bbox:"",id:""}],"Helper.point":["coordinates","properties",{bbox:"",id:""}],"Helper.polygon":["coordinates","properties",{bbox:"",id:""}],"Interpolation.interpolate":["points","cellSize",{gridType:"",property:"",units:"",weight:""}],"Interpolation.isobands":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Interpolation.isolines":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Grids.hexGrid":["bbox","cellSide",{units:"",triangles:"",properties:"",mask:""}],"Grids.pointGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.squareGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.triangleGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Aggregation.clustersDbscan":["points","maxDistance",{units:"",minPoints:"",mutate:""}],"Aggregation.clustersKmeans":["points",{numberOfClusters:"",mutate:""}],"Booleans.booleanPointInPolygon":["point","polygon",{ignoreBoundary:""}],"Booleans.booleanPointOnLine":["point","linestring",{ignoreEndVertices:""}],"UnitConversion.toMercator":["geojson",{mutate:""}],"UnitConversion.toWgs84":["geojson",{mutate:""}]},process:function(e,t,i,r){var s;try{s=dh[e.split(".")[1]].apply(this,this.parse(e,t))}catch(i){s=dh[e.split(".")[1]].apply(this,this.parseOption(e,t))}(r=null==r||r)&&this.addData([s]),i&&i(s)},parse:function(e,t){if("Transformation.union"===e)return t.A;var i=[],r=this.turfMap[e];return r&&r.map(function(e){return i.push(t[e]),t[e]}),i},parseOption(e,t){var i=[];return this.turfOptionMap[e].map(function(e){if(e instanceof Object){var r=e;Object.keys(r).forEach(function(e){r[e]=t[e]}),i.push(r)}else i.push(t[e]);return t}),i}}),mh=ao().Class.extend({initialize:function(e,t){this.geometry=e,this.attributes=t},toFeature:function(){var e=this.geometry,t=[];if(e instanceof ao().LatLng)t=[e.lng,e.lat];else if(e instanceof ao().Point)t=[e.x,e.y];else if(e instanceof ao().CircleMarker){var i=e.getLatLng();t=[i.lng,i.lat]}else t=e;return 2===t.length&&(e=new le(t[0],t[1])),new xe(e,this.attributes)}}),yh=ao().Layer.extend({options:{alwaysMapCRS:!1,id:ee.createUniqueID("heatMapLayer_"),featureWeight:null,opacity:1,colors:["blue","cyan","lime","yellow","red"],useGeoUnit:!1,radius:50,attribution:co.Common.attribution},initialize:function(e,t){ao().Util.setOptions(this,t),this.name=e,this.features=[],this.maxWeight=null,this.minWeight=null,this.rootCanvas=null,this.canvasContext=null,this.maxWidth=null,this.maxHeight=null,this.id=this.options.id,this.featureWeight=this.options.featureWeight,this.colors=this.options.colors,this.useGeoUnit=this.options.useGeoUnit,this.opacity=this.options.opacity,this.radius=this.options.radius,this.blur=this.options.blur,this.movingOffset=[0,0]},onRemove:function(e){ao().DomUtil.remove(this.rootCanvas),e.off("mousemove",this.mouseMoveHandler)},onAdd:function(e){var t=this;if(t._map=e,t._createCanvasContainer(),t.rootCanvas){var i=e.getSize();t.rootCanvas.width=t.maxWidth=i.x,t.rootCanvas.height=t.maxHeight=i.y,t._updateOpacity(),t.mouseMoveHandler=function(e){var i=e.layerPoint;t.currentMousePosition=ao().point(i.x+t.movingOffset[0],i.y+t.movingOffset[1])},e.on("mousemove",t.mouseMoveHandler),t.update()}else e.removeLayer(t)},addFeatures:function(e){this.features=this.toiClientFeature(e),this.refresh()},refresh:function(){if(0!==this.features.length&&this._map){var e=this._map.getBounds();this.updateHeatPoints(e)}},updateHeatPoints:function(e){this.features&&this.features.length>0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)},convertFastToPixelPoints:function(e){var t,i,r,s,n,a,o,l=[],h=e.getEast()-e.getWest(),u=e.getNorth()-e.getSouth(),c=this._map.getSize();s=h/c.x>u/c.y?h/c.x:u/c.y,this.useRadius=this.useGeoUnit?parseInt(this.radius/s):this.radius;for(var d=0;d<this.features.length;d++){var p=this.features[d],f=p.geometry,m=this.getLocalXY(new re(f.x,f.y));this.featureWeight?(m.weight=p.attributes[this.featureWeight],this.maxWeight||(n=n||m.weight,a=a||m.weight,n=Math.max(n,m.weight),a=Math.min(a,m.weight))):m.weight=1,t=Math.floor(m[0]),i=Math.floor(m[1]),r=m.weight,l.push([t,i,r])}this.maxWeight?this.draw(l,this.maxWeight):(o=n&&a?(n+a)/2:1,this.draw(l,o))},draw:function(e,t){if(!(this.maxHeight>0&&this.maxWidth>0))return!1;var i=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var r=0;r<e.length;r++){var s=e[r];this.canvasContext.globalAlpha=Math.max(s[2]/t,.05),this.canvasContext.drawImage(this.circle,s[0]-this.useRadius,s[1]-this.useRadius)}var n=i.getImageData(0,0,this.maxWidth,this.maxHeight);this.colorize(n.data,this.grad),i.putImageData(n,0,0)},colorize:function(e,t){for(var i,r=0;r<e.length;r+=4)(i=4*e[r+3])&&(e[r]=t[i],e[r+1]=t[i+1],e[r+2]=t[i+2])},drawCircle:function(e){var t=this.blur||e/2,i=this.circle=document.createElement("canvas"),r=i.getContext("2d");i.height=2*e,i.width=2*e,r.shadowOffsetX=r.shadowOffsetY=2*e,r.shadowBlur=t,r.shadowColor="#000000",r.beginPath(),r.arc(-e,-e,e/2,0,2*Math.PI,!0),r.closePath(),r.fill()},createGradient:function(){var e=this.colors,t=document.createElement("canvas"),i=t.getContext("2d"),r=i.createLinearGradient(0,0,0,256);t.height=256,t.width=1;for(var s=1,n=0,a=e.length;n<a;n++)r.addColorStop(s/a,e[n]),s++;i.fillStyle=r,i.fillRect(0,0,1,256),this.grad=i.getImageData(0,0,1,256).data},update:function(){var e=this._map.containerPointToLayerPoint([0,0]);ao().DomUtil.setPosition(this.rootCanvas,e);var t=this;t.refresh(),t.currentMousePosition&&(t.currentMousePosition=ao().point(t.currentMousePosition.x-t.movingOffset[0],t.currentMousePosition.y-t.movingOffset[1])),t.movingOffset=[0,0],t._zoom=t._map.getZoom(),t._center=t._map.getCenter()},getLocalXY:function(e){if(!this._map)return e;var t=e;ao().Util.isArray(e)&&(t=ao().point(e[0],e[1])),e instanceof ao().Point||(t=e instanceof le||e instanceof ue?ao().point(e.x,e.y):ao().point(e.lon,e.lat));var i=this._map.latLngToContainerPoint(this.options.alwaysMapCRS?this._map.options.crs.unproject(t):ao().latLng(t.y,t.x));return[i.x,i.y]},setOpacity:function(e){e!==this.options.opacity&&(e&&(this.options.opacity=e),this._updateOpacity())},removeFeatures:function(e){if(e&&0!==e.length&&this.features&&0!==this.features.length){if(e===this.features)return this.removeAllFeatures();ee.isArray(e)||(e=[e]);for(var t,i,r=[],s=0,n=e.length;s<n;s++)t=e[s],-1!==(i=ee.indexOf(this.features,t))?this.features.splice(i,1):r.push(t);var a=0==r.length;this._map.fire("featuresremoved",{features:r,succeed:a}),this.refresh()}},removeAllFeatures:function(){this.features=[],this.refresh()},_createCanvasContainer:function(){var e=this.getPane(),t="heatMapLayer leaflet-layer leaflet-zoom-"+(this._map.options.zoomAnimation&&ao().Browser.any3d?"animated":"hide");this.rootCanvas=ao().DomUtil.create("canvas",t,e);var i=ao().DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);this.rootCanvas.id=this.id,this.rootCanvas.style[i]="50% 50%",this.rootCanvas.style.position="absolute",this.rootCanvas.style.zIndex=200,ee.modifyDOMElement(this.rootCanvas,null,null,null,null,null,null,this.opacity),this.canvasContext=this.rootCanvas.getContext("2d")},_updateOpacity:function(){var e=this;ee.modifyDOMElement(e.rootCanvas,null,null,null,null,null,null,e.options.opacity),null!==e._map&&e._map.fire("changelayer",{layer:e,property:"opacity"})},getEvents:function(){var e={zoomend:this._reset,moveend:this._reset,resize:this._resize};return this._map._zoomAnimated&&(e.zoomanim=this._zoomAnim),e},toiClientFeature:function(e){ao().Util.isArray(e)||(e=[e]);let t=[];for(let i=0,r=e.length;i<r;i++)if(e[i]instanceof mh)t.push(e[i].toFeature());else if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(e[i].type)){const r=new Oe;t=t.concat(r.read(e[i]))}else{if(!e[i].geometry||!e[i].geometry.parts)throw new Error("Features's type does not match, please check.");t.push(is.fromJson(e[i]).toFeature())}return t},_zoomAnim:function(e){var t=this._map.getZoomScale(e.zoom),i=this._map._getCenterOffset(e.center)._multiplyBy(-t).subtract(this._map._getMapPanePos());ao().DomUtil.setTransform?ao().DomUtil.setTransform(this.rootCanvas,i,t):this.rootCanvas.style[ao().DomUtil.TRANSFORM]=ao().DomUtil.getTranslateString(i)+" scale("+t+")"},_reset:function(){var e=this;e.update();var t=e._map.getSize(),i=this._map.containerPointToLayerPoint([0,0]);ao().DomUtil.setPosition(this.rootCanvas,i),parseFloat(e.rootCanvas.width)!==parseFloat(t.x)&&(e.rootCanvas.width=t.x),parseFloat(e.rootCanvas.height)!==parseFloat(t.y)&&(e.rootCanvas.height=t.y),e.refresh()},_resize:function(){var e=this._map.getSize();this.maxWidth=e.x,this.maxHeight=e.y}}),gh=i(510),vh=i.n(gh);!function(e){e[e.Unknown=0]="Unknown",e[e.Point=1]="Point",e[e.LineString=2]="LineString",e[e.Polygon=3]="Polygon",e[e.MultiPoint=4]="MultiPoint",e[e.MultiLineString=5]="MultiLineString",e[e.MultiPolygon=6]="MultiPolygon",e[e.GeometryCollection=7]="GeometryCollection",e[e.CircularString=8]="CircularString",e[e.CompoundCurve=9]="CompoundCurve",e[e.CurvePolygon=10]="CurvePolygon",e[e.MultiCurve=11]="MultiCurve",e[e.MultiSurface=12]="MultiSurface",e[e.Curve=13]="Curve",e[e.Surface=14]="Surface",e[e.PolyhedralSurface=15]="PolyhedralSurface",e[e.TIN=16]="TIN",e[e.Triangle=17]="Triangle"}(ph||(ph={}));var bh=i(903);function _h(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Sh,xh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bb=null,this.bb_pos=0}var t,i,r;return t=e,r=[{key:"getRootAsGeometry",value:function(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsGeometry",value:function(t,i){return t.setPosition(t.position()+bh.XU),(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startGeometry",value:function(e){e.startObject(8)}},{key:"addEnds",value:function(e,t){e.addFieldOffset(0,t,0)}},{key:"createEndsVector",value:function(e,t){e.startVector(4,t.length,4);for(var i=t.length-1;i>=0;i--)e.addInt32(t[i]);return e.endVector()}},{key:"startEndsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"addXy",value:function(e,t){e.addFieldOffset(1,t,0)}},{key:"createXyVector",value:function(e,t){e.startVector(8,t.length,8);for(var i=t.length-1;i>=0;i--)e.addFloat64(t[i]);return e.endVector()}},{key:"startXyVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addZ",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"createZVector",value:function(e,t){e.startVector(8,t.length,8);for(var i=t.length-1;i>=0;i--)e.addFloat64(t[i]);return e.endVector()}},{key:"startZVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addM",value:function(e,t){e.addFieldOffset(3,t,0)}},{key:"createMVector",value:function(e,t){e.startVector(8,t.length,8);for(var i=t.length-1;i>=0;i--)e.addFloat64(t[i]);return e.endVector()}},{key:"startMVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addT",value:function(e,t){e.addFieldOffset(4,t,0)}},{key:"createTVector",value:function(e,t){e.startVector(8,t.length,8);for(var i=t.length-1;i>=0;i--)e.addFloat64(t[i]);return e.endVector()}},{key:"startTVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addTm",value:function(e,t){e.addFieldOffset(5,t,0)}},{key:"createTmVector",value:function(e,t){e.startVector(8,t.length,8);for(var i=t.length-1;i>=0;i--)e.addInt64(t[i]);return e.endVector()}},{key:"startTmVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addType",value:function(e,t){e.addFieldInt8(6,t,ph.Unknown)}},{key:"addParts",value:function(e,t){e.addFieldOffset(7,t,0)}},{key:"createPartsVector",value:function(e,t){e.startVector(4,t.length,4);for(var i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}},{key:"startPartsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"endGeometry",value:function(e){return e.endObject()}},{key:"createGeometry",value:function(t,i,r,s,n,a,o,l,h){return e.startGeometry(t),e.addEnds(t,i),e.addXy(t,r),e.addZ(t,s),e.addM(t,n),e.addT(t,a),e.addTm(t,o),e.addType(t,l),e.addParts(t,h),e.endGeometry(t)}}],(i=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"ends",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}},{key:"endsLength",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"endsArray",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"xy",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"xyLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"xyArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"z",value:function(e){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"zLength",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"zArray",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"m",value:function(e){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"mLength",value:function(){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"mArray",value:function(){var e=this.bb.__offset(this.bb_pos,10);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"t",value:function(e){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"tLength",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"tArray",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"tm",value:function(e){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):BigInt(0)}},{key:"tmLength",value:function(){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"type",value:function(){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readUint8(this.bb_pos+e):ph.Unknown}},{key:"parts",value:function(t,i){var r=this.bb.__offset(this.bb_pos,18);return r?(i||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"partsLength",value:function(){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}}])&&_h(t.prototype,i),r&&_h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wh(e,t){for(var i=[],r=0;r<e.length;r+=2){var s=[e[r],e[r+1]];t&&s.push(t[r>>1]),i.push(s)}return i}function Ch(e,t,i){if(!i||0===i.length)return[wh(e,t)];var r,s=0,n=Array.from(i).map(function(t){return e.slice(s,s=t<<1)});return t&&(s=0,r=Array.from(i).map(function(e){return t.slice(s,s=e)})),n.map(function(e,t){return wh(e,r?r[t]:void 0)})}function Mh(e,t){var i=t;if(i===ph.Unknown&&(i=e.type()),i===ph.GeometryCollection){for(var r=[],s=0;s<e.partsLength();s++){var n=e.parts(s),a=n.type();r.push(Mh(n,a))}return{type:ph[i],geometries:r}}if(i===ph.MultiPolygon){for(var o=[],l=0;l<e.partsLength();l++)o.push(Mh(e.parts(l),ph.Polygon));return{type:ph[i],coordinates:o.map(function(e){return e.coordinates})}}var h=function(e,t){var i=e.xyArray(),r=e.zArray();switch(t){case ph.Point:var s=Array.from(i);return r&&s.push(r[0]),s;case ph.MultiPoint:case ph.LineString:return wh(i,r);case ph.MultiLineString:case ph.Polygon:return Ch(i,r,e.endsArray())}}(e,i);return{type:ph[i],coordinates:h}}function Ah(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}!function(e){e[e.Byte=0]="Byte",e[e.UByte=1]="UByte",e[e.Bool=2]="Bool",e[e.Short=3]="Short",e[e.UShort=4]="UShort",e[e.Int=5]="Int",e[e.UInt=6]="UInt",e[e.Long=7]="Long",e[e.ULong=8]="ULong",e[e.Float=9]="Float",e[e.Double=10]="Double",e[e.String=11]="String",e[e.Json=12]="Json",e[e.DateTime=13]="DateTime",e[e.Binary=14]="Binary"}(Sh||(Sh={}));var Th=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bb=null,this.bb_pos=0}var t,i,r;return t=e,r=[{key:"getRootAsColumn",value:function(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsColumn",value:function(t,i){return t.setPosition(t.position()+bh.XU),(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startColumn",value:function(e){e.startObject(11)}},{key:"addName",value:function(e,t){e.addFieldOffset(0,t,0)}},{key:"addType",value:function(e,t){e.addFieldInt8(1,t,Sh.Byte)}},{key:"addTitle",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"addDescription",value:function(e,t){e.addFieldOffset(3,t,0)}},{key:"addWidth",value:function(e,t){e.addFieldInt32(4,t,-1)}},{key:"addPrecision",value:function(e,t){e.addFieldInt32(5,t,-1)}},{key:"addScale",value:function(e,t){e.addFieldInt32(6,t,-1)}},{key:"addNullable",value:function(e,t){e.addFieldInt8(7,+t,1)}},{key:"addUnique",value:function(e,t){e.addFieldInt8(8,+t,0)}},{key:"addPrimaryKey",value:function(e,t){e.addFieldInt8(9,+t,0)}},{key:"addMetadata",value:function(e,t){e.addFieldOffset(10,t,0)}},{key:"endColumn",value:function(e){var t=e.endObject();return e.requiredField(t,4),t}},{key:"createColumn",value:function(t,i,r,s,n,a,o,l,h,u,c,d){return e.startColumn(t),e.addName(t,i),e.addType(t,r),e.addTitle(t,s),e.addDescription(t,n),e.addWidth(t,a),e.addPrecision(t,o),e.addScale(t,l),e.addNullable(t,h),e.addUnique(t,u),e.addPrimaryKey(t,c),e.addMetadata(t,d),e.endColumn(t)}}],(i=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"name",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"type",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):Sh.Byte}},{key:"title",value:function(e){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"width",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt32(this.bb_pos+e):-1}},{key:"precision",value:function(){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt32(this.bb_pos+e):-1}},{key:"scale",value:function(){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):-1}},{key:"nullable",value:function(){var e=this.bb.__offset(this.bb_pos,18);return!e||!!this.bb.readInt8(this.bb_pos+e)}},{key:"unique",value:function(){var e=this.bb.__offset(this.bb_pos,20);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"primaryKey",value:function(){var e=this.bb.__offset(this.bb_pos,22);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"metadata",value:function(e){var t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&Ah(t.prototype,i),r&&Ah(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Eh(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Lh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bb=null,this.bb_pos=0}var t,i,r;return t=e,r=[{key:"getRootAsFeature",value:function(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsFeature",value:function(t,i){return t.setPosition(t.position()+bh.XU),(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startFeature",value:function(e){e.startObject(3)}},{key:"addGeometry",value:function(e,t){e.addFieldOffset(0,t,0)}},{key:"addProperties",value:function(e,t){e.addFieldOffset(1,t,0)}},{key:"createPropertiesVector",value:function(e,t){e.startVector(1,t.length,1);for(var i=t.length-1;i>=0;i--)e.addInt8(t[i]);return e.endVector()}},{key:"startPropertiesVector",value:function(e,t){e.startVector(1,t,1)}},{key:"addColumns",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"createColumnsVector",value:function(e,t){e.startVector(4,t.length,4);for(var i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}},{key:"startColumnsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"endFeature",value:function(e){return e.endObject()}},{key:"finishFeatureBuffer",value:function(e,t){e.finish(t)}},{key:"finishSizePrefixedFeatureBuffer",value:function(e,t){e.finish(t,void 0,!0)}},{key:"createFeature",value:function(t,i,r,s){return e.startFeature(t),e.addGeometry(t,i),e.addProperties(t,r),e.addColumns(t,s),e.endFeature(t)}}],(i=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"geometry",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?(e||new xh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"properties",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}},{key:"propertiesLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"propertiesArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"columns",value:function(e,t){var i=this.bb.__offset(this.bb_pos,8);return i?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*e),this.bb):null}},{key:"columnsLength",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}}])&&Eh(t.prototype,i),r&&Eh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Oh=(new TextEncoder,new TextDecoder);function Ph(e,t){var i={};if(!t||0===t.length)return i;var r=e.propertiesArray();if(!r)return i;for(var s=new DataView(r.buffer,r.byteOffset),n=e.propertiesLength(),a=0;a<n;){var o=s.getUint16(a,!0);a+=2;var l=t[o],h=l.name;switch(l.type){case Sh.Bool:i[h]=!!s.getUint8(a),a+=1;break;case Sh.Byte:i[h]=s.getInt8(a),a+=1;break;case Sh.UByte:i[h]=s.getUint8(a),a+=1;break;case Sh.Short:i[h]=s.getInt16(a,!0),a+=2;break;case Sh.UShort:i[h]=s.getUint16(a,!0),a+=2;break;case Sh.Int:i[h]=s.getInt32(a,!0),a+=4;break;case Sh.UInt:i[h]=s.getUint32(a,!0),a+=4;break;case Sh.Long:i[h]=Number(s.getBigInt64(a,!0)),a+=8;break;case Sh.ULong:i[h]=Number(s.getBigUint64(a,!0)),a+=8;break;case Sh.Float:i[h]=s.getFloat32(a,!0),a+=4;break;case Sh.Double:i[h]=s.getFloat64(a,!0),a+=8;break;case Sh.DateTime:case Sh.String:var u=s.getUint32(a,!0);a+=4,i[h]=Oh.decode(r.subarray(a,a+u)),a+=u;break;case Sh.Json:var c=s.getUint32(a,!0);a+=4;var d=Oh.decode(r.subarray(a,a+c));i[h]=JSON.parse(d),a+=c;break;default:throw new Error("Unknown type "+l.type)}}return i}function Nh(e,t){var i=t.columns;return{type:"Feature",geometry:Mh(e.geometry(),t.geometryType),properties:Ph(e,i)}}var Ih=i(901);function Fh(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var kh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bb=null,this.bb_pos=0}var t,i,r;return t=e,r=[{key:"getRootAsCrs",value:function(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsCrs",value:function(t,i){return t.setPosition(t.position()+bh.XU),(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startCrs",value:function(e){e.startObject(6)}},{key:"addOrg",value:function(e,t){e.addFieldOffset(0,t,0)}},{key:"addCode",value:function(e,t){e.addFieldInt32(1,t,0)}},{key:"addName",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"addDescription",value:function(e,t){e.addFieldOffset(3,t,0)}},{key:"addWkt",value:function(e,t){e.addFieldOffset(4,t,0)}},{key:"addCodeString",value:function(e,t){e.addFieldOffset(5,t,0)}},{key:"endCrs",value:function(e){return e.endObject()}},{key:"createCrs",value:function(t,i,r,s,n,a,o){return e.startCrs(t),e.addOrg(t,i),e.addCode(t,r),e.addName(t,s),e.addDescription(t,n),e.addWkt(t,a),e.addCodeString(t,o),e.endCrs(t)}}],(i=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"org",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"code",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}},{key:"name",value:function(e){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"wkt",value:function(e){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"codeString",value:function(e){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&Fh(t.prototype,i),r&&Fh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Dh(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Rh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bb=null,this.bb_pos=0}var t,i,r;return t=e,r=[{key:"getRootAsHeader",value:function(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsHeader",value:function(t,i){return t.setPosition(t.position()+bh.XU),(i||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startHeader",value:function(e){e.startObject(14)}},{key:"addName",value:function(e,t){e.addFieldOffset(0,t,0)}},{key:"addEnvelope",value:function(e,t){e.addFieldOffset(1,t,0)}},{key:"createEnvelopeVector",value:function(e,t){e.startVector(8,t.length,8);for(var i=t.length-1;i>=0;i--)e.addFloat64(t[i]);return e.endVector()}},{key:"startEnvelopeVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addGeometryType",value:function(e,t){e.addFieldInt8(2,t,ph.Unknown)}},{key:"addHasZ",value:function(e,t){e.addFieldInt8(3,+t,0)}},{key:"addHasM",value:function(e,t){e.addFieldInt8(4,+t,0)}},{key:"addHasT",value:function(e,t){e.addFieldInt8(5,+t,0)}},{key:"addHasTm",value:function(e,t){e.addFieldInt8(6,+t,0)}},{key:"addColumns",value:function(e,t){e.addFieldOffset(7,t,0)}},{key:"createColumnsVector",value:function(e,t){e.startVector(4,t.length,4);for(var i=t.length-1;i>=0;i--)e.addOffset(t[i]);return e.endVector()}},{key:"startColumnsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"addFeaturesCount",value:function(e,t){e.addFieldInt64(8,t,BigInt("0"))}},{key:"addIndexNodeSize",value:function(e,t){e.addFieldInt16(9,t,16)}},{key:"addCrs",value:function(e,t){e.addFieldOffset(10,t,0)}},{key:"addTitle",value:function(e,t){e.addFieldOffset(11,t,0)}},{key:"addDescription",value:function(e,t){e.addFieldOffset(12,t,0)}},{key:"addMetadata",value:function(e,t){e.addFieldOffset(13,t,0)}},{key:"endHeader",value:function(e){return e.endObject()}},{key:"finishHeaderBuffer",value:function(e,t){e.finish(t)}},{key:"finishSizePrefixedHeaderBuffer",value:function(e,t){e.finish(t,void 0,!0)}}],(i=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"name",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"envelope",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"envelopeLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"envelopeArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"geometryType",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):ph.Unknown}},{key:"hasZ",value:function(){var e=this.bb.__offset(this.bb_pos,10);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasM",value:function(){var e=this.bb.__offset(this.bb_pos,12);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasT",value:function(){var e=this.bb.__offset(this.bb_pos,14);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasTm",value:function(){var e=this.bb.__offset(this.bb_pos,16);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"columns",value:function(e,t){var i=this.bb.__offset(this.bb_pos,18);return i?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*e),this.bb):null}},{key:"columnsLength",value:function(){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"featuresCount",value:function(){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}},{key:"indexNodeSize",value:function(){var e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}},{key:"crs",value:function(e){var t=this.bb.__offset(this.bb_pos,24);return t?(e||new kh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"title",value:function(e){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"metadata",value:function(e){var t=this.bb.__offset(this.bb_pos,30);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&Dh(t.prototype,i),r&&Dh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bh(e){for(var t=Rh.getRootAsHeader(e),i=t.featuresCount(),r=t.indexNodeSize(),s=[],n=0;n<t.columnsLength();n++){var a=t.columns(n);if(!a)throw new Error("Column unexpectedly missing");if(!a.name())throw new Error("Column name unexpectedly missing");s.push({name:a.name(),type:a.type(),title:a.title(),description:a.description(),width:a.width(),precision:a.precision(),scale:a.scale(),nullable:a.nullable(),unique:a.unique(),primary_key:a.primaryKey()})}var o=t.crs(),l=o?{org:o.org(),code:o.code(),name:o.name(),description:o.description(),wkt:o.wkt(),code_string:o.codeString()}:null;return{geometryType:t.geometryType(),columns:s,envelope:null,featuresCount:Number(i),indexNodeSize:r,crs:l,title:t.title(),description:t.description(),metadata:t.metadata()}}var Gh=i(982);function Uh(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var jh,zh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._extraRequestThreshold=262144}var t,i,r;return t=e,(i=[{key:"extraRequestThreshold",value:function(){return this._extraRequestThreshold}},{key:"setExtraRequestThreshold",value:function(e){if(e<0)throw new Error("extraRequestThreshold cannot be negative");this._extraRequestThreshold=e}}])&&Uh(t.prototype,i),r&&Uh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Vh(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}zh.global=new zh,function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warn=2]="Warn",e[e.Error=3]="Error"}(jh||(jh={}));var Jh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,i,r;return t=e,r=[{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.log.apply(this,[jh.Debug].concat(t))}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.log.apply(this,[jh.Info].concat(t))}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.log.apply(this,[jh.Warn].concat(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.log.apply(this,[jh.Error].concat(t))}},{key:"log",value:function(e){if(!(this.logLevel>e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];switch(e){case jh.Debug:var s;(s=console).debug.apply(s,i);break;case jh.Info:var n;(n=console).info.apply(n,i);break;case jh.Warn:var a;(a=console).warn.apply(a,i);break;case jh.Error:var o;(o=console).error.apply(o,i)}}}}],(i=null)&&Vh(t.prototype,i),r&&Vh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function qh(e){"@babel/helpers - typeof";return(qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hh(){Hh=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function o(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,i){return e[t]=i}}function l(e,t,i,r){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(r||[]);return n._invoke=function(e,t,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return M()}for(i.method=s,i.arg=n;;){var a=i.delegate;if(a){var o=_(a,i);if(o){if(o===u)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var l=h(e,t,i);if("normal"===l.type){if(r=i.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r="completed",i.method="throw",i.arg=l.arg)}}}(e,i,a),n}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function c(){}function d(){}function p(){}var f={};o(f,s,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==t&&i.call(y,s)&&(f=y);var g=p.prototype=c.prototype=Object.create(f);function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){var r;this._invoke=function(s,n){function a(){return new t(function(r,a){!function r(s,n,a,o){var l=h(e[s],e,n);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==qh(c)&&i.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,o)},function(e){r("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,o)})}o(l.arg)}(s,n,r,a)})}return r=r?r.then(a,a):a()}}function _(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,o(g,"constructor",p),o(p,"constructor",d),d.displayName=o(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},v(b.prototype),o(b.prototype,n,function(){return this}),e.AsyncIterator=b,e.async=function(t,i,r,s,n){void 0===n&&(n=Promise);var a=new b(l(t,i,r,s),n);return e.isGeneratorFunction(i)?a:a.next().then(function(e){return e.done?e.value:a.next()})},v(g),o(g,a,"Generator"),o(g,s,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var r=t.pop();if(r in e)return i.value=r,i.done=!1,i}return i.done=!0,i}},e.values=C,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(i,r){return a.type="throw",a.arg=e,t.next=i,r&&(t.method="next",t.arg=void 0),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return r(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var n=s;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function Wh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var r,s,n=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw s}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yh(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Yh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function Xh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qh(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zh(e){var t,i;function r(t,i){try{var n=e[t](i),a=n.value,o=a instanceof Kh;Promise.resolve(o?a.v:a).then(function(i){if(o){var l="return"===t?"return":"next";if(!a.k||i.done)return r(l,i);i=e[l](i).value}s(n.done?"return":"normal",i)},function(e){r("throw",e)})}catch(e){s("throw",e)}}function s(e,s){switch(e){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?r(t.key,t.arg):i=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};i?i=i.next=o:(t=i=o,r(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function Kh(e,t){this.v=e,this.k=t}Jh.logLevel=jh.Info,Zh.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Zh.prototype.next=function(e){return this._invoke("next",e)},Zh.prototype.throw=function(e){return this._invoke("throw",e)},Zh.prototype.return=function(e){return this._invoke("return",e)};var $h=40;function eu(e,t){t=Math.min(Math.max(+t,2),65535);var i=e,r=i;do{r+=i=Math.ceil(i/t)}while(1!==i);return r*$h}function tu(e,t){if(t<2)throw new Error("Node size must be at least 2");if(0===e)throw new Error("Number of items must be greater than 0");var i=e,r=i,s=[i];do{r+=i=Math.ceil(i/t),s.push(i)}while(1!==i);var n=[];i=r;for(var a=0,o=s;a<o.length;a++){var l=o[a];n.push(i-l),i-=l}n.reverse(),s.reverse();for(var h=[],u=0;u<s.length;u++)h.push([n[u],n[u]+s[u]]);return h.reverse(),h}function iu(e,t,i,r){return ru.apply(this,arguments)}function ru(){var e;return e=Hh().mark(function e(t,i,r,s){var n,a,o,l,h,u,c,d,p,f;return Hh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=function(){function e(t,i){Xh(this,e),this._level=i,this.nodes=t}var t,i,r;return t=e,(i=[{key:"level",value:function(){return this._level}},{key:"startNode",value:function(){return this.nodes[0]}},{key:"endNode",value:function(){return this.nodes[1]}},{key:"extendEndNodeToNewOffset",value:function(e){console.assert(e>this.nodes[1]),this.nodes[1]=e}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&Qh(t.prototype,i),r&&Qh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),a=r.minX,o=r.minY,l=r.maxX,h=r.maxY,Jh.info("tree items: ".concat(t,", nodeSize: ").concat(i)),u=tu(t,i),c=u[0][0],void 0,m=u.length-1,d=new n([0,1],m),p=[d],Jh.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(t,", nodeSize: ").concat(i,", levelBounds: ").concat(u)),f=Hh().mark(function e(){var r,d,f,m,y,g,v,b,_,S,x,w;return Hh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.shift(),Jh.debug("popped node: ".concat(r,", queueLength: ").concat(p.length)),d=r.startNode(),f=d>=c,m=Wh(u[r.level()],2),y=m[1],g=Math.min(r.endNode()+i,y),v=g-d,e.next=9,new Kh(s(d*$h,v*$h),0);case 9:b=e.sent,_=new Float64Array(b),S=new Uint32Array(b),x=Hh().mark(function e(i){var s,u,m,y,g,v,b,x;return Hh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(l<_[(s=5*(i-d))+0])){e.next=3;break}return e.abrupt("return",0);case 3:if(!(h<_[s+1])){e.next=5;break}return e.abrupt("return",0);case 5:if(!(a>_[s+2])){e.next=7;break}return e.abrupt("return",0);case 7:if(!(o>_[s+3])){e.next=9;break}return e.abrupt("return",0);case 9:if(u=S[8+(s<<1)],m=S[9+(s<<1)],y=su(m,u),!f){e.next=17;break}return g=function(){if(i<t-1){var e=5*(i-d+1),r=S[8+(e<<1)];return su(S[9+(e<<1)],r)-y}return null}(),e.next=16,[y,i-c,g];case 16:return e.abrupt("return",0);case 17:if(v=zh.global.extraRequestThreshold()/$h,!(void 0!==(b=p[p.length-1])&&b.level()==r.level()-1&&y<b.endNode()+v)){e.next=23;break}return Jh.debug('Merging "nodeRange" request into existing range: '.concat(b,", newOffset: ").concat(b.endNode()," -> ").concat(y)),b.extendEndNodeToNewOffset(y),e.abrupt("return",0);case 23:void 0,w=r.level()-1,x=new n([y,y+1],w),void 0!==b&&b.level()==x.level()?Jh.info("Same level, but too far away. Pushing new request at offset: ".concat(y," rather than merging with distant ").concat(b)):Jh.info("Pushing new level for ".concat(x," onto queue with nearestNodeRange: ").concat(b," since there's not already a range for this level.")),p.push(x);case 26:case"end":return e.stop()}var w},e)}),w=d;case 14:if(!(w<g)){e.next=22;break}return e.delegateYield(x(w),"t0",16);case 16:if(0!==e.t0){e.next=19;break}return e.abrupt("continue",19);case 19:w++,e.next=14;break;case 22:case"end":return e.stop()}},e)});case 9:if(0==p.length){e.next=13;break}return e.delegateYield(f(),"t0",11);case 11:e.next=9;break;case 13:case"end":return e.stop()}var m},e)}),(ru=function(){return new Zh(e.apply(this,arguments))}).apply(this,arguments)}function su(e,t){if(0!=(4293918720&e))throw Error("integer is too large to be safely represented");return t+e*Math.pow(2,32)}var nu=new Uint8Array([102,103,98,3,102,103,98,0]),au=4;function ou(e){"@babel/helpers - typeof";return(ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lu(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=uu(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,n=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw n}}}}function hu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var r,s,n=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw s}}return n}(e,t)||uu(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uu(e,t){if(e){if("string"==typeof e)return cu(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?cu(e,t):void 0}}function cu(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function du(){du=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function o(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,i){return e[t]=i}}function l(e,t,i,r){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(r||[]);return n._invoke=function(e,t,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return M()}for(i.method=s,i.arg=n;;){var a=i.delegate;if(a){var o=_(a,i);if(o){if(o===u)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var l=h(e,t,i);if("normal"===l.type){if(r=i.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r="completed",i.method="throw",i.arg=l.arg)}}}(e,i,a),n}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function c(){}function d(){}function p(){}var f={};o(f,s,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==t&&i.call(y,s)&&(f=y);var g=p.prototype=c.prototype=Object.create(f);function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){var r;this._invoke=function(s,n){function a(){return new t(function(r,a){!function r(s,n,a,o){var l=h(e[s],e,n);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==ou(c)&&i.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,o)},function(e){r("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,o)})}o(l.arg)}(s,n,r,a)})}return r=r?r.then(a,a):a()}}function _(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,o(g,"constructor",p),o(p,"constructor",d),d.displayName=o(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},v(b.prototype),o(b.prototype,n,function(){return this}),e.AsyncIterator=b,e.async=function(t,i,r,s,n){void 0===n&&(n=Promise);var a=new b(l(t,i,r,s),n);return e.isGeneratorFunction(i)?a:a.next().then(function(e){return e.done?e.value:a.next()})},v(g),o(g,a,"Generator"),o(g,s,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var r=t.pop();if(r in e)return i.value=r,i.done=!1,i}return i.done=!0,i}},e.values=C,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(i,r){return a.type="throw",a.arg=e,t.next=i,r&&(t.method="next",t.arg=void 0),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return r(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var n=s;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function pu(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function fu(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){pu(n,r,s,a,o,"next",e)}function o(e){pu(n,r,s,a,o,"throw",e)}a(void 0)})}}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yu(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gu(e,t,i){return t&&yu(e.prototype,t),i&&yu(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function vu(e){return function(){return new bu(e.apply(this,arguments))}}function bu(e){var t,i;function r(t,i){try{var n=e[t](i),a=n.value,o=a instanceof xu;Promise.resolve(o?a.v:a).then(function(i){if(o){var l="return"===t?"return":"next";if(!a.k||i.done)return r(l,i);i=e[l](i).value}s(n.done?"return":"normal",i)},function(e){r("throw",e)})}catch(e){s("throw",e)}}function s(e,s){switch(e){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?r(t.key,t.arg):i=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};i?i=i.next=o:(t=i=o,r(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function _u(e){return new xu(e,0)}function Su(e){var t={},i=!1;function r(t,r){return i=!0,{done:!1,value:new xu(r=new Promise(function(i){i(e[t](r))}),1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return i?(i=!1,e):r("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(i)throw i=!1,e;return r("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return i?(i=!1,e):r("return",e)}),t}function xu(e,t){this.v=e,this.k=t}function wu(e){var t,i,r,s=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(i&&null!=(t=e[i]))return t.call(e);if(r&&null!=(t=e[r]))return new Cu(t.call(e));i="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Cu(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(Cu=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new Cu(e)}bu.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},bu.prototype.next=function(e){return this._invoke("next",e)},bu.prototype.throw=function(e){return this._invoke("throw",e)},bu.prototype.return=function(e){return this._invoke("return",e)};var Mu=function(){function e(t,i,r,s){mu(this,e),this.headerClient=t,this.header=i,this.headerLength=r,this.indexLength=s}return gu(e,[{key:"selectBbox",value:function(e){var t=this;return vu(du().mark(function i(){var r,s,n,a,o,l,h,u,c,d,p,f,m,y,g,v,b,_,S;return du().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=t.lengthBeforeTree(),s=t.headerClient,n=function(){var e=fu(du().mark(function e(t,i){var n;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=0,e.abrupt("return",s.getRange(r+t,i,n,"index"));case 2:case"end":return e.stop()}},e)}));return function(t,i){return e.apply(this,arguments)}}(),a=[],o=[],l=!1,h=!1,i.prev=7,c=wu(iu(t.header.featuresCount,t.header.indexNodeSize,e,n));case 9:return i.next=11,_u(c.next());case 11:if(!(l=!(d=i.sent).done)){i.next=26;break}if(p=d.value,f=hu(p,2),m=f[0],y=hu(p,3),(g=y[2])||(Jh.info("final feature"),v=zh.global.extraRequestThreshold(),g=v),0!=o.length){i.next=19;break}return o.push([m,g]),i.abrupt("continue",23);case 19:b=o[o.length-1],(_=m-(b[0]+b[1]))>zh.global.extraRequestThreshold()&&(Jh.info("Pushing new feature batch, since gap ".concat(_," was too large")),a.push(o),o=[]),o.push([m,g]);case 23:l=!1,i.next=9;break;case 26:i.next=32;break;case 28:i.prev=28,i.t0=i.catch(7),h=!0,u=i.t0;case 32:if(i.prev=32,i.prev=33,!l||null==c.return){i.next=37;break}return i.next=37,_u(c.return());case 37:if(i.prev=37,!h){i.next=40;break}throw u;case 40:return i.finish(37);case 41:return i.finish(32);case 42:return t.headerClient.logUsage("header+index"),o.length>0&&a.push(o),S=a.flatMap(function(e){return t.readFeatureBatch(e)}),i.delegateYield(Su(wu(Gh.ZN.merge(S))),"t1",46);case 46:case"end":return i.stop()}},i,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return nu.length+au+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(){return new Au(this.headerClient.httpClient)}},{key:"readFeatureBatch",value:function(e){var t=this;return vu(du().mark(function i(){var r,s,n,a,o,l,h,u,c,d,p;return du().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=hu(e[0],1),s=r[0],n=hu(e[e.length-1],2),a=n[0],o=n[1],l=a+o-s,h=t.buildFeatureClient(),u=lu(e),i.prev=7,u.s();case 9:if((c=u.n()).done){i.next=17;break}return d=hu(c.value,1),p=d[0],i.next=13,_u(t.readFeature(h,p,l));case 13:return i.next=15,i.sent;case 15:i.next=9;break;case 17:i.next=22;break;case 19:i.prev=19,i.t0=i.catch(7),u.e(i.t0);case 22:return i.prev=22,u.f(),i.finish(22);case 25:h.logUsage("feature");case 26:case"end":return i.stop()}},i,null,[[7,19,22,25]])}))()}},{key:"readFeature",value:function(){var e=fu(du().mark(function e(t,i,r){var s,n,a,o,l,h,u;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=i+this.lengthBeforeFeatures(),e.next=3,t.getRange(s,4,r,"feature length");case 3:return a=e.sent,n=new DataView(a).getUint32(0,!0),e.next=7,t.getRange(s+4,n,r,"feature data");case 7:return o=e.sent,l=new Uint8Array(o),(h=new Uint8Array(n+au)).set(l,au),(u=new bh.cZ(h)).setPosition(au),e.abrupt("return",Lh.getRootAsFeature(u));case 14:case"end":return e.stop()}},e,this)}));return function(t,i,r){return e.apply(this,arguments)}}()}],[{key:"open",value:function(){var t=fu(du().mark(function t(i){var r,s,n,a,o,l,h,u,c,d,p;return du().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=2024,s=new Au(i),n=function(){var e,t=0;for(e=0;e<3;e++){t+=Math.pow(16,e)*$h}return t}(),a=r+n,Jh.debug("fetching header. minReqLength: ".concat(a," (assumedHeaderLength: ").concat(r,", assumedIndexLength: ").concat(n,")")),t.t0=Uint8Array,t.next=8,s.getRange(0,8,a,"header");case 8:if(t.t1=t.sent,(o=new t.t0(t.t1)).subarray(0,3).every(function(e,t){return nu[t]===e})){t.next=13;break}throw Jh.error("bytes: ".concat(o," != ").concat(nu)),new Error("Not a FlatGeobuf file");case 13:return Jh.debug("magic bytes look good"),t.next=16,s.getRange(8,4,a,"header");case 16:if(h=t.sent,!((l=new DataView(h).getUint32(0,!0))>10485760||l<8)){t.next=21;break}throw new Error("Invalid header size");case 21:return Jh.debug("headerLength: ".concat(l)),t.next=24,s.getRange(12,l,a,"header");case 24:return u=t.sent,c=new bh.cZ(new Uint8Array(u)),d=Bh(c),p=eu(d.featuresCount,d.indexNodeSize),Jh.debug("completed: opening http reader"),t.abrupt("return",new e(s,d,l,p));case 30:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()}]),e}(),Au=function(){function e(t){mu(this,e),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new Tu(t):t}return gu(e,[{key:"getRange",value:function(){var e=fu(du().mark(function e(t,i,r,s){var n,a,o;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bytesEverUsed+=i,n=t-this.head,a=n+i,!(n>=0&&a<=this.buffer.byteLength)){e.next=5;break}return e.abrupt("return",this.buffer.slice(n,a));case 5:return o=Math.max(i,r),this.bytesEverFetched+=o,Jh.debug("requesting for new Range: ".concat(t,"-").concat(t+i-1)),e.next=10,this.httpClient.getRange(t,o,s);case 10:return this.buffer=e.sent,this.head=t,e.abrupt("return",this.buffer.slice(0,i));case 13:case"end":return e.stop()}},e,this)}));return function(t,i,r,s){return e.apply(this,arguments)}}()},{key:"logUsage",value:function(e){var t=e.split(" ")[0],i=this.bytesEverUsed,r=this.bytesEverFetched,s=(100*i/r).toFixed(2);Jh.info("".concat(t," bytes used/requested: ").concat(i," / ").concat(r," = ").concat(s,"%"))}}]),e}(),Tu=function(){function e(t){mu(this,e),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}return gu(e,[{key:"getRange",value:function(){var e=fu(du().mark(function e(t,i,r){var s,n;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=i,s="bytes=".concat(t,"-").concat(t+i-1),Jh.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(r,"), bytes: (this_request: ").concat(i,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(s)),e.next=6,fetch(this.url,{headers:{Range:s}});case 6:return n=e.sent,e.abrupt("return",n.arrayBuffer());case 8:case"end":return e.stop()}},e,this)}));return function(t,i,r){return e.apply(this,arguments)}}()}]),e}();function Eu(e){"@babel/helpers - typeof";return(Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lu(){Lu=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function o(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,i){return e[t]=i}}function l(e,t,i,r){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(r||[]);return n._invoke=function(e,t,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return M()}for(i.method=s,i.arg=n;;){var a=i.delegate;if(a){var o=_(a,i);if(o){if(o===u)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var l=h(e,t,i);if("normal"===l.type){if(r=i.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r="completed",i.method="throw",i.arg=l.arg)}}}(e,i,a),n}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function c(){}function d(){}function p(){}var f={};o(f,s,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==t&&i.call(y,s)&&(f=y);var g=p.prototype=c.prototype=Object.create(f);function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){var r;this._invoke=function(s,n){function a(){return new t(function(r,a){!function r(s,n,a,o){var l=h(e[s],e,n);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==Eu(c)&&i.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,o)},function(e){r("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,o)})}o(l.arg)}(s,n,r,a)})}return r=r?r.then(a,a):a()}}function _(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,o(g,"constructor",p),o(p,"constructor",d),d.displayName=o(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},v(b.prototype),o(b.prototype,n,function(){return this}),e.AsyncIterator=b,e.async=function(t,i,r,s,n){void 0===n&&(n=Promise);var a=new b(l(t,i,r,s),n);return e.isGeneratorFunction(i)?a:a.next().then(function(e){return e.done?e.value:a.next()})},v(g),o(g,a,"Generator"),o(g,s,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var r=t.pop();if(r in e)return i.value=r,i.done=!1,i}return i.done=!0,i}},e.values=C,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(i,r){return a.type="throw",a.arg=e,t.next=i,r&&(t.method="next",t.arg=void 0),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return r(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var n=s;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function Ou(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function Pu(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){Ou(n,r,s,a,o,"next",e)}function o(e){Ou(n,r,s,a,o,"throw",e)}a(void 0)})}}function Nu(e){var t,i,r,s=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(i&&null!=(t=e[i]))return t.call(e);if(r&&null!=(t=e[r]))return new Iu(t.call(e));i="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Iu(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(Iu=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new Iu(e)}function Fu(e){return new Ru(e,0)}function ku(e){return function(){return new Du(e.apply(this,arguments))}}function Du(e){var t,i;function r(t,i){try{var n=e[t](i),a=n.value,o=a instanceof Ru;Promise.resolve(o?a.v:a).then(function(i){if(o){var l="return"===t?"return":"next";if(!a.k||i.done)return r(l,i);i=e[l](i).value}s(n.done?"return":"normal",i)},function(e){r("throw",e)})}catch(e){s("throw",e)}}function s(e,s){switch(e){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?r(t.key,t.arg):i=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};i?i=i.next=o:(t=i=o,r(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function Ru(e,t){this.v=e,this.k=t}function Bu(){return(Bu=ku(Lu().mark(function e(t,i,r){var s,n,a,o,l,h,u,c,d,p;return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=Ih(t),n=function(){var e=Pu(Lu().mark(function e(t){return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.slice(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.t0=Uint8Array,e.next=5,Fu(n(8,"magic bytes"));case 5:if(e.t1=e.sent,(a=new e.t0(e.t1)).subarray(0,3).every(function(e,t){return nu[t]===e})){e.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return e.t2=Uint8Array,e.next=12,Fu(n(4,"header length"));case 12:return e.t3=e.sent,a=new e.t2(e.t3),o=new bh.cZ(a),l=o.readUint32(0),e.t4=Uint8Array,e.next=19,Fu(n(l,"header data"));case 19:if(e.t5=e.sent,a=new e.t4(e.t5),o=new bh.cZ(a),h=Bh(o),r&&r(h),u=h.indexNodeSize,c=h.featuresCount,!(u>0)){e.next=29;break}return d=eu(c,u),e.next=29,Fu(n(d,"entire index, w/o rect"));case 29:return e.next=31,Fu(Uu(n,h,i));case 31:if(!(p=e.sent)){e.next=36;break}return e.next=34,p;case 34:e.next=29;break;case 36:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Gu(){return(Gu=ku(Lu().mark(function e(t,i,r,s){var n,a,o,l,h,u,c;return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(Mu.open(t));case 2:n=e.sent,Jh.debug("opened reader"),s&&s(n.header),a=!1,o=!1,e.prev=7,h=Nu(n.selectBbox(i));case 9:return e.next=11,Fu(h.next());case 11:if(!(a=!(u=e.sent).done)){e.next=18;break}return c=u.value,e.next=15,r(c,n.header);case 15:a=!1,e.next=9;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(7),o=!0,l=e.t0;case 24:if(e.prev=24,e.prev=25,!a||null==h.return){e.next=29;break}return e.next=29,Fu(h.return());case 29:if(e.prev=29,!o){e.next=32;break}throw l;case 32:return e.finish(29);case 33:return e.finish(24);case 34:case"end":return e.stop()}},e,null,[[7,20,24,34],[25,,29,33]])}))).apply(this,arguments)}function Uu(e,t,i){return ju.apply(this,arguments)}function ju(){return(ju=Pu(Lu().mark(function e(t,i,r){var s,n,a,o,l;return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,t(4,"feature length");case 3:if(e.t1=e.sent,0!==(s=new e.t0(e.t1)).byteLength){e.next=7;break}return e.abrupt("return");case 7:return n=new bh.cZ(s),a=n.readUint32(0),e.t2=Uint8Array,e.next=12,t(a,"feature data");case 12:return e.t3=e.sent,s=new e.t2(e.t3),(o=new Uint8Array(a+4)).set(s,4),(n=new bh.cZ(o)).setPosition(au),l=Lh.getRootAsFeature(n),e.abrupt("return",r(l,i));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function zu(e,t){return{type:"FeatureCollection",features:function(e,t,i){if(!e.subarray(0,3).every(function(e,t){return nu[t]===e}))throw new Error("Not a FlatGeobuf file");var r=new bh.cZ(e),s=r.readUint32(nu.length);r.setPosition(nu.length+au);var n=Bh(r);i&&i(n);var a=nu.length+au+s,o=n.indexNodeSize,l=n.featuresCount;o>0&&(a+=eu(l,o));for(var h=[];a<r.capacity();){var u=r.readUint32(a);r.setPosition(a+au);var c=Lh.getRootAsFeature(r);h.push(t(c,n)),a+=au+u}return h}(e,Nh,t)}}function Vu(e,t){return function(e,t,i){return Bu.apply(this,arguments)}(e,Nh,t)}function Ju(e,t,i){return function(e,t,i,r){return Gu.apply(this,arguments)}(e,t,Nh,i)}function qu(e,t,i){return e instanceof Uint8Array?zu(e,i):e instanceof ReadableStream?Vu(e,i):Ju(e,t,i)}function Hu(e){"@babel/helpers - typeof";return(Hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wu(){Wu=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function o(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,i){return e[t]=i}}function l(e,t,i,r){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(r||[]);return n._invoke=function(e,t,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return M()}for(i.method=s,i.arg=n;;){var a=i.delegate;if(a){var o=_(a,i);if(o){if(o===u)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var l=h(e,t,i);if("normal"===l.type){if(r=i.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r="completed",i.method="throw",i.arg=l.arg)}}}(e,i,a),n}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function c(){}function d(){}function p(){}var f={};o(f,s,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==t&&i.call(y,s)&&(f=y);var g=p.prototype=c.prototype=Object.create(f);function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){var r;this._invoke=function(s,n){function a(){return new t(function(r,a){!function r(s,n,a,o){var l=h(e[s],e,n);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==Hu(c)&&i.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,o)},function(e){r("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,o)})}o(l.arg)}(s,n,r,a)})}return r=r?r.then(a,a):a()}}function _(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,o(g,"constructor",p),o(p,"constructor",d),d.displayName=o(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},v(b.prototype),o(b.prototype,n,function(){return this}),e.AsyncIterator=b,e.async=function(t,i,r,s,n){void 0===n&&(n=Promise);var a=new b(l(t,i,r,s),n);return e.isGeneratorFunction(i)?a:a.next().then(function(e){return e.done?e.value:a.next()})},v(g),o(g,a,"Generator"),o(g,s,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var r=t.pop();if(r in e)return i.value=r,i.done=!1,i}return i.done=!0,i}},e.values=C,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(i,r){return a.type="throw",a.arg=e,t.next=i,r&&(t.method="next",t.arg=void 0),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return r(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var n=s;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function Yu(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function Xu(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){Yu(n,r,s,a,o,"next",e)}function o(e){Yu(n,r,s,a,o,"throw",e)}a(void 0)})}}function Qu(e){var t,i,r,s=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(i&&null!=(t=e[i]))return t.call(e);if(r&&null!=(t=e[r]))return new Zu(t.call(e));i="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Zu(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(Zu=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new Zu(e)}Du.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Du.prototype.next=function(e){return this._invoke("next",e)},Du.prototype.throw=function(e){return this._invoke("throw",e)},Du.prototype.return=function(e){return this._invoke("return",e)};var Ku=ao().LayerGroup.extend({initialize:function(e,t){this.options=t||{},this.strategy=this.options.strategy||"bbox",this._layers={},this.url=e,this.previousLayer=null,this.loadedExtentsRtree_=new(vh()),this.extent=this.options.extent,this._cacheIds=[],this._validatedId=!1,this._checked=!1,this.idField=this.options.idField||"SmID",this._updateFeaturesFn=this._updateFeatures.bind(this),ao().Util.setOptions(this,t)},onAdd:function(e){this.map=e;var t=[];if("bbox"===this.strategy){var i=e.getBounds();t=[i.getWest(),i.getSouth(),i.getEast(),i.getNorth()],e.on("moveend",this._updateFeaturesFn)}if(this.extent){var r=function(e,t){const i=[];return function(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}(e,t)&&(e[0]>t[0]?i[0]=e[0]:i[0]=t[0],e[1]>t[1]?i[1]=e[1]:i[1]=t[1],e[2]<t[2]?i[2]=e[2]:i[2]=t[2],e[3]<t[3]?i[3]=e[3]:i[3]=t[3]),i}(this.extent,t);t=r&&r.length?r:this.extent}this._handleFeatures(t)},onRemove:function(e){this.loadedExtentsRtree_.clear(),this.loadedExtentsRtree_=null,"bbox"===this.strategy&&(e.off("moveend",this._updateFeaturesFn),this._cacheIds=[])},_updateFeatures:function(){var e=Xu(Wu().mark(function e(t){var i,r,s,n=this;return Wu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=t.target,r=[i.getBounds().getSouthWest(),i.getBounds().getNorthEast()],s=[r[0].lng,r[0].lat,r[1].lng,r[1].lat],this._forEachInExtent(s,function(e){return n._containsExtent(e.extent,s)})||this._handleFeatures(s);case 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),_handleFeatures:function(){var e=Xu(Wu().mark(function e(t){var i,r,s,n,a,o,l,h,u,c;return Wu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]},t.length){e.next=7;break}return e.next=4,this._getStream(this.url);case 4:i=e.sent,e.next=9;break;case 7:r.value={extent:t.slice()},this.loadedExtentsRtree_.insert(r);case 9:s=qu(i&&i.body||this.url,r),this._validatedId||(this.curLayer=ao().geoJSON(null,this.options),this.previousLayer&&this.removeLayer(this.previousLayer),this.previousLayer=this.curLayer,this.curLayer.addTo(this)),n=!1,a=!1,e.prev=13,l=Qu(s);case 15:return e.next=17,l.next();case 17:if(!(n=!(h=e.sent).done)){e.next=31;break}if(u=h.value,"bbox"!==this.strategy){e.next=26;break}if((c=u.properties[this.idField])&&!this._validatedId&&(this._validatedId=!0,this._checked=!0),!c||!this._checked){e.next=26;break}if(!this._cacheIds.includes(c)){e.next=25;break}return e.abrupt("continue",28);case 25:this._cacheIds.push(c);case 26:this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.curLayer.addData(u);case 28:n=!1,e.next=15;break;case 31:e.next=37;break;case 33:e.prev=33,e.t0=e.catch(13),a=!0,o=e.t0;case 37:if(e.prev=37,e.prev=38,!n||null==l.return){e.next=42;break}return e.next=42,l.return();case 42:if(e.prev=42,!a){e.next=45;break}throw o;case 45:return e.finish(42);case 46:return e.finish(37);case 47:case"end":return e.stop()}},e,this,[[13,33,37,47],[38,,42,46]])}));return function(t){return e.apply(this,arguments)}}(),_getStream:function(e){return Xu(Wu().mark(function t(){return Wu().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ue.get(e,{},{withoutFormatSuffix:!0}).then(function(e){return e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}))()},_containsExtent:function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]},_getInExtent:function(e){var t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.loadedExtentsRtree_.search(t).map(function(e){return e.value})},_forEachInExtent:function(e,t){return this._forEach(this._getInExtent(e),t)},_forEach:function(e,t){for(var i,r=0,s=e.length;r<s;r++)if(i=t(e[r]))return i;return i}}),$u=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._knowledgeGraphService=new class extends tt{constructor(e,t){super(e,t),this.options=t||{},this.eventCount=0,this.CLASS_NAME="SuperMap.KnowledgeGraphService"}destroy(){super.destroy()}query(e,t){const i=ee.urlAppend(this.url+"/query.json",`cypherQuery=${e}`);this.processAsync({url:i,method:"GET",callback:t})}getGraphMaps(e){const t=this.url+"/graphmaps.json";this.processAsync({url:t,method:"GET",callback:e})}getGraphMap(e,t){const i=this.url+`/graphmaps/${e}.json`;this.processAsync({url:i,method:"GET",callback:t})}async getGraphMapData(e){let t=[];const i=await this._getGraphMapData(e);if(!i)return;const r=i.dataContent.queries&&i.dataContent.queries.query||[];let s=[];s="string"==typeof r?[r]:r;const n=this._getGraphMapExpandQuery(i);n.length&&s.push(...n);for(let e=0;e<s.length;e++){const i=s[e],r=await this._queryDataBySql(i);t=t.concat([],r)}return{data:t,graphMap:i}}_getGraphMapExpandQuery(e){const t=[];return(e.dataContent.expand&&JSON.parse(e.dataContent.expand)||[]).forEach(e=>{t.push(`match p=(n)-[]-(m) where id(n)=${e} return p;`)}),t}processAsync({url:e,params:t,method:i,callback:r}){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&r)return delete e.eventId,r(e),this.events&&this.events.un(n),!1}};this.events.on(n);const a={method:i,url:e,scope:this,success(e,t){e.eventId=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.eventId=s,this.serviceProcessFailed(e,t)}};t&&(a.params=t),this.request(a)}_getGraphMapData(e){return new Promise((t,i)=>{this.getGraphMap(e,e=>{"processFailed"===e.type?i(e.error):""===e.result.data?i("无数据"):t(e.result.graphMap)})})}_queryDataBySql(e){return new Promise((t,i)=>{this.query(e,e=>{"processFailed"===e.type?i(e.error):t(e.result)})})}}(this.url,t)},query(e,t){this._knowledgeGraphService.query(e,t)},getGraphMaps(e){this._knowledgeGraphService.getGraphMaps(e)},getGraphMap(e,t){this._knowledgeGraphService.getGraphMap(e,t)},async getGraphMapData(e){return await this._knowledgeGraphService.getGraphMapData(e)}});var ec=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t);this._addressMatchService=new st(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},code:function(e,t){this._addressMatchService.code(ee.urlPathAppend(this.url,"geocoding"),e,t)},decode:function(e,t){this._addressMatchService.decode(ee.urlPathAppend(this.url,"geodecoding"),e,t)}});var tc=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._chartServiceBase=new class{constructor(e,t){this.url=e,this.options=t||{}}queryChart(e,t,i){var r=this,s=e,n=r._processFormat(i);new Pt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).processAsync(s)}getChartFeatureInfo(e){var t=this,i=ee.urlPathAppend(t.url,"chartFeatureInfoSpecs");new Tt(i,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).processAsync()}_processFormat(e){return e||t.GEOJSON}}(e,i)},queryChart:function(e,t,i){e=this._processParams(e),this._chartServiceBase.queryChart(e,t,i)},getChartFeatureInfo:function(e){this._chartServiceBase.getChartFeatureInfo(e)},_processParams:function(e){if(!e)return{};e.returnContent=null==e.returnContent||e.returnContent,e.chartQueryFilterParameters&&!ao().Util.isArray(e.chartQueryFilterParameters)&&(e.chartQueryFilterParameters=[e.chartQueryFilterParameters]),e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds))},_processFormat:function(e){return e||t.GEOJSON}}),ic=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._datasetService=new Ii(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getDatasets:function(e,t){e&&this._datasetService.getDatasetsService(e,t)},getDataset:function(e,t,i){e&&t&&this._datasetService.getDatasetService(e,t,i)},setDataset(e,t){if(e instanceof js||e instanceof qs){if(e instanceof js)var i={datasetType:e.datasetType,datasourceName:e.datasourceName,datasetName:e.datasetName};else e instanceof qs&&(i={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});this._datasetService.setDatasetService(i,t)}},deleteDataset:function(e,t,i){this._datasetService.deleteDatasetService(e,t,i)}}),rc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._datasourceService=new Ht(this.url,{proxy:this.proxy,withCredentials:this.withCredentials,crossOrigin:this.crossOrigin,headers:this.headers})},getDatasources:function(e){this._datasourceService.getDatasourcesService(e)},getDatasource:function(e,t){e&&this._datasourceService.getDatasourceService(e,t)},setDatasource:function(e,t){if(!(e instanceof rs))return;const i={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};this._datasourceService.setDatasourceService(i,t)}});var sc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._fieldService=new class{constructor(e,t){this.url=e,this.options=t||{}}getFields(e,t){var i=this;new Hi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t},datasource:e.datasource,dataset:e.dataset}).processAsync()}getFieldStatisticsInfo(e,t){if(e instanceof ci){var i=this,r=e.fieldName,s=e.statisticMode;s&&!Array.isArray(s)&&(s=[s]),i.currentStatisticResult={fieldName:r},i._statisticsCallback=t,s.forEach(t=>{i.currentStatisticResult[t]=null,i._fieldStatisticRequest(e.datasource,e.dataset,r,t)})}}_fieldStatisticRequest(e,t,i,r){var s=this;new di(s.url,{eventListeners:{scope:s,processCompleted:s._processCompleted.bind(s),processFailed:s._statisticsCallback},datasource:e,dataset:t,field:i,statisticMode:r,crossOrigin:s.options.crossOrigin,headers:s.options.headers}).processAsync()}_processCompleted(e,t){var i=this,r=!0,s=e.result;for(var n in this.currentStatisticResult&&null==i.currentStatisticResult[s.mode]&&(this.currentStatisticResult[s.mode]=s.result),i.currentStatisticResult)if(null==i.currentStatisticResult[n]){r=!1;break}r&&i._statisticsCallback({result:i.currentStatisticResult,options:t})}}(e,t)},getFields:function(e,t){this._fieldService.getFields(e,t)},getFieldStatisticsInfo:function(e,t){this._fieldService.getFieldStatisticsInfo(e,t)}}),nc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._gridCellQueryService=new Yi(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getGridCellInfos:function(e,t){if(!e)return null;this._gridCellQueryService.processAsync(e,t)}});const ac=po.extend({initialize:function(e,t){t=t||{},ao().setOptions(this,t),po.prototype.initialize.call(this,e,t),this.headers={},this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0,this._geoprocessingJobsService=new Oi(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getTools:function(e){this._geoprocessingJobsService.getTools(e)},getTool:function(e,t){this._geoprocessingJobsService.getTool(e,t)},execute:function(e,t,i,r){this._geoprocessingJobsService.execute(e,t,i,r)},submitJob:function(e,t,i,r){this._geoprocessingJobsService.submitJob(e,t,i,r)},waitForJobCompletion:function(e,t,i,r){this._geoprocessingJobsService.waitForJobCompletion(e,t,i,r)},getJobInfo:function(e,t,i){this._geoprocessingJobsService.getJobInfo(e,t,i)},cancelJob:function(e,t,i){this._geoprocessingJobsService.cancelJob(e,t,i)},getJobs:function(e,t){this._geoprocessingJobsService.getJobs(e,t)},getResults:function(e,t,i,r){this._geoprocessingJobsService.getResults(e,t,i,r)}});var oc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._layerInfoService=new class{constructor(e,t){this.url=e,this.options=t||{}}getLayersInfo(e){var t=this;new Cr(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{processCompleted:e,processFailed:e}}).processAsync()}setLayerInfo(e,t){if(e){var i=this,r=e.resourceID,s=e.tempLayerName,n=e.layerInfo;if(r&&s){var a=ee.urlPathAppend(i.url,"tempLayersSet/"+r+"/"+s);new ss(a,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(n)}}}setLayersInfo(e,t){if(e){var i=this,r=e.resourceID,s=!!e.isTempLayers&&e.isTempLayers,n=e.layersInfo;s&&!r||!n||new ns(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t},resourceID:r,isTempLayers:s}).processAsync(n)}}setLayerStatus(e,t){if(e){var i=this;new os(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(e)}}}(e,t)},getLayersInfo:function(e){this._layerInfoService.getLayersInfo(e)},setLayerInfo:function(e,t){this._layerInfoService.setLayerInfo(e,t)},setLayersInfo:function(e,t){this._layerInfoService.setLayersInfo(e,t)},setLayerStatus:function(e,t){this._layerInfoService.setLayerStatus(e,t)}}),lc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t)},measureDistance:function(e,t){return this.measure(o.DISTANCE,e,t),this},measureArea:function(e,t){return this.measure(o.AREA,e,t),this},measure:function(e,t,i){if(t instanceof Rr){var r=this;t.geometry&&(t.geometry=Po(t.geometry)),new Br(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,measureMode:e}).processAsync(t,i)}}});var hc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._networkAnalyst3DService=new class{constructor(e,t){this.url=e,this.options=t||{}}sinksFacilityAnalyst(e,t){var i=this;new $t(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}sourcesFacilityAnalyst(e,t){var i=this;new ti(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}traceUpFacilityAnalyst(e,t){var i=this;new oi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}traceDownFacilityAnalyst(e,t){var i=this;new ni(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}upstreamFacilityAnalyst(e,t){var i=this;new hi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}}(e,t)},sinksFacilityAnalyst:function(e,t){this._networkAnalyst3DService.sinksFacilityAnalyst(e,t)},sourcesFacilityAnalyst:function(e,t){this._networkAnalyst3DService.sourcesFacilityAnalyst(e,t)},traceUpFacilityAnalyst:function(e,t){this._networkAnalyst3DService.traceUpFacilityAnalyst(e,t)},traceDownFacilityAnalyst:function(e,t){this._networkAnalyst3DService.traceDownFacilityAnalyst(e,t)},upstreamFacilityAnalyst:function(e,t){this._networkAnalyst3DService.upstreamFacilityAnalyst(e,t)}});var uc=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._networkAnalystService=new class{constructor(e,t){this.url=e,this.options=t||{}}burstPipelineAnalyst(e,t){var i=this;new At(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}computeWeightMatrix(e,t){var i=this;new Dt(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}findClosestFacilities(e,t,i){var r=this;new fi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}streamFacilityAnalyst(e,t,i){var r=this;new ri(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}findLocation(e,t,i){var r=this;new yi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}findPath(e,t,i){var r=this;new _i(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}findTSPPaths(e,t,i){var r=this;new Ci(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}findMTSPPaths(e,t,i){var r=this;new vi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}findServiceAreas(e,t,i){var r=this;new xi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}updateEdgeWeight(e,t){var i=this;new zs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}updateTurnNodeWeight(e,t){var i=this;new Js(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}_processFormat(e){return e||t.GEOJSON}}(e,i)},burstPipelineAnalyst:function(e,t){e=this._processParams(e),this._networkAnalystService.burstPipelineAnalyst(e,t)},computeWeightMatrix:function(e,t){e=this._processParams(e),this._networkAnalystService.computeWeightMatrix(e,t)},findClosestFacilities:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findClosestFacilities(e,t,i)},streamFacilityAnalyst:function(e,t,i){e=this._processParams(e),this._networkAnalystService.streamFacilityAnalyst(e,t,i)},findLocation:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findLocation(e,t,i)},findPath:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findPath(e,t,i)},findTSPPaths:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findTSPPaths(e,t,i)},findMTSPPaths:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findMTSPPaths(e,t,i)},findServiceAreas:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findServiceAreas(e,t,i)},updateEdgeWeight:function(e,t){this._networkAnalystService.updateEdgeWeight(e,t)},updateTurnNodeWeight:function(e,t){this._networkAnalystService.updateTurnNodeWeight(e,t)},_processParams:function(e){if(!e)return{};if(e.centers&&ao().Util.isArray(e.centers)&&e.centers.map(function(t,i){return e.centers[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.centers[i]}),e.nodes&&ao().Util.isArray(e.nodes)&&e.nodes.map(function(t,i){return e.nodes[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.nodes[i]}),e.event&&e.event instanceof ao().LatLng&&(e.event={x:e.event.lng,y:e.event.lat}),e.facilities&&ao().Util.isArray(e.facilities)&&e.facilities.map(function(t,i){return e.facilities[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.facilities[i]}),e.parameter&&e.parameter.barrierPoints){var t=e.parameter.barrierPoints;ao().Util.isArray(t)?t.map(function(t,i){return e.parameter.barrierPoints[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.parameter.barrierPoints[i]}):e.parameter.barrierPoints=[t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t]}return e},_processFormat:function(e){return e||t.GEOJSON}});var cc=po.extend({initialize:function(e,i){i=i||{},ao().setOptions(this,i),po.prototype.initialize.call(this,e,i),this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={},this._processingService=new class{constructor(e,t){this.url=e,this.options=t||{},this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={}}getKernelDensityJobs(e,t){var i=this,r=i._processFormat(t);new Nr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getKernelDensityJobs()}getKernelDensityJob(e,t,i){var r=this,s=r._processFormat(i);new Nr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getKernelDensityJob(e)}addKernelDensityJob(e,t,i,r){var s=this,n=s._processFormat(r);new Nr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.kernelDensityJobs[e.id]=e.state}},format:n}).addKernelDensityJob(e,i)}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var i=this,r=i._processFormat(t);new ms(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getSummaryMeshJobs()}getSummaryMeshJob(e,t,i){var r=this,s=r._processFormat(i);new ms(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getSummaryMeshJob(e)}addSummaryMeshJob(e,t,i,r){var s=this,n=s._processFormat(r);new ms(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.summaryMeshJobs[e.id]=e.state}},format:n}).addSummaryMeshJob(e,i)}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var i=this,r=i._processFormat(t);new hs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getQueryJobs()}getQueryJob(e,t,i){var r=this,s=r._processFormat(i);new hs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getQueryJob(e)}addQueryJob(e,t,i,r){var s=this,n=s._processFormat(r);new hs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.queryJobs[e.id]=e.state}},format:n}).addQueryJob(e,i)}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var i=this,r=i._processFormat(t);new gs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getSummaryRegionJobs()}getSummaryRegionJob(e,t,i){var r=this,s=r._processFormat(i);new gs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getSummaryRegionJob(e)}addSummaryRegionJob(e,t,i,r){var s=this,n=s._processFormat(r);new gs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.summaryRegionJobs[e.id]=e.state}},format:n}).addSummaryRegionJob(e,i)}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var i=this,r=i._processFormat(t);new Ws(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getVectorClipJobs()}getVectorClipJob(e,t,i){var r=this,s=r._processFormat(i);new Ws(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getVectorClipJob(e)}addVectorClipJob(e,t,i,r){var s=this,n=s._processFormat(r);new Ws(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.vectorClipJobs[e.id]=e.state}},format:n}).addVectorClipJob(e,i)}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var i=this,r=i._processFormat(t);new jr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getOverlayGeoJobs()}getOverlayGeoJob(e,t,i){var r=this,s=r._processFormat(i);new jr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getOverlayGeoJob(e)}addOverlayGeoJob(e,t,i,r){var s=this,n=s._processFormat(r);new jr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.overlayGeoJobs[e.id]=e.state}},format:n}).addOverlayGeoJob(e,i)}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var i=this,r=i._processFormat(t);new wt(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getBuffersJobs()}getBuffersJob(e,t,i){var r=this,s=r._processFormat(i);new wt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getBuffersJob(e)}addBuffersJob(e,t,i,r){var s=this,n=s._processFormat(r);new wt(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.buffersJobs[e.id]=e.state}},format:n}).addBuffersJob(e,i)}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var i=this,r=i._processFormat(t);new Fs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getTopologyValidatorJobs()}getTopologyValidatorJob(e,t,i){var r=this,s=r._processFormat(i);new Fs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getTopologyValidatorJob(e)}addTopologyValidatorJob(e,t,i,r){var s=this,n=s._processFormat(r);new Fs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.topologyValidatorJobs[e.id]=e.state}},format:n}).addTopologyValidatorJob(e,i)}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var i=this,r=i._processFormat(t);new ps(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getSummaryAttributesJobs()}getSummaryAttributesJob(e,t,i){var r=this,s=r._processFormat(i);new ps(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getSummaryAttributesJob(e)}addSummaryAttributesJob(e,t,i,r){var s=this,n=s._processFormat(r);new ps(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.summaryAttributesJobs[e.id]=e.state}},format:n}).addSummaryAttributesJob(e,i)}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||t.GEOJSON}}(e,i)},getKernelDensityJobs:function(e,t){this._processingService.getKernelDensityJobs(e,t)},getKernelDensityJob:function(e,t,i){this._processingService.getKernelDensityJob(e,t,i)},addKernelDensityJob:function(e,t,i,r){let s=this._processParams(e);this._processingService.addKernelDensityJob(s,t,i,r)},getKernelDensityJobState:function(e){return this._processingService.getKernelDensityJobState(e)},getSummaryMeshJobs:function(e,t){this._processingService.getSummaryMeshJobs(e,t)},getSummaryMeshJob:function(e,t,i){this._processingService.getSummaryMeshJob(e,t,i)},addSummaryMeshJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addSummaryMeshJob(e,t,i,r)},getSummaryMeshJobState:function(e){return this._processingService.getSummaryMeshJobState(e)},getQueryJobs:function(e,t){this._processingService.getQueryJobs(e,t)},getQueryJob:function(e,t,i){this._processingService.getQueryJob(e,t,i)},addQueryJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addQueryJob(e,t,i,r)},getQueryJobState:function(e){return this._processingService.getQueryJobState(e)},getSummaryRegionJobs:function(e,t){this._processingService.getSummaryRegionJobs(e,t)},getSummaryRegionJob:function(e,t,i){this._processingService.getSummaryRegionJob(e,t,i)},addSummaryRegionJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addSummaryRegionJob(e,t,i,r)},getSummaryRegionJobState:function(e){return this._processingService.getSummaryRegionJobState(e)},getVectorClipJobs:function(e,t){this._processingService.getVectorClipJobs(e,t)},getVectorClipJob:function(e,t,i){this._processingService.getVectorClipJob(e,t,i)},addVectorClipJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addVectorClipJob(e,t,i,r)},getVectorClipJobState:function(e){return this._processingService.getVectorClipJobState(e)},getOverlayGeoJobs:function(e,t){this._processingService.getOverlayGeoJobs(e,t)},getOverlayGeoJob:function(e,t,i){this._processingService.getOverlayGeoJob(e,t,i)},addOverlayGeoJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addOverlayGeoJob(e,t,i,r)},getoverlayGeoJobState:function(e){return this._processingService.getoverlayGeoJobState(e)},getBuffersJobs:function(e,t){this._processingService.getBuffersJobs(e,t)},getBuffersJob:function(e,t,i){this._processingService.getBuffersJob(e,t,i)},addBuffersJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addBuffersJob(e,t,i,r)},getBuffersJobState:function(e){return this._processingService.getBuffersJobState(e)},getTopologyValidatorJobs:function(e,t){this._processingService.getTopologyValidatorJobs(e,t)},getTopologyValidatorJob:function(e,t,i){this._processingService.getTopologyValidatorJob(e,t,i)},addTopologyValidatorJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addTopologyValidatorJob(e,t,i,r)},getTopologyValidatorJobState:function(e){return this._processingService.getTopologyValidatorJobState(e)},getSummaryAttributesJobs:function(e,t){this._processingService.getSummaryAttributesJobs(e,t)},getSummaryAttributesJob:function(e,t,i){this._processingService.getSummaryAttributesJob(e,t,i)},addSummaryAttributesJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addSummaryAttributesJob(e,t,i,r)},getSummaryAttributesJobState:function(e){return this._processingService.getSummaryAttributesJobState(e)},_processParams:function(e){return e?(e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds)),e.query&&(e.query=vo.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=vo.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=vo.toProcessingParam(e.geometryClip)),e):{}}}),dc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._queryService=new Zr(e,t)},queryByBounds:function(e,t,i){e=this._processParams(e),this._queryService.queryByBounds(e,t,i)},queryByDistance:function(e,t,i){e=this._processParams(e),this._queryService.queryByDistance(e,t,i)},queryBySQL:function(e,t,i){e=this._processParams(e),this._queryService.queryBySQL(e,t,i)},queryByGeometry:function(e,t,i){e=this._processParams(e),this._queryService.queryByGeometry(e,t,i)},_processParams:function(e){return e?(e.returnContent=null==e.returnContent||e.returnContent,e.queryParams&&!ao().Util.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry instanceof ao().Point?e.geometry=new le(e.geometry.x,e.geometry.y):e.geometry=Po(e.geometry)),e):{}}});var pc=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._spatialAnalystService=new class{constructor(e,t){this.url=e,this.options=t||{}}getAreaSolarRadiationResult(e,t,i){var r=this;new ht(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}bufferAnalysis(e,t,i){var r=this;new gt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}densityAnalysis(e,t,i){var r=this;new Yt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}generateSpatialData(e,t,i){var r=this;new Ai(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}geoRelationAnalysis(e,t,i){var r=this;new Ni(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}interpolationAnalysis(e,t,i){var r=this;new Or(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}mathExpressionAnalysis(e,t,i){var r=this;new Dr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}overlayAnalysis(e,t,i){var r=this;new Gr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}routeCalculateMeasure(e,t,i){var r=this;new $r(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}routeLocate(e,t,i){var r=this;new ts(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}surfaceAnalysis(e,t,i){var r=this;new bs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}terrainCurvatureCalculate(e,t,i){var r=this;new Ss(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}thiessenAnalysis(e,t,i){var r=this;new Os(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}geometrybatchAnalysis(e,t,i){for(var r=new Ps(this.url,{eventListeners:{scope:this,processCompleted:t,processFailed:t},format:this._processFormat(i)}),s=[],n=0;n<e.length;n++){var a=e[n];s.push({analystName:a.analystName,param:a.param})}r.processAsync(s)}_processFormat(e){return e||t.GEOJSON}}(e,i)},getAreaSolarRadiationResult:function(e,t,i){this._spatialAnalystService.getAreaSolarRadiationResult(e,t,i)},bufferAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.bufferAnalysis(e,t,i)},densityAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.densityAnalysis(e,t,i)},generateSpatialData:function(e,t,i){this._spatialAnalystService.generateSpatialData(e,t,i)},geoRelationAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.geoRelationAnalysis(e,t,i)},interpolationAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.interpolationAnalysis(e,t,i)},mathExpressionAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.mathExpressionAnalysis(e,t,i)},overlayAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.overlayAnalysis(e,t,i)},routeCalculateMeasure:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.routeCalculateMeasure(e,t,i)},routeLocate:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.routeLocate(e,t,i)},surfaceAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.surfaceAnalysis(e,t,i)},terrainCurvatureCalculate:function(e,t,i){this._spatialAnalystService.terrainCurvatureCalculate(e,t,i)},thiessenAnalysis:function(e,t,i){e=this._processParams(e),this._spatialAnalystService.thiessenAnalysis(e,t,i)},geometrybatchAnalysis:function(e,t,i){for(var r=0;r<e.length;r++)e[r].param=this._processParams(e[r].param);this._spatialAnalystService.geometrybatchAnalysis(e,t,i)},_processParams:function(e){if(!e)return{};if(e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds)),e.inputPoints)for(let t=0;t<e.inputPoints.length;t++){let i=e.inputPoints[t];ao().Util.isArray(i)&&(e.inputPoints[t]={x:i[0],y:i[1],tag:i[2]})}if(e.points)for(let t=0;t<e.points.length;t++){let i=e.points[t];ao().Util.isArray(i)?e.points[t]={x:i[0],y:i[1]}:i instanceof ao().LatLng?e.points[t]={x:i.lng,y:i.lat}:e.points[t]={x:i.x,y:i.y}}if(e.point&&(ao().Util.isArray(e.point)?e.point={x:e.point[0],y:e.point[1]}:e.point instanceof ao().LatLng?e.point={x:e.point.lng,y:e.point.lat}:e.point={x:e.point.x,y:e.point.y}),e.extractRegion&&(e.extractRegion=Po(e.extractRegion)),e.extractParameter&&e.extractParameter.clipRegion&&(e.extractParameter.clipRegion=Po(e.extractParameter.clipRegion)),e.clipParam&&e.clipParam.clipRegion&&(e.clipParam.clipRegion=Po(e.clipParam.clipRegion)),e.sourceGeometry){var t=null;e.sourceGeometrySRID&&(t=e.sourceGeometrySRID),e.sourceGeometry=Po(e.sourceGeometry),t&&(e.sourceGeometry.SRID=t),delete e.sourceGeometry.sourceGeometrySRID}if(e.operateGeometry&&(e.operateGeometry=Po(e.operateGeometry)),e.sourceGeometries){for(var i=[],r=0;r<e.sourceGeometries.length;r++)i.push(Po(e.sourceGeometries[r]));e.sourceGeometries=i}if(e.operateGeometries){for(var s=[],n=0;n<e.operateGeometries.length;n++)s.push(Po(e.operateGeometries[n]));e.operateGeometries=s}if(e.sourceRoute&&e.sourceRoute instanceof ao().Polyline){var a={type:"LINEM"};a.parts=[e.sourceRoute.getLatLngs().length],a.points=[];for(let t=0;t<e.sourceRoute.getLatLngs().length;t++){let i=e.sourceRoute.getLatLngs()[t];a.points=a.points.concat({x:i.lng,y:i.lat,measure:i.alt})}e.sourceRoute=a}return e.operateRegions&&ao().Util.isArray(e.operateRegions)&&e.operateRegions.map(function(t,i){return e.operateRegions[i]=Po(t),e.operateRegions[i]}),e},_processFormat:function(e){return e||t.GEOJSON}}),fc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._themeService=new Ls(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getThemeInfo:function(e,t){this._themeService.processAsync(e,t)}});var mc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._commonTrafficTransferAnalystService=new class{constructor(e,t){this.url=e,this.options=t||{}}queryStop(e,t){var i=this;new cs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}analysisTransferPath(e,t){var i=this;new Rs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}analysisTransferSolution(e,t){var i=this;new Gs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}}(e,t)},queryStop:function(e,t){this._commonTrafficTransferAnalystService.queryStop(e,t)},analysisTransferPath:function(e,t){e=this._processParams(e),this._commonTrafficTransferAnalystService.analysisTransferPath(e,t)},analysisTransferSolution:function(e,t){e=this._processParams(e),this._commonTrafficTransferAnalystService.analysisTransferSolution(e,t)},_processParams:function(e){return e?(e.points&&ao().Util.isArray(e.points)&&e.points.map(function(t,i){return e.points[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.points[i]}),e):{}}}),yc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._webPrintingService=new an(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},createWebPrintingJob(e,t){e&&this._webPrintingService.createWebPrintingJob(this._processParams(e),t)},getPrintingJob:function(e,t){this._webPrintingService.getPrintingJob(e,t)},getPrintingJobResult:function(e,t){this._webPrintingService.getPrintingJobResult(e,t)},getLayoutTemplates:function(e){this._webPrintingService.getLayoutTemplates(e)},_processParams(e){return e.layoutOptions&&e.layoutOptions.littleMapOptions&&(e.layoutOptions.littleMapOptions.center=this._toPointObject(e.layoutOptions.littleMapOptions.center)),e.exportOptions&&(e.exportOptions.center=this._toPointObject(e.exportOptions.center)),e},_toPointObject:e=>ao().Util.isArray(e)?{x:e[0],y:e[1]}:e instanceof le||e instanceof ao().Point?{x:e.x,y:e.y}:e instanceof ao().LatLng?{x:e.lng,y:e.lat}:e}),gc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._imageService=new ln(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getCollections:function(e){this._imageService.getCollections(e)},getCollectionByID:function(e,t){this._imageService.getCollectionByID(e,t)},search:function(e,t){this._imageService.search(e,t)}}),vc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._imageCollectionService=new on(this.url,{collectionId:this.options.collectionId,proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getLegend:function(e,t){this._imageCollectionService.getLegend(e,t)},getStatistics:function(e){this._imageCollectionService.getStatistics(e)},getTileInfo:function(e){this._imageCollectionService.getTileInfo(e)},deleteItemByID(e,t){this._imageCollectionService.deleteItemByID(e,t)},getItemByID(e,t){this._imageCollectionService.getItemByID(e,t)}}),bc=ao().Control.extend({options:{position:"topright",style:(e,t)=>t?ao().circleMarker(t,{fillColor:"blue",weight:1,opacity:1,color:"blue",fillOpacity:.6}):{fillColor:"blue",weight:1,opacity:1,color:"blue",fillOpacity:.6},onEachFeature:null},initialize(e){ao().setOptions(this,e),this._event=new(ao().Evented),this.rootContainer=null},onAdd(e){return this.map=e,this.rootContainer=this._initView(),this.rootContainer},on(e,t){this._event.on(e,t)},off(e,t){t?this._event.off(e,t):this._event.off(e)},_initView(){},_preventMapEvent(e,t){e&&t&&(e.addEventListener("mouseover",function(){t.dragging.disable(),t.scrollWheelZoom.disable(),t.doubleClickZoom.disable()}),e.addEventListener("mouseout",function(){t.dragging.enable(),t.scrollWheelZoom.enable(),t.doubleClickZoom.enable()}))}}),_c=ao().Evented.extend({initialize(){this.fileModel=new class{constructor(e){this.FileTypes=Sa,this.FileConfig=xa,this.loadFileObject=e&&e.loadFileObject?e.loadFileObject:[]}set(e,t){this[e]=t}get(e){return this[e]}}},readFile(e){let t=e.target,i=t.files[0];if(i.size>this.fileModel.FileConfig.fileMaxSize)return this.fire("filesizeexceed",{messageType:"warring",message:Ma.i18n("msg_fileSizeExceeded")}),!1;let r=t.value,s=i.name,n=Ua.getFileType(s);if(!n)return this.fire("errorfileformat",{messageType:"failure",message:Ma.i18n("msg_fileTypeUnsupported")}),!1;""!==s&&(this.fileModel.set("loadFileObject",{file:i,filePath:r,fileName:s,fileType:n}),this._readData())},_readData(){const e=this,t=this.fileModel.loadFileObject.fileType;Ta.readFile(t,{file:this.fileModel.loadFileObject.file,path:this.fileModel.loadFileObject.filePath},i=>{Ta.processDataToGeoJson(t,i,e=>{e&&this.fire("openfilesucceeded",{result:e,layerName:this.fileModel.loadFileObject.fileName.split(".")[0]})},t=>{e.fire("openfilefailed",{messageType:"failure",message:t})},this)},()=>{e.fire("openfilefailed",{messageType:"failure",message:Ma.i18n("msg_openFileFail")})},this)}}),Sc=bc.extend({options:{layer:null},initialize(e){bc.prototype.initialize.apply(this,[e]),this.viewModel=new _c},setViewStyle(e,t){this.rootContainer.style[e]=t},_initView(){const e=ao().DomUtil.create("div","component-openfile");return e.id="openFile",this.fileSelect=ao().DomUtil.create("div","",e),this.label=ao().DomUtil.create("label","component-openfile__span--select",this.fileSelect),this.label.htmlFor="input_file",ao().DomUtil.create("div","supermapol-icons-upload",this.label),ao().DomUtil.create("span","component-openfile__span",this.label).appendChild(document.createTextNode(Ma.i18n("text_chooseFile"))),this.fileInput=ao().DomUtil.create("input","component-openfile__input",this.fileSelect),this.fileInput.id="input_file",this.fileInput.type="file",this.fileInput.accept=".json,.geojson,.csv,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",this.fileInput.onchange=(e=>{this.messageBox.closeView(),this.viewModel.readFile(e)}),this.messageBox=new wa,this.viewModel.on("filesizeexceed",e=>{this.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("errorfileformat",e=>{this.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("openfilefailed",e=>{this.messageBox.showView(e.message,e.messageType),this._event.fire("openfilefailed",e)}),this.viewModel.on("readdatafail",e=>{this.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("openfilesucceeded",e=>{this._event.fire("openfilesucceeded",e)}),this._preventMapEvent(e,this.map),e}});class xc{constructor(e){this.layers=[],e&&e.length>0&&this.addLayers(e),this.currentLayerDataModel=null}addLayers(e,t,i,r){for(let s=0;s<e.length;s++){let n=e[s].layerName;if(e[s].layer instanceof ao().GeoJSON){let i=new wc(e[s].layer);this.layers[n]=i,t&&t.call(r,{layerName:n,layer:i})}else i&&i.call(r,"")}}setCurrentLayerDataModel(e){this.layers[e]&&(this.currentLayerDataModel=this.layers[e])}}class wc{constructor(e){if(this.layer=e,this.features=e.getLayers(),this.attributeNames=[],this.features[0].feature.properties)for(let e in this.features[0].feature.properties)this.attributeNames.push(e);this.operatingAttributeNames=[],this.attributes={}}setOperatingAttributeNames(e){this.operatingAttributeNames=e}getAllAttributeNames(){return this.attributeNames}getAttributeNamesByType(e){if(this.features[0].feature.properties){let t=this.features[0].feature.properties,i=[];if("Num"===e)for(let e in t)isNaN(t[e])||i.push(e);else i=this.attributeNames;return i}}getAllFeatures(){return this.features}getAttributeValueByAttributeName(e){if(this.attributes[e])return this.attributes[e];this.attributes[e]=[];for(let t=0;t<this.features.length;t++)this.attributes[e].push([this.features[t].feature.properties[e]]);return this.attributes[e]}getFeaturesByKeyWord(e){let t=[],i=new RegExp(e.toLowerCase());const r=this;return this.features.forEach(function(e){if(!e.feature.properties)return null;let s,n=e.feature.properties;for(let a=0,o=(s=r.operatingAttributeNames.length>0?r.operatingAttributeNames:r.attributeNames).length;a<o;a++)if(n[s[a]]&&i.test(n[s[a]].toString().toLowerCase())){let i=s[a],r=n[s[a]];e.filterAttribute={filterAttributeName:i,filterAttributeValue:r},t.push(e);break}}),t}}var Cc=ao().Evented.extend({options:{cityGeoCodingConfig:{addressUrl:"https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos",key:"fvV2osxwuZWlY0wJb8FEb2i5"}},initialize(e,t){if(!e)return new Error("Cannot find map, fileModel.map cannot be null.");this.map=e,ao().Util.setOptions(this,t),this.dataModel=new xc,this.geoCodeParam={keyWords:"北京市",city:"北京市",pageSize:this.options.pageSize,pageNum:this.options.pageNum},this.searchCache={}},search(e,t){t?this.searchFromLayer(e,t):this.searchFromCityLocalSearchService(e)},searchFromLayer(e,t){if(this.dataModel.layers[t]){let i=this.dataModel.layers[t].getFeaturesByKeyWord(e);i&&i.length>0?this.fire("searchlayersucceeded",{result:i}):this.fire("searchfailed",{searchType:"searchLayersField"})}},searchFromCityLocalSearchService(e){if(this.searchCache[e])this.fire("geocodesucceeded",{result:this.searchCache[e]});else{this.geoCodeParam.keyWords=e||this.geoCodeParam.city;const t=this;let i=this._getSearchUrl(this.geoCodeParam);Ue.get(i).then(e=>e.json()).then(e=>{if(e.error||0===e.poiInfos.length)t.fire("searchfailed",{searchType:"searchGeocodeField"});else if(e.poiInfos){const i=t._dataToGeoJson(e.poiInfos,t.geoCodeParam);t.fire("geocodesucceeded",{result:i})}})}},addSearchLayers(e){this.dataModel.addLayers(e,e=>{this.fire("newlayeradded",{layerName:e.layerName})},null,this)},panToLayer(e){this.dataModel.layers[e]&&this.map.flyToBounds(this.dataModel.layers[e].layer.getBounds())},panToCity(e){this.geoCodeParam.keyWords=e,this.geoCodeParam.city=e;const t=this;let i=this._getSearchUrl(this.geoCodeParam);Ue.get(i).then(e=>e.json()).then(e=>{if(e.poiInfos.length>0){const i=ao().latLng(e.poiInfos[0].location.y,e.poiInfos[0].location.x);t.map.setView(i,8)}else t.fire("searchfailed",{searchType:"cityGeocodeField"})})},_dataToGeoJson(e,t){let i=[];for(let r=0;r<e.length;r++){let s={type:"Feature",geometry:{type:"Point",coordinates:[e[r].location.x,e[r].location.y]},properties:{name:e[r].name||t.keyWords,address:e[r].formatedAddress||e[r].address}};i.push(s)}return i},_getSearchUrl(e){return this.options.cityGeoCodingConfig.addressUrl+`.json?keywords=${e.keyWords}&city=${e.city}&pageSize=${e.pageSize}&pageNum=${e.pageNum}&key=${this.options.cityGeoCodingConfig.key}`}}),Mc=bc.extend({options:{cityConfig:{HOT:{HOT:["北京市","上海市","广州市","深圳市","南京市","杭州市","天津市","重庆市","成都市","青岛市","苏州市","无锡市","常州市","温州市","武汉市","长沙市","南昌市","三亚市","合肥市","石家庄市"]},AB:{A:["阿拉善盟","鞍山市","安庆市","安阳市","阿坝藏族羌族自治州","安顺市","阿里地区","安康市","阿克苏地区","阿勒泰地区","阿拉尔市"],B:["北京市","保定市","包头市","巴彦淖尔市","本溪市","白山市","白城市","蚌埠市","亳州市","滨州市","北海市","百色市","白沙黎族自治县","保亭黎族苗族自治县","巴中市","毕节地区","保山市","宝鸡市","白银市","博尔塔拉蒙古自治州","巴音郭楞蒙古自治州","北区"]},CD:{C:["重庆市","成都市","常州市","长沙市","承德市","沧州市","长治市","赤峰市","朝阳市","长春市","滁州市","巢湖市","池州市","常德市","郴州市","潮州市","崇左市","澄迈县","昌江黎族自治县","楚雄彝族自治州","昌都地区","昌吉回族自治州"],D:["大同市","大连市","丹东市","大庆市","大兴安岭地区","东营市","德州市","东莞市","儋州市","东方市","定安县","德阳市","达州市","大理白族自治州","德宏傣族景颇族自治州","迪庆藏族自治州","定西市","东区","大埔区","大堂区"]},EFG:{E:["鄂尔多斯市","鄂州市","恩施土家族苗族自治州"],F:["抚顺市","阜新市","阜阳市","福州市","抚州市","佛山市","防城港市"],G:["广州市","赣州市","桂林市","贵港市","广元市","广安市","贵阳市","固原市","高雄市","高雄县","甘南藏族自治州","甘孜藏族自治州"]},H:{H:["杭州市","合肥市","邯郸市","衡水市","呼和浩特市","呼伦贝尔市","葫芦岛市","哈尔滨市","鹤岗市","黑河市","淮安市","湖州市","淮南市","淮北市","黄山市","菏泽市","鹤壁市","黄石市","黄冈市","衡阳市","怀化市","惠州市","河源市","贺州市","河池市","海口市","红河哈尼族彝族自治州","汉中市","海东地区","海北藏族自治州","黄南藏族自治州","海南藏族自治州","果洛藏族自治州","海西蒙古族藏族自治州","哈密地区","和田地区","花莲县","黄大仙区","花地玛堂区"]},J:{J:["晋城市","晋中市","锦州市","吉林市","鸡西市","佳木斯市","嘉兴市","金华市","景德镇市","九江市","吉安市","济南市","济宁市","焦作市","济源市","荆门市","荆州市","江门市","湛江市","揭阳市","嘉峪关市","金昌市","酒泉市","基隆市","嘉义市","嘉义县","九龙城区","嘉模堂区"]},KL:{K:["开封市","昆明市","克拉玛依市","克孜勒苏柯尔克孜自治州","喀什地区"],L:["廊坊市","临汾市","吕梁市","辽阳市","辽源市","连云港市","丽水市","六安市","龙岩市","莱芜市","临沂市","聊城市","洛阳市","漯河市","娄底市","柳州市","来宾市","临高县","乐东黎族自治县","陵水黎族自治县","泸州市","乐山市","凉山彝族自治州","六盘水市","丽江市","临沧市","拉萨市","林芝地区","兰州市","陇南市","临夏回族自治州"]},MNP:{M:["牡丹江市","马鞍山市","茂名市","梅州市","绵阳市","眉山市","苗栗县"],N:["南京市","南昌市","南通市","宁波市","南平市","宁德市","南阳市","南宁市","南沙群岛","内江市","南充市","怒江傈傈族自治州","那曲地区","南投县"],P:["盘锦市","莆田市","萍乡市","平顶山市","濮阳市","攀枝花市","平凉市","屏东县","澎湖县"]},QR:{Q:["青岛市","秦皇岛市","齐齐哈尔市","黔西南布依族苗族自治州","七台河市","衢州市","泉州市","潜江市","清远市","钦州市","琼海市","曲靖市","庆阳市","荃湾区","黔东南苗族侗族自治州","黔南布依族苗族自治州","琼中黎族苗族自治县"],R:["日照市","日喀则地区"]},S:{S:["上海市","深圳市","苏州市","石家庄市","三亚市","朔州市","沈阳市","四平市","松原市","双鸭山市","绥化市","宿迁市","绍兴市","宿州市","三明市","上饶市","三门峡市","商丘市","十堰市","随州市","邵阳市","韶关市","汕头市","汕尾市","三亚市","遂宁市","思茅市","山南地区","商洛市","石嘴山市","石河子市","深水埗区","沙田区","神农架林区","圣安多尼堂区","圣方济各堂区"]},T:{T:["天津市","唐山市","太原市","通辽市","铁岭市","通化市","泰州市","台州市","铜陵市","泰安市","天门市","屯昌县","铜仁地区","铜川市","天水市","吐鲁番地区","塔城地区","图木舒克市","台北市","台中市","台南市","台北县","桃园县","台中县","台南县","台东县","屯门区"]},W:{W:["无锡市","温州市","武汉市","乌海市","乌兰察布市","芜湖市","潍坊市","威海市","梧州市","五指山市","文昌市","万宁市","文山壮族苗族自治州","渭南市","武威市","吴忠市","乌鲁木齐市","五家渠市","湾仔区","望德堂区"]},X:{X:["邢台市","忻州市","兴安盟","徐州市","宣城市","厦门市","新余市","新乡市","许昌市","信阳市","襄樊市","孝感市","咸宁市","仙桃市","湘潭市","西安市","咸阳市","西宁市","新竹市","新竹县","西贡区","锡林郭勒盟","西沙群岛","湘西土家族苗族自治州","西双版纳傣族自治州"]},Y:{Y:["阳泉市","运城市","营口市","延边朝鲜族自治州","伊春市","盐城市","扬州市","鹰潭市","宜春市","烟台市","宜昌市","岳阳市","益阳市","永州市","阳江市","云浮市","玉林市","宜宾市","雅安市","玉溪市","延安市","榆林市","玉树藏族自治州","银川市","伊犁哈萨克自治州","宜兰县","云林县","油尖旺区","元朗区"]},Z:{Z:["郑州市","张家口市","镇江市","舟山市","漳州市","淄博市","枣庄市","周口市","驻马店市","株洲市","张家界市","珠海市","肇庆市","中山市","自贡市","资阳市","遵义市","昭通市","张掖市","中卫市","彰化县","中西区","中沙群岛的岛礁及其海域"]}},cityGeoCodingConfig:{addressUrl:"https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos",key:"fvV2osxwuZWlY0wJb8FEb2i5"},isGeoCoding:!0,pageSize:10,pageNum:1,perPageDataNum:8},initialize(e){bc.prototype.initialize.apply(this,[e]),this.currentSearchLayerName="",this.isSearchLayer=!1,this.perPageDataNum=this.options.perPageDataNum},onAdd:function(e){return this.viewModel=new Cc(e,this.options),bc.prototype.onAdd.apply(this,[e])},addSearchLayer(e){this.viewModel.addSearchLayers(e)},_initView(){const e=this,t=document.createElement("div");t.setAttribute("class","component-search-container");const i=document.createElement("div");i.setAttribute("class","component-search");const r=document.createElement("div");r.setAttribute("class","component-search__settings");const s=document.createElement("div");s.setAttribute("class","component-search__settings__name"),r.appendChild(s);const n=document.createElement("span");n.setAttribute("class","supermapol-icons-solid-down-triangle"),r.appendChild(n);let a=null;if(this.options.isGeoCoding){const e=new Ra({config:this.options.cityConfig});a=e.getElement(),e.content.onclick=(e=>{"SPAN"===e.target.nodeName&&e.target.innerText&&(this.viewModel.panToCity(e.target.innerHTML),this.messageBox.closeView(),s.removeChild(s.firstChild),s.insertBefore(document.createTextNode(e.target.innerHTML),s.firstChild),this.isSearchLayer=!1)}),s.appendChild(document.createTextNode(e.content.getElementsByTagName("span")[0].innerText))}const o=function(){const t=document.createElement("div");t.setAttribute("class","component-search__layers");const i=document.createElement("div");i.setAttribute("class","component-search-layers-content"),t.appendChild(i);const r=document.createElement("div");r.setAttribute("class","component-search__layers__header");const n=document.createElement("div");n.setAttribute("class","load-btn"),r.appendChild(n);const a=document.createElement("span");a.setAttribute("class","supermapol-icons-poi-load"),n.appendChild(a);const o=document.createElement("span");o.appendChild(document.createTextNode(Ma.i18n("text_loadSearchCriteria"))),n.appendChild(o);const l=document.createElement("div");l.setAttribute("class","save-btn"),r.appendChild(l);const h=document.createElement("span");h.setAttribute("class","supermapol-icons-poi-save"),l.appendChild(h);const u=document.createElement("span");u.appendChild(document.createTextNode(Ma.i18n("text_saveSearchCriteria"))),l.appendChild(u);const c=document.createElement("div");return c.setAttribute("class","component-search__layers__body"),c.onclick=(t=>{e.clearSearchResult();let i=null;if("component-search__layers__itme__singleselect"===t.target.classList[0])i=t.target;else{if("component-single-default-img"!==t.target.classList[0]&&"single-label"!==t.target.classList[0])return;i=t.target.parentNode}document.getElementsByClassName("component-single-checked-img").length>0&&document.getElementsByClassName("component-single-checked-img")[0].setAttribute("class","component-single-default-img"),i.firstChild.setAttribute("class","component-single-checked-img"),e.currentSearchLayerName=i.lastChild.innerText,e.isSearchLayer=!0,s.removeChild(s.firstChild),s.insertBefore(document.createTextNode(e.currentSearchLayerName),s.firstChild),e.viewModel.panToLayer(e.currentSearchLayerName),e.messageBox.closeView()}),i.appendChild(c),t}();let l=[];a&&l.push({title:Ma.i18n("title_searchCity"),content:a}),l.push({title:Ma.i18n("title_searchLayer"),content:o});const h=new Ba({tabs:l}),u=h.getElement();h.closeView(),i.appendChild(u),r.onclick=(()=>{u.hidden?h.showView():h.closeView()}),i.appendChild(r),s.innerText||s.appendChild(document.createTextNode(Ma.i18n("text_label_chooseSearchLayers")));const c=document.createElement("div");c.setAttribute("class","component-search__input");const d=document.createElement("input");d.type="text",d.placeholder=Ma.i18n("text_label_searchTips"),c.appendChild(d),this.poiInput=d;const p=document.createElement("span");p.setAttribute("class","supermapol-icons-close"),p.hidden=!0,c.appendChild(p),i.appendChild(c);const f=document.createElement("div");f.setAttribute("class","component-search-icon supermapol-icons-search");const m=new Ga;this._resultDomObj=m,f.onclick=(()=>{m.closeView(),this.clearSearchResult(),this.messageBox.closeView(),h.closeView();const e=this.poiInput.value.trim();""!==e?this.isSearchLayer?this.viewModel.search(e,this.currentSearchLayerName):this.viewModel.search(e):this.messageBox.showView(Ma.i18n("msg_searchKeywords"))}),d.onkeypress=(e=>{if(13==e.which){var t=document.createEvent("HTMLEvents");t.initEvent("click",!1,!0),f.dispatchEvent(t)}}),i.appendChild(f);const y=function(){const t=m.getElement();return t.style.position="absolute",t.style.top="44px",t.style.right="0",m.closeView(),m.content.onclick=(t=>{let i=null;if("component-search-result-info"===t.target.parentNode.className)i=t.target.parentNode.parentNode;else if("component-search__resultitme"===t.target.parentNode.className)i=t.target.parentNode;else{if("component-search__resultitme"!==t.target.className)return;i=t.target}document.getElementsByClassName("component-search__resultitme-selected").length>0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),i.firstChild.classList.add("component-search__resultitme-selected");let r=i.children[1].firstChild.innerText;e._linkageFeature(r)}),t}();return i.appendChild(y),p.onclick=(e=>{this.clearSearchResult(),d.value="",e.target.hidden=!0,m.closeView()}),d.oninput=(()=>{p.hidden=!1}),this.messageBox=new wa,this._addViewModelListener(),t.appendChild(i),this._preventMapEvent(t,this.map),t},_createSearchLayerItem(e){const t=document.createElement("div");t.setAttribute("class","component-search__layers__itme");const i=document.createElement("div");i.setAttribute("class","component-search__layers__itme__singleselect");const r=document.createElement("div");r.setAttribute("class","component-single-default-img"),i.appendChild(r);const s=document.createElement("span");s.setAttribute("class","single-label"),s.innerHTML=e,i.appendChild(s),t.appendChild(i),document.getElementsByClassName("component-search__layers__body")[0].appendChild(t)},_createResultItem(e,t){const i=document.createElement("div");i.setAttribute("class","component-search__resultitme");let r=document.createElement("div");"Point"===e||"MultiPoint"===e?r.setAttribute("class","supermapol-icons-marker-layer component-search-result-icon"):"LineString"===e||"MultiLineString "===e?r.setAttribute("class","supermapol-icons-line-layer component-search-result-icon"):"Polygon"===e||"MultiPolygon"===e?r.setAttribute("class","supermapol-icons-polygon-layer component-search-result-icon"):r.setAttribute("class","supermapol-icons-point-layer component-search-result-icon"),i.appendChild(r);const s=document.createElement("div");s.setAttribute("class","component-search-result-info");const n=document.createElement("div");s.appendChild(n);const a=document.createElement("div");return t.name?(n.innerHTML=t.name,a.innerHTML=t.address,s.appendChild(a)):n.innerHTML=t.filterAttributeName+": "+t.filterAttributeValue,i.appendChild(s),document.createElement("div").setAttribute("class","component-checkbox component-checkbox-default-img"),i},_addViewModelListener(){this.viewModel.on("searchlayerschanged",e=>{for(let t=0;t<e.length;t++)this._createSearchLayerItem(e[t])}),this.viewModel.on("newlayeradded",e=>{this._createSearchLayerItem(e.layerName)}),this.viewModel.on("searchlayersucceeded",e=>{const t=e.result;this.clearSearchResult(),this.searchResultLayer=ao().featureGroup(t,{pointToLayer:this.options.style,style:this.options.style}).bindPopup(function(e){if(e.feature.properties)return new ka({attributes:e.feature.properties}).getElement()}).addTo(this.map),this.searchResultLayer.eachLayer(e=>{this.options.onEachFeature?this.options.onEachFeature(e.toGeoJSON(),e):this._featureOnclickEvent.bind(this)(e.toGeoJSON(),e)}),this.searchLayersData=t,this._prepareResultData(t),this._event.fire("searchlayersucceeded",{result:this.searchResultLayer.toGeoJSON()})}),this.viewModel.on("geocodesucceeded",e=>{const t=e.result;this.clearSearchResult(),this.searchResultLayer=ao().geoJSON(t,{pointToLayer:this.options.style,style:this.options.style,onEachFeature:this.options.onEachFeature||this._featureOnclickEvent.bind(this)}).bindPopup(function(e){if(e.feature.properties)return new ka({attributes:e.feature.properties}).getElement()}).addTo(this.map),this.searchLayersData=t,this._prepareResultData(t),this._event.fire("geocodesucceeded",{result:t})}),this.viewModel.on("searchfailed",e=>{let t="";t="searchGeocodeField"===e.searchType?Ma.i18n("msg_searchGeocodeField"):"cityGeocodeField"===e.searchType?Ma.i18n("msg_cityGeocodeField"):Ma.i18n("msg_getFeatureField"),this.messageBox.showView(t),this._event.fire("searchfailed",{message:t})})},_prepareResultData(e){this.currentResult=e;let t=Math.ceil(e.length/this.perPageDataNum);this._resultDomObj.setPageLink(t),this._createResultListByPageNum(1,e),this._resultDomObj.showView(),this._resultDomObj.setLinkageEvent(function(e){i._createResultListByPageNum(e,i.currentResult)});const i=this},_createResultListByPageNum(e,t){let i,r=0;1===e&&t.length<this.perPageDataNum?i=t.length-1:e*this.perPageDataNum>t.length?(r=this.perPageDataNum*(e-1),i=t.length-1):(r=this.perPageDataNum*(e-1),i=e*this.perPageDataNum-1);const s=document.createElement("div");for(let e=r;e<=i;e++){let i,r="Point";t[e].filterAttribute?(r=t[e].feature.geometry.type,i=t[e].filterAttribute):i=t[e].properties,s.appendChild(this._createResultItem(r,i))}this._resultDomObj.setContent(s),this._resultDomObj.showView(),s.firstChild.getElementsByClassName("component-search-result-icon")[0].classList.add("component-search__resultitme-selected");const n=s.firstChild.getElementsByClassName("component-search-result-info")[0].firstChild.innerText;!this._selectMarkerFeature&&this._linkageFeature(n)},_flyToBounds(e){const t=e.getSouthWest(),i=e.getNorthEast();t.lat===i.lat&&t.lng===i.lng?this.map.flyTo(t):this.map.fitBounds(e)},_linkageFeature(e){let t="";t=this.isSearchLayer?e.split(":")[1].trim():e,this._selectFeature&&this._selectFeature.addTo(this.map),this.searchResultLayer.eachLayer(e=>{(!t||e.filterAttribute&&e.filterAttribute.filterAttributeValue===t||e.feature.properties&&e.feature.properties.name===t)&&(e.remove(),this._setSelectedLayerStyle(e))})},clearSearchResult(){this.searchResultLayer&&(this.map.closePopup(),!this.isSearchLayer&&this.map.removeLayer(this.searchResultLayer),this._selectMarkerFeature&&this.map.removeLayer(this._selectMarkerFeature),this._selectFeaturethis&&this.map.removeLayer(this._selectFeature),this._selectMarkerFeature=null,this._selectFeature=null,this.searchResultLayer=null,this.currentResult=null)},_featureOnclickEvent(e,t){t.on("click",()=>{let i,r,s=document.getElementsByClassName("component-pagination__link")[0];this._resultDomObj._changePageEvent({target:s.children[0].children[0]}),this._selectFeature&&this._selectFeature.addTo(this.map),t.remove();for(let s=0;s<this.searchLayersData.length;s++){let n=this.searchLayersData[s];if(n.properties&&n.properties.name===e.properties.name||n.filterAttribute&&n.filterAttribute.filterAttributeName+": "+n.filterAttribute.filterAttributeValue==t.filterAttribute.filterAttributeName+": "+t.filterAttribute.filterAttributeValue){r=s%this.perPageDataNum,i=parseInt(s/this.perPageDataNum)+1;break}}if(i>1)for(let e=1;e<i;e++){let e;e=document.getElementsByClassName("component-pagination__link")[0],this._resultDomObj._changePageEvent({target:e.children[e.children.length-2].children[0]})}let n=document.getElementsByClassName("component-search-result-info"),a=n[r].children[0];if(a.innerHTML===e.properties.name||a.innerHTML===t.filterAttribute.filterAttributeName+": "+t.filterAttribute.filterAttributeValue){let e=n[r].parentNode;document.getElementsByClassName("component-search__resultitme-selected").length>0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),e.firstChild.classList.add("component-search__resultitme-selected"),this._setSelectedLayerStyle(t)}},this)},_setSelectedLayerStyle(e){let t;this._selectMarkerFeature&&this._selectMarkerFeature.remove(),this._selectMarkerFeature=null,this._selectFeature=e,this._selectMarkerFeature=ao().geoJSON(e.toGeoJSON(),{pointToLayer:(e,t)=>ao().marker(t,{icon:ao().divIcon({className:"component-select-marker-icon",iconAnchor:[15,0]})}),style:{fillColor:"red",weight:1,opacity:1,color:"red",fillOpacity:.2}}).addTo(this.map),this._selectMarkerFeature.bindPopup(function(){return new ka({attributes:e.feature.properties}).getElement()},{closeOnClick:!1}).openPopup().addTo(this.map),this._flyToBounds(this.searchResultLayer.getBounds()),e.getLatLng?t=e.getLatLng():e.getCenter&&(t=e.getCenter()),this.map.setView(t)}}),Ac=ao().Evented.extend({options:{_defaultLayerOptions:{style:null,onEachFeature:function(e,t){let i="属性信息如下:<br>";for(let t in e.properties)i+=t+": "+e.properties[t]+"<br>";t.bindPopup(i)}}},initialize(e,t=null){if(!e)return new Error("Cannot find map, fileModel.map cannot be null.");this.map=e,ao().Util.extend(this.options._defaultLayerOptions,t),this.options._defaultLayerOptions.pointToLayer=this.options._defaultLayerOptions.style,this.popupsStatus=!0,this.dataFlowStatus=!1,this.dataFlowUrl="",this.currentFeatures=[],this.dataFlowLayer=null},subscribe(e){if(this.dataFlowUrl===e){if(this.dataFlowStatus)return void this.fire("dataflowservicesubscribed")}else this.dataFlowUrl=e;this.dataFlowStatus=!0,this.dataFlowLayer&&(this.dataFlowLayer.remove(),this.dataFlowLayer=null);const t=new wl(e,this.options._defaultLayerOptions);t.on("subscribesucceeded",e=>{this.fire("subscribesucceeded",{result:e})}),t.on("subscribefailed",e=>{this.fire("subscribefailed",{result:e})}),t.on("dataupdated",e=>{this.fire("dataupdated",{result:e});let t=e.layer.getBounds(),i=vo.toSuperMapBounds(this.map.getBounds()),r=vo.toSuperMapBounds(t);i.intersectsBounds(r)||(r.left===r.right&&r.top===r.bottom?this.map.setView(t.getCenter()):this.map.flyToBounds(t)),this.popupsStatus&&this.openPopups()}),t.addTo(this.map),this.dataFlowLayer=t},cancelSubscribe(){this.dataFlowLayer&&(this.dataFlowStatus=!1,this.dataFlowLayer.dataService.unSubscribe(),this.dataFlowLayer.remove(),this.dataFlowLayer=null)},openPopups(){if(this.popupsStatus=!0,this.dataFlowLayer){const e=this.dataFlowLayer.getLayers();for(let t=0;t<e.length;t++)for(let i=0;i<e[t].getLayers().length;i++)e[t].getLayers()[i].openPopup()}},closePopups(){if(this.popupsStatus=!1,this.dataFlowLayer){const e=this.dataFlowLayer.getLayers();for(let t=0;t<e.length;t++)for(let i=0;i<e[t].getLayers().length;i++)e[t].getLayers()[i].closePopup()}}}),Tc=bc.extend({initialize(e){bc.prototype.initialize.apply(this,[e])},onAdd(e){let t={};return this.options.style&&(t.style=this.options.style),this.options.onEachFeature&&(t.style=this.options.onEachFeature),this.viewModel=new Ac(e,t),bc.prototype.onAdd.apply(this,[e])},_initView(){const e=new Pa({title:Ma.i18n("title_dataFlowService")}),t=e.getElement(),i=e.getContentElement();i.style.padding="10px 18px";const r=document.createElement("div");r.setAttribute("class","component-dataflow__container");const s=document.createElement("div");s.setAttribute("class","component-input-default");const n=document.createElement("input");n.setAttribute("class","component-input-default"),n.type="text",n.placeholder=Ma.i18n("text_input_value_inputDataFlowUrl"),n.title=Ma.i18n("text_input_value_inputDataFlowUrl"),s.appendChild(n);const a=document.createElement("span");a.setAttribute("class","supermapol-icons-close"),a.hidden=!0,a.onclick=(e=>{n.value="",e.target.hidden=!0}),n.oninput=(()=>{a.hidden=!1}),s.appendChild(a),r.appendChild(s),i.appendChild(r);const o=document.createElement("div");o.setAttribute("class","component-dataflow__container");const l=document.createElement("div");l.setAttribute("class","component-checkbox-container");const h=document.createElement("div");h.setAttribute("class","component-checkbox-default component-checkbox-selected-img"),h.checked=!0,l.appendChild(h);const u=document.createElement("div");u.setAttribute("class","component-label component-label-selected"),u.innerHTML=Ma.i18n("text_displayFeaturesInfo"),l.appendChild(u),h.onclick=(e=>{e.target.checked=!e.target.checked,e.target.checked?(u.setAttribute("class","component-label component-label-selected"),e.target.setAttribute("class","component-checkbox-default component-checkbox-selected-img"),this.viewModel.openPopups()):(u.setAttribute("class","component-label"),e.target.setAttribute("class","component-checkbox-default component-checkbox-default-img"),this.viewModel.closePopups())}),o.appendChild(l),i.appendChild(o);const c=document.createElement("div");c.setAttribute("class","component-dataflow__container component-init-center");const d=document.createElement("button");d.setAttribute("class","component-button-default"),d.innerHTML=Ma.i18n("text_subscribe"),d.onclick=(()=>{const e=n.value;""!==e?this.viewModel.subscribe(e):this.messageBox.showView(Ma.i18n("msg_inputDataFlowUrlFirst"))}),c.appendChild(d);const p=document.createElement("button");return p.setAttribute("class","component-button-default"),p.innerHTML=Ma.i18n("text_cancelSubscribe"),p.onclick=(()=>{this.viewModel.cancelSubscribe()}),c.appendChild(p),i.appendChild(c),this.messageBox=new wa,this.viewModel.on("dataflowservicesubscribed",()=>{this.messageBox.showView(Ma.i18n("msg_dataflowservicesubscribed"))}),this.viewModel.on("subscribesucceeded",()=>{this.messageBox.showView(Ma.i18n("msg_subscribesucceeded"))}),this.viewModel.on("dataupdated",e=>{this.messageBox.closeView(),this._event.fire("dataupdated",e)}),this._preventMapEvent(t,this.map),t}});class Ec{constructor(e,t){this.layerName=e,this.layer=t}}class Lc extends ao().Evented{initialize(e){this.workerUrl=e,this.turfLayers=[]}getLayersData(e){let t={},i={},r={},s={};for(let t=0;t<e;t++)e[t]=new Ec(e[t].layerName,e[t].layer);this.geoJsonLayersDataModel=new xc(e);let n=[];for(let t=0;t<e.length;t++)n[e[t].layerName]={fields:e[t].fields,layer:e[t].layer.toGeoJSON()};for(let e in this.geoJsonLayersDataModel.layers){let t;t=n[e].fields?n[e].fields:this.geoJsonLayersDataModel.layers[e].getAttributeNamesByType("Num");let o=[];for(let i=0;i<t.length;i++){o[t[i]]=this.geoJsonLayersDataModel.layers[e].getAttributeValueByAttributeName(t[i]);let r=o[t[i]];for(var a=0;a<r.length;a++)""!=r[a]&&void 0!==r[a]||(r.splice(a,1),a-=1),r[a]=parseFloat(r[a]);o[t[i]]=Array.from(new Set(r.sort(function(e,t){return e-t})))}let l={layerName:e,fields:t,fieldsValue:o,features:n[e].layer},h=n[e].layer.features[0].geometry.type;"Point"===h?i[e]=l:"LineString"===h?r[e]=l:"Polygon"===h&&(s[e]=l)}return t.point=i,t.lineString=r,t.polygon=s,t}analysis(e,t){this.geoJsonLayersDataModel.setCurrentLayerDataModel(e.analysisLayers),this.worker=new Worker(this.workerUrl);let i=this.geoJsonLayersDataModel.currentLayerDataModel.layer.toGeoJSON();if("isolines"===e.analysisMethod){let r=e.analysisFieldsValue.split(","),s=i;for(let e=0;e<r.length;e++)r[e]=parseFloat(r[e]);let n=this,a={pointGrid:s,analysisMethod:e.analysisMethod,breaks:r,zProperty:e.analysisFields,analysisCellSize:e.analysisCellSize,options:{gridType:"point",property:e.analysisFields,weight:Number(e.analysisBreaks)}};this.worker.postMessage(a),this.worker.onmessage=(i=>{if(0===i.data.features.length)n.fire("analysisfailed");else{n.fire("analysissucceeded",{data:i.data});let r=ao().geoJSON(i.data,{style:{color:"#1060C2",weight:3},onEachFeature:function(e,t){e.properties&&t.bindPopup(new ka(e.properties).getElement()),t.on({mouseover:function(){t.setStyle({color:"#ffffff",weight:5})},mouseout:function(){t.setStyle({color:"#1060C2",weight:3})},click:function(){t.setStyle({color:"#ffffff",weight:5})}})}}).addTo(t);n.turfLayers.push(r),n.fire("layerloaded",{layer:r,name:e.resultLayersName}),n.worker.terminate()}})}else if("buffer"===e.analysisMethod){let r=this,s={analysisMethod:"buffer",radius:e.radius,unit:e.unit,isSave:e.isSaveStatus,isUnion:e.isUnion,geoJson:i};this.worker.postMessage(s),this.worker.onmessage=(i=>{let s=ao().geoJSON(i.data,{style:{color:"#ffffff",fillColor:"#1060C2",fillOpacity:.5,weight:1.5},onEachFeature:function(e,t){e.properties&&t.bindPopup(new ka(e.properties).getElement()),t.on({mouseover:function(){t.setStyle({color:"#ffffff",fillColor:"rgb(46,40,79)",fillOpacity:.5,weight:5})},mouseout:function(){t.setStyle({color:"#ffffff",fillColor:"#1060C2",fillOpacity:.5,weight:1.5})},click:function(){t.setStyle({color:"#ffffff",fillColor:"rgb(46,40,79)",fillOpacity:.5,weight:2})}})}}).addTo(t);r.turfLayers.push(s),r.fire("layerloaded",{layer:s,name:e.resultLayersName}),r.worker.terminate()})}}clearLayers(){for(let e in this.turfLayers)this.turfLayers[e].clearLayers();this.fire("layersremoved",{layers:this.turfLayers})}cancelAnalysis(){this.worker.terminate()}}var Oc=bc.extend({initialize:function(e,t){if(!e)throw new Error("workerUrl is required");this.workerUrl=e,bc.prototype.initialize.apply(this,[t])},onAdd:function(e){return this.map=e,bc.prototype.onAdd.apply(this,[e])},addLayer:function(e){this.layers=this.layers||[],this.layers.push(e);let t=this.viewModel.getLayersData(this.layers);this.fillDataToView(t)},fillDataToView:function(e){if(!e)return;this.fillData=e;let t={};switch(document.getElementById("dropDownTop").getAttribute("data-value")){case"isolines":case"buffer":t=e.point}if("{}"==JSON.stringify(t))return;let i=[];for(let e in t)i.push(e);let r=document.getElementById("layersSelect"),s=document.getElementById("layerSelectName");r.innerHTML="",s.title=i[0],s.innerHTML=i[0],this._createOptions(r,i),this.layerSelectObj.optionClickEvent(r,s,this.layersSelectOnchange);let n=t[s.title],a=n.fields,o=n.fieldsValue;this.currentData=n,this.currentFillData=t;let l=document.getElementById("fieldsSelect");l.innerHTML="";let h=document.getElementById("fieldsSelectName");h.innerHTML=a[0],h.title=a[0],this._createOptions(l,a),this.fieldsSelectObj.optionClickEvent(l,h,this.fieldsSelectOnchange);let u=h.title,c=document.getElementById("getValueTextArea");c.value=o[u].toString().replace(/,/g,",\r\n"),c.setAttribute("data-value",o[u]);let d=document.getElementById("resultLayersName");switch(document.getElementById("dropDownTop").getAttribute("data-value")){case"isolines":d.value=Ma.i18n("text_label_isolines")+s.title;break;case"buffer":d.value=Ma.i18n("text_label_buffer")+s.title}},_initView:function(){this.workerUrl&&(this.viewModel=new Lc(this.workerUrl));let e=new Pa({title:Ma.i18n("title_clientComputing")}).getElement();e.classList.add("component-analysis"),e.children[0].style.fontSize="12px";let t=[{title:Ma.i18n("text_isoline"),dataValue:"isolines",remark:Ma.i18n("text_extractDiscreteValue"),icon:{className:"component-analyst-isoline-img"}},{title:Ma.i18n("text_buffer"),dataValue:"buffer",remark:Ma.i18n("text_specifyTheDistance"),icon:{className:"component-analyst-buffer-img"}}],i=e.children[1];i.classList.add("component-content--scroll"),i.classList.add("component-content--analysis");let r=new Ia(t).getElement();i.appendChild(r);let s=r.children[0].children[0],n=r.children[0].children[2].children[0];s.children[0].id="dropDownTop";let a=ao().DomUtil.create("div","component-analysis__container",i),o=ao().DomUtil.create("div","component-analysis__container__analysisLayer",a),l=ao().DomUtil.create("div","component-analysis__selecttool",o);l.id="layerSelectControl";let h={optionsArr:[""],labelName:Ma.i18n("text_label_analysisLayer")},u=new Na(h),c=u.getElement();this.layerSelectObj=u,l.appendChild(c);let d=c.children[1].children[0];d.id="layerSelectName",c.children[1].children[2].children[0].children[0].id="layersSelect";let p=ao().DomUtil.create("div","component-analysis__container__analysistype",a),f=ao().DomUtil.create("div","component-clientcomputation__isoline",p),m={optionsArr:[""],labelName:Ma.i18n("text_label_extractField"),optionsClickCb:this.fieldsSelectOnchange},y=ao().DomUtil.create("div","component-analysis__selecttool",f),g=new Na(m),v=g.getElement();this.fieldsSelectObj=g;let b=v.children[1].children[0];b.id="fieldsSelectName";let _=v.children[1].children[2].children[0].children[0];_.id="fieldsSelect",y.appendChild(v);let S=ao().DomUtil.create("div","component-analysis__container",f);ao().DomUtil.create("span","component-textarea__name",S).innerHTML=Ma.i18n("text_label_extractedValue");let x=ao().DomUtil.create("div","component-textarea",S);x.id="getValueText";let w=ao().DomUtil.create("div","",x),C=ao().DomUtil.create("div","component-scrollarea-content",w);C.setAttribute("tabindex","1");let M=ao().DomUtil.create("textarea","component-textarea__content",C);M.id="getValueTextArea",M.setAttribute("rows","20");let A=ao().DomUtil.create("div","",f);ao().DomUtil.create("span","",A).innerHTML=Ma.i18n("text_label_distanceAttenuation");let T=ao().DomUtil.create("input","",A);T.value="3";let E=ao().DomUtil.create("div","",f);ao().DomUtil.create("span","",E).innerHTML=Ma.i18n("text_label_gridSize");let L=ao().DomUtil.create("input","",E);L.value="30";let O=ao().DomUtil.create("div","component-clientcomputation__buffer hidden",p),P=ao().DomUtil.create("div","component-clientcomputation__buffer--radius",O);ao().DomUtil.create("span","",P).innerHTML=Ma.i18n("text_label_bufferRadius");let N=ao().DomUtil.create("div","",P),I=ao().DomUtil.create("input","buffer-radius-input",N);I.id="bufferRadiusInput",I.value="10",I.setAttribute("placeholder",Ma.i18n("text_label_defaultkilometers"));let F=ao().DomUtil.create("div","component-clientcomputation__buffer--unit",N);F.id="bufferUnit";let k={optionsArr:[Ma.i18n("text_option_kilometer")],labelName:Ma.i18n("text_label_unit")},D=new Na(k).getElement(),R=D.children[1].children[0];R.id="bufferUnitSelectName",D.children[1].children[2].children[0].children[0].id="bufferUnitSelect",D.children[0].style.display="none",F.appendChild(D);let B=ao().DomUtil.create("div","",P),G=ao().DomUtil.create("div","component-clientcomputation__buffer--issaveattrs",B);G.id="saveAttrsContainer";let U=ao().DomUtil.create("div","checkbox checkbox-fault",G);U.id="saveAttrsCheckbox";let j=ao().DomUtil.create("div","lable",G);j.id="saveAttrsLabel",j.innerHTML=Ma.i18n("text_retainOriginal");let z=ao().DomUtil.create("div","component-clientcomputation__buffer--isunion",B);z.id="isUnionContainer";let V=ao().DomUtil.create("div","checkbox checkbox-fault",z);V.id="isUnionCheckbox";let J=ao().DomUtil.create("div","lable",z);J.innerHTML=Ma.i18n("text_mergeBuffer"),J.id="isUnionLabel";let q=ao().DomUtil.create("div","component-analysis__container__resultLayersName",a);ao().DomUtil.create("span","",q).innerHTML=Ma.i18n("text_label_resultLayerName");let H=ao().DomUtil.create("input","",q);H.id="resultLayersName";let W=ao().DomUtil.create("div","component-analysis__container__analysisbtn",a),Y=ao().DomUtil.create("div","component-analysis__analysisbtn",W),X=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis",Y);X.innerHTML=Ma.i18n("btn_analyze");let Q=ao().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",Y),Z=ao().DomUtil.create("div","component-analysis__analysisbtn--analysising",Q),K=ao().DomUtil.create("div","component-analysis__svg-container",Z);K.id="analyse_background",K.innerHTML='<svg class="component-analysis__svg-rotate" width="16px" height="16px" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <path id="ring" fill="#FFF" transform="translate(8,8)" d="M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z"></path>\n <circle cx="8" cy="8" r="6" fill="#38ADF5"></circle>\n <rect class="svg-top" x="8" y="0" rx="2" ry="2" width="2" height="2" style="fill: rgb(255, 255, 255); stroke-width: 0;"></rect>\n <rect class="svg-left" x="0" y="8" rx="2" ry="2" width="2" height="2" style="fill: rgb(255, 255, 255); stroke-width: 0;"></rect>\n </svg>',ao().DomUtil.create("span","",Z).innerHTML=Ma.i18n("btn_analyzing");let $=ao().DomUtil.create("button","component-analysis__analysisbtn--cancel",Q);$.innerHTML=Ma.i18n("btn_cancelAnalysis");let ee=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",Y);ee.innerHTML=Ma.i18n("btn_emptyTheAnalysisLayer");for(let e=0;e<n.children.length;e++)n.children[e].onclick=(()=>{s.innerHTML=n.children[e].outerHTML,s.children[0].id="dropDownTop";let t=document.getElementById("layersSelect"),r=document.getElementById("layerSelectName"),a=n.children[e].getAttribute("data-value"),o={};switch(a){case"buffer":f.classList.add("hidden"),O.classList.remove("hidden"),i.style.height="422px",H.value=Ma.i18n("text_label_buffer")+r.title,o=this.fillData.point;break;case"isolines":f.classList.remove("hidden"),O.classList.add("hidden"),i.style.height="712px",H.value=Ma.i18n("text_label_isolines")+r.title,o=this.fillData.point}if(this.currentFillData===o)return;if(t.innerHTML="","{}"==JSON.stringify(o))return H.value="",r.title="",void(r.innerHTML="");let l=[];for(let e in o)l.push(e);r.title=l[0],r.innerHTML=l[0],this._createOptions(t,l),this.layerSelectObj.optionClickEvent(t,r,this.layersSelectOnchange),"buffer"===a?H.value=Ma.i18n("text_label_buffer")+l[0]:"isolines"===a&&(H.value=Ma.i18n("text_label_isolines")+l[0]),this.currentData=o[r.title],this.currentFillData=o});this.fieldsSelectOnchange=function(e){if(this.currentData){let t=this.currentData,i=e.title;M.value=t.fieldsValue[i].toString().replace(/,/g,",\r\n"),M.setAttribute("data-value",t.fieldsValue[i])}}.bind(this),this.layersSelectOnchange=function(e){if(this.currentData){let t=e.title,i=this.currentFillData[t];this.currentData=i,_.innerHTML="",this._createOptions(_,i.fields);let r=document.getElementById("fieldsSelectName"),s=i.fields[0];r.title=s,r.innerHTML=s;let n=s;this.fieldsSelectObj.optionClickEvent(_,r,this.fieldsSelectOnchange),M.value=i.fieldsValue[n].toString().replace(/,/g,",\r\n"),M.setAttribute("data-value",i.fieldsValue[n]);let a=document.getElementById("dropDownTop").getAttribute("data-value");switch(a){case"buffer":H.value=Ma.i18n("text_label_buffer")+t;break;case"isolines":H.value=Ma.i18n("text_label_isolines")+t}}}.bind(this);let te=!0,ie=!1;return j.classList.add("selected"),U.classList.add("checkbox-active"),G.onclick=(()=>{te?(U.classList.add("checkbox-fault"),U.classList.remove("checkbox-active"),j.classList.remove("selected"),te=!1):(U.classList.add("checkbox-active"),U.classList.remove("checkbox-fault"),j.classList.add("selected"),te=!0,ie&&(V.classList.add("checkbox-fault"),V.classList.remove("checkbox-active"),ie=!1))}),z.onclick=(()=>{ie?(V.classList.add("checkbox-fault"),V.classList.remove("checkbox-active"),J.classList.remove("selected"),ie=!1):(V.classList.add("checkbox-active"),V.classList.remove("checkbox-fault"),J.classList.add("selected"),ie=!0,te&&(U.classList.add("checkbox-fault"),U.classList.remove("checkbox-active"),te=!1))}),this.messageBox=new wa,X.onclick=(()=>{let e;switch(Q.style.display="block",X.style.display="none",document.getElementById("dropDownTop").getAttribute("data-value")){case"isolines":e=function(){let e=document.getElementById("dropDownTop").getAttribute("data-value"),t=document.getElementById("resultLayersName").value,i=d.title,r=b.title,s=M.value.replace(/[\r\n]/g,"").split(",").toString(),n=T.value,a=L.value;return{analysisMethod:e,analysisLayers:i,analysisFields:r,analysisFieldsValue:s,analysisBreaks:n,analysisCellSize:a,resultLayersName:t}}();break;case"buffer":e=function(){let e=document.getElementById("dropDownTop"),t=document.getElementById("resultLayersName").value,i=d.title,r=e.getAttribute("data-value"),s=I.value,n=R.title;return{analysisMethod:r,analysisLayers:i,radius:s,unit:n,resultLayersName:t,isSaveStatus:te,isUnion:ie}}()}this.viewModel.analysis(e,this.map),this.viewModel.on("layerloaded",e=>{Q.style.display="none",X.style.display="block",this._event.fire("analysissucceeded",{layer:e.layer,name:e.name})}),this.viewModel.on("analysisfailed",()=>{Q.style.display="none",X.style.display="block",this.messageBox.showView(Ma.i18n("msg_resultIsEmpty"),"failure"),this._event.fire("analysisfailed")})}),$.onclick=(()=>{Q.style.display="none",X.style.display="block",this.viewModel.cancelAnalysis()}),ee.onclick=(()=>{this.viewModel.on("layersremoved",e=>{this._event.fire("layersremoved",{layers:e.layers})}),this.viewModel.clearLayers()}),this._preventMapEvent(e,this.map),e},_createOptions(e,t){for(let i in t){let r=document.createElement("div"),s=t[i];r.className="component-selecttool__option",r.title=s,r.innerHTML=s,r.setAttribute("data-value",s),e.appendChild(r)}}});class Pc{constructor(e){this.layerName=e.layerName,this.layer=e.layer,this.fields=e.fields||null}}class Nc extends ao().Evented{initialize(e){this.processingUrl=e}getDatasetsName(){let e=this.processingUrl;this.dataset=[],this.dataset.datasetNames=[],this.dataset.childUrl=[];let t="http://"+e.split("/")[2],i=t+"/iserver/services/datacatalog/rest/datacatalog/sharefile.json",r=t+"/iserver/services/datacatalog/rest/datacatalog/relationship/datasets.json",s=this;Ue.get(i).then(function(e){return e.json()}).then(function(e){s.dataset.datasetNames=s.dataset.datasetNames.concat(e.datasetNames),s.dataset.childUrl=s.dataset.childUrl.concat(e.childUriList);let t=s;Ue.get(r).then(function(e){return e.json()}).then(function(e){t.dataset.datasetNames=t.dataset.datasetNames.concat(e.datasetNames),t.dataset.childUrl=t.dataset.childUrl.concat(e.childUriList);let i=[];for(let e in t.dataset.datasetNames)i[t.dataset.datasetNames[e]]=t.dataset.childUrl[e];t.fire("datasetsloaded",{result:{dataset:t.dataset,datasetHash:i}})})})}getDatasetInfo(e){let t,i=this;Ue.get(e).then(function(e){return e.json()}).then(function(e){let r=e.datasetInfo;"LINE"===r.datasetType||"LINE"===r.type?t="LINE":"POINT"===r.datasetType||"POINT"===r.type||"CSV"===r.type?t="POINT":"REGION"!==r.datasetType&&"REGION"!==r.type||(t="REGION");let s=[],n=r.fieldInfos||r.fieldInfo||null;if(n){for(let e in n)s.push(n[e].name);i.fire("datasetinfoloaded",{result:{type:t,fields:s}})}else{let r=e.childUriList[0].replace("//fields","/fields");Ue.get(r).then(function(e){return e.json()}).then(function(e){let r=e.fieldNames,s=[];for(let e in r)s.push(r[e]);i.fire("datasetinfoloaded",{result:{type:t,fields:s}})})}})}}class Ic extends ao().Evented{initialize(e){this.processingUrl=e}getDatasetsName(){let e=this.processingUrl;this.resultLayers=[],this.datasetNames=[],this.distributedAnalysisModel=new Nc(e),this.distributedAnalysisModel.getDatasetsName();let t=this;this.distributedAnalysisModel.on("datasetsloaded",function(e){t.fire("datasetsloaded",{result:e.result})})}getDatasetInfo(e){this.distributedAnalysisModel.getDatasetInfo(e);let t=this;this.distributedAnalysisModel.on("datasetinfoloaded",function(e){let i=e.result.type,r=e.result.fields;t.fire("datasetinfoloaded",{result:{type:i,fields:r}})})}analysis(e,t){let i=new cc(this.processingUrl);if(e.analysisParam instanceof Pr){let r=e.analysisParam,s=this;i.addKernelDensityJob(r,function(i){i.error?s.fire("analysisfailed",{error:i.error}):i.result.setting.serviceInfo.targetServiceInfos.map(function(i){return"RESTMAP"===i.serviceType&&Ue.get(i.serviceAddress+"/maps").then(function(e){return e.json()}).then(function(i){let r=i[0].path;s.fire("analysissucceed",{result:i});let n=Wo(r,{noWrap:!0,transparent:!0});s.resultLayers.push(n),n.addTo(t);let a=new Date,o=e.resultLayerName||a.getTime();s.fire("layerloaded",{layer:n,name:o})}),i})})}}clearLayers(){for(let e in this.resultLayers)this.resultLayers[e].remove();this.fire("layersremoved",{layers:this.resultLayers}),this.resultLayers=[]}}var Fc=bc.extend({initialize:function(e,t){bc.prototype.initialize.apply(this,[t]),this.viewModel=new Ic(e)},onAdd:function(e){return this._fillDataToView(),bc.prototype.onAdd.apply(this,[e])},_fillDataToView:function(){this.viewModel.on("datasetsloaded",e=>{let t=e.result.dataset.datasetNames;this.datasetSelect.innerHTML="",this._createOptions(this.datasetSelect,t),this.datasetSelectObj.optionClickEvent(this.datasetSelect,this.datasetSelectName,this.datasetSelectOnchange),this.dataHash=e.result.datasetHash}),this.viewModel.getDatasetsName()},_initView:function(){let e=new Pa({title:Ma.i18n("title_distributedAnalysis")}).getElement();e.classList.add("component-analysis"),e.children[0].style.fontSize="12px";let t=ao().DomUtil.create("div","component-content component-content--scroll component-content--analysis",e),i=[{title:Ma.i18n("text_densityAnalysis"),dataValue:"density",remark:Ma.i18n("text_CalculateTheValuePerUnitArea"),icon:{className:"component-analyst-density-img"}}],r=new Ia(i).getElement();t.appendChild(r);let s=r.children[0].children[0].children[0],n=ao().DomUtil.create("div","component-analysis__container",t),a=ao().DomUtil.create("div","analysistype",n),o=ao().DomUtil.create("div","component-analysis__container__analysisLayer",a),l=ao().DomUtil.create("div","component-analysis__selecttool",o),h={optionsArr:[Ma.i18n("text_option_selectDataset")],labelName:Ma.i18n("text_label_dataset"),optionsClickCb:te.bind(this)},u=new Na(h),c=u.getElement();this.datasetSelectObj=u,l.appendChild(c);let d=c.children[1].children[0];this.datasetSelectName=d;let p=c.children[1].children[2].children[0].children[0];p.children[0].style.display="none",this.datasetSelect=p;let f=ao().DomUtil.create("div","component-analysis__idw",o),m=[{optionsArr:[Ma.i18n("text_option_simplePointDensityAnalysis"),Ma.i18n("text_option_nuclearDensityAnalysis")],labelName:Ma.i18n("text_label_analyticalMethod")},{optionsArr:[Ma.i18n("text_option_quadrilateral"),Ma.i18n("text_option_hexagon")],labelName:Ma.i18n("text_label_meshType")}],y=ao().DomUtil.create("div","component-analysis__idw__selecttool",f);for(let e in m){let t=new Na(m[e]).getElement();y.appendChild(t)}let g={optionsArr:[Ma.i18n("text_option_notSet")],labelName:Ma.i18n("text_label_weightField")},v=new Na(g),b=v.getElement();y.appendChild(b),this.weightFieldsSelectObj=v;let _=y.children[0].children[1].children[0];_.setAttribute("data-value","0");let S=y.children[0].children[1].children[2].children[0].children[0];this._setEleAtribute(["0","1"],"data-value",S.children);let x=y.children[1].children[1].children[0];x.setAttribute("data-value","0");let w=y.children[1].children[1].children[2].children[0].children[0];this._setEleAtribute(["0","1"],"data-value",w.children);let C=y.children[2].children[1].children[0],M=y.children[2].children[1].children[2].children[0].children[0],A=[{spanName:Ma.i18n("text_label_queryRange"),value:""}];for(let e in A)this._creatInputBox(A[e],y);let T=y.children[3].children[1];T.setAttribute("placeholder",Ma.i18n("text_label_queryRangeTips")),T.title=Ma.i18n("text_label_queryRangeTips");let E={labelName:Ma.i18n("text_label_gridSizeInMeters"),selectOptions:{optionsArr:["Meter","Kilometer","Yard","Foot","Mile"]}},L=this._creatUnitSelectBox(E,y),O=L.children[1].children[0];O.value="1000";let P=L.children[1].children[1].children[0].children[0].children[0],N={labelName:Ma.i18n("text_label_searchRadius"),selectOptions:{optionsArr:["Meter","Kilometer","Yard","Foot","Mile"]}},I=this._creatUnitSelectBox(N,y),F=I.children[1].children[0];F.value="300";let k=I.children[1].children[1].children[0].children[0].children[0],D={labelName:Ma.i18n("text_label_areaUnit"),optionsArr:["SquareMile","SquareMeter","Hectare","Acre","SquareFoot","SquareYard"]},R=new Na(D).getElement();y.appendChild(R);let B=R.children[1].children[0],G=ao().DomUtil.create("div","range-content",a),U={optionsArr:[Ma.i18n("text_option_notSet"),Ma.i18n("text_option_equidistantSegmentation"),Ma.i18n("text_option_logarithm"),Ma.i18n("text_option_equalCountingSegment"),Ma.i18n("text_option_squareRootSegmentation")],labelName:Ma.i18n("text_label_thematicMapSegmentationMode"),optionsClickCb:function(e){"NOTSET"!==e.getAttribute("data-value")?(V.classList.remove("hidden"),J.classList.remove("hidden")):(V.classList.add("hidden"),J.classList.add("hidden"))}};G.appendChild(new Na(U).getElement());let j=G.children[0].children[1].children[0];j.setAttribute("data-value","NOTSET");let z=G.children[0].children[1].children[2].children[0].children[0];this._setEleAtribute(["NOTSET","EQUALINTERVAL","LOGARITHM","QUANTILE","SQUAREROOT"],"data-value",z.children);let V=this._creatInputBox({spanName:Ma.i18n("text_label_thematicMapSegmentationParameters"),value:"20"},G);V.classList.add("hidden");let J=new Na({optionsArr:[Ma.i18n("text_option_greenOrangePurpleGradient"),Ma.i18n("text_option_greenOrangeRedGradient"),Ma.i18n("text_option_rainbowGradient"),Ma.i18n("text_option_spectralGradient"),Ma.i18n("text_option_terrainGradient")],labelName:Ma.i18n("text_label_thematicMapColorGradientMode")}).getElement();G.appendChild(J),J.classList.add("hidden");let q=J.children[1].children[2].children[0].children[0],H=J.children[1].children[0];H.setAttribute("data-value","GREENORANGEVIOLET");this._setEleAtribute(["GREENORANGEVIOLET","GREENORANGERED","RAINBOW","SPECTRUM","TERRAIN"],"data-value",q.children);let W=ao().DomUtil.create("div","",a);ao().DomUtil.create("span","",W).innerHTML=Ma.i18n("text_label_resultLayerName");let Y=ao().DomUtil.create("input","component-distributeanalysis__input",W),X=ao().DomUtil.create("div","component-analysis__container__analysisbtn",n),Q=ao().DomUtil.create("div","component-analysis__analysisbtn",X),Z=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis",Q);Z.innerHTML=Ma.i18n("btn_analyze");let K=ao().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",Q),$=ao().DomUtil.create("div","component-analysis__analysisbtn--analysising",K);$.style.width="200px",ao().DomUtil.create("div","component-analysis__svg-container",$).innerHTML='<svg class="component-analysis__svg-rotate" width="16px" height="16px" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <path id="ring" fill="#FFF" transform="translate(8,8)" d="M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z"></path>\n <circle cx="8" cy="8" r="6" fill="#38ADF5"></circle>\n <rect class="svg-top" x="8" y="0" rx="2" ry="2" width="2" height="2" style="fill: rgb(255, 255, 255); stroke-width: 0;"></rect>\n <rect class="svg-left" x="0" y="8" rx="2" ry="2" width="2" height="2" style="fill: rgb(255, 255, 255); stroke-width: 0;"></rect>\n </svg>',ao().DomUtil.create("span","",$).innerHTML=Ma.i18n("btn_analyzing");let ee=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",Q);function te(e){if(this.messageBox.closeView(),this.dataHash){M.innerHTML="";let t=this.dataHash[e.title],i=this;this.viewModel.on("datasetinfoloaded",function(e){C.title=Ma.i18n("text_option_notSet"),C.innerHTML=Ma.i18n("text_option_notSet"),M.innerHTML="";let t=s.getAttribute("data-value"),r=e.result.type,n=e.result.fields;"density"===t&&("REGION"===r||"LINE"===r?i.messageBox.showView(Ma.i18n("msg_datasetOrMethodUnsupport"),"failure"):(i.messageBox.closeView(),i._createOptions(M,n),i.weightFieldsSelectObj.optionClickEvent(M,C)))}),this.viewModel.getDatasetInfo(t)}}return ee.id="deleteLayersBtn",ee.innerHTML=Ma.i18n("btn_emptyTheAnalysisLayer"),this.messageBox=new wa,this.datasetSelectOnchange=te.bind(this),Z.onclick=(()=>{this.messageBox.closeView();let e=function(){let e,t,i=s.getAttribute("data-value"),r=_.getAttribute("data-value"),n=x.getAttribute("data-value"),a=T.value,o=P.title,l=k.title,h=B.title,u=H.getAttribute("data-value"),c=j.getAttribute("data-value"),p=new Date,f=Y.value||p.getTime();e="NOTSET"===c?"":{rangeMode:c,rangeCount:V.value,colorGradientType:u};"density"===i&&(t=new Pr({datasetName:d.title,method:r,meshType:n,resolution:O.value,fields:C.title,radius:F.value,meshSizeUnit:o,radiusUnit:l,areaUnit:h,query:a,mappingParameters:new _t({rangeMode:e.rangeMode,rangeCount:e.rangeCount,colorGradientType:e.colorGradientType})}));return{analysisParam:t,resultLayerName:f}}();d.title===Ma.i18n("text_option_selectDataset")?this.messageBox.showView(Ma.i18n("msg_selectDataset"),"failure"):C.title===Ma.i18n("text_option_notSet")?this.messageBox.showView(Ma.i18n("msg_setTheWeightField"),"failure"):(this.messageBox.closeView(),K.style.display="block",Z.style.display="none",this.viewModel.on("layerloaded",e=>{K.style.display="none",Z.style.display="block",this._event.fire("analysissucceeded",{layer:e.layer,name:e.name})}),this.viewModel.on("analysisfailed",e=>{this.messageBox.showView(Ma.i18n("msg_theFieldNotSupportAnalysis"),"failure"),K.style.display="none",Z.style.display="block",this._event.fire("analysisfailed",{error:e.error})}),this.viewModel.analysis(e,this.map))}),ee.onclick=(()=>{this.viewModel.on("layersremoved",e=>{this._event.fire("layersremoved",{layers:e.layers})}),this.viewModel.clearLayers()}),this._preventMapEvent(e,this.map),e},_createOptions(e,t){for(let i in t){let r=document.createElement("div");r.className="component-selecttool__option",r.title=t[i],r.innerHTML=t[i],r.setAttribute("data-value",t[i]),e.appendChild(r)}},_creatInputBox(e,t){let i=ao().DomUtil.create("div","",t);ao().DomUtil.create("span","",i).innerHTML=e.spanName;let r=ao().DomUtil.create("input","",i);return r.value=e.value,r.className="component-distributeanalysis__input",i},_creatUnitSelectBox(e,t){let i=ao().DomUtil.create("div","component-clientcomputation__buffer--radius",t);ao().DomUtil.create("span","",i).innerHTML=e.labelName;let r=ao().DomUtil.create("div","",i);ao().DomUtil.create("input","buffer-radius-input",r);let s=ao().DomUtil.create("div","component-clientcomputation__buffer--unit",r),n=e.selectOptions,a=new Na(n).getElement();return s.appendChild(a),i},_setEleAtribute(e,t,i){for(let r=0;r<i.length;r++)i[r].setAttribute(t,e[r])}});class kc extends ao().Evented{initialize(e){this.dataserviceUrl=e,this.resultLayers=[]}getFeatures(e,t){let i=this.dataserviceUrl,r=this,s=hl(i);e instanceof zi?s.getFeaturesByIDs(e,function(e){r._getQureyResult(e,t)}):e instanceof Ji?s.getFeaturesBySQL(e,function(e){r._getQureyResult(e,t)}):e instanceof ki?s.getFeaturesByBounds(e,function(e){r._getQureyResult(e,t)}):e instanceof Bi?s.getFeaturesByBuffer(e,function(e){r._getQureyResult(e,t)}):e instanceof Ui&&s.getFeaturesByGeometry(e,function(e){r._getQureyResult(e,t)})}_getQureyResult(e,t){if(e.error)return void this.fire("getfeaturesfailed",{error:e.error});let i=ao().geoJSON(e.result.features,{onEachFeature:function(e,t){t.bindPopup("ID: "+e.properties.SMID)},pointToLayer:function(e,t){return ao().circleMarker(t,{radius:6})}}).addTo(t);this.resultLayers.push(i),this.fire("getfeaturessucceeded",{result:e.result.features})}clearLayers(){for(let e in this.resultLayers)this.resultLayers[e].remove();this.resultLayers=[]}}var Dc=function(e){return new Dc(e)},Rc=bc.extend({initialize:function(e,t,i){if(bc.prototype.initialize.apply(this,[i]),this.dataServiceUrl=e,!t||0===t.length)throw new Error("Please configure the dataset of the query!");t instanceof Array?this.dataSetNames=t:this.dataSetNames=t.split(" ")},onAdd:function(e){return bc.prototype.onAdd.apply(this,[e])},onRemove:function(){this.map.off("pm:create")},setDataSetNames(e){e instanceof Array?this.dataSetNames=e:this.dataSetNames=e.split(" ")},setGetFeatureMode(e){this.getFeatureMode=e,this._getFeatureModeOnchange(this.getFeatureMode)},setDataServiceUrl(e){this.dataServiceUrl=e,this.viewModel=new kc(this.dataServiceUrl)},_getFeatureModeOnchange(e){let t;t=e&&"{}"!=JSON.stringify(e)?e:["ID","SQL","BOUNDS","BUFFER","SPATIAL"];let i=document.getElementById("queryModelControl");i.innerHTML="",this.creatQueryModeSelect(t,i)},_initView:function(){this.viewModel=new kc(this.dataServiceUrl),this.messageBox=new wa;let e=new Pa({title:Ma.i18n("title_dataServiceQuery")}).getElement();e.classList.add("component-servicequery__container"),e.children[0].classList.add("component-servicequery__title");let t=e.children[1];t.classList.add("component-content--scroll"),t.classList.add("data-services");let i,r=ao().DomUtil.create("div","component-analysis__container",t),s=ao().DomUtil.create("div","component-servicequery__analysistype",r),n=ao().DomUtil.create("div","component-analysis__container__analysisLayer",s),a=this.options.getFeatureMode;i=a&&"{}"!=JSON.stringify(a)?a:["ID","SQL","BOUNDS","BUFFER","SPATIAL"];let o=ao().DomUtil.create("div","",n);o.id="queryModelContainer";let l=ao().DomUtil.create("div","component-analysis__selecttool",o);l.id="queryModelControl",this.creatQueryModeSelect=function(e,t){let i;if(e instanceof Array&&e.length>1){let r={optionsArr:e,labelName:Ma.i18n("text_label_queryMode"),optionsClickCb:this.queryModeltOnchange},s=new Na(r).getElement();t.appendChild(s),i=s.children[1].children[0],s.children[1].classList.add("dataservice-select");let n=s.children[1];n.classList.add("dataservice-select"),n.classList.add("querymodel-select")}else{let t=ao().DomUtil.create("span","",o);t.innerHTML=Ma.i18n("text_label_queryMode"),i=ao().DomUtil.create("div","component-servicequery__querymode-selectname",o);let r=ao().DomUtil.create("span","",i);e instanceof Array?r.innerHTML=e[0]:r.innerHTML=e,i.title=r.innerHTML,this.queryModeltOnchange(i)}return i.id="queryModelSelectName",i}.bind(this),this.queryModeltOnchange=H.bind(this),this.creatQueryModeSelect(i,l);let h=ao().DomUtil.create("div","component-analysis__container component-textarea--dataservice__container",n),u=ao().DomUtil.create("span","textarea-name",h);u.innerHTML=Ma.i18n("text_label_IDArrayOfFeatures");let c=ao().DomUtil.create("div","component-textarea component-textarea--dataservice",h);c.id="getfeaturesIdArr";let d=ao().DomUtil.create("div","scrollarea",c),p=ao().DomUtil.create("div","component-scrollarea-content",d);p.setAttribute("tabindex","1");let f=ao().DomUtil.create("textarea","component-textarea__content",p);f.value="[1,2,3]",f.id="getValueTextArea";let m=ao().DomUtil.create("div","component-servicequery__maxfeatures-container hidden",n),y={spanName:Ma.i18n("text_label_maxFeatures"),value:"1000"},g=this._creatInputBox(y,m).children[1];g.classList.add("max-features-input");let v=ao().DomUtil.create("div","component-servicequery__distance-container hidden",n),b={spanName:Ma.i18n("text_label_bufferDistance"),value:"10"},_=this._creatInputBox(b,v).children[1],S=ao().DomUtil.create("div","component-analysis__container component-textarea--dataservice__container hidden",n),x=ao().DomUtil.create("span","textarea-name",S),w=ao().DomUtil.create("div","",S),C=ao().DomUtil.create("div","component-servicequery__rangeicon-container",w);x.innerHTML=Ma.i18n("text_label_queryRange1");let M=ao().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-polygon-layer bounds",C),A=ao().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-line-layer hidden",C),T=ao().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-point-layer hidden",C),E=ao().DomUtil.create("div","component-textarea component-textarea--rangequery",w);E.id="getfeaturesIdArr";let L=ao().DomUtil.create("div","",E),O=ao().DomUtil.create("div","component-scrollarea-content",L);O.setAttribute("tabindex","1");let P=ao().DomUtil.create("textarea","component-textarea__content component-textarea--rangequery__content",O);P.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';let N=ao().DomUtil.create("div","component-servicequery__spatialquerymode-container hidden",n),I={optionsArr:["CONTAIN","CROSS","DISJOINT","IDENTITY","INTERSECT","NONE","OVERLAP","TOUCH","WITHIN"],labelName:Ma.i18n("text_label_spatialQueryMode")},F=ao().DomUtil.create("div","component-analysis__selecttool",N),k=new Na(I).getElement();k.children[1].classList.add("dataservice-select"),F.appendChild(k);let D=k.children[1].children[0];D.id="spatialQueryModeSelectName",k.children[1].children[2].classList.add("component-servicequery__spatialquerymode__selectcontent");let R=ao().DomUtil.create("div","component-analysis__container__analysisbtn",n),B=ao().DomUtil.create("div","component-analysis__analysisbtn",R),G=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis",B);G.innerHTML=Ma.i18n("btn_query");let U=ao().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",B),j=ao().DomUtil.create("div","component-analysis__analysisbtn--analysising component-servicequery__querybtn--querying",U);ao().DomUtil.create("div","component-analysis__svg-container",j).innerHTML='<svg class="component-analysis__svg-rotate" width="16px" height="16px" version="1.1" xmlns="http://www.w3.org/2000/svg">\n <path id="ring" fill="#FFF" transform="translate(8,8)" d="M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z"></path>\n <circle cx="8" cy="8" r="6" fill="#38ADF5"></circle>\n <rect class="svg-top" x="8" y="0" rx="2" ry="2" width="2" height="2" style="fill: rgb(255, 255, 255); stroke-width: 0;"></rect>\n <rect class="svg-left" x="0" y="8" rx="2" ry="2" width="2" height="2" style="fill: rgb(255, 255, 255); stroke-width: 0;"></rect>\n </svg>',ao().DomUtil.create("span","",j).innerHTML=Ma.i18n("btn_querying");let z=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",B);z.innerHTML=Ma.i18n("btn_emptyTheRresultLayer"),H(i[0]);let V,J,q=this;function H(e){let t;switch(t=e.title?e.title:e,m.classList.add("hidden"),S.classList.add("hidden"),v.classList.add("hidden"),A.classList.add("hidden"),T.classList.add("hidden"),M.classList.remove("bounds"),N.classList.add("hidden"),u.innerHTML=Ma.i18n("text_label_featureFilter"),f.value="SMID<10","BUFFER"!==t&&"SPATIAL"!==t||(S.classList.remove("hidden"),x.innerHTML=Ma.i18n("text_label_geometricObject"),P.value='{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[84.90234375,40.25390625]}}',A.classList.remove("hidden"),T.classList.remove("hidden")),t){case"ID":u.innerHTML=Ma.i18n("text_label_IDArrayOfFeatures"),f.value="[1,2,3]";break;case"SQL":m.classList.remove("hidden");break;case"BOUNDS":S.classList.remove("hidden"),x.innerHTML=Ma.i18n("text_label_queryRange"),P.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}',M.classList.add("bounds");break;case"BUFFER":v.classList.remove("hidden");break;case"SPATIAL":N.classList.remove("hidden")}}return G.onclick=(()=>{this.messageBox.closeView(),U.style.display="block",G.style.display="none";let e=function(){let e,t=q.dataSetNames,i=document.getElementById("queryModelSelectName").title,r=f.value;if("ID"===i){let i=f.value,r=i.substring(1,i.length-1).split(",");e=new zi({IDs:r,datasetNames:t})}else if("SQL"===i){let i=g.value;e=new Ji({queryParameter:{attributeFilter:r},datasetNames:t,maxFeatures:i})}else if("BOUNDS"===i){if(!V){let e=JSON.parse(P.value);V=ao().bounds([e.leftBottom.x,e.leftBottom.y],[e.rightTop.x,e.rightTop.y])}e=new ki({attributeFilter:r,datasetNames:t,bounds:V})}else if("BUFFER"===i){let i=_.value,s=JSON.parse(P.value),n=J||s;e=new Bi({attributeFilter:r,datasetNames:t,bufferDistance:i,geometry:n})}else if("SPATIAL"===i){let i=D.title,s=JSON.parse(P.value),n=J||s;e=new Ui({attributeFilter:r,datasetNames:t,spatialQueryMode:i,geometry:n})}return e}();this.viewModel.on("getfeaturessucceeded",e=>{U.style.display="none",G.style.display="block",0===e.result.features.length&&this.messageBox.showView(Ma.i18n("msg_dataReturnedIsEmpty"),"success"),this._event.fire("getfeaturessucceeded",{result:e.result})}),this.viewModel.on("getfeaturesfailed",e=>{U.style.display="none",G.style.display="block",this.messageBox.showView(e.error.errorMsg,"failure"),this._event.fire("getfeaturesfailed",{error:e.error})}),this.viewModel.getFeatures(e,this.map)}),M.onclick=(e=>{let t=document.getElementById("queryModelSelectName").title;J&&J.remove(),"BOUNDS"===t?this.map.pm.enableDraw("Rectangle"):this.map.pm.enableDraw("Poly"),e.stopPropagation(),e.preventDefault()}),A.onclick=(e=>{J&&J.remove(),this.map.pm.enableDraw("Line"),e.stopPropagation(),e.preventDefault()}),T.onclick=(e=>{J&&J.remove(),this.map.pm.enableDraw("Marker"),e.stopPropagation(),e.preventDefault()}),this.map.on("pm:create",e=>{if("Rectangle"===e.shape){let t=(J=e.layer).getBounds();V=ao().bounds([t._southWest.lng,t._southWest.lat],[t._northEast.lng,t._northEast.lat]);let i={leftBottom:{x:t._southWest.lng,y:t._southWest.lat},rightTop:{x:t._northEast.lng,y:t._northEast.lat}};P.value=JSON.stringify(i)}"Marker"===e.shape&&(J=e.layer,P.value=JSON.stringify(e.layer.toGeoJSON()),this.map.pm.disableDraw("Marker")),"Line"===e.shape&&(J=e.layer,P.value=JSON.stringify(e.layer.toGeoJSON())),"Polygon"===e.shape&&(J=e.layer,P.value=JSON.stringify(e.layer.toGeoJSON()))}),z.onclick=(()=>{this.viewModel.clearLayers()}),this._preventMapEvent(e,this.map),e},_creatInputBox(e,t){let i=ao().DomUtil.create("div","",t);return ao().DomUtil.create("span","",i).innerHTML=e.spanName,ao().DomUtil.create("input","",i).value=e.value,i}});ao().supermap={...e,Components:{...e.Components},...ao().supermap},ao().supermap.components=ao().supermap.components||{},ao().supermap.Components=ao().supermap.Components||{},ao().supermap.control=ao().supermap.control||{},ao().supermap.Util={},ao().Util.toGeoJSON=Oo,ao().supermap.Util.toGeoJSON=Oo,ao().Util.toSuperMapGeometry=Po,ao().supermap.Util.toSuperMapGeometry=Po,ao().Util.resolutionToScale=Io,ao().supermap.Util.resolutionToScale=Io,ao().Util.scaleToResolution=Fo,ao().supermap.Util.scaleToResolution=Fo,ao().Util.getMeterPerMapUnit=No,ao().supermap.Util.getMeterPerMapUnit=No,ao().Util.GetResolutionFromScaleDpi=Do,ao().supermap.Util.getResolutionFromScaleDpi=Do,ao().supermap.Util.GetResolutionFromScaleDpi=Do,ao().Util.NormalizeScale=ko,ao().supermap.Util.normalizeScale=ko,ao().supermap.Util.NormalizeScale=ko,ao().Util.transform=Ro,ao().supermap.Util.transform=Ro,ao().Proj=ao().Proj||{},ao().supermap.Proj=ao().supermap.Proj||{},ao().Proj.CRS=uo,ao().supermap.Proj.crs=uo,ao().supermap.Proj.CRS=ho,ao().Projection={},ao().supermap.Projection=ao().supermap.Projection||{},ao().Projection.NonProjection=To,ao().supermap.Projection.nonProjection=To,ao().supermap.Projection.NonProjection=Ao,ao().supermap.CRS=ao().supermap.CRS||{},ao().CRS.NonEarthCRS=Lo,ao().supermap.CRS.NonEarthCRS=Eo,ao().supermap.CRS.nonEarthCRS=Lo,ao().CRS.BaiduCRS=bo,ao().supermap.CRS.BaiduCRS=bo,ao().CRS.TianDiTu_WGS84CRS=So,ao().supermap.CRS.TianDiTu_WGS84CRS=So,ao().CRS.TianDiTu_MercatorCRS=Mo,ao().supermap.CRS.TianDiTu_MercatorCRS=Mo,ao().CRS.TianDiTu_Mercator=Mo,ao().supermap.CRS.TianDiTu_Mercator=Mo,ao().CRS.TianDiTu_WGS84=So,ao().supermap.CRS.TianDiTu_WGS84=So,ao().CRS.Baidu=bo,ao().supermap.CRS.Baidu=bo,ao().supermap.CommontypesConversion=vo,ao().supermap.components.clientComputationLayer=function(e){return new Pc(e)},ao().supermap.Components.ClientComputationLayer=Pc,ao().supermap.components.clientComputation=function(e){return new Oc(e)},ao().supermap.Components.ClientComputation=Oc,ao().supermap.components.clientComputationViewModel=function(e){return new Lc(e)},ao().supermap.Components.ClientComputationViewModel=Lc,ao().supermap.components.geoJSONLayerWithName=function(e,t){return new Ec(e,t)},ao().supermap.Components.GeoJSONLayerWithName=Ec,ao().supermap.components.GeoJsonLayersDataModel=xc,ao().supermap.Components.GeoJsonLayersDataModel=xc,ao().supermap.components.dataFlow=function(e){return new Tc(e)},ao().supermap.Components.DataFlow=Tc,ao().supermap.components.dataFlowViewModel=function(e){return new Ac(e)},ao().supermap.Components.DataFlowViewModel=Ac,ao().supermap.components.dataServiceQuery=function(e,t,i){return new Rc(e,t,i)},ao().supermap.Components.DataServiceQuery=Rc,ao().supermap.components.dataServiceQueryViewModel=Dc,ao().supermap.Components.DataServiceQueryViewModel=kc,ao().supermap.components.DistributedAnalysisModel=Nc,ao().supermap.Components.DistributedAnalysisModel=Nc,ao().supermap.components.distributedAnalysis=function(e){return new Fc(e)},ao().supermap.Components.DistributedAnalysis=Fc,ao().supermap.components.distributedAnalysisViewModel=function(e){return new Ic(e)},ao().supermap.Components.DistributedAnalysisViewModel=Ic,ao().supermap.components.openFile=function(e){return new Sc(e)},ao().supermap.Components.OpenFile=Sc,ao().supermap.components.openFileViewModel=function(e){return new _c(e)},ao().supermap.Components.OpenFileViewModel=_c,ao().supermap.components.search=function(e){return new Mc(e)},ao().supermap.Components.Search=Mc,ao().supermap.components.searchViewModel=function(e){return new Cc(e)},ao().supermap.Components.SearchViewModel=Cc,ao().supermap.components.componentsViewBase=function(e){return new bc(e)},ao().supermap.Components.ComponentsViewBase=bc,ao().supermap.control.changeTileVersion=function(e){return new mo(e)},ao().supermap.control.ChangeTileVersion=mo,ao().supermap.control.logo=function(e){return new yo(e)},ao().supermap.control.Logo=yo,ao().supermap.baiduTileLayer=Go,ao().supermap.BaiduTileLayer=Bo,ao().supermap.cloudTileLayer=jo,ao().supermap.CloudTileLayer=Uo,ao().supermap.imageMapLayer=function(e,t){return new zo(e,t)},ao().supermap.ImageMapLayer=zo,ao().supermap.imageTileLayer=function(e,t){return new dl(e,t)},ao().supermap.ImageTileLayer=dl,ao().supermap.tiandituTileLayer=function(e){return new qo(e)},ao().supermap.TiandituTileLayer=qo,ao().supermap.tiledMapLayer=Wo,ao().supermap.TiledMapLayer=Ho,ao().supermap.wmtsLayer=Jo,ao().supermap.WMTSLayer=Vo,ao().supermap.webmap=function(e,t){return new cl(e,t)},ao().supermap.WebMap=cl,ao().supermap.initMap=function(e,t){const i=(t=t||{}).mapOptions||{},r=t.layerOptions||{};return new Promise((t,s)=>{new fo(e).getMapInfo(async n=>{if("processCompleted"===n.type){const{prjCoordSys:s}=n.result,a=yl(s);fl(s)||await async function(e,t){if(!ml(t,!1)){const i=await async function(e){return new Promise((t,i)=>{new fo(e,{withoutFormatSuffix:!0}).getWkt(e=>{if("processCompleted"!==e.type)i();else{const i=e.result.data;t(i)}})})}(e);i&&lo().defs(t,i)}}(e,a);const o=function(e,t){const{bounds:i,center:r,scale:s,visibleScales:n,prjCoordSys:a,dpi:o,coordUnit:l}=e,{maxZoom:h=22}=t,u=An(n,i,o,l,h),c=pl({prjCoordSys:a,bounds:i,dpi:o,visibleScales:n,coordUnit:l},{maxZoom:h}),d=c.resolutions||u;return{crs:c,center:function(e,{center:t,bounds:i}){const r="string"==typeof e?e:e.code;return"number"!=typeof t.x&&"number"!=typeof t.y&&(t={lat:(i.bottom+i.top)/2,lng:(i.left+i.right)/2}),"EPSG:4326"===r?{lat:t.y,lng:t.x}:e.unproject(ao().point(t.x,t.y))}(c,{center:r,bounds:i}),zoom:function({scale:e,dpi:t,coordUnit:i},r){return function(e,t){let i,r=0;for(let s=0;s<t.length;s++)0===s&&(i=Math.abs(e-t[s])),i>Math.abs(e-t[s])&&(i=Math.abs(e-t[s]),r=s);return r}(Fo(e,t,i),r)}({scale:s,dpi:o,coordUnit:l},d),maxZoom:(p=u,p.length>0?p.length-1:22)};var p}(n.result,i),l=ao().map("map",{...o,...i}),h=new Ho(e,{...{noWrap:!0},...r});return h.addTo(l),void t({map:l,layer:h})}s()})})},ao().supermap.crsFromMapJSON=pl,ao().supermap.CartoCSSToLeaflet=el,ao().supermap.DefaultStyle=Qo,ao().supermap.CartoStyleMap=Zo,ao().supermap.ServerStyleMap=Ko,ao().supermap.CompOpMap=$o,ao().supermap.circleStyle=function(e){return new Ol(e)},ao().supermap.CircleStyle=Ol,ao().supermap.cloverStyle=function(e){return new Ll(e)},ao().supermap.CloverStyle=Ll,ao().supermap.graphic=function(e){return new tl(e)},ao().supermap.Graphic=tl,ao().supermap.imageStyle=function(e){return new Pl(e)},ao().supermap.ImageStyle=Pl,ao().supermap.themeFeature=function(e,t){return new il(e,t)},ao().supermap.ThemeFeature=il,ao().supermap.dataFlowLayer=function(e,t){return new wl(e,t)},ao().supermap.DataFlowLayer=wl,ao().supermap.echartsLayer=function(e,t){return new Cl(e,t)},ao().supermap.EchartsLayer=Cl,ao().supermap.graphicLayer=function(e,t){return new jl(e,t)},ao().supermap.GraphicLayer=jl,ao().supermap.graphThemeLayer=function(e,t,i){return new zl(e,t,i)},ao().supermap.GraphThemeLayer=zl,ao().supermap.heatMapFeature=function(e,t){return new mh(e,t)},ao().supermap.HeatMapFeature=mh,ao().supermap.heatMapLayer=function(e,t){return new yh(e,t)},ao().supermap.HeatMapLayer=yh,ao().supermap.labelThemeLayer=function(e,t){return new ol(e,t)},ao().supermap.LabelThemeLayer=ol,ao().supermap.mapVLayer=function(e,t,i){return new _l(e,t,i)},ao().supermap.MapVLayer=_l,ao().supermap.rangeThemeLayer=function(e,t){return new al(e,t)},ao().supermap.RangeThemeLayer=al,ao().supermap.rankSymbolThemeLayer=function(e,t,i){return new Vl(e,t,i)},ao().supermap.RankSymbolThemeLayer=Vl,ao().supermap.tiledVectorLayer=function(e,t){return new ch(e,t)},ao().supermap.TileVectorLayer=ch,ao().supermap.TiledVectorLayer=ch,ao().supermap.turfLayer=function(e){return new fh(e)},ao().supermap.TurfLayer=fh,ao().supermap.FGBLayer=Ku,ao().supermap.FGBLayer=function(e,t){return new Ku(e,t)},ao().supermap.unicodeMarker=function(e,t){return new ul(e,t)},ao().supermap.UnicodeMarker=ul,ao().supermap.uniqueThemeLayer=function(e,t){return new nl(e,t)},ao().supermap.UniqueThemeLayer=nl,ao().supermap.VectorTileFormat=lh,ao().supermap.addressMatchService=function(e,t){return new ec(e,t)},ao().supermap.AddressMatchService=ec,ao().supermap.chartService=function(e,t){return new tc(e,t)},ao().supermap.ChartService=tc,ao().supermap.dataFlowService=function(e,t){return new gl(e,t)},ao().supermap.DataFlowService=gl,ao().supermap.datasetService=function(e,t){return new ic(e,t)},ao().supermap.DatasetService=ic,ao().supermap.datasourceService=function(e,t){return new rc(e,t)},ao().supermap.DatasourceService=rc,ao().supermap.featureService=hl,ao().supermap.FeatureService=ll,ao().supermap.fieldService=function(e,t){return new sc(e,t)},ao().supermap.FieldService=sc,ao().supermap.geoprocessingService=function(e,t){return new ac(e,t)},ao().supermap.GeoprocessingService=ac,ao().supermap.gridCellInfosService=function(e,t){return new nc(e,t)},ao().supermap.GridCellInfosService=nc,ao().supermap.imageCollectionService=function(e,t){return new vc(e,t)},ao().supermap.ImageCollectionService=vc,ao().supermap.imageService=function(e,t){return new gc(e,t)},ao().supermap.ImageService=gc,ao().supermap.layerInfoService=function(e,t){return new oc(e,t)},ao().supermap.LayerInfoService=oc,ao().supermap.mapService=function(e,t){return new fo(e,t)},ao().supermap.MapService=fo,ao().supermap.measureService=function(e,t){return new lc(e,t)},ao().supermap.MeasureService=lc,ao().supermap.networkAnalyst3DService=function(e,t){return new hc(e,t)},ao().supermap.NetworkAnalyst3DService=hc,ao().supermap.networkAnalystService=function(e,t){return new uc(e,t)},ao().supermap.NetworkAnalystService=uc,ao().supermap.processingService=function(e,t){return new cc(e,t)},ao().supermap.ProcessingService=cc,ao().supermap.queryService=function(e,t){return new dc(e,t)},ao().supermap.QueryService=dc,ao().supermap.ServiceBase=po,ao().supermap.spatialAnalystService=function(e,t){return new pc(e,t)},ao().supermap.SpatialAnalystService=pc,ao().supermap.themeService=function(e,t){return new fc(e,t)},ao().supermap.ThemeService=fc,ao().supermap.trafficTransferAnalystService=function(e,t){return new mc(e,t)},ao().supermap.TrafficTransferAnalystService=mc,ao().supermap.webPrintingJobService=function(e,t){return new yc(e,t)},ao().supermap.WebPrintingJobService=yc,ao().supermap.KnowledgeGraphService=$u,ao().supermap.GraphMap=class extends ao().Evented{initialize(e,t){if(!e)return;this.graph=null,this.EVENT_TYPES=["loaded"];const i=e.split("/").pop();this.url=e.replace(`/graphmaps/${i}`,""),this.createGraphMap(i,t)}async createGraphMap(e,t){this.knowledgeGraphService=this.createKnowledgeGraphService(this.url,t);const i=await this.knowledgeGraphService.getGraphMapData(e),r=so.dataFromGraphMap(i.data,i.graphMap);this.graph=new so(t&&t.config),this.graph.on("beforelayout",()=>{this.fire(this.EVENT_TYPES[0])}),this.graph.setData(r),this.graph.handleNodeStatus(function(e){const{expand:t,collapse:i,hidden:r}=e.dataContent;return{expand:t&&JSON.parse(t),collapse:i&&JSON.parse(i),hidden:r&&JSON.parse(r)}}(i.graphMap))}createKnowledgeGraphService(e,t){return new $u(e,t)}},ao().supermap.CommonUtil=ee})(),(()=>{"use strict"})()})();
|