| 1 |
- (()=>{var e={693:function(e){!function(t){"use strict";if(t.__disableNativeFetch||!t.fetch){a.prototype.append=function(e,t){e=i(e),t=o(t);var s=this.map[e];s||(s=[],this.map[e]=s),s.push(t)},a.prototype.delete=function(e){delete this.map[i(e)]},a.prototype.get=function(e){var t=this.map[i(e)];return t?t[0]:null},a.prototype.getAll=function(e){return this.map[i(e)]||[]},a.prototype.has=function(e){return this.map.hasOwnProperty(i(e))},a.prototype.set=function(e,t){this.map[i(e)]=[o(t)]},a.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(s){this.map[s].forEach(function(r){e.call(t,r,s,this)},this)},this)};var s={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},r=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},c.call(d.prototype),c.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new a(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var n=[301,302,303,307,308];m.redirect=function(e,t){if(-1===n.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},t.Headers=a,t.Request=d,t.Response=m,t.fetch=function(e,t){return new Promise(function(r,n){var i;i=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t);var o=new XMLHttpRequest;var l=!1;function u(){if(4===o.readyState){var e=1223===o.status?204:o.status;if(e<100||e>599){if(l)return;return l=!0,void n(new TypeError("Network request failed"))}var t={status:e,statusText:o.statusText,headers:function(e){var t=new a;return e.getAllResponseHeaders().trim().split("\n").forEach(function(e){var s=e.trim().split(":"),r=s.shift().trim(),n=s.join(":").trim();t.append(r,n)}),t}(o),url:"responseURL"in o?o.responseURL:/^X-Request-URL:/m.test(o.getAllResponseHeaders())?o.getResponseHeader("X-Request-URL"):void 0},s="response"in o?o.response:o.responseText;l||(l=!0,r(new m(s,t)))}}o.onreadystatechange=u,o.onload=u,o.onerror=function(){l||(l=!0,n(new TypeError("Network request failed")))},o.open(i.method,i.url,!0);try{"include"===i.credentials&&("withCredentials"in o?o.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 o&&s.blob&&(o.responseType="blob"),i.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0,e.exports&&(e.exports=t.fetch)}function i(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 o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){this.map={},e instanceof a?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 u(e){return new Promise(function(t,s){e.onload=function(){t(e.result)},e.onerror=function(){s(e.error)}})}function h(e){var t=new FileReader;return t.readAsArrayBuffer(e),u(t)}function c(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(s.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(s.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!s.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},s.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(h)},this.text=function(){var e,t,s,r,n,i,o,a=l(this);if(a)return a;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,s=new FileReader,r=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",n=/charset\=[0-9a-zA-Z\-\_]*;?/,i=e.type.match(n)||r.match(n),o=[e],i&&o.push(i[0].replace(/^charset\=/,"").replace(/;$/,"")),s.readAsText.apply(s,o),u(s);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)},s.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(e,t){var s,n,i=(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 a(e.headers)),this.method=e.method,this.mode=e.mode,i||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new a(t.headers)),this.method=(s=t.method||this.method||"GET",n=s.toUpperCase(),r.indexOf(n)>-1?n:s),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i,t)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var s=e.split("="),r=s.shift().replace(/\+/g," "),n=s.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(n))}}),t}function m(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 a?t.headers:new a(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:this)},144:function(e,t){var s,r,n;r=[t,e],void 0===(n="function"==typeof(s=function(e,t){"use strict";var s={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function n(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],i=e,o=t.timeout||s.timeout,a=t.jsonpCallback||s.jsonpCallback,l=void 0;return new Promise(function(s,u){var h=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=a+"_"+h;window[h]=function(e){s({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),n(c),r(h)},i+=-1===i.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",""+i+a+"="+h),t.charset&&d.setAttribute("charset",t.charset),d.id=c,document.getElementsByTagName("head")[0].appendChild(d),l=setTimeout(function(){u(new Error("JSONP request to "+e+" timed out")),r(h),n(c),window[h]=function(){r(h)}},o),d.onerror=function(){u(new Error("JSONP request to "+e+" failed")),r(h),n(c),l&&clearTimeout(l)}})}})?s.apply(t,r):s)||(e.exports=n)},107:function(e,t,s){!function(){"use strict";function e(e){var t=this.constructor;return this.then(function(s){return t.resolve(e()).then(function(){return s})},function(s){return t.resolve(e()).then(function(){return t.reject(s)})})}function t(e){return new this(function(t,s){if(!e||void 0===e.length)return s(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var n=r.length;function i(e,s){if(s&&("object"==typeof s||"function"==typeof s)){var o=s.then;if("function"==typeof o)return void o.call(s,function(t){i(e,t)},function(s){r[e]={status:"rejected",reason:s},0==--n&&t(r)})}r[e]={status:"fulfilled",value:s},0==--n&&t(r)}for(var o=0;o<r.length;o++)i(o,r[o])})}var r=setTimeout;function n(e){return Boolean(e&&void 0!==e.length)}function i(){}function o(e){if(!(this instanceof o))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 a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var s=1===e._state?t.onFulfilled:t.onRejected;if(null!==s){var r;try{r=s(e._value)}catch(e){return void u(t.promise,e)}l(t.promise,r)}else(1===e._state?l:u)(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 s=t.then;if(t instanceof o)return e._state=3,e._value=t,void h(e);if("function"==typeof s)return void c((r=s,n=t,function(){r.apply(n,arguments)}),e)}e._state=1,e._value=t,h(e)}catch(t){u(e,t)}var r,n}function u(e,t){e._state=2,e._value=t,h(e)}function h(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,s=e._deferreds.length;t<s;t++)a(e,e._deferreds[t]);e._deferreds=null}function c(e,t){var s=!1;try{e(function(e){s||(s=!0,l(t,e))},function(e){s||(s=!0,u(t,e))})}catch(e){if(s)return;s=!0,u(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var s=new this.constructor(i);return a(this,new function(e,t,s){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=s}(e,t,s)),s},o.prototype.finally=e,o.all=function(e){return new o(function(t,s){if(!n(e))return s(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var i=r.length;function o(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,function(t){o(e,t)},s)}r[e]=n,0==--i&&t(r)}catch(e){s(e)}}for(var a=0;a<r.length;a++)o(a,r[a])})},o.allSettled=t,o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(e){return new o(function(t,s){s(e)})},o.race=function(e){return new o(function(t,s){if(!n(e))return s(new TypeError("Promise.race accepts an array"));for(var r=0,i=e.length;r<i;r++)o.resolve(e[r]).then(t,s)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){r(e,0)},o._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!==s.g)return s.g;throw new Error("unable to locate global object")}();"function"!=typeof d.Promise?d.Promise=o:(d.Promise.prototype.finally||(d.Promise.prototype.finally=e),d.Promise.allSettled||(d.Promise.allSettled=t))}()}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,s),i.exports}s.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t}),s.d=((e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),(()=>{"use strict";class e{constructor(e,t,s){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=s,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new e(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(t,s){if(null==t||null==s)throw new TypeError("Pixel.add cannot receive null values");return new e(this.x+t,this.y+s)}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}}e.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var t={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("-"),s=t[0],r=1,n=t.length;r<n;r++){var i=t[r];s+=i.charAt(0).toUpperCase()+i.substring(1)}return s},format:function(e,s,r){s||(s=window);return e.replace(t.tokenRegEx,function(e,t){for(var n,i=t.split(/\.+/),o=0;o<i.length;o++)0==o&&(n=s),n=n[i[o]];return"function"==typeof n&&(n=r?n.apply(null,r):n()),void 0===n?"undefined":n})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(e){return t.numberRegEx.test(e)},numericIf:function(e){return t.isNumeric(e)?parseFloat(e):e}},r={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,t){var s=0;return t>0&&(s=parseFloat(e.toPrecision(t))),s},format:function(e,t,s,n){t=void 0!==t?t:0,s=void 0!==s?s:r.thousandsSeparator,n=void 0!==n?n:r.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var i=e.toString().split(".");1===i.length&&null==t&&(t=0);var o,a=i[0];if(s)for(var l=/(-?[0-9]+)([0-9]{3})/;l.test(a);)a=a.replace(l,"$1"+s+"$2");if(0==t)o=a;else{var u=i.length>1?i[1]:"0";null!=t&&(u+=new Array(t-u.length+1).join("0")),o=a+n+u}return o}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return r.limitSigDigs(this,e)});var n={bind:function(e,t){var s=Array.prototype.slice.apply(arguments,[2]);return function(){var r=s.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,r)}},bindAsEventListener:function(e,t){return function(s){return e.call(t,s||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}};class i{constructor(){this.CLASS_NAME="SuperMap.Geometry",this.id=l.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 i}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 o=function(){var e,t="",s="",r="pc",n=navigator.userAgent.toLowerCase();return n.indexOf("msie")>-1||n.indexOf("trident")>-1&&n.indexOf("rv")>-1?(t="msie",e=n.match(/msie ([\d.]+)/)||n.match(/rv:([\d.]+)/)):n.indexOf("chrome")>-1?(t="chrome",e=n.match(/chrome\/([\d.]+)/)):n.indexOf("firefox")>-1?(t="firefox",e=n.match(/firefox\/([\d.]+)/)):n.indexOf("opera")>-1?(t="opera",e=n.match(/version\/([\d.]+)/)):n.indexOf("safari")>-1&&(t="safari",e=n.match(/version\/([\d.]+)/)),s=e?e[1]:"",n.indexOf("ipad")>-1||n.indexOf("ipod")>-1||n.indexOf("iphone")>-1?r="apple":n.indexOf("android")>-1&&(s=(e=n.match(/version\/([\d.]+)/))?e[1]:"",r="android"),{name:t,version:s,device:r}}(),a=function(){var e=!0,t=o;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}(),l=(function(){var e=navigator.userAgent.toLowerCase();-1===e.indexOf("webkit")&&e.indexOf("gecko")}(),{assign(e){for(var t=0;t<Object.getOwnPropertyNames(arguments).length;t++){var s=Object.getOwnPropertyNames(arguments)[t];if("caller"!=s&&"callee"!=s&&"length"!=s&&"arguments"!=s){var r=arguments[s];if(r)for(var n=0;n<Object.getOwnPropertyNames(r).length;n++){var i=Object.getOwnPropertyNames(r)[n];"caller"!=s&&"callee"!=s&&"length"!=s&&"arguments"!=s&&(e[i]=r[i])}}}return e},extend:function(e,t){if(e=e||{},t){for(var s in t){var r=t[s];void 0!==r&&(e[s]=r)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},copy:function(e,t){var s;if(e=e||{},t)for(var r in e)void 0!==(s=t[r])&&(e[r]=s)},reset:function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"==typeof e[t]&&e[t]instanceof Array){for(var s in e[t])e[t][s].destroy&&e[t][s].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,s=arguments.length;t<s;t++){var r=arguments[t];if("string"==typeof r&&(r=document.getElementById(r)),1===arguments.length)return r;e.push(r)}return e},isElement:function(e){return!(!e||1!==e.nodeType)},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},removeItem:function(e,t){for(var s=e.length-1;s>=0;s--)e[s]===t&&e.splice(s,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var s=0,r=e.length;s<r;s++)if(e[s]===t)return s;return-1},modifyDOMElement:function(e,t,s,r,n,i,o,a){t&&(e.id=t),s&&(e.style.left=s.x+"px",e.style.top=s.y+"px"),r&&(e.style.width=r.w+"px",e.style.height=r.h+"px"),n&&(e.style.position=n),i&&(e.style.border=i),o&&(e.style.overflow=o),parseFloat(a)>=0&&parseFloat(a)<1?(e.style.filter="alpha(opacity="+100*a+")",e.style.opacity=a):1===parseFloat(a)&&(e.style.filter="",e.style.opacity="")},applyDefaults:function(e,t){e=e||{};var s="function"==typeof window.Event&&t instanceof window.Event;for(var r in t)(void 0===e[r]||!s&&t.hasOwnProperty&&t.hasOwnProperty(r)&&!e.hasOwnProperty(r))&&(e[r]=t[r]);return!s&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var s in e){var r,n=e[s];if(null!=n&&"function"!=typeof n)r=Array.isArray(n)||"[object Object]"===n.toString()?encodeURIComponent(JSON.stringify(n)):encodeURIComponent(n),t.push(encodeURIComponent(s)+"="+r)}return t.join("&")},urlAppend:function(e,t){var s=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var r=(e+" ").split(/[?&]/);s+=" "===r.pop()?t:r.length?"&"+t:"?"+t}return s},urlPathAppend:function(e,t){let s=e;if(!t)return s;0===t.indexOf("/")&&(t=t.substring(1));const r=e.split("?");return r[0].indexOf("/",r[0].length-1)<0&&(r[0]+="/"),s=`${r[0]}${t}${r.length>1?`?${r[1]}`:""}`},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=l.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 s="";if(t.contains(e,"?")){var r=e.indexOf("?")+1,n=t.contains(e,"#")?e.indexOf("#"):e.length;s=e.substring(r,n)}for(var i={},o=s.split(/[&;]/),a=0,l=o.length;a<l;++a){var u=o[a].split("=");if(u[0]){var h=u[0];try{h=decodeURIComponent(h)}catch(e){h=unescape(h)}var c=(u[1]||"").replace(/\+/g," ");try{c=decodeURIComponent(c)}catch(e){c=unescape(c)}1==(c=c.split(",")).length&&(c=c[0]),i[h]=c}}return i},lastSeqID:0,createUniqueID:function(e){return null==e&&(e="id_"),l.lastSeqID+=1,e+l.lastSeqID},normalizeScale:function(e){return e>1?1/e:e},getResolutionFromScale:function(e,t){var s;e&&(null==t&&(t="degrees"),s=1/(l.normalizeScale(e)*u[t]*96));return s},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*u[t]*96},getBrowser:function(){return o},isSupportCanvas:a,supportCanvas:function(){return l.isSupportCanvas},isInTheSameDomain:function(e){if(!e)return!0;var t=e.indexOf("//"),s=document.location.toString(),r=s.indexOf("//");if(-1===t)return!0;var n,i=n=e.substring(0,t),o=s.substring(r+2);r=o.indexOf("/");var a=o.indexOf(":"),l=o.substring(0,r),u=document.location.protocol;if(-1!==a||(l+=":"+("http:"===u.toLowerCase()?80:443)),u.toLowerCase()!==i.toLowerCase())return!1;var h=(i=e.substring(t+2)).indexOf(":");t=i.indexOf("/");var c,d=i.substring(0,t);return-1!==h?c=i.substring(0,h):(c=i.substring(0,t),d+=":"+("http:"===n.toLowerCase()?80:443)),c===document.domain&&d===l},calculateDpi:function(e,t,s,r,n){if(e&&t&&s){var i,o=e.getWidth(),a=e.getHeight(),l=t.w,u=t.h;if(n=n||6378137,"degree"===(r=r||"degrees").toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()){let e=o/l,t=a/u;i=254/(e>t?e:t)/s/(2*Math.PI*n/360)/1e4}else{i=254/(o/l)/s/1e4}return i}},toJSON:function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return t=(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var s="",r=0,n=t.length;r<n;r++)s+=l.toJSON(t[r]),r!==t.length-1&&(s+=",");return"["+s+"]";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 s=0,r=t.length;s<r;s++)e.push(l.toJSON(t[s]));return"["+e.join(",")+"]"}let e=[];for(let s in t)"function"!=typeof t[s]&&"CLASS_NAME"!==s&&"parent"!==s&&e.push("'"+s+"':"+l.toJSON(t[s]));return e.length>0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,s,r){return r=r||6378137,s=s||"",e>0&&t>0?(e=l.normalizeScale(e),"degree"===s.toLowerCase()||"degrees"===s.toLowerCase()||"dd"===s.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,s,r){return r=r||6378137,s=s||"",e>0&&t>0?"degree"===s.toLowerCase()||"degrees"===s.toLowerCase()||"dd"===s.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4:-1},transformResult:function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},copyAttributes:function(e,t){if(e=e||{},t)for(var s in t){var r=t[s];void 0!==r&&"CLASS_NAME"!==s&&"function"!=typeof r&&(e[s]=r)}return e},copyAttributesWithClip:function(e,t,s){if(e=e||{},t)for(var r in t){var n=!1;if(s&&s.length)for(var i=0,o=s.length;i<o;i++)if(r===s[i]){n=!0;break}if(!0!==n){var a=t[r];void 0!==a&&"CLASS_NAME"!==r&&"function"!=typeof a&&(e[r]=a)}}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 s={};for(var t in e)e.hasOwnProperty(t)&&(s[t]=l.cloneObject(e[t]));return s}throw new Error("Unable to copy obj! Its type isn't supported.")},lineIntersection:function(e,t,s,r){var n,o,a=null,l=(r.x-s.x)*(e.y-s.y)-(r.y-s.y)*(e.x-s.x),u=(t.x-e.x)*(e.y-s.y)-(t.y-e.y)*(e.x-s.x),h=(r.y-s.y)*(t.x-e.x)-(r.x-s.x)*(t.y-e.y);if(0!=h)o=u/h,a=(n=l/h)>=0&&o<=1&&n<=1&&o>=0?new i.Point(e.x+n*(t.x-e.x),e.y+n*(t.y-e.y)):"No Intersection";else if(0==l&&0==u){var c=Math.max(e.y,t.y),d=Math.min(e.y,t.y),p=Math.max(e.x,t.x),m=Math.min(e.x,t.x);a=(s.y>=d&&s.y<=c||r.y>=d&&r.y<=c)&&s.x>=m&&s.x<=p||r.x>=m&&r.x<=p?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,s){document.body.appendChild(s),s.style.width="auto",s.style.height="auto",e.fontSize&&(s.style.fontSize=e.fontSize),e.fontFamily&&(s.style.fontFamily=e.fontFamily),e.fontWeight&&(s.style.fontWeight=e.fontWeight),s.style.position="relative",s.style.visibility="hidden",s.style.display="inline-block",s.innerHTML=t;var r=s.clientWidth,n=s.clientHeight;return document.body.removeChild(s),{textWidth:r,textHeight:n}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,(e,s)=>{var r;return r=t.hasOwnProperty(s)?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[s]):e,encodeURIComponent(r)}):e}}),u={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};u.in=u.inches,u.degrees=u.dd,u.nmi=1852*u.m;l.extend(u,{Inch:u.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}),l.extend(u,{mm:u.Meter/1e3,cm:u.Meter/100,dm:100*u.Meter,km:1e3*u.Meter,kmi:u.nmi,fath:u.Fathom,ch:u.IntnlChain,link:u.IntnlLink,"us-in":u.inches,"us-ft":u.Foot,"us-yd":u.Yard,"us-ch":u.GunterChain,"us-mi":u.Mile,"ind-yd":u.IndianYd37,"ind-ft":u.IndianFt37,"ind-ch":791.9942845122}),u.degree=u.dd,u.meter=u.m,u.foot=u.ft,u.inch=u.inches,u.mile=u.mi,u.kilometer=u.km,u.yard=u.yd;var h={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 s=h.element(e);s.parentNode&&(!s.tagName||s.tagName.toUpperCase()!=t.toUpperCase());)s=s.parentNode;return s},observe:function(e,t,s,r){var n=l.getElement(e);if(r=r||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||n.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!n._eventCacheID){var i="eventCacheID_";n.id&&(i=n.id+"_"+i),n._eventCacheID=l.createUniqueID(i)}var o=n._eventCacheID;this.observers[o]||(this.observers[o]=[]),this.observers[o].push({element:n,name:t,observer:s,useCapture:r}),n.addEventListener?"mousewheel"===t?n.addEventListener(t,s,{useCapture:r,passive:!1}):n.addEventListener(t,s,r):n.attachEvent&&n.attachEvent("on"+t,s)},stopObservingElement:function(e){var t=l.getElement(e)._eventCacheID;this._removeElementObservers(h.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var s=e[t],r=new Array(s.element,s.name,s.observer,s.useCapture);h.stopObserving.apply(this,r)}},stopObserving:function(e,t,s,r){r=r||!1;var n=l.getElement(e),i=n._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||n.detachEvent)&&(t="keydown");var o=!1,a=h.observers[i];if(a)for(var u=0;!o&&u<a.length;){var c=a[u];if(c.name===t&&c.observer===s&&c.useCapture===r){a.splice(u,1),0==a.length&&delete h.observers[i],o=!0;break}u++}return o&&(n.removeEventListener?n.removeEventListener(t,s,r):n&&n.detachEvent&&n.detachEvent("on"+t,s)),o},unloadCache:function(){if(h&&h.observers){for(var e in h.observers){var t=h.observers[e];h._removeElementObservers.apply(this,[t])}h.observers=!1}},CLASS_NAME:"SuperMap.Event"};h.observe(window,"resize",h.unloadCache,!1);class c{constructor(e,t,s,r,n){if(this.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"],this.listeners={},this.object=e,this.element=null,this.eventTypes=[],this.eventHandler=null,this.fallThrough=r,this.includeXY=!1,this.extensions={},this.extensionCount={},this.clearMouseListener=null,l.extend(this,n),null!=s)for(var i=0,o=s.length;i<o;i++)this.addEventType(s[i]);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&&(h.stopObservingElement(this.element),this.element.hasScrollEvent&&h.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?h.stopObservingElement(this.element):(this.eventHandler=n.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=n.bind(this.clearMouseCache,this)),this.element=e;for(var t=0,s=this.BROWSER_EVENTS.length;t<s;t++){var r=this.BROWSER_EVENTS[t];this.addEventType(r),h.observe(e,r,this.eventHandler)}h.observe(e,"dragstart",h.stop)}on(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])}register(e,t,s,r){if(e in c&&!this.extensions[e]&&(this.extensions[e]=new c[e](this)),null!=s&&-1!==l.indexOf(this.eventTypes,e)){null==t&&(t=this.object);var n=this.listeners[e];n||(n=[],this.listeners[e]=n,this.extensionCount[e]=0);var i={obj:t,func:s};r?(n.splice(this.extensionCount[e],0,i),"object"==typeof r&&r.extension&&this.extensionCount[e]++):n.push(i)}}registerPriority(e,t,s){this.register(e,t,s,!0)}un(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])}unregister(e,t,s){null==t&&(t=this.object);var r=this.listeners[e];if(null!=r)for(var n=0,i=r.length;n<i;n++)if(r[n].obj===t&&r[n].func===s){r.splice(n,1);break}}remove(e){null!=this.listeners[e]&&(this.listeners[e]=[])}triggerEvent(e,t){var s=this.listeners[e];if(s&&0!=s.length){var r;null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var n=0,i=(s=s.slice()).length;n<i;n++){var o=s[n];if(void 0!=(r=o.func.apply(o.obj,[t]))&&!1===r)break}return this.fallThrough||h.stop(t,!0),r}}handleBrowserEvent(e){var t=e.type,s=this.listeners[t];if(s&&0!=s.length){var r=e.touches;if(r&&r[0]){for(var n,i=0,o=0,a=r.length,l=0;l<a;++l)i+=(n=r[l]).clientX,o+=n.clientY;e.clientX=i/a,e.clientY=o/a}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(t){if(this.includeXY?this.element.hasScrollEvent||(h.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var s=l.getViewportElement();this.element.scrolls=[s.scrollLeft,s.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=l.pagePosition(this.element)),new e(t.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],t.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])}}c.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"];const d=function(){try{return elasticsearch}catch(e){return{}}}();var p=s.n(d);s(107),s(693);var m=s(144),f=s.n(m);let y=window.fetch;var g,v,S={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=l.toJSON(e[t]));var s=encodeURIComponent(e[t]);this.queryValues.push(s)}},issue:function(e){for(var t=this,s=t.getUid(),r=e.url,n=[],i=r,o=0,a=t.queryKeys?t.queryKeys.length:0,l=0;l<a;l++)if(i.length+t.queryKeys[l].length+2>=t.limitLength){if(0==o)return!1;n.push(i),i=r,o=0,l--}else if(i.length+t.queryKeys[l].length+2+t.queryValues[l].length>t.limitLength)for(var u=t.queryValues[l];u.length>0;){var h=t.limitLength-i.length-t.queryKeys[l].length-2;i.indexOf("?")>-1?i+="&":i+="?";var c=u.substring(0,h);"%"===c.substring(h-1,h)?(h-=1,c=u.substring(0,h)):"%"===c.substring(h-2,h-1)&&(h-=2,c=u.substring(0,h)),i+=t.queryKeys[l]+"="+c,u=u.substring(h),c.length>0&&(n.push(i),i=r,o=0)}else o++,i.indexOf("?")>-1?i+="&":i+="?",i+=t.queryKeys[l]+"="+t.queryValues[l];return n.push(i),t.send(n,"SuperMapJSONPCallbacks_"+s,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,s){var r=e.length;if(r>0)return new Promise(n=>{for(var i=(new Date).getTime(),o=0;o<r;o++){var a=e[o];a.indexOf("?")>-1?a+="&":a+="?",a+="sectionCount="+r,a+="§ionIndex="+o,a+="&jsonpUserID="+i,s&&(a=decodeURIComponent(a),a=s+encodeURIComponent(a)),f()(a,{jsonpCallbackFunction:t,timeout:3e4}).then(e=>{n(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)}},E=function(){return v||45e3},b={commit:function(e,t,s,r){switch(e=e?e.toUpperCase():e){case"GET":return this.get(t,s,r);case"POST":return this.post(t,s,r);case"PUT":return this.put(t,s,r);case"DELETE":return this.delete(t,s,r);default:return this.get(t,s,r)}},supportDirectRequest:function(e,t){return!!l.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:(void 0!=g?g:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest)||t.proxy)},get:function(e,t,s){s=s||{};if(e=l.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,s),!this.supportDirectRequest(e,s)){var r={url:e=e.replace(".json",".jsonp"),data:t};return S.GET(r)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,s):this._fetch(e,t,s,"GET")},delete:function(e,t,s){s=s||{};if(e=l.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,s),!this.supportDirectRequest(e,s)){e=e.replace(".json",".jsonp");var r={url:e+="&_method=DELETE",data:t};return S.DELETE(r)}return this.urlIsLong(e)?this._postSimulatie("DELETE",e.substring(0,e.indexOf("?")),t,s):this._fetch(e,t,s,"DELETE")},post:function(e,t,s){if(s=s||{},e=this._processUrl(e,s),!this.supportDirectRequest(e,s)){e=e.replace(".json",".jsonp");var r={url:l.urlAppend(e,"_method=POST"),data:t};return S.POST(r)}return this._fetch(e,t,s,"POST")},put:function(e,t,s){if(s=s||{},e=this._processUrl(e,s),!this.supportDirectRequest(e,s)){e=e.replace(".json",".jsonp");var r={url:e+="&_method=PUT",data:t};return S.PUT(r)}return this._fetch(e,t,s,"PUT")},urlIsLong:function(e){for(var t=0,s=null,r=0,n=e.length;r<n;r++)(s=e.charCodeAt(r))<127?t++:128<=s&&s<=2047?t+=2:2048<=s&&s<=65535&&(t+=3);return!(t<2e3)},_postSimulatie:function(e,t,s,r){return t+=(t.indexOf("?")>-1?"&":"?")+"_method="+e,"string"!=typeof s&&(s=JSON.stringify(s)),this.post(t,s,r)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var s=e.split("?");2===s.length&&(e=s[0]+".json?"+s[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,s,r){return(s=s||{}).headers=s.headers||{},s.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(s.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),s.timeout?this._timeout(s.timeout,y(e,{method:r,headers:s.headers,body:"PUT"===r||"POST"===r?t:void 0,credentials:this._getWithCredentials(s),mode:"cors",timeout:E()}).then(function(e){return e})):y(e,{method:r,body:"PUT"===r||"POST"===r?t:void 0,headers:s.headers,credentials:this._getWithCredentials(s),mode:"cors",timeout:E()}).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||{},f()(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(s,r){setTimeout(function(){r(new Error("timeout"))},e),t.then(s,r)})},_getParameterString:function(e){var t=[];for(var s in e){var r,n=e[s];if(null!=n&&"function"!=typeof n)r=Array.isArray(n)||"[object Object]"===n.toString()?encodeURIComponent(JSON.stringify(n)):encodeURIComponent(n),t.push(encodeURIComponent(s)+"="+r)}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class C{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}}C.CREDENTIAL=null;class w{static generateToken(e,t){var s=this.servers[e];if(s)return b.post(s.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(e){return e.text()})}static registerServers(e){this.servers=this.servers||{},l.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var s=e[t];this.servers[s.server]=s}}static registerToken(e,t){if(this.tokens=this.tokens||{},e&&t){var s=this._getTokenStorageKey(e);this.tokens[s]=t}}static registerKey(e,t){if(this.keys=this.keys||{},e&&!(e.length<1)&&t){e=l.isArray(e)?e:[e];for(var s=0;s<e.length;s++){var r=this._getUrlRestString(e[0])||e[0];this.keys[r]=t}}}static getServerInfo(e){return this.servers=this.servers||{},this.servers[e]}static getToken(e){if(e){this.tokens=this.tokens||{};var t=this._getTokenStorageKey(e);return this.tokens[t]}}static getKey(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;return this.keys[t]}static loginiServer(e,t,s,r){e=l.urlPathAppend(e,"services/security/login");var n={username:t&&t.toString(),password:s&&s.toString(),rememberme:r};n=JSON.stringify(n);return b.post(e,n,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then(function(e){return e.json()})}static logoutiServer(e){e=l.urlPathAppend(e,"services/security/logout");return b.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 s=w.SSO+"/login?service="+e;this._open(s,t)}static loginiPortal(e,t,s){e=l.urlPathAppend(e,"web/login");var r={username:t&&t.toString(),password:s&&s.toString()};r=JSON.stringify(r);return b.post(e,r,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!0}).then(function(e){return e.json()})}static logoutiPortal(e){e=l.urlPathAppend(e,"services/security/logout");return b.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,s){if(l.isInTheSameDomain(e)){var r=l.urlPathAppend(e,"icloud/security/tokens"),n=t||{},i={username:n.userName&&n.userName.toString(),password:n.password&&n.password.toString()};i=JSON.stringify(i);var o=this;return b.post(r,i,{headers:{Accept:"*/*","Content-Type":"application/json"}}).then(function(e){e.text().then(function(e){return o.imanagerToken=e,e})})}var a=!s||s.isNewTab;this._open(e,a)}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,s=this.getToken(e),r=s?new C(s,"token"):null;return r||(r=(s=this.getKey(e))?new C(s,"key"):null),r&&(t=l.urlAppend(t,r.getUrlParameters())),t}static _open(e,t){t=null==t||t;var s=window.screen.availWidth/2-this.INNER_WINDOW_WIDTH/2,r=window.screen.availHeight/2-this.INNER_WINDOW_HEIGHT/2,n="height="+this.INNER_WINDOW_HEIGHT+", width="+this.INNER_WINDOW_WIDTH+",top="+r+", left="+s+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";t?window.open(e,"login"):window.open(e,"login",n)}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}}w.INNER_WINDOW_WIDTH=600,w.INNER_WINDOW_HEIGHT=600,w.SSO="https://sso.supermap.com",w.ONLINE="https://www.supermapol.com";var O={GEOJSON:"GEOJSON",ISERVER:"ISERVER",FGB:"FGB"},x={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"},T="METER",_="KILOMETER",N="DEGREE",A="INCH",P="FOOT",I={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"},L={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"},R={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},M={CLIP:"clip",INTERSECT:"intersect"},D={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"},F={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"},J={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},U={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},k={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"};class j{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&&l.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 B{constructor(e){this.type=R.UDB,this.datasetName="analystResult",this.datasourceInfo=null,this.outputPath="",l.extend(this,e),this.CLASS_NAME="SuperMap.OutputSetting"}destroy(){var e=this;e.type=null,e.datasetName=null,e.outputPath=null,e.datasourceInfo instanceof j&&(e.datasourceInfo.destroy(),e.datasourceInfo=null)}}class G{constructor(e){this.items=null,this.numericPrecision=1,this.rangeMode=I.EQUALINTERVAL,this.rangeCount="",this.colorGradientType=L.YELLOW_RED,l.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 V{constructor(e){e&&(this.datasetName="",this.query="",this.resolution=80,this.method=0,this.meshType=0,this.fields="",this.radius=300,this.meshSizeUnit=F.METER,this.radiusUnit=F.METER,this.areaUnit=D.SQUAREMILE,this.output=null,this.mappingParameters=null,l.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 B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"output"!==s?(t.analyst=t.analyst||{},"query"===s&&e[s]?t.analyst[s]=e[s].toBBOX():t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class K{constructor(e){e&&(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=x.CONTAIN,this.output=null,this.mappingParameters=null,l.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"output"!==s?(t.analyst=t.analyst||{},t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class q{constructor(e){e&&(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,l.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"output"!==s?(t.analyst=t.analyst||{},t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class H{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=J.AVERAGE,this.fields="",this.type=U.SUMMARYMESH,this.output=null,this.mappingParameters=null,l.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 B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"type"!==s?"output"!==s?("SUMMARYMESH"===e.type&&"regionDataset"!==s||"SUMMARYREGION"===e.type&&!r(["meshType","resolution","query"],s))&&(t.analyst=t.analyst||{},"query"===s&&e[s]?t.analyst[s]=e[s].toBBOX():t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):t.type=e[s]:(t.input=t.input||{},t.input[s]=e[s]);function r(e,t){for(var s=e.length;s--;)if(e[s]===t)return!0;return!1}}}class Y{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=F.METER,this.type=U.SUMMARYMESH,this.output=null,this.mappingParameters=null,l.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 B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"type"!==s&&"type"!==s?"output"!==s?("SUMMARYREGION"===e.type||"SUMMARYMESH"===e.type&&"regionDataset"!==s)&&(t.analyst=t.analyst||{},"query"===s&&e[s]?t.analyst[s]=e[s].toBBOX():t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):t.type=e[s]:(t.input=t.input||{},t.input[s]=e[s])}}class W{constructor(e){e&&(this.datasetName="",this.datasetOverlay="",this.mode="",this.srcFields="",this.overlayFields="",this.output=null,this.mappingParameters=null,l.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 B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!=s?"output"!==s?(t.analyst=t.analyst||{},t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class Q{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=F.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;l.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 B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"output"!==s?(t.analyst=t.analyst||{},"bounds"===s&&e[s]?t.analyst[s]=e[s].toBBOX():t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class z{constructor(e){e&&(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=k.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,l.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"output"!==s?(t.analyst=t.analyst||{},t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class ${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,l.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class X{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,l.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}}var Z=window.SuperMap=window.SuperMap||{};Z.REST=Z.REST||{};const ee=function(){try{return mapv}catch(e){return{}}}();var te=function(e){var t;if(e===T)t=1;else if(e===N)t=2*Math.PI*6378137/360;else if(e===_)t=.001;else if(e===A)t=1/.025399999918;else{if(e!==P)return t;t=.3048}return t};var se=ee.baiduMapLayer?ee.baiduMapLayer.__proto__:Function;class re extends se{constructor(e,t,s,r){if(super(e,s,r),!se)return this;r=r||{},this.init(r),this.argCheck(r),this.canvasLayer=t,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent()}clickEvent(e){var t=e.xy,s=this.devicePixelRatio||1;super.clickEvent({x:t.x/s,y:t.y/s},e)}mousemoveEvent(e){var t=e.xy;super.mousemoveEvent(t,e)}bindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.events.on({click:this.clickEvent}),this.options.methods.mousemove&&e.events.on({mousemove:this.mousemoveEvent}))}unbindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.events.un({click:this.clickEvent}),this.options.methods.mousemove&&e.events.un({mousemove:this.mousemoveEvent}))}getContext(){return this.canvasLayer&&this.canvasLayer.canvasContext}addData(e,t){var s=e;e&&e.get&&(s=e.get()),this.dataSet.add(s),this.update({options:t})}setData(e,t){var s=e;e&&e.get&&(s=e.get()),this.dataSet=this.dataSet||new ee.DataSet,this.dataSet.set(s),this.update({options:t})}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})}render(e){this._canvasUpdate(e)}transferToMercator(){if(this.options.coordType&&["bd09mc","coordinates_mercator"].indexOf(this.options.coordType)>-1){var e=this.dataSet.get();e=this.dataSet.transferCoordinate(e,function(e){var t=Z.Projection.transform({x:e[0],y:e[1]},"EPSG:3857","EPSG:4326");return[t.x,t.y]},"coordinates","coordinates"),this.dataSet._set(e)}}_canvasUpdate(e){if(this.canvasLayer){var t=this.options.animation,s=this.getContext(),r=this.map;if(this.isEnabledTime()){if(void 0===e)return void this.clear(s);"2d"===this.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("2d"===this.context)for(var n in this.options)s[n]=this.options[n];else s.clear(s.COLOR_BUFFER_BIT);if(!(this.options.minZoom&&r.getZoom()<this.options.minZoom||this.options.maxZoom&&r.getZoom()>this.options.maxZoom)){var i=this.canvasLayer,o={fromColumn:"coordinates",transferCoordinate:function(e){var t={lon:e[0],lat:e[1]},s=r.getViewPortPxFromLonLat(t);return[s.x,s.y]}};void 0!==e&&(o.filter=function(s){var r=t.trails||10;return e&&s.time>e-r&&s.time<e});var a=this.dataSet.get(o);this.processData(a);var l=r.getResolution()*te("DEGREE");"m"===this.options.unit?(this.options.size&&(this.options._size=this.options.size/l),this.options.width&&(this.options._width=this.options.width/l),this.options.height&&(this.options._height=this.options.height/l)):(this.options._size=this.options.size,this.options._height=this.options.height,this.options._width=this.options.width);var u=r.getViewPortPxFromLonLat(i.transferToMapLatLng({lon:0,lat:0}));this.drawContext(s,a,this.options,u),this.options.updateCallback&&this.options.updateCallback(e)}}}init(e){this.options=e,this.initDataRange(e),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}addAnimatorEvent(){this.map.events.on({movestart:this.animatorMovestartEvent.bind(this)}),this.map.events.on({moveend:this.animatorMoveendEvent.bind(this)})}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}show(){this.map.addLayer(this.canvasLayer)}hide(){this.map.removeLayer(this.canvasLayer)}draw(){this.canvasLayer.redraw()}}Z.Layer.MapVLayer=class extends Z.Layer{constructor(e,t){if(super(e,t),this.dataSet=null,this.options=null,this.supported=!1,this.canvas=null,this.canvasContext=null,t&&Z.Util.extend(this,t),this.canvas=document.createElement("canvas"),this.canvas.getContext){this.supported=!0,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.div.appendChild(this.canvas);var s=this.options&&this.options.context||"2d";this.canvasContext=this.canvas.getContext(s);var r="undefined"==typeof window?{}:window,n=this.devicePixelRatio=r.devicePixelRatio||1;"2d"===s&&this.canvasContext.scale(n,n),this.attribution="© 2018 百度 <a href='https://mapv.baidu.com' target='_blank'>MapV</a> with <span>© <a target='_blank' href='https://iclient.supermap.io' style='color: #08c;text-decoration: none;'>SuperMap iClient</a></span>",this.CLASS_NAME="SuperMap.Layer.MapVLayer"}}destroy(){this.renderer&&this.renderer.animator&&(this.renderer.animator.stop(),this.renderer.animator=null),this.dataSet=null,this.options=null,this.renderer=null,this.supported=null,this.canvas=null,this.canvasContext=null,this.maxWidth=null,this.maxHeight=null,super.destroy()}addData(e,t){this.renderer&&this.renderer.addData(e,t)}setData(e,t){this.renderer&&this.renderer.setData(e,t)}getData(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}removeData(e){this.renderer&&this.renderer.removeData(e)}clearData(){this.renderer.clearData()}setMap(e){super.setMap(e),this.renderer=new re(e,this,this.dataSet,this.options),this.renderer.devicePixelRatio=this.devicePixelRatio,this.supported?this.redraw():this.map.removeLayer(this)}moveTo(e,t,s){if(super.moveTo(e,t,s),this.supported){if(this.zoomChanged=t,!s){this.div.style.visibility="hidden",this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px",this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var r=this.map.getSize();this.div.style.width=parseInt(r.w)+"px",this.div.style.height=parseInt(r.h)+"px","heatmap"===this.options.draw?(this.canvas.width=parseInt(r.w)*this.devicePixelRatio,this.canvas.height=parseInt(r.h)*this.devicePixelRatio):(this.canvas.width=parseInt(r.w),this.canvas.height=parseInt(r.h)),this.canvas.style.width=this.div.style.width,this.canvas.style.height=this.div.style.height,this.maxWidth=r.w,this.maxHeight=r.h,this.div.style.visibility="",t||this.renderer&&this.renderer.render()}t&&this.renderer&&this.renderer.render()}}transferToMapLatLng(e){var t="EPSG:4326",s=this.map.getUnits()||"degree";return["m","meter"].indexOf(s.toLowerCase())>-1&&(t="EPSG:3857"),new Z.LonLat(e.lon,e.lat).transform("EPSG:4326",t)}};class ne{constructor(e){this.data=null,this.keepData=!1,l.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class ie extends ne{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,s,r,n=["{"];this.level+=1;var i=!1;for(t in e)e.hasOwnProperty(t)&&(s=this.write.apply(this,[t,this.pretty]),r=this.write.apply(this,[e[t],this.pretty]),null!=s&&null!=r&&(i&&n.push(","),n.push(this.writeNewline(),this.writeIndent(),s,":",this.writeSpace(),r),i=!0));return this.level-=1,n.push(this.writeNewline(),this.writeIndent(),"}"),n.join("")},array:function(e){var t,s=["["];this.level+=1;for(var r=0,n=e.length;r<n;++r)null!=(t=this.write.apply(this,[e[r],this.pretty]))&&(r>0&&s.push(","),s.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,s.push(this.writeNewline(),this.writeIndent(),"]"),s.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,s){var r=t[s];return r||(r=s.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))})+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}}}read(e,t){var s;if(this.nativeJSON)try{s=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=s),s}write(e,t){this.pretty=!!t;var s=null,r=typeof e;if(this.serialize[r])try{s=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[r].apply(this,[e])}catch(e){}return s}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 oe{constructor(e,t){let s=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,l.isArray(e)?(s.urls=e,s.length=e.length,s.totalTimes=s.length,1===s.length?s.url=e[0]:(s.index=parseInt(Math.random()*s.length),s.url=e[s.index])):(s.totalTimes=1,s.url=e),l.isArray(e)&&!s.isServiceSupportPolling()&&(s.url=e[0],s.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,l.extend(this,t),s.isInTheSameDomain=l.isInTheSameDomain(s.url),s.events=new c(s,null,s.EVENT_TYPES,!0),s.eventListeners instanceof Object&&s.events.on(s.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;l.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e._processSuccess=null,e._processFailed=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){const t=e.scope.format;if(t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let s=this;e.url=e.url||s.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=l.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||s.proxy,e.withCredentials=void 0!=e.withCredentials?e.withCredentials:s.withCredentials,e.crossOrigin=void 0!=e.crossOrigin?e.crossOrigin:s.crossOrigin,e.headers=e.headers||s.headers,e.isInTheSameDomain=s.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=w.appendCredential(e.url),s.calculatePollingTimes(),e.scope=s;var r=e.scope?e.success.bind(e.scope):e.success,n=e.scope?e.failure.bind(e.scope):e.failure;e.success=s.getUrlCompleted(r,e),e.failure=s.getUrlFailed(n,e),s._commit(e)}getUrlCompleted(e,t){return function(s){e&&e(s,t)}}getUrlFailed(e,t){const s=this;return function(r){s.totalTimes>0?(s.totalTimes--,s.ajaxPolling(t)):e&&e(r,t)}}ajaxPolling(e){let t=this,s=e.url,r=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],s=s.replace(r,r.exec(t.url)[0]),e.url=s,e.isInTheSameDomain=l.isInTheSameDomain(s),t._commit(e)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.times<e.totalTimes&&(e.totalTimes=e.times):e.totalTimes>e.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}serviceProcessCompleted(e,t){e=l.transformResult(e),this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let s=(e=l.transformResult(e)).error||e;this.events.triggerEvent("processFailed",{error:s,options:t})}_returnContent(e){return e.scope.format!==O.FGB&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[O.GEOJSON,O.ISERVER]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=l.urlAppend(e.url,l.getParameterString(e.params||{}))),"object"==typeof e.data)try{e.params=l.toJSON(e.data)}catch(e){console.log("不是json对象")}else e.params=e.data;b.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(t){let s=t;return"string"==typeof t&&(s=(new ie).read(t)),(!s||s.error||s.code>=300&&304!==s.code)&&(s=s&&s.error?{error:s.error}:{error:s}),s&&e.scope.format===O.FGB&&(s.newResourceLocation=s.newResourceLocation.replace(".json","")+".fgb"),s}).catch(function(e){return{error:e}}).then(t=>{t.error?(e.scope?n.bind(e.failure,e.scope):e.failure)(t):(t.succeed=void 0==t.succeed||t.succeed,(e.scope?n.bind(e.success,e.scope):e.success)(t))})}}class ae extends oe{constructor(e,t){super(e,t),this.options=t||{},this.eventCount=0,this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,s){t instanceof $&&this.processAsync(e,t,s)}decode(e,t,s){t instanceof X&&this.processAsync(e,t,s)}processAsync(e,t,s){let r=++this.eventCount,n={scope:this,processCompleted:function(e){if(r===e.result.eventId&&s)return delete e.result.eventId,s(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&s)return s(e),this.events&&this.events.un(n),!1}};this.events.on(n),this.request({method:"GET",url:e,params:t,scope:this,success(e,t){e.eventId=r,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=r),e.eventId=r,this.serviceProcessFailed(e,t)}})}serviceProcessCompleted(e,t){e.succeed&&delete e.succeed,super.serviceProcessCompleted(e,t)}serviceProcessFailed(e,t){super.serviceProcessFailed(e,t)}}Z.REST.AddressMatchService=class extends oe{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.REST.AddressMatchService"}code(e,t){var s=this;new ae(s.url,{headers:s.headers,proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,eventListeners:{scope:s,processCompleted:t,processFailed:t}}).code(s.url+"/geocoding",e)}decode(e,t){var s=this;new ae(s.url,{headers:s.headers,proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,eventListeners:{scope:s,processCompleted:t,processFailed:t}}).decode(s.url+"/geodecoding",e)}};class le extends oe{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,this.eventCount=0,t&&l.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();this.datasource=null,this.dataset=null}getDatasetsService(e,t){const s=l.urlPathAppend(this.url,`datasources/name/${e}/datasets`);this.processAsync(s,"GET",t)}getDatasetService(e,t,s){const r=l.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(r,"GET",s)}setDatasetService(e,t){if(!e)return;const s=l.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);delete e.datasourceName,this.processAsync(s,"PUT",t,e)}deleteDatasetService(e,t,s){const r=l.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(r,"DELETE",s)}processAsync(e,t,s,r){let n=++this.eventCount,i={scope:this,processCompleted:function(e){if(n===e.result.eventId&&s)return delete e.result.eventId,s(e),this.events&&this.events.un(i),!1},processFailed:function(e){if((n===e.error.eventId||n===e.eventId)&&s)return s(e),this.events&&this.events.un(i),!1}};this.events.on(i);var o=this;let a={url:e,method:t,scope:o,success(e,t){e.eventId=n,o.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=n),e.eventId=n,o.serviceProcessFailed(e,t)}};r&&(a.data=l.toJSON(r)),o.request(a)}}class ue{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&l.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){this.datasourceName=null,this.datasetName=null,this.datasetType=null}}class he{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&&l.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}}Z.REST.DatasetService=class extends oe{constructor(e,t){super(e,t);const s=this;this._datasetService=new le(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers}),this.CLASS_NAME="SuperMap.REST.DatasetService"}getDatasets(e,t){e&&this._datasetService.getDatasetsService(e,t)}getDataset(e,t,s){e&&t&&this._datasetService.getDatasetService(e,t,s)}setDataset(e,t){if(!(e instanceof ue||e instanceof he))return;let s;e instanceof ue?s={datasetType:e.datasetType,datasourceName:e.datasourceName,datasetName:e.datasetName}:e instanceof he&&(s={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset}),this._datasetService.setDatasetService(s,t)}deleteDataset(e,t,s){this._datasetService.deleteDatasetService(e,t,s)}};class ce extends oe{constructor(e,t){super(e,t),t&&l.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.DatasourceService"}destroy(){this.eventCount=0,super.destroy()}getDatasourceService(e,t){let s=l.urlPathAppend(this.url,`datasources/name/${e}`);this.processAsync(s,"GET",t)}getDatasourcesService(e){let t=l.urlPathAppend(this.url,"datasources");this.processAsync(t,"GET",e)}setDatasourceService(e,t){if(!e)return;const s=l.urlPathAppend(this.url,`datasources/name/${e.datasourceName}`);this.processAsync(s,"PUT",t,e)}processAsync(e,t,s,r){let n=++this.eventCount,i={scope:this,processCompleted:function(e){if(n===e.result.eventId&&s)return delete e.result.eventId,s(e),this.events&&this.events.un(i),!1},processFailed:function(e){if((n===e.error.eventId||n===e.eventId)&&s)return s(e),this.events&&this.events.un(i),!1}};this.events.on(i);let o={url:e,method:t,scope:this,success(e,t){e.eventId=n,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=n),e.eventId=n,this.serviceProcessFailed(e,t)}};r&&(o.data=l.toJSON(r)),this.request(o)}}class de{constructor(e){e&&(this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null,e&&l.extend(this,e),this.CLASS_NAME="SuperMap.SetDatasourceParameters")}destroy(){this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null}}Z.REST.DatasourceService=class extends oe{constructor(e,t){super(e,t);const s=this;this._datasourceService=new ce(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers}),this.CLASS_NAME="SuperMap.REST.DatasourceService"}getDatasources(e){this._datasourceService.getDatasourcesService(e)}getDatasource(e,t){e&&this._datasourceService.getDatasourceService(e,t)}setDatasource(e,t){if(!(e instanceof de))return;const s={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};this._datasourceService.setDatasourceService(s,t)}};class pe extends oe{constructor(e,t){(t=t||{}).EVENT_TYPES=["processCompleted","processFailed","processRunning"],super(e,t),this.CLASS_NAME="SuperMap.ProcessingServiceBase"}destroy(){super.destroy()}getJobs(e){var t=this;b.get(w.appendCredential(e),null,{proxy:t.proxy}).then(function(e){return e.json()}).then(function(e){t.events.triggerEvent("processCompleted",{result:e})}).catch(function(e){t.eventListeners.processFailed({error:e})})}addJob(e,t,s,r){var n=this,i=null;t&&t instanceof s&&(i=new Object,s.toObject(t,i));let o=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},n.headers||{});var a={proxy:n.proxy,headers:o,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,isInTheSameDomain:n.isInTheSameDomain};b.post(w.appendCredential(e),JSON.stringify(i),a).then(function(e){return e.json()}).then(function(e){e.succeed?n.serviceProcessCompleted(e,r):n.serviceProcessFailed(e)}).catch(function(e){n.serviceProcessFailed({error:e})})}serviceProcessCompleted(e,t){e=l.transformResult(e),t=t||1e3;var s=this;if(e)var r=setInterval(function(){b.get(w.appendCredential(e.newResourceLocation),{_t:(new Date).getTime()}).then(function(e){return e.json()}).then(function(e){s.events.triggerEvent("processRunning",{id:e.id,state:e.state}),"LOST"!==e.state.runState&&"KILLED"!==e.state.runState&&"FAILED"!==e.state.runState||(clearInterval(r),s.events.triggerEvent("processFailed",{error:e.state.errorMsg,state:e.state.runState})),"FINISHED"===e.state.runState&&e.setting.serviceInfo&&(clearInterval(r),s.events.triggerEvent("processCompleted",{result:e}))}).catch(function(e){clearInterval(r),s.events.triggerEvent("processFailed",{error:e})})},t)}serviceProcessFailed(e){super.serviceProcessFailed(e)}}class me extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/density"),this.CLASS_NAME="SuperMap.KernelDensityJobsService"}destroy(){super.destroy()}getKernelDensityJobs(){super.getJobs(this.url)}getKernelDensityJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addKernelDensityJob(e,t){super.addJob(this.url,e,V,t)}}class fe extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(){super.getJobs(this.url)}getQueryJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addQueryJob(e,t){super.addJob(this.url,e,K,t)}}class ye extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(){super.getJobs(this.url)}getSummaryMeshJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addSummaryMeshJob(e,t){super.addJob(this.url,e,H,t)}}class ge extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(){super.getJobs(this.url)}getSummaryRegionJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addSummaryRegionJob(e,t){super.addJob(this.url,e,Y,t)}}class ve{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=M.CLIP,this.output=null,this.mappingParameters=null,l.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof B&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof G&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var s in e)"datasetName"!==s?"output"!==s?(t.analyst=t.analyst||{},t.analyst[s]=e[s],"mappingParameters"===s&&(t.analyst[s]=t.analyst[s]||{},t.analyst.mappingParameters=e[s])):(t.output=t.output||{},t.output=e[s]):(t.input=t.input||{},t.input[s]=e[s])}}class Se extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(){super.getJobs(this.url)}getVectorClipJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addVectorClipJob(e,t){super.addJob(this.url,e,ve,t)}}class Ee extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/overlay"),this.CLASS_NAME="SuperMap.OverlayGeoJobsService"}destroy(){super.destroy()}getOverlayGeoJobs(){super.getJobs(this.url)}getOverlayGeoJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addOverlayGeoJob(e,t){super.addJob(this.url,e,W,t)}}class be extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(){super.getJobs(this.url)}getBuffersJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addBuffersJob(e,t){super.addJob(this.url,e,Q,t)}}class Ce extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(){super.getJobs(this.url)}getTopologyValidatorJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addTopologyValidatorJob(e,t){super.addJob(this.url,e,z,t)}}class we extends pe{constructor(e,t){super(e,t),this.url=l.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(){super.getJobs(this.url)}getSummaryAttributesJob(e){super.getJobs(l.urlPathAppend(this.url,e))}addSummaryAttributesJob(e,t){super.addJob(this.url,e,q,t)}}Z.REST.ProcessingService=class extends oe{constructor(e,t){super(e,t),this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={}}getKernelDensityJobs(e,t){var s=this,r=s._processFormat(t);new me(s.url,{headers:s.headers,proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getKernelDensityJobs()}getKernelDensityJob(e,t,s){var r=this,n=r._processFormat(s);new me(r.url,{headers:r.headers,proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getKernelDensityJob(e)}addKernelDensityJob(e,t,s,r){var n=this,i=n._processFormat(r);new me(n.url,{headers:n.headers,proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning(e){n.kernelDensityJobs[e.id]=e.state}},format:i}).addKernelDensityJob(e,s)}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var s=this,r=s._processFormat(t);new ye(s.url,{headers:s.headers,proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getSummaryMeshJobs()}getSummaryMeshJob(e,t,s){var r=this,n=r._processFormat(s);new ye(r.url,{headers:r.headers,proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getSummaryMeshJob(e)}addSummaryMeshJob(e,t,s,r){var n=this,i=n._processFormat(r);new ye(n.url,{headers:n.headers,proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning(e){n.summaryMeshJobs[e.id]=e.state}},format:i}).addSummaryMeshJob(e,s)}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var s=this,r=s._processFormat(t);new fe(s.url,{headers:s.headers,proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getQueryJobs()}getQueryJob(e,t,s){var r=this,n=r._processFormat(s);new fe(r.url,{headers:r.headers,proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getQueryJob(e)}addQueryJob(e,t,s,r){var n=this,i=n._processParams(e),o=n._processFormat(r);new fe(n.url,{headers:n.headers,proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning(e){n.queryJobs[e.id]=e.state}},format:o}).addQueryJob(i,s)}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var s=this,r=s._processFormat(t);new ge(s.url,{proxy:s.proxy,headers:s.headers,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getSummaryRegionJobs()}getSummaryRegionJob(e,t,s){var r=this,n=r._processFormat(s);new ge(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getSummaryRegionJob(e)}addSummaryRegionJob(e,t,s,r){var n=this,i=n._processFormat(r);new ge(n.url,{proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,headers:n.headers,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning(e){n.summaryRegionJobs[e.id]=e.state}},format:i}).addSummaryRegionJob(e,s)}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var s=this,r=s._processFormat(t);new Se(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getVectorClipJobs()}getVectorClipJob(e,t,s){var r=this,n=r._processFormat(s);new Se(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getVectorClipJob(e)}addVectorClipJob(e,t,s,r){var n=this,i=n._processParams(e),o=n._processFormat(r);new Se(n.url,{proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,headers:n.headers,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning(e){n.vectorClipJobs[e.id]=e.state}},format:o}).addVectorClipJob(i,s)}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var s=this,r=s._processFormat(t);new Ee(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getOverlayGeoJobs()}getOverlayGeoJob(e,t,s){var r=this,n=r._processFormat(s);new Ee(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getOverlayGeoJob(e)}addOverlayGeoJob(e,t,s,r){var n=this,i=n._processFormat(r);new Ee(n.url,{proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,headers:n.headers,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning:function(e){n.overlayGeoJobs[e.id]=e.state}},format:i}).addOverlayGeoJob(e,s)}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var s=this,r=s._processFormat(t);new be(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getBuffersJobs()}getBuffersJob(e,t,s){var r=this,n=r._processFormat(s);new be(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getBuffersJob(e)}addBuffersJob(e,t,s,r){var n=this,i=n._processFormat(r);new be(n.url,{proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,headers:n.headers,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning:function(e){n.buffersJobs[e.id]=e.state}},format:i}).addBuffersJob(e,s)}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var s=this,r=s._processFormat(t);new Ce(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getTopologyValidatorJobs()}getTopologyValidatorJob(e,t,s){var r=this,n=r._processFormat(s);new Ce(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getTopologyValidatorJob(e)}addTopologyValidatorJob(e,t,s,r){var n=this,i=n._processFormat(r);new Ce(n.url,{proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,headers:n.headers,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning:function(e){n.topologyValidatorJobs[e.id]=e.state}},format:i}).addTopologyValidatorJob(e,s)}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var s=this,r=s._processFormat(t);new we(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers,eventListeners:{scope:s,processCompleted:e,processFailed:e},format:r}).getSummaryAttributesJobs()}getSummaryAttributesJob(e,t,s){var r=this,n=r._processFormat(s);new we(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:n}).getSummaryAttributesJob(e)}addSummaryAttributesJob(e,t,s,r){var n=this,i=n._processFormat(r);new we(n.url,{proxy:n.proxy,withCredentials:n.withCredentials,crossOrigin:n.crossOrigin,headers:n.headers,eventListeners:{scope:n,processCompleted:t,processFailed:t,processRunning:function(e){n.summaryAttributesJobs[e.id]=e.state}},format:i}).addSummaryAttributesJob(e,s)}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||O.GEOJSON}_processParams(e){return e?(e.geometryQuery&&(e.geometryQuery=this._convertPatams(e.geometryQuery)),e.geometryClip&&(e.geometryClip=this._convertPatams(e.geometryClip)),e):{}}_convertPatams(e){var t={};if(e.length<1)t="";else{for(var s=[],r=0;r<e.length;r++){var n={};n.x=e[r].x,n.y=e[r].y,s.push(n)}t.type="REGION",t.points=s}return t}},Z.ElasticSearch=class{constructor(e,t){t=t||{},this.url=e;try{this.client=new(p().Client)({host:this.url})}catch(e){this.client=new(p().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 c(this,null,this.EVENT_TYPES),this.eventListeners=null,l.extend(this,t),this.eventListeners instanceof Object&&this.events.on(this.eventListeners)}setGeoFence(e){this.geoFence=e}bulk(e,t){return this.client.bulk(e,this._handleCallback(t))}clearScroll(e,t){return this.client.clearScroll(e,this._handleCallback(t))}count(e,t){return this.client.count(e,this._handleCallback(t))}create(e,t){return this.client.create(e,this._handleCallback(t))}delete(e,t){return this.client.delete(e,this._handleCallback(t))}deleteByQuery(e,t){return this.client.deleteByQuery(e,this._handleCallback(t))}deleteScript(e,t){return this.client.deleteScript(e,this._handleCallback(t))}deleteTemplate(e,t){return this.client.deleteTemplate(e,this._handleCallback(t))}exists(e,t){return this.client.exists(e,this._handleCallback(t))}existsSource(e,t){return this.client.existsSource(e,this._handleCallback(t))}explain(e,t){return this.client.explain(e,this._handleCallback(t))}fieldCaps(e,t){return this.client.fieldCaps(e,this._handleCallback(t))}get(e,t){return this.client.get(e,this._handleCallback(t))}getScript(e,t){return this.client.getScript(e,this._handleCallback(t))}getSource(e,t){return this.client.getSource(e,this._handleCallback(t))}getTemplate(e,t){return this.client.getTemplate(e,this._handleCallback(t))}index(e,t){return this.client.index(e,this._handleCallback(t))}info(e,t){return this.client.info(e,this._handleCallback(t))}mget(e,t){return this.client.mget(e,this._handleCallback(t))}msearch(e,t){let s=this;return s.client.msearch(e).then(function(e){return e=e.body||e,s._update(e.responses,t),e},function(e){return t(e),s.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 s=this;return s.client.search(e).then(function(e){return e=e.body||e,s._update(e,t),e},function(e){return t&&t(e),s.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 s=t.shift();let r=t.shift();const n=r&&r.body;if(n){const{statusCode:e,headers:s}=r;t=[e,s],r=n}e.call(this,s,r,...t)}}_update(e,t){let s=this;e&&(s.data=e,s.openGeoFence&&s.geoFence&&s._validateDatas(e),s.events.triggerEvent("change",{data:s.data}),s.change?s.change&&s.change(e):t&&t(void 0,{responses:e}))}_validateDatas(e){if(e){e instanceof Array||(e=[e]);var t,s=e.length;for(t=0;t<s;t++)this._validateData(e[t])}}_validateData(e){let t=this;e.hits.hits.map(function(s){let r=s._source,n=t._getMeterPerMapUnit(t.geoFence.unit),i=t.geoFence.center[0]*n,o=t.geoFence.center[1]*n,a=r.x*n,l=r.y*n;return t._distance(a,l,i,o)>t.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),s})}_distance(e,t,s,r){return Math.sqrt((e-s)*(e-s)+(t-r)*(t-r))}_getMeterPerMapUnit(e){let t;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}},Z.SecurityManager=w,Z.KernelDensityJobParameter=V,Z.SingleObjectQueryJobsParameter=K,Z.SummaryAttributesJobsParameter=q,Z.SummaryMeshJobParameter=H,Z.SummaryRegionJobParameter=Y,Z.OverlayGeoJobParameter=W,Z.BuffersAnalystJobsParameter=Q,Z.TopologyValidatorJobsParameter=z,Z.OutputSetting=B,Z.MappingParameters=G,Z.GeoCodingParameter=$,Z.GeoDecodingParameter=X,Z.Util={...Z.Util,...l}})()})();
|