北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
ZhAkps
2024-02-06 f027164f4ee3f8a234f1a5dfd61eb3cceaa13fb7
1
2
3
4
5
6
7
8
/*!
 * 
 *          iclient-ol
 *          Copyright© 2000 - 2023 SuperMap Software Co.Ltd
 *          license: Apache-2.0
 *          version: v11.1.1
 *
 */(()=>{var e={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 r=this.map[e];r||(r=[],this.map[e]=r),r.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(r){this.map[r].forEach(function(i){e.call(t,i,r,this)},this)},this)};var r={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},i=["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(i,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 r=e.trim().split(":"),i=r.shift().trim(),s=r.join(":").trim();t.append(i,s)}),t}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;l||(l=!0,i(new f(r,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&&r.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,r){e.onload=function(){t(e.result)},e.onerror=function(){r(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(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.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,r,i,s,n,a,o=l(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,r=new FileReader,i=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",s=/charset\=[0-9a-zA-Z\-\_]*;?/,n=e.type.match(s)||i.match(s),a=[e],n&&a.push(n[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),h(r);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)},r.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(e,t){var r,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=(r=t.method||this.method||"GET",s=r.toUpperCase(),i.indexOf(s)>-1?s:r),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 r=e.split("="),i=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),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 r,i,s;i=[t,e],void 0===(s="function"==typeof(r=function(e,t){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function i(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||r.timeout,o=t.jsonpCallback||r.jsonpCallback,l=void 0;return new Promise(function(r,h){var u=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=o+"_"+u;window[u]=function(e){r({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),s(c),i(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")),i(u),s(c),window[u]=function(){i(u)}},a),d.onerror=function(){h(new Error("JSONP request to "+e+" failed")),i(u),s(c),l&&clearTimeout(l)}})}})?r.apply(t,i):r)||(e.exports=s)},186:e=>{var t=[],r=[],i="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(i);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,r[l]={}),void 0!==r[l]&&void 0!==r[l][a]?n=r[l][a]:(n=r[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},465:(e,t,r)=>{e=r.nmd(e);var i=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]",y="[object Set]",m="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",S="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",T="[object Uint16Array]",E="[object Uint32Array]",O=/\w*$/,P=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,N={};N[a]=N["[object Array]"]=N[v]=N[b]=N[o]=N[l]=N[S]=N[x]=N[_]=N[w]=N[C]=N[c]=N[d]=N[p]=N[f]=N[y]=N[m]=N[g]=N[A]=N[M]=N[T]=N[E]=!0,N["[object Error]"]=N[h]=N["[object WeakMap]"]=!1;var L="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,F=L||k||Function("return this")(),R=t&&!t.nodeType&&t,D=R&&e&&!e.nodeType&&e,G=D&&D.exports===R;function j(e,t){return e.set(t[0],t[1]),e}function B(e,t){return e.add(t),e}function U(e,t,r,i){var s=-1,n=e?e.length:0;for(i&&n&&(r=e[++s]);++s<n;)r=t(r,e[s],s,e);return r}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function J(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function z(e,t){return function(r){return e(t(r))}}function q(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var H=Array.prototype,W=Function.prototype,Y=Object.prototype,X=F["__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=G?F.Buffer:void 0,re=F.Symbol,ie=F.Uint8Array,se=z(Object.getPrototypeOf,Object),ne=Object.create,ae=Y.propertyIsEnumerable,oe=H.splice,le=Object.getOwnPropertySymbols,he=te?te.isBuffer:void 0,ue=z(Object.keys,Object),ce=Re(F,"DataView"),de=Re(F,"Map"),pe=Re(F,"Promise"),fe=Re(F,"Set"),ye=Re(F,"WeakMap"),me=Re(Object,"create"),ge=Ue(ce),ve=Ue(de),be=Ue(pe),Se=Ue(fe),xe=Ue(ye),_e=re?re.prototype:void 0,we=_e?_e.valueOf:void 0;function Ce(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Me(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Te(e){this.__data__=new Ae(e)}function Ee(e,t){var r=Je(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&ze(e)}(e)&&K.call(e,"callee")&&(!ae.call(e,"callee")||$.call(e)==a)}(e)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],i=r.length,s=!!i;for(var n in e)!t&&!K.call(e,n)||s&&("length"==n||je(n,i))||r.push(n);return r}function Oe(e,t,r){var i=e[t];K.call(e,t)&&Ve(i,r)&&(void 0!==r||t in e)||(e[t]=r)}function Pe(e,t){for(var r=e.length;r--;)if(Ve(e[r][0],t))return r;return-1}function Ie(e,t,r,i,s,n,P){var I;if(i&&(I=n?i(e,s,n,P):i(e)),void 0!==I)return I;if(!We(e))return e;var L=Je(e);if(L){if(I=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&K.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return function(e,t){var r=-1,i=e.length;t||(t=Array(i));for(;++r<i;)t[r]=e[r];return t}(e,I)}else{var k=Ge(e),F=k==h||k==u;if(qe(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(k==p||k==a||F&&!n){if(V(e))return n?e:{};if(I=function(e){return"function"!=typeof e.constructor||Be(e)?{}:(t=se(e),We(t)?ne(t):{});var t}(F?{}:e),!t)return function(e,t){return ke(e,De(e),t)}(e,function(e,t){return e&&ke(t,Ye(t),e)}(I,e))}else{if(!N[k])return n?e:{};I=function(e,t,r,i){var s=e.constructor;switch(t){case v:return Le(e);case o:case l:return new s(+e);case b:return function(e,t){var r=t?Le(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,i);case S:case x:case _:case w:case C:case A:case M:case T:case E:return function(e,t){var r=t?Le(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,i);case c:return function(e,t,r){return U(t?r(J(e),!0):J(e),j,new e.constructor)}(e,i,r);case d:case m:return new s(e);case f:return(h=new(a=e).constructor(a.source,O.exec(a))).lastIndex=a.lastIndex,h;case y:return function(e,t,r){return U(t?r(q(e),!0):q(e),B,new e.constructor)}(e,i,r);case g:return n=e,we?Object(we.call(n)):{}}var n;var a,h}(e,k,Ie,t)}}P||(P=new Te);var R=P.get(e);if(R)return R;if(P.set(e,I),!L)var D=r?function(e){return function(e,t,r){var i=t(e);return Je(e)?i:function(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}(i,r(e))}(e,Ye,De)}(e):Ye(e);return function(e,t){for(var r=-1,i=e?e.length:0;++r<i&&!1!==t(e[r],r,e););}(D||e,function(s,n){D&&(s=e[n=s]),Oe(I,n,Ie(s,t,r,i,n,e,P))}),I}function Ne(e){return!(!We(e)||Q&&Q in e)&&(He(e)||V(e)?ee:P).test(Ue(e))}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function ke(e,t,r,i){r||(r={});for(var s=-1,n=t.length;++s<n;){var a=t[s],o=i?i(r[a],e[a],a,r,e):void 0;Oe(r,a,void 0===o?e[a]:o)}return r}function Fe(e,t){var r,i,s=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof t?"string":"hash"]:s.map}function Re(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Ne(r)?r:void 0}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 r=t[e];return r===s?void 0:r}return K.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:K.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?s:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,r=Pe(t,e);return!(r<0||(r==t.length-1?t.pop():oe.call(t,r,1),0))},Ae.prototype.get=function(e){var t=this.__data__,r=Pe(t,e);return r<0?void 0:t[r][1]},Ae.prototype.has=function(e){return Pe(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var r=this.__data__,i=Pe(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},Me.prototype.clear=function(){this.__data__={hash:new Ce,map:new(de||Ae),string:new Ce}},Me.prototype.delete=function(e){return Fe(this,e).delete(e)},Me.prototype.get=function(e){return Fe(this,e).get(e)},Me.prototype.has=function(e){return Fe(this,e).has(e)},Me.prototype.set=function(e,t){return Fe(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Ae},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 r=this.__data__;if(r instanceof Ae){var s=r.__data__;if(!de||s.length<i-1)return s.push([e,t]),this;r=this.__data__=new Me(s)}return r.set(e,t),this};var De=le?z(le,Object):function(){return[]},Ge=function(e){return $.call(e)};function je(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||I.test(e))&&e>-1&&e%1==0&&e<t}function Be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function Ue(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ve(e,t){return e===t||e!=e&&t!=t}(ce&&Ge(new ce(new ArrayBuffer(1)))!=b||de&&Ge(new de)!=c||pe&&"[object Promise]"!=Ge(pe.resolve())||fe&&Ge(new fe)!=y||ye&&"[object WeakMap]"!=Ge(new ye))&&(Ge=function(e){var t=$.call(e),r=t==p?e.constructor:void 0,i=r?Ue(r):void 0;if(i)switch(i){case ge:return b;case ve:return c;case be:return"[object Promise]";case Se:return y;case xe:return"[object WeakMap]"}return t});var Je=Array.isArray;function ze(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 ze(e)?Ee(e):function(e){if(!Be(e))return ue(e);var t=[];for(var r in Object(e))K.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Ie(e,!0,!0)}},478:(e,t,r)=>{var i=200,s="__lodash_hash_undefined__",n=9007199254740991,a="[object Arguments]",o="[object Function]",l="[object GeneratorFunction]",h=/^\[object .+?Constructor\]$/,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=u||c||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,i){var s=e.length,n=r+(i?1:-1);for(;i?n--:++n<s;)if(t(e[n],n,e))return n;return-1}(e,m,r);var i=r-1,s=e.length;for(;++i<s;)if(e[i]===t)return i;return-1}(e,t,0)>-1}function f(e,t,r){for(var i=-1,s=e?e.length:0;++i<s;)if(r(t,e[i]))return!0;return!1}function y(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}function m(e){return e!=e}function g(e,t){return e.has(t)}var v=Array.prototype,b=Function.prototype,S=Object.prototype,x=d["__core-js_shared__"],_=function(){var e=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),w=b.toString,C=S.hasOwnProperty,A=S.toString,M=RegExp("^"+w.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=d.Symbol,E=S.propertyIsEnumerable,O=v.splice,P=T?T.isConcatSpreadable:void 0,I=Math.max,N=V(d,"Map"),L=V(Object,"create");function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function F(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function R(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function D(e){var t=-1,r=e?e.length:0;for(this.__data__=new R;++t<r;)this.add(e[t])}function G(e,t){for(var r,i,s=e.length;s--;)if((r=e[s][0])===(i=t)||r!=r&&i!=i)return s;return-1}function j(e,t,r,s){var n,a=-1,o=p,l=!0,h=e.length,u=[],c=t.length;if(!h)return u;r&&(t=function(e,t){for(var r=-1,i=e?e.length:0,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}(t,(n=r,function(e){return n(e)}))),s?(o=f,l=!1):t.length>=i&&(o=g,l=!1,t=new D(t));e:for(;++a<h;){var d=e[a],y=r?r(d):d;if(d=s||0!==d?d:0,l&&y==y){for(var m=c;m--;)if(t[m]===y)continue e;u.push(d)}else o(t,y,s)||u.push(d)}return u}function B(e){return!(!X(e)||_&&_ in e)&&(Y(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?M:h).test(function(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function U(e,t){var r,i,s=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof t?"string":"hash"]:s.map}function V(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return B(r)?r:void 0}function J(e){return q(e)||function(e){return W(e)&&C.call(e,"callee")&&(!E.call(e,"callee")||A.call(e)==a)}(e)||!!(P&&e&&e[P])}k.prototype.clear=function(){this.__data__=L?L(null):{}},k.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},k.prototype.get=function(e){var t=this.__data__;if(L){var r=t[e];return r===s?void 0:r}return C.call(t,e)?t[e]:void 0},k.prototype.has=function(e){var t=this.__data__;return L?void 0!==t[e]:C.call(t,e)},k.prototype.set=function(e,t){return this.__data__[e]=L&&void 0===t?s:t,this},F.prototype.clear=function(){this.__data__=[]},F.prototype.delete=function(e){var t=this.__data__,r=G(t,e);return!(r<0||(r==t.length-1?t.pop():O.call(t,r,1),0))},F.prototype.get=function(e){var t=this.__data__,r=G(t,e);return r<0?void 0:t[r][1]},F.prototype.has=function(e){return G(this.__data__,e)>-1},F.prototype.set=function(e,t){var r=this.__data__,i=G(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new k,map:new(N||F),string:new k}},R.prototype.delete=function(e){return U(this,e).delete(e)},R.prototype.get=function(e){return U(this,e).get(e)},R.prototype.has=function(e){return U(this,e).has(e)},R.prototype.set=function(e,t){return U(this,e).set(e,t),this},D.prototype.add=D.prototype.push=function(e){return this.__data__.set(e,s),this},D.prototype.has=function(e){return this.__data__.has(e)};var z=function(e,t){return t=I(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=I(r.length-t,0),n=Array(s);++i<s;)n[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n,function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(function(e,t){return W(e)?j(e,function e(t,r,i,s,n){var a=-1,o=t.length;for(i||(i=J),n||(n=[]);++a<o;){var l=t[a];r>0&&i(l)?r>1?e(l,r-1,i,s,n):y(n,l):s||(n[n.length]=l)}return n}(t,1,W,!0)):[]});var q=Array.isArray;function H(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Y(e)}function W(e){return function(e){return!!e&&"object"==typeof e}(e)&&H(e)}function Y(e){var t=X(e)?A.call(e):"";return t==o||t==l}function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=z},794:(e,t,r)=>{e=r.nmd(e);var i=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]",y="[object Function]",m="[object GeneratorFunction]",g="[object Map]",v="[object Number]",b="[object Object]",S="[object RegExp]",x="[object Set]",_="[object String]",w="[object Symbol]",C="[object ArrayBuffer]",A="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,E=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[u]=L[c]=L[C]=L[d]=L[A]=L[p]=L[f]=L[y]=L[g]=L[v]=L[b]=L[S]=L[x]=L[_]=L["[object WeakMap]"]=!1;var k="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,F="object"==typeof self&&self&&self.Object===Object&&self,R=k||F||Function("return this")(),D=t&&!t.nodeType&&t,G=D&&e&&!e.nodeType&&e,j=G&&G.exports===D&&k.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),U=B&&B.isTypedArray;function V(e,t){for(var r=-1,i=e?e.length:0;++r<i;)if(t(e[r],r,e))return!0;return!1}function J(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function z(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function q(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var H=Array.prototype,W=Function.prototype,Y=Object.prototype,X=R["__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=R.Symbol,re=R.Uint8Array,ie=Y.propertyIsEnumerable,se=H.splice,ne=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),ae=Re(R,"DataView"),oe=Re(R,"Map"),le=Re(R,"Promise"),he=Re(R,"Set"),ue=Re(R,"WeakMap"),ce=Re(Object,"create"),de=qe(ae),pe=qe(oe),fe=qe(le),ye=qe(he),me=qe(ue),ge=te?te.prototype:void 0,ve=ge?ge.valueOf:void 0,be=ge?ge.toString:void 0;function Se(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function xe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function _e(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function we(e){var t=-1,r=e?e.length:0;for(this.__data__=new _e;++t<r;)this.add(e[t])}function Ce(e){this.__data__=new xe(e)}function Ae(e,t){var r=Qe(e)||Xe(e)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],i=r.length,s=!!i;for(var n in e)!t&&!K.call(e,n)||s&&("length"==n||Ge(n,i))||r.push(n);return r}function Me(e,t){for(var r=e.length;r--;)if(Ye(e[r][0],t))return r;return-1}function Te(e,t){for(var r=0,i=(t=je(t,e)?[t]:Le(t)).length;null!=e&&r<i;)e=e[ze(t[r++])];return r&&r==i?e:void 0}function Ee(e,t){return null!=e&&t in Object(e)}function Oe(e,t,r,i,s){return e===t||(null==e||null==t||!et(e)&&!tt(t)?e!=e&&t!=t:function(e,t,r,i,s,n){var l=Qe(e),h=Qe(t),y=c,m=c;l||(y=(y=De(e))==u?b:y);h||(m=(m=De(t))==u?b:m);var M=y==b&&!J(e),T=m==b&&!J(t),E=y==m;if(E&&!M)return n||(n=new Ce),l||it(e)?ke(e,t,r,i,s,n):function(e,t,r,i,s,n,l){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C:return!(e.byteLength!=t.byteLength||!i(new re(e),new re(t)));case d:case p:case v:return Ye(+e,+t);case f:return e.name==t.name&&e.message==t.message;case S:case _:return e==t+"";case g:var h=z;case x:var u=n&o;if(h||(h=q),e.size!=t.size&&!u)return!1;var c=l.get(e);if(c)return c==t;n|=a,l.set(e,t);var y=ke(h(e),h(t),i,s,n,l);return l.delete(e),y;case w:if(ve)return ve.call(e)==ve.call(t)}return!1}(e,t,y,r,i,s,n);if(!(s&o)){var O=M&&K.call(e,"__wrapped__"),P=T&&K.call(t,"__wrapped__");if(O||P){var I=O?e.value():e,N=P?t.value():t;return n||(n=new Ce),r(I,N,i,s,n)}}if(!E)return!1;return n||(n=new Ce),function(e,t,r,i,s,n){var a=s&o,l=st(e),h=l.length,u=st(t).length;if(h!=u&&!a)return!1;for(var c=h;c--;){var d=l[c];if(!(a?d in t:K.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 y=a;++c<h;){d=l[c];var m=e[d],g=t[d];if(i)var v=a?i(g,m,d,t,e,n):i(m,g,d,e,t,n);if(!(void 0===v?m===g||r(m,g,i,s,n):v)){f=!1;break}y||(y="constructor"==d)}if(f&&!y){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof S&&S instanceof S)&&(f=!1)}return n.delete(e),n.delete(t),f}(e,t,r,i,s,n)}(e,t,Oe,r,i,s))}function Pe(e){return!(!et(e)||Q&&Q in e)&&(Ke(e)||J(e)?ee:I).test(qe(e))}function Ie(e){return"function"==typeof e?e:null==e?nt:"object"==typeof e?Qe(e)?function(e,t){if(je(e)&&Be(t))return Ue(ze(e),t);return function(r){var i=function(e,t,r){var i=null==e?void 0:Te(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?function(e,t){return null!=e&&function(e,t,r){var i,s=-1,n=(t=je(t,e)?[t]:Le(t)).length;for(;++s<n;){var a=ze(t[s]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}if(i)return i;return!!(n=e?e.length:0)&&$e(n)&&Ge(a,n)&&(Qe(e)||Xe(e))}(e,t,Ee)}(r,e):Oe(t,i,void 0,a|o)}}(e[0],e[1]):function(e){var t=function(e){var t=st(e),r=t.length;for(;r--;){var i=t[r],s=e[i];t[r]=[i,s,Be(s)]}return t}(e);if(1==t.length&&t[0][2])return Ue(t[0][0],t[0][1]);return function(r){return r===e||function(e,t,r,i){var s=r.length,n=s,l=!i;if(null==e)return!n;for(e=Object(e);s--;){var h=r[s];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++s<n;){var u=(h=r[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 Ce;if(i)var f=i(c,d,u,e,t,p);if(!(void 0===f?Oe(d,c,i,a|o,p):f))return!1}}return!0}(r,e,t)}}(e):je(t=e)?(r=ze(t),function(e){return null==e?void 0:e[r]}):function(e){return function(t){return Te(t,e)}}(t);var t,r}function Ne(e){if(r=(t=e)&&t.constructor,i="function"==typeof r&&r.prototype||Y,t!==i)return ne(e);var t,r,i,s=[];for(var n in Object(e))K.call(e,n)&&"constructor"!=n&&s.push(n);return s}function Le(e){return Qe(e)?e:Je(e)}function ke(e,t,r,i,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 we:void 0;for(n.set(e,t),n.set(t,e);++d<h;){var y=e[d],m=t[d];if(i)var g=l?i(m,y,d,t,e,n):i(y,m,d,e,t,n);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!V(t,function(e,t){if(!f.has(t)&&(y===e||r(y,e,i,s,n)))return f.add(t)})){p=!1;break}}else if(y!==m&&!r(y,m,i,s,n)){p=!1;break}}return n.delete(e),n.delete(t),p}function Fe(e,t){var r,i,s=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof t?"string":"hash"]:s.map}function Re(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Pe(r)?r:void 0}Se.prototype.clear=function(){this.__data__=ce?ce(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(ce){var r=t[e];return r===n?void 0:r}return K.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return ce?void 0!==t[e]:K.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=ce&&void 0===t?n:t,this},xe.prototype.clear=function(){this.__data__=[]},xe.prototype.delete=function(e){var t=this.__data__,r=Me(t,e);return!(r<0||(r==t.length-1?t.pop():se.call(t,r,1),0))},xe.prototype.get=function(e){var t=this.__data__,r=Me(t,e);return r<0?void 0:t[r][1]},xe.prototype.has=function(e){return Me(this.__data__,e)>-1},xe.prototype.set=function(e,t){var r=this.__data__,i=Me(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new Se,map:new(oe||xe),string:new Se}},_e.prototype.delete=function(e){return Fe(this,e).delete(e)},_e.prototype.get=function(e){return Fe(this,e).get(e)},_e.prototype.has=function(e){return Fe(this,e).has(e)},_e.prototype.set=function(e,t){return Fe(this,e).set(e,t),this},we.prototype.add=we.prototype.push=function(e){return this.__data__.set(e,n),this},we.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.clear=function(){this.__data__=new xe},Ce.prototype.delete=function(e){return this.__data__.delete(e)},Ce.prototype.get=function(e){return this.__data__.get(e)},Ce.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xe){var s=r.__data__;if(!oe||s.length<i-1)return s.push([e,t]),this;r=this.__data__=new _e(s)}return r.set(e,t),this};var De=function(e){return $.call(e)};function Ge(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(Qe(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!rt(e))||(T.test(e)||!M.test(e)||null!=t&&e in Object(t))}function Be(e){return e==e&&!et(e)}function Ue(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function Ve(e,t){return 1==t.length?e:Te(e,function(e,t,r){var i=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(r=r>s?s:r)<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(s);++i<s;)n[i]=e[i+t];return n}(t,0,-1))}(ae&&De(new ae(new ArrayBuffer(1)))!=A||oe&&De(new oe)!=g||le&&"[object Promise]"!=De(le.resolve())||he&&De(new he)!=x||ue&&"[object WeakMap]"!=De(new ue))&&(De=function(e){var t=$.call(e),r=t==b?e.constructor:void 0,i=r?qe(r):void 0;if(i)switch(i){case de:return A;case pe:return g;case fe:return"[object Promise]";case ye:return x;case me:return"[object WeakMap]"}return t});var Je=We(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(rt(e))return be?be.call(e):"";var t=e+"";return"0"==t&&1/e==-l?"-0":t}(t);var r=[];return E.test(e)&&r.push(""),e.replace(O,function(e,t,i,s){r.push(i?s.replace(P,"$1"):t||e)}),r});function ze(e){if("string"==typeof e||rt(e))return e;var t=e+"";return"0"==t&&1/e==-l?"-0":t}function qe(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function He(e){var t=e?e.length:0;return t?e[t-1]:void 0}function We(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(s);var r=function(){var i=arguments,s=t?t.apply(this,i):i[0],n=r.cache;if(n.has(s))return n.get(s);var a=e.apply(this,i);return r.cache=n.set(s,a),a};return r.cache=new(We.Cache||_e),r}function Ye(e,t){return e===t||e!=e&&t!=t}function Xe(e){return function(e){return tt(e)&&Ze(e)}(e)&&K.call(e,"callee")&&(!ie.call(e,"callee")||$.call(e)==u)}We.Cache=_e;var Qe=Array.isArray;function Ze(e){return null!=e&&$e(e.length)&&!Ke(e)}function Ke(e){var t=et(e)?$.call(e):"";return t==y||t==m}function $e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function et(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function tt(e){return!!e&&"object"==typeof e}function rt(e){return"symbol"==typeof e||tt(e)&&$.call(e)==w}var it=U?function(e){return function(t){return e(t)}}(U):function(e){return tt(e)&&$e(e.length)&&!!L[$.call(e)]};function st(e){return Ze(e)?Ae(e):Ne(e)}function nt(e){return e}e.exports=function(e,t){var r=[];if(!e||!e.length)return r;var i=-1,s=[],n=e.length;for(t=Ie(t);++i<n;){var a=e[i];t(a,i,e)&&(r.push(a),s.push(i))}return function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var s=t[r];if(r==i||s!==n){var n=s;if(Ge(s))se.call(e,s,1);else if(je(s,e))delete e[ze(s)];else{var a=Le(s),o=Ve(e,a);null!=o&&delete o[ze(He(a))]}}}}(e,s),r}},52:(e,t,r)=>{var i=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 r.g&&r.g&&r.g.Object===Object&&r.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 r=-1,i=e?e.length:0,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}(t,function(t){return[t,e[t]]})}var y=Function.prototype,m=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=y.toString,S=m.hasOwnProperty,x=m.toString,_=RegExp("^"+b.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=m.propertyIsEnumerable,C=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),A=G(p,"DataView"),M=G(p,"Map"),T=G(p,"Promise"),E=G(p,"Set"),O=G(p,"WeakMap"),P=U(A),I=U(M),N=U(T),L=U(E),k=U(O);function F(e,t){var r=V(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&J(e)}(e)&&S.call(e,"callee")&&(!w.call(e,"callee")||x.call(e)==s)}(e)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],i=r.length,n=!!i;for(var a in e)!t&&!S.call(e,a)||n&&("length"==a||B(a,i))||r.push(a);return r}function R(e){return!(!q(e)||v&&v in e)&&(z(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?_:h).test(U(e))}function D(e){if(r=(t=e)&&t.constructor,i="function"==typeof r&&r.prototype||m,t!==i)return C(e);var t,r,i,s=[];for(var n in Object(e))S.call(e,n)&&"constructor"!=n&&s.push(n);return s}function G(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return R(r)?r:void 0}var j=function(e){return x.call(e)};function B(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function U(e){if(null!=e){try{return b.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(A&&"[object DataView]"!=j(new A(new ArrayBuffer(1)))||M&&j(new M)!=o||T&&"[object Promise]"!=j(T.resolve())||E&&j(new E)!=l||O&&"[object WeakMap]"!=j(new O))&&(j=function(e){var t=x.call(e),r="[object Object]"==t?e.constructor:void 0,i=r?U(r):void 0;if(i)switch(i){case P:return"[object DataView]";case I:return o;case N:return"[object Promise]";case L:return l;case k:return"[object WeakMap]"}return t});var V=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!z(e)}function z(e){var t=q(e)?x.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 r,i,s,n=j(t);return n==o?(r=t,i=-1,s=Array(r.size),r.forEach(function(e,t){s[++i]=[t,e]}),s):n==l?function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}(t):f(t,e(t))}}(function(e){return J(e)?F(e):D(e)});e.exports=H},618:(e,t,r)=>{e=r.nmd(e);var i=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]",y="[object Function]",m="[object GeneratorFunction]",g="[object Map]",v="[object Number]",b="[object Object]",S="[object RegExp]",x="[object Set]",_="[object String]",w="[object Symbol]",C="[object ArrayBuffer]",A="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,E=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[u]=L[c]=L[C]=L[d]=L[A]=L[p]=L[f]=L[y]=L[g]=L[v]=L[b]=L[S]=L[x]=L[_]=L["[object WeakMap]"]=!1;var k="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,F="object"==typeof self&&self&&self.Object===Object&&self,R=k||F||Function("return this")(),D=t&&!t.nodeType&&t,G=D&&e&&!e.nodeType&&e,j=G&&G.exports===D&&k.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),U=B&&B.isTypedArray;function V(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,i){var s=e.length,n=r+(i?1:-1);for(;i?n--:++n<s;)if(t(e[n],n,e))return n;return-1}(e,q,r);var i=r-1,s=e.length;for(;++i<s;)if(e[i]===t)return i;return-1}(e,t,0)>-1}function J(e,t,r){for(var i=-1,s=e?e.length:0;++i<s;)if(r(t,e[i]))return!0;return!1}function z(e,t){for(var r=-1,i=e?e.length:0;++r<i;)if(t(e[r],r,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,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function X(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var Q=Array.prototype,Z=Function.prototype,K=Object.prototype,$=R["__core-js_shared__"],ee=function(){var e=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),te=Z.toString,re=K.hasOwnProperty,ie=K.toString,se=RegExp("^"+te.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=R.Symbol,ae=R.Uint8Array,oe=K.propertyIsEnumerable,le=Q.splice,he=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),ue=Ue(R,"DataView"),ce=Ue(R,"Map"),de=Ue(R,"Promise"),pe=Ue(R,"Set"),fe=Ue(R,"WeakMap"),ye=Ue(Object,"create"),me=Xe(ue),ge=Xe(ce),ve=Xe(de),be=Xe(pe),Se=Xe(fe),xe=ne?ne.prototype:void 0,_e=xe?xe.valueOf:void 0,we=xe?xe.toString:void 0;function Ce(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Me(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Te(e){var t=-1,r=e?e.length:0;for(this.__data__=new Me;++t<r;)this.add(e[t])}function Ee(e){this.__data__=new Ae(e)}function Oe(e,t){var r=$e(e)||Ke(e)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],i=r.length,s=!!i;for(var n in e)!t&&!re.call(e,n)||s&&("length"==n||Je(n,i))||r.push(n);return r}function Pe(e,t){for(var r=e.length;r--;)if(Ze(e[r][0],t))return r;return-1}function Ie(e,t){for(var r=0,i=(t=ze(t,e)?[t]:De(t)).length;null!=e&&r<i;)e=e[Ye(t[r++])];return r&&r==i?e:void 0}function Ne(e,t){return null!=e&&t in Object(e)}function Le(e,t,r,i,s){return e===t||(null==e||null==t||!it(e)&&!st(t)?e!=e&&t!=t:function(e,t,r,i,s,n){var l=$e(e),h=$e(t),y=c,m=c;l||(y=(y=Ve(e))==u?b:y);h||(m=(m=Ve(t))==u?b:m);var M=y==b&&!W(e),T=m==b&&!W(t),E=y==m;if(E&&!M)return n||(n=new Ee),l||at(e)?je(e,t,r,i,s,n):function(e,t,r,i,s,n,l){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C:return!(e.byteLength!=t.byteLength||!i(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 S:case _:return e==t+"";case g:var h=Y;case x: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 y=je(h(e),h(t),i,s,n,l);return l.delete(e),y;case w:if(_e)return _e.call(e)==_e.call(t)}return!1}(e,t,y,r,i,s,n);if(!(s&o)){var O=M&&re.call(e,"__wrapped__"),P=T&&re.call(t,"__wrapped__");if(O||P){var I=O?e.value():e,N=P?t.value():t;return n||(n=new Ee),r(I,N,i,s,n)}}if(!E)return!1;return n||(n=new Ee),function(e,t,r,i,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:re.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 y=a;++c<h;){d=l[c];var m=e[d],g=t[d];if(i)var v=a?i(g,m,d,t,e,n):i(m,g,d,e,t,n);if(!(void 0===v?m===g||r(m,g,i,s,n):v)){f=!1;break}y||(y="constructor"==d)}if(f&&!y){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof S&&S instanceof S)&&(f=!1)}return n.delete(e),n.delete(t),f}(e,t,r,i,s,n)}(e,t,Le,r,i,s))}function ke(e){return!(!it(e)||ee&&ee in e)&&(tt(e)||W(e)?se:I).test(Xe(e))}function Fe(e){return"function"==typeof e?e:null==e?lt:"object"==typeof e?$e(e)?function(e,t){if(ze(e)&&qe(t))return He(Ye(e),t);return function(r){var i=function(e,t,r){var i=null==e?void 0:Ie(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?function(e,t){return null!=e&&function(e,t,r){var i,s=-1,n=(t=ze(t,e)?[t]:De(t)).length;for(;++s<n;){var a=Ye(t[s]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}if(i)return i;return!!(n=e?e.length:0)&&rt(n)&&Je(a,n)&&($e(e)||Ke(e))}(e,t,Ne)}(r,e):Le(t,i,void 0,a|o)}}(e[0],e[1]):function(e){var t=function(e){var t=ot(e),r=t.length;for(;r--;){var i=t[r],s=e[i];t[r]=[i,s,qe(s)]}return t}(e);if(1==t.length&&t[0][2])return He(t[0][0],t[0][1]);return function(r){return r===e||function(e,t,r,i){var s=r.length,n=s,l=!i;if(null==e)return!n;for(e=Object(e);s--;){var h=r[s];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++s<n;){var u=(h=r[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(i)var f=i(c,d,u,e,t,p);if(!(void 0===f?Le(d,c,i,a|o,p):f))return!1}}return!0}(r,e,t)}}(e):ze(t=e)?(r=Ye(t),function(e){return null==e?void 0:e[r]}):function(e){return function(t){return Ie(t,e)}}(t);var t,r}function Re(e){if(r=(t=e)&&t.constructor,i="function"==typeof r&&r.prototype||K,t!==i)return he(e);var t,r,i,s=[];for(var n in Object(e))re.call(e,n)&&"constructor"!=n&&s.push(n);return s}function De(e){return $e(e)?e:We(e)}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 r=t[e];return r===n?void 0:r}return re.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:re.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?n:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,r=Pe(t,e);return!(r<0||(r==t.length-1?t.pop():le.call(t,r,1),0))},Ae.prototype.get=function(e){var t=this.__data__,r=Pe(t,e);return r<0?void 0:t[r][1]},Ae.prototype.has=function(e){return Pe(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var r=this.__data__,i=Pe(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},Me.prototype.clear=function(){this.__data__={hash:new Ce,map:new(ce||Ae),string:new Ce}},Me.prototype.delete=function(e){return Be(this,e).delete(e)},Me.prototype.get=function(e){return Be(this,e).get(e)},Me.prototype.has=function(e){return Be(this,e).has(e)},Me.prototype.set=function(e,t){return Be(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 Ae},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 r=this.__data__;if(r instanceof Ae){var s=r.__data__;if(!ce||s.length<i-1)return s.push([e,t]),this;r=this.__data__=new Me(s)}return r.set(e,t),this};var Ge=pe&&1/X(new pe([,-0]))[1]==l?function(e){return new pe(e)}:function(){};function je(e,t,r,i,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 y=e[d],m=t[d];if(i)var g=l?i(m,y,d,t,e,n):i(y,m,d,e,t,n);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!z(t,function(e,t){if(!f.has(t)&&(y===e||r(y,e,i,s,n)))return f.add(t)})){p=!1;break}}else if(y!==m&&!r(y,m,i,s,n)){p=!1;break}}return n.delete(e),n.delete(t),p}function Be(e,t){var r,i,s=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof t?"string":"hash"]:s.map}function Ue(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ke(r)?r:void 0}var Ve=function(e){return ie.call(e)};function Je(e,t){return!!(t=null==t?h:t)&&("number"==typeof e||N.test(e))&&e>-1&&e%1==0&&e<t}function ze(e,t){if($e(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!nt(e))||(T.test(e)||!M.test(e)||null!=t&&e in Object(t))}function qe(e){return e==e&&!it(e)}function He(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}(ue&&Ve(new ue(new ArrayBuffer(1)))!=A||ce&&Ve(new ce)!=g||de&&"[object Promise]"!=Ve(de.resolve())||pe&&Ve(new pe)!=x||fe&&"[object WeakMap]"!=Ve(new fe))&&(Ve=function(e){var t=ie.call(e),r=t==b?e.constructor:void 0,i=r?Xe(r):void 0;if(i)switch(i){case me:return A;case ge:return g;case ve:return"[object Promise]";case be:return x;case Se: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 r=[];return E.test(e)&&r.push(""),e.replace(O,function(e,t,i,s){r.push(i?s.replace(P,"$1"):t||e)}),r});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 r=function(){var i=arguments,s=t?t.apply(this,i):i[0],n=r.cache;if(n.has(s))return n.get(s);var a=e.apply(this,i);return r.cache=n.set(s,a),a};return r.cache=new(Qe.Cache||Me),r}function Ze(e,t){return e===t||e!=e&&t!=t}function Ke(e){return function(e){return st(e)&&et(e)}(e)&&re.call(e,"callee")&&(!oe.call(e,"callee")||ie.call(e)==u)}Qe.Cache=Me;var $e=Array.isArray;function et(e){return null!=e&&rt(e.length)&&!tt(e)}function tt(e){var t=it(e)?ie.call(e):"";return t==y||t==m}function rt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function it(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)&&ie.call(e)==w}var at=U?function(e){return function(t){return e(t)}}(U):function(e){return st(e)&&rt(e.length)&&!!L[ie.call(e)]};function ot(e){return et(e)?Oe(e):Re(e)}function lt(e){return e}e.exports=function(e,t){return e&&e.length?function(e,t,r){var s=-1,n=V,a=e.length,o=!0,l=[],h=l;if(r)o=!1,n=J;else if(a>=i){var u=t?null:Ge(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=r||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,r)||(h!==l&&h.push(d),l.push(c))}return l}(e,Fe(t)):[]}},107:function(e,t,r){!function(){"use strict";function e(e){var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){return t.reject(r)})})}function t(e){return new this(function(t,r){if(!e||void 0===e.length)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var s=i.length;function n(e,r){if(r&&("object"==typeof r||"function"==typeof r)){var a=r.then;if("function"==typeof a)return void a.call(r,function(t){n(e,t)},function(r){i[e]={status:"rejected",reason:r},0==--s&&t(i)})}i[e]={status:"fulfilled",value:r},0==--s&&t(i)}for(var a=0;a<i.length;a++)n(a,i[a])})}var i=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 r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var i;try{i=r(e._value)}catch(e){return void h(t.promise,e)}l(t.promise,i)}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 r=t.then;if(t instanceof a)return e._state=3,e._value=t,void u(e);if("function"==typeof r)return void c((i=r,s=t,function(){i.apply(s,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){h(e,t)}var i,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,r=e._deferreds.length;t<r;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t){var r=!1;try{e(function(e){r||(r=!0,l(t,e))},function(e){r||(r=!0,h(t,e))})}catch(e){if(r)return;r=!0,h(t,e)}}a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new function(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}(e,t,r)),r},a.prototype.finally=e,a.all=function(e){return new a(function(t,r){if(!s(e))return r(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var n=i.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)},r)}i[e]=s,0==--n&&t(i)}catch(e){r(e)}}for(var o=0;o<i.length;o++)a(o,i[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,r){r(e)})},a.race=function(e){return new a(function(t,r){if(!s(e))return r(new TypeError("Promise.race accepts an array"));for(var i=0,n=e.length;i<n;i++)a.resolve(e[i]).then(t,r)})},a._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){i(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!==r.g)return r.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))}()}},t={};function r(i){var s=t[i];if(void 0!==s)return s.exports;var n=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}),r.d=((e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),r.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"},i={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"},y={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"},m={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"},S={FLAT:"FLAT",ROUND:"ROUND"},x={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"},_={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},w={BSPLINE:"BSPLINE",POLISH:"POLISH"},C={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"},A={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"},M={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"},I={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"},N={CLIP:"clip",INTERSECT:"intersect"},L={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"},F={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},R={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},D={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"},G={GEOHASH_GRID:"geohash_grid"},j={AVG:"avg",MAX:"max",MIN:"min",SUM:"sum"},B={NDVI:"NDVI",HILLSHADE:"HILLSHADE"},U={CUSTOM:"CUSTOM",INTERSECTION:"INTERSECTION",UNION:"UNION"},V={CUSTOM:"CUSTOM",MAX:"MAX",MIN:"MIN"};class J{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 J(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 z{constructor(e,t,r){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=r,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new z(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 z(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}}z.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var q=function(...e){class t{constructor(t){for(var r=0;r<e.length;r++)s(this,new e[r](t))}}for(var r=0;r<e.length;r++){var i=e[r];s(t,i),s(t.prototype,i.prototype),s(t.prototype,new i)}return t;function s(e,t){var r=Object.getOwnPropertyNames(t);Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i++){var s=r[i];if("constructor"!==s&&"prototype"!==s&&"name"!==s&&"length"!==s){let r=Object.getOwnPropertyDescriptor(t,s);window.ActiveXObject?Object.defineProperty(e,s,r||{}):Object.defineProperty(e,s,r)}}}},H={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("-"),r=t[0],i=1,s=t.length;i<s;i++){var n=t[i];r+=n.charAt(0).toUpperCase()+n.substring(1)}return r},format:function(e,t,r){t||(t=window);return e.replace(H.tokenRegEx,function(e,i){for(var s,n=i.split(/\.+/),a=0;a<n.length;a++)0==a&&(s=t),s=s[n[a]];return"function"==typeof s&&(s=r?s.apply(null,r):s()),void 0===s?"undefined":s})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(e){return H.numberRegEx.test(e)},numericIf:function(e){return H.isNumeric(e)?parseFloat(e):e}},W={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,t){var r=0;return t>0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,t,r,i){t=void 0!==t?t:0,r=void 0!==r?r:W.thousandsSeparator,i=void 0!==i?i:W.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(r)for(var o=/(-?[0-9]+)([0-9]{3})/;o.test(a);)a=a.replace(o,"$1"+r+"$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+i+l}return n}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return W.limitSigDigs(this,e)});var Y={bind:function(e,t){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var i=r.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,i)}},bindAsEventListener:function(e,t){return function(r){return e.call(t,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},X={filter:function(e,t,r){var i=[];if(Array.prototype.filter)i=e.filter(t,r);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(r,a,n,e)&&i.push(a)}}return i}};class Q{constructor(){this.CLASS_NAME="SuperMap.Geometry",this.id=te.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 Q}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 Z=function(){var e,t="",r="",i="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.]+)/)),r=e?e[1]:"",s.indexOf("ipad")>-1||s.indexOf("ipod")>-1||s.indexOf("iphone")>-1?i="apple":s.indexOf("android")>-1&&(r=(e=s.match(/version\/([\d.]+)/))?e[1]:"",i="android"),{name:t,version:r,device:i}}(),K=function(){var e=!0,t=Z;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}(),$=function(){var e=navigator.userAgent.toLowerCase();return-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")}(),ee=96,te={assign(e){for(var t=0;t<Object.getOwnPropertyNames(arguments).length;t++){var r=Object.getOwnPropertyNames(arguments)[t];if("caller"!=r&&"callee"!=r&&"length"!=r&&"arguments"!=r){var i=arguments[r];if(i)for(var s=0;s<Object.getOwnPropertyNames(i).length;s++){var n=Object.getOwnPropertyNames(i)[s];"caller"!=r&&"callee"!=r&&"length"!=r&&"arguments"!=r&&(e[n]=i[n])}}}return e},extend:function(e,t){if(e=e||{},t){for(var r in t){var i=t[r];void 0!==i&&(e[r]=i)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},copy:function(e,t){var r;if(e=e||{},t)for(var i in e)void 0!==(r=t[i])&&(e[i]=r)},reset:function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"==typeof e[t]&&e[t]instanceof Array){for(var r in e[t])e[t][r].destroy&&e[t][r].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,r=arguments.length;t<r;t++){var i=arguments[t];if("string"==typeof i&&(i=document.getElementById(i)),1===arguments.length)return i;e.push(i)}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 r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},modifyDOMElement:function(e,t,r,i,s,n,a,o){t&&(e.id=t),r&&(e.style.left=r.x+"px",e.style.top=r.y+"px"),i&&(e.style.width=i.w+"px",e.style.height=i.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 r="function"==typeof window.Event&&t instanceof window.Event;for(var i in t)(void 0===e[i]||!r&&t.hasOwnProperty&&t.hasOwnProperty(i)&&!e.hasOwnProperty(i))&&(e[i]=t[i]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var r in e){var i,s=e[r];if(null!=s&&"function"!=typeof s)i=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(r)+"="+i)}return t.join("&")},urlAppend:function(e,t){var r=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var i=(e+" ").split(/[?&]/);r+=" "===i.pop()?t:i.length?"&"+t:"?"+t}return r},urlPathAppend:function(e,t){let r=e;if(!t)return r;0===t.indexOf("/")&&(t=t.substring(1));const i=e.split("?");return i[0].indexOf("/",i[0].length-1)<0&&(i[0]+="/"),r=`${i[0]}${t}${i.length>1?`?${i[1]}`:""}`},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=te.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(H.contains(e,"?")){var r=e.indexOf("?")+1,i=H.contains(e,"#")?e.indexOf("#"):e.length;t=e.substring(r,i)}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_"),te.lastSeqID+=1,e+te.lastSeqID},normalizeScale:function(e){return e>1?1/e:e},getResolutionFromScale:function(e,t){var r;e&&(null==t&&(t="degrees"),r=1/(te.normalizeScale(e)*re[t]*ee));return r},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*re[t]*ee},getBrowser:function(){return Z},isSupportCanvas:K,supportCanvas:function(){return te.isSupportCanvas},isInTheSameDomain:function(e){if(!e)return!0;var t=e.indexOf("//"),r=document.location.toString(),i=r.indexOf("//");if(-1===t)return!0;var s,n=s=e.substring(0,t),a=r.substring(i+2);i=a.indexOf("/");var o=a.indexOf(":"),l=a.substring(0,i),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,r,i,s){if(e&&t&&r){var n,a=e.getWidth(),o=e.getHeight(),l=t.w,h=t.h;if(s=s||6378137,"degree"===(i=i||"degrees").toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()){let e=a/l,t=o/h;n=254/(e>t?e:t)/r/(2*Math.PI*s/360)/1e4}else{n=254/(a/l)/r/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("<","&lt;")).replace(">","&gt;")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",i=0,s=t.length;i<s;i++)r+=te.toJSON(t[i]),i!==t.length-1&&(r+=",");return"["+r+"]";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 r=0,i=t.length;r<i;r++)e.push(te.toJSON(t[r]));return"["+e.join(",")+"]"}let e=[];for(let r in t)"function"!=typeof t[r]&&"CLASS_NAME"!==r&&"parent"!==r&&e.push("'"+r+"':"+te.toJSON(t[r]));return e.length>0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,r,i){return i=i||6378137,r=r||"",e>0&&t>0?(e=te.normalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*i/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,r,i){return i=i||6378137,r=r||"",e>0&&t>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*i/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 r in t){var i=t[r];void 0!==i&&"CLASS_NAME"!==r&&"function"!=typeof i&&(e[r]=i)}return e},copyAttributesWithClip:function(e,t,r){if(e=e||{},t)for(var i in t){var s=!1;if(r&&r.length)for(var n=0,a=r.length;n<a;n++)if(i===r[n]){s=!0;break}if(!0!==s){var o=t[i];void 0!==o&&"CLASS_NAME"!==i&&"function"!=typeof o&&(e[i]=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 r={};for(var t in e)e.hasOwnProperty(t)&&(r[t]=te.cloneObject(e[t]));return r}throw new Error("Unable to copy obj! Its type isn't supported.")},lineIntersection:function(e,t,r,i){var s,n,a=null,o=(i.x-r.x)*(e.y-r.y)-(i.y-r.y)*(e.x-r.x),l=(t.x-e.x)*(e.y-r.y)-(t.y-e.y)*(e.x-r.x),h=(i.y-r.y)*(t.x-e.x)-(i.x-r.x)*(t.y-e.y);if(0!=h)n=l/h,a=(s=o/h)>=0&&n<=1&&s<=1&&n>=0?new Q.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=(r.y>=c&&r.y<=u||i.y>=c&&i.y<=u)&&r.x>=p&&r.x<=d||i.x>=p&&i.x<=d?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",e.fontSize&&(r.style.fontSize=e.fontSize),e.fontFamily&&(r.style.fontFamily=e.fontFamily),e.fontWeight&&(r.style.fontWeight=e.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=t;var i=r.clientWidth,s=r.clientHeight;return document.body.removeChild(r),{textWidth:i,textHeight:s}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,(e,r)=>{var i;return i=t.hasOwnProperty(r)?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[r]):e,encodeURIComponent(i)}):e}},re={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};re.in=re.inches,re.degrees=re.dd,re.nmi=1852*re.m;const ie=.0254000508001016;te.extend(re,{Inch:re.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}),te.extend(re,{mm:re.Meter/1e3,cm:re.Meter/100,dm:100*re.Meter,km:1e3*re.Meter,kmi:re.nmi,fath:re.Fathom,ch:re.IntnlChain,link:re.IntnlLink,"us-in":re.inches,"us-ft":re.Foot,"us-yd":re.Yard,"us-ch":re.GunterChain,"us-mi":re.Mile,"ind-yd":re.IndianYd37,"ind-ft":re.IndianFt37,"ind-ch":791.9942845122}),re.degree=re.dd,re.meter=re.m,re.foot=re.ft,re.inch=re.inches,re.mile=re.mi,re.kilometer=re.km,re.yard=re.yd;class se{constructor(e,t){te.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?te.toFloat(e):0,this.lat=t?te.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 se(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new se(this.lon+te.toFloat(e),this.lat+te.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 se(t[0],t[1])}static fromArray(e){var t=te.isArray(e),r=t&&e[0],i=t&&e[1];return new se(r,i)}}class ne{constructor(e,t,r,i){te.isArray(e)&&(i=e[3],r=e[2],t=e[1],e=e[0]),this.left=null!=e?te.toFloat(e):this.left,this.bottom=null!=t?te.toFloat(t):this.bottom,this.right=null!=r?te.toFloat(r):this.right,this.top=null!=i?te.toFloat(i):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new ne(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 r=Math.pow(10,e),i=Math.round(this.left*r)/r,s=Math.round(this.bottom*r)/r,n=Math.round(this.right*r)/r,a=Math.round(this.top*r)/r;return!0===t?s+","+i+","+a+","+n:i+","+s+","+n+","+a}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new J(this.getWidth(),this.getHeight())}getCenterPixel(){return new z((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new se((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){var r,i;e=e||1,null==t&&(t=this.getCenterLonLat()),"SuperMap.LonLat"===t.CLASS_NAME?(r=t.lon,i=t.lat):(r=t.x,i=t.y);var s=(this.left-r)*e+r,n=(this.bottom-i)*e+i,a=(this.right-r)*e+r,o=(this.top-i)*e+i;return new ne(s,n,a,o)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new ne(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 ne(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new ne(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 r=this.contains(e.lon,e.lat,t.inclusive),i=t.worldBounds;if(i&&!r){var s=i.getWidth(),n=(i.left+i.right)/2,a=Math.round((e.lon-n)/s);r=this.containsLonLat({lon:e.lon-a*s,lat:e.lat},{inclusive:t.inclusive})}return r}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,r){if(null==r&&(r=!0),null==e||null==t)return!1;return r?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 r=this.wrapDateLine(t.worldBounds);e=e.wrapDateLine(t.worldBounds)}else r=this;null==t.inclusive&&(t.inclusive=!0);var i=!1,s=r.left===e.right||r.right===e.left||r.top===e.bottom||r.bottom===e.top;if(t.inclusive||!s){var n=e.bottom>=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,a=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top<e.top,o=e.left>=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,l=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;i=(n||a)&&(o||l)}if(t.worldBounds&&!i){var h=t.worldBounds,u=h.getWidth(),c=!h.containsBounds(r),d=!h.containsBounds(e);c&&!d?(e=e.add(-u,0),i=r.intersectsBounds(e,{inclusive:t.inclusive})):d&&!c&&(r=r.add(-u,0),i=e.intersectsBounds(r,{inclusive:t.inclusive}))}return i}containsBounds(e,t,r){null==t&&(t=!1),null==r&&(r=!0);var i=this.contains(e.left,e.bottom,r),s=this.contains(e.right,e.bottom,r),n=this.contains(e.left,e.top,r),a=this.contains(e.right,e.top,r);return t?i||s||n||a:i&&s&&n&&a}determineQuadrant(e){var t="",r=this.getCenterLonLat();return t+=e.lat<r.lat?"b":"t",t+=e.lon<r.lon?"l":"r"}wrapDateLine(e,t){var r=(t=t||{}).leftTolerance||0,i=t.rightTolerance||0,s=this.clone();if(e){for(var n=e.getWidth();s.left<e.left&&s.right-i<=e.left;)s=s.add(n,0);for(;s.left+r>=e.right&&s.right>e.right;)s=s.add(-n,0);var a=s.left+r;a<e.right&&a>e.left&&s.right-i>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 r=e.split(",");return ne.fromArray(r,t)}static fromArray(e,t){return!0===t?new ne(e[1],e[0],e[3],e[2]):new ne(e[0],e[1],e[2],e[3])}static fromSize(e){return new ne(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 ae extends Q{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 ae,t=0,r=this.components.length;t<r;t++)e.addComponent(this.components[t].clone());return te.applyDefaults(e,this),e}getComponentsString(){for(var e=[],t=0,r=this.components.length;t<r;t++)e.push(this.components[t].toShortString());return e.join(",")}calculateBounds(){this.bounds=null;var e=new ne,t=this.components;if(t)for(var r=0,i=t.length;r<i;r++)e.extend(t[r].getBounds());null!=e.left&&null!=e.bottom&&null!=e.right&&null!=e.top&&this.setBounds(e)}addComponents(e){te.isArray(e)||(e=[e]);for(var t=0,r=e.length;t<r;t++)this.addComponent(e[t])}addComponent(e,t){var r=!1;if(e&&(null==this.componentTypes||te.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(null!=t&&t<this.components.length){var i=this.components.slice(0,t),s=this.components.slice(t,this.components.length);i.push(e),this.components=i.concat(s)}else this.components.push(e);e.parent=this,this.clearBounds(),r=!0}return r}removeComponents(e){var t=!1;te.isArray(e)||(e=[e]);for(var r=e.length-1;r>=0;--r)t=this.removeComponent(e[r])||t;return t}removeComponent(e){return te.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,r=this.components.length;t<r;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(te.isArray(e.components)&&e.components.length===this.components.length){for(var r=0,i=this.components.length;r<i;++r)if(!this.components[r].equals(e.components[r])){t=!1;break}}else t=!1;else t=!1;return t}getVertices(e){for(var t=[],r=0,i=this.components.length;r<i;++r)Array.prototype.push.apply(t,this.components[r].getVertices(e));return t}}class oe extends ae{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 le extends oe{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point","SuperMap.PointWithMeasure"],this.CLASS_NAME="SuperMap.Geometry.Curve",this.geometryType="Curve"}}class he extends Q{constructor(e,t,r,i){super(e,t,r,i),this.x=parseFloat(e),this.y=parseFloat(t),this.tag=i||0==i?parseFloat(i):null,this.type=r||"Point",this.CLASS_NAME="SuperMap.Geometry.Point",this.geometryType="Point"}clone(e){return null==e&&(e=new he(this.x,this.y)),te.applyDefaults(e,this),e}calculateBounds(){this.bounds=new ne(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 ue extends le{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,r=this.components.length-1,i=new Array(r),s=0;s<r;++s)e=this.components[s],t=this.components[s+1],e.x<t.x?i[s]={x1:e.x,y1:e.y,x2:t.x,y2:t.y}:i[s]={x1:t.x,y1:t.y,x2:e.x,y2:e.y};return i.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={},r=e[0],i=e[1],s=e[2],n=0,a=0,o=!0,l=0,h=0,u=0,c=[],d=(s.y-r.y)/(s.x-r.x),p=s.y-d*s.x;if(s.x!=r.x&&s.y!=r.y&&i.y==d*i.x+p||s.x==r.x&&i.x==r.x||s.y==r.y&&i.y==r.y||s.x==r.x&&s.y==r.y||s.x==i.x&&s.y==i.y||r.x==i.x&&r.y==i.y)c.push(r),c.push(i),c.push(s);else{var f=(i.x*i.x+i.y*i.y-(r.x*r.x+r.y*r.y))*(2*(s.y-r.y))-(s.x*s.x+s.y*s.y-(r.x*r.x+r.y*r.y))*(2*(i.y-r.y)),y=2*(i.x-r.x)*(s.x*s.x+s.y*s.y-(r.x*r.x+r.y*r.y))-2*(s.x-r.x)*(i.x*i.x+i.y*i.y-(r.x*r.x+r.y*r.y)),m=4*((i.x-r.x)*(s.y-r.y)-(s.x-r.x)*(i.y-r.y));t.x=f/m,t.y=y/m;var g=(2*(n=Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)))*n-((r.x-s.x)*(r.x-s.x)+(r.y-s.y)*(r.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==r.x?t.x>r.x&&i.x>r.x||t.x<r.x&&i.x<r.x?360-u:u:t.y>d*t.x+p&&i.y>d*i.x+p||t.y<d*t.x+p&&i.y<d*i.x+p?360-u:u)/72,s.y!=r.y?s.x==r.x?s.y>r.y?i.x<r.x&&(o=!1):i.x>r.x&&(o=!1):s.x<r.x?i.y<d*i.x+p&&(o=!1):i.y>d*i.x+p&&(o=!1):s.x>r.x?i.y>r.y&&(o=!1):i.y<r.y&&(o=!1);var v=(r.y-t.y)/(r.x-t.x),b=v>=0?180*Math.atan(v)/Math.PI:Math.abs(180*Math.atan(v)/Math.PI)+90,S=Math.abs(t.y);r.y==S&&S==s.y&&r.x<s.x&&(b+=180);var x=r.y-t.y;c.push(r);for(var _=1;_<72;_++){l=a*_,h=b,o?x>=0?v>=0?h+=l:h=180-(h-90)+l:h=v>0?h-180+l:90-h+l:x>=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 he(w,C))}c.push(s)}return c}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var i=0;i<r;){if("LTypeArc"==e[i].type){var s=ue.createLineArc(t,i,r,e);t=s[0],i=s[1]}else t.push(e[i]),i++}return t}static createLineArc(e,t,r,i){if(0==t){let s=ue.addPointEPS(i,t,r,"LTypeArc");Array.prototype.push.apply(e,s[0]),t=s[1]+1}else if(t==r-1){var s=[i[t-1],i[t]],n=ue.calculateCircle(s);Array.prototype.push.apply(e,n),t++}else{let s=ue.addPointEPS(i,t,r,"LTypeArc");e.pop(),Array.prototype.push.apply(e,s[0]),t=s[1]+1}return[e,t]}static addPointEPS(e,t,r,i){var s,n=[],a=t+1;return 0==t?Array.prototype.push.apply(n,[e[t],e[t+1]]):t==r-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"==i?s=ue.calculatePointsFBZN(n):"LTypeArc"==i&&(s=ue.calculateCircle(n)),[s,a]}}class ce extends Q{constructor(e,t,r){super(e,t,r),this.x=parseFloat(e),this.y=parseFloat(t),this.text=r.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 he(this.x,this.y)}clone(e){return null==e&&(e=new ce(this.x,this.y,this.text)),te.applyDefaults(e,this),e}calculateBounds(){this.bounds=new ne(this.x,this.y,this.x,this.y)}getLabelPxBoundsByLabel(e,t,r,i){var s,n,a,o,l=te.cloneObject(e),h=(i.label||this.text).split("\n").length;if(t=parseFloat(t),r=parseFloat(r),h>1&&(r=parseFloat(r)*h),i.labelAlign&&"cm"!==i.labelAlign)switch(i.labelAlign){case"lt":l.x+=t/2,l.y+=r/2;break;case"lm":l.x+=t/2;break;case"lb":l.x+=t/2,l.y-=r/2;break;case"ct":l.y+=r/2;break;case"cb":l.y-=r/2;break;case"rt":l.x-=t/2,l.y+=r/2;break;case"rm":l.x-=t/2;break;case"rb":l.x-=t/2,l.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=t,s=l.x-parseFloat(t)/2,n=l.y+parseFloat(r)/2,o=l.x+parseFloat(t)/2,a=l.y-parseFloat(r)/2,new ne(s,n,o,a)}getLabelPxBoundsByText(e,t){var r,i,s,n,a=this.getLabelPxSize(t),o=te.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,r=o.x-a.w/2,i=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 ne(r,i,n,s)}getLabelPxSize(e){var t,r,i,s,n=parseFloat(e.strokeWidth);t=e.label||this.text,r=e.fontSize?parseFloat(e.fontSize):parseFloat("12px");var a=t.split("\n"),o=a.length;s=o>1?r*o+o+n+.2*r:r+n+.2*r+1,i=0,this.labelWTmp&&i<this.labelWTmp&&(i=this.labelWTmp);for(var l=0;l<o;l++){var h=this.getTextCount(a[l]),u=this.labelWTmp=te.getTextBounds(e,a[l],this.element).textWidth+1*h.textC+n;i<u&&(i=u)}var c=new Object;return c.h=s,c.w=i,c}getTextCount(e){for(var t={},r=0,i=0,s=0;s<e.length;s++)e.charCodeAt(s)>255?r++:i++;return t.cnC=r,t.enC=i,t.textC=e.length,t}}class de extends ue{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var r=!1,i=this.components.pop();null==t&&e.equals(i)||(r=super.addComponent.apply(this,arguments));var s=this.components[0];return super.addComponent.apply(this,[s]),r}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var r=this.components[0];super.addComponent.apply(this,[r])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,i=this.components.length;r<i-1;r++){var s=this.components[r],n=this.components[r+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 pe extends ae{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LineString"],this.CLASS_NAME="SuperMap.Geometry.MultiLineString",this.geometryType="MultiLineString"}}class fe extends ae{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Polygon"],this.CLASS_NAME="SuperMap.Geometry.MultiPolygon",this.geometryType="MultiPolygon"}}class ye extends ae{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,r=this.components.length;t<r;t++)e-=Math.abs(this.components[t].getArea())}return e}}class me extends Q{constructor(e,t,r,i){super(e,t,r,i),this.x=e,this.y=t,this.width=r,this.height=i,this.CLASS_NAME="SuperMap.Geometry.Rectangle",this.geometryType="Rectangle"}calculateBounds(){this.bounds=new ne(this.x,this.y,this.x+this.width,this.y+this.height)}getArea(){return this.width*this.height}}class ge{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}}ge.CREDENTIAL=null;var ve={toISOString:function(){if("toISOString"in Date.prototype)return function(e){return e.toISOString()};{function e(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r}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,r=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(r&&(r[1]||r[7])){var i=parseInt(r[1],10)||0,s=parseInt(r[2],10)-1||0,n=parseInt(r[3],10)||1;t=new Date(Date.UTC(i,s,n));var a=r[7];if(a){var o=parseInt(r[4],10),l=parseInt(r[5],10),h=parseFloat(r[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(r[8],10)||0));t=new Date(t.getTime()+d)}}}else t=new Date("invalid");return t}},be={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 r=be.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,i){var s=te.getElement(e);if(i=i||!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=te.createUniqueID(n)}var a=s._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:s,name:t,observer:r,useCapture:i}),s.addEventListener?"mousewheel"===t?s.addEventListener(t,r,{useCapture:i,passive:!1}):s.addEventListener(t,r,i):s.attachEvent&&s.attachEvent("on"+t,r)},stopObservingElement:function(e){var t=te.getElement(e)._eventCacheID;this._removeElementObservers(be.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var r=e[t],i=new Array(r.element,r.name,r.observer,r.useCapture);be.stopObserving.apply(this,i)}},stopObserving:function(e,t,r,i){i=i||!1;var s=te.getElement(e),n=s._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.detachEvent)&&(t="keydown");var a=!1,o=be.observers[n];if(o)for(var l=0;!a&&l<o.length;){var h=o[l];if(h.name===t&&h.observer===r&&h.useCapture===i){o.splice(l,1),0==o.length&&delete be.observers[n],a=!0;break}l++}return a&&(s.removeEventListener?s.removeEventListener(t,r,i):s&&s.detachEvent&&s.detachEvent("on"+t,r)),a},unloadCache:function(){if(be&&be.observers){for(var e in be.observers){var t=be.observers[e];be._removeElementObservers.apply(this,[t])}be.observers=!1}},CLASS_NAME:"SuperMap.Event"};be.observe(window,"resize",be.unloadCache,!1);class Se{constructor(e,t,r,i,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=i,this.includeXY=!1,this.extensions={},this.extensionCount={},this.clearMouseListener=null,te.extend(this,s),null!=r)for(var n=0,a=r.length;n<a;n++)this.addEventType(r[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&&(be.stopObservingElement(this.element),this.element.hasScrollEvent&&be.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?be.stopObservingElement(this.element):(this.eventHandler=Y.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=Y.bind(this.clearMouseCache,this)),this.element=e;for(var t=0,r=this.BROWSER_EVENTS.length;t<r;t++){var i=this.BROWSER_EVENTS[t];this.addEventType(i),be.observe(e,i,this.eventHandler)}be.observe(e,"dragstart",be.stop)}on(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])}register(e,t,r,i){if(e in Se&&!this.extensions[e]&&(this.extensions[e]=new Se[e](this)),null!=r&&-1!==te.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:r};i?(s.splice(this.extensionCount[e],0,n),"object"==typeof i&&i.extension&&this.extensionCount[e]++):s.push(n)}}registerPriority(e,t,r){this.register(e,t,r,!0)}un(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])}unregister(e,t,r){null==t&&(t=this.object);var i=this.listeners[e];if(null!=i)for(var s=0,n=i.length;s<n;s++)if(i[s].obj===t&&i[s].func===r){i.splice(s,1);break}}remove(e){null!=this.listeners[e]&&(this.listeners[e]=[])}triggerEvent(e,t){var r=this.listeners[e];if(r&&0!=r.length){var i;null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var s=0,n=(r=r.slice()).length;s<n;s++){var a=r[s];if(void 0!=(i=a.func.apply(a.obj,[t]))&&!1===i)break}return this.fallThrough||be.stop(t,!0),i}}handleBrowserEvent(e){var t=e.type,r=this.listeners[t];if(r&&0!=r.length){var i=e.touches;if(i&&i[0]){for(var s,n=0,a=0,o=i.length,l=0;l<o;++l)n+=(s=i[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||(be.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=te.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=te.pagePosition(this.element)),new z(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])}}Se.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 xe{constructor(e,t,r){this.CLASS_NAME="SuperMap.Feature",this.layer=e,this.id=te.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=t,this.data=null!=r?r:{}}destroy(){this.id=null,this.lonlat=null,this.data=null}}class _e{constructor(e,t,r){this.red=e||0==e?e:255,this.green=t||0,this.blue=r||0,this.CLASS_NAME="SuperMap.ServerColor"}destroy(){this.red=null,this.green=null,this.blue=null}static fromJson(e){if(e){var t=new _e,r=255;null!==e.red&&(r=Number(e.red)),t.red=r;var i=0;null!==e.green&&(i=Number(e.green)),t.green=i;var s=0;return null!==e.blue&&(s=Number(e.blue)),t.blue=s,t}}}class we{constructor(e){this.fillBackColor=new _e(255,255,255),this.fillBackOpaque=!1,this.fillForeColor=new _e(255,0,0),this.fillGradientMode=null,this.fillGradientAngle=0,this.fillGradientOffsetRatioX=0,this.fillGradientOffsetRatioY=0,this.fillOpaqueRate=100,this.fillSymbolID=0,this.lineColor=new _e(0,0,0),this.lineSymbolID=0,this.lineWidth=1,this.markerAngle=0,this.markerSize=1,this.markerSymbolID=-1,e&&te.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=te.copyAttributes(e,this)}static fromJson(e){if(e)return new we({fillBackColor:_e.fromJson(e.fillBackColor),fillBackOpaque:e.fillBackOpaque,fillForeColor:_e.fromJson(e.fillForeColor),fillGradientMode:e.fillGradientMode,fillGradientAngle:e.fillGradientAngle,fillGradientOffsetRatioX:e.fillGradientOffsetRatioX,fillGradientOffsetRatioY:e.fillGradientOffsetRatioY,fillOpaqueRate:e.fillOpaqueRate,fillSymbolID:e.fillSymbolID,lineColor:_e.fromJson(e.lineColor),lineSymbolID:e.lineSymbolID,lineWidth:e.lineWidth,markerAngle:e.markerAngle,markerSize:e.markerSize,markerSymbolID:e.markerSymbolID})}}class Ce extends he{constructor(e){super(e),this.measure=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.PointWithMeasure"}equals(e){var t=!1;if(null!=e){var r=this.x===e.x&&this.y===e.y&&this.measure===e.measure,i=isNaN(this.x)&&isNaN(this.y)&&isNaN(this.measure),s=isNaN(e.x)&&isNaN(e.y)&&isNaN(e.measure);t=r||i&&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 Ce({x:e.x,y:e.y,measure:e.measure})}}class Ae extends ae{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&&te.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 r=0,i=this.components.length;r<i;r++)for(var s=0,n=this.components[r].components.length;s<n;s++)e+=this.components[r].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||[],r=e.points||[],i=t.length,s=[];if(!(i>0))return null;for(var n=0,a=0,o=[];n<i;n++){for(var l=0;l<t[n];l++)o.push(Ce.fromJson(r[a+l]));a+=t[n],o[0].equals(o[t[n]-1])?s.push(new de(o)):s.push(new ue(o)),o=[]}return new Ae(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 Me{constructor(e){this.id=0,this.style=null,this.parts=null,this.points=null,this.type=null,this.prjCoordSys=null,e&&te.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||[],r=e.length;if(r>0){if(1===r)return new he(t[0].x,t[0].y);var i=[];for(let e=0;e<r;e++)i.push(new he(t[e].x,t[e].y));return new oe(i)}return null}toGeoLine(){var e=this.parts||[],t=this.points||[],r=e.length;if(r>0){if(1===r){let r=[];for(let i=0;i<e[0];i++)r.push(new he(t[i].x,t[i].y));return r[0].equals(r[e[0]-1])?new de(r):new ue(r)}{let i=[];for(let s=0;s<r;s++){let r=[];for(let i=0;i<e[s];i++)r.push(new he(t[i].x,t[i].y));i.push(new ue(r)),t.splice(0,e[s])}return new pe(i)}}return null}toGeoLineEPS(){var e,t,r,i,s,n=this.parts||[],a=this.points||[],o=n.length;if(o>0){if(1===o){for(e=0,r=[];e<n[0];e++)r.push(new he(a[e].x,a[e].y,a[e].type));return r[0].equals(r[n[0]-1])?(s=ue.createLineEPS(r),new de(s)):(s=ue.createLineEPS(r),new ue(s))}for(e=0,i=[];e<o;e++){for(t=0,r=[];t<n[e];t++)r.push(new he(a[t].x,a[t].y));s=ue.createLineEPS(r),i.push(new ue(s)),a.splice(0,n[e])}return new pe(i)}return null}toGeoLinem(){return Ae.fromJson(this)}toGeoRegion(){var e=this.parts||[],t=this.partTopo||[],r=this.points||[],i=e.length;if(i<=0)return null;var s=[],n=[];if(1==i){for(let e=0;e<r.length;e++)n.push(new he(r[e].x,r[e].y));return s.push(new ye([new de(n)])),new fe(s)}var a=[],o=[],l=[],h=[],u=[];for(let s=0,a=0;s<i;s++){for(let t=0;t<e[s];t++)n.push(new he(r[a+t].x,r[a+t].y));a+=e[s];var c=new ye([new de(n)]);n=[],l.push(c),0===t.length&&h.push(c.getBounds()),u.push(1),o.push(c.getArea())}if(0===t.length){Me.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==i-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 ye(a))}}return new fe(s)}toGeoRegionEPS(){var e=this.parts||[],t=this.partTopo||[],r=this.points||[],i=e.length;if(i<=0)return null;var s,n=[],a=[];if(1==i){for(var o=0;o<r.length;o++)a.push(new he(r[o].x,r[o].y));return s=ue.createLineEPS(a),n.push(new ye([new de(s)])),new fe(n)}var l=[],h=[],u=[],c=[],d=[];for(let n=0,o=0;n<i;n++){for(let t=0;t<e[n];t++)a.push(new he(r[o+t].x,r[o+t].y));o+=e[n],s=ue.createLineEPS(a);var p=new ye([new de(s)]);a=[],u.push(p),0===t.length&&c.push(p.getBounds()),d.push(1),h.push(p.getArea())}if(0===t.length){Me.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==i-1){var y=n.length;if(y)n[y-1].components=n[y-1].components.concat(l);else for(let e=0,t=l.length;e<t;e++)n.push(new ye(l))}}return new fe(n)}transformGeoCompound(){const e=this.geoParts||[],t=e.length;if(t<=0)return null;const r=[];for(let i=0;i<t;i++){const t=e[i];r.push(new Me(t).toGeometry())}return new ae(r)}static fromJson(e){if(e)return new Me({id:e.id,style:we.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,r=[],i=[],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 oe||e instanceof pe)){let e=a.length;for(let t=0;t<e;t++){const e=a[t].getVertices();let s=e.length;r.push(s);for(let t=0;t<s;t++)i.push(new he(e[t].x,e[t].y))}n="SuperMap.Geometry.MultiPoint"==o?s.POINT:s.LINE}else if(e instanceof fe){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;r.push(n);for(let e=0;e<n-1;e++)i.push(new he(s[e].x,s[e].y));i.push(new he(s[0].x,s[0].y))}}n=s.REGION}else if(e instanceof ye){let e=a.length;for(let t=0;t<e;t++){const e=a[t].getVertices();let s=e.length+1;r.push(s);for(let t=0;t<s-1;t++)i.push(new he(e[t].x,e[t].y));i.push(new he(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++)i.push(new he(t[e].x,t[e].y));e instanceof de&&(i.push(new he(t[0].x,t[0].y)),a++),r.push(a),n=e instanceof he?s.POINT:s.LINE}return new Me({id:t,style:null,parts:r,points:i,type:n,prjCoordSys:l})}}static IsClockWise(e){var t=e.length;if(t<3)return 0;var r=e[0].y*(e[t-1].x-e[1].x);e.push(e[0]);for(var i=1;i<t;i++)r+=e[i].y*(e[i-1].x-e[i+1].x);return.5*r}static bubbleSort(e,t,r,i){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,r&&r.length>0){var l=r[n];r[n]=r[s],r[s]=l}if(i&&i.length>0){var h=i[n];i[n]=i[s],i[s]=h}}}}const Te={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};class Ee extends xe{constructor(e,t,r){super(null,null,t),this.fid=null,this.geometry=e||null,this.attributes={},t&&(this.attributes=te.extend(this.attributes,t)),this.bounds=null,this.state=null,this.style=r||null,this.url=null,this.lonlat=null,this.CLASS_NAME="SuperMap.Feature.Vector",Ee.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 Ee(this.geometry?this.geometry.clone():null,this.attributes,this.style)}toState(e){if(e===Te.UPDATE)switch(this.state){case Te.UNKNOWN:case Te.DELETE:this.state=e;break;case Te.UPDATE:case Te.INSERT:}else if(e===Te.INSERT)switch(this.state){case Te.UNKNOWN:break;default:this.state=e}else if(e===Te.DELETE)switch(this.state){case Te.INSERT:case Te.DELETE:break;case Te.UNKNOWN:case Te.UPDATE:this.state=e}else e===Te.UNKNOWN&&(this.state=e)}}class Oe{constructor(e){this.data=null,this.keepData=!1,te.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class Pe extends Oe{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,r,i,s=["{"];this.level+=1;var n=!1;for(t in e)e.hasOwnProperty(t)&&(r=this.write.apply(this,[t,this.pretty]),i=this.write.apply(this,[e[t],this.pretty]),null!=r&&null!=i&&(n&&s.push(","),s.push(this.writeNewline(),this.writeIndent(),r,":",this.writeSpace(),i),n=!0));return this.level-=1,s.push(this.writeNewline(),this.writeIndent(),"}"),s.join("")},array:function(e){var t,r=["["];this.level+=1;for(var i=0,s=e.length;i<s;++i)null!=(t=this.write.apply(this,[e[i],this.pretty]))&&(i>0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.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,r){var i=t[r];return i||(i=r.charCodeAt(),"\\u00"+Math.floor(i/16).toString(16)+(i%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 r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=r),r}write(e,t){this.pretty=!!t;var r=null,i=typeof e;if(this.serialize[i])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[i].apply(this,[e])}catch(e){}return r}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 Ie extends Pe{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 he(e[0],e[1])},multipoint:function(e){for(var t=[],r=null,i=0,s=e.length;i<s;++i){try{r=this.parseCoords.point.apply(this,[e[i]])}catch(e){throw e}t.push(r)}return new oe(t)},linestring:function(e){for(var t=[],r=null,i=0,s=e.length;i<s;++i){try{r=this.parseCoords.point.apply(this,[e[i]])}catch(e){throw e}t.push(r)}return new ue(t)},multilinestring:function(e){for(var t=[],r=null,i=0,s=e.length;i<s;++i){try{r=this.parseCoords.linestring.apply(this,[e[i]])}catch(e){throw e}t.push(r)}return new pe(t)},polygon:function(e){for(var t,r,i=[],s=0,n=e.length;s<n;++s){try{r=this.parseCoords.linestring.apply(this,[e[s]])}catch(e){throw e}t=new de(r.components),i.push(t)}return new ye(i)},multipolygon:function(e){for(var t=[],r=null,i=0,s=e.length;i<s;++i){try{r=this.parseCoords.polygon.apply(this,[e[i]])}catch(e){throw e}t.push(r)}return new fe(t)},box:function(e){if(2!=e.length)throw"GeoJSON box coordinates must have 2 elements";return new ye([new de([new he(e[0][0],e[0][1]),new he(e[1][0],e[0][1]),new he(e[1][0],e[1][1]),new he(e[0][0],e[1][1]),new he(e[0][0],e[0][1])])])}},this.extract={feature:function(e){var t=this.extract.geometry.apply(this,[e.geometry]),r={type:"Feature",properties:this.createAttributes(e),geometry:t};return e.geometry&&"TEXT"===e.geometry.type&&(r.properties.texts=e.geometry.texts,r.properties.textStyle=e.geometry.textStyle),e.fid&&(r.id=e.fid),e.ID&&(r.id=e.ID),r},geometry:function(e){if(null==e)return null;!e.parts&&e.points&&(e.parts=[e.points.length]);var t,r=e.hasOwnProperty("geometryType")?e:new Me(e).toGeometry()||e,i=r.geometryType||r.type;return"LinearRing"===i&&(i="LineString"),"LINEM"===i&&(i="MultiLineString"),t=this.extract[i.toLowerCase()].apply(this,[r]),"Collection"===(i="TEXT"===i?"Point":i)?{type:"GeometryCollection",geometries:t}:{type:i,coordinates:t}},point:function(e){var t=[e.x,e.y];for(var r in e)"x"===r||"y"===r||null===e[r]||isNaN(e[r])||t.push(e[r]);return t},text:function(e){return[e.points[0].x,e.points[0].y]},multipoint:function(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t},linestring:function(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t},multilinestring:function(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extract.linestring.apply(this,[e.components[r]]));return t},polygon:function(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extract.linestring.apply(this,[e.components[r]]));return t},multipolygon:function(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extract.polygon.apply(this,[e.components[r]]));return t},collection:function(e){for(var t=e.components.length,r=new Array(t),i=0;i<t;++i)r[i]=this.extract.geometry.apply(this,[e.components[i]]);return r}}}read(e,t,r){t=t||"FeatureCollection";var i=null,s=null;if(s="string"==typeof e?super.read(e,r):e){if("string"!=typeof s.type);else if(this.isValidType(s,t))switch(t){case"Geometry":try{i=this.parseGeometry(s)}catch(e){}break;case"Feature":try{(i=this.parseFeature(s)).type="Feature"}catch(e){}break;case"FeatureCollection":switch(i=[],s.type){case"Feature":try{i.push(this.parseFeature(s))}catch(e){i=null}break;case"FeatureCollection":for(var n=0,a=s.features.length;n<a;++n)try{i.push(this.parseFeature(s.features[n]))}catch(e){i=null}break;default:try{var o=this.parseGeometry(s);i.push(new Ee(o))}catch(e){i=null}}}}else;return i}write(e,t){return super.write(this.toGeoJSON(e),t)}fromGeoJSON(e,t,r){let i=this.read(e,t,r);return te.isArray(i)?i.map(e=>this._toiSevrerFeature(e)):this._toiSevrerFeature(i)}toGeoJSON(e){var t={type:null};if(te.isArray(e)){t.type="FeatureCollection";var r=e.length;t.features=new Array(r);for(var i=0;i<r;++i){var s=e[i];if(n(s)){let e={};e.geometry=s,t.features[i]=this.extract.feature.apply(this,[e])}else t.features[i]=this.extract.feature.apply(this,[s])}}else if(n(e)){let r={};r.geometry=e,t=this.extract.feature.apply(this,[r])}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 r=!1;switch(t){case"Geometry":-1==te.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],e.type)||(r=!0);break;case"FeatureCollection":r=!0;break;default:e.type==t&&(r=!0)}return r}parseFeature(e){var t,r,i,s;i=e.properties?e.properties:{},s=e.geometry&&e.geometry.bbox||e.bbox;try{r=this.parseGeometry(e.geometry)}catch(e){throw e}return t=new Ee(r,i),s&&(t.bounds=ne.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(!te.isArray(e.geometries))throw"GeometryCollection must have geometries array: "+e;for(var r=e.geometries.length,i=new Array(r),s=0;s<r;++s)i[s]=this.parseGeometry.apply(this,[e.geometries[s]]);t=new ae(i)}else{if(!te.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(),r={};if(t.match(/epsg:/i)){var i=parseInt(t.substring(t.indexOf(":")+1));r=4326==i?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+i}}}return r}_toiSevrerFeature(e){const t=e.attributes,r=[],i=[];for(var s in t)r.push(s),i.push(t[s]);const n={fieldNames:r,fieldValues:i,geometry:Me.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 r=e.fieldNames,i=e.fieldValues;for(var s in r)t[r[s]]=i[s]}(e,t);var r=["fieldNames","fieldValues","geometry","stringID","ID"];for(var i in e)r.indexOf(i)>-1||(t[i]=e[i]);return t}}class Ne{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 Se(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(){}}r(107),r(693);var Le=r(144),ke=r.n(Le);let Fe=window.fetch;var Re,De,Ge={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=te.toJSON(e[t]));var r=encodeURIComponent(e[t]);this.queryValues.push(r)}},issue:function(e){for(var t=this,r=t.getUid(),i=e.url,s=[],n=i,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=i,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=i,a=0)}else a++,n.indexOf("?")>-1?n+="&":n+="?",n+=t.queryKeys[l]+"="+t.queryValues[l];return s.push(n),t.send(s,"SuperMapJSONPCallbacks_"+r,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var i=e.length;if(i>0)return new Promise(s=>{for(var n=(new Date).getTime(),a=0;a<i;a++){var o=e[a];o.indexOf("?")>-1?o+="&":o+="?",o+="sectionCount="+i,o+="&sectionIndex="+a,o+="&jsonpUserID="+n,r&&(o=decodeURIComponent(o),o=r+encodeURIComponent(o)),ke()(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)}},je=function(){return void 0!=Re?Re:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},Be=function(){return De||45e3},Ue={commit:function(e,t,r,i){switch(e=e?e.toUpperCase():e){case"GET":return this.get(t,r,i);case"POST":return this.post(t,r,i);case"PUT":return this.put(t,r,i);case"DELETE":return this.delete(t,r,i);default:return this.get(t,r,i)}},supportDirectRequest:function(e,t){return!!te.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:je()||t.proxy)},get:function(e,t,r){r=r||{};if(e=te.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){var i={url:e=e.replace(".json",".jsonp"),data:t};return Ge.GET(i)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"GET")},delete:function(e,t,r){r=r||{};if(e=te.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var i={url:e+="&_method=DELETE",data:t};return Ge.DELETE(i)}return this.urlIsLong(e)?this._postSimulatie("DELETE",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"DELETE")},post:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var i={url:te.urlAppend(e,"_method=POST"),data:t};return Ge.POST(i)}return this._fetch(e,t,r,"POST")},put:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var i={url:e+="&_method=PUT",data:t};return Ge.PUT(i)}return this._fetch(e,t,r,"PUT")},urlIsLong:function(e){for(var t=0,r=null,i=0,s=e.length;i<s;i++)(r=e.charCodeAt(i))<127?t++:128<=r&&r<=2047?t+=2:2048<=r&&r<=65535&&(t+=3);return!(t<2e3)},_postSimulatie:function(e,t,r,i){return t+=(t.indexOf("?")>-1?"&":"?")+"_method="+e,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(t,r,i)},_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 r=e.split("?");2===r.length&&(e=r[0]+".json?"+r[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,r,i){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,Fe(e,{method:i,headers:r.headers,body:"PUT"===i||"POST"===i?t:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:Be()}).then(function(e){return e})):Fe(e,{method:i,body:"PUT"===i||"POST"===i?t:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:Be()}).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||{},ke()(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(r,i){setTimeout(function(){i(new Error("timeout"))},e),t.then(r,i)})},_getParameterString:function(e){var t=[];for(var r in e){var i,s=e[r];if(null!=s&&"function"!=typeof s)i=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(r)+"="+i)}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class Ve{static generateToken(e,t){var r=this.servers[e];if(r)return Ue.post(r.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(e){return e.text()})}static registerServers(e){this.servers=this.servers||{},te.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var r=e[t];this.servers[r.server]=r}}static registerToken(e,t){if(this.tokens=this.tokens||{},e&&t){var r=this._getTokenStorageKey(e);this.tokens[r]=t}}static registerKey(e,t){if(this.keys=this.keys||{},e&&!(e.length<1)&&t){e=te.isArray(e)?e:[e];for(var r=0;r<e.length;r++){var i=this._getUrlRestString(e[0])||e[0];this.keys[i]=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,r,i){e=te.urlPathAppend(e,"services/security/login");var s={username:t&&t.toString(),password:r&&r.toString(),rememberme:i};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=te.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 r=Ve.SSO+"/login?service="+e;this._open(r,t)}static loginiPortal(e,t,r){e=te.urlPathAppend(e,"web/login");var i={username:t&&t.toString(),password:r&&r.toString()};i=JSON.stringify(i);return Ue.post(e,i,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!1}).then(function(e){return e.json()})}static logoutiPortal(e){e=te.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){var r=te.urlPathAppend(e,"/security/tokens"),i=t||{},s={username:i.userName&&i.userName.toString(),password:i.password&&i.password.toString()};s=JSON.stringify(s);var n=this;return Ue.post(r,s,{headers:{Accept:"*/*","Content-Type":"application/json; charset=UTF-8"}}).then(function(e){return e.text()}).then(function(e){return n.imanagerToken=e,e})}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,r=this.getToken(e),i=r?new ge(r,"token"):null;return i||(i=(r=this.getKey(e))?new ge(r,"key"):null),i&&(t=te.urlAppend(t,i.getUrlParameters())),t}static _open(e,t){t=null==t||t;var r=window.screen.availWidth/2-this.INNER_WINDOW_WIDTH/2,i=window.screen.availHeight/2-this.INNER_WINDOW_HEIGHT/2,s="height="+this.INNER_WINDOW_HEIGHT+", width="+this.INNER_WINDOW_WIDTH+",top="+i+", left="+r+",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}}Ve.INNER_WINDOW_WIDTH=600,Ve.INNER_WINDOW_HEIGHT=600,Ve.SSO="https://sso.supermap.com",Ve.ONLINE="https://www.supermapol.com";class Je{constructor(e,t){if(e){var r=e.substr(e.length-1,1);this.serviceUrl="/"===r?e.substr(0,e.length-2):e}this.options=t||{},this.CLASS_NAME="SuperMap.iManagerServiceBase"}request(e,t,r,i){(i=i||{headers:{Accept:"*/*","Content-Type":"application/json"}}).crossOrigin=this.options.crossOrigin,i.headers=this.options.headers;var s=Ve.imanagerToken;return s&&(i.headers||(i.headers={}),i.headers["X-Auth-Token"]=s),r&&(r=JSON.stringify(r)),Ue.commit(e,t,r,i).then(function(e){return e.json()})}}class ze{constructor(e){e=e||{},this.nodeSpec="SMALL",this.nodeCount=1,this.nodeName="",this.password="",this.description="",this.physicalMachineName="",this.ips=[],this.userName="",te.extend(this,e)}}class qe{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,r,i={headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials}){return t=Ve.appendCredential(t),Ue.commit(e,t,r,i).then(function(e){return e.json()})}}class He{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=[],te.extend(this,e)}}class We{constructor(e){e=e||{},this.content=[],this.total=0,this.currentPage=1,this.pageSize=12,this.aggregations=null,te.extend(this,e)}}class Ye extends qe{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={},te.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 r={authorizeSetting:this.sourceJSON.authorizeSetting,metadata:this.sourceJSON.metadata,tags:this.sourceJSON.tags,thumbnail:this.sourceJSON.thumbnail,tokenRefreshUrl:this.sourceJSON.tokenRefreshUrl};t=JSON.stringify(r)}return this.request("PUT",this.resourceUrl,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})}}class Xe{constructor(e){e=e||{},this.ids=[],this.entities=[],this.resourceType="",te.extend(this,e)}}class Qe{constructor(e){e=e||{},this.rootUrl="",this.tags=[],this.entities=[],te.extend(this,e)}}class Ze{constructor(e){e=e||{},this.type="",this.tags=[],this.entities=[],this.metadata={},this.addedMapNames=[],this.addedSceneNames=[],te.extend(this,e)}}class Ke{constructor(e){e=e||{},this.fileName="",this.type="",this.tags=[],this.dataMetaInfo={},te.extend(this,e)}}class $e{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={},te.extend(this,e)}}class et{constructor(e){e=e||{},this.type="",this.url="",this.connectionInfo={},te.extend(this,e)}}class tt{constructor(e){e=e||{},this.dataBase="",this.server="",te.extend(this,e)}}class rt{constructor(e,t){let r=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,te.isArray(e)?(r.urls=e,r.length=e.length,r.totalTimes=r.length,1===r.length?r.url=e[0]:(r.index=parseInt(Math.random()*r.length),r.url=e[r.index])):(r.totalTimes=1,r.url=e),te.isArray(e)&&!r.isServiceSupportPolling()&&(r.url=e[0],r.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,te.extend(this,t),r.isInTheSameDomain=te.isInTheSameDomain(r.url),r.events=new Se(r,null,r.EVENT_TYPES,!0),r.eventListeners instanceof Object&&r.events.on(r.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;te.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){let t=e.scope.format;if("string"==typeof e.success&&(e.scope.format=e.success,t=e.success,e.success=null,e.failure=null),t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let r=this;return e.url=e.url||r.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=te.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||r.proxy,e.withCredentials=void 0!=e.withCredentials?e.withCredentials:r.withCredentials,e.crossOrigin=void 0!=e.crossOrigin?e.crossOrigin:r.crossOrigin,e.headers=e.headers||r.headers,e.isInTheSameDomain=r.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=Ve.appendCredential(e.url),r.calculatePollingTimes(),e.scope=r,r.totalTimes>0?(r.totalTimes--,r.ajaxPolling(e)):r._commit(e)}ajaxPolling(e){let t=this,r=e.url,i=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(i,i.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=te.isInTheSameDomain(r),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)}transformResult(e,t){return{result:e=te.transformResult(e),options:t}}transformErrorResult(e,t){return{error:(e=te.transformResult(e)).error||e,options:t}}serviceProcessCompleted(e,t){e=this.transformResult(e).result,this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let r=(e=this.transformErrorResult(e).error).error||e;this.events.triggerEvent("processFailed",{error:r,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=te.urlAppend(e.url,te.getParameterString(e.params||{}))),"object"==typeof e.data)try{e.params=te.toJSON(e.data)}catch(e){console.log("不是json对象")}else e.params=e.data;return 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(r){let i=r;return"string"==typeof r&&(i=(new Pe).read(r)),(!i||i.error||i.code>=300&&304!==i.code)&&(i=i&&i.error?{error:i.error}:{error:i}),i&&e.scope.format===t.FGB&&(i.newResourceLocation=i.newResourceLocation.replace(".json","")+".fgb"),i}).catch(function(e){return{error:e}}).then(t=>{let r={object:this};if(t.error){const s="processFailed";if(this.events&&this.events.listeners[s]&&this.events.listeners[s].length){var i=e.failure&&(e.scope?Y.bind(e.failure,e.scope):e.failure);i?i(t,e):this.serviceProcessFailed(t,e)}else(r={...r,...this.transformErrorResult(t,e)}).type=s,e.failure&&e.failure(r)}else{const i="processCompleted";if(this.events&&this.events.listeners[i]&&this.events.listeners[i].length){var s=e.success&&(e.scope?Y.bind(e.success,e.scope):e.success);s?s(t,e):this.serviceProcessCompleted(t,e)}else t.succeed=void 0==t.succeed||t.succeed,(r={...r,...this.transformResult(t,e)}).type=i,e.success&&e.success(r)}return r})}}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,te.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class st{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,te.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 nt extends rt{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,r){if(t instanceof it)return this.processAsync(e,t,r)}decode(e,t,r){if(t instanceof st)return this.processAsync(e,t,r)}processAsync(e,t,r){return this.request({method:"GET",url:e,params:t,scope:this,success:r,failure:r})}transformResult(e,t){return e.succeed&&delete e.succeed,{result:e,options:t}}}class at{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",te.extend(this,e)}destroy(){this.aggName=null,this.aggFieldName=null,this.aggType=null}}class ot extends at{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",te.extend(this,e)}destroy(){this.subAggs&&(this.subAggs=null)}}class lt{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,te.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 r={};for(var i in e){if("dataset"!==i)"latitude"===i||"timeMode"===i||"dayStart"===i||("dayEnd"===i||"hourStart"===i||"hourEnd"===i)||("transmittance"===i||"hourInterval"===i||"dayInterval"===i)?r[i]=e[i]:t[i]=e[i]}t.parameter=r}}class ht extends rt{constructor(e,r){super(e,r),this.format=r&&r.format||t.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}transformResult(e,r){var i;if((e=te.transformResult(e))&&this.format===t.GEOJSON&&"function"==typeof this.toGeoJSONResult)if(te.isArray(e)){for(var s=0;s<e.length;s++)e[s]=this.toGeoJSONResult(e[s]);i=e}else i=this.toGeoJSONResult(e);return i||(i=e),{result:i,options:r}}toGeoJSONResult(e){if(!e)return null;e.result&&e.result.resultGeometry&&(e=e.result);var t=new Ie;if(e.recordsets)for(var r=0,i=e.recordsets,s=i.length;r<s;r++)i[r].features&&(i[r].features=t.toGeoJSON(i[r].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 ut extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.AreaSolarRadiationService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof lt){var r=this,i={};e instanceof lt&&(r.url=te.urlPathAppend(r.url,`datasets/${e.dataset}/solarradiation`)),r.url=te.urlAppend(r.url,"returnContent=true"),lt.toObject(e,i);var s=te.toJSON(i);return r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}}class ct{constructor(e){this.exp=null,this.value=100,te.extend(this,e),this.CLASS_NAME="SuperMap.BufferDistance"}destroy(){this.exp=null,this.value=null}}class dt{constructor(e){this.endType=S.FLAT,this.leftDistance=new ct,this.rightDistance=new ct,this.semicircleLineSegment=4,this.radiusUnit=h.METER,e&&te.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 pt{constructor(e){this.bufferSetting=new dt,te.extend(this,e),this.CLASS_NAME="SuperMap.BufferAnalystParameters"}destroy(){this.bufferSetting&&(this.bufferSetting.destroy(),this.bufferSetting=null)}}class ft{constructor(e){this.expectCount=1e3,this.dataset=null,this.dataReturnMode=A.RECORDSET_ONLY,this.deleteExistResultDataset=!0,te.extend(this,e),this.CLASS_NAME="SuperMap.DataReturnOption"}destroy(){this.expectCount=null,this.dataset=null,this.dataReturnMode=null,this.deleteExistResultDataset=null}}class yt{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&&te.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,r=e.joinItems,i=r.length;t<i;t++)r[t].destroy();e.joinItems=null}if(e.linkItems){for(let t=0,r=e.linkItems,i=r.length;t<i;t++)r[t].destroy();e.linkItems=null}e.ids=null,e.orderBy=null,e.groupBy=null,e.fields=null}}class mt extends pt{constructor(e){super(e),this.dataset=null,this.filterQueryParameter=new yt,this.resultSetting=new ft,this.isAttributeRetained=!0,this.isUnion=!1,te.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 r in e)if("bufferSetting"===r)e.bufferSetting.radiusUnit=e.bufferSetting.radiusUnit.toUpperCase(),t.bufferAnalystParameter=e.bufferSetting;else if("resultSetting"===r)t.dataReturnOption=e.resultSetting;else{if("dataset"===r)continue;t[r]=e[r]}}}class gt extends pt{constructor(e){super(e),this.sourceGeometry=null,this.sourceGeometrySRID=null,e&&te.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 r in e)if("bufferSetting"===r){var i={};for(var s in e.bufferSetting)i[s]=e.bufferSetting[s];t.analystParameter=i}else"sourceGeometry"===r?t.sourceGeometry=Me.fromGeometry(e.sourceGeometry):t[r]=e[r]}}class vt extends ht{constructor(e,t){super(e,t),this.mode=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.BufferAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof mt?(i.mode="datasets",i.url=te.urlPathAppend(i.url,"datasets/"+e.dataset+"/buffer"),mt.toObject(e,r)):e instanceof gt&&(i.mode="geometry",i.url=te.urlPathAppend(i.url,"geometry/buffer"),gt.toObject(e,r));var s=te.toJSON(r);return this.returnContent=!0,i.request({method:"POST",data:s,scope:i,success:t,failure:t})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class bt{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&&te.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 St{constructor(e){this.type=_.UDB,this.datasetName="analystResult",this.datasourceInfo=null,this.outputPath="",te.extend(this,e),this.CLASS_NAME="SuperMap.OutputSetting"}destroy(){var e=this;e.type=null,e.datasetName=null,e.outputPath=null,e.datasourceInfo instanceof bt&&(e.datasourceInfo.destroy(),e.datasourceInfo=null)}}class xt{constructor(e){this.items=null,this.numericPrecision=1,this.rangeMode=f.EQUALINTERVAL,this.rangeCount="",this.colorGradientType=y.YELLOW_RED,te.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 _t{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;te.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 St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},"bounds"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class wt extends rt{constructor(e,t){super(e,t=t||{}),this.CLASS_NAME="SuperMap.ProcessingServiceBase"}destroy(){super.destroy()}getJobs(e,t){var r=this;return Ue.get(Ve.appendCredential(e),null,{proxy:r.proxy}).then(function(e){return e.json()}).then(function(e){const i={result:e,object:r,type:"processCompleted"};return t(i),i}).catch(function(e){const i={error:e,object:r,type:"processFailed"};return t(i),i})}addJob(e,t,r,i,s,n){var a=this,o=null;t&&t instanceof r&&(o=new Object,r.toObject(t,o));let l=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},a.headers||{});var h={proxy:a.proxy,headers:l,withCredentials:a.withCredentials,crossOrigin:a.crossOrigin,isInTheSameDomain:a.isInTheSameDomain};return Ue.post(Ve.appendCredential(e),JSON.stringify(o),h).then(function(e){return e.json()}).then(function(e){return e.succeed?a.transformResult(e,i,s,n):((e=a.transformErrorResult(e)).options=a,e.type="processFailed",s(e),e)}).catch(function(e){return(e=a.transformErrorResult({error:e})).options=a,e.type="processFailed",s(e),e})}transformResult(e,t,r,i){e=te.transformResult(e),t=t||1e3;var s=this;if(e)return new Promise(n=>{var a=setInterval(function(){Ue.get(Ve.appendCredential(e.newResourceLocation),{_t:(new Date).getTime()}).then(function(e){return e.json()}).then(function(e){if(n({object:s,id:e.id,state:e.state}),i({id:e.id,state:e.state,object:s}),"LOST"===e.state.runState||"KILLED"===e.state.runState||"FAILED"===e.state.runState){clearInterval(a);const t={error:e.state.errorMsg,state:e.state.runState,object:s,type:"processFailed"};n(t),r(t)}if("FINISHED"===e.state.runState&&e.setting.serviceInfo){clearInterval(a);const t={result:e,object:s,type:"processCompleted"};n(t),r(t)}}).catch(function(e){clearInterval(a);const t={error:e,object:s,type:"processFailed"};n(t),r(t)})},t)})}}class Ct extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(e){return super.getJobs(this.url,e)}getBuffersJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addBuffersJob(e,t,r,i){return super.addJob(this.url,e,_t,t,r,i)}}class At{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,te.extend(this,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=null}}class Mt extends rt{constructor(e,r){super(e,r),this.format=t.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}transformResult(e,r){var i;return(e=te.transformResult(e))&&this.format===t.GEOJSON&&"function"==typeof this.toGeoJSONResult&&(i=this.toGeoJSONResult(e)),i||(i=e),{result:i,options:r}}toGeoJSONResult(e){return null}}class Tt extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(!(e instanceof At))return null;var r;if(this.url=te.urlPathAppend(this.url,"burstAnalyse"),r={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.");return null!==e.edgeID?r.edgeID=e.edgeID:r.nodeID=e.nodeID,this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}class Et extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ChartFeatureInfoSpecsService"}destroy(){super.destroy(),te.reset(this)}processAsync(e){return this.isTempLayers||te.urlPathAppend(this.url,"chartFeatureInfoSpecs"),this.request({method:"GET",params:null,scope:this,success:e,failure:e})}}class Ot{constructor(e){this.isQueryPoint=null,this.isQueryLine=null,this.isQueryRegion=null,this.attributeFilter=null,this.chartFeatureInfoSpecCode=null,te.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 Pt{constructor(e){this.queryMode=null,this.bounds=null,this.chartLayerNames=null,this.chartQueryFilterParameters=null,this.returnContent=!0,this.startRecord=0,this.expectCount=null,te.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=[],r=this.chartLayerNames.length,i=0;i<r;i++)t.push('"'+this.chartLayerNames[i]+'"');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 Ot&&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 It{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,te.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,r=e.queryParams,i=r.length;t<i;t++)r[t].destroy();e.queryParams=null}e.startRecord=null,e.holdTime=null,e.returnCustomResult=null,e.prjCoordSys=null}}class Nt extends rt{constructor(e,r){super(e,r),r=r||{},this.returnContent=null,this.format=t.GEOJSON,te.extend(this,r);r.format&&(this.format=r.format.toUpperCase()),this.url&&(this.url=te.urlPathAppend(this.url,"queryResults"),this.CLASS_NAME="SuperMap.ChartQueryService")}destroy(){rt.prototype.destroy.apply(this,arguments),this.returnContent=null,this.format=null}processAsync(e,t){if(e instanceof Pt){var r,i=this;return i.returnContent=e.returnContent,r=e.getVariablesJson(),i.returnContent&&(i.url=te.urlAppend(i.url,"returnContent=true")),i.request({method:"POST",data:r,scope:i,success:t,failure:t})}}transformResult(e,r){if((e=te.transformResult(e))&&e.recordsets&&this.format===t.GEOJSON)for(var i=0,s=e.recordsets,n=s.length;i<n;i++)if(s[i].features){var a=new Ie;s[i].features=a.toGeoJSON(s[i].features)}return{result:e,options:r}}getQueryParameters(e){return new It({queryMode:e.queryMode,bounds:e.bounds,chartLayerNames:e.chartLayerNames,chartQueryFilterParameters:e.chartQueryFilterParameters,returnContent:e.returnContent})}}class Lt{constructor(e){e=e||{},this.elevation=null,this.color=null,te.extend(this,e);var t=this.color;t&&(this.color=new _e(t.red,t.green,t.blue)),this.CLASS_NAME="SuperMap.ColorDictionary"}destroy(){te.reset(this)}toServerJSONObject(){var e={};return e=te.copyAttributes(e,this)}}class kt{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,te.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 kt,te.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 Rt{constructor(e){this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,te.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,t){if(e instanceof Rt){var r,i=this;return i.url=te.urlPathAppend(i.url,"weightmatrix"),r={parameter:te.toJSON(e.parameter),nodes:i.getJson(e.isAnalyzeById,e.nodes)},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(!1===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+=t[e];return r+="]"}}class Gt extends rt{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,te.extend(this,t),this.CLASS_NAME="SuperMap.DataFlowService"}initBroadcast(){var e=this;return this.broadcastWebSocket=this._connect(te.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(te.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(){rt.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 te.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 r=JSON.parse(e.data);e.featureResult=r,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}_connect(e){return e=Ve.appendCredential(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}}class jt{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,te.extend(this,e);var t=this.bounds;t&&(this.bounds=new ne(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y)),this.CLASS_NAME="SuperMap.DatasetInfo"}destroy(){te.reset(this)}toServerJSONObject(){var e={};return(e=te.copyAttributes(e,this)).bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class Bt{constructor(e){this.operation=x.UNION,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.OverlayAnalystParameters"}destroy(){this.operation=null}}class Ut extends Bt{constructor(e){super(e),this.operateDataset=null,this.operateDatasetFields=[],this.operateDatasetFilter=new yt,this.operateRegions=[],this.sourceDataset=null,this.sourceDatasetFields=[],this.sourceDatasetFilter=new yt,this.tolerance=0,this.resultSetting=new ft,te.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,r=e.operateRegions,i=r.length;t<i;t++)r[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 r in e)if("sourceDataset"!==r)if("operateRegions"===r){t.operateRegions=[];var i=e.operateRegions;for(var s in i)i.hasOwnProperty(s)&&(t.operateRegions[s]=Me.fromGeometry(i[s]))}else"resultSetting"===r?t.dataReturnOption=e.resultSetting:t[r]=e[r]}}class Vt{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&&te.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':"+te.toJSON(this.datumValue);if(e+=",'interval':"+te.toJSON(this.interval),e+=",'resampleTolerance':"+te.toJSON(this.resampleTolerance),e+=",'smoothMethod':"+te.toJSON(this.smoothMethod),e+=",'smoothness':"+te.toJSON(this.smoothness),null!=this.expectedZValues&&(e+=",'expectedZValues':"+te.toJSON(this.expectedZValues)),null!=this.clipRegion){var t=this.clipRegion;this.clipRegion instanceof Q&&this.clipRegion.components&&(t=Me.fromGeometry(this.clipRegion)),e+=",'clipRegion':"+te.toJSON(t)}return"{"+e+"}"}}class Jt{constructor(e){this.resolution=0,this.extractParameter=new Vt,this.resultSetting=new ft,this.surfaceAnalystMethod=C.ISOLINE,e&&te.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 zt extends Jt{constructor(e){super(e),this.dataset=null,this.filterQueryParameter=new yt,this.zValueFieldName=null,e&&te.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 r in e)if("filterQueryParameter"===r&&(t.filterQueryParameter=e.filterQueryParameter),"extractParameter"===r)e.extractParameter.clipRegion instanceof Q&&e.extractParameter.clipRegion.components&&(e.extractParameter.clipRegion=Me.fromGeometry(e.extractParameter.clipRegion)),t.extractParameter=e.extractParameter;else{if("dataset"===r)continue;if("surfaceAnalystMethod"===r)continue;t[r]=e[r]}}}class qt{constructor(e){e&&(this.clipRegion=null,this.createResultDataset=!1,this.resultDatasetName=null,this.resultDatasourceName=null,this.returnResultRegion=!0,te.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 Ht extends qt{constructor(e){super(e),this.filterQueryParameter=null,this.dataset=null,e&&te.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 r in e)"clipRegion"===r?t.clipRegion=Me.fromGeometry(e.clipRegion):t[r]=e[r]}}class Wt extends rt{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.DatasourceService"}destroy(){super.destroy()}getDatasourceService(e,t){let r=te.urlPathAppend(this.url,`datasources/name/${e}`);return this.processAsync(r,"GET",t)}getDatasourcesService(e){let t=te.urlPathAppend(this.url,"datasources");return this.processAsync(t,"GET",e)}setDatasourceService(e,t){if(!e)return;const r=te.urlPathAppend(this.url,`datasources/name/${e.datasourceName}`);return this.processAsync(r,"PUT",t,e)}processAsync(e,t,r,i){let s={url:e,method:t,scope:this,success:r,failure:r};return i&&(s.data=te.toJSON(i)),this.request(s)}}class Yt{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,te.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 r in e)"dataset"!==r&&(t[r]=e[r])}}class Xt extends ht{constructor(e,t){super(e,t),this.mode=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.DensityAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r=this,i=new Object;e instanceof Yt&&(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/densityanalyst/kernel"),r.mode="kernel"),Yt.toObject(e,i);var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class Qt{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.features=null,this.editType=M.ADD,this.IDs=null,this.returnContent=!1,this.isUseBatch=!1,te.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,r,i;if(e.editType===M.DELETE){if(null===e.IDs)return;i={ids:e.IDs}}else if(i=[],e.features){r=e.features.length;for(var s=0;s<r;s++)(t=e.features[s]).geometry=Me.fromGeometry(t.geometry),i.push(t)}return te.toJSON(i)}}class Zt extends rt{constructor(e,t){super(e,t),this.returnContent=!1,this.isUseBatch=!1,t&&te.extend(this,t),this.url=te.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,t){if(e instanceof Qt){var r=this,i="POST",s="",n=e.editType,a=null;if(r.returnContent=e.returnContent,r.isUseBatch=e.isUseBatch,a=Qt.toJsonParameters(e),n===M.DELETE){a=s=te.toJSON(e.IDs);var o=te.urlAppend(r.url,te.getParameterString({ids:s}));Ue.urlIsLong(o)?(r.url=te.urlAppend(r.url,te.getParameterString({_method:"DELETE"})),i="POST"):(r.url=o,i="DELETE")}else n===M.UPDATE?i="PUT":(r.isUseBatch&&(r.url=te.urlAppend(r.url,`isUseBatch=${r.isUseBatch}`),r.returnContent=!1),r.returnContent&&(r.url=te.urlAppend(r.url,"returnContent=true"),i="POST"));return r.request({method:i,data:a,scope:r,success:t,failure:t})}}getMetaData(e,t){var r=e.featureId;return this.url=te.urlPathAppend(this.url,r+"/metadata"),this.request({method:"GET",data:null,scope:this,success:t,failure:t})}}class Kt{constructor(e){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=!1,te.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalyst3DParameters"}destroy(){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=null}}class $t extends Kt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DParameters"}destroy(){super.destroy()}}class er extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DService"}destroy(){rt.prototype.destroy.apply(this,arguments)}processAsync(e,t){if(e instanceof $t){var r;return this.url=te.urlPathAppend(this.url,"sinks"),r={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class tr extends Kt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DParameters"}destroy(){super.destroy()}}class rr extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof tr){var r;return this.url=te.urlPathAppend(this.url,"sources"),r={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class ir{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,this.queryType=null,te.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 sr extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystStreamService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof ir){var r,i=this;if(0===e.queryType)i.url=te.urlPathAppend(i.url,"upstreamcirticalfaclilities");else{if(1!==e.queryType)return;i.url=te.urlPathAppend(i.url,"downstreamcirticalfaclilities")}if(r={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},!(null!==e.edgeID&&null!==e.nodeID||null===e.edgeID&&null===e.nodeID))return null!==e.edgeID?r.edgeID=e.edgeID:r.nodeID=e.nodeID,i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}}class nr extends Kt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DParameters"}destroy(){super.destroy()}}class ar extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof nr){var r;return this.url=te.urlPathAppend(this.url,"tracedownresult"),r={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class or extends Kt{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DParameters"}destroy(){super.destroy()}}class lr extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof or){var r;return this.url=te.urlPathAppend(this.url,"traceupresult"),r={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class hr extends Kt{constructor(e){super(e),e=e||{},this.sourceNodeIDs=null,te.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DParameters"}destroy(){super.destroy(),this.sourceNodeIDs=null}}class ur extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof hr){var r;return this.url=te.urlPathAppend(this.url,"upstreamcirticalfaclilities"),r={sourceNodeIDs:e.sourceNodeIDs,edgeID:e.edgeID,nodeID:e.nodeID,isUncertainDirectionValid:e.isUncertainDirectionValid},this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class cr{constructor(e){this.datasource=null,this.dataset=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.FieldParameters"}destroy(){this.datasource=null,this.dataset=null}}class dr extends cr{constructor(e){super(e),this.fieldName=null,this.statisticMode=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.FieldStatisticsParameters"}destroy(){this.fieldName=null,this.statisticMode=null}}class pr extends rt{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.FieldStatisticService"}destroy(){super.destroy();this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null}processAsync(e){var t=this,r="datasources/"+t.datasource+"/datasets/"+t.dataset+"/fields/"+t.field+"/"+t.statisticMode;return t.url=te.urlPathAppend(t.url,r),t.request({method:"GET",data:null,scope:t,success:e,failure:e})}}class fr{constructor(e){this.event=null,this.expectFacilityCount=1,this.facilities=null,this.fromEvent=!1,this.isAnalyzeById=!1,this.maxWeight=0,this.parameter=new Ft,te.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 yr extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindClosestFacilitiesService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof fr){var r,i=this;return i.url=te.urlPathAppend(i.url,"closestfacility"),r={expectFacilityCount:e.expectFacilityCount,fromEvent:e.fromEvent,maxWeight:e.maxWeight,parameter:te.toJSON(e.parameter),event:te.toJSON(e.event),facilities:i.getJson(e.isAnalyzeById,e.facilities)},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(!1===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.facilityPathList)return e;var t=new Ie;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 mr{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,te.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,r=e.supplyCenters,i=r.length;t<i;t++)r[t].destroy();e.supplyCenters=null}}}class gr extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindLocationService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof mr){var r,i=this;return i.url=te.urlPathAppend(i.url,"location"),r={isFromCenter:e.isFromCenter,expectedSupplyCenterCount:e.expectedSupplyCenterCount,weightName:e.weightName,turnWeightField:e.turnWeightField,returnEdgeFeature:!0,returnEdgeGeometry:!0,returnNodeFeature:!0,mapParameter:te.toJSON(e.mapParameter),supplyCenters:i.getCentersJson(e.supplyCenters)},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getCentersJson(e){for(var t="[",r=e?e.length:0,i=0;i<r;i++)i>0&&(t+=","),t+=te.toJSON(e[i]);return t+="]"}toGeoJSONResult(e){if(!e)return null;var t=new Ie;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class vr{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,te.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 br extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof vr){var r,i=this,s=i.getJson(e.isAnalyzeById,e.centers),n=i.getJson(e.isAnalyzeById,e.nodes);return i.url=te.urlPathAppend(i.url,"mtsppath"),r={centers:s,nodes:n,parameter:te.toJSON(e.parameter),hasLeastTotalCost:e.hasLeastTotalCost},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(!1===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.pathList)return null;var t=new Ie;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 Sr{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new Ft,te.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 xr extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Sr){var r,i=this;return i.url=te.urlPathAppend(i.url,"path"),r={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:te.toJSON(e.parameter),nodes:i.getJson(e.isAnalyzeById,e.nodes)},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(!1===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new Ie;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 _r{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new Ft,te.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 wr extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof _r){var r,i=this;return i.url=te.urlPathAppend(i.url,"servicearea"),r={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:te.toJSON(e.parameter),centers:i.getJson(e.isAnalyzeById,e.centers),weights:i.getJson(!0,e.weights)},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(!1===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e<i;e++)e>0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.serviceAreaList)return e;var t=new Ie;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 Cr{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,te.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 Ar extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Cr){var r,i=this;return i.url=te.urlPathAppend(i.url,"tsppath"),r={parameter:te.toJSON(e.parameter),endNodeAssigned:e.endNodeAssigned,nodes:i.getNodesJson(e)},i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}getNodesJson(e){var t,r,i,s,n="";if(!1===e.isAnalyzeById){for(t="[",r=0,i=(s=e.nodes).length;r<i;r++)r>0&&(t+=","),t+='{"x":'+s[r].x+',"y":'+s[r].y+"}";n+=t+="]"}else if(!0===e.isAnalyzeById){let t="[",r=e.nodes,i=r.length;for(let e=0;e<i;e++)e>0&&(t+=","),t+=r[e];n+=t+="]"}return n}toGeoJSONResult(e){if(!e||!e.tspPathList)return null;var t=new Ie;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 Mr{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&&te.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 Tr extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GenerateSpatialDataService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Mr){var r;return r=this.getJsonParameters(e),this.request({method:"POST",data:r,scope:this,success:t,failure:t})}}getJsonParameters(e){var t="datasets/"+e.routeTable+"/linearreferencing/generatespatialdata";return this.url=te.urlPathAppend(this.url,t),this.url=te.urlAppend(this.url,"returnContent=true"),te.toJSON(e)}}class Er extends Bt{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&&te.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 r in e)if("sourceGeometry"===r)t.sourceGeometry=Me.fromGeometry(e.sourceGeometry);else if("sourceGeometries"===r){for(var i=[],s=0;s<e.sourceGeometries.length;s++)i.push(Me.fromGeometry(e.sourceGeometries[s]));t.sourceGeometries=i}else if("operateGeometry"===r)t.operateGeometry=Me.fromGeometry(e.operateGeometry);else if("operateGeometries"===r){for(var n=[],a=0;a<e.operateGeometries.length;a++)n.push(Me.fromGeometry(e.operateGeometries[a]));t.operateGeometries=n}else t[r]=e[r]}}class Or extends Jt{constructor(e){super(e),this.points=null,this.zValues=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.GeometrySurfaceAnalystParameters"}destroy(){super.destroy();if(this.points){for(var e=0,t=this.points,r=t.length;e<r;e++)t[e].destroy();this.points=null}this.zValues=null}}class Pr extends qt{constructor(e){super(e),this.points=null,e&&te.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 r in e)"clipRegion"===r?t.clipRegion=Me.fromGeometry(e.clipRegion):t[r]=e[r]}}class Ir extends rt{constructor(e,t){super(e,t=t||{}),this.CLASS_NAME="SuperMap.GeoprocessingService",this.headers={},this.crossOrigin=!0}getTools(e){return this._processAsync({url:`${this.url}/list`,callback:e})}getTool(e,t){return this._processAsync({url:`${this.url}/${e}`,callback:t})}execute(e,t,r,i){const s={parameter:t=t||null,environment:r=r||null};return this._processAsync({url:`${this.url}/${e}/execute`,executeParamter:s,callback:i})}submitJob(e,t,r,i){t=t||null,r=r||null;const s=JSON.stringify({parameter:t,environments:r});return this._processAsync({url:`${this.url}/${e}/jobs`,method:"POST",callback:i,params:s})}waitForJobCompletion(e,t,r,i){const s=this,n=setInterval(function(){s._processAsync({url:`${s.url}/${t}/jobs/${e}`,callback:function(e){const t=e.result.state.runState;e.options.statusCallback&&e.options.statusCallback(t),-1!==["FINISHED","FAILED","CANCELED"].indexOf(t)&&(clearInterval(n),i(e))}})},r.interval)}getJobInfo(e,t,r){return this._processAsync({url:`${this.url}/${e}/jobs/${t}`,callback:r})}cancelJob(e,t,r){return this._processAsync({url:`${this.url}/${e}/jobs/${t}/cancel`,callback:r})}getJobs(e,t){let r=`${this.url}/jobs`;e&&"string"==typeof e?r=`${this.url}/${e}/jobs`:t=e,this._processAsync({url:r,callback:t})}getResults(e,t,r,i){let s=`${this.url}/${e}/jobs/${t}/results`;return r&&("string"==typeof r?s=`${s}/${r}`:i=r),this._processAsync({url:s,callback:i})}_processAsync({url:e,method:t,callback:r,paramter:i}){return this.request({url:e,method:t||"GET",params:i,headers:{"Content-type":"application/json"},scope:this,success:r,failure:r})}}class Nr{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&&te.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 Lr extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GeoRelationAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Nr){var r=this;r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/georelation");var i=te.toJSON(e);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}}class kr extends rt{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();this.datasource=null,this.dataset=null}getDatasetsService(e,t){const r=te.urlPathAppend(this.url,`datasources/name/${e}/datasets`);return this.processAsync(r,"GET",t)}getDatasetService(e,t,r){const i=te.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);return this.processAsync(i,"GET",r)}setDatasetService(e,t){if(!e)return;const r=te.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);return delete e.datasourceName,this.processAsync(r,"PUT",t,e)}deleteDatasetService(e,t,r){const i=te.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);return this.processAsync(i,"DELETE",r)}processAsync(e,t,r,i){let s={url:e,method:t,scope:this,success:r,failure:r};return i&&(s.data=te.toJSON(i)),this.request(s)}}class Fr{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,te.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 Rr extends Fr{constructor(e){super(e),this.getFeatureMode=Rr.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,te.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,r,i;return r={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},i={datasetNames:e.datasetNames,getFeatureMode:Rr.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new yt).name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode=Rr.getFeatureMode.BOUNDS_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),e.aggregations&&(i.aggregations=e.aggregations),te.toJSON(i)}}Rr.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class Dr extends rt{constructor(e,r){super(e,r),r=r||{},this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=t.GEOJSON,te.extend(this,r),this.url=te.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,t){if(e){var r,i=this,s=!0;return i.returnContent=e.returnContent,i.fromIndex=e.fromIndex,i.toIndex=e.toIndex,i.maxFeatures=e.maxFeatures,i.hasGeometry=e.hasGeometry,i.returnContent&&(s=!1),null!=i.fromIndex&&null!=i.toIndex&&!isNaN(i.fromIndex)&&!isNaN(i.toIndex)&&i.fromIndex>=0&&i.toIndex>=0&&!s&&(i.url=te.urlAppend(i.url,`fromIndex=${i.fromIndex}&toIndex=${i.toIndex}`)),e.returnCountOnly&&(i.url=te.urlAppend(i.url,"&returnCountOnly="+e.returnContent)),r=i.getJsonParameters(e),i.request({method:"POST",data:r,scope:i,success:t,failure:t})}}transformResult(e,r){if(e=te.transformResult(e),this.format===t.GEOJSON&&e.features){var i=new Ie;e.features=i.toGeoJSON(e.features)}return{result:e,options:r}}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Gr extends Dr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return Rr.toJsonParameters(e)}}class jr extends Fr{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,te.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,r,i;return i=Me.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:i},e.fields&&((t=new yt).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_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),te.toJSON(r)}}class Br extends Dr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof jr)return jr.toJsonParameters(e)}}class Ur extends Fr{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,te.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,r,i;return r=Me.fromGeometry(e.geometry),i={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new yt).name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode="SPATIAL_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),e.aggregations&&(i.aggregations=e.aggregations),te.toJSON(i)}}class Vr extends Dr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return Ur.toJsonParameters(e)}}class Jr extends Fr{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,te.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,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((r=new yt).name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),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),te.toJSON(t)}}class zr extends Dr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return Jr.toJsonParameters(e)}}class qr extends Fr{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,te.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),te.toJSON(t)}}class Hr extends Dr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return qr.toJsonParameters(e)}}class Wr extends rt{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();this.datasource=null,this.dataset=null}processAsync(e){var t=this;return t.url=te.urlPathAppend(t.url,`datasources/${t.datasource}/datasets/${t.dataset}/fields`),t.request({method:"GET",data:null,scope:t,success:e,failure:e})}}class Yr{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,te.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null}}class Xr extends rt{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&te.extend(this,t),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 Yr){te.extend(this,e);var r=this;return r.url=te.urlPathAppend(r.url,`datasources/${r.dataSourceName}/datasets/${r.datasetName}`),r.request({method:"GET",data:null,scope:r,success({result:e}){t&&r.getDatasetInfoCompleted(e,t)},failure:t}).then(({result:e})=>r.getDatasetInfoCompleted(e))}}getDatasetInfoCompleted(e,t){return e=te.transformResult(e),this.datasetType=e.datasetInfo.type,this.queryGridInfos(t)}queryGridInfos(e){var t=this,r=te.urlPathAppend(t.url,"GRID"==t.datasetType?"gridValue":"imageValue");return null!=t.X&&null!=t.Y&&(r=te.urlAppend(r,`x=${t.X}&y=${t.Y}`)),t.request({url:r,method:"GET",data:null,scope:t,success:e,failure:e})}}class Qr{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){this.memoryData&&(this.memoryData.destroy(),this.memoryData=null),this.type=null}toServerJSONObject(){}}class Zr{constructor(e){this.align=m.BASELINECENTER,this.backColor=new _e(255,255,255),this.foreColor=new _e(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&&te.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 Zr(e);return te.copy(t,e),t.backColor=_e.fromJson(e.backColor),t.foreColor=_e.fromJson(e.foreColor),t}}class Kr{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new Zr,e&&te.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 Kr;return te.copy(t,e),t}}}class $r{constructor(e){this.caption=null,this.style=new we,this.unique=null,this.visible=!0,e&&te.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=te.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new $r;return te.copy(t,e),t.style=we.fromJson(e.style),t}}class ei{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&te.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 ei;return te.copy(t,e),t}}}class ti{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new Zr,e&&te.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,r=e.styles,i=r.length;t<i;t++)r[t].destroy();e.styles=null}}static fromObj(e){if(e){var t=new ti,r=e.styles;if(te.copy(t,e),t.defaultStyle=new Zr(e.defaultStyle),r){t.styles=[];for(var i=0,s=r.length;i<s;i++)t.styles.push(new Zr(r[i]))}return t}}}class ri{constructor(e){this.maxTextHeight=0,this.maxTextWidth=0,this.minTextHeight=0,this.minTextWidth=0,this.uniformStyle=new Zr,this.uniformMixedStyle=null,e&&te.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 ri;return te.copy(t,e),t.uniformStyle=Zr.fromObj(e.uniformStyle),t.uniformMixedStyle=ti.fromObj(e.uniformMixedStyle),t}}}class ii{constructor(e){this.isAlongLine=!0,this.alongLineDirection=g.LB_TO_RT,this.angleFixed=!1,this.repeatedLabelAvoided=!1,this.repeatIntervalFixed=!1,this.labelRepeatInterval=0,e&&te.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 ii;return te.copy(t,e),t}}}class si{constructor(e){this.labelBackShape=v.NONE,this.backStyle=new we,e&&te.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 si;return t.labelBackShape=e.labelBackShape,t.backStyle=we.fromJson(e.backStyle),t}}}class ni extends Qr{constructor(e){super("LABEL",e),this.alongLine=new ii,this.background=new si,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 ei,this.overlapAvoided=!0,this.rangeExpression=null,this.uniqueExpression=null,this.smallGeometryLabeled=!1,this.text=new ri,this.textSpace=0,e&&te.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,r=e.items,i=r.length;t<i;t++)r[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 te.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 ni,r=e.items,i=e.uniqueItems,s=e.matrixCells;if(e.matrixCells=null,te.copy(t,e),t.alongLine=ii.fromObj(e),t.background=si.fromObj(e),r){t.items=[];for(var n=0,a=r.length;n<a;n++)t.items.push(Kr.fromObj(r[n]))}if(i){t.uniqueItems=[];for(let e=0,r=i.length;e<r;e++)t.uniqueItems.push($r.fromObj(i[e]))}if(s){t.matrixCells=[];for(let e=0,t=s.length;e<t;e++);}return t.offset=ei.fromObj(e),t.text=ri.fromObj(e),t}}}class ai extends Qr{constructor(e){super("UNIQUE",e),this.defaultStyle=new we,this.items=null,this.uniqueExpression=null,this.colorGradientType=y.YELLOW_RED,e&&te.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=te.copyAttributes(e,this)).defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,i=0;i<r;i++)t.push(e.items[i].toServerJSONObject());e.items=t}return e}static fromObj(e){var t=new ai,r=e.items,i=r?r.length:0;te.extend(t,e),t.items=[],t.defaultStyle=we.fromJson(e.defaultStyle);for(var s=0;s<i;s++)t.items.push($r.fromObj(r[s]));return t}}class oi{constructor(e){this.axesColor=new _e(0,0,0),this.axesDisplayed=!1,this.axesGridDisplayed=!1,this.axesTextDisplayed=!1,this.axesTextStyle=new Zr,e&&te.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 oi;return te.copy(t,e),t.axesColor=_e.fromJson(e.axesColor),t.axesTextStyle=Zr.fromObj(e.axesTextStyle),t}}}class li{constructor(e){this.maxGraphSize=0,this.minGraphSize=0,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphSize"}destroy(){this.maxGraphSize=null,this.minGraphSize=null}static fromObj(e){var t=new li;return te.copy(t,e),t}}class hi{constructor(e){this.graphTextDisplayed=!1,this.graphTextFormat=u.CAPTION,this.graphTextStyle=new Zr,e&&te.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 hi;return te.copy(t,e),t.graphTextStyle=Zr.fromObj(e.graphTextStyle),t}}class ui{constructor(e){this.caption=null,this.graphExpression=null,this.memoryDoubleValues=null,this.uniformStyle=new we,e&&te.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 ui;return te.copy(t,e),t.uniformStyle=we.fromJson(e.uniformStyle),t}}}class ci extends Qr{constructor(e){super("GRAPH",e),this.barWidth=0,this.graduatedMode=p.CONSTANT,this.graphAxes=new oi,this.graphSize=new li,this.graphSizeFixed=!1,this.graphText=new hi,this.graphType=c.AREA,this.graphAxesTextDisplayMode=d.NONE,this.items=null,this.memoryKeys=null,this.negativeDisplayed=!1,this.offset=new ei,this.overlapAvoided=!0,this.roseAngle=0,this.startAngle=0,e&&te.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,r=e.items,i=r.length;t<i;t++)r[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 te.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 ci,r=e.items,i=r?r.length:0;te.copy(t,e),t.items=[],t.graphAxes=oi.fromObj(e),t.graphSize=li.fromObj(e),t.graphText=hi.fromObj(e),t.offset=ei.fromObj(e);for(var s=0;s<i;s++)t.items.push(ui.fromObj(r[s]));return t}}class di extends Qr{constructor(e){super("DOTDENSITY",e),this.dotExpression=null,this.style=new we,this.value=null,e&&te.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=te.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){if(e){var t=new di;return te.copy(t,e),t.style=we.fromJson(e.style),t}}}class pi{constructor(e){this.negativeDisplayed=!1,this.negativeStyle=new we,this.positiveStyle=new we,this.zeroDisplayed=!1,this.zeroStyle=new we,e&&te.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 pi;return te.copy(t,e),t.negativeStyle=we.fromJson(e.negativeStyle),t.positiveStyle=we.fromJson(e.positiveStyle),t.zeroStyle=we.fromJson(e.zeroStyle),t}}}class fi extends Qr{constructor(e){super("GRADUATEDSYMBOL",e),this.baseValue=0,this.expression=null,this.graduatedMode=p.CONSTAN,this.offset=new ei,this.style=new pi,e&&te.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 te.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 fi;return te.copy(t,e),t.offset=ei.fromObj(e),t.style=pi.fromObj(e),t}}}class yi{constructor(e){this.caption=null,this.end=0,this.start=0,this.style=new we,this.visible=!0,e&&te.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=te.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){if(e){var t=new yi;return te.copy(t,e),t.style=we.fromJson(e.style),t}}}class mi extends Qr{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=y.YELLOW_RED,e&&te.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 mi;te.copy(t,e);var r=e.items,i=r?r.length:0;t.items=[];for(var s=0;s<i;s++)t.items.push(yi.fromObj(r[s]));return t}}}class gi{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,te.extend(this,e),this.CLASS_NAME="SuperMap.UGCLayer"}destroy(){te.reset(this)}fromJson(e){e=e||{},te.extend(this,e);var t=this.bounds;t&&(this.bounds=new ne(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y))}toServerJSONObject(){var e={};return(e=te.copyAttributes(e,this)).bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class vi extends gi{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(),te.reset(this)}fromJson(e){super.fromJson(e)}toServerJSONObject(){return super.toServerJSONObject()}}class bi{constructor(e){this.foreignTableName=null,this.joinFilter=null,this.joinType=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.JoinItem"}destroy(){this.foreignTableName=null,this.joinFilter=null,this.joinType=null}toServerJSONObject(){var e={};return e=te.copyAttributes(e,this)}}class Si extends vi{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 jt(this.datasetInfo)),this.joinItems&&this.joinItems.length){for(var t=[],r=0;r<this.joinItems.length;r++)t[r]=new bi(this.joinItems[r]);this.joinItems=t}}destroy(){super.destroy(),te.reset(this)}toServerJSONObject(){var e=super.toServerJSONObject();if(e.joinItems){for(var t=[],r=0;r<e.joinItems.length;r++)e.joinItems[r].toServerJSONObject&&(t[r]=e.joinItems[r].toServerJSONObject());e.joinItems=t}return e.datasetInfo&&e.datasetInfo.toServerJSONObject&&(e.datasetInfo=e.datasetInfo.toServerJSONObject()),e}}class xi extends Si{constructor(e){super(e=e||{}),this.theme=null,this.themeElementPosition=null,this.CLASS_NAME="SuperMap.ServerTheme"}destroy(){super.destroy(),te.reset(this)}fromJson(e){super.fromJson(e);var t=this.theme;switch(t&&t.type){case"LABEL":this.theme=ni.fromObj(t);break;case"UNIQUE":this.theme=ai.fromObj(t);break;case"GRAPH":this.theme=ci.fromObj(t);break;case"DOTDENSITY":this.theme=di.fromObj(t);break;case"GRADUATEDSYMBOL":this.theme=fi.fromObj(t);break;case"RANGE":this.theme=mi.fromObj(t)}this.themeElementPosition&&(this.themeElementPosition=new se(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 _i extends Si{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(),te.reset(this)}fromJson(e){if(super.fromJson(e),this.specialColor&&(this.specialColor=new _e(this.specialColor.red,this.specialColor.green,this.specialColor.blue)),this.colors){var t,r=[];for(var i in this.colors)t=this.colors[i],r.push(new _e(t.red,t.green,t.blue));this.colors=r}if(this.dashStyle&&(this.dashStyle=new we(this.dashStyle)),this.solidStyle&&(this.solidStyle=new we(this.solidStyle)),this.colorDictionary){var s,n=[];for(var a in this.colorDictionary)s=this.colorDictionary[a],n.push(new Lt({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 wi extends Si{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(),te.reset(this)}fromJson(e){super.fromJson(e),this.transparentColor&&(this.transparentColor=new _e(this.transparentColor.red,this.transparentColor.green,this.transparentColor.blue))}toServerJSONObject(){return super.toServerJSONObject()}}class Ci extends Si{constructor(e){super(e=e||{}),this.style=null,this.CLASS_NAME="SuperMap.Vector"}destroy(){super.destroy(),te.reset(this)}fromJson(e){super.fromJson(e);var t=this.style;t&&(this.style=new we(t))}toServerJSONObject(){var e=super.toServerJSONObject();return e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}}class Ai extends rt{constructor(e,t){super(e,t),this.isTempLayers=!1,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.GetLayersInfoService"}destroy(){super.destroy(),te.reset(this)}processAsync(e){var t=this;return t.isTempLayers||(t.url=te.urlPathAppend(t.url,"layers")),t.request({method:"GET",params:null,scope:t,success:e,failure:e})}transformResult(e,t){var r,i;return i=(r=!!(e=te.transformResult(e))&&e.length>0?e[0].subLayers.layers:null)?r.length:0,this.handleLayers(i,r),{result:e[0],options:t}}handleLayers(e,t){var r;if(e)for(var i=0;i<e;i++){if(t[i].subLayers&&t[i].subLayers.layers&&t[i].subLayers.layers.length>0)this.handleLayers(t[i].subLayers.layers.length,t[i].subLayers.layers);else switch(t[i].ugcLayerType){case"THEME":(r=new xi).fromJson(t[i]),t[i]=r;break;case"GRID":(r=new _i).fromJson(t[i]),t[i]=r;break;case"IMAGE":(r=new wi).fromJson(t[i]),t[i]=r;break;case"VECTOR":(r=new Ci).fromJson(t[i]),t[i]=r}}}}class Mi{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,te.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 r in e)if("inputPoints"===r&&"geometry"===e.InterpolationAnalystType){for(var i=[],s=0;s<e.inputPoints.length;s++){var n=e.inputPoints[s],a={x:n.x,y:n.y,z:n.tag};i.push(a)}t[r]=i}else t[r]=e[r]}}class Ti extends Mi{constructor(e){super(e),this.smooth=.1,this.tension=40,this.searchMode=null,this.expectedCount=12,this.maxPointCountForInterpolation=200,this.maxPointCountInNode=50,e&&te.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 r in e)t[r]=e[r]}}class Ei extends Mi{constructor(e){super(e),e&&te.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationDensityAnalystParameters"}destroy(){super.destroy()}}class Oi extends Mi{constructor(e){super(e),this.power=2,this.searchMode=null,this.expectedCount=12,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationIDWAnalystParameters"}destroy(){super.destroy();this.power=null,this.searchMode=null,this.expectedCount=null}}class Pi extends Mi{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&&te.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 Ii extends ht{constructor(e,t){super(e,t),this.mode=null,t&&te.extend(this,t)}destroy(){super.destroy(),this.mode=null,this.CLASS_NAME="SuperMap.InterpolationAnalystService"}processAsync(e,t){var r={},i=this;e instanceof Ei?(i.mode="Density","geometry"===e.InterpolationAnalystType?i.url=te.urlPathAppend(i.url,"geometry/interpolation/density"):i.url=te.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/density")):e instanceof Oi?(i.mode="IDW","geometry"===e.InterpolationAnalystType?i.url=te.urlPathAppend(i.url,"geometry/interpolation/idw"):i.url=te.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/idw")):e instanceof Ti?(i.mode="RBF","geometry"===e.InterpolationAnalystType?i.url=te.urlPathAppend(i.url,"geometry/interpolation/rbf"):i.url=te.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/rbf")):e instanceof Pi&&(i.mode="Kriging","geometry"===e.InterpolationAnalystType?i.url=te.urlPathAppend(i.url,"geometry/interpolation/kriging"):i.url=te.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/kriging")),Mi.toObject(e,r);var s=te.toJSON(r);return i.url=te.urlAppend(i.url,"returnContent=true"),i.request({method:"POST",data:s,scope:i,success:t,failure:t})}}class Ni{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=L.SQUAREMILE,this.output=null,this.mappingParameters=null,te.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 St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},"query"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Li extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/density"),this.CLASS_NAME="SuperMap.KernelDensityJobsService"}destroy(){super.destroy()}getKernelDensityJobs(e){return super.getJobs(this.url,e)}getKernelDensityJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addKernelDensityJob(e,t,r,i){return super.addJob(this.url,e,Ni,t,r,i)}}class ki{constructor(){this.CLASS_NAME="LabelMatrixCell"}}class Fi extends rt{constructor(e,t){super(e,t),this.projection=null,this.CLASS_NAME="SuperMap.MapService",t&&te.extend(this,t);var r=this;if(r.projection){var i=r.projection.split(":");i instanceof Array&&(2===i.length&&(r.url=te.urlAppend(r.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${i[1]}"}`)}`)),1===i.length&&(r.url=te.urlAppend(r.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${i[0]}"}`)}`)))}}destroy(){super.destroy()}processAsync(e){return this.request({method:"GET",scope:this,success:e,failure:e})}transformResult(e,t){var r=(e=te.transformResult(e)).code>=200&&e.code<300||0==e.code||304===e.code,i=e.code&&r;return!e.code||i?{result:e,options:t}:{error:e,options:t}}}class Ri{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,te.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 r in e)if("dataset"!==r&&(t[r]=e[r]),"extractRegion"===r&&e[r]){for(var i=e[r].components[0].components,s={},n=[],a=i.length,o=0;o<a-1;o++){var l={};l.x=i[o].x,l.y=i[o].y,n.push(l)}s.points=n,s.type="REGION",t[r]=s}}}class Di extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.MathExpressionAnalysisService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof Ri&&(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/mathanalyst")),Ri.toObject(e,i);var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class Gi{constructor(e,t){e&&(this.geometry=e,this.unit=l.METER,this.prjCoordSys=null,this.distanceMode=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.MeasureParameters")}destroy(){this.geometry=null,this.unit=null,this.prjCoordSys=null}}class ji extends rt{constructor(e,t){super(e,t),this.measureMode=o.DISTANCE,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.MeasureService"}destroy(){super.destroy();this.measureMode=null}processAsync(e,t){if(e instanceof Gi){var r,i,s=this,n=e.geometry;if(n){s.url=te.urlPathAppend(s.url,s.measureMode===o.AREA?"area":"distance");var a,l,h,u=Me.fromGeometry(n);if(u)return r=u.parts[0],i=u.points.splice(0,r),e.prjCoordSys?("object"==typeof e.prjCoordSys?a='{"epsgCode"'+(l=e.prjCoordSys.projCode).substring(l.indexOf(":"),l.length)+"}":"string"==typeof e.prjCoordSys&&(a='{"epsgCode"'+e.prjCoordSys.substring(e.prjCoordSys.indexOf(":"),e.prjCoordSys.length)+"}"),h={point2Ds:te.toJSON(i),unit:e.unit,prjCoordSys:a,distanceMode:e.distanceMode||"Geodesic"}):h={point2Ds:te.toJSON(i),unit:e.unit,distanceMode:e.distanceMode||"Geodesic"},s.request({method:"GET",params:h,scope:s,success:t,failure:t})}}}}class Bi extends ht{constructor(e,t){super(e,t),this.mode=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.OverlayAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof Ut?(i.mode="datasets",i.url=te.urlPathAppend(i.url,"datasets/"+e.sourceDataset+"/overlay"),Ut.toObject(e,r)):e instanceof Er&&(i.mode="geometry",e.operateGeometries&&e.sourceGeometries?(i.url=te.urlPathAppend(i.url,"geometry/overlay/batch"),i.url=te.urlAppend(i.url,"ignoreAnalystParam=true")):i.url=te.urlPathAppend(i.url,"geometry/overlay"),Er.toObject(e,r)),this.returnContent=!0;var s=te.toJSON(r);return i.request({method:"POST",data:s,scope:i,success:t,failure:t})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ui{constructor(e){e&&(this.datasetName="",this.datasetOverlay="",this.mode="",this.srcFields="",this.overlayFields="",this.output=null,this.mappingParameters=null,te.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 St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!=r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Vi extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/overlay"),this.CLASS_NAME="SuperMap.OverlayGeoJobsService"}destroy(){super.destroy()}getOverlayGeoJobs(e){return super.getJobs(this.url,e)}getOverlayGeoJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addOverlayGeoJob(e,t,r,i){return super.addJob(this.url,e,Ui,t,r,i)}}class Ji extends It{constructor(e){super(e=e||{}),this.returnContent=!0,this.bounds=null,te.extend(this,e),this.CLASS_NAME="SuperMap.QueryByBoundsParameters"}destroy(){super.destroy();this.returnContent=null,this.bounds&&(this.bounds=null)}}class zi extends rt{constructor(e,r){super(e,r),this.returnContent=!1,this.format=t.GEOJSON,this.returnFeatureWithFieldCaption=!1,r&&te.extend(this,r),this.CLASS_NAME="SuperMap.QueryService",this.url&&(r&&r.format&&(this.format=r.format.toUpperCase()),this.url=te.urlPathAppend(this.url,"queryResults"))}destroy(){super.destroy();this.returnContent=null,this.format=null}processAsync(e,t){if(e instanceof It){var r,i=this,s=null;return i.returnContent=e.returnContent,r=i.getJsonParameters(e),i.returnContent||(s=e.returnCustomResult)&&(i.url=te.urlAppend(i.url,"returnCustomResult="+s)),i.returnFeatureWithFieldCaption=e.returnFeatureWithFieldCaption,i.request({method:"POST",data:r,scope:i,success:t,failure:t})}}transformResult(e,r){e=te.transformResult(e);var i=new Ie;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=i.toGeoJSON(n[s].features)));return{result:e,options:r}}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}getQueryParameters(e){return new It({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 qi extends zi{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof Ji))return null;var t,r="",i=e.bounds;return t=this.getQueryParameters(e),r+="'queryMode':'BoundsQuery','queryParameters':",r+=te.toJSON(t),r="{"+(r+=",'bounds': {'rightTop':{'y':"+i.top+",'x':"+i.right+"},'leftBottom':{'y':"+i.bottom+",'x':"+i.left+"}}")+"}"}}class Hi extends It{constructor(e){super(e=e||{}),this.geometry=null,this.isNearest=null,this.returnContent=!0,te.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 Wi extends zi{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Hi){var t="",r=this.getQueryParameters(e),i=Me.fromGeometry(e.geometry);return t+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",t+=te.toJSON(r),t="{"+(t+=",'geometry':"+te.toJSON(i)+",'distance':"+e.distance)+"}"}}}class Yi extends It{constructor(e){super(e=e||{}),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=a.INTERSECT,te.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();this.returnContent=null,this.geometry=null,this.spatialQueryMode=null}}class Xi extends zi{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Yi){var t,r="",i=e.geometry,s=Me.fromGeometry(i);return t=this.getQueryParameters(e),r+="'queryMode':'SpatialQuery','queryParameters':",r="{"+(r+=te.toJSON(t)+",'geometry':"+te.toJSON(s)+",'spatialQueryMode':"+te.toJSON(e.spatialQueryMode))+"}"}}}class Qi extends It{constructor(e){super(e=e||{}),this.returnContent=!0,te.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();this.returnContent=null}}class Zi extends zi{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Qi){var t,r="";return t=this.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':",r="{"+(r+=te.toJSON(t))+"}"}}}class Ki{constructor(e){this.referenceDatasetName=null,this.referenceFilterQueryParameter=null,this.createResultDataset=null,this.resultDatasetName=null,this.resultDatasourceName=null,this.minDistance=null,this.maxDistance=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.MinDistanceAnalystParameters"}destroy(){var e=this;e.referenceDatasetName=null,e.dataset=null,e.referenceFilterQueryParameter=null,e.createResultDataset=null,e.resultDatasetName=null,e.resultDatasourceName=null,e.minDistance=null,e.maxDistance=null}}class $i extends Ki{constructor(e){super(e),this.dataset=null,this.inputFilterQueryParameter=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.DatasetMinDistanceAnalystParameters"}destroy(){super.destroy();this.dataset=null,this.inputFilterQueryParameter=null}}class es extends Ki{constructor(e){super(e),this.inputGeometries=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.GeometryMinDistanceAnalystParameters"}destroy(){super.destroy();this.inputGeometries=null}static toObject(e,t){for(var r in e)if("inputGeometries"===r&&e.inputGeometries){for(var i=[],s=0;s<e.inputGeometries.length;s++)i.push(Me.fromGeometry(e.inputGeometries[s]));t.inputGeometries=i}else t[r]=e[r]}}class ts extends ht{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.MinDistanceAnalystService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof $i?(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/mindistance"),i=e):e instanceof es&&(r.url=te.urlPathAppend(r.url,"geometry/mindistance"),es.toObject(e,i));var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class rs{constructor(e){e&&(this.dataset=null,this.cutFillType="GRID",this.afterCutFillDataset=null,this.resultDataset=null,this.buildPyramid=null,this.deleteExistResultDataset=null,this.bufferRadius=null,this.isRoundHead=null,this.line3D=null,this.region=null,this.region3D=null,te.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCutFillCalculationParameters")}destroy(){var e=this;e.cutFillType=null,e.afterCutFillDataset=null,e.resultDataset=null,e.buildPyramid=null,e.deleteExistResultDataset=null,e.bufferRadius=null,e.isRoundHead=null,e.line3D=null,e.region=null,e.region3D=null}static toObject(e,t){for(var r in e)"dataset"!==r&&(t[r]=e[r])}}class is extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCutFillCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof rs&&(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/cutfill")),rs.toObject(e,i);var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class ss{constructor(e){e&&(this.dataset=null,this.terrainAnalystSetting=null,this.resultDatasetName=null,this.deleteExistResultDataset=null,te.extend(this,e),this.CLASS_NAME="SuperMap.TerrainAspectCalculationParameters")}destroy(){this.terrainAnalystSetting=null,this.resultDatasetName=null,this.deleteExistResultDataset=null}static toObject(e,t){for(var r in e)"dataset"!==r&&(t[r]=e[r])}}class ns extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainAspectCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof ss&&(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/aspect")),ss.toObject(e,i);var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class as{constructor(e){e&&(this.dataset=null,this.terrainAnalystSetting=null,this.resultDatasetName=null,this.deleteExistResultDataset=null,this.zFactor=null,this.slopeType=null,te.extend(this,e),this.CLASS_NAME="SuperMap.TerrainSlopeCalculationParameters")}destroy(){var e=this;e.terrainAnalystSetting=null,e.resultDatasetName=null,e.deleteExistResultDataset=null,e.zFactor=null,e.slopeType=null}static toObject(e,t){for(var r in e)"dataset"!==r&&(t[r]=e[r])}}class os extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainSlopeCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof as&&(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/slope")),as.toObject(e,i);var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class ls extends ht{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.ConvexHullAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r=this;r.url=te.urlPathAppend(r.url,"geometry/3d/convexhull");var i=te.toJSON(e);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}class hs{constructor(e){this.edgeID=null,this.nodeID=null,this.weightName=null,this.returnFeatures=!0,this.isUncertainDirectionValid=!0,this.traceType=null,this.withIndex=null,te.extend(this,e),this.CLASS_NAME="SuperMap.TraceAnalystParameters"}destroy(){var e=this;e.edgeID=null,e.nodeID=null,e.weightName=null,e.returnFeatures=null,e.isUncertainDirectionValid=null,e.type=null,e.withIndex=null}}class us extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TraceAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof hs){var r,i=this;if(0===e.traceType)i.url=te.urlPathAppend(i.url,"traceup");else{if(1!==e.traceType)return;i.url=te.urlPathAppend(i.url,"tracedown")}if(r={weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid,returnFeatures:e.returnFeatures},!(null!==e.edgeID&&null!==e.nodeID||null===e.edgeID&&null===e.nodeID))return null!==e.edgeID?r.edgeID=e.edgeID:r.nodeID=e.nodeID,i.request({method:"GET",params:r,scope:i,success:t,failure:t})}}toGeoJSONResult(e){if(!e)return null;var t=new Ie;return e.edgesFeatures&&(e.edgesFeatures=t.toGeoJSON(e.edgesFeatures)),e.nodesFeatures&&(e.nodesFeatures=t.toGeoJSON(e.nodesFeatures)),e}}class cs{constructor(e){this.connected=null,this.returnFeatures=!0,this.edgeIDs=null,this.nodeIDs=null,this.withIndex=null,te.extend(this,e),this.CLASS_NAME="SuperMap.ConnectedEdgesAnalystParameters"}destroy(){var e=this;e.edgeIDs=null,e.nodeIDs=null,e.connected=null,e.returnFeatures=null,e.withIndex=null}}class ds extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ConnectedEdgesAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof cs){var r;if(this.url=te.urlPathAppend(this.url,"connectededges"),r={connected:e.connected,returnFeatures:e.returnFeatures},!(null!==e.edgeIDs&&null!==e.nodeIDs||null===e.edgeIDs&&null===e.nodeIDs))return null!==e.edgeIDs?r.edgeIDs=e.edgeIDs:r.nodeIDs=e.nodeIDs,this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}toGeoJSONResult(e){if(!e)return null;var t=new Ie;return e.edgesFeatures&&(e.edgesFeatures=t.toGeoJSON(e.edgesFeatures)),e.nodesFeatures&&(e.nodesFeatures=t.toGeoJSON(e.nodesFeatures)),e}}class ps extends rt{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.GetLayersLegendInfoService"}destroy(){super.destroy(),te.reset(this)}processAsync(e,t){return this.url=te.urlPathAppend(this.url,"/legend"),this.request({method:"GET",params:e,scope:this,success:t,failure:t})}}class fs{constructor(e,t){this.options=t||{},this.url=e}queryByBounds(e,t,r){var i=this;return new qi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}queryByDistance(e,t,r){var i=this;return new Wi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r}).processAsync(e,t)}queryBySQL(e,t,r){var i=this;return new Zi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r}).processAsync(e,t)}queryByGeometry(e,t,r){var i=this;return new Xi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r}).processAsync(e,t)}_processFormat(e){return e||t.GEOJSON}}class ys{constructor(e){if(!e)return this;this.sourceRoute=null,this.point=null,this.tolerance=null,this.isIgnoreGap=!1,te.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 ms extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteCalculateMeasureService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof ys){var r;return r=this.getJsonParameters(e),this.request({method:"POST",data:r,scope:this,success:t,failure:t})}}getJsonParameters(e){return this.url=te.urlPathAppend(this.url,"geometry/calculatemeasure"),this.url=te.urlAppend(this.url,"returnContent=true"),te.toJSON(e)}}class gs{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,r={};if(t&&t instanceof Q&&t.components){r.type=t.type,r.parts=t.parts;for(var i=[],s=0,n=t.components.length;s<n;s++)i=i.concat(t.components[s].components);r.points=i,e.sourceRoute=r}te.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 vs extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteLocatorService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof gs){var r;return r=this.getJsonParameters(e),this.request({method:"POST",data:r,scope:this,success:t,failure:t})}}getJsonParameters(e){var t="geometry/routelocator";return e.dataset&&(t="datasets/"+e.dataset+"/linearreferencing/routelocator",e.sourceRoute=null),this.url=te.urlPathAppend(this.url,t),this.url=te.urlAppend(this.url,"returnContent=true"),te.toJSON(e)}}class bs{constructor(e){this.fieldNames=null,this.fieldValues=null,this.geometry=null,e&&te.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,r,i,s={},n=this;for(var a in e=n.fieldNames,t=n.fieldValues,e)s[e[a]]=t[a];return n.geometry&&(r=n.geometry.toGeometry()),i=new Ee(r,s),n.geometry&&n.geometry.id&&(i.fid=n.geometry.id),i}static fromJson(e){var t=null;if(e)return(t=e.geometry)&&(t=Me.fromJson(t)),new bs({fieldNames:e.fieldNames,fieldValues:e.fieldValues,geometry:t})}}class Ss{constructor(e){e&&(this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.SetDatasourceParameters")}destroy(){this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null}}class xs extends rt{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerInfoService"}destroy(){super.destroy(),te.reset(this)}processAsync(e,t){if(e){var r=te.toJSON(e);return this.request({method:"PUT",data:r,scope:this,success:t,failure:t})}}}class _s extends rt{constructor(e,t){super(e,t),this.resourceID=null,this.isTempLayers=!1,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.SetLayersInfoService"}destroy(){super.destroy(),te.reset(this)}processAsync(e,t){if(e){var r,i=[],s=this,n="";s.isTempLayers?(s.url=te.urlPathAppend(s.url,"tempLayersSet/"+s.resourceID),n="PUT"):(s.url=te.urlPathAppend(s.url,"tempLayersSet"),n="POST"),e.subLayers||(e.subLayers={layers:[]}),e.subLayers.layers||(e.subLayers.layers=[]);var a=e.subLayers.layers,o=a.length;for(let e in a){if("GRID"===a[e].ugcLayerType){var l={},h=a[e].colorDictionarys;for(var u in h){l[h[u].elevation]=h[u].color}}a[e].colorDictionary=l,delete a[e].colorDictionarys}for(let e=0;e<o;e++)a[e].toJsonObject?i.push(a[e].toJsonObject()):i.push(a[e]);(r=te.extend(r,e)).subLayers={layers:i},r.object=null;var c=te.toJSON([r]);return s.request({method:n,data:c,scope:s,success:t,failure:t})}}}class ws{constructor(e){this.layerStatusList=[],this.holdTime=15,this.resourceID=null,e&&te.extend(this,e)}destroy(){this.layerStatusList=null,this.holdTime=null,this.resourceID=null}toJSON(){var e="{";e+='"layers":[';for(var t=[],r=0,i=this.layerStatusList.length;r<i;r++)t.push(this.layerStatusList[r].toJSON());return e+=t,e+="]",e+="}"}}class Cs extends rt{constructor(e,t){super(e,t),this.lastparams=null,this.mapUrl=e,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerStatusService"}destroy(){super.destroy(),te.reset(this)}processAsync(e,t){if(e instanceof ws){var r=this;if(r.url=r.mapUrl,null==e.resourceID)return r.url=te.urlPathAppend(r.url,"tempLayersSet"),r.lastparams=e,r.request({method:"POST",scope:r,success:r.createTempLayerComplete.bind(r,t),failure:t});r.url=te.urlPathAppend(r.url,"tempLayersSet/"+e.resourceID),r.url=te.urlAppend(r.url,"elementRemain=true&reference="+e.resourceID+"&holdTime="+e.holdTime.toString());var i="[{";return i+='"type":"UGC",',null!=e.layerStatusList&&e.layerStatusList.length>0&&(i+='"subLayers":'+e.toJSON()),i+=',"visible":true,',i+='"name":"'+this.getMapName(this.mapUrl)+'"',i+="}]",r.request({method:"PUT",data:i,scope:r,success:t,failure:t})}}createTempLayerComplete(e,t){return t.result=te.transformResult(t.result),t.result.succeed&&(this.lastparams.resourceID=t.result.newResourceID),this.processAsync(this.lastparams,e)}getMapName(e){var t=e;"/"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1));var r=t.lastIndexOf("/");return t.substring(r+1,t.length)}transformResult(e,t){return null!=(e=te.transformResult(e))&&null!=this.lastparams&&null!=this.lastparams.resourceID&&(e.newResourceID=this.lastparams.resourceID),{result:e,options:t}}}class As{constructor(e){e&&(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=a.CONTAIN,this.output=null,this.mappingParameters=null,te.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Ms extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(e){return super.getJobs(this.url,e)}getQueryJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addQueryJob(e,t,r,i){return super.addJob(this.url,e,As,t,r,i)}}class Ts{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,te.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){te.reset(this)}}class Es extends rt{constructor(e,t){super(e,t),t=t||{},te.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),te.reset(this)}processAsync(e,t){if(e instanceof Ts){return this.url=te.urlPathAppend(this.url,"stops/keyword/"+e.keyWord),this.request({method:"GET",params:{returnPosition:e.returnPosition},scope:this,success:t,failure:t})}}}class Os{constructor(e){e&&(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,te.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Ps extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(e){return super.getJobs(this.url,e)}getSummaryAttributesJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addSummaryAttributesJob(e,t,r,i){return super.addJob(this.url,e,Os,t,r,i)}}class Is{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=F.AVERAGE,this.fields="",this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,te.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 St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"type"!==r?"output"!==r?("SUMMARYMESH"===e.type&&"regionDataset"!==r||"SUMMARYREGION"===e.type&&!i(["meshType","resolution","query"],r))&&(t.analyst=t.analyst||{},"query"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):t.type=e[r]:(t.input=t.input||{},t.input[r]=e[r]);function i(e,t){for(var r=e.length;r--;)if(e[r]===t)return!0;return!1}}}class Ns extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(e){return super.getJobs(this.url,e)}getSummaryMeshJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addSummaryMeshJob(e,t,r,i){return super.addJob(this.url,e,Is,t,r,i)}}class Ls{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,te.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 St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"type"!==r&&"type"!==r?"output"!==r?("SUMMARYREGION"===e.type||"SUMMARYMESH"===e.type&&"regionDataset"!==r)&&(t.analyst=t.analyst||{},"query"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):t.type=e[r]:(t.input=t.input||{},t.input[r]=e[r])}}class ks extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(e){return super.getJobs(this.url,e)}getSummaryRegionJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addSummaryRegionJob(e,t,r,i){return super.addJob(this.url,e,Ls,t,r,i)}}class Fs{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&te.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 Fs({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class Rs extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.SurfaceAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Jt){var r;return r=this.getJsonParameters(e),this.request({method:"POST",data:r,scope:this,success:t,failure:t})}}getJsonParameters(e){var t="",r={};if(e instanceof zt)this.url=te.urlPathAppend(this.url,"datasets/"+e.dataset+"/"+e.surfaceAnalystMethod.toLowerCase()),zt.toObject(e,r),t=te.toJSON(r);else{if(!(e instanceof Or))return;this.url=te.urlPathAppend(this.url,"geometry/"+e.surfaceAnalystMethod.toLowerCase()),t=te.toJSON(e)}return this.returnContent=!0,t}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ds{constructor(e){e&&(this.dataset=null,this.zFactor=1,this.averageCurvatureName=null,this.profileCurvatureName="",this.planCurvatureName="",this.deleteExistResultDataset=!1,te.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 r in e)"dataset"!==r&&(t[r]=e[r])}}class Gs extends ht{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof Ds&&(r.url=te.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/curvature")),Ds.toObject(e,i);var s=te.toJSON(i);return r.url=te.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:s,scope:r,success:t,failure:t})}}class js{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new we,e&&te.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 js;return te.copy(t,e),t.leaderLineStyle=we.fromJson(e.leaderLineStyle),t}}}class Bs{constructor(e){this.caption=null,this.color=new _e,this.end=0,this.start=0,this.visible=!0,e&&te.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=te.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(e){var t=new Bs;return te.copy(t,e),t.color=_e.fromJson(e.color),t}}}class Us extends Qr{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=f.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=y.YELLOW_RED,this.reverseColor=!1,e&&te.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 Us;te.copy(t,e);var r=e.items,i=r?r.length:0;t.items=[];for(var s=0;s<i;s++)t.items.push(Bs.fromObj(r[s]));return t}}}class Vs{constructor(e){this.caption=null,this.color=new _e,this.unique=null,this.visible=!0,e&&te.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=te.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){var t=new Vs;return te.copy(t,e),t.color=_e.fromJson(e.color),t}}class Js extends Qr{constructor(e){super("GRIDUNIQUE",e),this.defaultcolor=new _e,this.items=null,e&&te.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=te.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,i=0;i<r;i++)t.push(e.items[i].toServerJSONObject());e.items=t}return e}static fromObj(e){var t=new Js,r=e.items,i=r?r.length:0;te.extend(t,e),t.items=[],t.defaultcolor=_e.fromJson(e.defaultcolor);for(var s=0;s<i;s++)t.items.push(Vs.fromObj(r[s]));return t}}class zs{constructor(e){this.caption=null,this.unique=null,this.offsetX=0,this.offsetY=0,this.visible=!0,this.style=new Zr,e&&te.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 zs;return te.copy(t,e),t}}}class qs{constructor(e){this.datasetNames=null,this.dataSourceNames=null,this.joinItems=null,this.themes=null,this.displayFilters=null,this.displayOrderBys=null,this.fieldValuesDisplayFilter=null,e&&te.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,r=e.joinItems,i=r.length;t<i;t++)r[t].destroy();e.joinItems=null}if(e.themes){for(let t=0,r=e.themes,i=r.length;t<i;t++)r[t].destroy();e.themes=null}}}class Hs extends rt{constructor(e,t){super(e,t),t&&te.extend(this,t),this.url=te.urlPathAppend(this.url,"tempLayersSet"),this.CLASS_NAME="SuperMap.ThemeService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof qs){var r;return r=this.getJsonParameters(e),this.request({method:"POST",data:r,scope:this,success:t,failure:t})}}getJsonParameters(e){var t,r="",i=null,s=null,n=null;r+="[{'type': 'UGC','subLayers': {'layers': [";for(var a=0;a<e.themes.length;a++){i=e.themes[a];var o=te.toJSON(i);if(r+="{'theme': "+(o=o.slice(0,-1))+"},'type': 'UGC','ugcLayerType': 'THEME',",(s=e.displayFilters)&&s.length>0&&(1===s.length?r+="'displayFilter':\""+s[0]+'",':r+="'displayFilter':\""+s[a]+'",'),(n=e.displayOrderBy)&&n.length>0&&(1===n.length?r+="'displayOrderBy':'"+n[0]+"',":r+="'displayOrderBy':'"+n[a]+"',"),(t=e.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+te.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[a]&&(r+="'joinItems':["+te.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;r+="'datasetInfo': {'name': '"+e.datasetNames[l]+"','dataSourceName': '"+e.dataSourceNames[h]+"'}},"}else r+="},"}e.themes&&e.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var u=this.url.split("/");return r+="'name': '"+u[u.length-2]+"'}]"}}class Ws extends ht{constructor(e,t){super(e,t),this.mode=null,t&&te.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof Ht?(i.mode="datasets",i.url=te.urlPathAppend(i.url,"datasets/"+e.dataset+"/thiessenpolygon"),Ht.toObject(e,r)):e instanceof Pr&&(i.mode="geometry",i.url=te.urlPathAppend(i.url,"geometry/thiessenpolygon"),Pr.toObject(e,r));var s=te.toJSON(r);return this.returnContent=!0,i.request({method:"POST",data:s,scope:i,success:t,failure:t})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ys extends ht{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e,t){var r=this;r.url=te.urlPathAppend(r.url,"geometry/batchanalyst"),r.url=te.urlAppend(r.url,"returnContent=true&ignoreAnalystParam=true");var i=r._processParams(e),s=te.toJSON(i);return r.request({method:"POST",data:s,scope:r,success:t,failure:t})}_processParams(e){var t=this;if(te.isArray(e)){var r=[];return e.map(function(e){return r.push(t._toJSON(e)),e}),r}}_toJSON(e){var t={};if("buffer"===e.analystName)t.analystName="buffer",t.param={},gt.toObject(e.param,t.param);else if("overlay"===e.analystName)t.analystName="overlay",t.param={},Er.toObject(e.param,t.param);else if("interpolationDensity"===e.analystName)t.analystName="interpolationDensity",t.param={},Mi.toObject(e.param,t.param);else if("interpolationidw"===e.analystName)t.analystName="interpolationidw",t.param={},Mi.toObject(e.param,t.param);else if("interpolationRBF"===e.analystName)t.analystName="interpolationRBF",t.param={},Mi.toObject(e.param,t.param);else if("interpolationKriging"===e.analystName)t.analystName="interpolationKriging",t.param={},Mi.toObject(e.param,t.param);else{if("thiessenpolygon"!==e.analystName)return e;t.analystName="thiessenpolygon",t.param={},Pr.toObject(e.param,t.param)}return t}destroy(){super.destroy()}}class Xs extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(e){if(this.url){return this.url=te.urlPathAppend(this.url,"tilesets"),this.request({method:"GET",scope:this,success:e,failure:e})}}}class Qs{constructor(e){e&&(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=D.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,te.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Zs extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(e){return super.getJobs(this.url,e)}getTopologyValidatorJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addTopologyValidatorJob(e,t,r,i){return super.addJob(this.url,e,Qs,t,r,i)}}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,te.extend(this,e),this.CLASS_NAME="SuperMap.TransferLine"}destroy(){te.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 $s{constructor(e){e=e||{},this.transferLines=null,this.points=null,te.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){te.reset(this)}static toJson(e){if(e)return te.toJSON(e)}}class en extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof $s){var r;return this.url=te.urlPathAppend(this.url,"path"),r={points:te.toJSON(e.points),transferLines:te.toJSON(e.transferLines)},this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class tn{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,te.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){te.reset(this)}static toJson(e){if(e)return te.toJSON(e)}}class rn extends rt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof tn){var r;return this.url=te.urlPathAppend(this.url,"solutions"),r={points:te.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(r.evadeLines=te.toJSON(e.evadeLines)),e.evadeStops&&(r.evadeStops=te.toJSON(e.evadeStops)),e.priorLines&&(r.priorLines=te.toJSON(e.priorLines)),e.priorStops&&(r.priorStops=te.toJSON(e.priorStops)),e.travelTime&&(r.travelTime=e.travelTime),this.request({method:"GET",params:r,scope:this,success:t,failure:t})}}}class sn{constructor(e){e&&(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",te.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 nn{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){this.datasourceName=null,this.datasetName=null,this.datasetType=null}}class an extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof sn){var r=this,i=r.parse(e);r.url=te.urlPathAppend(r.url,i);var s=e.edgeWeight?e.edgeWeight:null;return r.request({method:"PUT",scope:r,data:s,success:t,failure:t})}}parse(e){if(e){var t="";for(var r in e)if(""!==e[r]&&"edgeWeight"!==e[r])switch(r){case"edgeId":t+="/edgeweight/"+e[r];break;case"fromNodeId":t+="/fromnode/"+e[r];break;case"toNodeId":t+="/tonode/"+e[r];break;case"weightField":t+="/weightfield/"+e[r]}return t}}}class on{constructor(e){e&&(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",te.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 ln extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof on){var r=this,i=r.parse(e);r.url=te.urlPathAppend(r.url,i);var s=e.turnNodeWeight?e.turnNodeWeight:null;return r.request({method:"PUT",scope:r,data:s,success:t,failure:t})}}parse(e){if(e){var t="";for(var r in e)if(""!==e[r]&&"turnNodeWeight"!==e[r])switch(r){case"nodeId":t+="/turnnodeweight/"+e[r];break;case"fromEdgeId":t+="/fromedge/"+e[r];break;case"toEdgeId":t+="/toedge/"+e[r];break;case"weightField":t+="/weightfield/"+e[r]}return t}}}class hn{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&&te.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 un{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=N.CLIP,this.output=null,this.mappingParameters=null,te.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof St&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof xt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class cn extends wt{constructor(e,t){super(e,t),this.url=te.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(e){return super.getJobs(this.url,e)}getVectorClipJob(e,t){return super.getJobs(te.urlPathAppend(this.url,e),t)}addVectorClipJob(e,t,r,i){return super.addJob(this.url,e,un,t,r,i)}}class dn{constructor(e){e=e||{},this.type=null,te.extend(this,e),this.CLASS_NAME="SuperMap.RasterFunctionParameter"}destroy(){this.type=null}}class pn{constructor(e){this.name=null,this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobCustomItems",te.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,/,"")),te.toJSON(e)}}class fn{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobImage",te.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,/,"")),te.toJSON(e)}}class yn{constructor(e){this.name=null,this.layerType=null,this.url=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayers",te.extend(this,e)}destroy(){this.name=null,this.layerType=null,this.url=null}}class mn{constructor(e){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers=null,this.customItems=null,this.CLASS_NAME="SuperMap.WebPrintingJobLegendOptions",te.extend(this,e)}destroy(){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers instanceof yn&&(this.layers.destroy(),this.layers=null),this.customItems instanceof pn&&(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),te.toJSON(e)}}class gn{constructor(e){this.center=null,this.scale=null,this.layerNames=null,this.image=null,this.layers=null,this.CLASS_NAME="SuperMap.WebPrintingJobLittleMapOptions",te.extend(this,e)}destroy(){this.center=null,this.scale=null,this.layerNames=null,this.image instanceof fn&&(this.image.destroy(),this.image=null),this.layers instanceof yn&&(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),te.toJSON(e)}}class vn{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobNorthArrowOptions",te.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,/,"")),te.toJSON(e)}}class bn{constructor(e){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null,this.CLASS_NAME="SuperMap.WebPrintingJobScaleBarOptions",te.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),te.toJSON(e)}}class Sn{constructor(e){this.type=null,this.url=null,this.token=null,this.value=null,this.CLASS_NAME="SuperMap.WebPrintingJobContent",te.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),te.toJSON(e)}}class xn{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",te.extend(this,e)}destroy(){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions instanceof bn&&(this.scaleBarOptions.destroy(),this.scaleBarOptions=null),this.northArrowOptions instanceof vn&&(this.northArrowOptions.destroy(),this.northArrowOptions=null),this.littleMapOptions instanceof gn&&(this.littleMapOptions.destroy(),this.littleMapOptions=null),this.legendOptions instanceof mn&&(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),te.toJSON(e)}}class _n{constructor(e){this.format=null,this.dpi=96,this.scale=null,this.rotation=null,this.center=null,this.CLASS_NAME="SuperMap.WebPrintingJobExportOptions",te.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),te.toJSON(e)}}class wn extends rt{constructor(e,t){super(e,t),t&&te.extend(this,t),this.CLASS_NAME="SuperMap.WebPrintingService",this.url}destroy(){super.destroy()}createWebPrintingJob(e,t){if(e)return 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 r=this;r.processAsync(`jobs/${e}`,"GET",function(i){r.rollingProcess(i,r._processUrl(`jobs/${e}`),t)})}getPrintingJobResult(e,t){return this.processAsync(`jobs/${e}/result`,"GET",t)}getLayoutTemplates(e){return this.processAsync("layouts","GET",e)}rollingProcess(e,t,r){var i=this;e&&(this.id&&clearInterval(this.id),this.id=setInterval(function(){i.request({url:t,method:"GET",scope:i,success:r,failure:r})},1e3))}processAsync(e,t,r,i){let s={url:this._processUrl(e),method:t,scope:this,success:r,failure:r};return i&&(s.data=te.toJSON(i)),this.request(s)}transformResult(e,t){return"FINISHED"!==(e=te.transformResult(e)).status&&"ERROR"!==e.status||clearInterval(this.id),{result:e,options:t}}_processUrl(e){return e?te.urlPathAppend(this.url,e):this.url}}class Cn extends rt{constructor(e,t){super(e,t),this.options=t||{},t&&te.extend(this,t),this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e,t){var r={collectionId:this.options.collectionId};"function"==typeof e&&(t=e,e=null);var i=te.convertPath("/collections/{collectionId}/legend",r),s=te.urlPathAppend(this.url,i);return this._processAsync({url:s,method:"GET",params:e,callback:t})}getStatistics(e){var t={collectionId:this.options.collectionId},r=te.convertPath("/collections/{collectionId}/statistics",t),i=te.urlPathAppend(this.url,r);return this._processAsync({url:i,method:"GET",callback:e})}getTileInfo(e){var t={collectionId:this.options.collectionId},r=te.convertPath("/collections/{collectionId}/tileInfo",t),i=te.urlPathAppend(this.url,r);return this._processAsync({url:i,method:"GET",callback:e})}deleteItemByID(e,t){var r={collectionId:this.options.collectionId,featureId:e},i=te.convertPath("/collections/{collectionId}/items/{featureId}",r),s=te.urlPathAppend(this.url,i);return this._processAsync({url:s,method:"DELETE",callback:t})}getItemByID(e,t){var r={collectionId:this.options.collectionId,featureId:e},i=te.convertPath("/collections/{collectionId}/items/{featureId}",r),s=te.urlPathAppend(this.url,i);return this._processAsync({url:s,method:"GET",callback:t})}_processAsync({url:e,method:t,callback:r,params:i}){return this.request({method:t||"GET",url:e,params:i,scope:this,success:r,failure:r})}}class An extends rt{constructor(e,t){super(e,t),this.options=t||{},t&&te.extend(this,t),this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(e){var t=te.convertPath("/collections"),r=te.urlPathAppend(this.url,t);return this._processAsync({url:r,mehtod:"GET",callback:e})}getCollectionByID(e,t){var r={collectionId:e},i=te.convertPath("/collections/{collectionId}",r),s=te.urlPathAppend(this.url,i);return this._processAsync({url:s,mehtod:"GET",callback:t})}search(e,t){var r={...e||{}},i=te.convertPath("/search"),s=te.urlPathAppend(this.url,i);return this._processAsync({url:s,method:"POST",data:r,callback:t})}_processAsync({url:e,method:t,callback:r,data:i}){return this.request({method:t||"GET",url:e,data:i,scope:this,success:r,failure:r})}}class Mn{constructor(e){this.include=void 0,this.exclude=void 0,this.CLASS_NAME="SuperMap.FieldsFilter",te.extend(this,e)}destroy(){this.include=void 0,this.exclude=void 0}static constructFromObject(e,t){return e&&(t=t||new Mn,e.hasOwnProperty("include")&&(t.include=e.include),e.hasOwnProperty("exclude")&&(t.exclude=e.exclude)),t}}class Tn{constructor(e){this.field=void 0,this.direction=Tn.Direction.ASC,this.CLASS_NAME="SuperMap.Sortby",te.extend(this,e)}destroy(){this.field=void 0,this.direction="ASC"}static constructFromObject(e,t){return e&&(t=t||new Tn,e.hasOwnProperty("field")&&(t.field=e.field),e.hasOwnProperty("direction")&&(t.direction=e.direction)),t}}Tn.Direction={ASC:"ASC",DESC:"DESC"};class En{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",te.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 En,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=Mn.constructFromObject&&Mn.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=>Tn.constructFromObject&&Tn.constructFromObject(e,{})||e)))),t}}class On{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",te.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 On,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}}On.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",te.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=On.constructFromObject&&On.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 In{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",te.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 In,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 Nn{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",te.extend(this,e)}destroy(){this.girdFuncName="GFAspect",this.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new Nn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class Ln{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",te.extend(this,e)}destroy(){this.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new Ln,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class kn{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",te.extend(this,e)}destroy(){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new kn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class Fn extends rt{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.KnowledgeGraphService"}destroy(){super.destroy()}query(e,t){const r=te.urlAppend(this.url+"/query.json",`cypherQuery=${encodeURI(e)}`);this.processAsync({url:r,method:"GET",callback:t})}getGraphMaps(e){const t=this.url+"/graphmaps.json";this.processAsync({url:t,method:"GET",callback:e})}getGraphMap(e,t){const r=this.url+`/graphmaps/${e}.json`;this.processAsync({url:r,method:"GET",callback:t})}async getGraphMapData(e){let t=[];const r=await this._getGraphMapData(e);if(!r)return;const i=r.dataContent.queries&&r.dataContent.queries.query||[];let s=[];s="string"==typeof i?[i]:i;const n=this._getGraphMapExpandQuery(r);n.length&&s.push(...n);for(let e=0;e<s.length;e++){const r=s[e],i=await this._queryDataBySql(r);t=t.concat([],i)}return{data:t,graphMap:r}}_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:r,callback:i}){const s={method:r,url:e,scope:this,success:i,failure:i};return t&&(s.params=t),this.request(s)}_getGraphMapData(e){return new Promise((t,r)=>{this.getGraphMap(e,e=>{"processFailed"===e.type?r(e.error):""===e.result.data?r("无数据"):t(e.result.graphMap)})})}_queryDataBySql(e){return new Promise((t,r)=>{this.query(e,e=>{"processFailed"===e.type?r(e.error):t(e.result)})})}}class Rn{constructor(e){e=e||{},te.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,r,i={}){return t=Ve.appendCredential(t),i.crossOrigin=this.options.crossOrigin,i.headers=this.options.headers,Ue.commit(e,t,r,i).then(function(e){return e.json()})}}class Dn extends Rn{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,te.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){te.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}class Gn{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 r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;i<s;i++)r[i]=this.clone(e[i])}else if(!t[Object.prototype.toString.call(e)])for(var n in r={},e)e.hasOwnProperty(n)&&(r[n]=this.clone(e[n]));return r}return e}mergeItem(e,t,r,i){var s=this.BUILTIN_OBJECT;t.hasOwnProperty(r)&&("object"!=typeof e[r]||s[Object.prototype.toString.call(e[r])]?!i&&r in e||(e[r]=t[r]):this.merge(e[r],t[r],i))}merge(e,t,r){for(var i in t)this.mergeItem(e,t,i,r);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 r,i=this._canvas,s=this._pixelCtx,n=this._width,a=this._height,o=this._offsetX,l=this._offsetY;e+o>n&&(n=e+o+100,i.width=n,r=!0),t+l>a&&(a=t+l+100,i.height=a,r=!0),e<-o&&(n+=o=100*Math.ceil(-e/100),i.width=n,r=!0),t<-l&&(a+=l=100*Math.ceil(-t/100),i.height=a,r=!0),r&&s.translate(o,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}inherits(e,t){var r=e.prototype;function i(){}for(var s in i.prototype=t.prototype,e.prototype=new i,r)e.prototype[s]=r[s];e.constructor=e}}class jn{constructor(){this.util=new Gn,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,r,i,s,n,a){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var l=this._ctx.createRadialGradient(e,t,r,i,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,r,i,s){var n=this.util;this._ctx||(this._ctx=n.getContext());for(var a=this._ctx.createLinearGradient(e,t,r,i),o=0,l=s.length;o<l;o++)a.addColorStop(s[o][0],s[o][1]);return a.__nonRecursion=!0,a}getStepColors(e,t,r){e=this.toRGBA(e),t=this.toRGBA(t),e=this.getData(e);for(var i=[],s=((t=this.getData(t))[0]-e[0])/r,n=(t[1]-e[1])/r,a=(t[2]-e[2])/r,o=(t[3]-e[3])/r,l=0,h=e[0],u=e[1],c=e[2],d=e[3];l<r;l++)i[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],i[l]=this.toColor([h,u,c,d],"rgba"),i}getGradientColors(e,t){var r=[],i=e.length;if(void 0===t&&(t=20),1===i)r=this.getStepColors(e[0],e[0],t);else if(i>1)for(var s=0,n=i-1;s<n;s++){var a=this.getStepColors(e[s],e[s+1],t);s<n-1&&a.pop(),r=r.concat(a)}return r}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 r=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=r[0],e[2]=r[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=[],r=0;return e.replace(/[\d.]+/g,function(e){r<3?e|=0:e=+e,t[r++]=e}),t}convert(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),i=r[3];return void 0===i&&(i=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=i,this.toColor(r,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,r=(240&e)<<4,i=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(i<<4)+i).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var i=this.getData(e),s=0;s<3;s++)i[s]=1===r?i[s]*(1-t)|0:(255-i[s])*t+i[s]|0;return"rgb("+i.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,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===r&&(r=.5);for(var i=2*(r=1-this.adjust(r,[0,1]))-1,s=this.getData(this.toRGBA(e)),n=this.getData(this.toRGBA(t)),a=s[3]-n[3],o=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,l=1-o,h=[],u=0;u<3;u++)h[u]=s[u]*o+n[u]*l;var c=s[3]*r+n[3]*(1-r);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,r,i=(e=this.normalize(e)).match(this.colorRegExp);if(null===i)throw new Error("The color format error");var s,n=[];if(i[2])s=[(t=i[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],n=this.map(s,function(e){return jn.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(i[4]){var a=i[4].split(",");r=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),jn.prototype.adjust.call(this,e,[0,255])}),void 0!==r&&n.push(this.adjust(parseFloat(r),[0,1]))}else if(i[5]||i[6]){var o=(i[5]||i[6]).split(","),l=parseInt(o[0],0)/360,h=o[1],u=o[2];r=o[3],(n=this.map([h,u],function(e){return jn.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==r&&n.push(this.adjust(parseFloat(r),[0,1]))}return n}alpha(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}map(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,i=0;i<r;i++)e[i]=t(e[i]);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,r,i,s=e[0],n=e[1],a=e[2];if(0===n)t=255*a,r=255*a,i=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,r=255*p,i=255*f}return[t,r,i]}_HSL_2_RGB(e){var t,r,i,s=e[0],n=e[1],a=e[2];if(0===n)t=255*a,r=255*a,i=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),r=255*this._HUE_2_RGB(l,o,s),i=255*this._HUE_2_RGB(l,o,s-1/3)}return[t,r,i]}_HUE_2_RGB(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}_RGB_2_HSB(e){var t,r,i=e[0]/255,s=e[1]/255,n=e[2]/255,a=Math.min(i,s,n),o=Math.max(i,s,n),l=o-a,h=o;if(0===l)t=0,r=0;else{r=l/o;var u=((o-i)/6+l/2)/l,c=((o-s)/6+l/2)/l,d=((o-n)/6+l/2)/l;i===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,r*=100,h*=100]}_RGB_2_HSL(e){var t,r,i=e[0]/255,s=e[1]/255,n=e[2]/255,a=Math.min(i,s,n),o=Math.max(i,s,n),l=o-a,h=(o+a)/2;if(0===l)t=0,r=0;else{r=h<.5?l/(o+a):l/(2-o-a);var u=((o-i)/6+l/2)/l,c=((o-s)/6+l/2)/l,d=((o-n)/6+l/2)/l;i===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,r*=100,h*=100]}}var Bn=new jn;class Un{static createCanvas(e,t){var r=document.createElement("canvas");return r.height=e,r.width=t,r.getContext("2d")}static getLinearGradient(e,t,r,i,s){this._ctx||(this._ctx=this.getContext());for(var n=this._ctx.createLinearGradient(e,t,r,i),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,r){e=Bn.toRGBA(e),t=Bn.toRGBA(t),e=Bn.getData(e);for(var i=[],s=((t=Bn.getData(t))[0]-e[0])/r,n=(t[1]-e[1])/r,a=(t[2]-e[2])/r,o=(t[3]-e[3])/r,l=0,h=e[0],u=e[1],c=e[2],d=e[3];l<r;l++)i[l]=Bn.toColor([Bn.adjust(Math.floor(h),[0,255]),Bn.adjust(Math.floor(u),[0,255]),Bn.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],i[l]=Bn.toColor([h,u,c,d],"hex"),i}static getGradientColors(e,t,r){var i,s,n,a=[],o=e.length;if(void 0!==t){if(o>=t)if("RANGE"===r)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 r=e.length-1-t;a.push(e[r])}}else{for(i=Math.ceil(t/(o-1)),s=0,n=o-1;s<n;s++){var l=this.getStepColors(e[s],e[s+1],i);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}}}class Vn{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,r){if("offset"===t)return this.getEqInterval(e,r);if("jenks"===t)return this.getJenks(e,r);if("square"===t){return this.getMin(e)>=0&&this.getSqrtInterval(e,r)}if("logarithm"===t){return this.getMin(e)>0&&this.getGeometricProgression(e,r)}}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)}}var Jn=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 zn(e,t,r){return 1/(e*t*(1/.0254)*Jn(r))}function qn(e,t){const r=[];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]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]),r}var Hn=r(52),Wn=r.n(Hn);class Yn{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,r,i,s,n,a,o,l,h,u=this;function c(){s=o[i],n=r,l=r}function d(){o[i]=s,l=r=n}function p(){r>l&&(o[i]=o[i].slice(r-l),l=r)}function f(e){var s,n,a,u;if(e instanceof Function)return e.call(h.parsers);if("string"==typeof e)s=t.charAt(r)===e?e:null,n=1,p();else{if(p(),!(s=e.exec(o[i])))return null;n=s[0].length}if(s){var c=r+=n;for(u=r+o[i].length-n;r<u&&(32===(a=t.charCodeAt(r))||10===a||9===a);)r++;return o[i]=o[i].slice(n+(r-c)),l=r,0===o[i].length&&i<o.length-1&&i++,"string"==typeof s?s:1===s.length?s[0]:s}}function y(r){var i,s={index:a,filename:e.filename,message:"Parse error.",line:0,column:-1};for(var n in s)0===r[n]&&(r[n]=s[n]);i=r.filename&&u.env.inputs&&u.env.inputs[r.filename]?u.env.inputs[r.filename]:t,r.line=(i.slice(0,r.index).match(/\n/g)||"").length+1;for(var o=r.index;o>=0&&"\n"!==i.charAt(o);o--)r.column++;return new Error([r.filename,r.line,r.column,r.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(r=i=l=a=0,o=[],t=s.replace(/\r\n/g,"\n"),e.filename&&(u.env.inputs[e.filename]=t),o=function(e){for(var r,i,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,(r=o.exec(t))&&r.index===p&&(p+=r[0].length,d.push(r[0])),s=t.charAt(p),l.lastIndex=u.lastIndex=p,(r=u.exec(t))&&r.index===p)p+=r[0].length,d.push(r[0]);else if(i||"/"!==s||"/"!==(n=t.charAt(p+1))&&"*"!==n||!(r=l.exec(t))||r.index!==p){switch(s){case"{":if(!i){c++,d.push(s);break}case"}":if(!i){c--,d.push(s),e[++a]=d=[];break}case"(":if(!i){i=!0,d.push(s);break}case")":if(i){i=!1,d.push(s);break}default:d.push(s)}p++}else p+=r[0].length,d.push(r[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 y(h);var c=function(e,t){var r=e.specificity,i=t.specificity;return r[0]!=i[0]?i[0]-r[0]:r[1]!=i[1]?i[1]-r[1]:r[2]!=i[2]?i[2]-r[2]:i[3]-r[3]};return(n=new Yn.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"+y(t).message:e.errors.message=y(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 Yn.Tree.Invalid(e,n)},comment:function(){var e;if("/"===t.charAt(r))return"/"===t.charAt(r+1)?new Yn.Tree.Comment(f(/^\/\/.*/),!0):(e=f(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new Yn.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===t.charAt(r)||"'"===t.charAt(r)){var e=f(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new Yn.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(f("[")){var e=f(/(^[^\]]+)/);if(f("]"))return e?new Yn.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 Yn.Tree.Keyword(e)},call:function(){var e,t;if(e=/^([\w\-]+|%)\(/.exec(o[i])){if("url"===(e=e[1]))return null;r+=e.length;if(f("("),t=f(this.entities.arguments),f(")"))return e?new Yn.Tree.Call(e,t,r):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(r)&&f(/^url\(/)){e=f(this.entities.quoted)||f(this.entities.variable)||f(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return f(")")?new Yn.Tree.URL(void 0!==e.value||e instanceof Yn.Tree.Variable?e:new Yn.Tree.Quoted(e)):new Yn.Tree.Invalid(e,n,"Missing closing ) in URL.")}},variable:function(){var i,s=r;if("@"===t.charAt(r)&&(i=f(/^@[\w-]+/)))return new Yn.Tree.Variable(i,s,e.filename)},hexcolor:function(){var e;if("#"===t.charAt(r)&&(e=f(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new Yn.Tree.Color(e[1])},keywordcolor:function(){var e=o[i].match(/^[a-z]+/);if(e&&e[0]in Yn.Tree.Reference.data.colors)return new Yn.Tree.Color(Yn.Tree.Reference.data.colors[f(/^[a-z]+/)])},dimension:function(){var e=t.charCodeAt(r);if(!(e>57||e<45||47===e)){var i=f(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return i?new Yn.Tree.Dimension(i[1],i[2],n):void 0}}},variable:function(){var e;if("@"===t.charAt(r)&&(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),r=f(this.entities.url)||f(this.entities.keyword);return e||t||r},end:function(){var e;return f(";")||("string"==typeof(e="}")?t.charAt(r)===e:!!e.test(o[i]))},element:function(){var e=f(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new Yn.Tree.Element(e)},attachment:function(){var e=f(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(e)return e[1]},selector:function(){for(var e,i,s,a,o,l=[],h=new Yn.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 y({message:p,index:r-1});d++}else{if(i)throw y({message:"Encountered second attachment name.",index:r-1});i=e}var m=t.charAt(r);if("{"===m||"}"===m||";"===m||","===m)break}if(c)return new Yn.Tree.Selector(h,u,l,i,d,n)},filter:function(){c();var t,r,i;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 Yn.Tree.Quoted&&(t=new Yn.Tree.Field(t.toString())),(r=f(this.entities.comparison))&&(i=f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.dimension)||f(this.entities.keyword)||f(this.entities.field)))){if(!f("]"))throw y({message:"Missing closing ] of filter.",index:n-1});return t.is||(t=new Yn.Tree.Field(t)),new Yn.Tree.Filter(t,r,i,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 Yn.Tree.Zoom(e,t,n);d()},block:function(){var e;if(f("{")&&(e=f(this.primary))&&f("}"))return e},ruleset:function(){var e,t,r=[];for(c();e=f(this.selector);){for(r.push(e);f(this.comment););if(!f(","))break;for(;f(this.comment););}if(e)for(;f(this.comment););if(r.length>0&&(t=f(this.block))){if(1===r.length&&r[0].elements.length&&"Map"===r[0].elements[0].value){var i=new Yn.Tree.Ruleset(r,t);return i.isMap=!0,i}return new Yn.Tree.Ruleset(r,t)}d()},rule:function(){var i,s,o=t.charAt(r);if(c(),"."!==o&&"#"!==o&&(i=f(this.variable)||f(this.property))){if((s=f(this.value))&&f(this.end))return new Yn.Tree.Rule(i,s,n,e.filename);a=r,d()}},font:function(){for(var e,t=[],r=[];e=f(this.entity);)r.push(e);if(t.push(new Yn.Tree.Expression(r)),f(","))for(;(e=f(this.expression))&&(t.push(e),f(",")););return new Yn.Tree.Value(t)},value:function(){for(var e,t=[];(e=f(this.expression))&&(t.push(e),f(",")););return t.length>1?new Yn.Tree.Value(t.map(function(e){return e.value[0]})):1===t.length?new Yn.Tree.Value(t):void 0},sub:function(){var e;if(f("(")&&(e=f(this.expression))&&f(")"))return e},multiplication:function(){var e,t,r,i;if(e=f(this.operand)){for(;(r=f("/")||f("*")||f("%"))&&(t=f(this.operand));)i=new Yn.Tree.Operation(r,[i||e,t],n);return i||e}},addition:function(){var e,i,s,a;if(e=f(this.multiplication)){for(;(s=f(/^[-+]\s+/)||" "!=t.charAt(r-1)&&(f("+")||f("-")))&&(i=f(this.multiplication));)a=new Yn.Tree.Operation(s,[a||e,i],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 Yn.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 r={},i=[];this._toShaders(r,i,t);for(var s=[],n={},a=0,o=t.length;a<o;++a){var l=t[a],h=l.attachment,u=r[i[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 r=e.join("\n"),i='attributes["FEATUREID"]&&attributes["FEATUREID"]',s=r.indexOf(i);if(s>=0){if(!t.featureFilter){var n=s+i.length,a=r.indexOf(")",n+1),o="featureId&&(featureId"+r.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){"+r+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+r+"; 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[i[a]]=!0}Object.defineProperty(c,"zoom",{configurable:!0,enumerable:!1,value:l.zoom})}return s}}return null}_toShaders(e,t,r){for(let i=0,s=r.length;i<s;++i){let s=r[i],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=Yn.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 Xn={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"]}};Yn.mapnik_reference={version:{latest:Xn,"2.1.1":Xn}},Yn.Tree={},Yn.Tree.operate=function(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"%":return t%r;case"/":return t/r}},Yn.Tree.functions={rgb:function(e,t,r){return this.rgba(e,t,r,1)},rgba:function(e,t,r,i){var s=this,n=[e,t,r].map(function(e){return s.number(e)});return i=s.number(i),n.some(isNaN)||isNaN(i)?null:new Yn.Tree.Color(n,i)},stop:function(e){var t,r;return arguments.length>1&&(t=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:e,color:t,mode:r,toString:i=>'\n\t<stop value="'+e.ev(i)+'"'+(t?' color="'+t.ev(i)+'" ':"")+(r?' mode="'+r.ev(i)+'" ':"")+"/>"}},hsl:function(e,t,r){return this.hsla(e,t,r,1)},hsla:function(e,t,r,i){if([e=this.number(e)%360/360,t=this.number(t),r=this.number(r),i=this.number(i)].some(isNaN))return null;var s=r<=.5?r*(t+1):r+t-r*t,n=2*r-s;return this.rgba(255*a(e+1/3),255*a(e),255*a(e-1/3),i);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 Yn.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new Yn.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new Yn.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new Yn.Tree.Dimension(e.toHSL().a):null},saturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s+=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s-=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l+=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l-=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a+=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a-=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL(),i=(r.h+t.value)%360;return r.h=i<0?360+i:i,this.hsla_simple(r)},replace:function(e,t,r){return"field"===e.is?e.toString+".replace("+t.toString()+", "+r.toString()+")":e.replace(t,r)},mix:function(e,t,r){var i=r.value/100,s=2*i-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*i+t.alpha*(1-i);return new Yn.Tree.Color(l,h)},greyscale:function(e){return this.desaturate(e,new Yn.Tree.Dimension(100))},"%":function(e){for(var t=Array.prototype.slice.call(arguments,1),r=e.value,i=0;i<t.length;i++)r=r.replace(/%s/,t[i].value).replace(/%[da]/,t[i].toString());return r=r.replace(/%%/g,"%"),new Yn.Tree.Quoted(r)},hsla_simple:function(e){return this.hsla(e.h,e.s,e.l,e.a)},number:function(e){return e instanceof Yn.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))}},Yn.Tree.Call=class{constructor(e,t,r){this.is="call",this.name=e,this.args=t,this.index=r}ev(e){for(var t=this.args.map(function(t){return t.ev(e)}),r=0;r<t.length;r++)if("undefined"===t[r].is)return{is:"undefined",value:"undefined"};if(this.name in Yn.Tree.functions){if(Yn.Tree.functions[this.name].length<=t.length){var i=Yn.Tree.functions[this.name].apply(Yn.Tree.functions,t);return null===i?(e.error({message:"incorrect arguments given to "+this.name+"()",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):i}return e.error({message:"incorrect number of arguments for "+this.name+"(). "+Yn.Tree.functions[this.name].length+" expected.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}}var s=Yn.Tree.Reference.mapnikFunctions[this.name];if(void 0===s){var n=Wn()(Yn.Tree.Reference.mapnikFunctions),a=this.name,o=n.map(function(e){return[e[0],Yn.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}},Yn.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,r){var i=[];r instanceof Yn.Tree.Color||(r=r.toColor());for(var s=0;s<3;s++)i[s]=Yn.Tree.operate(t,this.rgb[s],r.rgb[s]);return new Yn.Tree.Color(i)}toHSL(){var e,t,r=this.rgb[0]/255,i=this.rgb[1]/255,s=this.rgb[2]/255,n=this.alpha,a=Math.max(r,i,s),o=Math.min(r,i,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 r:e=(i-s)/h+(i<s?6:0);break;case i:e=(s-r)/h+2;break;case s:e=(r-i)/h+4}e/=6}return{h:360*e,s:t,l,a:n}}},Yn.Tree.Comment=class{constructor(e,t){this.value=e,this.silent=!!t}toString(e){return"\x3c!--"+this.value+"--\x3e"}ev(){return this}},Yn.Tree.Definition=class{constructor(e,t){this.elements=e.elements,this.rules=t,this.ruleIndex={};for(var r=0;r<this.rules.length;r++)"zoom"in this.rules[r]&&(this.rules[r]=this.rules[r].clone()),this.rules[r].zoom=e.zoom,this.ruleIndex[this.rules[r].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={},r=this.zoom,i=this.filters.toJS(e),s=[r];function n(r){if(r instanceof Yn.Tree.Rule)t[r.name]=t[r.name]||[],i?t[r.name].push("if("+i+"){"+r.value.toJS(e)+"}"):t[r.name].push(r.value.toJS(e));else if(r instanceof Yn.Tree.Ruleset){var s=r.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 i&&s.push(i),i=s.join(" && "),this.rules)n(this.rules[a]);return t}},Yn.Tree.Dimension=class{constructor(e,t,r){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=r}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 Yn.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,r){return"%"===this.unit&&"%"!==r.unit?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.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 Yn.Tree.Dimension(Yn.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new Yn.Tree.Dimension(Yn.Tree.operate(t,this.value,r.value),this.unit||r.unit)}},Yn.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}},Yn.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new Yn.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(" ")}},Yn.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}},Yn.Tree.Filter=class{constructor(e,t,r,i,s){this.ops={"<":[" &lt; ","numeric"],">":[" &gt; ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" &lt;= ","numeric"],">=":[" &gt;= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=t,this.val=r,this.index=i,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+"]"}},Yn.Tree.Filterset=class{constructor(){this.filters={}}toJS(e){function t(e){var t=e.op;"="===t&&(t="==");var r=e.val;void 0!==e._val&&(r=e._val.toString(!0)),e.key&&"scale"===e.key.value?r=+r:"string"!=typeof r&&"object"!=typeof r||(r="'"+r+"'");var i="attributes";return i+"&&"+i+e.key+"&&"+i+e.key+" "+t+r}var r=[];for(var i in this.filters)r.push(t(this.filters[i]));return r.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 Yn.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}cloneWith(e){var t=[];for(var r in e.filters){var i=this.addable(e.filters[r]);if(!1===i)return!1;!0===i&&t.push(e.filters[r])}if(!t.length)return null;var s=new Yn.Tree.Filterset;for(r in this.filters)s.filters[r]=this.filters[r];for(;r=t.shift();)s.add(r);return s}addable(e){var t=e.key.toString(),r=e.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),e.op){case"=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val.toString()==r&&null:void 0===this.filters[t+"!="+r]&&(!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<r))));case"=~":return!0;case"!=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val!==r&&null:void 0!==this.filters[t+"!="+r]?null:void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r?null:void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<r)||null;case">":return t+"="in this.filters?!(this.filters[t+"="].val<=r)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)||null));case">=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val<r)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<r)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)||null));case"<":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>=r)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<r)||null));case"<=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>r)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)||null))}}conflict(e){var t=e.key.toString(),r=e.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===e.op&&void 0!==this.filters[t+"="]&&r!=this.filters[t+"="].val.toString()||"!="===e.op&&void 0!==this.filters[t+"="]&&r==this.filters[t+"="].val.toString()||"="===e.op&&void 0!==this.filters[t+"!="]&&r===this.filters[t+"!="].val.toString())&&e.toString()+" added to "+this.toString()+" produces an invalid filter"}add(e,t){var r,i=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===i&&delete this.filters[a];this.filters[i+"="]=e}else if("!="===s)this.filters[i+"!="+e.val]=e;else if("=~"===s)this.filters[i+"=~"+e.val]=e;else if(">"===s){for(var o in this.filters)this.filters[o].key===i&&this.filters[o].val<=e.val&&delete this.filters[o];this.filters[i+">"]=e}else if(">="===s){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===i&&r<e.val&&delete this.filters[l];void 0!==this.filters[i+"!="+e.val]?(delete this.filters[i+"!="+e.val],e.op=">",this.filters[i+">"]=e):this.filters[i+">="]=e}else if("<"===s){for(var h in this.filters)r=+this.filters[h].val.toString(),this.filters[h].key===i&&r>=e.val&&delete this.filters[h];this.filters[i+"<"]=e}else if("<="===s){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===i&&r>e.val&&delete this.filters[u];void 0!==this.filters[i+"!="+e.val]?(delete this.filters[i+"!="+e.val],e.op="<",this.filters[i+"<"]=e):this.filters[i+"<="]=e}}},Yn.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}},Yn.Tree.Invalid=class{constructor(e,t,r){this.is="invalid",this.chunk=e,this.index=t,this.type="syntax",this.message=r||"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"}}},Yn.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}},Yn.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}},Yn.Tree.Operation=class{constructor(e,t,r){this.is="operation",this.op=e.trim(),this.operands=t,this.index=r}ev(e){var t,r=this.operands[0].ev(e),i=this.operands[1].ev(e);return"undefined"===r.is||"undefined"===i.is?{is:"undefined",value:"undefined"}:(r instanceof Yn.Tree.Dimension&&i instanceof Yn.Tree.Color&&("*"===this.op||"+"===this.op?(t=i,i=r,r=t):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof Yn.Tree.Quoted&&i instanceof Yn.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"}):r instanceof Yn.Tree.Field||i instanceof Yn.Tree.Field||r instanceof Yn.Tree.Literal||i instanceof Yn.Tree.Literal?"color"===r.is||"color"===i.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 Yn.Tree.Literal(r.ev(e).toString(!0)+this.op+i.ev(e).toString(!0)):void 0===r.operate?(e.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(e,this.op,i))}},Yn.Tree.Quoted=class{constructor(e){this.is="string",this.value=e||""}toString(e){var t=this.value.replace(/&/g,"&amp;"),r=t.replace(/\'/g,"\\'").replace(/\"/g,"&quot;").replace(/</g,"&lt;").replace(/\>/g,"&gt;");return!0===e?"'"+r+"'":t}ev(){return this}operate(e,t,r){return new Yn.Tree.Quoted(Yn.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}},Yn.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 r in e.symbolizers)for(var i in e.symbolizers[r])e.symbolizers[r][i].hasOwnProperty("css")&&(t[e.symbolizers[r][i].css]=[e.symbolizers[r][i],r,i]);return t}(e),this.mapnikFunctions=function(e){var t={};for(var r in e.symbolizers)for(var i in e.symbolizers[r])if("functions"===e.symbolizers[r][i].type)for(var s=0;s<e.symbolizers[r][i].functions.length;s++){var n=e.symbolizers[r][i].functions[s];t[n[0]]=n[1]}return t}(e),this.required_cache=function(e){var t={};for(var r in e.symbolizers)for(var i in t[r]=[],e.symbolizers[r])e.symbolizers[r][i].required&&t[r].push(e.symbolizers[r][i].css);return t}(e)},setVersion:function(e){return!!Yn.mapnik_reference.version.hasOwnProperty(e)&&(this.setData(Yn.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 r=this.required_cache[e];for(var i in r)if(!(r[i]in t))return"Property "+r[i]+" 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 r=[],i=0;i<=t.length;i++)r[i]=[i];for(var s=0;s<=e.length;s++)r[0][s]=s;for(i=1;i<=t.length;i++)for(s=1;s<=e.length;s++)t.charAt(i-1)===e.charAt(s-1)?r[i][s]=r[i-1][s-1]:r[i][s]=Math.min(r[i-1][s-1]+1,Math.min(r[i][s-1]+1,r[i-1][s]+1));return r[t.length][e.length]},validValue:function(e,t,r){var i;if(this.selector(t)){if("keyword"===r.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}(r,t);if("undefined"===r.value[0].is)return!0;if("numbers"===this.selector(t).type){for(i in r.value)if("float"!==r.value[i].is)return!1;return!0}if("tags"===this.selector(t).type){if(!r.value)return!1;if(!r.value[0].value)return"tag"===r.value[0].is;for(i=0;i<r.value[0].value.length;i++)if("tag"!==r.value[0].value[i].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 r in e.value)for(var i in e.value[r].value){if("call"!==e.value[r].value[i].is)return!1;var s=find(this.selector(t).functions,function(t){return t[0]===e.value[r].value[i].name});if(!(s&&-1===s[1]||s&&s[1]===e.value[r].value[i].args.length))return!1}return!0}(r,t);if("expression"===this.selector(t).type)return!0;if("unsigned"===this.selector(t).type)return"float"===r.value[0].is&&(r.value[0].round(),!0);if(this.selector(t).validate){for(i=0;i<r.value.length;i++)if(this.selector(t).type===r.value[i].is&&this._validateValue[this.selector(t).validate](e,r.value[i].value))return!0;return!1}return this.selector(t).type===r.value[0].is}return!1}},Yn.Tree.Reference.setVersion("latest"),Yn.Tree.Rule=class{constructor(e,t,r,i){this.is="rule";var s=e.split("/");this.name=s.pop(),this.instance=s.length?s[0]:"__default__",this.value=t instanceof Yn.Tree.Value?t:new Yn.Tree.Value([t]),this.index=r,this.symbolizer=Yn.Tree.Reference.symbolizer(this.name),this.filename=i,this.variable="@"===e.charAt(0)}clone(){var e=Object.create(Yn.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"["+Yn.Tree.Zoom.toString(this.zoom)+"] "+this.name+": "+this.value}ev(e){return new Yn.Tree.Rule(this.name,this.value.ev(e),this.index,this.filename)}},Yn.Tree.Ruleset=class{constructor(e,t){this.is="ruleset",this.selectors=e,this.rules=t,this._lookups={}}ev(e){var t,r,i=new Yn.Tree.Ruleset(this.selectors,this.rules.slice(0));for(i.root=this.root,e.frames.unshift(i),t=0;t<i.rules.length;t++)r=i.rules[t],i.rules[t]=r.ev?r.ev(e):r;return e.frames.shift(),i}match(e){return!e||0===e.length}variables(){return this._variables?this._variables:this._variables=this.rules.reduce(function(e,t){return t instanceof Yn.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 Yn.Tree.Ruleset})}find(e,t){t=t||this;var r=[],i=e.toString();return i in this._lookups?this._lookups[i]:(this.rulesets().forEach(function(i){if(i!==t)for(var s=0;s<i.selectors.length;s++)if(e.match(i.selectors[s])){e.elements.length>1?Array.prototype.push.apply(r,i.find(new Yn.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(i);break}}),this._lookups[i]=r)}evZooms(e){for(var t=0;t<this.selectors.length;t++){for(var r=Yn.Tree.Zoom.all,i=0;i<this.selectors[t].zoom.length;i++)r=this.selectors[t].zoom[i].ev(e).zoom;this.selectors[t].zoom=r}}flatten(e,t,r){var i,s,n=[];for(0===this.selectors.length&&(r.frames=r.frames.concat(this.rules)),this.evZooms(r),i=0;i<this.selectors.length;i++){var a=this.selectors[i];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(Yn.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(i=0;i<this.rules.length;i++){var c=this.rules[i];c instanceof Yn.Tree.Ruleset?c.flatten(e,n,r):c instanceof Yn.Tree.Rule?u.push(c):c instanceof Yn.Tree.Invalid&&r.error(c)}var d=!!u.length&&u[0].index;for(i=0;i<n.length;i++)!1!==d&&(n[i].index=d),e.push(new Yn.Tree.Definition(n[i],u.slice()));return e}},Yn.Tree.Selector=class{constructor(e,t,r,i,s,n){this.elements=r||[],this.attachment=i,this.filters=e||{},this.zoom=void 0!==t?t:Yn.Tree.Zoom.all,this.conditions=s,this.index=n}specificity(){return this.elements.reduce(function(e,t){var r=t.specificity();return e[0]+=r[0],e[1]+=r[1],e},[0,0,this.conditions,this.index])}},Yn.Tree.URL=class{constructor(e,t){this.is="uri",this.value=e,this.paths=t}toString(){return this.value.toString()}ev(e){return new Yn.Tree.URL(this.value.ev(e),this.paths)}},Yn.Tree.Value=class{constructor(e){this.is="value",this.value=e}ev(e){return 1===this.value.length?this.value[0].ev(e):new Yn.Tree.Value(this.value.map(function(t){return t.ev(e)}))}toJS(e){var t=this.ev(e),r=t.toString();return"color"===t.is||"uri"===t.is||"string"===t.is||"keyword"===t.is?r="'"+r+"'":"field"===t.is?r=r.replace(/\[(.*)\]/g,"attributes['_match1']"):t.value&&"object"==typeof t.value&&(r="["+r+"]"),"_value = "+r+";"}toString(e,t,r,i){return this.value.map(function(t){return t.toString(e,i)}).join(r||", ")}clone(){var e=Object.create(Yn.Tree.Value.prototype);return Array.isArray(e)?e.value=this.value.slice():e.value=this.value,e.is=this.is,e}},Yn.Tree.Variable=class{constructor(e,t,r){this.is="variable",this.name=e,this.index=t,this.filename=r}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"})}},Yn.Tree.Zoom=class{constructor(e,t,r){this.op=e,this.value=t,this.index=r}setZoom(e){return this.zoom=e,this}ev(e){var t=parseInt(this.value.ev(e).toString(),10);switch((t>Yn.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+Yn.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<=Yn.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<<t?"X":".";return e}},Yn.Tree.Zoom.all=23,Yn.Tree.Zoom.maxZoom=22,Yn.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 Qn{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 Zn extends Qn{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 Qn{constructor(e){super(e),this.pointList=e,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class $n extends Qn{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 ea extends Qn{constructor(e,t,r,i){super(e,t,r,i),this.x=isNaN(e)?0:e,this.y=isNaN(e)?0:t,this.width=isNaN(r)?0:r,this.height=isNaN(i)?0:i,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class ta extends Qn{constructor(e,t,r,i,s,n,a){super(e,t,r,i,s,n,a),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(r)?0:r,this.startAngle=isNaN(i)?0:i,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 ra extends Qn{constructor(e,t,r){super(e,t,r),this.x=e,this.y=t,this.text=r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class ia extends Qn{constructor(e,t,r,i,s,n,a,o,l){super(e,t,r,i,s,n,a,o,l),this.x=e,this.y=t,this.image=r,this.width=i,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 sa extends Qn{constructor(e,t,r){super(e,t,r),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(r)?0:r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class na{constructor(){this._handlers={},this.CLASS_NAME="SuperMap.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(e,t,r){var i=this._handlers;return t&&e?(i[e]||(i[e]=[]),i[e].push({h:t,one:!0,ctx:r||this}),this):this}bind(e,t,r){var i=this._handlers;return t&&e?(i[e]||(i[e]=[]),i[e].push({h:t,one:!1,ctx:r||this}),this):this}unbind(e,t){var r=this._handlers;if(!e)return this._handlers={},this;if(t){if(r[e]){for(var i=[],s=0,n=r[e].length;s<n;s++)r[e][s].h!=t&&i.push(r[e][s]);r[e]=i}r[e]&&0===r[e].length&&delete r[e]}else delete r[e];return this}dispatch(e){if(this._handlers[e]){var t=arguments,r=t.length;r>3&&(t=Array.prototype.slice.call(t,1));for(var i=this._handlers[e],s=i.length,n=0;n<s;){switch(r){case 1:i[n].h.call(i[n].ctx);break;case 2:i[n].h.call(i[n].ctx,t[1]);break;case 3:i[n].h.call(i[n].ctx,t[1],t[2]);break;default:i[n].h.apply(i[n].ctx,t)}i[n].one?(i.splice(n,1),s--):n++}}return this}dispatchWithContext(e){if(this._handlers[e]){var t=arguments,r=t.length;r>4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var i=t[t.length-1],s=this._handlers[e],n=s.length,a=0;a<n;){switch(r){case 1:s[a].h.call(i);break;case 2:s[a].h.call(i,t[1]);break;case 3:s[a].h.call(i,t[1],t[2]);break;default:s[a].h.apply(i,t)}s[a].one?(s.splice(a,1),n--):a++}}return this}}class aa{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Vector"}create(e,t){var r=new(0,this.ArrayCtor)(2);return r[0]=e||0,r[1]=t||0,r}copy(e,t){return e[0]=t[0],e[1]=t[1],e}set(e,t,r){return e[0]=t,e[1]=r,e}add(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}scaleAndAdd(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e}sub(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}len(e){return Math.sqrt(this.lenSquare(e))}lenSquare(e){return e[0]*e[0]+e[1]*e[1]}mul(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}div(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}dot(e,t){return e[0]*t[0]+e[1]*t[1]}scale(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}normalize(e,t){var r=this.len(t);return 0===r?(e[0]=0,e[1]=0):(e[0]=t[0]/r,e[1]=t[1]/r),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,r,i){return e[0]=t[0]+i*(r[0]-t[0]),e[1]=t[1]+i*(r[1]-t[1]),e}applyTransform(e,t,r){var i=t[0],s=t[1];return e[0]=r[0]*i+r[2]*s+r[4],e[1]=r[1]*i+r[3]*s+r[5],e}min(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}max(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[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 oa{constructor(){this.vector=new aa,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,r,i,s){var n=1-s;return n*n*(n*e+3*s*t)+s*s*(s*i+3*n*r)}cubicDerivativeAt(e,t,r,i,s){var n=1-s;return 3*(((t-e)*n+2*(r-t)*s)*n+(i-r)*s*s)}cubicRootAt(e,t,r,i,s,n){var a=i+3*(t-r)-e,o=3*(r-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 y=c/u;let e=-o/a+y,t=-y/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),r=u*o+1.5*a*(-c-e),i=(-o-((t=t<0?-Math.pow(-t,this.ONE_THIRD):Math.pow(t,this.ONE_THIRD))+(r=r<0?-Math.pow(-r,this.ONE_THIRD):Math.pow(r,this.ONE_THIRD))))/(3*a);i>=0&&i<=1&&(n[p++]=i)}else{var m=(2*u*o-3*a*c)/(2*Math.sqrt(u*u*u)),g=Math.acos(m)/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),r=(-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),r>=0&&r<=1&&(n[p++]=r)}}return p}cubicExtrema(e,t,r,i,s){var n=6*r-12*t+6*e,a=9*t+3*i-3*e-9*r,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),r=(-n-e)/(2*a);t>=0&&t<=1&&(s[l++]=t),r>=0&&r<=1&&(s[l++]=r)}}return l}cubicSubdivide(e,t,r,i,s,n){var a=(t-e)*s+e,o=(r-t)*s+t,l=(i-r)*s+r,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]=i}cubicProjectPoint(e,t,r,i,s,n,a,o,l,h,u){var c,d=this.vector.create(),p=this.vector.create(),f=this.vector.create(),y=.005,m=1/0;d[0]=l,d[1]=h;for(let l=0;l<1;l+=.05){p[0]=this.cubicAt(e,r,s,a,l),p[1]=this.cubicAt(t,i,n,o,l);let h=this.vector.distSquare(d,p);h<m&&(c=l,m=h)}m=1/0;for(let l=0;l<32&&!(y<this.EPSILON);l++){let l=c-y,h=c+y;p[0]=this.cubicAt(e,r,s,a,l),p[1]=this.cubicAt(t,i,n,o,l);let u=this.vector.distSquare(p,d);if(l>=0&&u<m)c=l,m=u;else{f[0]=this.cubicAt(e,r,s,a,h),f[1]=this.cubicAt(t,i,n,o,h);let l=this.vector.distSquare(f,d);h<=1&&l<m?(c=h,m=l):y*=.5}}return u&&(u[0]=this.cubicAt(e,r,s,a,c),u[1]=this.cubicAt(t,i,n,o,c)),Math.sqrt(m)}quadraticAt(e,t,r,i){var s=1-i;return s*(s*e+2*i*t)+i*i*r}quadraticDerivativeAt(e,t,r,i){return 2*((1-i)*(t-e)+i*(r-t))}quadraticRootAt(e,t,r,i,s){var n=e-2*t+r,a=2*(t-e),o=e-i,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),r=(-a-e)/(2*n);t>=0&&t<=1&&(s[l++]=t),r>=0&&r<=1&&(s[l++]=r)}}return l}quadraticExtremum(e,t,r){var i=e+r-2*t;return 0===i?.5:(e-t)/i}quadraticProjectPoint(e,t,r,i,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,r,s,a),c[1]=this.quadraticAt(t,i,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,r,s,a),c[1]=this.quadraticAt(t,i,n,a);let l=this.vector.distSquare(c,u);if(a>=0&&l<f)h=a,f=l;else{d[0]=this.quadraticAt(e,r,s,o),d[1]=this.quadraticAt(t,i,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,r,s,h),l[1]=this.quadraticAt(t,i,n,h)),Math.sqrt(f)}}class la{}la.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},la.catchBrushException=!1,la.debugMode=0;class ha{static SUtil_smoothBezier(e,t,r,i,s){s&&2===s.length||(s=[0,0]);var n,a,o=s,l=[],h=[],u=[],c=[],d=!!i;if(d){n=[1/0,1/0],a=[-1/0,-1/0];let t=e.length;for(let r=0;r<t;r++)ha.Util_vector.min(n,n,[e[r][0]+o[0],e[r][1]+o[1]]),ha.Util_vector.max(a,a,[e[r][0]+o[0],e[r][1]+o[1]]);ha.Util_vector.min(n,n,i[0]),ha.Util_vector.max(a,a,i[1])}let p=e.length;for(let i=0;i<p;i++){let s,f,y=[e[i][0]+o[0],e[i][1]+o[1]];if(r)s=[e[i?i-1:p-1][0]+o[0],e[i?i-1:p-1][1]+o[1]],f=[e[(i+1)%p][0]+o[0],e[(i+1)%p][1]+o[1]];else{if(0===i||i===p-1){l.push([e[i][0]+o[0],e[i][1]+o[1]]);continue}s=[e[i-1][0]+o[0],e[i-1][1]+o[1]],f=[e[i+1][0]+o[0],e[i+1][1]+o[1]]}ha.Util_vector.sub(h,f,s),ha.Util_vector.scale(h,h,t);let m=ha.Util_vector.distance(y,s),g=ha.Util_vector.distance(y,f),v=m+g;0!==v&&(m/=v,g/=v),ha.Util_vector.scale(u,h,-m),ha.Util_vector.scale(c,h,g);let b=ha.Util_vector.add([],y,u),S=ha.Util_vector.add([],y,c);d&&(ha.Util_vector.max(b,b,n),ha.Util_vector.min(b,b,a),ha.Util_vector.max(S,S,n),ha.Util_vector.min(S,S,a)),l.push(b),l.push(S)}return r&&l.push(l.shift()),l}static SUtil_smoothSpline(e,t,r,i){i&&2===i.length||(i=[0,0]);var s=i,n=e.length,a=[],o=0;for(let t=1;t<n;t++)o+=ha.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 r=0;r<l;r++){let i,o,u,c=r/(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?(i=[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]]):(i=[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 y=p*p,m=p*y;a.push([h(i[0],f[0],o[0],u[0],p,y,m),h(i[1],f[1],o[1],u[1],p,y,m)])}return a;function h(e,t,r,i,s,n,a){var o=.5*(r-e),l=.5*(i-t);return(2*(t-r)+o+l)*a+(-3*(t-r)-2*o-l)*n+o*s+t}}static SUtil_dashedLineTo(e,t,r,i,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,r),void e.lineTo(i,s);var l=i-t,h=s-r,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,r):e.lineTo(t,r),c=!c,t+=l,r+=h;e.lineTo(i,s)}}ha.Util_area=new class{constructor(){this.util=new Gn,this.curve=new oa,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,r,i){if(!t||!e)return!1;var s=e.type;this._ctx=this._ctx||this.util.getContext();var n=this._mathMethod(e,t,r,i);if(void 0!==n)return n;if(e.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(e,this._ctx,t,r,i);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,r,i,a);case"rose":return this.isInsideCircle(t,r,i,t.maxr);default:return!1}}_mathMethod(e,t,r,i){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,r,i):this.isInsideCubicStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,r,i);case"line":return this.isInsideLine(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,r,i);case"broken-line":return this.isInsideBrokenLine(t.pointList,t.lineWidth,r,i);case"smicbroken-line":{let s=r,n=i;return e.refOriginalPosition&&(s=r-e.refOriginalPosition[0],n=i-e.refOriginalPosition[1]),this.isInsideBrokenLine(t.pointList,t.lineWidth,s,n)}case"ring":return this.isInsideRing(t.x,t.y,t.r0,t.r,r,i);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,r,i)}case"circle":return this.isInsideCircle(t.x,t.y,t.r,r,i);case"smicpoint":{let s=r,n=i;return e.refOriginalPosition&&(s=r-e.refOriginalPosition[0],n=i-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,r,i)}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,r,i)}case"path":return this.isInsidePath(t.pathArray,Math.max(t.lineWidth,5),t.brushType,r,i);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(t.pointList,r,i);case"smicpolygon":{let u=r,c=i;if(e.refOriginalPosition&&(u=r-e.refOriginalPosition[0],c=i-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,r,i);case"smictext":var c=e.getTextBackground(t);return this.isInsidePolygon(c,r,i);case"rectangle":case"image":return this.isInsideRect(t.x,t.y,t.width,t.height,r,i);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,r,i)}}}_buildPathMethod(e,t,r,i,s){return t.beginPath(),e.buildPath(t,r),t.closePath(),t.isPointInPath(i,s)}isOutside(e,t,r,i){return!this.isInside(e,t,r,i)}isInsideLine(e,t,r,i,s,n,a){if(0===s)return!1;var o=Math.max(s,5),l=0;if(a>t+o&&a>i+o||a<t-o&&a<i-o||n>e+o&&n>r+o||n<e-o&&n<r-o)return!1;if(e===r)return Math.abs(n-e)<=o/2;var h=(l=(t-i)/(e-r))*n-a+(e*i-r*t)/(e-r);return h*h/(l*l+1)<=o/2*o/2}isInsideCubicStroke(e,t,r,i,s,n,a,o,l,h,u){if(0===l)return!1;var c=Math.max(l,5);return!(u>t+c&&u>i+c&&u>n+c&&u>o+c||u<t-c&&u<i-c&&u<n-c&&u<o-c||h>e+c&&h>r+c&&h>s+c&&h>a+c||h<e-c&&h<r-c&&h<s-c&&h<a-c)&&this.curve.cubicProjectPoint(e,t,r,i,s,n,a,o,h,u,null)<=c/2}isInsideQuadraticStroke(e,t,r,i,s,n,a,o,l){if(0===a)return!1;var h=Math.max(a,5);return!(l>t+h&&l>i+h&&l>n+h||l<t-h&&l<i-h&&l<n-h||o>e+h&&o>r+h&&o>s+h||o<e-h&&o<r-h&&o<s-h)&&this.curve.quadraticProjectPoint(e,t,r,i,s,n,o,l,null)<=h/2}isInsideArcStroke(e,t,r,i,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>r||c+u<r)return!1;if(Math.abs(i-s)>=h)return!0;if(n){var d=i;i=this.normalizeRadian(s),s=this.normalizeRadian(d)}else i=this.normalizeRadian(i),s=this.normalizeRadian(s);i>s&&(s+=h);var p=Math.atan2(l,o);return p<0&&(p+=h),p>=i&&p<=s||p+h>=i&&p+h<=s}isInsideBrokenLine(e,t,r,i){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,r,i))return!0}return!1}isInsideRing(e,t,r,i,s,n){var a=(s-e)*(s-e)+(n-t)*(n-t);return a<i*i&&a>r*r}isInsideRect(e,t,r,i,s,n){return s>=e&&s<=e+r&&n>=t&&n<=t+i}isInsideCircle(e,t,r,i,s){return(i-e)*(i-e)+(s-t)*(s-t)<r*r}isInsideSector(e,t,r,i,s,n,a,o,l){return this.isInsideArcStroke(e,t,(r+i)/2,s,n,a,i-r,o,l)}isInsidePolygon(e,t,r){for(var i=e.length,s=0,n=0,a=i-1;n<i;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,r),a=n}return 0!==s}windingLine(e,t,r,i,s,n){return n>t&&n>i||n<t&&n<i?0:i==t?0:(n-t)/(i-t)*(r-e)+e>s?i<t?1:-1:0}swapExtrema(){var e=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=e}windingCubic(e,t,r,i,s,n,a,o,l,h){var u=this.curve,c=this.roots,d=this.extrema;if(h>t&&h>i&&h>n&&h>o||h<t&&h<i&&h<n&&h<o)return 0;var p=u.cubicRootAt(t,i,n,o,h,c);if(0===p)return 0;for(var f,y,m=0,g=-1,v=0;v<p;v++){var b=c[v];u.cubicAt(e,r,s,a,b)<l||(g<0&&(g=u.cubicExtrema(t,i,n,o,d),d[1]<d[0]&&g>1&&this.swapExtrema(),f=u.cubicAt(t,i,n,o,d[0]),g>1&&(y=u.cubicAt(t,i,n,o,d[1]))),2==g?b<d[0]?m+=f<t?1:-1:b<d[1]?m+=y<f?1:-1:m+=o<y?1:-1:b<d[0]?m+=f<t?1:-1:m+=o<f?1:-1)}return m}windingQuadratic(e,t,r,i,s,n,a,o){var l=this.curve,h=this.roots;if(o>t&&o>i&&o>n||o<t&&o<i&&o<n)return 0;var u=l.quadraticRootAt(t,i,n,o,h);if(0===u)return 0;var c=l.quadraticExtremum(t,i,n);if(c>=0&&c<=1){var d=0,p=l.quadraticAt(t,i,n,c);for(let i=0;i<u;i++)l.quadraticAt(e,r,s,h[i])>a||(h[i]<c?d+=p<t?1:-1:d+=n<p?1:-1);return d}return l.quadraticAt(e,r,s,h[0])>a?0:n<t?1:-1}windingArc(e,t,r,i,s,n,a,o){var l=this.roots,h=this.PI2;if((o-=t)>r||o<-r)return 0;let u=Math.sqrt(r*r-o*o);if(l[0]=-u,l[1]=u,Math.abs(i-s)>=h){i=0,s=h;var c=n?1:-1;return a>=l[0]+e&&a<=l[1]+e?c:0}if(n){let e=i;i=this.normalizeRadian(s),s=this.normalizeRadian(e)}else i=this.normalizeRadian(i),s=this.normalizeRadian(s);i>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>=i&&e<=s||e+h>=i&&e+h<=s)&&(e>Math.PI/2&&e<1.5*Math.PI&&(t=-t),d+=t)}}return d}isInsidePath(e,t,r,i,s){for(var n=0,a=0,o=0,l=0,h=0,u=!0,c=!0,d="stroke"===(r=r||"fill")||"both"===r,p="fill"===r||"both"===r,f=0;f<e.length;f++){var y=e[f],m=y.points;if(u||"M"===y.command){if(f>0&&(p&&(n+=this.windingLine(a,o,l,h,i,s)),0!==n))return!0;l=m[m.length-2],h=m[m.length-1],u=!1,c&&"A"!==y.command&&(c=!1,a=l,o=h)}switch(y.command){case"M":a=m[0],o=m[1];break;case"L":if(d&&this.isInsideLine(a,o,m[0],m[1],t,i,s))return!0;p&&(n+=this.windingLine(a,o,m[0],m[1],i,s)),a=m[0],o=m[1];break;case"C":if(d&&this.isInsideCubicStroke(a,o,m[0],m[1],m[2],m[3],m[4],m[5],t,i,s))return!0;p&&(n+=this.windingCubic(a,o,m[0],m[1],m[2],m[3],m[4],m[5],i,s)),a=m[4],o=m[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(a,o,m[0],m[1],m[2],m[3],t,i,s))return!0;p&&(n+=this.windingQuadratic(a,o,m[0],m[1],m[2],m[3],i,s)),a=m[2],o=m[3];break;case"A":var g=m[0],v=m[1],b=m[2],S=m[3],x=m[4],_=m[5],w=Math.cos(x)*b+g,C=Math.sin(x)*S+v;c?(c=!1,l=w,h=C):n+=this.windingLine(a,o,w,C);var A=(i-g)*S/b+g;if(d&&this.isInsideArcStroke(g,v,S,x,x+_,1-m[7],t,A,s))return!0;p&&(n+=this.windingArc(g,v,S,x,x+_,1-m[7],A,s)),a=Math.cos(x+_)*b+g,o=Math.sin(x+_)*S+v;break;case"z":if(d&&this.isInsideLine(a,o,l,h,t,i,s))return!0;u=!0}}return p&&(n+=this.windingLine(a,o,l,h,i,s)),0!==n}getTextWidth(e,t){var r=e+":"+t;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t);for(var i=0,s=0,n=(e=(e+"").split("\n")).length;s<n;s++)i=Math.max(this._ctx.measureText(e[s]).width,i);return this._ctx.restore(),this._textWidthCache[r]=i,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),i}getTextHeight(e,t){var r=e+":"+t;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split("\n");var i=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[r]=i,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),i}},ha.Util_color=new jn,ha.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="SuperMap.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(e,t,r){if(0!==e.length){for(var i=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]<i&&(i=l[0]),l[0]>s&&(s=l[0]),l[1]<n&&(n=l[1]),l[1]>a&&(a=l[1])}t[0]=i,t[1]=n,r[0]=s,r[1]=a}}cubeBezier(e,t,r,i,s,n){var a=new oa,o=[];a.cubicExtrema(e[0],t[0],r[0],i[0],o);for(let s=0;s<o.length;s++)o[s]=a.cubicAt(e[0],t[0],r[0],i[0],o[s]);var l=[];a.cubicExtrema(e[1],t[1],r[1],i[1],l);for(let s=0;s<l.length;s++)l[s]=a.cubicAt(e[1],t[1],r[1],i[1],l[s]);o.push(e[0],i[0]),l.push(e[1],i[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,r,i,s){var n=new oa,a=n.quadraticExtremum(e[0],t[0],r[0]),o=n.quadraticExtremum(e[1],t[1],r[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*r[0],c=l*l*e[1]+2*l*a*t[1]+a*a*r[1],d=h*h*e[0]+2*h*o*t[0]+o*o*r[0],p=h*h*e[1]+2*h*o*t[1]+o*o*r[1];i[0]=Math.min(e[0],r[0],u,d),i[1]=Math.min(e[1],r[1],c,p),s[0]=Math.max(e[0],r[0],u,d),s[1]=Math.max(e[1],r[1],c,p)}arc(e,t,r,i,s,n,a,o){var l=new aa,h=l.create(),u=l.create(),c=l.create();if(h[0]=Math.cos(i)*r+e,h[1]=Math.sin(i)*r+t,u[0]=Math.cos(s)*r+e,u[1]=Math.sin(s)*r+t,l.min(a,h,u),l.max(o,h,u),(i%=2*Math.PI)<0&&(i+=2*Math.PI),(s%=2*Math.PI)<0&&(s+=2*Math.PI),i>s&&!n?s+=2*Math.PI:i<s&&n&&(i+=2*Math.PI),n){var d=s;s=i,i=d}for(var p=0;p<s;p+=Math.PI/2)p>i&&(c[0]=Math.cos(p)*r+e,c[1]=Math.sin(p)*r+t,l.min(a,c,a),l.max(o,c,o))}},ha.Util_curve=new oa,ha.Util_env=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Env";var e,t,r,i,s,n,a,o,l,h,u,c,d,p,f,y,m,g,v,b,S,x=this;return e=navigator.userAgent,t=x.os={},r=x.browser={},i=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.]+)/),y=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),b=i&&e.match(/Mobile\//)&&!m,S=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,(r.webkit=!!i)&&(r.version=i[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]),y&&(r.playbook=!0),u&&(t.kindle=!0,t.version=u[1]),c&&(r.silk=!0,r.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(r.silk=!0),m&&(r.chrome=!0,r.version=m[1]),g&&(r.firefox=!0,r.version=g[1]),v&&(r.ie=!0,r.version=v[1]),b&&(e.match(/Safari/)||t.ios)&&(r.safari=!0),S&&(r.webview=!0),v&&(r.ie=!0,r.version=v[1]),t.tablet=!!(n||y||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||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:r,os:t,canvasSupported:!!document.createElement("canvas").getContext}}destory(){return!0}},ha.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}},ha.Util_http=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Http"}get(e,t,r){if("object"==typeof e){var i=e;e=i.url,t=i.onsuccess,r=i.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):r&&r(),s.onreadystatechange=new Function,s=null)},s.send(null)}},ha.Util_log=new class{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(0!=+la.debugMode)if(1==+la.debugMode)for(let e in arguments)throw new Error(arguments[e]);else if(+la.debugMode>1)for(let e in arguments)console.log(arguments[e])}}destory(){return!0}},ha.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}},ha.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,r){return e[0]=t[0]*r[0]+t[2]*r[1],e[1]=t[1]*r[0]+t[3]*r[1],e[2]=t[0]*r[2]+t[2]*r[3],e[3]=t[1]*r[2]+t[3]*r[3],e[4]=t[0]*r[4]+t[2]*r[5]+t[4],e[5]=t[1]*r[4]+t[3]*r[5]+t[5],e}translate(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}rotate(e,t,r){var i=t[0],s=t[2],n=t[4],a=t[1],o=t[3],l=t[5],h=Math.sin(r),u=Math.cos(r);return e[0]=i*u+a*h,e[1]=-i*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,r){var i=r[0],s=r[1];return e[0]=t[0]*i,e[1]=t[1]*s,e[2]=t[2]*i,e[3]=t[3]*s,e[4]=t[4]*i,e[5]=t[5]*s,e}invert(e,t){var r=t[0],i=t[2],s=t[4],n=t[1],a=t[3],o=t[5],l=r*a-n*i;return l?(l=1/l,e[0]=a*l,e[1]=-n*l,e[2]=-i*l,e[3]=r*l,e[4]=(i*o-a*s)*l,e[5]=(n*s-r*o)*l,e):null}mulVector(e,t,r){var i=t[0],s=t[2],n=t[4],a=t[1],o=t[3],l=t[5];return e[0]=r[0]*i+r[1]*s+n,e[1]=r[0]*a+r[1]*o+l,e}},ha.Util=new Gn,ha.Util_vector=new aa;class ua{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=ha.Util_vector.create(),function(t){this.transform||(this.transform=ha.Util_matrix.create());var r=this.transform;function i(e){return e>-5e-5&&e<5e-5}ha.Util_vector.sub(e,t,this.position),i(e[0])&&i(e[1])||(ha.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[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||ha.Util_matrix.create();if(ha.Util_matrix.identity(t),this.needLocalTransform){if(r(this.scale[0])||r(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;let i=r(e[0])||r(e[1]);i&&ha.Util_matrix.translate(t,t,e),ha.Util_matrix.scale(t,t,this.scale),i&&(e[0]=-e[0],e[1]=-e[1],ha.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 i=r(e[0])||r(e[1]);i&&ha.Util_matrix.translate(t,t,e),ha.Util_matrix.rotate(t,t,this.rotation[0]),i&&(e[0]=-e[0],e[1]=-e[1],ha.Util_matrix.translate(t,t,e))}}else 0!=+this.rotation&&ha.Util_matrix.rotate(t,t,this.rotation);(r(this.position[0])||r(this.position[1]))&&ha.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?ha.Util_matrix.mul(this.transform,this.parent.transform,this.transform):ha.Util_matrix.copy(this.transform,this.parent.transform))}function r(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],r=this.position,i=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)),r[0]=e[4],r[1]=e[5],i[0]=t,i[1]=n,i[2]=i[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 ca extends(q(na,ua)){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,te.extend(this,e),this.id=this.id||te.createUniqueID("smShape_"),this.CLASS_NAME="SuperMap.LevelRenderer.Shape",this.getTansform=(t=[],function(e,r){var i=[e,r];return this.needTransform&&this.transform&&(ha.Util_matrix.invert(t,this.transform),ha.Util_matrix.mulVector(i,t,[e,r,1]),e==i[0]&&r==i[1]&&this.updateNeedTransform()),i})}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 r=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,r),r.brushType){case"both":this.setCtxGlobalAlpha(e,"fill",r),e.fill(),r.lineWidth>0&&(this.setCtxGlobalAlpha(e,"stroke",r),e.stroke()),this.setCtxGlobalAlpha(e,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",r);break;default:this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)}this.drawText(e,r,this.style),this.afterBrush(e)}beforeBrush(e,t){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),t&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r}afterBrush(e){e.restore()}setContext(e,t){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],i=0,s=r.length;i<s;i++){var n=t[r[i][0]],a=r[i][1];void 0!==n&&(e[a]=n)}}doClip(e){var t=ha.Util_matrix.create();if(this.__clipShapes)for(var r=0;r<this.__clipShapes.length;r++){var i=this.__clipShapes[r];if(i.needTransform){let r=i.transform;ha.Util_matrix.invert(t,r),e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}if(e.beginPath(),i.buildPath(e,i.style),e.clip(),i.needTransform){let r=t;e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}}}getHighlightStyle(e,t,r){var i={};for(let t in e)i[t]=e[t];var s=ha.Util_color.getHighlightColor();"stroke"!=e.brushType?(i.strokeColor=s,i.lineWidth=e.lineWidth||1,i.brushType="both"):"stroke"!=r?(i.strokeColor=s,i.lineWidth=e.lineWidth||1):i.strokeColor=t.strokeColor||ha.Util_color.mix(e.strokeColor,ha.Util_color.toRGB(s));for(let e in t)void 0!==t[e]&&(i[e]=t[e]);return i}getHighlightZoom(){return"text"!=this.type?6:2}drift(e,t){this.position[0]+=e,this.position[1]+=t}buildPath(e,t){ha.Util_log("buildPath not implemented in "+this.type)}getRect(e){ha.Util_log("getRect not implemented in "+this.type)}isCover(e,t){var r=this.getTansform(e,t);e=r[0],t=r[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&ha.Util_area.isInside(this,this.style,e,t)}drawText(e,t,r){if(void 0!==t.text&&!1!==t.text){var i=t.textColor||t.color||t.strokeColor;e.fillStyle=i;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=(r||t).__rect||this.getRect(r||t);switch(h){case"inside":a=c.x+c.width/2,o=c.y+c.height/2,s="center",n="middle","stroke"!=t.brushType&&i==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,y=0;if(void 0!==t.pointList){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(h){case"start":d=m[0][0]+u[0],p=m[1][0]+u[0],f=m[0][1]+u[1],y=m[1][1]+u[1];break;case"end":d=m[g-2][0]+u[0],p=m[g-1][0]+u[0],f=m[g-2][1]+u[1],y=m[g-1][1]+u[1]}}else d=t.xStart+u[0]||0,p=t.xEnd+u[0]||0,f=t.yStart+u[1]||0,y=t.yEnd+u[1]||0;switch(h){case"start":s=d<p?"end":"start",n=f<y?"bottom":"top",a=d,o=f;break;case"end":s=d<p?"start":"end",n=f<y?"top":"bottom",a=p,o=y}l-=4,d&&p&&d!=p?a-="end"==s?l:-l:s="center",f!=y?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&&ca._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,r){e.globalAlpha="fill"===t?void 0===r.fillOpacity?void 0===r.opacity?1:r.opacity:r.fillOpacity:"stroke"===t?void 0===r.strokeOpacity?void 0===r.opacity?1:r.opacity:r.strokeOpacity:void 0===r.opacity?1:r.opacity}static _fillText(e,t,r,i,s,n,a){s&&(e.font=s),e.textAlign=n,e.textBaseline=a;var o=ca._getTextRect(t,r,i,s,n,a);t=(t+"").split("\n");var l=ha.Util_area.getTextHeight("ZH",s);switch(a){case"top":i=o.y;break;case"bottom":i=o.y+l;break;default:i=o.y+l/2}for(var h=0,u=t.length;h<u;h++)e.fillText(t[h],r,i),i+=l}static _getTextRect(e,t,r,i,s,n){var a=ha.Util_area.getTextWidth(e,i),o=ha.Util_area.getTextHeight("ZH",i);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":r-=o*e.length;break;default:r-=o*e.length/2}return{x:t,y:r,width:a,height:o*e.length}}}class da extends ca{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 r=this.refOriginalPosition;e.arc(t.x+r[0],t.y+r[1],t.r,0,2*Math.PI,!0)}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=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+r[0]-e.r-t/2),y:Math.round(e.y+r[1]-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect)}}class pa extends ca{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 r=this.refOriginalPosition,i=this.style;if(t&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),void 0!==i.text&&!1!==i.text){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s,n=(i.text+"").split("\n"),a=ha.Util_area.getTextHeight("ZH",i.textFont),o=this.getRectNoRotation(i),l=i.x+r[0];s="top"==i.textBaseline?o.y:"bottom"==i.textBaseline?o.y+a:o.y+a/2;for(var h=i.x+r[0],u=i.y+r[1],c=0,d=n.length;c<d;c++){switch(i.labelRect&&(e.fillRect(o.x-2,o.y,o.width+4,o.height),e.fillStyle=i.strokeColor,e.strokeRect(o.x-2,o.y,o.width+4,o.height),e.fillStyle=i.textColor),i.brushType){case"stroke":this.setCtxGlobalAlpha(e,"stroke",i),i.textRotation&&0!==i.textRotation?(e.save(),e.translate(h,u),e.rotate(i.textRotation*Math.PI/180),"top"==i.textBaseline?i.maxWidth?e.strokeText(n[c],0,a*c,i.maxWidth):e.strokeText(n[c],0,a*c):"bottom"==i.textBaseline?i.maxWidth?e.strokeText(n[c],0,a*(c+1)-o.height,i.maxWidth):e.strokeText(n[c],0,a*(c+1)-o.height):i.maxWidth?e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2,i.maxWidth):e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2),e.restore()):i.maxWidth?e.strokeText(n[c],l,s,i.maxWidth):e.strokeText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",i);break;case"both":i.textRotation&&0!==i.textRotation?(e.save(),e.translate(h,u),e.rotate(i.textRotation*Math.PI/180),"top"==i.textBaseline?i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],0,a*c,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],0,a*c,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],0,a*c),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],0,a*c),this.setCtxGlobalAlpha(e,"reset",i)):"bottom"==i.textBaseline?i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],0,a*(c+1)-o.height,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],0,a*(c+1)-o.height,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],0,a*(c+1)-o.height),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],0,a*(c+1)-o.height),this.setCtxGlobalAlpha(e,"reset",i)):i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],0,a*(c+1)-o.height/2-a/2,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],0,a*(c+1)-o.height/2-a/2),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],0,a*(c+1)-o.height/2-a/2),this.setCtxGlobalAlpha(e,"reset",i)),e.restore()):i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],l,s,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],l,s,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",i));break;default:this.setCtxGlobalAlpha(e,"fill",i),i.textRotation&&0!==i.textRotation?(e.save(),e.translate(h,u),e.rotate(i.textRotation*Math.PI/180),"top"==i.textBaseline?i.maxWidth?e.fillText(n[c],0,a*c,i.maxWidth):e.fillText(n[c],0,a*c):"bottom"==i.textBaseline?i.maxWidth?e.fillText(n[c],0,a*(c+1)-o.height,i.maxWidth):e.fillText(n[c],0,a*(c+1)-o.height):i.maxWidth?e.fillText(n[c],0,a*(c+1)-o.height/2-a/2,i.maxWidth):e.fillText(n[c],0,a*(c+1)-o.height/2-a/2),e.restore()):i.maxWidth?e.fillText(n[c],l,s,i.maxWidth):e.fillText(n[c],l,s),this.setCtxGlobalAlpha(e,"reset",i)}s+=a}e.restore()}}getRect(e){if(e.__rect)return e.__rect;for(var t,r,i,s,n=this.getTextBackground(e,!0),a=0,o=n.length;a<o;a++){var l=n[a];0==a?(t=l[0],i=l[0],r=l[1],s=l[1]):(l[0]<t&&(t=l[0]),l[0]>i&&(i=l[0]),l[1]<r&&(r=l[1]),l[1]>s&&(s=l[1]))}return e.__rect={x:t,y:r,width:i-t,height:s-r},e.__rect}getRectNoRotation(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition,i=ha.Util_area.getTextHeight("ZH",e.textFont),s=ha.Util_area.getTextWidth(e.text,e.textFont),n=ha.Util_area.getTextHeight(e.text,e.textFont),a=e.x+r[0];"end"==e.textAlign||"right"==e.textAlign?a-=s:"center"==e.textAlign&&(a-=s/2),t="top"==e.textBaseline?e.y+r[1]:"bottom"==e.textBaseline?e.y+r[1]-n:e.y+r[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+r[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?i/3*(s/o):i/3));return{x:a,y:t,width:s,height:n}}getTextBackground(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var i=this.getRectNoRotation(e),s=e.x+r[0],n=e.y+r[1],a=[];if(e.textRotation&&0!==e.textRotation){let t=e.textRotation,r=this.getRotatedLocation(i.x,i.y,s,n,t),o=this.getRotatedLocation(i.x+i.width,i.y,s,n,t),l=this.getRotatedLocation(i.x+i.width,i.y+i.height,s,n,t),h=this.getRotatedLocation(i.x,i.y+i.height,s,n,t);a.push(r),a.push(o),a.push(l),a.push(h)}else{let e=[i.x,i.y],t=[i.x+i.width,i.y],r=[i.x+i.width,i.y+i.height],s=[i.x,i.y+i.height];a.push(e),a.push(t),a.push(r),a.push(s)}return e.__textBackground=a,e.__textBackground}getRotatedLocation(e,t,r,i,s){var n,a,o=new Array;return t=-t,i=-i,s=-s,n=(e-r)*Math.cos(s/180*Math.PI)-(t-i)*Math.sin(s/180*Math.PI)+r,a=(e-r)*Math.sin(s/180*Math.PI)+(t-i)*Math.cos(s/180*Math.PI)+i,o[0]=n,o[1]=-a,o}}class fa extends ca{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 r=this.refOriginalPosition,i=t.x+r[0],s=t.y+r[1];return e.moveTo(i+t.r,s),e.arc(i,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,r=this.refOriginalPosition,i=e.x+r[0],s=e.y+r[1],n=e.r;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(i-n-t/2),y:Math.round(s-n-t/2),width:2*n+t,height:2*n+t},e.__rect}}class ya extends ca{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 r=this.style;t&&(r=this.getHighlightStyle(r,this.highlightStyle||{})),e.save(),this.setContext(e,r),this.setTransform(e);var i=!1;"fill"!=r.brushType&&"both"!=r.brushType&&void 0!==r.brushType||(e.beginPath(),"dashed"==r.lineType||"dotted"==r.lineType||"dot"==r.lineType||"dash"==r.lineType||"dashdot"==r.lineType||"longdash"==r.lineType||"longdashdot"==r.lineType?this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(e,r),i=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)),r.lineWidth>0&&("stroke"==r.brushType||"both"==r.brushType)&&(i||(e.beginPath(),this.buildPath(e,r)),this.setCtxGlobalAlpha(e,"stroke",r),e.stroke(),this.setCtxGlobalAlpha(e,"reset",r)),this.drawText(e,r,this.style);var s=te.cloneObject(r);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",i=!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),i=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",s),e.fill(),this.setCtxGlobalAlpha(e,"reset",s)),s.lineWidth>0&&("stroke"==s.brushType||"both"==s.brushType)?(i||(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 r=this.refOriginalPosition,i=t.pointList;if(!(i.length<2))if(t.smooth&&"spline"!==t.smooth){var s,n,a,o=ha.SUtil_smoothBezier(i,t.smooth,!0,t.smoothConstraint,r);e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(var l=i.length,h=0;h<l;h++)s=o[2*h],n=o[2*h+1],a=[i[(h+1)%l][0]+r[0],i[(h+1)%l][1]+r[1]],e.bezierCurveTo(s[0],s[1],n[0],n[1],a[0],a[1])}else if("spline"===t.smooth&&(i=ha.SUtil_smoothSpline(i,!0,null,r)),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(i[0][0]+r[0],i[0][1]+r[1]);for(let t=1;t<i.length;t++)ha.SUtil_dashedLineTo(e,i[t-1][0]+r[0],i[t-1][1]+r[1],i[t][0]+r[0],i[t][1]+r[1],n,[a,o]);ha.SUtil_dashedLineTo(e,i[i.length-1][0]+r[0],i[i.length-1][1]+r[1],i[0][0]+r[0],i[0][1]+r[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(i[0][0]+r[0],i[0][1]+r[1]);for(let t=1;t<i.length;t++)ha.SUtil_dashedLineTo(e,i[t-1][0]+r[0],i[t-1][1]+r[1],i[t][0]+r[0],i[t][1]+r[1],n,[a,o,l,h]);ha.SUtil_dashedLineTo(e,i[i.length-1][0]+r[0],i[i.length-1][1]+r[1],i[0][0]+r[0],i[0][1]+r[1],n,[a,o,l,h])}}else{e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let t=1;t<i.length;t++)e.lineTo(i[t][0]+r[0],i[t][1]+r[1]);e.lineTo(i[0][0]+r[0],i[0][1]+r[1])}}getRect(e,t){var r;if(t?r=t:(this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),r=this.refOriginalPosition),e.__rect)return e.__rect;for(var i,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]+r[0]<s&&(s=l[h][0]+r[0]),l[h][0]+r[0]>n&&(n=l[h][0]+r[0]),l[h][1]+r[1]<a&&(a=l[h][1]+r[1]),l[h][1]+r[1]>o&&(o=l[h][1]+r[1]);return i="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(s-i/2),y:Math.round(a-i/2),width:n-s+i,height:o-a+i},e.__rect}}class ma extends ca{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 r=this.refOriginalPosition,i=t.pointList;if(!(i.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=ha.SUtil_smoothBezier(i,t.smooth,!1,t.smoothConstraint,r);e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let t=0;t<s-1;t++)n=l[2*t],a=l[2*t+1],o=[i[t+1][0]+r[0],i[t+1][1]+r[1]],e.bezierCurveTo(n[0],n[1],a[0],a[1],o[0],o[1])}else if("spline"===t.smooth&&(s=(i=ha.SUtil_smoothSpline(i,null,null,r)).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(i[0][0]+r[0],i[0][1]+r[1]);for(var h=1;h<s;h++)ha.SUtil_dashedLineTo(e,i[h-1][0]+r[0],i[h-1][1]+r[1],i[h][0]+r[0],i[h][1]+r[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(i[0][0]+r[0],i[0][1]+r[1]);for(let t=1;t<s;t++)ha.SUtil_dashedLineTo(e,i[t-1][0]+r[0],i[t-1][1]+r[1],i[t][0]+r[0],i[t][1]+r[1],n,[a,o,l,h])}}else{e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let t=1;t<s;t++)e.lineTo(i[t][0]+r[0],i[t][1]+r[1])}}}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;return ya.prototype.getRect.apply(this,[e,t])}}class ga extends ca{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,r){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=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(ga._refreshTimeout),ga._needsRefresh.push(a),ga._refreshTimeout=setTimeout(function(){r&&r(ga._needsRefresh),ga._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+i[0],c=s.y+i[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+i[0]||0,r=s.sy+i[1]||0;e.drawImage(n,t,r,s.sWidth,s.sHeight,u,c,l,h)}else if(s.sx&&s.sy){let t=s.sx+i[0],r=s.sy+i[1];var d=l-t,p=h-r;e.drawImage(n,t,r,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={}}}ga._needsRefresh=[],ga._refreshTimeout=null;class va extends ca{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 r,i,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?r=i=s=n=d:d instanceof Array?1===d.length?r=i=s=n=d[0]:2===d.length?(r=s=d[0],i=n=d[1]):3===d.length?(r=d[0],i=n=d[1],s=d[2]):(r=d[0],i=d[1],s=d[2],n=d[3]):r=i=s=n=0,r+i>u&&(r*=u/(a=r+i),i*=u/a),s+n>u&&(s*=u/(a=s+n),n*=u/a),i+s>c&&(i*=c/(a=i+s),s*=c/a),r+n>c&&(r*=c/(a=r+n),n*=c/a),e.moveTo(l+r,h),e.lineTo(l+u-i,h),0!==i&&e.quadraticCurveTo(l+u,h,l+u,h+i),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+r),0!==r&&e.quadraticCurveTo(l,h,l+r,h)}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+r[0],t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1])),e.closePath()}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=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+r[0]-t/2),y:Math.round(e.y+r[1]-t/2),width:e.width+t,height:e.height+t},e.__rect)}}class ba extends ca{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 r=this.refOriginalPosition,i=t.x+r[0],s=t.y+r[1],n=t.r0||0,a=t.r,o=t.startAngle,l=t.endAngle,h=t.clockWise||!1;o=ha.Util_math.degreeToRadian(o),l=ha.Util_math.degreeToRadian(l),h||(o=-o,l=-l);var u=ha.Util_math.cos(o),c=ha.Util_math.sin(o);e.moveTo(u*n+i,c*n+s),e.lineTo(u*a+i,c*a+s),e.arc(i,s,a,o,l,!h),e.lineTo(ha.Util_math.cos(l)*n+i,ha.Util_math.sin(l)*n+s),0!==n&&e.arc(i,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,r=ha.Util_vector.create(),i=ha.Util_vector.create(),s=ha.Util_vector.create(),n=ha.Util_vector.create(),a=e.x+t[0],o=e.y+t[1],l=e.r0||0,h=e.r,u=ha.Util_math.degreeToRadian(e.startAngle),c=ha.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(u=-u,c=-c),l>1?ha.Util_computeBoundingBox.arc(a,o,l,u,c,!d,r,s):(r[0]=s[0]=a,r[1]=s[1]=o),ha.Util_computeBoundingBox.arc(a,o,h,u,c,!d,i,n),ha.Util_vector.min(r,r,i),ha.Util_vector.max(s,s,n),e.__rect={x:r[0],y:r[1],width:s[0]-r[0],height:s[1]-r[1]},e.__rect}}class Sa{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 Zn){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e=te.copyAttributesWithClip(e,t.style,["x","y"]);let r=new da;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["x","y","style","highlightStyle"]),r}if(t instanceof Kn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=te.copyAttributesWithClip(e,t.style,["pointList"]);let r=new ma;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["pointList","style","highlightStyle"]),r}if(t instanceof $n){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=te.copyAttributesWithClip(e,t.style,["pointList"]);let r=new ya;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["pointList","style","highlightStyle"]),r}if(t instanceof ea){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=te.copyAttributesWithClip(e,t.style,["x","y","width","height"]);let r=new va;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["x","y","width","height","style","highlightStyle"]),r}if(t instanceof ta){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=te.copyAttributesWithClip(e,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let r=new ba;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),r}if(t instanceof ra){let e=new Object;e.x=t.x,e.y=t.y,e.text=t.text,e=te.copyAttributesWithClip(e,t.style,["x","y","text"]);let r=new pa;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["x","y","text","style","highlightStyle"]),r}if(t instanceof ia){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=te.copyAttributesWithClip(e,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let r=new ga;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["x","y","image","width","height","style","highlightStyle"]),r}if(t instanceof sa){let e=new Object;e.x=t.x,e.r=t.r,e.y=t.y,e=te.copyAttributesWithClip(e,t.style,["x","y","r"]);let r=new fa;return r.style=Sa.transformStyle(e),r.highlightStyle=Sa.transformStyle(t.highlightStyle),te.copyAttributesWithClip(r,t,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),r}return null}static transformStyle(e){var t={},r=["normal","normal","normal","12","arial,sans-serif"],i=[!0,!1];for(var s in e)switch(s){case"fill":i[0]=e[s];break;case"fillColor":t.color=e[s];break;case"stroke":i[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":r[0]=e[s];break;case"fontVariant":r[1]=e[s];break;case"fontWeight":r[2]=e[s];break;case"fontSize":var n="";e[s]&&e[s].toString().indexOf("px")<0&&(n="px"),r[3]=e[s]+n;break;case"fontFamily":r[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=r.join(" "),!0===i[0]&&!1===i[1]?t.brushType="fill":!1===i[0]&&!0===i[1]?t.brushType="stroke":!0===i[0]&&!0===i[1]?t.brushType="both":t.brushType="fill",null==t.lineWidth&&(t.lineWidth=1),t}static Background(e,t,r){var i=r||{},s=new ea(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return s.style={fillColor:"#f3f3f3"},i.backgroundStyle&&te.copyAttributesWithClip(s.style,i.backgroundStyle),i.backgroundRadius&&(s.style.radius=i.backgroundRadius),s.clickable=!1,s.hoverable=!1,e.createShape(s)}static GraphAxis(e,t,r,i){var s=t,n=r||{},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 y=new Kn([[s[0],p],[s[2],p]]);y.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},y.clickable=!1,y.hoverable=!1,n.xReferenceLineStyle&&te.copyAttributesWithClip(y.style,n.xReferenceLineStyle),a.push(e.createShape(y))}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 m=[[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 $n(m);v.style={fillColor:"#008acd"},te.copyAttributesWithClip(v.style,n.axisStyle),o.push(e.createShape(v));var b=new $n(g);if(b.style={fillColor:"#008acd"},te.copyAttributesWithClip(b.style,n.axisStyle),o.push(e.createShape(b)),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){var S=new $n(u);S.style={fillColor:"#008acd"},te.copyAttributesWithClip(S.style,n.axisStyle),o.push(e.createShape(S))}}var x=new Kn(c);x.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},n.axisStyle&&te.copyAttributesWithClip(x.style,n.axisStyle),x.clickable=!1,x.hoverable=!1;var _=[e.createShape(x)],w=[];if(n.axisYLabels&&n.axisYLabels.length&&n.axisYLabels.length>0){var C=n.axisYLabels;let t=C.length;var A=[0,0];if(n.axisYLabelsOffset&&n.axisYLabelsOffset.length&&(A=n.axisYLabelsOffset),1==t){let t=new ra(s[0]-5+A[0],s[3]+A[1],C[0]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&te.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,w.push(e.createShape(t))}else for(var M=s[3],T=Math.abs(s[1]-s[3])/(t-1),E=0;E<t;E++){let t=new ra(s[0]-5+A[0],M+A[1],C[E]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&te.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,w.push(e.createShape(t)),M+=T}}var O=[];if(n.axisXLabels&&n.axisXLabels.length&&n.axisXLabels.length>0){let t=n.axisXLabels,r=t.length,a=[0,0];if(n.axisXLabelsOffset&&n.axisXLabelsOffset.length&&(a=n.axisXLabelsOffset),i&&i.xPositions&&i.xPositions.length&&i.xPositions.length==r){let o=i.xPositions;for(let i=0;i<r;i++){let r=new ra(o[i]+a[0],s[1]+a[1],t[i]);r.style={labelAlign:"center",labelBaseline:"top"},n.axisXLabelsStyle&&te.copyAttributesWithClip(r.style,n.axisXLabelsStyle),r.clickable=!1,r.hoverable=!1,O.push(e.createShape(r))}}else if(1==r){let r=new ra(s[0]-5+a[0],s[1]+a[0],t[0]);r.style={labelAlign:"center",labelBaseline:"top"},n.axisXLabelsStyle&&te.copyAttributesWithClip(r.style,n.axisXLabelsStyle),r.clickable=!1,r.hoverable=!1,O.push(e.createShape(r))}else{let i=s[0],o=Math.abs(s[2]-s[0])/(r-1);for(let l=0;l<r;l++){let r=new ra(i+a[0],s[1]+a[1],t[l]);r.style={labelAlign:"center",labelBaseline:"top"},n.axisXLabelsStyle&&te.copyAttributesWithClip(r.style,n.axisXLabelsStyle),r.clickable=!1,r.hoverable=!1,O.push(e.createShape(r)),i+=o}}}return a.concat(_).concat(w).concat(O).concat(o)}static ShapeStyleTool(e,t,r,i,s,n){var a=e||{};if(t&&te.copyAttributesWithClip(a,t),r&&r.length&&void 0!==s&&!isNaN(s)&&s>=0&&r[s]&&te.copyAttributesWithClip(a,r[s]),i&&i.length&&void 0!==n)for(var o=i,l=o.length,h=parseFloat(n),u=0;u<l;u++)if(o[u].start<=h&&h<o[u].end){te.copyAttributesWithClip(a,o[u].style);break}return a}}class xa{constructor(e,t){e&&t&&t.map&&t.renderer&&(this.id=te.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(),r=this.layer.map.getExtent();if(e instanceof he||e instanceof ce){return[e.x/t+-r.left/t,r.top/t-e.y/t]}if(e instanceof se){return[e.lon/t+-r.left/t,r.top/t-e.lat/t]}return null}}class _a extends xa{constructor(e,t,r,i,s,n){super(e,t,r,i,s,n),this.shapeFactory=new Sa,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=r||[],this.dataValues=null,this.lonlat=s||this.data.geometry.getBounds().getCenterLonLat(),i&&i.width&&i.height&&i.codomain&&(this.setting=i),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,r=xa.getDataValues(this.data,this.fields,t);this.dataValues=r||[],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 i=this.width,s=this.height,n=this.location;this.origonPoint=[n[0]-i/2,n[1]-s/2];var a=this.origonPoint;this.chartBox=[a[0],a[1]+s,a[0]+i,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 r=this.width,i=this.height,s=this.location;return this.chartBounds=new ne(s[0]-r/2,s[1]+i/2,s[0]+r/2,s[1]-i/2),this.resetLinearGradient(),s}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var e=this.shapes,t=this.location,r=0,i=e.length;r<i;r++){e[r].refOriginalPosition=t;var s=e[r].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)}}xa.getDataValues=function(e,t,r){if(!e.attributes)return!1;for(var i=[],s=e.attributes,n=0;n<t.length;n++)for(var a in s)if(a===t[n])try{!isNaN(r)&&r>=0?i.push(parseFloat(s[a].toString()).toFixed(r)):i.push(parseFloat(s[a].toString()))}catch(e){throw new Error("not a number")}return i.length===t.length&&i};class wa extends _a{constructor(e,t,r,i,s,n){super(e,t,r,i,s,n),this.setting=null,i&&i.codomain&&(this.setting=i,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,r=this.height,i=this.location;this.origonPoint=[i[0]-t/2,i[1]-r/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+r,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 Ca extends xa{constructor(e,t,r,i,s){if(super(e,t),e.geometry&&e.geometry instanceof Q){this.dataBounds=e.geometry.getBounds(),this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=r||{},this.CLASS_NAME="SuperMap.Feature.Theme.Vector",this.style=r||{},i&&te.copyAttributesWithClip(this,i,["shapeOptions","dataBounds"]),s&&te.copyAttributesWithClip(this.shapeOptions,s);var n=e.geometry;this.lonlat=this.dataBounds.getCenterLonLat(),this.location=this.getLocalXY(this.lonlat),n instanceof de?this.lineToTF(n):n instanceof ue?this.lineToTF(n):n instanceof le||(n instanceof oe?this.multiPointToTF(n):n instanceof pe?this.multiLineStringToTF(n):n instanceof fe?this.multiPolygonToTF(n):n instanceof ye?this.polygonToTF(n):n instanceof ae||(n instanceof he?this.pointToTF(n):n instanceof me?this.rectangleToTF(n):n instanceof ce&&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,r=[],i=[],s=this.location,n=[],a=this.nodesClipPixel,o=0;o<t.length;o++){var l=t[o];if(i=[],r=this.getLocalXY(l),i[0]=r[0]-s[0],i[1]=r[1]-s[1],n.length>0){var h=n[n.length-1];if(Math.abs(h[0]-i[0])<=a&&Math.abs(h[1]-i[1])<=a)continue}n.push(i)}if(n.length<2)return null;var u=new Object;(u=te.copyAttributesWithClip(u,this.style,["pointList"])).pointList=n;var c=new ma({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&&te.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}multiPointToTF(e){for(var t=e.components,r=[],i=[],s=this.location,n=[],a=this.nodesClipPixel,o=0;o<t.length;o++){var l=t[o];if(i=[],r=this.getLocalXY(l),i[0]=r[0]-s[0],i[1]=r[1]-s[1],n.length>0){var h=n[n.length-1];if(Math.abs(h[0]-i[0])<=a&&Math.abs(h[1]-i[1])<=a)continue}n.push(i);var u=new Object;u.r=6,(u=te.copyAttributesWithClip(u,this.style)).x=i[0],u.y=i[1];var c=new da({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&&te.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}}multiLineStringToTF(e){for(var t=e.components,r=0;r<t.length;r++){var i=t[r];this.lineToTF(i)}}multiPolygonToTF(e){for(var t=e.components,r=0;r<t.length;r++){var i=t[r];this.polygonToTF(i)}}pointToTF(e){var t=this.location,r=this.getLocalXY(e),i=new Object;i.r=6,(i=te.copyAttributesWithClip(i,this.style)).x=r[0]-t[0],i.y=r[1]-t[1];var s=new da({style:i,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&&te.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}polygonToTF(e){for(var t=e.components,r=[],i=[],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(i=[],r=this.getLocalXY(u[c]),i[0]=r[0]-s[0],i[1]=r[1]-s[1],n.length>0){var d=n[n.length-1];if(Math.abs(d[0]-i[0])<=l&&Math.abs(d[1]-i[1])<=l)continue}n.push(i)}}else{a=[];for(var p=0;p<u.length;p++){if(i=[],r=this.getLocalXY(u[p]),i[0]=r[0]-s[0],i[1]=r[1]-s[1],a.length>0){var f=a[a.length-1];if(Math.abs(f[0]-i[0])<=l&&Math.abs(f[1]-i[1])<=l)continue}a.push(i)}}a.length<2||o.push(a)}if(!(n.length<2)){var y={};(y=te.copyAttributesWithClip(y,this.style,["pointList"])).pointList=n;var m=new ya({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,o.length>0&&(m.holePolygonPointLists=o),this.shapeOptions&&te.copyAttributesWithClip(m,this.shapeOptions),this.shapes.push(m)}}rectangleToTF(e){var t=this.location,r=new se(e.x,e.y),i=this.layer.map.getResolution(),s=this.getLocalXY(r),n=new Object;n.r=6,(n=te.copyAttributesWithClip(n,this.style)).x=s[0]-t[0],n.y=s[1]-t[1]-2*e.width/i,n.width=e.width/i,n.height=e.height/i;var a=new va({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&&te.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}geoTextToTF(e){var t=this.location,r=this.getLocalXY(e),i=new Object;i.r=6,(i=te.copyAttributesWithClip(i,this.style,["x","y","text"])).x=r[0]-t[0],i.y=r[1]-t[1],i.text=e.text;var s=new pa({style:i,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&&te.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}updateAndAddShapes(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,r=0,i=this.shapes.length;r<i;r++){var s=this.shapes[r];s.refOriginalPosition=e,t.addShape(s)}}getShapesCount(){return this.shapes.length}getLocalXY(e){return this.layer.getLocalXY(e)}}class Aa extends(q(na,ua)){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,te.extend(this,e),this.id=this.id||te.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 Aa&&e.addChildrenToStorage(this._storage)))}removeChild(e){var t=te.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof Aa&&e.delChildrenFromStorage(this._storage))}eachChild(e,t){for(var r=!!t,i=0;i<this._children.length;i++){var s=this._children[i];r?e.call(t,s):e(s)}}traverse(e,t){for(var r=!!t,i=0;i<this._children.length;i++){var s=this._children[i];r?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 r=this._children[t];e.addToMap(r),"group"===r.type&&r.addChildrenToStorage(e)}}delChildrenFromStorage(e){for(var t=0;t<this._children.length;t++){var r=this._children[t];e.delFromMap(r.id),"group"===r.type&&r.delChildrenFromStorage(e)}}modSelf(){this.__dirty=!0}}class Ma{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 r=0,i=this._hoverElements.length;r<i;r++){var s=this._hoverElements[r];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,r=this._shapeList.length;t<r;t++)if(e(this._shapeList[t]))return this}return this}getHoverShapes(e){var t=[],r=this._hoverElements.length;for(let e=0;e<r;e++){t.push(this._hoverElements[e]);var i=this._hoverElements[e].hoverConnect;if(i)for(var s,n=0,a=(i=i instanceof Array?i:[i]).length;n<a;n++)(s=i[n].id?i[n]:this.get(i[n]))&&t.push(s)}if(t.sort(Ma.shapeCompareFunc),e)for(let e=0,r=t.length;e<r;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(Ma.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 r=0;r<e._children.length;r++){var i=e._children[r];i.__dirty=e.__dirty||i.__dirty,this._updateAndAddShape(i,t)}e.__dirty=!1}else e.__clipShapes=t,this._shapeList[this._shapeListOffset++]=e}mod(e,t){var r=this._elements[e];if(r&&(r.modSelf(),t))if(t.parent||t._storage||t.__startClip){var i={};for(var s in t)"parent"!=s&&"_storage"!=s&&"__startClip"!=s&&t.hasOwnProperty(s)&&(i[s]=t[s]);(new Gn).merge(r,i,!0)}else(new Gn).merge(r,t,!0);return this}drift(e,t,r){var i=this._elements[e];return i&&(i.needTransform=!0,"horizontal"===i.draggable?r=0:"vertical"===i.draggable&&(t=0),(!i.ondrift||i.ondrift&&!i.ondrift(t,r))&&i.drift(t,r)),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 Aa&&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 r=this._roots[t];r instanceof Aa&&r.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],void(this._roots=[])}if(e instanceof Array){var i=e.length;for(let t=0;t<i;t++)this.delRoot(e[t])}else{var s;s="string"==typeof e?this._elements[e]:e;var n=(new Gn).indexOf(this._roots,s);n>=0&&(this.delFromMap(s.id),this._roots.splice(n,1),s instanceof Aa&&s.delChildrenFromStorage(this))}}addToMap(e){return e instanceof Aa&&(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 Aa&&(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 Ta{constructor(e,t){this.root=e,this.storage=t,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,Ta.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 r=document.createElement("div");this._domRoot=r,r.style.position="relative",r.style.overflow="hidden",r.style.width=this._width+"px",r.style.height=this._height+"px",this.root.appendChild(r),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=Ta.createDom(te.createUniqueID("SuperMap.Theme_background_"),"div",this),r.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 i=new Ea(te.createUniqueID("_highLightLayer_"),this);this._layers.hover=i,r.appendChild(i.dom),i.initContext(),i.dom.onselectstart=n,i.dom.style["-webkit-user-select"]="none",i.dom.style["user-select"]="none",i.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 r=this.storage.getShapeList(!0);return this._paintList(r,t),"function"==typeof e&&e(),this}_paintList(e,t){var r,i,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(i!==h.zlevel&&(r&&r.needTransform&&s.restore(),s=(r=this.getLayer(h.zlevel)).ctx,i=h.zlevel,r.unusedCount=0,(r.dirty||t)&&r.clear(),r.needTransform&&(s.save(),r.setTransform(s))),s&&h.__startClip){var u=h.__startClip;if(s.save(),u.needTransform){let e=u.transform;ha.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((r&&r.dirty||t)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(s,!1)))if(la.catchBrushException)try{h.brush(s,!1,this.updatePainter)}catch(e){ha.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&&r&&r.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 r=this._zlevelList.length,i=null,s=-1;if(r>0&&e>this._zlevelList[0]){for(s=0;s<r-1&&!(this._zlevelList[s]<e&&this._zlevelList[s+1]>e);s++);i=this._layers[this._zlevelList[s]]}this._zlevelList.splice(s+1,0,e),t=new Ea(te.createUniqueID("_levelLayer_"+e),this);var n=i?i.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 Gn).merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}getLayers(){return this._layers}_updateLayerStatus(e){var t=this._layers,r={};for(let e in t)"hover"!==e&&(r[e]=t[e].elCount,t[e].elCount=0);for(let r=0;r<e.length;r++){var i=e[r],s=t[i.zlevel];if(s){if(s.elCount++,s.dirty)continue;s.dirty=i.__dirty}}for(let e in t)"hover"!==e&&r[e]!==t[e].elCount&&(t[e].dirty=!0)}refreshShapes(e,t){for(var r=0,i=e.length;r<i;r++){var s=e[r];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 Gn).merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var r=this._layers[e];r&&(new Gn).merge(r,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 Gn).indexOf(this._zlevelList,e),1))}refreshHover(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,r=e.length;t<r;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(),r=this._getHeight();if(e.style.display="",this._width!=t||r!=this._height){for(var i in this._width=t,this._height=r,e.style.width=t+"px",e.style.height=r+"px",this._layers)this._layers[i].resize(t,r);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,r){var i=Ta.createDom(te.createUniqueID("SuperMap.Theme.image_"),"canvas",this);this._bgDom.appendChild(i);var s=i.getContext("2d");1!=Ta.devicePixelRatio&&s.scale(Ta.devicePixelRatio,Ta.devicePixelRatio),s.fillStyle=t||"#fff",s.rect(0,0,this._width*Ta.devicePixelRatio,this._height*Ta.devicePixelRatio),s.fill();var n=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(s,!1)))if(la.catchBrushException)try{e.brush(s,!1,n.updatePainter)}catch(t){ha.Util_log(t,"brush error of "+e.type,e)}else e.brush(s,!1,n.updatePainter)},{normal:"up",update:!0});var a=i.toDataURL(e,r);return s=null,this._bgDom.removeChild(i),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 r=this.getLayer(e.zlevel);if(r.needTransform&&(t.save(),r.setTransform(t)),la.catchBrushException)try{e.brush(t,!0,this.updatePainter)}catch(t){ha.Util_log(t,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.updatePainter);r.needTransform&&t.restore()}}_shapeToImage(e,t,r,i,s){var n=document.createElement("canvas"),a=n.getContext("2d"),o=s||window.devicePixelRatio||1;n.style.width=r+"px",n.style.height=i+"px",n.setAttribute("width",r*o),n.setAttribute("height",i*o),a.clearRect(0,0,r*o,i*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 ga({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,r,i,s){return e._shapeToImage(t,r,i,s,Ta.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,r){var i=document.createElement(t),s=r._width,n=r._height;return i.style.position="absolute",i.style.left=0,i.style.top=0,i.style.width=s+"px",i.style.height=n+"px",i.setAttribute("width",s*Ta.devicePixelRatio),i.setAttribute("height",n*Ta.devicePixelRatio),i.setAttribute("id",e),i}}class Ea extends ua{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=Ta.createDom(te.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,ua.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),1!=Ta.devicePixelRatio&&this.ctx.scale(Ta.devicePixelRatio,Ta.devicePixelRatio)}createBackBuffer(){this.domBack=Ta.createDom(te.createUniqueID("SuperMap.Theme.back-"+this.id),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!=Ta.devicePixelRatio&&this.ctxBack.scale(Ta.devicePixelRatio,Ta.devicePixelRatio)}resize(e,t){this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*Ta.devicePixelRatio),this.dom.setAttribute("height",t*Ta.devicePixelRatio),1!=Ta.devicePixelRatio&&this.ctx.scale(Ta.devicePixelRatio,Ta.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",e*Ta.devicePixelRatio),this.domBack.setAttribute("height",t*Ta.devicePixelRatio),1!=Ta.devicePixelRatio&&this.ctxBack.scale(Ta.devicePixelRatio,Ta.devicePixelRatio))}clear(){var e=this.dom,t=this.ctx,r=e.width,i=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,r/Ta.devicePixelRatio,i/Ta.devicePixelRatio)),s?(t.save(),t.fillStyle=this.config.clearColor,t.fillRect(0,0,r/Ta.devicePixelRatio,i/Ta.devicePixelRatio),t.restore()):t.clearRect(0,0,r/Ta.devicePixelRatio,i/Ta.devicePixelRatio),n){var o=this.domBack;t.save(),t.globalAlpha=a,t.drawImage(o,0,0,r/Ta.devicePixelRatio,i/Ta.devicePixelRatio),t.restore()}}}class Oa extends na{constructor(e,t,r){var i,s;super(e,t,r),this.root=e,this.storage=t,this.painter=r,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=(i=function(e,t,r){var i=this;if(i._draggingTarget&&i._draggingTarget.id==e.id||e.isSilent())return!1;var s=i._event;if(e.isCover(t,r)){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=i.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&&i.storage.addHover(u):i.storage.addHover(u))}}}else i.storage.addHover(e);for(var c=e.parent;c;){if(c.clipShape&&!c.clipShape.isCover(i._mouseX,i._mouseY))return!1;c=c.parent}return i._lastHover!=e&&(i._processOutShape(s),i._processDragLeave(s),i._lastHover=e,i._processDragEnter(s)),i._processOverShape(s),i._processDragOver(s),i._hasfound=1,!0}return!1},s=this,function(e,t,r){return i.call(s,e,t,r)}),this._domHover=r.getDomHover(),this.CLASS_NAME="SuperMap.LevelRenderer.Handler";var n={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(la.EVENT.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<10&&this._dispatchAgency(t,la.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,la.EVENT.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){var t=((e=this._zrenderEventFixed(e)).wheelDelta||-e.detail)>0?1.1:1/1.1,r=this.painter.getLayers(),i=!1;for(var s in r)if("hover"!==s){var n=r[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,i=!0}}i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,la.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=ha.Util_event.getX(e),this._mouseY=ha.Util_event.getY(e);var t=this._mouseX-this._lastX,r=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 i="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,r),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&&(i="move",o.position[0]+=t,o.position[1]+=r,n=!0,o.dirty=!0)}n&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,la.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(la.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,la.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,la.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&&ha.Util_event.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment<la.EVENT.touchClickDelay&&(this._mobildFindFixed(e),this._clickHandler(e),t-this._lastClickMoment<la.EVENT.touchClickDelay/2&&(this._dblclickHandler(e),this._lastHover&&this._lastHover.clickable&&ha.Util_event.stop(e)),this._lastClickMoment=t),this.painter.clearHover()}};function a(e,t){return function(r){return e.call(t,r)}}!function(e){var t=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],r=t.length;for(;r--;){var i=t[r];e["_"+i+"Handler"]=a(n[i],e)}}(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),ha.Util_env.os.tablet||ha.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,na.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 r=la.EVENT;switch(e){case r.RESIZE:case r.CLICK:case r.DBLCLICK:case r.MOUSEWHEEL:case r.MOUSEMOVE:case r.MOUSEDOWN:case r.MOUSEUP:case r.MOUSEOUT:this["_"+e+"Handler"](t)}}dispose(){var e=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),ha.Util_env.os.tablet||ha.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 r=t;this._draggingTarget=r,this._isDragging=1,r.invisible=!0,this.storage.mod(r.id),this._dispatchAgency(r,la.EVENT.DRAGSTART,e),this.painter.refresh()}}_processDragEnter(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,la.EVENT.DRAGENTER,e,this._draggingTarget)}_processDragOver(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,la.EVENT.DRAGOVER,e,this._draggingTarget)}_processDragLeave(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,la.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,la.EVENT.DROP,e,this._draggingTarget))}_processDragEnd(e){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,la.EVENT.DRAGEND,e),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(e){this._dispatchAgency(this._lastHover,la.EVENT.MOUSEOVER,e)}_processOutShape(e){this._dispatchAgency(this._lastHover,la.EVENT.MOUSEOUT,e)}_dispatchAgency(e,t,r,i){var s="on"+t,n={type:t,event:r,target:e,cancelBubble:!1},a=e;for(i&&(n.dragged=i);a&&(a[s]&&(n.cancelBubble=a[s](n)),a.dispatch(t,n),a=a.parent,!n.cancelBubble););e?n.cancelBubble||this.dispatch(t,n):i||this.dispatch(t,{type:t,event:r})}_iterateAndFindHover(){for(var e,t=ha.Util_matrix.create(),r=this.storage.getShapeList(),i=[0,0],s=r.length-1;s>=0;s--){var n=r[s];if(void 0!==n.zlevel&&(e=this.painter.getLayer(n.zlevel,e),i[0]=this._mouseX,i[1]=this._mouseY,e.needTransform&&(ha.Util_matrix.invert(t,e.transform),ha.Util_vector.applyTransform(i,i,t))),this._findHover(n,i[0],i[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 r=0;!this._lastHover&&r<t.length;r++){var i=t[r];i.x&&(this._mouseX+=i.x),i.y&&(this._mouseX+=i.y),this._iterateAndFindHover()}this._lastHover&&(e.zrenderX=this._mouseX,e.zrenderY=this._mouseY)}_zrenderEventFixed(e,t){if(e.zrenderFixed)return e;if(t){var r="touchend"!=e.type?e.targetTouches[0]:e.changedTouches[0];if(r){var i=this.root.getBoundingClientRect();e.zrenderX=r.clientX-i.left,e.zrenderY=r.clientY-i.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,r=.1;return 0===e?0:1===e?1:(r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))}ElasticOut(e){var t,r=.1;return 0===e?0:1===e?1:(r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)}ElasticInOut(e){var t,r=.1;return 0===e?0:1===e?1:(r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:r*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 Ia{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,r=(e-this._startTime)/this._life;if(!(r<0)){r=Math.min(r,1);var i="string"==typeof this.easing?t[this.easing]:this.easing,s="function"==typeof i?i(r):r;return this.fire("frame",s),1==r?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 r=0,i=this._targetPool.length;r<i;r++)this["on"+e]&&this["on"+e](this._targetPool[r],t)}}class Na extends na{constructor(e){super(e),e=e||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,te.extend(this,e),this.CLASS_NAME="SuperMap.LevelRenderer.Animation"}add(e){this._clips.push(e)}remove(e){var t=(new Gn).indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)}_update(){var e=(new Date).getTime(),t=e-this._time,r=this._clips,i=r.length,s=[],n=[];for(let t=0;t<i;t++){var a=r[t],o=a.step(e);o&&(s.push(o),n.push(a))}this.stage.update&&this.stage.update();for(let e=0;e<i;)r[e]._needsRemove?(r[e]=r[i-1],r.pop(),i--):e++;i=s.length;for(let e=0;e<i;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 r(){t._running&&(t._update(),e(r))})}stop(){this._running=!1}clear(){this._clips=[]}animate(e,t){var r=new La(e,(t=t||{}).loop,t.getter,t.setter);return r.animation=this,r}static _interpolateNumber(e,t,r){return(t-e)*r+e}static _interpolateArray(e,t,r,i,s){var n=e.length;if(1==s)for(let s=0;s<n;s++)i[s]=Na._interpolateNumber(e[s],t[s],r);else{var a=e[0].length;for(let s=0;s<n;s++)for(let n=0;n<a;n++)i[s][n]=Na._interpolateNumber(e[s][n],t[s][n],r)}}static _isArrayLike(e){switch(typeof e){case"undefined":case"string":return!1}return void 0!==e.length}static _catmullRomInterpolateArray(e,t,r,i,s,n,a,o,l){var h=e.length;if(1==l)for(let l=0;l<h;l++)o[l]=Na._catmullRomInterpolate(e[l],t[l],r[l],i[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]=Na._catmullRomInterpolate(e[l][c],t[l][c],r[l][c],i[l][c],s,n,a)}}static _catmullRomInterpolate(e,t,r,i,s,n,a){var o=.5*(r-e),l=.5*(i-t);return(2*(t-r)+o+l)*a+(-3*(t-r)-2*o-l)*n+o*s+t}static _cloneValue(e){var t=Array.prototype.slice;if(Na._isArrayLike(e)){var r=e.length;if(Na._isArrayLike(e[0])){for(var i=[],s=0;s<r;s++)i.push(t.call(e[s]));return i}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 La{constructor(e,t,r,i){this._tracks={},this._target=e,this._loop=t||!1,this._getter=r||function(e,t){return e[t]},this._setter=i||function(e,t,r){e[t]=r},this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="SuperMap.LevelRenderer.Animation.Animator"}when(e,t){for(var r in t)this._tracks[r]||(this._tracks[r]=[],0!==e&&this._tracks[r].push({time:0,value:Na._cloneValue(this._getter(this._target,r))})),this._tracks[r].push({time:parseInt(e,10),value:t[r]});return this}during(e){return this._onframeList.push(e),this}start(e){var t=this,r=this._setter,i=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,r=0;r<e;r++)t._doneList[r].call(t)}},o=function(o,l){var h=o.length;if(h){var u=o[0].value,c=Na._isArrayLike(u),d=!1,p=c&&Na._isArrayLike(u[0])?2:1;o.sort(function(e,t){return e.time-t.time});var f=o[h-1].time,y=[],m=[];for(let e=0;e<h;e++){y.push(o[e].time/f);var g=o[e].value;"string"==typeof g&&(0===(g=ha.Util_color.toArray(g)).length&&(g[0]=g[1]=g[2]=0,g[3]=1),d=!0),m.push(g)}var v,b,S,x,_,w,C,A=0,M=0;if(d)var T=[0,0,0,0];var E=new Ia({target:t._target,life:f,loop:t._loop,delay:t._delay,onframe:function(e,a){if(a<M){for(v=Math.min(A+1,h-1),b=v;b>=0&&!(y[b]<=a);b--);b=Math.min(b,h-2)}else{for(b=A;b<h&&!(y[b]>a);b++);b=Math.min(b-1,h-2)}A=b,M=a;var o=y[b+1]-y[b];if(0!==o){if(S=(a-y[b])/o,n)if(_=m[b],x=m[0===b?b:b-1],w=m[b>h-2?h-1:b+1],C=m[b>h-3?h-1:b+2],c)Na._catmullRomInterpolateArray(x,_,w,C,S,S*S,S*S*S,i(e,l),p);else{let t;t=d?Na.rgba2String(T):Na._catmullRomInterpolate(x,_,w,C,S,S*S,S*S*S),r(e,l,t)}else if(c)Na._interpolateArray(m[b],m[b+1],S,i(e,l),p);else{let t;d?(Na._interpolateArray(m[b],m[b+1],S,T,1),t=Na.rgba2String(T)):t=Na._interpolateNumber(m[b],m[b+1],S),r(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 ka{constructor(e,t){this.id=e,this.storage=new Ma,this.painter=new Ta(t,this.storage),this.handler=new Oa(t,this.storage,this.painter),this.animatingElements=[],this.animation=new Na({stage:{update:ka.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,r){if("string"==typeof e&&(e=this.storage.get(e)),e){var i;if(t){for(var s=t.split("."),n=e,a=0,o=s.length;a<o;a++)n&&(n=n[s[a]]);n&&(i=n)}else i=e;if(!i)return void ha.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(i,{loop:r}).done(function(){if(e.__aniCount--,0===e.__aniCount){var t=(new Gn).indexOf(l,e);l.splice(t,1)}})}ha.Util_log("Element not existed")}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(e,t,r){return this.painter.toDataURL(e,t,r)}shapeToImage(e,t,r){var i=te.createUniqueID("SuperMap.LevelRenderer.ToImage_");return this.painter.shapeToImage(i,e,t,r)}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 r=0,i=t.length;r<i;r++)e.storage.mod(t[r].id);(t.length||e._needsRefreshNextFrame)&&e.refresh()}}}}class Fa{constructor(){Fa._instances={},Fa.Tool={},this.version="2.0.4",this.CLASS_NAME="SuperMap.LevelRenderer"}destroy(){this.dispose(),this.version=null}init(e){var t=new ka(te.createUniqueID("LRenderer_"),e);return Fa._instances[t.id]=t,t}dispose(e){if(e)e.dispose(),this.delInstance(e.id);else{for(var t in Fa._instances)Fa._instances[t].dispose();Fa._instances={}}return this}getInstance(e){return Fa._instances[e]}delInstance(e){return delete Fa._instances[e],this}}function Ra(e,t,r){if(e===r||e===t)return e;let i=r-t;return((e-t)%i+i)%i+t}function Da(e){return e*Math.PI/180}Math.PI,Math.PI;const Ga="EXCEL",ja="CSV",Ba="GEOJSON",Ua="JSON";class Va{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 r=document.createElement("div");r.setAttribute("class","component-messagebox"),r.innerHTML="",e.appendChild(r),this.messageBox=r;const i=document.createElement("div");i.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),i.appendChild(s),e.appendChild(i),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 Ja=function(){try{return echarts}catch(e){return{}}}();let za={"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 za.code||za.setCode(),za.code},setCode:function(){var e=this.getLanguageFromCookie();e||(e=za.defaultCode,e="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===e.indexOf("zh")&&(e="zh-CN"),0===e.indexOf("en")&&(e="en-US"),za.code=e},getLanguageFromCookie(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){for(var r=e[t];" "===r.charAt(0);)r=r.substring(1);if(-1!==r.indexOf("language="))return r.substring("language=".length,r.length)}return""},i18n:function(e){var t=za[za.getCode()],r=t&&t[e];return r||(r=e),r}};const qa=function(){try{return XLSX}catch(e){return{}}}();let Ha={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,r,i,s){Ua===e||Ba===e?this.readTextFile(t,r,i,s):Ga!==e&&ja!==e||this.readXLSXFile(t,r,i,s)},readTextFile(e,t,r,i){let s=new FileReader;s.onloadend=function(e){t&&t.call(i,e.target.result)},s.onerror=function(e){r&&r.call(i,e)},this.rAT?s.readAsText(e.file,"utf-8"):s.readAsBinaryString(e.file)},readXLSXFile(e,t,r,i){let s=new FileReader;s.onloadend=function(e){let s=new Uint8Array(e.target.result),n=qa.read(s,{type:"array"});try{if(n&&n.SheetNames&&n.SheetNames.length>0){let e=n.SheetNames[0],r=qa.utils.sheet_to_csv(n.Sheets[e]);t&&t.call(i,r)}}catch(e){r&&r.call(i,e)}},s.onerror=function(e){r&&r.call(i,e)},this.rABF&&s.readAsArrayBuffer(e.file)},processDataToGeoJson(e,t,r,i,s){let n=null;if("EXCEL"===e||"CSV"===e)n=this.processExcelDataToGeoJson(t),r&&r.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:i&&i.call(s,za.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(s,n)}else i&&i.call(s,za.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson(e){let t=this.string2Csv(e),r=t.colTitles,i=-1,s=-1;for(let e=0,t=r.length;e<t;e++)this.isXField(r[e])&&(i=e),this.isYField(r[e])&&(s=e);let n=[];for(let e=0,r=t.rows.length;e<r;e++){let r=t.rows[e],a=Number(r[i]),o=Number(r[s]),l={};for(let r in t.colTitles){l[t.colTitles[r]]=t.rows[e][r]}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 r=e.split("\n"),i={};i.colTitles=t?[]:r[0].split(","),i.rows=[];for(let e=t?0:1;e<r.length;e++)r[e]&&i.rows.push(r[e].split(","));return i}};class Wa{constructor(e){this.datasets=e,this.EVENT_TYPES=["getdatafailed"],this.events=new Se(this,null,this.EVENT_TYPES)}getDatasetInfo(e){let t=this.datasets.url,r=this;Ue.get(t).then(function(e){return e.json()}).then(function(t){if(t.datasetInfo){let i=t.datasetInfo;r.datasetsInfo={dataSourceName:i.dataSourceName,datasetName:i.name,mapName:t.name},e({result:r.datasetsInfo})}}).catch(function(e){console.log(e),r._fireFailedEvent(e)})}getDataFeatures(e,t){let r,i,s,n=e.result,a={name:n.datasetName+"@"+n.dataSourceName};Object.assign(a,this.datasets.queryInfo),r=new yt(a),i=new qr({queryParameter:r,datasetNames:[n.dataSourceName+":"+n.datasetName],fromIndex:0,toIndex:1e5}),(s=new Hr(n.dataUrl)).processAsync(i,t)}getLayerFeatures(e,t){let r,i,s,n=e.result,a={name:n.mapName};Object.assign(a,this.datasets.queryInfo),r=new yt(a),i=new Qi({queryParams:[r],expectCount:1e5}),(s=new Zi(n.dataUrl)).processAsync(i,t)}getDataInfoByIptl(e){this.getServiceInfo(this.datasets.url,e)}getServiceInfo(e,t){let r=this;Ue.get(e,null,{withCredentials:this.datasets.withCredentials}).then(e=>e.json()).then(i=>{if(!1!==i.succeed)if(i.dataItemServices&&i.dataItemServices.length>0){let s;i.dataItemServices.forEach(i=>{if("RESTDATA"===i.serviceType&&"PUBLISHED"===i.serviceStatus)s=i;else{if("RESTMAP"!==i.serviceType||"PUBLISHED"!==i.serviceStatus)return void r.getDatafromContent(e,t);s=i}}),s&&r.getDatafromRest(s.serviceType,s.address,t)}else r.getDatafromContent(e,t);else r._fireFailedEvent(i)}).catch(e=>{console.log(e),r._fireFailedEvent(e)})}getDatafromContent(e,t){let r={result:{}},i=this;e+="/content.json?pageSize=9999999&currentPage=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(za.i18n("msg_jsonResolveFiled"));let t=this._formatGeoJSON(e.content);r.result.features={type:e.content.type,features:t}}else if("EXCEL"===e.type||"CSV"===e.type){let t=this._excelData2Feature(e.content);r.result.features={type:"FeatureCollection",features:t}}t(r,"content")}}else i._fireFailedEvent(e)},this).catch(e=>{console.log(e),i._fireFailedEvent(e)})}getDatafromRest(e,t,r){let i=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],i.getDatafromRestData(`${t}/data`,[e+":"+n],r),[e+":"+n])).catch(function(e){i._fireFailedEvent(e)})}).catch(function(e){i._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,i.getDatafromRestMap(n,a,r),n)).catch(function(e){i._fireFailedEvent(e)})}).catch(function(e){i._fireFailedEvent(e)})}}getDatafromRestData(e,t,r){let i=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,e=>{r(e,"RESTDATA")},e=>{console.log(e),i._fireFailedEvent(e)})}getDatafromRestMap(e,t,r){let i=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,e=>{r(e,"RESTMAP")},e=>{console.log(e),i._fireFailedEvent(e)})}_getFeatureBySQL(e,t,r,i,s){let n,a,o,l={name:t.join().replace(":","@")};Object.assign(l,r),n=new yt(l),o=new qr({queryParameter:n,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),(a=new Hr(e)).processAsync(o,function(e){"processCompleted"===e.type?i&&i(e):s&&s(e)})}_queryFeatureBySQL(e,t,r,i,s,a,o,l,h,u){var c,d,p={name:t};Object.assign(p,r),c=new yt(p),i&&(c.fields=i);var f={queryParams:[c]};u&&(f.queryOption=n.ATTRIBUTE),l&&(f.startRecord=l),h&&(f.expectCount=h),s&&(f.prjCoordSys={epsgCode:s}),d=new Qi(f),this._queryBySQL(e,d,e=>{"processCompleted"===e.type?a(e):o(e)})}_queryBySQL(e,t,r,i){new Zi(e,{format:this._processFormat(i)}).processAsync(t,r)}_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,r=-1,i=-1;for(let e=0,s=t.length;e<s;e++)Ha.isXField(t[e])&&(r=e),Ha.isYField(t[e])&&(i=e);let s=[];for(let t=0,n=e.rows.length;t<n;t++){let n=e.rows[t],a=Number(n[r]),o=Number(n[i]),l={};for(let r in e.colTitles){l[e.colTitles[r]]=e.rows[t][r]}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:za.i18n("msg_getdatafailed")}:{message:za.i18n("msg_getdatafailed")};this.events.triggerEvent("getdatafailed",t)}}class Ya{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 Se(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 Wa(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,r=t.indexOf("rest");if(r>0){let i=t.indexOf("/",r+5),s=t.substring(r+5,i),n=t.substring(0,r+4)+"/data";if("maps"===s){let s=t.indexOf("/",i+1),a=t.substring(i+1,s);n=t.substring(0,r+4)+"/maps/"+a,e.result.dataUrl=n,this._getLayerFeatures(e)}else"data"===s&&(e.result.dataUrl=n,this._getDataFeatures(e))}}_getDataInfoSuccess(e,t){let r=this;"RESTMAP"===t?r._getChartDatasFromLayer(e):r._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,r={};if(t.length){let e=t[0],i=[],s=[];for(let t in e.properties)i.push(t),s.push(this._getDataType(e.properties[t]));r={features:t,fieldCaptions:i,fieldTypes:s,fieldValues:[]};for(let e in s){let i=[];for(let s in t){let n=t[s],a=r.fieldCaptions[e],o=n.properties[a];i.push(o)}r.fieldValues.push(i)}this.createChart(r)}}}_getChartDatasFromLayer(e){if(e.result.recordsets){let t=e.result.recordsets[0],r=t.features.features;this.features=t.features;let i={};if(r.length){i={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]};for(let e in i.fieldCaptions){let t=[];for(let s in r){let n=r[s],a=i.fieldCaptions[e],o=n.properties[a];t.push(o)}i.fieldValues.push(t)}this.createChart(i)}}}_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,r){this.updateChart=r,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 r=this.grid,i=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&&(r=t.grid),t.tooltip&&(o=t.tooltip),t.backgroundColor&&(l=t.backgroundColor)),{backgroundColor:l,grid:r,series:i,xAxis:n,yAxis:a,tooltip:o}}}_createChartDatas(e){let t=0,r=[],i=e.fieldCaptions,s=this;i.forEach(function(e,r){s.xField[0]&&e===s.xField[0].field&&(t=r)}),this.yFieldName="",this.yField.forEach(function(e,t){0!==t&&(s.yFieldName=s.yFieldName+","),s.yFieldName=s.yFieldName+e.name,i.forEach(function(t,i){t===e.field&&r.push(i)})});let n=this._getAttrData(e,t),a=[];if(r.length>0)r.forEach(function(t){let r=[];for(let i in e.fieldValues[t])r.push({value:e.fieldValues[t][i]});a.push(r)});else{let e=[],t=[],r=n.length;for(let i=0;i<r;i++){let r=!1;for(let s=0,a=t.length;s<a;s++)if(n[i].fieldsData===t[s].fieldsData){e[s].value++,t[s].recordIndexs.push(i),r=!0;break}r||n[i].fieldsData&&(t.push({fieldsData:n[i].fieldsData,recordIndexs:[i]}),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 r=[];for(let i=0,s=e.fieldValues[t].length;i<s;i++){let s=e.fieldValues[t][i];r.push({recordIndexs:i,fieldsData:s})}return r}_createChartSeries(e,t){let r=[];return e.YData.forEach(function(e){let i=0,s=[];for(let t of e)i=t.value,s.push({value:i});let n={type:t,data:s,name:"y"};r.push(n)}),r}_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 Xa{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 Qa extends Xa{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 r=document.createElement("div");r.setAttribute("class","component-popcontainer__header");const i=document.createElement("label");i.setAttribute("class","component-popcontainer__header__title"),i.innerHTML=e,r.appendChild(i);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(r);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 Za extends Xa{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 r=document.createElement("div");r.setAttribute("class","component-tabpage__content"),this.content=r,e.appendChild(t),e.appendChild(r),this.rootContainer=e}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t<e.length;t++){let r=document.createElement("span");r.index=t,r.appendChild(document.createTextNode(e[t].title)),r.onclick=this._changeTabsPage.bind(this);let i=e[t].content;i.index=t,i.hidden=!0,this.header.appendChild(r),this.content.appendChild(i)}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)}}var Ka=r(618),$a=r.n(Ka);function eo(e,t){const r=t&&t.styles&&t.styles.style,i=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,r){const i={nodes:[],edges:[]};return e.forEach(e=>{if(ro(e)){const r=so(e,t);i.edges.push(r)}else{const s=io(e,t,r);i.nodes.push(s)}}),i}(t,r,i);s.nodes.push(...e),s.edges.push(...n)}else if(ro(e)){const t=so(e,r);s.edges.push(t)}else{const t=io(e,r,i);s.nodes.push(t)}}),{nodes:to(s.nodes),edges:to(s.edges,"edgeId")}}function to(e,t="id"){return $a()(e,t)}function ro(e){return e.hasOwnProperty("start")&&e.hasOwnProperty("end")}function io(e,t,r){const{id:i,properties:s,lables:n}=e,a=t?function(e,t){if(!t)return{};const{id:r,labels:i}=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(r)||c.includes(i[0]))return{fillColor:t,fontSize:a.fontSize,fill:n,size:o,...ao(a.fontName),...no(a.fontStyle)}}return{}}(e,t):{},o=function(e,t){const{id:r,labels:i,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||"[]"),u=i&&i.join("&");if(l.includes(r)||h.includes(u))return s[n]||""}}return s[s._labelfieldname]||""}(e,r),l=a.fillColor||"",h={id:i+"",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 so(e,t){const{start:r,end:i,id:s,type:n,properties:a}=e,o=t?function(e,t){if(!t)return{};const{id:r,type:i}=e,s=t.filter(e=>"relationShip"===e.type);for(let e=0;e<s.length;e++){const{color:t,width:n,textColor:a,font:o,relationTypes:l,relationIds:h}=s[e],u=JSON.parse(h||"[]"),c=JSON.parse(l||"[]");if(u.includes(r)||c.includes(i))return{stroke:t,lineWidth:1.4*Number(n),fontSize:o.fontSize,fill:a,...ao(o.fontName),...no(o.fontStyle)}}return{}}(e,t):{},l={source:r+"",target:i+"",edgeId:s+"",label:n,style:{},labelCfg:{},properties:a};return o.stroke&&(l.style.stroke=o.stroke,l.style.endArrow={path:"M 0,0 L 4,2 L 4,-2 Z",fill:o.stroke},delete o.stroke),o.lineWidth&&(l.style.lineWidth=o.lineWidth,delete o.lineWidth),l.labelCfg={style:o},l}function no(e){return 1===e||"bold"===e?{fontWeight:"bold"}:2===e||"italic"===e?{fontStyle:"italic"}:"bolditalic"===e?{fontWeight:"bold",fontStyle:"italic"}:{}}function ao(e){if(!e)return{};const t=e.split(".");return{fontFamily:t[0],...no(t[1])}}const oo=function(){try{return G6}catch(e){return{}}}();var lo=r.n(oo),ho=r(186),uo=r.n(ho);class co{constructor(){this.config=null,this.graph=null,this.data=null,this.collpasedData={},this.importG6(),this.CLASS_NAME="SuperMap.G6Render"}importG6(){lo()||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(lo().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(lo().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 r=t.getType(),i=t.getModel();return r&&i&&"node"===r?this.isCollpased(i.id)?"<ul>\n              <li id='expand'>展开</li>\n            </ul>":"<ul>\n              <li id='collapse'>折叠</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()}},r={type:"fruchterman",gravity:5},i={},s={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},n={default:["drag-canvas","zoom-canvas","drag-node"]},a=this._getContextMenu(),o=[new(lo().ToolBar),a],l={lineWidth:3,stroke:"#b4d6ff"},h={stroke:"#b4d6ff",shadowColor:"#b4d6ff",shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 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:{...r,...t},defaultNode:i,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={...r,...e.layout||{},...!1!==e.animate?t:{}},e.defaultNode={...i,...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(lo().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,r=e.scrollHeight;this.graph.changeSize(t,r),this.graph.refresh()})}zoom(e,t,r,i){this.graph.zoom(e,t,r,i)}zoomTo(e,t,r,i){this.graph.zoomTo(e,t,r,i)}fitView(e,t,r,i){this.graph.fitView(e,t,r,i)}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,r=this.graph.getHeight()/2,i=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-i.x,r-i.y)}_setToolBarStyle(){uo()("\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 r=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(r,"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 r=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(r,"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,r=this.graph){return r.getNeighbors(e,t)}findById(e,t=this.graph){return t.findById(e)}find(e,t,r=this.graph){return r.find(e,t)}findAll(e,t,r=this.graph){return r.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,r=[];this._collapseFunc(e,r),this.collpasedData[t]=r,this._expandCollapseNode(r)}isCollpased(e){return!!this.collpasedData[e]}_collapseFunc(e,t=[]){const r=this.getNeighbors(e,"target"),i=this.getNeighbors(e,"source");for(let e=0;e<r.length;e++){const i=r[e],s=i.getModel();1===this.getNeighbors(i).length&&t.push({id:s.id})}for(let e=0;e<i.length;e++){const r=i[e],s=r.getModel();let n=this.getNeighbors(r),a=this.getNeighbors(r,"source");if(1===n.length||0===a.length)t.push({id:s.id});else{const e=[];this._collapseFunc(r,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,r=this.graph){r.showItem(e,t)}hideItem(e,t,r=this.graph){r.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,r=this.graph){r.addItem(e,t)}removeItem(e,t=this.graph){t.removeItem(e)}updateItem(e,t,r=this.graph){r.updateItem(e,t)}refreshItem(e,t=this.graph){t.refreshItem(e)}refreshPositions(e=this.graph){e.refreshPositions()}on(e,t,r=this.graph){r.on(e,t)}off(e,t,r=this.graph){r.off(e,t)}toDataURL(e,t,r=this.graph){r.toDataURL(e,t)}bindNodeDefaultDragEvent(e=this.graph){e.on("node:dragstart",function(e){po(e)}),e.on("node:drag",function(e){po(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 po(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 fo=r(465),yo=r.n(fo);class mo{constructor(e,t="G6"){this.graph=null,this.config=yo()(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 eo(e,t)}static dataFromKnowledgeGraphQuery(e){return eo(e)}handleNodeStatus(e){const{expand:t,collapse:r,hidden:i}=e;this.expandNodes(t),this.collapseNodes(r),this.hideNodes(i)}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 co)}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,r,i){this.graphRender.zoom(e,t,r,i)}zoomTo(e,t,r,i){this.graphRender.zoomTo(e,t,r,i)}fitView(e,t,r,i){this.graphRender.fitView(e,t,r,i)}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 r=t.labelCfg&&t.labelCfg.fontSize||this.defaultNode&&this.defaultNode.labelCfg&&this.defaultNode.labelCfg.fontSize||14;return t.label=function(e,t,r){const i=1*r;t*=1.6;if((e=>{let t=0;for(let r=0;r<e.length;r++)e.charCodeAt(r)>0&&e.charCodeAt(r)<128?t++:t+=2;return t})(e)*i>t){const r=Math.floor((t-20)/i),s=e.substring(0,r);return(e.substring(r).length+"…".length)*i>t?s+"\n"+e.substring(r,r+r-2)+"…":0==e.substring(r).length?s:s+"\n"+e.substring(r)}return e}(t.label,e,r),t}):t:[]}clear(e=this.graph){e&&e.clear()}destroy(e=this.graph){e&&e.destroy()}}e.Lang=za,e.i18n=e.Lang.i18n,e.Util={...e.Util,...te},e.Browser=Z,e.INCHES_PER_UNIT=re,e.METERS_PER_INCH=ie,e.DOTS_PER_INCH=ee,e.IS_GECKO=$,e.setCORS=function(e){Re=e},e.isCORS=je,e.setRequestTimeout=function(e){return De=e},e.getRequestTimeout=Be,e.FetchRequest=Ue,e.inherit=function(e,t){var r,i,s,n=function(){};for(n.prototype=t.prototype,e.prototype=new n,r=2,i=arguments.length;r<i;r++)"function"==typeof(s=arguments[r])&&(s=s.prototype),te.extend(e.prototype,s)},e.mixin=q,e.String=H,e.Number=W,e.Function=Y,e.Array=X,e.Date=ve,e.Event=be,e.Bounds=ne,e.Credential=ge,e.Events=Se,e.Feature=xe,e.Geometry=Q,e.Geometry3D=class extends Me{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry3D",this.position=null,this.rotationX=null,this.rotationY=null,this.rotationZ=null,this.scaleX=null,this.scaleY=null,this.scaleZ=null,te.extend(this,e)}destroy(){this.position=null,this.rotationX=null,this.rotationY=null,this.rotationZ=null,this.scaleX=null,this.scaleY=null,this.scaleZ=null}},e.Pixel=z,e.Size=J,e.Feature.Vector=Ee,e.Geometry.Collection=ae,e.Geometry.Curve=le,e.Geometry.GeoText=ce,e.Geometry.LinearRing=de,e.Geometry.LineString=ue,e.Geometry.MultiLineString=pe,e.Geometry.MultiPoint=oe,e.Geometry.MultiPolygon=fe,e.Geometry.Point=he,e.Geometry.Polygon=ye,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 Ya(t),this._fillDataToView()}onAdd(e){this.addChart=e}_fillDataToView(){let e=new Va;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 r=this;this.viewModel.updateData(e,t,function(e){r._updateChart(e),r.addChart&&r.addChart()})}_createChart(e){this.echart=Ja.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=Ya,e.Components.MessageBox=Va,e.Components.AttributesPopContainer=class extends Qa{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 r=document.createElement("tbody");let i=!0;for(let t in e){const s=document.createElement("tr");i&&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),r.appendChild(s),i=!i}t.appendChild(r),this.appendContent(t)}},e.Components.CityTabsPage=class extends Za{constructor(e){super(e),this.rootContainer.classList.add("component-citytabpage--noneBoxShadow"),this.config=e.config,te.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(te.isArray(this.config))for(let e=0;e<this.config.length;e++){let t="";for(const r in this.config[e])t+=r;let r=document.createElement("li");r.innerHTML=t,this.header.appendChild(r)}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 r=document.createElement("div"),i=document.createElement("div");i.setAttribute("class","component-citytabpag__py-key"),i.innerHTML=e,r.appendChild(i);const s=document.createElement("div");s.setAttribute("class","component-citytabpag__content");for(let e=0;e<t.length;e++){let r=document.createElement("span");r.innerHTML=t[e],s.appendChild(r)}"HOT"===e&&(s.style.width="428px"),r.appendChild(s),this.content.appendChild(r)}},e.Components.CommonContainer=class extends Xa{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 r=document.createElement("div");r.setAttribute("class","component-title");const i=document.createElement("div");i.innerHTML=e,r.appendChild(i),t.appendChild(r);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)}},e.Components.DropDownBox=class extends Xa{constructor(e){super(e),this._initView(e)}_initView(e){let t=document.createElement("div");t.className="component-dropdownbox--container";let r=document.createElement("div");r.setAttribute("tabindex","1"),r.className="component-dropdownbox",t.appendChild(r);let i=document.createElement("div");r.appendChild(i),this._createDropDownOption(e[0],i);let s=document.createElement("div");s.className="component-dropdownbox__triangle-btn",r.appendChild(s);let n=document.createElement("div");n.className="component-triangle-down-img",s.appendChild(n);let a={parentEle:r,dropDownContent:["component-dropdownbox__content component-dropdownbox__content--chart","dropDownContent"],scrollareaContent:"component-selecttool__scrollarea__content",optionsArr:e,triangleBtn:n,dropDownTopContainer:i};this._createDropDownBox(a),this.rootContainer=t}_createDropDownBox(e){let t=e.parentEle,r=e.dropDownTopContainer,i=document.createElement("div");i.className=e.dropDownContent[0],t.appendChild(i);let s=document.createElement("div");s.className=e.scrollareaContent,i.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,i,a),this._eleOnblur(t,i,a);let o=s.children;for(let e=0;e<o.length;e++)o[e].onclick=function(){r.innerHTML=o[e].outerHTML}}_createDropDownOption(e,t){let r=document.createElement("div");r.className="component-dropdownbox__item";let i=e;i.dataValue&&r.setAttribute("data-value",i.dataValue),t.appendChild(r);let s=document.createElement("div");s.className="component-dropdownbox__item__img",r.appendChild(s);let n=document.createElement("div");i.icon.className&&(n.className=i.icon.className),i.icon.background&&(n.style.background=i.icon.background),s.appendChild(n);let a=document.createElement("div");a.className="component-dropdownbox__item__title",a.title=i.title,a.innerHTML=i.title,r.appendChild(a);let o=document.createElement("div");o.className="component-dropdownbox__item__remark",o.title=i.remark,o.innerHTML=i.remark,r.appendChild(o)}_dropDownClickEvent(e,t,r){e.onclick=function(e){"block"===t.style.display?(t.style.display="none",r.className="component-triangle-down-img"):(t.style.display="block",r.className="triangle-up-img"),e.preventDefault(),e.stopPropagation()},e.onmousedown=function(e){e.target!==this&&(this.focus(),e.preventDefault(),e.stopPropagation())}}_eleOnblur(e,t,r){e.onblur=function(){t.style.display="none",r.className="component-triangle-down-img"}}_createElement(e,t,r){let i=document.createElement(e||"div");return t&&(i.className=t),r&&r.appendChild(i),i}},e.Components.IndexTabsPageContainer=Za,e.Components.NavTabsPage=class extends Xa{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 r=document.createElement("span");r.setAttribute("class","supermapol-icons-close"),r.onclick=this.closeView.bind(this),t.appendChild(r);const i=document.createElement("div");this.navTabsTitle=i,i.setAttribute("class","component-navtabspage__title"),t.appendChild(i);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 r=document.createElement("span");r.index=t,r.appendChild(document.createTextNode(e[t].title)),r.onclick=this._changeTabsPage.bind(this);let i=e[t].content;i.index=t,i.hidden=!0,this.navTabsTitle.appendChild(r),this.navTabsContent.appendChild(i)}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)}},e.Components.PaginationContainer=class extends Xa{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 r=document.createElement("div");r.setAttribute("class","component-pagination");const i=document.createElement("div");i.setAttribute("class","component-pagination__content"),r.appendChild(i),this.content=i;const s=document.createElement("ul");s.setAttribute("class","component-pagination__link"),s.onclick=this._changePageEvent.bind(this),r.appendChild(s),this._createLink(s),this.link=s,e&&this.setContent(e),0!==t&&this.setPageLink(t),this.rootContainer=r}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 r=document.createElement("li");r.setAttribute("class","disable");const i=document.createElement("span");r.appendChild(i),0===t?(i.id="first",i.setAttribute("class","supermapol-icons-first")):1===t?(i.id="prev",i.setAttribute("class","supermapol-icons-prev")):2===t?(i.id="next",i.setAttribute("class","supermapol-icons-next")):3===t&&(i.id="last",i.setAttribute("class","supermapol-icons-last")),e.appendChild(r)}}_changePageEvent(e){const t=e.target;if("disable"===t.parentElement.classList[0])return;let r;if(t.id)r=t.id;else{if(!Number(t.innerHTML))return;r=Number(t.innerHTML)}this._prePageNum(r),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)}},e.Components.PopContainer=Qa,e.Components.Select=class extends Xa{constructor(e){super(e),this._initView(e)}_initView(e){let t=this._createElement("div","component-selecttool");e.labelName&&(this._createElement("label","component-selecttool__lable--describe",t).innerHTML=e.labelName);let r=this._createElement("div","component-selecttool--chart",t);r.setAttribute("tabindex","1");let i=this._createElement("div","component-selecttool__name",r);i.title=e.optionsArr[0],i.innerHTML=e.optionsArr[0];let s=this._createElement("div","component-selecttool__trianglebtn--chart",r),n=this._createElement("div","component-triangle-down-img",s),a=this._createElement("div","component-selecttool__content",r),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,i,e.optionsClickCb),this._selectClickEvent(r,a,n),this.rootContainer=t}createOptions(e,t){for(let r in t){let i=this._createElement("div","component-selecttool__option",e);i.title=t[r],i.innerHTML=t[r]}}_selectClickEvent(e,t,r){e.onclick=function(e){"block"===t.style.display?(t.style.display="none",r.className="component-triangle-down-img"):(t.style.display="block",r.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",r.className="component-triangle-down-img"}}_createElement(e,t,r){let i=document.createElement(e||"div");return t&&(i.className=t),r&&r.appendChild(i),i}optionClickEvent(e,t,r){for(let i=0;i<e.children.length;i++){let s=e.children[i];s.onclick=function(){t.innerHTML=s.innerHTML,t.title=s.title,s.getAttribute("data-value")&&t.setAttribute("data-value",s.getAttribute("data-value")),r&&r(s)}}}},e.Components.TemplateBase=Xa,e.Components.FileReaderUtil=Ha,e.TimeControlBase=Ne,e.TimeFlowControl=class extends Ne{constructor(e,t){super(t);var r=this;r.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),r=this,i=function(){},s=function(){return r.apply(this instanceof i&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,s.prototype=new i,s}),r.update=r.update.bind(r),r.oldTime=r.currentTime,r.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||Oe,e.Format.GeoJSON=Ie,e.Format.JSON=Pe,e.Format.WKT=class extends Oe{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=[],r=0,i=e.components.length;r<i;++r)t.push("("+this.extract.point.apply(this,[e.components[r]])+")");return t.join(",")},linestring(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t.join(",")},multilinestring(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push("("+this.extract.linestring.apply(this,[e.components[r]])+")");return t.join(",")},polygon(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push("("+this.extract.linestring.apply(this,[e.components[r]])+")");return t.join(",")},multipolygon(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push("("+this.extract.polygon.apply(this,[e.components[r]])+")");return t.join(",")},collection(e){for(var t=[],r=0,i=e.components.length;r<i;++r)t.push(this.extractGeometry.apply(this,[e.components[r]]));return t.join(",")}},this.parse={point:function(e){var t=H.trim(e).split(this.regExes.spaces);return new Ee(new he(t[0],t[1]))},multipoint:function(e){for(var t,r=H.trim(e).split(","),i=[],s=0,n=r.length;s<n;++s)t=r[s].replace(this.regExes.trimParens,"$1"),i.push(this.parse.point.apply(this,[t]).geometry);return new Ee(new oe(i))},linestring:function(e){for(var t=H.trim(e).split(","),r=[],i=0,s=t.length;i<s;++i)r.push(this.parse.point.apply(this,[t[i]]).geometry);return new Ee(new ue(r))},multilinestring:function(e){for(var t,r=H.trim(e).split(this.regExes.parenComma),i=[],s=0,n=r.length;s<n;++s)t=r[s].replace(this.regExes.trimParens,"$1"),i.push(this.parse.linestring.apply(this,[t]).geometry);return new Ee(new pe(i))},polygon:function(e){for(var t,r,i,s=H.trim(e).split(this.regExes.parenComma),n=[],a=0,o=s.length;a<o;++a)t=s[a].replace(this.regExes.trimParens,"$1"),r=this.parse.linestring.apply(this,[t]).geometry,i=new de(r.components),n.push(i);return new Ee(new ye(n))},multipolygon:function(e){for(var t,r=H.trim(e).split(this.regExes.doubleParenComma),i=[],s=0,n=r.length;s<n;++s)t=r[s].replace(this.regExes.trimParens,"$1"),i.push(this.parse.polygon.apply(this,[t]).geometry);return new Ee(new fe(i))},geometrycollection:function(e){e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var t=H.trim(e).split("|"),r=[],i=0,s=t.length;i<s;++i)r.push(this.read(t[i]));return r}}}read(e){var t,r,i;e=e.replace(/[\n\r]/g," ");var s=this.regExes.typeStr.exec(e);return s&&(r=s[1].toLowerCase(),i=s[2],this.parse[r]&&(t=this.parse[r].apply(this,[i]))),t}write(e){var t,r,i;e.constructor===Array?(t=e,i=!0):(t=[e],i=!1);var s=[];i&&s.push("GEOMETRYCOLLECTION(");for(var n=0,a=t.length;n<a;++n)i&&n>0&&s.push(","),r=t[n].geometry,s.push(this.extractGeometry(r));return i&&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 Je{constructor(e){super(e)}load(){return this.request("GET",this.serviceUrl+"/web/api/service.json")}createIServer(e){return this.request("POST",this.serviceUrl+"/cloud/web/nodes/server.json",new ze(e))}createIPortal(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/portal.json",new ze(e))}iServerList(){return this.request("GET",this.serviceUrl+"/cloud/web/nodes/server.json")}iPortalList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/portal.json")}startNodes(e){return this.request("POST",this.serviceUrl+"/cloud/web/nodes/started.json",e)}stopNodes(e){return this.request("POST",this.serviceUrl+"/cloud/web/nodes/stopped.json",e)}},e.iManagerCreateNodeParam=ze,e.iManagerServiceBase=Je,e.iPortal=class extends qe{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 He))return new Promise(function(e){e("queryParams is not instanceof iPortalQueryParam !")});var t=this,r=this.iportalUrl+"/gateway/catalog/resource/search.json";return e.t=(new Date).getTime(),this.request("GET",r,e).then(function(e){var r=[];(e.content||[]).forEach(function(e){r.push(new Ye(t.iportalUrl,e))});let i=new We;return i.content=r,i.total=e.total,i.currentPage=e.currentPage,i.pageSize=e.pageSize,i.aggregations=e.aggregations,i})}updateResourcesShareSetting(e){if(!(e instanceof Xe))return new Promise(function(e){e("shareParams is not instanceof iPortalShareParam !")});var t=e.resourceType.replace("_","").toLowerCase()+"s";"datas"===t&&(t="mycontent/"+t);var r={ids:e.ids,entities:e.entities},i=this.iportalUrl+"/web/"+t+"/sharesetting.json";return this.request("PUT",i,JSON.stringify(r)).then(function(e){return e})}},e.iPortalAddDataParam=Ke,e.iPortalAddResourceParam=Qe,e.iPortalDataConnectionInfoParam=tt,e.iPortalDataMetaInfoParam=$e,e.iPortalDataStoreInfoParam=et,e.iPortalQueryParam=He,e.iPortalQueryResult=We,e.iPortalRegisterServiceParam=Ze,e.iPortalResource=Ye,e.iPortalServiceBase=qe,e.iPortalShareEntity=class{constructor(e){e=e||{},this.permissionType="",this.entityType="",this.entityName="GUEST",this.entityId=null,te.extend(this,e)}},e.iPortalShareParam=Xe,e.iPortalUser=class extends qe{constructor(e){super(e),this.iportalUrl=e}deleteResources(e){var t=e.resourceType.replace("_","").toLowerCase(),r=this.iportalUrl+"/web/"+t+"s.json?ids="+encodeURI(JSON.stringify(e.ids));return"data"===t?(r=this.iportalUrl+"/web/mycontent/datas/delete.json",this.request("POST",r,JSON.stringify(e.ids))):this.request("DELETE",r)}addMap(e){if(!(e instanceof Qe))return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},r=this.iportalUrl+"/web/maps/batchaddmaps.json";return this.request("POST",r,JSON.stringify(t)).then(function(e){return e})}addScene(e){if(!(e instanceof Qe))return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},r=this.iportalUrl+"/web/scenes/batchaddscenes.json";return this.request("POST",r,JSON.stringify(t)).then(function(e){return e})}registerService(e){if(!(e instanceof Ze))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},r=this.iportalUrl+"/web/services.json";return this.request("POST",r,JSON.stringify(t)).then(e=>e)}getErrMsgPromise(e){return new Promise(t=>{t(e)})}uploadDataRequest(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/upload.json";return this.request("POST",r,t)}addData(e,t){if(!(e instanceof Ke))return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");var r,i=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 $e))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");r={xField:e.dataMetaInfo.xField,yField:e.dataMetaInfo.yField},"csv"===n&&(r.fileEncoding=e.dataMetaInfo.fileEncoding),s.coordType="WGS84",s.dataMetaInfo=r}else if("hdfs"===n||"hbase"===n){if(!(e.dataMetaInfo instanceof $e))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof et))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,r={url:e.dataMetaInfo.url,dataStoreInfo:a};break;case"hbase":if(!(e.dataMetaInfo.dataStoreInfo.connectionInfo instanceof tt))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",r={dataStoreInfo:a}}s.dataMetaInfo=r}return this.request("POST",i,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 r=e.dataId,i=e.dataServiceId,s=e.serviceType,n=this.iportalUrl+"/web/mycontent/datas/"+r+"/publishstatus.json?serviceType="+s;return i&&(n+="&dataServiceId="+i),this.request("PUT",n,JSON.stringify(t)).then(e=>t?(i||(i=e.customResult),i):e)}getDataPublishedStatus(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/publishstatus.json?dataServiceId="+t+"&forPublish=true";return this.request("GET",r)}unPublishDataService(e){return this.publishOrUnpublish(e,!1)}publishDataService(e){return this.publishOrUnpublish(e,!0)}},e.AddressMatchService=nt,e.AggregationParameter=at,e.AreaSolarRadiationParameters=lt,e.AreaSolarRadiationService=ut,e.BucketAggParameter=ot,e.BufferAnalystParameters=pt,e.BufferAnalystService=vt,e.BufferDistance=ct,e.BuffersAnalystJobsParameter=_t,e.BuffersAnalystJobsService=Ct,e.BufferSetting=dt,e.BurstPipelineAnalystParameters=At,e.BurstPipelineAnalystService=Tt,e.ChartFeatureInfoSpecsService=Et,e.ChartQueryFilterParameter=Ot,e.ChartQueryParameters=Pt,e.ChartQueryService=Nt,e.ClipParameter=class{constructor(e){this.clipDatasetName=null,this.clipDatasourceName=null,this.clipRegion=null,this.isClipInRegion=!0,this.isExactClip=null,e&&te.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 te.toJSON({isClipInRegion:this.isClipInRegion,clipDatasetName:this.clipDatasetName,clipDatasourceName:this.clipDatasourceName,isExactClip:this.isExactClip,clipRegion:Me.fromGeometry(this.clipRegion)})}},e.ColorDictionary=Lt,e.CommonServiceBase=rt,e.ComputeWeightMatrixParameters=Rt,e.ComputeWeightMatrixService=Dt,e.CreateDatasetParameters=nn,e.DataFlowService=Gt,e.DataReturnOption=ft,e.DatasetBufferAnalystParameters=mt,e.DatasetInfo=jt,e.DatasetOverlayAnalystParameters=Ut,e.DatasetService=kr,e.DatasetSurfaceAnalystParameters=zt,e.DatasetThiessenAnalystParameters=Ht,e.DatasourceConnectionInfo=bt,e.DatasourceService=Wt,e.DensityAnalystService=Xt,e.DensityKernelAnalystParameters=Yt,e.EditFeaturesParameters=Qt,e.EditFeaturesService=Zt,e.FacilityAnalyst3DParameters=Kt,e.FacilityAnalystSinks3DParameters=$t,e.FacilityAnalystSinks3DService=er,e.FacilityAnalystSources3DParameters=tr,e.FacilityAnalystSources3DService=rr,e.FacilityAnalystStreamParameters=ir,e.FacilityAnalystStreamService=sr,e.FacilityAnalystTracedown3DParameters=nr,e.FacilityAnalystTracedown3DService=ar,e.FacilityAnalystTraceup3DParameters=or,e.FacilityAnalystTraceup3DService=lr,e.FacilityAnalystUpstream3DParameters=hr,e.FacilityAnalystUpstream3DService=ur,e.FieldParameters=cr,e.FieldsFilter=Mn,e.FieldStatisticService=pr,e.FieldStatisticsParameters=dr,e.FilterParameter=yt,e.FindClosestFacilitiesParameters=fr,e.FindClosestFacilitiesService=yr,e.FindLocationParameters=mr,e.FindLocationService=gr,e.FindMTSPPathsParameters=vr,e.FindMTSPPathsService=br,e.FindPathParameters=Sr,e.FindPathService=xr,e.FindServiceAreasParameters=_r,e.FindServiceAreasService=wr,e.FindTSPPathsParameters=Cr,e.FindTSPPathsService=Ar,e.GenerateSpatialDataParameters=Mr,e.GenerateSpatialDataService=Tr,e.GeoCodingParameter=it,e.GeoDecodingParameter=st,e.GeoHashGridAggParameter=class extends ot{constructor(e){super(),this.precision=5,te.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 te.toJson(t)}},e.GeometryBatchAnalystService=Ys,e.GeometryBufferAnalystParameters=gt,e.GeometryOverlayAnalystParameters=Er,e.GeometrySurfaceAnalystParameters=Or,e.GeometryThiessenAnalystParameters=Pr,e.GeoprocessingService=Ir,e.GeoRelationAnalystParameters=Nr,e.GeoRelationAnalystService=Lr,e.GetFeaturesByBoundsParameters=Rr,e.GetFeaturesByBoundsService=Gr,e.GetFeaturesByBufferParameters=jr,e.GetFeaturesByBufferService=Br,e.GetFeaturesByGeometryParameters=Ur,e.GetFeaturesByGeometryService=Vr,e.GetFeaturesByIDsParameters=Jr,e.GetFeaturesByIDsService=zr,e.GetFeaturesBySQLParameters=qr,e.GetFeaturesBySQLService=Hr,e.GetFeaturesParametersBase=Fr,e.GetFeaturesServiceBase=Dr,e.GetFieldsService=Wr,e.GetGridCellInfosParameters=Yr,e.GetGridCellInfosService=Xr,e.GetLayersInfoService=Ai,e.Grid=_i,e.HillshadeParameter=class extends dn{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=B.HILLSHADE,te.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=wi,e.ImageCollectionService=Cn,e.ImageGFAspect=Nn,e.ImageGFHillShade=In,e.ImageGFOrtho=Ln,e.ImageGFSlope=kn,e.ImageRenderingRule=Pn,e.ImageSearchParameter=En,e.ImageService=An,e.ImageStretchOption=On,e.InterpolationAnalystParameters=Mi,e.InterpolationAnalystService=Ii,e.InterpolationDensityAnalystParameters=Ei,e.InterpolationIDWAnalystParameters=Oi,e.InterpolationKrigingAnalystParameters=Pi,e.InterpolationRBFAnalystParameters=Ti,e.JoinItem=bi,e.KernelDensityJobParameter=Ni,e.KernelDensityJobsService=Li,e.LabelImageCell=class extends ki{constructor(e){super(e),this.height=0,this.pathField=null,this.rotation=0,this.width=0,this.sizeFixed=!1,this.type="IMAGE",e&&te.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=ki,e.LabelMixedTextStyle=ti,e.LabelSymbolCell=class extends ki{constructor(e){super(e),this.style=new we,this.symbolIDField=null,this.type="SYMBOL",e&&te.extend(this,e),this.CLASS_NAME="SuperMap.LabelSymbolCell"}destroy(){this.style&&(this.style.destroy(),this.style=null),this.symbolIDField=null}},e.LabelThemeCell=class extends ki{constructor(e){super(e),this.themeLabel=new ni,this.type="THEME",e&&te.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&&te.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":'+te.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&&te.extend(this,e),this.CLASS_NAME="SuperMap.LinkItem"}destroy(){var e=this;e.datasourceConnectionInfo instanceof bt&&(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=xt,e.MapService=Fi,e.MathExpressionAnalysisParameters=Ri,e.MathExpressionAnalysisService=Di,e.MeasureParameters=Gi,e.MeasureService=ji,e.MetricsAggParameter=class extends at{constructor(e){super(),this.aggType=j.AVG,te.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy(),this.aggType=null}},e.NDVIParameter=class extends dn{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=B.NDVI,te.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=St,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,te.extend(this,e),this.ugcLayer=new gi(e),this.CLASS_NAME="SuperMap.OverlapDisplayedOptions"}destroy(){te.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 r in e)e.hasOwnProperty(r)&&(t+="'"+r+"':"+e[r]+",");return t=t.substr(0,t.length-1),t+="}"}},e.OverlayAnalystParameters=Bt,e.OverlayAnalystService=Bi,e.OverlayGeoJobParameter=Ui,e.OverlayGeoJobsService=Vi,e.PointWithMeasure=Ce,e.ProcessingServiceBase=wt,e.QueryByBoundsParameters=Ji,e.QueryByBoundsService=qi,e.QueryByDistanceParameters=Hi,e.QueryByDistanceService=Wi,e.QueryByGeometryParameters=Yi,e.QueryByGeometryService=Xi,e.QueryBySQLParameters=Qi,e.QueryBySQLService=Zi,e.DatasetMinDistanceAnalystParameters=$i,e.MinDistanceAnalystService=ts,e.TerrainCutFillCalculationParameters=rs,e.TerrainCutFillCalculationService=is,e.terrainAnalystSetting=class{constructor(e){this.bounds=null,this.boundsType=U.MAX,this.cellSize=null,this.cellSizeType=V.UNION,te.extend(this,e),this.CLASS_NAME="SuperMap.terrainAnalystSetting"}destroy(){this.bounds=null,this.boundsType=null,this.cellSize=null,this.cellSizeType=null}},e.TerrainAspectCalculationParameters=ss,e.TerrainAspectCalculationService=ns,e.TerrainSlopeCalculationParameters=as,e.TerrainSlopeCalculationService=os,e.GeometryMinDistanceAnalystParameters=es,e.ConvexHullAnalystParameters=class{constructor(e){this.model=null,this.resultSetting=null,e&&te.extend(this,e),this.CLASS_NAME="SuperMap.ConvexHullAnalystParameters"}destroy(){this.model=null,this.resultSetting=null}},e.ConvexHullAnalystService=ls,e.TraceAnalystParameters=hs,e.TraceAnalystService=us,e.ConnectedEdgesAnalystParameters=cs,e.ConnectedEdgesAnalystService=ds,e.GetLayersLegendInfoParameters=class{constructor(e){this.bbox=null,this.layers=null,this.transparent=null,this.mapScale=null,this.returnVisibleOnly=null,this.width=null,this.height=null,te.extend(this,e),this.CLASS_NAME="SuperMap.GetLayersLegendInfoParameters"}destroy(){var e=this;e.bbox=null,e.layers=null,e.transparent=null,e.mapScale=null,e.returnVisibleOnly=null,e.width=null,e.height=null}},e.GetLayersLegendInfoService=ps,e.QueryParameters=It,e.QueryService=fs,e.RasterFunctionParameter=dn,e.Route=Ae,e.RouteCalculateMeasureParameters=ys,e.RouteCalculateMeasureService=ms,e.RouteLocatorParameters=gs,e.RouteLocatorService=vs,e.ServerColor=_e,e.ServerFeature=bs,e.ServerGeometry=Me,e.ServerStyle=we,e.ServerTextStyle=Zr,e.ServerTheme=xi,e.SetDatasourceParameters=Ss,e.SetLayerInfoParameters=class{constructor(e){e=e||{},this.resourceID=null,this.tempLayerName=null,this.layerInfo=null,te.extend(this,e),this.CLASS_NAME="SuperMap.SetLayerInfoParameters"}destroy(){this.resourceID=null,this.tempLayerName=null,this.layerInfo=null}},e.SetLayerInfoService=xs,e.SetLayersInfoParameters=class{constructor(e){e=e||{},this.isTempLayers=null,this.resourceID=null,this.layersInfo=null,te.extend(this,e),this.CLASS_NAME="SuperMap.SetLayersInfoParameters"}destroy(){this.isTempLayers=null,this.resourceID=null,this.layersInfo=null}},e.SetLayersInfoService=_s,e.SetLayerStatusParameters=ws,e.SetLayerStatusService=Cs,e.SingleObjectQueryJobsParameter=As,e.SingleObjectQueryJobsService=Ms,e.Sortby=Tn,e.SpatialAnalystBase=ht,e.StopQueryParameters=Ts,e.StopQueryService=Es,e.SummaryAttributesJobsParameter=Os,e.SummaryAttributesJobsService=Ps,e.SummaryMeshJobParameter=Is,e.SummaryMeshJobsService=Ns,e.SummaryRegionJobParameter=Ls,e.SummaryRegionJobsService=ks,e.SupplyCenter=Fs,e.SurfaceAnalystParameters=Jt,e.SurfaceAnalystParametersSetting=Vt,e.SurfaceAnalystService=Rs,e.TerrainCurvatureCalculationParameters=Ds,e.TerrainCurvatureCalculationService=Gs,e.Theme=Qr,e.ThemeDotDensity=di,e.ThemeFlow=js,e.ThemeGraduatedSymbol=fi,e.ThemeGraduatedSymbolStyle=pi,e.ThemeGraph=ci,e.ThemeGraphAxes=oi,e.ThemeGraphItem=ui,e.ThemeGraphSize=li,e.ThemeGraphText=hi,e.ThemeGridRange=Us,e.ThemeGridRangeItem=Bs,e.ThemeGridUnique=Js,e.ThemeGridUniqueItem=Vs,e.ThemeLabel=ni,e.ThemeLabelAlongLine=ii,e.ThemeLabelBackground=si,e.ThemeLabelItem=Kr,e.ThemeLabelText=ri,e.ThemeLabelUniqueItem=zs,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),r=0;r<t;r++)e+="'"+this.srcData[r]+"':'"+this.targetData[r]+"',";return r>0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}return null}},e.ThemeOffset=ei,e.ThemeParameters=qs,e.ThemeRange=mi,e.ThemeRangeItem=yi,e.ThemeService=Hs,e.ThemeUnique=ai,e.ThemeUniqueItem=$r,e.ThiessenAnalystParameters=qt,e.ThiessenAnalystService=Ws,e.TilesetsService=Xs,e.TopologyValidatorJobsParameter=Qs,e.TopologyValidatorJobsService=Zs,e.TransferLine=Ks,e.TransferPathParameters=$s,e.TransferPathService=en,e.TransferSolutionParameters=tn,e.TransferSolutionService=rn,e.TransportationAnalystParameter=Ft,e.TransportationAnalystResultSetting=kt,e.UGCLayer=gi,e.UGCMapLayer=vi,e.UGCSubLayer=Si,e.UpdateDatasetParameters=hn,e.UpdateEdgeWeightParameters=sn,e.UpdateEdgeWeightService=an,e.UpdateTurnNodeWeightParameters=on,e.UpdateTurnNodeWeightService=ln,e.Vector=Ci,e.VectorClipJobsParameter=un,e.VectorClipJobsService=cn,e.WebPrintingJobContent=Sn,e.WebPrintingJobCustomItems=pn,e.WebPrintingJobExportOptions=_n,e.WebPrintingJobImage=fn,e.WebPrintingJobLayers=yn,e.WebPrintingJobLayoutOptions=xn,e.WebPrintingJobLegendOptions=mn,e.WebPrintingJobLittleMapOptions=gn,e.WebPrintingJobNorthArrowOptions=vn,e.WebPrintingJobParameters=class{constructor(e){e&&(this.content=null,this.layoutOptions=null,this.exportOptions=null,te.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof Sn&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof xn&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof _n&&(this.exportOptions.destroy(),this.exportOptions=null)}},e.WebPrintingJobScaleBarOptions=bn,e.WebPrintingService=wn,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(){Ve.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,r=t.mDatasUrl;return e&&(e=e.toJSON()),Ue.get(r,e).then(function(e){if(e&&e.content&&!(e.content.length<1)){for(var r=[],i=e.content,s=i.length,n=0;n<s;n++){var a=i[n],o=new Dn(t.mDatasUrl,a);r.push(o)}return r}})}},e.OnlineData=Dn,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,te.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 r in t)null==t[r]&&delete t[r];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=Rn,e.Feature=e.Feature||{},e.Feature.Theme=xa,e.Feature.Theme.Bar=class extends _a{constructor(e,t,r,i,s){super(e,t,r,i,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 r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=this.dataViewBox,s=this.dataValues;if(!(s.length<1)){for(let e=0,t=s.length;e<t;e++)if(s[e]<r[0]||s[e]>r[1])return;var n=this.calculateXShapeInfo();if(n){var a=n.xPositions,o=n.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Sa.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(Sa.GraphAxis(this.shapeFactory,i,t,n)));for(var l=0;l<s.length;l++){var h=i[1]-(s[l]-r[0])/this.DVBUnitValue,u=[[a[l]-o/2,i[1]-1],[a[l]+o/2,i[1]-1],[a[l]+o/2,h],[a[l]-o/2,h]],c=new $n(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={},te.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,r=this.setting,i=this.dataValues.length;if(i<1)return null;var s=[],n=0,a=this.DVBWidth;if(r.xShapeBlank&&r.xShapeBlank.length&&3==r.xShapeBlank.length){var o=a-((e=r.xShapeBlank)[0]+e[2]+(i-1)*e[1]);if(o<=i)return null;n=o/i}else e=[n=a/(2*i+1),n,n];for(var l=0,h=0;h<i;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,r=-1,i=0;i<e;i++){var s=this.shapes[i];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];++r>=t.length&&(r%=t.length);var l=t[r][0],h=t[r][1],u=(new jn).getLinearGradient(a,0,o,0,[[0,l],[1,h]]);s.style.color=u}}}},e.Feature.Theme.Bar3D=class extends _a{constructor(e,t,r,i,s){super(e,t,r,i,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 r=this.dataViewBox,i=this.dataValues;if(!(i.length<1)){for(let e=0,r=i.length;e<r;e++)if(i[e]<t[0]||i[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(Sa.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(Sa.GraphAxis(this.shapeFactory,r,e,s)));var o=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10;for(let s=0;s<i.length;s++){var l=r[1]-(i[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,r[1]+o],[u,r[1]]],p=[[h-o,r[1]+o],[u-o,r[1]+o],[u-o,l+o],[h-o,l+o]];o<=0&&(p=[[h,r[1]],[u,r[1]],[u,l],[h,l]]);var f=new $n(c),y=new $n(d),m=new $n(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,m.style=Sa.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barFaceStyle,e.barFaceStyleByFields,e.barFaceStyleByCodomain,s,i[s]),y.style=Sa.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barSideStyle,e.barSideStyleByFields,e.barSideStyleByCodomain,s,i[s]),f.style=Sa.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barTopStyle,e.barTopStyleByFields,e.barTopStyleByCodomain,s,i[s]),e.barSideHoverStyle=e.barSideHoverStyle?e.barSideHoverStyle:e.barFaceHoverStyle,e.barTopHoverStyle=e.barTopHoverStyle?e.barTopHoverStyle:e.barFaceHoverStyle,m.highlightStyle=Sa.ShapeStyleTool({stroke:!0},e.barFaceHoverStyle),y.highlightStyle=Sa.ShapeStyleTool({stroke:!0},e.barSideHoverStyle),f.highlightStyle=Sa.ShapeStyleTool({stroke:!0},e.barTopHoverStyle),f.refDataID=y.refDataID=m.refDataID=this.data.id,f.isHoverByRefDataID=y.isHoverByRefDataID=m.isHoverByRefDataID=!0,f.refDataHoverGroup=y.refDataHoverGroup=m.refDataHoverGroup=te.createUniqueID("lr_shg"),f.dataInfo=y.dataInfo=m.dataInfo={field:this.fields[s],value:i[s]},void 0!==e.barHoverAble&&(f.hoverable=y.hoverable=m.hoverable=e.barHoverAble),void 0!==e.barClickAble&&(f.clickable=y.clickable=m.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(y)),this.shapes.push(this.shapeFactory.createShape(f)),this.shapes.push(this.shapeFactory.createShape(m))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,r=this.setting,i=this.dataValues.length;if(i<1)return null;var s=[],n=0,a=this.DVBWidth;if(r.xShapeBlank&&r.xShapeBlank.length&&3==r.xShapeBlank.length){var o=a-((e=r.xShapeBlank)[0]+e[2]+(i-1)*e[1]);if(o<=i)return null;n=o/i}else e=[n=a/(2*i+1),n,n];for(var l=0,h=0;h<i;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 wa{constructor(e,t,r,i,s){super(e,t,r,i,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,r=xa.getDataValues(this.data,this.fields,t);this.dataValues=r||[];var i=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=i[0]*n+e.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!s||!(i[0]<s[0]||i[0]>s[1]))){var o=this.DVBCenterPoint,l=new sa(o[0],o[1],a);l.style=Sa.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?l.style.fillColor=e.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=Sa.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:i[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}},e.Feature.Theme.Graph=_a,e.Feature.Theme.Line=class extends _a{constructor(e,t,r,i,s,n){super(e,t,r,i,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,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=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(Sa.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(Sa.GraphAxis(this.shapeFactory,t,e,n));for(var h=[],u=[],c=0,d=s.length;c<d;c++){if(s[c]<r[0]||s[c]>r[1])return null;a=l[c],o=t[1]-(s[c]-r[0])/i;var p=new Zn(a,o);p.style=Sa.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,c,s[c]),p.highlightStyle=Sa.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 y=new Kn(h);y.style=Sa.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),y.clickable=!1,y.hoverable=!1;var m=this.shapeFactory.createShape(y);this.shapes.push(m),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,r=this.setting,i=this.dataValues.length;if(i<1)return null;var s=[],n=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var o=n-((e=r.xShapeBlank)[0]+e[1]);if(o<=i)return null;a=o/(i-1)}else e=[a=n/(i+1),a,a];for(var l=0,h=0;h<i;h++)0==h?l=e[0]:l+=a,s.push(t[0]+l);return{xPositions:s,width:0}}},e.Feature.Theme.Pie=class extends _a{constructor(e,t,r,i,s){super(e,t,r,i,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(Sa.Background(this.shapeFactory,this.chartBox,e));var r=this.dataValues;if(!(r.length<1)){var i=this.DVBCodomain;for(let e=0;e<r.length;e++)if(r[e]<i[0]||r[e]>i[1])return;var s=0;for(let e=0;e<r.length;e++)s+=Math.abs(r[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<r.length;c++){var d=Math.abs(r[c]);(l=0===c?o+d*n:c===d.length-1?h:o+d*n)-o>=360&&(l=359.9999999);var p=new ta(a[0],a[1],u,o,l);if(void 0===e.sectorStyleByFields){var f=c%t.length;p.style=Sa.ShapeStyleTool(null,e.sectorStyle,t,null,f)}else p.style=Sa.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,c,r[c]);p.highlightStyle=Sa.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:r[c]},this.shapes.push(this.shapeFactory.createShape(p)),o=l}this.shapesConvertToRelativeCoordinate()}}}},e.Feature.Theme.Point=class extends _a{constructor(e,t,r,i,s,n){super(e,t,r,i,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,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=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(Sa.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(Sa.GraphAxis(this.shapeFactory,t,e,n));for(var h=0,u=s.length;h<u;h++){if(s[h]<r[0]||s[h]>r[1])return null;a=l[h],o=t[1]-(s[h]-r[0])/i;var c=new Zn(a,o);c.style=Sa.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,s[h]),c.highlightStyle=Sa.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,r=this.setting,i=this.dataValues.length;if(i<1)return null;var s=[],n=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var o=n-((e=r.xShapeBlank)[0]+e[1]);if(o<=i)return null;a=o/(i-1)}else e=[a=n/(i+1),a,a];for(var l=0,h=0;h<i;h++)0==h?l=e[0]:l+=a,s.push(t[0]+l);return{xPositions:s,width:0}}},e.Feature.Theme.RankSymbol=wa,e.Feature.Theme.Ring=class extends _a{constructor(e,t,r,i,s){super(e,t,r,i,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(Sa.Background(this.shapeFactory,this.chartBox,t));var r=this.dataValues;if(!(r.length<1)){var i=this.DVBCodomain;for(let e=0;e<r.length;e++)if(r[e]<i[0]||r[e]>i[1])return;var s=0;for(let e=0;e<r.length;e++)s+=Math.abs(r[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<r.length;p++){var f=Math.abs(r[p]);l=0===p?o+f*n:p===f.length-1?h:o+f*n;var y=new ta(a[0],a[1],u,o,l,d);if(void 0===t.sectorStyleByFields){var m=p%e.length;y.style=Sa.ShapeStyleTool(null,t.sectorStyle,e,null,m)}else y.style=Sa.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,p,r[p]);y.highlightStyle=Sa.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(y.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(y.clickable=t.sectorClickAble),y.refDataID=this.data.id,y.dataInfo={field:this.fields[p],value:r[p]},this.shapes.push(this.shapeFactory.createShape(y)),o=l}this.shapesConvertToRelativeCoordinate()}}}},e.Feature.Theme.ThemeVector=Ca,e.Feature.ShapeParameters=Qn,e.Feature.ShapeParameters.Circle=sa,e.Feature.ShapeParameters.Image=ia,e.Feature.ShapeParameters.Label=ra,e.Feature.ShapeParameters.Line=Kn,e.Feature.ShapeParameters.Point=Zn,e.Feature.ShapeParameters.Polygon=$n,e.Feature.ShapeParameters.Rectangle=ea,e.Feature.ShapeParameters.Sector=ta,e.Feature.ShapeFactory=Sa,e.LevelRenderer=Fa,e.KeyServiceParameter=class{constructor(e){this.name=null,this.serviceIds=null,this.clientType=I.SERVER,this.limitation=null,te.extend(this,e),this.CLASS_NAME="SuperMap.KeyServiceParameter"}toJSON(){return{name:this.name,serviceIds:this.serviceIds,clientType:this.clientType,limitation:this.limitation}}},e.SecurityManager=Ve,e.ServerInfo=class{constructor(e,t){this.type=e,this.server=null,this.tokenServiceUrl=null,this.keyServiceUrl=null,te.extend(this,t),this.CLASS_NAME="SuperMap.ServerInfo",this.type=this.type||i.ISERVER,this.server||console.error("server url require is not  undefined");var r="/services/security/tokens";this.type===i.ISERVER&&this.server.indexOf("iserver")<0&&(r="/iserver"+r),this.tokenServiceUrl||(this.tokenServiceUrl=te.urlPathAppend(this.server,r)),this.keyServiceUrl||(this.type===i.IPORTAL?this.keyServiceUrl=te.urlPathAppend(this.server,"/web/mycontent/keys/register"):this.type===i.ONLINE&&(this.keyServiceUrl=te.urlPathAppend(this.server,"/web/mycontent/keys")))}},e.TokenServiceParameter=class{constructor(e){this.userName=null,this.password=null,this.clientType=I.NONE,this.ip=null,this.referer=null,this.expiration=60,te.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=class{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,te.extend(this,e)}},e.CartoCSS=Yn,e.ElasticSearch=class{constructor(e,t,r){if(!t||"function"!=typeof t&&"object"!=typeof t||"function"!=typeof t.Client)throw Error("Please enter the global variable of @elastic/elasticsearch@5.6.22 or elasticsearch@16.7.3 for the second parameter!");r=r||{},this.url=e;try{this.client=new t.Client({host:this.url})}catch(e){this.client=new t.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 Se(this,null,this.EVENT_TYPES),this.eventListeners=null,te.extend(this,r),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 r=this;return r.client.msearch(e).then(function(e){return e=e.body||e,r._update(e.responses,t),e},function(e){return t(e),r.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 r=this;return r.client.search(e).then(function(e){return e=e.body||e,r._update(e,t),e},function(e){return t&&t(e),r.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 r=t.shift();let i=t.shift();const s=i&&i.body;if(s){const{statusCode:e,headers:r}=i;t=[e,r],i=s}e.call(this,r,i,...t)}}_update(e,t){let r=this;e&&(r.data=e,r.openGeoFence&&r.geoFence&&r._validateDatas(e),r.events.triggerEvent("change",{data:r.data}),r.change?r.change&&r.change(e):t&&t(void 0,{responses:e}))}_validateDatas(e){if(e){e instanceof Array||(e=[e]);var t,r=e.length;for(t=0;t<r;t++)this._validateData(e[t])}}_validateData(e){let t=this;e.hits.hits.map(function(r){let i=r._source,s=t._getMeterPerMapUnit(t.geoFence.unit),n=t.geoFence.center[0]*s,a=t.geoFence.center[1]*s,o=i.x*s,l=i.y*s;return t._distance(o,l,n,a)>t.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),r})}_distance(e,t,r,i){return Math.sqrt((e-r)*(e-r)+(t-i)*(t-i))}_getMeterPerMapUnit(e){let t;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}},e.ArrayStatistic=Vn,e.ColorsPickerUtil=Un,e.DataFormat=t,e.ServerType=i,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=y,e.TextAlignment=m,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=x,e.OutputType=_,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=S,e.SmoothMethod=w,e.SurfaceAnalystMethod=C,e.DataReturnMode=A,e.EditType=M,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=I,e.ChartType={BAR:"Bar",BAR3D:"Bar3D",CIRCLE:"Circle",PIE:"Pie",POINT:"Point",LINE:"Line",RING:"Ring"},e.ClipAnalystMode=N,e.AnalystAreaUnit=L,e.AnalystSizeUnit=k,e.StatisticAnalystMode=F,e.SummaryType=R,e.TopologyValidatorRule=D,e.BucketAggType=G,e.MetricsAggType=j,e.GetFeatureMode={BOUNDS:"BOUNDS",BUFFER:"BUFFER",ID:"ID",SPATIAL:"SPATIAL",SQL:"SQL"},e.RasterFunctionType=B,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=mo,e.BoundsType=U,e.CellSizeType=V;const go=ol.Observable;var vo=r.n(go);class bo extends(vo()){constructor(e,t){super(e,t),this.options=t||{},this.url=e,this.dispatchEvent({type:"initialized",value:this})}}class So extends bo{constructor(e,t){super(e,t)}getMapInfo(e){var t=this;return new Fi(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;return new Fi(`${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(e){var t=this;return new Xs(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers}).processAsync(e)}}const xo=ol.control.Control;var _o=r.n(xo);class wo extends(_o()){constructor(e){function t(e,t,r){var i=document.createElement(e);return i.className=t||"",r&&r.appendChild(i),i}function r(e,t,r,i){var s=function(t){if(r)return r.call(i||e,t||window.event)},n=s;return"addEventListener"in e?"mousewheel"===t?e.addEventListener("onwheel"in e?"wheel":"mousewheel",s,!1):"mouseenter"===t||"mouseleave"===t?(s=function(t){t=t||window.event,function(e,t){var r=t.relatedTarget;if(!r)return!0;try{for(;r&&r!==e;)r=r.parentNode}catch(e){return!1}return r!==e}(e,t)&&n(t)},e.addEventListener("mouseenter"===t?"mouseover":"mouseout",s,!1)):e.addEventListener(t,s,!1):"attachEvent"in e&&e.attachEvent("on"+t,s),this}function i(){this._container.classList.add("ol-control-ctv-expanded")}function s(){this._container.classList.remove("ol-control-ctv-expanded")}function n(){var e=this.getVersion();this.tilesVersion(e)}(e=e||{}).title||(e.title="switch tile version"),e.tooltip||(e.tooltip="top"),e.collapsed||(e.collapsed=!0),e.lastText||(e.lastText="-"),e.nextText||(e.nextText="+"),e.ico||(e.ico="V"),"vertical"!==e.orientation&&(e.orientation="horizontal"),e.switch||(e.switch=!0),super(e),this.options=e,this.element=e.element=function(){var a="ol-control-ctv";this._container=t("div",a+" "+a+"-"+e.orientation+" ol-unselectable ol-control"),this._sliderBtn=t("button",a+"-toggle",this._container),this._sliderBtn.setAttribute("title",e.title),this._sliderBtn.innerHTML=e.ico,this._sliderValue=t("p",a+"-value",this._container),this._sliderValue.innerHTML=e.ico,this._sliderValue.setAttribute("title",e.title);this._sliderContent=t("div","ol-ctv-slider-main  tooltip",this._container),"vertical"===e.orientation&&"top"===e.tooltip&&(e.tooltip="right");this.tooltip=t("span","tooltip-text  tooltip-"+e.tooltip,this._sliderContent),this.tooltip.innerHTML=e.ico,e.switch&&(this._next=t("a","ol-ctv-slider-incdec ol-ctv-slider-next",this._sliderContent),this._next.innerHTML=e.nextText,r(this._next,"click",this.nextTilesVersion,this),this._container.classList.add(a+"-incdec"));this._sliderContainer=t("div","ol-ctv-slider-container",this._sliderContent),this.slider=t("input","ol-ctv-slider",this._sliderContainer),this.min=null==this.min||isNaN(this.min)?0:parseInt(this.min),this.slider.setAttribute("title",e.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?r(this.slider,"change",n,this):this.slider.onpropertychange=n;e.switch&&(this._last=t("a","ol-ctv-slider-incdec ol-ctv-slider-last",this._sliderContent),this._last.innerHTML=e.lastText,r(this._last,"click",this.lastTilesVersion,this));"vertical"==e.orientation?(this.slider.style.width="170px",this._sliderContainer.style.height="170px"):this._sliderContainer.style.width="150px";r(this._container,"click",function(e){e.preventDefault(),e.stopPropagation()},this),e.collapsed?(r(this._container,"mouseenter",i,this),r(this._container,"mouseleave",s,this),r(this._sliderBtn,"click",function(e){e.preventDefault(),e.stopPropagation()}),r(this._sliderBtn,"click",i,this),r(this._sliderBtn,"focus",i,this)):i();return this._container}.call(this),e.layer&&this.setLayer(e.layer)}setContent(e){var t=e||{};this.setVersionName(t.desc).setToolTip(t.desc)}setVersionName(e){var t=e;return e||(t=this.getValue()),this._sliderValue.innerHTML=t,this}setToolTip(e){return this.tooltip.innerHTML=e,this}updateLength(e){e>0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))}setLayer(e){e&&(this.options.layer=e);var t=this,r=t.options.layer;r.on("tilesetsinfoloaded",function(e){var r=e.value&&e.value.tileVersions;t.update(r)}),r.on("tileversionschanged",function(e){var r=e.value&&e.value.tileVersion;t.setContent(r)}),t.getTileSetsInfo()}update(e){this.tileVersions=e||[],this.updateLength(this.tileVersions.length)}getTileSetsInfo(){var e=this;e.options.layer&&new So(e.options.layer._url).getTilesets(function(t){e.options.layer.setTileSetsInfo(t.result)})}removeLayer(){this.options.layer=null}nextTilesVersion(){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(){return parseInt(this.slider.value)<this.min+1?this:(this.slider.value=parseInt(this.slider.value)-1,this.options.layer.lastTilesVersion(),this)}tilesVersion(e){for(var t=this.options.layer,r=this.tileVersions,i=r.length,s=0;s<i;s++)if(r[s].name==e){t.updateCurrentTileSetsIndex(s),t.changeTilesVersion();break}}getValue(){return this.slider.value}getVersion(){var e=this.tileVersions[this.getValue()];return e&&e.name}}const Co=ol.control.ScaleLine;var Ao=r.n(Co);const Mo=ol.proj,To=ol.AssertionError;var Eo=r.n(To);class Oo extends(Ao()){constructor(e){(e=e||{}).render=function(e){var t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElementRepair()},super(e)}updateElementRepair(){const e=this.viewState_||this.o||this.Om;if(!e)return this.renderedVisible_=this.renderedVisible_||this.j||this.yn,void(this.renderedVisible_&&(this.element_=this.element_||this.c,this.element.style.display="none",this.renderedVisible_=!1));const t=e.center,r=e.projection,i=this.getUnits(),s="degrees"==i?"degrees":"m";let n=Mo.getPointResolution(r,e.resolution,t,s);this.minWidth_=this.minWidth_||this.v||this.Em;let a=this.minWidth_*n,o="";if("degrees"==i){const e=Mo.METERS_PER_UNIT.degrees;(a*=e)<e/60?(o="″",n*=3600):a<e?(o="′",n*=60):o="°"}else if("imperial"==i)a<.9144?(o="in",n/=.0254):a<1609.344?(o="ft",n/=.3048):(o="mi",n/=1609.344);else if("nautical"==i)n/=1852,o="nm";else if("metric"==i)a<.001?(o="μm",n*=1e6):a<1?(o="mm",n*=1e3):a<1e3?o="m":(o="km",n/=1e3);else{if("us"!=i)throw new(Eo())(33);a<.9144?(o="in",n*=39.37):a<1609.344?(o="ft",n/=.30480061):(o="mi",n/=1609.3472)}var l=[1,2,5];let h,u,c,d=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));for(;;){c=Math.floor(d/3);const e=Math.pow(10,c);if(h=l[(d%3+3)%3]*e,u=Math.round(h/n),isNaN(u))return this.element.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++d}this.renderedHTML_=this.renderedHTML_||this.D||this.am,this.innerElement_=this.innerElement_||this.l||this.Tm,this.renderedWidth_=this.renderedWidth_||this.B||this.Am,this.renderedVisible_=this.renderedVisible_||this.j||this.yn,this.element_=this.element_||this.c;let p=h.toFixed(c<0?-c:0)+" "+o;this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}}var Po="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=";class Io extends(_o()){constructor(e){(e=e||{}).imageUrl=e.imageUrl||null,e.width=e.width||null,e.height=e.height||null,e.alt=e.alt||"SuperMap iClient",super(e),this.options=e,this.element=e.element=function(){var e=document.createElement("div");e.className="ol-control-logo ol-unselectable ol-control",function(e){var t=document.getElementsByClassName("ol-attribution"),r=(t=t&&t[0])&&t.clientHeight||29;e.style.bottom=parseInt(r)+6+"px",e.style.right="4px",e.style.marginTop=0,e.style.marginLeft=0,e.style.marginBottom=0,e.style.marginRight=0;var i=document.createElement("style");i.type="text/css",i.innerHTML=".ol-control-logo,.ol-control-logo:hover {background-color: rgba(255,255,255,0);}",document.getElementsByTagName("head")[0].appendChild(i)}.call(this,e);var t=Po;this.options.imageUrl&&(t=this.options.imageUrl);var r=this.options.alt,i=this.options.link,s="94px",n="29px",a="width:"+s+";height:"+n+";";this.options.imageUrl&&(s=this.options.width,n=this.options.height,a="width:"+s+";height:"+n+";",s&&n||(a=""));return e.innerHTML="<a href='"+i+"' target='_blank' style='border: none;display: block;'><img src="+t+" alt='"+r+"'  style='border: none;"+a+"white-space: nowrap;margin-bottom: 2px'></a>",e}.call(this)}}var No={"point-file":"pointFile","point-fill":"fillStyle","point-radius":"pointRadius","point-halo-radius":"pointHaloRadius","point-halo-color":"pointHaloColor","point-dx":"offsetX","point-dy":"offsetY","point-opacity":"globalAlpha","point-comp-op":"globalCompositeOperation"},Lo={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","line-offset":"offset","line-comp-op":"globalCompositeOperation"},ko={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","polygon-fill":"fillStyle","polygon-dx":"offsetX","polygon-dy":"offsetY","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"},Fo={CartoStyleMap:{TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-vertical-alignment":"textBaseline","text-horizontal-alignment":"textAlign","text-bold":"bold","text-weight":"fontWeight","text-name":"textName","text-halo-radius":"haloRadius","text-halo-color":"backColor","text-fill":"foreColor","text-opacity":"globalAlpha","text-dx":"offsetX","text-dy":"offsetY","text-comp-op":"globalCompositeOperation"},POINT:No,MULTIPOINT:No,LINE:Lo,LINESTRING:Lo,MULTILINESTRING:Lo,REGION:ko,POLYGON:ko,MULTIPOLYGON:ko},ServerStyleMap:{fillBackOpaque:{canvasStyle:"",type:"bool",defaultValue:!0},lineWidth:{canvasStyle:"lineWidth",type:"number",unit:"mm",defaultValue:.1},fillBackColor:{canvasStyle:"",type:"color",defaultValue:"rgba(0,0,0,0)"},markerWidth:{canvasStyle:"",type:"number",unit:"mm",defaultValue:""},markerAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:""},fillForeColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{canvasStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},fillGradientOffsetRatioX:{canvasStyle:"",type:"number",defaultValue:0},fillGradientOffsetRatioY:{canvasStyle:"",type:"number",defaultValue:0},lineColor:{canvasStyle:"strokeStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},fillOpaqueRate:{canvasStyle:"",type:"number",defaultValue:100},markerHeight:{canvasStyle:"",type:"number",unit:"mm",defaultValue:0},fillGradientMode:{canvasStyle:"",type:"string",defaultValue:"NONE"},fillSymbolID:{canvasStyle:"",type:"number",defaultValue:0},fillGradientAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:0},markerSymbolID:{canvasStyle:"",type:"number",defaultValue:0},lineSymbolID:{canvasStyle:"",type:"number",defaultValue:0}},CartoCompOpMap:{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:""}},Ro={pointFile:"",pointRadius:3,pointHaloRadius:1,pointHaloColor:"#c33",offsetX:0,offsetY:0,fillStyle:"#fc0",globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},Do={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineDasharray:[],strokeOpacity:1,offset:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},Go={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineOpacity:1,fillOpacity:1,lineDasharray:[],fillStyle:"rgba(0,0,0,0)",polygonOpacity:1,offsetX:0,offsetY:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},jo={TEXT:{font:"10px sans-serif",textAlign:"middle",textBaseline:"center",direction:"ltr",bold:!1,haloRadius:0,backColor:"rgba(255,255,255,1)",foreColor:"rgba(0,0,0,1)",offsetX:0,offsetY:0,textHeight:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},POINT:Ro,MULTIPOINT:Ro,LINE:Do,LINESTRING:Do,MULTILINESTRING:Do,REGION:Go,POLYGON:Go,MULTIPOLYGON:Go,SHADOW:{shadowBlur:0,shadowColor:"rgba(0,0,0,0)",shadowOffsetX:0,shadowOffsetY:0},GLOBAL:{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0}};const Bo=ol.util,Uo=ol.geom.Geometry;var Vo=r.n(Uo);const Jo=ol.render,zo=ol.source.Vector;var qo=r.n(zo);const Ho=ol.layer.Vector;var Wo=r.n(Ho);const Yo=ol.style,Xo=ol.Feature;var Qo=r.n(Xo);const Zo=ol.proj.Projection;var Ko=r.n(Zo);const $o={getOlVersion(){if(Bo&&Bo.VERSION)return Bo.VERSION.split(".")[0];if(window&&window.ol){if(window.ol.util)return"6";if(window.ol.WebGLMap)return"5"}return"4"},toGeoJSON:e=>e?(new Ie).toGeoJSON(e):null,toSuperMapGeometry(e){if(!e||!e.type)return null;return(new Ie).read(e,"FeatureCollection")[0].geometry},resolutionToScale:(e,t,r)=>1/(e*t*(1/.0254)*Jn(r)),toSuperMapBounds:e=>new ne(e[0],e[1],e[2],e[3]),toProcessingParam(e){if(e.length<1)return"";const t={},r=[];for(let t=0;t<e.length;t++){const i={x:e[t][0],y:e[t][1]};r.push(i)}return r.push(r[0]),t.type="REGION",t.points=r,t},scaleToResolution:(e,t,r)=>1/(e*t*(1/.0254)*Jn(r)),getMeterPerMapUnit:Jn,isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},Csv2GeoJSON(e,t){t=t||{titles:["lon","lat"],latitudeTitle:"lat",longitudeTitle:"lon",fieldSeparator:",",lineSeparator:"\n",deleteDoubleQuotes:!0,firstLineTitles:!1};const r=[];if("string"==typeof e){let s=t.titles;if(t.firstLineTitles){if((e=e.split(t.lineSeparator)).length<2)return;s=e[0],e.splice(0,1),e=e.join(t.lineSeparator),s=s.trim().split(t.fieldSeparator);for(let e=0;e<s.length;e++)s[e]=i(s[e]);t.titles=s}for(let e=0;e<s.length;e++){let t=s[e].toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"_");""!==t&&"_"!==t||(t=`prop-${e}`),r[e]=t}e=function(e){const s={type:"FeatureCollection",features:[]},n=t.titles;e=e.split(t.lineSeparator);for(let a=0;a<e.length;a++){const o=e[a].trim().split(t.fieldSeparator),l=parseFloat(o[n.indexOf(t.longitudeTitle)]),h=parseFloat(o[n.indexOf(t.latitudeTitle)]),u=l<180&&l>-180&&h<90&&h>-90;if(o.length!==n.length||!u)continue;const c={type:"Feature",geometry:{},properties:{}};c.geometry.type="Point",c.geometry.coordinates=[l,h];for(let e=0;e<n.length;e++)n[e]!==t.latitudeTitle&&n[e]!==t.longitudeTitle&&(c.properties[r[e]]=i(o[e]));s.features.push(c)}return s}(e)}return e;function i(e){return t.deleteDoubleQuotes&&(e=e.trim().replace(/^"/,"").replace(/"$/,"")),e}},createCanvasContext2D(e,t){const r=document.createElement("CANVAS");return e&&(r.width=e),t&&(r.height=t),r.getContext("2d")},supportWebGL2(){const e=document.createElement("canvas");return Boolean(e&&e.getContext("webgl2"))},isString:el,isObject:e=>"[object Object]"===Object.prototype.toString.call(e),trim:(e="")=>e.replace(/(^\s*)|(\s*$)/g,""),newGuid(e){let t=e||32,r="";for(let e=1;e<t;e++){r+=Math.floor(16*Math.random()).toString(16)}return r},isNumber(e){if(""===e)return!1;let t=Number(e);return 0===t||!isNaN(t)},isMatchAdministrativeName:rl,getHighestMatchAdministration(e,t){let r=0,i=null;return e.filter(e=>rl(e.properties.Name,t)).forEach(e=>{let s=0;Array.from(new Set(e.properties.Name.split(""))).forEach(e=>{t.includes(e)&&s++}),s>r&&(r=s,i=e)}),i},setMask(e,t){if(!t)return;if(!((t instanceof Qo()?t.getGeometry():t)instanceof Vo())&&["MultiPolygon","Polygon"].indexOf(t.getType())<0)return;const r=t instanceof Qo()?t:new(Qo())(t),i=new Yo.Style({fill:new Yo.Fill({color:"black"})}),s=new(Wo())({source:new(qo())({features:[r],wrapX:!1})}),n=function(e){const t=(0,Jo.getVectorContext)(e);e.context.globalCompositeOperation="destination-in",s.getSource().forEachFeature(function(r){t.drawFeature(r,i),e.context.globalCompositeOperation="source-over"})},a=Array.isArray(e)?e:[e];tl(a),a.forEach(e=>{e.classNameBak_=e.className_,e.className_=`ol_mask_layer_${e.ol_uid}`,e.clipRender=n,e.extentBak_=e.getExtent(),e.setExtent(s.getSource().getExtent()),e.on("postrender",n),e.changed()})},unsetMask:tl,getZoomByResolution:(e,t)=>(function(e,t){let r,i=0;for(let s=0;s<t.length;s++)0===s&&(r=Math.abs(e-t[s])),r>Math.abs(e-t[s])&&(r=Math.abs(e-t[s]),i=s);return i})(e,t),scalesToResolutions:(e,t,r,i,s,n)=>(function(e,t,r,i,s=22){var n=[];if(e&&e.length>0)for(let t=0;t<e.length;t++)n.push(zn(e[t],r,i));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})})(e,t,r,i,s),getProjection(e,t){let r=(0,Mo.get)(`EPSG:${e.epsgCode}`);return"PCS_NON_EARTH"==e.type&&(r=new(Ko())({extent:t,units:"m",code:"0"})),r||console.error(`The projection of EPSG:${e.epsgCode} is missing, please register the projection of EPSG:${e.epsgCode} first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection`),r}};function el(e){return"string"==typeof e&&e.constructor===String}function tl(e){const t=Array.isArray(e)?e:[e];for(let e=0;e<t.length;e++){const r=t[e];r.clipRender&&(r.un("postrender",r.clipRender),r.className_=r.classNameBak_,r.setExtent(r.extentBak),delete r.classNameBak_,delete r.clipRender,delete r.extentBak_,r.changed())}}function rl(e,t){if(el(t)){let r=e.substr(0,2);return"张家"===r&&(r=e.substr(0,3)),!!t.match(new RegExp(r))}return!1}const il=function(){try{return canvg}catch(e){return{}}}();var sl=r.n(il);const nl=ol.style.Style;var al=r.n(nl);const ll=ol.style.Icon;var hl=r.n(ll);const ul=ol.style.Circle;var cl=r.n(ul);const dl=ol.style.Fill;var pl=r.n(dl);const fl=ol.style.Stroke;var yl=r.n(fl);const ml=ol.style.Text;var gl=r.n(ml),vl=8,bl=2*vl;const Sl=1e-7;class xl{static getValidStyleFromLayerInfo(e,t,r){var i=t.getGeometry().getType().toUpperCase(),s=e.layerStyle,n=this.getDefaultStyle(i);if(!("POINT"!==i&&"MULTIPOINT"!==i||t.getProperties().textStyle||"LABEL"===e.type||t.getProperties().TEXT_FEATURE_CONTENT)){if(s){var a={transparent:!0,resourceType:"SYMBOLMARKER",picWidth:Math.ceil(s.markerSize*ee*re.mm)||13,picHeight:Math.ceil(s.markerSize*ee*re.mm)||13,style:JSON.stringify(s)},o=te.urlAppend(r+"/symbol.png",te.getParameterString(a));return n.pointFile=o,new(al())({image:new(hl())({src:n.pointFile})})}return this.toOLPointStyle(n)}if(("POINT"===i||"MULTIPOINT"===i)&&(t.getProperties().textStyle||"LABEL"===e.type||t.getProperties().TEXT_STYLE_INFO)){if(n=this.getDefaultStyle("TEXT"),t.getProperties().textStyle&&(s=t.getProperties().textStyle),t.getProperties().TEXT_STYLE_INFO&&(s=JSON.parse(t.getProperties().TEXT_STYLE_INFO).textStyle),s&&"{}"!==s){var l="";n.fontStyle=s.italic?"italic":"normal",n.fontWeight=s.bold?s.fontWeight:"normal";var h=s.fontHeight*ee*re.mm*.85;n.fontSize=h+"px",l=s.fontName.indexOf("@")?s.fontName.replace(/@/g,""):s.fontName,n.fontFamily=l,n.textHeight=h;var u=s.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/,"");n.textAlign=u.toLowerCase();var c=s.align.replace(/LEFT|RIGHT|CENTER/,"");"BASELINE"===c&&(c="alphabetic"),n.textBaseline=c.toLowerCase(),n.haloRadius=s.outline?s.outlineWidth:0,n.backColor="rgba("+s.backColor.red+","+s.backColor.green+","+s.backColor.blue+",1)",n.foreColor="rgba("+s.foreColor.red+","+s.foreColor.green+","+s.foreColor.blue+",1)",n.rotation=s.rotation}var d;if(t.getProperties().textStyle&&t.getProperties().texts&&(d=t.getProperties().texts[0]),"LABEL"===e.type){var p=e.textField;if(p&&p.indexOf(".")){var f=p.split(".");p=f&&f.length>0&&f[f.length-1]}d=t.getProperties().attributes?t.getProperties().attributes[p]:t.getProperties()[p]}return t.getProperties().TEXT_FEATURE_CONTENT&&(d=t.getProperties().TEXT_FEATURE_CONTENT),d?this.toOLTextStyle(n,d):this.toOLPointStyle(this.getDefaultStyle("POINT"))}if(s){var y=s.fillSymbolID>7?0:s.fillSymbolID,m=s.lineSymbolID>5?0:s.lineSymbolID;for(var g in s){var v,b=Fo.ServerStyleMap[g],S=b.canvasStyle;if(S&&""!=S)switch(b.type){case"number":v=s[g],b.unit&&(v=v*ee*re[b.unit]*2.5),n[S]=v;break;case"color":var x=s[g],_=s.fillBackColor,w=1;if("fillStyle"===S)if(0===y||1===y)w=1-y,v="rgba("+x.red+","+x.green+","+x.blue+","+w+")";else try{var C=document.createElement("canvas");C.height=8,C.width=8;var A=C.getContext("2d"),M=new Image;this.layer&&this.layer.fillImages&&A.drawImage(this.layer.fillImages["System "+y],0,0);for(var T=A.getImageData(0,0,C.width,C.height),E=T.data,O=0,P=E.length;O<P;O+=4){var I=E[O],N=E[O+1],L=E[O+2];I<225&&N<225&&L<225?(E[O]=x.red,E[O+1]=x.green,E[O+2]=x.blue):_&&(E[O]=_.red,E[O+1]=_.green,E[O+2]=_.blue)}A.putImageData(T,0,0),M.src=C.toDataURL(),this.context&&(v=this.context.createPattern(M,"repeat"))}catch(e){throw Error(e.message)}else if("strokeStyle"===S){if(0===m||5===m)w=0===m?1:0;else{var k=[1,0];switch(m){case 1:k=[9.7,3.7];break;case 2:k=[3.7,3.7];break;case 3:k=[9.7,3.7,2.3,3.7];break;case 4:k=[9.7,3.7,2.3,3.7,2.3,3.7]}n.lineDasharray=k}v="rgba("+x.red+","+x.green+","+x.blue+","+w+")"}n[S]=v}}}return"LINESTRING"===i||"MULTILINESTRING"===i?this.toOLLineStyle(n):"POLYGON"===i||"MULTIPOLYGON"===i?this.toOLPolygonStyle(n):void 0}static getStyleFromCarto(e,t,r,i,s,n){var a=i.getGeometry().getType().toUpperCase(),o={},l=this.getDefaultStyle(a);o.FEATUREID=i.getProperties().id,o.SCALE=t;var h,u,c="TEXT"===i.getProperties().type?"TEXT":a,d=Fo.CartoStyleMap[c];if(r)for(var p=0,f=r.length;p<f;p++){var y=r[p],m=d[y.property],g=y.getValue(o,e,!0);if(null!==g&&m)if("fontSize"===m)s&&(g*=.8),h=g+"px",l.fontSize=h;else if("fontName"===m)u=g,l.fontName=u;else{if("globalCompositeOperation"===m){if(!(g=Fo.CartoCompOpMap[g]))continue}else s&&"pointFile"===m&&(g=(g=n+"/tileFeature/symbols/"+g.replace(/(___)/gi,"@")).replace(/(__0__0__)/gi,"__8__8__"));"lineWidth"===m&&g<1&&(g=Math.ceil(g)),l[m]=g}}if("TEXT"===i.getProperties().type){var v;if(i.getProperties().texts&&(v=i.getProperties().texts[0]),null==v&&l.textName){var b=l.textName.substring(1,l.textName.length-1);if(null!=(v=i.getProperties().attributes?i.getProperties().attributes[b]:i.getProperties()[b])){var S=i.getProperties().texts||[];S.push(v),i.setProperties({texts:S})}}return this.toOLTextStyle(l,v)}return"POINT"===a||"MULTIPOINT"===a?this.toOLPointStyle(l):"LINESTRING"===a||"MULTILINESTRING"===a?this.toOLLineStyle(l):"POLYGON"===a||"MULTIPOLYGON"===a?this.toOLPolygonStyle(l):void 0}static toOLPointStyle(e){return""!==e.pointFile?new(al())({image:new(hl())({src:e.pointFile})}):new(al())({image:new(cl())({radius:e.pointRadius,fill:new(pl())({color:e.fillStyle}),stroke:new(yl())({color:e.pointHaloColor,width:e.pointHaloRadius})})})}static toOLLineStyle(e){return new(al())({stroke:new(yl())({color:e.strokeStyle,width:e.lineWidth,lineCap:e.lineCap,lineDash:e.lineDasharray,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,miterLimit:e.miterLimit})})}static toOLPolygonStyle(e){var t=new(pl())({color:e.fillStyle}),r=new(yl())({color:e.strokeStyle,width:e.lineWidth,lineCap:e.lineCap,lineDash:e.lineDasharray,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,miterLimit:e.miterLimit});return new(al())({fill:t,stroke:r})}static toOLTextStyle(e,t){return new(al())({text:new(gl())({font:(e.fontStyle||"")+" "+(e.fontWeight||"")+" "+(e.fontSize||"")+" "+e.fontFamily,text:t,textAlign:e.textAlign,textBaseline:e.textBaseline,fill:new(pl())({color:e.foreColor}),stroke:new(yl())({color:e.backColor}),offsetX:e.offsetX,offsetY:e.offsetY})})}static dashStyle(e,t){if(!e)return[];var r=e.strokeWidth*t,i=e.strokeDashstyle||e.lineDash;switch(i){case"solid":return[0];case"dot":return[1,4*r];case"dash":return[4*r,4*r];case"dashdot":return[4*r,4*r,1,4*r];case"longdash":return[8*r,4*r];case"longdashdot":return[8*r,4*r,1,4*r];default:return i?te.isArray(i)?i:(i=H.trim(i).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}}static getStyleFromiPortalMarker(e){return 0==e.indexOf("./")?null:new(al())({image:new(hl())({src:e,opacity:1,size:[48,43],anchor:[.5,1]})})}static getStyleFromiPortalStyle(e,t,r){var i=r?JSON.parse(r):null,s=this;if("Point"===t||"MultiPoint"===t){var n=i||e.pointStyle;return n.externalGraphic?0==n.externalGraphic.indexOf("./")?null:new(al())({image:new(hl())({src:n.externalGraphic,opacity:n.graphicOpacity,size:[n.graphicWidth,n.graphicHeight]})}):new(al())({image:new(cl())({fill:new(pl())({color:s.hexToRgba(n.fillColor,n.fillOpacity)}),stroke:new(yl())({color:s.hexToRgba(n.strokeColor,n.strokeOpacity),lineCap:n.strokeLineCap,lineDash:this.dashStyle(n,1),width:n.strokeWidth}),radius:n.pointRadius})})}if("LineString"===t||"MultiLineString"===t||"Box"===t){var a=i||e.lineStyle;return new(al())({stroke:new(yl())({color:s.hexToRgba(a.strokeColor,a.strokeOpacity),lineCap:a.strokeLineCap,lineDash:this.dashStyle(a,1),width:a.strokeWidth})})}if("Polygon"===t||"MultiPolygon"===t){var o=i||e.polygonStyle;return new(al())({fill:new(pl())({color:s.hexToRgba(o.fillColor,o.fillOpacity)}),stroke:new(yl())({color:s.hexToRgba(o.strokeColor,o.strokeOpacity),lineCap:o.strokeLineCap,lineDash:this.dashStyle(o,1),width:o.strokeWidth})})}}static hexToRgba(e,t){var r=[],i=[];if(3==(e=e.replace(/#/,"")).length){var s=[];for(let t=0;t<3;t++)s.push(e.charAt(t)+e.charAt(t));e=s.join("")}for(let t=0;t<6;t+=2)r[t]="0x"+e.substr(t,2),i.push(parseInt(Number(r[t])));return i.push(t),"rgba("+i.join(",")+")"}static getDefaultStyle(e){var t={},r=jo[e];for(var i in r){var s=r[i];t[i]=s}return t}static async toOpenLayersStyle(e,t){e=e||this.getDefaultStyle();let r,i,s,n=new(al()),{fillColor:a,fillOpacity:o,strokeColor:l,strokeWidth:h,strokeOpacity:u,radius:c,lineCap:d,src:p,scale:f,offsetX:y,offsetY:m,anchor:g}=e,v=this.hexToRgb(a);v&&v.push(o);let b=this.hexToRgb(l);if(b&&b.push(u),"POINT"===t)p?/.+(\.svg$)/.test(p)?(this.svgDiv||(this.svgDiv=document.createElement("div"),document.body.appendChild(this.svgDiv)),await this.getCanvasFromSVG(p,this.svgDiv,e=>{r=new(hl())({img:e,scale:c/e.width,imgSize:[e.width,e.height],anchor:[.5,.5]})})):r=new(hl())({src:p,scale:f,anchor:g}):r=new(cl())({radius:c,fill:new(pl())({color:v}),stroke:new(yl())({width:h||Sl,color:b}),displacement:this.getCircleDisplacement(c,y,m)}),n.setImage(r);else if("LINE"===t||"LINESTRING"===t||"MULTILINESTRING"===t||"LINEARRING"===t)s=new(yl())({width:h||Sl,color:b,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),n.setStroke(s);else if("POLYGON"===t||"MULTIPOLYGON"===t||"REGION"===t)i=new(pl())({color:v}),s=new(yl())({width:h||Sl,color:b,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),n.setFill(i),n.setStroke(s);else{let t=this.getCanvas(e);r=new(hl())({img:t.canvas,imgSize:[t.width,t.height],scale:1,anchor:[.5,.5]}),n.setImage(r)}return n}static getIconAnchor(e=.5,t=.5){return[e,t]}static getCircleDisplacement(e,t=0,r=0){return[e*t,-(e*r)]}static getTextOffset(e,t=0,r=0){const i=e.substr(0,e.length-2)/2;return{x:i*t,y:i*r}}static getCanvas(e){let t;e.canvas?t=document.querySelector("#"+e.canvas)?document.getElemntById(e.canvas):this.createCanvas(e):(t=this.createCanvas(e),e.canvas=t.id),t.style.display="none";var r=t.getContext("2d");let i=Number(e.font.replace(/[^0-9]/gi,"")),s=e.text.split("\r\n"),n=s.length;r.font=e.font;let a=this.drawRect(r,e,s,i,t);return this.positionY=vl,n>1?s.forEach(function(t,s){0!==s&&(this.positionY=this.positionY+i),this.canvasTextAutoLine(t,e,r,i,a.width)},this):this.canvasTextAutoLine(s[0],e,r,i,a.width),{canvas:t,width:a.width,height:a.height}}static createCanvas(e){let t=document.createElement("div");document.body.appendChild(t);let r=document.createElement("canvas");return r.id=e.canvas?e.canvas:"textCanvas"+$o.newGuid(8),t.appendChild(r),r}static drawRect(e,t,r,i,s){let n,a=t.backgroundFill,o=t.maxWidth-bl,l=0,h=0,u=[];return r.forEach(function(t){let r,i="";h++;for(var s=0;s<t.length;s++){let a=i+t[s],l=e.measureText(a).width;l>o&&s>0||"\n"===t[s]?(i=t[s],h++,r=!0):(i=a,n=l)}r?u.push(o):u.push(n)},this),n=this.getCanvasWidth(u,o),l=h*i,l+=bl,s.width=n,s.height=l,e.fillStyle=a,e.fillRect(0,0,n,l),{width:n,height:l}}static getCanvasWidth(e,t){let r=0;for(let i=0;i<e.length;i++){let s=e[i];if(s>=t)return t+bl;s>r&&(r=s)}return r+bl}static canvasTextAutoLine(e,t,r,i,s){r.font=t.font;let n=t.textAlign,a=this.getPositionX(n,s),o=e.split(""),l="",h=t.fillColor,u=t.maxWidth-bl;for(var c=0;c<o.length;c++){let e=l+o[c];r.measureText(e).width>u&&c>0||"\n"===o[c]?(r.fillStyle=h,r.textAlign=n,r.textBaseline="top",r.fillText(l,a,this.positionY),l=o[c],this.positionY+=i):l=e}r.fillStyle=h,r.textAlign=n,r.textBaseline="top",r.fillText(l,a,this.positionY)}static getPositionX(e,t){let r,i=t-bl;switch(e){case"center":r=i/2;break;case"right":r=i;break;default:r=8}return r}static hexToRgb(e){if(e){var t=e.replace("#","").split(""),r=[t[0]+t[1],t[2]+t[3],t[4]+t[5]];return r=r.map(function(e){return parseInt(e,16)})}}static formatRGB(e){let t;return 3===e.length?(t="rgb(",e.forEach(function(e,r){t+=2===r?e:e+","})):(t="rgba(",e.forEach(function(e,r){t+=3===r?e:e+","})),t+=")"}static async getCanvasFromSVG(e,t,r){const i=window.canvg&&window.canvg.default?window.canvg.default:sl();let s=document.createElement("canvas");s.id="dataviz-canvas-"+$o.newGuid(8),s.style.display="none",t.appendChild(s);try{const t=s.getContext("2d");if((await i.from(t,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:()=>!1})).start(),s.width>300||s.height>300)return;r(s)}catch(e){return}}static stopCanvg(){this.canvgsV.forEach(e=>e.stop()),this.canvgsV=[]}static getMarkerDefaultStyle(e,t){let r;switch(e){case"POINT":r={src:`${t}apps/dataviz/static/imgs/markers/mark_red.png`,scale:1,anchor:[.5,1]};break;case"LINE":case"LINESTRING":case"MULTILINESTRING":r={strokeColor:"#3498db",strokeOpacity:1,strokeWidth:5,lineCap:"round",lineDash:"solid"};break;case"REGION":case"POLYGON":case"MULTIPOLYGON":r={fillColor:"#1abd9c",fillOpacity:1,strokeColor:"#3498db",strokeOpacity:1,strokeWidth:3,lineCap:"round",lineDash:"solid"}}return r}static async getOpenlayersStyle(e,t,r){let i;return"BASIC_POINT"===e.type?i=await this.toOpenLayersStyle(e,t):"SYMBOL_POINT"===e.type?i=this.getSymbolStyle(e,r):"SVG_POINT"===e.type?i=await this.getSVGStyle(e):"IMAGE_POINT"===e.type&&(i=this.getImageStyle(e)),i}static getSymbolStyle(e,t){let r="";e.unicode&&(r=String.fromCharCode(parseInt(e.unicode.replace(/^&#x/,""),16)));let i=xl.hexToRgb(e.fillColor);i.push(e.fillOpacity);let s=xl.hexToRgb(e.strokeColor);s.push(e.strokeOpacity);let n=t?2*e.radius+"px":e.fontSize;const{offsetX:a,offsetY:o,rotation:l=0}=e,h=xl.getTextOffset(n,a,o);return new(al())({text:new(gl())({text:r,font:n+" supermapol-icons",placement:"point",textAlign:"center",fill:new(pl())({color:i}),backgroundFill:new(pl())({color:[0,0,0,0]}),stroke:new(yl())({width:e.strokeWidth||1e-6,color:s}),offsetX:h.x,offsetY:h.y,rotation:l})})}static async getSVGStyle(e){let t,r=this;r.svgDiv||(r.svgDiv=document.createElement("div"),document.body.appendChild(r.svgDiv));const{url:i,radius:s,offsetX:n,offsetY:a,fillOpacity:o,rotation:l}=e;let h=this.getIconAnchor(n,a);return await xl.getCanvasFromSVG(i,r.svgDiv,function(i){t=new(al())({image:new(hl())({img:r.setColorToCanvas(i,e),scale:2*s/i.width,imgSize:[i.width,i.height],anchor:h||[.5,.5],opacity:o,anchorOrigin:"bottom-right",rotation:l})})}),t}static setColorToCanvas(e,t){let r=e.getContext("2d"),i=xl.hexToRgb(t.fillColor);i&&i.push(t.fillOpacity);let s=xl.hexToRgb(t.strokeColor);return s&&s.push(t.strokeOpacity),r.fillStyle=xl.formatRGB(i),r.fill(),r.strokeStyle=xl.formatRGB(s),r.lineWidth=t.strokeWidth,r.stroke(),e}static getImageStyle(e){let t=e.imageInfo.size,r=2*e.radius/t.w,i=e.imageInfo,s=i.img;s&&s.src||((s=new Image).src=i.url);const{offsetX:n,offsetY:a,rotation:o}=e;let l=this.getIconAnchor(n,a);return new(al())({image:new(hl())({img:s,scale:r,imgSize:[t.w,t.h],anchor:l||[.5,.5],anchorOrigin:"bottom-right",rotation:o})})}static getRoadPath(e,t){const{strokeWidth:r=Sl,lineCap:i,strokeColor:s,strokeOpacity:n}=e;let a=this.hexToRgb(s);a&&a.push(n);var o=new(al())({stroke:new(yl())({width:r||Sl,color:a,lineCap:i||"round",lineDash:[0]})});const{strokeColor:l}=t;let h=this.hexToRgb(l);h&&h.push(n);let u=t.strokeWidth||(0===r?Sl:r+2);return[new(al())({stroke:new(yl())({width:u,color:h,lineCap:i||"round",lineDash:[0]})}),o]}static getPathway(e,t){let{strokeWidth:r=Sl,strokeColor:i,strokeOpacity:s}=e;const n=(e=>[e,e+2*r])(4*r);let a=this.hexToRgb(i);a&&a.push(s);var o=new(al())({stroke:new(yl())({width:.5*r||Sl,color:a,lineCap:"square",lineDash:n})});const{strokeColor:l}=t;let h=this.hexToRgb(l);return h&&h.push(s),[new(al())({stroke:new(yl())({width:r||Sl,color:h,lineCap:"square"})}),o]}}const _l=ol.Map;var wl=r.n(_l);const Cl=ol.layer.Group;var Al=r.n(Cl);!function(){const e=function(t,r,i,s,n,a){t instanceof Al()?t.getLayers().forEach(function(t){e(t,r,i,s,n,a)}):t.getSource()._forEachFeatureAtCoordinate&&t.getSource()._forEachFeatureAtCoordinate(r,i,e=>{s(e,t)},n,a)};wl().prototype.forEachFeatureAtPixelDefault=wl().prototype.forEachFeatureAtPixel,wl().prototype.forEachFeatureAtPixel=wl().prototype.Tc=function(t,r,i,s){const n=i&&i.layerFilter?i.layerFilter:()=>!0,a=this.getLayers().getArray(),o=this.getView().getResolution(),l=this.getCoordinateFromPixel(t);for(let i=0;i<a.length;i++){const h=a[i];h.getVisible()&&n.call(null,h)&&e(h,l,o,r,t,s)}return this.forEachFeatureAtPixelDefault(t,r,i)}}();const Ml=ol.source.TileImage;var Tl=r.n(Ml);const El=ol.asserts,Ol=ol.tilegrid.TileGrid;var Pl=r.n(Ol);class Il extends(Tl()){constructor(e){var t=e||{},r=t.attributions||"Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方 with <span>© SuperMap iClient</span>",i=Il.defaultTileGrid(),s=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"https://maponline{num}.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408",a=t.hidpi||(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1;n=n.replace("{styles}",a?"ph":"pl"),super({attributions:r,cacheSize:t.cacheSize,crossOrigin:s,opaque:void 0===t.opaque||t.opaque,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,projection:"EPSG:3857",wrapX:t.wrapX,tilePixelRatio:a?2:1,tileGrid:i,tileUrlFunction:function(e,t,r){var s=n.replace("{num}",Math.abs((e[1]+e[2])%4)).replace("{z}",e[0].toString()).replace("{x}",e[1].toString()).replace("{y}",function(){console.log($o.getOlVersion());var t=["4","5"].indexOf($o.getOlVersion())>-1?e[2]:-e[2]-1;return t.toString()}).replace("{-y}",function(){var t=e[0],r=i.getFullTileRange(t);El.assert(r,55);var s=r.getHeight()+e[2];return s.toString()});o.tileProxy&&(s=o.tileProxy+encodeURIComponent(s));return s}}),t.tileProxy&&(this.tileProxy=t.tileProxy);var o=this}static defaultTileGrid(){return new(Pl())({extent:[-33554432,-33554432,33554432,33554432],resolutions:[262144,131072,65536,32768,16284,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1,.5],origin:[0,0],minZoom:3})}}const Nl=ol.source.Image;var Ll=r.n(Nl);const kl=ol.Image;var Fl=r.n(kl);const Rl=ol.format.GeoJSON;var Dl=r.n(Rl);const Gl=ol.extent;class jl extends(Ll()){constructor(e){if(super({attributions:e.attributions,imageSmoothing:e.imageSmoothing,projection:e.projection,resolutions:e.resolutions}),void 0===e.url)return;this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:Nl.defaultImageLoadFunction,this._image=null,this.renderedRevision_=0,this._crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this._url=e.url,this.ratio_=void 0!==e.ratio?e.ratio:1.5,e.attributions=e.attributions||"Map Data <span>© SuperMap iServer</span> with © SuperMap iClient",e.format=e.format?e.format:"png",this._layerUrl=te.urlPathAppend(e.url,"image."+e.format),this._layerUrl=Ve.appendCredential(this._layerUrl);const t={},r=void 0===e.transparent||e.transparent;t.transparent=r;const i=void 0===e.cacheEnabled||e.cacheEnabled;t.cacheEnabled=i,void 0!==e.layersID&&(t.layersID=e.layersID);let s=!1;void 0!==e.redirect&&(s=e.redirect),t.redirect=s,e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.clipRegionEnabled&&e.clipRegion instanceof Vo()&&(e.clipRegion=$o.toSuperMapGeometry((new(Dl())).writeGeometryObject(e.clipRegion)),e.clipRegion=te.toJSON(Me.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion)),e.overlapDisplayed&&e.overlapDisplayedOptions&&(t.overlapDisplayed=e.overlapDisplayed,t.overlapDisplayedOptions=e.overlapDisplayedOptions.toString()),!0===i&&e.tileversion&&(t.tileversion=e.tileversion),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),void 0!==e.antialias&&(t.antialias=e.antialias),void 0!==e.markerAngleFixed&&(t.markerAngleFixed=e.markerAngleFixed),void 0!==e.textAngleFixed&&(t.textAngleFixed=e.textAngleFixed),void 0!==e.textOrientationFixed&&(t.textOrientationFixed=e.textOrientationFixed),void 0!==e.paintBackground&&(t.paintBackground=e.paintBackground),isNaN(e.maxVisibleTextSize)||(t.maxVisibleTextSize=+e.maxVisibleTextSize),isNaN(e.minVisibleTextSize)||(t.maxVisibleTextSize=+e.minVisibleTextSize),isNaN(e.maxVisibleVertex)||(t.maxVisibleVertex=Math.round(+e.maxVisibleVertex)),this._layerUrl=te.urlAppend(this._layerUrl,te.getParameterString(t)),this.cacheEnabled=i,e.tileProxy&&(this.tileProxy=e.tileProxy)}getImageInternal(e,t,r){const i=(t=this.findNearestResolution(t))/r,s=(0,Gl.getCenter)(e),n=Math.ceil((0,Gl.getWidth)(e)/i),a=Math.ceil((0,Gl.getHeight)(e)/i),o=(0,Gl.getForViewAndSize)(s,i,0,[n,a]),l=Math.ceil(this.ratio_*(0,Gl.getWidth)(e)/i),h=Math.ceil(this.ratio_*(0,Gl.getHeight)(e)/i),u=(0,Gl.getForViewAndSize)(s,i,0,[l,h]),c=this._image;if(c&&this.renderedRevision_===this.getRevision()&&c.getResolution()===t&&c.getPixelRatio()===r&&(0,Gl.containsExtent)(c.getExtent(),o))return c;const d=[Math.round((0,Gl.getWidth)(u)/i),Math.round((0,Gl.getHeight)(u)/i)],p=this._getRequestUrl(u,d);return this._image=new(Fl())(u,t,r,p,this._crossOrigin,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this._image.addEventListener("change",this.handleImageChange.bind(this)),this._image}_getRequestUrl(e,t){const r={width:t[0],height:t[1],viewBounds:{leftBottom:{x:e[0],y:e[1]},rightTop:{x:e[2],y:e[3]}}};this.cacheEnabled||(r._t=(new Date).getTime());let i=te.urlAppend(this._layerUrl,te.getParameterString(r));return this.tileProxy&&(i=this.tileProxy+encodeURIComponent(i)),i}static optionsFromMapJSON(e,t){var r=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top];return{url:e,resolutions:function(){var e,i=r[2]-r[0],s=r[3]-r[1],n=i>=s?i:s;e=n===i?n/t.viewer.width:n/t.viewer.height;var a=[],o=l.METER;t.coordUnit===l.DEGREE&&(o=l.DEGREE);if(t.visibleScales.length>0)for(let e=0;e<t.visibleScales.length;e++)a.push($o.scaleToResolution(t.visibleScales[e],96,o));else for(let t=0;t<28;t++)a.push(e/Math.pow(2,t));return a.sort(function(e,t){return t-e})}()}}}const Bl=ol.source.XYZ;var Ul=r.n(Bl);class Vl extends(Ul()){constructor(e){var t=e||{},r=t.attributions||"Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo with <span>© SuperMap iClient</span>",i=t.mapName||"quanguo",s=t.mapType||"web",n=t.url||"http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}";n=n.replace("{mapName}",i).replace("{type}",s);var a={attributions:r,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,opaque:void 0===t.opaque||t.opaque,maxZoom:t.maxZoom||18,reprojectionErrorThreshold:t.reprojectionErrorThreshold,url:n,wrapX:t.wrapX};t.tileProxy&&(a.tileLoadFunction=function(e,t){e.getImage().src=o.tileProxy+encodeURIComponent(t)}),super(a),t.tileProxy&&(this.tileProxy=t.tileProxy);var o=this}}const Jl=ol.source.WMTS;var zl=r.n(Jl);const ql=ol.tilegrid.WMTS;var Hl=r.n(ql);class Wl extends(zl()){constructor(e){var t=e||{},r=t.attributions||"Map Data <a href='http://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='http://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a> with <span>© SuperMap iClient</span>";t.layerType=t.layerType||"vec",t.layerType=t.isLabel?{vec:"cva",ter:"cta",img:"cia"}[t.layerType]:t.layerType,t.matrixSet="EPSG:4326"===t.projection||"EPSG:4490"===t.projection?"c":"w",t.url||t.urls||(t.url="http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?"),t.key&&(t.url=`${t.url}tk=${t.key}`),t.url=t.url.replace("{layer}",t.layerType).replace("{proj}",t.matrixSet);var i=t.tileGrid||Wl.getTileGrid(t.projection||"EPSG:3857"),s=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n={version:t.version||"1.0.0",format:t.format||"tiles",dimensions:t.dimensions||{},layer:t.layerType,matrixSet:t.matrixSet,tileGrid:i,style:t.style||"default",attributions:r,cacheSize:t.cacheSize,crossOrigin:s,opaque:void 0===t.opaque||t.opaque,maxZoom:{vec:18,ter:14,img:18}[t.layerType],reprojectionErrorThreshold:t.reprojectionErrorThreshold,url:t.url,urls:t.urls,projection:t.projection||"EPSG:3857",wrapX:t.wrapX};t.tileProxy&&(n.tileLoadFunction=function(e,t){e.getImage().src=a.tileProxy+encodeURIComponent(t)}),super(n),t.tileProxy&&(this.tileProxy=t.tileProxy);var a=this}static getTileGrid(e){return"EPSG:4326"===e||"EPSG:4490"===e?Wl.default4326TileGrid():Wl.default3857TileGrid()}static default4326TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(1.40625/Math.pow(2,r)),t.push(r);return new(Hl())({extent:[-180,-90,180,90],resolutions:e,origin:[-180,90],matrixIds:t,minZoom:1})}static default3857TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(156543.03392804062/Math.pow(2,r)),t.push(r);return new(Hl())({extent:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892],resolutions:e,matrixIds:t,origin:[-20037508.3427892,20037508.3427892],minZoom:1})}}const Yl=ol.size,Xl=ol.tilegrid;class Ql extends(Tl()){constructor(e){(e=e||{}).attributions=e.attributions||"Map Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>",e.format=e.format?e.format:"png",super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,logo:"4"===$o.getOlVersion()?e.logo:null,opaque:e.opaque,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:function(r,s,n){t.tileGrid||(e.extent?(t.tileGrid=Ql.createTileGrid(e.extent),t.resolutions&&(t.tileGrid.resolutions=t.resolutions)):("EPSG:3857"===n.getCode()&&(t.tileGrid=Ql.createTileGrid([-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]),t.extent=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]),"EPSG:4326"===n.getCode()&&(t.tileGrid=Ql.createTileGrid([-180,-90,180,90]),t.extent=[-180,-90,180,90])));t.origin=t.tileGrid.getOrigin(0);var a=r[0],o=r[1],h=["4","5"].indexOf($o.getOlVersion())>-1?-r[2]-1:r[2],u=t.tileGrid.getResolution(a),c=t.dpi||96,d=n.getUnits()||l.DEGREE;"degrees"!==d&&"degree"!==d||(d=l.DEGREE);"m"!==d&&"meter"!==d||(d=l.METER);var p=$o.resolutionToScale(u,c,d),f=Yl.toSize(t.tileGrid.getTileSize(a,t.tmpSize)),y=function(){this._paramsChanged&&(this._layerUrl=i.call(this),this._paramsChanged=!1);return this._layerUrl||i.call(this)}.call(t)+encodeURI("&x="+o+"&y="+h+"&width="+f[0]+"&height="+f[1]+"&scale="+p);t.tileProxy&&(y=t.tileProxy+encodeURIComponent(y));t.cacheEnabled||(y+="&_t="+(new Date).getTime());return y},wrapX:void 0!==e.wrapX&&e.wrapX,cacheEnabled:e.cacheEnabled,layersID:e.layersID}),e.tileProxy&&(this.tileProxy=e.tileProxy),this.options=e,this._url=e.url,this.tileSetsIndex=-1,this.tempIndex=-1,this.dpi=this.options.dpi||96;var t=this,r=te.urlPathAppend(e.url,"tileImage."+e.format);function i(){return this.requestParams=this.requestParams||function(){var t={};return t.redirect=void 0!==e.redirect&&e.redirect,t.transparent=void 0===e.transparent||e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),this.cacheEnabled=t.cacheEnabled,t._cache=t.cacheEnabled,this.origin&&(t.origin=JSON.stringify({x:this.origin[0],y:this.origin[1]})),e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(t.layersID=e.layersID.toString()),e.clipRegion instanceof Vo()&&(e.clipRegionEnabled=!0,e.clipRegion=$o.toSuperMapGeometry((new(Dl())).writeGeometryObject(e.clipRegion)),e.clipRegion=te.toJSON(Me.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion)),e.overlapDisplayed?t.overlapDisplayed=!0:(t.overlapDisplayed=!1,e.overlapDisplayedOptions&&(t.overlapDisplayedOptions=this.overlapDisplayedOptions.toString())),t.cacheEnabled&&e.tileversion&&(t.tileversion=e.tileversion.toString()),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),t}.call(this),this._layerUrl=te.urlAppend(r,te.getParameterString(this.requestParams)),this._layerUrl=Ve.appendCredential(this._layerUrl),this._layerUrl}}setTileSetsInfo(e){this.tileSets=e,$o.isArray(this.tileSets)&&(this.tileSets=e[0]),this.tileSets&&(this.dispatchEvent({type:"tilesetsinfoloaded",value:{tileVersions:this.tileSets.tileVersions}}),this.changeTilesVersion())}lastTilesVersion(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()}nextTilesVersion(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()}changeTilesVersion(){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 r=t[e.tempIndex].name;e.mergeTileVersionParam(r)&&(e.tileSetsIndex=e.tempIndex,e.dispatchEvent({type:"tileversionschanged",value:{tileVersion:t[e.tempIndex]}}))}}}updateCurrentTileSetsIndex(e){this.tempIndex=e}mergeTileVersionParam(e){return!!e&&(this.requestParams.tileversion=e,this._paramsChanged=!0,this.refresh(),!0)}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var i=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top];const{visibleScales:s,bounds:n,dpi:a,coordUnit:o}=t;var l=$o.scalesToResolutions(s,n,a,o);return r.tileGrid=new(Pl())({extent:i,resolutions:l}),r}static createTileGrid(e,t,r,i,s){var n=Xl.createXYZ({extent:e,maxZoom:t,minZoom:r,tileSize:i});return new(Pl())({extent:e,minZoom:r,origin:s,resolutions:n.getResolutions(),tileSize:n.getTileSize()})}}var Zl=1,Kl=2,$l=3,eh=4,th=5,rh=6378137,ih=6356752.314,sh=.0066943799901413165,nh=484813681109536e-20,ah=Math.PI/2,oh=.16666666666666666,lh=.04722222222222222,hh=.022156084656084655,uh=1e-10,ch=.017453292519943295,dh=57.29577951308232,ph=Math.PI/4,fh=2*Math.PI,yh=3.14159265359,mh={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};const gh={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var vh=/[\s_\-\/\(\)]/g;function bh(e,t){if(e[t])return e[t];for(var r,i=Object.keys(e),s=t.toLowerCase().replace(vh,""),n=-1;++n<i.length;)if((r=i[n]).toLowerCase().replace(vh,"")===s)return e[r]}function Sh(e){var t,r,i,s={},n=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var r=t.split("=");return r.push(!0),e[r[0].toLowerCase()]=r[1],e},{}),a={proj:"projName",datum:"datumCode",rf:function(e){s.rf=parseFloat(e)},lat_0:function(e){s.lat0=e*ch},lat_1:function(e){s.lat1=e*ch},lat_2:function(e){s.lat2=e*ch},lat_ts:function(e){s.lat_ts=e*ch},lon_0:function(e){s.long0=e*ch},lon_1:function(e){s.long1=e*ch},lon_2:function(e){s.long2=e*ch},alpha:function(e){s.alpha=parseFloat(e)*ch},gamma:function(e){s.rectified_grid_angle=parseFloat(e)},lonc:function(e){s.longc=e*ch},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=bh(gh,e);t&&(s.to_meter=t.to_meter)},from_greenwich:function(e){s.from_greenwich=e*ch},pm:function(e){var t=bh(mh,e);s.from_greenwich=(t||parseFloat(e))*ch},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)r=n[t],t in a?"function"==typeof(i=a[t])?i(r):s[i]=r:s[t]=r;return"string"==typeof s.datumCode&&"WGS84"!==s.datumCode&&(s.datumCode=s.datumCode.toLowerCase()),s}const xh=function(e){return new Eh(e).output()};var _h=1,wh=/\s/,Ch=/[A-Za-z]/,Ah=/[A-Za-z84_]/,Mh=/[,\]]/,Th=/[\d\.E\-\+]/;function Eh(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=_h}function Oh(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var i=t?{}:e,s=r.reduce(function(e,t){return Ph(t,e),e},i);t&&(e[t]=s)}function Ph(e,t){if(Array.isArray(e)){var r=e.shift();if("PARAMETER"===r&&(r=e.shift()),1===e.length)return Array.isArray(e[0])?(t[r]={},void Ph(e[0],t[r])):void(t[r]=e[0]);if(e.length)if("TOWGS84"!==r){if("AXIS"===r)return r in t||(t[r]=[]),void t[r].push(e);var i;switch(Array.isArray(r)||(t[r]={}),r){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[r]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&Ph(e[2],t[r]));case"SPHEROID":case"ELLIPSOID":return t[r]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&Ph(e[3],t[r]));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 Oh(t,r,e);default:for(i=-1;++i<e.length;)if(!Array.isArray(e[i]))return Ph(e,t[r]);return Oh(t,r,e)}}else t[r]=e;else t[r]=!0}else t[e]=!0}Eh.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;wh.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case _h: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}},Eh.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(Mh.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)},Eh.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=_h)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=_h,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Eh.prototype.number=function(e){if(!Th.test(e)){if(Mh.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},Eh.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},Eh.prototype.keyword=function(e){if(Ah.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=_h)}if(!Mh.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},Eh.prototype.neutral=function(e){if(Ch.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(Th.test(e))return this.word=e,void(this.state=3);if(!Mh.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},Eh.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 Ih=.017453292519943295;function Nh(e){return e*Ih}function Lh(e){var t=xh(e),r=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",r]);var s={};return Ph(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="",r=0,i=e.AXIS.length;r<i;++r){var s=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][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){return t*(e.to_meter||1)}"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",Nh],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Nh],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",Nh],["lat0","latitude_of_origin",Nh],["lat0","standard_parallel_1",Nh],["lat1","standard_parallel_1",Nh],["lat2","standard_parallel_2",Nh],["azimuth","Azimuth"],["alpha","azimuth",Nh],["srsCode","name"]].forEach(function(t){return r=e,s=(i=t)[0],n=i[1],void(!(s in r)&&n in r&&(r[s]=r[n],3===i.length&&(r[s]=i[2](r[s]))));var r,i,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.lat_ts&&e.lat0&&"Polar_Stereographic"===e.projName&&(e.lat_ts=e.lat0,e.lat0=Nh(e.lat0>0?90:-90)):(e.lat0=Nh(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(s),s}function kh(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?kh[e]=Sh(arguments[1]):kh[e]=Lh(arguments[1]):kh[e]=r}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?kh.apply(t,e):kh(e)});if("string"==typeof e){if(e in kh)return kh[e]}else"EPSG"in e?kh["EPSG:"+e.EPSG]=e:"ESRI"in e?kh["ESRI:"+e.ESRI]=e:"IAU2000"in e?kh["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"]}(kh);const Fh=kh;var Rh=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var Dh=["3857","900913","3785","102113"];const Gh=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in Fh}(e))return Fh[e];if(function(e){return Rh.some(function(t){return e.indexOf(t)>-1})}(e)){var t=Lh(e);if(function(e){var t=bh(e,"authority");if(t){var r=bh(t,"epsg");return r&&Dh.indexOf(r)>-1}}(t))return Fh["EPSG:3857"];var r=function(e){var t=bh(e,"extension");if(t)return bh(t,"proj4")}(t);return r?Sh(r):t}return function(e){return"+"===e[0]}(e)?Sh(e):void 0};function jh(e,t){var r,i;if(e=e||{},!t)return e;for(i in t)void 0!==(r=t[i])&&(e[i]=r);return e}function Bh(e,t,r){var i=e*t;return r/Math.sqrt(1-i*i)}function Uh(e){return e<0?-1:1}function Vh(e){return Math.abs(e)<=yh?e:e-Uh(e)*fh}function Jh(e,t,r){var i=e*r,s=.5*e;return i=Math.pow((1-i)/(1+i),s),Math.tan(.5*(ah-t))/i}function zh(e,t){for(var r,i,s=.5*e,n=ah-2*Math.atan(t),a=0;a<=15;a++)if(r=e*Math.sin(n),n+=i=ah-2*Math.atan(t*Math.pow((1-r)/(1+r),s))-n,Math.abs(i)<=1e-10)return n;return-9999}function qh(e){return e}var Hh=[{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=Bh(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,r,i=e.x,s=e.y;if(s*dh>90&&s*dh<-90&&i*dh>180&&i*dh<-180)return null;if(Math.abs(Math.abs(s)-ah)<=uh)return null;if(this.sphere)t=this.x0+this.a*this.k0*Vh(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(ph+.5*s));else{var n=Math.sin(s),a=Jh(this.e,s,n);t=this.x0+this.a*this.k0*Vh(i-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,i=e.x-this.x0,s=e.y-this.y0;if(this.sphere)r=ah-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var n=Math.exp(-s/(this.a*this.k0));if(-9999===(r=zh(this.e,n)))return null}return t=Vh(this.long0+i/(this.a*this.k0)),e.x=t,e.y=r,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:qh,inverse:qh,names:["longlat","identity"]}],Wh={},Yh=[];function Xh(e,t){var r=Yh.length;return e.names?(Yh[r]=e,e.names.forEach(function(e){Wh[e.toLowerCase()]=r}),this):(console.log(t),!0)}const Qh={start:function(){Hh.forEach(Xh)},add:Xh,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==Wh[t]&&Yh[Wh[t]]?Yh[Wh[t]]:void 0}};var Zh={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"}},Kh=Zh.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Zh.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var $h={};$h.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},$h.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},$h.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},$h.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},$h.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},$h.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},$h.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},$h.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},$h.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},$h.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},$h.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},$h.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},$h.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},$h.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},$h.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},$h.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},$h.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};const eu=function(e,t,r,i,s,n,a){var o={};return o.datum_type=void 0===e||"none"===e?th:eh,t&&(o.datum_params=t.map(parseFloat),0===o.datum_params[0]&&0===o.datum_params[1]&&0===o.datum_params[2]||(o.datum_type=Zl),o.datum_params.length>3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=Kl,o.datum_params[3]*=nh,o.datum_params[4]*=nh,o.datum_params[5]*=nh,o.datum_params[6]=o.datum_params[6]/1e6+1))),a&&(o.datum_type=$l,o.grids=a),o.a=r,o.b=i,o.es=s,o.ep2=n,o};var tu={};function ru(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:tu[e]||null,isNull:!1}}function iu(e){return e/3600*Math.PI/180}function su(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function nu(e){return e.map(function(e){return[iu(e.longitudeShift),iu(e.latitudeShift)]})}function au(e,t,r){return{name:su(e,t+8,t+16).trim(),parent:su(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function ou(e,t,r,i){for(var s=t+176,n=[],a=0;a<r.gridNodeCount;a++){var o={latitudeShift:e.getFloat32(s+16*a,i),longitudeShift:e.getFloat32(s+16*a+4,i),latitudeAccuracy:e.getFloat32(s+16*a+8,i),longitudeAccuracy:e.getFloat32(s+16*a+12,i)};n.push(o)}return n}function lu(e,t){if(!(this instanceof lu))return new lu(e);t=t||function(e){if(e)throw e};var r=Gh(e);if("object"==typeof r){var i=lu.projections.get(r.projName);if(i){if(r.datumCode&&"none"!==r.datumCode){var s=bh($h,r.datumCode);s&&(r.datum_params=r.datum_params||(s.towgs84?s.towgs84.split(","):null),r.ellps=s.ellipse,r.datumName=s.datumName?s.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var n,a,o,l,h,u,c,d=function(e,t,r,i,s){if(!e){var n=bh(Zh,i);n||(n=Kh),e=n.a,t=n.b,r=n.rf}return r&&!t&&(t=(1-1/r)*e),(0===r||Math.abs(e-t)<uh)&&(s=!0,t=e),{a:e,b:t,rf:r,sphere:s}}(r.a,r.b,r.rf,r.ellps,r.sphere),p=(n=d.a,a=d.b,d.rf,o=r.R_A,u=((l=n*n)-(h=a*a))/l,c=0,o?(l=(n*=1-u*(oh+u*(lh+u*hh)))*n,u=0):c=Math.sqrt(u),{es:u,e:c,ep2:(l-h)/h}),f=function(e){return void 0===e?null:e.split(",").map(ru)}(r.nadgrids),y=r.datum||eu(r.datumCode,r.datum_params,d.a,d.b,p.es,p.ep2,f);jh(this,r),jh(this,i),this.a=d.a,this.b=d.b,this.rf=d.rf,this.sphere=d.sphere,this.es=p.es,this.e=p.e,this.ep2=p.ep2,this.datum=y,this.init(),t(null,this)}else t(e)}else t(e)}lu.projections=Qh,lu.projections.start();const hu=lu;function uu(e,t,r){var i,s,n,a,o=e.x,l=e.y,h=e.z?e.z:0;if(l<-ah&&l>-1.001*ah)l=-ah;else if(l>ah&&l<1.001*ah)l=ah;else{if(l<-ah)return{x:-1/0,y:-1/0,z:e.z};if(l>ah)return{x:1/0,y:1/0,z:e.z}}return o>Math.PI&&(o-=2*Math.PI),s=Math.sin(l),a=Math.cos(l),n=s*s,{x:((i=r/Math.sqrt(1-t*n))+h)*a*Math.cos(o),y:(i+h)*a*Math.sin(o),z:(i*(1-t)+h)*s}}function cu(e,t,r,i){var s,n,a,o,l,h,u,c,d,p,f,y,m,g,v,b=e.x,S=e.y,x=e.z?e.z:0;if(s=Math.sqrt(b*b+S*S),n=Math.sqrt(b*b+S*S+x*x),s/r<1e-12){if(g=0,n/r<1e-12)return ah,v=-i,{x:e.x,y:e.y,z:e.z}}else g=Math.atan2(S,b);a=x/n,c=(o=s/n)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*o*o)),d=a*l,m=0;do{m++,h=t*(u=r/Math.sqrt(1-t*d*d))/(u+(v=s*c+x*d-u*(1-t*d*d))),y=(f=a*(l=1/Math.sqrt(1-h*(2-h)*o*o)))*c-(p=o*(1-h)*l)*d,c=p,d=f}while(y*y>1e-24&&m<30);return{x:g,y:Math.atan(f/Math.abs(p)),z:v}}function du(e){return e===Zl||e===Kl}function pu(e,t,r){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===Zl?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==Kl||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return r;if(e.datum_type===th||t.datum_type===th)return r;var i=e.a,s=e.es;if(e.datum_type===$l){if(0!==fu(e,!1,r))return;i=rh,s=sh}var n=t.a,a=t.b,o=t.es;if(t.datum_type===$l&&(n=rh,a=ih,o=sh),s===o&&i===n&&!du(e.datum_type)&&!du(t.datum_type))return r;if((r=uu(r,s,i),du(e.datum_type)&&(r=function(e,t,r){if(t===Zl)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===Kl){var i=r[0],s=r[1],n=r[2],a=r[3],o=r[4],l=r[5],h=r[6];return{x:h*(e.x-l*e.y+o*e.z)+i,y:h*(l*e.x+e.y-a*e.z)+s,z:h*(-o*e.x+a*e.y+e.z)+n}}}(r,e.datum_type,e.datum_params)),du(t.datum_type)&&(r=function(e,t,r){if(t===Zl)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===Kl){var i=r[0],s=r[1],n=r[2],a=r[3],o=r[4],l=r[5],h=r[6],u=(e.x-i)/h,c=(e.y-s)/h,d=(e.z-n)/h;return{x:u+l*c-o*d,y:-l*u+c+a*d,z:o*u-a*c+d}}}(r,t.datum_type,t.datum_params)),r=cu(r,o,n,a),t.datum_type===$l)&&0!==fu(t,!0,r))return;return r}function fu(e,t,r){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var i={x:-r.x,y:r.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=i;break}if(o.mandatory,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,d=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,p=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(c>i.y||u>i.x||p<i.y||d<i.x||(s=yu(i,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 '"+-i.x*dh+" "+i.y*dh+" tried: '"+n+"'"),-1):(r.x=-s.x,r.y=s.y,0)}function yu(e,t,r){var i={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return i;var s={x:e.x,y:e.y};s.x-=r.ll[0],s.y-=r.ll[1],s.x=Vh(s.x-Math.PI)+Math.PI;var n=mu(s,r);if(t){if(isNaN(n.x))return i;n.x=s.x-n.x,n.y=s.y-n.y;var a,o,l=9;do{if(o=mu(n,r),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."),i;i.x=Vh(n.x+r.ll[0]),i.y=n.y+r.ll[1]}else isNaN(n.x)||(i.x=e.x+n.x,i.y=e.y+n.y);return i}function mu(e,t){var r,i={x:e.x/t.del[0],y:e.y/t.del[1]},s=Math.floor(i.x),n=Math.floor(i.y),a=i.x-1*s,o=i.y-1*n,l={x:Number.NaN,y:Number.NaN};if(s<0||s>=t.lim[0])return l;if(n<0||n>=t.lim[1])return l;r=n*t.lim[0]+s;var h=t.cvs[r][0],u=t.cvs[r][1];r++;var c=t.cvs[r][0],d=t.cvs[r][1];r+=t.lim[0];var p=t.cvs[r][0],f=t.cvs[r][1];r--;var y=t.cvs[r][0],m=t.cvs[r][1],g=a*o,v=a*(1-o),b=(1-a)*(1-o),S=(1-a)*o;return l.x=b*h+v*c+S*y+g*p,l.y=b*u+v*d+S*m+g*f,l}function gu(e,t,r){var i,s,n,a=r.x,o=r.y,l=r.z||0,h={};for(n=0;n<3;n++)if(!t||2!==n||void 0!==r.z)switch(0===n?(i=a,s=-1!=="ew".indexOf(e.axis[n])?"x":"y"):1===n?(i=o,s=-1!=="ns".indexOf(e.axis[n])?"y":"x"):(i=l,s="z"),e.axis[n]){case"e":h[s]=i;break;case"w":h[s]=-i;break;case"n":h[s]=i;break;case"s":h[s]=-i;break;case"u":void 0!==r[s]&&(h.z=i);break;case"d":void 0!==r[s]&&(h.z=-i);break;default:return null}return h}function vu(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}function bu(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 Su(e,t,r,i){var s,n=void 0!==(r=Array.isArray(r)?vu(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(e){bu(e.x),bu(e.y)}(r),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===Zl||e.datum.datum_type===Kl||e.datum.datum_type===$l)&&"WGS84"!==t.datumCode||(t.datum.datum_type===Zl||t.datum.datum_type===Kl||t.datum.datum_type===$l)&&"WGS84"!==e.datumCode}(e,t)&&(r=Su(e,s=new hu("WGS84"),r,i),e=s),i&&"enu"!==e.axis&&(r=gu(e,!1,r)),"longlat"===e.projName)r={x:r.x*ch,y:r.y*ch,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),!(r=e.inverse(r)))return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=pu(e.datum,t.datum,r))return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),"longlat"===t.projName?r={x:r.x*dh,y:r.y*dh,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),i&&"enu"!==t.axis?gu(t,!0,r):(n||delete r.z,r)}var xu=hu("WGS84");function _u(e,t,r,i){var s,n,a;return Array.isArray(r)?(s=Su(e,t,r,i)||{x:NaN,y:NaN},r.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(r.splice(3)):[s.x,s.y,r[2]].concat(r.splice(3)):[s.x,s.y].concat(r.splice(2)):[s.x,s.y]):(n=Su(e,t,r,i),2===(a=Object.keys(r)).length?n:(a.forEach(function(i){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;n[i]=r[i]}),n))}function wu(e){return e instanceof hu?e:e.oProj?e.oProj:hu(e)}const Cu=function(e,t,r){e=wu(e);var i,s=!1;return void 0===t?(t=e,e=xu,s=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,t=e,e=xu,s=!0),t=wu(t),r?_u(e,t,r):(i={forward:function(r,i){return _u(e,t,r,i)},inverse:function(r,i){return _u(t,e,r,i)}},s&&(i.oProj=t),i)};var Au=6,Mu="AJSAJS",Tu="AFAFAF",Eu=65,Ou=73,Pu=79,Iu=86,Nu=90;const Lu={forward:ku,inverse:function(e){var t=Gu(Bu(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:Fu};function ku(e,t){return t=t||5,function(e,t){var r="00000"+e.easting,i="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(p=e.easting,f=e.northing,y=e.zoneNumber,m=ju(y),g=Math.floor(p/1e5),v=Math.floor(f/1e5)%20,s=g,n=v,a=m,o=a-1,l=Mu.charCodeAt(o),h=Tu.charCodeAt(o),u=l+s-1,c=h+n,d=!1,u>Nu&&(u=u-Nu+Eu-1,d=!0),(u===Ou||l<Ou&&u>Ou||(u>Ou||l<Ou)&&d)&&u++,(u===Pu||l<Pu&&u>Pu||(u>Pu||l<Pu)&&d)&&++u===Ou&&u++,u>Nu&&(u=u-Nu+Eu-1),c>Iu?(c=c-Iu+Eu-1,d=!0):d=!1,(c===Ou||h<Ou&&c>Ou||(c>Ou||h<Ou)&&d)&&c++,(c===Pu||h<Pu&&c>Pu||(c>Pu||h<Pu)&&d)&&++c===Ou&&c++,c>Iu&&(c=c-Iu+Eu-1),String.fromCharCode(u)+String.fromCharCode(c))+r.substr(r.length-5,t)+i.substr(i.length-5,t);var s,n,a,o,l,h,u,c,d;var p,f,y,m,g,v}(function(e){var t,r,i,s,n,a,o,l=e.lat,h=e.lon,u=6378137,c=Ru(l),d=Ru(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=Ru(6*(o-1)-180+3),.006739496752268451,t=u/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),r=Math.tan(c)*Math.tan(c),i=.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=.9996*t*(s+(1-r+i)*s*s*s/6+(5-18*r+r*r+72*i-.39089081163157013)*s*s*s*s*s/120)+5e5,f=.9996*(n+t*Math.tan(c)*(s*s/2+(5-r+9*i+4*i*i)*s*s*s*s/24+(61-58*r+r*r+600*i-2.2240339282485886)*s*s*s*s*s*s/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(p),zoneNumber:o,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(l)}}({lat:e[1],lon:e[0]}),t)}function Fu(e){var t=Gu(Bu(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Ru(e){return e*(Math.PI/180)}function Du(e){return e/Math.PI*180}function Gu(e){var t=e.northing,r=e.easting,i=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)),y=r-5e5,m=t;i<"N"&&(m-=1e7),u=6*(s-1)-180+3,d=(c=m/.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=y/(.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=Du(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+Du(b),e.accuracy){var S=Gu({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:S.lat,right:S.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function ju(e){var t=e%Au;return 0===t&&(t=Au),t}function Bu(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,i=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>r)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;i=e.substring(n,n+=2);for(var l=ju(a),h=function(e,t){var r=Mu.charCodeAt(t-1),i=1e5,s=!1;for(;r!==e.charCodeAt(0);){if(++r===Ou&&r++,r===Pu&&r++,r>Nu){if(s)throw"Bad character: "+e;r=Eu,s=!0}i+=1e5}return i}(i.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var r=Tu.charCodeAt(t-1),i=0,s=!1;for(;r!==e.charCodeAt(0);){if(++r===Ou&&r++,r===Pu&&r++,r>Iu){if(s)throw"Bad character: "+e;r=Eu,s=!0}i+=1e5}return i}(i.charAt(1),l);u<Uu(o);)u+=2e6;var c=r-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,y=c/2,m=0,g=0;return y>0&&(d=1e5/Math.pow(10,y),p=e.substring(n,n+y),m=parseFloat(p)*d,f=e.substring(n+y),g=parseFloat(f)*d),{easting:m+h,northing:g+u,zoneLetter:o,zoneNumber:a,accuracy:d}}function Uu(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 Vu(e,t,r){if(!(this instanceof Vu))return new Vu(e,t,r);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 i=e.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Vu.fromMGRS=function(e){return new Vu(Fu(e))},Vu.prototype.toMGRS=function(e){return ku([this.x,this.y],e)};const Ju=Vu;var zu=1,qu=.25,Hu=.046875,Wu=.01953125,Yu=.01068115234375,Xu=.75,Qu=.46875,Zu=.013020833333333334,Ku=.007120768229166667,$u=.3645833333333333,ec=.005696614583333333,tc=.3076171875;function rc(e){var t=[];t[0]=zu-e*(qu+e*(Hu+e*(Wu+e*Yu))),t[1]=e*(Xu-e*(Hu+e*(Wu+e*Yu)));var r=e*e;return t[2]=r*(Qu-e*(Zu+e*Ku)),r*=e,t[3]=r*($u-e*ec),t[4]=r*e*tc,t}function ic(e,t,r,i){return r*=t,t*=t,i[0]*e-r*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}var sc=20;function nc(e,t,r){for(var i=1/(1-t),s=e,n=sc;n;--n){var a=Math.sin(s),o=1-t*a*a;if(s-=o=(ic(s,a,Math.cos(s),r)-e)*(o*Math.sqrt(o))*i,Math.abs(o)<uh)return s}return s}const ac={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=rc(this.es),this.ml0=ic(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,r,i,s=e.x,n=e.y,a=Vh(s-this.long0),o=Math.sin(n),l=Math.cos(n);if(this.es){var h=l*a,u=Math.pow(h,2),c=this.ep2*Math.pow(l,2),d=Math.pow(c,2),p=Math.abs(l)>uh?Math.tan(n):0,f=Math.pow(p,2),y=Math.pow(f,2);t=1-this.es*Math.pow(o,2),h/=Math.sqrt(t);var m=ic(n,o,l,this.en);r=this.a*(this.k0*h*(1+u/6*(1-f+c+u/20*(5-18*f+y+14*c-58*f*c+u/42*(61+179*y-y*f-479*f)))))+this.x0,i=this.a*(this.k0*(m-this.ml0+o*a*h/2*(1+u/12*(5-f+9*c+4*d+u/30*(61+y-58*f+270*c-330*f*c+u/56*(1385+543*y-y*f-3111*f))))))+this.y0}else{var g=l*Math.sin(a);if(Math.abs(Math.abs(g)-1)<uh)return 93;if(r=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,i=l*Math.cos(a)/Math.sqrt(1-Math.pow(g,2)),(g=Math.abs(i))>=1){if(g-1>uh)return 93;i=0}else i=Math.acos(i);n<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return e.x=r,e.y=i,e},inverse:function(e){var t,r,i,s,n=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(r=nc(t=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)<ah){var o=Math.sin(r),l=Math.cos(r),h=Math.abs(l)>uh?Math.tan(r):0,u=this.ep2*Math.pow(l,2),c=Math.pow(u,2),d=Math.pow(h,2),p=Math.pow(d,2);t=1-this.es*Math.pow(o,2);var f=n*Math.sqrt(t)/this.k0,y=Math.pow(f,2);i=r-(t*=h)*y/(1-this.es)*.5*(1-y/12*(5+3*d-9*u*d+u-4*c-y/30*(61+90*d-252*u*d+45*p+46*u-y/56*(1385+3633*d+4095*p+1574*p*d)))),s=Vh(this.long0+f*(1-y/6*(1+2*d+u-y/20*(5+28*d+24*p+8*u*d+6*u-y/42*(61+662*d+1320*p+720*p*d))))/l)}else i=ah*Uh(a),s=0;else{var m=Math.exp(n/this.k0),g=.5*(m-1/m),v=this.lat0+a/this.k0,b=Math.cos(v);t=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(g,2))),i=Math.asin(t),a<0&&(i=-i),s=0===g&&0===b?0:Vh(Math.atan2(g,b)+this.long0)}return e.x=s,e.y=i,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function oc(e){var t=Math.exp(e);return t=(t-1/t)/2}function lc(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),i=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function hc(e){var t=Math.abs(e);return t=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}(t*(1+t/(lc(1,t)+1))),e<0?-t:t}function uc(e,t){for(var r,i=2*Math.cos(2*t),s=e.length-1,n=e[s],a=0;--s>=0;)r=i*n-a+e[s],a=n,n=r;return t+r*Math.sin(2*t)}function cc(e,t,r){for(var i,s,n=Math.sin(t),a=Math.cos(t),o=oc(r),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(r),h=2*a*l,u=-2*n*o,c=e.length-1,d=e[c],p=0,f=0,y=0;--c>=0;)i=f,s=p,d=h*(f=d)-i-u*(p=y)+e[c],y=u*f-s+h*p;return[(h=n*l)*d-(u=a*o)*y,h*y+u*d]}const dc={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&&(ac.init.apply(this),this.forward=ac.forward,this.inverse=ac.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),r=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),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r*=t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r*=t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(.25+r*(1/64+r/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]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),r*=t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r*=t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var i=uc(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(e,t){for(var r,i=2*Math.cos(t),s=e.length-1,n=e[s],a=0;--s>=0;)r=i*n-a+e[s],a=n,n=r;return Math.sin(t)*r}(this.gtu,2*i))},forward:function(e){var t=Vh(e.x-this.long0),r=e.y;r=uc(this.cbg,r);var i=Math.sin(r),s=Math.cos(r),n=Math.sin(t),a=Math.cos(t);r=Math.atan2(i,a*s),t=Math.atan2(n*s,lc(i,s*a)),t=hc(Math.tan(t));var o,l,h=cc(this.gtu,2*r,2*t);return r+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(o=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(o=1/0,l=1/0),e.x=o,e.y=l,e},inverse:function(e){var t,r,i=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(s=(s-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var n=cc(this.utg,2*s,2*i);s+=n[0],i+=n[1],i=Math.atan(oc(i));var a=Math.sin(s),o=Math.cos(s),l=Math.sin(i),h=Math.cos(i);s=Math.atan2(a*h,lc(l,h*o)),t=Vh((i=Math.atan2(l,h*o))+this.long0),r=uc(this.cgb,s)}else t=1/0,r=1/0;return e.x=t,e.y=r,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};const pc={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(Vh(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*ch,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,dc.init.apply(this),this.forward=dc.forward,this.inverse=dc.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function fc(e,t){return Math.pow((1-e)/(1+e),t)}var yc=20;const mc={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+ph)/(Math.pow(Math.tan(.5*this.lat0+ph),this.C)*fc(this.e*e,this.ratexp))},forward:function(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+ph),this.C)*fc(this.e*Math.sin(r),this.ratexp))-ah,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,r=e.y,i=Math.pow(Math.tan(.5*r+ph)/this.K,1/this.C),s=yc;s>0&&(r=2*Math.atan(i*fc(this.e*Math.sin(e.y),-.5*this.e))-ah,!(Math.abs(r-e.y)<1e-14));--s)e.y=r;return s?(e.x=t,e.y=r,e):null},names:["gauss"]};const gc={init:function(){mc.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,r,i,s;return e.x=Vh(e.x-this.long0),mc.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),i=Math.cos(e.x),s=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*i),e.x=s*r*Math.sin(e.x),e.y=s*(this.cosc0*t-this.sinc0*r*i),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,r,i,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),r=Math.cos(a),s=Math.asin(r*this.sinc0+e.y*t*this.cosc0/n),i=Math.atan2(e.x*t,n*this.cosc0*r-e.y*this.sinc0*t)}else s=this.phic0,i=0;return e.x=i,e.y=s,mc.inverse.apply(this,[e]),e.x=Vh(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};const vc={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)<=uh&&(this.k0=.5*(1+Uh(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=uh&&(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)<=uh&&(this.k0=.5*this.cons*Bh(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Jh(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Bh(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-ah,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,r,i,s,n,a,o=e.x,l=e.y,h=Math.sin(l),u=Math.cos(l),c=Vh(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=uh&&Math.abs(l+this.lat0)<=uh?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*u*Math.cos(c)),e.x=this.a*t*u*Math.sin(c)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*u*Math.cos(c))+this.y0,e):(r=2*Math.atan(this.ssfn_(l,h,this.e))-ah,s=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=uh?(n=Jh(this.e,l*this.con,this.con*h),a=2*this.a*this.k0*n/this.cons,e.x=this.x0+a*Math.sin(o-this.long0),e.y=this.y0-this.con*a*Math.cos(o-this.long0),e):(Math.abs(this.sinlat0)<uh?(t=2*this.a*this.k0/(1+s*Math.cos(c)),e.y=t*i):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*s*Math.cos(c))),e.y=t*(this.cosX0*i-this.sinX0*s*Math.cos(c))+this.y0),e.x=t*s*Math.sin(c)+this.x0,e))},inverse:function(e){var t,r,i,s,n;e.x-=this.x0,e.y-=this.y0;var a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,r=this.lat0,a<=uh?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(o)*this.sinlat0+e.y*Math.sin(o)*this.coslat0/a),t=Math.abs(this.coslat0)<uh?this.lat0>0?Vh(this.long0+Math.atan2(e.x,-1*e.y)):Vh(this.long0+Math.atan2(e.x,e.y)):Vh(this.long0+Math.atan2(e.x*Math.sin(o),a*this.coslat0*Math.cos(o)-e.y*this.sinlat0*Math.sin(o))),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=uh){if(a<=uh)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,i=a*this.cons/(2*this.a*this.k0),r=this.con*zh(this.e,i),t=this.con*Vh(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else s=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=uh?n=this.X0:(n=Math.asin(Math.cos(s)*this.sinX0+e.y*Math.sin(s)*this.cosX0/a),t=Vh(this.long0+Math.atan2(e.x*Math.sin(s),a*this.cosX0*Math.cos(s)-e.y*this.sinX0*Math.sin(s)))),r=-1*zh(this.e,Math.tan(.5*(ah+n)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,r){return t*=r,Math.tan(.5*(ah+e))*Math.pow((1-t)/(1+t),.5*r)}};const bc={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,i=1/this.rf,s=2*i-Math.pow(i,2),n=this.e=Math.sqrt(s);this.R=this.k0*r*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)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),i=-this.alpha*(t+r)+this.K,s=2*(Math.atan(Math.exp(i))-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,r=e.y-this.y0,i=t/this.R,s=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-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"]};var Sc=1e-7;const xc={init:function(){var e,t,r,i,s,n,a,o,l,h,u,c,d,p=0,f=0,y=0,m=0,g=0,v=0,b=0;this.no_off=(d="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(d)),this.no_rot="no_rot"in this;var S=!1;"alpha"in this&&(S=!0);var x=!1;if("rectified_grid_angle"in this&&(x=!0),S&&(b=this.alpha),x&&(p=this.rectified_grid_angle*ch),S||x)f=this.longc;else if(y=this.long1,g=this.lat1,m=this.long2,v=this.lat2,Math.abs(g-v)<=Sc||(e=Math.abs(g))<=Sc||Math.abs(e-ah)<=Sc||Math.abs(Math.abs(this.lat0)-ah)<=Sc||Math.abs(Math.abs(v)-ah)<=Sc)throw new Error;var _=1-this.es;t=Math.sqrt(_),Math.abs(this.lat0)>uh?(o=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*o*o,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/_),this.A=this.B*this.k0*t/e,(s=(i=this.B*t/(r*Math.sqrt(e)))*i-1)<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=i,this.E*=Math.pow(Jh(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=s=1),S||x?(S?(u=Math.asin(Math.sin(b)/i),x||(p=b)):(u=p,b=Math.asin(i*Math.sin(u))),this.lam0=f-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(n=Math.pow(Jh(this.e,g,Math.sin(g)),this.B),a=Math.pow(Jh(this.e,v,Math.sin(v)),this.B),s=this.E/n,l=(a-n)/(a+n),h=((h=this.E*this.E)-a*n)/(h+a*n),(e=y-m)<-Math.pi?m-=fh:e>Math.pi&&(m+=fh),this.lam0=Vh(.5*(y+m)-Math.atan(h*Math.tan(.5*this.B*(y-m))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Vh(y-this.lam0))/(s-1/s)),p=b=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(ph-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ph+s))},forward:function(e){var t,r,i,s,n,a,o,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-ah)>uh){if(t=.5*((n=this.E/Math.pow(Jh(this.e,e.y,Math.sin(e.y)),this.B))-(a=1/n)),r=.5*(n+a),s=Math.sin(this.B*e.x),i=(t*this.singam-s*this.cosgam)/r,Math.abs(Math.abs(i)-1)<uh)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),a=Math.cos(this.B*e.x),o=Math.abs(a)<Sc?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+s*this.singam,a)}else l=e.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*e.y;return this.no_rot?(h.x=o,h.y=l):(o-=this.u_0,h.x=l*this.cosrot+o*this.sinrot,h.y=o*this.cosrot-l*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,r,i,s,n,a,o,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),s=.5*((i=Math.exp(-this.BrA*r))-1/i),n=.5*(i+1/i),o=((a=Math.sin(this.BrA*t))*this.cosgam+s*this.singam)/n,Math.abs(Math.abs(o)-1)<uh)l.x=0,l.y=o<0?-ah:ah;else{if(l.y=this.E/Math.sqrt((1+o)/(1-o)),l.y=zh(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(s*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},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"]};const _c={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)<uh)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),i=Bh(this.e,t,r),s=Jh(this.e,this.lat1,t),n=Math.sin(this.lat2),a=Math.cos(this.lat2),o=Bh(this.e,n,a),l=Jh(this.e,this.lat2,n),h=Jh(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>uh?this.ns=Math.log(i/o)/Math.log(s/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(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,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=uh&&(r=Uh(r)*(ah-2*uh));var i,s,n=Math.abs(Math.abs(r)-ah);if(n>uh)i=Jh(this.e,r,Math.sin(r)),s=this.a*this.f0*Math.pow(i,this.ns);else{if((n=r*this.ns)<=0)return null;s=0}var a=this.ns*Vh(t-this.long0);return e.x=this.k0*(s*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-s*Math.cos(a))+this.y0,e},inverse:function(e){var t,r,i,s,n,a=(e.x-this.x0)/this.k0,o=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),r=1):(t=-Math.sqrt(a*a+o*o),r=-1);var l=0;if(0!==t&&(l=Math.atan2(r*a,r*o)),0!==t||this.ns>0){if(r=1/this.ns,i=Math.pow(t/(this.a*this.f0),r),-9999===(s=zh(this.e,i)))return null}else s=-ah;return n=Vh(l/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)"]};const wc={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,r,i,s,n,a,o,l=e.x,h=e.y,u=Vh(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),i=-u*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/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,r,i,s,n,a,o,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),n=Math.sqrt(e.x*e.x+e.y*e.y),s=Math.atan2(e.y,e.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(s)),r=Math.asin(Math.cos(i)*Math.sin(s)/Math.cos(t)),e.x=this.long0-r/this.alfa,a=t,o=0;var h=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(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(o=1),a=e.y,h+=1}while(0===o&&h<15);return h>=15?null:e},names:["Krovak","krovak"]};function Cc(e,t,r,i,s){return e*s-t*Math.sin(2*s)+r*Math.sin(4*s)-i*Math.sin(6*s)}function Ac(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function Mc(e){return.375*e*(1+.25*e*(1+.46875*e))}function Tc(e){return.05859375*e*e*(1+.75*e)}function Ec(e){return e*e*e*(35/3072)}function Oc(e,t,r){var i=t*r;return e/Math.sqrt(1-i*i)}function Pc(e){return Math.abs(e)<ah?e:e-Uh(e)*Math.PI}function Ic(e,t,r,i,s){var n,a;n=e/t;for(var o=0;o<15;o++)if(n+=a=(e-(t*n-r*Math.sin(2*n)+i*Math.sin(4*n)-s*Math.sin(6*n)))/(t-2*r*Math.cos(2*n)+4*i*Math.cos(4*n)-6*s*Math.cos(6*n)),Math.abs(a)<=1e-10)return n;return NaN}const Nc={init:function(){this.sphere||(this.e0=Ac(this.es),this.e1=Mc(this.es),this.e2=Tc(this.es),this.e3=Ec(this.es),this.ml0=this.a*Cc(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,r,i=e.x,s=e.y;if(i=Vh(i-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(s)*Math.sin(i)),r=this.a*(Math.atan2(Math.tan(s),Math.cos(i))-this.lat0);else{var n=Math.sin(s),a=Math.cos(s),o=Oc(this.a,this.e,n),l=Math.tan(s)*Math.tan(s),h=i*Math.cos(s),u=h*h,c=this.es*a*a/(1-this.es);t=o*h*(1-u*l*(1/6-(8-l+8*c)*u/120)),r=this.a*Cc(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+o*n/a*u*(.5+(5-l+6*c)*u/24)}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,i=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(i)),r=Math.atan2(Math.tan(i),Math.cos(n))}else{var a=Ic(this.ml0/this.a+s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-ah)<=uh)return e.x=this.long0,e.y=ah,s<0&&(e.y*=-1),e;var o=Oc(this.a,this.e,Math.sin(a)),l=o*o*o/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(a),2),u=i*this.a/o,c=u*u;t=a-o*Math.tan(a)/l*u*u*(.5-(1+3*h)*u*u/24),r=u*(1-c*(h/3+(1+3*h)*h*c/15))/Math.cos(a)}return e.x=Vh(r+this.long0),e.y=Pc(t),e},names:["Cassini","Cassini_Soldner","cass"]};function Lc(e,t){var r;return e>1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t}var kc=.3333333333333333,Fc=.17222222222222222,Rc=.10257936507936508,Dc=.06388888888888888,Gc=.0664021164021164,jc=.016415012942191543;const Bc={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-ah)<uh?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<uh?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Lc(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=e*kc,t=e*e,r[0]+=t*Fc,r[1]=t*Dc,t*=e,r[0]+=t*Rc,r[1]+=t*Gc,r[2]=t*jc,r}(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=Lc(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,r,i,s,n,a,o,l,h,u,c=e.x,d=e.y;if(c=Vh(c-this.long0),this.sphere){if(n=Math.sin(d),u=Math.cos(d),i=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+u*i:1+this.sinph0*n+this.cosph0*u*i)<=uh)return null;t=(r=Math.sqrt(2/r))*u*Math.sin(c),r*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*u*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(d+this.lat0)<uh)return null;r=ph-.5*d,t=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(c),r*=i}}else{switch(o=0,l=0,h=0,i=Math.cos(c),s=Math.sin(c),n=Math.sin(d),a=Lc(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=a/this.qp,l=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:h=1+this.sinb1*o+this.cosb1*l*i;break;case this.EQUIT:h=1+l*i;break;case this.N_POLE:h=ah+d,a=this.qp-a;break;case this.S_POLE:h=d-ah,a=this.qp+a}if(Math.abs(h)<uh)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),r=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*o-this.sinb1*l*i):(h=Math.sqrt(2/(1+l*i)))*o*this.ymf,t=this.xmf*h*l*s;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(h=Math.sqrt(a))*s,r=i*(this.mode===this.S_POLE?h:-h)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,i,s,n,a,o,l,h,u,c=e.x/this.a,d=e.y/this.a;if(this.sphere){var p,f=0,y=0;if((r=.5*(p=Math.sqrt(c*c+d*d)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(r),f=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(p)<=uh?0:Math.asin(d*y/p),c*=y,d=f*p;break;case this.OBLIQ:r=Math.abs(p)<=uh?this.lat0:Math.asin(f*this.sinph0+d*y*this.cosph0/p),c*=y*this.cosph0,d=(f-Math.sin(r)*this.sinph0)*p;break;case this.N_POLE:d=-d,r=ah-r;break;case this.S_POLE:r-=ah}t=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,d):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,d*=this.dd,(a=Math.sqrt(c*c+d*d))<uh)return e.x=this.long0,e.y=this.lat0,e;s=2*Math.asin(.5*a/this.rq),i=Math.cos(s),c*=s=Math.sin(s),this.mode===this.OBLIQ?(o=i*this.sinb1+d*s*this.cosb1/a,n=this.qp*o,d=a*this.cosb1*i-d*this.sinb1*s):(o=d*s/a,n=this.qp*o,d=a*i)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(n=c*c+d*d))return e.x=this.long0,e.y=this.lat0,e;o=1-n/this.qp,this.mode===this.S_POLE&&(o=-o)}t=Math.atan2(c,d),l=Math.asin(o),h=this.apa,u=l+l,r=l+h[0]*Math.sin(u)+h[1]*Math.sin(u+u)+h[2]*Math.sin(u+u+u)}return e.x=Vh(this.long0+t),e.y=r,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Uc(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}const Vc={init:function(){Math.abs(this.lat1+this.lat2)<uh||(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=Bh(this.e3,this.sin_po,this.cos_po),this.qs1=Lc(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=Bh(this.e3,this.sin_po,this.cos_po),this.qs2=Lc(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=Lc(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>uh?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,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=Lc(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,n=this.ns0*Vh(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,r,i,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),i=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),i=-1),s=0,0!==t&&(s=Math.atan2(i*e.x,i*e.y)),i=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,a=this.phi1z(this.e3,r)),n=Vh(s/this.ns0+this.long0),e.x=n,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var r,i,s,n,a,o=Uc(.5*t);if(e<uh)return o;for(var l=e*e,h=1;h<=25;h++)if(r=Math.sin(o),i=Math.cos(o),o+=a=.5*(n=1-(s=e*r)*s)*n/i*(t/(1-l)-r/n+.5/e*Math.log((1-s)/(1+s))),Math.abs(a)<=1e-7)return o;return null}};const Jc={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,r,i,s,n,a,o,l=e.x,h=e.y;return i=Vh(l-this.long0),t=Math.sin(h),r=Math.cos(h),s=Math.cos(i),(n=this.sin_p14*t+this.cos_p14*r*s)>0||Math.abs(n)<=uh?(a=this.x0+1*this.a*r*Math.sin(i)/n,o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*s)/n):(a=this.x0+this.infinity_dist*r*Math.sin(i),o=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*s)),e.x=a,e.y=o,e},inverse:function(e){var t,r,i,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),r=Math.sin(s),a=Uc((i=Math.cos(s))*this.sin_p14+e.y*r*this.cos_p14/t),n=Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r),n=Vh(this.long0+n)):(a=this.phic0,n=0),e.x=n,e.y=a,e},names:["gnom"]};const zc={init:function(){this.sphere||(this.k0=Bh(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,r,i=e.x,s=e.y,n=Vh(i-this.long0);if(this.sphere)t=this.x0+this.a*n*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var a=Lc(this.e,Math.sin(s));t=this.x0+this.a*this.k0*n,r=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=r,e},inverse:function(e){var t,r;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=Vh(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=function(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*ah:ah;for(var i,s,n,a,o=Math.asin(.5*t),l=0;l<30;l++)if(s=Math.sin(o),n=Math.cos(o),a=e*s,o+=i=Math.pow(1-a*a,2)/(2*n)*(t/(1-e*e)-s/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(i)<=1e-10)return o;return NaN}(this.e,2*e.y*this.k0/this.a),t=Vh(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e},names:["cea"]};const qc={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,r=e.y,i=Vh(t-this.long0),s=Pc(r-this.lat0);return e.x=this.x0+this.a*i*this.rc,e.y=this.y0+this.a*s,e},inverse:function(e){var t=e.x,r=e.y;return e.x=Vh(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Pc(this.lat0+(r-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var Hc=20;const Wc={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ac(this.es),this.e1=Mc(this.es),this.e2=Tc(this.es),this.e3=Ec(this.es),this.ml0=this.a*Cc(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,r,i,s=e.x,n=e.y,a=Vh(s-this.long0);if(i=a*Math.sin(n),this.sphere)Math.abs(n)<=uh?(t=this.a*a,r=-1*this.a*this.lat0):(t=this.a*Math.sin(i)/Math.tan(n),r=this.a*(Pc(n-this.lat0)+(1-Math.cos(i))/Math.tan(n)));else if(Math.abs(n)<=uh)t=this.a*a,r=-1*this.ml0;else{var o=Oc(this.a,this.e,Math.sin(n))/Math.tan(n);t=o*Math.sin(i),r=this.a*Cc(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*(1-Math.cos(i))}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){var t,r,i,s,n,a,o,l,h;if(i=e.x-this.x0,s=e.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=uh)t=Vh(i/this.a+this.long0),r=0;else{var u;for(a=this.lat0+s/this.a,o=i*i/this.a/this.a+a*a,l=a,n=Hc;n;--n)if(l+=h=-1*(a*(l*(u=Math.tan(l))+1)-l-.5*(l*l+o)*u)/((l-a)/u-1),Math.abs(h)<=uh){r=l;break}t=Vh(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(s+this.ml0)<=uh)r=0,t=Vh(this.long0+i/this.a);else{var c,d,p,f,y;for(a=(this.ml0+s)/this.a,o=i*i/this.a/this.a+a*a,l=a,n=Hc;n;--n)if(y=this.e*Math.sin(l),c=Math.sqrt(1-y*y)*Math.tan(l),d=this.a*Cc(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(a*(c*(f=d/this.a)+1)-f-.5*c*(f*f+o))/(this.es*Math.sin(2*l)*(f*f+o-2*a*f)/(4*c)+(a-f)*(c*p-2/Math.sin(2*l))-p),Math.abs(h)<=uh){r=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=Vh(this.long0+Math.asin(i*c/this.a)/Math.sin(r))}return e.x=t,e.y=r,e},names:["Polyconic","poly"]};const Yc={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,r=e.x,i=e.y-this.lat0,s=r-this.long0,n=i/nh*1e-5,a=s,o=1,l=0;for(t=1;t<=10;t++)o*=n,l+=this.A[t]*o;var h,u=l,c=a,d=1,p=0,f=0,y=0;for(t=1;t<=6;t++)h=p*u+d*c,d=d*u-p*c,p=h,f=f+this.B_re[t]*d-this.B_im[t]*p,y=y+this.B_im[t]*d+this.B_re[t]*p;return e.x=y*this.a+this.x0,e.y=f*this.a+this.y0,e},inverse:function(e){var t,r,i=e.x,s=e.y,n=i-this.x0,a=(s-this.y0)/this.a,o=n/this.a,l=1,h=0,u=0,c=0;for(t=1;t<=6;t++)r=h*a+l*o,l=l*a-h*o,h=r,u=u+this.C_re[t]*l-this.C_im[t]*h,c=c+this.C_im[t]*l+this.C_re[t]*h;for(var d=0;d<this.iterations;d++){var p,f=u,y=c,m=a,g=o;for(t=2;t<=6;t++)p=y*u+f*c,f=f*u-y*c,y=p,m+=(t-1)*(this.B_re[t]*f-this.B_im[t]*y),g+=(t-1)*(this.B_im[t]*f+this.B_re[t]*y);f=1,y=0;var v=this.B_re[1],b=this.B_im[1];for(t=2;t<=6;t++)p=y*u+f*c,f=f*u-y*c,y=p,v+=t*(this.B_re[t]*f-this.B_im[t]*y),b+=t*(this.B_im[t]*f+this.B_re[t]*y);var S=v*v+b*b;u=(m*v+g*b)/S,c=(g*v-m*b)/S}var x=u,_=c,w=1,C=0;for(t=1;t<=9;t++)w*=x,C+=this.D[t]*w;var A=this.lat0+C*nh*1e5,M=this.long0+_;return e.x=M,e.y=A,e},names:["New_Zealand_Map_Grid","nzmg"]};const Xc={init:function(){},forward:function(e){var t=e.x,r=e.y,i=Vh(t-this.long0),s=this.x0+this.a*i,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/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=Vh(this.long0+e.x/this.a),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e},names:["Miller_Cylindrical","mill"]};var Qc=20;const Zc={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=rc(this.es)},forward:function(e){var t,r,i=e.x,s=e.y;if(i=Vh(i-this.long0),this.sphere){if(this.m)for(var n=this.n*Math.sin(s),a=Qc;a;--a){var o=(this.m*s+Math.sin(s)-n)/(this.m+Math.cos(s));if(s-=o,Math.abs(o)<uh)break}else s=1!==this.n?Math.asin(this.n*Math.sin(s)):s;t=this.a*this.C_x*i*(this.m+Math.cos(s)),r=this.a*this.C_y*s}else{var l=Math.sin(s),h=Math.cos(s);r=this.a*ic(s,l,h,this.en),t=this.a*i*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,i;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=Uc((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Uc(Math.sin(t)/this.n)),r=Vh(r+this.long0),t=Pc(t)):(t=nc(e.y/this.a,this.es,this.en),(i=Math.abs(t))<ah?(i=Math.sin(t),r=Vh(this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)))):i-uh<ah&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};const Kc={init:function(){},forward:function(e){for(var t=e.x,r=e.y,i=Vh(t-this.long0),s=r,n=Math.PI*Math.sin(r);;){var a=-(s+Math.sin(s)-n)/(1+Math.cos(s));if(s+=a,Math.abs(a)<uh)break}s/=2,Math.PI/2-Math.abs(r)<uh&&(i=0);var o=.900316316158*this.a*i*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,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var i=Vh(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var s=Math.asin(r);return e.x=i,e.y=s,e},names:["Mollweide","moll"]};const $c={init:function(){Math.abs(this.lat1+this.lat2)<uh||(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=Ac(this.es),this.e1=Mc(this.es),this.e2=Tc(this.es),this.e3=Ec(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Bh(this.e,this.sinphi,this.cosphi),this.ml1=Cc(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<uh?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Bh(this.e,this.sinphi,this.cosphi),this.ml2=Cc(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=Cc(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,r=e.x,i=e.y;if(this.sphere)t=this.a*(this.g-i);else{var s=Cc(this.e0,this.e1,this.e2,this.e3,i);t=this.a*(this.g-s)}var n=this.ns*Vh(r-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,r,i,s;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var n=0;return 0!==r&&(n=Math.atan2(t*e.x,t*e.y)),this.sphere?(s=Vh(this.long0+n/this.ns),i=Pc(this.g-r/this.a),e.x=s,e.y=i,e):(i=Ic(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),s=Vh(this.long0+n/this.ns),e.x=s,e.y=i,e)},names:["Equidistant_Conic","eqdc"]};const ed={init:function(){this.R=this.a},forward:function(e){var t,r,i=e.x,s=e.y,n=Vh(i-this.long0);Math.abs(s)<=uh&&(t=this.x0+this.R*n,r=this.y0);var a=Uc(2*Math.abs(s/Math.PI));(Math.abs(n)<=uh||Math.abs(Math.abs(s)-ah)<=uh)&&(t=this.x0,r=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/n-n/Math.PI),l=o*o,h=Math.sin(a),u=Math.cos(a),c=u/(h+u-1),d=c*c,p=c*(2/h-1),f=p*p,y=Math.PI*this.R*(o*(c-f)+Math.sqrt(l*(c-f)*(c-f)-(f+l)*(d-f)))/(f+l);n<0&&(y=-y),t=this.x0+y;var m=l+c;return y=Math.PI*this.R*(p*m-o*Math.sqrt((f+l)*(l+1)-m*m))/(f+l),r=s>=0?this.y0+y:this.y0-y,e.x=t,e.y=r,e},inverse:function(e){var t,r,i,s,n,a,o,l,h,u,c,d;return e.x-=this.x0,e.y-=this.y0,c=Math.PI*this.R,n=(i=e.x/c)*i+(s=e.y/c)*s,c=3*(s*s/(l=-2*(a=-Math.abs(s)*(1+n))+1+2*s*s+n*n)+(2*(o=a-2*s*s+i*i)*o*o/l/l/l-9*a*o/l/l)/27)/(h=(a-o*o/3/l)/l)/(u=2*Math.sqrt(-h/3)),Math.abs(c)>1&&(c=c>=0?1:-1),d=Math.acos(c)/3,r=e.y>=0?(-u*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI:-(-u*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI,t=Math.abs(i)<uh?this.long0:Vh(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(i*i-s*s)+n*n))/2/i),e.x=t,e.y=r,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};const td={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,r,i,s,n,a,o,l,h,u,c,d,p,f,y,m,g,v,b,S,x,_,w=e.x,C=e.y,A=Math.sin(e.y),M=Math.cos(e.y),T=Vh(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=uh?(e.x=this.x0+this.a*(ah-C)*Math.sin(T),e.y=this.y0-this.a*(ah-C)*Math.cos(T),e):Math.abs(this.sin_p12+1)<=uh?(e.x=this.x0+this.a*(ah+C)*Math.sin(T),e.y=this.y0+this.a*(ah+C)*Math.cos(T),e):(v=this.sin_p12*A+this.cos_p12*M*Math.cos(T),g=(m=Math.acos(v))?m/Math.sin(m):1,e.x=this.x0+this.a*g*M*Math.sin(T),e.y=this.y0+this.a*g*(this.cos_p12*A-this.sin_p12*M*Math.cos(T)),e):(t=Ac(this.es),r=Mc(this.es),i=Tc(this.es),s=Ec(this.es),Math.abs(this.sin_p12-1)<=uh?(n=this.a*Cc(t,r,i,s,ah),a=this.a*Cc(t,r,i,s,C),e.x=this.x0+(n-a)*Math.sin(T),e.y=this.y0-(n-a)*Math.cos(T),e):Math.abs(this.sin_p12+1)<=uh?(n=this.a*Cc(t,r,i,s,ah),a=this.a*Cc(t,r,i,s,C),e.x=this.x0+(n+a)*Math.sin(T),e.y=this.y0+(n+a)*Math.cos(T),e):(o=A/M,l=Oc(this.a,this.e,this.sin_p12),h=Oc(this.a,this.e,A),u=Math.atan((1-this.es)*o+this.es*l*this.sin_p12/(h*M)),b=0===(c=Math.atan2(Math.sin(T),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(T)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(c)-Math.PI)<=uh?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(T)*Math.cos(u)/Math.sin(c)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),m=l*b*(1-(S=b*b)*(y=(p=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*p)*(1-y)/6+(x=S*b)/8*(f=d*p)*(1-2*y)+(_=x*b)/120*(y*(4-7*y)-3*d*d*(1-7*y))-_*b/48*f),e.x=this.x0+m*Math.sin(c),e.y=this.y0+m*Math.cos(c),e))},inverse:function(e){var t,r,i,s,n,a,o,l,h,u,c,d,p,f,y,m,g,v,b,S,x,_,w;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*ah*this.a)return;return r=t/this.a,i=Math.sin(r),s=Math.cos(r),n=this.long0,Math.abs(t)<=uh?a=this.lat0:(a=Uc(s*this.sin_p12+e.y*i*this.cos_p12/t),o=Math.abs(this.lat0)-ah,n=Math.abs(o)<=uh?this.lat0>=0?Vh(this.long0+Math.atan2(e.x,-e.y)):Vh(this.long0-Math.atan2(-e.x,e.y)):Vh(this.long0+Math.atan2(e.x*i,t*this.cos_p12*s-e.y*this.sin_p12*i))),e.x=n,e.y=a,e}return l=Ac(this.es),h=Mc(this.es),u=Tc(this.es),c=Ec(this.es),Math.abs(this.sin_p12-1)<=uh?(a=Ic(((d=this.a*Cc(l,h,u,c,ah))-(t=Math.sqrt(e.x*e.x+e.y*e.y)))/this.a,l,h,u,c),n=Vh(this.long0+Math.atan2(e.x,-1*e.y)),e.x=n,e.y=a,e):Math.abs(this.sin_p12+1)<=uh?(d=this.a*Cc(l,h,u,c,ah),a=Ic(((t=Math.sqrt(e.x*e.x+e.y*e.y))-d)/this.a,l,h,u,c),n=Vh(this.long0+Math.atan2(e.x,e.y)),e.x=n,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),y=Math.atan2(e.x,e.y),p=Oc(this.a,this.e,this.sin_p12),m=Math.cos(y),v=-(g=this.e*this.cos_p12*m)*g/(1-this.es),b=3*this.es*(1-v)*this.sin_p12*this.cos_p12*m/(1-this.es),_=1-v*(x=(S=t/p)-v*(1+v)*Math.pow(S,3)/6-b*(1+3*v)*Math.pow(S,4)/24)*x/2-S*x*x*x/6,f=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*m),n=Vh(this.long0+Math.asin(Math.sin(y)*Math.sin(x)/Math.cos(f))),w=Math.sin(f),a=Math.atan2((w-this.es*_*this.sin_p12)*Math.tan(f),w*(1-this.es)),e.x=n,e.y=a,e)},names:["Azimuthal_Equidistant","aeqd"]};const rd={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,r,i,s,n,a,o,l=e.x,h=e.y;return i=Vh(l-this.long0),t=Math.sin(h),r=Math.cos(h),s=Math.cos(i),((n=this.sin_p14*t+this.cos_p14*r*s)>0||Math.abs(n)<=uh)&&(a=1*this.a*r*Math.sin(i),o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*s)),e.x=a,e.y=o,e},inverse:function(e){var t,r,i,s,n,a,o;return e.x-=this.x0,e.y-=this.y0,r=Uc((t=Math.sqrt(e.x*e.x+e.y*e.y))/this.a),i=Math.sin(r),s=Math.cos(r),a=this.long0,Math.abs(t)<=uh?(o=this.lat0,e.x=a,e.y=o,e):(o=Uc(s*this.sin_p14+e.y*i*this.cos_p14/t),n=Math.abs(this.lat0)-ah,Math.abs(n)<=uh?(a=this.lat0>=0?Vh(this.long0+Math.atan2(e.x,-e.y)):Vh(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=o,e):(a=Vh(this.long0+Math.atan2(e.x*i,t*this.cos_p14*s-e.y*this.sin_p14*i)),e.x=a,e.y=o,e))},names:["ortho"]};var id={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},sd={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function nd(e,t,r,i){var s;return e<uh?(i.value=sd.AREA_0,s=0):(s=Math.atan2(t,r),Math.abs(s)<=ph?i.value=sd.AREA_0:s>ph&&s<=ah+ph?(i.value=sd.AREA_1,s-=ah):s>ah+ph||s<=-(ah+ph)?(i.value=sd.AREA_2,s=s>=0?s-yh:s+yh):(i.value=sd.AREA_3,s+=ah)),s}function ad(e,t){var r=e+t;return r<-yh?r+=fh:r>+yh&&(r-=fh),r}const od={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>=ah-ph/2?this.face=id.TOP:this.lat0<=-(ah-ph/2)?this.face=id.BOTTOM:Math.abs(this.long0)<=ph?this.face=id.FRONT:Math.abs(this.long0)<=ah+ph?this.face=this.long0>0?id.RIGHT:id.LEFT:this.face=id.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,r,i,s,n,a,o={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,this.face===id.TOP)s=ah-t,r>=ph&&r<=ah+ph?(l.value=sd.AREA_0,i=r-ah):r>ah+ph||r<=-(ah+ph)?(l.value=sd.AREA_1,i=r>0?r-yh:r+yh):r>-(ah+ph)&&r<=-ph?(l.value=sd.AREA_2,i=r+ah):(l.value=sd.AREA_3,i=r);else if(this.face===id.BOTTOM)s=ah+t,r>=ph&&r<=ah+ph?(l.value=sd.AREA_0,i=-r+ah):r<ph&&r>=-ph?(l.value=sd.AREA_1,i=-r):r<-ph&&r>=-(ah+ph)?(l.value=sd.AREA_2,i=-r-ah):(l.value=sd.AREA_3,i=r>0?-r+yh:-r-yh);else{var h,u,c,d,p,f;this.face===id.RIGHT?r=ad(r,+ah):this.face===id.BACK?r=ad(r,+yh):this.face===id.LEFT&&(r=ad(r,-ah)),d=Math.sin(t),p=Math.cos(t),f=Math.sin(r),h=p*Math.cos(r),u=p*f,c=d,this.face===id.FRONT?i=nd(s=Math.acos(h),c,u,l):this.face===id.RIGHT?i=nd(s=Math.acos(u),c,-h,l):this.face===id.BACK?i=nd(s=Math.acos(-h),c,-u,l):this.face===id.LEFT?i=nd(s=Math.acos(-u),c,h,l):(s=i=0,l.value=sd.AREA_0)}return a=Math.atan(12/yh*(i+Math.acos(Math.sin(i)*Math.cos(ph))-ah)),n=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===sd.AREA_1?a+=ah:l.value===sd.AREA_2?a+=yh:l.value===sd.AREA_3&&(a+=1.5*yh),o.x=n*Math.cos(a),o.y=n*Math.sin(a),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,e.x=o.x,e.y=o.y,e},inverse:function(e){var t,r,i,s,n,a,o,l,h,u,c,d,p={lam:0,phi:0},f={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=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)?f.value=sd.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(f.value=sd.AREA_1,t-=ah):e.x<0&&-e.x>=Math.abs(e.y)?(f.value=sd.AREA_2,t=t<0?t+yh:t-yh):(f.value=sd.AREA_3,t+=ah),h=yh/12*Math.tan(t),n=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(n),(o=1-(i=Math.cos(t))*i*(s=Math.tan(r))*s*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?o=-1:o>1&&(o=1),this.face===id.TOP)l=Math.acos(o),p.phi=ah-l,f.value===sd.AREA_0?p.lam=a+ah:f.value===sd.AREA_1?p.lam=a<0?a+yh:a-yh:f.value===sd.AREA_2?p.lam=a-ah:p.lam=a;else if(this.face===id.BOTTOM)l=Math.acos(o),p.phi=l-ah,f.value===sd.AREA_0?p.lam=-a+ah:f.value===sd.AREA_1?p.lam=-a:f.value===sd.AREA_2?p.lam=-a-ah:p.lam=a<0?-a-yh:-a+yh;else{var y,m,g;h=(y=o)*y,m=(h+=(g=h>=1?0:Math.sqrt(1-h)*Math.sin(a))*g)>=1?0:Math.sqrt(1-h),f.value===sd.AREA_1?(h=m,m=-g,g=h):f.value===sd.AREA_2?(m=-m,g=-g):f.value===sd.AREA_3&&(h=m,m=g,g=-h),this.face===id.RIGHT?(h=y,y=-m,m=h):this.face===id.BACK?(y=-y,m=-m):this.face===id.LEFT&&(h=y,y=m,m=-h),p.phi=Math.acos(-g)-ah,p.lam=Math.atan2(m,y),this.face===id.RIGHT?p.lam=ad(p.lam,-ah):this.face===id.BACK?p.lam=ad(p.lam,-yh):this.face===id.LEFT&&(p.lam=ad(p.lam,+ah))}return 0!==this.es&&(u=p.phi<0?1:0,c=Math.tan(p.phi),d=this.b/Math.sqrt(c*c+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),u&&(p.phi=-p.phi)),p.lam+=this.long0,e.x=p.lam,e.y=p.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var ld=[[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]],hd=[[-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]],ud=.8487,cd=1.3523,dd=dh/5,pd=1/dd,fd=18,yd=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},md=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};const gd={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=Vh(e.x-this.long0),r=Math.abs(e.y),i=Math.floor(r*dd);i<0?i=0:i>=fd&&(i=fd-1),r=dh*(r-pd*i);var s={x:yd(ld[i],r)*t,y:yd(hd[i],r)};return e.y<0&&(s.y=-s.y),s.x=s.x*this.a*ud+this.x0,s.y=s.y*this.a*cd+this.y0,s},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*ud),y:Math.abs(e.y-this.y0)/(this.a*cd)};if(t.y>=1)t.x/=ld[fd][0],t.y=e.y<0?-ah:ah;else{var r=Math.floor(t.y*fd);for(r<0?r=0:r>=fd&&(r=fd-1);;)if(hd[r][0]>t.y)--r;else{if(!(hd[r+1][0]<=t.y))break;++r}var i=hd[r],s=5*(t.y-i[0])/(hd[r+1][0]-i[0]);s=function(e,t,r,i){for(var s=t;i;--i){var n=e(s);if(s-=n,Math.abs(n)<r)break}return s}(function(e){return(yd(i,e)-t.y)/md(i,e)},s,uh,100),t.x/=yd(ld[r],s),t.y=(5*r+s)*ch,e.y<0&&(t.y=-t.y)}return t.x=Vh(t.x+this.long0),t},names:["Robinson","robin"]};const vd={init:function(){this.name="geocent"},forward:function(e){return uu(e,this.es,this.a)},inverse:function(e){return cu(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var bd={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Sd={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}};const xd={init:function(){if(Object.keys(Sd).forEach(function(e){if(void 0===this[e])this[e]=Sd[e].def;else{if(Sd[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Sd[e].num&&(this[e]=parseFloat(this[e]))}Sd[e].degrees&&(this[e]=this[e]*ch)}.bind(this)),Math.abs(Math.abs(this.lat0)-ah)<uh?this.mode=this.lat0<0?bd.S_POLE:bd.N_POLE:Math.abs(this.lat0)<uh?this.mode=bd.EQUIT:(this.mode=bd.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,r,i,s,n=Math.sin(e.y),a=Math.cos(e.y),o=Math.cos(e.x);switch(this.mode){case bd.OBLIQ:r=this.sinph0*n+this.cosph0*a*o;break;case bd.EQUIT:r=a*o;break;case bd.S_POLE:r=-n;break;case bd.N_POLE:r=n}switch(t=(r=this.pn1/(this.p-r))*a*Math.sin(e.x),this.mode){case bd.OBLIQ:r*=this.cosph0*n-this.sinph0*a*o;break;case bd.EQUIT:r*=n;break;case bd.N_POLE:r*=-a*o;break;case bd.S_POLE:r*=a*o}return s=1/((i=r*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-r*this.sg)*this.cw*s,r=i*s,e.x=t*this.a,e.y=r*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,r,i,s={x:e.x,y:e.y};i=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=t*this.cg+r*this.sg,e.y=r*this.cg-t*this.sg;var n=lc(e.x,e.y);if(Math.abs(n)<uh)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 bd.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 bd.EQUIT:s.y=Math.asin(e.y*o/n),e.y=a*n,e.x*=o;break;case bd.N_POLE:s.y=Math.asin(a),e.y=-e.y;break;case bd.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"]};const _d={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,r,i,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/lc(this.radius_p*Math.cos(a),Math.sin(a));if(r=o*Math.cos(n)*Math.cos(a),i=o*Math.sin(n)*Math.cos(a),s=o*Math.sin(a),(this.radius_g-r)*r-i*i-s*s*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(i/lc(s,t)),e.y=this.radius_g_1*Math.atan(s/t)):(e.x=this.radius_g_1*Math.atan(i/t),e.y=this.radius_g_1*Math.atan(s/lc(i,t)))}else"sphere"===this.shape&&(t=Math.cos(a),r=Math.cos(n)*t,i=Math.sin(n)*t,s=Math.sin(a),t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(i/lc(s,t)),e.y=this.radius_g_1*Math.atan(s/t)):(e.x=this.radius_g_1*Math.atan(i/t),e.y=this.radius_g_1*Math.atan(s/lc(i,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,r,i,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)*lc(1,o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*lc(1,a));var l=o/this.radius_p;if(t=a*a+l*l+n*n,(i=(r=2*this.radius_g*n)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-r-Math.sqrt(i))/(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=(r=2*this.radius_g*n)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-r-Math.sqrt(i))/(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"]};Cu.defaultDatum="WGS84",Cu.Proj=hu,Cu.WGS84=new Cu.Proj("WGS84"),Cu.Point=Ju,Cu.toPoint=vu,Cu.defs=Fh,Cu.nadgrid=function(e,t){var r=new DataView(t),i=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)}(r),s=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:su(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(r,i);s.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n={header:s,subgrids:function(e,t,r){for(var i=[],s=0;s<t.nSubgrids;s++){var n=au(e,176,r),a=ou(e,176,n,r),o=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),l=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);i.push({ll:[iu(n.lowerLongitude),iu(n.lowerLatitude)],del:[iu(n.longitudeInterval),iu(n.latitudeInterval)],lim:[o,l],count:n.gridNodeCount,cvs:nu(a)})}return i}(r,s,i)};return tu[e]=n,n},Cu.transform=Su,Cu.mgrs=Lu,Cu.version="__VERSION__",function(e){e.Proj.projections.add(ac),e.Proj.projections.add(dc),e.Proj.projections.add(pc),e.Proj.projections.add(gc),e.Proj.projections.add(vc),e.Proj.projections.add(bc),e.Proj.projections.add(xc),e.Proj.projections.add(_c),e.Proj.projections.add(wc),e.Proj.projections.add(Nc),e.Proj.projections.add(Bc),e.Proj.projections.add(Vc),e.Proj.projections.add(Jc),e.Proj.projections.add(zc),e.Proj.projections.add(qc),e.Proj.projections.add(Wc),e.Proj.projections.add(Yc),e.Proj.projections.add(Xc),e.Proj.projections.add(Zc),e.Proj.projections.add(Kc),e.Proj.projections.add($c),e.Proj.projections.add(ed),e.Proj.projections.add(td),e.Proj.projections.add(rd),e.Proj.projections.add(od),e.Proj.projections.add(gd),e.Proj.projections.add(vd),e.Proj.projections.add(xd),e.Proj.projections.add(_d)}(Cu);const wd=Cu;function Cd(e){const t=function(){const e={};return["(",")","(",")",",",","].forEach((t,r)=>{e[t]=`$${r}`}),e}();for(let r in t){const i=t[r],s=new RegExp(`\\${r}`,"g");for(;s.test(e);)e=e.replace(s,i)}return e}function Ad(e,t){let r=e;return e.replace(/&|\||>|<|=|!/g," ").split(" ").filter(e=>e).forEach(e=>{const i=t.find(t=>t===e);if(Td(e)&&i&&(r=r.replace(i,"$"+i)),i){const e=Cd(i);r=r.replace(i,e)}}),r}function Md(e){let t={};for(let r in e){let i=r;Td(r)&&(i="$"+r),t[i=Cd(i)]=e[r]}return t}function Td(e){return/^\d/.test(e)}const Ed=ol.geom.Point;var Od=r.n(Ed);class Pd extends bo{constructor(e,t){super(e,t),this._queryService=new fs(e,t)}queryByBounds(e,t,r){return e=this._processParams(e),this._queryService.queryByBounds(e,t,r)}queryByDistance(e,t,r){return e=this._processParams(e),this._queryService.queryByDistance(e,t,r)}queryBySQL(e,t,r){return e=this._processParams(e),this._queryService.queryBySQL(e,t,r)}queryByGeometry(e,t,r){return e=this._processParams(e),this._queryService.queryByGeometry(e,t,r)}_processParams(e){return e?(e.returnContent=null==e.returnContent||e.returnContent,e.queryParams&&!$o.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds=new ne(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3])),e.geometry&&(e.geometry instanceof Od()?e.geometry=new he(e.geometry.getCoordinates()[0],e.geometry.getCoordinates()[1]):e.geometry=$o.toSuperMapGeometry(JSON.parse((new(Dl())).writeGeometry(e.geometry)))),e):{}}}class Id{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,r){var i=this;return new zr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r}).processAsync(e,t)}getFeaturesByBounds(e,t,r){var i=this;return new Gr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}getFeaturesByBuffer(e,t,r){var i=this;return new Br(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}getFeaturesBySQL(e,t,r){var i=this;return new Hr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}getFeaturesByGeometry(e,t,r){var i=this;return new Vr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,i=r.url,s=e.dataSourceName,n=e.dataSetName;return i=te.urlPathAppend(i,"datasources/"+s+"/datasets/"+n),new Zt(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}getMetadata(e,t){var r=this,i=r.url,s=e.dataSourceName,n=e.dataSetName;return i=te.urlPathAppend(i,"datasources/"+s+"/datasets/"+n),new Zt(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).getMetaData(e,t)}_processFormat(e){return e||t.GEOJSON}}class Nd extends bo{constructor(e,t){super(e,t),this._featureService=new Id(e,t)}getFeaturesByIDs(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByIDs(e,t,r)}getFeaturesByBounds(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByBounds(e,t,r)}getFeaturesByBuffer(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByBuffer(e,t,r)}getFeaturesBySQL(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesBySQL(e,t,r)}getFeaturesByGeometry(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByGeometry(e,t,r)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,i=r.url,s=e.dataSourceName,n=e.dataSetName;return i=te.urlPathAppend(i,"datasources/"+s+"/datasets/"+n),new Zt(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(r._processParams(e),t)}}getMetadata(e,t){return this._featureService.getMetadata(e,t)}_processParams(e){if(!e)return{};var t=this;if(e.returnContent=null==e.returnContent||e.returnContent,e.fromIndex=e.fromIndex?e.fromIndex:0,e.toIndex=e.toIndex?e.toIndex:-1,e.bounds&&(e.bounds=$o.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry=$o.toSuperMapGeometry(JSON.parse((new(Dl())).writeGeometry(e.geometry)))),e.editType&&(e.editType=e.editType.toLowerCase()),e.features){var r=[];$o.isArray(e.features)?e.features.map(function(e){return r.push(t._createServerFeature(e)),e}):r.push(t._createServerFeature(e.features)),e.features=r}return e}_createServerFeature(e){var t={},r=[],i=[],s=e.getProperties();for(var n in s)n!==e.getGeometryName()&&(r.push(n),i.push(s[n]));return t.fieldNames=r,t.fieldValues=i,e.getId()&&(t.id=e.getId()),t.geometry=$o.toSuperMapGeometry((new(Dl())).writeFeatureObject(e)),t}_processFormat(e){return e||t.GEOJSON}}function Ld(e){let t=[];var r;return r=e,"[object Array]"===Object.prototype.toString.call(r)&&e.length&&e.forEach(e=>{let r=e.get("attributes");r&&t.push(r)}),t}function kd(e,t,r,i,s,n,a){!function(e,t,r,i,s,n,a){let o,l=new yt({name:t.join().replace(":","@")}),h=a||1e3,u=[];Rd(e,l,t,0,1,1,s,n).then(a=>{o=a;let c=a.result.totalCount;if(c>1){for(let r=1;r<c;)u.push(Rd(e,l,t,r,r+h,h,s,n)),r+=h;Promise.all(u).then(e=>{e.forEach(e=>{"processCompleted"===e.type&&e.result.features&&e.result.features.features?e.result.features.features.forEach(e=>{o.result.features.features.push(e)}):o.someRequestFailed=!0}),r(o)}).catch(e=>{i(e)})}else r(a)}).catch(e=>{i(e)})}(e,t,i,s,r,n,a)}function Fd(e,t,r,i,s,a,o,l,h,u){const c=new yt({name:t,attributeFilter:r});i&&(c.fields=i);const d={queryParams:[c]};u&&(d.queryOption=n.ATTRIBUTE),l&&(d.startRecord=l),h&&(d.expectCount=h),s&&(d.prjCoordSys={epsgCode:s});const p=new Qi(d);new Pd(e).queryBySQL(p,function(e){"processCompleted"===e.type?a(e):o(e)})}function Rd(e,t,r,i,s,n,a,o){return new Promise((l,h)=>{new Nd(e,a).getFeaturesBySQL(function(e,t,r,i,s,n){return new qr({queryParameter:e,datasetNames:t,fromIndex:r,toIndex:i,maxFeatures:s,returnContent:!0,targetEpsgCode:n})}(t,r,i,s,n,o),e=>{let t=e.result;"processCompleted"===e.type&&t&&t.features?l(e):h(e)})})}class Dd extends bo{constructor(e,t){(t=t||{}).projection&&(t.prjCoordSys=t.projection),super(e,t),this.dataFlow=new Gt(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(){return this.dataFlow.initBroadcast(),this}broadcast(e){this.dataFlow.broadcast(e)}initSubscribe(){return this.dataFlow.initSubscribe(),this}setExcludeField(e){return this.dataFlow.setExcludeField(e),this.options.excludeField=e,this}setGeometry(e){return this.dataFlow.setGeometry(e),this.options.geometry=e,this}unSubscribe(){this.dataFlow.unSubscribe()}unBroadcast(){this.dataFlow.unBroadcast()}_defaultEvent(e){this.dispatchEvent({type:e.eventType||e.type,value:e})}}class Gd extends(qo()){constructor(e){var t=e||{};super(t),this.idField=t.idField||"id",this.dataService=new Dd(t.ws,{geometry:t.geometry,prjCoordSys:t.prjCoordSys,excludeField:t.excludeField}).initSubscribe();var r=this;r.dataService.on("subscribeSocketConnected",function(e){r.dispatchEvent({type:"subscribeSucceeded",value:e})}),r.dataService.on("messageSucceeded",function(e){r._onMessageSuccessed(e)}),r.dataService.on("setFilterParamSucceeded",function(e){r.dispatchEvent({type:"setFilterParamSucceeded",value:e})}),this.featureCache={}}setExcludeField(e){return this.dataService.setExcludeField(e),this.excludeField=e,this}setGeometry(e){return this.dataService.setGeometry(e),this.geometry=e,this}_onMessageSuccessed(e){var t=(new(Dl())).readFeature(e.value.featureResult),r=t.get(this.idField);void 0!==r&&this.featureCache[r]?(this.featureCache[r].setGeometry(t.getGeometry()),this.featureCache[r].setProperties(t.getProperties()),this.changed()):(this.addFeature(t),this.featureCache[r]=t),this.dispatchEvent({type:"dataupdated",value:{source:this,data:t}})}}class jd{constructor(e,t){this.geometry=e,this.attributes=t}toFeature(){var e=this.geometry;if(e instanceof Vo()){let t=this.attributes;t.geometry=e;let r=new(Qo())(t);return(new Ie).read((new(Dl())).writeFeature(r),"Feature")}if(3===e.length)return e=new ce(e[0],e[1],e[2]),new Ee(e,this.attributes)}}const Bd=ol.source.ImageCanvas;var Ud=r.n(Bd);class Vd extends(Ud()){constructor(e,t){var r=t||{};function i(e,t,r,i,s){var n=i[0]*r,a=i[1]*r;if(this.context||(this.context=$o.createCanvasContext2D(n,a)),!this.features)return this.context.canvas;this.pixelRatio=r;var o=this.map.getSize()[0]*r,l=this.map.getSize()[1]*r;this.offset=[(n-o)/2/r,(a-l)/2/r],this.notFirst||(this.redrawThematicFeatures(e),this.notFirst=!0),this.div.id=this.id,this.div.className="themeLayer",this.div.style.width=n+"px",this.div.style.height=a+"px",this.map.getViewport().appendChild(this.div),this.renderer.resize(),this.map.getViewport().removeChild(this.div),this.themeCanvas=this.renderer.painter.root.getElementsByTagName("canvas")[0],this.themeCanvas.width=n,this.themeCanvas.height=a,this.themeCanvas.style.width=n+"px",this.themeCanvas.style.height=a+"px",this.themeCanvas.getContext("2d").clearRect(0,0,n,a);var h=this.renderer.painter._layers.hover.ctx.canvas,u=$o.createCanvasContext2D(n,a);u.drawImage(h,0,0,h.width,h.height,0,0,n,a),this.redrawThematicFeatures(e);var c=this.context.canvas;return this.context.clearRect(0,0,c.width,c.height),c.width=n,c.height=a,c.style.width=n+"px",c.style.height=a+"px",this.context.drawImage(this.themeCanvas,0,0),this.context.drawImage(u.canvas,0,0),this.context.canvas}super({attributions:r.attributions||"Map Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>",canvasFunction:i,logo:"4"===$o.getOlVersion()?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state}),this.on=this.onInternal,this.id=r.id?r.id:te.createUniqueID("themeLayer_"),this.canvasFunctionInternal_=i,this.EVENT_TYPES=["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","added","removed","tileloaded","beforefeaturesadded","featuresadded","featuresremoved"],this.features=[],this.TFEvents=r.TFEvents||[],this.map=r.map;var s=this.map.getSize();this.div=document.createElement("div"),this.map.getViewport().appendChild(this.div),this.div.style.width=s[0]+"px",this.div.style.height=s[1]+"px",this.setOpacity(r.opacity),this.levelRenderer=new Fa,this.movingOffset=[0,0],this.renderer=this.levelRenderer.init(this.div),this.map.getViewport().removeChild(this.div),this.renderer.clear(),this.addTFEvents()}destroy(){this.EVENT_TYPES=null,this.isBaseLayer=null,this.TFEvents=null,this.destroyFeatures(),this.features=null,this.renderer&&this.renderer.dispose(),this.renderer=null,this.levelRenderer=null,this.movingOffset=null,this.currentMousePosition=null}destroyFeatures(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()}}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.div;te.modifyDOMElement(t,null,null,null,null,null,null,e),null!==this.map&&this.dispatchEvent({type:"changelayer",value:{layer:this,property:"opacity"}})}}addFeatures(e){}removeFeatures(e){var t=this;if(e){if(e===t.features)return t.removeAllFeatures();te.isArray(e)||"function"==typeof e||(e=[e]);for(var r=[],i=0;i<t.features.length;i++){var s=t.features[i];if(e&&"function"==typeof e)e(s)&&t.features.splice(i--,1);else-1===te.indexOf(e,s)?r.push(s):t.features.splice(i--,1)}for(var n=[],a=0,o=this.features.length;a<o;a++)s=this.features[a],n.push(s);this.features=[],this.addFeatures(n),this.renderer&&this.redrawThematicFeatures(this.map.getView().calculateExtent());var l=0==r.length;this.dispatchEvent({type:"featuresremoved",value:{features:r,succeed:l}})}}removeAllFeatures(){this.renderer&&this.renderer.clear(),this.features=[],this.dispatchEvent({type:"featuresremoved",value:{features:[],succeed:!0}})}getFeatures(e){for(var t=this.features.length,r=[],i=0;i<t;++i)(!e||e&&"function"==typeof e&&e(this.features[i]))&&r.push(this.features[i]);return r}getFeatureBy(e,t){var r=null;for(var i in this.features)if(this.features[i][e]===t){r=this.features[i];break}return r}getFeatureById(e){return this.getFeatureBy("id",e)}getFeaturesByAttribute(e,t){var r,i=[];for(var s in this.features)(r=this.features[s])&&r.attributes&&r.attributes[e]===t&&i.push(r);return i}redrawThematicFeatures(e){}onInternal(e,t){var r=t;if(this.renderer)this.renderer.on(e,r);else{var i=[];i.push(e),i.push(r),this.TFEvents.push(i)}}fire(e,t){if(this.offset){t=t.originalEvent;var r=this.getX(t),i=this.getY(t),s=-this.map.getView().getRotation(),n=this.map.getPixelFromCoordinate(this.map.getView().getCenter()),a=this.scale([r,i],n,this.pixelRatio),o=this.rotate(a,s,n),l=[o[0]+this.offset[0],o[1]+this.offset[1]],h=document.createEvent("Event");h.initEvent("pointermove",!0,!0),h.offsetX=l[0],h.offsetY=l[1],h.layerX=l[0],h.layerY=l[1],h.clientX=l[0],h.clientY=l[1],h.x=r,h.y=i,"click"===e&&this.renderer.handler._clickHandler(h),"dblclick"===e&&this.renderer.handler._dblclickHandler(h),"onmousewheel"===e&&this.renderer.handler._mousewheelHandler(h),"mousemove"===e&&(this.renderer.handler._mousemoveHandler(h),this.changed()),"onmouseout"===e&&this.renderer.handler._mouseoutHandler(h),"onmousedown"===e&&this.renderer.handler._mousedownHandler(h),"onmouseup"===e&&this.renderer.handler._mouseupHandler(h)}}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}un(e,t){var r=t;if(this.renderer)this.renderer.un(e,r);else{for(var i=this.TFEvents,s=i.length,n=[],a=0;a<s;a++){var o=i[a];o[0]===e&&o[1]===r||n.push(o)}this.TFEvents=n}}addTFEvents(){for(var e=this.TFEvents,t=e.length,r=0;r<t;r++)this.renderer.on(e[r][0],e[r][1])}getLocalXY(e){var t,r=this.map;(e instanceof he||e instanceof ce)&&(t=r.getPixelFromCoordinate([e.x,e.y])),e instanceof se&&(t=r.getPixelFromCoordinate([e.lon,e.lat]));var i=-r.getView().getRotation(),s=r.getPixelFromCoordinate(r.getView().getCenter()),n=t;return this.pixelRatio&&(n=this.scale(t,s,this.pixelRatio)),t&&s&&(n=this.rotate(n,i,s)),this.offset&&n?[n[0]+this.offset[0],n[1]+this.offset[1]]:n}rotate(e,t,r){return[Math.cos(t)*(e[0]-r[0])-Math.sin(t)*(e[1]-r[1])+r[0],Math.sin(t)*(e[0]-r[0])+Math.cos(t)*(e[1]-r[1])+r[1]]}scale(e,t,r){return[(e[0]-t[0])*r+t[0],(e[1]-t[1])*r+t[1]]}toiClientFeature(e){te.isArray(e)||(e=[e]);let t=[];for(let r=0;r<e.length;r++)if(e[r]instanceof jd)t.push(e[r].toFeature());else if(e[r]instanceof Qo())t.push(this._toFeature(e[r]));else if(e[r]instanceof Ee)t.push(e[r]);else if(e[r].geometry&&e[r].geometry.parts)t.push(bs.fromJson(e[r]).toFeature());else{if(-1==["FeatureCollection","Feature","Geometry"].indexOf(e[r].type))throw new Error(`features[${r}]'s type is not be supported.`);{const i=new Ie;t=t.concat(i.read(e[r]))}}return t}toFeature(e){return this.toiClientFeature(e)}_toFeature(e){let t=(new(Dl())).writeFeature(e);return(new Ie).read(t,"Feature")}}class Jd extends Vd{constructor(e,t,r){super(e,r),this.chartsSetting=r.chartsSetting||{},this.themeFields=r.themeFields||null,this.overlayWeightField=r.overlayWeightField||null,this.isOverLay=void 0===r.isOverLay||r.isOverLay,this.charts=r.charts||[],this.cache=r.cache||{},this.chartsType=t}destroy(){this.chartsType=null,this.chartsSetting=null,this.themeFields=null,this.overlayWeightField=null,this.isOverLay=null,Vd.prototype.destroy.apply(this,arguments),this.charts=null,this.cache=null}setChartsType(e){this.chartsType=e,this.redraw()}addFeatures(e){!1!==this.dispatchEvent({type:"beforefeaturesadded",value:{features:e}})&&(this.features=this.toiClientFeature(e),this.renderer&&this.changed())}redrawThematicFeatures(e){this.renderer.clearAll();for(var t=this.features,r=0,i=t.length;r<i;r++){var s=t[r],n=s.geometry.getBounds();if(e)if(!new ne(e[0],e[1],e[2],e[3]).intersectsBounds(n))continue;var a=this.cache,o=s.id;if(!a[o]){a[o]=o;var l=this.createThematicFeature(s);l&&this.overlayWeightField&&s.attributes[this.overlayWeightField]&&!isNaN(s.attributes[this.overlayWeightField])&&(l.__overlayWeight=s.attributes[this.overlayWeightField]),l&&this.charts.push(l)}}this.drawCharts()}createThematicFeature(e){var t;return xa[this.chartsType]&&this.themeFields&&this.chartsSetting&&(t=new xa[this.chartsType](e,this,this.themeFields,this.chartsSetting)),!!t&&(t.assembleShapes(),t)}drawCharts(){if(this.renderer){var e=this.charts;if(this.overlayWeightField&&e.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}),this.isOverLay)for(var t=[],r=this.map.getView().calculateExtent(),i=new ne(r[0],r[1],r[2],r[3]),s=this.getLocalXY(new se(i.left,i.top)),n=this.getLocalXY(new se(i.right,i.bottom)),a=new ne(s[0],n[1],n[0],s[1]),o=0,l=e.length;o<l;o++){var h=e[o],u=h.resetLocation(),c=h.chartBounds,d=[{x:c.left,y:c.top},{x:c.left,y:c.bottom},{x:c.right,y:c.bottom},{x:c.right,y:c.top},{x:c.left,y:c.top}];if(!a||this.isChartInMap(a,d)){var p=!1;if(0!==o)for(let e=0;e<t.length;e++)if(this.isQuadrilateralOverLap(d,t[e])){p=!0;break}if(!p){t.push(d);var f=h.shapes;for(let e=0,t=f.length;e<t;e++)f[e].refOriginalPosition=u,this.renderer.addShape(f[e])}}}else for(var y=0,m=e.length;y<m;y++)for(var g=e[y],v=g.resetLocation(),b=g.shapes,S=0,x=b.length;S<x;S++)b[S].refOriginalPosition=v,this.renderer.addShape(b[S]);this.renderer.render()}}getShapesByFeatureID(e){var t=[],r=this.renderer.getAllShapes();if(!e)return r;for(var i=0,s=r.length;i<s;i++){var n=r[i];n.refDataID&&e===n.refDataID&&t.push(n)}return t}isQuadrilateralOverLap(e,t){var r=e.length,i=t.length;if(5!==r||5!==i)return null;var s=!1;for(let i=0;i<r;i++)if(this.isPointInPoly(e[i],t)){s=!0;break}for(let r=0;r<i;r++)if(this.isPointInPoly(t[r],e)){s=!0;break}for(let n=0;n<r-1&&!s;n++)for(let r=0;r<i-1;r++){if("SuperMap.Geometry.Point"===te.lineIntersection(e[n],e[n+1],t[r],t[r+1]).CLASS_NAME){s=!0;break}}return s}isPointInPoly(e,t){for(var r=!1,i=-1,s=t.length,n=s-1;++i<s;n=i)(t[i].y<=e.y&&e.y<t[n].y||t[n].y<=e.y&&e.y<t[i].y)&&e.x<(t[n].x-t[i].x)*(e.y-t[i].y)/(t[n].y-t[i].y)+t[i].x&&(r=!r);return r}isChartInMap(e,t){for(var r=e,i=!1,s=0,n=t.length;s<n;s++){var a=t[s];if(a.x>=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){i=!0;break}}return i}clearCache(){this.cache={},this.charts=[]}removeFeatures(e){this.clearCache(),super.removeFeatures(e)}removeAllFeatures(){this.clearCache(),super.removeAllFeatures()}redraw(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getView().calculateExtent()),!0)}clear(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}canvasFunctionInternal_(e,t,r,i,s){return Vd.prototype.canvasFunctionInternal_.apply(this,arguments)}}const zd=ol.style.RegularShape;var qd=r.n(zd);class Hd extends(qd()){constructor(e){e.stroke?(e.stroke.color=e.stroke.getColor()||"#3388ff",e.stroke.width=e.stroke.getWidth()||1):e.stroke=new(yl())({color:"#3388ff",width:1}),e.fill?e.fill.color=e.fill.getColor()||"#66ccff":e.fill=new(pl())({color:"#66ccff"}),super({angle:e.angle||60,stroke:e.stroke,fill:e.fill,radius:e.radius||10,rotation:e.rotation||0}),this.count_=e.count||3,this.strokeOpacity=e.strokeOpacity||1,this.fillOpacity=e.fillOpacity||1,this._pixelRatio=window?window.devicePixelRatio:1,this._canvas=this.getImage(this._pixelRatio),this._ctx=this._canvas.getContext("2d"),this._render()}_render(){var e=0,t=this.getAngle();if(this.spaceAngle=360/this.count_-this.getAngle(),!(this.spaceAngle<0)){this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),this._ctx.translate(0,0),this._ctx.beginPath();for(var r=0;r<this.count_;r++)this._drawSector(this._ctx,this.getAnchor()[0],this.getAnchor()[1],this.getRadius(),e,t),t=(e=t+this.spaceAngle)+this.getAngle();this._fillStroke(),this._ctx.closePath()}}_drawSector(e,t,r,i,s,n){s=s/180*Math.PI,n=n/180*Math.PI,e.moveTo(t,r),e.lineTo(t+i*Math.cos(s),r+i*Math.sin(s)),e.arc(t,r,i,s,n),e.lineTo(t,r)}_fillStroke(){this.getFill()&&(this._ctx.globalAlpha=this.fillOpacity,this._ctx.fillStyle=this.getFill().color,this._ctx.fill()),this.getStroke()&&0!==this.weight&&(this._ctx.globalAlpha=this.strokeOpacity,this._ctx.lineWidth=this.getStroke().width,this._ctx.strokeStyle=this.getStroke().color,this._ctx.lineCap=this.getStroke().lineCap,this._ctx.lineJoin=this.getStroke().lineJoin,this._ctx.stroke())}getCount(){return this.count_}getSpaceAngle(){return this.spaceAngle}}class Wd extends Hd{constructor(e){super(e),this.sAngle=e.sAngle,this.eAngle=e.eAngle,this._render()}_render(){this._ctx.clearRect(0,0,this.getImage().width,this.getImage().height),this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),this._ctx.translate(0,0),this._ctx.beginPath(),this._drawSector(this._ctx,this.getAnchor()[0],this.getAnchor()[1],this.getRadius(),this.sAngle,this.eAngle),this._fillStroke(),this._ctx.closePath()}getSAngle(){return this.sAngle}getEAngle(){return this.eAngle}}const Yd=ol.Object;var Xd=r.n(Yd);const Qd=()=>!1,Zd=function(){let e=document.createElement("div"),t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(let r=0;r<t.length;r++){let i=t[r];if(void 0!==e.style[i])return i}return t[0]}();class Kd extends(Xd()){constructor(e,t){super(),this.layer=e,this.map=e.map;let r=t||{};te.extend(this,r);let i=this.pixelRatio=window?window.devicePixelRatio:1;this.width=this.map.getSize()[0]*i,this.height=this.map.getSize()[1]*i,this.center=this.map.getView().getCenter(),this._initContainer(),this._registerEvents()}_registerEvents(){let e=this.map,t=e.getView();e.on("change:size",this._resizeEvent.bind(this),this),t.on("change:resolution",this._moveEndEvent.bind(this),this),t.on("change:center",this._moveEvent.bind(this),this),t.on("change:rotation",this._moveEndEvent.bind(this),this),e.on("moveend",this._moveEndEvent.bind(this),this)}_resizeEvent(){this._resize(),this._clearAndRedraw()}_moveEvent(){let e=this.map.getPixelFromCoordinate(this.center),t=this.map.getPixelFromCoordinate(this.map.getView().getCenter()),r=[e[0]-t[0],e[1]-t[1]];this._canvas.style[Zd]="translate("+Math.round(r[0])+"px,"+Math.round(r[1])+"px)"}_moveEndEvent(){this._canvas.style[Zd]="translate(0,0)",this.center=this.map.getView().getCenter(),this._clearAndRedraw()}_clearAndRedraw(){this._clearBuffer(),this.layer.changed()}_resize(){const e=this.map.getSize(),t=e[0]*this.pixelRatio,r=e[1]*this.pixelRatio;this._canvas.width=t,this._canvas.height=r,this._canvas.style.width=t+"px",this._canvas.style.height=r+"px"}_clearBuffer(){if(!this.deckGL)return;let e=this.deckGL.layerManager;return e&&e.context.gl.clear(e.context.gl.COLOR_BUFFER_BIT),this}getCanvas(){return this._canvas}update(e){if(e&&e.length>-1&&(this._data=e),!this._renderLayer)return;this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();let t=this._getLayerState();t.data=this._data||[],this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)}drawGraphics(e){this._data=e||(this._data?this._data:[]),this._renderLayer||this._createInnerRender(),this._clearBuffer(),this._draw()}_initContainer(){this._canvas=this._createCanvas(this.width,this.height),this._layerContainer=this.container,this._wrapper=document.createElement("div"),this._wrapper.className="deck-wrapper",this._wrapper.style.position="absolute",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.appendChild(this._canvas),this._layerContainer&&this._layerContainer.appendChild(this._wrapper)}_createCanvas(e,t){let r=document.createElement("canvas");return r.oncontextmenu=Qd,r.width=e,r.height=t,r.style.width=e+"px",r.style.height=t+"px",r}_createInnerRender(){let e=this,t=this._getLayerState(),{color:r,radius:i,opacity:s,highlightColor:n,radiusScale:a,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,outline:u}=t;i=this._pixelToMeter(i);let c={id:"scatter-plot",data:[],pickable:Boolean(this.onClick)||Boolean(this.onHover),autoHighlight:!0,color:r,opacity:s,radius:i,radiusScale:a,highlightColor:n,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,outline:u,getPosition(t){if(!t)return[0,0,0];let r=t.getGeometry(),i=r&&r.getCoordinates();return(i=e._project(i))&&[i[0],i[1],0]},getColor(t){let r=e._getLayerDefaultStyle(),i=t&&t.getStyle();return i&&i.getColor&&i.getColor()||r.color},getRadius(t){let r=e._getLayerDefaultStyle(),i=t&&t.getStyle();return i&&i.getRadius&&i.getRadius()||r.radius},updateTriggers:{getColor:[r],getRadius:[i]}};e._renderLayer=new window.DeckGL.ScatterplotLayer(c)}_getLayerDefaultStyle(){let{color:e,opacity:t,radius:r,radiusScale:i,radiusMinPixels:s,radiusMaxPixels:n,strokeWidth:a,outline:o}=this._getLayerState();return{color:e,opacity:t,radius:r=this._pixelToMeter(r),radiusScale:i,radiusMinPixels:s,radiusMaxPixels:n,strokeWidth:a,outline:o}}_getLayerState(){let e=this.layer.getLayerState(),t=this.map.getView().getProjection().getCode(),r=Mo.transform([e.longitude,e.latitude],t,"EPSG:4326");return e.longitude=r[0],e.latitude=r[1],e.zoom=e.zoom-1,e}_draw(){this._refreshData();let e=this._getLayerState();e.data=this._data||[];let t={};for(let r in e)t[r]=e[r];this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._canvas,this.onBeforeRender&&(t.onBeforeRender=this.onBeforeRender.bind(this)),this.onAfterRender&&(t.onAfterRender=this.onAfterRender.bind(this)),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)}_refreshData(){let e=this._data||[],t=$o.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}_project(e){let t=this.map.getView().getProjection().getCode();return"EPSG:4326"===t?e:Mo.transform(e,t,"EPSG:4326")}_pixelToMeter(e){let t=this.map.getView(),r=t.getProjection().getUnits()||"degrees";"degrees"===r&&(r=l.DEGREE),"m"===r&&(r=l.METER);const i=t.getResolution();if(r===l.DEGREE){return e*(i*(6378137*Math.PI/180))}return e*i}}class $d extends(Xd()){constructor(e,t){super(),this.layer=e,this.map=e.map;let r=t||{};te.extend(this,r),this.highLightStyle=this.layer.highLightStyle,this.mapWidth=this.size[0]/this.pixelRatio,this.mapHeight=this.size[1]/this.pixelRatio,this.width=this.map.getSize()[0],this.height=this.map.getSize()[1],this.context=$o.createCanvasContext2D(this.mapWidth,this.mapHeight),this.context.scale(this.pixelRatio,this.pixelRatio),this.canvas=this.context.canvas,this.canvas.style.width=this.width+"px",this.canvas.style.height=this.height+"px",this._registerEvents()}_registerEvents(){this.map.on("change:size",this._resizeEvent.bind(this),this)}_resizeEvent(){this._resize(),this._clearAndRedraw()}_resize(){let e=this.map.getSize(),t=e[0],r=e[1],i=t/this.width,s=r/this.height;this.width=t,this.height=r,this.mapWidth=this.mapWidth*i,this.mapHeight=this.mapHeight*s,this.canvas.width=this.mapWidth,this.canvas.height=this.mapHeight,this.canvas.style.width=this.width+"px",this.canvas.style.height=this.height+"px"}_clearAndRedraw(){this._clearBuffer(),this.layer.changed()}update(){this.layer.changed()}_clearBuffer(){}getCanvas(){return this.canvas}drawGraphics(e){this.graphics_=e||[];let t=this.mapWidth,r=this.mapHeight,i=Jo.toContext(this.context,{size:[t,r],pixelRatio:this.pixelRatio}),s=this.layer._getDefaultStyle(),n=this,a=n.layer.map;e.map(function(e){let t=e.getStyle()||s;if(n.selected===e){let e=t;t instanceof Yo.Circle?e=new Yo.Circle({radius:t.getRadius(),fill:new Yo.Fill({color:"rgba(0, 153, 255, 1)"}),stroke:t.getStroke(),snapToPixel:"4"===$o.getOlVersion()?t.getSnapToPixel():null}):t instanceof Yo.RegularShape&&(e=new Yo.RegularShape({radius:t.getRadius(),radius2:t.getRadius2(),points:t.getPoints(),angle:t.getAngle(),snapToPixel:"4"===$o.getOlVersion()?t.getSnapToPixel():null,rotation:t.getRotation(),rotateWithView:t.getRotateWithView(),fill:new Yo.Fill({color:"rgba(0, 153, 255, 1)"}),stroke:t.getStroke()})),t=n.highLightStyle||e}i.setStyle(new Yo.Style({image:t}));let r=e.getGeometry().getCoordinates(),o=a.getView().getCenter(),l=a.getPixelFromCoordinate(o),h=a.getView().getResolution(),u=(r[0]-o[0])/h,c=(o[1]-r[1])/h,d=[u+l[0],c+l[1]],p=[(d=function(e,t,r){return[(e[0]-t[0])*r+t[0],(e[1]-t[1])*r+t[1]]}(d,l,1))[0]+n.offset[0],d[1]+n.offset[1]],f=new(Od())(p);return i.drawGeometry(f),e})}}class ep extends(Xd()){constructor(e,t){super(),e instanceof Vo()&&(this.geometry_=e),this.attributes=t,this.setStyle()}clone(){var e=new ep;return e.setId(this.id),e.setGeometry(this.geometry_),e.setAttributes(this.attributes),e.setStyle(this.style_),e}getId(){return this.id}setId(e){this.id=e}getGeometry(){return this.geometry_}setGeometry(e){this.geometry_=e}setAttributes(e){this.attributes=e}getAttributes(){return this.attributes}getStyle(){return this.style_}setStyle(e){(this.style||e)&&(this.style_=e,this.styleFunction_=e?ep.createStyleFunction(new(al())({image:e})):void 0,this.changed())}getStyleFunction(){return this.styleFunction_}static createStyleFunction(e){var t,r;"function"==typeof e?t=2==e.length?function(t){return e(this,t)}:e:(r=Array.isArray(e)?e:[e],t=function(){return r});return t}destroy(){this.id=null,this.geometry_=null,this.attributes=null,this.style_=null}}const tp=ol.geom.Polygon;var rp=r.n(tp);const ip=ol.layer.Image;var sp=r.n(ip);const np={color:[0,0,0,255],opacity:.8,radius:10,radiusScale:1,radiusMinPixels:0,radiusMaxPixels:Number.MAX_SAFE_INTEGER,strokeWidth:1,outline:!1},ap=["canvas","webgl"];class op extends(Ud()){constructor(e){super({attributions:e.attributions,canvasFunction:function(e,r,i,s,n){var a=s[0]/i,o=s[1]/i,l=t.map.getSize()[0],h=t.map.getSize()[1];t.renderer||(t.renderer=function(e,r){let i;if(t.render===ap[0])i=new $d(t,{size:e,pixelRatio:r});else{let e=te.extend({},np),s=te.extend(e,{color:t.color,opacity:t.opacity,radius:t.radius,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline,onClick:t.onClick,onHover:t.onHover});(s=te.extend(t,s)).pixelRatio=r,s.container=t.map.getViewport().getElementsByClassName("ol-overlaycontainer")[0],s.onBeforeRender=function(){return!1},s.onAfterRender=function(){return!1},i=new Kd(t,s)}return i}(s,i));t.renderer.mapWidth=a,t.renderer.mapHeight=o,t.renderer.pixelRatio=i,t.renderer.offset=[(a-l)/2,(o-h)/2];let u=this.getGraphicsInExtent(e);if(t.renderer._clearBuffer(),t.renderer.selected=this.selected,t.renderer.drawGraphics(u),t.isDeckGLRender=t.renderer instanceof Kd,t.isDeckGLRender)return t.context||(t.context=$o.createCanvasContext2D(a,o)),t.context.canvas;return t.renderer.getCanvas()},logo:"4"===$o.getOlVersion()?e.logo:null,projection:e.projection,ratio:e.ratio,resolutions:e.resolutions,state:e.state}),this.graphics=[].concat(e.graphics),this.map=e.map,te.extend(this,e),this.render=e.render||ap[0],$o.supportWebGL2()||(this.render=ap[0]),this.highLightStyle=e.highLightStyle,this.isHighLight=void 0===e.isHighLight||e.isHighLight,this.hitGraphicLayer=null,this._forEachFeatureAtCoordinate=function(e,r,i,s,n){let a=t.getGraphicsInExtent();t._highLightClose();for(let t=a.length-1;t>=0;t--){let o=a[t].getStyle();if(!o)return;if(o instanceof Wd)continue;let l=a[t].getGeometry().getCoordinates(),h=new(al())({image:o}).getImage(),u=!1;if(h instanceof Hd&&1===h.getCount()){const e=180*h.getRotation()/Math.PI,t=Number.parseFloat(h.getAngle()),i=h.getRadius()*r;let n=null;if(t>355)n=new(cl())(l,i);else{const r=[];r.push(l);const s=t/8;for(let t=0;t<8;t++){const n=(e+t*s)/180*Math.PI;r.push([l[0]+i*Math.cos(n),l[1]-i*Math.sin(n)])}r.push(l),n=new(rp())([r])}n.intersectsCoordinate(this.map.getCoordinateFromPixel(s))&&(u=!0)}else{let t=[];t[0]=l[0]-h.getAnchor()[0]*r,t[2]=l[0]+h.getAnchor()[0]*r,t[1]=l[1]-h.getAnchor()[1]*r,t[3]=l[1]+h.getAnchor()[1]*r,Gl.containsCoordinate(t,e)&&(u=!0)}!0!==u||i&&i(a[t],n)}return},this._options=e;const t=this;e.onClick&&t.map.on("click",function(r){if(t.isDeckGLRender){const i=t.renderer.deckGL.pickObject({x:r.pixel[0],y:r.pixel[1]});return void e.onClick(i)}const i=t.findGraphicByPixel(r,t);i&&(e.onClick(i,r),t.isHighLight&&t._highLight(i.getGeometry().getCoordinates(),new(al())({image:i.getStyle()}).getImage(),i,r.pixel))}),t.map.on("pointermove",function(r){if(t.isDeckGLRender){const i=t.renderer.deckGL.pickObject({x:r.pixel[0],y:r.pixel[1]});e.onHover&&e.onHover(i)}})}findGraphicByPixel(e,t){const r=t.map.getFeaturesAtPixel(e.pixel)||[];for(let e=0;e<r.length;e++){const i=r[e];if(t.graphics.indexOf(i)>-1)return i}}setGraphics(e){this.graphics=this.graphics||[],this.graphics.length=0;let t=$o.isArray(e)?[].concat(e):[e];this.graphics=[].concat(t),this.update()}addGraphics(e){this.graphics=this.graphics||[];let t=$o.isArray(e)?[].concat(e):[e];this.graphics=this.graphics.concat(t),this.update()}getGraphicBy(e,t){let r=null;for(let i in this.graphics)if(this.graphics[i][e]===t){r=this.graphics[i];break}return r}getGraphicById(e){return this.getGraphicBy("id",e)}getGraphicsByAttribute(e,t){var r,i=[];for(let s in this.graphics)(r=this.graphics[s])&&r.attributes&&r.attributes[e]===t&&i.push(r);return i}removeGraphics(e=null){if(!e||0===e.length||e===this.graphics)return this.graphics.length=0,void this.update();te.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--){let r=e[t],i=te.indexOf(this.graphics,r);-1!==i&&this.graphics.splice(i,1)}this.update()}clear(){this.removeGraphics()}update(){this.renderer.update(this.graphics,this._getDefaultStyle())}_getDefaultStyle(){const e={};return this.color&&(e.fill=new(pl())({color:this.toRGBA(this.color)})),this.radius&&(e.radius=this.radius),this.outline&&(e.stroke=new(pl())({color:this.toRGBA(this.color),width:this.strokeWidth})),new(cl())(e)}toRGBA(e){return`rgba(${e[0]},${e[1]},${e[2]},${(e[3]||255)/255})`}setStyle(e){let t={color:this.color,radius:this.radius,opacity:this.opacity,highlightColor:this.highlightColor,radiusScale:this.radiusScale,radiusMinPixels:this.radiusMinPixels,radiusMaxPixels:this.radiusMaxPixels,strokeWidth:this.strokeWidth,outline:this.outline};te.extend(this,te.extend(t,e)),this.update()}getLayerState(){let e=this.map,t=e.getSize()[0],r=e.getSize()[1],i=e.getView(),s=i.getCenter(),n={longitude:s[0],latitude:s[1],zoom:i.getZoom(),maxZoom:i.getMaxZoom(),pitch:0,bearing:180*-i.getRotation()/Math.PI},a={};for(let e in n)a[e]=n[e];return a.width=t,a.height=r,a.color=this.color,a.radius=this.radius,a.opacity=this.opacity,a.highlightColor=this.highlightColor,a.radiusScale=this.radiusScale,a.radiusMinPixels=this.radiusMinPixels,a.radiusMaxPixels=this.radiusMaxPixels,a.strokeWidth=this.strokeWidth,a.outline=this.outline,a}_highLightClose(){this.selected=null,this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null),this.changed()}_highLight(e,t,r,i){if(r.getStyle()instanceof Hd){this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null);var s=this.map.getPixelFromCoordinate([e[0],e[1]]);i=i||[0,0];var n=Math.atan2(i[1]-s[1],i[0]-s[0])/Math.PI*180;n=n>0?n:360+n;var a=(Math.ceil(n/(t.getAngle()+t.getSpaceAngle()))-1)*(t.getAngle()+t.getSpaceAngle()),o={stroke:new(yl())({color:"#ff0000",width:1}),fill:new(pl())({color:"#0099ff"}),radius:t.getRadius(),angle:t.getAngle(),eAngle:a+t.getAngle(),sAngle:a,rotation:t.getRotation()};this.highLightStyle&&this.highLightStyle instanceof Wd&&(o.stroke=this.highLightStyle.getStroke(),o.fill=this.highLightStyle.getFill(),o.radius=this.highLightStyle.getRadius(),o.angle=this.highLightStyle.getAngle());var l=new ep(new(Od())(e));l.setStyle(new Wd(o)),this.hitGraphicLayer=new(sp())({source:new op({map:this.map,graphics:[l]})}),this.map.addLayer(this.hitGraphicLayer)}else this.selected=r,this.changed()}getGraphicsInExtent(e){var t=[];return e?(this.graphics.forEach(r=>{Gl.containsExtent(e,r.getGeometry().getExtent())&&t.push(r)}),t):(this.graphics.forEach(e=>{t.push(e)}),t)}}class lp extends Vd{constructor(e,t){super(e,t),this.cache=t.cache||{},this.cacheFields=t.cacheFields||[],this.style=t.style||{},this.maxCacheCount=t.maxCacheCount||0,this.isCustomSetMaxCacheCount=void 0!==t.isCustomSetMaxCacheCount&&t.isCustomSetMaxCacheCount,this.nodesClipPixel=t.nodesClipPixel||2,this.isHoverAble=void 0!==t.isHoverAble&&t.isHoverAble,this.isMultiHover=void 0!==t.isMultiHover&&t.isMultiHover,this.isClickAble=void 0===t.isClickAble||t.isClickAble,this.highlightStyle=t.highlightStyle||null,this.isAllowFeatureStyle=void 0!==t.isAllowFeatureStyle&&t.isAllowFeatureStyle}destroy(){this.maxCacheCount=null,this.isCustomSetMaxCacheCount=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.cache=null,this.cacheFields=null,this.style=null,this.highlightStyle=null,this.isAllowFeatureStyle=null}addFeatures(e){this.dispatchEvent({type:"beforefeaturesadded",value:{features:e}}),this.features=this.toiClientFeature(e),this.isCustomSetMaxCacheCount||(this.maxCacheCount=5*this.features.length),this.renderer&&this.changed()}removeFeatures(e){this.clearCache(),Vd.prototype.removeFeatures.call(this,e)}removeAllFeatures(){this.clearCache(),Vd.prototype.removeAllFeatures.apply(this,arguments)}redrawThematicFeatures(e){var t=this.renderer.getHoverOne(),r=null;t&&t.refDataID&&(r=t.refDataID),this.renderer.clearAll();for(var i=this.features,s=this.cache,n=this.cacheFields,a=this.map.getView().getZoom(),o=this.maxCacheCount,l=0,h=i.length;l<h;l++){var u=i[l];if(u.geometry){var c=u.geometry.getBounds();if(e)if(!new ne(e[0],e[1],e[2],e[3]).intersectsBounds(c))continue;var d,p=u.id+"_zoom_"+a.toString();if(s[p])s[p].updateAndAddShapes();else{if((d=this.createThematicFeature(i[l])).getShapesCount()<1)continue;if(s[p]=d,n.push(p),n.length>o){var f=n[0];n.splice(0,1),delete s[f]}}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var y=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(y)}}createThematicFeature(e){var t=te.copyAttributesWithClip(this.style);e.style&&!0===this.isAllowFeatureStyle&&(t=te.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Sa.transformStyle(this.highlightStyle);for(var i=new Ca(e,this,Sa.transformStyle(t),r),s=0;s<i.shapes.length;s++)this.renderer.addShape(i.shapes[s]);return i}canvasFunctionInternal_(e,t,r,i,s){return Vd.prototype.canvasFunctionInternal_.apply(this,arguments)}clearCache(){this.cache={},this.cacheFields=[]}clear(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()}getCacheCount(){return this.cacheFields.length}setMaxCacheCount(e){isNaN(e)||(this.maxCacheCount=e,this.isCustomSetMaxCacheCount=!0)}getShapesByFeatureID(e){var t=[],r=this.renderer.getAllShapes();if(!e)return r;for(var i=0,s=r.length;i<s;i++){var n=r[i];n.refDataID&&e===n.refDataID&&t.push(n)}return t}}class hp extends lp{constructor(e,t){super(e,t),this.isOverLay=null==t.isOverLay||t.isOverLay,this.isAvoid=null==t.isAvoid||t.isAvoid,this.style=t.style,this.themeField=t.themeField,this.styleGroups=t.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",labelSelect:!0,_isGeoTextStrategyStyle:!0},this.getPxBoundsMode=0,this.labelFeatures=[]}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,super.destroy()}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Sa.transformStyle(this.highlightStyle);for(var i=new Ca(e,this,Sa.transformStyle(t),r),s=0;s<i.shapes.length;s++)this.renderer.addShape(i.shapes[s]);return i}redrawThematicFeatures(e){if(this.features.length>0&&0===this.labelFeatures.length)for(var t=this.setLabelsStyle(this.features),r=0,i=t.length;r<i;r++)this.labelFeatures.push(t[r]);this.features=this.getDrawnLabels(this.labelFeatures),super.redrawThematicFeatures.call(this,e)}removeFeatures(e){this.labelFeatures=[],super.removeFeatures.call(this,e)}removeAllFeatures(){this.labelFeatures=[],super.removeAllFeatures.call(this,arguments)}getDrawnLabels(e){var t,r,i,s,n=[],a=[],o={labelAlign:"cm",labelXOffset:0,labelYOffset:0},l=this.map,h=l.getSize();h={x:h[0],y:h[1]};for(var u=l.getView().getZoom(),c=0,d=e.length;c<d;c++){(r=e[c]).isStyleChange&&(r=this.setStyle(r));var p=this.getLabelPxLocation(r);if(p.x>=0&&p.x<=h.x&&p.y>=0&&p.y<=h.y){if(r.style.minZoomLevel>-1&&u<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&u>r.style.maxZoomLevel)continue;var f=null;r.isStyleChange?(r.isStyleChange=null,f=this.calculateLabelBounds(r,p)):f=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,p):this.calculateLabelBounds(r,p);var y=new ne(0,h.y,h.x,0),m=f.length;if(this.isAvoid){var g=this.getAvoidInfo(y,f);if(g){if("left"===g.aspectW){r.style.labelXOffset+=g.offsetX;for(let e=0;e<m;e++)f[e].x+=g.offsetX}else if("right"===g.aspectW){r.style.labelXOffset+=-g.offsetX;for(let e=0;e<m;e++)f[e].x+=-g.offsetX}if("top"===g.aspectH){r.style.labelYOffset+=g.offsetY;for(let e=0;e<m;e++)f[e].y+=g.offsetY}else if("bottom"===g.aspectH){r.style.labelYOffset+=-g.offsetY;for(let e=0;e<m;e++)f[e].y+=-g.offsetY}r.isStyleChange=!0}}if(this.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<m-1;e++)b.push(l.getCoordinateFromPixel([f[e].x,f[e].y]));var S=new ne(b[3][0],b[3][1],b[1][0],[b[1][1]]).getCenterLonLat(),x=new ce(S.lon,S.lat,r.attributes[this.themeField]);x.calculateBounds(),i=te.cloneObject(r.style),s=te.cloneObject(te.copyAttributes(i,o)),(t=new Ee(x,r.attributes,s)).id=r.id,t.fid=r.fid,n.push(t)}}return n}getStyleByData(e){var t=e;if(t.style=te.copyAttributes(t.style,this.defaultStyle),this.style&&this.style.fontSize&&parseFloat(this.style.fontSize)<12&&(this.style.fontSize="12px"),t.style=te.copyAttributes(t.style,this.style),this.themeField&&this.styleGroups&&t.attributes){var r=this.themeField,i=t.attributes,s=this.styleGroups,n=!1,a=null;for(var o in i)if(r===o){n=!0,a=i[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=te.copyAttributes(t.style,u)}t.style.label=t.attributes[this.themeField]}return t.style}setLabelsStyle(e){for(var t,r=[],i=0,s=e.length;i<s;i++){var n=e[i];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,r.push(t)}return r}setStyle(e){var t=e;if(t.style=te.copyAttributes(t.style,this.defaultStyle),this.style&&this.style.fontSize&&parseFloat(this.style.fontSize)<12&&(this.style.fontSize="12px"),t.style=te.copyAttributes(t.style,this.style),this.groupField&&this.styleGroups&&t.attributes){var r=this.groupField,i=t.attributes,s=this.styleGroups,n=!1,a=null;for(var o in i)if(r===o){n=!0,a=i[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=te.copyAttributes(t.style,u)}}return t.style.label=t.geometry.text,t}getLabelPxLocation(e){var t=e.geometry,r=e.style,i=t.getCentroid(),s=this.map.getPixelFromCoordinate([i.x,i.y]),n=new(Od())([s[0],s[1]]);if(r.labelXOffset||r.labelYOffset){var a=isNaN(r.labelXOffset)?0:r.labelXOffset,o=isNaN(r.labelYOffset)?0:r.labelYOffset;n.translate(a,-o)}return{x:n.getCoordinates()[0],y:n.getCoordinates()[1]}}calculateLabelBounds(e,t){var r=e.geometry,i=null,s=null;if(0==this.getPxBoundsMode)i=r.getLabelPxBoundsByText(t,e.style);else{if(1!==this.getPxBoundsMode)return null;s=this.getLabelInfo(e.geometry.getCentroid(),e.style),i=r.getLabelPxBoundsByLabel(t,s.w,s.h,e.style)}var n=[];return n=e.style.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,e.style.labelRotation),r.bounds=new ne(n[1].x,n[3].y,n[2].x,n[4].y),n}calculateLabelBounds2(e,t){var r,i,s,n,a,o=e.geometry.bsInfo,l=e.style,h=te.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}i=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,r=new ne(i,s,a,n);var u=[];return u=l.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,l.labelRotation),e.geometry.bounds=new ne(u[1].x,u[3].y,u[2].x,u[4].y),u}getLabelInfo(e,t){var r={l:"left",r:"right",t:"top",b:"bottom"},i={l:0,r:-1,t:0,b:-1};t=te.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"),y=f.length;if(h.fillText){h.font=p,h.textAlign=r[t.labelAlign[0]]||"center",h.textBaseline=r[t.labelAlign[1]]||"middle",null==(u=i[t.labelAlign[1]])&&(u=-.5),c=h.measureText("Mg").height||h.measureText("xx").width,s[1]+=c*u*(y-1);for(let e=0;e<y;e++)n<(d=h.measureText(f[e]).width)&&(n=d)}else if(h.mozDrawText){h.mozTextStyle=p,null==(u=i[t.labelAlign[1]])&&(u=-.5),c=h.mozMeasureText("xx"),s[1]+=c*(1+u*y);for(let e=0;e<y;e++)n<(d=h.measureText(f[e]).width)&&(n=d)}var m={};return n?(m.w=n,m.h=t.fontSize,m.rows=f.length,m):null}rotationBounds(e,t,r){var i=new(Od())([e.left,e.top]),s=new(Od())([e.right,e.top]),n=new(Od())([e.right,e.bottom]),a=new(Od())([e.left,e.bottom]),o=[];o.push(this.getRotatedLocation(i.getCoordinates()[0],i.getCoordinates()[1],t.x,t.y,r)),o.push(this.getRotatedLocation(s.getCoordinates()[0],s.getCoordinates()[1],t.x,t.y,r)),o.push(this.getRotatedLocation(n.getCoordinates()[0],n.getCoordinates()[1],t.x,t.y,r)),o.push(this.getRotatedLocation(a.getCoordinates()[0],a.getCoordinates()[1],t.x,t.y,r));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(e,t,r,i,s){var n,a,o={};return t=-t,i=-i,s=-s,n=(e-r)*Math.cos(s/180*Math.PI)-(t-i)*Math.sin(s/180*Math.PI)+r,a=(e-r)*Math.sin(s/180*Math.PI)+(t-i)*Math.cos(s/180*Math.PI)+i,o.x=n,o.y=-a,o}getAvoidInfo(e,t){if(5!==t.length)return null;for(var r=[{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}],i=!1,s=r.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"===te.lineIntersection(r[u],r[u+1],t[c],t[c+1]).CLASS_NAME&&(d(t[c]),d(t[c+1]),i=!0)}return i?{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 r=Math.abs(e.top-t.y);r>o&&(o=r,l="top")}if(t.y>e.bottom){let r=Math.abs(t.y-e.bottom);r>o&&(o=r,l="bottom")}if(t.x<e.left){let r=Math.abs(e.left-t.x);r>a&&(a=r,h="left")}if(t.x>e.right){let r=Math.abs(t.x-e.right);r>a&&(a=r,h="right")}}}}isQuadrilateralOverLap(e,t){var r=e.length,i=t.length;if(5!==r||5!==i)return null;var s=!1;for(let i=0;i<r;i++)if(this.isPointInPoly(e[i],t)){s=!0;break}for(let r=0;r<i;r++)if(this.isPointInPoly(t[r],e)){s=!0;break}for(let a=0;a<r-1&&!s;a++)for(var n=0;n<i-1;n++){if("SuperMap.Geometry.Point"===te.lineIntersection(e[a],e[a+1],t[n],t[n+1]).CLASS_NAME){s=!0;break}}return s}isPointInPoly(e,t){for(var r=!1,i=-1,s=t.length,n=s-1;++i<s;n=i)(t[i].y<=e.y&&e.y<t[n].y||t[n].y<=e.y&&e.y<t[i].y)&&e.x<(t[n].x-t[i].x)*(e.y-t[i].y)/(t[n].y-t[i].y)+t[i].x&&(r=!r);return r}canvasFunctionInternal_(e,t,r,i,s){return super.canvasFunctionInternal_.apply(this,arguments)}}class up{constructor(e){this.options=e||{},this.enableMassClear=this.options.enableMassClear,this._map=e.map,this.paneName=this.options.paneName||"mapPane",this.context=this.options.context||"2d",this.zIndex=this.options.zIndex||2,this.mixBlendMode=this.options.mixBlendMode||null,this.width=e.width,this.height=e.height,this.initialize()}initialize(){var e=this.canvas=document.createElement("canvas");e.style.cssText="position:absolute;left:0;top:0;z-index:"+this.zIndex+";user-select:none;",e.style.mixBlendMode=this.mixBlendMode,e.className="mapvClass";var t="undefined"==typeof window?{}:window,r=this.devicePixelRatio=t.devicePixelRatio||1;e.width=parseInt(this.width)*r,e.height=parseInt(this.height)*r,"2d"===this.context&&e.getContext(this.context).scale(r,r),e.style.width=this.width+"px",e.style.height=this.height+"px","webgl"===this.context&&this.canvas.getContext(this.context).viewport(0,0,e.width,e.height)}draw(){this.options.update&&this.options.update.call(this)}resize(e,t){var r="undefined"==typeof window?{}:window,i=this.devicePixelRatio=r.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=t*i,"2d"===this.context&&this.canvas.getContext("2d").scale(i,i),this.canvas.style.width=e+"px",this.canvas.style.height=t+"px","webgl"===this.context&&this.canvas.getContext(this.context).viewport(0,0,this.canvas.width,this.canvas.height)}getContainer(){return this.canvas}setZIndex(e){this.canvas.style.zIndex=e}getZIndex(){return this.zIndex}}const cp=function(){try{return mapv}catch(e){return{}}}(),dp=ol.interaction.Pointer;var pp=r.n(dp),fp=cp.baiduMapLayer?cp.baiduMapLayer.__proto__:Function;class yp extends fp{constructor(e,t,r,i,s,n){super(e,t,r),this.dataSet=t,this.mapWidth=i,this.mapHeight=s;var a=this;r=r||{},this.source=n,a.animator=null,a.map=e,a.init(r),a.argCheck(r),this.canvasLayer=new up({map:e,context:this.context,paneName:r.paneName,mixBlendMode:r.mixBlendMode,enableMassClear:r.enableMassClear,zIndex:r.zIndex,width:i,height:s,update:function(){a._canvasUpdate()}}),this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),e.on("movestart",this.moveStartEvent.bind(this)),e.on("moveend",this.moveEndEvent.bind(this)),e.getView().on("change:center",this.zoomEvent.bind(this)),e.getView().on("change:size",this.sizeEvent.bind(this)),e.on("pointerdrag",this.dragEvent.bind(this)),this.bindEvent()}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()}clickEvent(e){var t=e.pixel;super.clickEvent({x:t[0]+this.offset[0],y:t[1]+this.offset[1]},e)}mousemoveEvent(e){var t=e.pixel;super.mousemoveEvent({x:t[0],y:t[1]},e)}dragEvent(){this.clear(this.getContext())}zoomEvent(){this.clear(this.getContext())}sizeEvent(){this.canvasLayer.resize()}moveStartEvent(){var e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}moveEndEvent(){this.canvasLayer.draw()}bindEvent(){var e=this,t=e.map;e.options.methods&&(e.options.methods.click&&t.on("click",e.clickEvent),e.options.methods.mousemove&&(e.pointerInteraction=new(pp()),e.pointerInteraction.handleMoveEvent_=function(t){e.mousemoveEvent(t)},t.addInteraction(e.pointerInteraction)))}unbindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.un("click",this.clickEvent),this.options.methods.mousemove&&e.removeInteraction(this.pointerInteraction))}addData(e,t){var r=e;e&&e.get&&(r=e.get()),this.dataSet.add(r),this.update({options:t})}update(e){var t=e||{},r=t.data;r&&r.get&&(r=r.get()),void 0!=r&&this.dataSet.set(r),super.update({options:t.options})}draw(){this.canvasLayer.draw()}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,r=t.options.animation,i=t.map,s=t.canvasLayer.canvas.getContext(t.context);if(t.isEnabledTime()){if(void 0===e)return void t.clear(s);t.context&&"2d"!==t.context||(s.save(),s.globalCompositeOperation="destination-out",s.fillStyle="rgba(0, 0, 0, .1)",s.fillRect(0,0,s.canvas.width,s.canvas.height),s.restore())}else this.clear(s);if(t.context&&"2d"!==t.context)s.clear(s.COLOR_BUFFER_BIT);else for(var n in t.options)s[n]=t.options[n];var a=i.getView().calculateExtent(),o=i.getPixelFromCoordinate([a[0],a[3]]);t._mapCenter=i.getView().getCenter(),t._mapCenterPx=i.getPixelFromCoordinate(t._mapCenter),t._reselutions=i.getView().getResolution(),t._rotation=-i.getView().getRotation();var l=t._reselutions,h=1;if("2d"!=this.context){var u=("undefined"==typeof window?{}:window).devicePixelRatio||1;h=u}var c={transferCoordinate:function(e){var r=(e[0]-t._mapCenter[0])/t._reselutions,i=(t._mapCenter[1]-e[1])/t._reselutions,s=[r+t._mapCenterPx[0],i+t._mapCenterPx[1]];return[((s=function(e,t,r){var i=(e[0]-t[0])*r+t[0],s=(e[1]-t[1])*r+t[1];return[i,s]}(s,t._mapCenterPx,1))[0]+t.offset[0])*h,(s[1]+t.offset[1])*h]}};void 0!==e&&(c.filter=function(t){var i=r.trails||10;return e&&t.time>e-i&&t.time<e}),t.isEnabledTime()&&!t.notFirst&&(t.canvasLayer.resize(t.mapWidth,t.mapHeight),t.notFirst=!0);var d=t.dataSet.get(c);t.processData(d),"m"===t.options.unit?(t.options.size&&(t.options._size=t.options.size/l),t.options.width&&(t.options._width=t.options.width/l),t.options.height&&(t.options._height=t.options.height/l)):(t.options._size=t.options.size,t.options._height=t.options.height,t.options._width=t.options.width);var p=i.getPixelFromCoordinate([0,0]);p=[p[0]-o[0],p[1]-o[1]],this.drawContext(s,d,t.options,{x:p[0],y:p[1]}),t.isEnabledTime()&&this.source.changed(),t.options.updateCallback&&t.options.updateCallback(e)}}isEnabledTime(){var e=this.options.animation;return e&&!(!1===e.enabled)}argCheck(e){"heatmap"===e.draw&&e.strokeStyle&&console.warn("[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]")}getContext(){return this.canvasLayer.canvas.getContext(this.context)}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}}class mp extends(Ud()){constructor(e){var t=e||{};super({attributions:t.attributions||"© 2018 百度 MapV with <span>© SuperMap iClient</span>",canvasFunction:function(e,t,r,i,s){var n=i[0]/r,a=i[1]/r,o=this.map.getSize()[0],l=this.map.getSize()[1];this.layer||(this.layer=new yp(this.map,this.dataSet,this.mapvOptions,n,a,this));this.layer.pixelRatio=r,this.layer.offset=[(n-o)/2,(a-l)/2],this.rotate?this.rotate!==this.map.getView().getRotation()&&(this.layer.canvasLayer.resize(n,a),this.rotate=this.map.getView().getRotation()):this.rotate=this.map.getView().getRotation();var h=this.layer.canvasLayer.canvas;this.layer.isEnabledTime()||(this.layer.canvasLayer.resize(n,a),this.layer.canvasLayer.draw());this.context||(this.context=$o.createCanvasContext2D(n,a));var u=this.context.canvas;this.context.clearRect(0,0,u.width,u.height),u.width=i[0],u.height=i[1],u.style.width=i[0]+"px",u.style.height=i[1]+"px",this.context.drawImage(h,0,0),(this.resolution!==t||JSON.stringify(this.extent)!==JSON.stringify(e))&&(this.resolution=t,this.extent=e);return this.context.canvas},logo:"4"===$o.getOlVersion()?t.logo:null,projection:t.projection,ratio:t.ratio,resolutions:t.resolutions,state:t.state}),this.map=e.map,this.dataSet=e.dataSet,this.mapvOptions=e.mapvOptions}addData(e,t){this.layer.addData(e,t)}getData(){return this.layer&&(this.dataSet=this.layer.getData()),this.dataSet}removeData(e){this.layer&&this.layer.removeData(e)}clearData(){this.layer.clearData()}update(e){this.layer.update(e),this.changed()}}class gp extends lp{constructor(e,t){super(e,t),this.style=t.style,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle,this.themeField=t.themeField,this.styleGroups=t.styleGroups}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,lp.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Sa.transformStyle(this.highlightStyle);for(var i=new Ca(e,this,Sa.transformStyle(t),r),s=0;s<i.shapes.length;s++)this.renderer.addShape(i.shapes[s]);return i}getStyleByData(e){var t={},r=e;if(t=te.copyAttributesWithClip(t,this.style),this.themeField&&this.styleGroups&&this.styleGroups.length>0&&r.attributes){var i=this.themeField,s=r.attributes,n=this.styleGroups,a=!1,o=null;for(var l in s)if(i===l){a=!0,o=s[l];break}if(a)for(var h=0,u=n.length;h<u;h++)if(o>=n[h].start&&o<n[h].end){var c=n[h].style;t=te.copyAttributesWithClip(t,c)}}return r.style&&!0===this.isAllowFeatureStyle&&(t=te.copyAttributesWithClip(r.style)),t}canvasFunctionInternal_(e,t,r,i,s){return lp.prototype.canvasFunctionInternal_.apply(this,arguments)}}class vp extends Jd{constructor(e,t,r){super(e,t,r),this.symbolType=t,this.symbolSetting=r.symbolSetting,this.themeField=r.themeField}destroy(){this.symbolType=null,this.symbolSetting=null,this.themeField=null,Jd.prototype.destroy.apply(this,arguments)}setSymbolType(e){this.symbolType=e,this.redraw()}createThematicFeature(e){var t;return xa[this.symbolType]&&this.themeField&&this.symbolSetting&&(t=new xa[this.symbolType](e,this,[this.themeField],this.symbolSetting)),!!t&&(t.assembleShapes(),t)}canvasFunctionInternal_(e,t,r,i,s){return Jd.prototype.canvasFunctionInternal_.apply(this,arguments)}}const bp=function(){try{return turf}catch(e){return{}}}();class Sp extends(qo()){constructor(e){var t=e||{};super({attributions:t.attributions||"<span>© turfjs</span> with <span>© SuperMap iClient</span>",features:t.features,format:t.format,extent:t.extent,logo:"4"===$o.getOlVersion()?t.logo:null,projection:t.projection,wrapX:t.wrapX}),this.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"]},this.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(e,t,r,i){var s;try{s=bp[e.split(".")[1]].apply(this,this.parse(e,t))}catch(r){s=bp[e.split(".")[1]].apply(this,this.parseOption(e,t))}var n=null;try{n=(new(Dl())).readFeatures(s)}catch(e){return void(r&&r(s))}(i=null==i||i)&&this.addFeatures(n),r&&r(s)}parse(e,t){if("Transformation.union"===e)return t.A;var r=[],i=this.turfMap[e];return i&&i.map(function(e){return r.push(t[e]),t[e]}),r}parseOption(e,t){var r=[];return this.turfOptionMap[e].map(function(e){if(e instanceof Object){var i=e;Object.keys(i).forEach(function(e){i[e]=t[e]}),r.push(i)}else r.push(t[e]);return t}),r}}class xp extends lp{constructor(e,t){super(e,t),this.themeField=t.themeField,this.style=t.style,this.styleGroups=t.styleGroups,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,lp.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Sa.transformStyle(this.highlightStyle);for(var i=new Ca(e,this,Sa.transformStyle(t),r),s=0;s<i.shapes.length;s++)this.renderer.addShape(i.shapes[s]);return i}getStyleByData(e){var t={},r=e;if(t=te.copyAttributesWithClip(t,this.style),this.themeField&&this.styleGroups&&this.styleGroups.length>0&&r.attributes){var i=this.themeField,s=r.attributes,n=this.styleGroups,a=!1,o=null;for(var l in s)if(i===l){a=!0,o=s[l];break}if(a)for(var h=0,u=n.length;h<u;h++)if(o.toString()===n[h].value.toString()){var c=n[h].style;t=te.copyAttributesWithClip(t,c)}}return r.style&&!0===this.isAllowFeatureStyle&&(t=te.copyAttributesWithClip(r.style)),t}canvasFunctionInternal_(e,t,r,i,s){return lp.prototype.canvasFunctionInternal_.apply(this,arguments)}}class _p extends(vo()){constructor(e){if(super(),e){var t=!1;void 0!==e.donotNeedServerCartoCss&&(t=e.donotNeedServerCartoCss),_p.setDonotNeedServerCartoCss(t),e.view&&_p.setView(e.view),e.url&&_p.setUrl(e.url),e.cartoCss&&_p.setCartoCss(e.cartoCss);var r=new(al())({image:new(cl())({radius:5,fill:new(pl())({color:"blue"})})});e.selectedPointStyle&&(r=e.selectedPointStyle),_p.setSelectedPointStyle(r);var i=new(al())({stroke:new(yl())({color:"blue",width:3})});e.selectedLineStyle&&(i=e.selectedLineStyle),_p.setSelectedLineStyle(i);var s=new(al())({fill:new(pl())({color:[0,0,255,.5]}),stroke:new(yl())({color:"blue",width:3})});e.selectedRegionStyle&&(s=e.selectedRegionStyle),_p.setSelectedRegionStyle(s);var n=new(al())({text:new(gl())({font:"15px Microsoft YaHei",fill:new(pl())({color:"blue"}),stroke:new(yl())({color:"white",width:1})})});e.selectedTextStyle&&(n=e.selectedTextStyle),_p.setSelectedTextStyle(n);var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4==a.readyState){for(var e=JSON.parse(a.responseText),t={},r=0,i=e.length;r<i;r++)for(var s=e[r].subLayers.layers,n=0,o=s.length;n<o;n++)s[n].layerIndex=o-n,t[s[n].name]=s[n];if(_p.setLayersInfo(t),!_p.getDonotNeedServerCartoCss()){var l=new XMLHttpRequest;l.open("GET",te.urlPathAppend(_p.getUrl(),"tileFeature/vectorstyles.json"),!1),l.onreadystatechange=function(){if(4==l.readyState){var e,r=(new Pe).read(l.responseText);if(r.style&&"cartoCSS"===r.type){e=(e=(e=r.style).replace(/[@]/gi,"___")).replace(/\\#/gi,"___");var i={};t&&Object.keys(t).sort().forEach(function(t){var r=t.replace(/[@#\s]/gi,"___"),s=t,n=Object.keys(i);for(let e=n.length;e>-1;e--)if(t.indexOf(n[e])>-1){s=t.replace(n[e],i[n[e]]);break}s=s.replace(/[#]/gi,"#"),i[t]=r,e=e.replace(new RegExp(s,"g"),r)}),e=(e=e.replace(/[#]/gi,"\n#")).replace(/\[zoom/gi,"[scale")}var s={};new Yn(e).getShaders().forEach(function(e){return s[e.elements[0].clean]=s[e.elements[0].clean]||{},s[e.elements[0].clean][e.attachment]=s[e.elements[0].clean][e.attachment]||[],s[e.elements[0].clean][e.attachment].push(e),e}),_p.setCartoShaders(s)}},l.send(null)}if(_p.getCartoCss()){var h={};new Yn(_p.getCartoCss()).getShaders().forEach(function(e){return h[e.elements[0].clean]=h[e.elements[0].clean]||{},h[e.elements[0].clean][e.attachment]=h[e.elements[0].clean][e.attachment]||[],h[e.elements[0].clean][e.attachment].push(e),e}),_p.setClientCartoShaders(h)}}},a.open("GET",te.urlPathAppend(_p.getUrl(),"layers.json"),!1),a.send(null),this.on("featureSelected",function(e){_p.setSelectedId(e.selectedId),_p.setLayerName(e.layerName)})}}static setCartoShaders(e){this.cartoShaders=e}static getCartoShaders(){return this.cartoShaders}static setClientCartoShaders(e){this.clientCartoShaders=e}static getClientCartoShaders(){return this.clientCartoShaders}static setCartoCss(e){this.cartoCss=e}static getCartoCss(){return this.cartoCss}static setDonotNeedServerCartoCss(e){this.donotNeedServerCartoCss=e}static getDonotNeedServerCartoCss(){return this.donotNeedServerCartoCss}static setLayersInfo(e){this.layersInfo=e}static getLayersInfo(){return this.layersInfo}static setUrl(e){this.url=e}static getUrl(){return this.url}static setView(e){this.view=e}static getView(){return this.view}static setSelectedId(e){this.selectedId=e}static getSelectedId(){return this.selectedId}static setLayerName(e){this.layerName=e}static getLayerName(){return this.layerName}static setSelectedPointStyle(e){this.selectedPointStyle=e}static setSelectedLineStyle(e){this.selectedLineStyle=e}static setSelectedRegionStyle(e){this.selectedRegionStyle=e}static setSelectedTextStyle(e){this.selectedTextStyle=e}static getSelectedStyle(e){return"POINT"===e||"MULTIPOINT"===e?this.selectedPointStyle:"LINESTRING"===e||"MULTILINESTRING"===e?this.selectedLineStyle:"POLYGON"===e||"MULTIPOLYGON"===e?this.selectedRegionStyle:"TEXT"===e?this.selectedTextStyle:void 0}static getLayerInfo(e){var t=_p.getLayersInfo();if(void 0===t)return null;var r=t[e];if(!r)return null;var i={layerIndex:r.layerIndex,ugcLayerType:r.ugcLayerType};switch(r.ugcLayerType){case"VECTOR":i.layerStyle=r.style?r.style:null;break;case"THEME":var s=r.theme;i.layerStyle=s?s.defaultStyle:null,s&&"LABEL"===s.type&&(i.type=s.type,i.textField=s.labelExpression);break;default:r.style&&(i.layerStyle=r.style)}return i}static getStyle(e,t){var r=_p.getUrl(),i=_p.getView(),s=i.getZoom(),n=$o.resolutionToScale(i.getResolution(),96,l.METER),a=e.replace(/(@)/gi,"___").replace(/(#)/gi,"___");if(_p.getCartoCss()&&_p.getClientCartoShaders()[a])return u(_p.getClientCartoShaders()[a]);var o=_p.getLayerInfo(e);if(!_p.getDonotNeedServerCartoCss()&&_p.getCartoShaders()[a]){if(t.getProperties().textStyle||t.getProperties().TEXT_FEATURE_CONTENT||"LABEL"==o.type&&o.textField){var h=xl.getValidStyleFromLayerInfo(o,t,r);return"POINT"===t.getGeometry().getType().toUpperCase()&&(h=function(e,t,r){var i=xl.getValidStyleFromLayerInfo(e,t,r);if("LABEL"==e.type){t.setProperties({type:"TEXT"});for(var s=u(_p.getCartoShaders()[a]),n=i.getText(),o=0;o<s.length;o++)n?n.setText(s[o].getText().getText()):n=s[o].getText();return i.setText(n),i}return i}(o,t,r)),h}return u(_p.getCartoShaders()[a])}if(o)return xl.getValidStyleFromLayerInfo(o,t,r);function u(e){var i=[];for(var a in e)e[a].map(function(e){return i.push(xl.getStyleFromCarto(s,n,e,t,!0,r)),e});return i}}getFeatureStyle(e){var t,r=e.getProperties().layerName||e.getProperties().layer,i=e.getProperties().id||parseInt(e.getProperties().SmID);if(e.getProperties().type&&"TEXT"===e.getProperties().type.toUpperCase()?(t=_p.getSelectedStyle(e.getProperties().type.toUpperCase()),e.getProperties().texts?t.getText().text_=e.getProperties().texts[0]:t.getText().text_=""):t=_p.getSelectedStyle(e.getGeometry().getType().toUpperCase()),t){var s=_p.getLayerName(),n=_p.getSelectedId();if(s===r&&i===n)return t}return _p.getStyle(r,e)}}const wp=ol.source.VectorTile;var Cp=r.n(wp);const Ap=ol.format.MVT;var Mp,Tp=r.n(Ap);class Ep extends(Cp()){constructor(e){void 0===e.url&&void 0===e.style&&console.error("one of 'options.style' or 'options.style' is required");var t=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,s=/\{-y\}/g;e.attributions=e.attributions||"Tile Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>",["4","5"].indexOf($o.getOlVersion())<0&&(e.tileSize=e.format instanceof Tp()&&e.style?512:256),super({attributions:e.attributions,cacheSize:e.cacheSize,format:e.format||new(Dl()),logo:"4"===$o.getOlVersion()?e.logo:null,overlaps:e.overlaps,projection:e.projection,state:e.format instanceof Tp()&&e.style&&"[object String]"==Object.prototype.toString.call(e.style)?"loading":e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction||(e.format instanceof Tp()&&e.style?function(e){return e?n._tileUrl.replace(t,e[0].toString()).replace(r,e[1].toString()).replace(i,function(){var t=["4","5"].indexOf($o.getOlVersion())>-1?-e[2]-1:e[2];return t.toString()}).replace(s,function(){var t=e[0],r=n.tileGrid.getFullTileRange(t),i=r.getHeight()+e[2];return i.toString()}):void 0}:function(e,t,r){n.tileGrid||(n.tileGrid=n.getTileGridForProjection(r));var i=e[0],s=e[1],a=["4","5"].indexOf($o.getOlVersion())>-1?-e[2]-1:e[2],o=Yl.toSize(n.tileGrid.getTileSize(i,n.tmpSize)),h="";if("ZXY"===n.tileType)h="&width="+o[0]+"&height="+o[1]+"&x="+s+"&y="+a+"&z="+i;else if("ViewBounds"===n.tileType){var u=n.tileGrid.getTileCoordExtent(e);h="&width="+o[0]+"&height="+o[1]+"&viewBounds="+u[0]+","+u[1]+","+u[2]+","+u[3]}else{var c=n.tileGrid.getOrigin(i),d=n.tileGrid.getResolution(i),p=r.getUnits()||"degrees";"degrees"===p&&(p=l.DEGREE),"m"===p&&(p=l.METER);var f=$o.resolutionToScale(d,96,p);h="&x="+s+"&y="+a+"&width="+o[0]+"&height="+o[1]+"&scale="+f+"&origin={'x':"+c[0]+",'y':"+c[1]+"}"}return n._tileUrl+encodeURI(h)}),tileLoadFunction:e.tileLoadFunction||(e.format instanceof Tp()?function(e,t){const r=e.getFormat(),i=e.onLoad.bind(e),s=e.onError.bind(e);e.setLoader(function(e,a,o){const l=new XMLHttpRequest;l.open("GET","function"==typeof t?t(e,a,o):t,!0),"arraybuffer"==r.getType()&&(l.responseType="arraybuffer"),l.withCredentials=n.withCredentials,l.onload=function(){if(!l.status||l.status>=200&&l.status<300){const t=r.getType();let n=void 0;"json"===t||"text"===t?n=l.responseText:"xml"===t?(n=l.responseXML)||(n=(new DOMParser).parseFromString(l.responseText,"application/xml")):"arraybuffer"===t&&(n=l.response),n?["4","5"].indexOf($o.getOlVersion())>-1?i.call(this,r.readFeatures(n,{featureProjection:o}),r.readProjection(n),r.getLastExtent()):i.call(this,r.readFeatures(n,{extent:e,featureProjection:o}),r.readProjection(n)):s.call(this)}else s.call(this)}.bind(this),l.onerror=function(){s.call(this)}.bind(this),l.send()})}:function(e,t){var r=new RegExp("(^|\\?|&)width=([^&]*)(\\s|&|$)"),i=new RegExp("(^|\\?|&)height=([^&]*)(\\s|&|$)"),s=Number(t.match(r)[2]),n=Number(t.match(i)[2]);e.setLoader(function(r,i,a){Ue.get(t).then(function(t){if(e.getFormat()instanceof Dl())return t.json()}).then(function(t){var i=[];if(e.getFormat()instanceof Dl()){t.recordsets.map(function(e){return e.features.map(function(e){for(var t=[],r=0,i=0;i<e.geometry.parts.length;i++){for(var s=2*e.geometry.parts[i],n=0,a=r;n<s;n+=2,a+=2)t.push(new he(e.geometry.points[a],e.geometry.points[a+1]));r+=s}return e.geometry.points=t,e}),e}),t.recordsets.map(function(e){return e.features.map(function(t){return t.layerName=e.layerName,t.type=t.geometry.type,i.push(t),t}),e});let o=new(Ko())({extent:[0,0,256,256],code:"TILE_PIXELS",units:"tile-pixels"});["4","5"].indexOf($o.getOlVersion())>-1?(e.setExtent([0,0,s,n]),e.setProjection(o),i=e.getFormat().readFeatures($o.toGeoJSON(i))):i=e.getFormat().readFeatures($o.toGeoJSON(i),{extent:r,dataProjection:o,featureProjection:a}),e.setFeatures(i)}})})}),wrapX:void 0!==e.wrapX&&e.wrapX,tileSize:e.tileSize||null,zDirection:["4","5"].indexOf($o.getOlVersion())>-1?null:0});var n=this;if(n.withCredentials=e.withCredentials,n._tileType=e.tileType||"ScaleXY",this.vectorTileStyles=new _p,e.format instanceof Tp()&&e.style)if("[object String]"==Object.prototype.toString.call(e.style)){var a=Ve.appendCredential(e.style);Ue.get(a,null,{withCredentials:e.withCredentials}).then(e=>e.json()).then(t=>{this._fillByStyleJSON(t,e.source),this.setState("ready")})}else this._fillByStyleJSON(e.style,e.source);else this._fillByRestMapOptions(e.url,e)}_fillByStyleJSON(e,t){if(t||(t=Object.keys(e.sources)[0]),e.sources&&e.sources[t]&&(this._tileUrl=Ve.appendCredential(e.sources[t].tiles[0])),e.metadata&&e.metadata.indexbounds){const t=e.metadata.indexbounds;var r=Math.max(t[2]-t[0],t[3]-t[1]);const i=[];for(let e=0;e<30;e++)i.push(r/512/Math.pow(2,e));this.tileGrid=new(Pl())({extent:e.metadata.indexbounds,resolutions:i,tileSize:[512,512]})}}_fillByRestMapOptions(e,t){this._tileUrl=te.urlPathAppend(t.url,"tileFeature.json"),t.format instanceof Tp()&&(this._tileUrl=te.urlPathAppend(t.url,"tileFeature.mvt")),this._tileUrl=Ve.appendCredential(this._tileUrl);var r=!0;void 0!==t.returnAttributes&&(r=t.returnAttributes);var i={};i.returnAttributes=r,void 0!==t._cache&&(i._cache=t._cache),void 0!==t.layersID&&(i.layersID=t.layersID),void 0!==t.layerNames&&(i.layerNames=t.layerNames),void 0!==t.expands&&(i.expands=t.expands),void 0!==t.compressTolerance&&(i.compressTolerance=t.compressTolerance),void 0!==t.coordinateType&&(i.coordinateType=t.coordinateType),void 0!==t.returnCutEdges&&(i.returnCutEdges=t.returnCutEdges),this._tileUrl=te.urlAppend(this._tileUrl,te.getParameterString(i))}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var i=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],s=function(){var e,r=i[2]-i[0],s=i[3]-i[1],n=r>=s?r:s;e=n===r?n/t.viewer.width:n/t.viewer.height;var a=[],o=l.METER;t.coordUnit===l.DEGREE&&(o=l.DEGREE);if(t.visibleScales.length>0){var h=function(e){var t=e.visibleScales;if(!t)return null;var r=e.viewBounds,i=e.coordUnit,s=e.viewer,n=e.scale,a=e.datumAxis;r=new ne(r.left,r.bottom,r.right,r.top),s=new J(s.rightBottom.x,s.rightBottom.y),i=i.toLowerCase(),a=a||6378137;var o=i,l=te.calculateDpi(r,s,n,o,a),h=function(e){if(null===e)return;var t,r;r=e.length,t=[r];for(var i=0;i<r;i++)t[i]=te.getResolutionFromScaleDpi(e[i],l,o,a);return t}(t),u=h.length;t=[u];for(var c=0;c<u;c++)t[c]=te.getScaleFromResolutionDpi(h[c],l,o,a);return t}(t);for(let e=0;e<h.length;e++)a.push($o.scaleToResolution(h[e],96,o))}else for(let t=0;t<17;t++)a.push(e/Math.pow(2,t));return a}();return r.tileGrid=new(Pl())({extent:i,resolutions:s}),r}}class Op extends(Ud()){constructor(e,t){var r=t||{};function i(e,t,r,i,s){var n=i[0]*r,a=i[1]*r;if(this.rootCanvas.width=this.maxWidth=n,this.rootCanvas.height=this.maxHeight=a,!this.features)return this.rootCanvas;this.pixelRatio=r;var o=this.map.getSize()[0]*r,l=this.map.getSize()[1]*r;return this.offset=[(n-o)/2/r,(a-l)/2/r],this.updateHeatPoints(t),this.rootCanvas}if(super({attributions:r.attributions||"Map Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>",canvasFunction:i,logo:"4"===$o.getOlVersion()?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state}),this.canvasFunctionInternal_=i,this.features=[],this.name=e,!r.map)throw new Error("options.map is not found.");this.map=r.map,this.id=r.id?r.id:te.createUniqueID("HeatMapSource_"),this.opacity=r.opacity?r.opacity:1,this.colors=r.colors?r.colors:["blue","cyan","lime","yellow","red"],this.useGeoUnit=!!r.useGeoUnit&&r.useGeoUnit,this.radius=r.radius?r.radius:50,this.featureWeight=r.featureWeight?r.featureWeight:null,this.maxWeight=null,this.minWeight=null,this.maxWidth=null,this.maxHeight=null,this.rootCanvas=document.createElement("canvas");var s=this.map.getSize();this.rootCanvas.width=this.maxWidth=parseInt(s[0]),this.rootCanvas.height=this.maxHeight=parseInt(s[1]),te.modifyDOMElement(this.rootCanvas,null,null,null,null,null,null,this.opacity),this.canvasContext=this.rootCanvas.getContext("2d")}addFeatures(e){this.features=this.toiClientFeature(e),this.changed()}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.rootCanvas;te.modifyDOMElement(t,null,null,null,null,null,null,e),null!==this.map&&this.changed()}}updateHeatPoints(e){this.features&&this.features.length>0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}convertFastToPixelPoints(e){var t,r,i,s,n,a,o=[];this.useRadius=this.useGeoUnit?parseInt(this.radius/e):this.radius;for(var l=0;l<this.features.length;l++){var h=this.features[l],u=h.geometry,c=this.getLocalXY(new se(u.x,u.y));this.featureWeight?(c.weight=h.attributes[this.featureWeight],this.maxWeight||(s=s||c.weight,n=n||c.weight,s=Math.max(s,c.weight),n=Math.min(n,c.weight))):c.weight=1,t=Math.floor(c[0]),r=Math.floor(c[1]),i=c.weight,o.push([t,r,i])}this.maxWeight?this.draw(o,this.maxWeight):(a=s&&n?(s+n)/2:1,this.draw(o,a))}draw(e,t){if(!(this.maxHeight>0&&this.maxWidth>0))return!1;var r=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var i=0;i<e.length;i++){var s=e[i];this.canvasContext.globalAlpha=Math.max(s[2]/t,.05),this.canvasContext.drawImage(this.circle,s[0]-this.useRadius,s[1]-this.useRadius)}var n=r.getImageData(0,0,this.maxWidth,this.maxHeight);this.colorize(n.data,this.grad),r.putImageData(n,0,0)}colorize(e,t){for(var r,i=0;i<e.length;i+=4)(r=4*e[i+3])&&(e[i]=t[r],e[i+1]=t[r+1],e[i+2]=t[r+2])}drawCircle(e){var t=e/2,r=this.circle=document.createElement("canvas"),i=r.getContext("2d");r.height=2*e,r.width=2*e,i.shadowOffsetX=i.shadowOffsetY=2*e,i.shadowBlur=t,i.shadowColor="#000000",i.beginPath(),i.arc(-e,-e,e/2,0,2*Math.PI,!0),i.closePath(),i.fill()}createGradient(){var e=this.colors,t=document.createElement("canvas"),r=t.getContext("2d"),i=r.createLinearGradient(0,0,0,256);t.height=256,t.width=1;for(var s=1,n=0,a=e.length;n<a;n++)i.addColorStop(s/a,e[n]),s++;r.fillStyle=i,r.fillRect(0,0,1,256),this.grad=r.getImageData(0,0,1,256).data}getLocalXY(e){var t,r=this.map;(e instanceof he||e instanceof ce)&&(t=r.getPixelFromCoordinate([e.x,e.y])),e instanceof se&&(t=r.getPixelFromCoordinate([e.lon,e.lat]));var i=-r.getView().getRotation(),s=r.getPixelFromCoordinate(r.getView().getCenter()),n=t;return this.pixelRatio&&(n=this.scale(t,s,this.pixelRatio)),t&&s&&(n=this.rotate(n,i,s)),this.offset&&n?[n[0]+this.offset[0],n[1]+this.offset[1]]:n}rotate(e,t,r){return[Math.cos(t)*(e[0]-r[0])-Math.sin(t)*(e[1]-r[1])+r[0],Math.sin(t)*(e[0]-r[0])+Math.cos(t)*(e[1]-r[1])+r[1]]}scale(e,t,r){return[(e[0]-t[0])*r+t[0],(e[1]-t[1])*r+t[1]]}removeFeatures(e){if(e&&0!==e.length&&this.features&&0!==this.features.length){if(e===this.features)return this.removeAllFeatures();te.isArray(e)||(e=[e]);for(var t,r,i=[],s=0,n=e.length;s<n;s++)t=e[s],-1!==(r=te.indexOf(this.features,t))?this.features.splice(r,1):i.push(t);var a=0==i.length;this.dispatchEvent({type:"featuresremoved",value:{features:i,succeed:a}}),this.changed()}}removeAllFeatures(){this.features=[],this.changed()}toiClientFeature(e){$o.isArray(e)||(e=[e]);let t,r,i=[];for(let s=0,n=e.length;s<n;s++)if(e[s]instanceof Qo())e[s].getGeometry()instanceof Od()&&(t=new he(e[s].getGeometry().getCoordinates()[0],e[s].getGeometry().getCoordinates()[1]),r=e[s].getProperties().Properties?e[s].getProperties().Properties:{},i.push(new Ee(t,r)));else if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(e[s].type)){let t=new Ie;i=i.concat(t.read(e[s]))}else{if(!e[s].geometry||!e[s].geometry.parts)throw new Error(`Features[${s}]'s type does not match, please check.`);i.push(bs.fromJson(e[s]).toFeature())}return i}}!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"}(Mp||(Mp={}));const Pp=4,Ip=4,Np=new Int32Array(2),Lp=new Float32Array(Np.buffer),kp=new Float64Array(Np.buffer),Fp=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];var Rp;!function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"}(Rp||(Rp={}));class Dp{constructor(e){this.bytes_=e,this.position_=0}static allocate(e){return new Dp(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Np[0]=this.readInt32(e),Lp[0]}readFloat64(e){return Np[Fp?0:1]=this.readInt32(e),Np[Fp?1:0]=this.readInt32(e+4),kp[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Lp[0]=t,this.writeInt32(e,Np[0])}writeFloat64(e,t){kp[0]=t,this.writeInt32(e,Np[Fp?0:1]),this.writeInt32(e+4,Np[Fp?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+Pp+Ip)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<Ip;t++)e+=String.fromCharCode(this.readInt8(this.position_+Pp+t));return e}__offset(e,t){const r=e-this.readInt32(e);return t<this.readInt16(r)?this.readInt16(r+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);const r=this.readInt32(e);let i="",s=0;if(e+=Pp,t===Rp.UTF8_BYTES)return this.bytes_.subarray(e,e+r);for(;s<r;){let t;const r=this.readUint8(e+s++);if(r<192)t=r;else{const i=this.readUint8(e+s++);if(r<224)t=(31&r)<<6|63&i;else{const n=this.readUint8(e+s++);if(r<240)t=(15&r)<<12|(63&i)<<6|63&n;else{t=(7&r)<<18|(63&i)<<12|(63&n)<<6|63&this.readUint8(e+s++)}}}t<65536?i+=String.fromCharCode(t):(t-=65536,i+=String.fromCharCode(55296+(t>>10),56320+(1023&t)))}return i}__union_with_string(e,t){return"string"==typeof e?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+Pp}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=Ip)throw new Error("FlatBuffers: file identifier must be length "+Ip);for(let t=0;t<Ip;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+Pp+t))return!1;return!0}createScalarList(e,t){const r=[];for(let i=0;i<t;++i)null!==e(i)&&r.push(e(i));return r}createObjList(e,t){const r=[];for(let i=0;i<t;++i){const t=e(i);null!==t&&r.push(t.unpack())}return r}}function Gp(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var jp,Bp=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,r,i;return t=e,i=[{key:"getRootAsGeometry",value:function(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsGeometry",value:function(t,r){return t.setPosition(t.position()+4),(r||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 r=t.length-1;r>=0;r--)e.addInt32(t[r]);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 r=t.length-1;r>=0;r--)e.addFloat64(t[r]);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 r=t.length-1;r>=0;r--)e.addFloat64(t[r]);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 r=t.length-1;r>=0;r--)e.addFloat64(t[r]);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 r=t.length-1;r>=0;r--)e.addFloat64(t[r]);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 r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}},{key:"startTmVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addType",value:function(e,t){e.addFieldInt8(6,t,Mp.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 r=t.length-1;r>=0;r--)e.addOffset(t[r]);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,r,i,s,n,a,o,l,h){return e.startGeometry(t),e.addEnds(t,r),e.addXy(t,i),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)}}],(r=[{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):Mp.Unknown}},{key:"parts",value:function(t,r){var i=this.bb.__offset(this.bb_pos,18);return i?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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}}])&&Gp(t.prototype,r),i&&Gp(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Up(e,t){for(var r=[],i=0;i<e.length;i+=2){var s=[e[i],e[i+1]];t&&s.push(t[i>>1]),r.push(s)}return r}function Vp(e,t,r){if(!r||0===r.length)return[Up(e,t)];var i,s=0,n=Array.from(r).map(function(t){return e.slice(s,s=t<<1)});return t&&(s=0,i=Array.from(r).map(function(e){return t.slice(s,s=e)})),n.map(function(e,t){return Up(e,i?i[t]:void 0)})}function Jp(e,t){var r=t;if(r===Mp.Unknown&&(r=e.type()),r===Mp.GeometryCollection){for(var i=[],s=0;s<e.partsLength();s++){var n=e.parts(s),a=n.type();i.push(Jp(n,a))}return{type:Mp[r],geometries:i}}if(r===Mp.MultiPolygon){for(var o=[],l=0;l<e.partsLength();l++)o.push(Jp(e.parts(l),Mp.Polygon));return{type:Mp[r],coordinates:o.map(function(e){return e.coordinates})}}var h=function(e,t){var r=e.xyArray(),i=e.zArray();switch(t){case Mp.Point:var s=Array.from(r);return i&&s.push(i[0]),s;case Mp.MultiPoint:case Mp.LineString:return Up(r,i);case Mp.MultiLineString:case Mp.Polygon:return Vp(r,i,e.endsArray())}}(e,r);return{type:Mp[r],coordinates:h}}function zp(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}!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"}(jp||(jp={}));var qp=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,r,i;return t=e,i=[{key:"getRootAsColumn",value:function(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsColumn",value:function(t,r){return t.setPosition(t.position()+4),(r||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,jp.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,r,i,s,n,a,o,l,h,u,c,d){return e.startColumn(t),e.addName(t,r),e.addType(t,i),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)}}],(r=[{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):jp.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}}])&&zp(t.prototype,r),i&&zp(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Hp(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var Wp=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,r,i;return t=e,i=[{key:"getRootAsFeature",value:function(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsFeature",value:function(t,r){return t.setPosition(t.position()+4),(r||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 r=t.length-1;r>=0;r--)e.addInt8(t[r]);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 r=t.length-1;r>=0;r--)e.addOffset(t[r]);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,r,i,s){return e.startFeature(t),e.addGeometry(t,r),e.addProperties(t,i),e.addColumns(t,s),e.endFeature(t)}}],(r=[{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 Bp).__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 r=this.bb.__offset(this.bb_pos,8);return r?(t||new qp).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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}}])&&Hp(t.prototype,r),i&&Hp(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Yp=(new TextEncoder,new TextDecoder);function Xp(e,t){var r={};if(!t||0===t.length)return r;var i=e.propertiesArray();if(!i)return r;for(var s=new DataView(i.buffer,i.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 jp.Bool:r[h]=!!s.getUint8(a),a+=1;break;case jp.Byte:r[h]=s.getInt8(a),a+=1;break;case jp.UByte:r[h]=s.getUint8(a),a+=1;break;case jp.Short:r[h]=s.getInt16(a,!0),a+=2;break;case jp.UShort:r[h]=s.getUint16(a,!0),a+=2;break;case jp.Int:r[h]=s.getInt32(a,!0),a+=4;break;case jp.UInt:r[h]=s.getUint32(a,!0),a+=4;break;case jp.Long:r[h]=Number(s.getBigInt64(a,!0)),a+=8;break;case jp.ULong:r[h]=Number(s.getBigUint64(a,!0)),a+=8;break;case jp.Float:r[h]=s.getFloat32(a,!0),a+=4;break;case jp.Double:r[h]=s.getFloat64(a,!0),a+=8;break;case jp.DateTime:case jp.String:var u=s.getUint32(a,!0);a+=4,r[h]=Yp.decode(i.subarray(a,a+u)),a+=u;break;case jp.Json:var c=s.getUint32(a,!0);a+=4;var d=Yp.decode(i.subarray(a,a+c));r[h]=JSON.parse(d),a+=c;break;default:throw new Error("Unknown type "+l.type)}}return r}function Qp(e,t){var r=t.columns;return{type:"Feature",geometry:Jp(e.geometry(),t.geometryType),properties:Xp(e,r)}}const Zp=new Uint8Array(0);function Kp(e){this._source=e,this._array=Zp,this._index=0}function $p(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Kp.prototype.read=function(){var e=this,t=e._array.subarray(e._index);return e._source.read().then(function(r){return e._array=Zp,e._index=0,r.done?t.length>0?{done:!1,value:t}:{done:!0,value:void 0}:{done:!1,value:function(e,t){if(!e.length)return t;if(!t.length)return e;var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(t,r.value)}})},Kp.prototype.slice=function(e){if((e|=0)<0)throw new Error("invalid length");var t=this,r=this._array.length-this._index;if(this._index+e<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=e));var i=new Uint8Array(e);return i.set(this._array.subarray(this._index)),function s(){return t._source.read().then(function(n){return n.done?(t._array=Zp,t._index=0,r>0?i.subarray(0,r):null):r+n.value.length>=e?(t._array=n.value,t._index=e-r,i.set(n.value.subarray(0,e-r),r),i):(i.set(n.value,r),r+=n.value.length,s())})}()},Kp.prototype.cancel=function(){return this._source.cancel()};var ef=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,r,i;return t=e,i=[{key:"getRootAsCrs",value:function(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsCrs",value:function(t,r){return t.setPosition(t.position()+4),(r||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,r,i,s,n,a,o){return e.startCrs(t),e.addOrg(t,r),e.addCode(t,i),e.addName(t,s),e.addDescription(t,n),e.addWkt(t,a),e.addCodeString(t,o),e.endCrs(t)}}],(r=[{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}}])&&$p(t.prototype,r),i&&$p(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function tf(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var rf=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,r,i;return t=e,i=[{key:"getRootAsHeader",value:function(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsHeader",value:function(t,r){return t.setPosition(t.position()+4),(r||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 r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startEnvelopeVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addGeometryType",value:function(e,t){e.addFieldInt8(2,t,Mp.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 r=t.length-1;r>=0;r--)e.addOffset(t[r]);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)}}],(r=[{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):Mp.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 r=this.bb.__offset(this.bb_pos,18);return r?(t||new qp).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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 ef).__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}}])&&tf(t.prototype,r),i&&tf(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function sf(e){for(var t=rf.getRootAsHeader(e),r=t.featuresCount(),i=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(r),indexNodeSize:i,crs:l,title:t.title(),description:t.description(),metadata:t.metadata()}}var nf=function(e,t){return(nf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function af(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})}function of(e,t){var r,i,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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=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++,i=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],i=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}}function lf(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hf(e){return this instanceof hf?(this.v=e,this):new hf(e)}function uf(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=r.apply(e,t||[]),n=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(e){s[e]&&(i[e]=function(t){return new Promise(function(r,i){n.push([e,t,r,i])>1||o(e,t)})})}function o(e,t){try{(r=s[e](t)).value instanceof hf?Promise.resolve(r.value.v).then(l,h):u(n[0][2],r)}catch(e){u(n[0][3],e)}var r}function l(e){o("next",e)}function h(e){o("throw",e)}function u(e,t){e(t),n.shift(),n.length&&o(n[0][0],n[0][1])}}var cf=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(e,t){function r(){this.constructor=e}nf(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);(function(){function e(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}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()}})(),function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}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()}}(),function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}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()}}();function df(e){null!=e&&"function"==typeof e.then&&e.then(bf,bf)}var pf=0,ff=1,yf=2,mf=3,gf=4,vf=1024,bf=function(){};function Sf(e){var t=e.err,r=Promise.resolve(e.execution).then(function(e){if(null!=t)throw t;return e});return e.err=void 0,e.execution=r.then(function(){},function(){}),void 0===e.pending?r:e.pending.then(function(){return r})}function xf(e,t){var r=e.state>=mf;return Promise.resolve(t).then(function(t){return!r&&e.state>=gf?Sf(e).then(function(e){return{value:e,done:!0}}):{value:t,done:r}})}function _f(e,t){var r,i;if(!(e.state>=yf))if(e.state=yf,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=lf(e.pushes),n=s.next();!n.done;n=s.next()){n.value.resolve()}}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}else wf(e)}function wf(e){var t,r;if(!(e.state>=mf)){e.state<yf&&_f(e),e.state=mf,e.buffer=void 0;try{for(var i=lf(e.nexts),s=i.next();!s.done;s=i.next()){var n=s.value,a=void 0===e.pending?Sf(e):e.pending.then(function(){return Sf(e)});n.resolve(xf(e,a))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.pushes=[],e.nexts=[]}}function Cf(e){e.state>=gf||(e.state<mf&&wf(e),e.state=gf)}function Af(e){if(!(e.state>=ff)){e.state=ff;var t=function(e,t){if(df(t),e.pushes.length>=vf)throw new cf("No more than "+vf+" pending calls to push are allowed on a single repeater.");if(e.state>=yf)return Promise.resolve(void 0);var r,i=void 0===e.pending?Promise.resolve(t):e.pending.then(function(){return t});i=i.catch(function(t){e.state<yf&&(e.err=t),Cf(e)}),e.nexts.length?(e.nexts.shift().resolve(xf(e,i)),r=e.nexts.length?Promise.resolve(e.nexts[0].value):new Promise(function(t){return e.onnext=t})):void 0===e.buffer||e.buffer.full?r=new Promise(function(t){return e.pushes.push({resolve:t,value:i})}):(e.buffer.add(i),r=Promise.resolve(void 0));var s=!0,n={},a=r.catch(function(e){if(s)throw e});return n.then=function(e,t){return s=!1,Promise.prototype.then.call(r,e,t)},n.catch=function(e){return s=!1,Promise.prototype.catch.call(r,e)},n.finally=r.finally.bind(r),e.pending=i.then(function(){return a}).catch(function(t){e.err=t,Cf(e)}),n}.bind(null,e),r=function(e){var t=_f.bind(null,e),r=new Promise(function(t){return e.onstop=t});return t.then=r.then.bind(r),t.catch=r.catch.bind(r),t.finally=r.finally.bind(r),t}(e);e.execution=new Promise(function(i){return i(e.executor(t,r))}),e.execution.catch(function(){return _f(e)})}}var Mf=new WeakMap,Tf=function(){function e(e,t){Mf.set(this,{executor:e,buffer:t,err:void 0,state:pf,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:bf,onstop:bf})}return e.prototype.next=function(e){df(e);var t=Mf.get(this);if(void 0===t)throw new Error("WeakMap error");if(t.nexts.length>=vf)throw new cf("No more than "+vf+" pending calls to next are allowed on a single repeater.");if(t.state<=pf&&Af(t),t.onnext(e),void 0!==t.buffer&&!t.buffer.empty){var r=xf(t,t.buffer.remove());if(t.pushes.length){var i=t.pushes.shift();t.buffer.add(i.value),t.onnext=i.resolve}return r}if(t.pushes.length){var s=t.pushes.shift();return t.onnext=s.resolve,xf(t,s.value)}return t.state>=yf?(wf(t),xf(t,Sf(t))):new Promise(function(r){return t.nexts.push({resolve:r,value:e})})},e.prototype.return=function(e){df(e);var t=Mf.get(this);if(void 0===t)throw new Error("WeakMap error");return wf(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),xf(t,Sf(t))},e.prototype.throw=function(e){var t=Mf.get(this);if(void 0===t)throw new Error("WeakMap error");return t.state<=pf||t.state>=yf||void 0!==t.buffer&&!t.buffer.empty?(wf(t),null==t.err&&(t.err=e),xf(t,Sf(t))):this.next(Promise.reject(e))},e.prototype[Symbol.asyncIterator]=function(){return this},e.race=Of,e.merge=Pf,e.zip=If,e.latest=Nf,e}();function Ef(e,t){var r,i,s=[],n=function(e){null!=e&&"function"==typeof e[Symbol.asyncIterator]?s.push(e[Symbol.asyncIterator]()):null!=e&&"function"==typeof e[Symbol.iterator]?s.push(e[Symbol.iterator]()):s.push(function(){return uf(this,arguments,function(){return of(this,function(r){switch(r.label){case 0:return t.yieldValues?[4,hf(e)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return t.returnValues?[4,hf(e)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=lf(e),o=a.next();!o.done;o=a.next()){n(o.value)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s}function Of(e){var t=this,r=Ef(e,{returnValues:!0});return new Tf(function(e,i){return af(t,void 0,void 0,function(){var t,s,n,a,o,l;return of(this,function(h){switch(h.label){case 0:if(!r.length)return i(),[2];s=!1,i.then(function(){t(),s=!0}),h.label=1;case 1:h.trys.push([1,,5,7]),a=void 0,o=0,l=function(){var s,l,h,u,c,d;return of(this,function(p){switch(p.label){case 0:s=o;try{for(c=void 0,l=lf(r),h=l.next();!h.done;h=l.next())u=h.value,Promise.resolve(u.next()).then(function(e){e.done?(i(),void 0===n&&(n=e)):o===s&&(o++,t(e))},function(e){return i(e)})}catch(e){c={error:e}}finally{try{h&&!h.done&&(d=l.return)&&d.call(l)}finally{if(c)throw c.error}}return[4,new Promise(function(e){return t=e})];case 1:return void 0===(a=p.sent())?[3,3]:[4,e(a.value)];case 2:p.sent(),p.label=3;case 3:return[2]}})},h.label=2;case 2:return s?[3,4]:[5,l()];case 3:return h.sent(),[3,2];case 4:return[2,n&&n.value];case 5:return i(),[4,Promise.race(r.map(function(e){return e.return&&e.return()}))];case 6:return h.sent(),[7];case 7:return[2]}})})})}function Pf(e){var t=this,r=Ef(e,{yieldValues:!0});return new Tf(function(e,i){return af(t,void 0,void 0,function(){var t,s,n,a=this;return of(this,function(o){switch(o.label){case 0:if(!r.length)return i(),[2];t=[],s=!1,i.then(function(){var e,r;s=!0;try{for(var i=lf(t),n=i.next();!n.done;n=i.next()){(0,n.value)()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,o){return af(a,void 0,void 0,function(){var a;return of(this,function(l){switch(l.label){case 0:l.trys.push([0,,6,9]),l.label=1;case 1:return s?[3,5]:(Promise.resolve(r.next()).then(function(e){return t[o](e)},function(e){return i(e)}),[4,new Promise(function(e){t[o]=e})]);case 2:return void 0===(a=l.sent())?[3,4]:a.done?(n=a,[2]):[4,e(a.value)];case 3:l.sent(),l.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:l.sent(),l.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return o.sent(),[2,n&&n.value];case 3:return i(),[7];case 4:return[2]}})})})}function If(e){var t=this,r=Ef(e,{returnValues:!0});return new Tf(function(e,i){return af(t,void 0,void 0,function(){var t,s,n,a;return of(this,function(o){switch(o.label){case 0:if(!r.length)return i(),[2,[]];s=!1,i.then(function(){t(),s=!0}),o.label=1;case 1:o.trys.push([1,,6,8]),o.label=2;case 2:return s?[3,5]:(Promise.all(r.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return i(e)}),[4,new Promise(function(e){return t=e})]);case 3:return void 0===(n=o.sent())?[2]:(a=n.map(function(e){return e.value}),n.some(function(e){return e.done})?[2,a]:[4,e(a)]);case 4:return o.sent(),[3,2];case 5:return[3,8];case 6:return i(),[4,Promise.all(r.map(function(e){return e.return&&e.return()}))];case 7:return o.sent(),[7];case 8:return[2]}})})})}function Nf(e){var t=this,r=Ef(e,{yieldValues:!0,returnValues:!0});return new Tf(function(e,i){return af(t,void 0,void 0,function(){var t,s,n,a,o,l=this;return of(this,function(h){switch(h.label){case 0:if(!r.length)return i(),[2,[]];s=[],n=!1,i.then(function(){var e,r;t();try{for(var i=lf(s),a=i.next();!a.done;a=i.next()){(0,a.value)()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}n=!0}),h.label=1;case 1:return h.trys.push([1,,5,7]),Promise.all(r.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return i(e)}),[4,new Promise(function(e){return t=e})];case 2:return void 0===(a=h.sent())?[2]:(o=a.map(function(e){return e.value}),a.every(function(e){return e.done})?[2,o]:[4,e(o.slice())]);case 3:return h.sent(),[4,Promise.all(r.map(function(t,r){return af(l,void 0,void 0,function(){var l;return of(this,function(h){switch(h.label){case 0:if(a[r].done)return[2,a[r].value];h.label=1;case 1:return n?[3,4]:(Promise.resolve(t.next()).then(function(e){return s[r](e)},function(e){return i(e)}),[4,new Promise(function(e){return s[r]=e})]);case 2:return void 0===(l=h.sent())?[2,a[r].value]:l.done?[2,l.value]:(o[r]=l.value,[4,e(o.slice())]);case 3:return h.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,h.sent()];case 5:return i(),[4,Promise.all(r.map(function(e){return e.return&&e.return()}))];case 6:return h.sent(),[7];case 7:return[2]}})})})}function Lf(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var kf,Ff=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,r,i;return t=e,(r=[{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}}])&&Lf(t.prototype,r),i&&Lf(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rf(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Ff.global=new Ff,function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warn=2]="Warn",e[e.Error=3]="Error"}(kf||(kf={}));var Df=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,i;return t=e,i=[{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.log.apply(this,[kf.Debug].concat(t))}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.log.apply(this,[kf.Info].concat(t))}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.log.apply(this,[kf.Warn].concat(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.log.apply(this,[kf.Error].concat(t))}},{key:"log",value:function(e){if(!(this.logLevel>e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];switch(e){case kf.Debug:var s;(s=console).debug.apply(s,r);break;case kf.Info:var n;(n=console).info.apply(n,r);break;case kf.Warn:var a;(a=console).warn.apply(a,r);break;case kf.Error:var o;(o=console).error.apply(o,r)}}}}],(r=null)&&Rf(t.prototype,r),i&&Rf(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Gf(e){"@babel/helpers - typeof";return(Gf="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 jf(){jf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",n=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(i||[]);return n._invoke=function(e,t,r){var i="suspendedStart";return function(s,n){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===s)throw n;return A()}for(r.method=s,r.arg=n;;){var a=r.delegate;if(a){var o=S(a,r);if(o){if(o===u)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var l=h(e,t,r);if("normal"===l.type){if(i=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),n}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}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 y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==t&&r.call(m,s)&&(f=m);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 i;this._invoke=function(s,n){function a(){return new t(function(i,a){!function i(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"==Gf(c)&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){i("next",e,a,o)},function(e){i("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return i("throw",e,a,o)})}o(l.arg)}(s,n,i,a)})}return i=i?i.then(a,a):a()}}function S(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(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 i=h(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var s=i.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 x(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,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 i=-1,n=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){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,r,i,s,n){void 0===n&&(n=Promise);var a=new b(l(t,r,i,s),n);return e.isGeneratorFunction(r)?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 r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var i=t.pop();if(i in e)return r.value=i,r.done=!1,r}return r.done=!0,r}},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(_),!e)for(var t in this)"t"===t.charAt(0)&&r.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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return i("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return i(n.catchLoc,!0);if(this.prev<n.finallyLoc)return i(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return i(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return i(n.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i];if(s.tryLoc<=this.prev&&r.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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var s=i.arg;_(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function Bf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var i,s,n=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(i=r.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw s}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Uf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uf(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 Uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function Vf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jf(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function zf(e){var t,r;function i(t,r){try{var n=e[t](r),a=n.value,o=a instanceof qf;Promise.resolve(o?a.v:a).then(function(r){if(o){var l="return"===t?"return":"next";if(!a.k||r.done)return i(l,r);r=e[l](r).value}s(n.done?"return":"normal",r)},function(e){i("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)?i(t.key,t.arg):r=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};r?r=r.next=o:(t=r=o,i(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function qf(e,t){this.v=e,this.k=t}Df.logLevel=kf.Info,zf.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},zf.prototype.next=function(e){return this._invoke("next",e)},zf.prototype.throw=function(e){return this._invoke("throw",e)},zf.prototype.return=function(e){return this._invoke("return",e)};var Hf=40;function Wf(e,t){t=Math.min(Math.max(+t,2),65535);var r=e,i=r;do{i+=r=Math.ceil(r/t)}while(1!==r);return i*Hf}function Yf(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 r=e,i=r,s=[r];do{i+=r=Math.ceil(r/t),s.push(r)}while(1!==r);var n=[];r=i;for(var a=0,o=s;a<o.length;a++){var l=o[a];n.push(r-l),r-=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 Xf(e,t,r,i){return Qf.apply(this,arguments)}function Qf(){var e;return e=jf().mark(function e(t,r,i,s){var n,a,o,l,h,u,c,d,p,f;return jf().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=function(){function e(t,r){Vf(this,e),this._level=r,this.nodes=t}var t,r,i;return t=e,(r=[{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],"]")}}])&&Jf(t.prototype,r),i&&Jf(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),a=i.minX,o=i.minY,l=i.maxX,h=i.maxY,Df.info("tree items: ".concat(t,", nodeSize: ").concat(r)),u=Yf(t,r),c=u[0][0],void 0,y=u.length-1,d=new n([0,1],y),p=[d],Df.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(t,", nodeSize: ").concat(r,", levelBounds: ").concat(u)),f=jf().mark(function e(){var i,d,f,y,m,g,v,b,S,x,_,w;return jf().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=p.shift(),Df.debug("popped node: ".concat(i,", queueLength: ").concat(p.length)),d=i.startNode(),f=d>=c,y=Bf(u[i.level()],2),m=y[1],g=Math.min(i.endNode()+r,m),v=g-d,e.next=9,new qf(s(d*Hf,v*Hf),0);case 9:b=e.sent,S=new Float64Array(b),x=new Uint32Array(b),_=jf().mark(function e(r){var s,u,y,m,g,v,b,_;return jf().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(l<S[(s=5*(r-d))+0])){e.next=3;break}return e.abrupt("return",0);case 3:if(!(h<S[s+1])){e.next=5;break}return e.abrupt("return",0);case 5:if(!(a>S[s+2])){e.next=7;break}return e.abrupt("return",0);case 7:if(!(o>S[s+3])){e.next=9;break}return e.abrupt("return",0);case 9:if(u=x[8+(s<<1)],y=x[9+(s<<1)],m=Zf(y,u),!f){e.next=17;break}return g=function(){if(r<t-1){var e=5*(r-d+1),i=x[8+(e<<1)];return Zf(x[9+(e<<1)],i)-m}return null}(),e.next=16,[m,r-c,g];case 16:return e.abrupt("return",0);case 17:if(v=Ff.global.extraRequestThreshold()/Hf,!(void 0!==(b=p[p.length-1])&&b.level()==i.level()-1&&m<b.endNode()+v)){e.next=23;break}return Df.debug('Merging "nodeRange" request into existing range: '.concat(b,", newOffset: ").concat(b.endNode()," -> ").concat(m)),b.extendEndNodeToNewOffset(m),e.abrupt("return",0);case 23:void 0,w=i.level()-1,_=new n([m,m+1],w),void 0!==b&&b.level()==_.level()?Df.info("Same level, but too far away. Pushing new request at offset: ".concat(m," rather than merging with distant ").concat(b)):Df.info("Pushing new level for ".concat(_," onto queue with nearestNodeRange: ").concat(b," since there's not already a range for this level.")),p.push(_);case 26:case"end":return e.stop()}var w},e)}),w=d;case 14:if(!(w<g)){e.next=22;break}return e.delegateYield(_(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 y},e)}),(Qf=function(){return new zf(e.apply(this,arguments))}).apply(this,arguments)}function Zf(e,t){if(0!=(4293918720&e))throw Error("integer is too large to be safely represented");return t+e*Math.pow(2,32)}var Kf=new Uint8Array([102,103,98,3,102,103,98,0]),$f=4;function ey(e){"@babel/helpers - typeof";return(ey="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 ty(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=iy(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,s=function(){};return{s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,n=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw n}}}}function ry(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var i,s,n=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(i=r.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw s}}return n}(e,t)||iy(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 iy(e,t){if(e){if("string"==typeof e)return sy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sy(e,t):void 0}}function sy(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function ny(){ny=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",n=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(i||[]);return n._invoke=function(e,t,r){var i="suspendedStart";return function(s,n){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===s)throw n;return A()}for(r.method=s,r.arg=n;;){var a=r.delegate;if(a){var o=S(a,r);if(o){if(o===u)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var l=h(e,t,r);if("normal"===l.type){if(i=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),n}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}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 y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==t&&r.call(m,s)&&(f=m);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 i;this._invoke=function(s,n){function a(){return new t(function(i,a){!function i(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"==ey(c)&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){i("next",e,a,o)},function(e){i("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return i("throw",e,a,o)})}o(l.arg)}(s,n,i,a)})}return i=i?i.then(a,a):a()}}function S(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(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 i=h(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var s=i.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 x(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,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 i=-1,n=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){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,r,i,s,n){void 0===n&&(n=Promise);var a=new b(l(t,r,i,s),n);return e.isGeneratorFunction(r)?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 r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var i=t.pop();if(i in e)return r.value=i,r.done=!1,r}return r.done=!0,r}},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(_),!e)for(var t in this)"t"===t.charAt(0)&&r.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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return i("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return i(n.catchLoc,!0);if(this.prev<n.finallyLoc)return i(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return i(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return i(n.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i];if(s.tryLoc<=this.prev&&r.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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var s=i.arg;_(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function ay(e,t,r,i,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(i,s)}function oy(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var n=e.apply(t,r);function a(e){ay(n,i,s,a,o,"next",e)}function o(e){ay(n,i,s,a,o,"throw",e)}a(void 0)})}}function ly(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hy(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function uy(e,t,r){return t&&hy(e.prototype,t),r&&hy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cy(e){return function(){return new dy(e.apply(this,arguments))}}function dy(e){var t,r;function i(t,r){try{var n=e[t](r),a=n.value,o=a instanceof yy;Promise.resolve(o?a.v:a).then(function(r){if(o){var l="return"===t?"return":"next";if(!a.k||r.done)return i(l,r);r=e[l](r).value}s(n.done?"return":"normal",r)},function(e){i("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)?i(t.key,t.arg):r=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};r?r=r.next=o:(t=r=o,i(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function py(e){return new yy(e,0)}function fy(e){var t={},r=!1;function i(t,i){return r=!0,{done:!1,value:new yy(i=new Promise(function(r){r(e[t](i))}),1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return r?(r=!1,e):i("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(r)throw r=!1,e;return i("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return r?(r=!1,e):i("return",e)}),t}function yy(e,t){this.v=e,this.k=t}function my(e){var t,r,i,s=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new gy(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function gy(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(gy=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 r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new gy(e)}dy.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},dy.prototype.next=function(e){return this._invoke("next",e)},dy.prototype.throw=function(e){return this._invoke("throw",e)},dy.prototype.return=function(e){return this._invoke("return",e)};var vy=function(){function e(t,r,i,s){ly(this,e),this.headerClient=t,this.header=r,this.headerLength=i,this.indexLength=s}return uy(e,[{key:"selectBbox",value:function(e){var t=this;return cy(ny().mark(function r(){var i,s,n,a,o,l,h,u,c,d,p,f,y,m,g,v,b,S,x;return ny().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=t.lengthBeforeTree(),s=t.headerClient,n=function(){var e=oy(ny().mark(function e(t,r){var n;return ny().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=0,e.abrupt("return",s.getRange(i+t,r,n,"index"));case 2:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}(),a=[],o=[],l=!1,h=!1,r.prev=7,c=my(Xf(t.header.featuresCount,t.header.indexNodeSize,e,n));case 9:return r.next=11,py(c.next());case 11:if(!(l=!(d=r.sent).done)){r.next=26;break}if(p=d.value,f=ry(p,2),y=f[0],m=ry(p,3),(g=m[2])||(Df.info("final feature"),v=Ff.global.extraRequestThreshold(),g=v),0!=o.length){r.next=19;break}return o.push([y,g]),r.abrupt("continue",23);case 19:b=o[o.length-1],(S=y-(b[0]+b[1]))>Ff.global.extraRequestThreshold()&&(Df.info("Pushing new feature batch, since gap ".concat(S," was too large")),a.push(o),o=[]),o.push([y,g]);case 23:l=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),h=!0,u=r.t0;case 32:if(r.prev=32,r.prev=33,!l||null==c.return){r.next=37;break}return r.next=37,py(c.return());case 37:if(r.prev=37,!h){r.next=40;break}throw u;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return t.headerClient.logUsage("header+index"),o.length>0&&a.push(o),x=a.flatMap(function(e){return t.readFeatureBatch(e)}),r.delegateYield(fy(my(Tf.merge(x))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return Kf.length+$f+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(){return new by(this.headerClient.httpClient)}},{key:"readFeatureBatch",value:function(e){var t=this;return cy(ny().mark(function r(){var i,s,n,a,o,l,h,u,c,d,p;return ny().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=ry(e[0],1),s=i[0],n=ry(e[e.length-1],2),a=n[0],o=n[1],l=a+o-s,h=t.buildFeatureClient(),u=ty(e),r.prev=7,u.s();case 9:if((c=u.n()).done){r.next=17;break}return d=ry(c.value,1),p=d[0],r.next=13,py(t.readFeature(h,p,l));case 13:return r.next=15,r.sent;case 15:r.next=9;break;case 17:r.next=22;break;case 19:r.prev=19,r.t0=r.catch(7),u.e(r.t0);case 22:return r.prev=22,u.f(),r.finish(22);case 25:h.logUsage("feature");case 26:case"end":return r.stop()}},r,null,[[7,19,22,25]])}))()}},{key:"readFeature",value:function(){var e=oy(ny().mark(function e(t,r,i){var s,n,a,o,l,h,u;return ny().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=r+this.lengthBeforeFeatures(),e.next=3,t.getRange(s,4,i,"feature length");case 3:return a=e.sent,n=new DataView(a).getUint32(0,!0),e.next=7,t.getRange(s+4,n,i,"feature data");case 7:return o=e.sent,l=new Uint8Array(o),(h=new Uint8Array(n+$f)).set(l,$f),(u=new Dp(h)).setPosition($f),e.abrupt("return",Wp.getRootAsFeature(u));case 14:case"end":return e.stop()}},e,this)}));return function(t,r,i){return e.apply(this,arguments)}}()}],[{key:"open",value:function(){var t=oy(ny().mark(function t(r){var i,s,n,a,o,l,h,u,c,d,p;return ny().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=2024,s=new by(r),n=function(){var e,t=0;for(e=0;e<3;e++){t+=Math.pow(16,e)*Hf}return t}(),a=i+n,Df.debug("fetching header. minReqLength: ".concat(a," (assumedHeaderLength: ").concat(i,", 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 Kf[t]===e})){t.next=13;break}throw Df.error("bytes: ".concat(o," != ").concat(Kf)),new Error("Not a FlatGeobuf file");case 13:return Df.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 Df.debug("headerLength: ".concat(l)),t.next=24,s.getRange(12,l,a,"header");case 24:return u=t.sent,c=new Dp(new Uint8Array(u)),d=sf(c),p=Wf(d.featuresCount,d.indexNodeSize),Df.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}(),by=function(){function e(t){ly(this,e),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new Sy(t):t}return uy(e,[{key:"getRange",value:function(){var e=oy(ny().mark(function e(t,r,i,s){var n,a,o;return ny().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bytesEverUsed+=r,n=t-this.head,a=n+r,!(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(r,i),this.bytesEverFetched+=o,Df.debug("requesting for new Range: ".concat(t,"-").concat(t+r-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,r));case 13:case"end":return e.stop()}},e,this)}));return function(t,r,i,s){return e.apply(this,arguments)}}()},{key:"logUsage",value:function(e){var t=e.split(" ")[0],r=this.bytesEverUsed,i=this.bytesEverFetched,s=(100*r/i).toFixed(2);Df.info("".concat(t," bytes used/requested: ").concat(r," / ").concat(i," = ").concat(s,"%"))}}]),e}(),Sy=function(){function e(t){ly(this,e),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}return uy(e,[{key:"getRange",value:function(){var e=oy(ny().mark(function e(t,r,i){var s,n;return ny().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,s="bytes=".concat(t,"-").concat(t+r-1),Df.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(i,"), bytes: (this_request: ").concat(r,", 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,r,i){return e.apply(this,arguments)}}()}]),e}();function xy(e){"@babel/helpers - typeof";return(xy="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 _y(){_y=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",n=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(i||[]);return n._invoke=function(e,t,r){var i="suspendedStart";return function(s,n){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===s)throw n;return A()}for(r.method=s,r.arg=n;;){var a=r.delegate;if(a){var o=S(a,r);if(o){if(o===u)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var l=h(e,t,r);if("normal"===l.type){if(i=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),n}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}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 y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==t&&r.call(m,s)&&(f=m);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 i;this._invoke=function(s,n){function a(){return new t(function(i,a){!function i(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"==xy(c)&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){i("next",e,a,o)},function(e){i("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return i("throw",e,a,o)})}o(l.arg)}(s,n,i,a)})}return i=i?i.then(a,a):a()}}function S(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(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 i=h(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var s=i.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 x(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,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 i=-1,n=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){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,r,i,s,n){void 0===n&&(n=Promise);var a=new b(l(t,r,i,s),n);return e.isGeneratorFunction(r)?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 r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var i=t.pop();if(i in e)return r.value=i,r.done=!1,r}return r.done=!0,r}},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(_),!e)for(var t in this)"t"===t.charAt(0)&&r.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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return i("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return i(n.catchLoc,!0);if(this.prev<n.finallyLoc)return i(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return i(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return i(n.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i];if(s.tryLoc<=this.prev&&r.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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var s=i.arg;_(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function wy(e,t,r,i,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(i,s)}function Cy(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var n=e.apply(t,r);function a(e){wy(n,i,s,a,o,"next",e)}function o(e){wy(n,i,s,a,o,"throw",e)}a(void 0)})}}function Ay(e){var t,r,i,s=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new My(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function My(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(My=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 r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new My(e)}function Ty(e){return new Py(e,0)}function Ey(e){return function(){return new Oy(e.apply(this,arguments))}}function Oy(e){var t,r;function i(t,r){try{var n=e[t](r),a=n.value,o=a instanceof Py;Promise.resolve(o?a.v:a).then(function(r){if(o){var l="return"===t?"return":"next";if(!a.k||r.done)return i(l,r);r=e[l](r).value}s(n.done?"return":"normal",r)},function(e){i("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)?i(t.key,t.arg):r=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};r?r=r.next=o:(t=r=o,i(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function Py(e,t){this.v=e,this.k=t}function Iy(){return(Iy=Ey(_y().mark(function e(t,r,i){var s,n,a,o,l,h,u,c,d,p;return _y().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s="function"==typeof(f=t).slice?f:new Kp("function"==typeof f.read?f:f.getReader()),n=function(){var e=Cy(_y().mark(function e(t){return _y().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,Ty(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 Kf[t]===e})){e.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return e.t2=Uint8Array,e.next=12,Ty(n(4,"header length"));case 12:return e.t3=e.sent,a=new e.t2(e.t3),o=new Dp(a),l=o.readUint32(0),e.t4=Uint8Array,e.next=19,Ty(n(l,"header data"));case 19:if(e.t5=e.sent,a=new e.t4(e.t5),o=new Dp(a),h=sf(o),i&&i(h),u=h.indexNodeSize,c=h.featuresCount,!(u>0)){e.next=29;break}return d=Wf(c,u),e.next=29,Ty(n(d,"entire index, w/o rect"));case 29:return e.next=31,Ty(Ly(n,h,r));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()}var f},e)}))).apply(this,arguments)}function Ny(){return(Ny=Ey(_y().mark(function e(t,r,i,s){var n,a,o,l,h,u,c;return _y().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ty(vy.open(t));case 2:n=e.sent,Df.debug("opened reader"),s&&s(n.header),a=!1,o=!1,e.prev=7,h=Ay(n.selectBbox(r));case 9:return e.next=11,Ty(h.next());case 11:if(!(a=!(u=e.sent).done)){e.next=18;break}return c=u.value,e.next=15,i(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,Ty(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 Ly(e,t,r){return ky.apply(this,arguments)}function ky(){return(ky=Cy(_y().mark(function e(t,r,i){var s,n,a,o,l;return _y().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 Dp(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 Dp(o)).setPosition($f),l=Wp.getRootAsFeature(n),e.abrupt("return",i(l,r));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Fy(e,t){return{type:"FeatureCollection",features:function(e,t,r){if(!e.subarray(0,3).every(function(e,t){return Kf[t]===e}))throw new Error("Not a FlatGeobuf file");var i=new Dp(e),s=i.readUint32(Kf.length);i.setPosition(Kf.length+$f);var n=sf(i);r&&r(n);var a=Kf.length+$f+s,o=n.indexNodeSize,l=n.featuresCount;o>0&&(a+=Wf(l,o));for(var h=[];a<i.capacity();){var u=i.readUint32(a);i.setPosition(a+$f);var c=Wp.getRootAsFeature(i);h.push(t(c,n)),a+=$f+u}return h}(e,Qp,t)}}function Ry(e,t){return function(e,t,r){return Iy.apply(this,arguments)}(e,Qp,t)}function Dy(e,t,r){return function(e,t,r,i){return Ny.apply(this,arguments)}(e,t,Qp,r)}function Gy(e,t,r){return e instanceof Uint8Array?Fy(e,r):e instanceof ReadableStream?Ry(e,r):Dy(e,t,r)}Oy.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Oy.prototype.next=function(e){return this._invoke("next",e)},Oy.prototype.throw=function(e){return this._invoke("throw",e)},Oy.prototype.return=function(e){return this._invoke("return",e)};const jy=ol.loadingstrategy;function By(e){"@babel/helpers - typeof";return(By="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 Uy(){Uy=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",n=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function l(e,t,r,i){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(i||[]);return n._invoke=function(e,t,r){var i="suspendedStart";return function(s,n){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===s)throw n;return A()}for(r.method=s,r.arg=n;;){var a=r.delegate;if(a){var o=S(a,r);if(o){if(o===u)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var l=h(e,t,r);if("normal"===l.type){if(i=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),n}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}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 y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==t&&r.call(m,s)&&(f=m);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 i;this._invoke=function(s,n){function a(){return new t(function(i,a){!function i(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"==By(c)&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){i("next",e,a,o)},function(e){i("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return i("throw",e,a,o)})}o(l.arg)}(s,n,i,a)})}return i=i?i.then(a,a):a()}}function S(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(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 i=h(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var s=i.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 x(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,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 i=-1,n=function t(){for(;++i<e.length;)if(r.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){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,r,i,s,n){void 0===n&&(n=Promise);var a=new b(l(t,r,i,s),n);return e.isGeneratorFunction(r)?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 r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var i=t.pop();if(i in e)return r.value=i,r.done=!1,r}return r.done=!0,r}},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(_),!e)for(var t in this)"t"===t.charAt(0)&&r.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 i(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=void 0),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return i("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return i(n.catchLoc,!0);if(this.prev<n.finallyLoc)return i(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return i(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return i(n.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i];if(s.tryLoc<=this.prev&&r.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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var s=i.arg;_(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function Vy(e,t,r,i,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(i,s)}function Jy(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var n=e.apply(t,r);function a(e){Vy(n,i,s,a,o,"next",e)}function o(e){Vy(n,i,s,a,o,"throw",e)}a(void 0)})}}function zy(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function qy(e,t){return(qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Hy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,i=Wy(e);if(t){var s=Wy(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return function(e,t){if(t&&("object"===By(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function Wy(e){return(Wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Yy(e){var t,r,i,s=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new Xy(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function Xy(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(Xy=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 r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new Xy(e)}var Qy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qy(e,t)}(n,qo());var t,r,i,s=Hy(n);function n(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r=Object.assign({strategy:jy.bbox},e);return delete r.url,delete r.extent,delete r.idField,(t=s.call(this,r)).options=e||{},t.strategy=r.strategy,t.url=t.options.url,t.extent=t.options.extent,t._idField=t.options.idField||"SmID",t._validatedId=!1,t._checked=!1,t.setLoader(function(){var e=Jy(Uy().mark(function e(t){var r,i;return Uy().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.strategy===jy.bbox&&(this._validatedId||this.clear(),this.extent&&(r=qn(this.extent,t),t=r&&r.length?r:this.extent)),this.extent||this.strategy!==jy.all&&isFinite(t[0])||(t=[]),Object.keys(t).length){e.next=6;break}return e.next=5,this._getStream(this.url);case 5:i=e.sent;case 6:this._handleFeatures(i&&i.body||this.url,t);case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()),t}return t=n,(r=[{key:"_handleFeatures",value:function(){var e=Jy(Uy().mark(function e(t,r){var i,s,n,a,o,l,h,u,c;return Uy().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i={},r&&r.length&&(i={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}),s=Gy(t,i),n=!1,a=!1,e.prev=5,l=Yy(s);case 7:return e.next=9,l.next();case 9:if(!(n=!(h=e.sent).done)){e.next=20;break}u=h.value,(c=u.properties[this._idField])&&!this._validatedId&&(this._validatedId=!0,this._checked=!0),u=(new(Dl())).readFeature(u),c&&this._checked&&u.setId(c),this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.addFeature(u);case 17:n=!1,e.next=7;break;case 20:e.next=26;break;case 22:e.prev=22,e.t0=e.catch(5),a=!0,o=e.t0;case 26:if(e.prev=26,e.prev=27,!n||null==l.return){e.next=31;break}return e.next=31,l.return();case 31:if(e.prev=31,!a){e.next=34;break}throw o;case 34:return e.finish(31);case 35:return e.finish(26);case 36:case"end":return e.stop()}},e,this,[[5,22,26,36],[27,,31,35]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"_getStream",value:function(){var e=Jy(Uy().mark(function e(t){return Uy().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ue.get(t,{},{withoutFormatSuffix:!0}).then(function(e){return e});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()}])&&zy(t.prototype,r),i&&zy(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}();class Zy extends bo{constructor(e,t){super(e,t),this._knowledgeGraphService=new Fn(e,t)}query(e,t){return this._knowledgeGraphService.query(e,t)}getGraphMaps(e){return this._knowledgeGraphService.getGraphMaps(e)}getGraphMap(e,t){return this._knowledgeGraphService.getGraphMap(e,t)}async getGraphMapData(e){return await this._knowledgeGraphService.getGraphMapData(e)}}class Ky extends(vo()){constructor(e,t){super(),this.graph=null,this.EVENT_TYPES=["loaded"],this.url=e,this.options=t;const r=e.split("/").pop();this.url=e.replace(`/graphmaps/${r}`,""),this.createGraphMap(r,t)}async createGraphMap(e,t){this.knowledgeGraphService=this.createKnowledgeGraphService(this.url,t);const r=await this.knowledgeGraphService.getGraphMapData(e),i=mo.dataFromGraphMap(r.data,r.graphMap);this.graph=new mo(t&&t.config),this.graph.on("beforelayout",()=>{this.dispatchEvent(this.EVENT_TYPES[0])}),this.graph.setData(i),this.graph.handleNodeStatus(function(e){const{expand:t,collapse:r,hidden:i}=e.dataContent;return{expand:t&&JSON.parse(t),collapse:r&&JSON.parse(r),hidden:i&&JSON.parse(i)}}(r.graphMap))}createKnowledgeGraphService(e,t){return new Zy(e,t)}}const $y=ol.geom.LineString;var em=r.n($y),tm=function(e){if(em().prototype.getFlatMidpoint||(em().prototype.getFlatMidpoint=function(){return this.getCoordinateAt(.5)}),"4"===$o.getOlVersion()&&window&&window.ol&&window.ol.geom.flat){window.targetMapCache=e;let t=window.ol;t.format.MVT.prototype.readProjection=function(e){return new t.proj.Projection({code:"",units:t.proj.Units.TILE_PIXELS})},t.format.MVT.prototype.readProjection=function(e){return new t.proj.Projection({code:"",units:t.proj.Units.TILE_PIXELS})},t.render.canvas.Replay.prototype.applyFill=function(e,r){var i=e.fillStyle,s=[t.render.canvas.Instruction.SET_FILL_STYLE,i];if("string"!=typeof i){var n=window.targetMapCache.getView().getProjection().getExtent();s.push([n[0],n[3]])}this.instructions.push(s)},t.render.canvas.Replay.prototype.applyFill=function(e,r){var i=e.fillStyle,s=[t.render.canvas.Instruction.SET_FILL_STYLE,i];if("string"!=typeof i){var n=window.targetMapCache.getView().getProjection().getExtent();s.push([n[0],n[3]])}this.instructions.push(s)},t.format.MVT.prototype.createFeature_=function(e,r,i){var s,n=r.type;if(0===n)return null;var a=r.id,o=r.properties;o[this.layerName_]=r.layer.name;var l=[],h=[];t.format.MVT.readRawGeometry_(e,r,l,h);var u=t.format.MVT.getGeometryType_(n,h.length);if(this.featureClass_===t.render.Feature)s=new this.featureClass_(u,l,h,o,a);else{var c;if(u==t.geom.GeometryType.POLYGON){for(var d=[],p=0,f=0,y=0,m=h.length;y<m;++y){var g=h[y];t.geom.flat.orient.linearRingIsClockwise(l,p,g,2)||(d.push(h.slice(f,y+1)),f=y+1),p=g}d.length>1?(h=d,c=new t.geom.MultiPolygon(null)):c=new t.geom.Polygon(null)}else c=u===t.geom.GeometryType.POINT?new t.geom.Point(null):u===t.geom.GeometryType.LINE_STRING?new t.geom.LineString(null):u===t.geom.GeometryType.POLYGON?new t.geom.Polygon(null):u===t.geom.GeometryType.MULTI_POINT?new t.geom.MultiPoint(null):u===t.geom.GeometryType.MULTI_LINE_STRING?new t.geom.MultiLineString(null):null;if(c){c.setFlatCoordinates(t.geom.GeometryLayout.XY,l,h),s=new this.featureClass_,this.geometryName_&&s.setGeometryName(this.geometryName_);var v=t.format.Feature.transformWithOptions(c,!1,this.adaptOptions(i));s.setGeometry(v),s.setId(a),s.setProperties(o)}}return s},t.geom.flat.textpath.lineString=function(e,r,i,s,n,a,o,l){for(var h=[],u=Math.atan2(e[i-s+1]-e[r+1],e[i-s]-e[r]),c=u<-.785||u>2.356,d=u<-.785&&u>-2.356||u>.785&&u<2.356,p=n.length,f=e[r],y=e[r+1],m=e[r+=s],g=e[r+1],v=0,b=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-y,2));r<i-s&&v+b<o;)f=m,y=g,m=e[r+=s],g=e[r+1],v+=b,b=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-y,2));for(var S,x,_,w,C=(o-v)/b,A=t.math.lerp(f,m,C),M=t.math.lerp(y,g,C),T="",E=0,O=0;O<p;++O){x=c?p-O-1:O;var P=n.charAt(x),I=P.charCodeAt(0),N=I>=19968&&I<=40907,L=a(T=c?P+T:T+P)-E;for(E+=L;r<i-s&&Math.sqrt(Math.pow(m-A,2)+Math.pow(g-M,2))<L/2;)f=m,y=g,m=e[r+=s],g=e[r+1];var k=Math.pow(m-f,2)+Math.pow(g-y,2),F=2*(m-f)*(f-A)+2*(g-y)*(y-M),R=Math.pow(f-A,2)+Math.pow(y-M,2)-Math.pow(L/2,2),D=(-F+Math.sqrt(F*F-4*k*R))/(2*k),G=(-F-Math.sqrt(F*F-4*k*R))/(2*k);C=D<0||D>1?G:G<0||G>1?D:D<G?G:D;for(var j=t.math.lerp(f,m,C),B=t.math.lerp(y,g,C);r<i-s&&Math.sqrt(Math.pow(m-j,2)+Math.pow(g-B,2))<L/2;)f=m,y=g,m=e[r+=s],g=e[r+1];k=Math.pow(m-f,2)+Math.pow(g-y,2),F=2*(m-f)*(f-j)+2*(g-y)*(y-B),R=Math.pow(f-j,2)+Math.pow(y-B,2)-Math.pow(L/2,2),D=(-F+Math.sqrt(F*F-4*k*R))/(2*k),G=(-F-Math.sqrt(F*F-4*k*R))/(2*k),C=D<0||D>1?G:G<0||G>1?D:D<G?G:D;var U=t.math.lerp(f,m,C),V=t.math.lerp(y,g,C),J=Math.atan2(V-M,U-A);if(c&&(J+=J>0?-Math.PI:Math.PI),N&&d&&(J+=J>0?-Math.PI/2:Math.PI/2),void 0!==_){var z=J-_;if(z+=z>Math.PI?-2*Math.PI:z<-Math.PI?2*Math.PI:0,N===w?Math.abs(z)>l:Math.abs(z)>l+Math.PI/2)return null}_!=J||d?(E=L,S=[j,B,L/2,J,T=P],c?h.unshift(S):h.push(S),_=J,w=N):(c&&(S[0]=j,S[1]=B,S[2]=L/2),S[4]=T),A=U,M=V,o+=L}return h},t.layer.VectorTile.prototype.setFastRender=function(e){return this.fastRender=e},t.renderer.canvas.VectorTileLayer.prototype.postCompose=function(e,r,i){var s,n,a=this.getLayer(),o=a.getDeclutter()?{}:null,l=a.getSource(),h=a.getRenderMode(),u=t.renderer.canvas.VectorTileLayer.VECTOR_REPLAYS[h],c=r.pixelRatio,d=r.viewState.rotation,p=r.size;d&&(s=Math.round(c*p[0]/2),n=Math.round(c*p[1]/2),t.render.canvas.rotateAtOffset(e,-d,s,n)),o&&this.declutterTree_.clear();for(var f=this.renderedTiles,y=l.getTileGridForProjection(r.viewState.projection),m=[],g=[],v=f.length-1;v>=0;--v){var b=f[v];if(b.getState()!=t.TileState.ABORT)for(var S=b.tileCoord,x=y.getTileCoordExtent(S)[0]-y.getTileCoordExtent(b.wrappedTileCoord)[0],_=void 0,w=0,C=b.tileKeys.length;w<C;++w){var A=b.getTile(b.tileKeys[w]);if(A.getState()!=t.TileState.ERROR){var M=A.getReplayGroup(a,S.toString());if(h==t.layer.VectorTileRenderType.VECTOR||M&&M.hasReplays(u)){_||(_=this.getTransform(r,x));var T=A.tileCoord[0],E=M.getClipCoords(_);e.save(),e.globalAlpha=i.opacity;for(var O=0,P=m.length;O<P;++O){var I=m[O];T<g[O]&&(e.beginPath(),e.moveTo(E[0],E[1]),e.lineTo(E[2],E[3]),e.lineTo(E[4],E[5]),e.lineTo(E[6],E[7]),e.moveTo(I[6],I[7]),e.lineTo(I[4],I[5]),e.lineTo(I[2],I[3]),e.lineTo(I[0],I[1]),e.clip())}M.replay(e,_,d,{},u,o),e.restore(),m.push(E),g.push(T)}else!0===a.fastRender&&(A.replayGroups_={},A.features_=[])}}}o&&t.render.canvas.ReplayGroup.replayDeclutter(o,e,d),d&&t.render.canvas.rotateAtOffset(e,d,s,n),t.renderer.canvas.TileLayer.prototype.postCompose.apply(this,arguments)}}};window.olExtends=tm;var rm=r(794),im=r.n(rm);class sm extends(vo()){constructor(e){super(),e=e||{},this.spriteRegEx=/^(.*)(\?.*)$/,this.defaultFont=["DIN Offc Pro Medium","Arial Unicode MS Regular"],this.map=e.map,this.source=e.source,this.styleTarget=e.style||te.urlAppend(te.urlPathAppend(e.url,"tileFeature/vectorstyles"),"type=MapBox_GL&styleonly=true"),this.resolutions=e.resolutions,this.withCredentials=e.withCredentials,this.selectedObjects=[],this.selectedStyle=e.selectedStyle||function(){return new(al())({fill:new(pl())({color:"rgba(255, 0, 0, 1)"}),stroke:new(yl())({color:"rgba(255, 0, 0, 1)",width:10}),text:new(gl())({font:'normal 400 11.19px "Microsoft YaHei"',placement:"point",fill:new(pl())({color:"blue"})}),image:new(cl())({radius:5,fill:new(pl())({color:"blue"})})})},this.layersBySourceLayer={},tm(this.map),this._loadStyle(this.styleTarget)}getStyleFunction(){return this.featureStyleFuntion}getStylesBySourceLayer(e){if(this.layersBySourceLayer[e])return this.layersBySourceLayer[e];const t=[];for(let r=0;r<this._mbStyle.layers.length;r++){const i=this._mbStyle.layers[r];i["source-layer"]===e&&t.push(i)}return this.layersBySourceLayer[e]=t,t}setSelectedId(e,t){this.selectedObjects=[],this.selectedObjects.push({id:e,sourceLayer:t})}setSelectedObjects(e){Array.isArray(e)||(e=[e]),this.selectedObjects=[],this.selectedObjects=e}addSelectedObjects(e){Array.isArray(e)||(e=[e]),this.selectedObjects.push(...e)}removeSelectedObjects(e){Array.isArray(e)||(e=[e]),e.forEach(e=>{im()(this.selectedObjects,t=>e.id===t.id&&e.sourceLayer===t.sourceLayer)})}clearSelectedObjects(){this.selectedObjects=[]}updateStyles(e){"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);const t={};e.forEach(e=>{t[e.id]=e});let r=0;for(const i in this._mbStyle.layers){const s=this._mbStyle.layers[i];if(r>=e.length)break;if(!t[s.id])continue;const n=JSON.parse(JSON.stringify(t[s.id]));n.paint&&(n.paint=Object.assign({},s.paint,n.paint)),n.layout&&(n.layout=Object.assign({},s.layout,n.layout)),Object.assign(s,n),r++}this._createStyleFunction()}setStyle(e){this.layersBySourceLayer={},this._loadStyle(e)}_loadStyle(e){if("[object Object]"==Object.prototype.toString.call(e))this._mbStyle=e,this._resolve();else{var t=Ve.appendCredential(e);Ue.get(t,null,{withCredentials:this.withCredentials}).then(e=>e.json()).then(e=>{this._mbStyle=e,this._resolve()})}}_resolve(){if(this.source||(this.source=Object.keys(this._mbStyle.sources)[0]),this._mbStyle.sprite){const e=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"";this._mbStyle.sprite=this._mbStyle.sprite.replace("@2x","");const t=this._toSpriteUrl(this._mbStyle.sprite,this.path,e+".json");Ue.get(Ve.appendCredential(t),null,{withCredentials:this.withCredentials}).then(e=>e.json()).then(t=>{this._spriteData=t,this._spriteImageUrl=Ve.appendCredential(this._toSpriteUrl(this._mbStyle.sprite,this.path,e+".png")),this._spriteImage=null;const r=new Image;r.crossOrigin=this.withCredentials?"use-credentials":"anonymous",r.onload=(()=>{this._spriteImage=r,this._initStyleFunction()}),r.onerror=(()=>{this._spriteImage=null,this._initStyleFunction()}),r.src=this._spriteImageUrl}).catch(e=>{console.log(e),this._spriteImage=null,this._initStyleFunction()})}else this._initStyleFunction()}_initStyleFunction(){if(!this.resolutions&&this._mbStyle.metadata&&this._mbStyle.metadata.indexbounds){const t=this._mbStyle.metadata.indexbounds;var e=Math.max(t[2]-t[0],t[3]-t[1]);const r=[];for(let t=0;t<30;t++)r.push(e/512/Math.pow(2,t));this.resolutions=r}this._createStyleFunction(),this.dispatchEvent("styleloaded")}_createStyleFunction(){this.map&&window.olms.applyBackground(this.map,this._mbStyle),this.featureStyleFuntion=this._getStyleFunction()}_getStyleFunction(){return this.fun=window.olms.stylefunction({setStyle:function(){},set:function(){},changed:function(){}},this._mbStyle,this.source,this.resolutions,this._spriteData,"",this._spriteImage),(e,t)=>{const r=this.fun(e,t);if(this.selectedObjects.length>0&&this.selectedObjects.find(t=>t.id===e.getId()&&t.sourceLayer===e.get("layer"))){const i=r&&r[0]?r[0].getZIndex():99999;let s=this.selectedStyle(e,t);Array.isArray(s)||(s=[s]);for(let t=0;t<s.length;t++){const n=s[t];"Point"===e.getGeometry().getType()&&r[0].getText()&&n.getText()&&(n.setFill(null),n.setStroke(null),n.setImage(),n.getText().setText(r[0].getText().getText())),n.setZIndex(i)}return s}return r}}_withPath(e,t){return t&&0!=e.indexOf("http")&&(e=t+e),e}_toSpriteUrl(e,t,r){const i=(e=this._withPath(e,t)).match(this.spriteRegEx);return i?i[1]+r+(i.length>2?i[2]:""):e+r}}class nm extends bo{constructor(e,t){super(e,t),this._addressMatchService=new nt(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}code(e,t){return this._addressMatchService.code(te.urlPathAppend(this.url,"geocoding"),e,t)}decode(e,t){return this._addressMatchService.decode(te.urlPathAppend(this.url,"geodecoding"),e,t)}}class am{constructor(e,t){this.url=e,this.options=t||{}}queryChart(e,t,r){var i=this,s=e,n=i._processFormat(r);return new Nt(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:n}).processAsync(s,t)}getChartFeatureInfo(e){var t=this,r=te.urlPathAppend(t.url,"chartFeatureInfoSpecs");return new Et(r,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers}).processAsync(e)}_processFormat(e){return e||t.GEOJSON}}class om extends bo{constructor(e,t){super(e,t),this._chartService=new am(e,t)}queryChart(e,t,r){return e=this._processParams(e),this._chartService.queryChart(e,t,r)}getChartFeatureInfo(e){return this._chartService.getChartFeatureInfo(e)}_processParams(e){if(!e)return{};e.returnContent=null==e.returnContent||e.returnContent,e.filter&&(e.chartQueryFilterParameters=$o.isArray(e.filter)?e.filter:[e.filter]),e.bounds&&(e.bounds=new ne(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3]))}}class lm{constructor(e,t){this.url=e,this.options=t||{}}getFields(e,t){var r=this;return new Wr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,datasource:e.datasource,dataset:e.dataset}).processAsync(t)}getFieldStatisticsInfo(e,t){if(e instanceof dr){var r=this,i=e.fieldName,s=e.statisticMode;s&&!Array.isArray(s)&&(s=[s]),r.currentStatisticResult={fieldName:i},r._statisticsCallback=t,s.forEach(t=>{r.currentStatisticResult[t]=null,r._fieldStatisticRequest(e.datasource,e.dataset,i,t)})}}_fieldStatisticRequest(e,t,r,i){var s=this;new pr(s.url,{datasource:e,dataset:t,field:r,statisticMode:i,crossOrigin:s.options.crossOrigin,headers:s.options.headers}).processAsync(s._processCompleted.bind(s))}_processCompleted(e){var t=this;if(e.error)t._statisticsCallback(e);else{var r=!0,i=e.result;for(var s in this.currentStatisticResult&&null==t.currentStatisticResult[i.mode]&&(this.currentStatisticResult[i.mode]=i.result),t.currentStatisticResult)if(null==t.currentStatisticResult[s]){r=!1;break}r&&t._statisticsCallback({result:t.currentStatisticResult})}}}class hm extends bo{constructor(e,t){super(e,t),this._fieldService=new lm(e,t)}getFields(e,t){return this._fieldService.getFields(e,t)}getFieldStatisticsInfo(e,t){return this._fieldService.getFieldStatisticsInfo(e,t)}}class um extends bo{constructor(e,t){super(e,t),this._datasetService=new kr(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getDatasets(e,t){if(e)return this._datasetService.getDatasetsService(e,t)}getDataset(e,t,r){if(e&&t)return this._datasetService.getDatasetService(e,t,r)}setDataset(e,t){if(e instanceof nn||e instanceof hn){if(e instanceof nn)var r={datasetType:e.datasetType,datasetName:e.datasetName,datasourceName:e.datasourceName};else e instanceof hn&&(r={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});return this._datasetService.setDatasetService(r,t)}}deleteDataset(e,t,r){return this._datasetService.deleteDatasetService(e,t,r)}}class cm extends bo{constructor(e,t){super(e,t),this._datasourceService=new Wt(this.url,{proxy:this.proxy,withCredentials:this.withCredentials,crossOrigin:this.crossOrigin,headers:this.headers})}getDatasources(e){return this._datasourceService.getDatasourcesService(e)}getDatasource(e,t){if(e)return this._datasourceService.getDatasourceService(e,t)}setDatasource(e,t){if(!(e instanceof Ss))return;const r={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};return this._datasourceService.setDatasourceService(r,t)}}class dm extends bo{constructor(e,t){super(e,t),this._gridCellQueryService=new Xr(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getGridCellInfos(e,t){return e?this._gridCellQueryService.processAsync(e,t):null}}class pm extends bo{constructor(e,t){super(e,t),this.headers=!0,this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0,this._geoprocessingJobsService=new Ir(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getTools(e){return this._geoprocessingJobsService.getTools(e)}getTool(e,t){return this._geoprocessingJobsService.getTool(e,t)}execute(e,t,r,i){return this._geoprocessingJobsService.execute(e,t,r,i)}submitJob(e,t,r,i){return this._geoprocessingJobsService.submitJob(e,t,r,i)}waitForJobCompletion(e,t,r,i){return this._geoprocessingJobsService.waitForJobCompletion(e,t,r,i)}getJobInfo(e,t,r){return this._geoprocessingJobsService.getJobInfo(e,t,r)}cancelJob(e,t,r){return this._geoprocessingJobsService.cancelJob(e,t,r)}getJobs(e,t){return this._geoprocessingJobsService.getJobs(e,t)}getResults(e,t,r,i){return this._geoprocessingJobsService.getResults(e,t,r,i)}}class fm{constructor(e,t){this.url=e,this.options=t||{}}getLayersInfo(e){var t=this;return new Ai(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers}).processAsync(e)}getLayersLegendInfo(e,t){var r=this;return new ps(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}setLayerInfo(e,t){if(e){var r=this,i=e.resourceID,s=e.tempLayerName,n=e.layerInfo;if(i&&s){var a=te.urlPathAppend(r.url,"tempLayersSet/"+i+"/"+s);return new xs(a,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(n,t)}}}setLayersInfo(e,t){if(e){var r=this,i=e.resourceID,s=!!e.isTempLayers&&e.isTempLayers,n=e.layersInfo;if((!s||i)&&n)return new _s(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,resourceID:i,isTempLayers:s}).processAsync(n,t)}}setLayerStatus(e,t){if(e){var r=this;return new Cs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}}class ym extends bo{constructor(e,t){super(e,t),this._layerInfoService=new fm(e,t)}getLayersInfo(e){return this._layerInfoService.getLayersInfo(e)}getLayersLegendInfo(e,t){return this._layerInfoService.getLayersLegendInfo(e,t)}setLayerInfo(e,t){return this._layerInfoService.setLayerInfo(e,t)}setLayersInfo(e,t){return this._layerInfoService.setLayersInfo(e,t)}setLayerStatus(e,t){return this._layerInfoService.setLayerStatus(e,t)}}class mm extends bo{constructor(e,t){super(e,t)}measureDistance(e,t){return this.measure(e,"DISTANCE",t)}measureArea(e,t){return this.measure(e,"AREA",t)}measure(e,t,r){var i=this;return new ji(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,measureMode:t}).processAsync(i._processParam(e),r)}_processParam(e){return e&&e.geometry&&(e.geometry=$o.toSuperMapGeometry(JSON.parse((new(Dl())).writeGeometry(e.geometry)))),e}}class gm{constructor(e,t){this.url=e,this.options=t||{}}sinksFacilityAnalyst(e,t){var r=this;return new er(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}sourcesFacilityAnalyst(e,t){var r=this;return new rr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}traceUpFacilityAnalyst(e,t){var r=this;return new lr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}traceDownFacilityAnalyst(e,t){var r=this;return new ar(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}upstreamFacilityAnalyst(e,t){var r=this;return new ur(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}class vm extends bo{constructor(e,t){super(e,t),this._networkAnalyst3DService=new gm(e,t)}sinksFacilityAnalyst(e,t){return this._networkAnalyst3DService.sinksFacilityAnalyst(e,t)}sourcesFacilityAnalyst(e,t){return this._networkAnalyst3DService.sourcesFacilityAnalyst(e,t)}traceUpFacilityAnalyst(e,t){return this._networkAnalyst3DService.traceUpFacilityAnalyst(e,t)}traceDownFacilityAnalyst(e,t){return this._networkAnalyst3DService.traceDownFacilityAnalyst(e,t)}upstreamFacilityAnalyst(e,t){return this._networkAnalyst3DService.upstreamFacilityAnalyst(e,t)}}class bm{constructor(e,t){this.url=e,this.options=t||{}}burstPipelineAnalyst(e,t){var r=this;return new Tt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}computeWeightMatrix(e,t){var r=this;return new Dt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}findClosestFacilities(e,t,r){var i=this;return new yr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}traceAnalyst(e,t,r){var i=this;return new us(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}connectedEdgesAnalyst(e,t,r){var i=this;return new ds(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}streamFacilityAnalyst(e,t,r){var i=this;return new sr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}findLocation(e,t,r){var i=this;return new gr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}findPath(e,t,r){var i=this;return new xr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}findTSPPaths(e,t,r){var i=this;return new Ar(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}findMTSPPaths(e,t,r){var i=this;return new br(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}findServiceAreas(e,t,r){var i=this;return new wr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}updateEdgeWeight(e,t){var r=this;return new an(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}updateTurnNodeWeight(e,t){var r=this;return new ln(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}_processFormat(e){return e||t.GEOJSON}}class Sm extends bo{constructor(e,t){super(e,t),this._networkAnalystService=new bm(e,t)}burstPipelineAnalyst(e,t){return e=this._processParams(e),this._networkAnalystService.burstPipelineAnalyst(e,t)}computeWeightMatrix(e,t){return e=this._processParams(e),this._networkAnalystService.computeWeightMatrix(e,t)}findClosestFacilities(e,t,r){return e=this._processParams(e),this._networkAnalystService.findClosestFacilities(e,t,r)}traceAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.traceAnalyst(e,t,r)}connectedEdgesAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.connectedEdgesAnalyst(e,t,r)}streamFacilityAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.streamFacilityAnalyst(e,t,r)}findLocation(e,t,r){return e=this._processParams(e),this._networkAnalystService.findLocation(e,t,r)}findPath(e,t,r){return e=this._processParams(e),this._networkAnalystService.findPath(e,t,r)}findTSPPaths(e,t,r){return e=this._processParams(e),this._networkAnalystService.findTSPPaths(e,t,r)}findMTSPPaths(e,t,r){return e=this._processParams(e),this._networkAnalystService.findMTSPPaths(e,t,r)}findServiceAreas(e,t,r){return e=this._processParams(e),this._networkAnalystService.findServiceAreas(e,t,r)}updateEdgeWeight(e,t){return this._networkAnalystService.updateEdgeWeight(e,t)}updateTurnNodeWeight(e,t){return this._networkAnalystService.updateTurnNodeWeight(e,t)}_processParams(e){if(!e)return{};if(e.centers&&$o.isArray(e.centers)&&e.centers.map(function(t,r){return e.centers[r]=t instanceof Od()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.centers[r]}),e.nodes&&$o.isArray(e.nodes)&&e.nodes.map(function(t,r){return e.nodes[r]=t instanceof Od()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.nodes[r]}),e.event&&e.event instanceof Od()&&(e.event={x:e.event.getCoordinates()[0],y:e.event.getCoordinates()[1]}),e.facilities&&$o.isArray(e.facilities)&&e.facilities.map(function(t,r){return e.facilities[r]=t instanceof Od()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.facilities[r]}),e.parameter&&e.parameter.barrierPoints){var t=e.parameter.barrierPoints;$o.isArray(t)?t.map(function(t,r){return e.parameter.barrierPoints[r]=t instanceof Od()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.parameter.barrierPoints[r]}):e.parameter.barrierPoints=[t instanceof Od()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t]}return e}_processFormat(e){return e||t.GEOJSON}}class xm{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 r=this,i=r._processFormat(t);return new Li(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getKernelDensityJobs(e)}getKernelDensityJob(e,t,r){var i=this,s=i._processFormat(r);return new Li(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getKernelDensityJob(e,t)}addKernelDensityJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Li(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addKernelDensityJob(e,r,t,function(e){s.kernelDensityJobs[e.id]=e.state})}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var r=this,i=r._processFormat(t);return new Ns(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getSummaryMeshJobs(e)}getSummaryMeshJob(e,t,r){var i=this,s=i._processFormat(r);return new Ns(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getSummaryMeshJob(e,t)}addSummaryMeshJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Ns(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addSummaryMeshJob(e,r,t,function(e){s.summaryMeshJobs[e.id]=e.state})}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var r=this,i=r._processFormat(t);return new Ms(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getQueryJobs(e)}getQueryJob(e,t,r){var i=this,s=i._processFormat(r);return new Ms(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getQueryJob(e,t)}addQueryJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Ms(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addQueryJob(e,r,t,function(e){s.queryJobs[e.id]=e.state})}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var r=this,i=r._processFormat(t);return new ks(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getSummaryRegionJobs(e)}getSummaryRegionJob(e,t,r){var i=this,s=i._processFormat(r);return new ks(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getSummaryRegionJob(e,t)}addSummaryRegionJob(e,t,r,i){var s=this,n=s._processFormat(i);return new ks(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addSummaryRegionJob(e,r,t,function(e){s.summaryRegionJobs[e.id]=e.state})}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var r=this,i=r._processFormat(t);return new cn(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getVectorClipJobs(e)}getVectorClipJob(e,t,r){var i=this,s=i._processFormat(r);return new cn(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getVectorClipJob(e,t)}addVectorClipJob(e,t,r,i){var s=this,n=s._processFormat(i);return new cn(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addVectorClipJob(e,r,t,function(e){s.vectorClipJobs[e.id]=e.state})}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var r=this,i=r._processFormat(t);return new Vi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getOverlayGeoJobs(e)}getOverlayGeoJob(e,t,r){var i=this,s=i._processFormat(r);return new Vi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getOverlayGeoJob(e,t)}addOverlayGeoJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Vi(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addOverlayGeoJob(e,r,t,function(e){s.overlayGeoJobs[e.id]=e.state})}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var r=this,i=r._processFormat(t);return new Ct(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getBuffersJobs(e)}getBuffersJob(e,t,r){var i=this,s=i._processFormat(r);return new Ct(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getBuffersJob(e,t)}addBuffersJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Ct(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addBuffersJob(e,r,t,function(e){s.buffersJobs[e.id]=e.state})}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var r=this,i=r._processFormat(t);return new Zs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getTopologyValidatorJobs(e)}getTopologyValidatorJob(e,t,r){var i=this,s=i._processFormat(r);return new Zs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getTopologyValidatorJob(e,t)}addTopologyValidatorJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Zs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addTopologyValidatorJob(e,r,t,function(e){s.topologyValidatorJobs[e.id]=e.state})}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var r=this,i=r._processFormat(t);return new Ps(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i}).getSummaryAttributesJobs(e)}getSummaryAttributesJob(e,t,r){var i=this,s=i._processFormat(r);return new Ps(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:s}).getSummaryAttributesJob(e,t)}addSummaryAttributesJob(e,t,r,i){var s=this,n=s._processFormat(i);return new Ps(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,format:n}).addSummaryAttributesJob(e,r,t,function(e){s.summaryAttributesJobs[e.id]=e.state})}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||t.GEOJSON}}class _m extends bo{constructor(e,t){super(e,t),this._processingService=new xm(e,t)}getKernelDensityJobs(e,t){return this._processingService.getKernelDensityJobs(e,t)}getKernelDensityJob(e,t,r){return this._processingService.getKernelDensityJob(e,t,r)}addKernelDensityJob(e,t,r,i){return e=this._processParams(e),this._processingService.addKernelDensityJob(e,t,r,i)}getKernelDensityJobState(e){return this._processingService.getKernelDensityJobState(e)}getSummaryMeshJobs(e,t){return this._processingService.getSummaryMeshJobs(e,t)}getSummaryMeshJob(e,t,r){return this._processingService.getSummaryMeshJob(e,t,r)}addSummaryMeshJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryMeshJob(e,t,r,i)}getSummaryMeshJobState(e){return this._processingService.getSummaryMeshJobState(e)}getQueryJobs(e,t){return this._processingService.getQueryJobs(e,t)}getQueryJob(e,t,r){return this._processingService.getQueryJob(e,t,r)}addQueryJob(e,t,r,i){return e=this._processParams(e),this._processingService.addQueryJob(e,t,r,i)}getQueryJobState(e){return this._processingService.getQueryJobState(e)}getSummaryRegionJobs(e,t){return this._processingService.getSummaryRegionJobs(e,t)}getSummaryRegionJob(e,t,r){return this._processingService.getSummaryRegionJob(e,t,r)}addSummaryRegionJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryRegionJob(e,t,r,i)}getSummaryRegionJobState(e){return this._processingService.getSummaryRegionJobState(e)}getVectorClipJobs(e,t){return this._processingService.getVectorClipJobs(e,t)}getVectorClipJob(e,t,r){return this._processingService.getVectorClipJob(e,t,r)}addVectorClipJob(e,t,r,i){return e=this._processParams(e),this._processingService.addVectorClipJob(e,t,r,i)}getVectorClipJobState(e){return this._processingService.getVectorClipJobState(e)}getOverlayGeoJobs(e,t){return this._processingService.getOverlayGeoJobs(e,t)}getOverlayGeoJob(e,t,r){return this._processingService.getOverlayGeoJob(e,t,r)}addOverlayGeoJob(e,t,r,i){return e=this._processParams(e),this._processingService.addOverlayGeoJob(e,t,r,i)}getoverlayGeoJobState(e){return this._processingService.getoverlayGeoJobState(e)}getBuffersJobs(e,t){return this._processingService.getBuffersJobs(e,t)}getBuffersJob(e,t,r){return this._processingService.getBuffersJob(e,t,r)}addBuffersJob(e,t,r,i){return e=this._processParams(e),this._processingService.addBuffersJob(e,t,r,i)}getBuffersJobState(e){return this._processingService.getBuffersJobState(e)}getTopologyValidatorJobs(e,t){return this._processingService.getTopologyValidatorJobs(e,t)}getTopologyValidatorJob(e,t,r){return this._processingService.getTopologyValidatorJob(e,t,r)}addTopologyValidatorJob(e,t,r,i){return e=this._processParams(e),this._processingService.addTopologyValidatorJob(e,t,r,i)}getTopologyValidatorJobState(e){return this._processingService.getTopologyValidatorJobState(e)}getSummaryAttributesJobs(e,t){return this._processingService.getSummaryAttributesJobs(e,t)}getSummaryAttributesJob(e,t,r){return this._processingService.getSummaryAttributesJob(e,t,r)}addSummaryAttributesJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryAttributesJob(e,t,r,i)}getSummaryAttributesJobState(e){return this._processingService.getSummaryAttributesJobState(e)}_processFormat(e){return e||t.GEOJSON}_processParams(e){return e?(e.bounds&&(e.bounds=$o.toSuperMapBounds(e.bounds)),e.query&&(e.query=$o.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=$o.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=$o.toProcessingParam(e.geometryClip)),e):{}}}class wm{constructor(e,t){this.url=e,this.options=t||{}}getAreaSolarRadiationResult(e,t,r){var i=this;return new ut(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}bufferAnalysis(e,t,r){var i=this;return new vt(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}densityAnalysis(e,t,r){var i=this;return new Xt(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}generateSpatialData(e,t,r){var i=this;return new Tr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}geoRelationAnalysis(e,t,r){var i=this;return new Lr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}interpolationAnalysis(e,t,r){var i=this;return new Ii(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}mathExpressionAnalysis(e,t,r){var i=this;return new Di(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}overlayAnalysis(e,t,r){var i=this;return new Bi(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}routeCalculateMeasure(e,t,r){var i=this;return new ms(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}routeLocate(e,t,r){var i=this;return new vs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}surfaceAnalysis(e,t,r){var i=this;return new Rs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}terrainCurvatureCalculate(e,t,r){var i=this;return new Gs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}terrainCutFillCalculate(e,t,r){var i=this;return new is(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}terrainAspectCalculate(e,t,r){var i=this;return new ns(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}terrainSlopeCalculate(e,t,r){var i=this;return new os(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}thiessenAnalysis(e,t,r){var i=this;return new Ws(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}minDistanceAnalysis(e,t,r){var i=this;return new ts(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}convexHullAnalysis(e,t,r){var i=this;return new ls(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)}).processAsync(e,t)}geometrybatchAnalysis(e,t,r){for(var i=new Ys(this.url,{format:this._processFormat(r)}),s=[],n=0;n<e.length;n++){var a=e[n];s.push({analystName:a.analystName,param:a.param})}return i.processAsync(s,t)}_processFormat(e){return e||t.GEOJSON}}class Cm extends bo{constructor(e,t){super(e,t),this._spatialAnalystService=new wm(e,t)}getAreaSolarRadiationResult(e,t,r){return this._spatialAnalystService.getAreaSolarRadiationResult(e,t,r)}bufferAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.bufferAnalysis(e,t,r)}densityAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.densityAnalysis(e,t,r)}generateSpatialData(e,t,r){return this._spatialAnalystService.generateSpatialData(e,t,r)}geoRelationAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.geoRelationAnalysis(e,t,r)}interpolationAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.interpolationAnalysis(e,t,r)}mathExpressionAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.mathExpressionAnalysis(e,t,r)}overlayAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.overlayAnalysis(e,t,r)}routeCalculateMeasure(e,t,r){return e=this._processParams(e),this._spatialAnalystService.routeCalculateMeasure(e,t,r)}routeLocate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.routeLocate(e,t,r)}surfaceAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.surfaceAnalysis(e,t,r)}terrainCurvatureCalculate(e,t,r){return this._spatialAnalystService.terrainCurvatureCalculate(e,t,r)}terrainCutFillCalculate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.terrainCutFillCalculate(e,t,r)}terrainAspectCalculate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.terrainAspectCalculate(e,t,r)}terrainSlopeCalculate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.terrainSlopeCalculate(e,t,r)}thiessenAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.thiessenAnalysis(e,t,r)}minDistanceAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.minDistanceAnalysis(e,t,r)}convexHullAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.convexHullAnalysis(e,t,r)}geometrybatchAnalysis(e,t,r){for(var i=0;i<e.length;i++)e[i].param=this._processParams(e[i].param);return this._spatialAnalystService.geometrybatchAnalysis(e,t,r)}_processParams(e){if(!e)return{};if(e.bounds&&(e.bounds=$o.toSuperMapBounds(e.bounds)),e.inputPoints)for(let r=0;r<e.inputPoints.length;r++){var t=e.inputPoints[r];$o.isArray(t)?e.inputPoints[r]={x:t[0],y:t[1],tag:t[2]}:e.inputPoints[r]={x:t.getCoordinates()[0],y:t.getCoordinates()[1],tag:t.tag}}if(e.points)for(let t=0;t<e.points.length;t++){let r=e.points[t];$o.isArray(r)&&r.setCoordinates(r),e.points[t]=new he(r.getCoordinates()[0],r.getCoordinates()[1])}if(e.point){let t=e.point;$o.isArray(t)&&t.setCoordinates(t),e.point=new he(t.getCoordinates()[0],t.getCoordinates()[1])}if(e.extractRegion&&(e.extractRegion=this.convertGeometry(e.extractRegion)),e.extractParameter&&e.extractParameter.clipRegion&&(e.extractParameter.clipRegion=this.convertGeometry(e.extractParameter.clipRegion)),e.clipParam&&e.clipParam.clipRegion&&(e.clipParam.clipRegion=this.convertGeometry(e.clipParam.clipRegion)),e.sourceGeometry){var r=null;e.sourceGeometrySRID&&(r=e.sourceGeometrySRID),e.sourceGeometry=this.convertGeometry(e.sourceGeometry),r&&(e.sourceGeometry.SRID=r),delete e.sourceGeometry.sourceGeometrySRID}if(e.operateGeometry&&(e.operateGeometry=this.convertGeometry(e.operateGeometry)),e.sourceGeometries){for(var i=[],s=0;s<e.sourceGeometries.length;s++)i.push(this.convertGeometry(e.sourceGeometries[s]));e.sourceGeometries=i}if(e.operateGeometries){for(var n=[],a=0;a<e.operateGeometries.length;a++)n.push(this.convertGeometry(e.operateGeometries[a]));e.operateGeometries=n}if(e.inputGeometries){for(var o=[],l=0;l<e.inputGeometries.length;l++)o.push(this.convertGeometry(e.inputGeometries[l]));e.inputGeometries=o}if(e.sourceRoute&&e.sourceRoute instanceof em()&&e.sourceRoute.getCoordinates()){var h={type:"LINEM"};h.parts=[e.sourceRoute.getCoordinates()[0].length],h.points=[];for(let t=0;t<e.sourceRoute.getCoordinates()[0].length;t++){let r=e.sourceRoute.getCoordinates()[0][t];h.points=h.points.concat({x:r[0],y:r[1],measure:r[2]})}e.sourceRoute=h}var u=this;return e.operateRegions&&$o.isArray(e.operateRegions)&&e.operateRegions.map(function(t,r){return e.operateRegions[r]=u.convertGeometry(t),e.operateRegions[r]}),e.sourceRoute&&e.sourceRoute.components&&$o.isArray(e.sourceRoute.components)&&e.sourceRoute.components.map(function(t,r){return e.sourceRoute.components[r]=u.convertGeometry(t),e.sourceRoute.components[r]}),e}_processFormat(e){return e||t.GEOJSON}convertGeometry(e){return-1!=["FeatureCollection","Feature","Geometry"].indexOf(e.type)?$o.toSuperMapGeometry(e):$o.toSuperMapGeometry(JSON.parse((new(Dl())).writeGeometry(e)))}}class Am extends bo{constructor(e,t){super(e,t);var r=this;this._themeService=new Hs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers})}getThemeInfo(e,t){return this._themeService.processAsync(e,t)}}class Mm{constructor(e,t){this.url=e,this.options=t||{}}queryStop(e,t){var r=this;return new Es(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}analysisTransferPath(e,t){var r=this;return new en(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}analysisTransferSolution(e,t){var r=this;return new rn(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}class Tm extends bo{constructor(e,t){super(e,t),this._commonTrafficTransferAnalystService=new Mm(e,t)}queryStop(e,t){return this._commonTrafficTransferAnalystService.queryStop(e,t)}analysisTransferPath(e,t){return e=this._processParams(e),this._commonTrafficTransferAnalystService.analysisTransferPath(e,t)}analysisTransferSolution(e,t){return e=this._processParams(e),this._commonTrafficTransferAnalystService.analysisTransferSolution(e,t)}_processParams(e){return e?(e.transferLines&&!$o.isArray(e.transferLines)&&(e.transferLines=[e.transferLines]),e.points&&$o.isArray(e.points)&&e.points.map(function(t,r){return e.points[r]=t instanceof Od()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.points[r]}),e):{}}}class Em extends bo{constructor(e,t){super(e,t),this._webPrintingService=new wn(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}createWebPrintingJob(e,t){if(e)return this._webPrintingService.createWebPrintingJob(this._processParams(e),t)}getPrintingJob(e,t){return this._webPrintingService.getPrintingJob(e,t)}getPrintingJobResult(e,t){return this._webPrintingService.getPrintingJobResult(e,t)}getLayoutTemplates(e){return 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){return Array.isArray(e)?{x:e[0],y:e[1]}:e instanceof he||e instanceof Od()?{x:e.x,y:e.y}:e}}class Om extends bo{constructor(e,t){super(e,t),this._imageService=new An(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getCollections(e){return this._imageService.getCollections(e)}getCollectionByID(e,t){return this._imageService.getCollectionByID(e,t)}search(e,t){return this._imageService.search(e,t)}}class Pm extends bo{constructor(e,t){super(e,t),this._imageCollectionService=new Cn(this.url,{collectionId:this.options.collectionId,proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getLegend(e,t){return this._imageCollectionService.getLegend(e,t)}getStatistics(e){return this._imageCollectionService.getStatistics(e)}getTileInfo(e){return this._imageCollectionService.getTileInfo(e)}deleteItemByID(e,t){return this._imageCollectionService.deleteItemByID(e,t)}getItemByID(e,t){return this._imageCollectionService.getItemByID(e,t)}}const Im=JSON.parse('[{"name":"黑龙江省","coord":[127.64559817675396,48.48668098449708]},{"name":"内蒙古自治区","coord":[118.34519572208615,45.370218276977525]},{"name":"新疆维吾尔自治区","coord":[87.13479065593184,41.75497055053711]},{"name":"吉林省","coord":[126.12985278813787,43.57983207702637]},{"name":"辽宁省","coord":[124.02494773936439,41.105743408203125]},{"name":"甘肃省","coord":[102.87785725633012,37.69582366943361]},{"name":"河北省","coord":[115.66327227481898,39.33383178710938]},{"name":"北京市","coord":[116.62199343603638,40.25053787231445]},{"name":"山西省","coord":[112.45180235808988,37.666561126708984]},{"name":"天津市","coord":[117.35711842642581,39.406789779663086]},{"name":"陕西省","coord":[109.56294003056632,35.64754199981689]},{"name":"宁夏回族自治区","coord":[105.96110877640074,37.3081169128418]},{"name":"青海省","coord":[96.07301048277901,35.44417190551758]},{"name":"山东省","coord":[118.03833752951093,36.29800605773925]},{"name":"西藏自治区","coord":[87.47361520439412,31.6703872680664]},{"name":"河南省","coord":[113.07832397097275,33.87751102447509]},{"name":"江苏省","coord":[119.93926538201052,32.945452690124505]},{"name":"安徽省","coord":[117.15146765881019,32.024482727050774]},{"name":"四川省","coord":[102.28998890142759,30.182161331176758]},{"name":"湖北省","coord":[112.87798261431585,31.157071113586426]},{"name":"重庆市","coord":[107.870126637831,30.188085556030266]},{"name":"上海市","coord":[121.42561166015514,31.276043891906745]},{"name":"浙江省","coord":[119.75337092707514,29.175934791564945]},{"name":"湖南省","coord":[111.52770282777405,27.38110256195069]},{"name":"江西省","coord":[115.51091280655628,27.283511161804206]},{"name":"云南省","coord":[101.27053825991308,25.19783210754396]},{"name":"贵州省","coord":[106.49672346773299,26.92267990112305]},{"name":"福建省","coord":[117.9976766946587,25.939599990844727]},{"name":"广西壮族自治区","coord":[108.98706831086302,23.891559600830078]},{"name":"台湾省","coord":[120.82468432537434,23.602651596069336]},{"name":"香港特别行政区","coord":[114.21036850371561,22.374858856201172]},{"name":"海南省","coord":[109.62792940960824,19.163116455078125]},{"name":"广东省","coord":[113.32127888266032,22.873867034912106]},{"name":"澳门特别行政区","coord":[113.56819996291901,22.160347992976]}]'),Nm=JSON.parse('[{"name":"克拉玛依市","coord":[85.01486759299489,45.406422237230046]},{"name":"昌吉回族自治州","coord":[88.7154624754753,44.26991024636568]},{"name":"石河子市","coord":[86.0208600035924,44.239045558096805]},{"name":"霍林郭勒市","coord":[114.73479243733115,44.16058374713977]},{"name":"本溪市","coord":[124.64357865201586,41.177197783134275]},{"name":"嘉峪关市","coord":[98.16891560537093,39.76279786284264]},{"name":"莱芜市","coord":[117.65723565456207,36.27916499211527]},{"name":"神农架林区","coord":[110.48296222218153,31.581260143666697]},{"name":"天门市","coord":[113.00615321481195,30.64105781887143]},{"name":"鄂州市","coord":[114.94764081970385,30.325634953844585]},{"name":"潜江市","coord":[112.70703817700621,30.349210666019893]},{"name":"仙桃市","coord":[113.34688900729822,30.315951161935402]},{"name":"萍乡市","coord":[113.88072263074415,27.47193090553213]},{"name":"台湾省","coord":[120.14338943402045,23.596002465926095]},{"name":"东莞市","coord":[113.89443658529342,22.897826158636448]},{"name":"中山市","coord":[113.37118387764659,22.501478858616522]},{"name":"珠海市","coord":[113.21799258934986,22.23782602992192]},{"name":"北海市","coord":[109.18248083043899,21.695773689750148]},{"name":"香港","coord":[114.20689279508653,22.36016760139811]},{"name":"舟山市","coord":[122.22514712841459,30.338633120695956]},{"name":"克孜勒苏柯尔克孜","coord":[74.62910472637343,39.59886016069875]},{"name":"喀什地区","coord":[77.19899922143753,37.85462871211595]},{"name":"阿克苏地区","coord":[81.43930290016381,41.067304799230456]},{"name":"和田地区","coord":[80.69780509160952,36.95287032287055]},{"name":"阿里地区","coord":[82.536487505389,32.69566569631762]},{"name":"日喀则地区","coord":[86.5996831353606,29.54861754814263]},{"name":"那曲地区","coord":[88.32523292667608,33.20600450932715]},{"name":"玉树藏族自治州","coord":[95.2107128446203,33.90320387919257]},{"name":"迪庆藏族自治州","coord":[99.42465312188943,28.052797714348895]},{"name":"怒江傈傈族自治州","coord":[98.85737910439825,26.98345757528851]},{"name":"大理白族自治州","coord":[99.93934374816013,25.684737357453045]},{"name":"德宏傣族景颇族自","coord":[98.13830877778075,24.593421919561205]},{"name":"保山市","coord":[99.19031013453166,24.979380341662]},{"name":"临沧市","coord":[99.62483778975081,24.058807858948214]},{"name":"普洱市","coord":[100.94440267992684,23.44121660743221]},{"name":"西双版纳傣族自治","coord":[100.86105801845994,21.882475641324206]},{"name":"拉萨市","coord":[91.3684790613129,30.14176592960237]},{"name":"山南地区","coord":[92.11665242621062,28.33000201578789]},{"name":"林芝地区","coord":[94.9307847458166,29.125110156601963]},{"name":"昌都地区","coord":[97.33912235873476,30.48520825551814]},{"name":"丽江市","coord":[100.65713436205135,26.96190318191959]},{"name":"攀枝花市","coord":[101.73355913301131,26.714486678752795]},{"name":"凉山彝族自治州","coord":[102.08678551422615,27.683020519860396]},{"name":"楚雄彝族自治州","coord":[101.68264761198458,25.369603845264024]},{"name":"红河哈尼族彝族自","coord":[102.95101719613119,23.624860095239875]},{"name":"文山壮族苗族自治","coord":[104.8708359910614,23.579587266862504]},{"name":"百色市","coord":[106.69546907589859,23.98220841166522]},{"name":"崇左市","coord":[107.3277087317123,22.49769755349952]},{"name":"防城港市","coord":[107.88939931155171,21.94550204069006]},{"name":"南宁市","coord":[108.67078983716917,23.12207641861882]},{"name":"钦州市","coord":[108.8532307305186,22.157690108421384]},{"name":"玉林市","coord":[110.26918466489103,22.391823643610415]},{"name":"湛江市","coord":[109.93033457863683,21.086751055633457]},{"name":"茂名市","coord":[110.80336192333934,22.069184739040775]},{"name":"阳江市","coord":[111.70471342186183,22.108751366417575]},{"name":"江门市","coord":[112.53715618649149,22.297368082806777]},{"name":"广州市","coord":[113.4949302208309,23.28359314707863]},{"name":"清远市","coord":[113.10957368131268,24.334444053233856]},{"name":"肇庆市","coord":[112.11117530204233,23.60241158796112]},{"name":"梧州市","coord":[111.01709510772797,23.518132876753846]},{"name":"贺州市","coord":[111.50423061842756,24.4095096817199]},{"name":"桂林市","coord":[110.44046163393094,25.353966673735407]},{"name":"柳州市","coord":[109.34854449214147,24.972408051485047]},{"name":"河池市","coord":[107.81191841865586,24.649291651298164]},{"name":"黔东南苗族侗族自","coord":[108.39952601614591,26.429286420465576]},{"name":"贵阳市","coord":[106.59784062851153,26.797907456479816]},{"name":"安顺市","coord":[105.76161265300635,25.988644902171018]},{"name":"黔西南布依族苗族","coord":[105.5954078788574,25.404850939549405]},{"name":"曲靖市","coord":[103.9164335632742,25.697243690315265]},{"name":"六盘水市","coord":[104.77723228072432,26.15402255629164]},{"name":"毕节地区","coord":[105.03867422931839,27.077913968069666]},{"name":"昭通市","coord":[104.29730513046874,27.62418247971078]},{"name":"宜宾市","coord":[104.76748901448207,28.553501804266475]},{"name":"乐山市","coord":[103.56027669102787,29.160754519210577]},{"name":"自贡市","coord":[104.63272827056402,29.273152614922402]},{"name":"内江市","coord":[104.82644562304716,29.61272653799929]},{"name":"遵义市","coord":[106.82413636302059,28.191847588570702]},{"name":"达州市","coord":[107.59704170009518,31.32138258839703]},{"name":"遂宁市","coord":[105.48979445433736,30.677687821242678]},{"name":"广安市","coord":[106.56708164098042,30.43500706741521]},{"name":"泸州市","coord":[105.42591761727707,28.50277238478137]},{"name":"资阳市","coord":[104.97995126874034,30.154251886139654]},{"name":"雅安市","coord":[102.69931299964517,29.892630706195035]},{"name":"眉山市","coord":[104.07052881858888,29.894202166560405]},{"name":"甘孜藏族自治州","coord":[100.50721042614238,30.975216556269658]},{"name":"果洛藏族自治州","coord":[99.30775565051923,34.03539865224808]},{"name":"海南藏族自治州","coord":[100.39969108016373,35.90048272566899]},{"name":"黄南藏族自治州","coord":[101.5360706381689,35.10286360841902]},{"name":"赣南藏族自治州","coord":[102.97083885806067,34.326752803339026]},{"name":"陇南市","coord":[105.24780098912132,33.57031117443431]},{"name":"天水市","coord":[105.53503634660417,34.62320421368087]},{"name":"定西市","coord":[104.58787768541339,35.08900966621695]},{"name":"临夏回族自治州","coord":[103.2612870434902,35.591577124455235]},{"name":"西宁市","coord":[101.57680657999033,36.84800271717157]},{"name":"海东地区","coord":[102.30909850729282,36.287400615025646]},{"name":"海北藏族自治州","coord":[100.27122484450717,37.892557516083826]},{"name":"金昌市","coord":[102.02244049169511,38.497330414886164]},{"name":"酒泉市","coord":[95.94486678270127,40.56891536586272]},{"name":"海西蒙古族藏族自","coord":[94.67143298050689,36.022725148503724]},{"name":"巴音郭楞蒙古自治","coord":[88.18116214759745,39.556478810319916]},{"name":"哈密地区","coord":[93.84302392518026,42.95015211178875]},{"name":"叶鲁番地区","coord":[89.82035217277885,42.399368632283505]},{"name":"乌鲁木齐市","coord":[88.00048109561487,43.549986370786]},{"name":"阿勒泰地区","coord":[88.11213933257655,47.05593413019629]},{"name":"博尔塔拉蒙古自治","coord":[82.26402238163408,44.671135542630864]},{"name":"伊犁哈萨克自治州","coord":[82.80778717477179,43.53783381365267]},{"name":"阿拉善盟","coord":[103.29923966842289,40.10955801781495]},{"name":"武威市","coord":[102.73362058791429,37.94211141321436]},{"name":"兰州市","coord":[103.73793563506032,36.27379827886003]},{"name":"中卫市","coord":[105.6943786030716,37.20654236148948]},{"name":"银川市","coord":[106.20022174140034,38.52103167597483]},{"name":"石嘴山市","coord":[106.41544011793628,38.84054137571417]},{"name":"乌海市","coord":[106.8984175998405,39.54616572239788]},{"name":"鄂尔多斯市","coord":[108.43285571424619,39.24036799350715]},{"name":"巴彦淖尔市","coord":[107.45840392808307,41.30159860424196]},{"name":"包头市","coord":[110.46472193224272,41.48017783644221]},{"name":"呼和浩特市","coord":[111.48365173603975,40.498363056149884]},{"name":"乌兰察布市","coord":[112.61568977597707,41.75789561273154]},{"name":"大同市","coord":[113.7107192749083,39.898956799744184]},{"name":"朔州市","coord":[112.65428748167508,39.681772914701924]},{"name":"忻州市","coord":[112.36127575589583,38.88990233614568]},{"name":"榆林市","coord":[109.68473112169593,38.19921027134876]},{"name":"延安市","coord":[109.52425222161318,36.406522726136814]},{"name":"庆阳市","coord":[107.73052193155061,36.183821532624464]},{"name":"固原市","coord":[106.20191575442442,36.11634909496382]},{"name":"白银市","coord":[104.68634478137065,36.51582865625868]},{"name":"宝鸡市","coord":[107.33534779230747,34.3387216485855]},{"name":"汉中市","coord":[107.03534754266246,33.00142998064871]},{"name":"广元市","coord":[105.92928137563939,32.21872447205537]},{"name":"巴中市","coord":[107.03422410306194,31.99874720836291]},{"name":"南充市","coord":[106.32964805032347,31.156657700184095]},{"name":"绵阳市","coord":[104.58949560201106,31.88628780630976]},{"name":"德阳市","coord":[104.41542984932845,31.110558133718676]},{"name":"成都市","coord":[103.8852290010473,30.777258040348634]},{"name":"阿坝藏族羌族自治","coord":[102.26209319552814,32.45725845387284]},{"name":"安康市","coord":[109.14236501848015,32.77467694678074]},{"name":"十堰市","coord":[110.39934083416314,32.376209039347906]},{"name":"襄阳市","coord":[111.97539147094662,31.93399822417465]},{"name":"宜昌市","coord":[111.22204852395754,30.772457669035354]},{"name":"恩施市","coord":[109.42158366502872,30.260366574390105]},{"name":"张家界市","coord":[110.59760006538717,29.330107409240718]},{"name":"吉首市","coord":[109.72176899848378,28.681903937242495]},{"name":"铜仁地区","coord":[108.54247523485463,28.11736237519646]},{"name":"重庆市","coord":[107.86007108564992,30.186253395053196]},{"name":"怀化市","coord":[109.94325166787243,27.43919084801186]},{"name":"益阳市","coord":[112.43060358108062,28.75127294553697]},{"name":"娄底市","coord":[111.41891416951897,27.696312460064604]},{"name":"常德市","coord":[111.72571610131646,29.27189463838195]},{"name":"荆州市","coord":[112.65896596965268,30.05161542755362]},{"name":"荆门市","coord":[112.6586855902184,31.01267124474617]},{"name":"岳阳市","coord":[113.2595036144316,29.106247116930163]},{"name":"长沙市","coord":[113.15415586456598,28.222934680488425]},{"name":"湘潭市","coord":[112.51092596317824,27.69881544105668]},{"name":"株州市","coord":[113.49665538546823,27.03993794610501]},{"name":"衡阳市","coord":[112.48849636578527,26.783613569970782]},{"name":"邵阳市","coord":[110.6723832117475,26.81652287086792]},{"name":"永州市","coord":[111.8565364154186,25.768488267811968]},{"name":"韶关市","coord":[113.53420325850979,24.69848878771937]},{"name":"惠州市","coord":[114.32029589634925,23.25504544231892]},{"name":"佛山市","coord":[112.95925897403649,23.10116677189257]},{"name":"云浮市","coord":[111.78042514904234,22.840400494105687]},{"name":"深圳市","coord":[114.13138648919008,22.649563063468342]},{"name":"汕尾市","coord":[115.57412892884373,23.06989642104901]},{"name":"河源市","coord":[114.89746229844398,23.97971937124767]},{"name":"揭阳市","coord":[116.04290004239446,23.304802704715357]},{"name":"汕头市","coord":[116.7008461897183,23.35898625947344]},{"name":"潮州市","coord":[116.75405548481658,23.854381508863064]},{"name":"梅州市","coord":[116.13719397345734,24.15633544812716]},{"name":"漳州市","coord":[117.38279760543345,24.41111215459575]},{"name":"厦门市","coord":[118.04275971554665,24.675908246507944]},{"name":"龙岩市","coord":[116.69341144552507,25.20284542644492]},{"name":"泉州市","coord":[118.12035864630246,25.22984144365049]},{"name":"莆田市","coord":[118.82439690138142,25.439653480972687]},{"name":"福州市","coord":[119.1608285845262,25.99117532466728]},{"name":"三明市","coord":[117.51188176216434,26.318292906961602]},{"name":"南平市","coord":[118.16153136678187,27.306303151805437]},{"name":"抚州市","coord":[116.3455359885574,27.487043655935366]},{"name":"鹰潭市","coord":[117.01082360702333,28.241253742969946]},{"name":"吉安市","coord":[114.91377151807418,26.957486660664525]},{"name":"赣州市","coord":[115.046455717572,25.81565075681663]},{"name":"郴州市","coord":[113.1544526703492,25.871927095452524]},{"name":"新余市","coord":[114.94161795877827,27.79044654578371]},{"name":"宜春市","coord":[115.04574494880995,28.306428044943356]},{"name":"南昌市","coord":[115.9963824234495,28.664803351584705]},{"name":"九江市","coord":[115.53225905704193,29.362905920276297]},{"name":"上饶市","coord":[117.8595355766598,28.765755150094634]},{"name":"景德镇市","coord":[117.25387030721845,29.33426823662448]},{"name":"黄山市","coord":[117.85476357809696,29.969632034273722]},{"name":"池州市","coord":[117.34517113140791,30.208089337922335]},{"name":"铜陵市","coord":[117.93160431300694,30.926442655001676]},{"name":"安庆市","coord":[116.54307680610799,30.524265461641296]},{"name":"黄石市","coord":[115.02354597728443,29.924060229331015]},{"name":"咸宁市","coord":[114.26967602231792,29.652174021136048]},{"name":"黄冈市","coord":[115.2859016705373,30.65856897065683]},{"name":"武汉市","coord":[114.34552076948799,30.68836237966767]},{"name":"随州市","coord":[113.3850627838818,31.87891659924412]},{"name":"信阳市","coord":[114.81374730587638,32.0309685135914]},{"name":"驻马店市","coord":[114.07756451509235,32.896720987266114]},{"name":"商洛市","coord":[109.82044421310393,33.77403373563189]},{"name":"西安市","coord":[109.11839808451401,34.225257215515896]},{"name":"渭南市","coord":[109.75732444226935,35.025913644359306]},{"name":"铜川市","coord":[108.98695328111377,35.19235092947735]},{"name":"咸阳市","coord":[108.36398776446165,34.84311348287181]},{"name":"三门峡市","coord":[110.80049688104964,34.31818709571671]},{"name":"运城市","coord":[111.1736679525165,35.19010372283576]},{"name":"洛阳市","coord":[111.87577573098216,34.33379926109848]},{"name":"平顶山市","coord":[112.80931281928427,33.759895800153096]},{"name":"漯河市","coord":[113.83505724178012,33.70034266174508]},{"name":"许昌市","coord":[113.78762484088509,34.051835688452435]},{"name":"郑州市","coord":[113.49619951867594,34.61181797865449]},{"name":"焦作市","coord":[113.13404280173008,35.134167097471625]},{"name":"晋城市","coord":[112.7495732073233,35.63186423091449]},{"name":"长治市","coord":[112.85900842873183,36.45872910742828]},{"name":"临汾市","coord":[111.49379787924448,36.22810800777857]},{"name":"太原市","coord":[112.15628804033796,37.91704444063036]},{"name":"吕梁市","coord":[111.31901105774872,37.712740463356496]},{"name":"晋中市","coord":[113.08199599739676,37.36532613794343]},{"name":"邯郸市","coord":[114.41824047234618,36.530119932543315]},{"name":"安阳市","coord":[113.88883283163116,35.7797611183252]},{"name":"鹤壁市","coord":[114.3654094911545,35.75770487428472]},{"name":"新乡市","coord":[113.9184107718167,35.348471214026716]},{"name":"开封市","coord":[114.52801677500626,34.61371216679872]},{"name":"周口市","coord":[114.88509782391864,33.69999759722657]},{"name":"阜阳市","coord":[115.44595951398213,32.98060371610532]},{"name":"淮南市","coord":[116.68941991880993,32.79972275772595]},{"name":"蚌埠市","coord":[117.38594715783302,33.106729536033896]},{"name":"淮北市","coord":[116.69651711889378,33.69527529383458]},{"name":"宿州市","coord":[117.30175405886838,33.943330421260015]},{"name":"亳州市","coord":[116.12410804185097,33.46769392946132]},{"name":"商丘市","coord":[115.59575176872548,34.28339840831147]},{"name":"菏泽市","coord":[115.53631974831816,35.197319393220624]},{"name":"濮阳市","coord":[115.3070485514902,35.775883510964334]},{"name":"聊城市","coord":[115.8870069012884,36.40529594548765]},{"name":"邢台市","coord":[114.74259008644859,37.251396750084155]},{"name":"石家庄市","coord":[114.56923838363613,38.13141710980106]},{"name":"阳泉市","coord":[113.39216149668508,38.09075470547468]},{"name":"保定市","coord":[115.261524468934,39.09118520781398]},{"name":"衡水市","coord":[115.8182936677897,37.715661598187154]},{"name":"德州市","coord":[116.4582273790399,37.19372347888644]},{"name":"沧州市","coord":[116.76192710911863,38.20240042039232]},{"name":"廊坊市","coord":[116.50410772133856,39.27896741763884]},{"name":"天津市","coord":[117.31988934444873,39.37154482470619]},{"name":"北京市","coord":[116.59734730757869,40.237112944270976]},{"name":"张家口市","coord":[115.1823606483226,40.83732566607167]},{"name":"唐山市","coord":[117.8693184261954,39.71862889477249]},{"name":"秦皇岛市","coord":[119.30467355367742,39.990574652162564]},{"name":"承德市","coord":[117.16275671911026,41.36623845548547]},{"name":"葫芦岛市","coord":[119.9342336210531,40.5628822626519]},{"name":"朝阳市","coord":[120.11853493535794,41.471852354885755]},{"name":"赤峰市","coord":[118.50943546234379,43.25452976059767]},{"name":"锦州市","coord":[121.5167549323861,41.45933087433065]},{"name":"营口市","coord":[122.58571915054674,40.42093503997384]},{"name":"丹东市","coord":[124.33549382902183,40.46369290272115]},{"name":"辽阳市","coord":[123.34064798039414,41.152331397771356]},{"name":"盘锦市","coord":[122.06718005354679,41.05573599862555]},{"name":"阜新市","coord":[121.93889757908204,42.27641773244204]},{"name":"鞍山市","coord":[122.78904432242356,40.77781183142038]},{"name":"沈阳市","coord":[122.99508899709724,42.1162195010079]},{"name":"铁岭市","coord":[124.23100515588399,42.72666083611828]},{"name":"扶顺市","coord":[124.46027188217573,41.82955407638859]},{"name":"通辽市","coord":[122.0729370657937,43.90889130864869]},{"name":"兴安盟","coord":[120.79456431092532,45.92003249442161]},{"name":"白城市","coord":[123.10619907715235,45.25475749267784]},{"name":"齐齐哈尔市","coord":[124.5462214659102,47.55395009317394]},{"name":"大兴安岭地区","coord":[124.50992855161529,52.18438447846694]},{"name":"黑河市","coord":[127.14721400335922,49.25080134026901]},{"name":"大庆市","coord":[124.40329830095243,46.401048760966745]},{"name":"绥化市","coord":[126.5214484055605,46.76992452194825]},{"name":"松原市","coord":[124.21244334807682,44.75779381338502]},{"name":"四平市","coord":[124.27839350328821,43.52139065090318]},{"name":"通化市","coord":[125.67392830706305,41.91771808663852]},{"name":"辽源市","coord":[125.33529527643432,42.758340204944986]},{"name":"吉林市","coord":[126.83350281902375,43.60730120049175]},{"name":"长春市","coord":[125.53597875970374,44.24624314701737]},{"name":"白山市","coord":[127.16780160322108,42.093893880305075]},{"name":"哈尔滨市","coord":[127.39125008786029,45.36200668820575]},{"name":"鹤岗市","coord":[130.4703811258197,47.66520688940109]},{"name":"伊春市","coord":[128.91240831703635,47.93833794565277]},{"name":"七台河市","coord":[131.2677920224311,45.945099776108584]},{"name":"鸡西市","coord":[132.38059153660274,45.722934218318535]},{"name":"双鸭山市","coord":[132.3184817002743,46.65813679030265]},{"name":"佳木斯市","coord":[132.26174446608726,47.17569713691394]},{"name":"呼伦贝尔市","coord":[122.3210739998419,50.18176996070858]},{"name":"孝感市","coord":[113.83749892135485,31.11757234692128]},{"name":"贵港市","coord":[110.07354588052804,23.380735604767374]},{"name":"黔南布依族苗族自","coord":[107.30931767543106,26.2976919432269]},{"name":"宁德市","coord":[119.52482556634342,27.013151692716413]},{"name":"温州市","coord":[120.30037042732202,27.8699145504001]},{"name":"台州市","coord":[120.88886782713843,28.670799172772313]},{"name":"丽水市","coord":[119.56796851966463,28.170268394477755]},{"name":"衢州市","coord":[118.79479802644406,28.865874397158763]},{"name":"金华市","coord":[119.99381920686633,29.093455548185744]},{"name":"绍兴市","coord":[120.46546691682343,29.69382513836818]},{"name":"宁波市","coord":[121.42142987830871,29.70001162878972]},{"name":"杭州市","coord":[119.4405685790891,29.87218307296989]},{"name":"宣城市","coord":[118.68748382914703,30.628143499626418]},{"name":"湖州市","coord":[119.98261306633574,30.7945175862809]},{"name":"嘉兴市","coord":[120.83889215988998,30.67538495499343]},{"name":"上海市","coord":[121.37534147322967,31.25628247908459]},{"name":"苏州市","coord":[120.6906182622391,31.381280695137775]},{"name":"无锡市","coord":[120.32182300914366,31.54113306724517]},{"name":"常州市","coord":[119.61953292830165,31.611878565375576]},{"name":"南京市","coord":[118.71890548838064,31.910863187910323]},{"name":"镇江市","coord":[119.42349332902813,31.97942313430778]},{"name":"合肥市","coord":[117.30651975617157,31.79407863049138]},{"name":"六安市","coord":[116.24668220575353,31.820846193819513]},{"name":"滁州市","coord":[117.88422385307969,32.51792621904418]},{"name":"泰州市","coord":[120.03124303305091,32.56503102346783]},{"name":"南通市","coord":[120.85599446760912,32.18496706099728]},{"name":"盐城市","coord":[120.01812490612667,33.54219948734023]},{"name":"淮安市","coord":[119.0749424205415,33.39203631772854]},{"name":"宿迁市","coord":[118.45404943216346,33.666258719120265]},{"name":"徐州市","coord":[117.77482249295966,34.30847766157078]},{"name":"济宁市","coord":[116.74147276546373,35.27488504351119]},{"name":"枣庄市","coord":[117.43359942491492,34.884162021736]},{"name":"连云港市","coord":[119.01553213785074,34.54316517587849]},{"name":"临沂市","coord":[118.31478835349617,35.28173079028279]},{"name":"日照市","coord":[119.14265350444272,35.54479073199592]},{"name":"青岛市","coord":[120.27779044405756,36.3464117375903]},{"name":"威海市","coord":[122.12963327195605,37.13879077904251]},{"name":"烟台市","coord":[120.7689567423966,37.19772002195597]},{"name":"潍坊市","coord":[119.02178548592039,36.49292234053931]},{"name":"淄博市","coord":[117.92936024367185,36.60871347163638]},{"name":"泰安市","coord":[116.93810893944303,36.0423330118612]},{"name":"济南市","coord":[117.34560282551296,36.769574973846304]},{"name":"东营市","coord":[118.4915054457184,37.52194690335787]},{"name":"滨州市","coord":[117.67610299757533,37.4439597758601]},{"name":"昆明市","coord":[102.93100245594789,25.481300763922075]},{"name":"玉溪市","coord":[102.23080854291823,24.156168324611663]},{"name":"塔城地区","coord":[83.60908162840168,45.3721852373893]},{"name":"张掖市","coord":[100.47710030600572,38.704239320458385]},{"name":"南阳市","coord":[112.1400670951149,33.03033276715801]},{"name":"扬州市","coord":[119.48949608990988,32.80956776339646]},{"name":"延边朝鲜族自治州","coord":[129.3577692895626,43.24968794080283]},{"name":"牡丹江市","coord":[129.87240796405672,44.7073040108322]},{"name":"澳门","coord":[113.56289691515346,22.14602596262204]},{"name":"吴忠市","coord":[106.76894508116403,37.72566765880316]},{"name":"来宾市","coord":[109.25592217010114,23.86346274681084]},{"name":"平凉市","coord":[107.0708132782897,35.30329631658711]},{"name":"马鞍山市","coord":[118.27245878467022,31.657727937739004]},{"name":"芜湖市","coord":[118.32992684415504,31.081688223101658]},{"name":"澄迈县","coord":[110.04198076060266,19.694955078668105]},{"name":"保亭黎族苗族自治","coord":[109.6055304964257,18.6101488675304]},{"name":"乐东黎族自治县","coord":[109.04051999525574,18.643137437909203]},{"name":"儋州市","coord":[109.3431358337404,19.550974957403195]},{"name":"定安县","coord":[110.38744429685676,19.47557074114284]},{"name":"屯昌县","coord":[110.00574767630334,19.367175093044388]},{"name":"白沙黎族自治县","coord":[109.36860737761768,19.214416393082217]},{"name":"琼中黎族苗族自治","coord":[109.86691465937548,19.073671135862682]},{"name":"东方市","coord":[108.86903802405428,19.017352815445214]},{"name":"昌江黎族自治县","coord":[108.9686431884767,19.182594167127824]},{"name":"海口市","coord":[110.420654296875,19.806565564640795]},{"name":"济源市","coord":[112.38051465474433,35.07958362422394]},{"name":"五指山市","coord":[109.53595187364496,18.832908264613966]},{"name":"大连市","coord":[121.96662235866603,39.444150542439914]},{"name":"文昌市三沙市","coord":[110.81828537536748,19.756501444162936]},{"name":"三亚市","coord":[109.38424600793707,18.39186315877128]},{"name":"万宁市","coord":[110.28485046979574,18.860240588635115]},{"name":"陵水黎族自治县","coord":[109.95577603229562,18.594712684620465]},{"name":"临高县","coord":[109.71915395436967,19.79420403032508]},{"name":"琼海市","coord":[110.41650700703043,19.22315873149372]}]'),Lm=JSON.parse('[{"id":"SalesJan2009","fileName":"SalesJan2009","xField":"Longitude","yField":"Latitude","type":"POINT"},{"id":"Sacramentorealestatetransactions","fileName":"Ealestate transactions","xField":"longitude","yField":"latitude","type":"POINT"},{"id":"BeijingResidentialDistrict","fileName":"北京市住宅小区","xField":"SmX","yField":"SmY","type":"POINT"},{"id":"GlobalRecordOfOver7Earthquakes","fileName":"全球历史7级以上地震记录","xField":"经度","yField":"纬度","type":"POINT"},{"id":"ChinaRecordOfOver6Earthquakes","fileName":"中国历史6级以上地震记录","xField":"经度","yField":"纬度","type":"POINT"},{"id":"ChinaMeteorologicalObservationStation","fileName":"中国气象观测站","xField":"经度","yField":"纬度","type":"POINT"},{"id":"BeijingSubwayLine","fileName":"北京市地铁交通线路","type":"LINE"},{"id":"ChinaEarthquakeIntensityZone","fileName":"中国地震烈度区划面","type":"POLYGON"}]'),km=ol.View;var Fm=r.n(km);const Rm=ol.interaction.MouseWheelZoom;var Dm=r.n(Rm);const Gm=ol.proj.proj4,jm=ol.proj.Units;var Bm=r.n(jm);const Um=ol.layer,Vm=ol.format.WMTSCapabilities;var Jm=r.n(Vm);const zm=ol.format.WMSCapabilities;var qm=r.n(zm);const Hm=ol.geom,Wm=ol.source.TileWMS;var Ym=r.n(Wm);const Xm=ol.render.Feature;var Qm=r.n(Xm);const Zm=ol.Collection;var Km=r.n(Zm),$m=r(478),eg=r.n($m);window.proj4=wd,window.Proj4js=wd;const tg=new(Dl()),rg=1e3,ig={DEGREES:2*Math.PI*6370997/360,DEGREE:2*Math.PI*6370997/360,FEET:.3048,METERS:1,METER:1,M:1,USFEET:1200/3937},sg={default:96,iServerWMTS:90.7142857142857};class ng extends(vo()){constructor(e,t){super(),$o.isObject(e)?(t=e,this.mapId=t.id):this.mapId=e,t=t||{},this.server=t.server,this.successCallback=t.successCallback,this.errorCallback=t.errorCallback,this.credentialKey=t.credentialKey,this.credentialValue=t.credentialValue,this.withCredentials=t.withCredentials||!1,this.target=t.target||"map",this.excludePortalProxyUrl=t.excludePortalProxyUrl||!1,this.serviceProxy=t.serviceProxy||null,this.tiandituKey=t.tiandituKey,this.googleMapsAPIKey=t.googleMapsAPIKey||"",this.proxy=t.proxy,this.layerAdded=0,this.layers=[],this.events=new Se(this,null,["updateDataflowFeature"],!0),this.webMap=t.webMap,this.tileFormat=t.tileFormat&&t.tileFormat.toLowerCase(),this.restDataSingleRequestCount=t.restDataSingleRequestCount||1e3,this.createMap(t.mapSetting),this.webMap?$o.isString(this.webMap)?this.createWebmap(this.webMap):this.getMapInfoSuccess(t.webMap):this.createWebmap()}_removeBaseLayer(){const e=this.map,{layer:t,labelLayer:r}=this.baseLayer;r&&e.removeLayer(r),t&&e.removeLayer(t),this.baseLayer=null}_removeLayers(){const e=this.map;this.layers.forEach(({layerType:t,layer:r,labelLayer:i,pathLayer:s,dataflowService:n})=>{r&&("MIGRATION"!==t?("DATAFLOW_POINT_TRACK"!==t&&"DATAFLOW_HEAT"!==t||(s&&e.removeLayer(s),n&&n.unSubscribe()),i&&e.removeLayer(i),e.removeLayer(r)):r.remove())}),this.layers=[]}_clear(){this.scales=[],this.resolutionArray=[],this.resolutions={},this.layerAdded=0,this._removeBaseLayer(),this._removeLayers()}refresh(){this._clear(),this.createWebmap()}createMap(e){let t,r,i;e&&(i=e.interactions,t=e.overlays,r=e.controls),this.map=new(wl())({interactions:i,overlays:t,controls:r,target:this.target}),e&&this.registerMapEvent({mapClickCallback:e.mapClickCallback})}registerMapEvent(e){this.map.on("click",function(t){e.mapClickCallback&&e.mapClickCallback(t)})}createWebmap(e){let t;if(e)t=e;else{let e=this.server.split("");"/"!==e[e.length-1]&&(this.server+="/"),t=this.server+"web/maps/"+this.mapId+"/map";let r="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.server.indexOf(r)>-1){let e=this.server.split(r);e.length>1&&(t=e[0]+r+this.server+"web/maps/"+this.mapId+"/map.json")}}this.getMapInfo(t)}getMapInfo(e){let t=this,r=e;-1===e.indexOf(".json")&&(r=e=this.handleJSONSuffix(e)),Ue.get(t.getRequestUrl(r),null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){t.getMapInfoSuccess(e)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)})}async getMapInfoSuccess(e){let t=this;if(!1===e.succeed)return void(t.errorCallback&&t.errorCallback(e.error,"getMapFaild",t.map));let r=await t.handleCRS(e.projection,e.baseLayer.url);if(t.mapParams={title:e.title,description:e.description},"BrowseMap"===r.action)t.createSpecLayer(e);else{if("OpenMap"!==r.action)return void(t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${e.projection}`},"getMapFaild",t.map));t.baseProjection=r.newCrs||e.projection,t.webMapVersion=e.version,t.baseLayer=e.baseLayer,t.isHaveGraticule=e.grid&&e.grid.graticule,e.baseLayer&&"MAPBOXSTYLE"===e.baseLayer.layerType?t.addMVTMapLayer(e,e.baseLayer,0).then(async()=>{t.createView(e),e.layers&&0!==e.layers.length?await t.addLayers(e):t.sendMapToUser(0),t.addGraticule(e)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)}):(await t.addBaseMap(e),e.layers&&0!==e.layers.length?await t.addLayers(e):t.sendMapToUser(0),t.addGraticule(e))}}async handleCRS(e,t){let r=this,i={},s=e,n="OpenMap";return this.isCustomProjection(e)?await Ue.get(r.getRequestUrl(`${t}/prjCoordSys.wkt`),null,{withCredentials:r.withCredentials,withoutFormatSuffix:!0}).then(function(e){return e.text()}).then(async function(t){if(-1!==t.indexOf("<!doctype html>"))throw"ERROR";r.addProjctionFromWKT(t,e),i={action:n,newCrs:s}}).catch(function(){i={action:n="BrowseMap",newCrs:s}}):(0===e.indexOf("EPSG")&&e.split(":")[1]<=0?n="BrowseMap":"EPSG:910111"===e||"EPSG:910112"===e?s="EPSG:3857":"EPSG:910101"===e||"EPSG:910102"===e?s="EPSG:4326":0!==e.indexOf("EPSG")&&(r.addProjctionFromWKT(s),s=r.getEpsgInfoFromWKT(e)),i={action:n,newCrs:s}),i}getScales(e){let t,r,i=[],s={},n=[],a=e.coordUnit||Mo.get(e.projection).getUnits();if(a||(a="EPSG:3857"==this.baseProjection?"m":"degree"),e.visibleScales&&e.visibleScales.length>0)e.visibleScales.forEach(e=>{let r=1/e;t=this.getResFromScale(r,a),e=`1:${r}`,s[this.formatScale(e)]=t,n.push(t),i.push(e)},this);else if("WMTS"===e.layerType)e.scales.forEach(e=>{t=this.getResFromScale(e,a,90.7),e=`1:${e}`,s[this.formatScale(e)]=t,n.push(t),i.push(e)},this);else{let{minZoom:o=0,maxZoom:l=22}=e,h=this.map.getView();for(let e=o;e<=l;e++)if(t=h.getResolutionForZoom(e),r=this.getScaleFromRes(t,a),-1===i.indexOf(r)){i.push(r);let e=r.replace(/,/g,"");s[e]=t,n.push(t)}}this.scales=i,this.resolutions=s,this.resolutionArray=n}getResFromScale(e,t="DEGREE",r=96){return.0254*e/r/ig[t.toUpperCase()]}getScaleFromRes(e,t="DEGREE",r=96){let i;return"1:"+(i=e*r*ig[t.toUpperCase()]/.0254)}formatScale(e){return e.replace(/,/g,"")}createSpecLayer(e){let t=this,r=e.baseLayer,i=r.url,s=r.layerType,n=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],a=new Mo.Projection({extent:n,units:"m",code:"EPSG:0"});Mo.addProjection(a);let o={center:e.center,level:0};t.baseProjection=a;let l={center:o.center?[o.center.x,o.center.y]:[0,0],zoom:0,projection:a};["4","5"].indexOf($o.getOlVersion())<0&&(l.multiWorld=!0);let h,u=new(Fm())(l);t.map.setView(u),t.mapParams&&(t.mapParams.extent=n,t.mapParams.projection=e.projection),i&&i.indexOf("?token=")>-1&&(t.credentialKey="token",t.credentialValue=e.baseLayer.credential=i.split("?token=")[1],i=i.split("?token=")[0]),"TILE"===s?(i=this.handleJSONSuffix(i),Ue.get(t.getRequestUrl(i),null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){r.originResult=e;let s="IPORTAL",n=r.credential,a="Token",o=r.url;(r.url.indexOf("www.supermapol.com")>-1||r.url.indexOf("itest.supermapol.com")>-1)&&(a="Key",o=[o],s="ONLINE"),n&&Ve[`register${a}`](o,n);let l={serverType:s,url:i,tileGrid:Ql.optionsFromMapJSON(i,e).tileGrid};!i||te.isInTheSameDomain(i)||this.isIportalProxyServiceUrl(i)||(l.tileProxy=t.server+"apps/viewer/getUrlResource.png?url="),h=new Ql(l),t.addSpecToMap(h)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)})):"WMS"===s?(h=t.createWMSSource(r),t.addSpecToMap(h)):"WMTS"===s?Ue.get(t.getRequestUrl(i,!0),null,{withCredentials:this.withCredentials}).then(function(e){return e.text()}).then(function(i){r.extent=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],r.scales=t.getWMTSScales(r.tileMatrixSet,i),r.dpi=sg.iServerWMTS,h=t.createWMTSSource(r),t.addSpecToMap(h)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)}):t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${s}`},"getMapFaild",t.map),u&&u.fit(n)}addSpecToMap(e){let t=new Um.Tile({source:e,zIndex:0});this.map.addLayer(t),this.sendMapToUser(0)}getWMTSScales(e,t){let r=(new(Jm())).read(t).Contents.TileMatrixSet,i=[];for(let t=0;t<r.length;t++)if(r[t].Identifier===e){for(let e=0;e<r[t].TileMatrix.length;e++)i.push(r[t].TileMatrix[e].ScaleDenominator);break}return i}async addBaseMap(e){let{baseLayer:t}=e,r=t.layerType;"TILE"!==r&&"WMS"!==r&&"WMTS"!==r?this.getInternetMapInfo(t):"WMTS"===r?await this.getWmtsInfo(t):"TILE"===r?await this.getTileInfo(t):"WMS"===r&&await this.getWmsInfo(t),t.projection=e.projection,t.extent||(t.extent=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y]),this.createView(e);let i=this.createBaseLayer(t,0,null,null,!0);if(i.setProperties({layerType:r}),this.map.addLayer(i),this.mapParams&&(this.mapParams.extent=t.extent,this.mapParams.projection=e.projection),t.labelLayerVisible){let r=new Um.Tile({source:this.createTiandituSource(t.layerType,e.projection,!0),zIndex:t.zIndex||1,visible:t.visible});this.map.addLayer(r),t.labelLayer=r}this.limitScale(e,t)}validScale(e){if(!e)return!1;const t=e.split(":")[1];if(!t)return!1;const r=1/+t;return!(r===1/0||r>=1)}limitScale(e,t){if(this.validScale(e.minScale)&&this.validScale(e.maxScale)){let r,i,s;if("WMTS"===t.layerType)r=t.scales,i=+e.minScale.split(":")[1],s=+e.maxScale.split(":")[1];else{const n=this.scales.map(e=>1/e.split(":")[1]);r=Array.isArray(t.visibleScales)&&t.visibleScales.length&&t.visibleScales?t.visibleScales:n,i=1/+e.minScale.split(":")[1],s=1/+e.maxScale.split(":")[1]}const n=this.findNearest(r,i),a=this.findNearest(r,s);let o=r.indexOf(n),l=r.indexOf(a);o>l&&([o,l]=[l,o]),0===o&&l===r.length-1||(this.map.setView(new(Fm())(Object.assign({},this.map.getView().options_,{maxResolution:void 0,minResolution:void 0,minZoom:o,maxZoom:l,constrainResolution:!1}))),this.map.addInteraction(new(Dm())({constrainResolution:!0})))}}parseNumber(e){return Number(e.split(":")[1])}findNearest(e,t){let r=0,i=t;for(let t=1,s=e.length;t<s;t++)Math.abs(e[t]-i)<Math.abs(e[r]-i)&&(r=t);return e[r]}addMVTMapLayer(e,t,r){return t.zIndex=r,this.getMapboxStyleLayerInfo(e,t).then(e=>this.createMVTLayer(e).then(e=>{let r=$o.newGuid(8);t.name&&e.setProperties({name:t.name,layerID:r,layerType:"VECTOR_TILE"}),t.visibleScale&&this.setVisibleScales(e,t.visibleScale),t.layer=e,t.layerID=r,this.map.addLayer(e)})).catch(function(e){throw e})}createView(e){let t,r=e.center,i=void 0!==e.level?e.level:1,s=e.maxZoom||22,n=this.baseProjection,a=[];for(let e in r)a.push(r[e]);0===a.length&&(a=[0,0]),this.baseLayerExtent=t=e.baseLayer&&e.baseLayer.extent,this.mapParams&&(this.mapParams.extent=t,this.mapParams.projection=n),!(0,Gl.containsCoordinate)(t,a)&&(a=(0,Gl.getCenter)(t));let o,l=e.baseLayer;if(l.visibleScales&&l.visibleScales.length>0||l.scales&&l.scales.length>0)this.getScales(l);else if(e.baseLayer&&t&&4===t.length){let e=(t[2]-t[0])/512,r=(t[3]-t[1])/512;o=Math.max(e,r)}this.map.setView(new(Fm())({zoom:i,center:a,projection:n,maxZoom:s,maxResolution:o}));let h={};if(l.scales&&l.scales.length>0&&"WMTS"===l.layerType||this.resolutionArray&&this.resolutionArray.length>0?h={zoom:i,center:a,projection:n,resolutions:this.resolutionArray,maxZoom:s}:"WMTS"===l.layerType?(h={zoom:i,center:a,projection:n,maxZoom:s},this.getScales(l)):(h={zoom:i,center:a,projection:n,maxResolution:o,maxZoom:s},this.getScales(l)),["4","5"].indexOf($o.getOlVersion())<0&&(h.multiWorld=!0,h.showFullExtent=!0,h.enableRotation=!1,h.constrainResolution=!0),this.map.setView(new(Fm())(h)),e.visibleExtent){const t=this.map.getView(),r=t.getResolutionForExtent(e.visibleExtent,this.map.getSize());t.setResolution(r),t.setCenter((0,Gl.getCenter)(e.visibleExtent))}}createBaseLayer(e,t,r,i,s){let n,a=this;i&&(a=i);let o=e.layerType;switch((o.indexOf("TIANDITU_VEC")>-1||o.indexOf("TIANDITU_IMG")>-1||o.indexOf("TIANDITU_TER")>-1)&&(o=o.substr(0,12)),o){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":n=this.createTiandituSource(o,e.projection);break;case"BAIDU":n=this.createBaiduSource();break;case"BING":n=this.createBingSource(e,e.projection);break;case"WMS":n=this.createWMSSource(e);break;case"WMTS":n=a.createWMTSSource(e);break;case"TILE":case"SUPERMAP_REST":n=a.createDynamicTiledSource(e,s);break;case"CLOUD":case"CLOUD_BLACK":case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":n=this.createXYZSource(e)}var l=new Um.Tile({source:n,zIndex:e.zIndex||1,visible:e.visible}),h=$o.newGuid(8);e.name&&l.setProperties({name:e.name,layerID:h}),void 0!==e.visible&&null!==e.visible||(e.visible=!0),l.setVisible(e.visible),e.opacity&&l.setOpacity(e.opacity),t&&l.setZIndex(t),e.layer=l,e.layerID=h;let u,c,{visibleScale:d,autoUpdateTime:p}=e;return d&&(c=this.resolutions[d.minScale],u=this.resolutions[d.maxScale],c>1?l.setMaxResolution(Math.ceil(c)):l.setMaxResolution(1.1*c),l.setMinResolution(u)),p&&!e.autoUpdateInterval&&(e.autoUpdateInterval=setInterval(()=>{a.updateTileToMap(e,t)},p)),r&&(l.setZIndex(0),a.map.addLayer(l)),l}updateTileToMap(e,t){this.map.removeLayer(e.layer),this.map.addLayer(this.createBaseLayer(e,t))}getInternetMapInfo(e){const t=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892],r=[-180,-90,180,90],i=[-20037508.34,-20037508.34,20037508.34,20037508.34],s=[12555667.53929,1281852.98656,17525908.86651,7484870.70596],n=[-19741117.14519,-10003921.36848,19981677.71404,19660983.56089];switch(e.units="m",e.layerType){case"BAIDU":e.iServerUrl="https://map.baidu.com/",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=t;break;case"CLOUD":e.url="http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"CLOUD_BLACK":e.url="http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"tencent":e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"TIANDITU_VEC_3857":case"TIANDITU_IMG_3857":case"TIANDITU_TER_3857":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:3857",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=t,"TIANDITU_TER_3857"===e.layerType&&(e.maxZoom=14);break;case"TIANDITU_VEC_4326":case"TIANDITU_IMG_4326":case"TIANDITU_TER_4326":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:4326",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=r,"TIANDITU_TER_4326"===e.layerType&&(e.maxZoom=14);break;case"OSM":e.url="http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=i,e.iserverUrl="https://www.openstreetmap.org";break;case"GOOGLE":e.url=`https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s${this.getLang()}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key=${this.googleMapsAPIKey}`,e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=22,e.level=1,e.extent=i,e.iserverUrl="https://www.google.cn/maps";break;case"JAPAN_STD":e.url="https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=0,e.extent=i;break;case"JAPAN_PALE":e.url="https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=19,e.level=2,e.extent=i;break;case"JAPAN_RELIEF":e.url="https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=5,e.maxZoom=14,e.level=5,e.extent=s;break;case"JAPAN_ORT":e.url="https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=12,e.level=2,e.extent=n}}createDynamicTiledSource(e,t){let r="IPORTAL",i=e.credential?e.credential.token:void 0,s="Token",n=e.url;(e.url.indexOf("www.supermapol.com")>-1||e.url.indexOf("itest.supermapol.com")>-1)&&(s="Key",n=[n],r="ONLINE"),i&&Ve[`register${s}`](n,i);let a={transparent:!0,url:e.url,wrapX:!1,serverType:r,format:e.format};if(t||this.isCustomProjection(this.baseProjection)||(a.prjCoordSys={epsgCode:this.baseProjection.split(":")[1]}),e.visibleScales&&e.visibleScales.length>0){let t=[];for(let r in e.visibleScales){let i=$o.scaleToResolution(e.visibleScales[r],sg.default,e.coordUnit);t.push(i)}e.visibleResolutions=t;let r=new(Pl())({extent:e.extent,resolutions:t});a.tileGrid=r}else{a.extent=this.baseLayerExtent;let t=new(Pl())({extent:e.extent,resolutions:this.getResolutionsFromBounds(e.extent)});a.tileGrid=t}!e.url||te.isInTheSameDomain(e.url)||this.isIportalProxyServiceUrl(e.url)||"webp"===e.format||(a.tileProxy=this.server+"apps/viewer/getUrlResource.png?url=");let o=new Ql(a);return Ve[`register${s}`](e.url),o}getResolutionsFromBounds(e){let t=[],r=Math.abs(e[0]-e[2])/512;for(let e=0;e<22;e++)0!==e?(r/=2,t[e]=r):t[e]=r;return t}createTiandituSource(e,t,r){let i={layerType:e.split("_")[1].toLowerCase(),isLabel:r||!1,projection:t,url:`https://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?tk=${this.tiandituKey}`};return new Wl(i)}createBaiduSource(){return new Il}createBingSource(e,t){return new(Ul())({wrapX:!1,projection:t,crossOrigin:"anonymous",tileUrlFunction:function(e){let[t,r,i]=[...e];i=i>0?i-1:-i-1;let s="";for(let e=t;e>0;e--){let t=0,n=1<<e-1;0!=(r&n)&&t++,0!=(i&n)&&(t+=2),s+=t.toString()}return"https://dynamic.t0.tiles.ditu.live.com/comp/ch/{quadKey}?it=G,TW,L,LA&mkt=zh-cn&og=109&cstl=w4c&ur=CN&n=z".replace("{quadKey}",s)}})}createXYZSource(e){return new(Ul())({url:e.url,wrapX:!1,crossOrigin:"anonymous"})}createWMSSource(e){return new(Ym())({url:e.url,wrapX:!1,params:{LAYERS:e.layers?e.layers[0]:"0",FORMAT:"image/png",VERSION:e.version||"1.3.0"},projection:e.projection||this.baseProjection,tileLoadFunction:function(e,t){e.getImage().src=t}})}async getTileLayerExtent(e,t,r){let i=this,s=await i.getTileLayerExtentInfo(e);if(!1===s.succeed)if(400===s.error.code){let s=await i.getTileLayerExtentInfo(e,!1);!1===s.succeed?r():(Object.assign(e,s),t(e))}else r();else Object.assign(e,s),t(e)}getTileLayerExtentInfo(e,t=!0){let r,i=this,s=e.url.trim(),n=e.credential,a={withCredentials:this.withCredentials,withoutFormatSuffix:!0};if(t){let e={epsgCode:i.baseProjection.split(":")[1]};i.isCustomProjection(i.baseProjection)||(s+=".json?prjCoordSys="+encodeURI(JSON.stringify(e)))}return n&&(s=`${s}&token=${encodeURI(n.token)}`,r=n.token),s=this.handleJSONSuffix(s),Ue.get(i.getRequestUrl(s),null,a).then(function(e){return e.json()}).then(async t=>{if(!1===t.succeed)return t;let s="png";if("webp"===i.tileFormat){s=await i.isSupportWebp(e.url,r)?"webp":"png"}return{units:t.coordUnit&&t.coordUnit.toLowerCase(),coordUnit:t.coordUnit,visibleScales:t.visibleScales,extent:[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],projection:`EPSG:${t.prjCoordSys.epsgCode}`,format:s}}).catch(e=>({succeed:!1,error:e}))}getTileInfo(e,t,r){let i=this,s={withCredentials:this.withCredentials,withoutFormatSuffix:!0};e.url.indexOf("?token=")>-1&&(i.credentialKey="token",i.credentialValue=e.credential=e.url.split("?token=")[1],e.url=e.url.split("?token=")[0]);let n=this.handleJSONSuffix(e.url);return Ue.get(i.getRequestUrl(n),null,s).then(function(e){return e.json()}).then(async function(s){if(s&&s.code&&200!==s.code)throw s;s.visibleScales&&(e.visibleScales=s.visibleScales,e.coordUnit=s.coordUnit),e.maxZoom=s.maxZoom,e.maxZoom=s.minZoom;let n=e.credential?e.credential.token:void 0;if(e.format="png","webp"===i.tileFormat&&"https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark"!==e.url){const t=await i.isSupportWebp(e.url,n);e.format=t?"webp":"png"}r?t&&t(r,null,!0,i):t&&t(e)}).catch(function(e){i.errorCallback&&i.errorCallback(e,"getTileInfo",i.map)})}getWMTSUrl(e,t){let r="?";return e.indexOf("?")>-1&&(r="&"),e+=t?r+"SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities":r+"/1.0.0/WMTSCapabilities.xml",this.getRequestUrl(e,!0)}getWmtsInfo(e,t){let r=this,i={withCredentials:r.withCredentials,withoutFormatSuffix:!0};const s=!e.requestEncoding||"KVP"===e.requestEncoding;return Ue.get(r.getWMTSUrl(e.url,s),null,i).then(function(e){return e.text()}).then(function(i){let n=(new(Jm())).read(i);if(r.isValidResponse(n)){let i,o,l,h=n.Contents,u=h.TileMatrixSet,c=h.Layer,d="default";for(let t=0;t<c.length;t++)if(c[t].Identifier===e.layer){l=(i=c[o=t]).Format[0];var a=i.WGS84BoundingBox;break}i&&i.Style&&i.Style.forEach(e=>{e.isDefault&&(d=e.Identifier)});let p=[],f=[];for(let t=0;t<u.length;t++)if(u[t].Identifier===e.tileMatrixSet){let r=`EPSG:${u[t].SupportedCRS.split("::")[1]}`;for(let e=0;e<u[t].TileMatrix.length;e++)p.push(u[t].TileMatrix[e].ScaleDenominator),f.push(u[t].TileMatrix[e].Identifier);let i=u[t].TileMatrix[0].TopLeftCorner;e.origin=["EPSG:4326","EPSG:4490"].indexOf(r)>-1?[i[1],i[0]]:i;break}let y,m=e.name;a?(a[0]<-180&&(a[0]=-180),a[1]<-90&&(a[1]=-90),a[2]>180&&(a[2]=180),a[3]>90&&(a[3]=90),y=Mo.transformExtent(a,"EPSG:4326",r.baseProjection)):y=Mo.get(r.baseProjection).getExtent(),e.tileUrl=r.getTileUrl(n.OperationsMetadata.GetTile.DCP.HTTP.Get,i,l,s),e.extent=y,e.name=m,e.orginEpsgCode=e.projection,e.overLayer=!0,e.scales=p,e.style=d,e.title=m,e.unit="m",e.layerFormat=l,e.matrixIds=f,t&&t(e)}}).catch(function(e){r.errorCallback&&r.errorCallback(e,"getWmtsFaild",r.map)})}getWmsInfo(e){let t=this,r=e.url.trim();r+=r.indexOf("?")>-1?"&SERVICE=WMS&REQUEST=GetCapabilities":"?SERVICE=WMS&REQUEST=GetCapabilities";let i={withCredentials:t.withCredentials,withoutFormatSuffix:!0};return new Promise(function(s){return Ue.get(t.getRequestUrl(r,!0),null,i).then(function(e){return e.text()}).then(async function(t){let r=(new(qm())).read(t);if(r){let t=r.Capability.Layer.Layer,i=e.projection;e.subLayers=e.layers[0],e.version=r.version;for(let r=0;r<t.length;r++)if(e.layers[0]===t[r].name){let s=t[r];if(s.bbox[i]){let t=s.bbox[i].bbox;"1.3.0"===e.version&&"EPSG:4326"===e.projection||"1.3.0"===e.version&&"EPSG:4490"===e.projection?e.extent=[t[1],t[0],t[3],t[2]]:e.extent=t;break}}}s()}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getWMSFaild",t.map),s()})})}getTileUrl(e,t,r,i){let s;if(i)e.forEach(e=>{"KVP"===e.Constraint[0].AllowedValues.Value[0].toUpperCase()&&(s=e.href)});else{const e=t.ResourceURL.filter(e=>e.format===r);s=e[0].template}return s}createWMTSSource(e){let t=e.extent||Mo.get(e.projection).getExtent(),r=Mo.get(this.baseProjection).getUnits();return new(zl())({url:e.tileUrl||e.url,layer:e.layer,format:e.layerFormat,style:e.style,matrixSet:e.tileMatrixSet,requestEncoding:e.requestEncoding||"KVP",tileGrid:this.getWMTSTileGrid(t,e.scales,r,e.dpi,e.origin,e.matrixIds),tileLoadFunction:function(t,r){r.indexOf("tianditu.gov.cn")>=0?t.getImage().src=`${r}&tk=${te.getParameters(e.url).tk}`:t.getImage().src=r}})}getWMTSTileGrid(e,t,r,i,s,n){let a=this.getReslutionsFromScales(t,i||sg.iServerWMTS,r);return new(Hl())({origin:s,extent:e,resolutions:a.res,matrixIds:n||a.matrixIds})}getReslutionsFromScales(e,t,r,i){r=r&&r.toLowerCase()||"degrees",t=t||sg.iServerWMTS,i=i||6378137;let s=[],n=[];if($o.isArray(e))e&&e.forEach(function(e,a){e>1&&(n.push(a),s.push(this.getResolutionFromScale(e,t,r,i)))},this);else{let a=e.TileMatrix;a&&a.forEach(function(e){n.push(e.Identifier),s.push(this.getResolutionFromScale(e.ScaleDenominator,t,r,i))},this)}return{res:s,matrixIds:n}}getResolutionFromScale(e,t=sg.default,r,i){let s;return e=(e=+e)>1?1/e:e,s="degrees"===r||"dd"===r||"degree"===r?254/t/e/(2*Math.PI*i/360)/1e4:254/t/e/1e4}isValidResponse(e){let t=["Contents","OperationsMetadata"],r=!0;for(let i=0;i<t.length;i++)if(!e[t[i]]||e.error){r=!1;break}return r}async addLayers(e){let t=e.layers,r=this,i=[],s=t.length;if(s>0){this.layers=t;for(let n=0;n<t.length;n++){const a=t[n];let o=n+1,l=a.dataSource,h=l&&"SAMPLE_DATA"===l.type&&!!l.name;if("MAPBOXSTYLE"===a.layerType)r.addMVTMapLayer(e,a,o).then(()=>{r.layerAdded++,r.sendMapToUser(s)}).catch(function(e){r.layerAdded++,r.sendMapToUser(s),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)});else if(l&&l.serverId||"MARKER"===a.layerType||"HOSTED_TILE"===a.layerType||h){let e=a.dataSource,t=e?e.serverId:a.serverId;if(!t&&!h)return await r.addLayer(a,null,o),r.layerAdded++,void r.sendMapToUser(s);if("MARKER"===a.layerType||e&&(!e.accessType||"DIRECT"===e.accessType)||h){let n=h?`${r.server}apps/dataviz/libs/sample-datas/${e.name}.json`:`${r.server}web/datas/${t}/content.json?pageSize=9999999&currentPage=1`;n=r.getRequestUrl(n),Ue.get(n,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(async function(e){if(!1===e.succeed)return r.layerAdded++,r.sendMapToUser(s),void(r.errorCallback&&r.errorCallback(e.error,"getLayerFaild",r.map));if(e&&e.type){if("JSON"===e.type||"GEOJSON"===e.type)e.content=e.content.type?e.content:JSON.parse(e.content),i=r.geojsonToFeature(e.content,a);else if("EXCEL"===e.type||"CSV"===e.type)if(a.dataSource&&a.dataSource.administrativeInfo){e.content.rows.unshift(e.content.colTitles);let{divisionType:t,divisionField:s}=a.dataSource.administrativeInfo,n=r.excelData2FeatureByDivision(e.content,t,s);i=r._parseGeoJsonData2Feature({allDatas:{features:n.features},fileCode:a.projection})}else i=await r.excelData2Feature(e.content,a);else if("SHP"===e.type){let t=JSON.parse(e.content);e.content=t.layers[0],i=r.geojsonToFeature(e.content,a)}await r.addLayer(a,i,o),r.layerAdded++,r.sendMapToUser(s)}}).catch(function(e){r.layerAdded++,r.sendMapToUser(s),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)})}else{let t="HOSTED_TILE"===a.layerType,i=e?e.serverId:a.serverId;r.checkUploadToRelationship(i).then(function(e){if(e&&e.length>0){let n=e[0].name,l=e[0].type.toUpperCase();r.getDataService(i,n).then(async function(e){let i=e.dataItemServices;if(0===i.length)return r.layerAdded++,r.sendMapToUser(s),void(r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map));if(t){let e=r.getService(i,"RESTDATA");r.isMvt(e.address,n).then(async e=>{await r.getServiceInfoFromLayer(o,s,a,i,n,l,e)}).catch(async()=>{await r.getServiceInfoFromLayer(o,s,a,i,n,l)})}else await r.getServiceInfoFromLayer(o,s,a,i,n,l)})}else r.layerAdded++,r.sendMapToUser(s),r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map)}).catch(function(e){r.layerAdded++,r.sendMapToUser(s),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)})}}else l&&"USER_DATA"===l.type?r.addGeojsonFromUrl(a,s,o,!1):"TILE"===a.layerType?r.getTileLayerExtent(a,function(e){r.map.addLayer(r.createBaseLayer(e,o)),r.layerAdded++,r.sendMapToUser(s)},function(e){r.layerAdded++,r.sendMapToUser(s),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)}):"SUPERMAP_REST"===a.layerType||"WMS"===a.layerType||"WMTS"===a.layerType?"WMTS"===a.layerType?r.getWmtsInfo(a,function(e){r.map.addLayer(r.createBaseLayer(e,o)),r.layerAdded++,r.sendMapToUser(s)}):"WMS"===a.layerType?r.getWmsInfo(a).then(()=>{r.map.addLayer(r.createBaseLayer(a,o)),r.layerAdded++,r.sendMapToUser(s)}):(a.projection=r.baseProjection,r.map.addLayer(r.createBaseLayer(a,o)),r.layerAdded++,r.sendMapToUser(s)):l&&"REST_DATA"===l.type?r.getFeaturesFromRestData(a,o,s):l&&"REST_MAP"===l.type&&l.url?Fd(l.url,l.layerName,"smid=1",null,null,function(e){var t=e&&e.result.recordsets,i=t&&t[0],n=i.fields;if(i&&n){let e=[];for(var l in n){var h=n[l];0===h.indexOf("Sm")&&"SmID"!==h||e.push(h)}r.getFeatures(e,a,async function(e){await r.addLayer(a,e,o),r.layerAdded++,r.sendMapToUser(s)},function(e){r.layerAdded++,r.errorCallback&&r.errorCallback(e,"getFeatureFaild",r.map)})}},function(e){r.errorCallback&&r.errorCallback(e,"getFeatureFaild",r.map)}):"DATAFLOW_POINT_TRACK"!==a.layerType&&"DATAFLOW_HEAT"!==a.layerType||r.getDataflowInfo(a,async function(){await r.addLayer(a,i,o),r.layerAdded++,r.sendMapToUser(s)},function(e){r.layerAdded++,r.errorCallback&&r.errorCallback(e,"getFeatureFaild",r.map)})}}}addGeojsonFromUrl(e,t,r,i=this.withCredentials){let{dataSource:s}=e,{url:n}=s,a=this;Ue.get(n,null,{withCredentials:i,withoutFormatSuffix:!0}).then(function(e){return e.json()}).then(async function(i){if(i&&!1!==i.succeed){var s;if("CSV"===i.type||"EXCEL"===i.type)if(e.dataSource&&e.dataSource.administrativeInfo){i.content.rows.unshift(i.content.colTitles);let{divisionType:t,divisionField:r}=e.dataSource.administrativeInfo,n=a.excelData2FeatureByDivision(i.content,t,r);s=a._parseGeoJsonData2Feature({allDatas:{features:n.features},fileCode:e.projection})}else s=await a.excelData2Feature(i.content,e);else{var n=i.content?JSON.parse(i.content):i;s=a.geojsonToFeature(n,e)}t?(await a.addLayer(e,s,r),a.layerAdded++,a.sendMapToUser(t)):(a.map.removeLayer(e.layer),e.labelLayer&&a.map.removeLayer(e.labelLayer),await a.addLayer(e,s,r))}else t?a.errorCallback&&a.errorCallback(i.error,"autoUpdateFaild",a.map):(a.layerAdded++,a.sendMapToUser(t),a.errorCallback&&a.errorCallback(i.error,"getLayerFaild",a.map))}).catch(function(e){a.layerAdded++,a.sendMapToUser(t),a.errorCallback&&a.errorCallback(e,"getLayerFaild",a.map)})}async getServiceInfoFromLayer(e,t,r,i,s,n,a){let o=this,l=a?!a.isMvt:"HOSTED_TILE"===r.layerType,h=!1;for(let u=0;u<i.length;u++){const c=i[u];if(h)return;if(c&&l&&"RESTMAP"===c.serviceType)h=!0,o.getTileLayerInfo(c.address).then(function(i){i.forEach(function(i){let s=i.bounds;r.layerType="TILE",r.orginEpsgCode=o.baseProjection,r.units=i.coordUnit&&i.coordUnit.toLowerCase(),r.extent=[s.left,s.bottom,s.right,s.top],r.visibleScales=i.visibleScales,r.url=i.url,r.sourceType="TILE",o.map.addLayer(o.createBaseLayer(r,e)),o.layerAdded++,o.sendMapToUser(t)})});else if(c&&!l&&"RESTDATA"===c.serviceType)if(h=!0,a&&a.isMvt){let i=a.bounds;r=Object.assign(r,{layerType:"VECTOR_TILE",epsgCode:a.epsgCode,projection:`EPSG:${a.epsgCode}`,bounds:i,extent:[i.left,i.bottom,i.right,i.top],name:r.name,url:a.url,visible:r.visible,featureType:n,serverId:r.serverId.toString()}),o.map.addLayer(await o.addVectorTileLayer(r,e,"RESTDATA")),o.layerAdded++,o.sendMapToUser(t)}else h=!0,o.getDatasources(c.address).then(function(i){r.dataSource.dataSourceName=i+":"+s,r.dataSource.url=`${c.address}/data`,o.getFeaturesFromRestData(r,e,t)})}h||(o.layerAdded++,o.sendMapToUser(t),o.errorCallback&&o.errorCallback(null,"getLayerFaild",o.map))}getDataflowInfo(e,t,r){let i,s=e.url;s=this.handleJSONSuffix(s);let n=this.getRequestUrl(s,!1);e.credential&&e.credential.token&&(n+=`?token=${i=e.credential.token}`),Ue.get(n,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(r){e.featureType="POINT",r&&r.featureMetaData&&(e.featureType=r.featureMetaData.featureType.toUpperCase()),e.wsUrl=r.urls[0].url,t()}).catch(function(){r()})}getFeaturesFromRestData(e,t,r){let i=this,s=e.dataSource,n=e.dataSource.url,a=s.dataSourceName||e.name,o=i.formatUrlWithCredential(n),l={};if(l.withCredentials=this.withCredentials,this.excludePortalProxyUrl||te.isInTheSameDomain(o)||(l.proxy=this.getProxy()),["EPSG:0"].includes(e.projection))return i.layerAdded++,i.sendMapToUser(r),void(i.errorCallback&&i.errorCallback({},"getFeatureFaild",i.map));kd(o,[decodeURIComponent(a)],l,async function(s){let n=i.parseGeoJsonData2Feature({allDatas:{features:s.result.features.features},fileCode:i.baseProjection,featureProjection:i.baseProjection});await i.addLayer(e,n,t),i.layerAdded++,i.sendMapToUser(r)},function(e){i.layerAdded++,i.sendMapToUser(r),i.errorCallback&&i.errorCallback(e,"getFeatureFaild",i.map)},i.baseProjection.split("EPSG:")[1],this.restDataSingleRequestCount)}getFeatures(e,t,r,i){var s=this,n=t.dataSource,a=t.projection;Fd(n.url,n.layerName,null,e,null,function(e){var t=e.result.recordsets[0].features.features,i=s.parseGeoJsonData2Feature({allDatas:{features:t},fileCode:a,featureProjection:s.baseProjection},"JSON");r(i)},function(e){i(e)})}sendMapToUser(e){const t=this.isHaveGraticule?e+1:e;this.layerAdded===t&&this.successCallback&&this.successCallback(this.map,this.mapParams,this.layers,this.baseLayer)}async excelData2Feature(e,t){let r=e.rows,i=e.colTitles;for(let e in i)$o.isString(i[e])&&(i[e]=$o.trim(i[e]));let s=t.projection,n=t.dataSource,a=this.baseProjection,o=[],l=$o.trim(t.xyField&&t.xyField.xField||t.from&&t.from.xField),h=$o.trim(t.xyField&&t.xyField.yField||t.from&&t.from.yField),u=i.indexOf(l),c=i.indexOf(h);if("MIGRATION"===t.layerType)try{if("PORTAL_DATA"===n.type){const{dataMetaInfo:e}=await Ue.get(`${this.server}web/datas/${n.serverId}.json`,null,{withCredentials:this.withCredentials}).then(e=>e.json());t.xyField={xField:e.xField,yField:e.yField},e.xIndex?(u=e.xIndex,c=e.yIndex):(u=i.indexOf(e.xField),c=i.indexOf(e.yField))}else if("SAMPLE_DATA"===n.type){const e=Lm.find(e=>e.id===n.name)||{};l=e.xField,h=e.yField,t.xyField={xField:l,yField:h},u=i.findIndex(e=>e===l),c=i.findIndex(e=>e===h)}}catch(e){console.error(e)}for(let e=0,t=r.length;e<t;e++){let t=r[e],n={},l=r[e][u],h=r[e][c];if(""!==l&&""!==h){let e=new Hm.Point([+l,+h]);s!==a&&e.transform(s,a);for(let e=0,r=t.length;e<r;e++){let r=i[e];if(void 0!==r&&null!==r)if(r=r.trim(),Object.keys(n).indexOf(r)>-1){n[r+"_1"]=t[e]}else n[r]=t[e]}let r=new(Qo())({geometry:e,attributes:n});o.push(r)}}return Promise.resolve(o)}excelData2FeatureByDivision(e,t,r){let i,s=this;if("Province"===t?i=window.ProvinceData:"City"===t?i=window.MunicipalData:"GB-T_2260"===t&&(i=window.AdministrativeArea),i){return s.changeExcel2Geojson(i.features,e.rows,t,r)}}_parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let i=0,s=t.length;i<s;i++){let s=Object.assign({},t[i].properties);delete t[i].properties;let n=tg.readFeature(t[i],{dataProjection:e.fileCode,featureProjection:this.baseProjection||"ESPG:4326"});n.setProperties({attributes:s}),r.push(n)}return r}changeExcel2Geojson(e,t,r,i){let s={type:"FeatureCollection",features:[]};if(t.length<2)return s;let n=t[0],a=t.slice(1),o=n.findIndex(e=>e===i);return a.forEach(t=>{let i;if(i="GB-T_2260"===r?e.find(e=>e.properties.GB===t[o]):$o.getHighestMatchAdministration(e,t[o])){let e=window.cloneDeep(i);e.properties={},t.forEach((t,r)=>{let i=n[r].trim();e.properties[i]=t}),s.features.push(e)}}),s}geojsonToFeature(e,t){let r=e.features,i=[];for(let e=0,s=r.length;e<s;e++){let s=r[e].properties||{};delete r[e].properties;let n=tg.readFeature(r[e],{dataProjection:t.projection||"EPSG:4326",featureProjection:this.baseProjection||"ESPG:4326"}),a=n.getGeometry().getCoordinates();"Point"===r[e].geometry.type&&r[e].properties&&(r[e].properties.lon=a[0],r[e].properties.lat=a[1]);let o,l,h,u=!1;if(r[e].dv_v5_markerInfo&&(o=Object.assign({},r[e].dv_v5_markerInfo,s)).lon&&(delete o.lon,delete o.lat),r[e].dv_v5_markerStyle&&(l=r[e].dv_v5_markerStyle,u=!0),u)h=Object.assign({},{attributes:o},{useStyle:l}),n.layerId=t.timeId;else if(t.featureStyles){let r,i=JSON.parse(t.featureStyles[e].style),n=s;n._smiportal_imgLinkUrl.indexOf("http://")>-1||n._smiportal_imgLinkUrl.indexOf("https://")>-1?r=n._smiportal_imgLinkUrl:void 0!==n._smiportal_imgLinkUrl&&null!==n._smiportal_imgLinkUrl&&""!==n._smiportal_imgLinkUrl&&(r=`${$o.getIPortalUrl()}resources/markerIcon/${n._smiportal_imgLinkUrl}`),o={dataViz_description:n._smiportal_description,dataViz_imgUrl:r,dataViz_title:n._smiportal_title,dataViz_url:n._smiportal_otherLinkUrl},i.anchor=[.5,1],i.src=i.externalGraphic,l=i,h=Object.assign({},{attributes:o},{useStyle:l}),delete n._smiportal_description,delete n._smiportal_imgLinkUrl,delete n._smiportal_title,delete n._smiportal_otherLinkUrl}else h={attributes:s};n.setProperties(h),i.push(n)}return i}parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let i=0,s=t.length;i<s;i++){let s=t[i].properties;delete t[i].properties;let n=tg.readFeature(t[i],{dataProjection:e.fileCode||"EPSG:4326",featureProjection:e.featureProjection||this.baseProjection||"EPSG:4326"}),a=n.getGeometry();if(!a)continue;let o=a.getCoordinates();"Point"===t[i].geometry.type&&(s.lon=o[0],s.lat=o[1]),n.setProperties({attributes:s}),r.push(n)}return r}async addLayer(e,t,r){let i,s=this;"VECTOR"===e.layerType?i="POINT"===e.featureType?"SYMBOL_POINT"===e.style.type?this.createSymbolLayer(e,t):await this.createGraphicLayer(e,t):await this.createVectorLayer(e,t):"UNIQUE"===e.layerType?i=await this.createUniqueLayer(e,t):"RANGE"===e.layerType?i=await this.createRangeLayer(e,t):"HEAT"===e.layerType?i=this.createHeatLayer(e,t):"MARKER"===e.layerType?i=await this.createMarkerLayer(t):"DATAFLOW_POINT_TRACK"===e.layerType?i=await this.createDataflowLayer(e,r):"DATAFLOW_HEAT"===e.layerType?i=this.createDataflowHeatLayer(e):"RANK_SYMBOL"===e.layerType?i=await this.createRankSymbolLayer(e,t):"MIGRATION"===e.layerType&&(i=this.createMigrationLayer(e,t));let n=$o.newGuid(8);if(i){if(e.name&&i.setProperties({name:e.name,layerID:n,layerType:e.layerType}),e&&e.style&&e.style.imageInfo){let t=new Image;t.src=e.style.imageInfo.url,t.onload=function(){i.getSource().changed()}}"MIGRATION"===e.layerType?(i.appendTo(this.map),i.setVisible(e.visible),i.setCursor()):(void 0!=e.opacity&&i.setOpacity(e.opacity),i.setVisible(e.visible),this.map.addLayer(i)),i.setZIndex(r);const{visibleScale:t,autoUpdateTime:a}=e;if(t&&this.setVisibleScales(i,t),a&&!e.autoUpdateInterval){let t=e.dataSource;"DIRECT"!==t.accessType||t.url||(t.url=`${this.server}web/datas/${t.serverId}/content.json?pageSize=9999999&currentPage=1`),e.autoUpdateInterval=setInterval(()=>{s.updateFeaturesToMap(e,r,!0)},a)}}e.layer=i,e.layerID=n,e.labelStyle&&e.labelStyle.labelField&&"DATAFLOW_POINT_TRACK"!==e.layerType&&(t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,this.addLabelLayer(e,t))}updateFeaturesToMap(e,t){let r=this,i=e.dataSource,s=e.dataSource.url,n=i.dataSourceName||e.name;if("USER_DATA"===i.type||"DIRECT"===i.accessType)r.addGeojsonFromUrl(e,null,t);else{let i=r.formatUrlWithCredential(s),a={};a.withCredentials=this.withCredentials,this.excludePortalProxyUrl||te.isInTheSameDomain(i)||this.isIportalProxyServiceUrl(i)||(a.proxy=this.getProxy()),kd(i,[n],a,async function(i){let s=r.parseGeoJsonData2Feature({allDatas:{features:i.result.features.features},fileCode:e.projection,featureProjection:r.baseProjection});r.map.removeLayer(e.layer),e.labelLayer&&r.map.removeLayer(e.labelLayer),await r.addLayer(e,s,t)},function(e){r.errorCallback&&r.errorCallback(e,"autoUpdateFaild",r.map)},void 0,this.restDataSingleRequestCount)}}async addVectorTileLayer(e,t,r){let i;"RESTDATA"===r&&(i=await this.createDataVectorTileLayer(e));let s=$o.newGuid(8);return i&&(e.name&&i.setProperties({name:e.name,layerID:s}),void 0!=e.opacity&&i.setOpacity(e.opacity),i.setVisible(e.visible),i.setZIndex(t)),e.layer=i,e.layerID=s,i}async createDataVectorTileLayer(e){var t=new(Tp())({featureClass:Qo()});Tp().prototype.readProjection=function(){return new Mo.Projection({code:"",units:Bm().TILE_PIXELS})};let r=e.featureType,i=await xl.toOpenLayersStyle(this.getDataVectorTileStyle(r),r);return new Um.VectorTile({source:new Ep({url:e.url,projection:e.projection,tileType:"ScaleXY",format:t}),style:i})}getDataVectorTileStyle(e){let t={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT"};return["LINE","LINESTRING","MULTILINESTRING"].indexOf(e)>-1?(t.strokeColor="#4CC8A3",t.strokeWidth=2):["REGION","POLYGON","MULTIPOLYGON"].indexOf(e)>-1&&(t.fillColor="#826DBA"),t}getFiterFeatures(e,t){let r=this.parseFilterCondition(e),i=[];for(let e=0;e<t.length;e++){let s=t[e],n=!1;try{const e=s.get("attributes"),t=Ad(r,Object.keys(e)),i=Md(e),a="select * from json where ("+t+")";n=window.jsonsql.query(a,{attributes:i})}catch(e){continue}n&&n.length>0&&i.push(s)}return i}parseFilterCondition(e){return e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=").replace(/\(?[^\(]+?\s*in\s*\([^\)]+?\)\)?/gi,e=>{const t=e.match(/([^(]+?)\s*in\s*\(([^)]+?)\)/i);return 3===t.length?`(${t[2].split(",").map(e=>`${t[1]} == ${e.trim()}`).join(" || ")})`:e})}async createGraphicLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let r=await this.getGraphicsFromFeatures(t,e.style,e.featureType),i=new op({graphics:r,render:"canvas",map:this.map,isHighLight:!1});return new Um.Image({source:i})}async getGraphicsFromFeatures(e,t,r){let i=(await xl.getOpenlayersStyle(t,r)).getImage(),s=[];for(let t in e){let r=new ep(e[t].getGeometry());r.setStyle(i),r.setProperties({attributes:e[t].get("attributes")}),s.push(r)}return s}createSymbolLayer(e,t){let r=xl.getSymbolStyle(e.style);return new Um.Vector({style:r,source:new(qo())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1}),renderMode:"image"})}addLabelLayer(e,t){let r=e.labelStyle,i=this.getLabelStyle(r,e),s=e.labelLayer=new Um.Vector({declutter:!0,styleOL:i,labelField:r.labelField,source:new(qo())({features:t,wrapX:!1})});s.setStyle(e=>{let t=r.labelField,i=e.get("attributes")[t.trim()]+"";if("undefined"===i)return null;let n=s.get("styleOL"),a=n.getText();return a&&a.setText&&a.setText(i),n}),this.map.addLayer(s),s.setVisible(e.visible),s.setZIndex(1e3);const{visibleScale:n}=e;return n&&this.setVisibleScales(s,n),s}setVisibleScales(e,t){let r=this.resolutions[t.minScale],i=this.resolutions[t.maxScale];r>1?e.setMaxResolution(Math.ceil(r)):e.setMaxResolution(1.1*r),e.setMinResolution(i)}getLabelStyle(e,t){let r=t.style||t.pointStyle;const{radius:i=0,strokeWidth:s=0}=r,n=-(i+s),{fontSize:a="14px",fontFamily:o,fill:l,backgroundFill:h,offsetX:u=0,offsetY:c=n,placement:d="point",textBaseline:p="bottom",textAlign:f="center",outlineColor:y="#000000",outlineWidth:m=0}=e,g={font:`${a} ${o}`,placement:d,textBaseline:p,fill:new(pl())({color:l}),backgroundFill:new(pl())({color:h}),padding:[3,3,3,3],offsetX:"POINT"===t.featureType?u:0,offsetY:"POINT"===t.featureType?c:0,overflow:!0,maxAngle:0};return"POINT"===t.featureType&&(g.textAlign=f),m>0&&(g.stroke=new(yl())({color:y,width:m})),new(al())({text:new(gl())(g)})}async createVectorLayer(e,t){const{featureType:r,style:i}=e;let s;if("LINE"===r&&$o.isArray(i)&&2===i.length){const[e,t]=i;s=t.lineDash&&"solid"!==t.lineDash?xl.getPathway(t,e):xl.getRoadPath(t,e)}else $o.isArray(i)&&(e.style=i[0]),s=await xl.toOpenLayersStyle(e.style,e.featureType);return new Um.Vector({style:s,source:new(qo())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})})}createHeatLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let r={source:new(qo())({features:t,wrapX:!1})},i=e.themeSetting;r.gradient=i.colors.slice(),r.radius=parseInt(i.radius);let s=i.customSettings;for(let e in s)r.gradient[e]=s[e];return i.weight&&this.changeWeight(t,i.weight),new Um.Heatmap(r)}changeWeight(e,t){let r=this;this.fieldMaxValue={},this.getMaxValue(e,t);let i=this.fieldMaxValue[t];e.forEach(function(e){let s=e.get("attributes");try{let n=s[t];e.set("weight",n/i)}catch(e){r.errorCallback&&r.errorCallback(e)}})}getMaxValue(e,t){let r,i=[],s=this,n=t;this.fieldMaxValue[n]||(e.forEach(function(e){r=e.get("attributes");try{i.push(parseFloat(r[n]))}catch(e){s.errorCallback&&s.errorCallback(e)}}),this.fieldMaxValue[n]=Vn.getArrayStatistic(i,"Maximum"))}async createUniqueLayer(e,t){let r=await this.createUniqueSource(e,t),i=new Um.Vector({styleSource:r,source:new(qo())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return i.setStyle(e=>{let t=i.get("styleSource"),r=t.themeField,s=e.get("attributes")[r];return t.styleGroups.find(e=>e.value===s).olStyle}),i}async createUniqueSource(e,t){let r=await this.getUniqueStyleGroup(e,t);return{map:this.map,style:e.style,isHoverAble:e.isHoverAble,highlightStyle:e.highlightStyle,themeField:e.themeSetting.themeField,styleGroups:r}}async getUniqueStyleGroup(e,t){let r=e.featureType,i=e.style,s=e.themeSetting,n=s.themeField,a=[],o=s.customSettings;for(let e in t){let r=t[e].get("attributes")[n],i=!1;for(let e in a)if(a[e]===r){i=!0;break}i||a.push(r)}let l=[];const h=this.getCustomSettingColors(o,r).map(e=>e.toLowerCase()),u=this.getUniqueColors(s.colors||this.defaultParameters.themeSetting.colors,a.length+Object.keys(o).length).map(e=>e.toLowerCase()),c=eg()(u,h);for(let e=0;e<a.length;e++){const t=a[e];let s="1.0"===this.webMapVersion?e:t,n=o[s];$o.isString(n)&&(n=this.getCustomSetting(i,n,r),o[s]=n),n||(n=this.getCustomSetting(i,c.shift(),r));let h,u=n.type;h="SYMBOL_POINT"===u?xl.getSymbolStyle(n):"SVG_POINT"===u?await xl.getSVGStyle(n):"IMAGE_POINT"===u?xl.getImageStyle(n):await xl.toOpenLayersStyle(n,r),l.push({olStyle:h,style:o[s],value:t})}return l}getCustomSetting(e,t,r){let i={};return"LINE"===r?i.strokeColor=t:i.fillColor=t,Object.assign(e,i)}getCustomSettingColors(e,t){const r=[];return Object.keys(e).forEach(i=>{$o.isString(e[i])?r.push(e[i]):"LINE"===t?r.push(e[i].strokeColor):r.push(e[i].fillColor)}),r}getUniqueColors(e,t){return Un.getGradientColors(e,t)}async createRangeLayer(e,t){let r=await this.createRangeSource(e,t),i=new Um.Vector({styleSource:r,source:new(qo())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return i.setStyle(e=>{let t=i.get("styleSource");if(t){let r=t.themeField,i=Number(e.get("attributes")[r.trim()]),s=t.styleGroups;for(let e=0;e<s.length;e++)if(0===e){if(i>=s[e].start&&i<=s[e].end)return s[e].olStyle}else if(i>s[e].start&&i<=s[e].end)return s[e].olStyle}}),i}async createRangeSource(e,t){let r=await this.getRangeStyleGroup(e,t);return!!r&&{style:e.style,themeField:e.themeSetting.themeField,styleGroups:r}}async getRangeStyleGroup(e,t){let r,i,s=e.featureType,n=e.themeSetting,a=e.style,o=n.segmentCount,l=n.segmentMethod,h=n.colors,u=n.customSettings,c=n.themeField,d=[],p=o,f=l,y=this;t.forEach(function(e){r=e.get("attributes");try{if(r){let e=r[c.trim()];void 0!==e&&null!==e&&$o.isNumber(e)&&d.push(parseFloat(e))}else e.get(c)&&$o.isNumber(e.get(c))&&e.get(c)&&d.push(parseFloat(e.get(c)))}catch(e){y.errorCallback&&y.errorCallback(e)}});try{i=Vn.getArraySegments(d,f,p)}catch(e){y.errorCallback&&y.errorCallback(e)}if(i){let e=p;r&&i[0]===i[r.length-1]&&(e=1,i.length=2);for(let e in i){let t=i[e];t=0===Number(e)?Math.floor(100*t)/100:Math.ceil(100*t)/100+.1,i[e]=Number(t.toFixed(2))}let t=h;t=Un.getGradientColors(t,e,"RANGE");for(let t=0;t<e;t++)t in u&&(u[t].segment.start&&(i[t]=u[t].segment.start),u[t].segment.end&&(i[t+1]=u[t].segment.end));let n=[];for(let r=0;r<e;r++){let e=t[r];r in u&&u[r].color&&(e=u[r].color),"LINE"===s?a.strokeColor=e:a.fillColor=e;let o=await xl.toOpenLayersStyle(a,s),l=i[r],h=i[r+1];n.push({olStyle:o,color:e,start:l,end:h})}return n}return!1}async createMarkerLayer(e){return e&&await this.setEachFeatureDefaultStyle(e),new Um.Vector({source:new(qo())({features:e,wrapX:!1})})}async createDataflowLayer(e,t){let r,i=e.pointStyle;r=await xl.getOpenlayersStyle(i,e.featureType);let s,n,a,o,l=new(qo())({wrapX:!1}),h=new Um.Vector({styleOL:r,source:l});e.labelStyle&&e.visible&&((s=this.addLabelLayer(e)).setZIndex(1e3),n=s.getSource());const{visibleScale:u}=e;e.lineStyle&&e.visible&&(a=await this.createVectorLayer({style:e.lineStyle,featureType:"LINE"}),o=a.getSource(),a.setZIndex(t),this.map.addLayer(a),u&&this.setVisibleScales(a,u),e.pathLayer=a);let c=this;return this.createDataflowService(e,function(t,r,i){return function(s){if(c.events.triggerEvent("updateDataflowFeature",{feature:s,identifyField:e.identifyField,layerID:e.layerID}),e.filterCondition){const a=c.parseFilterCondition(e.filterCondition),h=s.get("attributes"),u=Ad(a,Object.keys(h)),d=Md(h),p="select * from json where ("+u+")";let f=window.jsonsql.query(p,{attributes:d});f&&f.length>0&&c.addDataflowFeature(s,e.identifyField,{dataflowSource:l,featureCache:t,labelSource:n,labelFeatureCache:r,pathSource:o,pathFeatureCache:i,maxPointCount:e.maxPointCount})}else c.addDataflowFeature(s,e.identifyField,{dataflowSource:l,featureCache:t,labelSource:n,labelFeatureCache:r,pathSource:o,pathFeatureCache:i,maxPointCount:e.maxPointCount})}}({},{},{})),this.setFeatureStyle(h,e.directionField,i.type),h}addDataflowFeature(e,t,r){r.dataflowSource&&this.addFeatureFromDataflowService(r.dataflowSource,e,t,r.featureCache),r.labelSource&&this.addFeatureFromDataflowService(r.labelSource,e,t,r.labelFeatureCache),r.pathSource&&this.addPathFeature(r.pathSource,e,t,r.pathFeatureCache,r.maxPointCount)}addPathFeature(e,t,r,i,s){let n=[];var a=t.get(r);i[a]?((n=i[a].getGeometry().getCoordinates()).push(t.getGeometry().getCoordinates()),s&&n.length>s&&n.splice(0,n.length-s),i[a].getGeometry().setCoordinates(n)):(n.push(t.getGeometry().getCoordinates()),i[a]=new(Qo())({geometry:new Hm.LineString(n)}),e.addFeature(i[a]))}setFeatureStyle(e,t,r){let i=e.get("styleOL");e.setStyle(e=>{let s,n;if((s=void 0!==t&&"未设置"!==t&&"None"!==t?e.get("attributes")[t]:0)>360||s<0)return null;n="SYMBOL_POINT"===r?i.getText():i.getImage();let a=Math.PI*s/180;return n&&n.setRotation(a),i})}createDataflowHeatLayer(e){let t={source:this.createDataflowHeatSource(e)};if(t.gradient=e.themeSetting.colors.slice(),t.radius=parseInt(e.themeSetting.radius),e.themeSetting.customSettings){let r=e.themeSetting.customSettings;for(let e in r)t.gradient[e]=r[e]}return new Um.Heatmap(t)}createDataflowHeatSource(e){let t=this,r=new(qo())({wrapX:!1});return this.createDataflowService(e,function(i){return function(s){if(e.filterCondition){let n=t.parseFilterCondition(e.filterCondition);const a=s.get("attributes"),o=Ad(n,Object.keys(a)),l=Md(a),h="select * from json where ("+o+")";let u=window.jsonsql.query(h,{attributes:l});u&&u.length>0&&t.addDataflowFeature(s,e.identifyField,{dataflowSource:r,featureCache:i})}else t.addDataflowFeature(s,e.identifyField,{dataflowSource:r,featureCache:i});e.themeSetting.weight&&t.changeWeight(r.getFeatures(),e.themeSetting.weight)}}({})),r}addFeatureFromDataflowService(e,t,r,i){var s=t.get(r);void 0!==s&&i[s]?(i[s].setGeometry(t.getGeometry()),i[s].setProperties(t.getProperties()),e.changed()):(e.addFeature(t),i[s]=t)}createDataflowService(e,t){let r=this,i=new Dd(e.wsUrl).initSubscribe();i.on("messageSucceeded",function(i){let s=JSON.parse(i.value.data),n=tg.readFeature(s,{dataProjection:e.projection||"EPSG:4326",featureProjection:r.baseProjection||"EPSG:4326"});n.setProperties({attributes:s.properties}),t(n)}),e.dataflowService=i}async setEachFeatureDefaultStyle(e){let t=this;e=$o.isArray(e)||e instanceof Km()?e:[e];for(let r=0;r<e.length;r++){const i=e[r];let s=i.getGeometry().getType().toUpperCase(),n=i.getProperties().useStyle;if(n){"POINT"===s&&n.text&&(s="TEXT");let e=t.setFeatureInfo(i);i.setProperties({useStyle:n,attributes:e}),"POINT"===s&&n.src&&-1===n.src.indexOf("http://")&&-1===n.src.indexOf("https://")&&(n.src=t.server+n.src)}else n=xl.getMarkerDefaultStyle(s,t.server);i.setStyle(await xl.toOpenLayersStyle(n,s))}}setFeatureInfo(e){let t=e.get("attributes"),r=Object.assign({dataViz_title:"",dataViz_description:"",dataViz_imgUrl:"",dataViz_url:""},t),i=e.getProperties();for(let e in r)i[e]&&(r[e]=i[e],delete i[e]);return r}async createRankSymbolLayer(e,t){let r=await this.createRankStyleSource(e,t,e.featureType),i=new Um.Vector({styleSource:r,source:new(qo())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1}),renderMode:"image"});return i.setStyle(e=>{let t=i.get("styleSource"),r=t.parameters.themeSetting.themeField,s=Number(e.get("attributes")[r]),n=t.styleGroups;for(let e=0,r=n.length;e<r;e++)if(s>=n[e].start&&s<n[e].end)return t.styleGroups[e].olStyle}),i}async createRankStyleSource(e,t,r){let i=e.themeSetting.themeField,s=await this.getRankStyleGroup(i,t,e,r);return!!s&&{parameters:e,styleGroups:s}}async getRankStyleGroup(e,t,r,i){let s=[],n=[],a=r.style,o=r.themeSetting,l=o.segmentMethod||this.defaultParameters.themeSetting.segmentMethod,h=o.segmentCount||this.defaultParameters.themeSetting.segmentCount,u=o.customSettings,c=r.themeSetting.minRadius,d=r.themeSetting.maxRadius,p=a.fillColor,f=r.themeSetting.colors;t.forEach(t=>{let r=t.get("attributes")[e];null!=r&&$o.isNumber(r)&&s.push(Number(r))});try{n=Vn.getArraySegments(s,l,h)}catch(e){console.error(e)}for(let e=0;e<h;e++)if(e in u){let t=u[e].segment.start,r=u[e].segment.end;null!=t&&(n[e]=t),null!=r&&(n[e+1]=r)}let y=[];if(n&&n.length){let e,t,r=n.length,s=(d-c)/(r-1),o=Number(((d+c)/2).toFixed(2)),l=f?Un.getGradientColors(f,r,"RANGE"):[];for(let h=0;h<r-1;h++){o=(e=Number(n[h].toFixed(2)))===(t=Number(n[h+1].toFixed(2)))?o:c+Math.round(s*h),t=h===r-2?t+.01:t,o=u[h]&&u[h].radius?u[h].radius:o,a.radius=o,a.fillColor=u[h]&&u[h].color?u[h].color:l[h]||p;let d=await xl.getOpenlayersStyle(a,i,!0);y.push({olStyle:d,radius:o,start:e,end:t,fillColor:a.fillColor})}return y}return!1}checkUploadToRelationship(e){let t=this.getRequestUrl(`${this.server}web/datas/${e}/datasets.json`);return Ue.get(t,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){return e})}getDatasources(e){let t=this.getRequestUrl(`${e}/data/datasources.json`);return Ue.get(t,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){return e.datasourceNames[0]})}getDataService(e,t){let r=this.getRequestUrl(`${this.server}web/datas/${e}.json`);return Ue.get(r,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(r){return r.fileId=e,r.datasetName=t,r})}getRequestUrl(e,t){if(e=t?e:this.formatUrlWithCredential(e),!this.excludePortalProxyUrl)return te.isInTheSameDomain(e)||this.isIportalProxyServiceUrl(e)?e:`${this.getProxy()}${encodeURIComponent(e)}`}formatUrlWithCredential(e){return this.credentialValue&&(e=-1===e.indexOf("?")?`${e}?${this.credentialKey}=${this.credentialValue}`:`${e}&${this.credentialKey}=${this.credentialValue}`),e}getProxy(e){return e||(e="json"),this.proxy||this.server+`apps/viewer/getUrlResource.${e}?url=`}getTileLayerInfo(e){let t=this,r=t.baseProjection.split("EPSG:")[1],i=t.getRequestUrl(`${e}/maps.json`);return Ue.get(i,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){let i=[];return e&&e.forEach(function(e){let s=t.getRequestUrl(`${e.path}.json?prjCoordSys=${encodeURI(JSON.stringify({epsgCode:r}))}`),n=Ue.get(s,null,{withCredentials:t.withCredentials}).then(function(e){return e.json()}).then(function(t){return t.url=e.path,t});i.push(n)}),Promise.all(i).then(function(e){return e})})}addProjctionFromWKT(e,t){if("string"!=typeof e)return!1;if("EPSG:4326"===e||"EPSG:3857"===e)return!0;{let r=t||this.getEpsgInfoFromWKT(e);return!!r&&(wd.defs(r,e),Gm&&Gm.register?Gm.register(wd):window.ol.proj&&window.ol.proj.setProj4&&window.ol.proj.setProj4(wd),!0)}}getEpsgInfoFromWKT(e){if("string"!=typeof e)return!1;if(0===e.indexOf("EPSG"))return e;{let t=e.lastIndexOf("AUTHORITY")+10,r=e.indexOf("]",t)-1;return t>0&&r>0&&`EPSG:${e.substring(t,r).split(",")[1].substr(1)}`}}createMigrationLayer(e,t){window.ol3Echarts.prototype.getContainer||(window.ol3Echarts.prototype.getContainer=function(){return this.$container}),window.ol3Echarts.prototype.setVisible||(window.ol3Echarts.prototype.setVisible=function(e){if(e){let e=this.get("options");e&&(this.setChartOptions(e),this.unset("options"))}else{let e=this.getChartOptions();this.set("options",e),this.clear(),this.setChartOptions({})}}),window.ol3Echarts.prototype.setZIndex||(window.ol3Echarts.prototype.setZIndex=function(e){let t=this.getContainer();t&&(t.style.zIndex=e)}),window.ol3Echarts.prototype.setCursor||(window.ol3Echarts.prototype.setCursor=function(e="default"){let t=this.getContainer();t&&"default"===e&&t.classList.add("cursor-default")});let r=Ld(t),i=this.createLinesData(e,r),s=this.createPointsData(i,e,r),n=this.createOptions(e,i,s),a=new window.ol3Echarts(n,{hideOnMoving:!1,hideOnZooming:!1,forcedPrecomposeRerender:!0});return a.type="ECHARTS",a}createOptions(e,t,r){let i,s=this.createLineSeries(e,t);if(r&&r.length){let t=this.createPointSeries(e,r);i=s.concat(t)}else i=s.slice();return{series:i}}createLineSeries(e,t){let r=e.lineSetting,i=e.animationSetting,s=[{name:"line-series",type:"lines",zlevel:1,silent:!0,effect:{show:i.show,constantSpeed:i.constantSpeed,trailLength:0,symbol:i.symbol,symbolSize:i.symbolSize},lineStyle:{normal:{color:r.color,type:r.type,width:r.width,opacity:r.opacity,curveness:r.curveness}},data:t}];return t.length>rg&&(s[0].blendMode="lighter"),s}createPointSeries(e,t){let r=e.lineSetting,i=e.animationSetting,s=e.labelSetting,n=[{name:"point-series",coordinateSystem:"geo",zlevel:2,silent:!0,label:{normal:{show:s.show,position:"right",formatter:"{b}",color:s.color,fontFamily:s.fontFamily}},itemStyle:{normal:{color:r.color||s.color}},data:t}];return i.show?(n[0].type="effectScatter",n[0].rippleEffect={brushType:"stroke"}):n[0].type="scatter",n}createPointsData(e,t,r){let i=[],s=t.labelSetting;if(!s.show||!e.length)return i;let n=[],a=[];return e.forEach((e,t)=>{let i=e.coords,o=i[0],l=i[1],h=r[t][s.from],u=r[t][s.to];!n.find(e=>e.value[0]===o[0]&&e.value[1]===o[1])&&n.push({name:h,value:o}),!a.find(e=>e.value[0]===l[0]&&e.value[1]===l[1])&&a.push({name:u,value:l})}),i=n.concat(a)}createLinesData(e,t){let r=[];if(t&&t.length){let i,s,n=e.from,a=e.to;if("XY_FIELD"===n.type&&n.xField&&n.yField&&a.xField&&a.yField)t.forEach(e=>{let t=e[n.xField],o=e[n.yField],l=e[a.xField],h=e[a.yField];t&&o&&l&&h&&(i=[e[n.xField],e[n.yField]],s=[e[a.xField],e[a.yField]],r.push({coords:[i,s]}))});else if("PLACE_FIELD"===n.type&&n.field&&a.field){const e=Im.concat(Nm);t.forEach(t=>{let o=t[n.field],l=t[a.field];i=e.find(e=>$o.isMatchAdministrativeName(e.name,o)),s=e.find(e=>$o.isMatchAdministrativeName(e.name,l)),i&&s&&r.push({coords:[i.coord,s.coord]})})}}return r}getService(e,t){return e.filter(e=>e&&e.serviceType===t)[0]}isMvt(e,t){let r=this;return this.getDatasetsInfo(e,t).then(e=>e.epsgCode==r.baseProjection.split("EPSG:")[1]?Ue.get(r.getRequestUrl(`${e.url}/tilefeature.mvt`),null,{withCredentials:r.withCredentials}).then(function(e){return e.json()}).then(function(t){return e.isMvt=t.error&&400===t.error.code,e}).catch(()=>e):e)}getDatasetsInfo(e,t){let r=this;return r.getDatasources(e).then(function(i){let s=`${e}/data/datasources/${i}/datasets/${t}.json`;return Ue.get(r.getRequestUrl(s),null,{withCredentials:r.withCredentials}).then(function(e){return e.json()}).then(function(e){return{epsgCode:e.datasetInfo.prjCoordSys.epsgCode,bounds:e.datasetInfo.bounds,url:s}})})}isRestMapMapboxStyle(e){let t=e.dataSource,r=e.layerType;return!(!(t&&"EXTERNAL"===t.type&&t.url.indexOf("/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY")>-1)||"MAPBOXSTYLE"!==r&&"VECTOR_TILE"!==r)}getMapboxStyleLayerInfo(e,t){let r=this;return new Promise((i,s)=>r.getMapLayerExtent(t).then(t=>r.getMapboxStyle(e,t).then(e=>{Object.assign(t,e),i(t)}).catch(e=>{s(e)})).catch(e=>{s(e)}))}getMapLayerExtent(e){let t=e.dataSource.url;this.isRestMapMapboxStyle(e)&&(t=t.replace("/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY","")),t=this.getRequestUrl(t+".json");let r,i,s=e.credential;return s&&(t=`${t}?${i=Object.keys(s)[0]}=${r=s[i]}`),Ue.get(t,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(e){return e.json()}).then(t=>(e.visibleScales=t.visibleScales,e.coordUnit=t.coordUnit,e.scale=t.scale,e.epsgCode=t.prjCoordSys.epsgCode,e.bounds=t.bounds,e)).catch(e=>{throw e})}getMapboxStyle(e,t){let r=this,i=t.url||t.dataSource.url,s=i;s.indexOf("/restjsr/")>-1&&(s=`${s}/style.json`),s=this.getRequestUrl(s);let n,a,o=t.credential;return o&&(a=Object.keys(o)[0],n=o[a],s=`${s}?${a}=${n}`),Ue.get(s,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(e){return e.json()}).then(s=>{r._matchStyleObject(s);let o=t.bounds;if(n){s.sprite=`${s.sprite}?${a}=${n}`;let e=s.sources;Object.keys(e).forEach(function(e){s.sources[e].tiles.forEach(function(t,r){s.sources[e].tiles[r]=`${t}?${a}=${n}`})})}let l={url:i,sourceType:"VECTOR_TILE",layerType:"VECTOR_TILE",styles:s,extent:o&&[o.left,o.bottom,o.right,o.top],bounds:t.bounds,projection:"EPSG:"+t.epsgCode,epsgCode:t.epsgCode,name:t.name};return Object.assign(t,l),t.zIndex>0&&r.modifyMapboxstyleLayer(e,t),t}).catch(e=>e)}modifyMapboxstyleLayer(e,t){let r=this;if(e.layers&&0===e.layers.length)return;let i=t.styles.layers;if(!i)return;i=i.filter(e=>"background"!==e.type),t.styles.layers=i;let s=e.layers.filter(e=>"VECTOR_TILE"===e.layerType&&e.zIndex!==t.zIndex).map(e=>e.styles&&e.styles.layers);!s||s&&0===s.length||s.forEach(e=>{i.forEach(t=>{r.renameLayerId(e,t)})})}renameLayerId(e,t){if(e.find(e=>e.id===t.id)){const r=t.id.match(/(.+)\((\w)\)$/);r?t.id=`${r[1]}(${+r[2]+1})`:t.id+="(1)",e.find(e=>e.id===t.id)&&this.renameLayerId(e,t)}}_matchStyleObject(e){let{sprite:t,glyphs:r}=e;t&&"object"==typeof t&&(e.sprite=Object.values(t)[0]),r&&"object"==typeof r&&(e.glyphs=Object.values(r)[0])}isIportalProxyServiceUrl(e){if(this.serviceProxy&&this.serviceProxy.enable&&e){let t="";return this.serviceProxy.proxyServerRootUrl?t=`${this.serviceProxy.proxyServerRootUrl}/`:this.serviceProxy.rootUrlPostfix?t=`${this.serviceProxy.port}/${this.serviceProxy.rootUrlPostfix}/`:this.serviceProxy.rootUrlPostfix||(t=`${this.serviceProxy.port}/`),80!==this.serviceProxy.port?e.indexOf(t)>=0:e.indexOf(t)>=0||e.indexOf(t.replace(":80",""))>=0}return!1}getStyleResolutions(e,t=0,r=22){let i=[];let s=Math.abs(e.left-e.right)/512;for(let e=t;e<=r;e++)0!==e?(s/=2,i[e]=s):i[e]=s;return i}createVisibleResolution(e,t,r,i){let s=[];if(e&&e.length>0)s=e.map(e=>{let t=1/e;return this.getResFromScale(t,i)});else{let e=this.getEnvelope(t,r);s=this.getStyleResolutions(e)}return s}getEnvelope(e,t){let r={};return e&&4===e.length?(r.left=e[0],r.bottom=e[1],r.right=e[2],r.top=e[3]):r=t,r}createMVTLayer(e){let t=e.styles;const r=t&&t.metadata&&t.metadata.indexbounds,i=this.createVisibleResolution(e.visibleScales,r,e.bounds,e.coordUnit),s=this.getEnvelope(r,e.bounds),n=this.getStyleResolutions(s);let a=this.isIportalProxyServiceUrl(t.sprite),o=new sm({style:t,source:t.name,resolutions:n,map:this.map,withCredentials:a});return new Promise(r=>{o.on("styleloaded",function(){let s=i[i.length-1],n=i[0],l=new Um.VectorTile({declutter:!0,source:new Ep({style:t,withCredentials:a,projection:e.projection,format:new(Tp())({featureClass:Qm()}),wrapX:!1}),style:o.featureStyleFuntion,visible:e.visible,zIndex:e.zIndex,opacity:e.opacity,minResolution:s,maxResolution:n>1?Math.ceil(n):1.1*n});r(l)})})}isSupportWebp(e,t){let r;return!(this.isIE()||this.isFirefox()&&this.getFirefoxVersion()<65||this.isChrome()&&this.getChromeVersion()<32)&&(e=t?`${e}/tileImage.webp?token=${t}`:`${e}/tileImage.webp`,r=!(te.isInTheSameDomain(e)&&!t),e=this.getRequestUrl(e,r),Ue.get(e,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0}).then(function(e){if(200!==e.status)throw e.status;return e}).then(()=>!0).catch(()=>!1))}isIE(){return!!(window.ActiveXObject||"ActiveXObject"in window)}isFirefox(){return navigator.userAgent.indexOf("Firefox")>-1}isChrome(){return navigator.userAgent.indexOf("Chrome")>-1}getFirefoxVersion(){return+navigator.userAgent.toLowerCase().match(/firefox\/([\d.]+)/)[1]}getChromeVersion(){return+navigator.userAgent.toLowerCase().match(/chrome\/([\d.]+)/)[1]}addGraticule(e){if(this.isHaveGraticule){this.createGraticuleLayer(e.grid.graticule),this.layerAdded++;const t=e.layers?e.layers.length:0;this.sendMapToUser(t)}}createGraticuleLayer(e){const{strokeColor:t,strokeWidth:r,lineDash:i,extent:s,visible:n,interval:a,lonLabelStyle:o,latLabelStyle:l}=e,h=this.baseProjection;let u=new Mo.get(h);u.setExtent(s),u.setWorldExtent(Mo.transformExtent(s,h,"EPSG:4326"));let c={layerID:"graticule_layer",strokeStyle:new(yl())({color:t,width:r,lineDash:i}),extent:s,visible:n,intervals:a,showLabels:!0,zIndex:9999,wrapX:!1,targetSize:0};o&&(c.lonLabelStyle=new(gl())({font:`${o.fontSize} ${o.fontFamily}`,textBaseline:o.textBaseline,fill:new(pl())({color:o.fill}),stroke:new(yl())({color:o.outlineColor,width:o.outlineWidth})})),l&&(c.latLabelStyle=new(gl())({font:`${l.fontSize} ${l.fontFamily}`,textBaseline:l.textBaseline,fill:new(pl())({color:l.fill}),stroke:new(yl())({color:l.outlineColor,width:l.outlineWidth})}));const d=new Um.Graticule(c);this.map.addLayer(d)}getLang(){if(this.getCookie("language")){const e=this.getCookie("language");return this.formatCookieLang(e)}return navigator.language||navigator.browserLanguage}getCookie(e){e=e.toLowerCase();let t=null;return document.cookie.split(";").forEach(function(r){const i=r.split("=");i[0].toLowerCase().trim()!==e||(t=i[1].trim())}),t}formatCookieLang(e){let t;switch(e){case"zh":t="zh-CN";break;case"ar":t="ar-EG";break;case"bg":t="bg-BG";break;case"ca":t="ca-ES";break;case"cs":t="cs-CZ";break;case"da":t="da-DK";break;case"de":t="de-DE";break;case"el":t="el-GR";break;case"es":t="es-ES";break;case"et":t="et-EE";break;case"fa":t="fa-IR";break;case"fl":t="fi-FI";break;case"fr":t="fr-FR";break;case"he":t="he-IL";break;case"hu":t="hu-HU";break;case"id":t="id-ID";break;case"is":t="is-IS";break;case"it":t="it-IT";break;case"ja":t="ja-JP";break;case"ko":t="ko-KR";break;case"ku":t="ku-IQ";break;case"mn":t="mn-MN";break;case"nb":t="nb-NO";break;case"ne":t="ne-NP";break;case"nl":t="nl-NL";break;case"pl":t="pl-PL";break;case"pt":t="pt-PT";break;case"ru":t="ru-RU";break;case"sk":t="sk-SK";break;case"sl":t="sl-SI";break;case"sr":t="sr-RS";break;case"sv":t="sv-SE";break;case"th":t="th-TH";break;case"tr":t="tr-TR";break;case"uk":t="uk-UA";break;case"vi":t="vi-VN";break;default:t="en-US"}return t}isCustomProjection(e){return $o.isNumber(e)?[-1e3,-1].includes(+e):["EPSG:-1000","EPSG:-1"].includes(e)}handleJSONSuffix(e){if(!e.includes(".json"))if(e.includes("?")){let t=e.split("?");t[0]=t[0]+".json",e=t.join("?")}else e+=".json";return e}}class ag extends(Ul()){constructor(e){(e=e||{}).format=e.format||"png",e.transparent=void 0===e.transparent||!0===e.transparent,e.cacheEnabled=void 0===e.cacheEnabled||!0===e.cacheEnabled;var t=e.attributions||"Map Data <span>© SuperMap iServer</span>",r=function(e,t){var r=te.urlPathAppend(e,`/collections/${t.collectionId}/tile.${t.format}?x={x}&y={y}&z={z}`),i=function(e){var t={};t.transparent=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(","));return t}(t);r=te.urlAppend(r,function(e){var t=[];for(var r in e)t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")}(i)),r=Ve.appendCredential(r),t.cacheEnabled||(r+="&_t="+(new Date).getTime());return r}(e.url,e),i={...e,attributions:t,url:r};!e.tileLoadFunction&&e.tileProxy&&(i.tileLoadFunction=function(e,t){e.getImage().src=s.tileProxy+encodeURIComponent(t)}),super(i);var s=this;this.options=e,e.tileProxy&&(this.tileProxy=e.tileProxy)}}class og{constructor(e,t,r){this.MapService=e,this.url=t,this.options=r,this.CLASS_NAME="SuperMap.InitMapServiceBase"}createMapService(){const e=this.MapService,t=this.url,r=this.options;return new e(t,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,projection:r.projection})}getMapInfo(e){return new Promise((t,r)=>{this.createMapService().getMapInfo(i=>{e(i,t,r)})})}getWKT(){return new Promise((e,t)=>{this.createMapService().getWKT(r=>{try{const i=r.result.data;e(i)}catch(e){t(e)}})})}}const lg=ol.layer.Tile;var hg=r.n(lg);function ug(e,t=22){let{bounds:r,dpi:i,center:s,visibleScales:n,scale:a,coordUnit:o,prjCoordSys:l}=e;const h=s.x&&s.y?[s.x,s.y]:[(r.left+r.right)/2,(r.bottom+r.top)/2],u=[r.left,r.bottom,r.right,r.top];let c=$o.getProjection(l,u);var d=$o.scalesToResolutions(n,r,i,o,t);return{center:h,projection:c,zoom:$o.getZoomByResolution($o.scaleToResolution(a,i,o),d),resolutions:d}}if(window.proj4=wd,window&&window.ol){let t=window.ol;t.supermap={...e,...t.supermap},t.supermap.control=t.supermap.control||{},t.supermap.control.ChangeTileVersion=wo,t.supermap.control.Logo=Io,t.supermap.control.ScaleLine=Oo,t.supermap.StyleUtils=xl,t.supermap.Util=$o,t.source.BaiduMap=Il,t.source.ImageSuperMapRest=jl,t.source.SuperMapCloud=Vl,t.source.ImageTileSuperMapRest=ag,t.source.Tianditu=Wl,t.source.TileSuperMapRest=Ql,t.supermap.WebMap=ng,t.style.CloverShape=Hd,t.Graphic=ep,t.style.HitCloverShape=Wd,t.source.GeoFeature=lp,t.source.Theme=Vd,t.supermap.ThemeFeature=jd,t.supermap.MapboxStyles=sm,t.supermap.VectorTileStyles=_p,t.source.DataFlow=Gd,t.source.Graph=Jd,t.source.Graphic=op,t.source.HeatMap=Op,t.source.Label=hp,t.source.Mapv=mp,t.source.Range=gp,t.source.RankSymbol=vp,t.source.Turf=Sp,t.source.FGB=Qy,t.source.Unique=xp,t.source.VectorTileSuperMapRest=Ep,t.supermap.GraphMap=Ky,t.supermap.AddressMatchService=nm,t.supermap.ChartService=om,t.supermap.DataFlowService=Dd,t.supermap.DatasetService=um,t.supermap.DatasourceService=cm,t.supermap.FeatureService=Nd,t.supermap.FieldService=hm,t.supermap.GridCellInfosService=dm,t.supermap.GeoprocessingService=pm,t.supermap.LayerInfoService=ym,t.supermap.MapService=So,t.supermap.MeasureService=mm,t.supermap.NetworkAnalyst3DService=vm,t.supermap.NetworkAnalystService=Sm,t.supermap.ProcessingService=_m,t.supermap.QueryService=Pd,t.supermap.ServiceBase=bo,t.supermap.SpatialAnalystService=Cm,t.supermap.ThemeService=Am,t.supermap.TrafficTransferAnalystService=Tm,t.supermap.WebPrintingJobService=Em,t.supermap.ImageService=Om,t.supermap.ImageCollectionService=Pm,t.supermap.KnowledgeGraphService=Zy,t.supermap.initMap=function(e,t={}){const{mapOptions:r,viewOptions:i,layerOptions:s,sourceOptions:n}=t,a=new og(So,e,t);return a.getMapInfo(async function(t,o,l){if(!t||!t.result)return void l("service is not work!");let{prjCoordSys:h,bounds:u}=t.result;if(!(0,Mo.get)(`EPSG:${h.epsgCode}`)&&"PCS_NON_EARTH"!==h.type){const e=await a.getWKT();!function(e,t,r){const i=[r.left,r.bottom,r.right,r.top];let s=`EPSG:${e}`;if(!(0,Mo.get)(s)&&wd.defs(s,t),Gm&&Gm.register){Gm.register(wd);var n=(0,Mo.get)(s);n.setExtent(i)}}(h.epsgCode,e,u)}let c=function(e,t,r){let i=ug(e);return new(wl())({target:"map",view:new(Fm())({...i,...r}),...t})}(t.result,r,i),{layer:d,source:p}=function(e,t,r,i){let s=Ql.optionsFromMapJSON(e,t,!0);s={...s,...r};var n=new Ql(s);return{layer:new(hg())({source:n,...i}),source:n}}(e,t.result,n,s);c.addLayer(d),o({map:c,source:p,layer:d})})},t.supermap.viewOptionsFromMapJSON=ug,t.supermap.CommonUtil=te}})(),(()=>{"use strict"})()})();