diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 385c831057a5c5325e7a2a49ed50329a6106e797..25357e679999f4de870690aa1c2428faa5492691 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,10 @@ build-master: - IMAGE_4="$CI_REGISTRY_IMAGE/pvs_cache" - docker pull "$IMAGE_4":latest || true - docker build --cache-from "$IMAGE_4":latest -t "$IMAGE_4":latest -t "$IMAGE_4":$VERSION_4 cache/ + - VERSION_5=`grep 'version="*"' fluentd/Dockerfile | cut -d '"' -f2` + - IMAGE_5="$CI_REGISTRY_IMAGE/fluentd" + - docker pull "$IMAGE_5":latest || true + - docker build --cache-from "$IMAGE_5":latest -t "$IMAGE_5":latest -t "$IMAGE_5":$VERSION_5 fluentd/ - chmod +x gitlab_test.sh - ./gitlab_test.sh - docker push "$IMAGE_1":$VERSION_1 @@ -39,6 +43,8 @@ build-master: - docker push "$IMAGE_3":latest - docker push "$IMAGE_4":$VERSION_4 - docker push "$IMAGE_4":latest + - docker push "$IMAGE_5":$VERSION_5 + - docker push "$IMAGE_5":latest only: - master @@ -51,20 +57,24 @@ build: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - IMAGE="$CI_REGISTRY_IMAGE/pvs_core" - - docker pull "$IMAGE":$CI_COMMIT_REF_NAME || true - - docker build --cache-from "$IMAGE":$CI_COMMIT_REF_NAME -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME core/ + - docker pull "$IMAGE":latest || true + - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME core/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_preprocessor" - - docker pull "$IMAGE":$CI_COMMIT_REF_NAME || true - - docker build --cache-from "$IMAGE":$CI_COMMIT_REF_NAME -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME preprocessor/ + - docker pull "$IMAGE":latest || true + - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME preprocessor/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_client" - - docker pull "$IMAGE":$CI_COMMIT_REF_NAME || true - - docker build --cache-from "$IMAGE":$CI_COMMIT_REF_NAME -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME client/ + - docker pull "$IMAGE":latest || true + - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME client/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_cache" - - docker pull "$IMAGE":$CI_COMMIT_REF_NAME || true - - docker build --cache-from "$IMAGE":$CI_COMMIT_REF_NAME -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME cache/ + - docker pull "$IMAGE":latest || true + - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME cache/ + - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" + - IMAGE="$CI_REGISTRY_IMAGE/fluentd" + - docker pull "$IMAGE":latest || true + - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME fluentd/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - chmod +x gitlab_test.sh - ./gitlab_test.sh diff --git a/README.md b/README.md index 44153c54bd5ec634da501efa1455c5978429dee2..04c3eec88ab83f576564baab7295c569a4c6521b 100644 --- a/README.md +++ b/README.md @@ -179,17 +179,25 @@ docker pull registry.gitlab.eox.at/esa/prism/vs/pvs_cache docker pull registry.gitlab.eox.at/esa/prism/vs/pvs_preprocessor docker pull registry.gitlab.eox.at/esa/prism/vs/pvs_client ``` +Create external network for stack to run: +``` +docker network create -d overlay vhr18-extnet +docker network create -d overlay emg-extnet +``` +Add following .env files with credentials to the cloned copy of the repository /env folder: `vhr18_db.env`, `vhr18_obs.env`, `vhr18_django.env`. Deploy the stack: ``` -docker stack deploy -c docker-compose.vhr18.yml -c docker-compose.vhr18.dev.yml vhr18-pvs # start VHR_IMAGE_2018 stack in dev mode, for example to use local sources -docker stack deploy -c docker-compose.emg.yml -c docker-compose.emg.dev.yml emg-pvs # start Emergency stack in dev mode, for example to use local sources - -docker exec -it $(docker ps -qf "name=vhr18-pvs_renderer") /bin/bash -cd /var/www/pvs/dev/pvs_instance -python manage.py runserver 0.0.0.0:8080 +docker stack deploy -c docker-compose.vhr18.yml -c docker-compose.vhr18.dev.yml -c docker-compose.logging.yml -c docker-compose.logging.dev.yml vhr18-pvs # start VHR_IMAGE_2018 stack in dev mode, for example to use local sources +docker stack deploy -c docker-compose.emg.yml -c docker-compose.emg.dev.yml emg-pvs -c docker-compose.logging.yml -c docker-compose.logging.dev.yml # start Emergency stack in dev mode, for example to use local sources +``` +First steps: ``` +# To register first data, use the following command inside the registrar container: +UPLOAD_CONTAINER=<product_bucket_name> && python3 registrar.py --objects-prefix <product_object_storage_item_prefix> +# To see the catalog opensearch response in the attached web client, a browser CORS extension needs to be turned on. +``` Tear town stack including data: ```bash @@ -201,15 +209,15 @@ docker volume rm vhr18-pvs_cache-db docker volume rm vhr18-pvs_instance-data ``` -Generate mapcache.sqlite -```bash -docker exec -it $(docker ps -qf "name=vhr18-pvs_renderer") python3 /var/www/pvs/dev/pvs_instance/manage.py mapcache sync -f -docker exec -it $(docker ps -qf "name=vhr18-pvs_renderer") mv VHR_IMAGE_2018.sqlite /cache-db/vhr18_mapcache_cache.sqlite +### Setup logging -docker exec -it $(docker ps -qf "name=emg-pvs_renderer") python3 /var/www/pvs/dev/pvs_instance/manage.py mapcache sync -f -docker exec -it $(docker ps -qf "name=emg-pvs_renderer") mv Emergency.sqlite /cache-db/emg_mapcache_cache.sqlite -``` +To access the logs, navigate to http://localhost:5601 . Ignore all of the fancy enterprise capabilities and select Kibana > Discover in the hamburger menu. + +On first run, you need to define an index pattern to select the data source for kibana in elastic search. +Since we only have fluentd, you can just use `*` as index pattern. +Select `@timestamp` as time field +([see also](https://www.elastic.co/guide/en/kibana/current/tutorial-define-index.html)). # Documentation diff --git a/cache/run-httpd.sh b/cache/run-httpd.sh index 0f0567a836253fbfda02e5ec5914bf8505ef7449..fc3cd5dd5012ad5cb20f597abb5c3e9b920a0e54 100755 --- a/cache/run-httpd.sh +++ b/cache/run-httpd.sh @@ -1,7 +1,7 @@ #!/bin/bash -e -/configure.sh +/configure.sh >&2 -echo "Running Apache server" +echo "Running Apache server" >&2 rm -rf /run/apache2/* /var/run/apache2/* /tmp/apache2* exec /usr/sbin/apache2ctl -D FOREGROUND diff --git a/client/html/ed6090683ac14375de89.worker.js b/client/html/505e00b9451ba872d9e7.worker.js similarity index 96% rename from client/html/ed6090683ac14375de89.worker.js rename to client/html/505e00b9451ba872d9e7.worker.js index 1ac4bbdb1fb61b7125a5c80523559ab2f8191475..9d0bc4419ab28f768804c570f9d908118dbc048c 100644 --- a/client/html/ed6090683ac14375de89.worker.js +++ b/client/html/505e00b9451ba872d9e7.worker.js @@ -1,6 +1,6 @@ /*! * PRISM version: 1.1.0-rc.26 - * eoxc version: 1.1.1 + * eoxc version: 1.1.2 */ !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t){"use strict";function e(e,n){return self.services[e]||(n?self.services[e]=t.resolve((0,s.deserialize)(n)):self.services[e]=(0,s.discover)(e)),self.services[e]}function r(t,n,r,i,o,s,a,c,l,p){var h=o.maxCount,f=o.totalResults,d=o.itemsPerPage;return e(t,a).then(function(t){var e=(0,u.convertFilters)(r,i,o,s,t),a=t.getPaginator(e,{type:s,method:n,baseOffset:o.startIndex,maxUrlLength:c,dropEmptyParameters:l,parseOptions:p,totalResults:f,preferredItemsPerPage:d});return a.searchFirstRecords(h)})}function i(){self.search&&(self.search.cancel(),self.search=null),self.emitter&&(self.emitter.emit("cancel"),self.emitter=null)}var o=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();n(95),n(96);var s=n(61),a=n(147),u=n(52);t.config({cancellation:!0}),(0,s.config)({useXHR:!0}),self.DOMParser=a.DOMParser,self.services={},self.promises={},self.onmessage=function(t){var e=t.data,n=o(e,2),s=n[0],a=n[1];switch(s){case"searchAll":var c=a.url,l=a.method,p=a.filterParams,h=a.mapParams,f=a.options,d=a.format,g=a.description,y=a.maxUrlLength,_=a.dropEmptyParameters,m=a.parseOptions,v=a.switchMultiPolygonCoordinates;self.search=r(c,l,p,h,f,d,g,y,_,m),self.search.then(function(t){self.emitter=t,t.on("page",function(t){return self.postMessage(["progress",Object.assign(t,{records:(0,u.prepareRecords)(t.records,v)})])}).on("success",function(t){return self.postMessage(["success",t])}).on("error",function(t){return self.postMessage(["error",t.toString()])})},function(t){return self.postMessage(["error",t.toString()])});break;case"cancel":i();break;case"terminate":i(),self.close()}}}).call(e,n(4))},function(t,e,n){(function(e,r,i){"use strict";function o(){try{var t=R;return R=null,t.apply(this,arguments)}catch(t){return T.e=t,T}}function s(t){return R=t,o}function a(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return a(t)?new Error(m(t)):t}function l(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;n<r;++n)i[n]=t[n];return i[n]=e,i}function p(t,e,n){if(!O.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function h(t,e,n){if(a(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return O.defineProperty(t,e,r),t}function f(t){throw t}function d(t){try{if("function"==typeof t){var e=O.names(t.prototype),n=O.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=M.test(t+"")&&O.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}}function g(t){function e(){}function n(){return typeof r.foo}e.prototype=t;var r=new e;return n(),n(),t}function y(t){return F.test(t)}function _(t,e,n){for(var r=new Array(t),i=0;i<t;++i)r[i]=e+i+n;return r}function m(t){try{return t+""}catch(t){return"[no string representation]"}}function v(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function b(t){try{h(t,"isOperational",!0)}catch(t){}}function E(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0)}function x(t){return v(t)&&O.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function I(t,e,n){for(var r=O.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{O.defineProperty(e,o,O.getDescriptor(t,o))}catch(t){}}}function N(t){return B?r.env[t]:void 0}function C(){if("function"==typeof i)try{var t=new i(function(){});if("[object Promise]"==={}.toString.call(t))return i}catch(t){}}function S(t,e){return t.bind(e)}var O=n(5),P="undefined"==typeof navigator,T={e:{}},R,L="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof e?e:void 0!==this?this:null,A=function(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n,t.prototype},D=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(O.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(t){return r}for(var s=0;s<o.length;++s){var a=o[s];if(!i[a]){i[a]=!0;var u=Object.getOwnPropertyDescriptor(t,a);null!=u&&null==u.get&&null==u.set&&r.push(a)}}t=O.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),M=/this\s*\.\s*\S+\s*=/,F=/^[a-z$_][a-z$_0-9]*$/i,k=function(){return"stack"in new Error?function(t){return x(t)?t:new Error(m(t))}:function(t){if(x(t))return t;try{throw new Error(m(t))}catch(t){return t}}}(),j=function(t){return O.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var G="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);return n};j=function(t){return O.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?G(t):null}}var U="undefined"!=typeof r&&"[object process]"===w(r).toLowerCase(),B="undefined"!=typeof r&&"undefined"!=typeof r.env,q={isClass:d,isIdentifier:y,inheritedDataKeys:D,getDataPropertyOrDefault:p,thrower:f,isArray:O.isArray,asArray:j,notEnumerableProp:h,isPrimitive:a,isObject:u,isError:v,canEvaluate:P,errorObj:T,tryCatch:s,inherits:A,withAppended:l,maybeWrapAsError:c,toFastProperties:g,filledRange:_,toString:m,canAttachTrace:x,ensureErrorObject:k,originatesFromRejection:E,markAsOriginatingFromRejection:b,classString:w,copyDescriptors:I,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:U,hasEnvVariables:B,env:N,global:L,getNativePromise:C,domainBind:S};q.isRecentNode=q.isNode&&function(){var t;return r.versions&&r.versions.node?t=r.versions.node.split(".").map(Number):r.version&&(t=r.version.split(".").map(Number)),0===t[0]&&t[1]>10||t[0]>0}(),q.isNode&&q.toFastProperties(r);try{throw new Error}catch(t){q.lastLineError=t}t.exports=q}).call(e,function(){return this}(),n(9),n(4))},function(t,e,n){"use strict";function r(t){for(var e=t.indexOf("?")===-1?t:t.substring(t.indexOf("?")),n=e.split("&"),r={},i=0;i<n.length;i++){var o=n[i].split("=");r[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return r}function i(t){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(t,"text/xml");if("undefined"!=typeof ActiveXObject){var e=new ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e}throw new Error("Could not parse XML document.")}function o(t){return t.children?Array.from(t.children):Array.from(t.childNodes).filter(function(t){return 1===t.nodeType})}function s(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:I;if(!t)return[];var i=r[e]||e,s=o(t);return n&&i?s.filter(function(t){return t.localName===n&&t.namespaceURI===i}):n?s.filter(function(t){return t.localName===n}):s}function a(t,e,n,r){if(!e&&!n&&t.firstElementChild)return t.firstElementChild;var i=s(t,e,n,r);return i.length?i[0]:null}function u(t,e,n,r){var i=a(t,e,n,r);return i?i.textContent:null}function c(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:I,o=i[e]||e;return t.hasAttributeNS(o,n)?t.getAttributeNS(o,n):r}function l(t){return t.indexOf(":")!==-1?t.split(":"):[null,t]}function p(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=e.split("/").filter(function(t){return t.length}),o=n?t:[t],u=0;u<i.length;++u){var p=i[u];if(n){if("text()"===p)return o.textContent;if(p.indexOf("@")!==-1){var h=p.split("@"),f=w(h,2),d=f[0],g=f[1],y=l(d),_=w(y,2),m=_[0],v=_[1],b=l(g),E=w(b,2),I=E[0],N=E[1];return o=a(o,m,v,r),o?c(o,I,N,void 0,r):null}var C=l(p),S=w(C,2),O=S[0],P=S[1];if(o=a(o,O,P,r),!o)return null}else{if("text()"===p)return o.map(function(t){return t.textContent});if(p.indexOf("@")!==-1){var T=function(){var t=p.split("@"),e=w(t,2),n=e[0],i=e[1],a=l(n),u=w(a,2),h=u[0],f=u[1],d=l(i),g=w(d,2),y=g[0],_=g[1];return{v:o.map(function(t){return s(t,h,f,r)}).reduce(function(t,e){return t.concat(e)},[]).map(function(t){return c(t,y,_,void 0,r)})}}();if("object"===("undefined"==typeof T?"undefined":x(T)))return T.v}else!function(){var t=l(p),e=w(t,2),n=e[0],i=e[1];o=o.map(function(t){return s(t,n,i,r)}).reduce(function(t,e){return t.concat(e)},[])}()}}return o}function h(t,e){var n=/^xmlns:(.*)$/;if(e.namespaceURI&&e.namespaceURI===t&&e.lookupNamespaceURI(e.prefix)===t)return e.prefix;if(e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r];n.lastIndex=0;var o=i.localName||i.name.substr(i.name.indexOf(":")+1);if(o.indexOf(":")!==-1&&(o=o.substr(i.name.indexOf(":")+1)),n.test(i.name)&&i.value===t)return o}return e.parentNode?h(t,e.parentNode):null}function f(t,e){if(t.lookupPrefix)return t.lookupPrefix(e);if(null===e||""===e)return null;switch(t.nodeType){case 1:return h(e,t);case 9:return h(e,t.documentElement);case 6:case 12:case 11:case 10:return null;case 2:return t.ownerElement?h(e,t.ownerElement):null;default:return t.parentNode?h(e,t.parentNode):null}}function d(){return fetch.apply(void 0,arguments).then(function(t){if(t.status>=400)throw new Error("Bad response from server");return t})}function g(t){return"undefined"==typeof t||null===t}function y(t){function e(t){return"("+t+")"}function n(t){return t.join(" ")}function r(t){return t.map(n).join(", ")}function i(t){return t.map(r).map(e).join(", ")}function o(t){return t.map(i).map(e).join(", ")}switch("Feature"===t.type&&(t=t.geometry),t.type){case"Point":return"POINT("+n(t.coordinates)+")";case"LineString":return"LINESTRING("+r(t.coordinates)+")";case"Polygon":return"POLYGON("+i(t.coordinates)+")";case"MultiPoint":return"MULTIPOINT("+r(t.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON("+o(t.coordinates)+")";case"MultiLineString":return"MULTILINESTRING("+i(t.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION("+t.geometries.map(y).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}}function _(t,e){return new Request(t,e)}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new XMLHttpRequest;return n.open(e.method||"GET",t),e.headers&&Object.keys(e.headers).forEach(function(t){n.setRequestHeader(t,e.headers[t])}),n.send(e.body?e.body:null),n}function v(t,e,n){if(Array.prototype.find)return t.find(e,n);for(var r=0;r<t.length;++r){var i=t[r];if(e(i,r,t))return i}}function b(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(Object.assign)return Object.assign.apply(Object,[t].concat(n));for(var i=0;i<n.length;++i){var o=n[i];if(o)for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t}var E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0}),e.namespaces=void 0;var x="function"==typeof Symbol&&"symbol"===E(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":E(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":E(t)},w=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.parseURLQuery=r,e.parseXml=i,e.getElements=s,e.getFirstElement=a,e.getText=u,e.getAttributeNS=c,e.simplePath=p,e.lookupPrefix=f,e.fetchAndCheck=d,e.isNullOrUndefined=g,e.toWKT=y,e.createRequest=_,e.createXHR=m,e.find=v,e.assign=b,n(45);var I=e.namespaces={os:"http://a9.com/-/spec/opensearch/1.1/",parameters:"http://a9.com/-/spec/opensearch/extensions/parameters/1.0/",atom:"http://www.w3.org/2005/Atom",georss:"http://www.georss.org/georss",dc:"http://purl.org/dc/elements/1.1/",media:"http://search.yahoo.com/mrss/",opt:"http://www.opengis.net/opt/2.1",om:"http://www.opengis.net/om/2.0",eop:"http://www.opengis.net/eop/2.0"}},function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return l(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=n(5),u=a.freeze,c=n(1),l=c.inherits,p=c.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),d=r("TimeoutError","timeout error"),g=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(t){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),_=0;_<y.length;++_)"function"==typeof Array.prototype[y[_]]&&(g.prototype[y[_]]=Array.prototype[y[_]]);a.defineProperty(g.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),g.prototype.isOperational=!0;var m=0;g.prototype.toString=function(){var t=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}return m--,e},l(i,Error);var v=Error.__BluebirdErrorTypes__;v||(v=u({CancellationError:f,TimeoutError:d,OperationalError:i,RejectionError:i,AggregateError:g}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:v,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:v.CancellationError,OperationalError:v.OperationalError,TimeoutError:v.TimeoutError,AggregateError:v.AggregateError,Warning:h}},function(t,e,n){(function(e){"use strict";function r(){try{e===o&&(e=i)}catch(t){}return o}var i;"undefined"!=typeof e&&(i=e);var o=n(81)();o.noConflict=r,t.exports=o}).call(e,n(4))},function(t,e){var n=function(){"use strict";return void 0===this}();if(n)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var r={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e},a=function(t,e){return{value:t[e]}},u=function(t,e,n){return t[e]=n.value,t},c=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(t){return o}},p=function(t){try{return"[object Array]"===i.call(t)}catch(t){return!1}};t.exports={isArray:p,keys:s,names:s,defineProperty:u,getDescriptor:a,freeze:c,getPrototypeOf:l,isES5:n,propertyIsWritable:function(){return!0}}}},function(t,e,n){var r=n(24)("wks"),i=n(27),o=n(8).Symbol,s="function"==typeof o,a=t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))};a.store=r},function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){g&&f&&(g=!1,f.length?d=f.concat(d):y=-1,d.length&&a())}function a(){if(!g){var t=i(s);g=!0;for(var e=d.length;e;){for(f=d,d=[];++y<e;)f&&f[y].run();y=-1,e=d.length}f=null,g=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var l,p,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var f,d=[],g=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new u(t,e)),1!==d.length||g||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,n){t.exports=!n(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){(function(t){"use strict";function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!t)return r;for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r}Object.defineProperty(e,"__esModule",{value:!0}),e.config=n;var r={useXHR:!1,Promise:t}}).call(e,n(4))},function(t,e,n){var r=n(20);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(15),i=n(22);t.exports=n(10)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(12),i=n(103),o=n(117),s=Object.defineProperty;e.f=n(10)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";function r(){return Object.keys(l)}function i(t){return l[t]}function o(t,e){l[t]=e}Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedTypes=r,e.getFormat=i,e.registerFormat=o;var s=n(57),a=n(59),u=n(58),c=n(60),l={};o("application/atom+xml",new s.AtomFormat),o("application/rss+xml",new a.RSSFormat),o("application/json",new u.GeoJSONFormat),o("application/vnd.geo+json",new u.GeoJSONFormat),o("application/x-suggestions+json",new c.SuggestionsJSONFormat)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(8),i=n(7),o=n(14),s=n(41),a=n(35),u="prototype",c=function(t,e,n){var l,p,h,f,d=t&c.F,g=t&c.G,y=t&c.S,_=t&c.P,m=t&c.B,v=g?r:y?r[e]||(r[e]={}):(r[e]||{})[u],b=g?i:i[e]||(i[e]={}),E=b[u]||(b[u]={});g&&(n=e);for(l in n)p=!d&&v&&void 0!==v[l],h=(p?v:n)[l],f=m&&p?a(h,r):_&&"function"==typeof h?a(Function.call,h):h,v&&s(v,l,h,t&c.U),b[l]!=h&&o(b,l,f),_&&E[l]!=h&&(E[l]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports={}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(24)("keys"),i=n(27);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(7),i=n(8),o="__core-js_shared__",s=i[o]||(i[o]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(39)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(17);t.exports=function(t){return Object(r(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r=n(123)();t.exports=function(t){return t!==r&&null!==t}},function(t,e){"use strict";function n(t,e,n){if(n=n||{},!N(n))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&C(r),i&&S(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function r(t,e,n){if(n=n||{},!N(n))throw new Error("options is invalid");var r=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");r&&C(r);var o;switch(t){case"Point":o=i(e).geometry;break;case"LineString":o=u(e).geometry;break;case"Polygon":o=s(e).geometry;break;case"MultiPoint":o=h(e).geometry;break;case"MultiLineString":o=p(e).geometry;break;case"MultiPolygon":o=f(e).geometry;break;default:throw new Error(t+" is invalid")}return r&&(o.bbox=r),o}function i(t,e,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!I(t[0])||!I(t[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},e,r)}function o(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map(function(t){return i(t,e)}),n)}function s(t,e,r){if(!t)throw new Error("coordinates is required");for(var i=0;i<t.length;i++){var o=t[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++){if(0===i&&0===s&&!I(o[0][0])||!I(o[0][1]))throw new Error("coordinates must contain numbers");if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}return n({type:"Polygon",coordinates:t},e,r)}function a(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map(function(t){return s(t,e)}),n)}function u(t,e,r){if(!t)throw new Error("coordinates is required");if(t.length<2)throw new Error("coordinates must be an array of two or more positions");if(!I(t[0][1])||!I(t[0][1]))throw new Error("coordinates must contain numbers");return n({type:"LineString",coordinates:t},e,r)}function c(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map(function(t){return u(t,e)}),n)}function l(t,e){if(e=e||{},!N(e))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&C(n),r&&S(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function p(t,e,r){if(!t)throw new Error("coordinates is required");return n({type:"MultiLineString",coordinates:t},e,r)}function h(t,e,r){if(!t)throw new Error("coordinates is required");return n({type:"MultiPoint",coordinates:t},e,r)}function f(t,e,r){if(!t)throw new Error("coordinates is required");return n({type:"MultiPolygon",coordinates:t},e,r)}function d(t,e,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return n({type:"GeometryCollection",geometries:t},e,r)}function g(t,e){if(void 0===t||null===t||isNaN(t))throw new Error("num is required");if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function y(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=F[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function _(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=F[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function m(t,e){return b(_(t,e))}function v(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function b(t){if(null===t||void 0===t)throw new Error("radians is required");var e=t%(2*Math.PI);return 180*e/Math.PI}function E(t){if(null===t||void 0===t)throw new Error("degrees is required");var e=t%360;return e*Math.PI/180}function x(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return y(_(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=j[e||"meters"];if(!r)throw new Error("invalid original units");var i=j[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function I(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function N(t){return!!t&&t.constructor===Object}function C(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!I(t))throw new Error("bbox must only contain numbers")})}function S(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}function O(){throw new Error("method has been renamed to `radiansToDegrees`")}function P(){throw new Error("method has been renamed to `degreesToRadians`")}function T(){throw new Error("method has been renamed to `lengthToDegrees`")}function R(){throw new Error("method has been renamed to `lengthToRadians`")}function L(){throw new Error("method has been renamed to `radiansToLength`")}function A(){throw new Error("method has been renamed to `bearingToAzimuth`")}function D(){throw new Error("method has been renamed to `convertLength`")}Object.defineProperty(e,"__esModule",{value:!0});var M=6371008.8,F={meters:M,metres:M,millimeters:1e3*M,millimetres:1e3*M,centimeters:100*M,centimetres:100*M,kilometers:M/1e3,kilometres:M/1e3,miles:M/1609.344,nauticalmiles:M/1852,inches:39.37*M,yards:M/1.0936,feet:3.28084*M,radians:1,degrees:M/111325},k={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/M,degrees:1/111325},j={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:3.86e-7,yards:1.195990046,feet:10.763910417,inches:1550.003100006};e.earthRadius=M,e.factors=F,e.unitsFactors=k,e.areaFactors=j,e.feature=n,e.geometry=r,e.point=i,e.points=o,e.polygon=s,e.polygons=a,e.lineString=u,e.lineStrings=c,e.featureCollection=l,e.multiLineString=p,e.multiPoint=h,e.multiPolygon=f,e.geometryCollection=d,e.round=g,e.radiansToLength=y,e.lengthToRadians=_,e.lengthToDegrees=m,e.bearingToAzimuth=v,e.radiansToDegrees=b,e.degreesToRadians=E,e.convertLength=x,e.convertArea=w,e.isNumber=I,e.isObject=N,e.validateBBox=C,e.validateId=S,e.radians2degrees=O,e.degrees2radians=P,e.distanceToDegrees=T,e.distanceToRadians=R,e.radiansToDistance=L,e.bearingToAngle=A,e.convertDistance=D},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e.push([i,r])}return e}function s(t){var e=t.trim().split(/\s+/).map(parseFloat);return o(e)}function a(t){return o((0,d.getText)(t,t.namespaceURI,"posList").trim().split(/\s+/).map(parseFloat))}function u(t,e){var n=(0,d.getFirstElement)(t,e,"exterior"),r=(0,d.getElements)(t,e,"interior"),o=a((0,d.getFirstElement)(n,e,"LinearRing"),e),s=r.map(function(t){return a((0,d.getFirstElement)(t,e,"LinearRing"),e)});return[o].concat(i(s))}function c(t,e){var n=(0,d.getText)(t,e,"lowerCorner").trim().split(/\s+/).map(parseFloat),r=(0,d.getText)(t,e,"upperCorner").trim().split(/\s+/).map(parseFloat),i=[[[n[1],n[0]],[r[1],n[0]],[r[1],r[0]],[n[1],r[0]],[n[1],n[0]]]];return i}function l(t){switch(t.localName){case"Point":var e=(0,d.getText)(t,t.namespaceURI,"pos").trim().split(/\s+/).map(parseFloat);return{type:"Point",coordinates:[e[1],e[0]]};case"LineString":var n=a(t,t.namespaceURI);return{type:"LineString",coordinates:n};case"Polygon":var r=u(t,t.namespaceURI);return{type:"Polygon",coordinates:r};case"Envelope":var i=c(t,t.namespaceURI);return{type:"Polygon",coordinates:i};case"MultiPolygon":var o=(0,d.getElements)(t,t.namespaceURI,"polygonMember").map(function(t){return(0,d.getFirstElement)(t,t.namespaceURI,"Polygon")}),s=o.map(function(e){return u(e,t.namespaceURI)});return{type:"MultiPolygon",coordinates:s};case"MultiSurface":var p=(0,d.getElements)(t,t.namespaceURI,"surfaceMember").map(function(t){return(0,d.getFirstElement)(t,t.namespaceURI,"Polygon")}),h=(0,d.getFirstElement)(t,t.namespaceURI,"surfaceMembers");h&&(p=p.concat((0,d.getElements)(h,h.namespaceURI,"Polygon")));var f=p.map(function(e){return u(e,t.namespaceURI)});return{type:"MultiPolygon",coordinates:f};case"geometryMember":return l((0,d.getFirstElement)(t))}return null}function p(t){for(var e=null,n=null,r=null,i=null,o=0;o<t.length;++o){var s=f(t[o],2),a=s[0],u=s[1];e=null===e||a<e?a:e,n=null===n||u<n?u:n,r=null===r||a>r?a:r,i=null===i||u>i?u:i}return[e,n,r,i]}Object.defineProperty(e,"__esModule",{value:!0}),e.BaseFeedFormat=void 0;var h=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance"); }}(),d=n(2);e.BaseFeedFormat=function(){function t(){r(this,t)}return h(t,[{key:"parseGeometry",value:function(t){var e=(0,d.getFirstElement)(t,"georss","where"),n=(0,d.getText)(t,"georss","point"),r=(0,d.getText)(t,"georss","line"),i=(0,d.getText)(t,"georss","polygon");if(e){var o=(0,d.getFirstElement)(e);if(o)return l(o)}else{if(n)return{type:"Point",coordinates:s(n)[0]};if(r)return{type:"LineString",coordinates:s(r)};if(i)return{type:"Polygon",coordinates:[s(i)]}}return null}},{key:"parseBox",value:function(t){var e=(0,d.getText)(t,"georss","box");if(e){var n=e.split(/\s+/).map(parseFloat);return[n[1],n[0],n[3],n[2]]}return null}},{key:"getBoxFromGeometry",value:function(t){var e=t.coordinates;switch(t.type){case"Point":return[e[0],e[1],e[0],e[1]];case"LineString":return p(e);case"Polygon":return p(e[0]);case"MultiPolygon":for(var n=e.map(function(t){return p(t[0])}),r=n[0],i=1;i<n.length;++i){var o=n[i];r[0]=Math.min(r[0],o[0]),r[1]=Math.min(r[1],o[1]),r[2]=Math.max(r[2],o[2]),r[3]=Math.max(r[3],o[3])}return r;default:return null}}},{key:"parseDate",value:function(t){var e=(0,d.getText)(t,"dc","date");if(e){var n=e.split("/");if(1===n.length)return new Date(e);if(n.length>=1)return[new Date(n[0]),new Date(n[1])]}return null}},{key:"parseLinks",value:function(t){return(0,d.getElements)(t,"atom","link").map(function(t){var e={href:t.getAttribute("href")},n=t.getAttribute("rel"),r=t.getAttribute("type"),i=t.getAttribute("title");return n&&(e.rel=n),r&&(e.type=r),i&&(e.title=i),e})}},{key:"parseMedia",value:function(t){var e=(0,d.getElements)(t,"media","content"),n=(0,d.getElements)(t,"media","group"),r=n.map(function(t){return(0,d.getElements)(t,"media","content")}).reduce(function(t,e){return t.concat(e)},[]),i=e.concat(r);return i.map(function(t){var e=(0,d.getFirstElement)(t,"media","category");return{url:t.getAttribute("url"),category:e?e.textContent:void 0,scheme:e?e.getAttribute("scheme"):void 0}})}},{key:"parseEOP",value:function(t){var e=(0,d.getFirstElement)(t,null,"EarthObservation");if(e){var n=(0,d.simplePath)(e,"om:procedure/EarthObservationEquipment",!0);return{productType:(0,d.simplePath)(e,"metaDataProperty/EarthObservationMetaData/productType/text()",!0),processingLevel:(0,d.simplePath)(e,"metaDataProperty/EarthObservationMetaData/processing/ProcessingInformation/processingLevel/text()",!0),platformShortName:(0,d.simplePath)(n,"platform/Platform/shortName/text()",!0),platformSerialIdentifier:(0,d.simplePath)(n,"platform/Platform/serialIdentifier/text()",!0),instrumentShortName:(0,d.simplePath)(n,"instrument/Instrument/shortName/text()",!0),sensorType:(0,d.simplePath)(n,"sensor/Sensor/sensorType/text()",!0),resolution:(0,d.simplePath)(n,"sensor/Sensor/resolution/text()",!0)+(0,d.simplePath)(n,"sensor/Sensor/resolution@uom",!0),orbitNumber:(0,d.simplePath)(n,"acquisitionParameters/Acquisition/orbitNumber/text()",!0),cloudCoverPercentage:(0,d.simplePath)(e,"om:result/opt:EarthObservationResult/opt:cloudCoverPercentage/text()",!0)}}return null}},{key:"parseS3Path",value:function(t){return(0,d.getText)(t,null,"s3Path")}},{key:"parseExtraFields",value:function(t,e,n,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=e[i],s=void 0,a=!0;if(Array.isArray(o)){var u=f(o,2);s=u[0],a=u[1]}else s=o;for(var c=i.split("."),l=r,p=0;p<c.length-1;++p){var h=c[p];l[h]||(l[h]={}),l=l[h]}l[c[c.length-1]]=(0,d.simplePath)(t,s,a,n)}}}]),t}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n,r){Object.keys(e).forEach(function(e){if(!Object.prototype.hasOwnProperty.call(t._parametersByType,e)&&!Object.prototype.hasOwnProperty.call(t._parametersByName,e))throw new Error("Invalid parameter '"+e+"'.")});var i=t.getMissingMandatoryParameters(e).map(function(t){return t.type});if(i.length)throw new Error("Missing mandatory parameters: "+i.join(", "));var o=t.serializeValues(e);if("GET"===t.method){for(var a=t.url,c=0;c<o.length;++c){var l=s(o[c],3),p=l[1],h=l[2];a=a.replace(new RegExp("{"+p+"[?]?}"),h)}if(n){var f=(0,u.default)(a,!1),d=f.query.split("&").map(function(t){return t.split("=")}).filter(function(t){return""!==t[1]}).map(function(t){return t.join("=")}).join("&");f.set("query",d),a=f.toString()}return{method:t.method,url:a,headers:r}}var g=t.enctype||"application/x-www-form-urlencoded",y=null;if("application/x-www-form-urlencoded"===g)y=o.map(function(t){var e=s(t,3),n=e[0],r=e[2];return encodeURIComponent(n)+"="+encodeURIComponent(r)}).join("&");else{if("multipart/form-data"!==g)throw new Error("Unsupported enctype '"+g+"'.");y=new FormData,o.forEach(function(t){var e=s(t,3),n=e[0],r=e[2];return y.append(n,r)})}return{method:t.method,url:t.url,headers:{"Content-Type":g},body:y}}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.type,o=n.raw,a=n.maxUrlLength,u=n.dropEmptyParameters,f=n.parseOptions,d=n.headers,g=i(t,e,u,d),y=(0,h.config)(),_=y.useXHR,m=y.Promise;if("undefined"!=typeof a&&g.url.length>a)return m.reject(new Error("Search URL too long: "+g.url.length+", maximum: "+a));var v=null;if(_)v=new m(function(t,e,n){var r=(0,l.createXHR)(g.url,g);r.onload=function(){o&&t(r),t([r.responseText,r.status])},r.onerror=function(){e(new TypeError("Failed to fetch"))},n&&"function"==typeof n&&n(function(){r.abort()})});else{if(v=fetch((0,l.createRequest)(g.url,g)),o)return v;v=v.then(function(t){return t.text().then(function(e){return[e,t.status]})})}return v.then(function(e){var n=s(e,2),i=n[0],o=n[1];if(o>=400){var a=(0,p.getErrorFromXml)(i);throw a||new Error(i)}var u=(0,c.getFormat)(r||t.type);if(!u)throw new Error("Could not parse response of type '"+r+"'.");return u.parse(i,f)})}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.createBaseRequest=i,e.search=o;var a=n(47),u=r(a),c=n(16),l=n(2),p=n(56),h=n(11)},function(t,e,n){"use strict";t.exports=function(t){function e(e,n,a){return function(u){var c=a._boundValue();t:for(var l=0;l<e.length;++l){var p=e[l];if(p===Error||null!=p&&p.prototype instanceof Error){if(u instanceof p)return o(n).call(c,u)}else if("function"==typeof p){var h=o(p).call(c,u);if(h===s)return h;if(h)return o(n).call(c,u)}else if(r.isObject(u)){for(var f=i(p),d=0;d<f.length;++d){var g=f[d];if(p[g]!=u[g])continue t}return o(n).call(c,u)}}return t}}var r=n(1),i=n(5).keys,o=r.tryCatch,s=r.errorObj;return e}},function(t,e,n){"use strict";function r(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=l.keys(t),i=0;i<n.length;++i){var o=n[i];p.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(n,r){if(null!==t){if(n){var o=i(a(n));t._attachExtraTrace(o),t._reject(o)}else if(e){for(var s=arguments.length,u=new Array(Math.max(s-1,0)),c=1;c<s;++c)u[c-1]=arguments[c];t._fulfill(u)}else t._fulfill(r);t=null}}}var s=n(1),a=s.maybeWrapAsError,u=n(3),c=u.OperationalError,l=n(5),p=/^(?:name|message|stack|cause)$/;t.exports=o},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(97);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(20),i=n(8).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(34);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){t.exports=!1},function(t,e,n){var r=n(114),i=n(37);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(8),i=n(14),o=n(13),s=n(27)("src"),a=n(101),u="toString",c=(""+a).split(u);n(7).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||i(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,u,function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){var r=n(15).f,i=n(13),o=n(6)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(38),i=n(17);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(25),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){n(146),t.exports=self.fetch.bind(self)},function(t,e){"use strict";var n=void 0;t.exports=function(t){return t!==n&&null!==t}},function(t,e,n){(function(e){"use strict";function r(t){return(t?t:"").toString().replace(g,"")}function i(t){var n;n="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{};var r=n.location||{};t=t||r;var i,o={},s=typeof t;if("blob:"===t.protocol)o=new a(unescape(t.pathname),{});else if("string"===s){o=new a(t,{});for(i in _)delete o[i]}else if("object"===s){for(i in t)i in _||(o[i]=t[i]);void 0===o.slashes&&(o.slashes=h.test(t.href))}return o}function o(t){t=r(t);var e=f.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],rest:e[3]}}function s(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}function a(t,e,n){if(t=r(t),!(this instanceof a))return new a(t,e,n);var u,c,h,f,d,g,_=y.slice(),m=typeof e,v=this,b=0;for("object"!==m&&"string"!==m&&(n=e,e=null),n&&"function"!=typeof n&&(n=p.parse),e=i(e),c=o(t||""),u=!c.protocol&&!c.slashes,v.slashes=c.slashes||u&&e.slashes,v.protocol=c.protocol||e.protocol||"",t=c.rest,c.slashes||(_[3]=[/(.*)/,"pathname"]);b<_.length;b++)f=_[b],"function"!=typeof f?(h=f[0],g=f[1],h!==h?v[g]=t:"string"==typeof h?~(d=t.indexOf(h))&&("number"==typeof f[2]?(v[g]=t.slice(0,d),t=t.slice(d+f[2])):(v[g]=t.slice(d),t=t.slice(0,d))):(d=h.exec(t))&&(v[g]=d[1],t=t.slice(0,d.index)),v[g]=v[g]||(u&&f[3]?e[g]||"":""),f[4]&&(v[g]=v[g].toLowerCase())):t=f(t);n&&(v.query=n(v.query)),u&&e.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==e.pathname)&&(v.pathname=s(v.pathname,e.pathname)),l(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(f=v.auth.split(":"),v.username=f[0]||"",v.password=f[1]||""),v.origin=v.protocol&&v.host&&"file:"!==v.protocol?v.protocol+"//"+v.host:"null",v.href=v.toString()}function u(t,e,n){var r=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||p.parse)(e)),r[t]=e;break;case"port":r[t]=e,l(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[t]="");break;case"hostname":r[t]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[t]=e,/:\d+$/.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(e){var i="pathname"===t?"/":"#";r[t]=e.charAt(0)!==i?i+e:e}else r[t]=e;break;default:r[t]=e}for(var o=0;o<y.length;o++){var s=y[o];s[4]&&(r[s[1]]=r[s[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function c(t){t&&"function"==typeof t||(t=p.stringify);var e,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,e="object"==typeof n.query?t(n.query):n.query,e&&(i+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(i+=n.hash),i}var l=n(138),p=n(137),h=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,d="[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]",g=new RegExp("^"+d+"+"),y=[["#","hash"],["?","query"],function(t){return t.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],_={hash:1,query:1};a.prototype={set:u,toString:c},a.extractProtocol=o,a.location=i,a.trimLeft=r,a.qs=p,t.exports=a}).call(e,function(){return this}())},function(t,e){function n(t,e){for(var n in t)e[n]=t[n]}function r(t,e){function r(){}var i=t.prototype;if(Object.create){var o=Object.create(e.prototype);i.__proto__=o}i instanceof e||(r.prototype=e.prototype,r=new r,n(i,r),t.prototype=i=r),i.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),i.constructor=t)}function i(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,it[t]),this.message=it[t],Error.captureStackTrace&&Error.captureStackTrace(this,i);return n.code=t,e&&(this.message=this.message+": "+e),n}function o(){}function s(t,e){this._node=t,this._refresh=e,a(this)}function a(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var r=t._refresh(t._node);B(t,"length",r.length),n(r,t),t._inc=e}}function u(){}function c(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function l(t,e,n,r){if(r?e[c(e,r)]=n:e[e.length++]=n,t){n.ownerElement=t;var i=t.ownerDocument;i&&(r&&m(i,t,r),_(i,t,n))}}function p(t,e,n){var r=c(e,n);if(!(r>=0))throw i(st,new Error(t.tagName+"@"+n));for(var o=e.length-1;r<o;)e[r]=e[++r];if(e.length=o,t){var s=t.ownerDocument;s&&(m(s,t,n),n.ownerElement=null)}}function h(t){if(this._features={},t)for(var e in t)this._features=t[e]}function f(){}function d(t){return"<"==t&&"<"||">"==t&&">"||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function g(t,e){if(e(t))return!0;if(t=t.firstChild)do if(g(t,e))return!0;while(t=t.nextSibling)}function y(){}function _(t,e,n){t&&t._inc++;var r=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==r&&(e._nsMap[n.prefix?n.localName:""]=n.value)}function m(t,e,n,r){t&&t._inc++;var i=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==i&&delete e._nsMap[n.prefix?n.localName:""]}function v(t,e,n){if(t&&t._inc){t._inc++;var r=e.childNodes;if(n)r[r.length++]=n;else{for(var i=e.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function b(t,e){var n=e.previousSibling,r=e.nextSibling;return n?n.nextSibling=r:t.firstChild=r,r?r.previousSibling=n:t.lastChild=n,v(t.ownerDocument,t),e}function E(t,e,n){var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===et){var i=e.firstChild;if(null==i)return e;var o=e.lastChild}else i=o=e;var s=n?n.previousSibling:t.lastChild;i.previousSibling=s,o.nextSibling=n,s?s.nextSibling=i:t.firstChild=i,null==n?t.lastChild=o:n.previousSibling=o;do i.parentNode=t;while(i!==o&&(i=i.nextSibling));return v(t.ownerDocument||t,t),e.nodeType==et&&(e.firstChild=e.lastChild=null),e}function x(t,e){var n=e.parentNode;if(n){var r=t.lastChild;n.removeChild(e);var r=t.lastChild}var r=t.lastChild;return e.parentNode=t,e.previousSibling=r,e.nextSibling=null,r?r.nextSibling=e:t.firstChild=e,t.lastChild=e,v(t.ownerDocument,t,e),e}function w(){this._nsMap={}}function I(){}function N(){}function C(){}function S(){}function O(){}function P(){}function T(){}function R(){}function L(){}function A(){}function D(){}function M(){}function F(t,e){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i){var i=r.lookupPrefix(o);if(null==i)var s=[{namespace:o,prefix:null}]}return j(this,n,t,e,s),n.join("")}function k(t,e,n){var r=t.prefix||"",i=t.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=n.length;o--;){var s=n[o];if(s.prefix==r)return s.namespace!=i}return!0}function j(t,e,n,r,i){if(r){if(t=r(t),!t)return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case X:i||(i=[]);var o=(i.length,t.attributes),s=o.length,a=t.firstChild,u=t.tagName;n=V===t.namespaceURI||n,e.push("<",u);for(var c=0;c<s;c++){var l=o.item(c);"xmlns"==l.prefix?i.push({prefix:l.localName,namespace:l.value}):"xmlns"==l.nodeName&&i.push({prefix:"",namespace:l.value})}for(var c=0;c<s;c++){var l=o.item(c);if(k(l,n,i)){var p=l.prefix||"",h=l.namespaceURI,f=p?" xmlns:"+p:" xmlns";e.push(f,'="',h,'"'),i.push({prefix:p,namespace:h})}j(l,e,n,r,i)}if(k(t,n,i)){var p=t.prefix||"",h=t.namespaceURI,f=p?" xmlns:"+p:" xmlns";e.push(f,'="',h,'"'),i.push({prefix:p,namespace:h})}if(a||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),n&&/^script$/i.test(u))for(;a;)a.data?e.push(a.data):j(a,e,n,r,i),a=a.nextSibling;else for(;a;)j(a,e,n,r,i),a=a.nextSibling;e.push("</",u,">")}else e.push("/>");return;case Z:case et:for(var a=t.firstChild;a;)j(a,e,n,r,i),a=a.nextSibling;return;case Y:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,d),'"');case H:return e.push(t.data.replace(/[<&]/g,d));case W:return e.push("<![CDATA[",t.data,"]]>");case J:return e.push("<!--",t.data,"-->");case tt:var g=t.publicId,y=t.systemId;if(e.push("<!DOCTYPE ",t.name),g)e.push(' PUBLIC "',g),y&&"."!=y&&e.push('" "',y),e.push('">');else if(y&&"."!=y)e.push(' SYSTEM "',y,'">');else{var _=t.internalSubset;_&&e.push(" [",_,"]"),e.push(">")}return;case K:return e.push("<?",t.target," ",t.data,"?>");case $:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function G(t,e,n){var r;switch(e.nodeType){case X:r=e.cloneNode(!1),r.ownerDocument=t;case et:break;case Y:n=!0}if(r||(r=e.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var i=e.firstChild;i;)r.appendChild(G(t,i,n)),i=i.nextSibling;return r}function U(t,e,n){var r=new e.constructor;for(var i in e){var s=e[i];"object"!=typeof s&&s!=r[i]&&(r[i]=s)}switch(e.childNodes&&(r.childNodes=new o),r.ownerDocument=t,r.nodeType){case X:var a=e.attributes,c=r.attributes=new u,l=a.length;c._ownerElement=r;for(var p=0;p<l;p++)r.setAttributeNode(U(t,a.item(p),!0));break;case Y:n=!0}if(n)for(var h=e.firstChild;h;)r.appendChild(U(t,h,n)),h=h.nextSibling;return r}function B(t,e,n){t[e]=n}function q(t){switch(t.nodeType){case X:case et:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(q(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}var V="http://www.w3.org/1999/xhtml",z={},X=z.ELEMENT_NODE=1,Y=z.ATTRIBUTE_NODE=2,H=z.TEXT_NODE=3,W=z.CDATA_SECTION_NODE=4,$=z.ENTITY_REFERENCE_NODE=5,Q=z.ENTITY_NODE=6,K=z.PROCESSING_INSTRUCTION_NODE=7,J=z.COMMENT_NODE=8,Z=z.DOCUMENT_NODE=9,tt=z.DOCUMENT_TYPE_NODE=10,et=z.DOCUMENT_FRAGMENT_NODE=11,nt=z.NOTATION_NODE=12,rt={},it={},ot=(rt.INDEX_SIZE_ERR=(it[1]="Index size error",1),rt.DOMSTRING_SIZE_ERR=(it[2]="DOMString size error",2),rt.HIERARCHY_REQUEST_ERR=(it[3]="Hierarchy request error",3)),st=(rt.WRONG_DOCUMENT_ERR=(it[4]="Wrong document",4),rt.INVALID_CHARACTER_ERR=(it[5]="Invalid character",5),rt.NO_DATA_ALLOWED_ERR=(it[6]="No data allowed",6),rt.NO_MODIFICATION_ALLOWED_ERR=(it[7]="No modification allowed",7),rt.NOT_FOUND_ERR=(it[8]="Not found",8)),at=(rt.NOT_SUPPORTED_ERR=(it[9]="Not supported",9),rt.INUSE_ATTRIBUTE_ERR=(it[10]="Attribute in use",10));rt.INVALID_STATE_ERR=(it[11]="Invalid state",11),rt.SYNTAX_ERR=(it[12]="Syntax error",12),rt.INVALID_MODIFICATION_ERR=(it[13]="Invalid modification",13),rt.NAMESPACE_ERR=(it[14]="Invalid namespace",14),rt.INVALID_ACCESS_ERR=(it[15]="Invalid access",15);i.prototype=Error.prototype,n(rt,i),o.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],r=0;r<this.length;r++)j(this[r],n,t,e);return n.join("")}},s.prototype.item=function(t){return a(this),this[t]},r(s,o),u.prototype={length:0,item:o.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new i(at);var n=this.getNamedItem(t.nodeName);return l(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new i(at);return e=this.getNamedItemNS(t.namespaceURI,t.localName),l(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return p(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return p(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var r=this[n];if(r.localName==e&&r.namespaceURI==t)return r}return null}},h.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];return!(!n||e&&!(e in n))},createDocument:function(t,e,n){var r=new y;if(r.implementation=this,r.childNodes=new o,r.doctype=n,n&&r.appendChild(n),e){var i=r.createElementNS(t,e);r.appendChild(i)}return r},createDocumentType:function(t,e,n){var r=new P;return r.name=t,r.nodeName=t,r.publicId=e,r.systemId=n,r}},f.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return E(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return b(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return U(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==H&&t.nodeType==H?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var r in n)if(n[r]==t)return r;e=e.nodeType==Y?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==Y?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return null==e}},n(z,f),n(z,f.prototype),y.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==et){for(var n=t.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,e),n=r}return t}return null==this.documentElement&&t.nodeType==X&&(this.documentElement=t),E(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),b(this,t)},importNode:function(t,e){return G(this,t,e)},getElementById:function(t){var e=null;return g(this.documentElement,function(n){if(n.nodeType==X&&n.getAttribute("id")==t)return e=n,!0}),e},createElement:function(t){var e=new w;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new o;var n=e.attributes=new u;return n._ownerElement=e,e},createDocumentFragment:function(){var t=new A;return t.ownerDocument=this,t.childNodes=new o,t},createTextNode:function(t){var e=new C;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new S;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new O;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new D;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new I;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new L;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new w,r=e.split(":"),i=n.attributes=new u;return n.childNodes=new o,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,i._ownerElement=n,n},createAttributeNS:function(t,e){var n=new I,r=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,n}},r(y,f),w.prototype={nodeType:X,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===et?this.insertBefore(t,null):x(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var r=this.ownerDocument.createAttributeNS(t,e);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new s(this,function(e){var n=[];return g(e,function(r){r===e||r.nodeType!=X||"*"!==t&&r.tagName!=t||n.push(r)}),n})},getElementsByTagNameNS:function(t,e){return new s(this,function(n){var r=[];return g(n,function(i){i===n||i.nodeType!==X||"*"!==t&&i.namespaceURI!==t||"*"!==e&&i.localName!=e||r.push(i)}),r})}},y.prototype.getElementsByTagName=w.prototype.getElementsByTagName,y.prototype.getElementsByTagNameNS=w.prototype.getElementsByTagNameNS,r(w,f),I.prototype.nodeType=Y,r(I,f),N.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(it[ot])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var r=this.data.substring(0,t),i=this.data.substring(t+e);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},r(N,f),C.prototype={nodeName:"#text",nodeType:H,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(C,N),S.prototype={nodeName:"#comment",nodeType:J},r(S,N),O.prototype={nodeName:"#cdata-section",nodeType:W},r(O,N),P.prototype.nodeType=tt,r(P,f),T.prototype.nodeType=nt,r(T,f),R.prototype.nodeType=Q,r(R,f),L.prototype.nodeType=$,r(L,f),A.prototype.nodeName="#document-fragment",A.prototype.nodeType=et,r(A,f),D.prototype.nodeType=K,r(D,f),M.prototype.serializeToString=function(t,e,n){return F.call(t,e,n)},f.prototype.toString=F;try{Object.defineProperty&&(Object.defineProperty(s.prototype,"length",{get:function(){return a(this),this.$$length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return q(this)},set:function(t){switch(this.nodeType){case X:case et:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),B=function(t,e,n){t["$$"+e]=n})}catch(t){}e.DOMImplementation=h,e.XMLSerializer=M},function(t,e,n){"use strict";function r(t){var e=[1/0,1/0,-(1/0),-(1/0)];return i.coordEach(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}var i=n(50);t.exports=r,t.exports.default=r},function(t,e,n){"use strict";function r(t,e,n){if(null!==t)for(var i,o,s,a,u,c,l,p,h=0,f=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,_=g?t.features.length:1,m=0;m<_;m++){l=g?t.features[m].geometry:y?t.geometry:t,p=!!l&&"GeometryCollection"===l.type,u=p?l.geometries.length:1;for(var v=0;v<u;v++){var b=0,E=0;if(a=p?l.geometries[v]:l,null!==a){c=a.coordinates;var x=a.type;switch(h=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(e(c,f,m,b,E)===!1)return!1;f++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],f,m,b,E)===!1)return!1;f++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(o=0;o<c[i].length-h;o++){if(e(c[i][o],f,m,b,E)===!1)return!1;f++}"MultiLineString"===x&&b++,"Polygon"===x&&E++}"Polygon"===x&&b++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for("MultiPolygon"===x&&(E=0),o=0;o<c[i].length;o++){for(s=0;s<c[i][o].length-h;s++){if(e(c[i][o][s],f,m,b,E)===!1)return!1;f++}E++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(r(a.geometries[i],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function i(t,e,n,i){var o=n;return r(t,function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)},i),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&e(t.features[n].properties,n)!==!1;n++);break;case"Feature":e(t.properties,0)}}function s(t,e,n){var r=n;return o(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&e(t.features[n],n)!==!1;n++);}function u(t,e,n){var r=n;return a(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function c(t){var e=[];return r(t,function(t){e.push(t)}),e}function l(t,e){var n,r,i,o,s,a,u,c,l,p,h=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(n=0;n<g;n++){for(a=f?t.features[n].geometry:d?t.geometry:t,c=f?t.features[n].properties:d?t.properties:{},l=f?t.features[n].bbox:d?t.bbox:void 0,p=f?t.features[n].id:d?t.id:void 0,u=!!a&&"GeometryCollection"===a.type,s=u?a.geometries.length:1,i=0;i<s;i++)if(o=u?a.geometries[i]:a,null!==o)switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(e(o,h,c,l,p)===!1)return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(e(o.geometries[r],h,c,l,p)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}else if(e(null,h,c,l,p)===!1)return!1;h++}}function p(t,e,n){var r=n;return l(t,function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),r}function h(t,e){l(t,function(t,n,r,i,o){var s=null===t?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":if(e(b.feature(t,r,{bbox:i,id:o}),n,0)===!1)return!1;return}var a;switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c=t.coordinates[u],l={type:a,coordinates:c};if(e(b.feature(l,r),n,u)===!1)return!1}})}function f(t,e,n){var r=n;return h(t,function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)}),r}function d(t,e){h(t,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var a;return r(t,function(r,s,u,c,l){if(void 0===a)return void(a=r);var p=b.lineString([a,r],t.properties);return e(p,n,i,l,o)!==!1&&(o++,void(a=r))})!==!1&&void 0}}})}function g(t,e,n){var r=n,i=!1;return d(t,function(t,o,s,a,u){r=i===!1&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}function y(t,e){if(!t)throw new Error("geojson is required"); @@ -18,6 +18,6 @@ this._itemBoundables=new wt,this._nodeCapacity=null,0===arguments.length){var e= et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=O.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=O.INTERIOR;break}if(r.isInResult()){t=O.EXTERIOR;break}}}if(t===O.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===O.INTERIOR):(s.isInResult()&&(i=O.EXTERIOR),a.isInResult()&&(i=O.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Le(O.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==O.INTERIOR&&o!==O.BOUNDARY||this._label.setLocation(i,O.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new ke(t,new zn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Yn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yn.prototype.compareTo=function(t){var e=t;return Yn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yn.prototype.interfaces_=function(){return[E]},Yn.prototype.getClass=function(){return Yn},Yn.orientation=function(t){return 1===Ct.increasingDirection(t)},Yn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var l=t[u].compareTo(n[c]);if(0!==l)return l;var p=(u+=i)===s,h=(c+=o)===a;if(p&&!h)return-1;if(!p&&h)return 1;if(p&&h)return 0}};var Hn=function(){this._edges=new wt,this._ocaMap=new p};Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Yn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Yn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Wn=function(){};Wn.prototype.processIntersections=function(t,e,n,r){},Wn.prototype.isDone=function(){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var $n=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};$n.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if($n.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},$n.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},$n.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},$n.prototype.getLineIntersector=function(){return this._li},$n.prototype.hasProperIntersection=function(){return this._hasProper},$n.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},$n.prototype.hasIntersection=function(){return this._hasIntersection},$n.prototype.isDone=function(){return!1},$n.prototype.hasInteriorIntersection=function(){return this._hasInterior},$n.prototype.interfaces_=function(){return[Wn]},$n.prototype.getClass=function(){return $n},$n.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Qn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new I(t),this.segmentIndex=e,this.dist=n};Qn.prototype.getSegmentIndex=function(){return this.segmentIndex},Qn.prototype.getCoordinate=function(){return this.coord},Qn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Qn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Qn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Qn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Qn.prototype.getDistance=function(){return this.dist},Qn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Qn.prototype.interfaces_=function(){return[E]},Qn.prototype.getClass=function(){return Qn};var Kn=function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Kn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new I(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new nr(o,new Le(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new Qn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new wt;n.add(new D(e));do{var r=this.findChainEnd(t,e);n.add(new D(r)),e=r}while(e<t.length-1);return Jn.toIntArray(n)},Jn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Zn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Y,this.env2=new Y;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Jn;this.startIndex=e.getChainStartIndices(this.pts)};Zn.prototype.getCoordinates=function(){return this.pts},Zn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Zn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Zn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],c=arguments[5],l=this.pts[i],p=this.pts[o],h=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return c.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(l,p),this.env2.init(h,f),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),g=Math.trunc((a+u)/2);i<d&&(a<g&&this.computeIntersectsForChain(i,d,s,a,g,c),g<u&&this.computeIntersectsForChain(i,d,s,g,u,c)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,c),g<u&&this.computeIntersectsForChain(d,o,s,g,u,c))}},Zn.prototype.getStartIndexes=function(){return this.startIndex},Zn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var tr=function t(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ne.RIGHT]-this._depth[t][Ne.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==O.EXTERIOR&&r!==O.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===O.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Le.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Zn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Y;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new I(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new A;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ne.ON),e.getLocation(1,Ne.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ne.LEFT),e.getLocation(1,Ne.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ne.RIGHT),e.getLocation(1,Ne.RIGHT),2))},e}(Fe),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Le(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new wt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Mn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new wt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Te;i.create(r),e.add(i)}}return Ze.sort(e,Ze.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new xn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new $n(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Dn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new ze(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new nr(i.getCoordinates(),new Le(s));this.insertUniqueEdge(a)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ne.LEFT),n=t.getLocation(0,Ne.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new _e,n=new wt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(T(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&z.out.println(n)}},ir.prototype.scale=function(){if(T(arguments[0],bt)){for(var t=arguments[0],e=new wt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new dn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new I(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Ct.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[bn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},sr={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Z("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(i,u,o,c);else if(4===arguments.length){var l=arguments[0],p=arguments[1],h=arguments[2],f=arguments[3];if(l===h&&p===f)return null;var d=l.getCoordinates()[p],g=l.getCoordinates()[p+1],y=h.getCoordinates()[f],_=h.getCoordinates()[f+1];if(this._li.computeIntersection(d,g,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,g)||this.hasInteriorIntersection(this._li,y,_)))throw new Z("found non-noded intersection at "+d+"-"+g+" and "+y+"-"+_)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Z("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},sr.fact.get=function(){return new _e},Object.defineProperties(or,sr);var ar=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new m("Scale factor must be non-zero");1!==e&&(this._pt=new I(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new I,this._p1Scaled=new I),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ar.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ar.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new I(this._maxx,this._maxy),this._corner[1]=new I(this._minx,this._maxy),this._corner[2]=new I(this._minx,this._miny),this._corner[3]=new I(this._maxx,this._miny)},ar.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ar.prototype.getCoordinate=function(){return this._originalPt},ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Y(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ar.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},ar.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},ar.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ar,ur);var cr=function(){this.tempEnv1=new Y,this.selectedSegment=new gn};cr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var lr=function(){this._index=null;var t=arguments[0];this._index=t},pr={HotPixelSnapAction:{configurable:!0}};lr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new hr(e,n,r);return this._index.query(i,{interfaces_:function(){return[$e]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},pr.HotPixelSnapAction.get=function(){return hr},Object.defineProperties(lr,pr);var hr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();return null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex?null:void(this._isNodeAdded=this._hotPixel.addSnappedNode(r,n))},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new wt};fr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},fr.prototype.isDone=function(){return!1},fr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fr.prototype.interfaces_=function(){return[Wn]},fr.prototype.getClass=function(){return fr};var dr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};dr.prototype.checkCorrectness=function(t){var e=dn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof q))throw t;t.printStackTrace()}},dr.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},dr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},dr.prototype.findInteriorIntersections=function(t,e){var n=new fr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},dr.prototype.computeVertexSnaps=function(){if(T(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof dn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},dr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new xn,this._pointSnapper=new lr(this._noder.getIndex()),this.snapRound(t,this._li)},dr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},dr.prototype.interfaces_=function(){return[bn]},dr.prototype.getClass=function(){return dr};var gr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new In,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gr.prototype.bufferFixedPrecision=function(t){var e=new ir(new dr(new fe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Oe))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gr.precisionScaleFactor(this._argGeom,this._distance,n),i=new fe(r);this.bufferFixedPrecision(i)}},gr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Z))throw t;this._saveException=t}},gr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new gr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new gr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof In&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new gr(s,u).getResultGeometry(a)}}else if(4===arguments.length){var c=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3],f=new gr(c);return f.setQuadrantSegments(p),f.setEndCapStyle(h), f.getResultGeometry(l)}},gr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=R.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yr.CAP_ROUND.get=function(){return In.CAP_ROUND},yr.CAP_BUTT.get=function(){return In.CAP_FLAT},yr.CAP_FLAT.get=function(){return In.CAP_FLAT},yr.CAP_SQUARE.get=function(){return In.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gr,yr);var _r=function(){this._pt=[new I,new I],this._distance=v.NaN,this._isNull=!0};_r.prototype.getCoordinates=function(){return this._pt},_r.prototype.getCoordinate=function(t){return this._pt[t]},_r.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},_r.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},_r.prototype.getDistance=function(){return this._distance},_r.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var mr=function(){};mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.computeDistance=function(){if(arguments[2]instanceof _r&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new gn,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof _r&&arguments[0]instanceof Zt&&arguments[1]instanceof I){var a=arguments[0],u=arguments[1],c=arguments[2];mr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)mr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof _r&&arguments[0]instanceof lt&&arguments[1]instanceof I){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof $t)mr.computeDistance(p,h,f);else if(p instanceof Zt)mr.computeDistance(p,h,f);else if(p instanceof qt)for(var d=p,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);mr.computeDistance(y,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof _r&&arguments[0]instanceof gn&&arguments[1]instanceof I){var _=arguments[0],m=arguments[1],v=arguments[2],b=_.closestPoint(m);v.setMinimum(b,m)}};var vr=function(t){this._maxPtDist=new _r,this._inputGeom=t||null},br={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};vr.prototype.computeMaxMidpointDistance=function(t){var e=new xr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},vr.prototype.getDistancePoints=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},br.MaxPointDistanceFilter.get=function(){return Er},br.MaxMidpointDistanceFilter.get=function(){return xr},Object.defineProperties(vr,br);var Er=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};Er.prototype.filter=function(t){this._minPtDist.initialize(),mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[ft]},Er.prototype.getClass=function(){return Er};var xr=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};xr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new I((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),mr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xr.prototype.isDone=function(){return!1},xr.prototype.isGeometryChanged=function(){return!1},xr.prototype.getMaxPointDistance=function(){return this._maxPtDist},xr.prototype.interfaces_=function(){return[Bt]},xr.prototype.getClass=function(){return xr};var wr=function(t){this._comps=t||null};wr.prototype.filter=function(t){t instanceof Zt&&this._comps.add(t)},wr.prototype.interfaces_=function(){return[Ut]},wr.prototype.getClass=function(){return wr},wr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return wr.getPolygons(t,new wt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof qt&&e.apply(new wr(n)),n}};var Ir=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Ir.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof $t&&this._lines.add(t)},Ir.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ir.prototype.interfaces_=function(){return[ct]},Ir.prototype.getClass=function(){return Ir},Ir.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Ir.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Ir.getLines(e,n))}},Ir.getLines=function(){if(1===arguments.length){var t=arguments[0];return Ir.getLines(t,!1)}if(2===arguments.length){if(T(arguments[0],bt)&&T(arguments[1],bt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Ir.getLines(i,n)}return n}if(arguments[0]instanceof lt&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new wt;return o.apply(new Ir(a,s)),a}if(arguments[0]instanceof lt&&T(arguments[1],bt)){var u=arguments[0],c=arguments[1];return u instanceof $t?c.add(u):u.apply(new Ir(c)),c}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&T(arguments[0],bt)&&T(arguments[1],bt)){for(var l=arguments[0],p=arguments[1],h=arguments[2],f=l.iterator();f.hasNext();){var d=f.next();Ir.getLines(d,p,h)}return p}if("boolean"==typeof arguments[2]&&arguments[0]instanceof lt&&T(arguments[1],bt)){var g=arguments[0],y=arguments[1],_=arguments[2];return g.apply(new Ir(y,_)),y}}};var Nr=function(){if(this._boundaryRule=dt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new m("Rule must be non-null");this._boundaryRule=t}};Nr.prototype.locateInternal=function(){if(arguments[0]instanceof I&&arguments[1]instanceof Zt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return O.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===O.EXTERIOR)return O.EXTERIOR;if(r===O.BOUNDARY)return O.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===O.INTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}if(arguments[0]instanceof I&&arguments[1]instanceof $t){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return O.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?at.isOnLine(a,c)?O.INTERIOR:O.EXTERIOR:O.BOUNDARY}if(arguments[0]instanceof I&&arguments[1]instanceof Kt){var l=arguments[0];return arguments[1].getCoordinate().equals2D(l)?O.INTERIOR:O.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof $t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof qt)for(var u=new Bn(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof $t?this.locateInternal(t,e):e instanceof Zt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Cr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Sr={INSIDE_AREA:{configurable:!0}};Cr.prototype.isInsideArea=function(){return this._segIndex===Cr.INSIDE_AREA},Cr.prototype.getCoordinate=function(){return this._pt},Cr.prototype.getGeometryComponent=function(){return this._component},Cr.prototype.getSegmentIndex=function(){return this._segIndex},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cr,Sr);var Or=function(t){this._pts=t||null};Or.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[Ut]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Ze.singletonList(t):Or.getPoints(t,new wt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof qt&&e.apply(new Or(n)),n}};var Pr=function(){this._locations=null;var t=arguments[0];this._locations=t};Pr.prototype.filter=function(t){(t instanceof Kt||t instanceof $t||t instanceof Zt)&&this._locations.add(new Cr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[Ut]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new wt;return t.apply(new Pr(e)),e};var Tr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=v.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Tr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=wr.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&T(arguments[0],xt)&&T(arguments[1],xt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),p=0;p<a.size();p++)if(this.computeContainmentDistance(l,a.get(p),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Cr&&arguments[1]instanceof Zt){var h=arguments[0],f=arguments[1],d=arguments[2],g=h.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(g,f))return this._minDistance=0,d[0]=h,d[1]=new Cr(f,g),null}},Tr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ir.getLines(this._geom[0]),n=Ir.getLines(this._geom[1]),r=Or.getPoints(this._geom[0]),i=Or.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Tr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Tr.prototype.updateMinDistance=function(t,e){return null===t[0]?null:void(e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1]))},Tr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Tr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=at.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new gn(r[o],r[o+1]).closestPoint(i);n[0]=new Cr(t,o,a),n[1]=new Cr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof $t){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var p=u.getCoordinates(),h=c.getCoordinates(),f=0;f<p.length-1;f++)for(var d=0;d<h.length-1;d++){var g=at.distanceLineLine(p[f],p[f+1],h[d],h[d+1]);if(g<this._minDistance){this._minDistance=g;var y=new gn(p[f],p[f+1]),_=new gn(h[d],h[d+1]),m=y.closestPoints(_);l[0]=new Cr(u,f,m[0]),l[1]=new Cr(c,d,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Tr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Cr(i,0,i.getCoordinate()),n[1]=new Cr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new m("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Tr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(t,e){return new Tr(t,e).distance()},Tr.isWithinDistance=function(t,e,n){return new Tr(t,e,n).distance()<=n},Tr.nearestPoints=function(t,e){return new Tr(t,e).nearestPoints()};var Rr=function(){this._pt=[new I,new I],this._distance=v.NaN,this._isNull=!0};Rr.prototype.getCoordinates=function(){return this._pt},Rr.prototype.getCoordinate=function(t){return this._pt[t]},Rr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Rr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Rr.prototype.toString=function(){return J.toLineString(this._pt[0],this._pt[1])},Rr.prototype.getDistance=function(){return this._distance},Rr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr};var Lr=function(){};Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.computeDistance=function(){if(arguments[2]instanceof Rr&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof Zt&&arguments[1]instanceof I){var a=arguments[0],u=arguments[1],c=arguments[2];Lr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)Lr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof lt&&arguments[1]instanceof I){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof $t)Lr.computeDistance(p,h,f);else if(p instanceof Zt)Lr.computeDistance(p,h,f);else if(p instanceof qt)for(var d=p,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);Lr.computeDistance(y,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof gn&&arguments[1]instanceof I){var _=arguments[0],m=arguments[1],v=arguments[2],b=_.closestPoint(m);v.setMinimum(b,m)}};var Ar=function(){this._g0=null,this._g1=null,this._ptDist=new Rr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Dr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ar.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ar.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new m("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ar.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ar.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ar.prototype.computeOrientedDistance=function(t,e,n){var r=new Mr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Fr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Ar.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Ar(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Ar(n,r);return o.setDensifyFraction(i),o.distance()}},Dr.MaxPointDistanceFilter.get=function(){return Mr},Dr.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Ar,Dr);var Mr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._euclideanDist=new Lr,this._geom=null;var t=arguments[0];this._geom=t};Mr.prototype.filter=function(t){this._minPtDist.initialize(),Lr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Mr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Mr.prototype.interfaces_=function(){return[ft]},Mr.prototype.getClass=function(){return Mr};var Fr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Fr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,c=new I(a,u);this._minPtDist.initialize(),Lr.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Fr.prototype.isDone=function(){return!1},Fr.prototype.isGeometryChanged=function(){return!1},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[Bt]},Fr.prototype.getClass=function(){return Fr};var kr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},jr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};kr.prototype.checkMaximumDistance=function(t,e,n){var r=new Ar(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+J.toLineString(i[0],i[1])+")"}},kr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=kr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),kr.VERBOSE&&z.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},kr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Zt||this._input instanceof ne||this._input instanceof qt))return null;var t=this.getPolygonLines(this._input);return this.checkMinimumDistance(t,this._result,this._minValidDistance),this._isValid?void this.checkMaximumDistance(t,this._result,this._maxValidDistance):null},kr.prototype.getErrorIndicator=function(){return this._errorIndicator},kr.prototype.checkMinimumDistance=function(t,e,n){var r=new Tr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+J.toLineString(i[0],i[1])+" )"}},kr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();return this.checkMinimumDistance(this._input,t,this._minValidDistance),this._isValid?void this.checkMaximumDistance(this._input,t,this._maxValidDistance):null},kr.prototype.getErrorLocation=function(){return this._errorLocation},kr.prototype.getPolygonLines=function(t){for(var e=new wt,n=new Ir(e),r=wr.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},kr.prototype.getErrorMessage=function(){return this._errMsg},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(kr,jr);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Y(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Y(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new kr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Gr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gr.prototype.checkPolygonal=function(){this._result instanceof Zt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){return Gr.VERBOSE?void z.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED")):null},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var Br=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Br.prototype.getCoordinates=function(){return this._pts},Br.prototype.size=function(){return this._pts.length},Br.prototype.getCoordinate=function(t){return this._pts[t]},Br.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Br.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Br.prototype.setData=function(t){this._data=t},Br.prototype.getData=function(){return this._data},Br.prototype.toString=function(){return J.toLineString(new ue(this._pts))},Br.prototype.interfaces_=function(){return[hn]},Br.prototype.getClass=function(){return Br};var qr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new wt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};qr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qr.prototype.getIntersectionSegments=function(){return this._intSegments},qr.prototype.count=function(){return this._intersectionCount},qr.prototype.getIntersections=function(){return this._intersections},qr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},qr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qr.prototype.interfaces_=function(){return[Wn]},qr.prototype.getClass=function(){return qr},qr.createAllIntersectionsFinder=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e},qr.createAnyIntersectionFinder=function(t){return new qr(t)},qr.createIntersectionCounter=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){return null!==this._segInt?null:void this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new qr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new xn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Oe(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3]); },Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var zr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};zr.prototype.checkValid=function(){this._nv.checkValid()},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.toSegmentStrings=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Br(r.getCoordinates(),r))}return e},zr.checkValid=function(t){new zr(t).checkValid()};var Xr=function(t){this._mapOp=t};Xr.prototype.map=function(t){for(var e=new wt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(_e.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var Yr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new wt,this._resultLineList=new wt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Yr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Yr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Ci.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Yr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Yr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Yr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Ci.isResultOfOp(r,e)&&e===Ci.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new wt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Ci.INTERSECTION)){var r=n.getLabel();Ci.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Wr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Wr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new wt,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new wt;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Wr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Wr.prototype.getInputGeometry=function(){return this._inputGeom},Wr.prototype.transformMultiLineString=function(t,e){for(var n=new wt,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Wr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Wr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformMultiPoint=function(t,e){for(var n=new wt,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Wr.prototype.transformMultiPolygon=function(t,e){for(var n=new wt,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Wr.prototype.copy=function(t){return t.copy()},Wr.prototype.transformGeometryCollection=function(t,e){for(var n=new wt,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(_e.toGeometryArray(n)):this._factory.buildGeometry(n)},Wr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof $t)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Zt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof qt)return this.transformGeometryCollection(t,null);throw new m("Unknown Geometry subtype: "+t.getClass().getName())},Wr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var $r=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $t&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};$r.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new I(o)),0===r&&this._isClosed&&t.set(t.size()-1,new I(o)))}},$r.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},$r.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},$r.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new I(i),!1)}},$r.prototype.findSegmentIndexToSnap=function(t,e){for(var n=v.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},$r.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Qr=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};Qr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Jr(e,n).transform(this._srcGeom)},Qr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Jr(t,n,!0).transform(this._srcGeom),i=r;return e&&T(i,Jt)&&(i=r.buffer(0)),i},Qr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Qr.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Qr.prototype.computeMinimumSegmentLength=function(t){for(var e=v.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Qr(t);r[0]=i.snapTo(e,n);var o=new Qr(e);return r[1]=o.snapTo(r[0],n),r},Qr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Qr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Qr.computeOverlaySnapTolerance(i),Qr.computeOverlaySnapTolerance(o))}},Qr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Qr.SNAP_PRECISION_FACTOR},Qr.snapToSelf=function(t,e,n){return new Qr(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Qr,Kr);var Jr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new $r(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wr),Zr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Zr.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},Zr.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Zr.signExpBits(this._commonBits),this._isFirst=!1,null):Zr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Zr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Zr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Zr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Zr.signExpBits=function(t){return t>>52},Zr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Zr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Zr.getBit(t,r)!==Zr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new I(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Zr,this._commonBitsY=new Zr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new I(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ft]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Bt]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Qr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Ci.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||z.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Qr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Qr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Ci.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ci.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ci.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ci.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Ci.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Z))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Z?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Ci.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ci.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ci.DIFFERENCE)};var si=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};si.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var ai=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};ai.prototype.isDelete=function(){return this._eventType===ai.DELETE},ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ai.prototype.getObject=function(){return this._obj},ai.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},ai.prototype.getInsertEvent=function(){return this._insertEvent},ai.prototype.isInsert=function(){return this._eventType===ai.INSERT},ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ai.prototype.interfaces_=function(){return[E]},ai.prototype.getClass=function(){return ai},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(ai,ui);var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var li=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};li.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(li.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var pi=function(t){function e(){t.call(this),this.events=new wt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Ze.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof li&&T(arguments[0],xt)&&T(arguments[1],xt)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&T(arguments[0],xt)&&arguments[1]instanceof li){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new si(n,i),s=new ai(e,n.getMinX(i),o);this.events.add(s),this.events.add(new ai(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ci),hi=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}};hi.prototype.getMin=function(){return this._min},hi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},hi.prototype.getMax=function(){return this._max},hi.prototype.toString=function(){return J.toLineString(new I(this._min,0),new I(this._max,0))},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},fi.NodeComparator.get=function(){return di},Object.defineProperties(hi,fi);var di=function(){};di.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},di.prototype.interfaces_=function(){return[w]},di.prototype.getClass=function(){return di};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){return this.intersects(t,e)?void n.visitItem(this._item):null},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){return this.intersects(t,e)?(null!==this._node1&&this._node1.query(t,e,n),void(null!==this._node2&&this._node2.query(t,e,n))):null},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),_i=function(){this._leaves=new wt,this._root=null,this._level=0};_i.prototype.buildTree=function(){Ze.sort(this._leaves,new hi.NodeComparator);for(var t=this._leaves,e=null,n=new wt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_i.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,n))},_i.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_i.prototype.buildRoot=function(){return null!==this._root?null:void(this._root=this.buildTree())},_i.prototype.printNode=function(t){z.out.println(J.toLineString(new I(t._min,this._level),new I(t._max,this._level)))},_i.prototype.init=function(){return null!==this._root?null:void this.buildRoot()},_i.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yi(t.get(n),t.get(n+1));e.add(i)}}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var mi=function(){this._items=new wt};mi.prototype.visitItem=function(t){this._items.add(t)},mi.prototype.getItems=function(){return this._items},mi.prototype.interfaces_=function(){return[$e]},mi.prototype.getClass=function(){return mi};var vi=function(){this._index=null;var t=arguments[0];if(!T(t,Jt))throw new m("Argument must be Polygonal");this._index=new xi(t)},bi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};vi.prototype.locate=function(t){var e=new st(t),n=new Ei(e);return this._index.query(t.y,t.y,n),e.getLocation()},vi.prototype.interfaces_=function(){return[Un]},vi.prototype.getClass=function(){return vi},bi.SegmentVisitor.get=function(){return Ei},bi.IntervalIndexedGeometry.get=function(){return xi},Object.defineProperties(vi,bi);var Ei=function(){this._counter=null;var t=arguments[0];this._counter=t};Ei.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ei.prototype.interfaces_=function(){return[$e]},Ei.prototype.getClass=function(){return Ei};var xi=function(){this._index=new _i;var t=arguments[0];this.init(t)};xi.prototype.init=function(t){for(var e=Ir.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},xi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},xi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new mi;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi};var wi=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new he,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Nr,2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;O.NONE,r.getLocation(t,Ne.ON)===O.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new li(n,!0,!1);o.setIsDoneIfProperInt(i);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof ee||this._parentGeom instanceof Zt||this._parentGeom instanceof ne,u=r||!a;return s.computeIntersections(this._edges,o,u),this.addSelfIntersectionNodes(this._argIndex),o}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new li(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof I){var e=arguments[0];this.insertPoint(this._argIndex,e,O.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,O.INTERIOR,O.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],O.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],O.BOUNDARY)},e.prototype.addLineString=function(t){var e=Ct.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Le(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){return this.isBoundaryNode(t,e)?null:void(n===O.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n))},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Ct.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;at.isCCW(r)&&(i=n,o=e);var s=new nr(r,new Le(this._argIndex,O.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],O.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Le(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new pi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Zt)this.addPolygon(e);else if(e instanceof $t)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{ -if(!(e instanceof qt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return T(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?O.BOUNDARY:O.INTERIOR},e}(ze),Ii=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new wi(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wi(0,e,r),this._arg[1]=new wi(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wi(0,i,s),this._arg[1]=new wi(1,o,s)}};Ii.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ii.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Ni=function(){};Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof lt&&T(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new wt,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(T(arguments[0],bt)&&T(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new wt,u=o.iterator();u.hasNext();){var c=u.next(),l=s.map(c);null!==l&&a.add(l)}return a}},Ni.MapOp=function(){};var Ci=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new wt,this._resultLineList=new wt,this._resultPointList=new wt,this._graph=new ze(new Xn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Le(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new wt;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new wt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new wt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),zr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Yr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ne.RIGHT),i.getLocation(1,Ne.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ne.LEFT,r.getLocation(i,Ne.LEFT)),et.isTrue(!r.isNull(i,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ne.RIGHT,r.getLocation(i,Ne.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ii);Ci.overlayOp=function(t,e,n){return new Ci(t,e).getResultGeometry(n)},Ci.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Ci.createEmptyResult(Ci.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ni.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.INTERSECTION)},Ci.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},Ci.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Ci.INTERSECTION:o=Math.min(r,i);break;case Ci.UNION:o=Math.max(r,i);break;case Ci.DIFFERENCE:o=r;break;case Ci.SYMDIFFERENCE:o=Math.max(r,i)}return o},Ci.createEmptyResult=function(t,e,n,r){var i=null;switch(Ci.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Ci.difference=function(t,e){return t.isEmpty()?Ci.createEmptyResult(Ci.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.DIFFERENCE))},Ci.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Ci.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case Ci.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Ci.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Ci.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Ci.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Ci.INTERSECTION=1,Ci.UNION=2,Ci.DIFFERENCE=3,Ci.SYMDIFFERENCE=4;var Si=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Nr,this._seg=new gn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Si.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=_e.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Oi=function(){this._linework=null,this._linework=new wt};Oi.prototype.getLinework=function(){return this._linework},Oi.prototype.filter=function(t){if(t instanceof Zt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Oi.prototype.interfaces_=function(){return[Ut]},Oi.prototype.getClass=function(){return Oi};var Pi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Pi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new wt,n=Ir.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,l=(e.y+t.y)/2;if(this._doLeft){var p=new I(c-u,l+a);r.add(p)}if(this._doRight){var h=new I(c+u,l-a);r.add(h)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ti=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new wt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]},Ri={TOLERANCE:{configurable:!0}};Ti.prototype.reportResult=function(t,e,n){z.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Ti.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ti.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Ti.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Ti.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ti.prototype.isValidResult=function(t,e){var n=Ci.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Ti.prototype.getInvalidLocation=function(){return this._invalidLocation},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ti.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Qr.computeSizeBasedSnapTolerance(t),Qr.computeSizeBasedSnapTolerance(e))},Ti.isValid=function(t,e,n,r){return new Ti(t,e,r).isValid(n)},Ri.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ti,Ri);var Li=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Li.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Li.prototype.combine=function(){for(var t=new wt,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.combine=function(){if(1===arguments.length){var t=arguments[0];return new Li(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Li(Li.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Li(Li.createList(r,i,o)).combine()}},Li.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Li.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new wt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new wt;return s.add(r),s.add(i),s.add(o),s}};var Ai=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new wt)},Di={STRTREE_NODE_CAPACITY:{configurable:!0}};Ai.prototype.reduceToGeometries=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next(),i=null;T(r,xt)?i=this.unionTree(r):r instanceof lt&&(i=r),e.add(i)}return e},Ai.prototype.extractByEnvelope=function(t,e,n){for(var r=new wt,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ai.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Li.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ai.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new sn(Ai.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ai.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ai.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ai.getGeometry(e,n),Ai.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Ai.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ai.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ai.prototype.unionActual=function(t,e){return Ai.restrictToPolygons(t.union(e))},Ai.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ai.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new wt,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Li.combine(r)},Ai.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.restrictToPolygons=function(t){if(T(t,Jt))return t;var e=wr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_e.toPolygonArray(e))},Ai.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ai.union=function(t){return new Ai(t).union()},Di.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ai,Di);var Mi=function(){};Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.UNION)},t.GeoJSONReader=we,t.GeoJSONWriter=Ie,t.OverlayOp=Ci,t.UnionOp=Mi,t.BufferOp=gr,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){"use strict";var r=n(145);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!r(t)}},function(t,e,n){"use strict";var r=n(46),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},function(t,e,n){"use strict";var r=n(142),i=/^\s*class[\s{\/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},function(t,e,n){"use strict";var r=n(143);t.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},function(t,e,n){(function(t){!function(t,n){n(e)}(this,function(e){function n(t){return t&&DataView.prototype.isPrototypeOf(t)}function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function i(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return E.iterable&&(e[Symbol.iterator]=function(){return e}),e}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function a(e){return e.bodyUsed?t.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function u(e){return new t(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function c(t){var e=new FileReader,n=u(e);return e.readAsArrayBuffer(t),n}function l(t){var e=new FileReader,n=u(e);return e.readAsText(t),n}function p(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:E.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:E.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:E.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():E.arrayBuffer&&E.blob&&n(t)?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):E.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||w(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):E.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},E.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},E.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return I.indexOf(e)>-1?e:t}function g(t,e){e=e||{};var n=e.body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function _(t){var e=new s,n=t.replace(/\r?\n[\t ]+/g," ");return n.split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"",this.headers=new s(e.headers),this.url=e.url||"",this._initBody(t)}function v(n,r){return new t(function(t,i){function o(){u.abort()}function s(t){try{return""===t&&b.location.href?b.location.href:t}catch(e){return t}}var a=new g(n,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;u.onload=function(){var e={status:u.status,statusText:u.statusText,headers:_(u.getAllResponseHeaders()||"")};e.url="responseURL"in u?u.responseURL:e.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;setTimeout(function(){t(new m(n,e))},0)},u.onerror=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},u.onabort=function(){setTimeout(function(){i(new e.DOMException("Aborted","AbortError"))},0)},u.open(a.method,s(a.url),!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&(E.blob?u.responseType="blob":E.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(u.responseType="arraybuffer")),a.headers.forEach(function(t,e){u.setRequestHeader(e,t)}),a.signal&&(a.signal.addEventListener("abort",o),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",o)}),u.send("undefined"==typeof a._bodyInit?null:a._bodyInit)})}var b=function(t){return t}("undefined"!=typeof self?self:this),E={searchParams:"URLSearchParams"in b,iterable:"Symbol"in b&&"iterator"in Symbol,blob:"FileReader"in b&&"Blob"in b&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in b,arrayBuffer:"ArrayBuffer"in b};if(E.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(t){return t&&x.indexOf(Object.prototype.toString.call(t))>-1};s.prototype.append=function(t,e){t=r(t),e=i(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},s.prototype.delete=function(t){delete this.map[r(t)]},s.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},s.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},s.prototype.set=function(t,e){this.map[r(t)]=i(e)},s.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},s.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),o(t)},s.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},s.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),o(t)},E.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var N=[301,302,303,307,308];m.redirect=function(t,e){if(N.indexOf(e)===-1)throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},e.DOMException=b.DOMException,"function"!=typeof e.DOMException&&(e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException),v.polyfill=!0,b.fetch||(b.fetch=v,b.Headers=s,b.Request=g,b.Response=m),e.Headers=s,e.Request=g,e.Response=m,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})}).call(e,n(4))},function(t,e,n){function r(t){this.options=t||{locator:{}}}function i(t,e,n){function r(e){var r=t[e];!r&&s&&(r=2==t.length?function(n){t(e,n)}:t),i[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+a(n))}||function(){}}if(!t){if(e instanceof o)return e;t=e}var i={},s=t instanceof Function;return n=n||{},r("warning"),r("error"),r("fatalError"),i}function o(){this.cdata=!1}function s(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function a(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function u(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function c(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}r.prototype.parseFromString=function(t,e){var n=this.options,r=new l,s=n.domBuilder||new o,a=n.errorHandler,u=n.locator,c=n.xmlns||{},p={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&s.setDocumentLocator(u),r.errorHandler=i(a,s,u),r.domBuilder=n.domBuilder||s,/\/x?html?$/.test(e)&&(p.nbsp=" ",p.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t?r.parse(t,c,p):r.errorHandler.error("invalid doc source"),s.doc},o.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var i=this.doc,o=i.createElementNS(t,n||e),a=r.length;c(this,o),this.currentElement=o,this.locator&&s(this.locator,o);for(var u=0;u<a;u++){var t=r.getURI(u),l=r.getValue(u),n=r.getQName(u),p=i.createAttributeNS(t,n);this.locator&&s(r.getLocator(u),p),p.value=p.nodeValue=l,o.setAttributeNode(p)}},endElement:function(t,e,n){var r=this.currentElement;r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&s(this.locator,n),c(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=u.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(t);else var r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&s(this.locator,r)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=u.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&s(this.locator,r),c(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(t,e,n);this.locator&&s(this.locator,i),c(this,i)}},warning:function(t){console.warn("[xmldom warning]\t"+t,a(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,a(this.locator))},fatalError:function(t){throw console.error("[xmldom fatalError]\t"+t,a(this.locator)),t}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){o.prototype[t]=function(){return null}});var l=n(148).XMLReader,p=e.DOMImplementation=n(48).DOMImplementation;e.XMLSerializer=n(48).XMLSerializer,e.DOMParser=r},function(t,e){function n(){}function r(t,e,n,r,c){function f(t){if(t>65535){t-=65536;var e=55296+(t>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}function d(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?f(parseInt(e.substr(1).replace("x","0x"))):(c.error("entity not found:"+t),t)}function g(e){ -if(e>w){var n=t.substring(w,e).replace(/&#?\w+;/g,d);b&&y(w),r.characters(n,0,e-w),w=e}}function y(e,n){for(;e>=m&&(n=v.exec(t));)_=n.index,m=_+n[0].length,b.lineNumber++;b.columnNumber=e-_+1}for(var _=0,m=0,v=/.*(?:\r\n?|\n)|.*$/g,b=r.locator,E=[{currentNSMap:e}],x={},w=0;;){try{var I=t.indexOf("<",w);if(I<0){if(!t.substr(w).match(/^\s*$/)){var N=r.doc,C=N.createTextNode(t.substr(w));N.appendChild(C),r.currentElement=C}return}switch(I>w&&g(I),t.charAt(I+1)){case"/":var S=t.indexOf(">",I+3),O=t.substring(I+2,S),P=E.pop();S<0?(O=t.substring(I+2).replace(/[\s<].*/,""),c.error("end tag name: "+O+" is not complete:"+P.tagName),S=I+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),c.error("end tag name: "+O+" maybe not complete"),S=I+1+O.length);var T=P.localNSMap,R=P.tagName==O,L=R||P.tagName&&P.tagName.toLowerCase()==O.toLowerCase();if(L){if(r.endElement(P.uri,P.localName,O),T)for(var A in T)r.endPrefixMapping(A);R||c.fatalError("end tag name: "+O+" is not match the current start tagName:"+P.tagName)}else E.push(P);S++;break;case"?":b&&y(I),S=p(t,I,r);break;case"!":b&&y(I),S=l(t,I,r,c);break;default:b&&y(I);var D=new h,M=E[E.length-1].currentNSMap,S=o(t,I,D,M,d,c),F=D.length;if(!D.closed&&u(t,S,D.tagName,x)&&(D.closed=!0,n.nbsp||c.warning("unclosed xml attribute")),b&&F){for(var k=i(b,{}),j=0;j<F;j++){var G=D[j];y(G.offset),G.locator=i(b,{})}r.locator=k,s(D,r,M)&&E.push(D),r.locator=b}else s(D,r,M)&&E.push(D);"http://www.w3.org/1999/xhtml"!==D.uri||D.closed?S++:S=a(t,S,D.tagName,d,r)}}catch(t){c.error("element parse error: "+t),S=-1}S>w?w=S:g(Math.max(I,w)+1)}}function i(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function o(t,e,n,r,i,o){for(var s,a,u=++e,c=m;;){var l=t.charAt(u);switch(l){case"=":if(c===v)s=t.slice(e,u),c=E;else{if(c!==b)throw new Error("attribute equal must after attrName");c=E}break;case"'":case'"':if(c===E||c===v){if(c===v&&(o.warning('attribute value must after "="'),s=t.slice(e,u)),e=u+1,u=t.indexOf(l,e),!(u>0))throw new Error("attribute value no end '"+l+"' match");a=t.slice(e,u).replace(/&#?\w+;/g,i),n.add(s,a,e-1),c=w}else{if(c!=x)throw new Error('attribute value must after "="');a=t.slice(e,u).replace(/&#?\w+;/g,i),n.add(s,a,e),o.warning('attribute "'+s+'" missed start quot('+l+")!!"),e=u+1,c=w}break;case"/":switch(c){case m:n.setTagName(t.slice(e,u));case w:case I:case N:c=N,n.closed=!0;case x:case v:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),c==m&&n.setTagName(t.slice(e,u)),u;case">":switch(c){case m:n.setTagName(t.slice(e,u));case w:case I:case N:break;case x:case v:a=t.slice(e,u),"/"===a.slice(-1)&&(n.closed=!0,a=a.slice(0,-1));case b:c===b&&(a=s),c==x?(o.warning('attribute "'+a+'" missed quot(")!!'),n.add(s,a.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+a+'" missed value!! "'+a+'" instead!!'),n.add(a,a,e));break;case E:throw new Error("attribute value missed!!")}return u;case"€":l=" ";default:if(l<=" ")switch(c){case m:n.setTagName(t.slice(e,u)),c=I;break;case v:s=t.slice(e,u),c=b;break;case x:var a=t.slice(e,u).replace(/&#?\w+;/g,i);o.warning('attribute "'+a+'" missed quot(")!!'),n.add(s,a,e);case w:c=I}else switch(c){case b:n.tagName;"http://www.w3.org/1999/xhtml"===r[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),n.add(s,s,e),e=u,c=v;break;case w:o.warning('attribute space is required"'+s+'"!!');case I:c=v,e=u;break;case E:c=x,e=u;break;case N:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function s(t,e,n){for(var r=t.tagName,i=null,o=t.length;o--;){var s=t[o],a=s.qName,u=s.value,l=a.indexOf(":");if(l>0)var p=s.prefix=a.slice(0,l),h=a.slice(l+1),f="xmlns"===p&&h;else h=a,p=null,f="xmlns"===a&&"";s.localName=h,f!==!1&&(null==i&&(i={},c(n,n={})),n[f]=i[f]=u,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(f,u))}for(var o=t.length;o--;){s=t[o];var p=s.prefix;p&&("xml"===p&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==p&&(s.uri=n[p||""]))}var l=r.indexOf(":");l>0?(p=t.prefix=r.slice(0,l),h=t.localName=r.slice(l+1)):(p=null,h=t.localName=r);var d=t.uri=n[p||""];if(e.startElement(d,h,r,t),!t.closed)return t.currentNSMap=n,t.localNSMap=i,!0;if(e.endElement(d,h,r),i)for(p in i)e.endPrefixMapping(p)}function a(t,e,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),o)}return e+1}function u(t,e,n,r){var i=r[n];return null==i&&(i=t.lastIndexOf("</"+n+">"),i<e&&(i=t.lastIndexOf("</"+n)),r[n]=i),i<e}function c(t,e){for(var n in t)e[n]=t[n]}function l(t,e,n,r){var i=t.charAt(e+2);switch(i){case"-":if("-"===t.charAt(e+3)){var o=t.indexOf("-->",e+4);return o>e?(n.comment(t,e+4,o-e-4),o+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==t.substr(e+3,6)){var o=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,o-e-9),n.endCDATA(),o+3}var s=d(t,e),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],c=a>3&&/^public$/i.test(s[2][0])&&s[3][0],l=a>4&&s[4][0],p=s[a-1];return n.startDTD(u,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function p(t,e,n){var r=t.indexOf("?>",e);if(r){var i=t.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){i[0].length;return n.processingInstruction(i[1],i[2]),r+2}return-1}return-1}function h(t){}function f(t,e){return t.__proto__=e,t}function d(t,e){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);n=i.exec(t);)if(r.push(n),n[1])return r}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),_=new RegExp("^"+g.source+y.source+"*(?::"+g.source+y.source+"*)?$"),m=0,v=1,b=2,E=3,x=4,w=5,I=6,N=7;n.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),c(e,e={}),r(t,e,n,i,this.errorHandler),i.endDocument()}},h.prototype={setTagName:function(t){if(!_.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},add:function(t,e,n){if(!_.test(t))throw new Error("invalid attribute:"+t);this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},f({},f.prototype)instanceof f||(f=function(t,e){function n(){}n.prototype=e,n=new n;for(e in t)n[e]=t[e];return n}),e.XMLReader=n}]); -//# sourceMappingURL=ed6090683ac14375de89.worker.js.map \ No newline at end of file +if(!(e instanceof qt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return T(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?O.BOUNDARY:O.INTERIOR},e}(ze),Ii=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new wi(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wi(0,e,r),this._arg[1]=new wi(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wi(0,i,s),this._arg[1]=new wi(1,o,s)}};Ii.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ii.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Ni=function(){};Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof lt&&T(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new wt,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(T(arguments[0],bt)&&T(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new wt,u=o.iterator();u.hasNext();){var c=u.next(),l=s.map(c);null!==l&&a.add(l)}return a}},Ni.MapOp=function(){};var Ci=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new wt,this._resultLineList=new wt,this._resultPointList=new wt,this._graph=new ze(new Xn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Le(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new wt;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new wt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new wt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),zr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Yr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ne.RIGHT),i.getLocation(1,Ne.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ne.LEFT,r.getLocation(i,Ne.LEFT)),et.isTrue(!r.isNull(i,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ne.RIGHT,r.getLocation(i,Ne.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ii);Ci.overlayOp=function(t,e,n){return new Ci(t,e).getResultGeometry(n)},Ci.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Ci.createEmptyResult(Ci.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ni.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.INTERSECTION)},Ci.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},Ci.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Ci.INTERSECTION:o=Math.min(r,i);break;case Ci.UNION:o=Math.max(r,i);break;case Ci.DIFFERENCE:o=r;break;case Ci.SYMDIFFERENCE:o=Math.max(r,i)}return o},Ci.createEmptyResult=function(t,e,n,r){var i=null;switch(Ci.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Ci.difference=function(t,e){return t.isEmpty()?Ci.createEmptyResult(Ci.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.DIFFERENCE))},Ci.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Ci.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case Ci.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Ci.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Ci.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Ci.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Ci.INTERSECTION=1,Ci.UNION=2,Ci.DIFFERENCE=3,Ci.SYMDIFFERENCE=4;var Si=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Nr,this._seg=new gn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Si.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=_e.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Oi=function(){this._linework=null,this._linework=new wt};Oi.prototype.getLinework=function(){return this._linework},Oi.prototype.filter=function(t){if(t instanceof Zt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Oi.prototype.interfaces_=function(){return[Ut]},Oi.prototype.getClass=function(){return Oi};var Pi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Pi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new wt,n=Ir.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,l=(e.y+t.y)/2;if(this._doLeft){var p=new I(c-u,l+a);r.add(p)}if(this._doRight){var h=new I(c+u,l-a);r.add(h)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ti=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new wt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]},Ri={TOLERANCE:{configurable:!0}};Ti.prototype.reportResult=function(t,e,n){z.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Ti.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ti.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Ti.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Ti.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ti.prototype.isValidResult=function(t,e){var n=Ci.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Ti.prototype.getInvalidLocation=function(){return this._invalidLocation},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ti.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Qr.computeSizeBasedSnapTolerance(t),Qr.computeSizeBasedSnapTolerance(e))},Ti.isValid=function(t,e,n,r){return new Ti(t,e,r).isValid(n)},Ri.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ti,Ri);var Li=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Li.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Li.prototype.combine=function(){for(var t=new wt,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.combine=function(){if(1===arguments.length){var t=arguments[0];return new Li(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Li(Li.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Li(Li.createList(r,i,o)).combine()}},Li.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Li.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new wt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new wt;return s.add(r),s.add(i),s.add(o),s}};var Ai=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new wt)},Di={STRTREE_NODE_CAPACITY:{configurable:!0}};Ai.prototype.reduceToGeometries=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next(),i=null;T(r,xt)?i=this.unionTree(r):r instanceof lt&&(i=r),e.add(i)}return e},Ai.prototype.extractByEnvelope=function(t,e,n){for(var r=new wt,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ai.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Li.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ai.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new sn(Ai.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ai.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ai.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ai.getGeometry(e,n),Ai.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Ai.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ai.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ai.prototype.unionActual=function(t,e){return Ai.restrictToPolygons(t.union(e))},Ai.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ai.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new wt,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Li.combine(r)},Ai.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.restrictToPolygons=function(t){if(T(t,Jt))return t;var e=wr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_e.toPolygonArray(e))},Ai.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ai.union=function(t){return new Ai(t).union()},Di.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ai,Di);var Mi=function(){};Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.UNION)},t.GeoJSONReader=we,t.GeoJSONWriter=Ie,t.OverlayOp=Ci,t.UnionOp=Mi,t.BufferOp=gr,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){"use strict";var r=n(145);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!r(t)}},function(t,e,n){"use strict";var r=n(46),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},function(t,e,n){"use strict";var r=n(142),i=/^\s*class[\s{\/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},function(t,e,n){"use strict";var r=n(143);t.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},function(t,e,n){(function(t){!function(t,n){n(e)}(this,function(e){"use strict";function n(t){return t&&DataView.prototype.isPrototypeOf(t)}function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function i(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return E.iterable&&(e[Symbol.iterator]=function(){return e}),e}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function a(e){return e.bodyUsed?t.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function u(e){return new t(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function c(t){var e=new FileReader,n=u(e);return e.readAsArrayBuffer(t),n}function l(t){var e=new FileReader,n=u(e);return e.readAsText(t),n}function p(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:E.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:E.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:E.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():E.arrayBuffer&&E.blob&&n(t)?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):E.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||w(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):E.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},E.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=a(this);return e?e:ArrayBuffer.isView(this._bodyArrayBuffer)?t.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):t.resolve(this._bodyArrayBuffer)}return this.blob().then(c)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},E.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return I.indexOf(e)>-1?e:t}function g(t,e){if(!(this instanceof g))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var n=e.body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function _(t){var e=new s,n=t.replace(/\r?\n[\t ]+/g," ");return n.split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}function m(t,e){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"",this.headers=new s(e.headers),this.url=e.url||"",this._initBody(t)}function v(n,r){return new t(function(t,o){function a(){l.abort()}function u(t){try{return""===t&&b.location.href?b.location.href:t}catch(e){return t}}var c=new g(n,r);if(c.signal&&c.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;l.onload=function(){var e={status:l.status,statusText:l.statusText,headers:_(l.getAllResponseHeaders()||"")};e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var n="response"in l?l.response:l.responseText;setTimeout(function(){t(new m(n,e))},0)},l.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},l.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},l.onabort=function(){setTimeout(function(){o(new e.DOMException("Aborted","AbortError"))},0)},l.open(c.method,u(c.url),!0),"include"===c.credentials?l.withCredentials=!0:"omit"===c.credentials&&(l.withCredentials=!1),"responseType"in l&&(E.blob?l.responseType="blob":E.arrayBuffer&&c.headers.get("Content-Type")&&c.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(l.responseType="arraybuffer")),!r||"object"!=typeof r.headers||r.headers instanceof s?c.headers.forEach(function(t,e){l.setRequestHeader(e,t)}):Object.getOwnPropertyNames(r.headers).forEach(function(t){l.setRequestHeader(t,i(r.headers[t]))}),c.signal&&(c.signal.addEventListener("abort",a),l.onreadystatechange=function(){4===l.readyState&&c.signal.removeEventListener("abort",a)}),l.send("undefined"==typeof c._bodyInit?null:c._bodyInit)})}var b="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof b&&b,E={searchParams:"URLSearchParams"in b,iterable:"Symbol"in b&&"iterator"in Symbol,blob:"FileReader"in b&&"Blob"in b&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in b,arrayBuffer:"ArrayBuffer"in b};if(E.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(t){return t&&x.indexOf(Object.prototype.toString.call(t))>-1};s.prototype.append=function(t,e){t=r(t),e=i(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},s.prototype.delete=function(t){delete this.map[r(t)]},s.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},s.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},s.prototype.set=function(t,e){this.map[r(t)]=i(e)},s.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},s.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),o(t)},s.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},s.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),o(t)},E.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var N=[301,302,303,307,308];m.redirect=function(t,e){if(N.indexOf(e)===-1)throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},e.DOMException=b.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}v.polyfill=!0,b.fetch||(b.fetch=v,b.Headers=s,b.Request=g,b.Response=m),e.Headers=s,e.Request=g,e.Response=m,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})}).call(e,n(4))},function(t,e,n){function r(t){this.options=t||{locator:{}}}function i(t,e,n){function r(e){var r=t[e];!r&&s&&(r=2==t.length?function(n){t(e,n)}:t),i[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+a(n))}||function(){}}if(!t){if(e instanceof o)return e;t=e}var i={},s=t instanceof Function;return n=n||{},r("warning"),r("error"),r("fatalError"),i}function o(){this.cdata=!1}function s(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function a(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function u(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function c(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}r.prototype.parseFromString=function(t,e){var n=this.options,r=new l,s=n.domBuilder||new o,a=n.errorHandler,u=n.locator,c=n.xmlns||{},p={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&s.setDocumentLocator(u),r.errorHandler=i(a,s,u),r.domBuilder=n.domBuilder||s,/\/x?html?$/.test(e)&&(p.nbsp=" ",p.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t?r.parse(t,c,p):r.errorHandler.error("invalid doc source"),s.doc},o.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var i=this.doc,o=i.createElementNS(t,n||e),a=r.length;c(this,o),this.currentElement=o,this.locator&&s(this.locator,o);for(var u=0;u<a;u++){var t=r.getURI(u),l=r.getValue(u),n=r.getQName(u),p=i.createAttributeNS(t,n);this.locator&&s(r.getLocator(u),p),p.value=p.nodeValue=l,o.setAttributeNode(p)}},endElement:function(t,e,n){var r=this.currentElement;r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&s(this.locator,n),c(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=u.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(t);else var r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&s(this.locator,r)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=u.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&s(this.locator,r),c(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(t,e,n);this.locator&&s(this.locator,i),c(this,i)}},warning:function(t){console.warn("[xmldom warning]\t"+t,a(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,a(this.locator))},fatalError:function(t){throw console.error("[xmldom fatalError]\t"+t,a(this.locator)),t} +},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){o.prototype[t]=function(){return null}});var l=n(148).XMLReader,p=e.DOMImplementation=n(48).DOMImplementation;e.XMLSerializer=n(48).XMLSerializer,e.DOMParser=r},function(t,e){function n(){}function r(t,e,n,r,c){function f(t){if(t>65535){t-=65536;var e=55296+(t>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}function d(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?f(parseInt(e.substr(1).replace("x","0x"))):(c.error("entity not found:"+t),t)}function g(e){if(e>w){var n=t.substring(w,e).replace(/&#?\w+;/g,d);b&&y(w),r.characters(n,0,e-w),w=e}}function y(e,n){for(;e>=m&&(n=v.exec(t));)_=n.index,m=_+n[0].length,b.lineNumber++;b.columnNumber=e-_+1}for(var _=0,m=0,v=/.*(?:\r\n?|\n)|.*$/g,b=r.locator,E=[{currentNSMap:e}],x={},w=0;;){try{var I=t.indexOf("<",w);if(I<0){if(!t.substr(w).match(/^\s*$/)){var N=r.doc,C=N.createTextNode(t.substr(w));N.appendChild(C),r.currentElement=C}return}switch(I>w&&g(I),t.charAt(I+1)){case"/":var S=t.indexOf(">",I+3),O=t.substring(I+2,S),P=E.pop();S<0?(O=t.substring(I+2).replace(/[\s<].*/,""),c.error("end tag name: "+O+" is not complete:"+P.tagName),S=I+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),c.error("end tag name: "+O+" maybe not complete"),S=I+1+O.length);var T=P.localNSMap,R=P.tagName==O,L=R||P.tagName&&P.tagName.toLowerCase()==O.toLowerCase();if(L){if(r.endElement(P.uri,P.localName,O),T)for(var A in T)r.endPrefixMapping(A);R||c.fatalError("end tag name: "+O+" is not match the current start tagName:"+P.tagName)}else E.push(P);S++;break;case"?":b&&y(I),S=p(t,I,r);break;case"!":b&&y(I),S=l(t,I,r,c);break;default:b&&y(I);var D=new h,M=E[E.length-1].currentNSMap,S=o(t,I,D,M,d,c),F=D.length;if(!D.closed&&u(t,S,D.tagName,x)&&(D.closed=!0,n.nbsp||c.warning("unclosed xml attribute")),b&&F){for(var k=i(b,{}),j=0;j<F;j++){var G=D[j];y(G.offset),G.locator=i(b,{})}r.locator=k,s(D,r,M)&&E.push(D),r.locator=b}else s(D,r,M)&&E.push(D);"http://www.w3.org/1999/xhtml"!==D.uri||D.closed?S++:S=a(t,S,D.tagName,d,r)}}catch(t){c.error("element parse error: "+t),S=-1}S>w?w=S:g(Math.max(I,w)+1)}}function i(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function o(t,e,n,r,i,o){for(var s,a,u=++e,c=m;;){var l=t.charAt(u);switch(l){case"=":if(c===v)s=t.slice(e,u),c=E;else{if(c!==b)throw new Error("attribute equal must after attrName");c=E}break;case"'":case'"':if(c===E||c===v){if(c===v&&(o.warning('attribute value must after "="'),s=t.slice(e,u)),e=u+1,u=t.indexOf(l,e),!(u>0))throw new Error("attribute value no end '"+l+"' match");a=t.slice(e,u).replace(/&#?\w+;/g,i),n.add(s,a,e-1),c=w}else{if(c!=x)throw new Error('attribute value must after "="');a=t.slice(e,u).replace(/&#?\w+;/g,i),n.add(s,a,e),o.warning('attribute "'+s+'" missed start quot('+l+")!!"),e=u+1,c=w}break;case"/":switch(c){case m:n.setTagName(t.slice(e,u));case w:case I:case N:c=N,n.closed=!0;case x:case v:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),c==m&&n.setTagName(t.slice(e,u)),u;case">":switch(c){case m:n.setTagName(t.slice(e,u));case w:case I:case N:break;case x:case v:a=t.slice(e,u),"/"===a.slice(-1)&&(n.closed=!0,a=a.slice(0,-1));case b:c===b&&(a=s),c==x?(o.warning('attribute "'+a+'" missed quot(")!!'),n.add(s,a.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+a+'" missed value!! "'+a+'" instead!!'),n.add(a,a,e));break;case E:throw new Error("attribute value missed!!")}return u;case"€":l=" ";default:if(l<=" ")switch(c){case m:n.setTagName(t.slice(e,u)),c=I;break;case v:s=t.slice(e,u),c=b;break;case x:var a=t.slice(e,u).replace(/&#?\w+;/g,i);o.warning('attribute "'+a+'" missed quot(")!!'),n.add(s,a,e);case w:c=I}else switch(c){case b:n.tagName;"http://www.w3.org/1999/xhtml"===r[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),n.add(s,s,e),e=u,c=v;break;case w:o.warning('attribute space is required"'+s+'"!!');case I:c=v,e=u;break;case E:c=x,e=u;break;case N:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function s(t,e,n){for(var r=t.tagName,i=null,o=t.length;o--;){var s=t[o],a=s.qName,u=s.value,l=a.indexOf(":");if(l>0)var p=s.prefix=a.slice(0,l),h=a.slice(l+1),f="xmlns"===p&&h;else h=a,p=null,f="xmlns"===a&&"";s.localName=h,f!==!1&&(null==i&&(i={},c(n,n={})),n[f]=i[f]=u,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(f,u))}for(var o=t.length;o--;){s=t[o];var p=s.prefix;p&&("xml"===p&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==p&&(s.uri=n[p||""]))}var l=r.indexOf(":");l>0?(p=t.prefix=r.slice(0,l),h=t.localName=r.slice(l+1)):(p=null,h=t.localName=r);var d=t.uri=n[p||""];if(e.startElement(d,h,r,t),!t.closed)return t.currentNSMap=n,t.localNSMap=i,!0;if(e.endElement(d,h,r),i)for(p in i)e.endPrefixMapping(p)}function a(t,e,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),o)}return e+1}function u(t,e,n,r){var i=r[n];return null==i&&(i=t.lastIndexOf("</"+n+">"),i<e&&(i=t.lastIndexOf("</"+n)),r[n]=i),i<e}function c(t,e){for(var n in t)e[n]=t[n]}function l(t,e,n,r){var i=t.charAt(e+2);switch(i){case"-":if("-"===t.charAt(e+3)){var o=t.indexOf("-->",e+4);return o>e?(n.comment(t,e+4,o-e-4),o+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==t.substr(e+3,6)){var o=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,o-e-9),n.endCDATA(),o+3}var s=d(t,e),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],c=a>3&&/^public$/i.test(s[2][0])&&s[3][0],l=a>4&&s[4][0],p=s[a-1];return n.startDTD(u,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function p(t,e,n){var r=t.indexOf("?>",e);if(r){var i=t.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){i[0].length;return n.processingInstruction(i[1],i[2]),r+2}return-1}return-1}function h(t){}function f(t,e){return t.__proto__=e,t}function d(t,e){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);n=i.exec(t);)if(r.push(n),n[1])return r}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),_=new RegExp("^"+g.source+y.source+"*(?::"+g.source+y.source+"*)?$"),m=0,v=1,b=2,E=3,x=4,w=5,I=6,N=7;n.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),c(e,e={}),r(t,e,n,i,this.errorHandler),i.endDocument()}},h.prototype={setTagName:function(t){if(!_.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},add:function(t,e,n){if(!_.test(t))throw new Error("invalid attribute:"+t);this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},f({},f.prototype)instanceof f||(f=function(t,e){function n(){}n.prototype=e,n=new n;for(e in t)n[e]=t[e];return n}),e.XMLReader=n}]); +//# sourceMappingURL=505e00b9451ba872d9e7.worker.js.map \ No newline at end of file diff --git a/client/html/prism.js b/client/html/prism.js index 02287804cac7fa80f1c539e7878b5abde89da6ea..39cde35a2ec7374c40fc8f36ed6eaf5a8e8d43f9 100644 --- a/client/html/prism.js +++ b/client/html/prism.js @@ -1,6 +1,6 @@ /*! * PRISM version: 1.1.0-rc.26 - * eoxc version: 1.1.1 + * eoxc version: 1.1.2 */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') @@ -64328,6 +64328,8 @@ return /******/ (function(modules) { // webpackBootstrap var _proj = __webpack_require__(16); + var _wicket = __webpack_require__(1165); + var _util = __webpack_require__(120); var _utils = __webpack_require__(141); @@ -64364,6 +64366,8 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var wkt = new _wicket.Wkt(); + var GroupById = function (_Group) { _inherits(GroupById, _Group); @@ -64760,6 +64764,9 @@ return /******/ (function(modules) { // webpackBootstrap this.listenTo(this.mapModel, 'change:time', function () { _this5.setSearchParamTime(); }); + this.selectionSource.on('change', function () { + _this5.setSearchParamArea(); + }); } }, { key: 'setSearchParamCenter', @@ -64778,6 +64785,26 @@ return /******/ (function(modules) { // webpackBootstrap (0, _util.setSearchParam)('timestart', (0, _util.getISODateTimeString)(this.mapModel.get('time')[0], false)); (0, _util.setSearchParam)('timeend', (0, _util.getISODateTimeString)(this.mapModel.get('time')[1], false)); } + }, { + key: 'setSearchParamArea', + value: function setSearchParamArea() { + var vectorFeatures = this.selectionSource.getFeatures(); + if (vectorFeatures.length !== 2) { + (0, _util.setSearchParam)('area', null); + } else { + var writerOptions = { + decimals: 6, + dataProjection: 'ESPG:4326', + featureProjection: this.projection + }; + // convert feature to geojson format in map projection + var geomJson = this.geoJSONFormat.writeGeometryObject(vectorFeatures[1].getGeometry(), writerOptions); + // write as JSON string and save read it with wkt + wkt.read(JSON.stringify(geomJson)); + // write as WKT string and set it as search param + (0, _util.setSearchParam)('area', wkt.write()); + } + } /** * Set up all events from the layer collections @@ -64997,6 +65024,15 @@ return /******/ (function(modules) { // webpackBootstrap this.onDrawFinished({ feature: feature }); } } + }, { + key: 'filterFromSearchParams', + value: function filterFromSearchParams(area) { + wkt.read(area); + var geometryJson = wkt.toJson(); + var geometry = this.geoJSONFormat.readGeometry(geometryJson); + var feature = new _Feature2.default({ geometry: geometry }); + this.onDrawFinished({ feature: feature }); + } }, { key: 'onDrawFinished', value: function onDrawFinished(event) { @@ -82322,6 +82358,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.parseFeaturesFromFiles = parseFeaturesFromFiles; exports.sizeChangedEvent = sizeChangedEvent; exports.updateConfigBySearchParams = updateConfigBySearchParams; + exports.updateAreaBySearchParams = updateAreaBySearchParams; exports.updateFiltersBySearchParams = updateFiltersBySearchParams; exports.setSearchParamsFilterChange = setSearchParamsFilterChange; @@ -82510,9 +82547,14 @@ return /******/ (function(modules) { // webpackBootstrap if (config.disableSearchParams) { return config; } + var actualWindowObject = window; + if (window.self !== window.top) { + // checking if it is an iframe + actualWindowObject = window.parent; + } // extracts search parameters in url and update settings replacing keys with user supported ones var configUpdate = Object.assign({}, config); - var params = new URLSearchParams(window.location.search); + var params = new URLSearchParams(actualWindowObject.location.search); // validate and set time filter var timeStartStr = params.get('timestart') || params.get('time_start'); var timeEndStr = params.get('timeend') || params.get('time_end'); @@ -82568,9 +82610,28 @@ return /******/ (function(modules) { // webpackBootstrap return configUpdate; } + function updateAreaBySearchParams(mapModel) { + var actualWindowObject = window; + if (window.self !== window.top) { + // checking if it is an iframe + actualWindowObject = window.parent; + } + // extracts search parameters in url and update settings replacing keys with user supported ones + var params = new URLSearchParams(actualWindowObject.location.search); + var area = params.get('area'); + if (typeof area === 'string') { + mapModel.filterFromSearchParams(area); + } + } + function updateFiltersBySearchParams(layerCollection) { // for single layer mode, update values of search filters from url search params - var params = new URLSearchParams(window.location.search); + var actualWindowObject = window; + if (window.self !== window.top) { + // checking if it is an iframe + actualWindowObject = window.parent; + } + var params = new URLSearchParams(actualWindowObject.location.search); var configuredFilters = layerCollection[0].get('search.parameters') || []; configuredFilters.forEach(function (filter, i) { var searchParam = params.get(filter.type); @@ -113154,7 +113215,7 @@ return /******/ (function(modules) { // webpackBootstrap var _paginator = __webpack_require__(309); - var _OpenSearchWorker = __webpack_require__(1165); + var _OpenSearchWorker = __webpack_require__(1166); var _OpenSearchWorker2 = _interopRequireDefault(_OpenSearchWorker); @@ -141143,7 +141204,7 @@ return /******/ (function(modules) { // webpackBootstrap var options = setting.options || param.options; return { type: param.type, - name: param.name, + name: setting.name || param.name, title: param.title || setting.title, mandatory: setting.mandatory || param.mandatory, options: options, @@ -141496,6 +141557,9 @@ return /******/ (function(modules) { // webpackBootstrap if (!config.disableSearchParams && typeof mainOLView.setupSearchParamsEvents === 'function') { mainOLView.setupSearchParamsEvents(); mainOLView.setSearchParamCenter(); + if (typeof mainOLView.filterFromSearchParams === 'function') { + (0, _utils2.updateAreaBySearchParams)(mainOLView); + } // zoom is not explicitely set, as some other event already triggers it } @@ -168475,7 +168539,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 1064 */ /***/ (function(module, exports) { - module.exports = {"_from":"github:eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","_id":"eoxc@1.1.1","_inBundle":false,"_integrity":"","_location":"/eoxc","_phantomChildren":{},"_requested":{"type":"git","raw":"eoxc@github:eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","name":"eoxc","escapedName":"eoxc","rawSpec":"github:eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","saveSpec":"github:eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","fetchSpec":null,"gitCommittish":"969eb010bd3392201c398f5412d94685f79ed8df"},"_requiredBy":["/"],"_resolved":"github:eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","_spec":"eoxc@github:eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","_where":"/home/lubomir/projects/prism","author":{"name":"Fabian Schindler","email":"fabian.schindler.strauss@gmail.com"},"bugs":{"url":"https://github.com/eoxc/eoxc/issues"},"bundleDependencies":false,"dependencies":{"@turf/bbox":"^5.1.5","@turf/difference":"^5.1.5","@turf/helpers":"^5.1.5","@turf/intersect":"^5.1.5","@turf/rewind":"^5.1.5","@turf/union":"^5.1.5","D3.TimeSlider":"^1.6.1","backbone":"^1.3.3","backbone-nested":"^2.0.4","backbone.marionette":"^2.4.5","bluebird":"3.5.5","bootstrap":"^3.3.6","bootstrap-slider":"^9.7.2","core-js":"^2.4.1","d3":"^3.5.17","debounce":"^1.0.0","deep-equal":"^1.0.1","file-saver":"^1.3.3","font-awesome":"^4.6.1","font-awesome-webpack":"0.0.4","i18next":"^3.4.1","jquery":"^2.2.3","jquery-lazyload":"^1.9.7","jquery-ui":"^1.12.0","marionette.sliding-view":"^0.1.0","ol":"6.1.1","opensearch-browser":"2.0.0-alpha.5","underscore":"^1.8.3","url-parse":"^1.4.7","worker-loader":"^0.7.1","xmldom":"^0.1.27"},"deprecated":false,"description":"EOxC client generator","devDependencies":{"babel-core":"^6.5.1","babel-loader":"^6.2.4","babel-plugin-transform-class-properties":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.3.14","babel-preset-es2015":"^6.5.0","babel-register":"^6.5.1","chai":"^3.4.1","coffee-loader":"^0.7.2","coffee-script":"^1.10.0","css-loader":"^0.23.1","eslint":"^3.10.0","eslint-config-airbnb":"^13.0.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^2.2.3","eslint-plugin-react":"^6.6.0","exports-loader":"^0.6.3","file-loader":"^0.8.5","glob":"^6.0.3","handlebars-loader":"^1.3.0","imports-loader":"^0.6.5","json-loader":"^0.5.3","less":"^2.7.1","less-loader":"^2.2.3","minami":"^1.1.1","mocha":"^2.3.4","sinon":"^1.17.2","sinon-chai":"^2.8.0","style-loader":"^0.13.1","url-loader":"^0.5.7","webpack":"^1.12.9","webpack-dev-server":"^1.14.1"},"homepage":"https://github.com/eoxc/eoxc","keywords":[],"license":"MIT","main":"dist/eoxc.js","name":"eoxc","repository":{"type":"git","url":"git+https://github.com/eoxc/eoxc.git"},"scripts":{"build":"webpack -p","build-browser-tests":"webpack -d --config webpack.tests.config.js","build-browser-tests:watch":"npm run build-browser-tests -- --watch","build-dev":"webpack -d","dev-server":"webpack-dev-server --watch","docs":"jsdoc README.md src -d ./docs -r -P package.json -t node_modules/minami","lint":"eslint src","test":"mocha --compilers js:babel-register test/setup/node.js test/unit/**/*.js","test:watch":"npm run test -- -w","watch":"webpack -d --watch"},"version":"1.1.1"} + module.exports = {"_from":"github:eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","_id":"eoxc@1.1.2","_inBundle":false,"_integrity":"","_location":"/eoxc","_phantomChildren":{},"_requested":{"type":"git","raw":"eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","rawSpec":"eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","saveSpec":"github:eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","fetchSpec":null,"gitCommittish":"d706827477c10c51501425851b28253e3aa49653"},"_requiredBy":["#USER","/"],"_resolved":"github:eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","_spec":"eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","_where":"/home/lubomir/projects/prism","author":{"name":"Fabian Schindler","email":"fabian.schindler.strauss@gmail.com"},"bugs":{"url":"https://github.com/eoxc/eoxc/issues"},"bundleDependencies":false,"dependencies":{"@turf/bbox":"^5.1.5","@turf/difference":"^5.1.5","@turf/helpers":"^5.1.5","@turf/intersect":"^5.1.5","@turf/rewind":"^5.1.5","@turf/union":"^5.1.5","D3.TimeSlider":"^1.6.1","backbone":"^1.3.3","backbone-nested":"^2.0.4","backbone.marionette":"^2.4.5","bluebird":"3.5.5","bootstrap":"^3.3.6","bootstrap-slider":"^9.7.2","core-js":"^2.4.1","d3":"^3.5.17","debounce":"^1.0.0","deep-equal":"^1.0.1","file-saver":"^1.3.3","font-awesome":"^4.6.1","font-awesome-webpack":"0.0.4","i18next":"^3.4.1","jquery":"^2.2.3","jquery-lazyload":"^1.9.7","jquery-ui":"^1.12.0","marionette.sliding-view":"^0.1.0","ol":"6.1.1","opensearch-browser":"2.0.0-alpha.5","underscore":"^1.8.3","url-parse":"^1.4.7","wicket":"^1.3.6","worker-loader":"^0.7.1","xmldom":"^0.1.27"},"deprecated":false,"description":"EOxC client generator","devDependencies":{"babel-core":"^6.5.1","babel-loader":"^6.2.4","babel-plugin-transform-class-properties":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.3.14","babel-preset-es2015":"^6.5.0","babel-register":"^6.5.1","chai":"^3.4.1","coffee-loader":"^0.7.2","coffee-script":"^1.10.0","css-loader":"^0.23.1","eslint":"^3.10.0","eslint-config-airbnb":"^13.0.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^2.2.3","eslint-plugin-react":"^6.6.0","exports-loader":"^0.6.3","file-loader":"^0.8.5","glob":"^6.0.3","handlebars-loader":"^1.3.0","imports-loader":"^0.6.5","json-loader":"^0.5.3","less":"^2.7.1","less-loader":"^2.2.3","minami":"^1.1.1","mocha":"^2.3.4","sinon":"^1.17.2","sinon-chai":"^2.8.0","style-loader":"^0.13.1","url-loader":"^0.5.7","webpack":"^1.12.9","webpack-dev-server":"^1.14.1"},"homepage":"https://github.com/eoxc/eoxc","keywords":[],"license":"MIT","main":"dist/eoxc.js","name":"eoxc","repository":{"type":"git","url":"git+https://github.com/eoxc/eoxc.git"},"scripts":{"build":"webpack -p","build-browser-tests":"webpack -d --config webpack.tests.config.js","build-browser-tests:watch":"npm run build-browser-tests -- --watch","build-dev":"webpack -d","dev-server":"webpack-dev-server --watch","docs":"jsdoc README.md src -d ./docs -r -P package.json -t node_modules/minami","lint":"eslint src","test":"mocha --compilers js:babel-register test/setup/node.js test/unit/**/*.js","test:watch":"npm run test -- -w","watch":"webpack -d --watch"},"version":"1.1.2"} /***/ }), /* 1065 */ @@ -168487,7 +168551,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 1066 */ /***/ (function(module, exports) { - module.exports = {"name":"prism","version":"1.1.0-rc.26","description":"prism","scripts":{"build":"webpack -p && cp src/index.html dist/","build-dev":"webpack -d","watch":"webpack -d --watch","build-browser-tests":"webpack -d --config webpack.tests.config.js","build-browser-tests:watch":"npm run build-browser-tests -- --watch","dev-server":"webpack-dev-server -d --content-base src/","docs":"node_modules/.bin/jsdoc README.md src -d ./docs -r -P package.json -t node_modules/minami","lint":"./node_modules/.bin/eslint src"},"repository":{"type":"git","url":"https://github.com/eoxc/prism.git"},"keywords":[],"author":"Lubomir Bucek <lubomir.bucek@eox.at>","license":"MIT","bugs":{"url":"https://github.com/eoxc/prism/issues"},"homepage":"https://github.com/eoxc/prism","devDependencies":{"babel-core":"^6.5.1","babel-loader":"^6.2.4","babel-plugin-transform-class-properties":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.19.0","babel-polyfill":"^6.3.14","babel-preset-es2015":"^6.5.0","babel-register":"^6.5.1","chai":"^3.4.1","coffee-loader":"^0.7.2","coffee-script":"^1.10.0","css-loader":"^0.23.1","eslint":"^3.14.1","eslint-config-airbnb":"^13.0.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^2.2.3","eslint-plugin-react":"^6.6.0","exports-loader":"^0.6.3","file-loader":"^0.8.5","glob":"^6.0.3","handlebars":"^4.3.3","handlebars-loader":"^1.4.0","imports-loader":"^0.6.5","json-loader":"^0.5.3","less":"^2.7.1","less-loader":"^2.2.3","minami":"^1.1.1","node-sass":"^4.13.1","sass-loader":"^6.0.0","sinon":"^1.17.2","sinon-chai":"^2.8.0","style-loader":"^0.13.1","url-loader":"^0.5.7","webpack":"^1.15.0","webpack-dev-server":"^1.14.1"},"dependencies":{"@tmcw/togeojson":"github:tmcw/togeojson","anno.js":"^1.0.3","autoprefixer":"^6.7.5","backbone.marionette":"^2.4.7","bootstrap":"^3.4.1","bootstrap-slider":"^9.9.1","eonasdan-bootstrap-datetimepicker":"^4.17.42","eoxc":"eoxc/eoxc#969eb010bd3392201c398f5412d94685f79ed8df","i18next":"^3.4.1","jquery":"^2.2.3","jquery-ui":"^1.10.5","jszip":"^2.6.1","moment-timezone":"^0.5.10","parse-color":"^1.0.0","postcss-loader":"^1.3.2","script-path":"^1.0.1","shpjs":"github:calvinmetcalf/shapefile-js#v3.3.2","tether-shepherd":"^1.8.1","url-search-params-polyfill":"^8.1.0","worker-loader":"^0.7.1"}} + module.exports = {"name":"prism","version":"1.1.0-rc.26","description":"prism","scripts":{"build":"webpack -p && cp src/index.html dist/","build-dev":"webpack -d","watch":"webpack -d --watch","build-browser-tests":"webpack -d --config webpack.tests.config.js","build-browser-tests:watch":"npm run build-browser-tests -- --watch","dev-server":"webpack-dev-server -d --content-base src/","docs":"node_modules/.bin/jsdoc README.md src -d ./docs -r -P package.json -t node_modules/minami","lint":"./node_modules/.bin/eslint src"},"repository":{"type":"git","url":"https://github.com/eoxc/prism.git"},"keywords":[],"author":"Lubomir Bucek <lubomir.bucek@eox.at>","license":"MIT","bugs":{"url":"https://github.com/eoxc/prism/issues"},"homepage":"https://github.com/eoxc/prism","devDependencies":{"babel-core":"^6.5.1","babel-loader":"^6.2.4","babel-plugin-transform-class-properties":"^6.8.0","babel-plugin-transform-object-rest-spread":"^6.19.0","babel-polyfill":"^6.3.14","babel-preset-es2015":"^6.5.0","babel-register":"^6.5.1","chai":"^3.4.1","coffee-loader":"^0.7.2","coffee-script":"^1.10.0","css-loader":"^0.23.1","eslint":"^3.14.1","eslint-config-airbnb":"^13.0.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^2.2.3","eslint-plugin-react":"^6.6.0","exports-loader":"^0.6.3","file-loader":"^0.8.5","glob":"^6.0.3","handlebars":"^4.3.3","handlebars-loader":"^1.4.0","imports-loader":"^0.6.5","json-loader":"^0.5.3","less":"^2.7.1","less-loader":"^2.2.3","minami":"^1.1.1","node-sass":"^4.13.1","sass-loader":"^6.0.0","sinon":"^1.17.2","sinon-chai":"^2.8.0","style-loader":"^0.13.1","url-loader":"^0.5.7","webpack":"^1.15.0","webpack-dev-server":"^1.14.1"},"dependencies":{"@tmcw/togeojson":"github:tmcw/togeojson","anno.js":"^1.0.3","autoprefixer":"^6.7.5","backbone.marionette":"^2.4.7","bootstrap":"^3.4.1","bootstrap-slider":"^9.9.1","eonasdan-bootstrap-datetimepicker":"^4.17.42","eoxc":"github:eoxc/eoxc#d706827477c10c51501425851b28253e3aa49653","i18next":"^3.4.1","jquery":"^2.2.3","jquery-ui":"^1.10.5","jszip":"^2.6.1","moment-timezone":"^0.5.10","parse-color":"^1.0.0","postcss-loader":"^1.3.2","script-path":"^1.0.1","shpjs":"github:calvinmetcalf/shapefile-js#v3.3.2","tether-shepherd":"^1.8.1","url-search-params-polyfill":"^8.1.0","worker-loader":"^0.7.1"}} /***/ }), /* 1067 */ @@ -186284,12 +186348,13 @@ return /******/ (function(modules) { // webpackBootstrap true ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.WHATWGFetch = {}))); - }(this, (function (exports) { + }(this, (function (exports) { 'use strict'; + + var global = + (typeof globalThis !== 'undefined' && globalThis) || + (typeof self !== 'undefined' && self) || + (typeof global !== 'undefined' && global); - var global = (function(self) { - return self - // eslint-disable-next-line no-invalid-this - })(typeof self !== 'undefined' ? self : this); var support = { searchParams: 'URLSearchParams' in global, iterable: 'Symbol' in global && 'iterator' in Symbol, @@ -186564,7 +186629,20 @@ return /******/ (function(modules) { // webpackBootstrap this.arrayBuffer = function() { if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) + var isConsumed = consumed(this); + if (isConsumed) { + return isConsumed + } + if (ArrayBuffer.isView(this._bodyArrayBuffer)) { + return Promise.resolve( + this._bodyArrayBuffer.buffer.slice( + this._bodyArrayBuffer.byteOffset, + this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength + ) + ) + } else { + return Promise.resolve(this._bodyArrayBuffer) + } } else { return this.blob().then(readBlobAsArrayBuffer) } @@ -186610,6 +186688,10 @@ return /******/ (function(modules) { // webpackBootstrap } function Request(input, options) { + if (!(this instanceof Request)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') + } + options = options || {}; var body = options.body; @@ -186702,6 +186784,9 @@ return /******/ (function(modules) { // webpackBootstrap Body.call(Request.prototype); function Response(bodyInit, options) { + if (!(this instanceof Response)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') + } if (!options) { options = {}; } @@ -186743,8 +186828,9 @@ return /******/ (function(modules) { // webpackBootstrap }; exports.DOMException = global.DOMException; - - if (typeof exports.DOMException !== 'function') { + try { + new exports.DOMException(); + } catch (err) { exports.DOMException = function(message, name) { this.message = message; this.name = name; @@ -186828,9 +186914,15 @@ return /******/ (function(modules) { // webpackBootstrap } } - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value); - }); + if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) { + Object.getOwnPropertyNames(init.headers).forEach(function(name) { + xhr.setRequestHeader(name, normalizeValue(init.headers[name])); + }); + } else { + request.headers.forEach(function(value, name) { + xhr.setRequestHeader(name, value); + }); + } if (request.signal) { request.signal.addEventListener('abort', abortXhr); @@ -186869,10 +186961,907 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }), /* 1165 */ +/***/ (function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/** @license + * + * Copyright (C) 2012 K. Arthur Endsley (kaendsle@mtu.edu) + * Michigan Tech Research Institute (MTRI) + * 3600 Green Court, Suite 100, Ann Arbor, MI, 48105 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + + (function (root, factory) { + + if (true) { + // AMD (+ global for extensions) + !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return factory(); + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof module !== 'undefined' && typeof exports === "object") { + // CommonJS + module.exports = factory(); + } else { + // Browser + root.Wkt = factory(); + } + }(this, function () { + + + var beginsWith, endsWith, root, Wkt; + + // Establish the root object, window in the browser, or exports on the server + root = this; + + /** + * @desc The Wkt namespace. + * @property {String} delimiter - The default delimiter for separating components of atomic geometry (coordinates) + * @namespace + * @global + */ + Wkt = function (obj) { + if (obj instanceof Wkt) return obj; + if (!(this instanceof Wkt)) return new Wkt(obj); + this._wrapped = obj; + }; + + + + /** + * Returns true if the substring is found at the beginning of the string. + * @param str {String} The String to search + * @param sub {String} The substring of interest + * @return {Boolean} + * @private + */ + beginsWith = function (str, sub) { + return str.substring(0, sub.length) === sub; + }; + + /** + * Returns true if the substring is found at the end of the string. + * @param str {String} The String to search + * @param sub {String} The substring of interest + * @return {Boolean} + * @private + */ + endsWith = function (str, sub) { + return str.substring(str.length - sub.length) === sub; + }; + + /** + * The default delimiter for separating components of atomic geometry (coordinates) + * @ignore + */ + Wkt.delimiter = ' '; + + /** + * Determines whether or not the passed Object is an Array. + * @param obj {Object} The Object in question + * @return {Boolean} + * @member Wkt.isArray + * @method + */ + Wkt.isArray = function (obj) { + return !!(obj && obj.constructor === Array); + }; + + /** + * Removes given character String(s) from a String. + * @param str {String} The String to search + * @param sub {String} The String character(s) to trim + * @return {String} The trimmed string + * @member Wkt.trim + * @method + */ + Wkt.trim = function (str, sub) { + sub = sub || ' '; // Defaults to trimming spaces + // Trim beginning spaces + while (beginsWith(str, sub)) { + str = str.substring(1); + } + // Trim ending spaces + while (endsWith(str, sub)) { + str = str.substring(0, str.length - 1); + } + return str; + }; + + /** + * An object for reading WKT strings and writing geographic features + * @constructor this.Wkt.Wkt + * @param initializer {String} An optional WKT string for immediate read + * @property {Array} components - Holder for atomic geometry objects (internal representation of geometric components) + * @property {String} delimiter - The default delimiter for separating components of atomic geometry (coordinates) + * @property {Object} regExes - Some regular expressions copied from OpenLayers.Format.WKT.js + * @property {String} type - The Well-Known Text name (e.g. 'point') of the geometry + * @property {Boolean} wrapVerticies - True to wrap vertices in MULTIPOINT geometries; If true: MULTIPOINT((30 10),(10 30),(40 40)); If false: MULTIPOINT(30 10,10 30,40 40) + * @return {this.Wkt.Wkt} + * @memberof Wkt + */ + Wkt.Wkt = function (initializer) { + + /** + * The default delimiter between X and Y coordinates. + * @ignore + */ + this.delimiter = Wkt.delimiter || ' '; + + /** + * Configuration parameter for controlling how Wicket seralizes + * MULTIPOINT strings. Examples; both are valid WKT: + * If true: MULTIPOINT((30 10),(10 30),(40 40)) + * If false: MULTIPOINT(30 10,10 30,40 40) + * @ignore + */ + this.wrapVertices = true; + + /** + * Some regular expressions copied from OpenLayers.Format.WKT.js + * @ignore + */ + this.regExes = { + 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/, + 'spaces': /\s+|\+/, // Matches the '+' or the empty space + 'numeric': /-*\d+(\.*\d+)?/, + 'comma': /\s*,\s*/, + 'parenComma': /\)\s*,\s*\(/, + 'coord': /-*\d+\.*\d+ -*\d+\.*\d+/, // e.g. "24 -14" + 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/, + 'ogcTypes': /^(multi)?(point|line|polygon|box)?(string)?$/i, // Captures e.g. "Multi","Line","String" + 'crudeJson': /^{.*"(type|coordinates|geometries|features)":.*}$/ // Attempts to recognize JSON strings + }; + + /** + * Strip any whitespace and parens from front and back. + * This is the equivalent of s/^\s*\(?(.*)\)?\s*$/$1/ but without the risk of catastrophic backtracking. + * @param str {String} + */ + this._stripWhitespaceAndParens = function (fullStr) { + var trimmed = fullStr.trim(); + var noParens = trimmed.replace(/^\(?(.*?)\)?$/, '$1'); + return noParens; + }; + + /** + * The internal representation of geometry--the "components" of geometry. + * @ignore + */ + this.components = undefined; + + // An initial WKT string may be provided + if (initializer && typeof initializer === 'string') { + this.read(initializer); + } else if (initializer && typeof initializer !== undefined) { + this.fromObject(initializer); + } + + }; + + + + /** + * Returns true if the internal geometry is a collection of geometries. + * @return {Boolean} Returns true when it is a collection + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.isCollection = function () { + switch (this.type.slice(0, 5)) { + case 'multi': + // Trivial; any multi-geometry is a collection + return true; + case 'polyg': + // Polygons with holes are "collections" of rings + return true; + default: + // Any other geometry is not a collection + return false; + } + }; + + /** + * Compares two x,y coordinates for equality. + * @param a {Object} An object with x and y properties + * @param b {Object} An object with x and y properties + * @return {Boolean} + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.sameCoords = function (a, b) { + return (a.x === b.x && a.y === b.y); + }; + + /** + * Sets internal geometry (components) from framework geometry (e.g. + * Google Polygon objects or google.maps.Polygon). + * @param obj {Object} The framework-dependent geometry representation + * @return {this.Wkt.Wkt} The object itself + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.fromObject = function (obj) { + var result; + + if (obj.hasOwnProperty('type') && obj.hasOwnProperty('coordinates')) { + result = this.fromJson(obj); + } else { + result = this.deconstruct.call(this, obj); + } + + this.components = result.components; + this.isRectangle = result.isRectangle || false; + this.type = result.type; + return this; + }; + + /** + * Creates external geometry objects based on a plug-in framework's + * construction methods and available geometry classes. + * @param config {Object} An optional framework-dependent properties specification + * @return {Object} The framework-dependent geometry representation + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.toObject = function (config) { + var obj = this.construct[this.type].call(this, config); + // Don't assign the "properties" property to an Array + if (typeof obj === 'object' && !Wkt.isArray(obj)) { + obj.properties = this.properties; + } + return obj; + }; + + /** + * Returns the WKT string representation; the same as the write() method. + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.toString = function (config) { + return this.write(); + }; + + /** + * Parses a JSON representation as an Object. + * @param obj {Object} An Object with the GeoJSON schema + * @return {this.Wkt.Wkt} The object itself + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.fromJson = function (obj) { + var i, j, k, coords, iring, oring; + + this.type = obj.type.toLowerCase(); + this.components = []; + if (obj.hasOwnProperty('geometry')) { //Feature + this.fromJson(obj.geometry); + this.properties = obj.properties; + return this; + } + coords = obj.coordinates; + + if (!Wkt.isArray(coords[0])) { // Point + this.components.push({ + x: coords[0], + y: coords[1] + }); + + } else { + + for (i in coords) { + if (coords.hasOwnProperty(i)) { + + if (!Wkt.isArray(coords[i][0])) { // LineString + + if (this.type === 'multipoint') { // MultiPoint + this.components.push([{ + x: coords[i][0], + y: coords[i][1] + }]); + + } else { + this.components.push({ + x: coords[i][0], + y: coords[i][1] + }); + + } + + } else { + + oring = []; + for (j in coords[i]) { + if (coords[i].hasOwnProperty(j)) { + + if (!Wkt.isArray(coords[i][j][0])) { + oring.push({ + x: coords[i][j][0], + y: coords[i][j][1] + }); + + } else { + + iring = []; + for (k in coords[i][j]) { + if (coords[i][j].hasOwnProperty(k)) { + + iring.push({ + x: coords[i][j][k][0], + y: coords[i][j][k][1] + }); + + } + } + + oring.push(iring); + + } + + } + } + + this.components.push(oring); + } + } + } + + } + + return this; + }; + + /** + * Creates a JSON representation, with the GeoJSON schema, of the geometry. + * @return {Object} The corresponding GeoJSON representation + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.toJson = function () { + var cs, json, i, j, k, ring, rings; + + cs = this.components; + json = { + coordinates: [], + type: (function () { + var i, type, s; + + type = this.regExes.ogcTypes.exec(this.type).slice(1); + s = []; + + for (i in type) { + if (type.hasOwnProperty(i)) { + if (type[i] !== undefined) { + s.push(type[i].toLowerCase().slice(0, 1).toUpperCase() + type[i].toLowerCase().slice(1)); + } + } + } + + return s; + }.call(this)).join('') + } + + // Wkt BOX type gets a special bbox property in GeoJSON + if (this.type.toLowerCase() === 'box') { + json.type = 'Polygon'; + json.bbox = []; + + for (i in cs) { + if (cs.hasOwnProperty(i)) { + json.bbox = json.bbox.concat([cs[i].x, cs[i].y]); + } + } + + json.coordinates = [ + [ + [cs[0].x, cs[0].y], + [cs[0].x, cs[1].y], + [cs[1].x, cs[1].y], + [cs[1].x, cs[0].y], + [cs[0].x, cs[0].y] + ] + ]; + + return json; + } + + // For the coordinates of most simple features + for (i in cs) { + if (cs.hasOwnProperty(i)) { + + // For those nested structures + if (Wkt.isArray(cs[i])) { + rings = []; + + for (j in cs[i]) { + if (cs[i].hasOwnProperty(j)) { + + if (Wkt.isArray(cs[i][j])) { // MULTIPOLYGONS + ring = []; + + for (k in cs[i][j]) { + if (cs[i][j].hasOwnProperty(k)) { + ring.push([cs[i][j][k].x, cs[i][j][k].y]); + } + } + + rings.push(ring); + + } else { // POLYGONS and MULTILINESTRINGS + + if (cs[i].length > 1) { + rings.push([cs[i][j].x, cs[i][j].y]); + + } else { // MULTIPOINTS + rings = rings.concat([cs[i][j].x, cs[i][j].y]); + } + } + } + } + + json.coordinates.push(rings); + + } else { + if (cs.length > 1) { // For LINESTRING type + json.coordinates.push([cs[i].x, cs[i].y]); + + } else { // For POINT type + json.coordinates = json.coordinates.concat([cs[i].x, cs[i].y]); + } + } + + } + } + + return json; + }; + + /** + * Absorbs the geometry of another this.Wkt.Wkt instance, merging it with its own, + * creating a collection (MULTI-geometry) based on their types, which must agree. + * For example, creates a MULTIPOLYGON from a POLYGON type merged with another + * POLYGON type, or adds a POLYGON instance to a MULTIPOLYGON instance. + * @param wkt {String} A Wkt.Wkt object + * @return {this.Wkt.Wkt} The object itself + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.merge = function (wkt) { + var prefix = this.type.slice(0, 5); + + if (this.type !== wkt.type) { + if (this.type.slice(5, this.type.length) !== wkt.type) { + throw TypeError('The input geometry types must agree or the calling this.Wkt.Wkt instance must be a multigeometry of the other'); + } + } + + switch (prefix) { + + case 'point': + this.components = [this.components.concat(wkt.components)]; + break; + + case 'multi': + this.components = this.components.concat((wkt.type.slice(0, 5) === 'multi') ? wkt.components : [wkt.components]); + break; + + default: + this.components = [ + this.components, + wkt.components + ]; + break; + + } + + if (prefix !== 'multi') { + this.type = 'multi' + this.type; + } + return this; + }; + + /** + * Reads a WKT string, validating and incorporating it. + * @param str {String} A WKT or GeoJSON string + * @return {this.Wkt.Wkt} The object itself + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.read = function (str) { + var matches; + matches = this.regExes.typeStr.exec(str); + if (matches) { + this.type = matches[1].toLowerCase(); + this.base = matches[2]; + if (this.ingest[this.type]) { + this.components = this.ingest[this.type].apply(this, [this.base]); + } + + } else { + if (this.regExes.crudeJson.test(str)) { + if (typeof JSON === 'object' && typeof JSON.parse === 'function') { + this.fromJson(JSON.parse(str)); + + } else { + console.log('JSON.parse() is not available; cannot parse GeoJSON strings'); + throw { + name: 'JSONError', + message: 'JSON.parse() is not available; cannot parse GeoJSON strings' + }; + } + + } else { + console.log('Invalid WKT string provided to read()'); + throw { + name: 'WKTError', + message: 'Invalid WKT string provided to read()' + }; + } + } + + return this; + }; // eo readWkt + + /** + * Writes a WKT string. + * @param components {Array} An Array of internal geometry objects + * @return {String} The corresponding WKT representation + * @memberof this.Wkt.Wkt + * @method + */ + Wkt.Wkt.prototype.write = function (components) { + var i, pieces, data; + + components = components || this.components; + + pieces = []; + + pieces.push(this.type.toUpperCase() + '('); + + for (i = 0; i < components.length; i += 1) { + if (this.isCollection() && i > 0) { + pieces.push(','); + } + + // There should be an extract function for the named type + if (!this.extract[this.type]) { + return null; + } + + data = this.extract[this.type].apply(this, [components[i]]); + if (this.isCollection() && this.type !== 'multipoint') { + pieces.push('(' + data + ')'); + + } else { + pieces.push(data); + + // If not at the end of the components, add a comma + if (i !== (components.length - 1) && this.type !== 'multipoint') { + pieces.push(','); + } + + } + } + + pieces.push(')'); + + return pieces.join(''); + }; + + /** + * This object contains functions as property names that extract WKT + * strings from the internal representation. + * @memberof this.Wkt.Wkt + * @namespace this.Wkt.Wkt.extract + * @instance + */ + Wkt.Wkt.prototype.extract = { + /** + * Return a WKT string representing atomic (point) geometry + * @param point {Object} An object with x and y properties + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + point: function (point) { + return String(point.x) + this.delimiter + String(point.y); + }, + + /** + * Return a WKT string representing multiple atoms (points) + * @param multipoint {Array} Multiple x-and-y objects + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + multipoint: function (multipoint) { + var i, parts = [], + s; + + for (i = 0; i < multipoint.length; i += 1) { + s = this.extract.point.apply(this, [multipoint[i]]); + + if (this.wrapVertices) { + s = '(' + s + ')'; + } + + parts.push(s); + } + + return parts.join(','); + }, + + /** + * Return a WKT string representing a chain (linestring) of atoms + * @param linestring {Array} Multiple x-and-y objects + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + linestring: function (linestring) { + // Extraction of linestrings is the same as for points + return this.extract.point.apply(this, [linestring]); + }, + + /** + * Return a WKT string representing multiple chains (multilinestring) of atoms + * @param multilinestring {Array} Multiple of multiple x-and-y objects + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + multilinestring: function (multilinestring) { + var i, parts = []; + + if (multilinestring.length) { + for (i = 0; i < multilinestring.length; i += 1) { + parts.push(this.extract.linestring.apply(this, [multilinestring[i]])); + } + } else { + parts.push(this.extract.point.apply(this, [multilinestring])); + } + + return parts.join(','); + }, + + /** + * Return a WKT string representing multiple atoms in closed series (polygon) + * @param polygon {Array} Collection of ordered x-and-y objects + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + polygon: function (polygon) { + // Extraction of polygons is the same as for multilinestrings + return this.extract.multilinestring.apply(this, [polygon]); + }, + + /** + * Return a WKT string representing multiple closed series (multipolygons) of multiple atoms + * @param multipolygon {Array} Collection of ordered x-and-y objects + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + multipolygon: function (multipolygon) { + var i, parts = []; + for (i = 0; i < multipolygon.length; i += 1) { + parts.push('(' + this.extract.polygon.apply(this, [multipolygon[i]]) + ')'); + } + return parts.join(','); + }, + + /** + * Return a WKT string representing a 2DBox + * @param multipolygon {Array} Collection of ordered x-and-y objects + * @return {String} The WKT representation + * @memberof this.Wkt.Wkt.extract + * @instance + */ + box: function (box) { + return this.extract.linestring.apply(this, [box]); + }, + + geometrycollection: function (str) { + console.log('The geometrycollection WKT type is not yet supported.'); + } + }; + + /** + * This object contains functions as property names that ingest WKT + * strings into the internal representation. + * @memberof this.Wkt.Wkt + * @namespace this.Wkt.Wkt.ingest + * @instance + */ + Wkt.Wkt.prototype.ingest = { + + /** + * Return point feature given a point WKT fragment. + * @param str {String} A WKT fragment representing the point + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + point: function (str) { + var coords = Wkt.trim(str).split(this.regExes.spaces); + // In case a parenthetical group of coordinates is passed... + return [{ // ...Search for numeric substrings + x: parseFloat(this.regExes.numeric.exec(coords[0])[0]), + y: parseFloat(this.regExes.numeric.exec(coords[1])[0]) + }]; + }, + + /** + * Return a multipoint feature given a multipoint WKT fragment. + * @param str {String} A WKT fragment representing the multipoint + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + multipoint: function (str) { + var i, components, points; + components = []; + points = Wkt.trim(str).split(this.regExes.comma); + for (i = 0; i < points.length; i += 1) { + components.push(this.ingest.point.apply(this, [points[i]])); + } + return components; + }, + + /** + * Return a linestring feature given a linestring WKT fragment. + * @param str {String} A WKT fragment representing the linestring + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + linestring: function (str) { + var i, multipoints, components; + + // In our x-and-y representation of components, parsing + // multipoints is the same as parsing linestrings + multipoints = this.ingest.multipoint.apply(this, [str]); + + // However, the points need to be joined + components = []; + for (i = 0; i < multipoints.length; i += 1) { + components = components.concat(multipoints[i]); + } + return components; + }, + + /** + * Return a multilinestring feature given a multilinestring WKT fragment. + * @param str {String} A WKT fragment representing the multilinestring + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + multilinestring: function (str) { + var i, components, line, lines; + components = []; + + lines = Wkt.trim(str).split(this.regExes.doubleParenComma); + if (lines.length === 1) { // If that didn't work... + lines = Wkt.trim(str).split(this.regExes.parenComma); + } + + for (i = 0; i < lines.length; i += 1) { + line = this._stripWhitespaceAndParens(lines[i]); + components.push(this.ingest.linestring.apply(this, [line])); + } + + return components; + }, + + /** + * Return a polygon feature given a polygon WKT fragment. + * @param str {String} A WKT fragment representing the polygon + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + polygon: function (str) { + var i, j, components, subcomponents, ring, rings; + rings = Wkt.trim(str).split(this.regExes.parenComma); + components = []; // Holds one or more rings + for (i = 0; i < rings.length; i += 1) { + ring = this._stripWhitespaceAndParens(rings[i]).split(this.regExes.comma); + subcomponents = []; // Holds the outer ring and any inner rings (holes) + for (j = 0; j < ring.length; j += 1) { + // Split on the empty space or '+' character (between coordinates) + var split = ring[j].split(this.regExes.spaces); + if (split.length > 2) { + //remove the elements which are blanks + split = split.filter(function (n) { + return n != "" + }); + } + if (split.length === 2) { + var x_cord = split[0]; + var y_cord = split[1]; + + //now push + subcomponents.push({ + x: parseFloat(x_cord), + y: parseFloat(y_cord) + }); + } + } + components.push(subcomponents); + } + return components; + }, + + /** + * Return box vertices (which would become the Rectangle bounds) given a Box WKT fragment. + * @param str {String} A WKT fragment representing the box + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + box: function (str) { + var i, multipoints, components; + + // In our x-and-y representation of components, parsing + // multipoints is the same as parsing linestrings + multipoints = this.ingest.multipoint.apply(this, [str]); + + // However, the points need to be joined + components = []; + for (i = 0; i < multipoints.length; i += 1) { + components = components.concat(multipoints[i]); + } + + return components; + }, + + /** + * Return a multipolygon feature given a multipolygon WKT fragment. + * @param str {String} A WKT fragment representing the multipolygon + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + multipolygon: function (str) { + var i, components, polygon, polygons; + components = []; + polygons = Wkt.trim(str).split(this.regExes.doubleParenComma); + for (i = 0; i < polygons.length; i += 1) { + polygon = this._stripWhitespaceAndParens(polygons[i]); + components.push(this.ingest.polygon.apply(this, [polygon])); + } + return components; + }, + + /** + * Return an array of features given a geometrycollection WKT fragment. + * @param str {String} A WKT fragment representing the geometry collection + * @memberof this.Wkt.Wkt.ingest + * @instance + */ + geometrycollection: function (str) { + console.log('The geometrycollection WKT type is not yet supported.'); + } + + }; // eo ingest + + return Wkt; + })); + + +/***/ }), +/* 1166 */ /***/ (function(module, exports, __webpack_require__) { module.exports = function() { - return new Worker(__webpack_require__.p + "ed6090683ac14375de89.worker.js"); + return new Worker(__webpack_require__.p + "505e00b9451ba872d9e7.worker.js"); }; /***/ }) diff --git a/config/vhr18_index-dev.html b/config/vhr18_index-dev.html index f6fcaef88be4ef4affd4006387352fe073b7a9e6..7edc52050848f7dd15974fc055fc47c9e2967c67 100644 --- a/config/vhr18_index-dev.html +++ b/config/vhr18_index-dev.html @@ -225,13 +225,38 @@ "pageSize": 200, "countZeroRecords": true, "parameters": [ - { - "max": 100, - "min": 0, - "range": true, - "type": "eo:cloudCover", - "title": "Cloud Coverage" - }, + { + "type": "eo:sensorMode", + "name": "Sensor", + "title": "Sensor Mode" + }, + { + "max": 100, + "min": 0, + "step": 1, + "range": true, + "type": "eo:cloudCover", + "name": "Cloud Coverage", + "title": "Cloud Coverage in percent" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:acrossTrackIncidenceAngle", + "name": "Offnadir angle", + "title": "Across Track Incidence Angle in degrees" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:illuminationAzimuthAngle", + "name": "Sun elevation", + "title": "Illumination Azimuth Angle in degrees" + }, ], "parametersFilterSettings": { "collapsed": false, @@ -295,13 +320,38 @@ "pageSize": 200, "countZeroRecords": true, "parameters": [ - { - "max": 100, - "min": 0, - "range": true, - "type": "eo:cloudCover", - "title": "Cloud Coverage" - }, + { + "type": "eo:sensorMode", + "name": "Sensor", + "title": "Sensor Mode" + }, + { + "max": 100, + "min": 0, + "step": 1, + "range": true, + "type": "eo:cloudCover", + "name": "Cloud Coverage", + "title": "Cloud Coverage in percent" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:acrossTrackIncidenceAngle", + "name": "Offnadir angle", + "title": "Across Track Incidence Angle in degrees" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:illuminationAzimuthAngle", + "name": "Sun elevation", + "title": "Illumination Azimuth Angle in degrees" + }, ], "parametersFilterSettings": { "collapsed": false, diff --git a/config/vhr18_index-ops.html b/config/vhr18_index-ops.html index e37daa1932e4c60780c5f3a8f3b7981848f979aa..405a10ede068684a958f18494550c0e94c5fe557 100644 --- a/config/vhr18_index-ops.html +++ b/config/vhr18_index-ops.html @@ -245,13 +245,38 @@ "pageSize": 200, "countZeroRecords": true, "parameters": [ - { - "max": 100, - "min": 0, - "range": true, - "type": "eo:cloudCover", - "title": "Cloud Coverage" - }, + { + "type": "eo:sensorMode", + "name": "Sensor", + "title": "Sensor Mode" + }, + { + "max": 100, + "min": 0, + "step": 1, + "range": true, + "type": "eo:cloudCover", + "name": "Cloud Coverage", + "title": "Cloud Coverage in percent" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:acrossTrackIncidenceAngle", + "name": "Offnadir angle", + "title": "Across Track Incidence Angle in degrees" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:illuminationAzimuthAngle", + "name": "Sun elevation", + "title": "Illumination Azimuth Angle in degrees" + }, ], "parametersFilterSettings": { "collapsed": false, @@ -315,13 +340,38 @@ "pageSize": 200, "countZeroRecords": true, "parameters": [ - { - "max": 100, - "min": 0, - "range": true, - "type": "eo:cloudCover", - "title": "Cloud Coverage" - }, + { + "type": "eo:sensorMode", + "name": "Sensor", + "title": "Sensor Mode" + }, + { + "max": 100, + "min": 0, + "step": 1, + "range": true, + "type": "eo:cloudCover", + "name": "Cloud Coverage", + "title": "Cloud Coverage in percent" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:acrossTrackIncidenceAngle", + "name": "Offnadir angle", + "title": "Across Track Incidence Angle in degrees" + }, + { + "max": 360, + "min": 0, + "step": 1, + "range": true, + "type": "eo:illuminationAzimuthAngle", + "name": "Sun elevation", + "title": "Illumination Azimuth Angle in degrees" + }, ], "parametersFilterSettings": { "collapsed": false, diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/docker-compose.base.ops.yml b/docker-compose.base.ops.yml index f9b2e18a7aff70b874dd1132e51208e3e816e7ce..f29bcc7cd01abe7e88f0e64f5bbed23858b909be 100644 --- a/docker-compose.base.ops.yml +++ b/docker-compose.base.ops.yml @@ -27,6 +27,7 @@ services: - vhr18-extnet - emg-extnet - dem-extnet + - logging-extnet volumes: traefik-data: networks: @@ -36,3 +37,5 @@ networks: name: emg-extnet dem-extnet: name: dem-extnet + logging-extnet: + name: logging-extnet diff --git a/docker-compose.dem.dev.yml b/docker-compose.dem.dev.yml index 33f14fbf382bf2a078f5ebca9ba6eaede5853cb1..3e213c68cebc843d445f5ec9c4110bd6cb44b28b 100644 --- a/docker-compose.dem.dev.yml +++ b/docker-compose.dem.dev.yml @@ -5,12 +5,24 @@ services: - extnet ports: - "5432:5432" + volumes: + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" client: ports: - "80:80" configs: - source: client-dev target: /usr/share/nginx/html/index.html + volumes: + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" renderer: ports: - "81:80" @@ -19,6 +31,8 @@ services: - type: bind source: ./data/ target: /data/ + logging: + driver: "fluentd" registrar: volumes: - type: bind @@ -27,6 +41,8 @@ services: - type: bind source: ./core/ target: /core/ + logging: + driver: "fluentd" cache: ports: - "83:80" @@ -37,6 +53,8 @@ services: configs: - source: mapcache-dev target: /mapcache-template.xml + logging: + driver: "fluentd" preprocessor: volumes: - type: tmpfs @@ -44,6 +62,11 @@ services: - type: bind source: ./preprocessor/ target: /preprocessor/ + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" networks: extnet: name: dem-extnet diff --git a/docker-compose.dem.ops.yml b/docker-compose.dem.ops.yml index 3247b7d2521af8f470459d66ff32da90ad40a4f9..b1f09109f8cead43205facab36c86a791a3a851f 100644 --- a/docker-compose.dem.ops.yml +++ b/docker-compose.dem.ops.yml @@ -42,6 +42,9 @@ services: resources: limits: memory: 8G + placement: + constraints: + - node.labels.type == external networks: - extnet cache: @@ -81,12 +84,20 @@ services: resources: limits: memory: 8G + placement: + constraints: + - node.labels.type == external networks: - extnet registrar: environment: INSTALL_DIR: "/var/www/pvs/ops/" INSTANCE_DIR: "/var/www/pvs/ops/pvs_instance/" + deploy: + replicas: 0 + placement: + constraints: + - node.labels.type == internal client: configs: - source: client-ops @@ -109,6 +120,9 @@ services: - "traefik.docker.network=dem-extnet" - "traefik.docker.lbswarm=true" - "traefik.enable=true" + placement: + constraints: + - node.labels.type == external networks: - extnet preprocessor: @@ -116,6 +130,11 @@ services: - type: bind source: /var/vhr target: /tmp + deploy: + replicas: 0 + placement: + constraints: + - node.labels.type == internal networks: extnet: name: dem-extnet diff --git a/docker-compose.emg.dev.yml b/docker-compose.emg.dev.yml index 5739969a94825b231f082fddc4a52fd7bc67356f..8e8c7d65bfbddd9875a8e4e9441ab53510c040d9 100644 --- a/docker-compose.emg.dev.yml +++ b/docker-compose.emg.dev.yml @@ -4,13 +4,25 @@ services: networks: - extnet ports: - - "5432:5432" + - "5432:5432" + volumes: + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" client: ports: - "80:80" configs: - source: client-dev target: /usr/share/nginx/html/index.html + volumes: + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" renderer: ports: - "81:80" @@ -19,6 +31,8 @@ services: - type: bind source: ./data/ target: /data/ + logging: + driver: "fluentd" registrar: volumes: - type: bind @@ -27,6 +41,8 @@ services: - type: bind source: ./core/ target: /core/ + logging: + driver: "fluentd" cache: ports: - "83:80" @@ -37,6 +53,8 @@ services: configs: - source: mapcache-dev target: /mapcache-template.xml + logging: + driver: "fluentd" preprocessor: volumes: - type: tmpfs @@ -44,6 +62,11 @@ services: - type: bind source: ./preprocessor/ target: /preprocessor/ + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" networks: extnet: name: emg-extnet diff --git a/docker-compose.emg.ops.yml b/docker-compose.emg.ops.yml index 506a77d724e0a77b76f396eb5923b875e694e98a..fcc054e6937f3a9886345f9a45b0642a0b195cea 100644 --- a/docker-compose.emg.ops.yml +++ b/docker-compose.emg.ops.yml @@ -42,6 +42,9 @@ services: resources: limits: memory: 8G + placement: + constraints: + - node.labels.type == external networks: - extnet cache: @@ -81,12 +84,20 @@ services: resources: limits: memory: 8G + placement: + constraints: + - node.labels.type == external networks: - extnet registrar: environment: INSTALL_DIR: "/var/www/pvs/ops/" INSTANCE_DIR: "/var/www/pvs/ops/pvs_instance/" + deploy: + replicas: 0 + placement: + constraints: + - node.labels.type == internal client: configs: - source: client-ops @@ -109,6 +120,9 @@ services: - "traefik.docker.network=emg-extnet" - "traefik.docker.lbswarm=true" - "traefik.enable=true" + placement: + constraints: + - node.labels.type == external networks: - extnet preprocessor: @@ -116,6 +130,11 @@ services: - type: bind source: /var/vhr target: /tmp + deploy: + replicas: 0 + placement: + constraints: + - node.labels.type == internal networks: extnet: name: emg-extnet diff --git a/docker-compose.logging.dev.yml b/docker-compose.logging.dev.yml new file mode 100644 index 0000000000000000000000000000000000000000..6ce3f23db24f96836bfef5b3f17bc2af06d83931 --- /dev/null +++ b/docker-compose.logging.dev.yml @@ -0,0 +1,16 @@ +version: "3.6" +services: + elasticsearch: + ports: + - "9200:9200" + environment: + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms256m -Xmx256m" + - "discovery.type=single-node" + deploy: + resources: + limits: + memory: 500M + kibana: + ports: + - "5601:5601" diff --git a/docker-compose.logging.ops.yml b/docker-compose.logging.ops.yml new file mode 100644 index 0000000000000000000000000000000000000000..53434247c97cc5ba62880d1ca8eafc2a81731d0c --- /dev/null +++ b/docker-compose.logging.ops.yml @@ -0,0 +1,48 @@ +version: "3.6" +services: + fluentd: + deploy: + placement: + # this is not strictly required, but feels right + constraints: [node.role == manager] + + elasticsearch: + environment: + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - "discovery.type=single-node" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + deploy: + placement: + constraints: [node.role == manager] + resources: + limits: + memory: 1000M + kibana: + deploy: + placement: + constraints: [node.role == manager] + labels: + # router for basic auth based access (https) + - "traefik.http.routers.kibana.rule=Host(`kibana.pdas.prism.eox.at`)" + - "traefik.http.routers.kibana.middlewares=apiauth@file,compress@file" + - "traefik.http.routers.kibana.tls=true" + - "traefik.http.routers.kibana.tls.certresolver=default" + - "traefik.http.routers.kibana.entrypoints=https" + - "traefik.http.services.kibana.loadbalancer.sticky=false" + - "traefik.http.services.kibana.loadbalancer.server.port=5601" + - "traefik.docker.network=logging-extnet" + - "traefik.docker.lbswarm=true" + - "traefik.enable=true" + networks: + - logging-extnet +networks: + logging-extnet: + name: logging-extnet + external: true diff --git a/docker-compose.logging.yml b/docker-compose.logging.yml new file mode 100644 index 0000000000000000000000000000000000000000..0eafaa5ebcc1751dd1e1dc684eec98477eb7cd17 --- /dev/null +++ b/docker-compose.logging.yml @@ -0,0 +1,49 @@ +version: "3.6" +services: + fluentd: + image: registry.gitlab.eox.at/esa/prism/vs/fluentd:latest + configs: + - source: fluentd-conf + target: /fluentd/etc/fluent.conf + ports: + - "24224:24224" + networks: + - logging + deploy: + replicas: 1 + logging: + # fluentd can't start logging to itself + driver: "json-file" + elasticsearch: + image: elasticsearch:7.9.0 + networks: + - logging + environment: + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms256m -Xmx256m" + - "discovery.type=single-node" + deploy: + replicas: 1 + resources: + limits: + memory: 500M + volumes: + - es-data:/usr/share/elasticsearch/data + logging: + # there are startup issues if ES tried to log to fluentd + driver: "json-file" + kibana: + image: kibana:7.9.0 + logging: + driver: "fluentd" + networks: + - logging + deploy: + replicas: 1 +configs: + fluentd-conf: + file: ./fluentd/conf/fluent.conf +volumes: + es-data: +networks: + logging: diff --git a/docker-compose.vhr18.dev.yml b/docker-compose.vhr18.dev.yml index d48b1ea24aa7701ef8c05e7166bb64dbf737a8f4..1a576b4abd0748a1d93811616801719a3568df97 100644 --- a/docker-compose.vhr18.dev.yml +++ b/docker-compose.vhr18.dev.yml @@ -4,13 +4,25 @@ services: networks: - extnet ports: - - "5432:5432" + - "5432:5432" + volumes: + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" client: ports: - "80:80" configs: - source: client-dev target: /usr/share/nginx/html/index.html + volumes: + - type: bind + source: ./data/ + target: /data/ + logging: + driver: "fluentd" renderer: ports: - "81:80" @@ -19,6 +31,8 @@ services: - type: bind source: ./data/ target: /data/ + logging: + driver: "fluentd" registrar: volumes: - type: bind @@ -27,6 +41,8 @@ services: - type: bind source: ./core/ target: /core/ + logging: + driver: "fluentd" cache: ports: - "83:80" @@ -37,6 +53,8 @@ services: configs: - source: mapcache-dev target: /mapcache-template.xml + logging: + driver: "fluentd" preprocessor: volumes: - type: tmpfs @@ -44,6 +62,8 @@ services: - type: bind source: ./preprocessor/ target: /preprocessor/ + logging: + driver: "fluentd" networks: extnet: name: vhr18-extnet diff --git a/docker-compose.vhr18.ops.yml b/docker-compose.vhr18.ops.yml index 69257b3407bfafd6179b179467b6a7f4f4a97048..e8665d49ec311f51e4bc59d6550381e86f4423f4 100644 --- a/docker-compose.vhr18.ops.yml +++ b/docker-compose.vhr18.ops.yml @@ -30,7 +30,7 @@ services: - "traefik.http.routers.vhr18-renderer_referer.tls.certresolver=default" - "traefik.http.routers.vhr18-renderer_referer.entrypoints=https" # router for referrer based access (http) - - "traefik.http.routers.vhr18-renderer_referer-redirect.rule=Host(vhr18.pdas.prism.eox.at`, `a.vhr18.pdas.prism.eox.at`, `b.vhr18.pdas.prism.eox.at`, `c.vhr18.pdas.prism.eox.at`, `d.vhr18.pdas.prism.eox.at`, `e.vhr18.pdas.prism.eox.at`, `f.vhr18.pdas.prism.eox.at`, `g.vhr18.pdas.prism.eox.at`, `h.vhr18.pdas.prism.eox.at`, `vhr18.pass.copernicus.eu`, `a.vhr18.pass.copernicus.eu`, `b.vhr18.pass.copernicus.eu`, `c.vhr18.pass.copernicus.eu`, `d.vhr18.pass.copernicus.eu`, `e.vhr18.pass.copernicus.eu`, `f.vhr18.pass.copernicus.eu`, `g.vhr18.pass.copernicus.eu`, `h.vhr18.pass.copernicus.eu`) && PathPrefix(`/ows`, `/opensearch`, `/admin`) && HeadersRegexp(`Referer`, `(https?://)?(panda.copernicus.eu|panda.cdsv3.eu|panda-demo.ondaprism.eu|panda-demo.copernicus.eu|cdsportal-demo.copernicus.eu|ocqc-demo.copernicus.eu|vhr18.pdas.prism.eox.at|vhr18.pass.copernicus.eu)/?`)" + - "traefik.http.routers.vhr18-renderer_referer-redirect.rule=Host(`vhr18.pdas.prism.eox.at`, `a.vhr18.pdas.prism.eox.at`, `b.vhr18.pdas.prism.eox.at`, `c.vhr18.pdas.prism.eox.at`, `d.vhr18.pdas.prism.eox.at`, `e.vhr18.pdas.prism.eox.at`, `f.vhr18.pdas.prism.eox.at`, `g.vhr18.pdas.prism.eox.at`, `h.vhr18.pdas.prism.eox.at`, `vhr18.pass.copernicus.eu`, `a.vhr18.pass.copernicus.eu`, `b.vhr18.pass.copernicus.eu`, `c.vhr18.pass.copernicus.eu`, `d.vhr18.pass.copernicus.eu`, `e.vhr18.pass.copernicus.eu`, `f.vhr18.pass.copernicus.eu`, `g.vhr18.pass.copernicus.eu`, `h.vhr18.pass.copernicus.eu`) && PathPrefix(`/ows`, `/opensearch`, `/admin`) && HeadersRegexp(`Referer`, `(https?://)?(panda.copernicus.eu|panda.cdsv3.eu|panda-demo.ondaprism.eu|panda-demo.copernicus.eu|cdsportal-demo.copernicus.eu|ocqc-demo.copernicus.eu|vhr18.pdas.prism.eox.at|vhr18.pass.copernicus.eu)/?`)" - "traefik.http.routers.vhr18-renderer_referer-redirect.middlewares=redirect@file" - "traefik.http.routers.vhr18-renderer_referer-redirect.entrypoints=http" # general @@ -42,6 +42,9 @@ services: resources: limits: memory: 8G + placement: + constraints: + - node.labels.type == external networks: - extnet cache: @@ -81,12 +84,20 @@ services: limits: memory: 8G replicas: 3 + placement: + constraints: + - node.labels.type == external networks: - extnet registrar: environment: INSTALL_DIR: "/var/www/pvs/ops/" INSTANCE_DIR: "/var/www/pvs/ops/pvs_instance/" + deploy: + replicas: 0 + placement: + constraints: + - node.labels.type == internal client: configs: - source: client-ops @@ -109,6 +120,9 @@ services: - "traefik.docker.network=vhr18-extnet" - "traefik.docker.lbswarm=true" - "traefik.enable=true" + placement: + constraints: + - node.labels.type == external networks: - extnet preprocessor: @@ -116,6 +130,11 @@ services: - type: bind source: /var/vhr target: /tmp + deploy: + replicas: 0 + placement: + constraints: + - node.labels.type == internal networks: extnet: name: vhr18-extnet diff --git a/docker-compose.vhr18.yml b/docker-compose.vhr18.yml index 243427eaa62ca5c068e52c8f6308285396278a44..9fe307e6505dff13fac0343774a43385362a3fdf 100644 --- a/docker-compose.vhr18.yml +++ b/docker-compose.vhr18.yml @@ -74,6 +74,9 @@ services: WAIT_TIMEOUT: 300 # wait up to 5 minutes deploy: replicas: 1 + logging: + options: + tag: "docker.apache2" networks: - intnet command: diff --git a/fluentd/Dockerfile b/fluentd/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fb2dfae9469b57e2afd689b7b9b28b7cdee3432c --- /dev/null +++ b/fluentd/Dockerfile @@ -0,0 +1,40 @@ +#------------------------------------------------------------------------------ +# +# Project: prism view server +# Authors: Stephan Meissl <stephan.meissl@eox.at> +# +#------------------------------------------------------------------------------ +# Copyright (C) 2018 EOX IT Services GmbH <https://eox.at> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies of this Software or works derived from this Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +#----------------------------------------------------------------------------- + +FROM fluent/fluentd:v1.11.2-debian-1.0 + +MAINTAINER EOX +LABEL name="prism view server cache" \ + vendor="EOX IT Services GmbH <https://eox.at>" \ + license="MIT Copyright (C) 2019 EOX IT Services GmbH <https://eox.at>" \ + type="prism view server fluentd" \ + version="0.0.1-dev" + +USER root +RUN gem install fluent-plugin-elasticsearch \ + && gem install fluent-plugin-rewrite-tag-filter +USER fluent diff --git a/fluentd/conf/fluent.conf b/fluentd/conf/fluent.conf new file mode 100644 index 0000000000000000000000000000000000000000..41c2b8746ea74f9836a17213b75ba511a1328a97 --- /dev/null +++ b/fluentd/conf/fluent.conf @@ -0,0 +1,49 @@ +<system> + log_level debug +</system> + +<source> + @type forward + port 24224 + bind 0.0.0.0 +</source> + +<match docker.apache2> + @type rewrite_tag_filter + <rule> + key source + pattern /^(.*)$/ + tag $1.${tag} + </rule> +</match> + +<filter stdout.docker.apache2> + @type parser + key_name log + reserve_data true + <parse> + @type regexp + # this is basically apache2 but also has the request time at the end as extra field + expression /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")? (?<request_serve_duration>[^ ]*)$/ + time_format %d/%b/%Y:%H:%M:%S %z + types request_serve_duration:integer + </parse> +</filter> + +<match *.**> + @type copy + + <store> + @type elasticsearch + host elasticsearch + port 9200 + logstash_format true + logstash_prefix fluentd + logstash_dateformat %Y%m%d + include_tag_key true + type_name access_log + tag_key @log_name + flush_interval 1s + </store> + +</match> diff --git a/gitlab_test.sh b/gitlab_test.sh index d8a3d5d2b0ea173b315dcad71284a22947a5f992..1b0972c92f180d9cf6090c5d457169b5408899ab 100644 --- a/gitlab_test.sh +++ b/gitlab_test.sh @@ -4,7 +4,7 @@ chmod +x env_setup.sh wait_for_container.sh mkdir data docker swarm init docker network create -d overlay emg-extnet -docker stack deploy -c docker-compose.emg.yml -c docker-compose.emg.dev.yml emg-pvs +docker stack deploy -c docker-compose.emg.yml -c docker-compose.emg.dev.yml -c docker-compose.logging.yml emg-pvs apk update && apk add bash postgresql-dev gcc python3-dev musl-dev py-pip gdal pip3 install -r requirements.txt ./wait_for_container.sh