v-openlayers 2.0.5 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,484 @@
1
+ (function($t,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],S):($t=typeof globalThis<"u"?globalThis:$t||self,S($t["v-openlayers"]={},$t.Vue))})(this,function($t,S){"use strict";var C6=Object.defineProperty;var I6=($t,S,ei)=>S in $t?C6($t,S,{enumerable:!0,configurable:!0,writable:!0,value:ei}):$t[S]=ei;var zt=($t,S,ei)=>(I6($t,typeof S!="symbol"?S+"":S,ei),ei);const ei={light:"light",dark:"dark",custom:"custom"},Ot={supermap:"supermap",supermapwmts:"supermapwmts",tdt:"tdt",geoserverwmts:"geoserverwmts",wmts:"wmts",tms:"tms",xyz:"xyz",wfs:"wfs",wmsimage:"wmsimage",wmsimagetile:"wmsimagetile",arcgisdynamic:"arcgisdynamic",arcgisfeature:"arcgisfeature",arcgisgroup:"arcgisgroup",arcgisimage:"arcgisimage",arcgisimagetile:"arcgisimagetile",arcgistile:"arcgistile",mvt:"mvt",geoservermvt:"geoservermvt",mapboxmvt:"mapboxmvt","3d-tileset":"3d-tileset",bdmap:"bdmap",gdmap:"gdmap",geojson:"geojson",heatmap:"heatmap",clustermap:"clustermap"},ZR={point:"Point",polyline:"Polyline",polygon:"Polygon",rectangle:"rectangle",circle:"circle",billboard:"billboard"},ba={none:"none",draw:"draw",mesure:"measure",identify:"identify"},Se={token:"718469ef14a862124f30427a38edaec4",subdomains:[0,1,2,3,4,5,6,7]},ic={TDT_IMG_3857:"http://t{s}.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_IMG_3857_LABEL:"http://t{s}.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_IMG_4490:"http://t{s}.tianditu.gov.cn/img_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_IMG_4490_LABEL:"http://t{s}.tianditu.gov.cn/cia_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_IMG_4326:"http://t{s}.tianditu.gov.cn/img_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_IMG_4326_LABEL:"http://t{s}.tianditu.gov.cn/cia_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_VEC_3857:"http://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_VEC_3857_LABEL:"http://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_VEC_4490:"http://t{s}.tianditu.gov.cn/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_VEC_4490_LABEL:"http://t{s}.tianditu.gov.cn/cva_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_VEC_4326:"http://t{s}.tianditu.gov.cn/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_VEC_4326_LABEL:"http://t{s}.tianditu.gov.cn/cva_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_TER_3857:"http://t{s}.tianditu.gov.cn/ter_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_TER_3857_LABEL:"http://t{s}.tianditu.gov.cn/cta_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cta&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_TER_4490:"http://t{s}.tianditu.gov.cn/ter_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_TER_4490_LABEL:"http://t{s}.tianditu.gov.cn/cta_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cta&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_TER_4326:"http://t{s}.tianditu.gov.cn/ter_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",TDT_TER_4326_LABEL:"http://t{s}.tianditu.gov.cn/cta_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cta&tk="+Se.token+"&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",OSM_VEC:"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",MAPBOX_VEC:"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw",GD_VEC:"http://webst01.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}",BD_VEC:"http://online1.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=pl"},ni={"EPSG:4326":{prj:"EPSG:4326",resolutions:[.7031249999891485,.35156250000645817,.17578124999134512,.08789062499567256,.04394531250972024,.02197265625486012,.01098632812743006,.00549316406371503,.002746582031857515,.0013732910159287575,.0006866454960804162,.00034332275992417075,.00017166136807812276,8583068403906138e-20,4291534201953069e-20,21457682893727956e-21,10728841446863978e-21,5364420723431989e-21,26822103617159945e-22,13411051808579973e-22,6705522537231445e-22,33527612686157227e-23],matrixIds:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],tileGrid:{extent:[-180,-90,180,90],tileSize:[256,256],origin:[-180,90]}},"EPSG:3857":{prj:"EPSG:3857",resolutions:[156543.03392804097,78271.51696402048,39135.75848201024,19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.8740565703525,76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032,4.777314267823516,2.388657133911758,1.194328566955879,.5971642834779395],matrixIds:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],tileGrid:{tileSize:[256,256],origin:[-2003750834e-2,2003750834e-2]}},V_MAP_PROVIDER:Ot,V_GEO_TYPE:ZR,V_BASE_MAP:ic};function d0({mapStyle:r="TDT_IMG",prj:t="4326",token:e=Se.token,isCesium:n=!1}){if(n)return KR({mapStyle:r,prj:t,token:e});e===""&&(e=Se.token),t=t.replace("EPSG:","").replace("epsg:","").trim(),r=r.toUpperCase();let i=ic[`${r.toUpperCase()}_${t}`]||ic[`${r.toUpperCase().replace("_LABEL","")}_${t}_LABEL`];return i?i.replace(Se.token,e).replace("{level}","{z}").replace("{row}","{y}").replace("{col}","{x}").replace("{s}","{0-7}"):""}function KR({mapStyle:r="TDT_IMG",prj:t="4326",token:e=Se.token}){e===""&&(e=Se.token),t=t.replace("EPSG:","").replace("epsg:","").trim();let n=ic[`${r.toUpperCase()}_${t}`]||ic[`${r.toUpperCase().replace("_LABEL","")}_${t}_LABEL`];return n?n.replace(Se.token,e).replace("{level}","{TileMatrix}").replace("{row}","{TileRow}").replace("{col}","{TileCol}"):""}class JR{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Er=JR,Cl={PROPERTYCHANGE:"propertychange"};class QR{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const tf=QR;function $R(r,t,e){let n,i;e=e||hs;let o=0,a=r.length,l=!1;for(;o<a;)n=o+(a-o>>1),i=+e(r[n],t),i<0?o=n+1:(a=n,l=!i);return l?o:~o}function hs(r,t){return r>t?1:r<t?-1:0}function ef(r,t,e){if(r[0]<=t)return 0;const n=r.length;if(t<=r[n-1])return n-1;if(typeof e=="function"){for(let i=1;i<n;++i){const o=r[i];if(o===t)return i;if(o<t)return e(t,r[i-1],o)>0?i-1:i}return n-1}if(e>0){for(let i=1;i<n;++i)if(r[i]<t)return i-1;return n-1}if(e<0){for(let i=1;i<n;++i)if(r[i]<=t)return i;return n-1}for(let i=1;i<n;++i){if(r[i]==t)return i;if(r[i]<t)return r[i-1]-t<t-r[i]?i-1:i}return n-1}function tP(r,t,e){for(;t<e;){const n=r[t];r[t]=r[e],r[e]=n,++t,--e}}function Pn(r,t){const e=Array.isArray(t)?t:[t],n=e.length;for(let i=0;i<n;i++)r[r.length]=e[i]}function fs(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(r[n]!==t[n])return!1;return!0}function eP(r,t,e){const n=t||hs;return r.every(function(i,o){if(o===0)return!0;const a=n(r[o-1],i);return!(a>0||e&&a===0)})}function qs(){return!0}function Aa(){return!1}function Il(){}function g0(r){let t=!1,e,n,i;return function(){const o=Array.prototype.slice.call(arguments);return(!t||this!==i||!fs(o,n))&&(t=!0,i=this,n=o,e=r.apply(this,arguments)),e}}function p0(r){function t(){let e;try{e=r()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function La(r){for(const t in r)delete r[t]}function Mo(r){let t;for(t in r)return!1;return!t}class nP extends tf{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);i.includes(e)||i.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,i=this.listeners_&&this.listeners_[n];if(!i)return;const o=e?new Er(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});n in a||(a[n]=0,l[n]=0),++a[n];let u;for(let c=0,h=i.length;c<h;++c)if("handleEvent"in i[c]?u=i[c].handleEvent(o):u=i[c].call(this,o),u===!1||o.propagationStopped){u=!1;break}if(--a[n]===0){let c=l[n];for(delete l[n];c--;)this.removeEventListener(n,Il);delete a[n]}return u}disposeInternal(){this.listeners_&&La(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const i=n.indexOf(e);i!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=Il,++this.pendingRemovals_[t]):(n.splice(i,1),n.length===0&&delete this.listeners_[t]))}}const sc=nP,ot={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function yt(r,t,e,n,i){if(n&&n!==r&&(e=e.bind(n)),i){const a=e;e=function(){r.removeEventListener(t,e),a.apply(this,arguments)}}const o={target:r,type:t,listener:e};return r.addEventListener(t,e),o}function nf(r,t,e,n){return yt(r,t,e,n,!0)}function Ht(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),La(r))}class oc extends sc{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ot.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,i=new Array(n);for(let o=0;o<n;++o)i[o]=yt(this,t[o],e);return i}return yt(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const i=t.length;n=new Array(i);for(let o=0;o<i;++o)n[o]=nf(this,t[o],e)}else n=nf(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)np(n);else if(Array.isArray(t))for(let i=0,o=t.length;i<o;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)}}oc.prototype.on,oc.prototype.once,oc.prototype.un;function np(r){if(Array.isArray(r))for(let t=0,e=r.length;t<e;++t)Ht(r[t]);else Ht(r)}function at(){throw new Error("Unimplemented abstract method.")}let rP=0;function Z(r){return r.ol_uid||(r.ol_uid=String(++rP))}class m0 extends Er{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}class iP extends oc{constructor(t){super(),this.on,this.once,this.un,Z(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new m0(n,t,e)),n=Cl.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new m0(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const i=this.values_||(this.values_={});if(n)i[t]=e;else{const o=i[t];i[t]=e,o!==e&&this.notify(t,o)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],Mo(this.values_)&&(this.values_=null),e||this.notify(t,n)}}}const Di=iP,te={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};function xt(r,t){if(!r)throw new Error(t)}function Oe(r,t,e){return Math.min(Math.max(r,t),e)}function sP(r,t,e,n,i,o){const a=i-e,l=o-n;if(a!==0||l!==0){const u=((r-e)*a+(t-n)*l)/(a*a+l*l);u>1?(e=i,n=o):u>0&&(e+=a*u,n+=l*u)}return Zs(r,t,e,n)}function Zs(r,t,e,n){const i=e-r,o=n-t;return i*i+o*o}function oP(r){const t=r.length;for(let n=0;n<t;n++){let i=n,o=Math.abs(r[n][n]);for(let l=n+1;l<t;l++){const u=Math.abs(r[l][n]);u>o&&(o=u,i=l)}if(o===0)return null;const a=r[i];r[i]=r[n],r[n]=a;for(let l=n+1;l<t;l++){const u=-r[l][n]/r[n][n];for(let c=n;c<t+1;c++)n==c?r[l][c]=0:r[l][c]+=u*r[n][c]}}const e=new Array(t);for(let n=t-1;n>=0;n--){e[n]=r[n][t]/r[n][n];for(let i=n-1;i>=0;i--)r[i][t]-=r[i][n]*e[n]}return e}function Ma(r){return r*Math.PI/180}function ds(r,t){const e=r%t;return e*t<0?e+t:e}function Dr(r,t,e){return r+e*(t-r)}function ac(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function rf(r,t){return Math.round(ac(r,t))}function Tl(r,t){return Math.floor(ac(r,t))}function No(r,t){return Math.ceil(ac(r,t))}class aP extends Di{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[te.OPACITY]=t.opacity!==void 0?t.opacity:1,xt(typeof e[te.OPACITY]=="number","Layer opacity must be a number"),e[te.VISIBLE]=t.visible!==void 0?t.visible:!0,e[te.Z_INDEX]=t.zIndex,e[te.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[te.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[te.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[te.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return e.opacity=Oe(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return at()}getLayerStatesArray(t){return at()}getExtent(){return this.get(te.EXTENT)}getMaxResolution(){return this.get(te.MAX_RESOLUTION)}getMinResolution(){return this.get(te.MIN_RESOLUTION)}getMinZoom(){return this.get(te.MIN_ZOOM)}getMaxZoom(){return this.get(te.MAX_ZOOM)}getOpacity(){return this.get(te.OPACITY)}getSourceState(){return at()}getVisible(){return this.get(te.VISIBLE)}getZIndex(){return this.get(te.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(te.EXTENT,t)}setMaxResolution(t){this.set(te.MAX_RESOLUTION,t)}setMinResolution(t){this.set(te.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(te.MAX_ZOOM,t)}setMinZoom(t){this.set(te.MIN_ZOOM,t)}setOpacity(t){xt(typeof t=="number","Layer opacity must be a number"),this.set(te.OPACITY,t)}setVisible(t){this.set(te.VISIBLE,t)}setZIndex(t){this.set(te.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const y0=aP,pn={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},fe={ANIMATING:0,INTERACTING:1},Bi={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},_0=42,rp=256,Rl={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class lP{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Rl[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const ip=lP,lc=6378137,Pl=Math.PI*lc,uP=[-Pl,-Pl,Pl,Pl],cP=[-180,-85,180,85],sf=lc*Math.log(Math.tan(Math.PI/2));class bl extends ip{constructor(t){super({code:t,units:"m",extent:uP,global:!0,worldExtent:cP,getPointResolution:function(e,n){return e/Math.cosh(n[1]/lc)}})}}const v0=[new bl("EPSG:3857"),new bl("EPSG:102100"),new bl("EPSG:102113"),new bl("EPSG:900913"),new bl("http://www.opengis.net/def/crs/EPSG/0/3857"),new bl("http://www.opengis.net/gml/srs/epsg.xml#3857")];function hP(r,t,e){const n=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let i=0;i<n;i+=e){t[i]=Pl*r[i]/180;let o=lc*Math.log(Math.tan(Math.PI*(+r[i+1]+90)/360));o>sf?o=sf:o<-sf&&(o=-sf),t[i+1]=o}return t}function fP(r,t,e){const n=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let i=0;i<n;i+=e)t[i]=180*r[i]/Pl,t[i+1]=360*Math.atan(Math.exp(r[i+1]/lc))/Math.PI-90;return t}const dP=6378137,E0=[-180,-90,180,90],gP=Math.PI*dP/180;class Na extends ip{constructor(t,e){super({code:t,units:"degrees",extent:E0,axisOrientation:e,global:!0,metersPerUnit:gP,worldExtent:E0})}}const x0=[new Na("CRS:84"),new Na("EPSG:4326","neu"),new Na("urn:ogc:def:crs:OGC:1.3:CRS84"),new Na("urn:ogc:def:crs:OGC:2:84"),new Na("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Na("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Na("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let sp={};function pP(r){return sp[r]||sp[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function mP(r,t){sp[r]=t}let Al={};function of(r,t,e){const n=r.getCode(),i=t.getCode();n in Al||(Al[n]={}),Al[n][i]=e}function yP(r,t){let e;return r in Al&&t in Al[r]&&(e=Al[r][t]),e}const mn={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function bn(r){const t=An();for(let e=0,n=r.length;e<n;++e)uc(t,r[e]);return t}function _P(r,t,e){const n=Math.min.apply(null,r),i=Math.min.apply(null,t),o=Math.max.apply(null,r),a=Math.max.apply(null,t);return ii(n,i,o,a,e)}function xr(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function w0(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function Oa(r,t,e){let n,i;return t<r[0]?n=r[0]-t:r[2]<t?n=t-r[2]:n=0,e<r[1]?i=r[1]-e:r[3]<e?i=e-r[3]:i=0,n*n+i*i}function Fa(r,t){return op(r,t[0],t[1])}function ri(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function op(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function ap(r,t){const e=r[0],n=r[1],i=r[2],o=r[3],a=t[0],l=t[1];let u=mn.UNKNOWN;return a<e?u=u|mn.LEFT:a>i&&(u=u|mn.RIGHT),l<n?u=u|mn.BELOW:l>o&&(u=u|mn.ABOVE),u===mn.UNKNOWN&&(u=mn.INTERSECTING),u}function An(){return[1/0,1/0,-1/0,-1/0]}function ii(r,t,e,n,i){return i?(i[0]=r,i[1]=t,i[2]=e,i[3]=n,i):[r,t,e,n]}function Ll(r){return ii(1/0,1/0,-1/0,-1/0,r)}function Ml(r,t){const e=r[0],n=r[1];return ii(e,n,e,n,t)}function lp(r,t,e,n,i){const o=Ll(i);return C0(o,r,t,e,n)}function Oo(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function S0(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function uc(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function C0(r,t,e,n,i){for(;e<n;e+=i)vP(r,t[e],t[e+1]);return r}function vP(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function up(r,t){let e;return e=t(Nl(r)),e||(e=t(cc(r)),e)||(e=t(fc(r)),e)||(e=t(wr(r)),e)?e:!1}function cp(r){let t=0;return Da(r)||(t=Pt(r)*Fe(r)),t}function Nl(r){return[r[0],r[1]]}function cc(r){return[r[2],r[1]]}function Gi(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function EP(r,t){let e;if(t==="bottom-left")e=Nl(r);else if(t==="bottom-right")e=cc(r);else if(t==="top-left")e=wr(r);else if(t==="top-right")e=fc(r);else throw new Error("Invalid corner");return e}function hc(r,t,e,n,i){const[o,a,l,u,c,h,f,d]=hp(r,t,e,n);return ii(Math.min(o,l,c,f),Math.min(a,u,h,d),Math.max(o,l,c,f),Math.max(a,u,h,d),i)}function hp(r,t,e,n){const i=t*n[0]/2,o=t*n[1]/2,a=Math.cos(e),l=Math.sin(e),u=i*a,c=i*l,h=o*a,f=o*l,d=r[0],g=r[1];return[d-u+f,g-c-h,d-u-f,g-c+h,d+u-f,g+c+h,d+u+f,g+c-h,d-u+f,g-c-h]}function Fe(r){return r[3]-r[1]}function Ks(r,t,e){const n=e||An();return De(r,t)?(r[0]>t[0]?n[0]=r[0]:n[0]=t[0],r[1]>t[1]?n[1]=r[1]:n[1]=t[1],r[2]<t[2]?n[2]=r[2]:n[2]=t[2],r[3]<t[3]?n[3]=r[3]:n[3]=t[3]):Ll(n),n}function wr(r){return[r[0],r[3]]}function fc(r){return[r[2],r[3]]}function Pt(r){return r[2]-r[0]}function De(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Da(r){return r[2]<r[0]||r[3]<r[1]}function xP(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function wP(r,t){const e=(r[2]-r[0])/2*(t-1),n=(r[3]-r[1])/2*(t-1);r[0]-=e,r[2]+=e,r[1]-=n,r[3]+=n}function SP(r,t,e){let n=!1;const i=ap(r,t),o=ap(r,e);if(i===mn.INTERSECTING||o===mn.INTERSECTING)n=!0;else{const a=r[0],l=r[1],u=r[2],c=r[3],h=t[0],f=t[1],d=e[0],g=e[1],p=(g-f)/(d-h);let m,y;o&mn.ABOVE&&!(i&mn.ABOVE)&&(m=d-(g-c)/p,n=m>=a&&m<=u),!n&&o&mn.RIGHT&&!(i&mn.RIGHT)&&(y=g-(d-u)*p,n=y>=l&&y<=c),!n&&o&mn.BELOW&&!(i&mn.BELOW)&&(m=d-(g-l)/p,n=m>=a&&m<=u),!n&&o&mn.LEFT&&!(i&mn.LEFT)&&(y=g-(d-a)*p,n=y>=l&&y<=c)}return n}function CP(r,t,e,n){if(Da(r))return Ll(e);let i=[];if(n>1){const l=r[2]-r[0],u=r[3]-r[1];for(let c=0;c<n;++c)i.push(r[0]+l*c/n,r[1],r[2],r[1]+u*c/n,r[2]-l*c/n,r[3],r[0],r[3]-u*c/n)}else i=[r[0],r[1],r[2],r[1],r[2],r[3],r[0],r[3]];t(i,i,2);const o=[],a=[];for(let l=0,u=i.length;l<u;l+=2)o.push(i[l]),a.push(i[l+1]);return _P(o,a,e)}function I0(r,t){const e=t.getExtent(),n=Gi(r);if(t.canWrapX()&&(n[0]<e[0]||n[0]>=e[2])){const i=Pt(e),a=Math.floor((n[0]-e[0])/i)*i;r[0]-=a,r[2]-=a}return r}function T0(r,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[n[0],r[1],n[2],r[3]]];I0(r,t);const i=Pt(n);if(Pt(r)>i&&!e)return[[n[0],r[1],n[2],r[3]]];if(r[0]<n[0])return[[r[0]+i,r[1],n[2],r[3]],[n[0],r[1],r[2],r[3]]];if(r[2]>n[2])return[[r[0],r[1],n[2],r[3]],[n[0],r[1],r[2]-i,r[3]]]}return[r]}function fp(r,t){const e=(""+r).split("."),n=(""+t).split(".");for(let i=0;i<Math.max(e.length,n.length);i++){const o=parseInt(e[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function R0(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function IP(r,t){const e=t.getRadius(),n=t.getCenter(),i=n[0],o=n[1],a=r[0],l=r[1];let u=a-i;const c=l-o;u===0&&c===0&&(u=1);const h=Math.sqrt(u*u+c*c),f=i+e*u/h,d=o+e*c/h;return[f,d]}function dp(r,t){const e=r[0],n=r[1],i=t[0],o=t[1],a=i[0],l=i[1],u=o[0],c=o[1],h=u-a,f=c-l,d=h===0&&f===0?0:(h*(e-a)+f*(n-l))/(h*h+f*f||0);let g,p;return d<=0?(g=a,p=l):d>=1?(g=u,p=c):(g=a+d*h,p=l+d*f),[g,p]}function ki(r,t){let e=!0;for(let n=r.length-1;n>=0;--n)if(r[n]!=t[n]){e=!1;break}return e}function gp(r,t){const e=Math.cos(t),n=Math.sin(t),i=r[0]*e-r[1]*n,o=r[1]*e+r[0]*n;return r[0]=i,r[1]=o,r}function P0(r,t){return r[0]*=t,r[1]*=t,r}function Js(r,t){const e=r[0]-t[0],n=r[1]-t[1];return e*e+n*n}function af(r,t){return Math.sqrt(Js(r,t))}function TP(r,t){return Js(r,dp(r,t))}function pp(r,t){if(t.canWrapX()){const e=Pt(t.getExtent()),n=RP(r,t,e);n&&(r[0]-=n*e)}return r}function RP(r,t,e){const n=t.getExtent();let i=0;return t.canWrapX()&&(r[0]<n[0]||r[0]>n[2])&&(e=e||Pt(n),i=Math.floor((r[0]-n[0])/e)),i}const mp=63710088e-1;function dc(r,t,e){e=e||mp;const n=Ma(r[1]),i=Ma(t[1]),o=(i-n)/2,a=Ma(t[0]-r[0])/2,l=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(i);return 2*e*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function yp(r,t){let e=0;for(let n=0,i=r.length;n<i-1;++n)e+=dc(r[n],r[n+1],t);return e}function lf(r,t){t=t||{};const e=t.radius||mp,n=t.projection||"EPSG:3857",i=r.getType();i!=="GeometryCollection"&&(r=r.clone().transform(n,"EPSG:4326"));let o=0,a,l,u,c,h,f;switch(i){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":{a=r.getCoordinates(),o=yp(a,e);break}case"MultiLineString":case"Polygon":{for(a=r.getCoordinates(),u=0,c=a.length;u<c;++u)o+=yp(a[u],e);break}case"MultiPolygon":{for(a=r.getCoordinates(),u=0,c=a.length;u<c;++u)for(l=a[u],h=0,f=l.length;h<f;++h)o+=yp(l[h],e);break}case"GeometryCollection":{const d=r.getGeometries();for(u=0,c=d.length;u<c;++u)o+=lf(d[u],t);break}default:throw new Error("Unsupported geometry type: "+i)}return o}function uf(r,t){let e=0;const n=r.length;let i=r[n-1][0],o=r[n-1][1];for(let a=0;a<n;a++){const l=r[a][0],u=r[a][1];e+=Ma(l-i)*(2+Math.sin(Ma(o))+Math.sin(Ma(u))),i=l,o=u}return e*t*t/2}function b0(r,t){t=t||{};const e=t.radius||mp,n=t.projection||"EPSG:3857",i=r.getType();i!=="GeometryCollection"&&(r=r.clone().transform(n,"EPSG:4326"));let o=0,a,l,u,c,h,f;switch(i){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":{for(a=r.getCoordinates(),o=Math.abs(uf(a[0],e)),u=1,c=a.length;u<c;++u)o-=Math.abs(uf(a[u],e));break}case"MultiPolygon":{for(a=r.getCoordinates(),u=0,c=a.length;u<c;++u)for(l=a[u],o+=Math.abs(uf(l[0],e)),h=1,f=l.length;h<f;++h)o-=Math.abs(uf(l[h],e));break}case"GeometryCollection":{const d=r.getGeometries();for(u=0,c=d.length;u<c;++u)o+=b0(d[u],t);break}default:throw new Error("Unsupported geometry type: "+i)}return o}const A0={info:1,warn:2,error:3,none:4};let PP=A0.info;function L0(...r){PP>A0.warn||console.warn(...r)}let _p=!0;function M0(r){_p=!(r===void 0?!0:r)}function vp(r,t){if(t!==void 0){for(let e=0,n=r.length;e<n;++e)t[e]=r[e];t=t}else t=r.slice();return t}function N0(r,t){if(t!==void 0&&r!==t){for(let e=0,n=r.length;e<n;++e)t[e]=r[e];r=t}return r}function bP(r){mP(r.getCode(),r),of(r,r,vp)}function AP(r){r.forEach(bP)}function gt(r){return typeof r=="string"?pP(r):r||null}function cf(r,t,e,n){r=gt(r);let i;const o=r.getPointResolutionFunc();if(o){if(i=o(t,e),n&&n!==r.getUnits()){const a=r.getMetersPerUnit();a&&(i=i*a/Rl[n])}}else{const a=r.getUnits();if(a=="degrees"&&!n||n=="degrees")i=t;else{const l=hf(r,gt("EPSG:4326"));if(l===N0&&a!=="degrees")i=t*r.getMetersPerUnit();else{let c=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];c=l(c,c,2);const h=dc(c.slice(0,2),c.slice(2,4)),f=dc(c.slice(4,6),c.slice(6,8));i=(h+f)/2}const u=n?Rl[n]:r.getMetersPerUnit();u!==void 0&&(i/=u)}}return i}function O0(r){AP(r),r.forEach(function(t){r.forEach(function(e){t!==e&&of(t,e,vp)})})}function LP(r,t,e,n){r.forEach(function(i){t.forEach(function(o){of(i,o,e),of(o,i,n)})})}function Ep(r,t){return r?typeof r=="string"?gt(r):r:gt(t)}function MP(r,t){return M0(),Ba(r,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function NP(r,t){const e=Ba(r,t!==void 0?t:"EPSG:3857","EPSG:4326"),n=e[0];return(n<-180||n>180)&&(e[0]=ds(n+180,360)-180),e}function gs(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||hf(r,t)===vp)&&e}function hf(r,t){const e=r.getCode(),n=t.getCode();let i=yP(e,n);return i||(i=N0),i}function Ol(r,t){const e=gt(r),n=gt(t);return hf(e,n)}function Ba(r,t,e){return Ol(t,e)(r,void 0,r.length)}function OP(r,t,e,n){const i=Ol(t,e);return CP(r,i,void 0,n)}let FP=null;function DP(){return FP}function Ga(r,t){return r}function de(r,t){return _p&&!ki(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(_p=!1,L0("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function gc(r,t){return r}function ps(r,t){return r}function BP(){O0(v0),O0(x0),LP(x0,v0,hP,fP)}BP();function F0(r,t,e){return function(n,i,o,a,l){if(!n)return;if(!i&&!t)return n;const u=t?0:o[0]*i,c=t?0:o[1]*i,h=l?l[0]:0,f=l?l[1]:0;let d=r[0]+u/2+h,g=r[2]-u/2+h,p=r[1]+c/2+f,m=r[3]-c/2+f;d>g&&(d=(g+d)/2,g=d),p>m&&(p=(m+p)/2,m=p);let y=Oe(n[0],d,g),E=Oe(n[1],p,m);if(a&&e&&i){const _=30*i;y+=-_*Math.log(1+Math.max(0,d-n[0])/_)+_*Math.log(1+Math.max(0,n[0]-g)/_),E+=-_*Math.log(1+Math.max(0,p-n[1])/_)+_*Math.log(1+Math.max(0,n[1]-m)/_)}return[y,E]}}function GP(r){return r}function xp(r,t,e,n){const i=Pt(t)/e[0],o=Fe(t)/e[1];return n?Math.min(r,Math.max(i,o)):Math.min(r,Math.min(i,o))}function wp(r,t,e){let n=Math.min(r,t);const i=50;return n*=Math.log(1+i*Math.max(0,r/t-1))/i+1,e&&(n=Math.max(n,e),n/=Math.log(1+i*Math.max(0,e/r-1))/i+1),Oe(n,e/2,t*2)}function kP(r,t,e,n){return t=t!==void 0?t:!0,function(i,o,a,l){if(i!==void 0){const u=r[0],c=r[r.length-1],h=e?xp(u,e,a,n):u;if(l)return t?wp(i,h,c):Oe(i,c,h);const f=Math.min(h,i),d=Math.floor(ef(r,f,o));return r[d]>h&&d<r.length-1?r[d+1]:r[d]}}}function zP(r,t,e,n,i,o){return n=n!==void 0?n:!0,e=e!==void 0?e:0,function(a,l,u,c){if(a!==void 0){const h=i?xp(t,i,u,o):t;if(c)return n?wp(a,h,e):Oe(a,e,h);const f=1e-9,d=Math.ceil(Math.log(t/h)/Math.log(r)-f),g=-l*(.5-f)+.5,p=Math.min(h,a),m=Math.floor(Math.log(t/p)/Math.log(r)+g),y=Math.max(d,m),E=t/Math.pow(r,y);return Oe(E,e,h)}}}function D0(r,t,e,n,i){return e=e!==void 0?e:!0,function(o,a,l,u){if(o!==void 0){const c=n?xp(r,n,l,i):r;return!e||!u?Oe(o,t,c):wp(o,c,t)}}}function Sp(r){if(r!==void 0)return 0}function B0(r){if(r!==void 0)return r}function UP(r){const t=2*Math.PI/r;return function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function VP(r){const t=r===void 0?Ma(5):r;return function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e}}function G0(r){return Math.pow(r,3)}function Fl(r){return 1-G0(1-r)}function jP(r){return 3*r*r-2*r*r*r}function WP(r){return r}const k0=new Array(6);function an(){return[1,0,0,1,0,0]}function z0(r){return Cp(r,1,0,0,1,0,0)}function ff(r,t){const e=r[0],n=r[1],i=r[2],o=r[3],a=r[4],l=r[5],u=t[0],c=t[1],h=t[2],f=t[3],d=t[4],g=t[5];return r[0]=e*u+i*c,r[1]=n*u+o*c,r[2]=e*h+i*f,r[3]=n*h+o*f,r[4]=e*d+i*g+a,r[5]=n*d+o*g+l,r}function Cp(r,t,e,n,i,o,a){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=o,r[5]=a,r}function YP(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function We(r,t){const e=t[0],n=t[1];return t[0]=r[0]*e+r[2]*n+r[4],t[1]=r[1]*e+r[3]*n+r[5],t}function Ip(r,t,e){return ff(r,Cp(k0,t,0,0,e,0,0))}function U0(r,t,e){return ff(r,Cp(k0,1,0,0,1,t,e))}function si(r,t,e,n,i,o,a,l){const u=Math.sin(o),c=Math.cos(o);return r[0]=n*c,r[1]=i*u,r[2]=-n*u,r[3]=i*c,r[4]=a*n*c-l*n*u+t,r[5]=a*i*u+l*i*c+e,r}function Tp(r,t){const e=XP(t);xt(e!==0,"Transformation matrix cannot be inverted");const n=t[0],i=t[1],o=t[2],a=t[3],l=t[4],u=t[5];return r[0]=a/e,r[1]=-i/e,r[2]=-o/e,r[3]=n/e,r[4]=(o*u-a*l)/e,r[5]=-(n*u-i*l)/e,r}function XP(r){return r[0]*r[3]-r[1]*r[2]}const V0=[1e6,1e6,1e6,1e6,2,2];function HP(r){return"matrix("+r.map((e,n)=>Math.round(e*V0[n])/V0[n]).join(", ")+")"}function Fo(r,t,e,n,i,o){o=o||[];let a=0;for(let l=t;l<e;l+=n){const u=r[l],c=r[l+1];o[a++]=i[0]*u+i[2]*c+i[4],o[a++]=i[1]*u+i[3]*c+i[5]}return o&&o.length!=a&&(o.length=a),o}function Rp(r,t,e,n,i,o,a){a=a||[];const l=Math.cos(i),u=Math.sin(i),c=o[0],h=o[1];let f=0;for(let d=t;d<e;d+=n){const g=r[d]-c,p=r[d+1]-h;a[f++]=c+g*l-p*u,a[f++]=h+g*u+p*l;for(let m=d+2;m<d+n;++m)a[f++]=r[m]}return a&&a.length!=f&&(a.length=f),a}function qP(r,t,e,n,i,o,a,l){l=l||[];const u=a[0],c=a[1];let h=0;for(let f=t;f<e;f+=n){const d=r[f]-u,g=r[f+1]-c;l[h++]=u+i*d,l[h++]=c+o*g;for(let p=f+2;p<f+n;++p)l[h++]=r[p]}return l&&l.length!=h&&(l.length=h),l}function ZP(r,t,e,n,i,o,a){a=a||[];let l=0;for(let u=t;u<e;u+=n){a[l++]=r[u]+i,a[l++]=r[u+1]+o;for(let c=u+2;c<u+n;++c)a[l++]=r[c]}return a&&a.length!=l&&(a.length=l),a}const j0=an(),df=class extends Di{constructor(){super(),this.extent_=An(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=g0((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return at()}closestPointXY(t,e,n,i){return at()}containsXY(t,e){const n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return at()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Ll(e),this.extentRevision_=this.getRevision()}return xP(this.extent_,t)}rotate(t,e){at()}scale(t,e,n){at()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return at()}getType(){return at()}applyTransform(t){at()}intersectsExtent(t){return at()}translate(t,e){at()}transform(t,e){const n=gt(t),i=n.getUnits()=="tile-pixels"?function(o,a,l){const u=n.getExtent(),c=n.getWorldExtent(),h=Fe(c)/Fe(u);return si(j0,c[0],c[3],h,-h,0,0,0),Fo(o,0,o.length,l,j0,a),Ol(n,e)(o,a,l)}:Ol(n,e);return this.applyTransform(i),this}};class KP extends df{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return lp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return at()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=gf(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){at()}setLayout(t,e,n){let i;if(t)i=gf(t);else{for(let o=0;o<n;++o){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}i=e.length,t=ka(i)}this.layout=t,this.stride=i}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();Rp(n,0,n.length,i,t,e,n),this.changed()}}scale(t,e,n){e===void 0&&(e=t),n||(n=Gi(this.getExtent()));const i=this.getFlatCoordinates();if(i){const o=this.getStride();qP(i,0,i.length,o,t,e,n,i),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();ZP(n,0,n.length,i,t,e,n),this.changed()}}}function ka(r){let t;return r==2?t="XY":r==3?t="XYZ":r==4&&(t="XYZM"),t}function gf(r){let t;return r=="XY"?t=2:r=="XYZ"||r=="XYM"?t=3:r=="XYZM"&&(t=4),t}function JP(r,t,e){const n=r.getFlatCoordinates();if(!n)return null;const i=r.getStride();return Fo(n,0,n.length,i,t,e)}const Do=KP;function W0(r,t,e,n,i,o,a){const l=r[t],u=r[t+1],c=r[e]-l,h=r[e+1]-u;let f;if(c===0&&h===0)f=t;else{const d=((i-l)*c+(o-u)*h)/(c*c+h*h);if(d>1)f=e;else if(d>0){for(let g=0;g<n;++g)a[g]=Dr(r[t+g],r[e+g],d);a.length=n;return}else f=t}for(let d=0;d<n;++d)a[d]=r[f+d];a.length=n}function Pp(r,t,e,n,i){let o=r[t],a=r[t+1];for(t+=n;t<e;t+=n){const l=r[t],u=r[t+1],c=Zs(o,a,l,u);c>i&&(i=c),o=l,a=u}return i}function bp(r,t,e,n,i){for(let o=0,a=e.length;o<a;++o){const l=e[o];i=Pp(r,t,l,n,i),t=l}return i}function QP(r,t,e,n,i){for(let o=0,a=e.length;o<a;++o){const l=e[o];i=bp(r,t,l,n,i),t=l[l.length-1]}return i}function Ap(r,t,e,n,i,o,a,l,u,c,h){if(t==e)return c;let f,d;if(i===0){if(d=Zs(a,l,r[t],r[t+1]),d<c){for(f=0;f<n;++f)u[f]=r[t+f];return u.length=n,d}return c}h=h||[NaN,NaN];let g=t+n;for(;g<e;)if(W0(r,g-n,g,n,a,l,h),d=Zs(a,l,h[0],h[1]),d<c){for(c=d,f=0;f<n;++f)u[f]=h[f];u.length=n,g+=n}else g+=n*Math.max((Math.sqrt(d)-Math.sqrt(c))/i|0,1);if(o&&(W0(r,e-n,t,n,a,l,h),d=Zs(a,l,h[0],h[1]),d<c)){for(c=d,f=0;f<n;++f)u[f]=h[f];u.length=n}return c}function Lp(r,t,e,n,i,o,a,l,u,c,h){h=h||[NaN,NaN];for(let f=0,d=e.length;f<d;++f){const g=e[f];c=Ap(r,t,g,n,i,o,a,l,u,c,h),t=g}return c}function $P(r,t,e,n,i,o,a,l,u,c,h){h=h||[NaN,NaN];for(let f=0,d=e.length;f<d;++f){const g=e[f];c=Lp(r,t,g,n,i,o,a,l,u,c,h),t=g[g.length-1]}return c}function Y0(r,t,e,n){for(let i=0,o=e.length;i<o;++i)r[t++]=e[i];return t}function pf(r,t,e,n){for(let i=0,o=e.length;i<o;++i){const a=e[i];for(let l=0;l<n;++l)r[t++]=a[l]}return t}function pc(r,t,e,n,i){i=i||[];let o=0;for(let a=0,l=e.length;a<l;++a){const u=pf(r,t,e[a],n);i[o++]=u,t=u}return i.length=o,i}function X0(r,t,e,n,i){i=i||[];let o=0;for(let a=0,l=e.length;a<l;++a){const u=pc(r,t,e[a],n,i[o]);u.length===0&&(u[0]=t),i[o++]=u,t=u[u.length-1]}return i.length=o,i}function mf(r,t,e,n,i,o,a){const l=(e-t)/n;if(l<3){for(;t<e;t+=n)o[a++]=r[t],o[a++]=r[t+1];return a}const u=new Array(l);u[0]=1,u[l-1]=1;const c=[t,e-n];let h=0;for(;c.length>0;){const f=c.pop(),d=c.pop();let g=0;const p=r[d],m=r[d+1],y=r[f],E=r[f+1];for(let _=d+n;_<f;_+=n){const v=r[_],x=r[_+1],w=sP(v,x,p,m,y,E);w>g&&(h=_,g=w)}g>i&&(u[(h-t)/n]=1,d+n<h&&c.push(d,h),h+n<f&&c.push(h,f))}for(let f=0;f<l;++f)u[f]&&(o[a++]=r[t+f*n],o[a++]=r[t+f*n+1]);return a}function H0(r,t,e,n,i,o,a,l){for(let u=0,c=e.length;u<c;++u){const h=e[u];a=mf(r,t,h,n,i,o,a),l.push(a),t=h}return a}function za(r,t){return t*Math.round(r/t)}function tb(r,t,e,n,i,o,a){if(t==e)return a;let l=za(r[t],i),u=za(r[t+1],i);t+=n,o[a++]=l,o[a++]=u;let c,h;do if(c=za(r[t],i),h=za(r[t+1],i),t+=n,t==e)return o[a++]=c,o[a++]=h,a;while(c==l&&h==u);for(;t<e;){const f=za(r[t],i),d=za(r[t+1],i);if(t+=n,f==c&&d==h)continue;const g=c-l,p=h-u,m=f-l,y=d-u;if(g*y==p*m&&(g<0&&m<g||g==m||g>0&&m>g)&&(p<0&&y<p||p==y||p>0&&y>p)){c=f,h=d;continue}o[a++]=c,o[a++]=h,l=c,u=h,c=f,h=d}return o[a++]=c,o[a++]=h,a}function Mp(r,t,e,n,i,o,a,l){for(let u=0,c=e.length;u<c;++u){const h=e[u];a=tb(r,t,h,n,i,o,a),l.push(a),t=h}return a}function eb(r,t,e,n,i,o,a,l){for(let u=0,c=e.length;u<c;++u){const h=e[u],f=[];a=Mp(r,t,h,n,i,o,a,f),l.push(f),t=h[h.length-1]}return a}function Bo(r,t,e,n,i){i=i!==void 0?i:[];let o=0;for(let a=t;a<e;a+=n)i[o++]=r.slice(a,a+n);return i.length=o,i}function mc(r,t,e,n,i){i=i!==void 0?i:[];let o=0;for(let a=0,l=e.length;a<l;++a){const u=e[a];i[o++]=Bo(r,t,u,n,i[o]),t=u}return i.length=o,i}function Np(r,t,e,n,i){i=i!==void 0?i:[];let o=0;for(let a=0,l=e.length;a<l;++a){const u=e[a];i[o++]=u.length===1&&u[0]===t?[]:mc(r,t,u,n,i[o]),t=u[u.length-1]}return i.length=o,i}function q0(r,t,e,n){let i=0,o=r[e-n],a=r[e-n+1];for(;t<e;t+=n){const l=r[t],u=r[t+1];i+=a*l-o*u,o=l,a=u}return i/2}function Z0(r,t,e,n){let i=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];i+=q0(r,t,l,n),t=l}return i}function nb(r,t,e,n){let i=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];i+=Z0(r,t,l,n),t=l[l.length-1]}return i}const Op=class a0 extends Do{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new a0(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,i){return i<Oa(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ap(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,i))}getArea(){return q0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Bo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=mf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new a0(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=pf(this.flatCoordinates,0,t,this.stride),this.changed()}},or=class HR extends Do{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new HR(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){const o=this.flatCoordinates,a=Zs(t,e,o[0],o[1]);if(a<i){const l=this.stride;for(let u=0;u<l;++u)n[u]=o[u];return n.length=l,a}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return Ml(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return op(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Y0(this.flatCoordinates,0,t,this.stride),this.changed()}};function rb(r,t,e,n,i){return!up(i,function(a){return!Ua(r,t,e,n,a[0],a[1])})}function Ua(r,t,e,n,i,o){let a=0,l=r[e-n],u=r[e-n+1];for(;t<e;t+=n){const c=r[t],h=r[t+1];u<=o?h>o&&(c-l)*(o-u)-(i-l)*(h-u)>0&&a++:h<=o&&(c-l)*(o-u)-(i-l)*(h-u)<0&&a--,l=c,u=h}return a!==0}function Fp(r,t,e,n,i,o){if(e.length===0||!Ua(r,t,e[0],n,i,o))return!1;for(let a=1,l=e.length;a<l;++a)if(Ua(r,e[a-1],e[a],n,i,o))return!1;return!0}function ib(r,t,e,n,i,o){if(e.length===0)return!1;for(let a=0,l=e.length;a<l;++a){const u=e[a];if(Fp(r,t,u,n,i,o))return!0;t=u[u.length-1]}return!1}function Dp(r,t,e,n,i,o,a){let l,u,c,h,f,d,g;const p=i[o+1],m=[];for(let _=0,v=e.length;_<v;++_){const x=e[_];for(h=r[x-n],d=r[x-n+1],l=t;l<x;l+=n)f=r[l],g=r[l+1],(p<=d&&g<=p||d<=p&&p<=g)&&(c=(p-d)/(g-d)*(f-h)+h,m.push(c)),h=f,d=g}let y=NaN,E=-1/0;for(m.sort(hs),h=m[0],l=1,u=m.length;l<u;++l){f=m[l];const _=Math.abs(f-h);_>E&&(c=(h+f)/2,Fp(r,t,e,n,c,p)&&(y=c,E=_)),h=f}return isNaN(y)&&(y=i[o]),a?(a.push(y,p,E),a):[y,p,E]}function K0(r,t,e,n,i){let o=[];for(let a=0,l=e.length;a<l;++a){const u=e[a];o=Dp(r,t,u,n,i,2*a,o),t=u[u.length-1]}return o}function J0(r,t,e,n,i){let o;for(t+=n;t<e;t+=n)if(o=i(r.slice(t-n,t),r.slice(t,t+n)),o)return o;return!1}function yf(r,t,e,n,i){const o=C0(An(),r,t,e,n);return De(i,o)?ri(i,o)||o[0]>=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:J0(r,t,e,n,function(a,l){return SP(i,a,l)}):!1}function sb(r,t,e,n,i){for(let o=0,a=e.length;o<a;++o){if(yf(r,t,e[o],n,i))return!0;t=e[o]}return!1}function Q0(r,t,e,n,i){return!!(yf(r,t,e,n,i)||Ua(r,t,e,n,i[0],i[1])||Ua(r,t,e,n,i[0],i[3])||Ua(r,t,e,n,i[2],i[1])||Ua(r,t,e,n,i[2],i[3]))}function $0(r,t,e,n,i){if(!Q0(r,t,e[0],n,i))return!1;if(e.length===1)return!0;for(let o=1,a=e.length;o<a;++o)if(rb(r,e[o-1],e[o],n,i)&&!yf(r,e[o-1],e[o],n,i))return!1;return!0}function ob(r,t,e,n,i){for(let o=0,a=e.length;o<a;++o){const l=e[o];if($0(r,t,l,n,i))return!0;t=l[l.length-1]}return!1}function ab(r,t,e,n){for(;t<e-n;){for(let i=0;i<n;++i){const o=r[t+i];r[t+i]=r[e-n+i],r[e-n+i]=o}t+=n,e-=n}}function Bp(r,t,e,n){let i=0,o=r[e-n],a=r[e-n+1];for(;t<e;t+=n){const l=r[t],u=r[t+1];i+=(l-o)*(u+a),o=l,a=u}return i===0?void 0:i>0}function Gp(r,t,e,n,i){i=i!==void 0?i:!1;for(let o=0,a=e.length;o<a;++o){const l=e[o],u=Bp(r,t,l,n);if(o===0){if(i&&u||!i&&!u)return!1}else if(i&&!u||!i&&u)return!1;t=l}return!0}function tE(r,t,e,n,i){for(let o=0,a=e.length;o<a;++o){const l=e[o];if(!Gp(r,t,l,n,i))return!1;l.length&&(t=l[l.length-1])}return!0}function _f(r,t,e,n,i){i=i!==void 0?i:!1;for(let o=0,a=e.length;o<a;++o){const l=e[o],u=Bp(r,t,l,n);(o===0?i&&u||!i&&!u:i&&!u||!i&&u)&&ab(r,t,l,n),t=l}return t}function kp(r,t,e,n,i){for(let o=0,a=e.length;o<a;++o)t=_f(r,t,e[o],n,i);return t}function eE(r,t){const e=[];let n=0,i=0,o;for(let a=0,l=t.length;a<l;++a){const u=t[a],c=Bp(r,n,u,2);if(o===void 0&&(o=c),c===o)e.push(t.slice(i,a+1));else{if(e.length===0)continue;e[e.length-1].push(t[i])}i=a+1,n=u}return e}let zp=class l0 extends Do{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Pn(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new l0(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,i){return i<Oa(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(bp(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lp(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,i))}containsXY(t,e){return Fp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Z0(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),_f(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,mc(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Gi(this.getExtent());this.flatInteriorPoint_=Dp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new or(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new Op(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,n=this.ends_,i=[];let o=0;for(let a=0,l=n.length;a<l;++a){const u=n[a],c=new Op(e.slice(o,u),t);i.push(c),o=u}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Gp(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=_f(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Mp(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new l0(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return $0(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=pc(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};const ar=zp;function nE(r){if(Da(r))throw new Error("Cannot create polygon from empty extent");const t=r[0],e=r[1],n=r[2],i=r[3],o=[t,e,t,i,n,i,n,e,t,e];return new zp(o,"XY",[o.length])}function lb(r,t,e){t=t||32;const n=r.getStride(),i=r.getLayout(),o=r.getCenter(),a=n*(t+1),l=new Array(a);for(let h=0;h<a;h+=n){l[h]=0,l[h+1]=0;for(let f=2;f<n;f++)l[h+f]=o[f]}const u=[l.length],c=new zp(l,i,u);return ub(c,o,r.getRadius(),e),c}function ub(r,t,e,n){const i=r.getFlatCoordinates(),o=r.getStride(),a=i.length/o-1,l=n||0;for(let u=0;u<=a;++u){const c=u*o,h=l+ds(u,a)*2*Math.PI/a;i[c]=t[0]+e*Math.cos(h),i[c+1]=t[1]+e*Math.sin(h)}r.changed()}const Up=0;class cb extends Di{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Ep(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&M0(),t.center&&(t.center=de(t.center,this.projection_)),t.extent&&(t.extent=ps(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const l in Bi)delete e[l];this.setProperties(e,!0);const n=fb(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const i=hb(t),o=n.constraint,a=db(t);this.constraints_={center:i,resolution:o,rotation:a},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const i=t||[0,0,0,0];e=e||[0,0,0,0];const o=this.getResolution(),a=o/2*(i[3]-e[3]+e[1]-i[1]),l=o/2*(i[0]-e[0]+e[2]-i[2]);this.setCenterInternal([n[0]+a,n[1]-l])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let n=0;n<e.length;++n){let i=arguments[n];i.center&&(i=Object.assign({},i),i.center=de(i.center,this.getProjection())),i.anchor&&(i=Object.assign({},i),i.anchor=de(i.anchor,this.getProjection())),e[n]=i}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,n;e>1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let i=0;for(;i<e&&!this.isDef();++i){const h=arguments[i];h.center&&this.setCenterInternal(h.center),h.zoom!==void 0?this.setZoom(h.zoom):h.resolution&&this.setResolution(h.resolution),h.rotation!==void 0&&this.setRotation(h.rotation)}if(i===e){n&&vf(n,!0);return}let o=Date.now(),a=this.targetCenter_.slice(),l=this.targetResolution_,u=this.targetRotation_;const c=[];for(;i<e;++i){const h=arguments[i],f={start:o,complete:!1,anchor:h.anchor,duration:h.duration!==void 0?h.duration:1e3,easing:h.easing||jP,callback:n};if(h.center&&(f.sourceCenter=a,f.targetCenter=h.center.slice(),a=f.targetCenter),h.zoom!==void 0?(f.sourceResolution=l,f.targetResolution=this.getResolutionForZoom(h.zoom),l=f.targetResolution):h.resolution&&(f.sourceResolution=l,f.targetResolution=h.resolution,l=f.targetResolution),h.rotation!==void 0){f.sourceRotation=u;const d=ds(h.rotation-u+Math.PI,2*Math.PI)-Math.PI;f.targetRotation=u+d,u=f.targetRotation}gb(f)?f.complete=!0:o+=f.duration,c.push(f)}this.animations_.push(c),this.setHint(fe.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[fe.ANIMATING]>0}getInteracting(){return this.hints_[fe.INTERACTING]>0}cancelAnimations(){this.setHint(fe.ANIMATING,-this.hints_[fe.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e<n;++e){const i=this.animations_[e];if(i[0].callback&&vf(i[0].callback,!1),!t)for(let o=0,a=i.length;o<a;++o){const l=i[o];if(!l.complete){t=l.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let n=this.animations_.length-1;n>=0;--n){const i=this.animations_[n];let o=!0;for(let a=0,l=i.length;a<l;++a){const u=i[a];if(u.complete)continue;const c=t-u.start;let h=u.duration>0?c/u.duration:1;h>=1?(u.complete=!0,h=1):o=!1;const f=u.easing(h);if(u.sourceCenter){const d=u.sourceCenter[0],g=u.sourceCenter[1],p=u.targetCenter[0],m=u.targetCenter[1];this.nextCenter_=u.targetCenter;const y=d+f*(p-d),E=g+f*(m-g);this.targetCenter_=[y,E]}if(u.sourceResolution&&u.targetResolution){const d=f===1?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){const g=this.getViewportSize_(this.getRotation()),p=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(p,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){const d=f===1?ds(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!u.complete)break}if(o){this.animations_[n]=null,this.setHint(fe.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=i[0].callback;a&&vf(a,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const i=this.getCenterInternal();return i!==void 0&&(n=[i[0]-e[0],i[1]-e[1]],gp(n,t-this.getRotation()),R0(n,e)),n}calculateCenterZoom(t,e){let n;const i=this.getCenterInternal(),o=this.getResolution();if(i!==void 0&&o!==void 0){const a=e[0]-t*(e[0]-i[0])/o,l=e[1]-t*(e[1]-i[1])/o;n=[a,l]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Ga(t,this.getProjection())}getCenterInternal(){return this.get(Bi.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return gc(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();xt(e,"The view center is not defined");const n=this.getResolution();xt(n!==void 0,"The view resolution is not defined");const i=this.getRotation();return xt(i!==void 0,"The view rotation is not defined"),hc(e,n,i,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Bi.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(ps(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=Pt(t)/e[0],i=Fe(t)/e[1];return Math.max(n,i)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(e/n)/Math.log(t);return function(o){return e/Math.pow(t,o*i)}}getRotation(){return this.get(Bi.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,o=Math.log(n/i)/e;return function(a){return Math.log(n/a)/e/o}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let i=this.getCenterInternal();const o=this.padding_;if(o){const a=this.getViewportSizeMinusPadding_();i=Vp(i,this.getViewportSize_(),[a[0]/2+o[3],a[1]/2+o[0]],e,n)}return{center:i.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,i;if(this.resolutions_){const o=ef(this.resolutions_,t,1);e=o,n=this.resolutions_[o],o==this.resolutions_.length-1?i=2:i=n/this.resolutions_[o+1]}else n=this.maxResolution_,i=this.zoomFactor_;return e+Math.log(n/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=Oe(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Oe(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(xt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){xt(!Da(t),"Cannot fit empty extent provided as `geometry`");const i=ps(t,this.getProjection());n=nE(i)}else if(t.getType()==="Circle"){const i=ps(t.getExtent(),this.getProjection());n=nE(i),n.rotate(this.getRotation(),Gi(i))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),o=t.getFlatCoordinates(),a=t.getStride();let l=1/0,u=1/0,c=-1/0,h=-1/0;for(let f=0,d=o.length;f<d;f+=a){const g=o[f]*n-o[f+1]*i,p=o[f]*i+o[f+1]*n;l=Math.min(l,g),u=Math.min(u,p),c=Math.max(c,g),h=Math.max(h,p)}return[l,u,c,h]}fitInternal(t,e){e=e||{};let n=e.size;n||(n=this.getViewportSizeMinusPadding_());const i=e.padding!==void 0?e.padding:[0,0,0,0],o=e.nearest!==void 0?e.nearest:!1;let a;e.minResolution!==void 0?a=e.minResolution:e.maxZoom!==void 0?a=this.getResolutionForZoom(e.maxZoom):a=0;const l=this.rotatedExtentForGeometry(t);let u=this.getResolutionForExtentInternal(l,[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]);u=isNaN(u)?a:Math.max(u,a),u=this.getConstrainedResolution(u,o?0:1);const c=this.getRotation(),h=Math.sin(c),f=Math.cos(c),d=Gi(l);d[0]+=(i[1]-i[3])/2*u,d[1]+=(i[0]-i[2])/2*u;const g=d[0]*f-d[1]*h,p=d[1]*f+d[0]*h,m=this.getConstrainedCenter([g,p],u),y=e.callback?e.callback:Il;e.duration!==void 0?this.animateInternal({resolution:u,center:m,duration:e.duration,easing:e.easing},y):(this.targetResolution_=u,this.targetCenter_=m,this.applyTargetState_(!1,!0),vf(y,!0))}centerOn(t,e,n){this.centerOnInternal(de(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(Vp(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,i){let o;const a=this.padding_;if(a&&t){const l=this.getViewportSizeMinusPadding_(-n),u=Vp(t,i,[l[0]/2+a[3],l[1]/2+a[0]],e,n);o=[t[0]-u[0],t[1]-u[1]]}return o}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=Ga(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&de(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,i,n);e&&(this.targetCenter_=this.calculateCenterZoom(o,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=de(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&de(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const n=this.getAnimating()||this.getInteracting()||e,i=this.constraints_.rotation(this.targetRotation_,n),o=this.getViewportSize_(i),a=this.constraints_.resolution(this.targetResolution_,0,o,n),l=this.constraints_.center(this.targetCenter_,a,o,n,this.calculateCenterShift(this.targetCenter_,a,i,o));this.get(Bi.ROTATION)!==i&&this.set(Bi.ROTATION,i),this.get(Bi.RESOLUTION)!==a&&(this.set(Bi.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!l||!this.get(Bi.CENTER)||!ki(this.get(Bi.CENTER),l))&&this.set(Bi.CENTER,l),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,n){t=t!==void 0?t:200;const i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),l=this.constraints_.resolution(this.targetResolution_,i,a),u=this.constraints_.center(this.targetCenter_,l,a,!1,this.calculateCenterShift(this.targetCenter_,l,o,a));if(t===0&&!this.cancelAnchor_){this.targetResolution_=l,this.targetRotation_=o,this.targetCenter_=u,this.applyTargetState_();return}n=n||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==l||this.getRotation()!==o||!this.getCenterInternal()||!ki(this.getCenterInternal(),u))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:l,duration:t,easing:Fl,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(fe.INTERACTING,1)}endInteraction(t,e,n){n=n&&de(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(fe.INTERACTING,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function vf(r,t){setTimeout(function(){r(t)},0)}function hb(r){if(r.extent!==void 0){const e=r.smoothExtentConstraint!==void 0?r.smoothExtentConstraint:!0;return F0(r.extent,r.constrainOnlyCenter,e)}const t=Ep(r.projection,"EPSG:3857");if(r.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,F0(e,!1,!1)}return GP}function fb(r){let t,e,n,a=r.minZoom!==void 0?r.minZoom:Up,l=r.maxZoom!==void 0?r.maxZoom:28;const u=r.zoomFactor!==void 0?r.zoomFactor:2,c=r.multiWorld!==void 0?r.multiWorld:!1,h=r.smoothResolutionConstraint!==void 0?r.smoothResolutionConstraint:!0,f=r.showFullExtent!==void 0?r.showFullExtent:!1,d=Ep(r.projection,"EPSG:3857"),g=d.getExtent();let p=r.constrainOnlyCenter,m=r.extent;if(!c&&!m&&d.isGlobal()&&(p=!1,m=g),r.resolutions!==void 0){const y=r.resolutions;e=y[a],n=y[l]!==void 0?y[l]:y[y.length-1],r.constrainResolution?t=kP(y,h,!p&&m,f):t=D0(e,n,h,!p&&m,f)}else{const E=(g?Math.max(Pt(g),Fe(g)):360*Rl.degrees/d.getMetersPerUnit())/rp/Math.pow(2,Up),_=E/Math.pow(2,28-Up);e=r.maxResolution,e!==void 0?a=0:e=E/Math.pow(u,a),n=r.minResolution,n===void 0&&(r.maxZoom!==void 0?r.maxResolution!==void 0?n=e/Math.pow(u,l):n=E/Math.pow(u,l):n=_),l=a+Math.floor(Math.log(e/n)/Math.log(u)),n=e/Math.pow(u,l-a),r.constrainResolution?t=zP(u,e,n,h,!p&&m,f):t=D0(e,n,h,!p&&m,f)}return{constraint:t,maxResolution:e,minResolution:n,minZoom:a,zoomFactor:u}}function db(r){if(r.enableRotation!==void 0?r.enableRotation:!0){const e=r.constrainRotation;return e===void 0||e===!0?VP():e===!1?B0:typeof e=="number"?UP(e):B0}return Sp}function gb(r){return!(r.sourceCenter&&r.targetCenter&&!ki(r.sourceCenter,r.targetCenter)||r.sourceResolution!==r.targetResolution||r.sourceRotation!==r.targetRotation)}function Vp(r,t,e,n,i){const o=Math.cos(-i);let a=Math.sin(-i),l=r[0]*o-r[1]*a,u=r[1]*o+r[0]*a;l+=(t[0]/2-e[0])*n,u+=(e[1]-t[1]/2)*n,a=-a;const c=l*o-u*a,h=u*o+l*a;return[c,h]}const Br=cb;class pb extends y0{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(te.SOURCE,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(te.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Ht(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=yt(t,ot.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof Br?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let i;e.layerStatesArray?i=e.layerStatesArray.find(a=>a.layer===this):i=this.getLayerState();const o=this.getExtent();return jp(i,e.viewState)&&(!o||De(o,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const n=this.getSource();if(n&&(e=n.getAttributions()),!e)return[];const i=t instanceof Br?t.getViewStateAndExtent():t;let o=e(i);return Array.isArray(o)||(o=[o]),o}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(te.MAP,t)}getMapInternal(){return this.get(te.MAP)}setMap(t){this.mapPrecomposeKey_&&(Ht(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ht(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=yt(t,pn.PRECOMPOSE,function(e){const i=e.frameState.layerStatesArray,o=this.getLayerState(!1);xt(!i.some(function(a){return a.layer===o.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),i.push(o)},this),this.mapRenderKey_=yt(this,ot.CHANGE,t.render,t),this.changed())}setSource(t){this.set(te.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function jp(r,t){if(!r.visible)return!1;const e=t.resolution;if(e<r.minResolution||e>=r.maxResolution)return!1;const n=t.zoom;return n>r.minZoom&&n<=r.maxZoom}const yc=pb;class mb extends yc{constructor(t){t=t||{},super(t)}}const yb=mb,$={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class _b extends oc{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t}getFeatures(t){return at()}getData(t){return null}prepareFrame(t){return at()}renderFrame(t,e){return at()}loadedTileCallback(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n}createLoadedTileFinder(t,e,n){return(i,o)=>{const a=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,o,a)}}forEachFeatureAtCoordinate(t,e,n,i,o){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===$.LOADED||e.getState()===$.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=$.LOADED&&e!=$.ERROR&&t.addEventListener(ot.CHANGE,this.boundHandleImageChange_),e==$.IDLE&&(t.load(),e=t.getState()),e==$.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const rE=_b;class vb extends Er{constructor(t,e,n,i){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=i}}const _c=vb,Go=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Eb=Go.includes("firefox"),xb=Go.includes("safari")&&!Go.includes("chrom")&&(Go.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Go)),wb=Go.includes("webkit")&&!Go.includes("edge"),iE=Go.includes("macintosh"),sE=typeof devicePixelRatio<"u"?devicePixelRatio:1,oE=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Wp=typeof Image<"u"&&Image.prototype.decode,Sb=typeof createImageBitmap=="function",aE=function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r}();function ln(r,t,e,n){let i;return e&&e.length?i=e.shift():oE?i=new OffscreenCanvas(r||300,t||300):i=document.createElement("canvas"),r&&(i.width=r),t&&(i.height=t),i.getContext("2d",n)}let Yp;function Ef(){return Yp||(Yp=ln(1,1)),Yp}function vc(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}function Cb(r){let t=r.offsetWidth;const e=getComputedStyle(r);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function Ib(r){let t=r.offsetHeight;const e=getComputedStyle(r);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function lE(r,t){const e=t.parentNode;e&&e.replaceChild(r,t)}function xf(r){return r&&r.parentNode?r.parentNode.removeChild(r):null}function uE(r){for(;r.lastChild;)r.removeChild(r.lastChild)}function Tb(r,t){const e=r.childNodes;for(let n=0;;++n){const i=e[n],o=t[n];if(!i&&!o)break;if(i!==o){if(!i){r.appendChild(o);continue}if(!o){r.removeChild(i),--n;continue}r.insertBefore(o,i)}}}class Rb{constructor(){zt(this,"pushMethodArgs_",(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this));this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Ef(),{get:(t,e)=>{if(typeof Ef()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,n),!0)})}pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,i=e.length;n<i;++n){const o=e[n];if(typeof o=="function"){o(t);continue}const a=e[++n];if(typeof t[o]=="function")t[o](...a);else{if(typeof a=="function"){t[o]=a(t);continue}t[o]=a}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const Xp=Rb,Ec={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Ln={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Ln.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}},Ln.max=Ln.whitepoint[2].D65,Ln.rgb=function(r,t){t=t||Ln.whitepoint[2].E;var e=r[0]/t[0],n=r[1]/t[1],i=r[2]/t[2],o,a,l;return o=e*3.240969941904521+n*-1.537383177570093+i*-.498610760293,a=e*-.96924363628087+n*1.87596750150772+i*.041555057407175,l=e*.055630079696993+n*-.20397695888897+i*1.056971514242878,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,l=l>.0031308?1.055*Math.pow(l,1/2.4)-.055:l=l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]},Ec.xyz=function(r,t){var e=r[0]/255,n=r[1]/255,i=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var o=e*.41239079926595+n*.35758433938387+i*.18048078840183,a=e*.21263900587151+n*.71516867876775+i*.072192315360733,l=e*.019330818715591+n*.11919477979462+i*.95053215224966;return t=t||Ln.whitepoint[2].E,[o*t[0],a*t[1],l*t[2]]};const Hp={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(r,t,e){var n,i,o,a,l,u,c,h,f,d,g,p,m;if(o=r[0],a=r[1],l=r[2],o===0)return[0,0,0];var y=.0011070564598794539;return t=t||"D65",e=e||2,f=Ln.whitepoint[e][t][0],d=Ln.whitepoint[e][t][1],g=Ln.whitepoint[e][t][2],p=4*f/(f+15*d+3*g),m=9*d/(f+15*d+3*g),n=a/(13*o)+p||0,i=l/(13*o)+m||0,c=o>8?d*Math.pow((o+16)/116,3):d*o*y,u=c*9*n/(4*i)||0,h=c*(12-3*n-20*i)/(4*i)||0,[u,c,h]}};Ln.luv=function(r,t,e){var n,i,o,a,l,u,c,h,f,d,g,p,m,y=.008856451679035631,E=903.2962962962961;t=t||"D65",e=e||2,f=Ln.whitepoint[e][t][0],d=Ln.whitepoint[e][t][1],g=Ln.whitepoint[e][t][2],p=4*f/(f+15*d+3*g),m=9*d/(f+15*d+3*g),u=r[0],c=r[1],h=r[2],n=4*u/(u+15*c+3*h)||0,i=9*c/(u+15*c+3*h)||0;var _=c/d;return o=_<=y?E*_:116*Math.pow(_,1/3)-16,a=13*o*(n-p),l=13*o*(i-m),[o,a,l]};var cE={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(r){var t=r[0],e=r[1],n=r[2],i,o,a;return a=n/360*2*Math.PI,i=e*Math.cos(a),o=e*Math.sin(a),[t,i,o]},xyz:function(r){return Hp.xyz(cE.luv(r))}};Hp.lchuv=function(r){var t=r[0],e=r[1],n=r[2],i=Math.sqrt(e*e+n*n),o=Math.atan2(n,e),a=o*360/2/Math.PI;return a<0&&(a+=360),[t,i,a]},Ln.lchuv=function(r){return Hp.lchuv(Ln.luv(r))};const hE={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var fE={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Pb(r){var h,f;var t,e=[],n=1,i;if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(r=String(r).toLowerCase(),hE[r])e=hE[r].slice(),i="rgb";else if(r==="transparent")n=0,i="rgb",e=[0,0,0];else if(r[0]==="#"){var o=r.slice(1),a=o.length,l=a<=4;n=1,l?(e=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],a===4&&(n=parseInt(o[3]+o[3],16)/255)):(e=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],a===8&&(n=parseInt(o[6]+o[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),i="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(r)){var u=t[1];i=u.replace(/a$/,"");var c=i==="cmyk"?4:i==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=e.shift()),e=e.map(function(d,g){if(d[d.length-1]==="%")return d=parseFloat(d)/100,g===3?d:i==="rgb"?d*255:i[0]==="h"||i[0]==="l"&&!g?d*100:i==="lab"?d*125:i==="lch"?g<2?d*150:d*360:i[0]==="o"&&!g?d:i==="oklab"?d*.4:i==="oklch"?g<2?d*.4:d*360:d;if(i[g]==="h"||g===2&&i[i.length-1]==="h"){if(fE[d]!==void 0)return fE[d];if(d.endsWith("deg"))return parseFloat(d);if(d.endsWith("turn"))return parseFloat(d)*360;if(d.endsWith("grad"))return parseFloat(d)*360/400;if(d.endsWith("rad"))return parseFloat(d)*180/Math.PI}return d==="none"?0:parseFloat(d)}),n=e.length>c?e.pop():1}else/[0-9](?:\s|\/|,)/.test(r)&&(e=r.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),i=((f=(h=r.match(/([a-z])/ig))==null?void 0:h.join(""))==null?void 0:f.toLowerCase())||"rgb");return{space:i,values:e,alpha:n}}const qp={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i,o,a,l,u,c=0;if(e===0)return u=n*255,[u,u,u];for(o=n<.5?n*(1+e):n+e-n*e,i=2*n-o,l=[0,0,0];c<3;)a=t+1/3*-(c-1),a<0?a++:a>1&&a--,u=6*a<1?i+(o-i)*6*a:2*a<1?o:3*a<2?i+(o-i)*(2/3-a)*6:i,l[c++]=u*255;return l}};Ec.hsl=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.min(t,e,n),o=Math.max(t,e,n),a=o-i,l,u,c;return o===i?l=0:t===o?l=(e-n)/a:e===o?l=2+(n-t)/a:n===o&&(l=4+(t-e)/a),l=Math.min(l*60,360),l<0&&(l+=360),c=(i+o)/2,o===i?u=0:c<=.5?u=a/(o+i):u=a/(2-o-i),[l,u*100,c*100]};function bb(r){Array.isArray(r)&&r.raw&&(r=String.raw(...arguments)),r instanceof Number&&(r=+r);var t,e=Pb(r);if(!e.space)return[];const n=e.space[0]==="h"?qp.min:Ec.min,i=e.space[0]==="h"?qp.max:Ec.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],n[0]),i[0]),t[1]=Math.min(Math.max(e.values[1],n[1]),i[1]),t[2]=Math.min(Math.max(e.values[2],n[2]),i[2]),e.space[0]==="h"&&(t=qp.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function Ab(r){return typeof r=="string"?r:Jp(r)}const Lb=1024,xc={};let Zp=0;function Mb(r){if(r.length===4)return r;const t=r.slice();return t[3]=1,t}function dE(r){const t=Ln.lchuv(Ec.xyz(r));return t[3]=r[3],t}function Nb(r){const t=Ln.rgb(cE.xyz(r));return t[3]=r[3],t}function Kp(r){if(xc.hasOwnProperty(r))return xc[r];if(Zp>=Lb){let e=0;for(const n in xc)e++&3||(delete xc[n],--Zp)}const t=bb(r);if(t.length!==4)throw new Error('Failed to parse "'+r+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+r+'" as color');return gE(t),xc[r]=t,++Zp,t}function Dl(r){return Array.isArray(r)?r:Kp(r)}function gE(r){return r[0]=Oe(r[0]+.5|0,0,255),r[1]=Oe(r[1]+.5|0,0,255),r[2]=Oe(r[2]+.5|0,0,255),r[3]=Oe(r[3],0,1),r}function Jp(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let n=r[2];n!=(n|0)&&(n=n+.5|0);const i=r[3]===void 0?1:Math.round(r[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+i+")"}function Ob(r){try{return Kp(r),!0}catch{return!1}}const pE=[];let Bl=null;function Fb(){Bl=ln(1,1,void 0,{willReadFrequently:!0})}class Db extends rE{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=an(),this.pixelTransform=an(),this.inversePixelTransform=an(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,n){Bl||Fb(),Bl.clearRect(0,0,1,1);let i;try{Bl.drawImage(t,e,n,1,1,0,0,1,1),i=Bl.getImageData(0,0,1,1).data}catch{return Bl=null,null}return i}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const i=this.getLayer().getClassName();let o,a;if(t&&t.className===i&&(!n||t&&t.style.backgroundColor&&fs(Dl(t.style.backgroundColor),Dl(n)))){const l=t.firstElementChild;l instanceof HTMLCanvasElement&&(a=l.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){o=document.createElement("div"),o.className=i;let l=o.style;l.position="absolute",l.width="100%",l.height="100%",a=ln();const u=a.canvas;o.appendChild(u),l=u.style,l.position="absolute",l.left="0",l.transformOrigin="top left",this.container=o,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const i=wr(n),o=fc(n),a=cc(n),l=Nl(n);We(e.coordinateToPixelTransform,i),We(e.coordinateToPixelTransform,o),We(e.coordinateToPixelTransform,a),We(e.coordinateToPixelTransform,l);const u=this.inversePixelTransform;We(u,i),We(u,o),We(u,a),We(u,l),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(l[0]),Math.round(l[1])),t.clip()}prepareContainer(t,e){const n=t.extent,i=t.viewState.resolution,o=t.viewState.rotation,a=t.pixelRatio,l=Math.round(Pt(n)/i*a),u=Math.round(Fe(n)/i*a);si(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,o,-l/2,-u/2),Tp(this.inversePixelTransform,this.pixelTransform);const c=HP(this.pixelTransform);if(this.useContainer(e,c,this.getBackground(t)),!this.containerReused){const h=this.context.canvas;h.width!=l||h.height!=u?(h.width=l,h.height=u):this.context.clearRect(0,0,l,u),c!==h.style.transform&&(h.style.transform=c)}}dispatchRenderEvent_(t,e,n){const i=this.getLayer();if(i.hasListener(t)){const o=new _c(t,this.inversePixelTransform,n,e);i.dispatchEvent(o)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(pn.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(pn.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Xp),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(pn.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(pn.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,i,o,a,l){const u=o/2,c=a/2,h=i/e,f=-h,d=-t[0]+l,g=-t[1];return si(this.tempTransform,u,c,h,f,-n,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const Qp=Db;class Bb extends Qp{constructor(t){super(t),this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,i=t.viewState,o=i.resolution,a=this.getLayer().getSource(),l=t.viewHints;let u=t.extent;if(e.extent!==void 0&&(u=Ks(u,ps(e.extent,i.projection))),!l[fe.ANIMATING]&&!l[fe.INTERACTING]&&!Da(u))if(a){const c=i.projection,h=a.getImage(u,o,n,c);h&&(this.loadImage(h)?this.image_=h:h.getState()===$.EMPTY&&(this.image_=null))}else this.image_=null;return!!this.image_}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=We(e.pixelToCoordinateTransform,t.slice()),o=n.getExtent();if(o&&!Fa(o,i))return null;const a=this.image_.getExtent(),l=this.image_.getImage(),u=Pt(a),c=Math.floor(l.width*((i[0]-a[0])/u));if(c<0||c>=l.width)return null;const h=Fe(a),f=Math.floor(l.height*((a[3]-i[1])/h));return f<0||f>=l.height?null:this.getImageData(l,c,f)}renderFrame(t,e){const n=this.image_,i=n.getExtent(),o=n.getResolution(),[a,l]=Array.isArray(o)?o:[o,o],u=n.getPixelRatio(),c=t.layerStatesArray[t.layerIndex],h=t.pixelRatio,f=t.viewState,d=f.center,g=f.resolution,p=h*a/(g*u),m=h*l/(g*u);this.prepareContainer(t,e);const y=this.context.canvas.width,E=this.context.canvas.height,_=this.getRenderContext(t);let v=!1,x=!0;if(c.extent){const R=ps(c.extent,f.projection);x=De(R,t.extent),v=x&&!ri(R,t.extent),v&&this.clipUnrotated(_,t,R)}const w=n.getImage(),I=si(this.tempTransform,y/2,E/2,p,m,0,u*(i[0]-d[0])/a,u*(d[1]-i[3])/l);this.renderedResolution=l*h/u;const C=w.width*I[0],T=w.height*I[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,t),x&&C>=.5&&T>=.5){const R=I[4],M=I[5],P=c.opacity;P!==1&&(_.save(),_.globalAlpha=P),_.drawImage(w,0,0,+w.width,+w.height,R,M,C,T),P!==1&&_.restore()}return this.postRender(this.context,t),v&&_.restore(),_.imageSmoothingEnabled=!0,this.container}}const Gb=Bb;class kb extends yb{constructor(t){super(t)}createRenderer(){return new Gb(this)}getData(t){return super.getData(t)}}const $p=kb;class zb extends sc{constructor(t,e,n,i){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof i=="function"?$.IDLE:i,this.image_=null,this.loader=typeof i=="function"?i:null}changed(){this.dispatchEvent(ot.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==$.IDLE&&this.loader){this.state=$.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;p0(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=$.LOADED}).catch(n=>{this.state=$.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function Ub(r,t,e){const n=r;let i=!0,o=!1,a=!1;const l=[nf(n,ot.LOAD,function(){a=!0,o||t()})];return n.src&&Wp?(o=!0,n.decode().then(function(){i&&t()}).catch(function(u){i&&(a?t():e())})):l.push(nf(n,ot.ERROR,e)),function(){i=!1,l.forEach(Ht)}}function Vb(r,t){return new Promise((e,n)=>{function i(){a(),e(r)}function o(){a(),n(new Error("Image load error"))}function a(){r.removeEventListener("load",i),r.removeEventListener("error",o)}r.addEventListener("load",i),r.addEventListener("error",o),t&&(r.src=t)})}function mE(r,t){return t&&(r.src=t),r.src&&Wp?new Promise((e,n)=>r.decode().then(()=>e(r)).catch(i=>r.complete&&r.width?e(r):n(i))):Vb(r)}function wf(r,t){return t&&(r.src=t),r.src&&Wp&&Sb?r.decode().then(()=>createImageBitmap(r)).catch(e=>{if(r.complete&&r.width)return r;throw e}):mE(r)}const tm=zb;class jb extends tm{constructor(t,e,n,i,o){const a=o!==void 0?$.IDLE:$.LOADED;super(t,e,n,a),this.loader_=o!==void 0?o:null,this.canvas_=i,this.error_=null}getError(){return this.error_}handleLoad_(t){t?(this.error_=t,this.state=$.ERROR):this.state=$.LOADED,this.changed()}load(){this.state==$.IDLE&&(this.state=$.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}const Wb=jb,yE=.5,Yb=10,_E=.25;class Xb{constructor(t,e,n,i,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const u=Ol(this.targetProj_,this.sourceProj_);this.transformInv_=function(_){const v=_[0]+"/"+_[1];return l[v]||(l[v]=u(_)),l[v]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Pt(i)>=Pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Pt(this.targetProj_.getExtent()):null;const c=wr(n),h=fc(n),f=cc(n),d=Nl(n),g=this.transformInv_(c),p=this.transformInv_(h),m=this.transformInv_(f),y=this.transformInv_(d),E=Yb+(a?Math.max(0,Math.ceil(Math.log2(cp(n)/(a*a*256*256)))):0);if(this.addQuad_(c,h,f,d,g,p,m,y,E),this.wrapsXInSource_){let _=1/0;this.triangles_.forEach(function(v,x,w){_=Math.min(_,v.source[0][0],v.source[1][0],v.source[2][0])}),this.triangles_.forEach(v=>{if(Math.max(v.source[0][0],v.source[1][0],v.source[2][0])-_>this.sourceWorldWidth_/2){const x=[[v.source[0][0],v.source[0][1]],[v.source[1][0],v.source[1][1]],[v.source[2][0],v.source[2][1]]];x[0][0]-_>this.sourceWorldWidth_/2&&(x[0][0]-=this.sourceWorldWidth_),x[1][0]-_>this.sourceWorldWidth_/2&&(x[1][0]-=this.sourceWorldWidth_),x[2][0]-_>this.sourceWorldWidth_/2&&(x[2][0]-=this.sourceWorldWidth_);const w=Math.min(x[0][0],x[1][0],x[2][0]);Math.max(x[0][0],x[1][0],x[2][0])-w<this.sourceWorldWidth_/2&&(v.source=x)}})}l={}}addTriangle_(t,e,n,i,o,a){this.triangles_.push({source:[i,o,a],target:[t,e,n]})}addQuad_(t,e,n,i,o,a,l,u,c){const h=bn([o,a,l,u]),f=this.sourceWorldWidth_?Pt(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&f>.5&&f<1;let p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const y=bn([t,e,n,i]);p=Pt(y)/this.targetWorldWidth_>_E||p}!g&&this.sourceProj_.isGlobal()&&f&&(p=f>_E||p)}if(!p&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!De(h,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1])||!isFinite(u[0])||!isFinite(u[1]))){if(c>0)p=!0;else if(m=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(l[0])||!isFinite(l[1])?2:0)+(!isFinite(u[0])||!isFinite(u[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){const y=[(t[0]+n[0])/2,(t[1]+n[1])/2],E=this.transformInv_(y);let _;g?_=(ds(o[0],d)+ds(l[0],d))/2-ds(E[0],d):_=(o[0]+l[0])/2-E[0];const v=(o[1]+l[1])/2-E[1];p=_*_+v*v>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const y=[(e[0]+n[0])/2,(e[1]+n[1])/2],E=this.transformInv_(y),_=[(i[0]+t[0])/2,(i[1]+t[1])/2],v=this.transformInv_(_);this.addQuad_(t,e,y,_,o,a,E,v,c-1),this.addQuad_(_,y,n,i,v,E,l,u,c-1)}else{const y=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(y),_=[(n[0]+i[0])/2,(n[1]+i[1])/2],v=this.transformInv_(_);this.addQuad_(t,y,_,i,o,E,v,u,c-1),this.addQuad_(y,e,n,_,E,a,l,v,c-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(t,n,i,o,l,u),m&14||this.addTriangle_(t,n,e,o,l,a),m&&(m&13||this.addTriangle_(e,i,t,a,u,o),m&7||this.addTriangle_(e,i,n,a,u,l))}calculateSourceExtent(){const t=An();return this.triangles_.forEach(function(e,n,i){const o=e.source;uc(t,o[0]),uc(t,o[1]),uc(t,o[2])}),t}getTriangles(){return this.triangles_}}const vE=Xb;let em;const Gl=[];function EE(r,t,e,n,i){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(n,i),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,n)+1,Math.max(e,i)),r.restore()}function nm(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function Hb(){if(em===void 0){const r=ln(6,6,Gl);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",EE(r,4,5,4,0),EE(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;em=nm(t,0)||nm(t,4)||nm(t,8),vc(r),Gl.push(r.canvas)}return em}function wc(r,t,e,n){const i=Ba(e,t,r);let o=cf(t,n,e);const a=t.getMetersPerUnit();a!==void 0&&(o*=a);const l=r.getMetersPerUnit();l!==void 0&&(o/=l);const u=r.getExtent();if(!u||Fa(u,i)){const c=cf(r,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function qb(r,t,e,n){const i=Gi(e);let o=wc(r,t,i,n);return(!isFinite(o)||o<=0)&&up(e,function(a){return o=wc(r,t,a,n),isFinite(o)&&o>0}),o}function xE(r,t,e,n,i,o,a,l,u,c,h,f,d,g){const p=ln(Math.round(e*r),Math.round(e*t),Gl);if(f||(p.imageSmoothingEnabled=!1),u.length===0)return p.canvas;p.scale(e,e);function m(w){return Math.round(w*e)/e}p.globalCompositeOperation="lighter";const y=An();u.forEach(function(w,I,C){S0(y,w.extent)});let E;const _=e/n,v=(f?1:1+Math.pow(2,-24))/_;if(!d||u.length!==1||c!==0){if(E=ln(Math.round(Pt(y)*_),Math.round(Fe(y)*_),Gl),f||(E.imageSmoothingEnabled=!1),i&&g){const w=(i[0]-y[0])*_,I=-(i[3]-y[3])*_,C=Pt(i)*_,T=Fe(i)*_;E.rect(w,I,C,T),E.clip()}u.forEach(function(w,I,C){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){E.save();const b=(w.clipExtent[0]-y[0])*_,A=-(w.clipExtent[3]-y[3])*_,L=Pt(w.clipExtent)*_,B=Fe(w.clipExtent)*_;E.rect(f?b:Math.round(b),f?A:Math.round(A),f?L:Math.round(b+L)-Math.round(b),f?B:Math.round(A+B)-Math.round(A)),E.clip()}const T=(w.extent[0]-y[0])*_,R=-(w.extent[3]-y[3])*_,M=Pt(w.extent)*_,P=Fe(w.extent)*_;E.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,f?T:Math.round(T),f?R:Math.round(R),f?M:Math.round(T+M)-Math.round(T),f?P:Math.round(R+P)-Math.round(R)),w.clipExtent&&E.restore()}})}const x=wr(a);return l.getTriangles().forEach(function(w,I,C){const T=w.source,R=w.target;let M=T[0][0],P=T[0][1],b=T[1][0],A=T[1][1],L=T[2][0],B=T[2][1];const F=m((R[0][0]-x[0])/o),V=m(-(R[0][1]-x[1])/o),Y=m((R[1][0]-x[0])/o),st=m(-(R[1][1]-x[1])/o),Q=m((R[2][0]-x[0])/o),et=m(-(R[2][1]-x[1])/o),H=M,Et=P;M=0,P=0,b-=H,A-=Et,L-=H,B-=Et;const G=[[b,A,0,0,Y-F],[L,B,0,0,Q-F],[0,0,b,A,st-V],[0,0,L,B,et-V]],bt=oP(G);if(!bt)return;if(p.save(),p.beginPath(),Hb()||!f){p.moveTo(Y,st);const Qt=4,ce=F-Y,q=V-st;for(let dt=0;dt<Qt;dt++)p.lineTo(Y+m((dt+1)*ce/Qt),st+m(dt*q/(Qt-1))),dt!=Qt-1&&p.lineTo(Y+m((dt+1)*ce/Qt),st+m((dt+1)*q/(Qt-1)));p.lineTo(Q,et)}else p.moveTo(Y,st),p.lineTo(F,V),p.lineTo(Q,et);p.clip(),p.transform(bt[0],bt[2],bt[1],bt[3],F,V),p.translate(y[0]-H,y[3]-Et);let ue;if(E)ue=E.canvas,p.scale(v,-v);else{const Qt=u[0],ce=Qt.extent;ue=Qt.image,p.scale(Pt(ce)/ue.width,-Fe(ce)/ue.height)}p.drawImage(ue,0,0),p.restore()}),E&&(vc(E),Gl.push(E.canvas)),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,l.getTriangles().forEach(function(w,I,C){const T=w.target,R=(T[0][0]-x[0])/o,M=-(T[0][1]-x[1])/o,P=(T[1][0]-x[0])/o,b=-(T[1][1]-x[1])/o,A=(T[2][0]-x[0])/o,L=-(T[2][1]-x[1])/o;p.beginPath(),p.moveTo(P,b),p.lineTo(R,M),p.lineTo(A,L),p.closePath(),p.stroke()}),p.restore()),p.canvas}function rm(r){return Array.isArray(r)?Math.min(...r):r}class Zb extends tm{constructor(t,e,n,i,o,a,l){let u=t.getExtent();u&&t.canWrapX()&&(u=u.slice(),u[0]=-1/0,u[2]=1/0);let c=e.getExtent();c&&e.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);const h=c?Ks(n,c):n,f=Gi(h),d=wc(t,e,f,i),g=yE,p=new vE(t,e,h,u,d*g,i),m=p.calculateSourceExtent(),y=Da(m)?null:a(m,d,o),E=y?$.IDLE:$.EMPTY,_=y?y.getPixelRatio():1;super(n,i,_,E),this.targetProj_=e,this.maxSourceExtent_=u,this.triangulation_=p,this.targetResolution_=i,this.targetExtent_=n,this.sourceImage_=y,this.sourcePixelRatio_=_,this.interpolate_=l,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==$.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==$.LOADED){const e=Pt(this.targetExtent_)/this.targetResolution_,n=Fe(this.targetExtent_)/this.targetResolution_;this.canvas_=xE(e,n,this.sourcePixelRatio_,rm(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=t,this.changed()}load(){if(this.state==$.IDLE){this.state=$.LOADING,this.changed();const t=this.sourceImage_.getState();t==$.LOADED||t==$.ERROR?this.reproject_():(this.sourceListenerKey_=yt(this.sourceImage_,ot.CHANGE,function(e){const n=this.sourceImage_.getState();(n==$.LOADED||n==$.ERROR)&&(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}}unlistenSource_(){Ht(this.sourceListenerKey_),this.sourceListenerKey_=null}}const Kb=Zb;class Jb extends Di{constructor(t){super(),this.projection=gt(t.projection),this.attributions_=wE(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(n,i){e.viewResolver=n,e.viewRejector=i})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=wE(t),this.changed()}setState(t){this.state_=t,this.changed()}}function wE(r){return r?Array.isArray(r)?function(t){return r}:typeof r=="function"?r:function(t){return[r]}:null}const im=Jb,ms=4,sm={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class Qb extends Er{constructor(t,e){super(t),this.image=e}}class $b extends im{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:t.interpolate!==void 0?t.interpolate:!0}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=t.resolutions!==void 0?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=t.loader?t.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const e=this.getResolutions();if(e){const n=ef(e,t,0);t=e[n]}return t}getImage(t,e,n,i){const o=this.getProjection();if(!o||!i||gs(o,i))return o&&(i=o),this.getImageInternal(t,e,n,i);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&gs(this.reprojectedImage_.getProjection(),i)&&this.reprojectedImage_.getResolution()==e&&Oo(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Kb(o,i,t,e,n,(a,l,u)=>this.getImageInternal(a,l,u,o),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,n,i){if(this.loader){const o=om(t,e,n,1),a=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===i&&(this.wantedExtent_&&ri(this.wantedExtent_,o)||ri(this.image.getExtent(),o))&&(this.wantedResolution_&&rm(this.wantedResolution_)===a||rm(this.image.getResolution())===a)))return this.image;this.wantedProjection_=i,this.wantedExtent_=o,this.wantedResolution_=a,this.image=new tm(o,a,n,this.loader),this.image.addEventListener(ot.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let n;switch(e.getState()){case $.LOADING:this.loading=!0,n=sm.IMAGELOADSTART;break;case $.LOADED:this.loading=!1,n=sm.IMAGELOADEND;break;case $.ERROR:this.loading=!1,n=sm.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new Qb(n,e))}}function SE(r,t){r.getImage().src=t}function om(r,t,e,n){const i=t/e,o=Gi(r),a=No(Pt(r)/i,ms),l=No(Fe(r)/i,ms),u=No((n-1)*a/2,ms),c=a+2*u,h=No((n-1)*l/2,ms),f=l+2*h;return hc(o,i,0,[c,f])}const am=$b;class tA extends am{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getImageInternal(t,e,n,i){e=this.findNearestResolution(e);let o=this.canvas_;if(o&&this.renderedRevision_==this.getRevision()&&o.getResolution()==e&&o.getPixelRatio()==n&&ri(o.getExtent(),t))return o;t=t.slice(),wP(t,this.ratio_);const a=Pt(t)/e,l=Fe(t)/e,u=[a*n,l*n],c=this.canvasFunction_.call(this,t,e,n,u,i);return c&&(o=new Wb(t,e,n,c)),this.canvas_=o,this.renderedRevision_=this.getRevision(),o}}const eA=tA;class nA{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return xt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return xt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){var e;return(e=this.entries_[t])==null?void 0:e.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){xt(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}const rA=nA,X={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Sf=class extends sc{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(ot.CHANGE)}release(){this.state===X.ERROR&&this.setState(X.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){let t=this.interimTile;if(!t)return this;do{if(t.getState()==X.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){let t=this.interimTile;if(!t)return;let e=this;do{if(t.getState()==X.LOADED){t.interimTile=null;break}t.getState()==X.LOADING?e=t:t.getState()==X.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==X.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){at()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const i=e-n+1e3/60;return i>=this.transition_?1:G0(i/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}};class iA extends Sf{constructor(t,e,n,i,o,a){super(t,e,a),this.crossOrigin_=i,this.src_=n,this.key=n,this.image_=new Image,i!==null&&(this.image_.crossOrigin=i),this.unlisten_=null,this.tileLoadFunction_=o}getImage(){return this.image_}setImage(t){this.image_=t,this.state=X.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=X.ERROR,this.unlistenImage_(),this.image_=sA(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=X.LOADED:this.state=X.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==X.ERROR&&(this.state=X.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==X.IDLE&&(this.state=X.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ub(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function sA(){const r=ln(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}const CE=iA;class oA extends Sf{constructor(t,e,n,i,o,a,l,u,c,h,f,d){super(o,X.IDLE,d),this.renderEdges_=f!==void 0?f:!1,this.pixelRatio_=l,this.gutter_=u,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=i,this.wrappedTileCoord_=a||o,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const g=i.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const y=p?Ks(g,p):g;if(cp(y)===0){this.state=X.EMPTY;return}const E=t.getExtent();E&&(m?m=Ks(m,E):m=E);const _=i.getResolution(this.wrappedTileCoord_[0]),v=qb(t,n,y,_);if(!isFinite(v)||v<=0){this.state=X.EMPTY;return}const x=h!==void 0?h:yE;if(this.triangulation_=new vE(t,n,y,m,v*x,_),this.triangulation_.getTriangles().length===0){this.state=X.EMPTY;return}this.sourceZ_=e.getZForResolution(v);let w=this.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(w[1]=Oe(w[1],m[1],m[3]),w[3]=Oe(w[3],m[1],m[3])):w=Ks(w,m)),!cp(w))this.state=X.EMPTY;else{let I=0,C=0;t.canWrapX()&&(I=Pt(E),C=Math.floor((w[0]-E[0])/I)),T0(w.slice(),t,!0).forEach(R=>{const M=e.getTileRangeForExtentAndZ(R,this.sourceZ_);for(let P=M.minX;P<=M.maxX;P++)for(let b=M.minY;b<=M.maxY;b++){const A=c(this.sourceZ_,P,b,l);if(A){const L=C*I;this.sourceTiles_.push({tile:A,offset:L})}}++C}),this.sourceTiles_.length===0&&(this.state=X.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{var i;const n=e.tile;if(n&&n.getState()==X.LOADED){const o=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);o[0]+=e.offset,o[2]+=e.offset;const a=(i=this.clipExtent_)==null?void 0:i.slice();a&&(a[0]+=e.offset,a[2]+=e.offset),t.push({extent:o,clipExtent:a,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=X.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i=typeof n=="number"?n:n[0],o=typeof n=="number"?n:n[1],a=this.targetTileGrid_.getResolution(e),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=xE(i,o,this.pixelRatio_,l,this.sourceTileGrid_.getExtent(),a,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=X.LOADED}this.changed()}load(){if(this.state==X.IDLE){this.state=X.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==X.IDLE||n==X.LOADING){t++;const i=yt(e,ot.CHANGE,function(o){const a=e.getState();(a==X.LOADED||a==X.ERROR||a==X.EMPTY)&&(Ht(i),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(i)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},n,i){e.getState()==X.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Ht),this.sourcesListenerKeys_=null}release(){this.canvas_&&(vc(this.canvas_.getContext("2d")),Gl.push(this.canvas_),this.canvas_=null),super.release()}}const lm=oA;function IE(r,t,e,n){return n!==void 0?(n[0]=r,n[1]=t,n[2]=e,n):[r,t,e]}function kl(r,t,e){return r+"/"+t+"/"+e}function TE(r){return kl(r[0],r[1],r[2])}function aA(r){const[t,e,n]=r.substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number);return kl(t,e,n)}function RE(r){return r.split("/").map(Number)}function um(r){return(r[1]<<r[0])+r[2]}function lA(r,t){const e=r[0],n=r[1],i=r[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const o=t.getFullTileRange(e);return o?o.containsXY(n,i):!0}class uA extends rA{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),n=RE(t)[0];this.forEach(i=>{i.tileCoord[0]!==n&&(this.remove(TE(i.tileCoord)),i.release())})}}const cm=uA,hm={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class PE{constructor(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function zl(r,t,e,n,i){return i!==void 0?(i.minX=r,i.maxX=t,i.minY=e,i.maxY=n,i):new PE(r,t,e,n)}const bE=PE;function AE(r){return r[0]>0&&r[1]>0}function LE(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function zn(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}const Ul=[0,0,0],ko=5;class cA{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,xt(eP(this.resolutions_,(i,o)=>o-i,!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let i=0,o=this.resolutions_.length-1;i<o;++i)if(!e)e=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==e){e=void 0;break}}this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,xt(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const n=t.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=wr(n)),xt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,xt(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:rp,xt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n!==void 0?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map((i,o)=>{const a=new bE(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(n){const l=this.getTileRangeForExtentAndZ(n,o);a.minX=Math.max(l.minX,a.minX),a.maxX=Math.min(l.maxX,a.maxX),a.minY=Math.max(l.minY,a.minY),a.maxY=Math.min(l.maxY,a.maxY)}return a}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const i=this.getTileRangeForExtentAndZ(t,e);for(let o=i.minX,a=i.maxX;o<=a;++o)for(let l=i.minY,u=i.maxY;l<=u;++l)n([e,o,l])}forEachTileCoordParentTileRange(t,e,n,i){let o,a,l,u=null,c=t[0]-1;for(this.zoomFactor_===2?(a=t[1],l=t[2]):u=this.getTileCoordExtent(t,i);c>=this.minZoom;){if(a!==void 0&&l!==void 0?(a=Math.floor(a/2),l=Math.floor(l/2),o=zl(a,a,l,l,n)):o=this.getTileRangeForExtentAndZ(u,c,n),e(c,o))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const o=t[1]*2,a=t[2]*2;return zl(o,o+1,a,a+1,e)}const i=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;const i=t[0],o=t[1],a=t[2];if(e===i)return zl(o,a,o,a,n);if(this.zoomFactor_){const u=Math.pow(this.zoomFactor_,e-i),c=Math.floor(o*u),h=Math.floor(a*u);if(e<i)return zl(c,c,h,h,n);const f=Math.floor(u*(o+1))-1,d=Math.floor(u*(a+1))-1;return zl(c,f,h,d,n)}const l=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(l,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Ul);const i=Ul[1],o=Ul[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Ul);const a=Ul[1],l=Ul[2];return zl(i,a,o,l,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=zn(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]}getTileCoordExtent(t,e){const n=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=zn(this.getTileSize(t[0]),this.tmpSize_),a=n[0]+t[1]*o[0]*i,l=n[1]-(t[2]+1)*o[1]*i,u=a+o[0]*i,c=l+o[1]*i;return ii(a,l,u,c,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)}getTileCoordForXYAndResolution_(t,e,n,i,o){const a=this.getZForResolution(n),l=n/this.getResolution(a),u=this.getOrigin(a),c=zn(this.getTileSize(a),this.tmpSize_);let h=l*(t-u[0])/n/c[0],f=l*(u[1]-e)/n/c[1];return i?(h=No(h,ko)-1,f=No(f,ko)-1):(h=Tl(h,ko),f=Tl(f,ko)),IE(a,h,f,o)}getTileCoordForXYAndZ_(t,e,n,i,o){const a=this.getOrigin(n),l=this.getResolution(n),u=zn(this.getTileSize(n),this.tmpSize_);let c=(t-a[0])/l/u[0],h=(a[1]-e)/l/u[1];return i?(c=No(c,ko)-1,h=No(h,ko)-1):(c=Tl(c,ko),h=Tl(h,ko)),IE(n,c,h,o)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){const n=ef(this.resolutions_,t,e||0);return Oe(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return Q0(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,n=new Array(e);for(let i=this.minZoom;i<e;++i)n[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=n}}const Sc=cA;class hA extends Sc{constructor(t){super({extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}getMatrixId(t){return this.matrixIds_[t]}getMatrixIds(){return this.matrixIds_}}const zo=hA;function ME(r){let t=r.getDefaultTileGrid();return t||(t=gA(r),r.setDefaultTileGrid(t)),t}function fA(r,t,e){const n=t[0],i=r.getTileCoordCenter(t),o=Cf(e);if(!Fa(o,i)){const a=Pt(o),l=Math.ceil((o[0]-i[0])/a);return i[0]+=a*l,r.getTileCoordForCoordAndZ(i,n)}return t}function dA(r,t,e,n){n=n!==void 0?n:"top-left";const i=OE(r,t,e);return new Sc({extent:r,origin:EP(r,n),resolutions:i,tileSize:e})}function NE(r){const t=r||{},e=t.extent||gt("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:OE(e,t.maxZoom,t.tileSize,t.maxResolution)};return new Sc(n)}function OE(r,t,e,n){t=t!==void 0?t:_0,e=zn(e!==void 0?e:rp);const i=Fe(r),o=Pt(r);n=n>0?n:Math.max(o/e[0],i/e[1]);const a=t+1,l=new Array(a);for(let u=0;u<a;++u)l[u]=n/Math.pow(2,u);return l}function gA(r,t,e,n){const i=Cf(r);return dA(i,t,e,n)}function Cf(r){r=gt(r);let t=r.getExtent();if(!t){const e=180*Rl.degrees/r.getMetersPerUnit();t=ii(-e,-e,e,e)}return t}class pA extends im{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.opaque_=t.opaque!==void 0?t.opaque:!1,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&zn(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tileCache=new cm(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const n=this.getTileCacheForProjection(t);n&&n.expireCache(e)}forEachLoadedTile(t,e,n,i){const o=this.getTileCacheForProjection(t);if(!o)return!1;let a=!0,l,u,c;for(let h=n.minX;h<=n.maxX;++h)for(let f=n.minY;f<=n.maxY;++f)u=kl(e,h,f),c=!1,o.containsKey(u)&&(l=o.get(u),c=l.getState()===X.LOADED,c&&(c=i(l)!==!1)),c||(a=!1);return a}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getOpaque(t){return this.opaque_}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,n,i,o){return at()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:ME(t)}getTileCacheForProjection(t){const e=this.getProjection();return xt(e===null||gs(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection."),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const i=this.getTileGridForProjection(n),o=this.getTilePixelRatio(e),a=zn(i.getTileSize(t),this.tmpSize);return o==1?a:LE(a,o,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==void 0?e:this.getProjection();const n=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=fA(n,t,e)),lA(t,n)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(t,e){const n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)}useTile(t,e,n,i){}}class mA extends Er{constructor(t,e){super(t),this.tile=e}}const yA=pA;function _A(r,t){const e=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,l,u){if(a)return r.replace(e,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,function(){const c=a[0],h=t.getFullTileRange(c);if(!h)throw new Error("The {-y} placeholder requires a tile grid with extent");return(h.getHeight()-a[2]-1).toString()})}}function vA(r,t){const e=r.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=_A(r[i],t);return fm(n)}function fm(r){return r.length===1?r[0]:function(t,e,n){if(!t)return;const i=um(t),o=ds(i,r.length);return r[o](t,e,n)}}function FE(r){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(r);if(e){const n=e[1].charCodeAt(0),i=e[2].charCodeAt(0);let o;for(o=n;o<=i;++o)t.push(r.replace(e[0],String.fromCharCode(o)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(r),e){const n=parseInt(e[2],10);for(let i=parseInt(e[1],10);i<=n;i++)t.push(r.replace(e[0],i.toString()));return t}return t.push(r),t}class dm extends yA{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===dm.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,n=Z(e),i=e.getState();let o;i==X.LOADING?(this.tileLoadingKeys_[n]=!0,o=hm.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],o=i==X.ERROR?hm.TILELOADERROR:i==X.LOADED?hm.TILELOADEND:void 0),o!=null&&this.dispatchEvent(new mA(o,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=FE(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
2
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(vA(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,n){}useTile(t,e,n){const i=kl(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)}}const DE=dm;class EA extends DE{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:xA,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:CE,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const n=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==n?e:{});for(const i in this.tileCacheForProjection){const o=this.tileCacheForProjection[i];o.expireCache(o==n?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!gs(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return this.getProjection()&&t&&!gs(this.getProjection(),t)?!1:super.getOpaque(t)}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||gs(e,t)))return this.tileGrid;const n=Z(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=ME(t)),this.tileGridForProjection[n]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||gs(e,t))return this.tileCache;const n=Z(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new cm(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]}createTile_(t,e,n,i,o,a){const l=[t,e,n],u=this.getTileCoordForTileUrlFunction(l,o),c=u?this.tileUrlFunction(u,i,o):void 0,h=new this.tileClass(l,c!==void 0?X.IDLE:X.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=a,h.addEventListener(ot.CHANGE,this.handleTileChange.bind(this)),h}getTile(t,e,n,i,o){const a=this.getProjection();if(!a||!o||gs(a,o))return this.getTileInternal(t,e,n,i,a||o);const l=this.getTileCacheForProjection(o),u=[t,e,n];let c;const h=TE(u);l.containsKey(h)&&(c=l.get(h));const f=this.getKey();if(c&&c.key==f)return c;const d=this.getTileGridForProjection(a),g=this.getTileGridForProjection(o),p=this.getTileCoordForTileUrlFunction(u,o),m=new lm(a,d,o,g,u,p,this.getTilePixelRatio(i),this.getGutter(),(y,E,_,v)=>this.getTileInternal(y,E,_,v,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=f,c?(m.interimTile=c,m.refreshInterimChain(),l.replace(h,m)):l.set(h,m),m}getTileInternal(t,e,n,i,o){let a=null;const l=kl(t,e,n),u=this.getKey();if(!this.tileCache.containsKey(l))a=this.createTile_(t,e,n,i,o,u),this.tileCache.set(l,a);else if(a=this.tileCache.get(l),a.key!=u){const c=a;a=this.createTile_(t,e,n,i,o,u),c.getState()==X.IDLE?a.interimTile=c.interimTile:a.interimTile=c,a.refreshInterimChain(),this.tileCache.replace(l,a)}return a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const n=gt(t);if(n){const i=Z(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function xA(r,t){r.getImage().src=t}const If=EA;class wA extends If{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",n=t.tileGrid!==void 0?t.tileGrid:NE({extent:Cf(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const Va=wA;class gm extends Di{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new gm(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const n=this.getStyle();return n&&t.setStyle(n),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Ht(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=yt(t,ot.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?SA(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function SA(r){if(typeof r=="function")return r;let t;return Array.isArray(r)?t=r:(xt(typeof r.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[r]),function(){return t}}const Ye=gm,Be={ADD:"add",REMOVE:"remove"},BE={LENGTH:"length"};class Tf extends Er{constructor(t,e,n){super(t),this.element=e,this.index=n}}const Gr=class extends Di{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let n=0,i=this.array_.length;n<i;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,n=t.length;e<n;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let n=0,i=e.length;n<i;++n)t(e[n],n,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(BE.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Tf(Be.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,i=e.length;n<i;++n)if(e[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Tf(Be.REMOVE,e,t)),e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Tf(Be.REMOVE,i,t)),this.dispatchEvent(new Tf(Be.ADD,e,t))}updateLength_(){this.set(BE.LENGTH,this.array_.length)}assertUnique_(t,e){for(let n=0,i=this.array_.length;n<i;++n)if(this.array_[n]===t&&n!==e)throw new Error("Duplicate item added to a unique collection")}};function CA(r,t,e,n,i){GE(r,t,e||0,n||r.length-1,i||IA)}function GE(r,t,e,n,i){for(;n>e;){if(n-e>600){var o=n-e+1,a=t-e+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(a-o/2<0?-1:1),h=Math.max(e,Math.floor(t-a*u/o+c)),f=Math.min(n,Math.floor(t+(o-a)*u/o+c));GE(r,t,h,f,i)}var d=r[t],g=e,p=n;for(Cc(r,e,t),i(r[n],d)>0&&Cc(r,e,n);g<p;){for(Cc(r,g,p),g++,p--;i(r[g],d)<0;)g++;for(;i(r[p],d)>0;)p--}i(r[e],d)===0?Cc(r,e,p):(p++,Cc(r,p,n)),p<=t&&(e=p+1),t<=p&&(n=p-1)}}function Cc(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function IA(r,t){return r<t?-1:r>t?1:0}let kE=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!Pf(t,e))return n;const i=this.toBBox,o=[];for(;e;){for(let a=0;a<e.children.length;a++){const l=e.children[a],u=e.leaf?i(l):l;Pf(t,u)&&(e.leaf?n.push(l):mm(t,u)?this._all(l,n):o.push(l))}e=o.pop()}return n}collides(t){let e=this.data;if(!Pf(t,e))return!1;const n=[];for(;e;){for(let i=0;i<e.children.length;i++){const o=e.children[i],a=e.leaf?this.toBBox(o):o;if(Pf(t,a)){if(e.leaf||mm(t,a))return!0;n.push(o)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=jl([]),this}remove(t,e){if(!t)return this;let n=this.data;const i=this.toBBox(t),o=[],a=[];let l,u,c;for(;n||o.length;){if(n||(n=o.pop(),u=o[o.length-1],l=a.pop(),c=!0),n.leaf){const h=TA(t,n.children,e);if(h!==-1)return n.children.splice(h,1),o.push(n),this._condense(o),this}!c&&!n.leaf&&mm(n,i)?(o.push(n),a.push(l),l=0,u=n,n=n.children[0]):u?(l++,n=u.children[l],c=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,i){const o=n-e+1;let a=this._maxEntries,l;if(o<=a)return l=jl(t.slice(e,n+1)),Vl(l,this.toBBox),l;i||(i=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,i-1))),l=jl([]),l.leaf=!1,l.height=i;const u=Math.ceil(o/a),c=u*Math.ceil(Math.sqrt(a));zE(t,e,n,c,this.compareMinX);for(let h=e;h<=n;h+=c){const f=Math.min(h+c-1,n);zE(t,h,f,u,this.compareMinY);for(let d=h;d<=f;d+=u){const g=Math.min(d+u-1,f);l.children.push(this._build(t,d,g,i-1))}}return Vl(l,this.toBBox),l}_chooseSubtree(t,e,n,i){for(;i.push(e),!(e.leaf||i.length-1===n);){let o=1/0,a=1/0,l;for(let u=0;u<e.children.length;u++){const c=e.children[u],h=pm(c),f=bA(t,c)-h;f<a?(a=f,o=h<o?h:o,l=c):f===a&&h<o&&(o=h,l=c)}e=l||e.children[0]}return e}_insert(t,e,n){const i=n?t:this.toBBox(t),o=[],a=this._chooseSubtree(i,this.data,e,o);for(a.children.push(t),Tc(a,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)}_split(t,e){const n=t[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);const a=this._chooseSplitIndex(n,o,i),l=jl(n.children.splice(a,n.children.length-a));l.height=n.height,l.leaf=n.leaf,Vl(n,this.toBBox),Vl(l,this.toBBox),e?t[e-1].children.push(l):this._splitRoot(n,l)}_splitRoot(t,e){this.data=jl([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Vl(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let i,o=1/0,a=1/0;for(let l=e;l<=n-e;l++){const u=Ic(t,0,l,this.toBBox),c=Ic(t,l,n,this.toBBox),h=AA(u,c),f=pm(u)+pm(c);h<o?(o=h,i=l,a=f<a?f:a):h===o&&f<a&&(a=f,i=l)}return i||n-e}_chooseSplitAxis(t,e,n){const i=t.leaf?this.compareMinX:RA,o=t.leaf?this.compareMinY:PA,a=this._allDistMargin(t,e,n,i),l=this._allDistMargin(t,e,n,o);a<l&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const o=this.toBBox,a=Ic(t,0,e,o),l=Ic(t,n-e,n,o);let u=Rf(a)+Rf(l);for(let c=e;c<n-e;c++){const h=t.children[c];Tc(a,t.leaf?o(h):h),u+=Rf(a)}for(let c=n-e-1;c>=e;c--){const h=t.children[c];Tc(l,t.leaf?o(h):h),u+=Rf(l)}return u}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)Tc(e[i],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Vl(t[e],this.toBBox)}};function TA(r,t,e){if(!e)return t.indexOf(r);for(let n=0;n<t.length;n++)if(e(r,t[n]))return n;return-1}function Vl(r,t){Ic(r,0,r.children.length,t,r)}function Ic(r,t,e,n,i){i||(i=jl(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;o<e;o++){const a=r.children[o];Tc(i,r.leaf?n(a):a)}return i}function Tc(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function RA(r,t){return r.minX-t.minX}function PA(r,t){return r.minY-t.minY}function pm(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Rf(r){return r.maxX-r.minX+(r.maxY-r.minY)}function bA(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function AA(r,t){const e=Math.max(r.minX,t.minX),n=Math.max(r.minY,t.minY),i=Math.min(r.maxX,t.maxX),o=Math.min(r.maxY,t.maxY);return Math.max(0,i-e)*Math.max(0,o-n)}function mm(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function Pf(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function jl(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function zE(r,t,e,n,i){const o=[t,e];for(;o.length;){if(e=o.pop(),t=o.pop(),e-t<=n)continue;const a=t+Math.ceil((e-t)/n/2)*n;CA(r,a,t,e,i),o.push(t,a,a,e)}}class LA{constructor(t){this.rbush_=new kE(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[Z(e)]=n}load(t,e){const n=new Array(e.length);for(let i=0,o=e.length;i<o;i++){const a=t[i],l=e[i],u={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:l};n[i]=u,this.items_[Z(l)]=u}this.rbush_.load(n)}remove(t){const e=Z(t),n=this.items_[e];return delete this.items_[e],this.rbush_.remove(n)!==null}update(t,e){const n=this.items_[Z(e)],i=[n.minX,n.minY,n.maxX,n.maxY];Oo(i,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(i){return i.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let i=0,o=t.length;i<o;i++)if(n=e(t[i]),n)return n;return n}isEmpty(){return Mo(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return ii(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const bf=LA;class Af extends Do{constructor(t,e,n){super(),n!==void 0&&e===void 0?this.setFlatCoordinates(n,t):(e=e||0,this.setCenterAndRadius(t,e,n))}clone(){const t=new Af(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){const o=this.flatCoordinates,a=t-o[0],l=e-o[1],u=a*a+l*l;if(u<i){if(u===0)for(let c=0;c<this.stride;++c)n[c]=o[c];else{const c=this.getRadius()/Math.sqrt(u);n[0]=o[0]+c*a,n[1]=o[1]+c*l;for(let h=2;h<this.stride;++h)n[h]=o[h]}return n.length=this.stride,u}return i}containsXY(t,e){const n=this.flatCoordinates,i=t-n[0],o=e-n[1];return i*i+o*o<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(t){const e=this.flatCoordinates,n=e[this.stride]-e[0];return ii(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e}getType(){return"Circle"}intersectsExtent(t){const e=this.getExtent();if(De(t,e)){const n=this.getCenter();return t[0]<=n[0]&&t[2]>=n[0]||t[1]<=n[1]&&t[3]>=n[1]?!0:up(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){const e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],i=t.slice();i[e]=i[0]+n;for(let o=1;o<e;++o)i[e+o]=t[o];this.setFlatCoordinates(this.layout,i),this.changed()}setCenterAndRadius(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);const i=this.flatCoordinates;let o=Y0(i,0,t,this.stride);i[o++]=i[0]+e;for(let a=1,l=this.stride;a<l;++a)i[o++]=i[a];i.length=o,this.changed()}getCoordinates(){return null}setCoordinates(t,e){}setRadius(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()}rotate(t,e){const n=this.getCenter(),i=this.getStride();this.setCenter(Rp(n,0,n.length,i,t,e,n)),this.changed()}}Af.prototype.transform;const MA=Af;let NA=class u0 extends df{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Ht),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,n=t.length;e<n;++e)this.changeEventsKeys_.push(yt(t[e],ot.CHANGE,this.changed,this))}clone(){const t=new u0(ym(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,n,i){if(i<Oa(this.getExtent(),t,e))return i;const o=this.geometries_;for(let a=0,l=o.length;a<l;++a)i=o[a].closestPointXY(t,e,n,i);return i}containsXY(t,e){const n=this.geometries_;for(let i=0,o=n.length;i<o;++i)if(n[i].containsXY(t,e))return!0;return!1}computeExtent(t){Ll(t);const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)S0(t,e[n].getExtent());return t}getGeometries(){return ym(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],n=this.geometries_;let i=!1;for(let o=0,a=n.length;o<a;++o){const l=n[o],u=l.getSimplifiedGeometry(t);e.push(u),u!==l&&(i=!0)}return i?new u0(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)if(e[n].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const n=this.geometries_;for(let i=0,o=n.length;i<o;++i)n[i].rotate(t,e);this.changed()}scale(t,e,n){n||(n=Gi(this.getExtent()));const i=this.geometries_;for(let o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()}setGeometries(t){this.setGeometriesArray(ym(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)e[n].applyTransform(t);this.changed()}translate(t,e){const n=this.geometries_;for(let i=0,o=n.length;i<o;++i)n[i].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function ym(r){return r.map(t=>t.clone())}const Rc=NA;function Lf(r,t,e,n,i,o,a){let l,u;const c=(e-t)/n;if(c===1)l=t;else if(c===2)l=t,u=i;else if(c!==0){let h=r[t],f=r[t+1],d=0;const g=[0];for(let y=t+n;y<e;y+=n){const E=r[y],_=r[y+1];d+=Math.sqrt((E-h)*(E-h)+(_-f)*(_-f)),g.push(d),h=E,f=_}const p=i*d,m=$R(g,p);m<0?(u=(p-g[-m-2])/(g[-m-1]-g[-m-2]),l=t+(-m-2)*n):l=t+m*n}a=a>1?a:2,o=o||new Array(a);for(let h=0;h<a;++h)o[h]=l===void 0?NaN:u===void 0?r[l+h]:Dr(r[l+h],r[l+n+h],u);return o}function _m(r,t,e,n,i,o){if(e==t)return null;let a;if(i<r[t+n-1])return o?(a=r.slice(t,t+n),a[n-1]=i,a):null;if(r[e-1]<i)return o?(a=r.slice(e-n,e),a[n-1]=i,a):null;if(i==r[t+n-1])return r.slice(t,t+n);let l=t/n,u=e/n;for(;l<u;){const d=l+u>>1;i<r[(d+1)*n-1]?u=d:l=d+1}const c=r[l*n-1];if(i==c)return r.slice((l-1)*n,(l-1)*n+n);const h=r[(l+1)*n-1],f=(i-c)/(h-c);a=[];for(let d=0;d<n-1;++d)a.push(Dr(r[(l-1)*n+d],r[l*n+d],f));return a.push(i),a}function OA(r,t,e,n,i,o,a){if(a)return _m(r,t,e[e.length-1],n,i,o);let l;if(i<r[n-1])return o?(l=r.slice(0,n),l[n-1]=i,l):null;if(r[r.length-1]<i)return o?(l=r.slice(r.length-n),l[n-1]=i,l):null;for(let u=0,c=e.length;u<c;++u){const h=e[u];if(t!=h){if(i<r[t+n-1])return null;if(i<=r[h-1])return _m(r,t,h,n,i,!1);t=h}}return null}function UE(r,t,e,n){let i=r[t],o=r[t+1],a=0;for(let l=t+n;l<e;l+=n){const u=r[l],c=r[l+1];a+=Math.sqrt((u-i)*(u-i)+(c-o)*(c-o)),i=u,o=c}return a}const Sr=class c0 extends Do{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){Pn(this.flatCoordinates,t),this.changed()}clone(){const t=new c0(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){return i<Oa(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ap(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,i))}forEachSegment(t){return J0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,_m(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Bo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Lf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return UE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=mf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new c0(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return yf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=pf(this.flatCoordinates,0,t,this.stride),this.changed()}},ja=class h0 extends Do{constructor(t,e,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&n)this.setFlatCoordinates(e,t),this.ends_=n;else{const i=t,o=[],a=[];for(let u=0,c=i.length;u<c;++u){const h=i[u];Pn(o,h.getFlatCoordinates()),a.push(o.length)}const l=i.length===0?this.getLayout():i[0].getLayout();this.setFlatCoordinates(l,o),this.ends_=a}}appendLineString(t){Pn(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new h0(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,i){return i<Oa(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(bp(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lp(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,i))}getCoordinateAtM(t,e,n){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,n=n!==void 0?n:!1,OA(this.flatCoordinates,0,this.ends_,this.stride,t,e,n))}getCoordinates(){return mc(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Sr(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,n=this.layout,i=[];let o=0;for(let a=0,l=e.length;a<l;++a){const u=e[a],c=new Sr(t.slice(o,u),n);i.push(c),o=u}return i}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let n=0;const i=this.ends_,o=this.stride;for(let a=0,l=i.length;a<l;++a){const u=i[a],c=Lf(e,n,u,o,.5);Pn(t,c),n=u}return t}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=H0(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,n),new h0(e,"XY",n)}getType(){return"MultiLineString"}intersectsExtent(t){return sb(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=pc(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},Uo=class qR extends Do{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){Pn(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new qR(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){if(i<Oa(this.getExtent(),t,e))return i;const o=this.flatCoordinates,a=this.stride;for(let l=0,u=o.length;l<u;l+=a){const c=Zs(t,e,o[l],o[l+1]);if(c<i){i=c;for(let h=0;h<a;++h)n[h]=o[l+h];n.length=a}}return i}getCoordinates(){return Bo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new or(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,n=this.stride,i=[];for(let o=0,a=t.length;o<a;o+=n){const l=new or(t.slice(o,o+n),e);i.push(l)}return i}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,n=this.stride;for(let i=0,o=e.length;i<o;i+=n){const a=e[i],l=e[i+1];if(op(t,a,l))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=pf(this.flatCoordinates,0,t,this.stride),this.changed()}};function VE(r,t,e,n){const i=[];let o=An();for(let a=0,l=e.length;a<l;++a){const u=e[a];o=lp(r,t,u[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),t=u[u.length-1]}return i}const Wa=class f0 extends Do{constructor(t,e,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(t[0])){const i=t,o=[],a=[];for(let l=0,u=i.length;l<u;++l){const c=i[l],h=o.length,f=c.getEnds();for(let d=0,g=f.length;d<g;++d)f[d]+=h;Pn(o,c.getFlatCoordinates()),a.push(f)}e=i.length===0?this.getLayout():i[0].getLayout(),t=o,n=a}e!==void 0&&n?(this.setFlatCoordinates(e,t),this.endss_=n):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const n=this.flatCoordinates.length;Pn(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let i=0,o=e.length;i<o;++i)e[i]+=n}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let i=0;i<t;++i)e[i]=this.endss_[i].slice();const n=new f0(this.flatCoordinates.slice(),this.layout,e);return n.applyProperties(this),n}closestPointXY(t,e,n,i){return i<Oa(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(QP(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$P(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,i))}containsXY(t,e){return ib(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return nb(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),kp(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Np(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=VE(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=K0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Uo(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;tE(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=kp(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=eb(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,n),new f0(e,"XY",n)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const o=this.endss_[t-1];e=o[o.length-1]}const n=this.endss_[t].slice(),i=n[n.length-1];if(e!==0)for(let o=0,a=n.length;o<a;++o)n[o]-=e;return new ar(this.flatCoordinates.slice(e,i),this.layout,n)}getPolygons(){const t=this.layout,e=this.flatCoordinates,n=this.endss_,i=[];let o=0;for(let a=0,l=n.length;a<l;++a){const u=n[a].slice(),c=u[u.length-1];if(o!==0)for(let f=0,d=u.length;f<d;++f)u[f]-=o;const h=new ar(e.slice(o,c),t,u);i.push(h),o=c}return i}getType(){return"MultiPolygon"}intersectsExtent(t){return ob(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const n=X0(this.flatCoordinates,0,t,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{const i=n[n.length-1];this.flatCoordinates.length=i.length===0?0:i[i.length-1]}this.changed()}},jE=an();class Wl{constructor(t,e,n,i,o,a){this.styleFunction,this.extent_,this.id_=a,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=o,this.squaredTolerance_,this.stride_=i,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?Ml(this.flatCoordinates_):lp(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Gi(this.getExtent());this.flatInteriorPoints_=Dp(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=eE(this.flatCoordinates_,this.ends_),e=VE(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=K0(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Lf(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const n=this.ends_;for(let i=0,o=n.length;i<o;++i){const a=n[i],l=Lf(t,e,a,2,.5);Pn(this.flatMidpoints_,l),e=a}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=gt(t);const e=t.getExtent(),n=t.getWorldExtent();if(e&&n){const i=Fe(n)/Fe(e);si(jE,n[0],n[3],i,-i,0,0,0),Fo(this.flatCoordinates_,0,this.flatCoordinates_.length,2,jE,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;return new Wl(this.type_,this.flatCoordinates_.slice(),(t=this.ends_)==null?void 0:t.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=g0((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let i;switch(this.type_){case"LineString":n.length=mf(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),i=[n.length];break;case"MultiLineString":i=[],n.length=H0(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,i);break;case"Polygon":i=[],n.length=Mp(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,i);break}return i&&(this.simplifiedGeometry_=new Wl(this.type_,n,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Wl.prototype.getFlatCoordinates=Wl.prototype.getOrientedFlatCoordinates;const zi=Wl,Ke={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function FA(r,t){return[[-1/0,-1/0,1/0,1/0]]}let DA=!1;function WE(r,t,e,n,i,o,a){const l=new XMLHttpRequest;l.open("GET",typeof r=="function"?r(e,n,i):r,!0),t.getType()=="arraybuffer"&&(l.responseType="arraybuffer"),l.withCredentials=DA,l.onload=function(u){if(!l.status||l.status>=200&&l.status<300){const c=t.getType();try{let h;c=="text"||c=="json"?h=l.responseText:c=="xml"?h=l.responseXML||l.responseText:c=="arraybuffer"&&(h=l.response),h?o(t.readFeatures(h,{extent:e,featureProjection:i}),t.readProjection(h)):a()}catch{a()}}else a()},l.onerror=a,l.send()}function YE(r,t){return function(e,n,i,o,a){const l=this;WE(r,t,e,n,i,function(u,c){l.addFeatures(u),o!==void 0&&o(u)},a||Il)}}class Vo extends Er{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class BA extends im{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Il,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(xt(this.format_,"`format` must be set when `url` is set"),this.loader_=YE(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:FA;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new bf:null,this.loadedExtentsRtree_=new bf,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,i;Array.isArray(t.features)?i=t.features:t.features&&(n=t.features,i=n.getArray()),!e&&n===void 0&&(n=new Gr(i)),i!==void 0&&this.addFeaturesInternal(i),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=Z(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const i=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Vo(Ke.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof zi||(this.featureChangeKeys_[t]=[yt(e,ot.CHANGE,this.handleFeatureChange_,this),yt(e,Cl.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const i=String(e.getId());if(!(i in this.idIndex_))this.idIndex_[i]=e;else if(e instanceof zi){const o=this.idIndex_[i];o instanceof zi?Array.isArray(o)?o.push(e):this.idIndex_[i]=[o,e]:n=!1}else n=!1}return n&&(xt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],i=[];for(let o=0,a=t.length;o<a;o++){const l=t[o],u=Z(l);this.addToIndex_(u,l)&&n.push(l)}for(let o=0,a=n.length;o<a;o++){const l=n[o],u=Z(l);this.setupChangeEvents_(u,l);const c=l.getGeometry();if(c){const h=c.getExtent();e.push(h),i.push(l)}else this.nullGeometryFeatures_[u]=l}if(this.featuresRtree_&&this.featuresRtree_.load(e,i),this.hasListener(Ke.ADDFEATURE))for(let o=0,a=n.length;o<a;o++)this.dispatchEvent(new Vo(Ke.ADDFEATURE,n[o]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Ke.ADDFEATURE,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(Ke.REMOVEFEATURE,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(Be.ADD,n=>{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(Be.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(Ht);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const n=i=>{this.removeFeatureInternal(i)};this.featuresRtree_.forEach(n);for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Vo(Ke.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(i){const o=i.getGeometry();if(o instanceof zi||o.intersectsCoordinate(t))return e(i)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const i=n.getGeometry();if(i instanceof zi||i.intersectsExtent(t)){const o=e(n);if(o)return o}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Mo(this.nullGeometryFeatures_)||Pn(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const i=T0(t,e);return[].concat(...i.map(o=>this.featuresRtree_.getInExtent(o)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],i=t[1];let o=null;const a=[NaN,NaN];let l=1/0;const u=[-1/0,-1/0,1/0,1/0];return e=e||qs,this.featuresRtree_.forEachInExtent(u,function(c){if(e(c)){const h=c.getGeometry(),f=l;if(l=h instanceof zi?0:h.closestPointXY(n,i,a,l),l<f){o=c;const d=Math.sqrt(l);u[0]=n-d,u[1]=i-d,u[2]=n+d,u[3]=i+d}}}),o}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=Z(e),i=e.getGeometry();if(!i)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);else{const a=i.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}const o=e.getId();if(o!==void 0){const a=o.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Vo(Ke.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:Z(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Mo(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,n){const i=this.loadedExtentsRtree_,o=this.strategy_(t,e,n);for(let a=0,l=o.length;a<l;++a){const u=o[a];i.forEachInExtent(u,function(h){return ri(h.extent,u)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Vo(Ke.FEATURESLOADSTART)),this.loader_.call(this,u,e,n,h=>{--this.loadingExtentsCount_,this.dispatchEvent(new Vo(Ke.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Vo(Ke.FEATURESLOADERROR))}),i.insert(u,{extent:u.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let n;e.forEachInExtent(t,function(i){if(Oo(i.extent,t))return n=i,!0}),n&&e.remove(n)}removeFeatures(t){const e=[];for(let n=0,i=t.length;n<i;++n){const o=t[n],a=this.removeFeatureInternal(o);a&&e.push(a)}e.length>0&&this.changed()}removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=Z(t);if(!(e in this.uidIndex_))return;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);const n=this.featureChangeKeys_[e];n==null||n.forEach(Ht),delete this.featureChangeKeys_[e];const i=t.getId();if(i!==void 0){const o=i.toString(),a=this.idIndex_[o];a===t?delete this.idIndex_[o]:Array.isArray(a)&&(a.splice(a.indexOf(t),1),a.length===1&&(this.idIndex_[o]=a[0]))}return delete this.uidIndex_[e],this.hasListener(Ke.REMOVEFEATURE)&&this.dispatchEvent(new Vo(Ke.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const n in this.idIndex_){const i=this.idIndex_[n];if(t instanceof zi&&Array.isArray(i)&&i.includes(t))i.splice(i.indexOf(t),1);else if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){xt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(YE(t,this.format_))}}const Un=BA;class GA extends Un{constructor(t){t=t||{},super({attributions:t.attributions,wrapX:t.wrapX}),this.resolution=void 0,this.distance=t.distance!==void 0?t.distance:20,this.minDistance=t.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=t.geometryFunction||function(e){const n=e.getGeometry();return xt(!n||n.getType()==="Point","The default `geometryFunction` can only handle `Point` or null geometries"),n},this.createCustomCluster_=t.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(t.source||null)}clear(t){this.features.length=0,super.clear(t)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(t,e,n){var i;(i=this.source)==null||i.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())}setDistance(t){this.updateDistance(t,this.minDistance)}setMinDistance(t){this.updateDistance(this.distance,t)}getMinDistance(){return this.minDistance}setSource(t){this.source&&this.source.removeEventListener(ot.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(ot.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(t,e){const n=t===0?0:Math.min(e,t)/t,i=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,i&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const t=An(),e=this.distance*this.resolution,n=this.source.getFeatures(),i={};for(let o=0,a=n.length;o<a;o++){const l=n[o];if(!(Z(l)in i)){const u=this.geometryFunction(l);if(u){const c=u.getCoordinates();Ml(c,t),xr(t,e,t);const h=this.source.getFeaturesInExtent(t).filter(function(f){const d=Z(f);return d in i?!1:(i[d]=!0,!0)});this.features.push(this.createCluster(h,t))}}}}createCluster(t,e){const n=[0,0];for(let l=t.length-1;l>=0;--l){const u=this.geometryFunction(t[l]);u?R0(n,u.getCoordinates()):t.splice(l,1)}P0(n,1/t.length);const i=Gi(e),o=this.interpolationRatio,a=new or([n[0]*(1-o)+i[0]*o,n[1]*(1-o)+i[1]*o]);return this.createCustomCluster_?this.createCustomCluster_(a,t):new Ye({geometry:a,features:t})}}const kA=GA;var Pc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function XE(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),e}const zA=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function Yl(r,t){const e=[];Object.keys(t).forEach(function(i){t[i]!==null&&t[i]!==void 0&&e.push(i+"="+encodeURIComponent(t[i]))});const n=e.join("&");return r=r.replace(/[?&]$/,""),r+=r.includes("?")?"&":"?",r+n}function HE(r,t,e,n,i,o){const a=i.getCode().split(/:(?=\d+$)/).pop(),l=e/n,u=[rf(Pt(t)/l,ms),rf(Fe(t)/l,ms)];o.SIZE=u[0]+","+u[1],o.BBOX=t.join(","),o.BBOXSR=a,o.IMAGESR=a,o.DPI=Math.round(o.DPI?o.DPI*n:90*n);const c=r.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return Yl(c,o)}function UA(r){const t=r.load?r.load:wf,e=gt(r.projection||"EPSG:3857");return function(n,i,o){o=r.hidpi?o:1;const a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};Object.assign(a,r.params),n=om(n,i,o,r.ratio);const l=HE(r.url,n,i,o,e,a),u=new Image;return r.crossOrigin!==null&&(u.crossOrigin=r.crossOrigin),t(u,l).then(c=>{const h=Pt(n)/c.width*o;return{image:c,extent:n,resolution:h,pixelRatio:o}})}}class VA extends am{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:SE,this.params_=Object.assign({},t.params),this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=UA({crossOrigin:this.crossOrigin_,params:this.params_,projection:i,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(o,a)=>(this.image.setImage(o),this.imageLoadFunction_(this.image,a),wf(o))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const jA=VA,Mf="1.3.0",qE=[101,101];function ZE(r,t,e,n,i){i.WIDTH=e[0],i.HEIGHT=e[1];const o=n.getAxisOrientation();let a;const l=fp(i.VERSION,"1.3")>=0;return i[l?"CRS":"SRS"]=n.getCode(),l&&o.substr(0,2)=="ne"?a=[t[1],t[0],t[3],t[2]]:a=t,i.BBOX=a.join(","),Yl(r,i)}function KE(r,t,e,n,i,o,a){o=Object.assign({REQUEST:"GetMap"},o);const l=t/e,u=[rf(Pt(r)/l,ms),rf(Fe(r)/l,ms)];if(e!=1)switch(a){case"geoserver":const h=90*e+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+h:o.FORMAT_OPTIONS="dpi:"+h;break;case"mapserver":o.MAP_RESOLUTION=90*e;break;case"carmentaserver":case"qgis":o.DPI=90*e;break;default:throw new Error("Unknown `serverType` configured")}return ZE(i,r,u,n,o)}function Nf(r,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:Mf,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},r)}function WA(r){const t=r.hidpi===void 0?!0:r.hidpi,e=gt(r.projection||"EPSG:3857"),n=r.ratio||1.5,i=r.load||wf;return(o,a,l)=>{o=om(o,a,l,n),l!=1&&(!t||r.serverType===void 0)&&(l=1);const u=KE(o,a,l,e,r.url,Nf(r.params,"GetMap"),r.serverType),c=new Image;return r.crossOrigin!==null&&(c.crossOrigin=r.crossOrigin),i(c,u).then(h=>({image:h,extent:o,pixelRatio:l}))}}function YA(r,t,e){if(r.url===void 0)return;const n=gt(r.projection||"EPSG:3857"),i=hc(t,e,0,qE),o={QUERY_LAYERS:r.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(o,Nf(r.params,"GetFeatureInfo"),r.params);const a=Tl((t[0]-i[0])/e,ms),l=Tl((i[3]-t[1])/e,ms),u=fp(o.VERSION,"1.3")>=0;return o[u?"I":"X"]=a,o[u?"J":"Y"]=l,ZE(r.url,i,qE,n,o)}function XA(r,t){if(r.url===void 0)return;const e={SERVICE:"WMS",VERSION:Mf,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(r.params===void 0||r.params.LAYER===void 0){const n=r.params.LAYERS;if(!(!Array.isArray(n)||n.length===1))return;e.LAYER=n}if(t!==void 0){const n=gt(r.projection||"EPSG:3857").getMetersPerUnit()||1,i=28e-5;e.SCALE=t*n/i}return Object.assign(e,r.params),Yl(r.url,e)}class HA extends am{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:SE,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,n,i){const o=gt(n),a=this.getProjection();a&&a!==o&&(e=wc(a,o,t,e),t=Ba(t,o,a));const l={url:this.url_,params:{...this.params_,...i},projection:a||o};return YA(l,t,e)}getLegendUrl(t,e){return XA({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=WA({crossOrigin:this.crossOrigin_,params:this.params_,projection:i,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(o,a)=>(this.image.setImage(o),this.imageLoadFunction_(this.image,a),wf(o))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const qA=HA,ZA=class extends Sf{constructor(t,e,n,i,o,a){super(t,e,a),this.extent=null,this.format_=i,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=o,this.url_=n,this.key=n}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==X.IDLE&&(this.setState(X.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(t,e){this.setFeatures(t)}onError(){this.setState(X.ERROR)}setFeatures(t){this.features_=t,this.setState(X.LOADED)}setLoader(t){this.loader_=t}},JE=[];class KA extends Sf{constructor(t,e,n,i){super(t,e,{transition:0}),this.context_={},this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.wrappedTileCoord=n}getContext(t){const e=Z(t);return e in this.context_||(this.context_[e]=ln(1,1,JE)),this.context_[e]}hasContext(t){return Z(t)in this.context_}getImage(t){return this.hasContext(t)?this.getContext(t).canvas:null}getReplayState(t){const e=Z(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){for(const t in this.context_){const e=this.context_[t];vc(e),JE.push(e.canvas),delete this.context_[t]}super.release()}}const JA=KA;class QA extends DE{constructor(t){const e=t.projection||"EPSG:3857",n=t.extent||Cf(e),i=t.tileGrid||NE({extent:n,maxResolution:t.maxResolution,maxZoom:t.maxZoom!==void 0?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,opaque:!1,projection:e,state:t.state,tileGrid:i,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:$A,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX===void 0?!0:t.wrapX,transition:t.transition,zDirection:t.zDirection===void 0?1:t.zDirection}),this.format_=t.format?t.format:null,this.sourceTileCache=new cm(this.tileCache.highWaterMark),this.overlaps_=t.overlaps==null?!0:t.overlaps,this.tileClass=t.tileClass?t.tileClass:ZA,this.tileGrids_={}}getFeaturesInExtent(t){const e=[],n=this.tileCache;if(n.getCount()===0)return e;const i=RE(n.peekFirstKey())[0],o=this.tileGrid;return n.forEach(function(a){if(a.tileCoord[0]!==i||a.getState()!==X.LOADED)return;const l=a.getSourceTiles();for(let u=0,c=l.length;u<c;++u){const h=l[u],f=h.tileCoord;if(De(t,o.getTileCoordExtent(f))){const d=h.getFeatures();if(d)for(let g=0,p=d.length;g<p;++g){const m=d[g],y=m.getGeometry();De(t,y.getExtent())&&e.push(m)}}}}),e}getOverlaps(){return this.overlaps_}clear(){this.tileCache.clear(),this.sourceTileCache.clear()}expireCache(t,e){const n=this.getTileCacheForProjection(t),i=Object.keys(e).reduce((o,a)=>{const l=aA(a),u=n.peek(l);if(u){const c=u.sourceTiles;for(let h=0,f=c.length;h<f;++h)o[c[h].getKey()]=!0}return o},{});super.expireCache(t,e),this.sourceTileCache.expireCache(i)}getSourceTiles(t,e,n){if(n.getState()===X.IDLE){n.setState(X.LOADING);const i=n.wrappedTileCoord,o=this.getTileGridForProjection(e),a=o.getTileCoordExtent(i),l=i[0],u=o.getResolution(l);xr(a,-u,a);const c=this.tileGrid,h=c.getExtent();h&&Ks(a,h,a);const f=c.getZForResolution(u,this.zDirection);c.forEachTileCoord(a,f,d=>{const g=this.tileUrlFunction(d,t,e),p=this.sourceTileCache.containsKey(g)?this.sourceTileCache.get(g):new this.tileClass(d,g?X.IDLE:X.EMPTY,g,this.format_,this.tileLoadFunction);n.sourceTiles.push(p);const m=p.getState();if(m<X.LOADED){const y=E=>{this.handleTileChange(E);const _=p.getState();if(_===X.LOADED||_===X.ERROR){const v=p.getKey();v in n.errorTileKeys?p.getState()===X.LOADED&&delete n.errorTileKeys[v]:n.loadingSourceTiles--,_===X.ERROR?n.errorTileKeys[v]=!0:p.removeEventListener(ot.CHANGE,y),n.loadingSourceTiles===0&&n.setState(Mo(n.errorTileKeys)?X.LOADED:X.ERROR)}};p.addEventListener(ot.CHANGE,y),n.loadingSourceTiles++}m===X.IDLE&&(p.extent=c.getTileCoordExtent(d),p.projection=e,p.resolution=c.getResolution(d[0]),this.sourceTileCache.set(g,p),p.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(d=>d.getState()===X.ERROR)?X.ERROR:X.LOADED)}return n.sourceTiles}getTile(t,e,n,i,o){const a=kl(t,e,n),l=this.getKey();let u;if(this.tileCache.containsKey(a)&&(u=this.tileCache.get(a),u.key===l))return u;const c=[t,e,n];let h=this.getTileCoordForTileUrlFunction(c,o);const f=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(o);if(h&&f){const m=d.getTileCoordExtent(h);xr(m,-d.getResolution(t),m),De(f,m)||(h=null)}let g=!0;if(h!==null){const m=this.tileGrid,y=d.getResolution(t),E=m.getZForResolution(y,1),_=d.getTileCoordExtent(h);xr(_,-y,_),m.forEachTileCoord(_,E,v=>{g=g&&!this.tileUrlFunction(v,i,o)})}const p=new JA(c,g?X.EMPTY:X.IDLE,h,this.getSourceTiles.bind(this,i,o));return p.key=l,u?(p.interimTile=u,p.refreshInterimChain(),this.tileCache.replace(a,p)):this.tileCache.set(a,p),p}getTileGridForProjection(t){const e=t.getCode();let n=this.tileGrids_[e];if(!n){const i=this.tileGrid,o=i.getResolutions().slice(),a=o.map(function(c,h){return i.getOrigin(h)}),l=o.map(function(c,h){return i.getTileSize(h)}),u=_0+1;for(let c=o.length;c<u;++c)o.push(o[c-1]/2),a.push(a[c-1]),l.push(l[c-1]);n=new Sc({extent:i.getExtent(),origins:a,resolutions:o,tileSizes:l}),this.tileGrids_[e]=n}return n}getTilePixelRatio(t){return t}getTilePixelSize(t,e,n){const i=this.getTileGridForProjection(n),o=zn(i.getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]}updateCacheSize(t,e){super.updateCacheSize(t*2,e),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(e).highWaterMark}}const Of=QA;function $A(r,t){r.setLoader(function(e,n,i){WE(t,r.getFormat(),e,n,i,r.onLoad.bind(r),r.onError.bind(r))})}const tL='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class eL extends Va{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[tL];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",i=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:i,wrapX:t.wrapX,zDirection:t.zDirection})}}const QE=eL,jo={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class nL extends yc{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(jo.PRELOAD)}setPreload(t){this.set(jo.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(jo.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(jo.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const rL=nL;class iL extends Qp{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=An(),this.tmpTileRange_=new bE(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==X.LOADED||n==X.EMPTY||n==X.ERROR&&!i}getTile(t,e,n,i){const o=i.pixelRatio,a=i.viewState.projection,l=this.getLayer();let c=l.getSource().getTile(t,e,n,o,a);return c.getState()==X.ERROR&&l.getUseInterimTilesOnError()&&l.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(c)||(c=c.getInterimTile()),c}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=We(e.pixelToCoordinateTransform,t.slice()),o=n.getExtent();if(o&&!Fa(o,i))return null;const a=e.pixelRatio,l=e.viewState.projection,u=e.viewState,c=n.getRenderSource(),h=c.getTileGridForProjection(u.projection),f=c.getTilePixelRatio(e.pixelRatio);for(let d=h.getZForResolution(u.resolution);d>=h.getMinZoom();--d){const g=h.getTileCoordForCoordAndZ(i,d),p=c.getTile(d,g[1],g[2],a,l);if(!(p instanceof CE||p instanceof lm)||p instanceof lm&&p.getState()===X.EMPTY)return null;if(p.getState()!==X.LOADED)continue;const m=h.getOrigin(d),y=zn(h.getTileSize(d)),E=h.getResolution(d),_=Math.floor(f*((i[0]-m[0])/E-g[1]*y[0])),v=Math.floor(f*((m[1]-i[1])/E-g[2]*y[1])),x=Math.round(f*c.getGutterForProjection(u.projection));return this.getImageData(p.getImage(),_+x,v+x)}return null}loadedTileCallback(t,e,n){return this.isDrawableTile(n)?super.loadedTileCallback(t,e,n):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,a=i.resolution,l=i.center,u=i.rotation,c=t.pixelRatio,h=this.getLayer(),f=h.getSource(),d=f.getRevision(),g=f.getTileGridForProjection(o),p=g.getZForResolution(a,f.zDirection),m=g.getResolution(p);let y=t.extent;const E=t.viewState.resolution,_=f.getTilePixelRatio(c);this.prepareContainer(t,e);const v=this.context.canvas.width,x=this.context.canvas.height,w=n.extent&&ps(n.extent);w&&(y=Ks(y,ps(n.extent)));const I=m*v/2/_,C=m*x/2/_,T=[l[0]-I,l[1]-C,l[0]+I,l[1]+C],R=g.getTileRangeForExtentAndZ(y,p),M={};M[p]={};const P=this.createLoadedTileFinder(f,o,M),b=this.tmpExtent,A=this.tmpTileRange_;this.newTiles_=!1;const L=u?hp(i.center,E,u,t.size):void 0;for(let et=R.minX;et<=R.maxX;++et)for(let H=R.minY;H<=R.maxY;++H){if(u&&!g.tileCoordIntersectsViewport([p,et,H],L))continue;const Et=this.getTile(p,et,H,t);if(this.isDrawableTile(Et)){const ue=Z(this);if(Et.getState()==X.LOADED){M[p][Et.tileCoord.toString()]=Et;let Qt=Et.inTransition(ue);Qt&&n.opacity!==1&&(Et.endTransition(ue),Qt=!1),!this.newTiles_&&(Qt||!this.renderedTiles.includes(Et))&&(this.newTiles_=!0)}if(Et.getAlpha(ue,t.time)===1)continue}const G=g.getTileCoordChildTileRange(Et.tileCoord,A,b);let bt=!1;G&&(bt=P(p+1,G)),bt||g.forEachTileCoordParentTileRange(Et.tileCoord,P,A,b)}const B=m/a*c/_,F=this.getRenderContext(t);si(this.tempTransform,v/2,x/2,B,B,0,-v/2,-x/2),w&&this.clipUnrotated(F,t,w),f.getInterpolate()||(F.imageSmoothingEnabled=!1),this.preRender(F,t),this.renderedTiles.length=0;let V=Object.keys(M).map(Number);V.sort(hs);let Y,st,Q;n.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?V=V.reverse():(Y=[],st=[]);for(let et=V.length-1;et>=0;--et){const H=V[et],Et=f.getTilePixelSize(H,c,o),bt=g.getResolution(H)/m,ue=Et[0]*bt*B,Qt=Et[1]*bt*B,ce=g.getTileCoordForCoordAndZ(wr(T),H),q=g.getTileCoordExtent(ce),dt=We(this.tempTransform,[_*(q[0]-T[0])/m,_*(T[3]-q[3])/m]),oe=_*f.getGutterForProjection(o),ir=M[H];for(const as in ir){const _r=ir[as],Li=_r.tileCoord,Ue=ce[1]-Li[1],Ut=Math.round(dt[0]-(Ue-1)*ue),kn=ce[2]-Li[2],ls=Math.round(dt[1]-(kn-1)*Qt),Ze=Math.round(dt[0]-Ue*ue),Ve=Math.round(dt[1]-kn*Qt),sr=Ut-Ze,Ws=ls-Ve,Mi=p===H,us=Mi&&_r.getAlpha(Z(this),t.time)!==1;let Ys=!1;if(!us)if(Y){Q=[Ze,Ve,Ze+sr,Ve,Ze+sr,Ve+Ws,Ze,Ve+Ws];for(let cs=0,we=Y.length;cs<we;++cs)if(p!==H&&H<st[cs]){const he=Y[cs];De([Ze,Ve,Ze+sr,Ve+Ws],[he[0],he[3],he[4],he[7]])&&(Ys||(F.save(),Ys=!0),F.beginPath(),F.moveTo(Q[0],Q[1]),F.lineTo(Q[2],Q[3]),F.lineTo(Q[4],Q[5]),F.lineTo(Q[6],Q[7]),F.moveTo(he[6],he[7]),F.lineTo(he[4],he[5]),F.lineTo(he[2],he[3]),F.lineTo(he[0],he[1]),F.clip())}Y.push(Q),st.push(H)}else F.clearRect(Ze,Ve,sr,Ws);this.drawTileImage(_r,t,Ze,Ve,sr,Ws,oe,Mi),Y&&!us?(Ys&&F.restore(),this.renderedTiles.unshift(_r)):this.renderedTiles.push(_r),this.updateUsedTiles(t.usedTiles,f,_r)}}return this.renderedRevision=d,this.renderedResolution=m,this.extentChanged=!this.renderedExtent_||!Oo(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=c,this.renderedProjection=o,this.manageTilePyramid(t,f,g,c,o,y,p,h.getPreload()),this.scheduleExpireCache(t,f),this.postRender(this.context,t),n.extent&&F.restore(),F.imageSmoothingEnabled=!0,this.container}drawTileImage(t,e,n,i,o,a,l,u){const c=this.getTileImage(t);if(!c)return;const h=this.getRenderContext(e),f=Z(this),d=e.layerStatesArray[e.layerIndex],g=d.opacity*(u?t.getAlpha(f,e.time):1),p=g!==h.globalAlpha;p&&(h.save(),h.globalAlpha=g),h.drawImage(c,l,l,c.width-2*l,c.height-2*l,n,i,o,a),p&&h.restore(),g!==d.opacity?e.animate=!0:u&&t.endTransition(f)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const n=(function(i,o,a){const l=Z(i);l in a.usedTiles&&i.expireCache(a.viewState.projection,a.usedTiles[l])}).bind(null,e);t.postRenderFunctions.push(n)}}updateUsedTiles(t,e,n){const i=Z(e);i in t||(t[i]={}),t[i][n.getKey()]=!0}manageTilePyramid(t,e,n,i,o,a,l,u,c){const h=Z(e);h in t.wantedTiles||(t.wantedTiles[h]={});const f=t.wantedTiles[h],d=t.tileQueue,g=n.getMinZoom(),p=t.viewState.rotation,m=p?hp(t.viewState.center,t.viewState.resolution,p,t.size):void 0;let y=0,E,_,v,x,w,I;for(I=g;I<=l;++I)for(_=n.getTileRangeForExtentAndZ(a,I,_),v=n.getResolution(I),x=_.minX;x<=_.maxX;++x)for(w=_.minY;w<=_.maxY;++w)p&&!n.tileCoordIntersectsViewport([I,x,w],m)||(l-I<=u?(++y,E=e.getTile(I,x,w,i,o),E.getState()==X.IDLE&&(f[E.getKey()]=!0,d.isKeyQueued(E.getKey())||d.enqueue([E,h,n.getTileCoordCenter(E.tileCoord),v])),c!==void 0&&c(E)):e.useTile(I,x,w,o));e.updateCacheSize(y,o)}}const $E=iL;class sL extends rL{constructor(t){super(t)}createRenderer(){return new $E(this)}}const Cr=sL,Ff=1/0,oL=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,La(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const i=this.keyFunction_(n);return delete this.queuedElements_[i],n}enqueue(t){xt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Ff?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,i=e.length,o=e[t],a=n[t],l=t;for(;t<i>>1;){const u=this.getLeftChildIndex_(t),c=this.getRightChildIndex_(t),h=c<i&&n[c]<n[u]?c:u;e[t]=e[h],n[t]=n[h],t=h}e[t]=o,n[t]=a,this.siftDown_(l,t)}siftDown_(t,e){const n=this.elements_,i=this.priorities_,o=n[e],a=i[e];for(;e>t;){const l=this.getParentIndex_(e);if(i[l]>a)n[e]=n[l],i[e]=i[l],e=l;else break}n[e]=o,i[e]=a}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let i=0;const o=e.length;let a,l,u;for(l=0;l<o;++l)a=e[l],u=t(a),u==Ff?delete this.queuedElements_[this.keyFunction_(a)]:(n[i]=u,e[i++]=a);e.length=i,n.length=i,this.heapify_()}};class aL extends oL{constructor(t,e){super(function(n){return t.apply(null,n)},function(n){return n[0].getKey()}),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(ot.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,n=e.getState();if(n===X.LOADED||n===X.ERROR||n===X.EMPTY){n!==X.ERROR&&e.removeEventListener(ot.CHANGE,this.boundHandleTileChange_);const i=e.getKey();i in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[i],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0,i,o,a;for(;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=this.dequeue()[0],a=o.getKey(),i=o.getState(),i===X.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++n,o.load())}}const lL=aL;function uL(r,t,e,n,i){if(!r||!(e in r.wantedTiles)||!r.wantedTiles[e][t.getKey()])return Ff;const o=r.viewState.center,a=n[0]-o[0],l=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+l*l)/i}class cL extends If{constructor(t){t=t||{},super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.params_=Object.assign({},t.params),this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=An(),this.setKey(this.getKeyForParams_())}getKeyForParams_(){let t=0;const e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")}getParams(){return this.params_}getRequestUrl_(t,e,n,i,o,a){const l=this.urls;if(!l)return;let u;if(l.length==1)u=l[0];else{const c=ds(um(t),l.length);u=l[c]}return HE(u,n,(this.tileGrid||this.getTileGridForProjection(o)).getResolution(t[0]),i,o,a)}getTilePixelRatio(t){return this.hidpi_?t:1}updateParams(t){Object.assign(this.params_,t),this.setKey(this.getKeyForParams_())}tileUrlFunction(t,e,n){let i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),i.getResolutions().length<=t[0])return;e!=1&&!this.hidpi_&&(e=1);const o=i.getTileCoordExtent(t,this.tmpExtent_);let a=zn(i.getTileSize(t[0]),this.tmpSize);e!=1&&(a=LE(a,e,this.tmpSize));const l={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return Object.assign(l,this.params_),this.getRequestUrl_(t,a,o,e,n,l)}}const hL=cL;class fL extends If{constructor(t){t=t||{};const e=Object.assign({},t.params),n="TRANSPARENT"in e?e.TRANSPARENT:!0;super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:!n,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=An(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,n,i){const o=gt(n),a=this.getProjection()||o;let l=this.getTileGrid();l||(l=this.getTileGridForProjection(a));const u=Ba(t,o,a),c=wc(a,o,t,e),h=l.getZForResolution(c,this.zDirection),f=l.getResolution(h),d=l.getTileCoordForCoordAndZ(u,h);if(l.getResolutions().length<=d[0])return;let g=l.getTileCoordExtent(d,this.tmpExtent_);const p=this.gutter_;p!==0&&(g=xr(g,f*p,g));const m={QUERY_LAYERS:this.params_.LAYERS};Object.assign(m,Nf(this.params_,"GetFeatureInfo"),i);const y=Math.floor((u[0]-g[0])/f),E=Math.floor((g[3]-u[1])/f);return m[this.v13_?"I":"X"]=y,m[this.v13_?"J":"Y"]=E,this.getRequestUrl_(d,g,1,a||o,m)}getLegendUrl(t,e){if(this.urls[0]===void 0)return;const n={SERVICE:"WMS",VERSION:Mf,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(e===void 0||e.LAYER===void 0){const i=this.params_.LAYERS;if(!(!Array.isArray(i)||i.length===1))return;n.LAYER=i}if(t!==void 0){const i=this.getProjection()?this.getProjection().getMetersPerUnit():1,o=28e-5;n.SCALE=t*i/o}return Object.assign(n,e),Yl(this.urls[0],n)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,n,i,o){const a=this.urls;if(!a)return;let l;if(a.length==1)l=a[0];else{const u=ds(um(t),a.length);l=a[u]}return KE(e,(this.tileGrid||this.getTileGridForProjection(i)).getResolution(t[0]),n,i,l,o,this.serverType_)}getTilePixelRatio(t){return!this.hidpi_||this.serverType_===void 0?1:t}getKeyForParams_(){let t=0;const e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const t=this.params_.VERSION||Mf;this.v13_=fp(t,"1.3")>=0}tileUrlFunction(t,e,n){let i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),i.getResolutions().length<=t[0])return;e!=1&&(!this.hidpi_||this.serverType_===void 0)&&(e=1);const o=i.getResolution(t[0]);let a=i.getTileCoordExtent(t,this.tmpExtent_);const l=this.gutter_;l!==0&&(a=xr(a,o*l,a));const u=Object.assign({},Nf(this.params_,"GetMap"));return this.getRequestUrl_(t,a,e,n,u)}}const dL=fL;class gL extends If{constructor(t){const e=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let i=t.urls;i===void 0&&t.url!==void 0&&(i=FE(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:i,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection}),this.version_=t.version!==void 0?t.version:"1.0.0",this.format_=t.format!==void 0?t.format:"image/jpeg",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),i&&i.length>0&&(this.tileUrlFunction=fm(i.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join(`
3
+ `);this.setTileUrlFunction(fm(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?Yl(t,n):t.replace(/\{(\w+?)\}/g,function(a,l){return l.toLowerCase()in n?n[l.toLowerCase()]:a});const i=this.tileGrid,o=this.dimensions_;return function(a,l,u){if(!a)return;const c={TileMatrix:i.getMatrixId(a[0]),TileCol:a[1],TileRow:a[2]};Object.assign(c,o);let h=t;return e=="KVP"?h=Yl(h,c):h=h.replace(/\{(\w+?)\}/g,function(f,d){return c[d]}),h}}}const Df=gL;class pL{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];!(t++&3)&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const i=Em(t,e,n);return i in this.cache_?this.cache_[i]:null}getPattern(t,e,n){const i=Em(t,e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(t,e,n,i,o){const a=Em(t,e,n),l=a in this.cache_;this.cache_[a]=i,o&&(i.getImageState()===$.IDLE&&i.load(),i.getImageState()===$.LOADING?i.ready().then(()=>{this.patternCache_[a]=Ef().createPattern(i.getImage(1),"repeat")}):this.patternCache_[a]=Ef().createPattern(i.getImage(1),"repeat")),l||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Em(r,t,e){const n=e?Dl(e):"null";return t+":"+r+":"+n}const ys=new pL;let bc=null;class mL extends sc{constructor(t,e,n,i,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=o,this.imageState_=i===void 0?$.IDLE:i,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===$.LOADED){bc||(bc=ln(1,1,void 0,{willReadFrequently:!0})),bc.drawImage(this.image_,0,0);try{bc.getImageData(0,0,1,1),this.tainted_=!1}catch{bc=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(ot.CHANGE)}handleImageError_(){this.imageState_=$.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=$.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=ln(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===$.IDLE){this.image_||this.initializeImage_(),this.imageState_=$.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&mE(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==$.LOADED)return;const e=this.image_,n=document.createElement("canvas");n.width=Math.ceil(e.width*t),n.height=Math.ceil(e.height*t);const i=n.getContext("2d");i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Ab(this.color_),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise(t=>{this.imageState_===$.LOADED||this.imageState_===$.ERROR?t():this.addEventListener(ot.CHANGE,function e(){(this.imageState_===$.LOADED||this.imageState_===$.ERROR)&&(this.removeEventListener(ot.CHANGE,e),t())})})),this.ready_}}function xm(r,t,e,n,i,o){let a=t===void 0?void 0:ys.get(t,e,i);return a||(a=new mL(r,r&&"src"in r?r.src||void 0:t,e,n,i),ys.set(t,e,i,a,o)),o&&a&&!ys.getPattern(t,e,i)&&ys.set(t,e,i,a,o),a}class wm{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new wm({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=xm(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===$.IDLE&&e.load(),e.getImageState()===$.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const Dt=wm;class Sm{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Sm({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const Je=Sm;class Cm{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=zn(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Cm({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return at()}getImage(t){return at()}getHitDetectionImage(){return at()}getPixelRatio(t){return 1}getImageState(){return at()}getImageSize(){return at()}getOrigin(){return at()}getSize(){return at()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=zn(t)}listenImageChange(t){at()}load(){at()}unlistenImageChange(t){at()}ready(){return Promise.resolve()}}const tx=Cm;function _s(r){return r?Array.isArray(r)?Jp(r):typeof r=="object"&&"src"in r?yL(r):r:null}function yL(r){if(!r.offset||!r.size)return ys.getPattern(r.src,"anonymous",r.color);const t=r.src+":"+r.offset,e=ys.getPattern(t,void 0,r.color);if(e)return e;const n=ys.get(r.src,"anonymous",null);if(n.getImageState()!==$.LOADED)return null;const i=ln(r.size[0],r.size[1]);return i.drawImage(n.getImage(1),r.offset[0],r.offset[1],r.size[0],r.size[1],0,0,r.size[0],r.size[1]),xm(i.canvas,t,void 0,$.LOADED,r.color,!0),ys.getPattern(t,void 0,r.color)}const Bf="ol-hidden",_L="ol-selectable",Ac="ol-unselectable",Im="ol-control",ex="ol-collapsed",vL=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),nx=["style","variant","weight","size","lineHeight","family"],rx=function(r){const t=r.match(vL);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let n=0,i=nx.length;n<i;++n){const o=t[n+1];o!==void 0&&(e[nx[n]]=o)}return e.families=e.family.split(/,\s?/),e},ix="10px sans-serif",Ir="#000",Xl="round",Qs=[],$s=0,Hl="round",Lc=10,Mc="#000",Nc="center",Gf="middle",Ya=[0,0,0,0],Oc=1,to=new Di;let ql=null,Tm;const Rm={},EL=function(){const t="32px ",e=["monospace","serif"],n=e.length,i="wmytzilWMYTZIL@#/&?$%10";let o,a;function l(c,h,f){let d=!0;for(let g=0;g<n;++g){const p=e[g];if(a=kf(c+" "+h+" "+t+p,i),f!=p){const m=kf(c+" "+h+" "+t+f+","+p,i);d=d&&m!=a}}return!!d}function u(){let c=!0;const h=to.getKeys();for(let f=0,d=h.length;f<d;++f){const g=h[f];to.get(g)<100&&(l.apply(this,g.split(`
4
+ `))?(La(Rm),ql=null,Tm=void 0,to.set(g,100)):(to.set(g,to.get(g)+1,!0),c=!1))}c&&(clearInterval(o),o=void 0)}return function(c){const h=rx(c);if(!h)return;const f=h.families;for(let d=0,g=f.length;d<g;++d){const p=f[d],m=h.style+`
5
+ `+h.weight+`
6
+ `+p;to.get(m)===void 0&&(to.set(m,100,!0),l(h.style,h.weight,p)||(to.set(m,0,!0),o===void 0&&(o=setInterval(u,32))))}}}(),xL=function(){let r;return function(t){let e=Rm[t];if(e==null){if(oE){const n=rx(t),i=sx(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else r||(r=document.createElement("div"),r.innerHTML="M",r.style.minHeight="0",r.style.maxHeight="none",r.style.height="auto",r.style.padding="0",r.style.border="none",r.style.position="absolute",r.style.display="block",r.style.left="-99999px"),r.style.font=t,document.body.appendChild(r),e=r.offsetHeight,document.body.removeChild(r);Rm[t]=e}return e}}();function sx(r,t){return ql||(ql=ln(1,1)),r!=Tm&&(ql.font=r,Tm=ql.font),ql.measureText(t)}function kf(r,t){return sx(r,t).width}function ox(r,t,e){if(t in e)return e[t];const n=t.split(`
7
+ `).reduce((i,o)=>Math.max(i,kf(r,o)),0);return e[t]=n,n}function wL(r,t){const e=[],n=[],i=[];let o=0,a=0,l=0,u=0;for(let c=0,h=t.length;c<=h;c+=2){const f=t[c];if(f===`
8
+ `||c===h){o=Math.max(o,a),i.push(a),a=0,l+=u,u=0;continue}const d=t[c+1]||r.font,g=kf(d,f);e.push(g),a+=g;const p=xL(d);n.push(p),u=Math.max(u,p)}return{width:o,height:l,widths:e,heights:n,lineWidths:i}}function SL(r,t,e,n,i,o,a,l,u,c,h){r.save(),e!==1&&(r.globalAlpha===void 0?r.globalAlpha=f=>f.globalAlpha*=e:r.globalAlpha*=e),t&&r.transform.apply(r,t),n.contextInstructions?(r.translate(u,c),r.scale(h[0],h[1]),CL(n,r)):h[0]<0||h[1]<0?(r.translate(u,c),r.scale(h[0],h[1]),r.drawImage(n,i,o,a,l,0,0,a,l)):r.drawImage(n,i,o,a,l,u,c,a*h[0],l*h[1]),r.restore()}function CL(r,t){const e=r.contextInstructions;for(let n=0,i=e.length;n<i;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}class Pm extends tx{constructor(t){super({opacity:1,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?$.LOADING:$.LOADED,this.imageState_===$.LOADING&&this.ready().then(()=>this.imageState_=$.LOADED),this.render()}clone(){const t=this.getScale(),e=new Pm({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const n=this.renderOptions_,i=ln(n.size*t,n.size*t);this.draw_(n,i,t),e=i.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let i=this.radius_,o=this.radius2_===void 0?i:this.radius2_;if(i<o){const I=i;i=o,o=I}const a=this.radius2_===void 0?this.points_:this.points_*2,l=2*Math.PI/a,u=o*Math.sin(l),c=Math.sqrt(o*o-u*u),h=i-c,f=Math.sqrt(u*u+h*h),d=f/u;if(t==="miter"&&d<=n)return d*e;const g=e/2/d,p=e/2*(h/f),y=Math.sqrt((i+g)*(i+g)+p*p)-i;if(this.radius2_===void 0||t==="bevel")return y*2;const E=i*Math.sin(l),_=Math.sqrt(i*i-E*E),v=o-_,w=Math.sqrt(E*E+v*v)/E;if(w<=n){const I=w*e/2-o-i;return 2*Math.max(y,I)}return y*2}createRenderOptions(){let t=Xl,e=Hl,n=0,i=null,o=0,a,l=0;this.stroke_&&(a=_s(this.stroke_.getColor()??Mc),l=this.stroke_.getWidth()??Oc,i=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset()??0,e=this.stroke_.getLineJoin()??Hl,t=this.stroke_.getLineCap()??Xl,n=this.stroke_.getMiterLimit()??Lc);const u=this.calculateLineJoinSize_(e,l,n),c=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*c+u);return{strokeStyle:a,strokeWidth:l,size:h,lineCap:t,lineDash:i,lineDashOffset:o,lineJoin:e,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvases_={},this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let i=this.fill_.getColor();i===null&&(i=Ir),e.fillStyle=_s(i),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let n=this.fill_.getColor(),i=0;typeof n=="string"&&(n=Dl(n)),n===null?i=1:Array.isArray(n)&&(i=n.length===4?n[3]:1),i===0&&(e=ln(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const i=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(e*=2);const o=this.angle_-Math.PI/2,a=2*Math.PI/e;for(let l=0;l<e;l++){const u=o+l*a,c=l%2===0?n:i;t.lineTo(c*Math.cos(u),c*Math.sin(u))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Ir,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}const ax=Pm;class bm extends ax{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new bm({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}const lr=bm;class Wo{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=ux,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new Wo({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=ux,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function IL(r){let t;if(typeof r=="function")t=r;else{let e;Array.isArray(r)?e=r:(xt(typeof r.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[r]),t=function(){return e}}return t}let Am=null;function lx(r,t){if(!Am){const e=new Dt({color:"rgba(255,255,255,0.4)"}),n=new Je({color:"#3399CC",width:1.25});Am=[new Wo({image:new lr({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return Am}function Lm(){const r={},t=[255,255,255,1],e=[0,153,255,1],n=3;return r.Polygon=[new Wo({fill:new Dt({color:[255,255,255,.5]})})],r.MultiPolygon=r.Polygon,r.LineString=[new Wo({stroke:new Je({color:t,width:n+2})}),new Wo({stroke:new Je({color:e,width:n})})],r.MultiLineString=r.LineString,r.Circle=r.Polygon.concat(r.LineString),r.Point=[new Wo({image:new lr({radius:n*2,fill:new Dt({color:e}),stroke:new Je({color:t,width:n/2})}),zIndex:1/0})],r.MultiPoint=r.Point,r.GeometryCollection=r.Polygon.concat(r.LineString,r.Point),r}function ux(r){return r.getGeometry()}const ye=Wo,TL="#333";class Mm{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=zn(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Dt({color:TL}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Mm({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=zn(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const zf=Mm;function cx(r,t,e,n){return e!==void 0&&n!==void 0?[e/r,n/t]:e!==void 0?e/r:n!==void 0?n/t:1}class Nm extends tx{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,i=t.scale!==void 0?t.scale:1,o=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:i,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:o,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;let l=t.src;xt(!(l!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(l===void 0||l.length===0)&&a&&(l=a.src||Z(a)),xt(l!==void 0&&l.length>0,"A defined and non-empty `src` or `image` must be provided"),xt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let u;if(t.src!==void 0?u=$.IDLE:a!==void 0&&("complete"in a?a.complete?u=a.src?$.LOADED:$.IDLE:u=$.LOADING:u=$.LOADED),this.color_=t.color!==void 0?Dl(t.color):null,this.iconImage_=xm(a,l,this.crossOrigin_,u,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let c,h;if(t.size)[c,h]=t.size;else{const f=this.getImage(1);if(f.width&&f.height)c=f.width,h=f.height;else if(f instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(cx(g[0],g[1],t.width,t.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(cx(c,h,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Nm({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const i=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=i[0]),this.anchorYUnits_=="fraction"&&(t[1]*=i[1])}if(this.anchorOrigin_!="top-left"){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+i[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+i[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==$.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==$.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(ot.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(ot.CHANGE,t)}ready(){return this.iconImage_.ready()}}const Fc=Nm;let Xa=0;const Zl=0,Ge=1<<Xa++,rt=1<<Xa++,kr=1<<Xa++,yn=1<<Xa++,vs=1<<Xa++,Dc=1<<Xa++,Vn=Math.pow(2,Xa)-1,hx={[Ge]:"boolean",[rt]:"number",[kr]:"string",[yn]:"color",[vs]:"number[]",[Dc]:"size"},RL=Object.keys(hx).map(Number).sort(hs);function jn(r){const t=[];for(const e of RL)PL(r,e)&&t.push(hx[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function PL(r,t){return(r&t)===t}function Es(r,t){return!!(r&t)}function Uf(r,t){return r===t}class Yo{constructor(t,e){this.type=t,this.value=e}}class bL{constructor(t,e,...n){this.type=t,this.operator=e,this.args=n}}function fx(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,style:{}}}function AL(r){switch(r){case"string":return kr;case"color":return yn;case"number":return rt;case"boolean":return Ge;case"number[]":return vs;default:throw new Error(`Unrecognized type hint: ${r}`)}}function ee(r,t,e){switch(typeof r){case"boolean":return new Yo(Ge,r);case"number":return new Yo(e===Dc?Dc:rt,r);case"string":{let i=kr;return Ob(r)&&(i|=yn),Uf(i&e,Zl)||(i&=e),new Yo(i,r)}}if(!Array.isArray(r))throw new Error("Expression must be an array or a primitive value");if(r.length===0)throw new Error("Empty expression");if(typeof r[0]=="string")return VL(r,t,e);for(const i of r)if(typeof i!="number")throw new Error("Expected an array of numbers");let n=vs;return r.length===2?n|=Dc:(r.length===3||r.length===4)&&(n|=yn),e&&(n&=e),new Yo(n,r)}const z={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string"},LL={[z.Get]:pt(([r,t])=>t!==void 0?AL(t.value):Vn,Tt(1,2),ML),[z.Var]:pt(([r])=>r.type,Tt(1,1),NL),[z.Id]:pt(rt|kr,Bc,OL),[z.Concat]:pt(kr,Tt(2,1/0),Vt(Vn)),[z.GeometryType]:pt(kr,Bc,FL),[z.Resolution]:pt(rt,Bc),[z.Zoom]:pt(rt,Bc),[z.Time]:pt(rt,Bc),[z.Any]:pt(Ge,Tt(2,1/0),Vt(Ge)),[z.All]:pt(Ge,Tt(2,1/0),Vt(Ge)),[z.Not]:pt(Ge,Tt(1,1),Vt(Ge)),[z.Equal]:pt(Ge,Tt(2,2),Vt(Vn),Xo),[z.NotEqual]:pt(Ge,Tt(2,2),Vt(Vn),Xo),[z.GreaterThan]:pt(Ge,Tt(2,2),Vt(Vn),Xo),[z.GreaterThanOrEqualTo]:pt(Ge,Tt(2,2),Vt(Vn),Xo),[z.LessThan]:pt(Ge,Tt(2,2),Vt(Vn),Xo),[z.LessThanOrEqualTo]:pt(Ge,Tt(2,2),Vt(Vn),Xo),[z.Multiply]:pt(r=>{let t=rt|yn;for(let e=0;e<r.length;e++)t&=r[e].type;return t},Tt(2,1/0),Vt(rt|yn),Xo),[z.Coalesce]:pt(r=>{let t=Vn;for(let e=1;e<r.length;e+=2)t&=r[e].type;return t&=r[r.length-1].type,t},Tt(2,1/0),Vt(Vn),Xo),[z.Divide]:pt(rt,Tt(2,2),Vt(rt)),[z.Add]:pt(rt,Tt(2,1/0),Vt(rt)),[z.Subtract]:pt(rt,Tt(2,2),Vt(rt)),[z.Clamp]:pt(rt,Tt(3,3),Vt(rt)),[z.Mod]:pt(rt,Tt(2,2),Vt(rt)),[z.Pow]:pt(rt,Tt(2,2),Vt(rt)),[z.Abs]:pt(rt,Tt(1,1),Vt(rt)),[z.Floor]:pt(rt,Tt(1,1),Vt(rt)),[z.Ceil]:pt(rt,Tt(1,1),Vt(rt)),[z.Round]:pt(rt,Tt(1,1),Vt(rt)),[z.Sin]:pt(rt,Tt(1,1),Vt(rt)),[z.Cos]:pt(rt,Tt(1,1),Vt(rt)),[z.Atan]:pt(rt,Tt(1,2),Vt(rt)),[z.Sqrt]:pt(rt,Tt(1,1),Vt(rt)),[z.Match]:pt(r=>{let t=Vn;for(let e=2;e<r.length;e+=2)t&=r[e].type;return t&=r[r.length-1].type,t},Tt(4,1/0),dx,BL),[z.Between]:pt(Ge,Tt(3,3),Vt(rt)),[z.Interpolate]:pt(r=>{let t=yn|rt;for(let e=3;e<r.length;e+=2)t&=r[e].type;return t},Tt(6,1/0),dx,GL),[z.Case]:pt(r=>{let t=Vn;for(let e=1;e<r.length;e+=2)t&=r[e].type;return t&=r[r.length-1].type,t},Tt(3,1/0),DL,kL),[z.In]:pt(Ge,Tt(2,2),zL),[z.Number]:pt(rt,Tt(1,1/0),Vt(Vn)),[z.String]:pt(kr,Tt(1,1/0),Vt(Vn)),[z.Array]:pt(r=>r.length===2?vs|Dc:r.length===3||r.length===4?vs|yn:vs,Tt(1,1/0),Vt(rt)),[z.Color]:pt(yn,Tt(1,4),Vt(rt)),[z.Band]:pt(rt,Tt(1,3),Vt(rt)),[z.Palette]:pt(yn,Tt(2,2),UL),[z.ToString]:pt(kr,Tt(1,1),Vt(Ge|rt|kr|yn))};function ML(r,t){const e=ee(r[1],t);if(!(e instanceof Yo))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");if(t.properties.add(e.value),r.length===3){const n=ee(r[2],t);return[e,n]}return[e]}function NL(r,t,e,n){const i=r[1];if(typeof i!="string")throw new Error("Expected a string argument for var operation");if(t.variables.add(i),!("variables"in t.style)||t.style.variables[i]===void 0)return[new Yo(Vn,i)];const o=t.style.variables[i],a=ee(o,t);if(a.value=i,n&&!Es(n,a.type))throw new Error(`The variable ${i} has type ${jn(a.type)} but the following type was expected: ${jn(n)}`);return[a]}function OL(r,t){t.featureId=!0}function FL(r,t){t.geometryType=!0}function Bc(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function Tt(r,t){return function(e,n){const i=e[0],o=e.length-1;if(r===t){if(o!==r){const a=r===1?"":"s";throw new Error(`Expected ${r} argument${a} for ${i}, got ${o}`)}}else if(o<r||o>t){const a=t===1/0?`${r} or more`:`${r} to ${t}`;throw new Error(`Expected ${a} arguments for ${i}, got ${o}`)}}}function Vt(r){return function(t,e){const n=t[0],i=t.length-1,o=new Array(i);for(let a=0;a<i;++a){const l=ee(t[a+1],e);if(!Es(r,l.type)){const u=jn(r),c=jn(l.type);throw new Error(`Unexpected type for argument ${a} of ${n} operation, got ${u} but expected ${c}`)}l.type&=r,o[a]=l}return o}}function Xo(r,t,e){const n=r[0],i=r.length-1;let o=Vn;for(let l=0;l<e.length;++l)o&=e[l].type;if(o===Zl)throw new Error(`No common type could be found for arguments of ${n} operation`);const a=new Array(i);for(let l=0;l<i;++l)a[l]=ee(r[l+1],t,o);return a}function DL(r,t){const e=r[0],n=r.length-1;if(n%2===0)throw new Error(`An odd amount of arguments was expected for operation ${e}, got ${JSON.stringify(n)} instead`)}function dx(r,t){const e=r[0],n=r.length-1;if(n%2===1)throw new Error(`An even amount of arguments was expected for operation ${e}, got ${JSON.stringify(n)} instead`)}function BL(r,t,e,n){const i=r.length-1;let a=ee(r[1],t).type;const l=ee(r[r.length-1],t);let u=n!==void 0?n&l.type:l.type;const c=new Array(i-2);for(let f=0;f<i-2;f+=2){const d=ee(r[f+2],t),g=ee(r[f+3],t);a&=d.type,u&=g.type,c[f]=d,c[f+1]=g}const h=kr|rt|Ge;if(!Es(h,a))throw new Error(`Expected an input of type ${jn(h)} for the interpolate operation, got ${jn(a)} instead`);if(a&=h,Uf(u,Zl))throw new Error("Could not find a common output type for the following match operation: "+JSON.stringify(r));for(let f=0;f<i-2;f+=2){const d=ee(r[f+2],t,a),g=ee(r[f+3],t,u);c[f]=d,c[f+1]=g}return[ee(r[1],t,a),...c,ee(r[r.length-1],t,u)]}function GL(r,t,e,n){const i=r[1];let o;switch(i[0]){case"linear":o=1;break;case"exponential":if(o=i[1],typeof o!="number")throw new Error(`Expected a number base for exponential interpolation, got ${JSON.stringify(o)} instead`);break;default:o=null}if(!o)throw new Error(`Invalid interpolation type: ${JSON.stringify(i)}`);o=ee(o,t);let a=ee(r[2],t);if(!Es(rt,a.type))throw new Error(`Expected an input of type number for the interpolate operation, got ${jn(a.type)} instead`);a=ee(r[2],t,rt);const l=new Array(r.length-3);for(let u=0;u<l.length;u+=2){let c=ee(r[u+3],t);if(!Es(rt,c.type))throw new Error(`Expected all stop input values in the interpolate operation to be of type number, got ${jn(c.type)} at position ${u+2} instead`);let h=ee(r[u+4],t);if(!Es(rt|yn,h.type))throw new Error(`Expected all stop output values in the interpolate operation to be a number or color, got ${jn(h.type)} at position ${u+3} instead`);c=ee(r[u+3],t,rt),h=ee(r[u+4],t,rt|yn),l[u]=c,l[u+1]=h}return[o,a,...l]}function kL(r,t,e,n){const i=ee(r[r.length-1],t,n);let o=n!==void 0?n&i.type:i.type;const a=new Array(r.length-1);for(let l=0;l<a.length-1;l+=2){const u=ee(r[l+1],t),c=ee(r[l+2],t,n);if(!Es(Ge,u.type))throw new Error(`Expected all conditions in the case operation to be of type boolean, got ${jn(u.type)} at position ${l} instead`);o&=c.type,a[l]=u,a[l+1]=c}if(Uf(o,Zl))throw new Error("Could not find a common output type for the following case operation: "+JSON.stringify(r));for(let l=0;l<a.length-1;l+=2)a[l+1]=ee(r[l+2],t,o);return a[a.length-1]=ee(r[r.length-1],t,o),a}function zL(r,t){let e=r[2];if(!Array.isArray(e))throw new Error('The "in" operator was provided a literal value which was not an array as second argument.');if(typeof e[0]=="string"){if(e[0]!=="literal")throw new Error('For the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions.');if(!Array.isArray(e[1]))throw new Error('The "in" operator was provided a literal value which was not an array as second argument.');e=e[1]}let n=kr|rt;const i=new Array(e.length);for(let a=0;a<i.length;a++){const l=ee(e[a],t);n&=l.type,i[a]=l}if(Uf(n,Zl))throw new Error("Could not find a common type for the following in operation: "+JSON.stringify(r));return[ee(r[1],t,n),...i]}function UL(r,t){const e=ee(r[1],t,rt);if(e.type!==rt)throw new Error(`The first argument of palette must be an number, got ${jn(e.type)} instead`);const n=r[2];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");const i=new Array(n.length);for(let o=0;o<i.length;o++){const a=ee(n[o],t,yn);if(!(a instanceof Yo))throw new Error(`The palette color at index ${o} must be a literal value`);if(!Es(a.type,yn))throw new Error(`The palette color at index ${o} should be of type color, got ${jn(a.type)} instead`);i[o]=a}return[e,...i]}function pt(r,...t){return function(e,n,i){const o=e[0];let a=[];for(let u=0;u<t.length;u++)a=t[u](e,n,a,i)||a;let l=typeof r=="function"?r(a):r;if(i!==void 0){if(!Es(l,i))throw new Error(`The following expression was expected to return ${jn(i)}, but returns ${jn(l)} instead: ${JSON.stringify(e)}`);l&=i}if(l===Zl)throw new Error(`No matching type was found for the following expression: ${JSON.stringify(e)}`);return new bL(l,o,...a)}}function VL(r,t,e){const n=r[0],i=LL[n];if(!i)throw new Error(`Unknown operator: ${n}`);return i(r,t,e)}function gx(r){if(!r)return"";const t=r.getType();switch(t){case"Point":case"LineString":case"Polygon":return t;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return t.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return gx(r.getGeometries()[0]);default:return""}}function px(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function eo(r,t,e){const n=ee(r,e);if(!Es(t,n.type)){const i=jn(t),o=jn(n.type);throw new Error(`Expected expression to be of type ${i}, got ${o}`)}return Ui(n)}function Ui(r,t){if(r instanceof Yo){if(r.type===yn&&typeof r.value=="string"){const n=Kp(r.value);return function(){return n}}return function(){return r.value}}const e=r.operator;switch(e){case z.Number:case z.String:case z.Coalesce:return jL(r);case z.Get:case z.Var:return WL(r);case z.Id:return n=>n.featureId;case z.GeometryType:return n=>n.geometryType;case z.Concat:{const n=r.args.map(i=>Ui(i));return i=>"".concat(...n.map(o=>o(i).toString()))}case z.Resolution:return n=>n.resolution;case z.Any:case z.All:case z.Between:case z.In:case z.Not:return XL(r);case z.Equal:case z.NotEqual:case z.LessThan:case z.LessThanOrEqualTo:case z.GreaterThan:case z.GreaterThanOrEqualTo:return YL(r);case z.Multiply:case z.Divide:case z.Add:case z.Subtract:case z.Clamp:case z.Mod:case z.Pow:case z.Abs:case z.Floor:case z.Ceil:case z.Round:case z.Sin:case z.Cos:case z.Atan:case z.Sqrt:return HL(r);case z.Case:return qL(r);case z.Match:return ZL(r);case z.Interpolate:return KL(r);case z.ToString:return JL(r);default:throw new Error(`Unsupported operator ${e}`)}}function jL(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let o=0;o<n;++o)i[o]=Ui(r.args[o]);switch(e){case z.Coalesce:return o=>{for(let a=0;a<n;++a){const l=i[a](o);if(typeof l<"u"&&l!==null)return l}throw new Error("Expected one of the values to be non-null")};case z.Number:case z.String:return o=>{for(let a=0;a<n;++a){const l=i[a](o);if(typeof l===e)return l}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function WL(r,t){const n=r.args[0].value;switch(r.operator){case z.Get:return i=>i.properties[n];case z.Var:return i=>i.variables[n];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function YL(r,t){const e=r.operator,n=Ui(r.args[0]),i=Ui(r.args[1]);switch(e){case z.Equal:return o=>n(o)===i(o);case z.NotEqual:return o=>n(o)!==i(o);case z.LessThan:return o=>n(o)<i(o);case z.LessThanOrEqualTo:return o=>n(o)<=i(o);case z.GreaterThan:return o=>n(o)>i(o);case z.GreaterThanOrEqualTo:return o=>n(o)>=i(o);default:throw new Error(`Unsupported comparison operator ${e}`)}}function XL(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let o=0;o<n;++o)i[o]=Ui(r.args[o]);switch(e){case z.Any:return o=>{for(let a=0;a<n;++a)if(i[a](o))return!0;return!1};case z.All:return o=>{for(let a=0;a<n;++a)if(!i[a](o))return!1;return!0};case z.Between:return o=>{const a=i[0](o),l=i[1](o),u=i[2](o);return a>=l&&a<=u};case z.In:return o=>{const a=i[0](o);for(let l=1;l<n;++l)if(a===i[l](o))return!0;return!1};case z.Not:return o=>!i[0](o);default:throw new Error(`Unsupported logical operator ${e}`)}}function HL(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let o=0;o<n;++o)i[o]=Ui(r.args[o]);switch(e){case z.Multiply:return o=>{let a=1;for(let l=0;l<n;++l)a*=i[l](o);return a};case z.Divide:return o=>i[0](o)/i[1](o);case z.Add:return o=>{let a=0;for(let l=0;l<n;++l)a+=i[l](o);return a};case z.Subtract:return o=>i[0](o)-i[1](o);case z.Clamp:return o=>{const a=i[0](o),l=i[1](o);if(a<l)return l;const u=i[2](o);return a>u?u:a};case z.Mod:return o=>i[0](o)%i[1](o);case z.Pow:return o=>Math.pow(i[0](o),i[1](o));case z.Abs:return o=>Math.abs(i[0](o));case z.Floor:return o=>Math.floor(i[0](o));case z.Ceil:return o=>Math.ceil(i[0](o));case z.Round:return o=>Math.round(i[0](o));case z.Sin:return o=>Math.sin(i[0](o));case z.Cos:return o=>Math.cos(i[0](o));case z.Atan:return n===2?o=>Math.atan2(i[0](o),i[1](o)):o=>Math.atan(i[0](o));case z.Sqrt:return o=>Math.sqrt(i[0](o));default:throw new Error(`Unsupported numeric operator ${e}`)}}function qL(r,t){const e=r.args.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=Ui(r.args[i]);return i=>{for(let o=0;o<e-1;o+=2)if(n[o](i))return n[o+1](i);return n[e-1](i)}}function ZL(r,t){const e=r.args.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=Ui(r.args[i]);return i=>{const o=n[0](i);for(let a=1;a<e;a+=2)if(o===n[a](i))return n[a+1](i);return n[e-1](i)}}function KL(r,t){const e=r.args.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=Ui(r.args[i]);return i=>{const o=n[0](i),a=n[1](i);let l,u;for(let c=2;c<e;c+=2){const h=n[c](i);let f=n[c+1](i);const d=Array.isArray(f);if(d&&(f=Mb(f)),h>=a)return c===2?f:d?QL(o,a,l,u,h,f):Gc(o,a,l,u,h,f);l=h,u=f}return u}}function JL(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let o=0;o<n;++o)i[o]=Ui(r.args[o]);switch(e){case z.ToString:return o=>{const a=i[0](o);return r.args[0].type===yn?Jp(a):a.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function Gc(r,t,e,n,i,o){const a=i-e;if(a===0)return n;const l=t-e,u=r===1?l/a:(Math.pow(r,l)-1)/(Math.pow(r,a)-1);return n+u*(o-n)}function QL(r,t,e,n,i,o){if(i-e===0)return n;const l=dE(n),u=dE(o);let c=u[2]-l[2];c>180?c-=360:c<-180&&(c+=360);const h=[Gc(r,t,e,l[0],i,u[0]),Gc(r,t,e,l[1],i,u[1]),l[2]+Gc(r,t,e,0,i,c),Gc(r,t,e,n[3],i,o[3])];return gE(Nb(h))}function $L(r){return!0}function tM(r){const t=fx(),e=eM(r,t),n=px();return function(i,o){if(n.properties=i.getPropertiesInternal(),n.resolution=o,t.featureId){const a=i.getId();a!==void 0?n.featureId=a:n.featureId=null}return t.geometryType&&(n.geometryType=gx(i.getGeometry())),e(n)}}function mx(r){const t=fx(),e=r.length,n=new Array(e);for(let a=0;a<e;++a)n[a]=Om(r[a],t);const i=px(),o=new Array(e);return function(a,l){if(i.properties=a.getPropertiesInternal(),i.resolution=l,t.featureId){const c=a.getId();c!==void 0?i.featureId=c:i.featureId=null}let u=0;for(let c=0;c<e;++c){const h=n[c](i);h&&(o[u]=h,u+=1)}return o.length=u,o}}function eM(r,t){const e=r.length,n=new Array(e);for(let i=0;i<e;++i){const o=r[i],a="filter"in o?eo(o.filter,Ge,t):$L;let l;if(Array.isArray(o.style)){const u=o.style.length;l=new Array(u);for(let c=0;c<u;++c)l[c]=Om(o.style[c],t)}else l=[Om(o.style,t)];n[i]={filter:a,styles:l}}return function(i){const o=[];let a=!1;for(let l=0;l<e;++l){const u=n[l].filter;if(u(i)&&!(r[l].else&&a)){a=!0;for(const c of n[l].styles){const h=c(i);h&&o.push(h)}}}return o}}function Om(r,t){const e=kc(r,"",t),n=zc(r,"",t),i=nM(r,t),o=rM(r,t),a=Tr(r,"z-index",t);if(!e&&!n&&!i&&!o&&!Mo(r))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(r));const l=new ye;return function(u){let c=!0;if(e){const h=e(u);h&&(c=!1),l.setFill(h)}if(n){const h=n(u);h&&(c=!1),l.setStroke(h)}if(i){const h=i(u);h&&(c=!1),l.setText(h)}if(o){const h=o(u);h&&(c=!1),l.setImage(h)}return a&&l.setZIndex(a(u)),c?null:l}}function kc(r,t,e){let n;if(t+"fill-pattern-src"in r?n=aM(r,t+"fill-",e):n=Fm(r,t+"fill-color",e),!n)return null;const i=new Dt;return function(o){const a=n(o);return a==="none"?null:(i.setColor(a),i)}}function zc(r,t,e){const n=Tr(r,t+"stroke-width",e),i=Fm(r,t+"stroke-color",e);if(!n&&!i)return null;const o=no(r,t+"stroke-line-cap",e),a=no(r,t+"stroke-line-join",e),l=yx(r,t+"stroke-line-dash",e),u=Tr(r,t+"stroke-line-dash-offset",e),c=Tr(r,t+"stroke-miter-limit",e),h=new Je;return function(f){if(i){const d=i(f);if(d==="none")return null;h.setColor(d)}if(n&&h.setWidth(n(f)),o){const d=o(f);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(d)}if(a){const d=a(f);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(d)}return l&&h.setLineDash(l(f)),u&&h.setLineDashOffset(u(f)),c&&h.setMiterLimit(c(f)),h}}function nM(r,t){const e="text-",n=no(r,e+"value",t);if(!n)return null;const i=kc(r,e,t),o=kc(r,e+"background-",t),a=zc(r,e,t),l=zc(r,e+"background-",t),u=no(r,e+"font",t),c=Tr(r,e+"max-angle",t),h=Tr(r,e+"offset-x",t),f=Tr(r,e+"offset-y",t),d=Uc(r,e+"overflow",t),g=no(r,e+"placement",t),p=Tr(r,e+"repeat",t),m=jf(r,e+"scale",t),y=Uc(r,e+"rotate-with-view",t),E=Tr(r,e+"rotation",t),_=no(r,e+"align",t),v=no(r,e+"justify",t),x=no(r,e+"baseline",t),w=yx(r,e+"padding",t),I=Yf(r,e+"declutter-mode"),C=new zf({declutterMode:I});return function(T){if(C.setText(n(T)),i&&C.setFill(i(T)),o&&C.setBackgroundFill(o(T)),a&&C.setStroke(a(T)),l&&C.setBackgroundStroke(l(T)),u&&C.setFont(u(T)),c&&C.setMaxAngle(c(T)),h&&C.setOffsetX(h(T)),f&&C.setOffsetY(f(T)),d&&C.setOverflow(d(T)),g){const R=g(T);if(R!=="point"&&R!=="line")throw new Error("Expected point or line for text-placement");C.setPlacement(R)}if(p&&C.setRepeat(p(T)),m&&C.setScale(m(T)),y&&C.setRotateWithView(y(T)),E&&C.setRotation(E(T)),_){const R=_(T);if(R!=="left"&&R!=="center"&&R!=="right"&&R!=="end"&&R!=="start")throw new Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(R)}if(v){const R=v(T);if(R!=="left"&&R!=="right"&&R!=="center")throw new Error("Expected left, right, or center for text-justify");C.setJustify(R)}if(x){const R=x(T);if(R!=="bottom"&&R!=="top"&&R!=="middle"&&R!=="alphabetic"&&R!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(R)}return w&&C.setPadding(w(T)),C}}function rM(r,t){return"icon-src"in r?iM(r,t):"shape-points"in r?sM(r,t):"circle-radius"in r?oM(r,t):null}function iM(r,t){const e="icon-",n=e+"src",i=xx(r[n],n),o=Vf(r,e+"anchor",t),a=jf(r,e+"scale",t),l=Tr(r,e+"opacity",t),u=Vf(r,e+"displacement",t),c=Tr(r,e+"rotation",t),h=Uc(r,e+"rotate-with-view",t),f=vx(r,e+"anchor-origin"),d=Ex(r,e+"anchor-x-units"),g=Ex(r,e+"anchor-y-units"),p=hM(r,e+"color"),m=uM(r,e+"cross-origin"),y=cM(r,e+"offset"),E=vx(r,e+"offset-origin"),_=Wf(r,e+"width"),v=Wf(r,e+"height"),x=lM(r,e+"size"),w=Yf(r,e+"declutter-mode"),I=new Fc({src:i,anchorOrigin:f,anchorXUnits:d,anchorYUnits:g,color:p,crossOrigin:m,offset:y,offsetOrigin:E,height:v,width:_,size:x,declutterMode:w});return function(C){return l&&I.setOpacity(l(C)),u&&I.setDisplacement(u(C)),c&&I.setRotation(c(C)),h&&I.setRotateWithView(h(C)),a&&I.setScale(a(C)),o&&I.setAnchor(o(C)),I}}function sM(r,t){const e="shape-",n=e+"points",i=e+"radius",o=Dm(r[n],n),a=Dm(r[i],i),l=kc(r,e,t),u=zc(r,e,t),c=jf(r,e+"scale",t),h=Vf(r,e+"displacement",t),f=Tr(r,e+"rotation",t),d=Uc(r,e+"rotate-with-view",t),g=Wf(r,e+"radius2"),p=Wf(r,e+"angle"),m=Yf(r,e+"declutter-mode"),y=new ax({points:o,radius:a,radius2:g,angle:p,declutterMode:m});return function(E){return l&&y.setFill(l(E)),u&&y.setStroke(u(E)),h&&y.setDisplacement(h(E)),f&&y.setRotation(f(E)),d&&y.setRotateWithView(d(E)),c&&y.setScale(c(E)),y}}function oM(r,t){const e="circle-",n=kc(r,e,t),i=zc(r,e,t),o=Tr(r,e+"radius",t),a=jf(r,e+"scale",t),l=Vf(r,e+"displacement",t),u=Tr(r,e+"rotation",t),c=Uc(r,e+"rotate-with-view",t),h=Yf(r,e+"declutter-mode"),f=new lr({radius:5,declutterMode:h});return function(d){return o&&f.setRadius(o(d)),n&&f.setFill(n(d)),i&&f.setStroke(i(d)),l&&f.setDisplacement(l(d)),u&&f.setRotation(u(d)),c&&f.setRotateWithView(c(d)),a&&f.setScale(a(d)),f}}function Tr(r,t,e){if(!(t in r))return;const n=eo(r[t],rt,e);return function(i){return Dm(n(i),t)}}function no(r,t,e){if(!(t in r))return null;const n=eo(r[t],kr,e);return function(i){return xx(n(i),t)}}function aM(r,t,e){const n=no(r,t+"pattern-src",e),i=_x(r,t+"pattern-offset",e),o=_x(r,t+"pattern-size",e),a=Fm(r,t+"color",e);return function(l){return{src:n(l),offset:i&&i(l),size:o&&o(l),color:a&&a(l)}}}function Uc(r,t,e){if(!(t in r))return null;const n=eo(r[t],Ge,e);return function(i){const o=n(i);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${t}`);return o}}function Fm(r,t,e){if(!(t in r))return null;const n=eo(r[t],yn|kr,e);return function(i){return wx(n(i),t)}}function yx(r,t,e){if(!(t in r))return null;const n=eo(r[t],vs,e);return function(i){return Vc(n(i),t)}}function Vf(r,t,e){if(!(t in r))return null;const n=eo(r[t],vs,e);return function(i){const o=Vc(n(i),t);if(o.length!==2)throw new Error(`Expected two numbers for ${t}`);return o}}function _x(r,t,e){if(!(t in r))return null;const n=eo(r[t],vs,e);return function(i){return Sx(n(i),t)}}function jf(r,t,e){if(!(t in r))return null;const n=eo(r[t],vs|rt,e);return function(i){return fM(n(i),t)}}function Wf(r,t){const e=r[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function lM(r,t){const e=r[t];if(e!==void 0){if(typeof e=="number")return zn(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function uM(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function vx(r,t){const e=r[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function Ex(r,t){const e=r[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function cM(r,t){const e=r[t];if(e!==void 0)return Vc(e,t)}function Yf(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function hM(r,t){const e=r[t];if(e!==void 0)return wx(e,t)}function Vc(r,t){if(!Array.isArray(r))throw new Error(`Expected an array for ${t}`);const e=r.length;for(let n=0;n<e;++n)if(typeof r[n]!="number")throw new Error(`Expected an array of numbers for ${t}`);return r}function xx(r,t){if(typeof r!="string")throw new Error(`Expected a string for ${t}`);return r}function Dm(r,t){if(typeof r!="number")throw new Error(`Expected a number for ${t}`);return r}function wx(r,t){if(typeof r=="string")return r;const e=Vc(r,t),n=e.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Sx(r,t){const e=Vc(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function fM(r,t){return typeof r=="number"?r:Sx(r,t)}const Cx={RENDER_ORDER:"renderOrder"};class dM extends yc{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Cx.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new kE(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Cx.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?lx:t;const e=gM(t);this.styleFunction_=t===null?void 0:IL(e),this.changed()}}function gM(r){if(r===void 0)return lx;if(!r)return null;if(typeof r=="function"||r instanceof ye)return r;if(!Array.isArray(r))return mx([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof ye){const i=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!(a instanceof ye))throw new Error("Expected a list of style instances");i[o]=a}return i}if("style"in e){const i=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!("style"in a))throw new Error("Expected a list of rules with a style property");i[o]=a}return tM(i)}return mx(r)}const jc=dM,Wc={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Xf=[Wc.FILL],Ho=[Wc.STROKE],Ha=[Wc.BEGIN_PATH],Ix=[Wc.CLOSE_PATH],ht=Wc;class pM{drawCustom(t,e,n,i,o){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,n){}drawFeature(t,e,n){}drawGeometryCollection(t,e,n){}drawLineString(t,e,n){}drawMultiLineString(t,e,n){}drawMultiPoint(t,e,n){}drawMultiPolygon(t,e,n){}drawPoint(t,e,n){}drawPolygon(t,e,n){}drawText(t,e,n){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const Tx=pM;class mM extends Tx{constructor(t,e,n,i){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=i,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),i=this.tmpCoordinate_,o=this.coordinates;let a=o.length;for(let l=0,u=t.length;l<u;l+=e)i[0]=t[l],i[1]=t[l+1],Fa(n,i)&&(o[a++]=i[0],o[a++]=i[1]);return a}appendFlatLineCoordinates(t,e,n,i,o,a){const l=this.coordinates;let u=l.length;const c=this.getBufferedMaxExtent();a&&(e+=i);let h=t[e],f=t[e+1];const d=this.tmpCoordinate_;let g=!0,p,m,y;for(p=e+i;p<n;p+=i)d[0]=t[p],d[1]=t[p+1],y=ap(c,d),y!==m?(g&&(l[u++]=h,l[u++]=f,g=!1),l[u++]=d[0],l[u++]=d[1]):y===mn.INTERSECTING?(l[u++]=d[0],l[u++]=d[1],g=!1):g=!0,h=d[0],f=d[1],m=y;return(o&&g||p===e+i)&&(l[u++]=h,l[u++]=f),u}drawCustomCoordinates_(t,e,n,i,o){for(let a=0,l=n.length;a<l;++a){const u=n[a],c=this.appendFlatLineCoordinates(t,e,u,i,!1,!1);o.push(c),e=u}return e}drawCustom(t,e,n,i,o){this.beginGeometry(t,e,o);const a=t.getType(),l=t.getStride(),u=this.coordinates.length;let c,h,f,d,g;switch(a){case"MultiPolygon":c=t.getOrientedFlatCoordinates(),d=[];const p=t.getEndss();g=0;for(let m=0,y=p.length;m<y;++m){const E=[];g=this.drawCustomCoordinates_(c,g,p[m],l,E),d.push(E)}this.instructions.push([ht.CUSTOM,u,d,t,n,Np,o]),this.hitDetectionInstructions.push([ht.CUSTOM,u,d,t,i||n,Np,o]);break;case"Polygon":case"MultiLineString":f=[],c=a=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),g=this.drawCustomCoordinates_(c,0,t.getEnds(),l,f),this.instructions.push([ht.CUSTOM,u,f,t,n,mc,o]),this.hitDetectionInstructions.push([ht.CUSTOM,u,f,t,i||n,mc,o]);break;case"LineString":case"Circle":c=t.getFlatCoordinates(),h=this.appendFlatLineCoordinates(c,0,c.length,l,!1,!1),this.instructions.push([ht.CUSTOM,u,h,t,n,Bo,o]),this.hitDetectionInstructions.push([ht.CUSTOM,u,h,t,i||n,Bo,o]);break;case"MultiPoint":c=t.getFlatCoordinates(),h=this.appendFlatPointCoordinates(c,l),h>u&&(this.instructions.push([ht.CUSTOM,u,h,t,n,Bo,o]),this.hitDetectionInstructions.push([ht.CUSTOM,u,h,t,i||n,Bo,o]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([ht.CUSTOM,u,h,t,n,void 0,o]),this.hitDetectionInstructions.push([ht.CUSTOM,u,h,t,i||n,void 0,o]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[ht.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ht.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let i,o,a=-1;for(e=0;e<n;++e)i=t[e],o=i[0],o==ht.END_GEOMETRY?a=e:o==ht.BEGIN_GEOMETRY&&(i[2]=e,tP(this.hitDetectionInstructions,a,e),a=-1)}setFillStrokeStyle(t,e){const n=this.state;if(t){const i=t.getColor();n.fillPatternScale=i&&typeof i=="object"&&"src"in i?this.pixelRatio:1,n.fillStyle=_s(i||Ir)}else n.fillStyle=void 0;if(e){const i=e.getColor();n.strokeStyle=_s(i||Mc);const o=e.getLineCap();n.lineCap=o!==void 0?o:Xl;const a=e.getLineDash();n.lineDash=a?a.slice():Qs;const l=e.getLineDashOffset();n.lineDashOffset=l||$s;const u=e.getLineJoin();n.lineJoin=u!==void 0?u:Hl;const c=e.getWidth();n.lineWidth=c!==void 0?c:Oc;const h=e.getMiterLimit();n.miterLimit=h!==void 0?h:Lc,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const e=t.fillStyle,n=[ht.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[ht.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,i=t.lineCap,o=t.lineDash,a=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,c=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||o!=t.currentLineDash&&!fs(t.currentLineDash,o)||t.currentLineDashOffset!=a||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=c)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=o,t.currentLineDashOffset=a,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=c)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[ht.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=w0(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;xr(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const Yc=mM;class yM extends Yc{constructor(t,e,n,i){super(t,e,n,i),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,n){if(!this.image_||this.maxExtent&&!Fa(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,l=this.appendFlatPointCoordinates(i,o);this.instructions.push([ht.DRAW_IMAGE,a,l,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,a,l,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),o=[];for(let u=0,c=i.length;u<c;u+=t.getStride())(!this.maxExtent||Fa(this.maxExtent,i.slice(u,u+2)))&&o.push(i[u],i[u+1]);const a=this.coordinates.length,l=this.appendFlatPointCoordinates(o,2);this.instructions.push([ht.DRAW_IMAGE,a,l,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,a,l,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const n=t.getAnchor(),i=t.getSize(),o=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const _M=yM;class vM extends Yc{constructor(t,e,n,i){super(t,e,n,i)}drawFlatCoordinates_(t,e,n,i){const o=this.coordinates.length,a=this.appendFlatLineCoordinates(t,e,n,i,!1,!1),l=[ht.MOVE_TO_LINE_TO,o,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),n}drawLineString(t,e,n){const i=this.state,o=i.strokeStyle,a=i.lineWidth;if(o===void 0||a===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([ht.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Qs,$s],Ha);const l=t.getFlatCoordinates(),u=t.getStride();this.drawFlatCoordinates_(l,0,l.length,u),this.hitDetectionInstructions.push(Ho),this.endGeometry(e)}drawMultiLineString(t,e,n){const i=this.state,o=i.strokeStyle,a=i.lineWidth;if(o===void 0||a===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([ht.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Qs,$s],Ha);const l=t.getEnds(),u=t.getFlatCoordinates(),c=t.getStride();let h=0;for(let f=0,d=l.length;f<d;++f)h=this.drawFlatCoordinates_(u,h,l[f],c);this.hitDetectionInstructions.push(Ho),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Ho),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Ho),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(Ha)}}const EM=vM;class xM extends Yc{constructor(t,e,n,i){super(t,e,n,i)}drawFlatCoordinatess_(t,e,n,i){const o=this.state,a=o.fillStyle!==void 0,l=o.strokeStyle!==void 0,u=n.length;this.instructions.push(Ha),this.hitDetectionInstructions.push(Ha);for(let c=0;c<u;++c){const h=n[c],f=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,h,i,!0,!l),g=[ht.MOVE_TO_LINE_TO,f,d];this.instructions.push(g),this.hitDetectionInstructions.push(g),l&&(this.instructions.push(Ix),this.hitDetectionInstructions.push(Ix)),e=h}return a&&(this.instructions.push(Xf),this.hitDetectionInstructions.push(Xf)),l&&(this.instructions.push(Ho),this.hitDetectionInstructions.push(Ho)),e}drawCircle(t,e,n){const i=this.state,o=i.fillStyle,a=i.strokeStyle;if(o===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([ht.SET_FILL_STYLE,Ir]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ht.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Qs,$s]);const l=t.getFlatCoordinates(),u=t.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(l,0,l.length,u,!1,!1);const h=[ht.CIRCLE,c];this.instructions.push(Ha,h),this.hitDetectionInstructions.push(Ha,h),i.fillStyle!==void 0&&(this.instructions.push(Xf),this.hitDetectionInstructions.push(Xf)),i.strokeStyle!==void 0&&(this.instructions.push(Ho),this.hitDetectionInstructions.push(Ho)),this.endGeometry(e)}drawPolygon(t,e,n){const i=this.state,o=i.fillStyle,a=i.strokeStyle;if(o===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([ht.SET_FILL_STYLE,Ir]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ht.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Qs,$s]);const l=t.getEnds(),u=t.getOrientedFlatCoordinates(),c=t.getStride();this.drawFlatCoordinatess_(u,0,l,c),this.endGeometry(e)}drawMultiPolygon(t,e,n){const i=this.state,o=i.fillStyle,a=i.strokeStyle;if(o===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([ht.SET_FILL_STYLE,Ir]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ht.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Qs,$s]);const l=t.getEndss(),u=t.getOrientedFlatCoordinates(),c=t.getStride();let h=0;for(let f=0,d=l.length;f<d;++f)h=this.drawFlatCoordinatess_(u,h,l[f],c);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let n=0,i=e.length;n<i;++n)e[n]=za(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const Rx=xM;function wM(r,t,e,n,i){const o=[];let a=e,l=0,u=t.slice(e,2);for(;l<r&&a+i<n;){const[c,h]=u.slice(-2),f=t[a+i],d=t[a+i+1],g=Math.sqrt((f-c)*(f-c)+(d-h)*(d-h));if(l+=g,l>=r){const p=(r-l+g)/g,m=Dr(c,f,p),y=Dr(h,d,p);u.push(m,y),o.push(u),u=[m,y],l==r&&(a+=i),l=0}else if(l<r)u.push(t[a+i],t[a+i+1]),a+=i;else{const p=g-l,m=Dr(c,f,p/g),y=Dr(h,d,p/g);u.push(m,y),o.push(u),u=[m,y],l=0,a+=i}}return l>0&&o.push(u),o}function SM(r,t,e,n,i){let o=e,a=e,l=0,u=0,c=e,h,f,d,g,p,m,y,E,_,v;for(f=e;f<n;f+=i){const x=t[f],w=t[f+1];p!==void 0&&(_=x-p,v=w-m,g=Math.sqrt(_*_+v*v),y!==void 0&&(u+=d,h=Math.acos((y*_+E*v)/(d*g)),h>r&&(u>l&&(l=u,o=c,a=f),u=0,c=f-i)),d=g,y=_,E=v),p=x,m=w}return u+=g,u>l?[c,f]:[o,a]}const Hf={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class CM extends Yc{constructor(t,e,n,i){super(t,e,n,i),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Ir]={fillStyle:Ir},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const i=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(this.text_===""||!a||!i&&!o)return;const l=this.coordinates;let u=l.length;const c=t.getType();let h=null,f=t.getStride();if(a.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!De(this.maxExtent,t.getExtent()))return;let d;if(h=t.getFlatCoordinates(),c=="LineString")d=[h.length];else if(c=="MultiLineString")d=t.getEnds();else if(c=="Polygon")d=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const y=t.getEndss();d=[];for(let E=0,_=y.length;E<_;++E)d.push(y[E][0])}this.beginGeometry(t,e,n);const g=a.repeat,p=g?void 0:a.textAlign;let m=0;for(let y=0,E=d.length;y<E;++y){let _;g?_=wM(g*this.resolution,h,m,d[y],f):_=[h.slice(m,d[y])];for(let v=0,x=_.length;v<x;++v){const w=_[v];let I=0,C=w.length;if(p==null){const R=SM(a.maxAngle,w,0,w.length,2);I=R[0],C=R[1]}for(let R=I;R<C;R+=f)l.push(w[R],w[R+1]);const T=l.length;m=d[y],this.drawChars_(u,T),u=T}}this.endGeometry(e)}else{let d=a.overflow?null:[];switch(c){case"Point":case"MultiPoint":h=t.getFlatCoordinates();break;case"LineString":h=t.getFlatMidpoint();break;case"Circle":h=t.getCenter();break;case"MultiLineString":h=t.getFlatMidpoints(),f=2;break;case"Polygon":h=t.getFlatInteriorPoint(),a.overflow||d.push(h[2]/this.resolution),f=3;break;case"MultiPolygon":const _=t.getFlatInteriorPoints();h=[];for(let v=0,x=_.length;v<x;v+=3)a.overflow||d.push(_[v+2]/this.resolution),h.push(_[v],_[v+1]);if(h.length===0)return;f=2;break}const g=this.appendFlatPointCoordinates(h,f);if(g===u)return;if(d&&(g-u)/2!==h.length/f){let _=u/2;d=d.filter((v,x)=>{const w=l[(_+x)*2]===h[x*f]&&l[(_+x)*2+1]===h[x*f+1];return w||--_,w})}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&this.updateFillStyle(this.state,this.createFill),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,n);let p=a.padding;if(p!=Ya&&(a.scale[0]<0||a.scale[1]<0)){let _=a.padding[0],v=a.padding[1],x=a.padding[2],w=a.padding[3];a.scale[0]<0&&(v=-v,w=-w),a.scale[1]<0&&(_=-_,x=-x),p=[_,v,x,w]}const m=this.pixelRatio;this.instructions.push([ht.DRAW_IMAGE,u,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==Ya?Ya:p.map(function(_){return _*m}),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const y=1/m,E=this.state.fillStyle;a.backgroundFill&&(this.state.fillStyle=Ir,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,u,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,p,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Ir:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),a.backgroundFill&&(this.state.fillStyle=E,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||Nc,justify:e.justify,textBaseline:e.textBaseline||Gf,scale:e.scale});const a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,i=this.textState_,o=this.strokeKey_,a=this.textKey_,l=this.fillKey_;this.saveTextStates_();const u=this.pixelRatio,c=Hf[i.textBaseline],h=this.textOffsetY_*u,f=this.text_,d=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([ht.DRAW_CHARS,t,e,c,i.overflow,l,i.maxAngle,u,h,o,d*u,f,a,1,this.declutterMode_]),this.hitDetectionInstructions.push([ht.DRAW_CHARS,t,e,c,i.overflow,l&&Ir,i.maxAngle,u,h,o,d*u,f,a,1/u,this.declutterMode_])}setTextStyle(t,e){let n,i,o;if(!t)this.text_="";else{const a=t.getFill();a?(i=this.textFillState_,i||(i={},this.textFillState_=i),i.fillStyle=_s(a.getColor()||Ir)):(i=null,this.textFillState_=i);const l=t.getStroke();if(!l)o=null,this.textStrokeState_=o;else{o=this.textStrokeState_,o||(o={},this.textStrokeState_=o);const p=l.getLineDash(),m=l.getLineDashOffset(),y=l.getWidth(),E=l.getMiterLimit();o.lineCap=l.getLineCap()||Xl,o.lineDash=p?p.slice():Qs,o.lineDashOffset=m===void 0?$s:m,o.lineJoin=l.getLineJoin()||Hl,o.lineWidth=y===void 0?Oc:y,o.miterLimit=E===void 0?Lc:E,o.strokeStyle=_s(l.getColor()||Mc)}n=this.textState_;const u=t.getFont()||ix;EL(u);const c=t.getScaleArray();n.overflow=t.getOverflow(),n.font=u,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Gf,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Ya,n.scale=c===void 0?[1,1]:c;const h=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=f===void 0?0:f,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=o?(typeof o.strokeStyle=="string"?o.strokeStyle:Z(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=i&&i.fillStyle?typeof i.fillStyle=="string"?i.fillStyle:"|"+Z(i.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const IM={Circle:Rx,Default:Yc,Image:_M,LineString:EM,Polygon:Rx,Text:CM};class TM{constructor(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const i in n){const o=n[i].finish();t[e][i]=o}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let i=this.buildersByZIndex_[n];i===void 0&&(i={},this.buildersByZIndex_[n]=i);let o=i[e];if(o===void 0){const a=IM[e];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=o}return o}}const Px=TM;function RM(r,t,e,n,i,o,a,l,u,c,h,f){let d=r[t],g=r[t+1],p=0,m=0,y=0,E=0;function _(){p=d,m=g,t+=n,d=r[t],g=r[t+1],E+=y,y=Math.sqrt((d-p)*(d-p)+(g-m)*(g-m))}do _();while(t<e-n&&E+y<o);let v=y===0?0:(o-E)/y;const x=Dr(p,d,v),w=Dr(m,g,v),I=t-n,C=E,T=o+l*u(c,i,h);for(;t<e-n&&E+y<T;)_();v=y===0?0:(T-E)/y;const R=Dr(p,d,v),M=Dr(m,g,v);let P;if(f){const F=[x,w,R,M];Rp(F,0,4,2,f,F,F),P=F[0]>F[2]}else P=x>R;const b=Math.PI,A=[],L=I+n===t;t=I,y=0,E=C,d=r[t],g=r[t+1];let B;if(L){_(),B=Math.atan2(g-m,d-p),P&&(B+=B>0?-b:b);const F=(R+x)/2,V=(M+w)/2;return A[0]=[F,V,(T-o)/2,B,i],A}i=i.replace(/\n/g," ");for(let F=0,V=i.length;F<V;){_();let Y=Math.atan2(g-m,d-p);if(P&&(Y+=Y>0?-b:b),B!==void 0){let G=Y-B;if(G+=G>b?-2*b:G<-b?2*b:0,Math.abs(G)>a)return null}B=Y;const st=F;let Q=0;for(;F<V;++F){const G=P?V-F-1:F,bt=l*u(c,i[G],h);if(t+n<e&&E+y<o+Q+bt/2)break;Q+=bt}if(F===st)continue;const et=P?i.substring(V-st,V-F):i.substring(st,F);v=y===0?0:(o+Q/2-E)/y;const H=Dr(p,d,v),Et=Dr(m,g,v);A.push([H,Et,Q/2,Y,et]),o+=Q}return A}const Kl=An(),qo=[],ro=[],io=[],Zo=[];function bx(r){return r[3].declutterBox}const Ax=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Bm(r,t){return t==="start"?t=Ax.test(r)?"right":"left":t==="end"&&(t=Ax.test(r)?"left":"right"),Hf[t]}function PM(r,t,e){return e>0&&r.push(`
9
+ `,""),r.push(t,""),r}class bM{constructor(t,e,n,i,o){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=an(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=o?new Xp:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,i){const o=t+e+n+i;if(this.labels_[o])return this.labels_[o];const a=i?this.strokeStates[i]:null,l=n?this.fillStates[n]:null,u=this.textStates[e],c=this.pixelRatio,h=[u.scale[0]*c,u.scale[1]*c],f=Array.isArray(t),d=u.justify?Hf[u.justify]:Bm(Array.isArray(t)?t[0]:t,u.textAlign||Nc),g=i&&a.lineWidth?a.lineWidth:0,p=f?t:t.split(`
10
+ `).reduce(PM,[]),{width:m,height:y,widths:E,heights:_,lineWidths:v}=wL(u,p),x=m+g,w=[],I=(x+2)*h[0],C=(y+g)*h[1],T={width:I<0?Math.floor(I):Math.ceil(I),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:w};(h[0]!=1||h[1]!=1)&&w.push("scale",h),i&&(w.push("strokeStyle",a.strokeStyle),w.push("lineWidth",g),w.push("lineCap",a.lineCap),w.push("lineJoin",a.lineJoin),w.push("miterLimit",a.miterLimit),w.push("setLineDash",[a.lineDash]),w.push("lineDashOffset",a.lineDashOffset)),n&&w.push("fillStyle",l.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");const R=.5-d;let M=d*x+R*g;const P=[],b=[];let A=0,L=0,B=0,F=0,V;for(let Y=0,st=p.length;Y<st;Y+=2){const Q=p[Y];if(Q===`
11
+ `){L+=A,A=0,M=d*x+R*g,++F;continue}const et=p[Y+1]||u.font;et!==V&&(i&&P.push("font",et),n&&b.push("font",et),V=et),A=Math.max(A,_[B]);const H=[Q,M+R*E[B]+d*(E[B]-v[F]),.5*(g+A)+L];M+=E[B],i&&P.push("strokeText",H),n&&b.push("fillText",H),++B}return Array.prototype.push.apply(w,P),Array.prototype.push.apply(w,b),this.labels_[o]=T,T}replayTextBackground_(t,e,n,i,o,a,l){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,e),a&&(this.alignAndScaleFill_=a[2],this.fill_(t)),l&&(this.setStrokeStyle_(t,l),t.stroke())}calculateImageOrLabelDimensions_(t,e,n,i,o,a,l,u,c,h,f,d,g,p,m,y){l*=d[0],u*=d[1];let E=n-l,_=i-u;const v=o+c>t?t-c:o,x=a+h>e?e-h:a,w=p[3]+v*d[0]+p[1],I=p[0]+x*d[1]+p[2],C=E-p[3],T=_-p[0];(m||f!==0)&&(qo[0]=C,Zo[0]=C,qo[1]=T,ro[1]=T,ro[0]=C+w,io[0]=ro[0],io[1]=T+I,Zo[1]=io[1]);let R;return f!==0?(R=si(an(),n,i,1,1,f,-n,-i),We(R,qo),We(R,ro),We(R,io),We(R,Zo),ii(Math.min(qo[0],ro[0],io[0],Zo[0]),Math.min(qo[1],ro[1],io[1],Zo[1]),Math.max(qo[0],ro[0],io[0],Zo[0]),Math.max(qo[1],ro[1],io[1],Zo[1]),Kl)):ii(Math.min(C,C+w),Math.min(T,T+I),Math.max(C,C+w),Math.max(T,T+I),Kl),g&&(E=Math.round(E),_=Math.round(_)),{drawImageX:E,drawImageY:_,drawImageW:v,drawImageH:x,originX:c,originY:h,declutterBox:{minX:Kl[0],minY:Kl[1],maxX:Kl[2],maxY:Kl[3],value:y},canvasTransform:R,scale:d}}replayImageOrLabel_(t,e,n,i,o,a,l){const u=!!(a||l),c=i.declutterBox,h=l?l[2]*i.scale[0]/2:0;return c.minX-h<=e[0]&&c.maxX+h>=0&&c.minY-h<=e[1]&&c.maxY+h>=0&&(u&&this.replayTextBackground_(t,qo,ro,io,Zo,a,l),SL(t,i.canvasTransform,o,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=We(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,n,i){const o=this.textStates[e],a=this.createLabel(t,e,i,n),l=this.strokeStates[n],u=this.pixelRatio,c=Bm(Array.isArray(t)?t[0]:t,o.textAlign||Nc),h=Hf[o.textBaseline||Gf],f=l&&l.lineWidth?l.lineWidth:0,d=a.width/u-2*o.scale[0],g=c*d+2*(.5-c)*f,p=h*a.height/u+2*(.5-h)*f;return{label:a,anchorX:g,anchorY:p}}execute_(t,e,n,i,o,a,l,u){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&fs(n,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Fo(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),YP(this.renderedTransform_,n));let f=0;const d=i.length;let g=0,p,m,y,E,_,v,x,w,I,C,T,R,M,P=0,b=0,A=null,L=null;const B=this.coordinateCache_,F=this.viewRotation_,V=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,Y={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:F},st=this.instructions!=i||this.overlaps?0:200;let Q,et,H,Et;for(;f<d;){const G=i[f];switch(G[0]){case ht.BEGIN_GEOMETRY:Q=G[1],Et=G[3],Q.getGeometry()?l!==void 0&&!De(l,Et.getExtent())?f=G[2]+1:++f:f=G[2],c&&(c.zIndex=G[4]);break;case ht.BEGIN_PATH:P>st&&(this.fill_(t),P=0),b>st&&(t.stroke(),b=0),!P&&!b&&(t.beginPath(),_=NaN,v=NaN),++f;break;case ht.CIRCLE:g=G[1];const ue=h[g],Qt=h[g+1],ce=h[g+2],q=h[g+3],dt=ce-ue,oe=q-Qt,ir=Math.sqrt(dt*dt+oe*oe);t.moveTo(ue+ir,Qt),t.arc(ue,Qt,ir,0,2*Math.PI,!0),++f;break;case ht.CLOSE_PATH:t.closePath(),++f;break;case ht.CUSTOM:g=G[1],p=G[2];const as=G[3],_r=G[4],Li=G[5];Y.geometry=as,Y.feature=Q,f in B||(B[f]=[]);const Ue=B[f];Li?Li(h,g,p,2,Ue):(Ue[0]=h[g],Ue[1]=h[g+1],Ue.length=2),c&&(c.zIndex=G[6]),_r(Ue,Y),++f;break;case ht.DRAW_IMAGE:g=G[1],p=G[2],I=G[3],m=G[4],y=G[5];let Ut=G[6];const kn=G[7],ls=G[8],Ze=G[9],Ve=G[10];let sr=G[11];const Ws=G[12];let Mi=G[13];E=G[14]||"declutter";const us=G[15];if(!I&&G.length>=20){C=G[19],T=G[20],R=G[21],M=G[22];const Ni=this.drawLabelWithPointPlacement_(C,T,R,M);I=Ni.label,G[3]=I;const Sl=G[23];m=(Ni.anchorX-Sl)*this.pixelRatio,G[4]=m;const Oi=G[24];y=(Ni.anchorY-Oi)*this.pixelRatio,G[5]=y,Ut=I.height,G[6]=Ut,Mi=I.width,G[13]=Mi}let Ys;G.length>25&&(Ys=G[25]);let cs,we,he;G.length>17?(cs=G[16],we=G[17],he=G[18]):(cs=Ya,we=!1,he=!1),Ve&&V?sr+=F:!Ve&&!V&&(sr-=F);let Ra=0;for(;g<p;g+=2){if(Ys&&Ys[Ra++]<Mi/this.pixelRatio)continue;const Ni=this.calculateImageOrLabelDimensions_(I.width,I.height,h[g],h[g+1],Mi,Ut,m,y,ls,Ze,sr,Ws,o,cs,we||he,Q),Sl=[t,e,I,Ni,kn,we?A:null,he?L:null];if(u){let Oi,Hs,Fi;if(us){const je=p-g;if(!us[je]){us[je]={args:Sl,declutterMode:E};continue}const vr=us[je];Oi=vr.args,Hs=vr.declutterMode,delete us[je],Fi=bx(Oi)}let bo,Ao;if(Oi&&(Hs!=="declutter"||!u.collides(Fi))&&(bo=!0),(E!=="declutter"||!u.collides(Ni.declutterBox))&&(Ao=!0),Hs==="declutter"&&E==="declutter"){const je=bo&&Ao;bo=je,Ao=je}bo&&(Hs!=="none"&&u.insert(Fi),this.replayImageOrLabel_.apply(this,Oi)),Ao&&(E!=="none"&&u.insert(Ni.declutterBox),this.replayImageOrLabel_.apply(this,Sl))}else this.replayImageOrLabel_.apply(this,Sl)}++f;break;case ht.DRAW_CHARS:const Xs=G[1],tp=G[2],Pa=G[3],i0=G[4];M=G[5];const Kh=G[6],ep=G[7],jR=G[8];R=G[9];const s0=G[10];C=G[11],T=G[12];const WR=[G[13],G[13]];E=G[14]||"declutter";const o0=this.textStates[T],Jh=o0.font,Qh=[o0.scale[0]*ep,o0.scale[1]*ep];let $h;Jh in this.widths_?$h=this.widths_[Jh]:($h={},this.widths_[Jh]=$h);const YR=UE(h,Xs,tp,2),XR=Math.abs(Qh[0])*ox(Jh,C,$h);if(i0||XR<=YR){const Ni=this.textStates[T].textAlign,Sl=(YR-XR)*Bm(C,Ni),Oi=RM(h,Xs,tp,2,C,Sl,Kh,Math.abs(Qh[0]),ox,Jh,$h,V?0:this.viewRotation_);t:if(Oi){const Hs=[];let Fi,bo,Ao,je,vr;if(R)for(Fi=0,bo=Oi.length;Fi<bo;++Fi){vr=Oi[Fi],Ao=vr[4],je=this.createLabel(Ao,T,"",R),m=vr[2]+(Qh[0]<0?-s0:s0),y=Pa*je.height+(.5-Pa)*2*s0*Qh[1]/Qh[0]-jR;const Lo=this.calculateImageOrLabelDimensions_(je.width,je.height,vr[0],vr[1],je.width,je.height,m,y,0,0,vr[3],WR,!1,Ya,!1,Q);if(u&&E==="declutter"&&u.collides(Lo.declutterBox))break t;Hs.push([t,e,je,Lo,1,null,null])}if(M)for(Fi=0,bo=Oi.length;Fi<bo;++Fi){vr=Oi[Fi],Ao=vr[4],je=this.createLabel(Ao,T,M,""),m=vr[2],y=Pa*je.height-jR;const Lo=this.calculateImageOrLabelDimensions_(je.width,je.height,vr[0],vr[1],je.width,je.height,m,y,0,0,vr[3],WR,!1,Ya,!1,Q);if(u&&E==="declutter"&&u.collides(Lo.declutterBox))break t;Hs.push([t,e,je,Lo,1,null,null])}u&&E!=="none"&&u.load(Hs.map(bx));for(let Lo=0,S6=Hs.length;Lo<S6;++Lo)this.replayImageOrLabel_.apply(this,Hs[Lo])}}++f;break;case ht.END_GEOMETRY:if(a!==void 0){Q=G[1];const Ni=a(Q,Et,E);if(Ni)return Ni}++f;break;case ht.FILL:st?P++:this.fill_(t),++f;break;case ht.MOVE_TO_LINE_TO:for(g=G[1],p=G[2],et=h[g],H=h[g+1],t.moveTo(et,H),_=et+.5|0,v=H+.5|0,g+=2;g<p;g+=2)et=h[g],H=h[g+1],x=et+.5|0,w=H+.5|0,(g==p-2||x!==_||w!==v)&&(t.lineTo(et,H),_=x,v=w);++f;break;case ht.SET_FILL_STYLE:A=G,this.alignAndScaleFill_=G[2],P&&(this.fill_(t),P=0,b&&(t.stroke(),b=0)),t.fillStyle=G[1],++f;break;case ht.SET_STROKE_STYLE:L=G,b&&(t.stroke(),b=0),this.setStrokeStyle_(t,G),++f;break;case ht.STROKE:st?b++:t.stroke(),++f;break;default:++f;break}}P&&this.fill_(t),b&&t.stroke()}execute(t,e,n,i,o,a){this.viewRotation_=i,this.execute_(t,e,n,this.instructions,o,void 0,void 0,a)}executeHitDetection(t,e,n,i,o){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,i,o)}}const AM=bM,Jl=["Polygon","Circle","LineString","Image","Text","Default"],qf=["Image","Text"],LM=Jl.filter(r=>!qf.includes(r));class MM{constructor(t,e,n,i,o,a,l){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=an(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(o,l)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let i=this.executorsByZIndex_[n];i===void 0&&(i={},this.executorsByZIndex_[n]=i);const o=t[n];for(const a in o){const l=o[a];i[a]=new AM(this.resolution_,this.pixelRatio_,this.overlaps_,l,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let i=0,o=t.length;i<o;++i)if(t[i]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,i,o,a){i=Math.round(i);const l=i*2+1,u=si(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=ln(l,l,void 0,{willReadFrequently:!0}));const h=this.hitDetectionContext_;h.canvas.width!==l||h.canvas.height!==l?(h.canvas.width=l,h.canvas.height=l):c||h.clearRect(0,0,l,l);let f;this.renderBuffer_!==void 0&&(f=An(),uc(f,t),xr(f,e*(this.renderBuffer_+i),f));const d=NM(i);let g;function p(w,I,C){const T=h.getImageData(0,0,l,l).data;for(let R=0,M=d.length;R<M;R++)if(T[d[R]]>0){if(!a||C==="none"||g!=="Image"&&g!=="Text"||a.includes(w)){const P=(d[R]-3)/4,b=i-P%l,A=i-(P/l|0),L=o(w,I,b*b+A*A);if(L)return L}h.clearRect(0,0,l,l);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(hs);let y,E,_,v,x;for(y=m.length-1;y>=0;--y){const w=m[y].toString();for(_=this.executorsByZIndex_[w],E=Jl.length-1;E>=0;--E)if(g=Jl[E],v=_[g],v!==void 0&&(x=v.executeHitDetection(h,u,n,p,f),x))return x}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],i=e[1],o=e[2],a=e[3],l=[n,i,n,a,o,a,o,i];return Fo(l,0,8,2,t,l),l}isEmpty(){return Mo(this.executorsByZIndex_)}execute(t,e,n,i,o,a,l){const u=Object.keys(this.executorsByZIndex_).map(Number);u.sort(hs),a=a||Jl;const c=Jl.length;let h,f,d,g,p;for(l&&u.reverse(),h=0,f=u.length;h<f;++h){const m=u[h].toString();for(p=this.executorsByZIndex_[m],d=0,g=a.length;d<g;++d){const y=a[d],E=p[y];if(E!==void 0){const _=l===null?void 0:E.getZIndexContext(),v=_?_.getContext():t,x=this.maxExtent_&&y!=="Image"&&y!=="Text";if(x&&(v.save(),this.clip(v,n)),!_||y==="Text"||y==="Image"?E.execute(v,e,n,i,o,l):_.pushFunction(w=>E.execute(w,e,n,i,o,l)),x&&v.restore(),_){_.offset();const w=u[h]*c+d;this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(_)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(hs);for(let n=0,i=e.length;n<i;++n)t[e[n]].forEach(o=>{o.draw(this.renderedContext_),o.clear()}),t[e[n]].length=0}}const Gm={};function NM(r){if(Gm[r]!==void 0)return Gm[r];const t=r*2+1,e=r*r,n=new Array(e+1);for(let o=0;o<=r;++o)for(let a=0;a<=r;++a){const l=o*o+a*a;if(l>e)break;let u=n[l];u||(u=[],n[l]=u),u.push(((r+o)*t+(r+a))*4+3),o>0&&u.push(((r-o)*t+(r+a))*4+3),a>0&&(u.push(((r+o)*t+(r-a))*4+3),o>0&&u.push(((r-o)*t+(r-a))*4+3))}const i=[];for(let o=0,a=n.length;o<a;++o)n[o]&&i.push(...n[o]);return Gm[r]=i,i}const Lx=MM;class OM extends Tx{constructor(t,e,n,i,o,a,l){super(),this.context_=t,this.pixelRatio_=e,this.extent_=n,this.transform_=i,this.transformRotation_=i?ac(Math.atan2(i[1],i[0]),10):0,this.viewRotation_=o,this.squaredTolerance_=a,this.userTransform_=l,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=an()}drawImages_(t,e,n,i){if(!this.image_)return;const o=Fo(t,e,n,i,this.transform_,this.pixelCoordinates_),a=this.context_,l=this.tmpLocalTransform_,u=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=u*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let h=0,f=o.length;h<f;h+=2){const d=o[h]-this.imageAnchorX_,g=o[h+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const p=d+this.imageAnchorX_,m=g+this.imageAnchorY_;si(l,p,m,1,1,c,-p,-m),a.save(),a.transform.apply(a,l),a.translate(p,m),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=u)}drawText_(t,e,n,i){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const o=Fo(t,e,n,i,this.transform_,this.pixelCoordinates_),a=this.context_;let l=this.textRotation_;for(this.transformRotation_===0&&(l-=this.viewRotation_),this.textRotateWithView_&&(l+=this.viewRotation_);e<n;e+=i){const u=o[e]+this.textOffsetX_,c=o[e+1]+this.textOffsetY_;l!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(u-this.textOffsetX_,c-this.textOffsetY_),a.rotate(l),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,u,c),this.textFillState_&&a.fillText(this.text_,u,c))}}moveToLineTo_(t,e,n,i,o){const a=this.context_,l=Fo(t,e,n,i,this.transform_,this.pixelCoordinates_);a.moveTo(l[0],l[1]);let u=l.length;o&&(u-=2);for(let c=2;c<u;c+=2)a.lineTo(l[c],l[c+1]);return o&&a.closePath(),n}drawRings_(t,e,n,i){for(let o=0,a=n.length;o<a;++o)e=this.moveToLineTo_(t,e,n[o],i,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!De(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=JP(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],i=e[3]-e[1],o=Math.sqrt(n*n+i*i),a=this.context_;a.beginPath(),a.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,i=e.length;n<i;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!De(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(De(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,i=t.getFlatCoordinates();let o=0;const a=t.getEnds(),l=t.getStride();n.beginPath();for(let u=0,c=a.length;u<c;++u)o=this.moveToLineTo_(i,o,a[u],l,!1);n.stroke()}if(this.text_!==""){const n=t.getFlatMidpoints();this.drawText_(n,0,n.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!De(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!De(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getOrientedFlatCoordinates();let i=0;const o=t.getEndss(),a=t.getStride();e.beginPath();for(let l=0,u=o.length;l<u;++l){const c=o[l];i=this.drawRings_(n,i,c,a)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),fs(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,n=this.contextTextState_,i=t.textAlign?t.textAlign:Nc;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=i&&(n.textAlign=i,e.textAlign=i),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const n=t.getColor();this.fillState_={fillStyle:_s(n||Ir)}}if(!e)this.strokeState_=null;else{const n=e.getColor(),i=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),c=e.getMiterLimit(),h=o||Qs;this.strokeState_={lineCap:i!==void 0?i:Xl,lineDash:this.pixelRatio_===1?h:h.map(f=>f*this.pixelRatio_),lineDashOffset:(a||$s)*this.pixelRatio_,lineJoin:l!==void 0?l:Hl,lineWidth:(u!==void 0?u:Oc)*this.pixelRatio_,miterLimit:c!==void 0?c:Lc,strokeStyle:_s(n||Mc)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*n,this.imageAnchorY_=i[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const g=e.getColor();this.textFillState_={fillStyle:_s(g||Ir)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const g=n.getColor(),p=n.getLineCap(),m=n.getLineDash(),y=n.getLineDashOffset(),E=n.getLineJoin(),_=n.getWidth(),v=n.getMiterLimit();this.textStrokeState_={lineCap:p!==void 0?p:Xl,lineDash:m||Qs,lineDashOffset:y||$s,lineJoin:E!==void 0?E:Hl,lineWidth:_!==void 0?_:Oc,miterLimit:v!==void 0?v:Lc,strokeStyle:_s(g||Mc)}}const i=t.getFont(),o=t.getOffsetX(),a=t.getOffsetY(),l=t.getRotateWithView(),u=t.getRotation(),c=t.getScaleArray(),h=t.getText(),f=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:i!==void 0?i:ix,textAlign:f!==void 0?f:Nc,textBaseline:d!==void 0?d:Gf},this.text_=h!==void 0?Array.isArray(h)?h.reduce((g,p,m)=>g+=m%2?" ":p,""):h:"",this.textOffsetX_=o!==void 0?this.pixelRatio_*o:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=l!==void 0?l:!1,this.textRotation_=u!==void 0?u:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const FM=OM,zr=.5;function Mx(r,t,e,n,i,o,a,l,u){const c=u?gc(i):i,h=r[0]*zr,f=r[1]*zr,d=ln(h,f);d.imageSmoothingEnabled=!1;const g=d.canvas,p=new FM(d,zr,i,null,a,l,u?hf(DP(),u):null),m=e.length,y=Math.floor((256*256*256-1)/m),E={};for(let v=1;v<=m;++v){const x=e[v-1],w=x.getStyleFunction()||n;if(!w)continue;let I=w(x,o);if(!I)continue;Array.isArray(I)||(I=[I]);const T=(v*y).toString(16).padStart(7,"#00000");for(let R=0,M=I.length;R<M;++R){const P=I[R],b=P.getGeometryFunction()(x);if(!b||!De(c,b.getExtent()))continue;const A=P.clone(),L=A.getFill();L&&L.setColor(T);const B=A.getStroke();B&&(B.setColor(T),B.setLineDash(null)),A.setText(void 0);const F=P.getImage();if(F){const Q=F.getImageSize();if(!Q)continue;const et=ln(Q[0],Q[1],void 0,{alpha:!1}),H=et.canvas;et.fillStyle=T,et.fillRect(0,0,H.width,H.height),A.setImage(new Fc({img:H,anchor:F.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:F.getOrigin(),opacity:1,size:F.getSize(),scale:F.getScale(),rotation:F.getRotation(),rotateWithView:F.getRotateWithView()}))}const V=A.getZIndex()||0;let Y=E[V];Y||(Y={},E[V]=Y,Y.Polygon=[],Y.Circle=[],Y.LineString=[],Y.Point=[]);const st=b.getType();if(st==="GeometryCollection"){const Q=b.getGeometriesArrayRecursive();for(let et=0,H=Q.length;et<H;++et){const Et=Q[et];Y[Et.getType().replace("Multi","")].push(Et,A)}}else Y[st.replace("Multi","")].push(b,A)}}const _=Object.keys(E).map(Number).sort(hs);for(let v=0,x=_.length;v<x;++v){const w=E[_[v]];for(const I in w){const C=w[I];for(let T=0,R=C.length;T<R;T+=2){p.setStyle(C[T+1]);for(let M=0,P=t.length;M<P;++M)p.setTransform(t[M]),p.drawGeometry(C[T])}}}return d.getImageData(0,0,g.width,g.height)}function Nx(r,t,e){const n=[];if(e){const i=Math.floor(Math.round(r[0])*zr),o=Math.floor(Math.round(r[1])*zr),a=(Oe(i,0,e.width-1)+Oe(o,0,e.height-1)*e.width)*4,l=e.data[a],u=e.data[a+1],h=e.data[a+2]+256*(u+256*l),f=Math.floor((256*256*256-1)/t.length);h&&h%f===0&&n.push(t[h/f-1])}return n}const DM=.5,Ox={Point:WM,LineString:UM,Polygon:XM,MultiPoint:YM,MultiLineString:VM,MultiPolygon:jM,GeometryCollection:zM,Circle:GM};function BM(r,t){return parseInt(Z(r),10)-parseInt(Z(t),10)}function km(r,t){const e=Fx(r,t);return e*e}function Fx(r,t){return DM*r/t}function GM(r,t,e,n,i){const o=e.getFill(),a=e.getStroke();if(o||a){const u=r.getBuilder(e.getZIndex(),"Circle");u.setFillStrokeStyle(o,a),u.drawCircle(t,n,i)}const l=e.getText();if(l&&l.getText()){const u=r.getBuilder(e.getZIndex(),"Text");u.setTextStyle(l),u.drawText(t,n)}}function Zf(r,t,e,n,i,o,a,l){const u=[],c=e.getImage();if(c){let d=!0;const g=c.getImageState();g==$.LOADED||g==$.ERROR?d=!1:g==$.IDLE&&c.load(),d&&u.push(c.ready())}const h=e.getFill();h&&h.loading()&&u.push(h.ready());const f=u.length>0;return f&&Promise.all(u).then(()=>i(null)),kM(r,t,e,n,o,a,l),f}function kM(r,t,e,n,i,o,a){const l=e.getGeometryFunction()(t);if(!l)return;const u=l.simplifyTransformed(n,i);if(e.getRenderer())Dx(r,u,e,t,a);else{const h=Ox[u.getType()];h(r,u,e,t,a,o)}}function Dx(r,t,e,n,i){if(t.getType()=="GeometryCollection"){const a=t.getGeometries();for(let l=0,u=a.length;l<u;++l)Dx(r,a[l],e,n,i);return}r.getBuilder(e.getZIndex(),"Default").drawCustom(t,n,e.getRenderer(),e.getHitDetectionRenderer(),i)}function zM(r,t,e,n,i,o){const a=t.getGeometriesArray();let l,u;for(l=0,u=a.length;l<u;++l){const c=Ox[a[l].getType()];c(r,a[l],e,n,i,o)}}function UM(r,t,e,n,i){const o=e.getStroke();if(o){const l=r.getBuilder(e.getZIndex(),"LineString");l.setFillStrokeStyle(null,o),l.drawLineString(t,n,i)}const a=e.getText();if(a&&a.getText()){const l=r.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,i)}}function VM(r,t,e,n,i){const o=e.getStroke();if(o){const l=r.getBuilder(e.getZIndex(),"LineString");l.setFillStrokeStyle(null,o),l.drawMultiLineString(t,n,i)}const a=e.getText();if(a&&a.getText()){const l=r.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,i)}}function jM(r,t,e,n,i){const o=e.getFill(),a=e.getStroke();if(a||o){const u=r.getBuilder(e.getZIndex(),"Polygon");u.setFillStrokeStyle(o,a),u.drawMultiPolygon(t,n,i)}const l=e.getText();if(l&&l.getText()){const u=r.getBuilder(e.getZIndex(),"Text");u.setTextStyle(l),u.drawText(t,n,i)}}function WM(r,t,e,n,i,o){const a=e.getImage(),l=e.getText(),u=l&&l.getText(),c=o&&a&&u?{}:void 0;if(a){if(a.getImageState()!=$.LOADED)return;const h=r.getBuilder(e.getZIndex(),"Image");h.setImageStyle(a,c),h.drawPoint(t,n,i)}if(u){const h=r.getBuilder(e.getZIndex(),"Text");h.setTextStyle(l,c),h.drawText(t,n,i)}}function YM(r,t,e,n,i,o){const a=e.getImage(),l=a&&a.getOpacity()!==0,u=e.getText(),c=u&&u.getText(),h=o&&l&&c?{}:void 0;if(l){if(a.getImageState()!=$.LOADED)return;const f=r.getBuilder(e.getZIndex(),"Image");f.setImageStyle(a,h),f.drawMultiPoint(t,n,i)}if(c){const f=r.getBuilder(e.getZIndex(),"Text");f.setTextStyle(u,h),f.drawText(t,n,i)}}function XM(r,t,e,n,i){const o=e.getFill(),a=e.getStroke();if(o||a){const u=r.getBuilder(e.getZIndex(),"Polygon");u.setFillStrokeStyle(o,a),u.drawPolygon(t,n,i)}const l=e.getText();if(l&&l.getText()){const u=r.getBuilder(e.getZIndex(),"Text");u.setTextStyle(l),u.drawText(t,n,i)}}class HM extends Qp{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=An(),this.wrappedRenderedExtent_=An(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,n){const i=e.extent,o=e.viewState,a=o.center,l=o.resolution,u=o.projection,c=o.rotation,h=u.getExtent(),f=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),g=e.pixelRatio,p=e.viewHints,m=!(p[fe.ANIMATING]||p[fe.INTERACTING]),y=this.context,E=Math.round(Pt(i)/l*g),_=Math.round(Fe(i)/l*g),v=f.getWrapX()&&u.canWrapX(),x=v?Pt(h):null,w=v?Math.ceil((i[2]-h[2])/x)+1:1;let I=v?Math.floor((i[0]-h[0])/x):0;do{let C=this.getRenderTransform(a,l,0,g,E,_,I*x);e.declutter&&(C=C.slice(0)),t.execute(y,[y.canvas.width,y.canvas.height],C,c,m,n===void 0?Jl:n?qf:LM,n?d&&e.declutter[d]:void 0)}while(++I<w)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=ln(this.context.canvas.width,this.context.canvas.height,pE))}resetDrawContext_(){if(this.opacity_!==1){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,vc(this.context),pE.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const i=t.viewState;this.prepareContainer(t,e);const o=this.context,a=this.replayGroup_;let l=a&&!a.isEmpty();if(!l&&!(this.getLayer().hasListener(pn.PRERENDER)||this.getLayer().hasListener(pn.POSTRENDER)))return null;if(this.setDrawContext_(),this.preRender(o,t),i.projection,this.clipped_=!1,l&&n.extent&&this.clipping){const u=ps(n.extent);l=De(u,t.extent),this.clipped_=l&&!ri(u,t.extent),this.clipped_&&this.clipUnrotated(o,t,u)}return l&&this.renderWorlds(a,t,this.getLayer().getDeclutter()?!1:void 0),!t.declutter&&this.clipped_&&o.restore(),this.postRender(o,t),this.renderedRotation_!==i.rotation&&(this.renderedRotation_=i.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),i=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,l=this.renderedProjection_,u=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],f=n[0]*zr,d=n[1]*zr;h.push(this.getRenderTransform(i,o,a,zr,f,d,0).slice());const g=c.getSource(),p=l.getExtent();if(g.getWrapX()&&l.canWrapX()&&!ri(p,u)){let m=u[0];const y=Pt(p);let E=0,_;for(;m<p[0];)--E,_=y*E,h.push(this.getRenderTransform(i,o,a,zr,f,d,_).slice()),m+=y;for(E=0,m=u[2];m>p[2];)++E,_=y*E,h.push(this.getRenderTransform(i,o,a,zr,f,d,_).slice()),m-=y}this.hitDetectionImageData_=Mx(n,h,this.renderedFeatures_,c.getStyleFunction(),u,o,a,km(o,this.renderedPixelRatio_),null)}e(Nx(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,i,o){if(!this.replayGroup_)return;const a=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),c={},h=function(p,m,y){const E=Z(p),_=c[E];if(_){if(_!==!0&&y<_.distanceSq){if(y===0)return c[E]=!0,o.splice(o.lastIndexOf(_),1),i(p,u,m);_.geometry=m,_.distanceSq=y}}else{if(y===0)return c[E]=!0,i(p,u,m);o.push(c[E]={feature:p,layer:u,geometry:m,distanceSq:y,callback:i})}};let f;const d=[this.replayGroup_],g=this.getLayer().getDeclutter();return d.some(p=>f=p.forEachFeatureAtCoordinate(t,a,l,n,h,g&&e.declutter[g]?e.declutter[g].all().map(m=>m.value):null)),f}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const i=t.viewHints[fe.ANIMATING],o=t.viewHints[fe.INTERACTING],a=e.getUpdateWhileAnimating(),l=e.getUpdateWhileInteracting();if(this.ready&&!a&&i||!l&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const u=t.extent,c=t.viewState,h=c.projection,f=c.resolution,d=t.pixelRatio,g=e.getRevision(),p=e.getRenderBuffer();let m=e.getRenderOrder();m===void 0&&(m=BM);const y=c.center.slice(),E=xr(u,p*f),_=E.slice(),v=[E.slice()],x=h.getExtent();if(n.getWrapX()&&h.canWrapX()&&!ri(x,t.extent)){const L=Pt(x),B=Math.max(Pt(E)/2,L);E[0]=x[0]-B,E[2]=x[2]+B,pp(y,h);const F=I0(v[0],h);F[0]<x[0]&&F[2]<x[2]?v.push([F[0]+L,F[1],F[2]+L,F[3]]):F[0]>x[0]&&F[2]>x[2]&&v.push([F[0]-L,F[1],F[2]-L,F[3]])}if(this.ready&&this.renderedResolution_==f&&this.renderedRevision_==g&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!t.declutter&&ri(this.wrappedRenderedExtent_,E))return fs(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const w=new Px(Fx(f,d),E,f,d);let I;for(let L=0,B=v.length;L<B;++L)n.loadFeatures(v[L],f,h);const C=km(f,d);let T=!0;const R=(L,B)=>{let F;const V=L.getStyleFunction()||e.getStyleFunction();if(V&&(F=V(L,f)),F){const Y=this.renderFeature(L,C,F,w,I,this.getLayer().getDeclutter(),B);T=T&&!Y}},M=gc(E),P=n.getFeaturesInExtent(M);m&&P.sort(m);for(let L=0,B=P.length;L<B;++L)R(P[L],L);this.renderedFeatures_=P,this.ready=T;const b=w.finish(),A=new Lx(E,f,d,n.getOverlaps(),b,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=f,this.renderedRevision_=g,this.renderedRenderOrder_=m,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=E,this.renderedCenter_=y,this.renderedProjection_=h,this.renderedPixelRatio_=d,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,n,i,o,a,l){if(!n)return!1;let u=!1;if(Array.isArray(n))for(let c=0,h=n.length;c<h;++c)u=Zf(i,t,n[c],e,this.boundHandleStyleImageChange_,o,a,l)||u;else u=Zf(i,t,n,e,this.boundHandleStyleImageChange_,o,a,l);return u}}const qM=HM;class ZM extends jc{constructor(t){super(t)}createRenderer(){return new qM(this)}}const Ur=ZM;class Ko extends Er{constructor(t,e){super(t),this.layer=e}}const zm={LAYERS:"layers"};class Um extends y0{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(zm.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new Gr(n.slice(),{unique:!0}):xt(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new Gr(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Ht),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(yt(t,Be.ADD,this.handleLayersAdd_,this),yt(t,Be.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(Ht);La(this.listenerKeys_);const e=t.getArray();for(let n=0,i=e.length;n<i;n++){const o=e[n];this.registerLayerListeners_(o),this.dispatchEvent(new Ko("addlayer",o))}this.changed()}registerLayerListeners_(t){const e=[yt(t,Cl.PROPERTYCHANGE,this.handleLayerChange_,this),yt(t,ot.CHANGE,this.handleLayerChange_,this)];t instanceof Um&&e.push(yt(t,"addlayer",this.handleLayerGroupAdd_,this),yt(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[Z(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Ko("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Ko("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Ko("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,n=Z(e);this.listenerKeys_[n].forEach(Ht),delete this.listenerKeys_[n],this.dispatchEvent(new Ko("removelayer",e)),this.changed()}getLayers(){return this.get(zm.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const n=e.getArray();for(let i=0,o=n.length;i<o;++i)this.dispatchEvent(new Ko("removelayer",n[i]))}this.set(zm.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=t!==void 0?t:[],n=e.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(e)});const i=this.getLayerState();let o=i.zIndex;!t&&i.zIndex===void 0&&(o=0);for(let a=n,l=e.length;a<l;a++){const u=e[a];u.opacity*=i.opacity,u.visible=u.visible&&i.visible,u.maxResolution=Math.min(u.maxResolution,i.maxResolution),u.minResolution=Math.max(u.minResolution,i.minResolution),u.minZoom=Math.max(u.minZoom,i.minZoom),u.maxZoom=Math.min(u.maxZoom,i.maxZoom),i.extent!==void 0&&(u.extent!==void 0?u.extent=Ks(u.extent,i.extent):u.extent=i.extent),u.zIndex===void 0&&(u.zIndex=o)}return e}getSourceState(){return"ready"}}const Kf=Um,Vm=34962,jm=34963,KM=35040,JM=35044,Wm=35048,QM=5121,$M=5123,tN=5125,Bx=5126,Gx=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function eN(r,t){t=Object.assign({preserveDrawingBuffer:!0,antialias:!xb},t);const e=Gx.length;for(let n=0;n<e;++n)try{const i=r.getContext(Gx[n],t);if(i)return i}catch{}return null}const nN={STATIC_DRAW:JM,STREAM_DRAW:KM,DYNAMIC_DRAW:Wm};class rN{constructor(t,e){this.array_=null,this.type_=t,xt(t===Vm||t===jm,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage_=e!==void 0?e:nN.STATIC_DRAW}ofSize(t){return this.array_=new(Ym(this.type_))(t),this}fromArray(t){return this.array_=Ym(this.type_).from(t),this}fromArrayBuffer(t){return this.array_=new(Ym(this.type_))(t),this}getType(){return this.type_}getArray(){return this.array_}getUsage(){return this.usage_}getSize(){return this.array_?this.array_.length:0}}function Ym(r){switch(r){case Vm:return Float32Array;case jm:return Uint32Array;default:return Float32Array}}const kx=rN,Jf={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"},iN=`
12
+ precision mediump float;
13
+
14
+ attribute vec2 a_position;
15
+ varying vec2 v_texCoord;
16
+ varying vec2 v_screenCoord;
17
+
18
+ uniform vec2 u_screenSize;
19
+
20
+ void main() {
21
+ v_texCoord = a_position * 0.5 + 0.5;
22
+ v_screenCoord = v_texCoord * u_screenSize;
23
+ gl_Position = vec4(a_position, 0.0, 1.0);
24
+ }
25
+ `,sN=`
26
+ precision mediump float;
27
+
28
+ uniform sampler2D u_image;
29
+ uniform float u_opacity;
30
+
31
+ varying vec2 v_texCoord;
32
+
33
+ void main() {
34
+ gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
35
+ }
36
+ `;class oN{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t.vertexShader||iN),e.compileShader(n);const i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,t.fragmentShader||sN),e.compileShader(i),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,n),e.attachShader(this.renderTargetProgram_,i),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();const o=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(a=>{this.uniforms_.push({value:t.uniforms[a],location:e.getUniformLocation(this.renderTargetProgram_,a)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;const i=0,o=e.RGBA,a=0,l=e.RGBA,u=e.UNSIGNED_BYTE,c=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,i,o,n[0],n[1],a,l,u,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n[0],n[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,n,i){const o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){const u=Z(o.canvas);if(!t.renderTargets[u]){const c=o.getContextAttributes();c&&c.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT)),t.renderTargets[u]=!0}}o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);const l=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,l),this.applyUniforms(t),n&&n(o,t),o.drawArrays(o.TRIANGLES,0,6),i&&i(o,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let n,i=1;this.uniforms_.forEach(function(o){if(n=typeof o.value=="function"?o.value(t):o.value,n instanceof HTMLCanvasElement||n instanceof ImageData)o.texture||(o.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${i}`]),e.bindTexture(e.TEXTURE_2D,o.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,n.width,n.height,0,e.UNSIGNED_BYTE,new Uint8Array(n.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n),e.uniform1i(o.location,i++);else if(Array.isArray(n))switch(n.length){case 2:e.uniform2f(o.location,n[0],n[1]);return;case 3:e.uniform3f(o.location,n[0],n[1],n[2]);return;case 4:e.uniform4f(o.location,n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(o.location,n)})}}const zx=oN;function aN(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function lN(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const so={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},oo={UNSIGNED_BYTE:QM,UNSIGNED_SHORT:$M,UNSIGNED_INT:tN,FLOAT:Bx},Qf={};function Ux(r){return"shared/"+r}let Vx=0;function uN(){const r="unique/"+Vx;return Vx+=1,r}function cN(r){let t=Qf[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:eN(e)},Qf[r]=t}return t.users+=1,t.context}function hN(r){const t=Qf[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,n=e.getExtension("WEBGL_lose_context");n&&n.loseContext();const i=e.canvas;i.width=1,i.height=1,delete Qf[r]}class fN extends tf{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?Ux(t.canvasCacheKey):uN(),this.gl_=cN(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(Jf.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(Jf.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=an(),this.offsetScaleMatrix_=an(),this.tmpMat4_=aN(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(n=>new zx({webGlContext:this.gl_,scaleRatio:n.scaleRatio,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms})):[new zx({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===Ux(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,n=Z(t);let i=this.bufferCache_[n];if(!i){const o=e.createBuffer();i={buffer:t,webGlBuffer:o},this.bufferCache_[n]=i}e.bindBuffer(t.getType(),i.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,n=Z(t),i=this.bufferCache_[n];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[n]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(Jf.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(Jf.RESTORED,this.boundHandleWebGLContextRestored_),hN(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,n){const i=this.gl_,o=this.getCanvas(),a=t.size,l=t.pixelRatio;(o.width!==a[0]*l||o.height!==a[1]*l)&&(o.width=a[0]*l,o.height=a[1]*l,o.style.width=a[0]+"px",o.style.height=a[1]+"px");for(let u=this.postProcessPasses_.length-1;u>=0;u--)this.postProcessPasses_[u].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.depthRange(0,1),i.clearDepth(1),i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,e?i.ZERO:i.ONE_MINUS_SRC_ALPHA),n?(i.enable(i.DEPTH_TEST),i.depthFunc(i.LEQUAL)):i.disable(i.DEPTH_TEST)}bindTexture(t,e,n){const i=this.gl_;i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),i.uniform1i(this.getUniformLocation(n),e)}prepareDrawToRenderTarget(t,e,n,i){const o=this.gl_,a=e.getSize();o.bindFramebuffer(o.FRAMEBUFFER,e.getFramebuffer()),o.bindRenderbuffer(o.RENDERBUFFER,e.getDepthbuffer()),o.viewport(0,0,a[0],a[1]),o.bindTexture(o.TEXTURE_2D,e.getTexture()),o.clearColor(0,0,0,0),o.depthRange(0,1),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.enable(o.BLEND),o.blendFunc(o.ONE,n?o.ZERO:o.ONE_MINUS_SRC_ALPHA),i?(o.enable(o.DEPTH_TEST),o.depthFunc(o.LEQUAL)):o.disable(o.DEPTH_TEST)}drawElements(t,e){const n=this.gl_;this.getExtension("OES_element_index_uint");const i=n.UNSIGNED_INT,o=4,a=e-t,l=t*o;n.drawElements(n.TRIANGLES,a,i,l)}finalizeDraw(t,e,n){for(let i=0,o=this.postProcessPasses_.length;i<o;i++)i===o-1?this.postProcessPasses_[i].apply(t,null,e,n):this.postProcessPasses_[i].apply(t,this.postProcessPasses_[i+1])}getCanvas(){return this.gl_.canvas}getGL(){return this.gl_}applyFrameState(t){const e=t.size,n=t.viewState.rotation,i=t.pixelRatio;this.setUniformFloatValue(so.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(so.ZOOM,t.viewState.zoom),this.setUniformFloatValue(so.RESOLUTION,t.viewState.resolution),this.setUniformFloatValue(so.PIXEL_RATIO,i),this.setUniformFloatVec2(so.VIEWPORT_SIZE_PX,[e[0],e[1]]),this.setUniformFloatValue(so.ROTATION,n)}applyHitDetectionUniform(t){const e=this.getUniformLocation(so.HIT_DETECTION);this.getGL().uniform1i(e,t?1:0),t&&this.setUniformFloatValue(so.PIXEL_RATIO,.5)}applyUniforms(t){const e=this.gl_;let n,i=0;this.uniforms_.forEach(o=>{if(n=typeof o.value=="function"?o.value(t):o.value,n instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof ImageData||n instanceof WebGLTexture){n instanceof WebGLTexture&&!o.texture?(o.prevValue=void 0,o.texture=n):o.texture||(o.prevValue=void 0,o.texture=e.createTexture()),this.bindTexture(o.texture,i,o.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const a=!(n instanceof HTMLImageElement)||n.complete;!(n instanceof WebGLTexture)&&a&&o.prevValue!==n&&(o.prevValue=n,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),i++}else if(Array.isArray(n)&&n.length===6)this.setUniformMatrixValue(o.name,lN(this.tmpMat4_,n));else if(Array.isArray(n)&&n.length<=4)switch(n.length){case 2:e.uniform2f(this.getUniformLocation(o.name),n[0],n[1]);return;case 3:e.uniform3f(this.getUniformLocation(o.name),n[0],n[1],n[2]);return;case 4:e.uniform4f(this.getUniformLocation(o.name),n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(this.getUniformLocation(o.name),n)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const n=this.gl_,i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}getProgram(t,e){const n=this.gl_,i=this.compileShader(t,n.FRAGMENT_SHADER),o=this.compileShader(e,n.VERTEX_SHADER),a=n.createProgram();if(n.attachShader(a,i),n.attachShader(a,o),n.linkProgram(a),!n.getShaderParameter(i,n.COMPILE_STATUS)){const l=`Fragment shader compilation failed: ${n.getShaderInfoLog(i)}`;throw new Error(l)}if(n.deleteShader(i),!n.getShaderParameter(o,n.COMPILE_STATUS)){const l=`Vertex shader compilation failed: ${n.getShaderInfoLog(o)}`;throw new Error(l)}if(n.deleteShader(o),!n.getProgramParameter(a,n.LINK_STATUS)){const l=`GL program linking failed: ${n.getProgramInfoLog(a)}`;throw new Error(l)}return a}getUniformLocation(t){const e=Z(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=Z(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const n=t.size,i=t.viewState.rotation,o=t.viewState.resolution,a=t.viewState.center;return si(e,0,0,2/(o*n[0]),2/(o*n[1]),-i,-a[0],-a[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,n,i,o){const a=this.getAttributeLocation(t);a<0||(this.gl_.enableVertexAttribArray(a),this.gl_.vertexAttribPointer(a,e,n,!1,i,o))}enableAttributes(t){const e=dN(t);let n=0;for(let i=0;i<t.length;i++){const o=t[i];this.enableAttributeArray_(o.name,o.size,o.type||Bx,e,n),n+=o.size*jx(o.type)}}handleWebGLContextLost(t){La(this.bufferCache_),this.currentProgram_=null,t.preventDefault()}handleWebGLContextRestored(){this.needsToBeRecreated_=!0}needsToBeRecreated(){return this.needsToBeRecreated_}createTexture(t,e,n){const i=this.gl_;n=n||i.createTexture();const o=0,a=i.RGBA,l=0,u=i.RGBA,c=i.UNSIGNED_BYTE;return i.bindTexture(i.TEXTURE_2D,n),e?i.texImage2D(i.TEXTURE_2D,o,a,u,c,e):i.texImage2D(i.TEXTURE_2D,o,a,t[0],t[1],l,u,c,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),n}}function dN(r){let t=0;for(let e=0;e<r.length;e++){const n=r[e];t+=n.size*jx(n.type)}return t}function jx(r){switch(r){case oo.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case oo.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case oo.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case oo.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class Xm extends rE{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=an(),this.pixelContext_=null,this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(te.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const n=this.getLayer();if(n.hasListener(pn.PRECOMPOSE)){const i=new _c(pn.PRECOMPOSE,void 0,e,t);n.dispatchEvent(i)}}dispatchPostComposeEvent(t,e){const n=this.getLayer();if(n.hasListener(pn.POSTCOMPOSE)){const i=new _c(pn.POSTCOMPOSE,void 0,e,t);n.dispatchEvent(i)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e=!0,n=-1,i;for(let a=0,l=t.layerStatesArray.length;a<l;a++){const u=t.layerStatesArray[a].layer,c=u.getRenderer();if(!(c instanceof Xm)){e=!0;continue}const h=u.getClassName();if((e||h!==i)&&(n+=1,e=!1),i=h,c===this)break}const o="map/"+t.mapId+"/group/"+n;(!this.helper||!this.helper.canvasCacheKeyMatches(o)||this.helper.needsToBeRecreated())&&(this.removeHelper(),this.helper=new fN({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:o}),i&&(this.helper.getCanvas().className=i),this.afterHelperCreated())}return this.prepareFrameInternal(t)}afterHelperCreated(){}prepareFrameInternal(t){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(t,e,n){const i=this.getLayer();if(i.hasListener(t)){si(this.inversePixelTransform_,0,0,n.pixelRatio,-n.pixelRatio,0,0,-n.size[1]);const o=new _c(t,this.inversePixelTransform_,n,e);i.dispatchEvent(o)}}preRender(t,e){this.dispatchRenderEvent_(pn.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(pn.POSTRENDER,t,e)}}const gN=Xm,xs=new Uint8Array(4);class pN{constructor(t,e){this.helper_=t;const n=t.getGL();this.texture_=n.createTexture(),this.framebuffer_=n.createFramebuffer(),this.depthbuffer_=n.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){fs(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return xs[0]=0,xs[1]=0,xs[2]=0,xs[3]=0,xs;this.readAll();const n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return xs[0]=this.data_[n*4],xs[1]=this.data_[n*4+1],xs[2]=this.data_[n*4+2],xs[3]=this.data_[n*4+3],xs}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const mN=pN,Wx={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"};var Yx={exports:{}};Yx.exports=$f,Yx.exports.default=$f;function $f(r,t,e){e=e||2;var n=t&&t.length,i=n?t[0]*e:r.length,o=Xx(r,0,i,e,!0),a=[];if(!o||o.next===o.prev)return a;var l,u,c,h,f,d,g;if(n&&(o=xN(r,t,o,e)),r.length>80*e){l=c=r[0],u=h=r[1];for(var p=e;p<i;p+=e)f=r[p],d=r[p+1],f<l&&(l=f),d<u&&(u=d),f>c&&(c=f),d>h&&(h=d);g=Math.max(c-l,h-u),g=g!==0?32767/g:0}return Xc(o,a,e,l,u,g,0),a}function Xx(r,t,e,n,i){var o,a;if(i===Zm(r,t,e,n)>0)for(o=t;o<e;o+=n)a=Zx(o,r[o],r[o+1],a);else for(o=e-n;o>=t;o-=n)a=Zx(o,r[o],r[o+1],a);return a&&td(a,a.next)&&(qc(a),a=a.next),a}function qa(r,t){if(!r)return r;t||(t=r);var e=r,n;do if(n=!1,!e.steiner&&(td(e,e.next)||Re(e.prev,e,e.next)===0)){if(qc(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function Xc(r,t,e,n,i,o,a){if(r){!a&&o&&TN(r,n,i,o);for(var l=r,u,c;r.prev!==r.next;){if(u=r.prev,c=r.next,o?_N(r,n,i,o):yN(r)){t.push(u.i/e|0),t.push(r.i/e|0),t.push(c.i/e|0),qc(r),r=c.next,l=c.next;continue}if(r=c,r===l){a?a===1?(r=vN(qa(r),t,e),Xc(r,t,e,n,i,o,2)):a===2&&EN(r,t,e,n,i,o):Xc(qa(r),t,e,n,i,o,1);break}}}}function yN(r){var t=r.prev,e=r,n=r.next;if(Re(t,e,n)>=0)return!1;for(var i=t.x,o=e.x,a=n.x,l=t.y,u=e.y,c=n.y,h=i<o?i<a?i:a:o<a?o:a,f=l<u?l<c?l:c:u<c?u:c,d=i>o?i>a?i:a:o>a?o:a,g=l>u?l>c?l:c:u>c?u:c,p=n.next;p!==t;){if(p.x>=h&&p.x<=d&&p.y>=f&&p.y<=g&&Ql(i,l,o,u,a,c,p.x,p.y)&&Re(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function _N(r,t,e,n){var i=r.prev,o=r,a=r.next;if(Re(i,o,a)>=0)return!1;for(var l=i.x,u=o.x,c=a.x,h=i.y,f=o.y,d=a.y,g=l<u?l<c?l:c:u<c?u:c,p=h<f?h<d?h:d:f<d?f:d,m=l>u?l>c?l:c:u>c?u:c,y=h>f?h>d?h:d:f>d?f:d,E=Hm(g,p,t,e,n),_=Hm(m,y,t,e,n),v=r.prevZ,x=r.nextZ;v&&v.z>=E&&x&&x.z<=_;){if(v.x>=g&&v.x<=m&&v.y>=p&&v.y<=y&&v!==i&&v!==a&&Ql(l,h,u,f,c,d,v.x,v.y)&&Re(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=g&&x.x<=m&&x.y>=p&&x.y<=y&&x!==i&&x!==a&&Ql(l,h,u,f,c,d,x.x,x.y)&&Re(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=E;){if(v.x>=g&&v.x<=m&&v.y>=p&&v.y<=y&&v!==i&&v!==a&&Ql(l,h,u,f,c,d,v.x,v.y)&&Re(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=_;){if(x.x>=g&&x.x<=m&&x.y>=p&&x.y<=y&&x!==i&&x!==a&&Ql(l,h,u,f,c,d,x.x,x.y)&&Re(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function vN(r,t,e){var n=r;do{var i=n.prev,o=n.next.next;!td(i,o)&&Hx(i,n,n.next,o)&&Hc(i,o)&&Hc(o,i)&&(t.push(i.i/e|0),t.push(n.i/e|0),t.push(o.i/e|0),qc(n),qc(n.next),n=r=o),n=n.next}while(n!==r);return qa(n)}function EN(r,t,e,n,i,o){var a=r;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&bN(a,l)){var u=qx(a,l);a=qa(a,a.next),u=qa(u,u.next),Xc(a,t,e,n,i,o,0),Xc(u,t,e,n,i,o,0);return}l=l.next}a=a.next}while(a!==r)}function xN(r,t,e,n){var i=[],o,a,l,u,c;for(o=0,a=t.length;o<a;o++)l=t[o]*n,u=o<a-1?t[o+1]*n:r.length,c=Xx(r,l,u,n,!1),c===c.next&&(c.steiner=!0),i.push(PN(c));for(i.sort(wN),o=0;o<i.length;o++)e=SN(i[o],e);return e}function wN(r,t){return r.x-t.x}function SN(r,t){var e=CN(r,t);if(!e)return t;var n=qx(e,r);return qa(n,n.next),qa(e,e.next)}function CN(r,t){var e=t,n=r.x,i=r.y,o=-1/0,a;do{if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){var l=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(l<=n&&l>o&&(o=l,a=e.x<e.next.x?e:e.next,l===n))return a}e=e.next}while(e!==t);if(!a)return null;var u=a,c=a.x,h=a.y,f=1/0,d;e=a;do n>=e.x&&e.x>=c&&n!==e.x&&Ql(i<h?n:o,i,c,h,i<h?o:n,i,e.x,e.y)&&(d=Math.abs(i-e.y)/(n-e.x),Hc(e,r)&&(d<f||d===f&&(e.x>a.x||e.x===a.x&&IN(a,e)))&&(a=e,f=d)),e=e.next;while(e!==u);return a}function IN(r,t){return Re(r.prev,r,t.prev)<0&&Re(t.next,r,r.next)<0}function TN(r,t,e,n){var i=r;do i.z===0&&(i.z=Hm(i.x,i.y,t,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,RN(i)}function RN(r){var t,e,n,i,o,a,l,u,c=1;do{for(e=r,r=null,o=null,a=0;e;){for(a++,n=e,l=0,t=0;t<c&&(l++,n=n.nextZ,!!n);t++);for(u=c;l>0||u>0&&n;)l!==0&&(u===0||!n||e.z<=n.z)?(i=e,e=e.nextZ,l--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:r=i,i.prevZ=o,o=i;e=n}o.nextZ=null,c*=2}while(a>1);return r}function Hm(r,t,e,n,i){return r=(r-e)*i|0,t=(t-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function PN(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Ql(r,t,e,n,i,o,a,l){return(i-a)*(t-l)>=(r-a)*(o-l)&&(r-a)*(n-l)>=(e-a)*(t-l)&&(e-a)*(o-l)>=(i-a)*(n-l)}function bN(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!AN(r,t)&&(Hc(r,t)&&Hc(t,r)&&LN(r,t)&&(Re(r.prev,r,t.prev)||Re(r,t.prev,t))||td(r,t)&&Re(r.prev,r,r.next)>0&&Re(t.prev,t,t.next)>0)}function Re(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function td(r,t){return r.x===t.x&&r.y===t.y}function Hx(r,t,e,n){var i=nd(Re(r,t,e)),o=nd(Re(r,t,n)),a=nd(Re(e,n,r)),l=nd(Re(e,n,t));return!!(i!==o&&a!==l||i===0&&ed(r,e,t)||o===0&&ed(r,n,t)||a===0&&ed(e,r,n)||l===0&&ed(e,t,n))}function ed(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function nd(r){return r>0?1:r<0?-1:0}function AN(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Hx(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Hc(r,t){return Re(r.prev,r,r.next)<0?Re(r,t,r.next)>=0&&Re(r,r.prev,t)>=0:Re(r,t,r.prev)<0||Re(r,r.next,t)<0}function LN(r,t){var e=r,n=!1,i=(r.x+t.x)/2,o=(r.y+t.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&i<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function qx(r,t){var e=new qm(r.i,r.x,r.y),n=new qm(t.i,t.x,t.y),i=r.next,o=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,n.next=e,e.prev=n,o.next=n,n.prev=o,n}function Zx(r,t,e,n){var i=new qm(r,t,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function qc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function qm(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}$f.deviation=function(r,t,e,n){var i=t&&t.length,o=i?t[0]*e:r.length,a=Math.abs(Zm(r,0,o,e));if(i)for(var l=0,u=t.length;l<u;l++){var c=t[l]*e,h=l<u-1?t[l+1]*e:r.length;a-=Math.abs(Zm(r,c,h,e))}var f=0;for(l=0;l<n.length;l+=3){var d=n[l]*e,g=n[l+1]*e,p=n[l+2]*e;f+=Math.abs((r[d]-r[p])*(r[g+1]-r[d+1])-(r[d]-r[g])*(r[p+1]-r[d+1]))}return a===0&&f===0?0:Math.abs((f-a)/a)};function Zm(r,t,e,n){for(var i=0,o=t,a=e-n;o<e;o+=n)i+=(r[a]-r[o])*(r[o+1]+r[a+1]),a=o;return i}$f.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},n=0,i=0;i<r.length;i++){for(var o=0;o<r[i].length;o++)for(var a=0;a<t;a++)e.vertices.push(r[i][o][a]);i>0&&(n+=r[i-1].length,e.holes.push(n))}return e};const Kx=.985;function MN(r,t){t=t||[];const e=256,n=e-1;return t[0]=Math.floor(r/e/e/e)/n,t[1]=Math.floor(r/e/e)%e/n,t[2]=Math.floor(r/e)%e/n,t[3]=r%e/n,t}function NN(r){let t=0;const e=256,n=e-1;return t+=Math.round(r[0]*e*e*e*n),t+=Math.round(r[1]*e*e*n),t+=Math.round(r[2]*e*n),t+=Math.round(r[3]*n),t}function ON(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,h=v?t[0]*n:e.length,c=f(e,0,h,n,!0),g=[];if(!c||c.next===c.prev)return g;if(v&&(c=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x<i;x++)(u=f(e,t[x]*r,x<i-1?t[x+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),o.push(d(u));for(o.sort(p),x=0;x<o.length;x++)n=y(o[x],n);return n}(e,t,c,n)),e.length>80*n){r=i=e[0],x=u=e[1];for(var b=n;b<h;b+=n)(o=e[b])<r&&(r=o),(s=e[b+1])<x&&(x=s),o>i&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(c,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i<n;i+=r)u=P(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t<s&&(o++,r=r.nextZ);t++);for(f=s;o>0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=h(s(e),t,n),t,n,r,x,i,2):2===u&&c(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=x<i?x<u?x:u:i<u?i:u,l=o<f?o<s?o:s:f<s?f:s,v=x>i?x>u?x:u:i>u?i:u,h=o>f?o>s?o:s:f>s?f:s,c=r.next;c!==t;){if(c.x>=a&&c.x<=v&&c.y>=l&&c.y<=h&&M(x,o,i,f,u,s,c.x,c.y)&&w(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,h=o<f?o<s?o:s:f<s?f:s,c=a<l?a<v?a:v:l<v?l:v,p=o>f?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(h,c,t,n,r),d=b(p,y,t,n,r),Z=e.prevZ,m=e.nextZ;Z&&Z.z>=g&&m&&m.z<=d;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;if(Z=Z.prevZ,m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;Z&&Z.z>=g;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;m&&m.z<=d;){if(m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function h(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&z(x,i)&&z(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function c(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&Z(u,o)){var f=F(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x<r.next.x?r:r.next,o===x))return n}r=r.next}while(r!==t);if(!n)return null;var f,s=n,a=n.x,l=n.y,v=1/0;r=n;do{x>=r.x&&r.x>=a&&x!==r.x&&M(i<l?x:u,i,a,l,i<l?u:x,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(x-r.x),z(r,e)&&(f<v||f===v&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=F(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function M(e,t,n,r,x,i,u,o){return(x-u)*(t-o)>=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function Z(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(z(e,t)&&z(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||m(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=I(w(e,t,n)),i=I(w(e,t,r)),u=I(w(n,r,e)),o=I(w(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function z(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}function F(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}u.exports=o,u.exports.default=o,o.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(O(e,0,i,n));if(x)for(var o=0,f=t.length;o<f;o++){var s=t[o]*n,a=o<f-1?t[o+1]*n:e.length;u-=Math.abs(O(e,s,a,n))}var l=0;for(o=0;o<r.length;o+=3){var v=r[o]*n,h=r[o+1]*n,c=r[o+2]*n;l+=Math.abs((e[v]-e[c])*(e[h+1]-e[v+1])-(e[v]-e[h])*(e[c+1]-e[v+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},o.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n<s.length;n++)s[n]=e[t+2+n];let a=i?i.vertexPosition:0,l=i?i.indexPosition:0;const v=a/u;return T(n,a,o,f,0),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,1),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,2),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,3),s.length&&n.set(s,a+3),a+=u,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,S.vertexPosition=a,S.indexPosition=l,S}function k(e,t,n,x,i,u,o,f,s,a,l){const v=8+f.length,h=u.length/v,c=[e[t+0],e[t+1]],p=[e[n],e[n+1]],y=r(s,[...c]),g=r(s,[...p]);function b(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),x=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-x[1],x[0]],u=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/u,(n[1]-e[1])/u],f=0===r||0===u?0:Math.acos((s=o[0]*x[0]+o[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return o[0]*i[0]+o[1]*i[1]>0?f:2*Math.PI-f}let d=-1,M=-1,Z=l;const w=null!==i;if(null!==x){d=b(y,g,r(s,[...[e[x],e[x+1]]])),Math.cos(d)<=.985&&(Z+=Math.tan((d-Math.PI)/2))}if(w){M=b(g,y,r(s,[...[e[i],e[i+1]]])),Math.cos(M)<=.985&&(Z+=Math.tan((Math.PI-M)/2))}function m(e,t){return 0===t?1e4*e:Math.sign(t)*(1e4*e+Math.abs(t))}return u.push(c[0],c[1],p[0],p[1],d,M,a,m(0,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(1,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(2,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(3,l)),u.push(...f),o.push(h,h+1,h+2,h+1,h+3,h+2),{length:a+Math.sqrt((g[0]-y[0])*(g[0]-y[0])+(g[1]-y[1])*(g[1]-y[1])),angle:Z}}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t<f;t++)s+=e[u++],t<f-1&&(a[t]=s);const l=e.slice(u,u+2*s),v=N(l,a,2);for(let e=0;e<v.length;e++)r.push(v[e]+n.length/i);for(let e=0;e<l.length;e+=2)n.push(l[e],l[e+1],...o);return u+2*s}const j=self;j.onmessage=r=>{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e<x.length;e+=r)a=U(x,e,s,f,n,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:x.buffer},i);j.postMessage(l,[s.buffer,f.buffer,x.buffer]);break}case n:{const e=[],t=[],n=i.customAttributesSize,r=2,u=new Float32Array(i.renderInstructions);let o=0;const f=[1,0,0,1,0,0];let s,a;for(x(f,i.renderInstructionsTransform);o<u.length;){a=Array.from(u.slice(o,o+n)),o+=n,s=u[o++];const x=o,i=o+(s-1)*r,l=u[x]===u[i]&&u[x+1]===u[i+1];let v=0,h=0;for(let n=0;n<s-1;n++){let c=null;n>0?c=o+(n-1)*r:l&&(c=i-r);let p=null;n<s-2?p=o+(n+2)*r:l&&(p=x+r);const y=k(u,o+n*r,o+(n+1)*r,c,p,e,t,a,f,v,h);v=y.length,h=y.angle}o+=s*r}const l=Uint32Array.from(t),v=Float32Array.from(e),h=Object.assign({vertexBuffer:v.buffer,indexBuffer:l.buffer,renderInstructions:u.buffer},i);j.postMessage(h,[v.buffer,l.buffer,u.buffer]);break}case e:{const e=[],t=[],n=i.customAttributesSize,r=new Float32Array(i.renderInstructions);let x=0;for(;x<r.length;)x=G(r,x,e,t,n);const u=Uint32Array.from(t),o=Float32Array.from(e),f=Object.assign({vertexBuffer:o.buffer,indexBuffer:u.buffer,renderInstructions:r.buffer},i);j.postMessage(f,[o.buffer,u.buffer,r.buffer]);break}}};';return new Worker(typeof Blob>"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}function FN(r,t){const e=r.viewState.projection,i=t.getSource().getWrapX()&&e.canWrapX(),o=e.getExtent(),a=r.extent,l=i?Pt(o):null,u=i?Math.ceil((a[2]-o[2])/l)+1:1;return[i?Math.floor((a[0]-o[0])/l):0,u,l]}class DN extends gN{constructor(t,e){const n=e.uniforms||{},i=an();n[so.PROJECTION_MATRIX]=i,super(t,{uniforms:n,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new kx(Vm,Wm),this.indicesBuffer_=new kx(jm,Wm),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const o=e.attributes?e.attributes.map(function(l){return{name:"a_prop_"+l.name,size:1,type:oo.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:oo.FLOAT},{name:"a_index",size:1,type:oo.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_prop_hitColor",size:4,type:oo.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:oo.FLOAT})),this.attributes.push(...o),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=An(),this.currentTransform_=i,this.renderTransform_=an(),this.invertRenderTransform_=an(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=ON(),this.worker_.addEventListener("message",l=>{const u=l.data;if(u.type===Wx.GENERATE_POINT_BUFFERS){const c=u.projectionTransform;this.verticesBuffer_.fromArrayBuffer(u.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(u.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=c,Tp(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(l.data.renderInstructions),u.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[yt(a,Ke.ADDFEATURE,this.handleSourceFeatureAdded_,this),yt(a,Ke.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),yt(a,Ke.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),yt(a,Ke.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature(l=>{this.featureCache_[Z(l)]={feature:l,properties:l.getProperties(),geometry:l.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new mN(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[Z(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[Z(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[Z(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[n,i,o]=FN(t,this.getLayer());return this.renderWorlds(t,!1,n,i,o),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,n,i,o),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),n=e.getSource(),i=t.viewState,o=!t.viewHints[fe.ANIMATING]&&!t.viewHints[fe.INTERACTING],a=!Oo(this.previousExtent_,t.extent),l=this.sourceRevision_<n.getRevision();if(l&&(this.sourceRevision_=n.getRevision()),o&&(a||l)){const u=i.projection,c=i.resolution,h=e instanceof jc?e.getRenderBuffer():0,f=xr(t.extent,h*c);n.loadFeatures(f,c,u),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(t){const e=an();this.helper.makeProjectionTransform(t,e);const i=(this.hitDetectionEnabled_?7:2)+this.customAttributes.length,o=i*this.featureCount_;(!this.renderInstructions_||this.renderInstructions_.length!==o)&&(this.renderInstructions_=new Float32Array(o));let a,l;const u=[],c=[];let h=-1;for(const d in this.featureCache_)if(a=this.featureCache_[d],l=a.geometry,!(!l||l.getType()!=="Point")){if(u[0]=l.getFlatCoordinates()[0],u[1]=l.getFlatCoordinates()[1],We(e,u),this.renderInstructions_[++h]=u[0],this.renderInstructions_[++h]=u[1],this.hitDetectionEnabled_){const g=MN(h+5,c);this.renderInstructions_[++h]=g[0],this.renderInstructions_[++h]=g[1],this.renderInstructions_[++h]=g[2],this.renderInstructions_[++h]=g[3],this.renderInstructions_[++h]=Number(d)}for(let g=0;g<this.customAttributes.length;g++){const p=this.customAttributes[g].callback(a.feature,a.properties);this.renderInstructions_[++h]=p}}const f={id:++this.lastSentId,type:Wx.GENERATE_POINT_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesSize:i-2};f.projectionTransform=e,this.ready=!1,this.worker_.postMessage(f,[this.renderInstructions_.buffer]),this.renderInstructions_=null}forEachFeatureAtCoordinate(t,e,n,i,o){if(xt(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has been disabled using the `disableHitDetection: true` option."),!this.renderInstructions_||!this.hitDetectionEnabled_)return;const a=We(e.coordinateToPixelTransform,t.slice()),l=this.hitRenderTarget_.readPixel(a[0]/2,a[1]/2),u=[l[0]/255,l[1]/255,l[2]/255,l[3]/255],c=NN(u),h=this.renderInstructions_[c],f=Math.floor(h).toString(),g=this.getLayer().getSource().getFeatureByUid(f);if(g)return i(g,this.getLayer(),null)}renderWorlds(t,e,n,i,o){let a=n;this.helper.useProgram(this.program_,t),e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0)),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),U0(this.currentTransform_,a*o,0),ff(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.applyHitDetectionUniform(e);const l=this.indicesBuffer_.getSize();this.helper.drawElements(0,l)}while(++a<i)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(t){Ht(t)}),this.sourceListenKeys_=null,super.disposeInternal()}renderDeclutter(){}}const BN=DN;function Zc(r){const t=r.toString();return t.includes(".")?t:t+".0"}function GN(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(Zc).join(", ")})`}function Km(r){const t=Dl(r),e=t.length>3?t[3]:1;return GN([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}const Jm={};let kN=0;function zN(r){return r in Jm||(Jm[r]=kN++),Jm[r]}function $l(r){return Zc(zN(r))}function UN(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const tu=`#ifdef GL_FRAGMENT_PRECISION_HIGH
37
+ precision highp float;
38
+ #else
39
+ precision mediump float;
40
+ #endif
41
+ uniform mat4 u_projectionMatrix;
42
+ uniform mat4 u_screenToWorldMatrix;
43
+ uniform vec2 u_viewportSizePx;
44
+ uniform float u_pixelRatio;
45
+ uniform float u_globalAlpha;
46
+ uniform float u_time;
47
+ uniform float u_zoom;
48
+ uniform float u_resolution;
49
+ uniform float u_rotation;
50
+ uniform vec4 u_renderExtent;
51
+ uniform vec2 u_patternOrigin;
52
+ uniform float u_depth;
53
+ uniform mediump int u_hitDetection;
54
+
55
+ const float PI = 3.141592653589793238;
56
+ const float TWO_PI = 2.0 * PI;
57
+
58
+ // this used to produce an alpha-premultiplied color from a texture
59
+ vec4 samplePremultiplied(sampler2D sampler, vec2 texCoord) {
60
+ vec4 color = texture2D(sampler, texCoord);
61
+ return vec4(color.rgb * color.a, color.a);
62
+ }
63
+ `,eu=UN();class VN{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${Zc(eu["circle-radius"])} + ${Zc(eu["circle-stroke-width"]*.5)})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=Km(eu["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=Zc(eu["stroke-width"]),this.strokeColorExpression_=Km(eu["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=$l("round"),this.strokeJoinExpression_=$l("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=Km(eu["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}addUniform(t){return this.uniforms_.push(t),this}addAttribute(t){return this.attributes_.push(t),this}addVarying(t,e,n){return this.varyings_.push({name:t,type:e,expression:n}),this}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}getFragmentDiscardExpression(){return this.discardExpression_}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}getStrokeColorExpression(){return this.strokeColorExpression_}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}getFillColorExpression(){return this.fillColorExpression_}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${tu}
64
+ ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
65
+ `)}
66
+ attribute vec2 a_position;
67
+ attribute float a_index;
68
+ attribute vec4 a_prop_hitColor;
69
+ ${this.attributes_.map(function(t){return"attribute "+t+";"}).join(`
70
+ `)}
71
+ varying vec2 v_texCoord;
72
+ varying vec2 v_quadCoord;
73
+ varying vec4 v_prop_hitColor;
74
+ varying vec2 v_centerPx;
75
+ varying float v_angle;
76
+ varying vec2 v_quadSizePx;
77
+ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
78
+ `)}
79
+ ${this.vertexShaderFunctions_.join(`
80
+ `)}
81
+ vec2 pxToScreen(vec2 coordPx) {
82
+ vec2 scaled = coordPx / u_viewportSizePx / 0.5;
83
+ return scaled;
84
+ }
85
+
86
+ vec2 screenToPx(vec2 coordScreen) {
87
+ return (coordScreen * 0.5 + 0.5) * u_viewportSizePx;
88
+ }
89
+
90
+ void main(void) {
91
+ v_quadSizePx = ${this.symbolSizeExpression_};
92
+ vec2 halfSizePx = v_quadSizePx * 0.5;
93
+ vec2 centerOffsetPx = ${this.symbolOffsetExpression_};
94
+ vec2 offsetPx = centerOffsetPx;
95
+ if (a_index == 0.0) {
96
+ offsetPx -= halfSizePx;
97
+ } else if (a_index == 1.0) {
98
+ offsetPx += halfSizePx * vec2(1., -1.);
99
+ } else if (a_index == 2.0) {
100
+ offsetPx += halfSizePx;
101
+ } else {
102
+ offsetPx += halfSizePx * vec2(-1., 1.);
103
+ }
104
+ float angle = ${this.symbolRotationExpression_};
105
+ ${this.symbolRotateWithView_?"angle += u_rotation;":""}
106
+ float c = cos(-angle);
107
+ float s = sin(-angle);
108
+ offsetPx = vec2(c * offsetPx.x - s * offsetPx.y, s * offsetPx.x + c * offsetPx.y);
109
+ vec4 center = u_projectionMatrix * vec4(a_position, 0.0, 1.0);
110
+ gl_Position = center + vec4(pxToScreen(offsetPx), u_depth, 0.);
111
+ vec4 texCoord = ${this.texCoordExpression_};
112
+ float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;
113
+ float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;
114
+ v_texCoord = vec2(u, v);
115
+ v_prop_hitColor = a_prop_hitColor;
116
+ v_angle = angle;
117
+ c = cos(-v_angle);
118
+ s = sin(-v_angle);
119
+ centerOffsetPx = vec2(c * centerOffsetPx.x - s * centerOffsetPx.y, s * centerOffsetPx.x + c * centerOffsetPx.y);
120
+ v_centerPx = screenToPx(center.xy) + centerOffsetPx;
121
+ ${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
122
+ `)}
123
+ }`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${tu}
124
+ ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
125
+ `)}
126
+ varying vec2 v_texCoord;
127
+ varying vec4 v_prop_hitColor;
128
+ varying vec2 v_centerPx;
129
+ varying float v_angle;
130
+ varying vec2 v_quadSizePx;
131
+ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
132
+ `)}
133
+ ${this.fragmentShaderFunctions_.join(`
134
+ `)}
135
+
136
+ void main(void) {
137
+ if (${this.discardExpression_}) { discard; }
138
+ vec2 coordsPx = gl_FragCoord.xy / u_pixelRatio - v_centerPx; // relative to center
139
+ float c = cos(v_angle);
140
+ float s = sin(v_angle);
141
+ coordsPx = vec2(c * coordsPx.x - s * coordsPx.y, s * coordsPx.x + c * coordsPx.y);
142
+ gl_FragColor = ${this.symbolColorExpression_};
143
+ if (u_hitDetection > 0) {
144
+ if (gl_FragColor.a < 0.05) { discard; };
145
+ gl_FragColor = v_prop_hitColor;
146
+ }
147
+ }`:null}getStrokeVertexShader(){return this.hasStroke_?`${tu}
148
+ ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
149
+ `)}
150
+ attribute vec2 a_position;
151
+ attribute float a_index;
152
+ attribute vec2 a_segmentStart;
153
+ attribute vec2 a_segmentEnd;
154
+ attribute float a_parameters;
155
+ attribute float a_distance;
156
+ attribute vec2 a_joinAngles;
157
+ attribute vec4 a_prop_hitColor;
158
+ ${this.attributes_.map(function(t){return"attribute "+t+";"}).join(`
159
+ `)}
160
+ varying vec2 v_segmentStart;
161
+ varying vec2 v_segmentEnd;
162
+ varying float v_angleStart;
163
+ varying float v_angleEnd;
164
+ varying float v_width;
165
+ varying vec4 v_prop_hitColor;
166
+ varying float v_distanceOffsetPx;
167
+ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
168
+ `)}
169
+ ${this.vertexShaderFunctions_.join(`
170
+ `)}
171
+ vec2 worldToPx(vec2 worldPos) {
172
+ vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);
173
+ return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;
174
+ }
175
+
176
+ vec4 pxToScreen(vec2 pxPos) {
177
+ vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;
178
+ return vec4(screenPos, u_depth, 1.0);
179
+ }
180
+
181
+ bool isCap(float joinAngle) {
182
+ return joinAngle < -0.1;
183
+ }
184
+
185
+ vec2 getJoinOffsetDirection(vec2 normalPx, float joinAngle) {
186
+ float halfAngle = joinAngle / 2.0;
187
+ float c = cos(halfAngle);
188
+ float s = sin(halfAngle);
189
+ vec2 angleBisectorNormal = vec2(s * normalPx.x + c * normalPx.y, -c * normalPx.x + s * normalPx.y);
190
+ float length = 1.0 / s;
191
+ return angleBisectorNormal * length;
192
+ }
193
+
194
+ vec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) {
195
+ // if on a cap or the join angle is too high, offset the line along the segment normal
196
+ if (cos(joinAngle) > 0.998 || isCap(joinAngle)) {
197
+ return point - normal * offsetPx;
198
+ }
199
+ // offset is applied along the inverted normal (positive offset goes "right" relative to line direction)
200
+ return point - getJoinOffsetDirection(normal, joinAngle) * offsetPx;
201
+ }
202
+
203
+ void main(void) {
204
+ v_angleStart = a_joinAngles.x;
205
+ v_angleEnd = a_joinAngles.y;
206
+ float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5);
207
+ // we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45)
208
+ float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters);
209
+
210
+ float lineWidth = ${this.strokeWidthExpression_};
211
+ float lineOffsetPx = ${this.strokeOffsetExpression_};
212
+
213
+ // compute segment start/end in px with offset
214
+ vec2 segmentStartPx = worldToPx(a_segmentStart);
215
+ vec2 segmentEndPx = worldToPx(a_segmentEnd);
216
+ vec2 tangentPx = normalize(segmentEndPx - segmentStartPx);
217
+ vec2 normalPx = vec2(-tangentPx.y, tangentPx.x);
218
+ segmentStartPx = getOffsetPoint(segmentStartPx, normalPx, v_angleStart, lineOffsetPx),
219
+ segmentEndPx = getOffsetPoint(segmentEndPx, normalPx, v_angleEnd, lineOffsetPx);
220
+
221
+ // compute current vertex position
222
+ float normalDir = vertexNumber < 0.5 || (vertexNumber > 1.5 && vertexNumber < 2.5) ? 1.0 : -1.0;
223
+ float tangentDir = vertexNumber < 1.5 ? 1.0 : -1.0;
224
+ float angle = vertexNumber < 1.5 ? v_angleStart : v_angleEnd;
225
+ vec2 joinDirection;
226
+ vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx;
227
+ // if angle is too high, do not make a proper join
228
+ if (cos(angle) > ${Kx} || isCap(angle)) {
229
+ joinDirection = normalPx * normalDir - tangentPx * tangentDir;
230
+ } else {
231
+ joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle);
232
+ }
233
+ positionPx = positionPx + joinDirection * (lineWidth * 0.5 + 1.); // adding 1 pixel for antialiasing
234
+ gl_Position = pxToScreen(positionPx);
235
+
236
+ v_segmentStart = segmentStartPx;
237
+ v_segmentEnd = segmentEndPx;
238
+ v_width = lineWidth;
239
+ v_prop_hitColor = a_prop_hitColor;
240
+ v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum);
241
+ ${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
242
+ `)}
243
+ }`:null}getStrokeFragmentShader(){return this.hasStroke_?`${tu}
244
+ ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
245
+ `)}
246
+ varying vec2 v_segmentStart;
247
+ varying vec2 v_segmentEnd;
248
+ varying float v_angleStart;
249
+ varying float v_angleEnd;
250
+ varying float v_width;
251
+ varying vec4 v_prop_hitColor;
252
+ varying float v_distanceOffsetPx;
253
+ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
254
+ `)}
255
+ ${this.fragmentShaderFunctions_.join(`
256
+ `)}
257
+
258
+ vec2 pxToWorld(vec2 pxPos) {
259
+ vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;
260
+ return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;
261
+ }
262
+
263
+ bool isCap(float joinAngle) {
264
+ return joinAngle < -0.1;
265
+ }
266
+
267
+ float segmentDistanceField(vec2 point, vec2 start, vec2 end, float width) {
268
+ vec2 tangent = normalize(end - start);
269
+ vec2 normal = vec2(-tangent.y, tangent.x);
270
+ vec2 startToPoint = point - start;
271
+ return abs(dot(startToPoint, normal)) - width * 0.5;
272
+ }
273
+
274
+ float buttCapDistanceField(vec2 point, vec2 start, vec2 end) {
275
+ vec2 startToPoint = point - start;
276
+ vec2 tangent = normalize(end - start);
277
+ return dot(startToPoint, -tangent);
278
+ }
279
+
280
+ float squareCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {
281
+ return buttCapDistanceField(point, start, end) - width * 0.5;
282
+ }
283
+
284
+ float roundCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {
285
+ float onSegment = max(0., 1000. * dot(point - start, end - start)); // this is very high when inside the segment
286
+ return length(point - start) - width * 0.5 - onSegment;
287
+ }
288
+
289
+ float roundJoinDistanceField(vec2 point, vec2 start, vec2 end, float width) {
290
+ return roundCapDistanceField(point, start, end, width);
291
+ }
292
+
293
+ float bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {
294
+ vec2 startToPoint = point - start;
295
+ vec2 tangent = normalize(end - start);
296
+ float c = cos(joinAngle * 0.5);
297
+ float s = sin(joinAngle * 0.5);
298
+ float direction = -sign(sin(joinAngle));
299
+ vec2 bisector = vec2(c * tangent.x - s * tangent.y, s * tangent.x + c * tangent.y);
300
+ float radius = width * 0.5 * s;
301
+ return dot(startToPoint, bisector * direction) - radius;
302
+ }
303
+
304
+ float miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {
305
+ if (cos(joinAngle) > ${Kx}) { // avoid risking a division by zero
306
+ return bevelJoinField(point, start, end, width, joinAngle);
307
+ }
308
+ float miterLength = 1. / sin(joinAngle * 0.5);
309
+ float miterLimit = ${this.strokeMiterLimitExpression_};
310
+ if (miterLength > miterLimit) {
311
+ return bevelJoinField(point, start, end, width, joinAngle);
312
+ }
313
+ return -1000.;
314
+ }
315
+
316
+ float capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) {
317
+ if (capType == ${$l("butt")}) {
318
+ return buttCapDistanceField(point, start, end);
319
+ } else if (capType == ${$l("square")}) {
320
+ return squareCapDistanceField(point, start, end, width);
321
+ }
322
+ return roundCapDistanceField(point, start, end, width);
323
+ }
324
+
325
+ float joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) {
326
+ if (joinType == ${$l("bevel")}) {
327
+ return bevelJoinField(point, start, end, width, joinAngle);
328
+ } else if (joinType == ${$l("miter")}) {
329
+ return miterJoinDistanceField(point, start, end, width, joinAngle);
330
+ }
331
+ return roundJoinDistanceField(point, start, end, width);
332
+ }
333
+
334
+ float computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float capType, float joinType) {
335
+ if (isCap(joinAngle)) {
336
+ return capDistanceField(point, start, end, width, capType);
337
+ }
338
+ return joinDistanceField(point, start, end, width, joinAngle, joinType);
339
+ }
340
+
341
+ void main(void) {
342
+ vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio;
343
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
344
+ vec2 worldPos = pxToWorld(currentPoint);
345
+ if (
346
+ abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (
347
+ worldPos[0] < u_renderExtent[0] ||
348
+ worldPos[1] < u_renderExtent[1] ||
349
+ worldPos[0] > u_renderExtent[2] ||
350
+ worldPos[1] > u_renderExtent[3]
351
+ )
352
+ ) {
353
+ discard;
354
+ }
355
+ #endif
356
+ if (${this.discardExpression_}) { discard; }
357
+
358
+ float segmentLength = length(v_segmentEnd - v_segmentStart);
359
+ vec2 segmentTangent = (v_segmentEnd - v_segmentStart) / segmentLength;
360
+ vec2 segmentNormal = vec2(-segmentTangent.y, segmentTangent.x);
361
+ vec2 startToPoint = currentPoint - v_segmentStart;
362
+ float currentLengthPx = max(0., min(dot(segmentTangent, startToPoint), segmentLength)) + v_distanceOffsetPx;
363
+ float currentRadiusPx = abs(dot(segmentNormal, startToPoint));
364
+ float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width;
365
+ vec4 color = ${this.strokeColorExpression_} * u_globalAlpha;
366
+ float capType = ${this.strokeCapExpression_};
367
+ float joinType = ${this.strokeJoinExpression_};
368
+ float segmentStartDistance = computeSegmentPointDistance(currentPoint, v_segmentStart, v_segmentEnd, v_width, v_angleStart, capType, joinType);
369
+ float segmentEndDistance = computeSegmentPointDistance(currentPoint, v_segmentEnd, v_segmentStart, v_width, v_angleEnd, capType, joinType);
370
+ float distance = max(
371
+ segmentDistanceField(currentPoint, v_segmentStart, v_segmentEnd, v_width),
372
+ max(segmentStartDistance, segmentEndDistance)
373
+ );
374
+ distance = max(distance, ${this.strokeDistanceFieldExpression_});
375
+ gl_FragColor = color * smoothstep(0.5, -0.5, distance);
376
+ if (u_hitDetection > 0) {
377
+ if (gl_FragColor.a < 0.1) { discard; };
378
+ gl_FragColor = v_prop_hitColor;
379
+ }
380
+ }`:null}getFillVertexShader(){return this.hasFill_?`${tu}
381
+ ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
382
+ `)}
383
+ attribute vec2 a_position;
384
+ attribute vec4 a_prop_hitColor;
385
+ ${this.attributes_.map(function(t){return"attribute "+t+";"}).join(`
386
+ `)}
387
+ varying vec4 v_prop_hitColor;
388
+ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
389
+ `)}
390
+ ${this.vertexShaderFunctions_.join(`
391
+ `)}
392
+ void main(void) {
393
+ gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0);
394
+ v_prop_hitColor = a_prop_hitColor;
395
+ ${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
396
+ `)}
397
+ }`:null}getFillFragmentShader(){return this.hasFill_?`${tu}
398
+ ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
399
+ `)}
400
+ varying vec4 v_prop_hitColor;
401
+ ${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(`
402
+ `)}
403
+ ${this.fragmentShaderFunctions_.join(`
404
+ `)}
405
+ vec2 pxToWorld(vec2 pxPos) {
406
+ vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;
407
+ return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;
408
+ }
409
+
410
+ vec2 worldToPx(vec2 worldPos) {
411
+ vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);
412
+ return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;
413
+ }
414
+
415
+ void main(void) {
416
+ vec2 pxPos = gl_FragCoord.xy / u_pixelRatio;
417
+ vec2 pxOrigin = worldToPx(u_patternOrigin);
418
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
419
+ vec2 worldPos = pxToWorld(pxPos);
420
+ if (
421
+ abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (
422
+ worldPos[0] < u_renderExtent[0] ||
423
+ worldPos[1] < u_renderExtent[1] ||
424
+ worldPos[0] > u_renderExtent[2] ||
425
+ worldPos[1] > u_renderExtent[3]
426
+ )
427
+ ) {
428
+ discard;
429
+ }
430
+ #endif
431
+ if (${this.discardExpression_}) { discard; }
432
+ gl_FragColor = ${this.fillColorExpression_} * u_globalAlpha;
433
+ if (u_hitDetection > 0) {
434
+ if (gl_FragColor.a < 0.1) { discard; };
435
+ gl_FragColor = v_prop_hitColor;
436
+ }
437
+ }`:null}}const Vi={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},jN=["#00f","#0ff","#0f0","#ff0","#f00"];class WN extends jc{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(Vi.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:jN),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const n=t.weight?t.weight:"weight";typeof n=="string"?this.weightFunction_=function(i){return i.get(n)}:this.weightFunction_=n,this.setRenderOrder(null)}getBlur(){return this.get(Vi.BLUR)}getGradient(){return this.get(Vi.GRADIENT)}getRadius(){return this.get(Vi.RADIUS)}handleGradientChanged_(){this.gradient_=YN(this.getGradient())}setBlur(t){this.set(Vi.BLUR,t)}setGradient(t){this.set(Vi.GRADIENT,t)}setRadius(t){this.set(Vi.RADIUS,t)}createRenderer(){const t=new VN().addAttribute("float a_prop_weight").addVarying("v_prop_weight","float","a_prop_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_prop_weight)");return new BN(this,{className:this.getClassName(),attributes:[{name:"weight",callback:e=>{const n=this.weightFunction_(e);return n!==void 0?Oe(n,0,1):1}}],uniforms:{u_size:()=>(this.get(Vi.RADIUS)+this.get(Vi.BLUR))*2,u_blurSlope:()=>this.get(Vi.RADIUS)/Math.max(1,this.get(Vi.BLUR))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:`
438
+ precision mediump float;
439
+
440
+ uniform sampler2D u_image;
441
+ uniform sampler2D u_gradientTexture;
442
+ uniform float u_opacity;
443
+
444
+ varying vec2 v_texCoord;
445
+
446
+ void main() {
447
+ vec4 color = texture2D(u_image, v_texCoord);
448
+ gl_FragColor.a = color.a * u_opacity;
449
+ gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
450
+ gl_FragColor.rgb *= gl_FragColor.a;
451
+ }`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function YN(r){const n=ln(1,256),i=n.createLinearGradient(0,0,1,256),o=1/(r.length-1);for(let a=0,l=r.length;a<l;++a)i.addColorStop(a*o,r[a]);return n.fillStyle=i,n.fillRect(0,0,1,256),n.canvas}const XN=WN,HN={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},Jx={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class qN extends $E{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=an(),this.tileClipContexts_=null}prepareTile(t,e,n){let i;const o=t.getState();return(o===X.LOADED||o===X.ERROR)&&(this.updateExecutorGroup_(t,e,n),this.tileImageNeedsRender_(t)&&(i=!0)),i}getTile(t,e,n,i){const o=i.pixelRatio,a=i.viewState,l=a.resolution,u=a.projection,c=this.getLayer(),h=c.getSource().getTile(t,e,n,o,u),f=i.viewHints,d=!(f[fe.ANIMATING]||f[fe.INTERACTING]);return(d||!h.wantedResolution)&&(h.wantedResolution=l),this.prepareTile(h,o,u)&&(d||Date.now()-i.time<8)&&c.getRenderMode()!=="vector"&&this.renderTileImage_(h,i),super.getTile(t,e,n,i)}isDrawableTile(t){const e=this.getLayer();return super.isDrawableTile(t)&&(e.getRenderMode()==="vector"?Z(e)in t.executorGroups:t.hasContext(e))}getTileImage(t){return t.getImage(this.getLayer())}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,n){const i=this.getLayer(),o=i.getRevision(),a=i.getRenderOrder()||null,l=t.wantedResolution,u=t.getReplayState(i);if(!u.dirty&&u.renderedResolution===l&&u.renderedRevision==o&&u.renderedRenderOrder==a)return;const c=i.getSource(),h=!!i.getDeclutter(),f=c.getTileGrid(),g=c.getTileGridForProjection(n).getTileCoordExtent(t.wrappedTileCoord),p=c.getSourceTiles(e,n,t),m=Z(i);delete t.hitDetectionImageData[m],t.executorGroups[m]=[],u.dirty=!1;for(let y=0,E=p.length;y<E;++y){const _=p[y];if(_.getState()!=X.LOADED)continue;const v=_.tileCoord,x=f.getTileCoordExtent(v),w=Ks(g,x),I=xr(w,i.getRenderBuffer()*l,this.tmpExtent),C=Oo(x,w)?null:I,T=new Px(0,w,l,e),R=km(l,e),M=function(B,F){let V;const Y=B.getStyleFunction()||i.getStyleFunction();if(Y&&(V=Y(B,l)),V){const st=this.renderFeature(B,R,V,T,h,F);u.dirty=u.dirty||st}},P=_.getFeatures();a&&a!==u.renderedRenderOrder&&P.sort(a);for(let B=0,F=P.length;B<F;++B){const V=P[B];(!C||De(C,V.getGeometry().getExtent()))&&M.call(this,V,B)}const b=T.finish(),A=i.getRenderMode()!=="vector"&&h&&p.length===1?null:w,L=new Lx(A,l,e,c.getOverlaps(),b,i.getRenderBuffer(),!0);t.executorGroups[m].push(L)}u.renderedRevision=o,u.renderedRenderOrder=a,u.renderedResolution=l}forEachFeatureAtCoordinate(t,e,n,i,o){const a=e.viewState.resolution,l=e.viewState.rotation;n=n??0;const u=this.getLayer(),h=u.getSource().getTileGridForProjection(e.viewState.projection),f=bn([t]);xr(f,a*n,f);const d={},g=function(y,E,_){let v=y.getId();v===void 0&&(v=Z(y));const x=d[v];if(x){if(x!==!0&&_<x.distanceSq){if(_===0)return d[v]=!0,o.splice(o.lastIndexOf(x),1),i(y,u,E);x.geometry=E,x.distanceSq=_}}else{if(_===0)return d[v]=!0,i(y,u,E);o.push(d[v]={feature:y,layer:u,geometry:E,distanceSq:_,callback:i})}},p=this.renderedTiles;let m;for(let y=0,E=p.length;!m&&y<E;++y){const _=p[y],v=h.getTileCoordExtent(_.wrappedTileCoord);if(!De(v,f))continue;const x=Z(u),w=[_.executorGroups[x]],I=u.getDeclutter();w.some(C=>{const T=I?e.declutter[I].all().map(R=>R.value):null;for(let R=0,M=C.length;R<M;++R)if(m=C[R].forEachFeatureAtCoordinate(t,a,l,n,g,T),m)return!0})}return m}getFeatures(t){return new Promise((e,n)=>{const i=this.getLayer(),o=Z(i),a=i.getSource(),l=this.renderedProjection,u=l.getExtent(),c=this.renderedResolution,h=a.getTileGridForProjection(l),f=We(this.renderedPixelToCoordinateTransform_,t.slice()),d=h.getTileCoordForCoordAndResolution(f,c);let g;for(let v=0,x=this.renderedTiles.length;v<x;++v)if(d.toString()===this.renderedTiles[v].tileCoord.toString()){if(g=this.renderedTiles[v],g.getState()===X.LOADED){const w=h.getTileCoordExtent(g.tileCoord);a.getWrapX()&&l.canWrapX()&&!ri(u,w)&&pp(f,l);break}g=void 0}if(!g||g.loadingSourceTiles>0){e([]);return}const p=h.getTileCoordExtent(g.wrappedTileCoord),m=wr(p),y=[(f[0]-m[0])/c,(m[1]-f[1])/c],E=g.getSourceTiles().reduce(function(v,x){return v.concat(x.getFeatures())},[]);let _=g.hitDetectionImageData[o];if(!_){const v=zn(h.getTileSize(h.getZForResolution(c,a.zDirection))),x=this.renderedRotation_,w=[this.getRenderTransform(h.getTileCoordCenter(g.wrappedTileCoord),c,0,zr,v[0]*zr,v[1]*zr,0)];_=Mx(v,w,E,i.getStyleFunction(),h.getTileCoordExtent(g.wrappedTileCoord),g.getReplayState(i).renderedResolution,x),g.hitDetectionImageData[o]=_}e(Nx(y,E,_))})}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t,e){const n=this.context,i=n.globalAlpha;n.globalAlpha=e.opacity;const o=t.viewHints,a=!(o[fe.ANIMATING]||o[fe.INTERACTING]),l=this.renderedTiles;for(let u=0,c=l.length;u<c;++u){const h=l[u],f=h.executorGroups[Z(this.getLayer())],d=this.getLayer().getDeclutter();if(f)for(let g=f.length-1;g>=0;--g)f[g].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(h,t),t.viewState.rotation,a,qf,d?t.declutter[d]:void 0)}n.globalAlpha=i}renderDeferredInternal(t){const n=this.renderedTiles.reduce((l,u,c)=>(u.executorGroups[Z(this.getLayer())].forEach(h=>l.push({executorGroup:h,index:c})),l),[]),i=n.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,u=n.length;l<u;++l){const c=n[l].executorGroup.getDeferredZIndexContexts();for(const h in c)o[h]=!0}Object.keys(o).sort(hs).map(Number).forEach(l=>{i.forEach((u,c)=>{u[l]&&(u[l].forEach(h=>{const{executorGroup:f,index:d}=n[c],g=f.getRenderedContext(),p=g.globalAlpha;g.globalAlpha=this.renderedOpacity_;const m=this.tileClipContexts_[d];m&&m.draw(g),h.draw(g),m&&g.restore(),g.globalAlpha=p,h.clear()}),u[l].length=0)})})}getTileRenderTransform(t,e){const n=e.pixelRatio,i=e.viewState,o=i.center,a=i.resolution,l=i.rotation,u=e.size,c=Math.round(u[0]*n),h=Math.round(u[1]*n),d=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),g=t.tileCoord,p=d.getTileCoordExtent(t.wrappedTileCoord),m=d.getTileCoordExtent(g,this.tmpExtent)[0]-p[0];return ff(Ip(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(o,a,l,n,c,h,m))}postRender(t,e){var x;const n=e.viewHints,i=!(n[fe.ANIMATING]||n[fe.INTERACTING]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const o=this.getLayer(),a=o.getRenderMode(),l=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const u=o.getDeclutter(),c=u?Jx[a].filter(w=>!qf.includes(w)):Jx[a],h=e.viewState,f=h.rotation,d=o.getSource(),p=d.getTileGridForProjection(h.projection).getZForResolution(h.resolution,d.zDirection),m=this.renderedTiles,y=[],E=[],_=[];let v=!0;for(let w=m.length-1;w>=0;--w){const I=m[w];v=v&&!I.getReplayState(o).dirty;const C=I.executorGroups[Z(o)].filter(L=>L.hasExecutors(c));if(C.length===0)continue;const T=this.getTileRenderTransform(I,e),R=I.tileCoord[0];let M=!1;const P=C[0].getClipCoords(T);let b=t,A;if(P){A=new Xp,b=A.getContext();for(let L=0,B=y.length;L<B;++L)if(p!==R&&R<E[L]){const F=y[L];De([P[0],P[3],P[4],P[7]],[F[0],F[3],F[4],F[7]])&&(M||(b.save(),M=!0),b.beginPath(),b.moveTo(P[0],P[1]),b.lineTo(P[2],P[3]),b.lineTo(P[4],P[5]),b.lineTo(P[6],P[7]),b.moveTo(F[6],F[7]),b.lineTo(F[4],F[5]),b.lineTo(F[2],F[3]),b.lineTo(F[0],F[1]),b.clip())}y.push(P),E.push(R)}for(let L=0,B=C.length;L<B;++L)C[L].execute(t,[t.canvas.width,t.canvas.height],T,f,i,c,(x=e.declutter)==null?void 0:x[u]);M&&(b===t?b.restore():_[w]=A)}t.globalAlpha=l,this.ready=v,this.tileClipContexts_=_,e.declutter||this.renderDeferredInternal(e),super.postRender(t,e)}renderFeature(t,e,n,i,o,a){if(!n)return!1;let l=!1;if(Array.isArray(n))for(let u=0,c=n.length;u<c;++u)l=Zf(i,t,n[u],e,this.boundHandleStyleImageChange_,void 0,o,a)||l;else l=Zf(i,t,n,e,this.boundHandleStyleImageChange_,void 0,o,a);return l}tileImageNeedsRender_(t){const e=this.getLayer();if(e.getRenderMode()==="vector")return!1;const n=t.getReplayState(e),i=e.getRevision(),o=t.wantedResolution;return n.renderedTileResolution!==o||n.renderedTileRevision!==i}renderTileImage_(t,e){const n=this.getLayer(),i=t.getReplayState(n),o=n.getRevision(),a=t.executorGroups[Z(n)];i.renderedTileRevision=o;const l=t.wrappedTileCoord,u=l[0],c=n.getSource();let h=e.pixelRatio;const d=e.viewState.projection,g=c.getTileGridForProjection(d),p=g.getResolution(t.tileCoord[0]),m=e.pixelRatio/t.wantedResolution*p,y=g.getResolution(u),E=t.getContext(n);h=Math.round(Math.max(h,m/h));const _=c.getTilePixelSize(u,h,d);E.canvas.width=_[0],E.canvas.height=_[1];const v=h/m;if(v!==1){const C=z0(this.tmpTransform_);Ip(C,v,v),E.setTransform.apply(E,C)}const x=g.getTileCoordExtent(l,this.tmpExtent),w=m/y,I=z0(this.tmpTransform_);Ip(I,w,-w),U0(I,-x[0],-x[3]);for(let C=0,T=a.length;C<T;++C)a[C].execute(E,[E.canvas.width*v,E.canvas.height*v],I,0,!0,HN[n.getRenderMode()],null);i.renderedTileResolution=t.wantedResolution}}const ZN=qN;class KN extends jc{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un;const n=t.renderMode||"hybrid";xt(n=="hybrid"||n=="vector","`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=n,this.setPreload(t.preload?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new ZN(this)}getFeatures(t){return super.getFeatures(t)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(jo.PRELOAD)}getUseInterimTilesOnError(){return this.get(jo.USE_INTERIM_TILES_ON_ERROR)}setPreload(t){this.set(jo.PRELOAD,t)}setUseInterimTilesOnError(t){this.set(jo.USE_INTERIM_TILES_ON_ERROR,t)}}const rd=KN,JN={arrayMax:r=>Math.max(...r),arrayMin:r=>Math.min(...r),chunk:(r,t)=>Array.from({length:Math.ceil(r.length/t)},(e,n)=>r.slice(n*t,n*t+t)),compact:r=>r.filter(Boolean),countOccurrences:(r,t)=>r.reduce((e,n)=>n===t?e+1:e+0,0),difference:(r,t)=>{const e=new Set(t);return r.filter(n=>!e.has(n))},distinctValuesOfArray:r=>[...new Set(r)],dropElements:(r,t)=>{for(;r.length>0&&!t(r[0]);)r.shift();return r},everyNth:(r,t)=>r.filter((e,n)=>n%t===0),filterNonUnique:r=>r.filter(t=>r.indexOf(t)===r.lastIndexOf(t)),flatten:r=>r.reduce((t,e)=>t.concat(e),[]),head:r=>r[0],initial:r=>r.slice(0,-1),initializeArrayWithRange:(r,t=0)=>Array.from({length:r-t}).map((e,n)=>n+t),initializeArrayWithValues:(r,t=0)=>Array(r).fill(t),intersection:(r,t)=>{const e=new Set(t);return r.filter(n=>e.has(n))},last:r=>r[r.length-1],mapObject:(r,t)=>(e=>(e=[r,r.map(t)],e[0].reduce((n,i,o)=>(n[i]=e[1][o],n),{})))(),nthElement:(r,t=0)=>(t>0?r.slice(t,t+1):r.slice(t))[0],pick:(r,t)=>t.reduce((e,n)=>(n in r&&(e[n]=r[n]),e),{}),pull:(r,...t)=>{const e=r.filter((n,i)=>!t.includes(n));r.length=0,e.forEach(n=>r.push(n))},remove:(r,t)=>Array.isArray(r)?r.filter(t).reduce((e,n)=>(r.splice(r.indexOf(n),1),e.concat(n)),[]):[],sample:r=>r[Math.floor(Math.random()*r.length)],shuffle:r=>r.sort(()=>Math.random()-.5),similarity:(r,t)=>r.filter(e=>t.includes(e)),symmetricDifference:(r,t)=>{const e=new Set(r),n=new Set(t);return[...r.filter(i=>!n.has(i)),...t.filter(i=>!e.has(i))]},tail:r=>r.length>1?r.slice(1):r,take:(r,t=1)=>r.slice(0,t),takeRight:(r,t=1)=>r.slice(r.length-t,r.length),union:(r,t)=>Array.from(new Set([...r,...t])),without:(r,...t)=>r.filter(e=>!t.includes(e)),zip:(...r)=>{const t=Math.max(...r.map(e=>e.length));return Array.from({length:t}).map((e,n)=>Array.from({length:r.length},(i,o)=>r[o][n]))},removeArrayItem:function(r,t){for(var e=0;e<r.length;)r[e]==t?r.splice(e,1):e++;return r},contains:function(r,t){for(var e=r.length;e--;)if(r[e]===t)return!0;return!1},bottomVisible:()=>document.documentElement.clientHeight+window.scrollY>=document.documentElement.scrollHeight||document.documentElement.clientHeight,currentURL:()=>window.location.href,elementIsVisibleInViewport:(r,t=!1)=>{const{top:e,left:n,bottom:i,right:o}=r.getBoundingClientRect();return t?(e>0&&e<innerHeight||i>0&&i<innerHeight)&&(n>0&&n<innerWidth||o>0&&o<innerWidth):e>=0&&n>=0&&i<=innerHeight&&o<=innerWidth},getScrollPosition:(r=window)=>({x:r.pageXOffset!==void 0?r.pageXOffset:r.scrollLeft,y:r.pageYOffset!==void 0?r.pageYOffset:r.scrollTop}),getURLParameters:r=>r.match(/([^?=&]+)(=([^&]*))/g).reduce((t,e)=>(t[e.slice(0,e.indexOf("="))]=e.slice(e.indexOf("=")+1),t),{}),redirect:(r,t=!0)=>t?window.location.href=r:window.location.replace(r),scrolllToTop:()=>{const r=document.documentElement.scrollTop||document.body.scrollTop;r>0&&(window.requestAnimationFrame(scrollToTop),window.scrollTo(0,r-r/8))},ISODateString:r=>(pad=t=>t<10?"0"+t:t,r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())+"Z"),getDayDiffBetweenDates:(r,t)=>(t-r)/(1e3*3600*24),JSONToDate:r=>{const t=new Date(parseInt(r.toString().substr(6)));return`${t.getDate()}/${t.getMonth()+1}/${t.getFullYear()}`},toEnglishDate:r=>{try{return new Date(r).toISOString().split("T")[0].replace(/-/g,"/")}catch{return}},chainAsync:r=>{let t=0;const e=()=>r[t++](e);e()},compose:(...r)=>r.reduce((t,e)=>(...n)=>t(e(...n))),curry:function(r){var t=Array.prototype.slice.call(arguments,1);return function(){var e=Array.prototype.slice.call(arguments),n=t.concat(e);return r.apply(null,n)}},functionName:r=>(console.debug(r,name),r),pipeFunctions:(...r)=>r.reduce((t,e)=>(...n)=>e(t(...n))),promisify:r=>(...t)=>new Promise((e,n)=>r(...t,(i,o)=>i?n(i):e(o))),runPromisesInSeries:r=>r.reduce((t,e)=>t.then(e),Promise.resolve()),sleep:r=>new Promise(t=>setTimeout(t,r)),generateRandom:(r,t)=>{var e=t-r+1;return Math.floor(Math.random()*e+r)},arrayAverage:r=>r.reduce((t,e)=>t+e,0)/r.length,arraySum:r=>r.reduce((t,e)=>t+e,0),collatz:r=>r%2==0?r/2:3*r+1,digitize:r=>[...""+r].map(t=>parseInt(t)),distance:(r,t,e,n)=>Math.hypot(e-r,n-t),fibonacci:r=>Array(r).fill(0).reduce((t,e,n)=>t.concat(n>1?t[n-1]+t[n-2]:n),[]),gcd:(r,t)=>(_gcd=(e,n)=>n?_gcd(n,e%n):e,_gcd(r,t)),hammingDistance:(r,t)=>((r^t).toString(2).match(/1/g)||"").length,isDivisible:(r,t)=>r%t===0,isEven:r=>r%2===0,lcm:(r,t)=>{const e=(n,i)=>i?e(i,n%i):n;return Math.abs(r*t)/e(r,t)},median:r=>{const t=Math.floor(r.length/2),e=r.sort((n,i)=>n-i);return r.length%2!==0?e[t]:(e[t-1]+e[t])/2},palindrome:r=>{const t=r.toLowerCase().replace(/[\W]/g,"");return t===t.split("").reverse().join("")},percentile:(r,t)=>100*r.reduce((e,n)=>e+(n<t?1:0)+(n===t?.5:0),0)/r.length,powerset:r=>r.reduce((t,e)=>t.concat(t.map(n=>[e].concat(n))),[[]]),randomIntegerInRange:(r,t)=>Math.floor(Math.random()*(t-r+1))+r,randomNumberInRange:(r,t)=>Math.random()*(t-r)+r,round:(r,t=0)=>+`${Math.round(`${r}e${t}`)}e-${t}`,speechSynthesis:r=>{const t=new SpeechSynthesisUtterance(r);t.voice=window.speechSynthesis.getVoices()[0],window.speechSynthesis.speak(t)},hasClass:function(r,t){return r.className?r.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)")):!1},cleanObj:(r,t=[],e)=>{const n=r,i=t,o=e;return _cleanObj=(a,l=[],u)=>{Object.keys(a).forEach(c=>{c===u?_cleanObj(a[c],l,u):l.includes(c)||delete a[c]})},_cleanObj(n,i,o)},objectFromPairs:r=>r.reduce((t,e)=>(t[e[0]]=e[1],t),{}),objectToPairs:r=>Object.keys(r).map(t=>[t,r[t]]),shallowClone:r=>Object.assign({},r),truthCheckCollection:(r,t)=>r.every(e=>e[t]),trim:function(r){return r.replace(/^\s+|\s+$/g,"")},ltrim:function(r){return r.replace(/^\s+/,"")},rtrim:function(r){return r.replace(/\s+$/,"")},truncate:function(r,t){return r.length>t&&(r=r.substring(0,t)),r},onlyLetters:function(r){return r.toLowerCase().replace(/[^a-z]/g,"")},onlyLettersNums:function(r){return r.toLowerCase().replace(/[^a-z,0-9]/g,"")},anagrams:r=>(_anagrams=t=>t.length<=2?t.length===2?[t,t[1]+t[0]]:[t]:t.split("").reduce((e,n,i)=>e.concat(_anagrams(t.slice(0,i)+t.slice(i+1)).map(o=>n+o)),[]),s=r,_anagrams(s)),capitalize:([r,...t],e=!1)=>r.toUpperCase()+(e?t.join("").toLowerCase():t.join("")),capitalizeEveryWord:r=>r.replace(/\b[a-z]/g,t=>t.toUpperCase()),escapeRegExp:r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),fromCamelCase:(r,t="_")=>r.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+t+"$2").toLowerCase(),reverseString:r=>[...r].reverse().join(""),sortCharactersInString:r=>r.split("").sort((t,e)=>t.localeCompare(e)).join(""),toCamelCase:r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,e,n,i)=>n?n.toUpperCase():e.toLowerCase()),truncateString:(r,t)=>r.length>t?r.slice(0,t>3?t-3:t)+"...":r,isNumber:function(r){return!isNaN(parseFloat(r))&&isFinite(r)},isArray:function(r){return Object.prototype.toString.call(r)=="[object Array]"},isFunction:function(r){return Object.prototype.toString.call(r)=="[object Function]"},isRegExp:function(r){return Object.prototype.toString.call(r)=="[object RegExp]"},isString:r=>Object.prototype.toString.call(r)=="[object String]",isBoolean:r=>Object.prototype.toString.call(r)=="[object Boolean]",isSymbol:r=>Object.prototype.toString.call(r)=="[object Symbol]",maxNum:r=>Math.max.apply(Math,r),minNum:r=>Math.max.apply(Math,r),coalesce:(...r)=>r.find(t=>![void 0,null].includes(t)),coalesceFactory:r=>(...t)=>t.find(r),extendHex:r=>{_extendHex=e=>e.length<=4?"#"+e.slice(e.startsWith("#")?1:0).split("").map(n=>n+n).join(""):r;const t=r;return _extendHex(t)},gettype:r=>r===void 0?"undefined":r===null?"null":r.constructor.name.toLowerCase(),hexToRGB:r=>{const t=n=>"#"+n.slice(n.startsWith("#")?1:0).split("").map(i=>i+i).join(""),e=r.slice(r.startsWith("#")?1:0).length===3?t(r):r;return`rgb(${parseInt(e.slice(1),16)>>16}, ${(parseInt(e.slice(1),16)&65280)>>8}, ${parseInt(e.slice(1),16)&255})`},RGBToHex:(r,t,e)=>((r<<16)+(t<<8)+e).toString(16).padStart(6,"0"),timeTaken:r=>{console.time("timeTaken");const t=r();return console.timeEnd("timeTaken"),t},toOridinalSuffix:r=>{const t=parseInt(r),e=[t%10],n=["st","nd","rd","th"],i=[1,2,3,4],o=[11,12,13,14,15,16,17,18,19];return i.includes(e[0])&&!o.includes(e[1])?t+n[e[0]-1]:t+n[3]},UUIDGenerator:()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16)),validateEmail:r=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)},Za=r=>Object.prototype.toString.call(r).slice(8,-1);function QN(r){return Za(r)==="Array"}function Qx(r){return Za(r)==="Object"}function $N(r){return Za(r)==="String"}function tO(r){return Za(r)==="Number"&&r===r}function eO(r){return Za(r)==="RegExp"}function nO(r){return Za(r)==="File"}function rO(r){return Za(r)==="Blob"}function iO(r){return r===void 0}function Qm(r){return typeof r=="function"}function sO(r){return Qx(r)&&Object.keys(r).length===0}const oO=Object.freeze(Object.defineProperty({__proto__:null,isArray:QN,isBlob:rO,isEmptyObject:sO,isFile:nO,isFunction:Qm,isNumber:tO,isObject:Qx,isRegExp:eO,isString:$N,isUndefined:iO},Symbol.toStringTag,{value:"Module"}));function aO(r){return/^(https?:|mailto:|tel:)/.test(r)}function lO(r){return["admin","editor"].indexOf(r.trim())>=0}function uO(r){return/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(r)}function cO(r){return/^[a-z]+$/.test(r)}function hO(r){return/^[A-Z]+$/.test(r)}function fO(r){return/^[A-Za-z]+$/.test(r)}function dO(r){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)}function nu(r){return typeof r=="string"||r instanceof String}function gO(r){return typeof Array.isArray>"u"?Object.prototype.toString.call(r)==="[object Array]":Array.isArray(r)}const pO=Object.freeze(Object.defineProperty({__proto__:null,isArray:gO,isExternal:aO,isString:nu,validAlphabets:fO,validEmail:dO,validLowerCase:cO,validURL:uO,validUpperCase:hO,validUsername:lO},Symbol.toStringTag,{value:"Module"}));function mO(r){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=r,document.getElementsByTagName("head")[0].appendChild(t)}function yO(r,t){const e=new RegExp(`(^|&)${t}=([^&]*)(&|$)`,"i"),n=r.split("?")[1].match(e);return n!=null?decodeURI(n[2]):null}function _O(r=[],t="id"){const e={};for(let i=0;i<r.length;i++){const o=r[i];e[o[t]]?e[o[t]].push(o):e[o[t]]=[o]}const n=[];return Object.keys(e).forEach(i=>{n.push({id:i,data:e[i]})}),n}function $x(r,t){if(!(!r||!r.length))for(let e=0;e<r.length;e++){const n=r[e],i=JSON.parse(JSON.stringify(n));i.children=void 0,t.push(i),$x(n.children,t)}}function vO(r){let t=r.split("?");if(t.length>1){let e={};return t[1].split("&").forEach(i=>{let o=i.split("="),a=i.indexOf("=");e[o[0]]=i.substring(a+1)}),e}else return{}}function EO(r,t){return Math.floor(Math.random()*(t-r)+r)}function xO(r,t){return Math.random()*(t-r)+r}function wO(r){let t=r.split(/[(\r\n)\r\n]+/);return t.forEach((e,n)=>{e||snsArr.splice(n,1)}),t}function SO(r){const t=[];for(const e in r)if(Object.hasOwnProperty.call(r,e)){const n=r[e];typeof n!="object"&&t.push({label:e,value:n})}return t}function sd(r={}){if(typeof r!="object"||r===null)return r;let t;r instanceof Array?t=[]:t={};for(const e in r)r.hasOwnProperty(e)&&(t[e]=sd(r[e]));return t}function CO(r,t="uid",e="children"){for(let n=0;n<r.length;n++){let i=r[n];i[t]="id_"+parseInt(Math.random()*1e13),i.children&&Array.loopTree(i.children)}}function IO(r=0,t=100){var e=t-r,n=Math.random(),i=r+Math.round(n*e);return i}function TO(r){return r===null||typeof r>"u"}function RO(r,t,e){t&&e&&!r.includes(t)?r.push(t):e||t1(r,t)}function t1(r,t){for(var e=0;e<r.length;)r[e]==t?r.splice(e,1):e++;return r}function PO(r){let t=r.map(JSON.stringify);return[...new Set(t)].map(JSON.parse)}function bO(){return`rgba(${parseInt(Math.random()*255)},${parseInt(Math.random()*255)},${parseInt(Math.random()*255)})`}function AO(r=1){let t=Math.floor(Math.random()*256),e=Math.floor(Math.random()*256),n=Math.floor(Math.random()*256);return`rgba(${t},${e},${n},${r})`}function LO(r){let t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];if(r){let e="#";for(let n=0;n<6;n++){let i=Math.floor(Math.random()*t.length);e+=t[i]}return e}else{let e=Math.floor(Math.random()*256),n=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return`rgb(${e},${n},${i})`}}const MO=Object.freeze(Object.defineProperty({__proto__:null,csv2Array:wO,deepClone:sd,getQueryValueByUrl:yO,getRandomColor:LO,getRandomFloatNumberByRange:xO,getRandomIntNumberByRange:EO,getRandomNum:IO,getRandomRgb:bO,getRandomRgba:AO,groupBy:_O,isNullOrUndifiend:TO,loadStyles:mO,object2Array:SO,parasUrlParams2Obj:vO,pushNoReapeat:RO,removeArrayItem:t1,removeRepeat:PO,setUuidForTree:CO,tree2list:$x},Symbol.toStringTag,{value:"Module"}));function NO(r=30,t=["04:00 - 24:00"]){let e=t,n=new Date().getFullYear(),i=new Date().getMonth()+1,o=new Date().getDate(),a=[],l=[];for(let h=0,f=e.length;h<f;h++){let[d,g]=e[h].split("-");a.push(new Date(n+"/"+i+"/"+o+" "+d)),l.push(new Date(n+"/"+i+"/"+o+" "+g))}let u=[];function c(h){return h<10?"0"+h:h}for(let h=0,f=a.length;h<f;h++){let d=(l[h].getTime()-a[h].getTime())/(r*60*1e3);for(let g=0;g<d;g++)if(a[h].getTime()+r*60*1e3<=l[h].getTime()){let p=new Date(a[h].getTime()+r*60*1e3*g),m=new Date(a[h].getTime()+r*60*1e3*(g+1));u.push([c(p.getHours())+":"+c(p.getMinutes()),c(m.getHours())+":"+c(m.getMinutes())])}}return u=u.map(h=>h[0]),u}function OO(r,t){if(!r)return console.log("util_date:传入时间参数为空"),"";if(!t)return console.log("util_date:传入格式化参数为空"),"";typeof r=="number"&&(r=new Date(r));let e=t;const n=["日","一","二","三","四","五","六"];return e=e.replace(/yyyy|YYYY/,r.getFullYear()),e=e.replace(/yy|YY/,r.getYear()%100>9?(r.getYear()%100).toString():`0${r.getYear()%100}`),e=e.replace(/MM/,r.getMonth()+1<10?`0${r.getMonth()+1}`:r.getMonth()+1),e=e.replace(/M/g,r.getMonth()),e=e.replace(/w|W/g,n[r.getDay()]),e=e.replace(/dd|DD/,r.getDate()>9?r.getDate().toString():`0${r.getDate()}`),e=e.replace(/d|D/g,r.getDate()),e=e.replace(/hh|HH/,r.getHours()>9?r.getHours().toString():`0${r.getHours()}`),e=e.replace(/h|H/g,r.getHours()),e=e.replace(/mm/,r.getMinutes()>9?r.getMinutes().toString():`0${r.getMinutes()}`),e=e.replace(/m/g,r.getMinutes()),e=e.replace(/ss|SS/,r.getSeconds()>9?r.getSeconds().toString():`0${r.getSeconds()}`),e=e.replace(/s|S/g,r.getSeconds()),e}function FO(r,t=!1){let e=Object.prototype.toString.call(r),n=null;if(e=="[object Date]")n=new Date(r);else if(e=="[object String]")if(/^\d+$/.test(r)){let o=parseInt(r),a=r.length==10?o*1e3:o;n=new Date(a)}else{let o=new Date(r).getTime();o!=null&&o!=null&&!isNaN(o)&&(n=new Date(o))}else if(e=="[object Number]"){let i=r.toString().length==10?r*1e3:r;n=new Date(i)}return n==null&&!t&&(n=new Date),n}function DO(r,t){var e=new Date(r),n=function(i){return(i<10?"0":"")+i};return t.replace(/yyyy| MM| dd| HH| mm| ss/g,function(i){switch(i){case"yyyy":return n(e.getFullYear());case"MM":return n(e.getMonth()+1);case"mm":return n(e.getMinutes());case"dd":return n(e.getDate());case"HH":return n(e.getHours());case"ss":return n(e.getSeconds())}})}function BO(r,t,e,n){let i=864e5;e=="H"&&(i=36e5),typeof t=="string"&&(t=new Date(t));let o=t||new Date;o=new Date(o.getTime()+i*r);const a=o.getFullYear();let l=o.getMonth()+1;l=l<10?`0${l}`:l;let u=o.getDate();u=u<10?`0${u}`:u;let c=o.getHours();c=c<10?`0${c}`:c;let h=o.getMinutes();h=h<10?`0${h}`:h;let f=o.getSeconds();return f=f<10?`0${f}`:f,n=="yyyy-MM-dd HH:mm:ss"?`${a}-${l}-${u} ${c}:${h}:${f}`:n=="yyyy-MM-dd HH:mm"?`${a}-${l}-${u} ${c}:${h}`:n=="yyyy-MM-dd"?`${a}-${l}-${u}`:`${a}-${l}-${u} ${c}:${h}:${f}`}const GO=Object.freeze(Object.defineProperty({__proto__:null,CustomTimeSegment:NO,convertAnyToDate:FO,dateFormat:OO,formatDateTimeCount:BO,timestamp2String:DO},Symbol.toStringTag,{value:"Module"}));function od(){let r=[],t="0123456789abcdefghijk";for(let e=0;e<36;e++)r[e]=t.substr(Math.floor(Math.random()*16),1);return r[14]="4",r[19]=t.substr(r[19]&3|8,1),r[8]=r[13]=r[18]=r[23]="-",r.join("")}function oi(r=10){let t=[],e="abcdefghijklmnopqrstuvwxyz";for(let n=0;n<r;n++)t[n]=e.substr(Math.floor(Math.random()*16),1);return t.join("")}const Wn={...JN,...oO,...pO,...MO,...Object.freeze(Object.defineProperty({__proto__:null,uuid:od,uuidOnlyStr:oi},Symbol.toStringTag,{value:"Module"})),Date:{...GO}},$m={};function e1(r,t,e){if(t===e)return r;const n=`${r}-${e}-${t}`;if($m.hasOwnProperty(n))return $m.uid;let i=new XMLHttpRequest;i.open("GET",r,!1),i.setRequestHeader("Content-type","application/ison;charset=utf-8;"),i.send(JSON.stringify());let o=i.responseText;return o=o.replaceAll(t,e),o="data:image/svg+xml,"+escape(o),$m[n]=o,o}function kO({circle:r={},icon:t={}}){let e=null;if(t.src){let{src:n,fromColor:i,toColor:o,scale:a=1,color:l}=t;i&&o&&(n=e1(n,i,o)),e=new Fc({src:n,scale:a,color:l,crossOrigin:"anonymous"})}else{const{color:n="#ff0000",radius:i=7}=r;e=new lr({radius:i,fill:new Dt({color:n})})}return e}function zO({color:r="red",width:t=0,lineCap:e="butt",lineDash:n=[0,0],zIndex:i}={}){return new Je({color:r,width:t,lineCap:e,lineDash:n})}function UO({color:r="rgba(255, 208, 75, 0.7)"}={}){return new Dt({color:r})}function ao(r={}){let{circle:t={},icon:e={},text:n,stroke:i={},fill:o={}}=r;const{zIndex:a}=i;let l=new ye({image:kO({circle:t,icon:e})});function u(f,d){return f.getProperties()[n.field]||""}function c(f,d){const{color:g="white",backgroundColor:p,fontSize:m="14px",padding:y=[0,5,0,5],offsetX:E=0,offsetY:_=-22,textFormatter:v=u,rotation:x=0,textAlign:w="center",justify:I="center"}=n;try{const C=new zf({font:`${m} Microsoft YaHei`,text:v(f,d),offsetX:E,offsetY:_,fill:new Dt({color:g}),backgroundFill:p?new Dt({color:p}):null,padding:y,textAlign:w,rotation:x,justify:I});return l.setText(C),l}catch{return null}}if(n)return c;let h=[];return i instanceof Array?(i.forEach(f=>{h.push(ao({stroke:f}))}),h):new ye({fill:UO(o),stroke:zO(i),image:l.getImage(),text:l.getText(),zIndex:a}).clone()}function VO(){const r=new URL("data:image/svg+xml;base64,PHN2ZyB0PSIxNjg5MDY2ODUxMDA0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgcC1pZD0iNzg2NiIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIj4KICA8cGF0aCBkPSJNNTEyIDUxMm0tMzE3LjQ0IDBhMzE3LjQ0IDMxNy40NCAwIDEgMCA2MzQuODggMCAzMTcuNDQgMzE3LjQ0IDAgMSAwLTYzNC44OCAwWiIKICAgIGZpbGw9IiNEM0U1RkEiIHAtaWQ9Ijc4NjciPjwvcGF0aD4KICA8cGF0aCBkPSJNNTEyIDUxMm0tMTg2Ljg4IDBhMTg2Ljg4IDE4Ni44OCAwIDEgMCAzNzMuNzYgMCAxODYuODggMTg2Ljg4IDAgMSAwLTM3My43NiAwWiIKICAgIGZpbGw9IiMxMzc3RkYiIHAtaWQ9Ijc4NjgiPjwvcGF0aD4KPC9zdmc+",self.location).href,t=new Fc({src:"https://openlayers.org/en/latest/examples/data/icons/emoticon-cool.svg",src:r,scale:1,color:"#BADA55",crossOrigin:"anonymous"});return new ye({image:t})}const jO=Object.freeze(Object.defineProperty({__proto__:null,getIconStyle:VO,getStyle:ao,getSvg:e1},Symbol.toStringTag,{value:"Module"}));class ty{constructor(){}}const V6="";class WO extends tf{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){at()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;si(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Tp(i,n)}forEachFeatureAtCoordinate(t,e,n,i,o,a,l,u){let c;const h=e.viewState;function f(x,w,I,C){return o.call(a,w,x?I:null,C)}const d=h.projection,g=pp(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&i){const x=d.getExtent(),w=Pt(x);p.push([-w,0],[w,0])}const m=e.layerStatesArray,y=m.length,E=[],_=[];for(let x=0;x<p.length;x++)for(let w=y-1;w>=0;--w){const I=m[w],C=I.layer;if(C.hasRenderer()&&jp(I,h)&&l.call(u,C)){const T=C.getRenderer(),R=C.getSource();if(T&&R){const M=R.getWrapX()?g:t,P=f.bind(null,I.managed);_[0]=M[0]+p[x][0],_[1]=M[1]+p[x][1],c=T.forEachFeatureAtCoordinate(_,e,n,P,E)}if(c)return c}}if(E.length===0)return;const v=1/E.length;return E.forEach((x,w)=>x.distanceSq+=w*v),E.sort((x,w)=>x.distanceSq-w.distanceSq),E.some(x=>c=x.callback(x.feature,x.layer,x.geometry)),c}hasFeatureAtCoordinate(t,e,n,i,o,a){return this.forEachFeatureAtCoordinate(t,e,n,i,qs,this,o,a)!==void 0}getMap(){return this.map_}renderFrame(t){at()}scheduleExpireIconCache(t){ys.canExpireCache()&&t.postRenderFunctions.push(YO)}}function YO(r,t){ys.expire()}const XO=WO;class HO extends XO{constructor(t){super(t),this.fontChangeListenerKey_=yt(to,Cl.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=Ac+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const i=new _c(t,void 0,e);n.dispatchEvent(i)}}disposeInternal(){Ht(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(pn.PRECOMPOSE,t);const e=t.layerStatesArray.sort(function(l,u){return l.zIndex-u.zIndex});e.some(l=>l.layer instanceof jc&&l.layer.getDeclutter())&&(t.declutter={});const i=t.viewState;this.children_.length=0;const o=[];let a=null;for(let l=0,u=e.length;l<u;++l){const c=e[l];t.layerIndex=l;const h=c.layer,f=h.getSourceState();if(!jp(c,i)||f!="ready"&&f!="undefined"){h.unrender();continue}const d=h.render(t,a);d&&(d!==a&&(this.children_.push(d),a=d),o.push(c))}this.declutter(t,o),Tb(this.element_,this.children_),this.dispatchRenderEvent(pn.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let n=e.length-1;n>=0;--n){const i=e[n],o=i.layer;o.getDeclutter()&&o.renderDeclutter(t,i)}e.forEach(n=>n.layer.renderDeferred(t))}}}const qO=HO;class ZO extends Er{constructor(t,e,n){super(t),this.map=e,this.frameState=n!==void 0?n:null}}const ru=ZO;class KO extends ru{constructor(t,e,n,i,o,a){super(t,e,o),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=i!==void 0?i:!1,this.activePointers=a}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const lo=KO,Bt={SINGLECLICK:"singleclick",CLICK:ot.CLICK,DBLCLICK:ot.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ey={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class JO extends sc{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=yt(n,ey.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=yt(n,ey.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(ot.TOUCHMOVE,this.boundHandleTouchMove_,aE?{passive:!1}:!1)}emulateClick_(t){let e=new lo(Bt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new lo(Bt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new lo(Bt.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==Bt.POINTERUP||e.type==Bt.POINTERCANCEL){delete this.trackedTouches_[n];for(const i in this.trackedTouches_)if(this.trackedTouches_[i].target!==e.target){delete this.trackedTouches_[i];break}}else(e.type==Bt.POINTERDOWN||e.type==Bt.POINTERMOVE)&&(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new lo(Bt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Ht),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new lo(Bt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(yt(n,Bt.POINTERMOVE,this.handlePointerMove_,this),yt(n,Bt.POINTERUP,this.handlePointerUp_,this),yt(this.element_,Bt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(yt(this.element_.getRootNode(),Bt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new lo(Bt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new lo(Bt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Ht(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ot.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ht(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ht),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const QO=JO,uo={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Yn={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};class $O extends Di{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){xf(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&xf(this.element);for(let e=0,n=this.listenerKeys.length;e<n;++e)Ht(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Il&&this.listenerKeys.push(yt(t,uo.POSTRENDER,this.render,this)),t.render())}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}const ad=$O;class t2 extends ad{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);const e=t.className!==void 0?t.className:"ol-attribution",n=t.tipLabel!==void 0?t.tipLabel:"Attributions",i=t.expandClassName!==void 0?t.expandClassName:e+"-expand",o=t.collapseLabel!==void 0?t.collapseLabel:"›",a=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof o=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const l=t.label!==void 0?t.label:"i";typeof l=="string"?(this.label_=document.createElement("span"),this.label_.textContent=l,this.label_.className=i):this.label_=l;const u=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(u),this.toggleButton_.addEventListener(ot.CLICK,this.handleClick_.bind(this),!1);const c=e+" "+Ac+" "+Im+(this.collapsed_&&this.collapsible_?" "+ex:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=c,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=Array.from(new Set(this.getMap().getAllLayers().flatMap(i=>i.getAttributions(t)))),n=!this.getMap().getAllLayers().some(i=>i.getSource()&&i.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(n),e}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(i=>p0(()=>i))),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!fs(e,this.renderedAttributions_)){uE(this.ulElement_);for(let i=0,o=e.length;i<o;++i){const a=document.createElement("li");a.innerHTML=e[i],this.ulElement_.appendChild(a)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(ex),this.collapsed_?lE(this.collapseLabel_,this.label_):lE(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}const e2=t2;class n2 extends ad{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=t.className!==void 0?t.className:"ol-rotate",n=t.label!==void 0?t.label:"⇧",i=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof n=="string"?(this.label_=document.createElement("span"),this.label_.className=i,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(i));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(ot.CLICK,this.handleClick_.bind(this),!1);const l=e+" "+Ac+" "+Im,u=this.element;u.className=l,u.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Bf)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const n=e.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Fl}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const i="rotate("+n+"rad)";if(this.autoHide_){const o=this.element.classList.contains(Bf);!o&&n===0?this.element.classList.add(Bf):o&&n!==0&&this.element.classList.remove(Bf)}this.label_.style.transform=i}this.rotation_=n}}const r2=n2;class i2 extends ad{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,i=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",o=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",l=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",u=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",c=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=i,h.setAttribute("type","button"),h.title=u,h.appendChild(typeof a=="string"?document.createTextNode(a):a),h.addEventListener(ot.CLICK,this.handleClick_.bind(this,n),!1);const f=document.createElement("button");f.className=o,f.setAttribute("type","button"),f.title=c,f.appendChild(typeof l=="string"?document.createTextNode(l):l),f.addEventListener(ot.CLICK,this.handleClick_.bind(this,-n),!1);const d=e+" "+Ac+" "+Im,g=this.element;g.className=d,g.appendChild(h),g.appendChild(f),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const i=n.getZoom();if(i!==void 0){const o=n.getConstrainedZoom(i+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:o,duration:this.duration_,easing:Fl})):n.setZoom(o)}}}const s2=i2;function ld(r){r=r||{};const t=new Gr;return(r.zoom!==void 0?r.zoom:!0)&&t.push(new s2(r.zoomOptions)),(r.rotate!==void 0?r.rotate:!0)&&t.push(new r2(r.rotateOptions)),(r.attribution!==void 0?r.attribution:!0)&&t.push(new e2(r.attributionOptions)),t}const ny={ACTIVE:"active"};class o2 extends Di{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(ny.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(ny.ACTIVE,t)}setMap(t){this.map_=t}}function a2(r,t,e){const n=r.getCenterInternal();if(n){const i=[n[0]+t[0],n[1]+t[1]];r.animateInternal({duration:e!==void 0?e:250,easing:WP,center:r.getConstrainedCenter(i)})}}function ry(r,t,e,n){const i=r.getZoom();if(i===void 0)return;const o=r.getConstrainedZoom(i+t),a=r.getResolutionForZoom(o);r.getAnimating()&&r.cancelAnimations(),r.animate({resolution:a,anchor:e,duration:n!==void 0?n:250,easing:Fl})}const iu=o2;class l2 extends iu{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==Bt.DBLCLICK){const n=t.originalEvent,i=t.map,o=t.coordinate,a=n.shiftKey?-this.delta_:this.delta_,l=i.getView();ry(l,a,o,this.duration_),n.preventDefault(),e=!0}return!e}}const u2=l2;class c2 extends iu{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Bt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Bt.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==Bt.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Bt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function iy(r){const t=r.length;let e=0,n=0;for(let i=0;i<t;i++)e+=r[i].clientX,n+=r[i].clientY;return{clientX:e/t,clientY:n/t}}const Jo=c2;function sy(r){const t=arguments;return function(e){let n=!0;for(let i=0,o=t.length;i<o&&(n=n&&t[i](e),!!n);++i);return n}}const h2=function(r){const t=r.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},f2=function(r){const t=r.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},d2=function(r){const t=r.map.getTargetElement(),e=r.map.getOwnerDocument().activeElement;return t.contains(e)},n1=function(r){return r.map.getTargetElement().hasAttribute("tabindex")?d2(r):!0},Kc=qs,r1=function(r){const t=r.originalEvent;return t.button==0&&!(wb&&iE&&t.ctrlKey)},oy=Aa,i1=function(r){return r.type==Bt.SINGLECLICK},ay=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},g2=function(r){const t=r.originalEvent;return iE?t.metaKey:t.ctrlKey},ly=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},s1=function(r){const t=r.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},uy=function(r){const t=r.originalEvent;return xt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.pointerType=="mouse"},o1=function(r){const t=r.originalEvent;return xt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.isPrimary&&t.button===0};class p2 extends Jo{constructor(t){super({stopDown:Aa}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:sy(ay,o1);this.condition_=t.onFocusOnly?sy(n1,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const n=this.targetPointers,i=e.getEventPixel(iy(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){const o=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],l=t.map.getView();P0(o,l.getResolution()),gp(o,l.getRotation()),l.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,n=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const i=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),a=n.getCenterInternal(),l=e.getPixelFromCoordinateInternal(a),u=e.getCoordinateFromPixelInternal([l[0]-i*Math.cos(o),l[1]-i*Math.sin(o)]);n.animateInternal({center:n.getConstrainedCenter(u),duration:500,easing:Fl})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const m2=p2;class y2 extends Jo{constructor(t){t=t||{},super({stopDown:Aa}),this.condition_=t.condition?t.condition:f2,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!uy(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===Sp)return;const i=e.getSize(),o=t.pixel,a=Math.atan2(i[1]/2-o[1],o[0]-i[0]/2);if(this.lastAngle_!==void 0){const l=a-this.lastAngle_;n.adjustRotationInternal(-l)}this.lastAngle_=a}handleUpEvent(t){return uy(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return uy(t)&&r1(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}const _2=y2;class v2 extends tf{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,n="px",i=this.element_.style;i.left=Math.min(t[0],e[0])+n,i.top=Math.min(t[1],e[1])+n,i.width=Math.abs(e[0]-t[0])+n,i.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new ar([i])}getGeometry(){return this.geometry_}}const E2=v2,Jc={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class ud extends Er{constructor(t,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}class x2 extends Jo{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new E2(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:r1,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const i=n[0]-e[0],o=n[1]-e[1];return i*i+o*o>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new ud(Jc.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new ud(e?Jc.BOXEND:Jc.BOXCANCEL,t.coordinate,t)),!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ud(Jc.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new ud(Jc.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}}const w2=x2;class S2 extends w2{constructor(t){t=t||{};const e=t.condition?t.condition:ly;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const n=this.getMap().getView();let i=this.getGeometry();if(this.out_){const o=n.rotatedExtentForGeometry(i),a=n.getResolutionForExtentInternal(o),l=n.getResolution()/a;i=i.clone(),i.scale(l*l)}n.fitInternal(i,{duration:this.duration_,easing:Fl})}}const a1=S2,Ka={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class C2 extends iu{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return ay(e)&&s1(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==ot.KEYDOWN){const n=t.originalEvent,i=n.key;if(this.condition_(t)&&(i==Ka.DOWN||i==Ka.LEFT||i==Ka.RIGHT||i==Ka.UP)){const a=t.map.getView(),l=a.getResolution()*this.pixelDelta_;let u=0,c=0;i==Ka.DOWN?c=-l:i==Ka.LEFT?u=-l:i==Ka.RIGHT?u=l:c=l;const h=[u,c];gp(h,a.getRotation()),a2(a,h,this.duration_),n.preventDefault(),e=!0}}return!e}}const I2=C2;class T2 extends iu{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!g2(e)&&s1(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==ot.KEYDOWN||t.type==ot.KEYPRESS){const n=t.originalEvent,i=n.key;if(this.condition_(t)&&(i==="+"||i==="-")){const o=t.map,a=i==="+"?this.delta_:-this.delta_,l=o.getView();ry(l,a,void 0,this.duration_),n.preventDefault(),e=!0}}return!e}}const R2=T2;class P2{constructor(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let n=e-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60)return!1;const o=this.points_[e]-this.points_[n],a=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/i,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const b2=P2;class A2 extends iu{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:Kc;this.condition_=t.onFocusOnly?sy(n1,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)||t.type!==ot.WHEEL)return!0;const n=t.map,i=t.originalEvent;i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let o;if(t.type==ot.WHEEL&&(o=i.deltaY,Eb&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=sE),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const l=n.getView();if(this.mode_==="trackpad"&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=o;const u=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),u),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-Oe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),ry(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}const L2=A2;class M2 extends Jo{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Aa),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0],i=this.targetPointers[1],o=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(this.lastAngle_!==void 0){const u=o-this.lastAngle_;this.rotationDelta_+=u,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=u}this.lastAngle_=o;const a=t.map,l=a.getView();l.getConstraints().rotation!==Sp&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(iy(this.targetPointers))),this.rotating_&&(a.render(),l.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const N2=M2;class O2 extends Jo{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Aa),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0],i=this.targetPointers[1],o=n.clientX-i.clientX,a=n.clientY-i.clientY,l=Math.sqrt(o*o+a*a);this.lastDistance_!==void 0&&(e=this.lastDistance_/l),this.lastDistance_=l;const u=t.map,c=u.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=u.getCoordinateFromPixelInternal(u.getEventPixel(iy(this.targetPointers))),u.render(),c.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const n=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,i),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const F2=O2;function l1(r){r=r||{};const t=new Gr,e=new b2(-.005,.05,100);return(r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0)&&t.push(new _2),(r.doubleClickZoom!==void 0?r.doubleClickZoom:!0)&&t.push(new u2({delta:r.zoomDelta,duration:r.zoomDuration})),(r.dragPan!==void 0?r.dragPan:!0)&&t.push(new m2({onFocusOnly:r.onFocusOnly,kinetic:e})),(r.pinchRotate!==void 0?r.pinchRotate:!0)&&t.push(new N2),(r.pinchZoom!==void 0?r.pinchZoom:!0)&&t.push(new F2({duration:r.zoomDuration})),(r.keyboard!==void 0?r.keyboard:!0)&&(t.push(new I2),t.push(new R2({delta:r.zoomDelta,duration:r.zoomDuration}))),(r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0)&&t.push(new L2({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration})),(r.shiftDragZoom!==void 0?r.shiftDragZoom:!0)&&t.push(new a1({duration:r.zoomDuration})),t}function u1(r){if(r instanceof yc){r.setMapInternal(null);return}r instanceof Kf&&r.getLayers().forEach(u1)}function c1(r,t){if(r instanceof yc){r.setMapInternal(t);return}if(r instanceof Kf){const e=r.getLayers().getArray();for(let n=0,i=e.length;n<i;++n)c1(e[n],t)}}let D2=class extends Di{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=B2(t);this.renderComplete_,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,this.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:sE,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=an(),this.pixelToCoordinateTransform_=an(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||ld(),this.interactions=e.interactions||l1({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new lL(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Yn.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Yn.VIEW,this.handleViewChanged_),this.addChangeListener(Yn.SIZE,this.handleSizeChanged_),this.addChangeListener(Yn.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const n=this;t.view&&!(t.view instanceof Br)&&t.view.then(function(i){n.setView(new Br(i))}),this.controls.addEventListener(Be.ADD,i=>{i.element.setMap(this)}),this.controls.addEventListener(Be.REMOVE,i=>{i.element.setMap(null)}),this.interactions.addEventListener(Be.ADD,i=>{i.element.setMap(this)}),this.interactions.addEventListener(Be.REMOVE,i=>{i.element.setMap(null)}),this.overlays_.addEventListener(Be.ADD,i=>{this.addOverlayInternal_(i.element)}),this.overlays_.addEventListener(Be.REMOVE,i=>{const o=i.element.getId();o!==void 0&&delete this.overlayIdIndex_[o.toString()],i.element.setMap(null)}),this.controls.forEach(i=>{i.setMap(this)}),this.interactions.forEach(i=>{i.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){c1(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_)return;const i=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};const o=n.hitTolerance!==void 0?n.hitTolerance:0,a=n.layerFilter!==void 0?n.layerFilter:qs,l=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,o,l,e,null,a,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(i){n.push(i)},e),n}getAllLayers(){const t=[];function e(n){n.forEach(function(i){i instanceof Kf?e(i.getLayers()):t.push(i)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const i=e.layerFilter!==void 0?e.layerFilter:qs,o=e.hitTolerance!==void 0?e.hitTolerance:0,a=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,o,a,i,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),i=this.getSize(),o=n.width/i[0],a=n.height/i[1],l="changedTouches"in t?t.changedTouches[0]:t;return[(l.clientX-n.left)/o,(l.clientY-n.top)/a]}getTarget(){return this.get(Yn.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Ga(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?We(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Yn.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Gr){e.setLayers(t);return}const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const i=t[e];if(!i.visible)continue;const o=i.layer.getRenderer();if(o&&!o.ready)return!0;const a=i.layer.getSource();if(a&&a.loading)return!0}return!1}getPixelFromCoordinate(t){const e=de(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?We(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Yn.SIZE)}getView(){return this.get(Yn.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,n,i){return uL(this.frameState_,t,e,n,i)}handleBrowserEvent(t,e){e=e||t.type;const n=new lo(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,n=e.type;if(n===ey.POINTERDOWN||n===ot.WHEEL||n===ot.KEYDOWN){const i=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():i,a=e.target;if(this.overlayContainerStopEvent_.contains(a)||!(o===i?i.documentElement:o).contains(a))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const i=this.getInteractions().getArray().slice();for(let o=i.length-1;o>=0;o--){const a=i[o];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let i=this.maxTilesLoading_,o=i;if(t){const a=t.viewHints;if(a[fe.ANIMATING]||a[fe.INTERACTING]){const l=Date.now()-t.time>8;i=l?0:8,o=l?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(pn.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(pn.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new ru(uo.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new ru(uo.LOADSTART,this,t))));const n=this.postRenderFunctions_;for(let i=0,o=n.length;i<o;++i)n[i](this,t);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let n=0,i=this.targetChangeHandlerKeys_.length;n<i;++n)Ht(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ot.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ot.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,xf(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const n=this.targetElement_.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.unobserve(n.host),this.setSize(void 0)}const t=this.getTarget(),e=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=e,!e)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new qO(this)),this.mapBrowserEventHandler_=new QO(this,this.moveTolerance_);for(const o in Bt)this.mapBrowserEventHandler_.addEventListener(Bt[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ot.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(ot.WHEEL,this.boundHandleBrowserEvent_,aE?{passive:!1}:!1);const n=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[yt(n,ot.KEYDOWN,this.handleBrowserEvent,this),yt(n,ot.KEYPRESS,this.handleBrowserEvent,this)];const i=e.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.observe(i.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Ht(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ht(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=yt(t,Cl.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=yt(t,ot.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ht),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Ko("addlayer",t)),this.layerGroupPropertyListenerKeys_=[yt(t,Cl.PROPERTYCHANGE,this.render,this),yt(t,ot.CHANGE,this.render,this),yt(t,"addlayer",this.handleLayerAdd_,this),yt(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){u1(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),n=this.getView(),i=this.frameState_;let o=null;if(e!==void 0&&AE(e)&&n&&n.isDef()){const a=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=n.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:hc(l.center,l.resolution,l.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:l,viewHints:a,wantedTiles:{},mapId:Z(this),renderTargets:{}},l.nextCenter&&l.nextResolution){const u=isNaN(l.nextRotation)?l.rotation:l.nextRotation;o.nextExtent=hc(l.nextCenter,l.nextResolution,u,e)}}this.frameState_=o,this.renderer_.renderFrame(o),o&&(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),i&&(!this.previousExtent_||!Da(this.previousExtent_)&&!Oo(o.extent,this.previousExtent_))&&(this.dispatchEvent(new ru(uo.MOVESTART,this,i)),this.previousExtent_=Ll(this.previousExtent_)),this.previousExtent_&&!o.viewHints[fe.ANIMATING]&&!o.viewHints[fe.INTERACTING]&&!Oo(o.extent,this.previousExtent_)&&(this.dispatchEvent(new ru(uo.MOVEEND,this,o)),w0(o.extent,this.previousExtent_))),this.dispatchEvent(new ru(uo.POSTRENDER,this,o)),this.renderComplete_=this.hasListener(uo.LOADSTART)||this.hasListener(uo.LOADEND)||this.hasListener(pn.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Ko("removelayer",e)),this.set(Yn.LAYERGROUP,t)}setSize(t){this.set(Yn.SIZE,t)}setTarget(t){this.set(Yn.TARGET,t)}setView(t){if(!t||t instanceof Br){this.set(Yn.VIEW,t);return}this.set(Yn.VIEW,new Br);const e=this;t.then(function(n){e.setView(new Br(n))})}updateSize(){const t=this.getTargetElement();let e;if(t){const i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),a=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(e=[o,a],!AE(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&L0("No map visible because the map container's width or height are 0."))}const n=this.getSize();e&&(!n||!fs(e,n))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};function B2(r){let t=null;r.keyboardEventTarget!==void 0&&(t=typeof r.keyboardEventTarget=="string"?document.getElementById(r.keyboardEventTarget):r.keyboardEventTarget);const e={},n=r.layers&&typeof r.layers.getLayers=="function"?r.layers:new Kf({layers:r.layers});e[Yn.LAYERGROUP]=n,e[Yn.TARGET]=r.target,e[Yn.VIEW]=r.view instanceof Br?r.view:new Br;let i;r.controls!==void 0&&(Array.isArray(r.controls)?i=new Gr(r.controls.slice()):(xt(typeof r.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),i=r.controls));let o;r.interactions!==void 0&&(Array.isArray(r.interactions)?o=new Gr(r.interactions.slice()):(xt(typeof r.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),o=r.interactions));let a;return r.overlays!==void 0?Array.isArray(r.overlays)?a=new Gr(r.overlays.slice()):(xt(typeof r.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=r.overlays):a=new Gr,{controls:i,interactions:o,keyboardEventTarget:t,overlays:a,values:e}}const cd=D2,Xn={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class G2 extends Di{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,this.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,this.element=document.createElement("div"),this.element.className=t.className!==void 0?t.className:"ol-overlay-container "+_L,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=t.autoPan===!0?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(Xn.ELEMENT,this.handleElementChanged),this.addChangeListener(Xn.MAP,this.handleMapChanged),this.addChangeListener(Xn.OFFSET,this.handleOffsetChanged),this.addChangeListener(Xn.POSITION,this.handlePositionChanged),this.addChangeListener(Xn.POSITIONING,this.handlePositioningChanged),t.element!==void 0&&this.setElement(t.element),this.setOffset(t.offset!==void 0?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),t.position!==void 0&&this.setPosition(t.position)}getElement(){return this.get(Xn.ELEMENT)}getId(){return this.id}getMap(){return this.get(Xn.MAP)||null}getOffset(){return this.get(Xn.OFFSET)}getPosition(){return this.get(Xn.POSITION)}getPositioning(){return this.get(Xn.POSITIONING)}handleElementChanged(){uE(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(xf(this.element),Ht(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=yt(t,uo.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(Xn.ELEMENT,t)}setMap(t){this.set(Xn.MAP,t)}setOffset(t){this.set(Xn.OFFSET,t)}setPosition(t){this.set(Xn.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(Xn.POSITION))return;const n=this.getRect(e.getTargetElement(),e.getSize()),i=this.getElement(),o=this.getRect(i,[Cb(i),Ib(i)]);t=t||{};const a=t.margin===void 0?20:t.margin;if(!ri(n,o)){const l=o[0]-n[0],u=n[2]-o[2],c=o[1]-n[1],h=n[3]-o[3],f=[0,0];if(l<0?f[0]=l-a:u<0&&(f[0]=Math.abs(u)+a),c<0?f[1]=c-a:h<0&&(f[1]=Math.abs(h)+a),f[0]!==0||f[1]!==0){const d=e.getView().getCenterInternal(),g=e.getPixelFromCoordinateInternal(d);if(!g)return;const p=[g[0]+f[0],g[1]+f[1]],m=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(p),duration:m.duration,easing:m.easing})}}}getRect(t,e){const n=t.getBoundingClientRect(),i=n.left+window.pageXOffset,o=n.top+window.pageYOffset;return[i,o,i+e[0],o+e[1]]}setPositioning(t){this.set(Xn.POSITIONING,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}const n=t.getPixelFromCoordinate(e),i=t.getSize();this.updateRenderedPosition(n,i)}updateRenderedPosition(t,e){const n=this.element.style,i=this.getOffset(),o=this.getPositioning();this.setVisible(!0);const a=Math.round(t[0]+i[0])+"px",l=Math.round(t[1]+i[1])+"px";let u="0%",c="0%";o=="bottom-right"||o=="center-right"||o=="top-right"?u="-100%":(o=="bottom-center"||o=="center-center"||o=="top-center")&&(u="-50%"),o=="bottom-left"||o=="bottom-center"||o=="bottom-right"?c="-100%":(o=="center-left"||o=="center-center"||o=="center-right")&&(c="-50%");const h=`translate(${u}, ${c}) translate(${a}, ${l})`;this.rendered.transform_!=h&&(this.rendered.transform_=h,n.transform=h)}getOptions(){return this.options}}const hd=G2,cy="units",k2=[1,2,5],Qc=25.4/.28;class z2 extends ad{constructor(t){t=t||{};const e=document.createElement("div");e.style.pointerEvents="none",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un;const n=t.className!==void 0?t.className:t.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=n+"-inner",this.element.className=n+" "+Ac,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=t.minWidth!==void 0?t.minWidth:64,this.maxWidth_=t.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(cy,this.handleUnitsChanged_),this.setUnits(t.units||"metric"),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(cy)}handleUnitsChanged_(){this.updateElement_()}setUnits(t){this.set(cy,t)}setDpi(t){this.dpi_=t}updateElement_(){const t=this.viewState_;if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=t.center,n=t.projection,i=this.getUnits(),o=i=="degrees"?"degrees":"m";let a=cf(n,t.resolution,e,o);const l=this.minWidth_*(this.dpi_||Qc)/Qc,u=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||Qc)/Qc:void 0;let c=l*a,h="";if(i=="degrees"){const v=Rl.degrees;c*=v,c<v/60?(h="″",a*=3600):c<v?(h="′",a*=60):h="°"}else if(i=="imperial")c<.9144?(h="in",a/=.0254):c<1609.344?(h="ft",a/=.3048):(h="mi",a/=1609.344);else if(i=="nautical")a/=1852,h="NM";else if(i=="metric")c<1e-6?(h="nm",a*=1e9):c<.001?(h="μm",a*=1e6):c<1?(h="mm",a*=1e3):c<1e3?h="m":(h="km",a/=1e3);else if(i=="us")c<.9144?(h="in",a*=39.37):c<1609.344?(h="ft",a/=.30480061):(h="mi",a/=1609.3472);else throw new Error("Invalid units");let f=3*Math.floor(Math.log(l*a)/Math.log(10)),d,g,p,m,y,E;for(;;){p=Math.floor(f/3);const v=Math.pow(10,p);if(d=k2[(f%3+3)%3]*v,g=Math.round(d/a),isNaN(g)){this.element.style.display="none",this.renderedVisible_=!1;return}if(u!==void 0&&g>=u){d=m,g=y,p=E;break}else if(g>=l)break;m=d,y=g,E=p,++f}const _=this.scaleBar_?this.createScaleBar(g,d,h):d.toFixed(p<0?-p:0)+" "+h;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(t,e,n){const i=this.getScaleForResolution(),o=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),a=this.scaleBarSteps_,l=t/a,u=[this.createMarker("absolute")];for(let h=0;h<a;++h){const f=h%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";u.push(`<div><div class="ol-scale-singlebar ${f}" style="width: ${l}px;"></div>`+this.createMarker("relative")+(h%2===0||a===2?this.createStepText(h,t,!1,e,n):"")+"</div>")}return u.push(this.createStepText(a,t,!0,e,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${t}px;">`+o+"</div>":"")+u.join("")}createMarker(t){return`<div class="ol-scale-step-marker" style="position: ${t}; top: ${t==="absolute"?3:-10}px;"></div>`}createStepText(t,e,n,i,o){const l=(t===0?0:Math.round(i/this.scaleBarSteps_*t*100)/100)+(t===0?"":" "+o),u=t===0?-3:e/this.scaleBarSteps_*-1,c=t===0?0:e/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${u}px;text-align: ${t===0?"left":"center"};min-width: ${c}px;left: ${n?e+"px":"unset"};">`+l+"</div>"}getScaleForResolution(){const t=cf(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),e=this.dpi_||Qc,n=1e3/25.4;return t*n*e}render(t){const e=t.frameState;e?this.viewState_=e.viewState:this.viewState_=null,this.updateElement_()}}const hy=z2;class U2{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Ye,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let n=e.dataProjection?gt(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()==="tile-pixels"&&(n=gt(n),n.setWorldExtent(e.extent)),e={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return at()}readFeature(t,e){return at()}readFeatures(t,e){return at()}readGeometry(t,e){return at()}readProjection(t){return at()}writeFeature(t,e){return at()}writeFeatures(t,e){return at()}writeGeometry(t,e){return at()}}const fd=U2;function co(r,t,e){const n=e?gt(e.featureProjection):null,i=e?gt(e.dataProjection):null;let o=r;if(n&&i&&!gs(n,i)){t&&(o=r.clone());const a=t?n:i,l=t?i:n;a.getUnits()==="tile-pixels"?o.transform(a,l):o.applyTransform(Ol(a,l))}if(t&&e&&e.decimals!==void 0){const a=Math.pow(10,e.decimals),l=function(u){for(let c=0,h=u.length;c<h;++c)u[c]=Math.round(u[c]*a)/a;return u};o===r&&(o=r.clone()),o.applyTransform(l)}return o}function fy(r,t){const e=t?gt(t.featureProjection):null,n=t?gt(t.dataProjection):null;return e&&n&&!gs(e,n)?OP(r,n,e):r}const V2={Point:or,LineString:Sr,Polygon:ar,MultiPoint:Uo,MultiLineString:ja,MultiPolygon:Wa};function j2(r,t,e){return Array.isArray(t[0])?(tE(r,0,t,e)||(r=r.slice(),kp(r,0,t,e)),r):(Gp(r,0,t,e)||(r=r.slice(),_f(r,0,t,e)),r)}function h1(r,t){var o;const e=r.geometry;if(!e)return[];if(Array.isArray(e))return e.map(a=>h1({...r,geometry:a})).flat();const n=e.type==="MultiPolygon"?"Polygon":e.type;if(n==="GeometryCollection"||n==="Circle")throw new Error("Unsupported geometry type: "+n);const i=e.layout.length;return co(new zi(n,n==="Polygon"?j2(e.flatCoordinates,e.ends,i):e.flatCoordinates,(o=e.ends)==null?void 0:o.flat(),i,r.properties||{},r.id).enableSimplifyTransformed(),!1,t)}function dy(r,t){if(!r)return null;if(Array.isArray(r)){const n=r.map(i=>dy(i,t));return new Rc(n)}const e=V2[r.type];return co(new e(r.flatCoordinates,r.layout,r.ends),!1,t)}var gy={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */gy.read=function(r,t,e,n,i){var o,a,l=i*8-n-1,u=(1<<l)-1,c=u>>1,h=-7,f=e?i-1:0,d=e?-1:1,g=r[t+f];for(f+=d,o=g&(1<<-h)-1,g>>=-h,h+=l;h>0;o=o*256+r[t+f],f+=d,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+r[t+f],f+=d,h-=8);if(o===0)o=1-c;else{if(o===u)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-c}return(g?-1:1)*a*Math.pow(2,o-n)},gy.write=function(r,t,e,n,i,o){var a,l,u,c=o*8-i-1,h=(1<<c)-1,f=h>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,p=n?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+f>=1?t+=d/u:t+=d*Math.pow(2,1-f),t*u>=2&&(a++,u/=2),a+f>=h?(l=0,a=h):a+f>=1?(l=(t*u-1)*Math.pow(2,i),a=a+f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;r[e+g]=l&255,g+=p,l/=256,i-=8);for(a=a<<i|l,c+=i;c>0;r[e+g]=a&255,g+=p,a/=256,c-=8);r[e+g-p]|=m*128};var W2=qt,dd=gy;function qt(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}qt.Varint=0,qt.Fixed64=1,qt.Bytes=2,qt.Fixed32=5;var py=65536*65536,f1=1/py,Y2=12,d1=typeof TextDecoder>"u"?null:new TextDecoder("utf8");qt.prototype={destroy:function(){this.buf=null},readFields:function(r,t,e){for(e=e||this.length;this.pos<e;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,r(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=gd(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=p1(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=gd(this.buf,this.pos)+gd(this.buf,this.pos+4)*py;return this.pos+=8,r},readSFixed64:function(){var r=gd(this.buf,this.pos)+p1(this.buf,this.pos+4)*py;return this.pos+=8,r},readFloat:function(){var r=dd.read(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=dd.read(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t=this.buf,e,n;return n=t[this.pos++],e=n&127,n<128||(n=t[this.pos++],e|=(n&127)<<7,n<128)||(n=t[this.pos++],e|=(n&127)<<14,n<128)||(n=t[this.pos++],e|=(n&127)<<21,n<128)?e:(n=t[this.pos],e|=(n&15)<<28,X2(e,r,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2===1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=Y2&&d1?oF(this.buf,t,r):sF(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==qt.Bytes)return r.push(this.readVarint(t));var e=ho(this);for(r=r||[];this.pos<e;)r.push(this.readVarint(t));return r},readPackedSVarint:function(r){if(this.type!==qt.Bytes)return r.push(this.readSVarint());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readSVarint());return r},readPackedBoolean:function(r){if(this.type!==qt.Bytes)return r.push(this.readBoolean());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readBoolean());return r},readPackedFloat:function(r){if(this.type!==qt.Bytes)return r.push(this.readFloat());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readFloat());return r},readPackedDouble:function(r){if(this.type!==qt.Bytes)return r.push(this.readDouble());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readDouble());return r},readPackedFixed32:function(r){if(this.type!==qt.Bytes)return r.push(this.readFixed32());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readFixed32());return r},readPackedSFixed32:function(r){if(this.type!==qt.Bytes)return r.push(this.readSFixed32());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readSFixed32());return r},readPackedFixed64:function(r){if(this.type!==qt.Bytes)return r.push(this.readFixed64());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readFixed64());return r},readPackedSFixed64:function(r){if(this.type!==qt.Bytes)return r.push(this.readSFixed64());var t=ho(this);for(r=r||[];this.pos<t;)r.push(this.readSFixed64());return r},skip:function(r){var t=r&7;if(t===qt.Varint)for(;this.buf[this.pos++]>127;);else if(t===qt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===qt.Fixed32)this.pos+=4;else if(t===qt.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t<this.pos+r;)t*=2;if(t!==this.length){var e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(r){this.realloc(4),ou(this.buf,r,this.pos),this.pos+=4},writeSFixed32:function(r){this.realloc(4),ou(this.buf,r,this.pos),this.pos+=4},writeFixed64:function(r){this.realloc(8),ou(this.buf,r&-1,this.pos),ou(this.buf,Math.floor(r*f1),this.pos+4),this.pos+=8},writeSFixed64:function(r){this.realloc(8),ou(this.buf,r&-1,this.pos),ou(this.buf,Math.floor(r*f1),this.pos+4),this.pos+=8},writeVarint:function(r){if(r=+r||0,r>268435455||r<0){H2(r,this);return}this.realloc(4),this.buf[this.pos++]=r&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=r>>>7&127)))},writeSVarint:function(r){this.writeVarint(r<0?-r*2-1:r*2)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(r.length*4),this.pos++;var t=this.pos;this.pos=aF(this.buf,r,this.pos);var e=this.pos-t;e>=128&&g1(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(r){this.realloc(4),dd.write(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),dd.write(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var e=0;e<t;e++)this.buf[this.pos++]=r[e]},writeRawMessage:function(r,t){this.pos++;var e=this.pos;r(t,this);var n=this.pos-e;n>=128&&g1(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeMessage:function(r,t,e){this.writeTag(r,qt.Bytes),this.writeRawMessage(t,e)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,K2,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,J2,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,tF,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,Q2,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,$2,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,eF,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,nF,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,rF,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,iF,t)},writeBytesField:function(r,t){this.writeTag(r,qt.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,qt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,qt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,qt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,qt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,qt.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,qt.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,qt.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,qt.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,qt.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};function X2(r,t,e){var n=e.buf,i,o;if(o=n[e.pos++],i=(o&112)>>4,o<128||(o=n[e.pos++],i|=(o&127)<<3,o<128)||(o=n[e.pos++],i|=(o&127)<<10,o<128)||(o=n[e.pos++],i|=(o&127)<<17,o<128)||(o=n[e.pos++],i|=(o&127)<<24,o<128)||(o=n[e.pos++],i|=(o&1)<<31,o<128))return su(r,i,t);throw new Error("Expected varint not more than 10 bytes")}function ho(r){return r.type===qt.Bytes?r.readVarint()+r.pos:r.pos+1}function su(r,t,e){return e?t*4294967296+(r>>>0):(t>>>0)*4294967296+(r>>>0)}function H2(r,t){var e,n;if(r>=0?(e=r%4294967296|0,n=r/4294967296|0):(e=~(-r%4294967296),n=~(-r/4294967296),e^4294967295?e=e+1|0:(e=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),q2(e,n,t),Z2(n,t)}function q2(r,t,e){e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos]=r&127}function Z2(r,t){var e=(r&7)<<4;t.buf[t.pos++]|=e|((r>>>=3)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127)))))}function g1(r,t,e){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));e.realloc(n);for(var i=e.pos-1;i>=r;i--)e.buf[i+n]=e.buf[i]}function K2(r,t){for(var e=0;e<r.length;e++)t.writeVarint(r[e])}function J2(r,t){for(var e=0;e<r.length;e++)t.writeSVarint(r[e])}function Q2(r,t){for(var e=0;e<r.length;e++)t.writeFloat(r[e])}function $2(r,t){for(var e=0;e<r.length;e++)t.writeDouble(r[e])}function tF(r,t){for(var e=0;e<r.length;e++)t.writeBoolean(r[e])}function eF(r,t){for(var e=0;e<r.length;e++)t.writeFixed32(r[e])}function nF(r,t){for(var e=0;e<r.length;e++)t.writeSFixed32(r[e])}function rF(r,t){for(var e=0;e<r.length;e++)t.writeFixed64(r[e])}function iF(r,t){for(var e=0;e<r.length;e++)t.writeSFixed64(r[e])}function gd(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+r[t+3]*16777216}function ou(r,t,e){r[e]=t,r[e+1]=t>>>8,r[e+2]=t>>>16,r[e+3]=t>>>24}function p1(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}function sF(r,t,e){for(var n="",i=t;i<e;){var o=r[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l>e)break;var u,c,h;l===1?o<128&&(a=o):l===2?(u=r[i+1],(u&192)===128&&(a=(o&31)<<6|u&63,a<=127&&(a=null))):l===3?(u=r[i+1],c=r[i+2],(u&192)===128&&(c&192)===128&&(a=(o&15)<<12|(u&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):l===4&&(u=r[i+1],c=r[i+2],h=r[i+3],(u&192)===128&&(c&192)===128&&(h&192)===128&&(a=(o&15)<<18|(u&63)<<12|(c&63)<<6|h&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,l=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=l}return n}function oF(r,t,e){return d1.decode(r.subarray(t,e))}function aF(r,t,e){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){r[e++]=239,r[e++]=191,r[e++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(r[e++]=239,r[e++]=191,r[e++]=189):o=i;continue}else o&&(r[e++]=239,r[e++]=191,r[e++]=189,o=null);i<128?r[e++]=i:(i<2048?r[e++]=i>>6|192:(i<65536?r[e++]=i>>12|224:(r[e++]=i>>18|240,r[e++]=i>>12&63|128),r[e++]=i>>6&63|128),r[e++]=i&63|128)}return e}const lF=vm(W2);class uF extends fd{constructor(t){super(),t=t||{},this.dataProjection=new ip({code:"",units:"tile-pixels"}),this.featureClass=t.featureClass?t.featureClass:zi,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(t,e,n,i){t.pos=e.geometry;const o=t.readVarint()+t.pos;let a=1,l=0,u=0,c=0,h=0,f=0;for(;t.pos<o;){if(!l){const d=t.readVarint();a=d&7,l=d>>3}if(l--,a===1||a===2)u+=t.readSVarint(),c+=t.readSVarint(),a===1&&h>f&&(i.push(h),f=h),n.push(u,c),h+=2;else if(a===7)h>f&&(n.push(n[f],n[f+1]),h+=2);else throw new Error("Invalid command found in the PBF")}h>f&&(i.push(h),f=h)}createFeature_(t,e,n){const i=e.type;if(i===0)return null;let o;const a=e.properties;let l;this.idProperty_?(l=a[this.idProperty_],delete a[this.idProperty_]):l=e.id,a[this.layerName_]=e.layer.name;const u=[],c=[];this.readRawGeometry_(t,e,u,c);const h=gF(i,c.length);if(this.featureClass===zi)o=new this.featureClass(h,u,c,2,a,l),o.transform(n.dataProjection);else{let f;if(h=="Polygon"){const p=eE(u,c);f=p.length>1?new Wa(u,"XY",p):new ar(u,"XY",c)}else f=h==="Point"?new or(u,"XY"):h==="LineString"?new Sr(u,"XY"):h==="MultiPoint"?new Uo(u,"XY"):h==="MultiLineString"?new ja(u,"XY",c):null;const d=this.featureClass;o=new d,this.geometryName_&&o.setGeometryName(this.geometryName_);const g=co(f,!1,n);o.setGeometry(g),l!==void 0&&o.setId(l),o.setProperties(a,!0)}return o}getType(){return"arraybuffer"}readFeatures(t,e){const n=this.layers_;e=this.adaptOptions(e);const i=gt(e.dataProjection);i.setWorldExtent(e.extent),e.dataProjection=i;const o=new lF(t),a=o.readFields(cF,{}),l=[];for(const u in a){if(n&&!n.includes(u))continue;const c=a[u],h=c?[0,0,c.extent,c.extent]:null;i.setExtent(h);for(let f=0,d=c.length;f<d;++f){const g=dF(o,c,f),p=this.createFeature_(o,g,e);p!==null&&l.push(p)}}return l}readProjection(t){return this.dataProjection}setLayers(t){this.layers_=t}}function cF(r,t,e){if(r===3){const n={keys:[],values:[],features:[]},i=e.readVarint()+e.pos;e.readFields(hF,n,i),n.length=n.features.length,n.length&&(t[n.name]=n)}}function hF(r,t,e){if(r===15)t.version=e.readVarint();else if(r===1)t.name=e.readString();else if(r===5)t.extent=e.readVarint();else if(r===2)t.features.push(e.pos);else if(r===3)t.keys.push(e.readString());else if(r===4){let n=null;const i=e.readVarint()+e.pos;for(;e.pos<i;)r=e.readVarint()>>3,n=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null;t.values.push(n)}}function fF(r,t,e){if(r==1)t.id=e.readVarint();else if(r==2){const n=e.readVarint()+e.pos;for(;e.pos<n;){const i=t.layer.keys[e.readVarint()],o=t.layer.values[e.readVarint()];t.properties[i]=o}}else r==3?t.type=e.readVarint():r==4&&(t.geometry=e.pos)}function dF(r,t,e){r.pos=t.features[e];const n=r.readVarint()+r.pos,i={layer:t,type:0,properties:{}};return r.readFields(fF,i,n),i}function gF(r,t){let e;return r===1?e=t===1?"Point":"MultiPoint":r===2?e=t===1?"LineString":"MultiLineString":r===3&&(e="Polygon"),e}const pd=uF;class pF extends fd{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(md(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(md(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return at()}readFeaturesFromObject(t,e){return at()}readGeometry(t,e){return this.readGeometryFromObject(md(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return at()}readProjection(t){return this.readProjectionFromObject(md(t))}readProjectionFromObject(t){return at()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return at()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return at()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return at()}}function md(r){if(typeof r=="string"){const t=JSON.parse(r);return t||null}return r!==null?r:null}const mF=pF;class yF extends mF{constructor(t){t=t||{},super(),this.dataProjection=gt(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=gt(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let n=null;t.type==="Feature"?n=t:n={type:"Feature",geometry:t,properties:null};const i=my(n.geometry);if(this.featureClass===zi)return h1({geometry:i,id:n.id,properties:n.properties},e);const o=new Ye;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&o.setGeometryName(n.geometry_name),o.setGeometry(dy(i,e)),"id"in n&&o.setId(n.id),n.properties&&o.setProperties(n.properties,!0),o}readFeaturesFromObject(t,e){const n=t;let i=null;if(n.type==="FeatureCollection"){const o=t;i=[];const a=o.features;for(let l=0,u=a.length;l<u;++l){const c=this.readFeatureFromObject(a[l],e);c&&i.push(c)}}else i=[this.readFeatureFromObject(t,e)];return i.flat()}readGeometryFromObject(t,e){return _F(t,e)}readProjectionFromObject(t){const e=t.crs;let n;if(e)if(e.type=="name")n=gt(e.properties.name);else if(e.type==="EPSG")n=gt("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else n=this.dataProjection;return n}writeFeatureObject(t,e){e=this.adaptOptions(e);const n={type:"Feature",geometry:null,properties:null},i=t.getId();if(i!==void 0&&(n.id=i),!t.hasProperties())return n;const o=t.getProperties(),a=t.getGeometry();return a&&(n.geometry=yy(a,e),delete o[t.getGeometryName()]),Mo(o)||(n.properties=o),n}writeFeaturesObject(t,e){e=this.adaptOptions(e);const n=[];for(let i=0,o=t.length;i<o;++i)n.push(this.writeFeatureObject(t[i],e));return{type:"FeatureCollection",features:n}}writeGeometryObject(t,e){return yy(t,this.adaptOptions(e))}}function my(r,t){if(!r)return null;let e;switch(r.type){case"Point":{e=EF(r);break}case"LineString":{e=xF(r);break}case"Polygon":{e=IF(r);break}case"MultiPoint":{e=SF(r);break}case"MultiLineString":{e=wF(r);break}case"MultiPolygon":{e=CF(r);break}case"GeometryCollection":{e=vF(r);break}default:throw new Error("Unsupported GeoJSON type: "+r.type)}return e}function _F(r,t){const e=my(r);return dy(e,t)}function vF(r,t){return r.geometries.map(function(n){return my(n)})}function EF(r){const t=r.coordinates;return{type:"Point",flatCoordinates:t,layout:ka(t.length)}}function xF(r){var n;const t=r.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:ka(((n=t[0])==null?void 0:n.length)||2)}}function wF(r){var o,a;const t=r.coordinates,e=((a=(o=t[0])==null?void 0:o[0])==null?void 0:a.length)||2,n=[],i=pc(n,0,t,e);return{type:"MultiLineString",flatCoordinates:n,ends:i,layout:ka(e)}}function SF(r){var e;const t=r.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:ka(((e=t[0])==null?void 0:e.length)||2)}}function CF(r){var o,a;const t=r.coordinates,e=[],n=((a=(o=t[0])==null?void 0:o[0])==null?void 0:a[0].length)||2,i=X0(e,0,t,n);return{type:"MultiPolygon",flatCoordinates:e,ends:i,layout:ka(n)}}function IF(r){var o,a;const t=r.coordinates,e=[],n=(a=(o=t[0])==null?void 0:o[0])==null?void 0:a.length,i=pc(e,0,t,n);return{type:"Polygon",flatCoordinates:e,ends:i,layout:ka(n)}}function yy(r,t){r=co(r,!0,t);const e=r.getType();let n;switch(e){case"Point":{n=LF(r);break}case"LineString":{n=RF(r);break}case"Polygon":{n=MF(r,t);break}case"MultiPoint":{n=bF(r);break}case"MultiLineString":{n=PF(r);break}case"MultiPolygon":{n=AF(r,t);break}case"GeometryCollection":{n=TF(r,t);break}case"Circle":{n={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return n}function TF(r,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:r.getGeometriesArray().map(function(n){return yy(n,t)})}}function RF(r,t){return{type:"LineString",coordinates:r.getCoordinates()}}function PF(r,t){return{type:"MultiLineString",coordinates:r.getCoordinates()}}function bF(r,t){return{type:"MultiPoint",coordinates:r.getCoordinates()}}function AF(r,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:r.getCoordinates(e)}}function LF(r,t){return{type:"Point",coordinates:r.getCoordinates()}}function MF(r,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:r.getCoordinates(e)}}const Qo=yF,_y="http://www.w3.org/2001/XMLSchema-instance";function wt(r,t){return v1().createElementNS(r,t)}function $c(r,t){return m1(r,t,[]).join("")}function m1(r,t,e){if(r.nodeType==Node.CDATA_SECTION_NODE||r.nodeType==Node.TEXT_NODE)t?e.push(String(r.nodeValue).replace(/(\r\n|\r|\n)/g,"")):e.push(r.nodeValue);else{let n;for(n=r.firstChild;n;n=n.nextSibling)m1(n,t,e)}return e}function au(r){return"documentElement"in r}function NF(r,t,e){return r.getAttributeNS(t,e)||""}function lu(r){return new DOMParser().parseFromString(r,"application/xml")}function y1(r,t){return function(e,n){const i=r.call(t!==void 0?t:this,e,n);if(i!==void 0){const o=n[n.length-1];Pn(o,i)}}}function mt(r,t){return function(e,n){const i=r.call(t!==void 0?t:this,e,n);i!==void 0&&n[n.length-1].push(i)}}function lt(r,t){return function(e,n){const i=r.call(t!==void 0?t:this,e,n);i!==void 0&&(n[n.length-1]=i)}}function ji(r,t,e){return function(n,i){const o=r.call(e!==void 0?e:this,n,i);if(o!==void 0){const a=i[i.length-1],l=t!==void 0?t:n.localName;a[l]=o}}}function k(r,t){return function(e,n,i){r.call(t!==void 0?t:this,e,n,i),i[i.length-1].node.appendChild(e)}}function Vr(r,t){return function(e,n,i){const a=n[n.length-1].node;let l=r;l===void 0&&(l=i);const u=t!==void 0?t:a.namespaceURI;return wt(u,l)}}const _1=Vr();function Ja(r,t,e,n){let i;for(i=t.firstElementChild;i;i=i.nextElementSibling){const o=r[i.namespaceURI];if(o!==void 0){const a=o[i.localName];a!==void 0&&a.call(n,i,e)}}}function ne(r,t,e,n,i){return n.push(r),Ja(t,e,n,i),n.pop()}function OF(r,t,e,n,i,o){const a=(i!==void 0?i:e).length;let l,u;for(let c=0;c<a;++c)l=e[c],l!==void 0&&(u=t.call(o!==void 0?o:this,l,n,i!==void 0?i[c]:void 0),u!==void 0&&r[u.namespaceURI][u.localName].call(o,u,l,n))}function ke(r,t,e,n,i,o,a){return i.push(r),OF(t,e,n,i,o,a),i.pop()}let vy;function FF(){return vy===void 0&&typeof XMLSerializer<"u"&&(vy=new XMLSerializer),vy}let Ey;function v1(){return Ey===void 0&&typeof document<"u"&&(Ey=document.implementation.createDocument("","",null)),Ey}class DF extends fd{constructor(){super(),this.xmlSerializer_=FF()}getType(){return"xml"}readFeature(t,e){if(!t)return null;if(typeof t=="string"){const n=lu(t);return this.readFeatureFromDocument(n,e)}return au(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}readFeatureFromDocument(t,e){const n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null}readFeatureFromNode(t,e){return null}readFeatures(t,e){if(!t)return[];if(typeof t=="string"){const n=lu(t);return this.readFeaturesFromDocument(n,e)}return au(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}readFeaturesFromDocument(t,e){const n=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&Pn(n,this.readFeaturesFromNode(i,e));return n}readFeaturesFromNode(t,e){return at()}readGeometry(t,e){if(!t)return null;if(typeof t=="string"){const n=lu(t);return this.readGeometryFromDocument(n,e)}return au(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}readGeometryFromDocument(t,e){return null}readGeometryFromNode(t,e){return null}readProjection(t){if(!t)return null;if(typeof t=="string"){const e=lu(t);return this.readProjectionFromDocument(e)}return au(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}readProjectionFromDocument(t){return this.dataProjection}readProjectionFromNode(t){return this.dataProjection}writeFeature(t,e){const n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeFeatureNode(t,e){return null}writeFeatures(t,e){const n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeFeaturesNode(t,e){return null}writeGeometry(t,e){const n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeGeometryNode(t,e){return null}}const E1=DF,fo="http://www.opengis.net/gml",BF=/^\s*$/;class ze extends E1{constructor(t){super(),t=t||{},this.featureType=t.featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:mt(this.readFeaturesInternal),featureMembers:lt(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(t,e){const n=t.localName;let i=null;if(n=="FeatureCollection")i=ne([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if(n=="featureMembers"||n=="featureMember"||n=="member"){const o=e[0];let a=o.featureType,l=o.featureNS;const u="p",c="p0";if(!a&&t.childNodes){a=[],l={};for(let d=0,g=t.childNodes.length;d<g;++d){const p=t.childNodes[d];if(p.nodeType===1){const m=p.nodeName.split(":").pop();if(!a.includes(m)){let y="",E=0;const _=p.namespaceURI;for(const v in l){if(l[v]===_){y=v;break}++E}y||(y=u+E,l[y]=_),a.push(y+":"+m)}}}n!="featureMember"&&(o.featureType=a,o.featureNS=l)}if(typeof l=="string"){const d=l;l={},l[c]=d}const h={},f=Array.isArray(a)?a:[a];for(const d in l){const g={};for(let p=0,m=f.length;p<m;++p)(f[p].includes(":")?f[p].split(":")[0]:c)===d&&(g[f[p].split(":").pop()]=n=="featureMembers"?mt(this.readFeatureElement,this):lt(this.readFeatureElement,this));h[l[d]]=g}n=="featureMember"||n=="member"?i=ne(void 0,h,t,e):i=ne([],h,t,e)}return i===null&&(i=[]),i}readGeometryOrExtent(t,e){const n=e[0];return n.srsName=t.firstElementChild.getAttribute("srsName"),n.srsDimension=t.firstElementChild.getAttribute("srsDimension"),ne(null,this.GEOMETRY_PARSERS,t,e,this)}readExtentElement(t,e){const n=e[0],i=this.readGeometryOrExtent(t,e);return i?fy(i,n):void 0}readGeometryElement(t,e){const n=e[0],i=this.readGeometryOrExtent(t,e);return i?co(i,!1,n):void 0}readFeatureElementInternal(t,e,n){let i;const o={};for(let u=t.firstElementChild;u;u=u.nextElementSibling){let c;const h=u.localName;u.childNodes.length===0||u.childNodes.length===1&&(u.firstChild.nodeType===3||u.firstChild.nodeType===4)?(c=$c(u,!1),BF.test(c)&&(c=void 0)):(n&&(c=h==="boundedBy"?this.readExtentElement(u,e):this.readGeometryElement(u,e)),c?h!=="boundedBy"&&(i=h):c=this.readFeatureElementInternal(u,e,!1));const f=u.attributes.length;if(f>0&&!(c instanceof df)){c={_content_:c};for(let d=0;d<f;d++){const g=u.attributes[d].name;c[g]=u.attributes[d].value}}o[h]?(o[h]instanceof Array||(o[h]=[o[h]]),o[h].push(c)):o[h]=c}if(!n)return o;const a=new Ye(o);i&&a.setGeometryName(i);const l=t.getAttribute("fid")||NF(t,this.namespace,"id");return l&&a.setId(l),a}readFeatureElement(t,e){return this.readFeatureElementInternal(t,e,!0)}readPoint(t,e){const n=this.readFlatCoordinatesFromNode(t,e);if(n)return new or(n,"XYZ")}readMultiPoint(t,e){const n=ne([],this.MULTIPOINT_PARSERS,t,e,this);if(n)return new Uo(n)}readMultiLineString(t,e){const n=ne([],this.MULTILINESTRING_PARSERS,t,e,this);if(n)return new ja(n)}readMultiPolygon(t,e){const n=ne([],this.MULTIPOLYGON_PARSERS,t,e,this);if(n)return new Wa(n)}pointMemberParser(t,e){Ja(this.POINTMEMBER_PARSERS,t,e,this)}lineStringMemberParser(t,e){Ja(this.LINESTRINGMEMBER_PARSERS,t,e,this)}polygonMemberParser(t,e){Ja(this.POLYGONMEMBER_PARSERS,t,e,this)}readLineString(t,e){const n=this.readFlatCoordinatesFromNode(t,e);if(n)return new Sr(n,"XYZ")}readFlatLinearRing(t,e){const n=ne(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);if(n)return n}readLinearRing(t,e){const n=this.readFlatCoordinatesFromNode(t,e);if(n)return new Op(n,"XYZ")}readPolygon(t,e){const n=ne([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(n&&n[0]){const i=n[0],o=[i.length];let a,l;for(a=1,l=n.length;a<l;++a)Pn(i,n[a]),o.push(i.length);return new ar(i,"XYZ",o)}}readFlatCoordinatesFromNode(t,e){return ne(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)}readGeometryFromNode(t,e){const n=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return n||null}readFeaturesFromNode(t,e){const n={featureType:this.featureType,featureNS:this.featureNS};return n&&Object.assign(n,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[n])||[]}readProjectionFromNode(t){return gt(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))}}ze.prototype.namespace=fo,ze.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},ze.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},ze.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},ze.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:mt(ze.prototype.pointMemberParser),pointMembers:mt(ze.prototype.pointMemberParser)}},ze.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:mt(ze.prototype.lineStringMemberParser),lineStringMembers:mt(ze.prototype.lineStringMemberParser)}},ze.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:mt(ze.prototype.polygonMemberParser),polygonMembers:mt(ze.prototype.polygonMemberParser)}},ze.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:mt(ze.prototype.readFlatCoordinatesFromNode)}},ze.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:mt(ze.prototype.readLineString)}},ze.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:mt(ze.prototype.readPolygon)}},ze.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:lt(ze.prototype.readFlatLinearRing)}};const St=ze;function uu(r){const t=$c(r,!1);return cu(t)}function cu(r){const t=/^\s*(\d+)\s*$/.exec(r);if(t)return parseInt(t[1],10)}function Qe(r,t){r.appendChild(v1().createTextNode(t))}const GF=fo+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",kF={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class Gt extends St{constructor(t){t=t||{},super(t),this.FEATURE_COLLECTION_PARSERS[fo].featureMember=mt(this.readFeaturesInternal),this.schemaLocation=t.schemaLocation?t.schemaLocation:GF}readFlatCoordinates(t,e){const n=$c(t,!1).replace(/^\s*|\s*$/g,""),o=e[0].srsName;let a="enu";if(o){const c=gt(o);c&&(a=c.getAxisOrientation())}const l=n.trim().split(/\s+/),u=[];for(let c=0,h=l.length;c<h;c++){const f=l[c].split(/,+/),d=parseFloat(f[0]),g=parseFloat(f[1]),p=f.length===3?parseFloat(f[2]):0;a.substr(0,2)==="en"?u.push(d,g,p):u.push(g,d,p)}return u}readBox(t,e){const n=ne([null],this.BOX_PARSERS_,t,e,this);return ii(n[1][0],n[1][1],n[1][3],n[1][4])}innerBoundaryIsParser(t,e){const n=ne(void 0,this.RING_PARSERS,t,e,this);n&&e[e.length-1].push(n)}outerBoundaryIsParser(t,e){const n=ne(void 0,this.RING_PARSERS,t,e,this);if(n){const i=e[e.length-1];i[0]=n}}GEOMETRY_NODE_FACTORY_(t,e,n){const i=e[e.length-1],o=i.multiSurface,a=i.surface,l=i.multiCurve;return Array.isArray(t)?n="Envelope":(n=t.getType(),n==="MultiPolygon"&&o===!0?n="MultiSurface":n==="Polygon"&&a===!0?n="Surface":n==="MultiLineString"&&l===!0&&(n="MultiCurve")),wt("http://www.opengis.net/gml",n)}writeFeatureElement(t,e,n){const i=e.getId();i&&t.setAttribute("fid",i);const o=n[n.length-1],a=o.featureNS,l=e.getGeometryName();o.serializers||(o.serializers={},o.serializers[a]={});const u=[],c=[];if(e.hasProperties()){const f=e.getProperties();for(const d in f){const g=f[d];g!==null&&(u.push(d),c.push(g),d==l||typeof g.getSimplifiedGeometry=="function"?d in o.serializers[a]||(o.serializers[a][d]=k(this.writeGeometryElement,this)):d in o.serializers[a]||(o.serializers[a][d]=k(Qe)))}}const h=Object.assign({},o);h.node=t,ke(h,o.serializers,Vr(void 0,a),c,n,u)}writeCurveOrLineString(t,e,n){const o=n[n.length-1].srsName;if(t.nodeName!=="LineStringSegment"&&o&&t.setAttribute("srsName",o),t.nodeName==="LineString"||t.nodeName==="LineStringSegment"){const a=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(a),this.writeCoordinates_(a,e,n)}else if(t.nodeName==="Curve"){const a=wt(t.namespaceURI,"segments");t.appendChild(a),this.writeCurveSegments_(a,e,n)}}writeLineStringOrCurveMember(t,e,n){const i=this.GEOMETRY_NODE_FACTORY_(e,n);i&&(t.appendChild(i),this.writeCurveOrLineString(i,e,n))}writeMultiCurveOrLineString(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName,l=i.curve;a&&t.setAttribute("srsName",a);const u=e.getLineStrings();ke({node:t,hasZ:o,srsName:a,curve:l},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,u,n,void 0,this)}writeGeometryElement(t,e,n){const i=n[n.length-1],o=Object.assign({},i);o.node=t;let a;Array.isArray(e)?a=fy(e,i):a=co(e,!0,i),ke(o,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[a],n,void 0,this)}createCoordinatesNode_(t){const e=wt(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e}writeCoordinates_(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName,l=e.getCoordinates(),u=l.length,c=new Array(u);for(let h=0;h<u;++h){const f=l[h];c[h]=this.getCoords_(f,a,o)}Qe(t,c.join(" "))}writeCurveSegments_(t,e,n){const i=wt(t.namespaceURI,"LineStringSegment");t.appendChild(i),this.writeCurveOrLineString(i,e,n)}writeSurfaceOrPolygon(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName;if(t.nodeName!=="PolygonPatch"&&a&&t.setAttribute("srsName",a),t.nodeName==="Polygon"||t.nodeName==="PolygonPatch"){const l=e.getLinearRings();ke({node:t,hasZ:o,srsName:a},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,l,n,void 0,this)}else if(t.nodeName==="Surface"){const l=wt(t.namespaceURI,"patches");t.appendChild(l),this.writeSurfacePatches_(l,e,n)}}RING_NODE_FACTORY_(t,e,n){const i=e[e.length-1],o=i.node,a=i.exteriorWritten;return a===void 0&&(i.exteriorWritten=!0),wt(o.namespaceURI,a!==void 0?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(t,e,n){const i=wt(t.namespaceURI,"PolygonPatch");t.appendChild(i),this.writeSurfaceOrPolygon(i,e,n)}writeRing(t,e,n){const i=wt(t.namespaceURI,"LinearRing");t.appendChild(i),this.writeLinearRing(i,e,n)}getCoords_(t,e,n){let i="enu";e&&(i=gt(e).getAxisOrientation());let o=i.substr(0,2)==="en"?t[0]+","+t[1]:t[1]+","+t[0];if(n){const a=t[2]||0;o+=","+a}return o}writePoint(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName;a&&t.setAttribute("srsName",a);const l=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(l);const u=e.getCoordinates(),c=this.getCoords_(u,a,o);Qe(l,c)}writeMultiPoint(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName;a&&t.setAttribute("srsName",a);const l=e.getPoints();ke({node:t,hasZ:o,srsName:a},this.POINTMEMBER_SERIALIZERS,Vr("pointMember"),l,n,void 0,this)}writePointMember(t,e,n){const i=wt(t.namespaceURI,"Point");t.appendChild(i),this.writePoint(i,e,n)}writeLinearRing(t,e,n){const o=n[n.length-1].srsName;o&&t.setAttribute("srsName",o);const a=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(a),this.writeCoordinates_(a,e,n)}writeMultiSurfaceOrPolygon(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName,l=i.surface;a&&t.setAttribute("srsName",a);const u=e.getPolygons();ke({node:t,hasZ:o,srsName:a,surface:l},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,u,n,void 0,this)}writeSurfaceOrPolygonMember(t,e,n){const i=this.GEOMETRY_NODE_FACTORY_(e,n);i&&(t.appendChild(i),this.writeSurfaceOrPolygon(i,e,n))}writeEnvelope(t,e,n){const o=n[n.length-1].srsName;o&&t.setAttribute("srsName",o);const a=["lowerCorner","upperCorner"],l=[e[0]+" "+e[1],e[2]+" "+e[3]];ke({node:t},this.ENVELOPE_SERIALIZERS,_1,l,n,a,this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(t,e,n){const i=e[e.length-1].node;return wt("http://www.opengis.net/gml",kF[i.nodeName])}}Gt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:lt(Gt.prototype.readFlatCoordinates)}},Gt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:Gt.prototype.innerBoundaryIsParser,outerBoundaryIs:Gt.prototype.outerBoundaryIsParser}},Gt.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:mt(Gt.prototype.readFlatCoordinates)}},Gt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:lt(St.prototype.readPoint),MultiPoint:lt(St.prototype.readMultiPoint),LineString:lt(St.prototype.readLineString),MultiLineString:lt(St.prototype.readMultiLineString),LinearRing:lt(St.prototype.readLinearRing),Polygon:lt(St.prototype.readPolygon),MultiPolygon:lt(St.prototype.readMultiPolygon),Box:lt(Gt.prototype.readBox)}},Gt.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:k(Gt.prototype.writeCurveOrLineString),MultiCurve:k(Gt.prototype.writeMultiCurveOrLineString),Point:k(Gt.prototype.writePoint),MultiPoint:k(Gt.prototype.writeMultiPoint),LineString:k(Gt.prototype.writeCurveOrLineString),MultiLineString:k(Gt.prototype.writeMultiCurveOrLineString),LinearRing:k(Gt.prototype.writeLinearRing),Polygon:k(Gt.prototype.writeSurfaceOrPolygon),MultiPolygon:k(Gt.prototype.writeMultiSurfaceOrPolygon),Surface:k(Gt.prototype.writeSurfaceOrPolygon),MultiSurface:k(Gt.prototype.writeMultiSurfaceOrPolygon),Envelope:k(Gt.prototype.writeEnvelope)}},Gt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:k(Gt.prototype.writeLineStringOrCurveMember),curveMember:k(Gt.prototype.writeLineStringOrCurveMember)}},Gt.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:k(Gt.prototype.writeRing),innerBoundaryIs:k(Gt.prototype.writeRing)}},Gt.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:k(Gt.prototype.writePointMember)}},Gt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:k(Gt.prototype.writeSurfaceOrPolygonMember),polygonMember:k(Gt.prototype.writeSurfaceOrPolygonMember)}},Gt.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:k(Qe),upperCorner:k(Qe)}};const th=Gt,zF=fo+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",UF={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class tt extends St{constructor(t){t=t||{},super(t),this.surface_=t.surface!==void 0?t.surface:!1,this.curve_=t.curve!==void 0?t.curve:!1,this.multiCurve_=t.multiCurve!==void 0?t.multiCurve:!0,this.multiSurface_=t.multiSurface!==void 0?t.multiSurface:!0,this.schemaLocation=t.schemaLocation?t.schemaLocation:zF,this.hasZ=t.hasZ!==void 0?t.hasZ:!1}readMultiCurve(t,e){const n=ne([],this.MULTICURVE_PARSERS,t,e,this);if(n)return new ja(n)}readFlatCurveRing(t,e){const n=ne([],this.MULTICURVE_PARSERS,t,e,this),i=[];for(let o=0,a=n.length;o<a;++o)Pn(i,n[o].getFlatCoordinates());return i}readMultiSurface(t,e){const n=ne([],this.MULTISURFACE_PARSERS,t,e,this);if(n)return new Wa(n)}curveMemberParser(t,e){Ja(this.CURVEMEMBER_PARSERS,t,e,this)}surfaceMemberParser(t,e){Ja(this.SURFACEMEMBER_PARSERS,t,e,this)}readPatch(t,e){return ne([null],this.PATCHES_PARSERS,t,e,this)}readSegment(t,e){return ne([],this.SEGMENTS_PARSERS,t,e,this)}readPolygonPatch(t,e){return ne([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)}readLineStringSegment(t,e){return ne([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)}interiorParser(t,e){const n=ne(void 0,this.RING_PARSERS,t,e,this);n&&e[e.length-1].push(n)}exteriorParser(t,e){const n=ne(void 0,this.RING_PARSERS,t,e,this);if(n){const i=e[e.length-1];i[0]=n}}readSurface(t,e){const n=ne([null],this.SURFACE_PARSERS,t,e,this);if(n&&n[0]){const i=n[0],o=[i.length];let a,l;for(a=1,l=n.length;a<l;++a)Pn(i,n[a]),o.push(i.length);return new ar(i,"XYZ",o)}}readCurve(t,e){const n=ne([null],this.CURVE_PARSERS,t,e,this);if(n)return new Sr(n,"XYZ")}readEnvelope(t,e){const n=ne([null],this.ENVELOPE_PARSERS,t,e,this);return ii(n[1][0],n[1][1],n[2][0],n[2][1])}readFlatPos(t,e){let n=$c(t,!1);const i=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];let a;for(;a=i.exec(n);)o.push(parseFloat(a[1])),n=n.substr(a[0].length);if(n!=="")return;const u=e[0].srsName;let c="enu";if(u&&(c=gt(u).getAxisOrientation()),c==="neu"){let f,d;for(f=0,d=o.length;f<d;f+=3){const g=o[f],p=o[f+1];o[f]=p,o[f+1]=g}}const h=o.length;if(h==2&&o.push(0),h!==0)return o}readFlatPosList(t,e){const n=$c(t,!1).replace(/^\s*|\s*$/g,""),i=e[0],o=i.srsName,a=i.srsDimension;let l="enu";o&&(l=gt(o).getAxisOrientation());const u=n.split(/\s+/);let c=2;t.getAttribute("srsDimension")?c=cu(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=cu(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=cu(t.parentNode.getAttribute("srsDimension")):a&&(c=cu(a));let h,f,d;const g=[];for(let p=0,m=u.length;p<m;p+=c)h=parseFloat(u[p]),f=parseFloat(u[p+1]),d=c===3?parseFloat(u[p+2]):0,l.substr(0,2)==="en"?g.push(h,f,d):g.push(f,h,d);return g}writePos_(t,e,n){const i=n[n.length-1],o=i.hasZ,a=o?"3":"2";t.setAttribute("srsDimension",a);const l=i.srsName;let u="enu";l&&(u=gt(l).getAxisOrientation());const c=e.getCoordinates();let h;if(u.substr(0,2)==="en"?h=c[0]+" "+c[1]:h=c[1]+" "+c[0],o){const f=c[2]||0;h+=" "+f}Qe(t,h)}getCoords_(t,e,n){let i="enu";e&&(i=gt(e).getAxisOrientation());let o=i.substr(0,2)==="en"?t[0]+" "+t[1]:t[1]+" "+t[0];if(n){const a=t[2]||0;o+=" "+a}return o}writePosList_(t,e,n){const i=n[n.length-1],o=i.hasZ,a=o?"3":"2";t.setAttribute("srsDimension",a);const l=i.srsName,u=e.getCoordinates(),c=u.length,h=new Array(c);let f;for(let d=0;d<c;++d)f=u[d],h[d]=this.getCoords_(f,l,o);Qe(t,h.join(" "))}writePoint(t,e,n){const o=n[n.length-1].srsName;o&&t.setAttribute("srsName",o);const a=wt(t.namespaceURI,"pos");t.appendChild(a),this.writePos_(a,e,n)}writeEnvelope(t,e,n){const o=n[n.length-1].srsName;o&&t.setAttribute("srsName",o);const a=["lowerCorner","upperCorner"],l=[e[0]+" "+e[1],e[2]+" "+e[3]];ke({node:t},this.ENVELOPE_SERIALIZERS,_1,l,n,a,this)}writeLinearRing(t,e,n){const o=n[n.length-1].srsName;o&&t.setAttribute("srsName",o);const a=wt(t.namespaceURI,"posList");t.appendChild(a),this.writePosList_(a,e,n)}RING_NODE_FACTORY_(t,e,n){const i=e[e.length-1],o=i.node,a=i.exteriorWritten;return a===void 0&&(i.exteriorWritten=!0),wt(o.namespaceURI,a!==void 0?"interior":"exterior")}writeSurfaceOrPolygon(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName;if(t.nodeName!=="PolygonPatch"&&a&&t.setAttribute("srsName",a),t.nodeName==="Polygon"||t.nodeName==="PolygonPatch"){const l=e.getLinearRings();ke({node:t,hasZ:o,srsName:a},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,l,n,void 0,this)}else if(t.nodeName==="Surface"){const l=wt(t.namespaceURI,"patches");t.appendChild(l),this.writeSurfacePatches_(l,e,n)}}writeCurveOrLineString(t,e,n){const o=n[n.length-1].srsName;if(t.nodeName!=="LineStringSegment"&&o&&t.setAttribute("srsName",o),t.nodeName==="LineString"||t.nodeName==="LineStringSegment"){const a=wt(t.namespaceURI,"posList");t.appendChild(a),this.writePosList_(a,e,n)}else if(t.nodeName==="Curve"){const a=wt(t.namespaceURI,"segments");t.appendChild(a),this.writeCurveSegments_(a,e,n)}}writeMultiSurfaceOrPolygon(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName,l=i.surface;a&&t.setAttribute("srsName",a);const u=e.getPolygons();ke({node:t,hasZ:o,srsName:a,surface:l},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,u,n,void 0,this)}writeMultiPoint(t,e,n){const i=n[n.length-1],o=i.srsName,a=i.hasZ;o&&t.setAttribute("srsName",o);const l=e.getPoints();ke({node:t,hasZ:a,srsName:o},this.POINTMEMBER_SERIALIZERS,Vr("pointMember"),l,n,void 0,this)}writeMultiCurveOrLineString(t,e,n){const i=n[n.length-1],o=i.hasZ,a=i.srsName,l=i.curve;a&&t.setAttribute("srsName",a);const u=e.getLineStrings();ke({node:t,hasZ:o,srsName:a,curve:l},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,u,n,void 0,this)}writeRing(t,e,n){const i=wt(t.namespaceURI,"LinearRing");t.appendChild(i),this.writeLinearRing(i,e,n)}writeSurfaceOrPolygonMember(t,e,n){const i=this.GEOMETRY_NODE_FACTORY_(e,n);i&&(t.appendChild(i),this.writeSurfaceOrPolygon(i,e,n))}writePointMember(t,e,n){const i=wt(t.namespaceURI,"Point");t.appendChild(i),this.writePoint(i,e,n)}writeLineStringOrCurveMember(t,e,n){const i=this.GEOMETRY_NODE_FACTORY_(e,n);i&&(t.appendChild(i),this.writeCurveOrLineString(i,e,n))}writeSurfacePatches_(t,e,n){const i=wt(t.namespaceURI,"PolygonPatch");t.appendChild(i),this.writeSurfaceOrPolygon(i,e,n)}writeCurveSegments_(t,e,n){const i=wt(t.namespaceURI,"LineStringSegment");t.appendChild(i),this.writeCurveOrLineString(i,e,n)}writeGeometryElement(t,e,n){const i=n[n.length-1],o=Object.assign({},i);o.node=t;let a;Array.isArray(e)?a=fy(e,i):a=co(e,!0,i),ke(o,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[a],n,void 0,this)}writeFeatureElement(t,e,n){const i=e.getId();i&&t.setAttribute("fid",i);const o=n[n.length-1],a=o.featureNS,l=e.getGeometryName();o.serializers||(o.serializers={},o.serializers[a]={});const u=[],c=[];if(e.hasProperties()){const f=e.getProperties();for(const d in f){const g=f[d];g!==null&&(u.push(d),c.push(g),d==l||typeof g.getSimplifiedGeometry=="function"?d in o.serializers[a]||(o.serializers[a][d]=k(this.writeGeometryElement,this)):d in o.serializers[a]||(o.serializers[a][d]=k(Qe)))}}const h=Object.assign({},o);h.node=t,ke(h,o.serializers,Vr(void 0,a),c,n,u)}writeFeatureMembers_(t,e,n){const i=n[n.length-1],o=i.featureType,a=i.featureNS,l={};l[a]={},l[a][o]=k(this.writeFeatureElement,this);const u=Object.assign({},i);u.node=t,ke(u,l,Vr(o,a),e,n)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(t,e,n){const i=e[e.length-1].node;return wt(this.namespace,UF[i.nodeName])}GEOMETRY_NODE_FACTORY_(t,e,n){const i=e[e.length-1],o=i.multiSurface,a=i.surface,l=i.curve,u=i.multiCurve;return Array.isArray(t)?n="Envelope":(n=t.getType(),n==="MultiPolygon"&&o===!0?n="MultiSurface":n==="Polygon"&&a===!0?n="Surface":n==="LineString"&&l===!0?n="Curve":n==="MultiLineString"&&u===!0&&(n="MultiCurve")),wt(this.namespace,n)}writeGeometryNode(t,e){e=this.adaptOptions(e);const n=wt(this.namespace,"geom"),i={node:n,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&Object.assign(i,e),this.writeGeometryElement(n,t,[i]),n}writeFeaturesNode(t,e){e=this.adaptOptions(e);const n=wt(this.namespace,"featureMembers");n.setAttributeNS(_y,"xsi:schemaLocation",this.schemaLocation);const i={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&Object.assign(i,e),this.writeFeatureMembers_(n,t,[i]),n}}tt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:lt(tt.prototype.readFlatPos),posList:lt(tt.prototype.readFlatPosList),coordinates:lt(th.prototype.readFlatCoordinates)}},tt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:tt.prototype.interiorParser,exterior:tt.prototype.exteriorParser}},tt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:lt(St.prototype.readPoint),MultiPoint:lt(St.prototype.readMultiPoint),LineString:lt(St.prototype.readLineString),MultiLineString:lt(St.prototype.readMultiLineString),LinearRing:lt(St.prototype.readLinearRing),Polygon:lt(St.prototype.readPolygon),MultiPolygon:lt(St.prototype.readMultiPolygon),Surface:lt(tt.prototype.readSurface),MultiSurface:lt(tt.prototype.readMultiSurface),Curve:lt(tt.prototype.readCurve),MultiCurve:lt(tt.prototype.readMultiCurve),Envelope:lt(tt.prototype.readEnvelope)}},tt.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:mt(tt.prototype.curveMemberParser),curveMembers:mt(tt.prototype.curveMemberParser)}},tt.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:mt(tt.prototype.surfaceMemberParser),surfaceMembers:mt(tt.prototype.surfaceMemberParser)}},tt.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:mt(St.prototype.readLineString),Curve:mt(tt.prototype.readCurve)}},tt.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:mt(St.prototype.readPolygon),Surface:mt(tt.prototype.readSurface)}},tt.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:lt(tt.prototype.readPatch)}},tt.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:lt(tt.prototype.readSegment)}},tt.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:mt(tt.prototype.readFlatPosList),upperCorner:mt(tt.prototype.readFlatPosList)}},tt.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:lt(tt.prototype.readPolygonPatch)}},tt.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:y1(tt.prototype.readLineStringSegment)}},St.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:lt(St.prototype.readFlatLinearRing),Ring:lt(tt.prototype.readFlatCurveRing)}},tt.prototype.writeFeatures,tt.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:k(tt.prototype.writeRing),interior:k(tt.prototype.writeRing)}},tt.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:k(Qe),upperCorner:k(Qe)}},tt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:k(tt.prototype.writeSurfaceOrPolygonMember),polygonMember:k(tt.prototype.writeSurfaceOrPolygonMember)}},tt.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:k(tt.prototype.writePointMember)}},tt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:k(tt.prototype.writeLineStringOrCurveMember),curveMember:k(tt.prototype.writeLineStringOrCurveMember)}},tt.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:k(tt.prototype.writeCurveOrLineString),MultiCurve:k(tt.prototype.writeMultiCurveOrLineString),Point:k(tt.prototype.writePoint),MultiPoint:k(tt.prototype.writeMultiPoint),LineString:k(tt.prototype.writeCurveOrLineString),MultiLineString:k(tt.prototype.writeMultiCurveOrLineString),LinearRing:k(tt.prototype.writeLinearRing),Polygon:k(tt.prototype.writeSurfaceOrPolygon),MultiPolygon:k(tt.prototype.writeMultiSurfaceOrPolygon),Surface:k(tt.prototype.writeSurfaceOrPolygon),MultiSurface:k(tt.prototype.writeMultiSurfaceOrPolygon),Envelope:k(tt.prototype.writeEnvelope)}};const Ct=tt,xy=Ct;xy.prototype.writeFeatures,xy.prototype.writeFeaturesNode;const VF=xy;class jF extends fd{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(yd(t),this.adaptOptions(e))}readFeatureFromText(t,e){return at()}readFeatures(t,e){return this.readFeaturesFromText(yd(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return at()}readGeometry(t,e){return this.readGeometryFromText(yd(t),this.adaptOptions(e))}readGeometryFromText(t,e){return at()}readProjection(t){return this.readProjectionFromText(yd(t))}readProjectionFromText(t){return this.dataProjection}writeFeature(t,e){return this.writeFeatureText(t,this.adaptOptions(e))}writeFeatureText(t,e){return at()}writeFeatures(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))}writeFeaturesText(t,e){return at()}writeGeometry(t,e){return this.writeGeometryText(t,this.adaptOptions(e))}writeGeometryText(t,e){return at()}}function yd(r){return typeof r=="string"?r:""}const WF=jF;class Wt extends Ct{constructor(t){t=t||{},super(t),this.schemaLocation=t.schemaLocation?t.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}writeGeometryElement(t,e,n){const i=n[n.length-1];n[n.length-1]=Object.assign({multiCurve:!0,multiSurface:!0},i),super.writeGeometryElement(t,e,n)}}Wt.prototype.namespace="http://www.opengis.net/gml/3.2",Wt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:lt(Ct.prototype.readFlatPos),posList:lt(Ct.prototype.readFlatPosList),coordinates:lt(th.prototype.readFlatCoordinates)}},Wt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Ct.prototype.interiorParser,exterior:Ct.prototype.exteriorParser}},Wt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:lt(St.prototype.readPoint),MultiPoint:lt(St.prototype.readMultiPoint),LineString:lt(St.prototype.readLineString),MultiLineString:lt(St.prototype.readMultiLineString),LinearRing:lt(St.prototype.readLinearRing),Polygon:lt(St.prototype.readPolygon),MultiPolygon:lt(St.prototype.readMultiPolygon),Surface:lt(Wt.prototype.readSurface),MultiSurface:lt(Ct.prototype.readMultiSurface),Curve:lt(Wt.prototype.readCurve),MultiCurve:lt(Ct.prototype.readMultiCurve),Envelope:lt(Wt.prototype.readEnvelope)}},Wt.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:mt(Ct.prototype.curveMemberParser),curveMembers:mt(Ct.prototype.curveMemberParser)}},Wt.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:mt(Ct.prototype.surfaceMemberParser),surfaceMembers:mt(Ct.prototype.surfaceMemberParser)}},Wt.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:mt(St.prototype.readLineString),Curve:mt(Ct.prototype.readCurve)}},Wt.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:mt(St.prototype.readPolygon),Surface:mt(Ct.prototype.readSurface)}},Wt.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:lt(Ct.prototype.readPatch)}},Wt.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:lt(Ct.prototype.readSegment)}},Wt.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:mt(Ct.prototype.readFlatPosList),upperCorner:mt(Ct.prototype.readFlatPosList)}},Wt.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:lt(Ct.prototype.readPolygonPatch)}},Wt.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:y1(Ct.prototype.readLineStringSegment)}},Wt.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:mt(St.prototype.pointMemberParser),pointMembers:mt(St.prototype.pointMemberParser)}},Wt.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:mt(St.prototype.lineStringMemberParser),lineStringMembers:mt(St.prototype.lineStringMemberParser)}},Wt.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:mt(St.prototype.polygonMemberParser),polygonMembers:mt(St.prototype.polygonMemberParser)}},Wt.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:mt(St.prototype.readFlatCoordinatesFromNode)}},Wt.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:mt(St.prototype.readLineString)}},Wt.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:mt(St.prototype.readPolygon)}},Wt.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:lt(St.prototype.readFlatLinearRing),Ring:lt(Wt.prototype.readFlatCurveRing)}},Wt.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:k(Ct.prototype.writeRing),interior:k(Ct.prototype.writeRing)}},Wt.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:k(Qe),upperCorner:k(Qe)}},Wt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:k(Ct.prototype.writeSurfaceOrPolygonMember),polygonMember:k(Ct.prototype.writeSurfaceOrPolygonMember)}},Wt.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:k(Ct.prototype.writePointMember)}},Wt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:k(Ct.prototype.writeLineStringOrCurveMember),curveMember:k(Ct.prototype.writeLineStringOrCurveMember)}},Wt.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:k(Ct.prototype.writeCurveOrLineString),MultiCurve:k(Ct.prototype.writeMultiCurveOrLineString),Point:k(Wt.prototype.writePoint),MultiPoint:k(Ct.prototype.writeMultiPoint),LineString:k(Ct.prototype.writeCurveOrLineString),MultiLineString:k(Ct.prototype.writeMultiCurveOrLineString),LinearRing:k(Ct.prototype.writeLinearRing),Polygon:k(Ct.prototype.writeSurfaceOrPolygon),MultiPolygon:k(Ct.prototype.writeMultiSurfaceOrPolygon),Surface:k(Ct.prototype.writeSurfaceOrPolygon),MultiSurface:k(Ct.prototype.writeMultiSurfaceOrPolygon),Envelope:k(Ct.prototype.writeEnvelope)}};const wy=Wt;class YF{constructor(t){this.tagName_=t}getTagName(){return this.tagName_}}const x1=YF;class XF extends x1{constructor(t,e){super(t),this.conditions=e,xt(this.conditions.length>=2,"At least 2 conditions are required")}}const HF=XF;class qF extends HF{constructor(t){super("And",Array.prototype.slice.call(arguments))}}const ZF=qF;class KF extends x1{constructor(t,e,n){if(super("BBOX"),this.geometryName=t,this.extent=e,e.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=n}}const JF=KF;function QF(r){const t=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(ZF,t))}function $F(r,t,e){return new JF(r,t,e)}const w1={"http://www.opengis.net/gml":{boundedBy:ji(St.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:mt(St.prototype.readFeaturesInternal)}},tD={"http://www.opengis.net/wfs":{totalInserted:ji(uu),totalUpdated:ji(uu),totalDeleted:ji(uu)},"http://www.opengis.net/wfs/2.0":{totalInserted:ji(uu),totalUpdated:ji(uu),totalDeleted:ji(uu)}},eD={"http://www.opengis.net/wfs":{TransactionSummary:ji(T1,"transactionSummary"),InsertResults:ji(P1,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:ji(T1,"transactionSummary"),InsertResults:ji(P1,"insertIds")}},nD={"http://www.opengis.net/wfs":{PropertyName:k(Qe)},"http://www.opengis.net/wfs/2.0":{PropertyName:k(Qe)}},S1={"http://www.opengis.net/wfs":{Insert:k(b1),Update:k(M1),Delete:k(L1),Property:k(N1),Native:k(O1)},"http://www.opengis.net/wfs/2.0":{Insert:k(b1),Update:k(M1),Delete:k(L1),Property:k(N1),Native:k(O1)}},C1="feature",Sy="http://www.w3.org/2000/xmlns/",Cy={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},Iy={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},Ty={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},I1={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Ry={"2.0.0":wy,"1.1.0":Ct,"1.0.0":th},rD="1.1.0";class iD extends E1{constructor(t){super(),t=t||{},this.version_=t.version?t.version:rD,this.featureType_=t.featureType,this.featureNS_=t.featureNS,this.gmlFormat_=t.gmlFormat?t.gmlFormat:new Ry[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:I1[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(t){this.featureType_=t}readFeaturesFromNode(t,e){const n={node:t};Object.assign(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object.assign(n,this.getReadOptions(t,e||{}));const i=[n];let o;this.version_==="2.0.0"?o=w1:o=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let a=ne([],o,t,i,this.gmlFormat_);return a||(a=[]),a}readTransactionResponse(t){if(t){if(typeof t=="string"){const e=lu(t);return this.readTransactionResponseFromDocument(e)}return au(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}}readFeatureCollectionMetadata(t){if(t){if(typeof t=="string"){const e=lu(t);return this.readFeatureCollectionMetadataFromDocument(e)}return au(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}}readFeatureCollectionMetadataFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)}readFeatureCollectionMetadataFromNode(t){const e={},n=cu(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,ne(e,w1,t,[],this.gmlFormat_)}readTransactionResponseFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)}readTransactionResponseFromNode(t){return ne({},eD,t,[])}writeGetFeature(t){const e=wt(Iy[this.version_],"GetFeature");e.setAttribute("service","WFS"),e.setAttribute("version",this.version_),t.handle&&e.setAttribute("handle",t.handle),t.outputFormat&&e.setAttribute("outputFormat",t.outputFormat),t.maxFeatures!==void 0&&e.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&e.setAttribute("resultType",t.resultType),t.startIndex!==void 0&&e.setAttribute("startIndex",String(t.startIndex)),t.count!==void 0&&e.setAttribute("count",String(t.count)),t.viewParams!==void 0&&e.setAttribute("viewParams",t.viewParams),e.setAttributeNS(_y,"xsi:schemaLocation",this.schemaLocation_);const n={node:e};if(Object.assign(n,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),xt(Array.isArray(t.featureTypes),"`options.featureTypes` must be an Array"),typeof t.featureTypes[0]=="string"){let i=t.filter;t.bbox&&(xt(t.geometryName,"`options.geometryName` must also be provided when `options.bbox` is set"),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object.assign(n,{geometryName:t.geometryName,filter:i}),W1(e,t.featureTypes,[n])}else t.featureTypes.forEach(i=>{const o=this.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object.assign(n,{geometryName:i.geometryName,filter:o}),W1(e,[i.name],[n])});return e}combineBboxAndFilter(t,e,n,i){const o=$F(t,e,n);return i?QF(i,o):o}writeTransaction(t,e,n,i){const o=[],a=i.version?i.version:this.version_,l=wt(Iy[a],"Transaction");l.setAttribute("service","WFS"),l.setAttribute("version",a);let u;i&&(u=i.gmlOptions?i.gmlOptions:{},i.handle&&l.setAttribute("handle",i.handle)),l.setAttributeNS(_y,"xsi:schemaLocation",I1[a]);const c=sD(l,u,a,i);return t&&_d("Insert",t,o,c),e&&_d("Update",e,o,c),n&&_d("Delete",n,o,c),i.nativeElements&&_d("Native",i.nativeElements,o,c),l}readProjectionFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null}readProjectionFromNode(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild){t=t.firstElementChild.firstElementChild;for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(!(e.childNodes.length===0||e.childNodes.length===1&&e.firstChild.nodeType===3)){const n=[{}];return this.gmlFormat_.readGeometryElement(e,n),gt(n.pop().srsName)}}return null}}function sD(r,t,e,n){const i=n.featurePrefix?n.featurePrefix:C1;let o;return e==="1.0.0"?o=2:e==="1.1.0"?o=3:e==="2.0.0"&&(o=3.2),Object.assign({node:r},{version:e,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:i,gmlVersion:o,hasZ:n.hasZ,srsName:n.srsName},t)}function _d(r,t,e,n){ke(n,S1,Vr(r),t,e)}function T1(r,t){return ne({},tD,r,t)}const oD={"http://www.opengis.net/ogc":{FeatureId:mt(function(r,t){return r.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:mt(function(r,t){return r.getAttribute("fid")})}};function R1(r,t){Ja(oD,r,t)}const aD={"http://www.opengis.net/wfs":{Feature:R1},"http://www.opengis.net/wfs/2.0":{Feature:R1}};function P1(r,t){return ne([],aD,r,t)}function b1(r,t,e){const n=e[e.length-1],i=n.featureType,o=n.featureNS,a=n.gmlVersion,l=wt(o,i);r.appendChild(l),a===2?th.prototype.writeFeatureElement(l,t,e):a===3?Ct.prototype.writeFeatureElement(l,t,e):wy.prototype.writeFeatureElement(l,t,e)}function A1(r,t,e){const i=e[e.length-1].version,o=Cy[i],a=wt(o,"Filter"),l=wt(o,"FeatureId");a.appendChild(l),l.setAttribute("fid",t),r.appendChild(a)}function Py(r,t){r=r||C1;const e=r+":";return t.startsWith(e)?t:e+t}function L1(r,t,e){const n=e[e.length-1];xt(t.getId()!==void 0,"Features must have an id set");const i=n.featureType,o=n.featurePrefix,a=n.featureNS,l=Py(o,i);r.setAttribute("typeName",l),r.setAttributeNS(Sy,"xmlns:"+o,a);const u=t.getId();u!==void 0&&A1(r,u,e)}function M1(r,t,e){const n=e[e.length-1];xt(t.getId()!==void 0,"Features must have an id set");const i=n.version,o=n.featureType,a=n.featurePrefix,l=n.featureNS,u=Py(a,o),c=t.getGeometryName();r.setAttribute("typeName",u),r.setAttributeNS(Sy,"xmlns:"+a,l);const h=t.getId();if(h!==void 0){const f=t.getKeys(),d=[];for(let g=0,p=f.length;g<p;g++){const m=t.get(f[g]);if(m!==void 0){let y=f[g];m&&typeof m.getSimplifiedGeometry=="function"&&(y=c),d.push({name:y,value:m})}}ke({version:i,gmlVersion:n.gmlVersion,node:r,hasZ:n.hasZ,srsName:n.srsName},S1,Vr("Property"),d,e),A1(r,h,e)}}function N1(r,t,e){const n=e[e.length-1],i=n.version,o=Iy[i],l=wt(o,i==="2.0.0"?"ValueReference":"Name"),u=n.gmlVersion;if(r.appendChild(l),Qe(l,t.name),t.value!==void 0&&t.value!==null){const c=wt(o,"Value");r.appendChild(c),t.value&&typeof t.value.getSimplifiedGeometry=="function"?u===2?th.prototype.writeGeometryElement(c,t.value,e):u===3?Ct.prototype.writeGeometryElement(c,t.value,e):wy.prototype.writeGeometryElement(c,t.value,e):Qe(c,t.value)}}function O1(r,t,e){t.vendorId&&r.setAttribute("vendorId",t.vendorId),t.safeToIgnore!==void 0&&r.setAttribute("safeToIgnore",String(t.safeToIgnore)),t.value!==void 0&&Qe(r,t.value)}const vd={"http://www.opengis.net/wfs":{Query:k(F1)},"http://www.opengis.net/wfs/2.0":{Query:k(F1)},"http://www.opengis.net/ogc":{During:k(G1),And:k(Ed),Or:k(Ed),Not:k(k1),BBOX:k(D1),Contains:k($o),Intersects:k($o),Within:k($o),DWithin:k(B1),PropertyIsEqualTo:k(ai),PropertyIsNotEqualTo:k(ai),PropertyIsLessThan:k(ai),PropertyIsLessThanOrEqualTo:k(ai),PropertyIsGreaterThan:k(ai),PropertyIsGreaterThanOrEqualTo:k(ai),PropertyIsNull:k(z1),PropertyIsBetween:k(U1),PropertyIsLike:k(V1)},"http://www.opengis.net/fes/2.0":{During:k(G1),And:k(Ed),Or:k(Ed),Not:k(k1),BBOX:k(D1),Contains:k($o),Disjoint:k($o),Intersects:k($o),ResourceId:k(uD),Within:k($o),DWithin:k(B1),PropertyIsEqualTo:k(ai),PropertyIsNotEqualTo:k(ai),PropertyIsLessThan:k(ai),PropertyIsLessThanOrEqualTo:k(ai),PropertyIsGreaterThan:k(ai),PropertyIsGreaterThanOrEqualTo:k(ai),PropertyIsNull:k(z1),PropertyIsBetween:k(U1),PropertyIsLike:k(V1)}};function F1(r,t,e){const n=e[e.length-1],i=n.version,o=n.featurePrefix,a=n.featureNS,l=n.propertyNames,u=n.srsName;let c;o?c=Py(o,t):c=t;let h;i==="2.0.0"?h="typeNames":h="typeName",r.setAttribute(h,c),u&&r.setAttribute("srsName",u),a&&r.setAttributeNS(Sy,"xmlns:"+o,a);const f=Object.assign({},n);f.node=r,ke(f,nD,Vr("PropertyName"),l,e);const d=n.filter;if(d){const g=wt(Sd(i),"Filter");r.appendChild(g),lD(g,d,e)}}function lD(r,t,e){const n=e[e.length-1],i={node:r};Object.assign(i,{context:n}),ke(i,vd,Vr(t.getTagName()),[t],e)}function D1(r,t,e){const n=e[e.length-1],o=n.context.version;n.srsName=t.srsName;const a=Ry[o];hu(o,r,t.geometryName),a.prototype.writeGeometryElement(r,t.extent,e)}function uD(r,t,e){r.setAttribute("rid",t.rid)}function $o(r,t,e){const n=e[e.length-1],o=n.context.version;n.srsName=t.srsName;const a=Ry[o];hu(o,r,t.geometryName),a.prototype.writeGeometryElement(r,t.geometry,e)}function B1(r,t,e){const o=e[e.length-1].context.version;$o(r,t,e);const a=wt(Sd(o),"Distance");Qe(a,t.distance.toString()),o==="2.0.0"?a.setAttribute("uom",t.unit):a.setAttribute("units",t.unit),r.appendChild(a)}function G1(r,t,e){const o=e[e.length-1].context.version;xd(Ty[o],"ValueReference",r,t.propertyName);const a=wt(fo,"TimePeriod");r.appendChild(a);const l=wt(fo,"begin");a.appendChild(l),j1(l,t.begin);const u=wt(fo,"end");a.appendChild(u),j1(u,t.end)}function Ed(r,t,e){const i=e[e.length-1].context,o={node:r};Object.assign(o,{context:i});const a=t.conditions;for(let l=0,u=a.length;l<u;++l){const c=a[l];ke(o,vd,Vr(c.getTagName()),[c],e)}}function k1(r,t,e){const i=e[e.length-1].context,o={node:r};Object.assign(o,{context:i});const a=t.condition;ke(o,vd,Vr(a.getTagName()),[a],e)}function ai(r,t,e){const o=e[e.length-1].context.version;t.matchCase!==void 0&&r.setAttribute("matchCase",t.matchCase.toString()),hu(o,r,t.propertyName),wd(o,r,""+t.expression)}function z1(r,t,e){const o=e[e.length-1].context.version;hu(o,r,t.propertyName)}function U1(r,t,e){const o=e[e.length-1].context.version,a=Sd(o);hu(o,r,t.propertyName);const l=wt(a,"LowerBoundary");r.appendChild(l),wd(o,l,""+t.lowerBoundary);const u=wt(a,"UpperBoundary");r.appendChild(u),wd(o,u,""+t.upperBoundary)}function V1(r,t,e){const o=e[e.length-1].context.version;r.setAttribute("wildCard",t.wildCard),r.setAttribute("singleChar",t.singleChar),r.setAttribute("escapeChar",t.escapeChar),t.matchCase!==void 0&&r.setAttribute("matchCase",t.matchCase.toString()),hu(o,r,t.propertyName),wd(o,r,""+t.pattern)}function xd(r,t,e,n){const i=wt(r,t);Qe(i,n),e.appendChild(i)}function wd(r,t,e){xd(Sd(r),"Literal",t,e)}function hu(r,t,e){r==="2.0.0"?xd(Ty[r],"ValueReference",t,e):xd(Cy[r],"PropertyName",t,e)}function j1(r,t){const e=wt(fo,"TimeInstant");r.appendChild(e);const n=wt(fo,"timePosition");e.appendChild(n),Qe(n,t)}function W1(r,t,e){const n=e[e.length-1],i=Object.assign({},n);i.node=r,ke(i,vd,Vr("Query"),t,e)}function Sd(r){let t;return r==="2.0.0"?t=Ty[r]:t=Cy[r],t}const Y1=iD,cD={POINT:or,LINESTRING:Sr,POLYGON:ar,MULTIPOINT:Uo,MULTILINESTRING:ja,MULTIPOLYGON:Wa},X1="EMPTY",H1="Z",q1="M",hD="ZM",Zt={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},fD={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class dD{constructor(t){this.wkt=t,this.index_=-1}isAlpha_(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return e=e!==void 0?e:!1,t>="0"&&t<="9"||t=="."&&!e}isWhiteSpace_(t){return t==" "||t==" "||t=="\r"||t==`
452
+ `}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let n=t,i;if(t=="(")i=Zt.LEFT_PAREN;else if(t==",")i=Zt.COMMA;else if(t==")")i=Zt.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")i=Zt.NUMBER,n=this.readNumber_();else if(this.isAlpha_(t))i=Zt.TEXT,n=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")i=Zt.EOF;else throw new Error("Unexpected character: "+t)}return{position:e,value:n,type:i}}readNumber_(){let t;const e=this.index_;let n=!1,i=!1;do t=="."?n=!0:(t=="e"||t=="E")&&(i=!0),t=this.nextChar_();while(this.isNumeric_(t,n)||!i&&(t=="e"||t=="E")||i&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}class gD{constructor(t){this.lexer_=t,this.token_={position:0,type:Zt.START},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(t){return this.token_.type==t}match(t){const e=this.isTokenType(t);return e&&this.consume_(),e}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let t="XY";const e=this.token_;if(this.isTokenType(Zt.TEXT)){const n=e.value;n===H1?t="XYZ":n===q1?t="XYM":n===hD&&(t="XYZM"),t!=="XY"&&this.consume_()}return t}parseGeometryCollectionText_(){if(this.match(Zt.LEFT_PAREN)){const t=[];do t.push(this.parseGeometry_());while(this.match(Zt.COMMA));if(this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(Zt.LEFT_PAREN)){const t=this.parsePoint_();if(this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(Zt.LEFT_PAREN)){const t=this.parsePointList_();if(this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(Zt.LEFT_PAREN)){const t=this.parseLineStringTextList_();if(this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(Zt.LEFT_PAREN)){let t;if(this.token_.type==Zt.LEFT_PAREN?t=this.parsePointTextList_():t=this.parsePointList_(),this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(Zt.LEFT_PAREN)){const t=this.parseLineStringTextList_();if(this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(Zt.LEFT_PAREN)){const t=this.parsePolygonTextList_();if(this.match(Zt.RIGHT_PAREN))return t}throw new Error(this.formatErrorMessage_())}parsePoint_(){const t=[],e=this.layout_.length;for(let n=0;n<e;++n){const i=this.token_;if(this.match(Zt.NUMBER))t.push(i.value);else break}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}parsePointList_(){const t=[this.parsePoint_()];for(;this.match(Zt.COMMA);)t.push(this.parsePoint_());return t}parsePointTextList_(){const t=[this.parsePointText_()];for(;this.match(Zt.COMMA);)t.push(this.parsePointText_());return t}parseLineStringTextList_(){const t=[this.parseLineStringText_()];for(;this.match(Zt.COMMA);)t.push(this.parseLineStringText_());return t}parsePolygonTextList_(){const t=[this.parsePolygonText_()];for(;this.match(Zt.COMMA);)t.push(this.parsePolygonText_());return t}isEmptyGeometry_(){const t=this.isTokenType(Zt.TEXT)&&this.token_.value==X1;return t&&this.consume_(),t}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const t=this.token_;if(this.match(Zt.TEXT)){const e=t.value;this.layout_=this.parseGeometryLayout_();const n=this.isEmptyGeometry_();if(e=="GEOMETRYCOLLECTION"){if(n)return new Rc([]);const a=this.parseGeometryCollectionText_();return new Rc(a)}const i=cD[e];if(!i)throw new Error("Invalid geometry type: "+e);let o;if(n)e=="POINT"?o=[NaN,NaN]:o=[];else switch(e){case"POINT":{o=this.parsePointText_();break}case"LINESTRING":{o=this.parseLineStringText_();break}case"POLYGON":{o=this.parsePolygonText_();break}case"MULTIPOINT":{o=this.parseMultiPointText_();break}case"MULTILINESTRING":{o=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{o=this.parseMultiPolygonText_();break}}return new i(o,this.layout_)}throw new Error(this.formatErrorMessage_())}}class pD extends WF{constructor(t){super(),t=t||{},this.splitCollection_=t.splitCollection!==void 0?t.splitCollection:!1}parse_(t){const e=new dD(t);return new gD(e).parse()}readFeatureFromText(t,e){const n=this.readGeometryFromText(t,e),i=new Ye;return i.setGeometry(n),i}readFeaturesFromText(t,e){let n=[];const i=this.readGeometryFromText(t,e);this.splitCollection_&&i.getType()=="GeometryCollection"?n=i.getGeometriesArray():n=[i];const o=[];for(let a=0,l=n.length;a<l;++a){const u=new Ye;u.setGeometry(n[a]),o.push(u)}return o}readGeometryFromText(t,e){const n=this.parse_(t);return co(n,!1,e)}writeFeatureText(t,e){const n=t.getGeometry();return n?this.writeGeometryText(n,e):""}writeFeaturesText(t,e){if(t.length==1)return this.writeFeatureText(t[0],e);const n=[];for(let o=0,a=t.length;o<a;++o)n.push(t[o].getGeometry());const i=new Rc(n);return this.writeGeometryText(i,e)}writeGeometryText(t,e){return J1(co(t,!0,e))}}function Z1(r){const t=r.getCoordinates();return t.length===0?"":t.join(" ")}function mD(r){const t=[],e=r.getPoints();for(let n=0,i=e.length;n<i;++n)t.push("("+Z1(e[n])+")");return t.join(",")}function yD(r){const t=[],e=r.getGeometries();for(let n=0,i=e.length;n<i;++n)t.push(J1(e[n]));return t.join(",")}function by(r){const t=r.getCoordinates(),e=[];for(let n=0,i=t.length;n<i;++n)e.push(t[n].join(" "));return e.join(",")}function _D(r){const t=[],e=r.getLineStrings();for(let n=0,i=e.length;n<i;++n)t.push("("+by(e[n])+")");return t.join(",")}function K1(r){const t=[],e=r.getLinearRings();for(let n=0,i=e.length;n<i;++n)t.push("("+by(e[n])+")");return t.join(",")}function vD(r){const t=[],e=r.getPolygons();for(let n=0,i=e.length;n<i;++n)t.push("("+K1(e[n])+")");return t.join(",")}function ED(r){const t=r.getLayout();let e="";return(t==="XYZ"||t==="XYZM")&&(e+=H1),(t==="XYM"||t==="XYZM")&&(e+=q1),e}const xD={Point:Z1,LineString:by,Polygon:K1,MultiPoint:mD,MultiLineString:_D,MultiPolygon:vD,GeometryCollection:yD};function J1(r){const t=r.getType(),e=xD[t],n=e(r);let i=fD[t];if(typeof r.getFlatCoordinates=="function"){const o=ED(r);o.length>0&&(i+=" "+o)}return n.length===0?i+" "+X1:i+"("+n+")"}const ws=pD,Ay=new ye({image:new lr({radius:5,fill:new Dt({color:"red"})})}),wD=new ye({fill:new Dt({color:"rgba(0, 0, 255, 1)"})}),Q1={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"};function $1(r,t={style:Ay}){let{field:e,style:n,labelField:i}=t;const a=new Qo().readFeatures(r);return a.forEach(l=>{let u="",c="";switch(e&&(u=l.getProperties()[e]),i&&(c=l.getProperties()[i]),l.getGeometry().getType()){case Q1.POINT:e?n=new ye({image:new lr({radius:15,fill:new Dt({color:`rgba(255, ${u}, ${u}, 1)`})}),text:i?new zf({font:"14 Arial",text:c.toString()||"",fill:new Dt({color:"white"}),stroke:new Je({color:"orange",width:"2"}),offsetX:0,offsetY:-10}):null}):n=Ay;break;case Q1.POLYGON:e?n=new ye({fill:new Dt({color:`rgba(255, ${u}, ${u}, 1)`})}):n=wD;break;default:n=Ay;break}l.setStyle(n)}),a}const tw=new ye({fill:new Dt({color:"rgba(255, 208, 75, 0.5)"}),stroke:new Je({color:"red",width:2}),image:new lr({radius:7,fill:new Dt({color:"#ffcc33"})})});function Ly(r,t,e){const n=[],a=t,l=(180-360)/360*Math.PI;var u,c,h;for(let f=0;f<100+1;++f){const d=f*1;u=l+d*2*Math.PI/100;let g=[];c=a[0]+e*Math.cos(u),h=a[1]+e*Math.sin(u),g=[c,h],n.push(g)}return n}function SD(r,t,e){return new ar(Ly(r,t,e))}function ew(r,t,e,n){return new ar([Ly(r,t,e),Ly(r,t,n)])}function CD(r,t,e=tw){new Ny().getVectorLayer()}function ID({map:r,points:t,style:e=tw,layerId:n="layerId_vectorLayer",featureId:i="vectorLayerPoint_",zIndex:o=100}){const a=[];t.forEach((c,h)=>{if(c.lgtd&&c.lttd){const f=new Ye({geometry:new or([c.lgtd,c.lttd]),layerId:`${i}_${c.code}`,properties:c});f.setStyle(e),a.push(f)}});let l=new ol.source.Vector({features:a}),u=new ol.layer.Vector({id:n,source:l,visible:!0});this.layerCollection[n]=u,r.addLayer(u),u.setZIndex(o)}const TD=Object.freeze(Object.defineProperty({__proto__:null,createCircle:SD,createPoint:CD,createPoints:ID,createRing:ew},Symbol.toStringTag,{value:"Module"}));function RD(r,t,e,n,i){var o=new t({color:"red"}),a=new e({color:"red",width:1}),l=new r({fill:o}),u=new r({fill:o,stroke:a}),c=new r({stroke:a}),h=new r({text:new i({text:"",fill:o,stroke:a})}),f={};function d(p){var m=f[p];return m||(m=new r({image:new n({src:"https://cdn.jsdelivr.net/npm/@mapbox/maki@4.0.0/icons/"+p+"-15.svg",imgSize:[15,15],crossOrigin:"anonymous"})}),f[p]=m),m}var g=[];return function(p,m){var y=0,E=p.get("layer"),_=p.get("class"),v=p.get("type"),x=p.get("scalerank"),w=p.get("labelrank"),I=p.get("admin_level"),C=p.get("maritime"),T=p.get("disputed"),R=p.get("maki"),M=p.getGeometry().getType();return E=="landuse"&&_=="park"?(o.setColor("#d8e8c8"),g[y++]=l):E=="landuse"&&_=="cemetery"?(o.setColor("#e0e4dd"),g[y++]=l):E=="landuse"&&_=="hospital"?(o.setColor("#fde"),g[y++]=l):E=="landuse"&&_=="school"?(o.setColor("#f0e8f8"),g[y++]=l):E=="landuse"&&_=="wood"?(o.setColor("rgb(233,238,223)"),g[y++]=l):E=="waterway"&&_!="river"&&_!="stream"&&_!="canal"||E=="waterway"&&_=="river"?(a.setColor("#a0c8f0"),a.setWidth(1),g[y++]=c):E!="waterway"||_!="stream"&&_!="canal"?E=="water"?(o.setColor("#a0c8f0"),g[y++]=l):E=="aeroway"&&M=="Polygon"?(o.setColor("rgb(242,239,235)"),g[y++]=l):E=="aeroway"&&M=="LineString"&&m<=76.43702828517625?(a.setColor("#f0ede9"),a.setWidth(1),g[y++]=c):E=="building"?(o.setColor("#f2eae2"),a.setColor("#dfdbd7"),a.setWidth(1),g[y++]=u):E=="tunnel"&&_=="motorway_link"?(a.setColor("#e9ac77"),a.setWidth(1),g[y++]=c):E=="tunnel"&&_=="service"?(a.setColor("#cfcdca"),a.setWidth(1),g[y++]=c):E!="tunnel"||_!="street"&&_!="street_limited"?E=="tunnel"&&_=="main"&&m<=1222.99245256282||E=="tunnel"&&_=="motorway"?(a.setColor("#e9ac77"),a.setWidth(1),g[y++]=c):E=="tunnel"&&_=="path"?(a.setColor("#cba"),a.setWidth(1),g[y++]=c):E=="tunnel"&&_=="major_rail"?(a.setColor("#bbb"),a.setWidth(2),g[y++]=c):E=="road"&&_=="motorway_link"?(a.setColor("#e9ac77"),a.setWidth(1),g[y++]=c):E!="road"||_!="street"&&_!="street_limited"||M!="LineString"?E=="road"&&_=="main"&&m<=1222.99245256282||E=="road"&&_=="motorway"&&m<=4891.96981025128?(a.setColor("#e9ac77"),a.setWidth(1),g[y++]=c):E=="road"&&_=="path"?(a.setColor("#cba"),a.setWidth(1),g[y++]=c):E=="road"&&_=="major_rail"?(a.setColor("#bbb"),a.setWidth(2),g[y++]=c):E=="bridge"&&_=="motorway_link"||E=="bridge"&&_=="motorway"?(a.setColor("#e9ac77"),a.setWidth(1),g[y++]=c):E=="bridge"&&_=="service"?(a.setColor("#cfcdca"),a.setWidth(1),g[y++]=c):E!="bridge"||_!="street"&&_!="street_limited"?E=="bridge"&&_=="main"&&m<=1222.99245256282?(a.setColor("#e9ac77"),a.setWidth(1),g[y++]=c):E=="bridge"&&_=="path"?(a.setColor("#cba"),a.setWidth(1),g[y++]=c):E=="bridge"&&_=="major_rail"?(a.setColor("#bbb"),a.setWidth(2),g[y++]=c):E=="admin"&&I>=3&&C===0||E=="admin"&&I==2&&T===0&&C===0||E=="admin"&&I==2&&T===1&&C===0?(a.setColor("#9e9cab"),a.setWidth(1),g[y++]=c):E=="admin"&&I>=3&&C===1||E=="admin"&&I==2&&C===1?(a.setColor("#a0c8f0"),a.setWidth(1),g[y++]=c):E=="country_label"&&x===1?(h.getText().setText(p.get("name_en")),h.getText().setFont('bold 11px "Open Sans", "Arial Unicode MS"'),o.setColor("#334"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(2),g[y++]=h):E=="country_label"&&x===2&&m<=19567.87924100512?(h.getText().setText(p.get("name_en")),h.getText().setFont('bold 10px "Open Sans", "Arial Unicode MS"'),o.setColor("#334"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(2),g[y++]=h):E=="country_label"&&x===3&&m<=9783.93962050256?(h.getText().setText(p.get("name_en")),h.getText().setFont('bold 9px "Open Sans", "Arial Unicode MS"'),o.setColor("#334"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(2),g[y++]=h):E=="country_label"&&x===4&&m<=4891.96981025128?(h.getText().setText(p.get("name_en")),h.getText().setFont('bold 8px "Open Sans", "Arial Unicode MS"'),o.setColor("#334"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(2),g[y++]=h):E=="marine_label"&&w===1&&M=="Point"||E=="marine_label"&&w===2&&M=="Point"?(h.getText().setText(p.get("name_en")),h.getText().setFont('italic 11px "Open Sans", "Arial Unicode MS"'),o.setColor("#74aee9"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):E=="marine_label"&&w===3&&M=="Point"?(h.getText().setText(p.get("name_en")),h.getText().setFont('italic 10px "Open Sans", "Arial Unicode MS"'),o.setColor("#74aee9"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):E=="marine_label"&&w===4&&M=="Point"?(h.getText().setText(p.get("name_en")),h.getText().setFont('italic 9px "Open Sans", "Arial Unicode MS"'),o.setColor("#74aee9"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):E=="place_label"&&v=="city"&&m<=1222.99245256282?(h.getText().setText(p.get("name_en")),h.getText().setFont('11px "Open Sans", "Arial Unicode MS"'),o.setColor("#333"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):E=="place_label"&&v=="town"&&m<=305.748113140705?(h.getText().setText(p.get("name_en")),h.getText().setFont('9px "Open Sans", "Arial Unicode MS"'),o.setColor("#333"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):E=="place_label"&&v=="village"&&m<=38.21851414258813?(h.getText().setText(p.get("name_en")),h.getText().setFont('8px "Open Sans", "Arial Unicode MS"'),o.setColor("#333"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):E=="place_label"&&m<=19.109257071294063&&(v=="hamlet"||v=="suburb"||v=="neighbourhood")?(h.getText().setText(p.get("name_en")),h.getText().setFont('bold 9px "Arial Narrow"'),o.setColor("#633"),a.setColor("rgba(255,255,255,0.8)"),a.setWidth(1),g[y++]=h):(E=="poi_label"&&m<=19.109257071294063&&x==1&&R!=="marker"||E=="poi_label"&&m<=9.554628535647032&&x==2&&R!=="marker"||E=="poi_label"&&m<=4.777314267823516&&x==3&&R!=="marker"||E=="poi_label"&&m<=2.388657133911758&&x==4&&R!=="marker"||E=="poi_label"&&m<=1.194328566955879&&x>=5&&R!=="marker")&&(g[y++]=d(R)):(a.setColor("#cfcdca"),a.setWidth(1),g[y++]=c):(a.setColor("#cfcdca"),a.setWidth(1),g[y++]=c):(a.setColor("#cfcdca"),a.setWidth(1),g[y++]=c):(a.setColor("#a0c8f0"),a.setWidth(1),g[y++]=c),g.length=y,g}}let My={prj:"EPSG:3857",defaultView:{projection:"EPSG:3857",center:[104.53125000000001,32.70263671875],zoom:4,minZoom:0,maxZoom:18},defaultBaseLayerId:"amap",baseLayers:[{id:"1",label:"高德",type:Ot.gdmap,children:[{id:"amap",label:"高德",visible:!0,type:Ot.gdmap,image:new URL("data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB5CAYAAADyOOV3AAAUBklEQVR4nO2dW3BUV3aGv5ZaagkhqXVpSQgJxEVIAgtjm4ttYDwYg20GKrFNORXjuRSxq/KSPE1NquKnpCqpylS5aipPqTgVV+KZcU1mMmPHNhmPDR7AYBsbI6NgrpJlEBKtG7pLrWse1l5qTqtbrW51S+Jw/pejPn3O3rt1zr/XZa+1tuvw4cOTOLAt3ABPv/QqAJlpcnJZrhyrS2f37Ju+SAUgq3ACAF9FYt4Z1/gwAJ7rPwdgeNVLAHT2yfdX/S4AHl4r/Z39sg6At99+D4D7Nj4IwGO7dgFQnJ+RkPG4u76UY/fHAIwvvR+AkWVPzqn9ROOv/vrH8oB3rpN/UHacv7+oUh5swyfyD0/UA04JdAEw4fYCMDIm5/XBriiQfoaGBgE4ffpTAP7+715JSP+RxuMakzdsqPInSeknkUhZ6AE4SC7cAB733BpZkitM6mtJ7PviGhNmTmaUAhAYs35fmifHy5dvArCx9r6E9j81DjM1p/mPADBS+lxS+kkGHAbbHHPkrhWFlcLkwR6RkcrseJHSI0rTWNFuAEZG5HxGmvW6K1evAbD90W1z6i8UoUrVaPE+ACY8eQntJ5lwGGxzuAHSE8Tj9Exh7sBtYe6S3PjaSev6Sv5wZwPQ0CuM8ZuZYUNZ+JlhcFBkdn5+flz9pgRuA5Dae1GO/V8DMJ67RY5LSuNqdyHhMNjmSKgM9paLPdx2ZW72sLvzfQB6Vomd2XRV2ttVE769nGxh+sDAUEz9pA62yLGnHoCU4RsAjBV8F4Bh36MxtbcY4TDY5kgog9ONJywwkJj2Qu3eSCgpKQbg1i0/AFVVlWGvi8bYxeZqTAQcBtscboDjx8VprkyIxIBkQ+3OSbdowSOjcj5vycz3+XwFAHz+xZeW8/ciY0PhMNjmcEOQucqArKxMAMrKymJqTD1XI/3y3sTq0ZpMFSHuGpNVm/Y+uT/UcxUKtXuvXBGPVnrr+5bvJ7LWyLjuAcaGwmGwzeGG6TL3XJ3IrNkyWD1AKYFOAHwlPgC6W8QDFa9P2t8pMvnBSs+M16msfXi9yOILbUsBqLx/e1z92gkOg20Oix2sqzIPbKoFglpt6kAzACkDDfK5/ytLI+MZq01r4lEqWycfP31XZGPF0t8AwXVdjYjAHFOHG8MObkPmZQDyRkSNTrndYPlex6H9P/rIwwC8e1Luq7w/bLP3FBwG2xxugMyrPwVgoFlcR/nLzgPgGRWZNpFRDsB4rjB7LH+rnI+wLqpvTelGObYOPAFAcW6H3JdVAcBkqmjrI56DwB12a+dpuTEgB1egzdy3xvQr4wrViie6usxfl2f4yfcWHAbbHG6A186slE8iQhletUeOca6rKoLRltJOQbV3xus1BmskVWR1/agI0ULf7LRwXQ/Ozc2JfbA2hcNgm8MNsO9pYWy8kRCRELR/xSMVzbM1JWsziuRET2z9+dtExuv6sAOHwbaHGxLP3FCUVAtjNfOh9qkIDB4WLdpdVAMEU2n6xByPmHnRZbRnzWw49MLzcx7z3QSdGUfM/0kjasBhsO2R0IiOSNDYrFuX5M3qNrlF3mIrk9WjNTC5f1btak7SqdOfAbB3j8RPJ3tGWiiMGL9AS70k+7WIu4JskyToyZLPeeXB/6vDYJvDDXD58lUg+ZEcVbvELv7iF/IGbj40DoDHbY3k6B0VYavrwJFk7/XrN63tL1AkSrKhM97X7wkfNYNk/ffkGDoT3gmHwTaHG4KrSHp8YvdjAGRmRgmGihHpZllXfdQqS1bXSjyz5gFrJEdRzsweLI1AUTvebtDE+s4m+bz+ezIDzsTYUDgMtjncAAf2Pw0ESyB8ePQ4d55PNCo2i+yt/728X+3fCGOXGS3Qly1v6I0uOV+ad2+UEVFZG7Rj5Xc/dHAi7jYdBtscFjv4oQc3AcEiJslisEK16vp3ZH03Zc0DAJzvlze4qiQ8c9X+1SjKFw/9WVLHmSyoB6r5vBz7tPbI5sQVs3EYbHPMiycrElSr3rpPMg7q/7cQgLQhee+8B1T2WKvpnDkj2vPuxx+bp5EmFu1NwtTrX8jvVMau2xm/rI0Eh8E2h4XByhDN9ZkrtD31OKmdHYpc46laUSRMbhr5IQBn/kve9KzVss77zonXAdiyRQqcJVtHSDTUru3rkBmp9oBYE+kzh33PCQ6DbY4QBotPOC9vblVkQmVlb5/EP2u8tWLJEvGUdTWeAcDfKZ6sr6+9BYBnUjImStoqANhafBiAx3dqrYzFZR9rHLlioF+iRlVL1vHWPpV4WRsJDoNtDguDv2m6DkB52fIZb9IICr2+v68fgBvNIms1qlFjo6LJyiL3WgAG22Q92FspVW2qVwoDNOtQPT0XP7Bqn4mqjRkvdJ2294aMr+eizDzdAXHNLeQ4HQbbHBYGR4tpam6WHKU/Hj8FBJm+Zk0FALW164FgfHKk7MRI9ajSU0QGV3EUAM/1biCYL5xucpCWPi0RHxdPigwfHTI+65r5kW2hkRW62uMrERlcsk6KlKypGp+X8cwEh8E2h4XBqj3X1wujlmZLnm1xkXiYfvfWuwC89Bc/ACKvF2tMVGiNjNBsQM021ELfLUJseg0jQwuSu3vFjl7aJgXCa5+S+3RVakl++FivuUJ9xm1XpR9lbHaxdbXH3dsOBOO7R1mT0HHEA4fBNoeFwboqo7JWMwUaGpoAeOZPRfaFMldlqmvcWmlO6ytrldZoNTKyRWnm8i05VoeUhhzLEW1bGaI1Lat2SQ6Txnptek4YNddqt5F8xhWbw7er1XHHCxZPhTyHwTZH2NUk1X71qB4a3bMg1VSxCZWpmuGvmfsaYzXbKq0aPakZDSqTS0Mca6OmhmT6DakcsMQt9mbFI1JaQO3khw7Gp8Wqz7jrisxIDzwlM1m6W6wDesPflzImWv/IIqpK6zDY5rAweBpTQ7Vfs32MZvpHk6lar0q1X5Wh0aD1oBv8M8dkjZRLZQBlckGO6AZNvVKR4MpJeX/XbhCdwjPeBEyvETLeJ8z7tvlxAAaGxL5/aMdZANICct3k+MxZi6prLCY4DLY5pOJ7qEyNkamRMFokERcZjf8MwITnZXOcebWqzyjj0SrcTfVTKtq9+9IJAIqWi0wuTBdf+bljEmuW6ZLzBWUiSwOjwvj2W2K3L9sgM8UG4xGbRGT9yOyGsSjhMNjmcMPcmRoJugo0ViDtprf8NwCBFS9avg/F9c6Z92ZQhO6K0jUinqMMl1TcKymSrMOl90nO0sWTMnM0XLBmHybKbl6McBhscwiDY7TbdDUlNJZIfbZTjWcYRuRbS87pZpO6g9ikW1xYgUlh9JCpE53rMh6yQRHKWoXHNSarNRO3Pgegd2QDAH0D4jPvmRCmXvg/kbH+drMuWyZZlLWHxW4PXV9W33LF1omwv+9uhMNgm8MN0NYsb7IrZI+E2yZCQfdg6GuRzx5ThioQ4tHJDln90brRel1hpWQueFNklcr1bXPYQT2SJc7o22fluo7OVeYb+TyZLtVs224+aNqVfjvM7iyavegtXwbAmmITvdgqDE69KnZzmtENvAdlhmm5KOOtfyfVMp41O2PP6lsscBhsc7gBbpnSjjm51uddtM4aIeGdYzSgrs6MDoXPxHcNiQftalsVANmFIpsLtlr71d1d1uYKM1Un6PML8zR7MRRqJaQOitWgNTHTAzJjlNY8aY5yvcrohpN3r4x2GGxzuAEGTanKjWuTG0MUjCoML8vS2iWSZMBUuhv2CtOjyb6eVmFa9ixlpFoN40sOmn6FyVp1V+12n/Gk5T0jM8rNK6KVq4wuqJDvS2uTn6EQLxwG2xxugC6zzBmtolyyoXWk1w8Lo04MCoNHjHYfaZdU1faL1sWn5er6svafMtxu+V7t9jVu0RFWPi4M/9YvVoEyerHEad8Jh8E2hxtgtTiAuNkVPppxvqAV4BXq0ZovBGWz1bM3GuKJ09W31Rn/CkDZAfHIffWRZGXqjJKMfN9Y4TDY5nBDkLGfXjO1IhZYFg8YnUBjs6LtUK6etvR5Gm/Qnpa4b10le3Cr5FRduCCy+fS/i2yOp75VouAw2OawcKPYrIdeML7ph9curDYYbT1YoT5yd8b8yrwpmW0yM1Q2bywT2dy+QuzsKydFNmvEyHzlUIHDYNvDwuBVskjDxVY5RrM/kw3dP5gIslV90Lq6tdCepFDZXND5IQBb94mdXXdCsy2FV/PBZIfBNkdYbqpd3GHCh0MzC5IFjezwuCROOTA209UwNiyyN33p4vEcQVA2T3gk2lOjSu/fJVGlai/3dwi/krk65TDY5gjL4JxMYYTm6S5UtdeF7n+u0KjRkeUSReq5/hoQZLK/VaI71ZedjMgRh8E2R1gGe8zZ4Xn2BSvSjQer1ex8ttpshLZQ2vxcoTI5ND68yMSH5y4TpieDyQ6DbQ4LJzqN1qyV1m8Pzvt4LFiWK0fNVSq4y7ckDF2V0nVmDJNrD1iZXLNn7hkXDoNtDjfAkfOuGS+KlGk/X4hmD88G//CP/zT3RhKM1CGJ5nQFpLruWI5EewaG0gF4/S15Lr7VpopPDKtlr/zt3wAOg22PWemlmu033/aoJ036SwSDFyPGM0sA0DwKd69UVMAwOX+lMLn1otmVpkb+H7Ew2WGwzbGoLEv1/GhtSl3d0kiTHJOteLdr06GYYvKEOB5CmVy0Ln4mOwy2OWbFYI2bXqj14RUF8sbqnoYF2XenbzoaxrOkOlDKqNQXc/dLNmRKppz3lsnU1X5FMinKK0xSmSvd2tCofypLY1FN0YsdPp+PQ4d+wPnzdRw7djSuNrKysigvXzHjNa4xk/A+Wk5n+03ae+IPDIjpAc/3+rBCV5V0lUuhe9brztfJRm3tRnw+H11dt+Nuo7x8Bd///g9pb28nEBiOeJ3Hk4HP5+PUxyf4wy9eAcC7VGqQjHokT7qtTT4XrrTWAZrIXstQ5U+AHzsMjgVbtmwDoLS0lNLS6GUvPv/8M9rb28N+19bmp7u7O+K9Xq8Xn88X30DvQEwPuM5E7GcbJiU6blqr5uhO4Irl+dZoT81OTDM+6vTMmT1xicAjj2wnJ0eCv7Zv3zGrexobGyI+4FnDlcJEtpQscI3IC1GwRiznjpvyANpb5Fiwcrpu4jB4FsjKymLPnr0EAgFeffWnDAxIpP2+ffvZvn0Hb7zxH1y6dDGmNouKisnNzY34vceTGPbE9YBPmv1tt61KrF2qNTInMsot53WmqCy27ivs1oyGoeRq1c8//+d4PB6OHv1g6uHGgvEJUdCKfIXk5eXT3Hwj6j2BwPDUdetqt9LZ2TFtNlDGdn4r/49uEx+eXTI5ZfE4DI6C6uoaysvLaW6+EbfmDLBt6zZ27Jjd1H4nysrK2b59B6dOfcyRI+/GfP+cHvBn3ySWyVoHa9IdviFtX3WAj84aH3nspJo1Ojs7+OCDPzA0NER1dY3lO69X7NVQhWvMFEro6p+kpa2TW+0dvPPBZ3xWd41VK5eTlyNTUlqqVXdwRVAlGhsb6OzsmHZ+KCD/hzEz0/ffNPs2ueDTejPLzfJ33rPYsmVbVKVq9+49Eb/7/dGPeeNX79Hc2kHTzXae3b+b0mVF3PK3kWL8iBnGJAo1nXy+IjweT1zMVSTkASuTn1gvb1Ssnq6pmpOdfwSCtSwjQdtfaUR11wXpPxnr1o2NDdPOTRqRX7txI7k5OQQCAT4+fYbRCVNvzFznSZvkRlMDFT6z/3FgktRUGA4EaPymiZExuTI/Pxefz8eNm366urpJSTFWSk4uHo9nKqJlUKsJmWO2x9QtMzFsmcvkvoFbKWQ1yNvjMDgKLl26OE1DVqVpx44dBAIBPB4PF680cvJzuc6dYlyqJiA/25rXPq9I6AOO19OVOiAV71R7jlSFNhSa13zW5CbdMHWt2kxlvfXL45tRImHceAw7euFHP/oTAN4/epInd+/k+Wf20XpdX4TwWn2mx0WKCzI8HirNbnEQNInKlhfjK8idmiEyPB5Lv+rJK/ZGENbGozfaNzlVcchhcBzYu2s71VVr8fvb+Z/3PsS71MN3vrOTF154kV/+8ucz3ltXVzdt+171Wvn9frpvdzNunnDDN01zHmtCH3Bbr5EJ7ti0at1vaKxod1z9am5SjZSmpHtCPp8ytSsz06C5KxjnXSiuXJaYXKBUo+woU1TWBULiwtMylnLouafZ8ehDBAIB3nzzPyn2wvvvv0dNTTUbNtzHCy+8yNtv/y6svbxixUo2bdo07bwyuKS4mDzvdOfHxpqVXL/+LUHpPjO8yycl3+nXDoNnjb27trN3z2N4c3Noa2vnzV/92uJ4eO21f+Hll/+SDRvuo7x8BSdOHOf8+TrLg+7s7OCjj45Na7u0tJTdu/dw/nwdLS0t074PZyLNFgl9wC09erS+aZqtqDFWxgykcInZ5cXsNxRtL4fZQnWAO2PIjt7h3vYbH3/3oHWcmWZ8qSZIKidzkif3PsF3H/sOHo+HQCAQ0eEwMDDAz372Kvv27Wfz5i3s33+A/fsPcO3aNV5//d949tmDFBcXhx2vMnjjxk1UVVWHvcbv9/Pb3/4m6m8HSHUHMxUdBkdBZ1cXPT29nKur4+wXn0Z1VR458i7Hj3/Etm0PU1VVzblzst1Aa2srw8ORlwevXLk8Y7u3b8e3RDkvD7hxaoYRxiijC8NvXhozRvpjq9FR7NW/ovmwXVyoP8eF+nMxjWdgYIBjx45aXJuffHIqpjYSBScmy+aY1yk63zBW7ddJrFGUsUJrdCgWukbHYoTDYJtjXhlcHCFLTiM4piI6ZunJchAdDoNtjnlhsGrNqyLEkKkMjpW5sVTZ0Wy7ew0Og20O1+HDh+2ZJuAAgP8HqaPMHDeG4rEAAAAASUVORK5CYII=",self.location).href,url:"http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}"}]}],toolbar:[{label:"地图选择",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAa9JREFUWEft1b0vBEEYBvDnJSEhCktJCDtHq7nOH0DU14pCcXOiIiohKpFT+dhCI6LTEv6HKzQiYUlc4qO6Wac4JG5fueW4XIKdvV3X3Jazk/f55ZmdLKHOD9U5Hw1AowGtBowdu0dNi9swP1w9wLbNAGeUjMXDQgQAeNFZJUV/GIigAABUaOtu7b5N9D7XAqkB8BHrus39jzMD2aCImgGlYGI3nksNZYIgQgGUghk84cjYkS4iNIDXBNFULmnu6iBCBXhNMC84qdiaX0ToAC+Ysa5SYs4PIhqAZ6A9R5qTfyEiA3wGnygpxn5DRARgBdADgHMlReLfANzcNOoWi/f5N7rDrHj9q37v5vjZVN5jeD+j74eAUwZGKlbSSprzOjODA4jmiPmFgc0KQEFJsz1yABOkkxRWKcjYsm9A6CuHEmg2J80NvwjdBs6YsO8kxerXsVhXi2BeqWjhQklzOBJAp3U94SQHD6uHG9uXTwB1lNcZNO5I89gPQquBnwYalr0ExnLF+4SS4uDfAKWgri173yVkXbSk87LP8ROufQ39DtXZF8oR6ARW720A6t7AO1OFnSGLL33dAAAAAElFTkSuQmCC",self.location).href,key:"pointer",visible:!0},{label:"放大",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABHdJREFUWEfFl19sFFUUxr8zu21IkMLOtlaNiUB3djXiv1qFxJBAjBajxMQoT4oYUmDvFtAEg/KiPBRJiQlIZ1bB+AdrovJgAiQaJYHgiyYYImlF9q5oNGBpu7NtSkyQzhwz093tbDuzu9UG5nHud7/7u+eec+YO4QY/dIPXx4wAIunsErKtZ4momRnNIJoLokvM/JdCdDynjHyHjW3XZrKpmgCienYtEycBLKtkzowhEH8W5rpdQ6lFA7WAVASI9px/lBVlG4BVPmZ/AHQZhHvAPMc7zowsEe8yRfzDahCBANF0dgsz7/MYXATzXoDOhutDPw12LL5cHIsYF+5VyLrPZjxOwPOeOYdNoa2pBOELoOrZVSD+qjSR6MtwWEl6Fw0yjaTla8R4qzjOhJ58UtscpJ8G0NgjW20FP5YmMNrNlPZNtVB6x5v0/ptsqj/FwAPOe2J6MZeKHfLzmAagGtLZuXvmIUWJD21qkTNZ3KtV0/IqGPUABq26umWjHQt/m+pVBlDI9o8nRMorpmjZG7T4gvS5hYTwI/mk9mmgZr9coYRwwh0n2mcmYy9XBFAN+QOAhwE6borYY5V2rhryIoDbAKwxhXY4SKsamT0AOZUExVYSw50tGa+2FIFGI/ugDT7twgKdOaHpVQDYHWd7p5lKvBkYBT1zv0J0pqDdZqYSb/sCqGn5BhiukW1h5chm7eRsADgeqiFHATQwcDIvtJX+AEbmPYA2uKEasxqGt985NosA3wNYCiBjCi3hCxA15BEGVvuJGnt+jduK1QvQQ1Urgu1pYVYnNzdmCq0hKALHAHoSQL8ptCVeUZOejVnEtZWjT05EdKkTQQAYMIV2awCAfB/AevfMxjEnu0W76hU6STpu8bziu1J5sb3TtpVSvvjlTsSQJwhYAeBrU2hP+AJEDNlFwA43B0BtwyI22Q194q4asqYqcKZGdDlIhCYi6s4lY9sDAM4vJyinJsrQXpcTiUJD8j/1WgHKjo+w3kxqH/gCTJRL9heAEwz05oX2wmxUQcTIvEqg7qDIlrdiQ+5goMvtL4TX80ltdxBEVM+sY6IFptAC23W0J7OUFXJK0HE8YIr4xql+ZQDNhwbmXrsy5kxwqyDE/8wbSt19pWrpBQiKEXWPlezbc8mE077LHp+vYeYlgNxzIuBMTmit/wXA21mJuTuXipclX9HT/0JiyC8APFcU2cDTI0I7UgvIfCOzOATlI4CXF/V+LbgigFs6abmfGJ0ek15Y1ruhv3HWr0073ZIVq51B7/iBBkFUvpRO3Ib3ALjZY2qB8DNs7gPoEgOtRLgLwC3ehZm5i4jaALR7I2Gj/plRcUe+agSKgvkHf18UGh/fCuattRwBGAct4t2jIn7B0au6/ByEyYsp4zSB1+ZS8XOFPKvJFu4HicZXMylPEdBc2LFz3eoDcz9AfQhxn7kp/u1UR1WXB0DoKEWCYeRTWmpGALVhBquihvyEC1d27025pj+j/7t4cX7EyG4Ac5hAR81U7M/rGoGgTVzXCPhB/Au0q94weWhzkgAAAABJRU5ErkJggg==",self.location).href,key:"zoomIn",visible:!0},{label:"缩小",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABEJJREFUWEfFl19sU3UUx7/ntltIkEHbzWliorDeViP+m1N4IYEYHUaJiVGfFDVkQO8doAkG5UV9GJIRE5DeWwXjH9yDfx5MwESCJBB80QRDJJtKf1c0GnBs6+2WEROk9x5zb9vtdtzbdusCfezvnO/5/M45v9NTwg3+0A2Oj1kBRDLGcrKtZ4ionRntIFoIoovM/I9EdDwnjX+PTV1XZ3OpugBimrGeiVMAVlYTZ8YoiD8Pc9OuUXXpcD0gVQFi6XOPsCRtB7DWR+wvgC6BcA+YF3jPmWEQ8S5TSXxcCyIQIJYxtjLzPo/ABTDvBehsuDn080jPskvls4h+/l6JrPtsxmMEPO/x+cpU5OeqQfgCRDVjLYi/nXIk+jocllLeoEGikYx4nRjvlM+ZkM6n5C1B9tcAtKZFpy3hpykHRrepysdqpdJ73qYN3WRT8ykGHnC+J6YXc2r8kJ/GNQBRXTg3d2sekqTE6OYOMZvgXttoRlwBoxnAiNXUtHKi544/ZmpVAJS6/dOikfSqqXTsnWtwx2/JfrFaCuGEq0G0z0zFX6kKENXFjwAeBui4qcQfbSR42TeqZ/cA5LwkSLaUHOvtyHp1pzLQqhsP2uDTLizQm1NkbT4AlmjZ+yWiM64W29tNNfmuL0A0I94E4y3n0LawZnyLfHI+AByNqC4mALQwcDKvyGv8AfTsBwBtdFM1abWM7bhzch4BfgCwAkDWVOSkL0BMF4cZWOdn1Jr+PWFL1gBAD9WE8klzdPpyk6YitwRl4BuAngAwZCrycq9Rm2bELeL6niPbb5tq0i1l+RPRhEYEBcCwqci3BgCIDwFscGtWwAJjq3zFa+g0acHiRbUy4Nc7EV2cIGA1gKOmIj/uCxDRRR8BO90eAHWNKfHpaVgrao3ziCZGiNBGRP25VHxHAMC5VQTpVPEZ2i/llGRpIDUWvaJ8hA1mSv7IF6D4XIzfAE4yMJBX5BcaC130jujZ1wjUH5TZylGsi50M9DnGTHgjn5J3NwIRS2dXsETOE3QUD5hKYtNMvQqA9kPDC69ennQc3FcQ4v8Wjap3X54rRDmjblnJvi2XSl6oClAsQ/ZlgNw6EXAmp8idcwHwTlZi7s+piYrmK2v6LyS6+BLAs2UjG3hqXJEP1wOyWM8uC0H6BOBVZXu/EVwVwG2ejNhPjF6PyAAs6/3QvzjrN6adacmS1c2g9/xAgyCqL6XFbXgPgJs9ohYIv8DmQYAuMtBJhLsA3OINzMx9RNQFoNubCRvNT08ot+drZqBssPjgn0tDhcI2MG+rpwRgHLSId08oifNuT2niCxCmF1PGaQKvz6mJX0t9Vpcs3B8kKqxjkp4koL10Y2fdGgTzEECDCPGguTnx3UzFqCYOgNAzlQmGnldldVYA9WEGW8V08RmXVnbvplzXP6NGg5f9I7qxEcxhAh0x1fjf1zUDQZe4rhnwg/gfGyOgMNRa/t4AAAAASUVORK5CYII=",self.location).href,key:"zoomOut",visible:!0},{label:"全图",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABXtJREFUWEfFV2tsFFUU/s5MH8APys7SNiIV6c6sohL9BQIxRkg09RHRKBqikRBr2dlSeSgmhpCaSAA1AkJnW1A0CEowWvzhA6MSVBACiQpKys4gr6IFurPFmNDKzj1mlm27287stuEH99/c+51zvnte9wzhOi+6zvYxdAIth4uDzuh7GVQD8BQA4wGqBLNgiY6TgEWgIwK0N1le/TPmkDOUyxUm0LinKFA5vpYYjQAqvJQKSdzVteCW38asPTmGSq/UEtNjJCGWWKBuAxHnI5KXQLApPomJPgeg5VVC9HgiorYqsfj7BF4uiRLHoVQbAxalMNtu0Nr95H0JBGPWTGZuBTA6W5iAX5jpRxA39O/zETC2gGgdE00uEj2nHCpxjZYB6BDMNV3R8K9eJDwJBIzj9xCk7wEUZYS6CTjIxCft8+dq0XhfSomZn4DxRK9SAvYK5pakru2ofOvIqCujRrWB3Dzh+cz0qMzSss76UHwgiUEEyox4tQwcAkjpV07NCV2NjG05dkN3T3Hq3wbtoutuMM3L8sLfAB1loqVgVBH4y8zZUvuCui5Qbq0XVLLikj4hOcCjuZwCMWsGMW8GMMkzbozzjnCmSbL8PAGvDroRYzUDe0DYxcA6yNKaZF3oUtmGtolFctEy9yK+BAIx6w65JHWae6SpAC13gcy03S4PbVE6rYUA1maEEwBcD3mF0D07zEQfJCPqjmxjimF9yjItTtaFzmSFrh+iGOYWW9fme968kSWlwnoXwG0AphaqcSKalYiobh71rYBh1UjEDyciWnQQgYrNf1amrjgdQsg3d9VXn/Y10HK4WHHKugFIQynNHAwzKTHrgD1Wnd7bqPpcGIjF64ipmUEPJnX1q3zKlSazA4TKfBgGb0jq4axSvYoOxOKvs4NvuurDP7jffQSUmLkJjFowL7Kj4fV+ypWY+QAYXwCQC4TBtFOYjAatx8W5XbJodI+DnqKwAzEzqYffzCVgmDsBPMmguqSubvJSrjRZ00G8B0BJoRxIK2dsT0S1Z9xMVgzrDBEuQhZzOSVH7Kj64gAPxL8F0ywwzbCj6n5PAob5HYCZQzHei2HgQ7pK+KnM3mIA021dm5NDIGCYrQTMJqbnElF1qw+BnwDMGA4BD2wHwLttPZxuYn05EDRMgwG3SXQihZDdoP2TTpqWEzfJQlQL4mKI9MM08hoJgIFVSV1LN7H+KjDMVwhYnVG+2x6rPuSWimKYuwHcf61GB8jX2rrm9pSsKtho3g4Jv2fFbmsyos5Tmq0WYoTdBsRA+QBFbtdrA0MC4W6fzjiIu+Q4N3YuvPWvHALuR9AwLQZCvRIEfNSTwiL38cE7ZmmwmOuYaUXaKPCSrWsHerFuqCRHrBTAWYnokBBCI6I1Hp7bb+taXx7l9HLFMBdl9fs+WXcGAODmxDkGdtkX2lvdJzlfWJRmcxoEBlUTM89NRsMfZ12yX834t8+OvDyi+7SHq7NtXbJ1bUyhnAgY8ZcJ9MYA3DH7gjoZjSQ8CbibSsycD8Z7+QwISk3sikw65YtpZClQYR0nQM3BMNXYUfXr7D3PiUhpijeDqM7PgDsHJHRtld95MGbVM/OGHENMyxNRdeVAGe+ZcCfLwU6rlYFHfIwwwPvA9Nl/DralkzSzghvjU4VEewko7ZflTbYe9ryQ/1TcyFKwwtqYaU75IsLsSHcmF4aOKk1WFYjdyhiXFeO83ir4XxCMmc8yw3VdlS8Lxmskic3M0j4AEzK4YyAssSOa28h8V0ECacmdf5QEE6UvMPPTAKb5DCMdDATc6ZgI2xLn1e3Z2Z4nnwoVVO55oOVEGbEzhYQ0TrCoJEiCiTtkQvuIyyMOti+pujwcjUPzwHA0DhN73Qn8D8RBLD8OwRUqAAAAAElFTkSuQmCC",self.location).href,key:"fullExtent",visible:!0},{label:"行政区划",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAASYRJREFUeNrsvQm4ZUV1NvzWPvO5Y88DPdBzQzfQEBUkQIwkzoIxERwSTPTnT0wi4oxTDKIRVFRAUVRQRGTGORqIOGCigJ+KIzKIIjM93L7DmfbeVd9aq6r2rn3ubW5D4//8+b574PS9p+4+e6hatepd7xpKGWMw9/q/9xXNdcGcAMy95gRg7jUnAHOvOQGYe80JwNxrTgDmXnMCMPeaE4C515wAzL3mBGDuNScAc685AZh7zQnA3Ov/0FeZ/+n1emGb+IeVUgh/7s3rsRwr0hc9MfL3WK+7t69+V7nWelq7/73/b7O1p2kq991/jT+Uez44b9ZZ8+fPtwIwU4eGnfqHEgK+qSdi8J6o88z0LOGAsMD6a/l2/3upVJo2yPzTf6e/vVwui3Dw972Q+POxcPwhBGCm85ZnGrT+z4+lgx/rYPxPEwL/eSYh2NefMwnNE/0sMwrA3n7pD7kcPFFS/v+VEPBKuSchsKuo/9v0n3v6u1t9M009XQhoyTQzLJsqDVfvUMsjSczsGODRHvxT/3EUmvVR8L3UK8NIze9x4X9+HcODCSbbVbz+eS9AL+3i4//5FRht8MA9PXz41X+L7RNVVCKFB3aux3d//Qo6xzw83BrBcC1BvcFLTIRh+jnVY9UE3H1PjJi+v2xeC61eF+UoxTO2Xo0nr7kJWu1PdxOjXKoiUiUoupdKeZDuZVI6xY65ousNUNsU/RZJH9BV6DxNamvZ46iDUtNDvRTj3B9+GPMHqVXZbhuoAJOx6zpqYKU8UAUmOqlT05A+aFLbVId+55vg/+neGzX6bhvoxprukf9mzzfRccfw+UzQ5oSVzynXaPOd0X/0RUNtgzWD3S0j35Hj6Ge1TF9OH8SLn/xa9JIqkjShPhhAufI7nPapq7ByVVmepVmLsHMsgU4NXQu4/l+bjyoEs2qA4UHqcAzQyRUG67TOaYWlCyJpT5IE53/1Goy1FDZviLBs5Be4b/FWfOQrn8U/P/9ldJND2LT8bmxd+Wa60SFE6cO48udfo4dJWbowVFdokgAouvMldE7ukEatgXY3QkpPfcsDr8MNd8Q44wWnoRMPoxRV6D4iGZAyDbYy+eBzW4naIlNy8s9trE4HoXQkAsejUaYejlQHK0YNBuj6pmQHqEE9Ue8F84j+qVVY6Hlt13YgqbnGx9GgKTew3MbfbVR4kJUbXPu5UXXHOOHhzywsXiC8UNRqEInLBKWqUKs6AaBOaffK+LsjTsZUF+gki+j6k9TepT4ZxDsu/jK2bbHnMNJ/ESoljU6Xv6/3zgoI1Wa/2jnzI+fjrDefgl5cwSe/+mmM9QawdSNJXyUSid16gEKrSwNCZxrrbsX8EYVFIwN4/5eupQ7s0jsmgBSR8FQx1qlhw6oU1aqSAarTT63s9aNIycAN1G3Hl+jzwlGabe06/te9x+LgZd+jv9csQOXZ4n5aDWB/Z0GiKe4G24lBRJ+NPTdIe/CQsTDXG4YGRME/Lg9sppydBmg4bcuCpmWG2uNsP9G9GyPHV1go3Gzlz9zvVWpLdS4kVoPy7dlr+neVBSX47I9LNJwGKNPn7aRlR0XTDlQfxue++3r8+v5t2G++wlO2GeovmjCkivz91ap8vyToJbV3AtCPDhnR+ld16Uq84xNXo04z/rAtEVZRh1aqdsASurlylU+ipFOlE6nThpsGhxxg0E1p9nFvUCPJBObTDCtXlAxemc5TouPL8meave5ey/QLdyhbiCyX5bLCbTufh4OXXE83NmgHVplsHVWi6u3aq7gHlMrWU9umnIDIk2ZCXi8ldA9VOd4PImsd/jofRbeHiNpK7mz8mTVUOeL+QaYRRD3T50Rkzg4uKRw5X5zaLxv/XX7eJBAg+jILSi9rs8dJvzhBm4ojvGDzqYjNalp+7sF7vnIx9ltUo7EwGCTJ6fScoDvB4v7jPq4kCsEwPrYlIARTp53wSnzzF+ejQjpmwUhZdJVSmiS0gqetfhmi2mLopOU6cYo6bAo33/9FqIEIT1v1chrI+XQjFdIYQ7QutWTtLKkpfPu376cHatINaxl8P251fnh345FbkAdIDZdLPPsb1DmseSL63KABc4NL0sKD79sEArhZr6itxMeJptCiUquqRR1fxUBNZeqeLiFaJ0Pj2g6ijLUbRH5VWABU0OaOY4GVNdxYTUGTUFg2f5y0layQKpWr+2rEk8et/66tVrZaip9zqPIgXXA5CWyEq286E0/e1CA1b6SvanRzrbLDLKylnDByH9Ro0nV7CEDpY8QAXgjacRvPf9Kr6aFLpDJr+OJPz6a/NmlJICEgEKY7i0kYUlJTE/jIf1xIs6aBQ9Yn2DlJN5BSp2sL2mj4RLqVdOkwjl5xCr55zyekJ0T9qxyAdRKrSZQTDO7cXz+8HhsX3UNC1JQO44c0Au7clGX7WbNabhEoVvYErAVSFpi2LBW8JvZ0got/fQZWLVJyHbhB4hfhPf6GDJKsnom9F76EXd+NgPB2Yr+j3Izl7m3HuaqXNZ96tp3mAmHbzPTjaK1vdZEtMR4vtLrcrvHcjW+gtX4+LTGTGIvXYCkh/nbPLRE1BqSGNE2ZlgAt363R7J9op+hQ+8O7Kxa/7AsVzDPP6CG6wCBddBGec+ApeP6Wl9Ds2YHPfe9cQvc7aCbvxL//+LVYsriBlUt5ttIMjRISmrIMTMktEaF1EevFeN7616ObwCF0p2vdO/iVZonGjfeeTILQtuqezyhAPxKkb9d8O+X8Z/vd/Keck9qb0ThW0dpZVrnFFLmeUAUDyt2HyjtKBW0q5NX67jk80bS2/uOCewjbYpo4z17/Uhr8eczV4rYHnorRIQVPnvp7mOqVcNyBL8bxW1+FFxz0KvzF1lfT3zq0NET484POnBXnz84DGPvEokoMg5hhEoRBPOuAf8Iluy/DBddfiN00wdYvH8cJh76M5zm+89sryQIoZQ9rsq6IBJn7B2ili3Hcxn/Cd353BtokXNXSzNLKS8HiUYbrPcEPBbSWdZ1x9+oH3bVlmIGFJhHWLVK8jJUyyM+rBmYBzI+fllF7dQbT942YTDc2hbs01Uvo4Cf3vQhDwxohRu8lJfzV1peQgbzSqRSFLk3UvzrsLTRpe9g5NT7rjUezkyDGziDpTLvosSmmTZNsToX1+ytsXF3GH625nJYEwgNYjIX1n8maVCu1SRu0Rb2xnjZkuxqTCPjh+43on166AEevOhPPWPV39Hvk9GP2A54jYXDzy4efSp0R56DPmXoZ4IMDhMHg++P4+jqNUTHjbAcUrR2dD0LWnqFw/zeT4YXgkPxGg181SVRM6p/tb4WezGD5rKPCs2WD09fGP3kynPutzxDq3074ZBIDgw2LPYKvdWJePkcdUGVwreX+E90gDUJmN2qPDwSGr2p1mADToMzCUrmJGpvwpIfKNINGBmMMkcFbiSawcelvCKnOF1E5cs0VeGhqMz72rYuxePhenHjEBdSZNTJPxggbLMKCwQdJk8yjm687nThE12nSg2g6xuGBKFdzDHbY9j542c1I1Sr6Xpk6o07rsZvxztQrEeDTaa4BhBtQNR56ErYUUaWNS39xNtYudYMoUmh7lRFzzVhwZZCDO29YeIReLQcmm9Mc0qbt506ssGnBt7Bp3g9p0GOGzFaoVILx3v74zj0vo+eMrNVD91SjX3TNFMxAfl7TALbsX8cn/utSOffB6wi/kBDxrLfkkEKz1CKLbB6duiHgmnFAOWpYOrlE2CDpzcqMzioA3d44odKamGq8hvaSCctV08wen6LZjCqed8ApBEwW0d8nBY9N0TLxnAP+AVfHH0WZBj6Op8is6eG8G95Cs2IenSPFac8+iX5uoa7oyfliMpo3zb8Mv5tiAskUBIB/Twl0nv1fH8brjjqNHn5UNIyAQBOYegIM225Bt1OJBz9Nx+jfGHU8hHJtkISEBko79Zfazmc73oLAnAfg9m6anSoDfNyWMXxuRrYSRoqTeO7a09HVwwQAyerRiUX3cq4SBsoP41n7v51kroXrfvM2EoiFGFIWBBaBIZ2PFEeXvrN4oVX7LRKscUKfLzroZOqfAeEgSuV5tNbzNSZEP7Htz/ca0xjZJWJiVp/CXvoCPJGiss+pbuIF296Oye7BNPPnZauXZ+E68UK88KDT5DtxXEdEvb5odBjDA/zdEs78j8/jXcedgsneqFPcZayddyvG4224v7WVlJfOwZKxpuGaJRF2TC0mDdIReJcWAJ+/uh182/FdOmtKs2IXCdkkPvbjc7BmYY7gjVtwjXvDFOGFyeCGPVgF31Ph4qrYMtA4YcO7SIgWykgqVilaFRh+TQNqwXQTx67+MAnCBL5xNwE10mZsecTasqEVDaHIX0zArmf4bykm440YrN5BVslSRzjxYFd5IQhuw0HeSMkyBLWXRNCsnqdoJtBikcGCQVL9aamAngWUayZCGg6h89Qiq6DMfIARk3ArYYf333AuTn3am4Qy5ptPCFdsW3oNDuqdhevuvUTWQaPygWI7fVHjQerI+ZaZSZFDYuQOFWt6dVCjgb9z1xH44h1vIjUdYc0iR47owG1iivx/+LsdNJMNokbOQ4Xf59l64rrT7OD7+/F96jGoDIyluGUCoUGCUMfz178bn/3pu8Xmf/GWf5S2yXgdmpW7CQAuctyAIUtrNy0BA5jJqg8vFwLPvXGLzUoEGbcwWULDzqxIuU5xBISByTl5fzz8MQT+yKBWqm2BCvulGdRVIrLFgcnOEIFJZFMwMTz3B4RnqJaQLbbGDYZRJmPSjJhPJp/9bAuzpaBJ3ZO6vfDWM1CrLcCmpXad5vtO6Es0uagzix1UdUKrVRgA4oI6vJBoy/Jl6prnH6n+Eze8kzTAQjcltJseXtPkqsU4YbIayjjuYT6eue6Ddmkh05hnbrM6RYM/kMFK5TRaZk8pY/vCvT0bKniDJoZJ+9Dq41kC/A3WqyPUeXaG1soDBF4c+nbcfalM6DT1nx2goraK8TZzKirsGz97q9ix9QoNAPXi6qEbCNR9m9apBg1MmVSmsC30e1Uo2AYd16jYe2ByQ4Ae/52dQKUBAYEe+Qsm4eAKU6GBjOmpJnH+D8/DigVlzB9wThXmdahzn7vijfTbYlK3FdIQZKFIb03hhofea3l+B+zYcqkHIFDGNbKMoXKjzyZpI9pJP5c4JtDAZPZCTWhjP5lSur9SVHNCYJwvgfn6OobrLRkwTdhBMTNKbRVnhcCt7SUCzFHq5wMtmPy81OYFgLFDmcEutbGFq6m/4mp330Agn7xHIDCuVOUiPEY9AjoRr8BOX1ZYdVMbA7ASnBDwmhjvog4ex67J+ajXxvHnW07H1379aXTjCM9ZfxythUsw1V1Nh7boQUpyPtYWrB7O+fZHcPBaTedQjkswArwme0oAHWigmclhNc9LDIM6kN1brU7g/Te+k87XwNolTA0bYcw6sWUTeV2Nk9TN4AnL1DGMJaFhT1sUmdxq1zkIdMaBtQLoQze2zz7eNfjrTe8njbKS/tZyLl07/Nxf0mbNDav5BL23spkrGosFM82/q/2xeqrwmV3tsZ7IXcn03YrghikRSHsscwZsWk/K8b1kfN9BoAcSylFgKqC5MnMr4Nzk5uMemTL34fxvfowQ7jDe9JwX0V+YQNIiped+5wt40opv4Jlbb6RBKQtdyU6j1MSk9hPsv5zMpCiwwZVdUMTbRype69ipUauLI55JZhKf/+kbsXphA406y4ddfI1WGUTQwki26dzUkdRxNP1kEDQBKT/IxhRZwLCd70M5zTbZVfibA04T96worwLvp/sWaG/0RxlDkfdtQAcqy42EbR6ESh+Xqa/IRhRcwhogrTgclI9RpFRwDbXvPMBjisgRNZbQmr4TH/rGx7BsyXyypVN8+PprxRu435JUaOLVSyP8YvuzcPu3j8ar/uRfSdrL9OBkvpEAsJewEgBYFVBlNfrbed//EE75YzYneVmKLW7ga5Z30tMsQLORO3CUGzSPFxqkET540/kCRHkWs9M0JgzDDpmDVlptgZCAMiE5Uxz8lx3wZlqnF/fZAypbtyO/Jmfg1PG9emau0OyJRHR/iBoVJLfch8onf4CFj3SwcwGZ1ycdhfJTlyBt9fY4IvvMA/gpYRCCO28IhZ9tr9fKu/Hh687HksUVDDa1mCQbVxsM1pWswb24hOM3vYQEYyHZuZtw6++fil89cDDu3L5eUP78YYUVi7R1vohtb9WxFnKDVu/5zIjtJrDWRCzBJBEGKjtwxo3n4ylrLchLlXPfBut55LyD65ZxAIeSZcGKSo7UM7Dnh1F7zWEybqBLy9JLN55Kg78ChRF1aoKFMlIxTcy69ZyGg+vDxzKcYIp0oPs98qyjB4FkA3duuRv193wbG196DMoLh7FkxwTu+NC3MKYPR+UpK0kxJtkyovrI5Zmijx87E8guGAKBtdQp/Mg+RoUAX5pa25OMHNx1/zHYtLpGs4zVsLUeOIyKgy/Y8dOLad0uraCuGSWhSHDIyjtwxJof4fKfvxeDNfYqWrdm6HTxIJC7uzpk8NFbLsTyoR140UH/Jrz+BTd9ENtWRRJxY8OflCWSjEX/SFyHUFtdmEXrk1RR3k3MvslxJh9MZgJ1qJE1A0nu5IWCM8TlJ9R4zVknCe6bWIJrfn4cXnvMpwnDNKWvjLEUrRwXaYvonS+ZwR0yU9PigojAYjmMJKYHe/A9n8VTn3co4tt/gPhXdLN0nv2P34bvvf+7WPK1f6Yx6FgMUKpbIM4gMOlm984xHnuMCn60F4PAHoNA7tBEBSDQG7iMcKlNsxCk1EFdmYVxL83dud75Q7Mn7rKZMoU0qiKOy/TdrtjA60ZvwB1jTxeBaRNQrJa180NYvp/dqGIJ0H8r5/HsXoQzbzibhInte3v+XmzZvMhHDGWmmnMWOkAHdstqS09EyKnfdprzAH4JaKc5M2ht4YS+NkHAk+CvqjgGzoK7MiZx7c9fKXGIwBgdU5UoJC8A7Er2wFA7AeAfDPi01woO0CWMUdyMjnQDnYfHMPHTm+l3spjoHgydV2//PuIdkwIEUwKS2p0lJhDIfEMvzZ1BewqYnZ0IUqroFezj3TwIFMVGptXm/X6Mu34V0w1y/F6a2cPGqUAOaLQMW5SZcamuYuvSb+Gg5deReh9AlNyHq27/OGkOU3SjOoqOI17q9LfNKywnUSqrzGnkOXpBxg6AhcyfCYI5oj4FHBI8PfYt6LxvlMMBzMWXIrJ6DBM5ZdcnuatskEAIh7R96acn4lmbr6LJUCpEAheRjZqhzWQ96pU5D2zcrOHh+zqEjxLhUBKaYElUQZtjyjIIGOZz9IOox+AN3JeY9F46jBcefBrm1X9G62yJ1JClRD3NasN8pt9VSsKTpE2aGQO0ii7BYYsvF2rUIHCUoLhcMqsn/nEXwFFA7O45TGYtFAkcFThftMm9fzYgReGEtW/AceveIc4d4wbfCCNn8K/fPA/X/OxFqJTiXHjAgpjQPVmLaOt+t3HLPjmSs8cl1bb4rc/FnXe3MD6hsXN7BxOTGnf9poXRNzwNxgKaxxWiH82aSjQTCGSGo0kGHcc009uUS9mo8Pe6ySiOXHMRXrjl1XjBlr8lNZqKNOtM5qPs2Ozc/l/p7ArWL7gVVewgreKPtXa4dqBMBkxb1axdcJ532OjQsSJve9/atRW+G8Avf33OlFPRMP1xPpY2b8+COyWiiR5g034KO3qrheTyA1yJEnzm5leKGVaJxrFu/q+F+zfTgB76AOB0EKj72nScYsGxB2DeWcfjjriG39yf4tetKobf+QLMe85mMp6S3GHto5nc737w95SGNysRVBMQOCRSXSYQGBG60z+5DwMXkTlCkrhjQQPtv34yKkevg5FYKcsEJukCQegGS/GyQ16P/7jjXAxW7Lpcq4xQ5wzaGD7n0GGGkVUzgxjGzloN4i8O+BCuvf2dZKZVmIHJYvgh4M74oMHMSSN0btlFB7t2Zu6M9084NcCxeUYFKtk416+yFPHixk46foRMxFEcu/oafP6Xp2GonlPGfM5/fOp5pIbnyYAzuGNAceTau7CDwMqRq75AQs/P35YlCuKltIBP1nTH78Mxd9LGn5Sz70t1RxQ57oEDWHolLD32UFSevBn33jeG1cuGsGhkPjrdcbr3qgi5B4E145jAcjdL83tUDDCbO7jqmEBFa0/3h3dh6dk3Y70zRxaTOXLnOTdiu26jevgqksZUOiUWYGPVT0vXsGr06/jpA8+mB2+TcLTZO0Cg2cXwceKFp5gldrAlszVJanj+2tfiK785xxI6EkAZxPAlLngy4w2MgLYCCKxYYFiANAwqez6iyMmF5rB2NvFeT+3DaPWGCcy1CQtU8dID34bP/vw9ZCkYTNENrBn8byQEVBPTsWxexMktXew/+iN634KpblnCsvqZwJDh80ygdiAwZAJLfUwgAzq+RtydoEnWRbU3CU0otlcr0xI7mSFW7WBgzgTunjGv8TFFBBmlspCuqF5B9/3/hVXP2ybmSPvGbyK+7Qdijkx94EaoWsVewIOwLEanggMW/xeGK/fiuZs+KJ4wC6qmgyHlrWS37rbTRTh+w5skwNQvBd5V6xeOMEnDmCDYAyZz8xaibwKCB4FbmDWpJtOOI5M6XRtFLOJkhqgzE7JiNE7cfCYOXf49wSxF5xsLbsm1mwD0qYwsMlAFqtFMA20q+Ncfb2nGDmmWdism64q0Bi3BCd1Liz5zexYijzAEPmfTwgTW8L2XTGCuKjXnAmyfwPjPyBxJi+aI3jlpUXcf6PHf7iUD+LNN5yI1NTH7QtJUZQcyicNh410J/UrIOrBOHE5vIsuCg+W9Z8yEIWNeYFTux8+COgz6M6NNn6PMIAeDqjRBar6LT958Ml59zCcJDzQlxOrlh5wj99RL5tFAtwNMJCZ5+CQBiacdPf4oUYBaZ2QvcsY4l1e5L41uN0GXtGuaGlSrJfnZIfCnjU3SEWdUv4bX09P8+wH+o2YGqczR7Jgp6qF2o4pH7u2g3GeOtKplLDCpW9uc/RrZGSSRNKwmdbVAUWZ8lzFZsGiJVOf37zoMt9xzNF78R5/AaHOM1PUw/uqAk/Gl2z8jNK5yHL933yqP6nkddHkBWUy+A3xw1oIKwaHKuXo+pEb3+87rz5MPS0YV/vW6t+J1R32UTE7OtaNOdwrTZINtsthAK4CZNZ/HC3qY6QU162PTF5Kos6gD74b2rmBW34PDNdRTEkBSU91OhDKBkXqtIWFfot4tG+EAbyGKcXYM0M8QhYhRmMDSoKy1pbSC4Tcei7ve+iUsW1QWDxx78h7Y3sLIO49HOW3QLOUETmsLT7ZHsGBkJ2JCrgwMI/G+RbJGc8eXy3VJDI0cs8gOIYKYuOXe47HfIoXLfvQWvOnp/4wWASqtF4p3j3PpjGf4wnBuxW1Z9EXmlayVilancskTJnQyOADJaWnb9rdahEHj6CAbOUwvD9mkEsGd1Wz2ZzIQ1UgL5K5g/s+DOyXxD/b4Esc5RX4ZMxb0MevnlzYX18dAziTW9Ejd5OB4zCjmgBYjeYNMijGoLJW8MFsPocQEOvVXKXdmLfQxa0CIMIE+JrCtUD9qGZIzno1ff+A7qD3cRW9+E/Pf+scYeuZq9NpjgVdqJ66++aWEmLs46ZiLkCYLJJEkEheMXavihMmjluPslUQMcw7i/3PEP+Frd30c+y3QePvXzsG/POsN9HC7MdkJ551lB0X1+VXT2Dbxu3j7nyyPdhLwIm6JsCCwiAuEbXRtXcIAJx36Nvo5nxqnnJy4GS6gTWVtKjWSlZx5RgTcsTaacqFpjgkUF/GkYwb9UhQAwwwschzjRBZQKu+EBXEiW+p0aqOlJP7P4SXtQp16sY8JHN87DfCoPEAWE+gic6iXho5aDb3tJXjggQmsXr1MOP2UAIkkebqj47SGVz79XNx057MxNjUqsYBVWjYSTmdBLpWpW4B58BUJSK3K7uFdwulzmvSmFSV89HsfwngbOHB1atG9VgVGD85d7IGhCsPKndr1YVnoI4PQb5G7NtZM1992Ap6+7joJ585DwOystOogskuRClxiJgCAGYFkB63EKXUuqqoc9RyHoTNV7cOMI+onmu406NUs3E0hMH+QR1ypPm+kCXI4wpn/mDRAvxCoAJAIACMwUurGaHCUC00vEyXOt+5Qt+vOdreJw/a/QS5+5/1H4NZ79scLD/+C6yMXO6C74kJulLfju3c+Dz/+3fHoUIdvWWMHu0Zr/trlSmLgRZJ14OIN2cGMMcwTR8w0wGdyungGEOjb2AooRS2y528SKte4CBEW0oR1GM9E7gZa2lgIOPLZxj2q7FyMf0ygr9hRtoMmwsKB7fTMEa754XFoVibw7ENvBvts/LAqGvwf/vYIXPztP8W5J72FLI+BacGdpgAezMxpJ4Fn02sAXtr7BWFWK0ALwZBa+5xDJzo9uXCP7f0SWQX0c4pmf7mc0uwtiYdV4IiEbxmJAIawZ7/AhuU/oPZKFjjC3ipjxtAsj+EdX/wsli0sYdP+drAjCaOyD8HBIextNMohdQf4ePZpBFHgvj1CFp5WBHzI3MtZW8AD8LtDg3/SQadSRy2kcy8QtC3AzNik1lJpEl++9U8w1RvACYdehk4yTEJRkT7Kq3fY5zfO2UO9QN+L8cHr/gYjtR14zZ9/HL98+BBZAp+x7YeZ8PqJU6F1fv1K5rknOTDNGcbajbfJNIBx1/FmlHF8gcmgqplGB/dbAYobpqamCrLjbUT++bUfnozBxjxxBjGwmZjYDcNrHq9JCVn0DQZIZLaRiTY4WBOhqFea9HAdi04ZPEpRpIbM9sglbaZk1g3WJ3DBDadirLMUG1YpyZXnjF12G0fICR5283KmqwiBW5U4Xq+bBoEjyrp5e4nJgKFkG1NbNy0E3chx3bTYEQwWuynjkhh/uflsGvARepYm3XPHMorRblz+v56Hu3dsRrOphM27f5fBXx/2OWxafh8mOtYxoUzZZixGVVqnexkg46ydaomFf5KEpkbXm8KDkyswb2ACadx1IWNSwwTNag8Xff8tmBrfgb//s3OpPzghtk6Kt+3C1fgoDnmjtrjlVhtrxzKLmCaWSJvobMczD/2kpMPZiiS64B6q1+uza4BObxcNTNl2MD1gpdYRF6emji7FGo1mKksABzonZAYKlckMXzLl6FfFhJ8IAgMgSEIHzYjoQbz3Kx/DvJEqViyx0ThpLN7zzPUbuUgePke7a5EvHMPHjn1OqFBRYHfXcnCXTe6KA4ae9uIZWTNS1CIEgayYGCxKZQ2y85mD4AyelEBqlWbvJTc9G/dNHYD9l+gse3kNofHLfvIyDP5iHK/+09Oo4xtyzk6XKfMhuv+doqViUxXrR6dDEr3E5W6YdBqs/o406KCwpsiifFMa6AgTXHLGLMDP79kPa5fcIwOe6Im8bIy2YXRJMinWhPV1GIkjiAlAsjZjAL9PGMB/Mcu7U8YxSCwItnhDtcpevJ7N0Xdh0IJBRCdHwXdtvjsk9m8SP/j1n2PVMjJjyloigZB571TA9pms8IHJLLx8rffHIczD90mioes3SB2YFuJVAICGBreS2ZUmsOofaq3FvGHrzRR07lLSVy/h84zg7V88nwaTvk8j9MEX/RP1UBeX/PcJ1D8d/CUtFT0ykbUecKDVYwUlQTPKmDyDSNLYK1i/+Fbc9tAhpE3TLKzMGNUX5aOyMHmYvJ/982cm8b74AjxZFUW5D8uDTC7WII4XHYCYPcQKeulmYWmUH8ZNd5+Ig9dz9qvKQrHy4Mu+gNB+d7AqCksG+jIg58GemhHwpSEFjCLrxo8z2RmhjrcmFVsAqW7g1GPOFdZNqQEJgLGROy1c9tO30VIxggNWJ/L0TNG+/YsfJTWu0KDljBQI3nT14Vi38E686umXSNpbmwQhp6FV7gt163tPl3HMuivwx2uvsuxoaoNkEVDkM45TAAh1NlaPrgGibOYF7+lMoM7WGBOcPm/TWbpN6u1Yh5rFJk7d4OsYtfIDeN9XL8CKpcpV3zLOxZuxoo7RQ+a+9S5d7/ottJnczevj+HQICF1IdeE4k9fvCdu0sQ6mwfqkeyJjg1pULJqhS7O4R+Ytz+YeDWI7XogXH/Q+LG7cKfn87NWs0HK5lkzXNcsjjI5EWDQP2LqG9IHaiHd9+Qy86uLTxSLw/Sr/GZ3DOjeZONiEk25Snfe2zqTGj4EORsKNhbGMIMx0AMiYbK98AaG6qFaHbEwgTY0ygSImPXxMoE0MaaKmHZEja1FKg1eWJI0Sx2BxlgLX4kGVZn6CD3zlIgJ8FQwMWBNPnEwqZ+7qfF9VlRdSYOxRRVbwyT9QrWyv5zNtBNzxiapFwMcRv4wDMnewb6sWY3m5pF1CIPDUo9+NbneBKz1Ts0kgTrMJo0xAWDu1w6YeC8XT1n4df7p2DDf85kT67gieufl8OmZYwsK+dcdJuHdqLRZXFJYt0DjpqC9KP2rY2MdSqZZnX0XG+UIawhhajaiFKONCHTCD9HdXwUS7BBLPzyhblrZSsnmG/P1qeXhaYOiMvoBH4wBa7Z108Qo9rOVPewREsphALrYk2bKTkpkTYZxmfodA4whJ8CO49e6jMdLcjTVL7iKwskxKl4zO5wBKMh3bqQjSZNf6wpVPyqhHUh7Fm3ZeEDPA5yhTHuhWnIfWC2aoGwGLXnKUB3w9FGIJGCzy+QogkJ7tbw99M93XIi74kplR7NL1iVfIANhUoL4JFMYDEtr+1BWXyTUmu1UpQMEm71NXXwKL2bWUtuskPYmM9swfz34Gd1l9IadjU27LCkdpEfZeOpE9hF/qbJsKEkYJhzgQ2OmNzxoZNCsG4Po/CRdW8GaZt8384CjlcuS346rvvhI///2RWDgYYXfHYGhACbpfOHg7Xnnsx1CvjgmHryIfcm3ysig+397kLl9v3vh1PG8LGT5VjOVHkdIzWTWvPFO3nwmc7ET4x6NOR6uzKE8wFfUfzhirA3LAFvj5XQqYoH2T5wUw6I11zVvsEiqudRpEHxmpcZADwFD75hKrHH8Bl21glzudjYdHXsp4V7wKwzn3LSy8HE2RxA6JKqpVBjPqNadV2VHRxiXfPAWT6aHYutEI7cvFi9hxwXf5yNhm0gyJuI+1KQI9G8eusmILfnAzlsYEAx76O02erWMxnwV8qcmDHDT6gGGB9bOfJ7sR/uHw19NsWetqC4SVQ1RBkIS/UDnBkwFc7wgKSojoKIgl9DheqyL6lDYTWDYoePJCYWVTj4WHWVPRCMLTJG456qe0XfIo1Ky5AbMGhLztjMvRqD5EJ9tOtusYofY2gbo0A4OS1oUEOzuHYtF8UnMVm8svwZGRTcdeMGJw3lfPw+7WiFW32oIdjTzpQ5siKPPgMCycoB2Y499TkwM+iR4KAd80AGk/pwHg459tUsUnP+nVtEQsdGVrdPA22U/tgJUXnNxxo50Fo10ip85yA6F1NvPz2AF3buTX0m5Ge+xuPKzT2VBKEUghccxuem+ntkfYMKW2neglHadV7DIDbQKrJp3mDwjfe6UBNh6u8YHPXglTKmPbhjtx3NEfoCVhmEBTRap1MaDhiJmVS1IMDtSsd5QDIytWumpcGZHW66F1jCMWYbgJqRAqgK9iM2u87155921NIQwg9m3ZcY65U5XA9+9Lq1SU8xA6hq+spgVKiDuY76HDg7uYcOqgJGP0eT6yGL7Qlch1d2xaupJIECWFLmuoaDfj2K8s3HUTZcIAJiFLqKeFCZR4Rx/rF2lbFJLbwhxGl2hSJm3rtVxEs75Cs/2SG07BPQ+vz9w/jVqC1xz/KrR7ywk4VizeputWWbAifvburBpg1mLRUz2FxcutD3p3shnvv+K9eM1fnoyx1nIBh00zIpz+C5/0Cnz5xx/EcOMhPHPLBbQEdKR20JU/vkrKxTbpfel/n44VS2KhPO2MITDYdQ5iP2iO4ctBIIM7BwJD3r+upI6eLw3ndrmg8wVUsLF1+LyLOFs6akrOxxtlcAJGyhk+JQ/4ikA4dSxdFqwT8XETQb5+Huun6lW0b7kb+uPfxchDk5hcRNL+d0eiccw6JFMdGfyEAXOm8h0I5FIujqnimc6DH8eTzqWc0ixvk3WU4uGpDVi9kqOwbDp8jYD56z7xcZz5yhOov1eQkNTEYhJQTrO/E48XBn4mZ9Cj8gAeSJRopnJ52NFRgwWLFuLsqy6mAb2fBmIH3WiPloUexltDeMaW03DkhnNpPZ1HNz9EwzoiBQslK4tOtN/i1PL5WRJHhOHqnfJA4bpoAtYnXwdz9sZMi+vL7eP+WD/TV80rQ9biZOoIOAy9k3mugMlQfwG0hZXDjGfjpHwJWjT45vRvYPOxT8LKU47D5mccjuj938bkd+50YcfIq4L7Z/LfR7ZVi7Rx3YKUI4BocilDlpcaw/AwaVbSMBUpJRuh3oywdRPwpk9eSdrgPrIIelKHwD5PZMv0zmDdheM8e2KIj6N3VPDggMHyZUN4z+evxVlXfJxU/UOkfnbSexddvI2UbpgJH5ZcLid7yMqrpNq1PFspL+Hig/i3TxL40mmhSlZhrTU5wdOf7NH/TpGTP9oUj9HB79abqISg4g7TWe5+/jYmrMKRh3GpMJjD3w87Yci8eeD0r2H/voDZNcdvw8P/dh0tV2VXxi0oJOFzHELhFpyQuiit3aiX78fnv/P/4qwvXIRGJbH4RiOrG1CtRTiIhODNF15BS+r9gs+0kG4ce6BnTQzZY0xgtudNFg+YV8lqDETYuJ5UU9zEudd+GtvHU5vPT6dZNHQvXvdXZ2Aq1ujqAaxf9HUcuOxSXHfbl2xef2RNGonrUyqrsWvXQWQz0lfmUDqfMakJloXM/amyAk7GFP36YrIxQaUNQnpcrqGZ96+74pMpnPj0JWroLBkmNAyMCYlXncUIdh4enzF/r7djMigDWxz8CPmeQpUyz2BmCUu0bD5EwPmN+P0jG7FiGbBhLYeyu30LlMn2L+Cv1+olHLBO4yNf+Df84wvOQ7dn8yrTNNk7DBDGBPr9bPwMHB0oYZj6qdpQUsde0rGUK7BPf1+92JaLjxzyanVW42NfvZDWo/tw8nPeSTb2QgkLryiWVuWAHZebs7Xyhho9UUMcf2+0zdotlx1IdKW1OR5fah6qHAgK4HPn85Ypl3jxINAPYb3sHCVRzvdXKwYDLFBpTQrycRl6drcaFSpFk7F+UubWoXLlyrwITyD4n9PWayKA8UB9xvy9Li3MEWcTl2xZGDiB58EvlwlEx9Tn1QSfuo4TS2NxL9/4y4MwMjKKI5Yn4mJvkoYplZyF4CYEl9vRDftQvD9BGm8gwenREmydTkw8PWYiyG9i5A/eNZmShBH2pQ7giFx2t1qize6kgabN+pXyKixlNFjLlwMP7lyKN3zqArz7pBNkhkwKQ2dLtBq08OI/ehWByP0kMSQr78ogujSEWI9TJ7bwyR98EoN0TdOkb3SktKjzErJ0KMsi+hpMzvMnbdkYKkH7rZ4Jx1W+z2BRysLgXkz0EoluIp2Vl5AVDaNtWZZAC1TEz9EqhI+JW9Z0sOxtz8Sdr7sS+wUBs/dvb2HRu46TeEllagXAJ6eIrZuXo4Ke/5SrRCONNCewddVH8NmbrpQ8RTqVmIzjbZ0pKTF/afDHWzqLQKvUU7zv0rPwDy98KV2nSRq4PXsBGJbmsbGxAgSoVqsiBI1GA0e97j4sW1xBrVHCguGS0K9R4EofJiAy4elcN4q8Fcwk3WyXOv6u39rBffLBkQRhtAgPvOLIlxNgWU7SOiSZLcpVhWQsX60M081PyWAPlHfh6h+fTrNlMS03RogPn208RLN/smd8mem8reOKTLou5gCTVsfkGoD+MlizAsD1eH98u8GHX/pKGuj90JWws5IrbQcJCEni3XSfbWe/cyzDEvHnK7dziWhMMr3Yp19q1PDQ9b/C797zDUQP7Ua6YAgr3vhnWHzcFqQkbbx7SZJOBCFsJmszzm6XeAFaQpLkDlx2y5Vo1u26PyiDHVRn40zkmm3zDyvAldT/LbfSRB3vorsrwW+vXzNT3ZFHNwNDDRDWuxenC6+pUZ704tchE+WI3Dh6sl7jrWQc2uTwMRr8Q5ZfQZ21MIuRD+k+G8fvOG26Tiuej+MPOQsNUn/f/NUL8Jsdh4sVUSknObjLIu8C168pMsLaKo/ANW07iwmrg2htfePlF2LNwkfw98eeJlXLeHBteekBVKsP4W1XfITupYmV8+7FG4/7IP3OW76NZOHzqbMgYrItF/7JBqjDVuLBB3tYsqSKecNVJJO9jNJFWHPYeRMy5k4ieruYN7Adr/7EpTjswCRjOwvJMBnYVXnqu3u+RrOETZvIemgTKN0++/ZzM9YHCPey84ydR5/MN0UuKlfq6Lus2ygQAs/siWp2XkOeQZNtg0NWXY/YLLAeK8eERSZyyR4s/NYWtpiCo1vIsO0N44i11+CP119Jx+7CRTd9mtbENIvr83UDUhNmAqms7IsHkDkIzGMCq7RWb17D0UeL8ebLLpR7b1S6JBxdEuAmHpmoYMN+HPhCy0trBd5+1Yewav7NePkxV9BsHbXCorSLAWSVTpim20ONAFhEGirp5E6jsiR96Cw6RSjdkrHbvXBhzbiNZvk+nHH5Z3DgBl9pLHeD+2olJmRJdU6Ja8eqlqjvIi6wsRcbc86oARgU+mTC0aaiNakks1lAYOSWAKchuPSLcoDIr8PNqn3ArGKVbPpQxd8f83dI1GpUlY0e4uxgy/hFNpKIkx0IjHGRQaaHIp6iNS7zzptBVaBY5ev52Ljw5xjrHkTXTm3mjLsGg6IsGtaBQwaQ7P3zhSwNcgDpdSEvE+yGbhxoY/1SMyDpaANkYq3lgSzZZx6ivlhFoPeeBw7H7Q/8EhuWPyjlWiMuUp0kBL5SCfvmoA/O2E24okqvKqC5VmvmDJ8LJRcgqBoC/Dj1bWTgIbznyk9jy1oCn2VX+BKWNGvyVjuNUMPafvY0stcQ1YoNSunQQI00H6cA+GWAXzumNGoTCepJWUDgRM+XfDGZu2m8YyOAvTeKXxNt601T3kwj3THZY8GaENcyzxp2JVv3squJkSi3d8+UJKImP7oPjQtvwcgjbexaUMfUSX+E2lHr8NT1ZHpObME3bzuRtElDHp4Fcl5TZ+5l+DJzdeuYspLmlpq6wwqBaZjWfeh5EFiCYhYxn4/X4gaB0qtvOQFveu7b6KlGJei1Q1im1epJPgObX2wtcD0kPRkJ/8EVU6pqWBg+n7hgVX+CdmcHCe+9+OcLLsXmtdRTpAUnWzpzmonJFwA+n/LG790hMGShSDR2TRl0u/xTP74loBBFkiW5miwbqpAo4FRtmJGhskA8ZOycytZim6iXCYt3Zyq3N4GLA49p8EfOuhEbXBr6Uq6K9eEbMUEHVo9YhUWDD+DEJ/+Lrf4lexhpfOGn76M1vEKmXx4Ro02Q3mqm1+kPw+sLfwuwT5hgLHsJlbgUTFPc5CzIbLaWSKgHh6rCMXC+nuEA0TIHaFTkmEhFQZlYd12XuNis3o9TL/w8DtrgtpAzKIS65axTkN2UuyMzLZv7uYN9tbAXJWL6PUThbpi6z/VqdH/ShSkAxZnalOfVqcMSmDyBVOdEU+46hYQFjZ/5LayegVXbdda3ZK81rr4RJw0Jz+qmbPcO4sTD3o2XP5mWmbSTs3chu6cxI4O4x7f2GKdIlUsOf4W3xRkX4sakzsSNLAdRIQmp10ljlitifUQq8OObIEFUbPldeN2nLsZWN/ihCzt7BoXp7KPZQ1shBd7snQDwmh++wyXAmxwIKEitA3AYuneDtiyGzzOITPKUxiUGXpvcfWpvVmdJDgILOW/wkXFJQ594sIPJh3dj4qEWxn78faQ7JzJXtPWL62x3zVjTMhEvwosOeYW4ek3gFraFGPL4wDxOcM9tqTEFl7N3Q8sGl5UEr7vkQtTKOx2TmMdGykYVFb+bib1HG9XjQKCrU8Nu9Nt+vxFrV1Xt4BfK4DgAqIttmbsbCFzogQsceW1EPfsKMDMRFG5gPJ+AzzCBwIaAwJLEwYUxfM3AdesDO5q1PIEji/Urp/jAFVfhHS9/FYGUUbsNbKmOqnWxZXnxZd4ajq7RadRnTEPnqljMcPFXyhXnlnUROpEUoq/ToAxKWCHfR71iqWaVc0OSuVxoAwrH+X6r7+k4F9hxyMYqfnXfkTh49XZHk6uMpubC0GzRKGdt6JIRtpFZSKP9EhNj0WhLgkebdZ35XJoV5A4q+C1rI+H4fbSP3WHU5lj442zpHBKrJi89EdoD0ePHACEIrE4RwiUQWKqkWSydBGi6mxlvW0ZORXnUDoNAFR5HgrRkeYSzr3wLXvX898hOmE3MlySGKLVEEGfAcuyAnmxh+E3H4M63fBXL+1i1kX95NrpTO8lGbwqrFgVFfRMZ/Nvwms98DtsO6Nk9eY0DgSpPDOX7mQhAoHH+gRAYyiDV/XE5nuDjptyzcemZDpluTAIlUu8wSMmiJaknBI9y1VK4uBaTYxMZkEp1LLuu7Z5yZWCkJE8ZHeqrHpmSHgfY2Z1aIigEhtTGewwjOK5ZcyCQwOHOSb13S8CjRQV78BGpHIGq/sJ6wRRRQZsq+HOZWWSv2Tpq3y4ImdOwxFmDnM6VWZCkGHraWjTf8xzcHldxt6uK1Xj7MzDqqmKpDPnaQebYxVrlEbz20xdjy3obkWQK4K5vgUfxd9PfVjgudDDl3kVeLbes/KHkP/ptZD3/kfq4SVPMP/TmKS+DPOji+3FfmmiX8TeHvxAvOvQkdONKkChhB14FwFCFKdDBNicqAO57vWHETN5AzwaqoHxKsRBjsMtWyAQGLlIT5daA78D5owneetE1eO8r/5LOX5NtUwm3ixmJoNxLOtXD8NHroA9dge0PJ1i0pIx5Q3WhVBXyToMP2TItfOcXR2PD6hqq1bRQM6iQeBKQJ+gvEtm/i9dM9YO9NcMzLtFS/9hqvmI5PWVMEL3rAK7KE7uliFPaoyXFego7vQpOPvpEMmOXkbLkbXZIjZcDhrQvaNYEhS9VELfgq6YYA8y6F96eQGAoEKnON0zSughCciBoCoyhydRlDg59MgZvBrFlk8bbL74WF33tFMICO+i42IFNi2Sk+AGfg9RgqdtFjT4rMsiTXi/33bsYPRbUVPMuIRO4+a6/IJUaW1CUmiyGMGMxQ/CaBqBLB7+nyEBuGjy3BWTuvMZkMYts2eRWQu6j5fvSOgsud/frS8PyDmAdApL34wNXfohwAe8Gym1NGdGU/9PF+zMmB4VZ/yKIlexjbf04PS4QGPoC5g1bRokDD3hv+nIpCDJQlkXLdtJ03/EgMMrSyFTexscSCjt8W0pL+zp8+b9fjRcdcy09d9Nt2NwQj1u3a7fw0qkSs4oN0qRTFfBXq5VliziJ0uW9CAk7MFO5cjHjlARh4S2OPwzjY4UJrAQ7gXhwV51eXKJeyc3YjEUkdD/oo+FT3tVESlhDlUyQHm53AsmqlDkAwc4lmdQxb7e3E+/49OdwyIEl2YR72+ov0znnScZOtdLCYENJhXXvy2jW8u3pPR5hYMjBNL5ugo13ZGccCRODwHbp8TOBXqXt3B2jSnZ5nVV1RefuVteD/ENAYOTr81rFIm2+IrdDM5zxqtxxLAkD1Rh3/O4QAlOfoCcaFe6arYJ2dwIdmvFchTxNUvHLt0gTcAxBuUwdpspocMGqZCedZpyQ7278y6WfwsEHEEhtBy4mJVvzibeyX40LSA0YQ54tWdtMx/ngqLpnOSG7er7vmjfjDS+8gGZvKZMoLSLBu5xMuLh9txmklLDh2n278OHL34ylBIo5fHzHLuAZB15MIG+ehKl94cZT0WavizG52U3n2e09f0FEUAYCnUYYqGphDNsMAicehzPIA8BCQoSbBkUQ4kkKVWSdTF6NK6vGPMNebEZboDZvNHXFNSK3/btNOh3gErTUlhLgi5jujbhIdMVdl3kEWhpK9+PT170ed96/DevXKAmYYP+66qtz2A9UC+BJz9A2w3GmDxxI0fESaZ/qGsn5T3inzlKU7/FhVMZymqyQI/sJujRLx6AJDDd4VrFm463eaeArpXF69ins6h6G5lCcM5NBrWllgm3sTB8TqPOdyaHyeoP7tATkSRgmq3NvwuLXuu+zybN3w3jsaQkaLqCyErXd8To4XNt6xEy7Vljds/vVxQxEtOYnHTwyNoCzrvwc1qwCDtxID1J16lJnFWQzkKpdKdaiMWCm3due2swMpWR85u3QkMJ/3vpcHLnl3+niw3kBSzV9YiVJQkL7MM688iNYtjzJTlqv9XD6JdfS360X9MkH9zAVq74A1LwAZmbdBIOdMYY63wNxb2p+z6oBClm30FkH+5pLngmM/GxTOSMYuXItcKVctM53ArXUsJE9dY2r3cKDbLR233VMpEsu0a56RhKzq/YBXHj9B7F1sxYGza+Bmcs0qBmgA5dwtv+fyUvNYJa2dIY2E3D1vMfRT373TBy++Roy/Zo2h9JZUTZXL7LAlYBqudzFRV9/DYaHF9BMNxmryC7l9etzVpR3CEm7+dZzGWXuJpsJgLnpswpg8tqI2qT7rgFGhyKMNkuo1DiSJiI1p523zUrBgGcCozzcStyUfSQD7xoCkwNG2cOHjhupcyzfqJSJFwatPIBKYsvB+H0IOdmBPcMJAb4qdeKFXz8bWzdEWZFIv1I1A9DmWUl2EZs+U64xQ1v/cdoDvmnfdYxcEDffJC1VIyTPtntERi0DuYrsBGLNidhZBPXyGHp4CpYv0Vkug2fzWFC8wDZdrJ8KqoxJnwaqSBjDapRHWLuJVy9TnxII5DI4HQcC91QcYu9A4DidrJGimkQZCFRRsCEDBy/3AT4O3WRwEkXFNVTAU8AN8I6jm/e7jIBRV6JyjcMOXe3YQWdF8E12ujsk/2Cgfj92xyuwyHCGcTF/oQja/HqoZgB3eZsK2sYf5bhscaqbaW0cvHrqxy7AB05+CQGwpVL5vF4bRYfj/1IWgIRQ/f1466euxsrVsSSjWnMuB3JKhaHvLtQryEngAR8vsH7272NTITAEhgkE7iIQyEzgrol0ZnJvb3MDsxKuZtrurFlB6HxrVBSL7huTB2eEbuSgrkunnWLLyluoqeyMijwD2a93SZoijtm7t4O0zf148wVXYcFoL1/3gqWo3wXav7379KKA/QWm93zcns4nCSY06w4gjfSuSz9JAvoAPccY/WEnvbfT7ztplt+HN5x/lcUq5VLAOmLmbQNUvmZl/VfYX774XZWBviD8fYatyGZKAJodA6Qu9t2BMBPspYusCkc/AAyBiSq4V/0NckXQvz/2bzHVHYUrVuEYRH/fNPAEinq6iwUDO/DOCz9KeKCJLZusK9bv8BGFaeAmNzkzQNRfIsZMB0j9+QSPehz6wawFSLxX4dKlgzTLL6dlagoLh1M8sjuiZWFAgN3WzUayelougMPMcN0sw1gX1X2eTV1E+Tk7iKy6iMnTGfaKC54VA2QuXR/D5vbP9V6uLMFBW8CGgI3yhaWMc37qQFA4YqWnm25fXJ2bMgpC7vTSmH6dRL20A6dffBVW7h+hUbMpUbof8EV53J82nmcI28KCUOoxgECTfdegyHD2tzFz12hG2LSRzLp0EMN1WgZGOTY/lc5iE9GzkqqPVpbAL93fhqwAuQ7c0sqEwBB50osO3PYOtKf6Cdg7eP5ghJFBrkxNtjk9VFRyGz65osfMDhrZ+SJXOU1Jv02zrduEMawiyxEUW59AT6U0KP4AlW1GxbkTVYmdG27sxr9//yX40e3HYtvWSPYCVMjXQAaVspF1EP/XrE6PCWy4tiAtwH23D9xVi9U1s5i7Pp+BnE8Xo4Ty2Dxb4URMO5rt1aq2u4Z5l27NbZtj8qJOci9QBYHKrpv5FyywzgQgOJ+tvBZ4AwlAjsSkYQmsd6b2kgncU7l4cQdPaFSb9Ca7lP3yNv5PF9yC4y1TQPchMAy5JAuyLIs2PqVle7Mu2fQlF4fPaJiDJBV+gdecczVWLC9h6QoyFdlTNpUzd14tegYyV6mRBWhR0aEzPg3w5W1eUxjkcfchNtg9Azso3zV5MQYPIENcMcSJHK2iKSfna+lAAFxcXz8IpJEe62vT7jjPvWj3vGPufF54OIh6bCoRELhjb5nA/tQwTgwJt0vLmL8AXCgfIxgEghaD50y+82MfRkDgh1dBSBjzAkONB3HquVfjwM2kQut5UGnhHHvcc8lklkTepops3iyMX9hmprXnxnb/DmbTivmamVjQGZ4jAGvKY4Cg2HNhV40waHEPDKEKmNq9ec2KAWy4UyVTcUYXZ6GPE1RRAJyymj9+OxeVA5Qgvq3TrUOVY0kAlVmrduPj174LG9aXyPS0B2qdD2y4CWEWMdu/VZzqZ8/MdIbPu5NVHwgM2vSjsYO6rzYh8h3FCiEFWfTvDKAyBMb91wjZPP9dbfL+7I8v8EKp+8rvPB4BmJYlHLgbkTF8AROo/abROfnimUDl10plcj+681fz77VaC524TEtAKuHUJTKfkupqmvlx1qEZKDK+UFIQnaPDTRZz92k4EaeBOxWCxZmPC23vPR2HPKQx/65jaMJ72eP5PLgLEjwAFGshZhFGlgnN+iQEjHr6UhGW33ncAuBf84ZKDgQqQeHZlmxuxjMw9JpKuVTvwXrkKmXla2yz6uP2LG3IgsA5dbWoKnHzFUL8F3zhPKxcpWXrWQQlVT2zGGq1LO4w0ITsMjUGBaHwgEr1gcXpIFBNC/7w4K6/LRvsLF4P2QTIjgviIrNYP47r02nANqoc8AVFspq1khTZhMppdAv48mWBr8c7nGTVz5wQNAmnxbEhEEgadugJEICdu1MLAjlpg06+u1tMyBTAV2D9zPQ2BMfBqpC425FkijaBS9XjcOpdGI/3I1CYyuYQ3uXs98Pa3SoKQAjasuVROUAVVOrPGL4QGNJfx1uYGdzlcT32uHZfTWF2y7bz8nZ+lu1uFdu0CUClypeyzH0bRCdJW5AvyN/lOEEE57MAsohBGASG55PtkKspgUC7yRSzuI8rJnBagkhgfyqTU1OqP/YvADcqjLFSRcbKE0jM7XPZ+DiNxa/fbJayQBPMxC4i9H/2gS+1B9YPmHY+1X++/hjAfvZN9Z2vwNrNxOQ5LmJPjJ+a/n0FMw0oTu/XPEAVfa75orvehJX89k0ATLibiQk3gkZeC78vISGUWg9OQvclP2w7aaIaTaDb69EDTOCcK84h66Pn4uVCIDUDY6ZNUF7dFJMk+98Ke5cQgsf5d52zdNlb9yVzzPAcYXmZQskblQO8Itgz09zDCMi4bDxQHKMnRAA8sAh/zxMuXCW8MDEkSFLQwTFZrJ1sH5vg7EsvwEDjIeikDVXdH1HJBJsbhHUEUSgorQNgaJDXD8ze2mSFW7SeIfbPPM425JlCWYygMVlm8LT4wkIsZV/SjM43vC48a7D3sdbh9YqxmSFYzO4hHBe9dwIwOwgcVgIEmccWd3C5WE2PmUDl4T5sVA8DQ+Vly7GBnGlrjGMMmcEnALN4eBAfufwqvPUVf42liyoYaFpQJNWtojwMW0ARb1ujcpMvczkHphwzkMYzkG4GMEBTfWqXwZg4OQpte3ucKpatNTnzGVY7tYkcOgOBtq6fyrgTP3O5/7LjYKun274yhdr8zbrtv4wi0K4NRS8f75CSDEToVYB4qrTvArBjl0a5FqNaKwsPz0xWFNTbmTdgLBtlUx2cyi1j11Q+EHxckuqMMRSaWNKtyboYquCN51yJ/de10I2pM0gIxtp5gobU7E+Nva7Ky7PpASVsWSgAugn6ri4kfIw0Vca05W2OkQuW4uy4Qps7bk/n87OSr9vKzQWZgQScx1qm0DacRPn5/Cz2x4Uh8SkdN6ULmcopZ/22TMGE1HTczqni+fj+doyn6HVTbN+d7rsAyBqV2v2BYkLrSRKYXm6/3aSnsxIssm9dNRFPXmgtpElJ9r1Vea1paiPLom6wYlUqLmH+e49mO8fEh9fga3JbUPoHvdjun5tF7LqdvwvH0TuJlezkEaaG8fk4/CocbI7LYy6i2OaeTU0/X4gzewnH8acFPNjrRXIv4XGpe47sGrytS7WUf9cExwXX5bPE1H9JrAuJKr2qe44AO8adSNpMmi+nswrAihUr5MO99947Q7EIMik6mms2iFR1Wi6ow91wl9btTrc4YB06uOsl3ak2ui86Li3E5sl323Zmx3Hscgg1XSMvEyuMIX2Q8wWap05t7eAaUio2ovMVZqySaprtji6wubXwu1lbaYY23qtI56nlfd81yK/b/12+v05HF5w3/jmg8jJzNXbaBN/ltbsT2fz+MA61E+XHZWHr5eB5/fa3nCrf5TFLZV+nmYJBwt8LziA+cJoQkIrZgdhu4xaXMTZh10QbA0hS3ook/DgK9v3pEWbYOZXmhAy1dUdK2DWBgkOn1+bv6sJS0R2K7PKhfHRtZI+bDDuYc99KUsEsvPcetfG9ZG3gDZZLEhkTDo5891HaTNC2s++4TnbcTNfNVXEnvIZLMunSc7CDRrzmbtOQ7nAJ2/k4U7yXHbtT6XMuMs+aokt9usP1vZcA6eeJtOCX6NCyunNXYsUrKBDhhaC/DIDql45HHnnE+MTQ+fPnz5g5vDfcwUx1h/b19XjO8URc93/6KxyLUqmkwvZyH5Wiwk7buXPnPnX2nj7vSR31/92nqIe/9//0f3u0h49mKZa0N8fsjSA9Ucc8VsF9jEIehdRVFDRyLpOwxxy//nglrT+2YKbPYXv/7/0Jqlnsnasc1i8Es2mlvdFae3PM3mi+J+qYx3LcYz3WjXHdj73XABwPM4/eC/lDhYv974P69DtSZSLXN7vCGT7TMf2aoF9YZhKkJ0Ld740meKyT4A91ncdzXfdaTe/trOAZqvSbgc1Fixa9hH5uo/cBbCAwFAglZu71P+YlWNQNNCP7X9H7J5DivsFkdJIjm3swWUVv3mtsgRv4QddWnevP/5EvLnLH2ROTThB2sBPVtXVp7HVoBajgHQU/sXd+pbnX/x8NgEAbhBuKOl+UMwPnXv/3vubW9TkBmHvNCcDca04A5l5zAjD3mhOAudecAMy95gRg7jUnAHOvOQGYe80JwNxrTgDmXv9nv/63AAMAj0tumZ7c1koAAAAASUVORK5CYII=",self.location).href,key:"xzq",visible:!1},{label:"搜索",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAChpJREFUeF7tmn1wFPUZx7/P7l0ADQVtB4SOb0AYbYdqJ3Ycye0Z4BR5uQtYiQPFgtJmuEuwKlpt7QttxylV1ArchaYindGmJVTh7gKIuZB4lxS1xPGlFgeRUasygy+Vl0SS3P6ezgbvsne3d7ebHGEG2P/u9nn97PP8XnZ/hLP8orM8f5wDcK4CznIC51pgqAvA4W28QFV5rN0ujREiPhbgYgIdBotPZOBwUeexT154+oedQxVXzgq4cfeBUiFQSiLe2HTjFR8PJKiymuB4mflqhnQtAAcYo/LZIfAHgqU2SRJ7uyX7ay+vm300n85A72cFUBZ8e+SIYlvLV4b3R2ZMWmTFieINzgHRLQCmWNEzkO0B8JKQuL59fcXeQdrKUDcJgPZHZkw0BcBRve1aieWFDHYUOlgQnpNVe33rhlnvFcp2/hYASllQa7Nr4v5cTsvv2jpa9NpqmHle3uCYPwLwEST6EExHQWI8mMYBGA/g63n0jzOjvq3WU5fXD4C59+5wE2MuExob18wOp+sUZBZwrAhfRXH+JQiXGQVFhA4h0AFIHW21cztyBV52R3AkFYlSSFIpgUoBTDa0CbRHA56f5IPgvndHKzEVM3As/OisaQUH4Kxp9LAQvzIOhHYI4s3tfs9b+QLNdv96X3CagFQJ8PcMZL6wk7xst3/O+9n03St3hAk0jsGHwo/OducFMP+e7ZNVksplFq1bH5uTs+wd3uACIrrfwHlUMBraaz0vDTTxdD2HL+yWCLcx84QMm0VF7tgfbzpk5Mvz0+B4IeylktTbEXq4ImMmy2gBz8qd9cmyk3umhR6uOGZk2Ol77kqG7ekMooRI1O95oFCJ6+04vI0TJIlXG0D4sis+fnpH3TW9Vv1mAEiUTJ+hLADKq8LfUG34G8AXpDhk7IrVeh60GoRVeWd1uCEdAoMb2wIVq6zaygAwb+WuUgG1XBB1NK6Z1WpkUPGGHgdB0d9jRp3ZkdlqkIYVWB36EzO0QTJ5EdGmqN/tt2Lf8izg8IYXEfE9pzP5hG+nAQQQVcX87lfNQrAEoK/0Zd4EgjZnf3VxMBao+J1Zh4WU61t79NieYPC3dXZbYgHPfWb9WAKg1IRWQGBJf83hUDfiS1/x3/yZWYeFllOWB8sg0RMprQD8PBrwvGDGl2kA5TXhK4TgTQzYk8+e8ESb35MxE5hxXEgZxRt6CISZOptvxgKe2834MA1AWR70QqJl/ZVP73w+9sslb62q1DYrp/VSvMHvgOgpfRCyJC9vXT8n7+bJPABfqH99oHkiaU3MP/fvpzVznXNndWg1M1zJvwRvjG2oqM0XnykAWvmrgp9J7TMxPxqY9998DobqvtMX/AGD7k74I9Dr0YC7v2KzBGIKgFId9IJ15Q96NRZwVw1Vcmb8lPuCk1RQSkWOOPbF9fneLpkC4PCFniTgah3dR6IB92YzgQ2ljOILbwd4bMKnYNTk24+YAqCk9T9J4vbo+nlvDmVyZnw5faE1DJQnHxTzb6O1FaFcuuYAVIeDYP5mwpAs1FtaN8wv2FsZM8mZkXH4gisJtLC/UlEbDXg2Dh6ALxQBMDphqIjiM5tP4+InW0IOX2ghASuT95mfjdVW/H7QAJy+0B79AuiiMSembkmb/2dE3v8Wcc8YzVnkhhLDTZSZpzgYGcfyreUkyWt0NqKxgCdl35Ju31QLpAMolm1lO9fN7k4Y05KXqLeBgZNrcsG/idxQYnlrOpjkNd0yX3CaBHqk4ACUtBaQ43RTa53704QjV9M7qyDRr/UJEJGrafrE5sEmZUVf8QYXg+iugreAkjYIMkuVbbVzD+YCoC1NI9Mn5l2IWEkwn6zDG7qfCAtOxSCYsgxWof7on4H5ryUczWw5MEkVeCc9QGZe0Owq+Ue+wAt1X6kOrQVjahJAoabBzIVQ5vQyo/nAJgKWpibDb8t2+/RdzssMX1gWKvGEHcUbagFhZOJ3IRdCWmI1/QHzvlig4jZ9Ajc2H3QKiBczkmJ+KuIqOeWt4KzZNoWFtEnvP32wNgJuchbYdjFD2qo3IEu0uHW9+239f67mA88CuDnD0RDMCoovlPqQCLGY35PcHGWrNlMANGXFF1wH0HUJQ0YvQctbDhfb1CMxECX3DUnHpxhCenwEMrVfMQ3A6QvfyuD+d22MI7Ktd0nruu9/mNIKuw5cLGT8G4SvpVMnUJNg9ZFm1+SmQva/w7vNRSStTpmGbbQwutadMTBnxmQyEu1gA0H9C4iSewImqm/zux9LN+F68d0piPMb2U3TFhD2sMD2fB9dzYSneEN/BuG7/bLUHAu4jb5YZZgzXQGaZkYVEFSZaEn6WKDJTm/e75QgZQ6KmSF0gfkzED4F6AAz7Wp2Tci5gdGbULzheSD+hf4/lmlZ2zr362bgWQKgGXT4ghsJdFXCOBEdLOod/uNI3Q1H0h3OfP4/41T7sCcBnm0mGN0TXB2ZMfFn+XSMSh9Em2N+t345nNOMZQBKdXgGmP+Q0m9EB6N+d6WRp9K9e+0XHBmtLZNXAJnjgmF0zJ9HXCU5zwlMrX72Upnt2qyju/h/diEt3b3BrZ0/MHVZBnCyFUIPMjA/xQPhjZjfc0c2r66m/VdCklcArJ00yX1OiPmvEVfJ4my2Zq3YMey4Gn+FgPMYLAjoYpBKhIejfk+Dqcy/EhoQAE03/S2R9p92EGLs4RO+LVsq1ewg3h1FkvAwowJElzNwIQEXJquDUWfv4ft2zi4xPBjlrAldzgJbCLiIgcTH2W4Qnon5PXdaSb4vZqsKCXnts5TaI2svSlILgdCh9uKh9jrPBwO1nU1PqQmWQSS/Al2pk+smoogQ9IB+k2bG/4ABaMb7jsaonDFiE3CYgYb4sBOb9zxe+aWZQHLJTK3efqkMUQnmW/vleDxAowCKA9w332sDslUIgwKgOXVVNY3qsZ1Ym/aBsi9OLSAm3tzVcyLSUVeZMUvkA1N2Z+gSSeU5YNISL9bLEzCMwQxQypcpqxAGDSARlFIdvi/1CaWk1wnmlwWopb3WszNX4tfd/fyF9u7eWQKsEHBNNlltqSuY/mV0YsQKhIIB6GsJb3CBRJJ2RvCSXEkS6CizOAaiowxor9a0LexICdppLj4vly4DeyXi+qi/InrSp/GxGbMQCgrgZEs0jOqWRyxkEosIlDOZfC2Qcp/xHmmJByqeS9cbDISCA0gEN7Vq60TZbruZGApDG7AGfO1jRsxGI+tbA9OOZ7MyUAinDIA+UG36IkHlDGgHFZPfF7Ii0Z62RC0quNXKGcOBQBgSAPpEy1e1DMfHx4t77NL5skTnyyoXxam7S1XtncOGxzuPdV3cOZDjbgkfViEMOYABN4IFxewQMs8wnpEAcs0OsYAnZWo9YwEYQSCDU6xnNAANQmlVw6jh8vCpNkjHSeV9+i9afatVC611RoqeA3BGPlYLSZ2rAAuwzkjRs74C/g/v9i99Qr4F4AAAAABJRU5ErkJggg==",self.location).href,key:"search",hasChild:!0,visible:!1,handler:"handleSearch"},{label:"测距",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAgZJREFUWEfFlr9KA0EQxmeDjZ1ebacbbfUJFAQFtUxKQVJI7lC00dLkDQKSBERBBBtTamPnCwhWgpy2NuomoCiCuZU1F0z29t/tXchBmuxlvt/MfjMTBEN+0JD1YSAATt1fggAmiIdPdAmmDuDU/BwAXITCDeLivAoiVQBOvKurhEgNgM8cABomlUgFIJo5PSJudtPkOhIDCDJnHoCgDQutLXyjg0gEIAre+Y4usgp0TaCCsAYQGY6izFqzOHklcj33/i5xcYW9ZwUgKDuLlUOUbrx52VMJAGvNv+sBBMukiK+tAGTlHDv050c+27ev+zPvPIBT8//FAfLExaxDQhbdqOo57xdHXwB0lLWbatioxGNVgM+coswZ0KAEAPdNF69ry85lHqsCvOFUd93jfGnZe2G1JpT2OaWzLS97Z5u5UQWEfV59KCGUmfv+gcLHNn6JYzgRrLQCgj5/DihdkWXNgusMZwwg63OgQZl408x4kcdGXNgFsj536v4BKeJymuIRAPE+72w22biwzTxiwvH60yqiwWV4wCYV+1QA0Dlxp/bSzjwC4FT9AiA4Dg/6xuWgxEVXYDQ8kpZdOYh0wXXnMVaLfBnJRNIWVy4jXizc5Z19LlkscbNXAggmWze+1qBxQEyWkZEx44gqTShpuR2KMo+y/3u24torSBLY9LfaKzANZPveL7x9LDDFJHZqAAAAAElFTkSuQmCC",self.location).href,key:"LineString",visible:!0},{label:"测面",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABCpJREFUWEfFll1oHFUYht9vNjcK1uSsolda7J4N26JYUYvVCy9UKoL0Jr8W/1CzM1MLBSH+1SbVYlAQbTKzNSIWCgUTFAoFf8BSKLZYQalWo3sWqSBqJXsmtVARt/PJmeyms8ludrfd0nM1M3s473Pe79v3HMJlHnSZ9dF2gM5xde/cs/JQsxtrK4Dw1Icg9ILDUe12jzQD0TYAkcvvA9PAgmiTEG0BSPpqLwObAEyH5+BbCUwAWNOMExcNIPz8HoAeK+98WjuyV+xWqxFiKoIgjGhbjtYrx0UBCE+9D8KTZudlgR7z3ArEBQOInJoE4+mKoAEQvjK7bgniggCSfj7HoCyArwCsA3Dwv7DUe2ZzpliGgHEhgmpQjpYBunw1QYDLhP2BLTd2+WqYgDGAj1vhud7ZzZn84nqXIX4w35nhBq70K3NaAhBe/h0QbYkJ9GpHTgvv5xFYFtdrNuErU5YpkNG3Hg7sVQdaBhCeeguEreWGM01n6m1GBFGvyxfEgRKx1Vd0V30cn9uUA8LPvwnQc5GF4EcCJ70vtnBdiMocAv6Fhb5iVu5fDNoQIOmrMQaGAXwE4AEAVxF4S9FJj5cFeioNF1/8PCCdZaK+uO1NO9Dlq50EvAjGUe3K9cIrbADxuwBuWC7lYu6cYVBf4KQ+aTmIRK6wA8zbyjXvYdBQ4KQmkxP5dZygDQ0bDpgDoV/b8rPlDqWaJRA5tR0Mc5rNp9r5gNmqHfl2Ew1XBGNQu/LzRidibQC/cBjge2qmXJ1sj9n+F1nWYMh8LZiHFgAIJ66wTg//PnT72WV7YGH3jFEQtjNhb2DLRytR26Dh/rCIB2dtechcTCpCVgIvRA1c44he4oDwC8cAviNkXmuBNhoIEN7Ttnymlp2xkPmNORwMnO7DS5JwQt0FC0cA+lo7qTvrOiC8mfWgji8B/KMdeWW0a0+NRE6AxwMnHU9Bc/jMJxzwKywM6Kw8WrPmU1MJMXvrKYCS4NLd2s0cqZmESU+9zoTnQfSFtlP3VSZVIIj5jaKbNpkQF/+FKBwo2t3Hlms44RcOAPwQMcaKrjQliUZVCUROfQfGzSB6VdupV6qDpZyGHI4SJYoM3gVAWQn0zw7Jbxp1u/Dy20C0A4TvtS1vWQLQmVNrLcb8QhY9qLOpT5fU0lOToOgOYNB/CinRP5e96Xgj8cix3fn7EVL0twwJt83Z8tsqB7q8/GtE9FK02ApcrTfJv2s23fzN90YmeiqwUyeaEY8AdqkV6MBp88zMOwM3/XIVgPDVjwAy8w5gjc5K8962Eb8TAJjRjlxdDeCpP0G4rqw4Cw69ptQtixvOC0MCWS6Aa6K5jFPalddXA+QKH4D58YaLtWMC0R5tp56oAjAvnbmZlSh1rGyHRt01Okon5+zMycrvDe8DlxRmcQ5carFa6/8Pq4PXMG+KSocAAAAASUVORK5CYII=",self.location).href,key:"Polygon",visible:!0},{label:"清除",image:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA6ZJREFUWEfFll9oHFUUxr8zm02j2JqdLRHbIkIym75oRSL6JMmLpVCNIEpbxKdqzExTii2ItaWxq9CHtkGTzrrEvgjSUkGCFQs+BV+kUMGXgMlsbKHaqklm0lT6J9m9n8yaxN3NdGe32aXzeOfc7/vdc8899woe8CcP2B81B2gedDolgiP+wjSoT2fM9pFyi6wpQMvwb49lF3I/A9i4aDqryK5ZK/HLvSBqChC3nYMEPik0Uzl0zfYZo3UHaB643KytyY4DaCk0c/9ui6JfsnUH0FOZ/SCPFxkRJ1zLOFD3Gth08upDt5ru/AlgXaHZfBYt/+w1puoOELMn3xeoYyVGp13T2B12zFdfhP3U9JbMbQCNhWaa0tqn97RO1BwglsrsELIPwNMAxiC4AKK/2IjfuGbitTBz/39VGdBtZx+AgTBhTdOem3639VJYXFUA+rCzCQu4WoHoRUa0rV5P640KYqvLQMye3CVUhyHYXF5crlCkz+tt/S4MoqItaD418YwmMgIi6VrG6fjQr92UyCEIOso0mPMzpvHKqgHiqfGNpPZ7gdA1gknPTHweS01uB9V+ATqDjLRIdMN0z5PX778PpBnVc5n5IAEBpgBJzphtgz6IRtVDYHs190DZItRt53UA58JSCMAvtqOuaZxcBHmHwMskpjzLKLoX7rGQlcMx2xkSwKrAvCBEblGY9HqNY/mtUWqbZxmhGkVFqJ9yXoKGD0G8uKxMDEPwdhUw/s2XdE3jaCVzlgH0lHMEhH9zPZKfSPxFTfYJeaZUiJAvBXxr5TjuCrAGoOuaiXhVAOvTVx5XuQW/e20A8RMi2A3Fw4DsKBH6AoDfZmMBACMCvArgomsaL1QF4Af7hUdgVwPne7NaU4dQnS8UITAKyBkB04EFJRgl0SnEVzOW8WbVAPkJ6UtR9HQsxG3nW7+a/xfhH02RucTd3KNni8eXIy5A8tnbAqqPXKu95IIKxgnshH4VC3PHAWlfmqYEz0aV3MwJnSApBXRrwCCAJ1YN4BvEhyaeVxH5QIhuiuz0etvOxu1MH8HPAvZ+0jONNt125gCsrQlA3uTcWKM+1XBwKZ267XwPYNuKDBAn1j3ccGjudtZ/mKB2ACVOuu0wKP0UeUqECgpji0d4wLWM9+6vCMvMWpseX9+Yi+wk6GdhKRM/uKax9b+6WT41X7um8UbNAUoF/c6pyDuzexI/xlOZvSQ/BnCdwDXPNLrqDlCJQVhMRQ+SMJHV/P8X3mtmMGFz/NIAAAAASUVORK5CYII=",self.location).href,key:"clear",visible:!0}]};function eh(){return My}My.prj,My.prj;const nw=gt("EPSG:3857").getExtent(),PD=Pt(nw)/256,rw=new Array(19),iw=new Array(19);for(let r=0;r<19;++r)rw[r]=PD/Math.pow(2,r),iw[r]=r;function Qa({id:r,visible:t,opacity:e,zIndex:n,minZoom:i,maxZoom:o}){return{id:r,visible:t,opacity:e,zIndex:n,minZoom:i,maxZoom:o}}class Ny{constructor(t,e){zt(this,"prj",eh().prj);zt(this,"isWgs84",!1);zt(this,"isWebmocat",!1);zt(this,"defaultStyle",new ye({fill:new Dt({color:"rgba(255, 208, 75, 0.5)"}),stroke:new Je({color:"red",width:2}),image:new lr({radius:7,fill:new Dt({color:"#ffcc33"})})}));zt(this,"defaultVectorLayerId","vector_layer_temp_id_");this.map=t,this.prj=e}setMap(t,e){this.map=t}getWmts(t){return new Cr({id:t.id===void 0?"id_"+Math.random():t.id,opacity:t.opacity===void 0?1:t.opacity,visible:t.visible===void 0?!0:t.visible,source:new Df({url:t.url,format:"image/png",tileGrid:new zo({origin:wr(nw),resolutions:rw,matrixIds:iw})})})}getWmtsWgs84(t){const e=gt(ni["EPSG:4326"].prj),n=e.getExtent(),{resolutions:i,matrixIds:o}=ni["EPSG:4326"];return new Cr({id:t.id===void 0?"id_"+Math.random():t.id,opacity:t.opacity===void 0?1:t.opacity,visible:t.visible===void 0?!0:t.visible,source:new Df({...t,wrapX:!0,projection:e,tileGrid:new zo({origin:wr(n),resolutions:i,matrixIds:o})})})}getWmtsByPrj({prj:t,options:e}){const n=gt(ni[t].prj),i=n.getExtent(),{resolutions:o,matrixIds:a}=ni[t],l=[];a.forEach(h=>{e.params.matrixSetPrefix?l.push(`${e.params.matrixSetPrefix}${h}`):l.push(`${h}`)});const{url:u,params:c={}}=e;return c.hasOwnProperty("matrixSet")||(c.matrixSet=c.tilematrixset),new Cr({...Qa(e),source:new Df({url:u,format:"image/png",style:"",...c,wrapX:!0,projection:n,tileGrid:new zo({origin:wr(i),resolutions:o,matrixIds:l})})})}getWmtsGeoserver({prj:t="EPSG:4326",options:e}){const n=gt(ni[t].prj);n.getExtent();const{resolutions:i,matrixIds:o}=ni[t],a=this.getMatrixIds(o,t),l=new zo({extent:[-180,-90,180,90],tileSize:[256,256],origin:[-180,90],resolutions:i,matrixIds:a}),{params:u}=e;u.hasOwnProperty("matrixSet")||(u.matrixSet=u.tilematrixset);const c=new Df({url:e.url.split("?")[0],projection:n,tileGrid:l,format:"image/png",...Wn.parasUrlParams2Obj(e.url),...u});return new Cr({id:e.id===void 0?"id_"+Math.random():e.id,opacity:e.opacity===void 0?1:e.opacity,visible:e.visible===void 0?!0:e.visible,source:c,wrapX:!1})}getXYZ(t){const{url:e}=t;return new Cr({...Qa(t),source:new Va({url:e})})}getXYZByPrj({prj:t,options:e={}}){const{url:n}=e;return new Cr({...Qa(e),source:new Va({url:n,projection:t})})}getTdtByPrj({prj:t,options:e}){return this.getXYZByPrj({prj:t,options:e})}getTmsLayer(t){return new Cr({id:t.id,opacity:t.opacity===void 0?1:t.opacity,visible:t.visible===void 0?!0:t.visible,source:new Va({tileUrlFunction:function(e){let n=e[0],i=e[1],o=-e[2]-1;return`${t.url}/${n}/${o}/${i}.png`}})})}getSuperMapWmts({prj:t,options:e}){const i=gt(ni[t].prj).getExtent(),{resolutions:o,matrixIds:a,origin:l}=ni[t],{requestParams:u}=e,c=new zo({origin:u.origin||l||wr(i),resolutions:u.resolutions||o,matrixIds:u.matrixIds||a});return new Cr({...Qa(e),source:new Va({tileGrid:c,projection:t,tileUrlFunction:function(f){const d=f[0],g=f[1],p=f[2];return`${e.url}&request=gettile&tilecol=${g}&tilerow=${p}&tilematrix=${d}`}})})}getSuperMapXYZ({prj:t,options:e}){const i=gt(ni[t].prj).getExtent(),{resolutions:o,matrixIds:a}=ni[t],l=new zo({origin:wr(i),resolutions:o,matrixIds:a}),{url:u}=e;return new Cr({id:e.id===void 0?"id_"+Math.random():e.id,opacity:e.opacity===void 0?1:e.opacity,visible:e.visible===void 0?!0:e.visible,source:new Va({tileGrid:l,projection:t,tileUrlFunction:function(h){let f=h[0],d=h[1],g=-h[2]-1;return`${u}/${f}/${g}/${d}.png?k=HzxwyaaeOc7z1KRENNqH0A==`}})})}getWmsTile(t){return new Cr({...Qa(t),source:new dL({url:t.url.split("?")[0],params:Wn.parasUrlParams2Obj(t.url)})})}getWmsImage(t){return new $p({...Qa(t),source:new qA({url:t.url.split("?")[0],params:Wn.parasUrlParams2Obj(t.url)})})}getArcgisImage(t){return new $p({id:t.id,visible:t.visible,source:new jA({url:t.url})})}getArcgisImageTile(t){return new Cr({...Qa(t),source:new hL({url:t.url})})}getUserDefinedXYZ(t){return new Cr({id:t.id||oi(),opacity:t.opacity===void 0?1:t.opacity,visible:t.visible===void 0?!0:t.visible,source:new Va({url:t.url,projection:t.prj===void 0?"EPSG:3857":t.prj})})}getGeojsonLayer({id:t,visible:e,geojson:n}){const i=new Un({features:new Qo().readFeatures(n)});return new Ur({id:t,visible:e,source:i})}getGaodeLayer(t){return this.getXYZ({id:"layerId_gaode",url:"http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",...t})}getUrl(t=0,e,n,i){let o="";switch(t){case 0:o="http://online3.map.bdimg.com/onlinelabel/?qt=tile&x="+e+"&y="+n+"&z="+i+"&styles=pl&udt=20200519&scaler=1&p=1";break;case 1:o="http://shangetu"+parseInt(Math.random()*10)+".http://map.bdimg.com/it/u=x="+e+";y="+n+";z="+i+";v=009;type=sate&fm=46&udt=20170606",o="https://maponline2.bdimg.com/starpic/?qt=satepc&u=x="+e+";y="+n+";z="+i+";v=009;type=sate&fm=46&app=webearth2&v=009&udt=20200519";break;case 2:o="http://online"+parseInt(Math.random()*10)+".http://map.bdimg.com/onlinelabel/?qt=tile&x="+e+"&y="+n+"&z="+i+"&styles=sl&udt=20200519&scaler=1&p=1";break}return o}getBaiduLayer(t){}getGeojsonLayerWithRender(t){let{id:e,visible:n,geojson:i,field:o,labelField:a}=t;const l=new Un({features:$1(i,{field:o,labelField:a})});return new Ur({id:e,visible:n,source:l,style:function(c){console.log(c)}})}getHeatMapLayer(t,e){let{field:n,blur:i,radius:o}=e,a=new Un({features:new Qo().readFeatures(t)});return new XN({source:a,blur:i||10,radius:o||10,weight:function(u){return u.get(n)}})}getClusterLayer(t,{id:e=od(),visible:n=!0,distance:i=20,minDistance:o=0,style:a={},zIndex:l,geomField:u="wktstr",showLabel:c=!0}={}){let h=!1;t instanceof Array?h=!1:h=!0,Object.keys(a).length===0&&(a={circle:{radius:16,color:"#3399CC"},text:{color:"#fff",offsetX:0,offsetY:0}}),c&&(a.text||(a.text={}),a.text.textFormatter=(p,m)=>p.get("features").length===1?p.get("features")[0].getProperties()[a.text.field]||"":p.get("features").length.toString());let f=null;if(h)f=new Un({features:$1(t)});else{const p=[];t.forEach(m=>{const y=new ws().readFeature(m[u]),E=Wn.deepClone(m);delete E[u],m.id&&y.setId(m.id),y.setProperties(E),p.push(y)}),f=new Un({features:p})}this.trasnformPrj(f.getFeatures());const d=new kA({distance:i,minDistance:o,source:f});return new Ur({id:e,visible:n,source:d,style:ao(a),zIndex:l})}getOverlayLayer(t,{autoPan:e=!0,className:n="vmap-overlay-"+oi(),positioning:i="center-right"}={}){return new hd({element:t,autoPan:e,className:n,positioning:i})}getVectorLayer({id:t=this.defaultVectorLayerId+oi(),style:e=this.defaultStyle}={id:this.defaultVectorLayerId+oi(),style:this.defaultStyle}){const n=new Un({wrapX:!1});return new Ur({id:t,source:n,style:e})}createRingLayer({map:t,center:e,outerR:n,innerR:i}){const o=new Ye({geometry:ew(t,e,n,i)}),a=this.getVectorLayer();return a.getSource().addFeature(o),a}createPoints(t){return this.createCustomLayer({...t,multiple:!1})}createLines(t){return this.createCustomLayer({...t,multiple:!1})}createMultiLines(t){return this.createCustomLayer({...t,multiple:!0})}createPolygons(t){return this.createCustomLayer({...t,multiple:!1})}createMultiPolygons(t){return this.createCustomLayer({...t,multiple:!0})}createCustomLayer({layerId:t=Wn.UUIDGenerator(),features:e,style:n={circle:{},icon:{},stroke:{},fill:{},text:{}},visible:i=!0,opacity:o=1,zIndex:a=100,map:l=this.map,clear:u=!1,multiple:c=!0,cluster:h=!1,geomField:f="wktstr"}){const d=n.hasOwnProperty("text")&&n.text.hasOwnProperty("field"),g=ao(n);let p=null;const m=[];if(e instanceof Array)e.forEach((E,_)=>{if(E[f]){const{id:v=Wn.UUIDGenerator()}=E,x=E[f];if(E.style?p=ao(E.style):p=g,c){const w=new ws().readFeatures(x),I=Wn.deepClone(E);delete I[f],w.forEach(C=>{C.setProperties(I),C.setStyle(p),m.push(C)})}else{const w=new ws().readFeature(x),I=Wn.deepClone(E);delete I[f],v&&w.setId(v),w.setProperties(I),d||w.setStyle(p),m.push(w)}}});else if(p=g,c)new Qo().readFeatures(e).forEach(_=>{_.setStyle(p),m.push(_)});else{const E=new Qo().readFeature(e);d||E.setStyle(p),m.push(E)}let y=this.getLayerById(t,l);if(y&&u&&y.getSource().clear(),this.trasnformPrj(m),y==null){const E={id:t};d&&(E.style=p),y=this.getVectorLayer(E),y.getSource().addFeatures(m),y.setVisible(i),y.setZIndex(a),y.setOpacity(o),l.addLayer(y)}else y.getSource().addFeatures(m);return y}removeLayerById(t,e=this.map,n=!0){if(e&&t){let i=e.getLayers().getArray();for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.getProperties().id;(!n&&l&&l.indexOf(t)!==-1||l===t)&&e.removeLayer(a)}}}getLayerById(t,e){if(e){let n=e.getLayers().getArray();for(let i=n.length-1;i>=0;i--){const o=n[i];if(o){const a=o.getProperties().id;if(a&&a===t)return o}}}return null}setLayerVisibleById(t,e,n=this.map){if(n&&t){let i=n.getLayers().getArray();for(let o=0;o<i.length;o++){const a=i[o],l=a.getProperties().id;l&&l===t&&a.setVisible(e)}}}checkLayerIsExist(t,e){if(t&&e){const n=t.getLayers().getArray();for(let i=0;i<n.length;i++){const a=n[i].getProperties().id;if(a&&a===e)return!0}return!1}else return!1}removeAllLayer(t){if(t){let e=t.getLayers().getArray();for(let n=e.length-1;n>=0;n--){const i=e[n];i&&i.getProperties().id&&t.removeLayer(i)}}}trasnformPrj(t){this.prj.includes("4326")||t.forEach(e=>{e.getGeometry().transform("EPSG:4326",this.prj)})}getMvtOfficial(t){const e="pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ",n=[];for(let o=0;o<=8;++o)n.push(156543.03392804097/Math.pow(2,o*2));function i(o){return("http://localhost/mapbox/map/{a-d}/v4/mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token="+e).replace("{z}",String(o[0]*2-1)).replace("{x}",String(o[1])).replace("{y}",String(o[2])).replace("{a-d}","abcd".substr(((o[1]<<o[0])+o[2])%4,1))}return new rd({source:new Of({attributions:"",format:new pd,tileGrid:new Sc({extent:gt("EPSG:3857").getExtent(),resolutions:n,tileSize:512}),tileUrlFunction:i}),style:RD(ye,Dt,Je,Fc,zf)})}getMatrixIds(t,e){const n=[];return t.forEach(i=>{n.push(`${e}:${i}`)}),n}getMvt({prj:t="EPSG:3857",options:e}){let n=t;const i=gt(n),{resolutions:o,matrixIds:a,tileGrid:l}=ni[n],u=this.getMatrixIds(a,n),{id:c,url:h,visible:f,opacity:d,zIndex:g}=e,{style:p={}}=e.params;let m="application/vnd.mapbox-vector-tile";const y={REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:e.params.layer,STYLE:"",TILEMATRIX:n+":{z}",TILEMATRIXSET:n,FORMAT:m,TILECOL:"{x}",TILEROW:"{y}"};function E(){let v=h+"?";for(let w in y)v=v+w+"="+y[w]+"&";return v=v.slice(0,-1),new Of({url:v,format:new pd({}),projection:i,tileGrid:new zo({tileSize:[256,256],origin:e.params.origin||l.origin,resolutions:e.params.resolutions||o,matrixIds:u}),wrapX:!0})}return new rd({id:c,visible:f,opacity:d,source:E(),zIndex:g,style:Qm(p)?p:JSON.stringify(p)==="{}"?void 0:ao(p)})}getMvtGeography(t){var e="EPSG:4326";const n=gt(e),{resolutions:i,matrixIds:o}=ni[e],a=this.getMatrixIds(o,e),{id:l,url:u,visible:c,opacity:h}=t,{layer:f,style:d={}}=t.params;var g="application/vnd.mapbox-vector-tile";const p={REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f,STYLE:"",TILEMATRIX:e+":{z}",TILEMATRIXSET:e,FORMAT:g,TILECOL:"{x}",TILEROW:"{y}"};function m(){var y=u+"?";for(var E in p)y=y+E+"="+p[E]+"&";y=y.slice(0,-1);var _=new Of({url:y,format:new pd({}),projection:n,tileGrid:new zo({tileSize:[256,256],origin:[-180,90],resolutions:i,matrixIds:a}),wrapX:!0});return _}return new rd({id:l,visible:c,opacity:h,source:m()})}getMapboxVt(t={}){console.log("................................",t);const{id:e,url:n,visible:i=!0,opacity:o=1,zIndex:a=void 0,layerStyle:l}=t;return new rd({id:e,visible:i,opacity:o,zIndex:a,source:new Of({format:new pd,url:n}),style:Qm(l)?l:JSON.stringify(l)==="{}"?void 0:ao(l)})}}const Cd={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Id extends Er{constructor(t,e){super(t),this.feature=e}}function bD(r,t){const e=[];for(let n=0;n<t.length;++n){const o=t[n].getGeometry();sw(r,o,e)}return e}function Td(r,t){return Zs(r[0],r[1],t[0],t[1])}function fu(r,t){const e=r.length;return t<0?r[t+e]:t>=e?r[t-e]:r[t]}function Rd(r,t,e){let n,i;t<e?(n=t,i=e):(n=e,i=t);const o=Math.ceil(n),a=Math.floor(i);if(o>a){const u=du(r,n),c=du(r,i);return Td(u,c)}let l=0;if(n<o){const u=du(r,n),c=fu(r,o);l+=Td(u,c)}if(a<i){const u=fu(r,a),c=du(r,i);l+=Td(u,c)}for(let u=o;u<a-1;++u){const c=fu(r,u),h=fu(r,u+1);l+=Td(c,h)}return l}function sw(r,t,e){if(t instanceof Sr){Pd(r,t.getCoordinates(),!1,e);return}if(t instanceof ja){const n=t.getCoordinates();for(let i=0,o=n.length;i<o;++i)Pd(r,n[i],!1,e);return}if(t instanceof ar){const n=t.getCoordinates();for(let i=0,o=n.length;i<o;++i)Pd(r,n[i],!0,e);return}if(t instanceof Wa){const n=t.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length;l<u;++l)Pd(r,a[l],!0,e)}return}if(t instanceof Rc){const n=t.getGeometries();for(let i=0;i<n.length;++i)sw(r,n[i],e);return}}const Oy={index:-1,endIndex:NaN};function AD(r,t,e,n){const i=r[0],o=r[1];let a=1/0,l=-1,u=NaN;for(let f=0;f<t.targets.length;++f){const d=t.targets[f],g=d.coordinates;let p=1/0,m;for(let y=0;y<g.length-1;++y){const E=g[y],_=g[y+1],v=ow(i,o,E,_);v.squaredDistance<p&&(p=v.squaredDistance,m=y+v.along)}p<a&&(a=p,d.ring&&t.targetIndex===f&&(d.endIndex>d.startIndex?m<d.startIndex&&(m+=g.length):d.endIndex<d.startIndex&&m>d.startIndex&&(m-=g.length)),u=m,l=f)}const c=t.targets[l];let h=c.ring;if(t.targetIndex===l&&h){const f=du(c.coordinates,u),d=e.getPixelFromCoordinate(f);af(d,t.startPx)>n&&(h=!1)}if(h){const f=c.coordinates,d=f.length,g=c.startIndex,p=u;if(g<p){const m=Rd(f,g,p);Rd(f,g,p-d)<m&&(u-=d)}else{const m=Rd(f,g,p);Rd(f,g,p+d)<m&&(u+=d)}}return Oy.index=l,Oy.endIndex=u,Oy}function Pd(r,t,e,n){const i=r[0],o=r[1];for(let a=0,l=t.length-1;a<l;++a){const u=t[a],c=t[a+1],h=ow(i,o,u,c);if(h.squaredDistance===0){const f=a+h.along;n.push({coordinates:t,ring:e,startIndex:f,endIndex:f});return}}}const Fy={along:0,squaredDistance:0};function ow(r,t,e,n){const i=e[0],o=e[1],a=n[0],l=n[1],u=a-i,c=l-o;let h=0,f=i,d=o;return(u!==0||c!==0)&&(h=Oe(((r-i)*u+(t-o)*c)/(u*u+c*c),0,1),f+=u*h,d+=c*h),Fy.along=h,Fy.squaredDistance=ac(Zs(r,t,f,d),10),Fy}function du(r,t){const e=r.length;let n=Math.floor(t);const i=t-n;n>=e?n-=e:n<0&&(n+=e);let o=n+1;o>=e&&(o-=e);const a=r[n],l=a[0],u=a[1],c=r[o],h=c[0]-l,f=c[1]-u;return[l+h*i,u+f*i]}class LD extends Jo{constructor(t){const e=t;e.stopDown||(e.stopDown=Aa),super(e),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=OD(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:qs,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let n=t.geometryFunction;if(!n){const i=this.mode_;if(i==="Circle")n=function(o,a,l){const u=a||new MA([NaN,NaN]),c=de(o[0]),h=Js(c,de(o[o.length-1]));return u.setCenterAndRadius(c,Math.sqrt(h),this.geometryLayout_),u};else{let o;i==="Point"?o=or:i==="LineString"?o=Sr:i==="Polygon"&&(o=ar),n=function(a,l,u){return l?i==="Polygon"?a[0].length?l.setCoordinates([a[0].concat([a[0][0]])],this.geometryLayout_):l.setCoordinates([],this.geometryLayout_):l.setCoordinates(a,this.geometryLayout_):l=new o(a,this.geometryLayout_),l}}}this.geometryFunction_=n,this.dragVertexDelay_=t.dragVertexDelay!==void 0?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new Ur({source:new Un({useSpatialIndex:!1,wrapX:t.wrapX?t.wrapX:!1}),style:t.style?t.style:MD(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:ay,this.freehandCondition_,t.freehand?this.freehandCondition_=Kc:this.freehandCondition_=t.freehandCondition?t.freehandCondition:ly,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(ny.ACTIVE,this.updateState_)}setTrace(t){let e;t?t===!0?e=Kc:e=t:e=oy,this.traceCondition_=e}setMap(t){super.setMap(t),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(t){t.originalEvent.type===ot.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(t);let e=t.type===Bt.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&t.type===Bt.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===Bt.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(t.coordinate),n=!1):this.freehand_&&t.type===Bt.POINTERDOWN?n=!1:e&&this.getPointerCount()<2?(n=t.type===Bt.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):(t.originalEvent.pointerType==="mouse"||t.type===Bt.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(t)):t.type===Bt.DBLCLICK&&(n=!1),super.handleEvent(t)&&n}handleDownEvent(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new lo(Bt.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))},this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active){this.deactivateTrace_();return}const e=this.getMap(),n=e.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),i=e.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_]),o=bn([n,i]),a=this.traceSource_.getFeaturesInExtent(o);if(a.length===0)return;const l=bD(t.coordinate,a);l.length&&(this.traceState_={active:!0,startPx:t.pixel.slice(),targets:l,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,e){const n=t.startIndex<=t.endIndex,i=t.startIndex<=e;n===i?n&&e>t.endIndex||!n&&e<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,e):(n&&e<t.endIndex||!n&&e>t.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let n=0;if(t<e){const i=Math.ceil(t);let o=Math.floor(e);o===e&&(o-=1),n=o-i+1}else{const i=Math.floor(t);let o=Math.ceil(e);o===e&&(o+=1),n=i-o+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(t,e,n){if(e===n)return;const i=[];if(e<n){const o=Math.ceil(e);let a=Math.floor(n);a===n&&(a-=1);for(let l=o;l<=a;++l)i.push(fu(t.coordinates,l))}else{const o=Math.floor(e);let a=Math.ceil(n);a===n&&(a+=1);for(let l=o;l>=a;--l)i.push(fu(t.coordinates,l))}i.length&&this.appendCoordinates(i)}updateTrace_(t){const e=this.traceState_;if(!e.active||e.targetIndex===-1&&af(e.startPx,t.pixel)<this.snapTolerance_)return;const n=AD(t.coordinate,e,this.getMap(),this.snapTolerance_);if(e.targetIndex!==n.index){if(e.targetIndex!==-1){const u=e.targets[e.targetIndex];this.removeTracedCoordinates_(u.startIndex,u.endIndex)}const l=e.targets[n.index];this.addTracedCoordinates_(l,l.startIndex,n.endIndex)}else{const l=e.targets[e.targetIndex];this.addOrRemoveTracedCoordinates_(l,n.endIndex)}e.targetIndex=n.index;const i=e.targets[e.targetIndex];i.endIndex=n.endIndex;const o=du(i.coordinates,i.endIndex),a=this.getMap().getPixelFromCoordinate(o);t.coordinate=o,t.pixel=[Math.round(a[0]),Math.round(a[1])]}handleUpEvent(t){let e=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);const n=this.traceState_.active;if(this.toggleTraceState_(t),this.shouldHandle_){const i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_==="Point")&&(this.atFinish_(t.pixel,n)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing()}return!e&&this.stopClick_&&t.preventDefault(),e}handlePointerMove_(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const e=this.downPx_,n=t.pixel,i=e[0]-n[0],o=e[1]-n[1],a=i*i+o*o;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(t.coordinate.slice());return}this.updateTrace_(t),this.modifyDrawing_(t.coordinate)}atFinish_(t,e){let n=!1;if(this.sketchFeature_){let i=!1,o=[this.finishCoordinate_];const a=this.mode_;if(a==="Point")n=!0;else if(a==="Circle")n=this.sketchCoords_.length===2;else if(a==="LineString")i=!e&&this.sketchCoords_.length>this.minPoints_;else if(a==="Polygon"){const l=this.sketchCoords_;i=l[0].length>this.minPoints_,o=[l[0][0],l[0][l[0].length-2]],e?o=[l[0][0]]:o=[l[0][0],l[0][l[0].length-2]]}if(i){const l=this.getMap();for(let u=0,c=o.length;u<c;u++){const h=o[u],f=l.getPixelFromCoordinate(h),d=t[0]-f[0],g=t[1]-f[1],p=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(d*d+g*g)<=p,n){this.finishCoordinate_=h;break}}}}return n}createOrUpdateSketchPoint_(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Ye(new or(t)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(t){this.sketchLine_||(this.sketchLine_=new Ye);const e=t.getLinearRing(0);let n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new Sr(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(t){const e=this.getMap().getView().getProjection(),n=gf(this.geometryLayout_);for(;t.length<n;)t.push(0);this.finishCoordinate_=t,this.mode_==="Point"?this.sketchCoords_=t.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Ye(new Sr(this.sketchLineCoords_)));const i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Ye,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Id(Cd.DRAWSTART,this.sketchFeature_))}modifyDrawing_(t){const e=this.getMap(),n=this.sketchFeature_.getGeometry(),i=e.getView().getProjection(),o=gf(this.geometryLayout_);let a,l;for(;t.length<o;)t.push(0);this.mode_==="Point"?l=this.sketchCoords_:this.mode_==="Polygon"?(a=this.sketchCoords_[0],l=a[a.length-1],this.atFinish_(e.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):(a=this.sketchCoords_,l=a[a.length-1]),l[0]=t[0],l[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,i),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(t),n.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(t){const e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection();let i,o;const a=this.mode_;return a==="LineString"||a==="Circle"?(this.finishCoordinate_=t.slice(),o=this.sketchCoords_,o.length>=this.maxPoints_&&(this.freehand_?o.pop():i=!0),o.push(t.slice()),this.geometryFunction_(o,e,n)):a==="Polygon"&&(o=this.sketchCoords_[0],o.length>=this.maxPoints_&&(this.freehand_?o.pop():i=!0),o.push(t.slice()),i&&(this.finishCoordinate_=o[0]),this.geometryFunction_(this.sketchCoords_,e,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),i?this.finishDrawing():this.sketchFeature_}removeLastPoints_(t){if(!this.sketchFeature_)return;const e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),i=this.mode_;for(let o=0;o<t;++o){let a;if(i==="LineString"||i==="Circle"){if(a=this.sketchCoords_,a.splice(-2,1),a.length>=2){this.finishCoordinate_=a[a.length-2].slice();const l=this.finishCoordinate_.slice();a[a.length-1]=l,this.createOrUpdateSketchPoint_(l)}this.geometryFunction_(a,e,n),e.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(i==="Polygon"){a=this.sketchCoords_[0],a.splice(-2,1);const l=this.sketchLine_.getGeometry();if(a.length>=2){const u=a[a.length-2].slice();a[a.length-1]=u,this.createOrUpdateSketchPoint_(u)}l.setCoordinates(a),this.geometryFunction_(this.sketchCoords_,e,n)}if(a.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const t=this.abortDrawing_();if(!t)return null;let e=this.sketchCoords_;const n=t.getGeometry(),i=this.getMap().getView().getProjection();return this.mode_==="LineString"?(e.pop(),this.geometryFunction_(e,n,i)):this.mode_==="Polygon"&&(e[0].pop(),this.geometryFunction_(e,n,i),e=n.getCoordinates()),this.type_==="MultiPoint"?t.setGeometry(new Uo([e])):this.type_==="MultiLineString"?t.setGeometry(new ja([e])):this.type_==="MultiPolygon"&&t.setGeometry(new Wa([e])),this.dispatchEvent(new Id(Cd.DRAWEND,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t),t}abortDrawing_(){this.finishCoordinate_=null;const t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),t}abortDrawing(){const t=this.abortDrawing_();t&&this.dispatchEvent(new Id(Cd.DRAWABORT,t))}appendCoordinates(t){const e=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(t[0]);let i;if(e==="LineString"||e==="Circle")i=this.sketchCoords_;else if(e==="Polygon")i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;n&&i.shift(),i.pop();for(let a=0;a<t.length;a++)this.addToDrawing_(t[a]);const o=t[t.length-1];this.sketchFeature_=this.addToDrawing_(o),this.modifyDrawing_(o)}extend(t){const n=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=n.getCoordinates();const i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new Ye(new or(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Id(Cd.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);const e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)}updateState_(){const t=this.getMap(),e=this.getActive();(!t||!e)&&this.abortDrawing(),this.overlay_.setMap(e?t:null)}}function MD(){const r=Lm();return function(t,e){return r[t.getGeometry().getType()]}}function ND(){return function(r,t,e){const n=bn([r[0],r[r.length-1]].map(function(o){return de(o)})),i=[[Nl(n),cc(n),fc(n),wr(n),Nl(n)]];return t?t.setCoordinates(i):t=new ar(i),t}}function OD(r){switch(r){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+r)}}const bd=LD,aw=0,nh=1,lw=[0,0,0,0],gu=[],Dy={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class By extends Er{constructor(t,e,n){super(t),this.features=e,this.mapBrowserEvent=n}}class FD extends Jo{constructor(t){super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:o1,this.defaultDeleteCondition_=function(n){return h2(n)&&i1(n)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:Kc,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new bf,this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new Ur({source:new Un({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:BD(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let e;if(t.features?e=t.features:t.source&&(this.source_=t.source,e=new Gr(this.source_.getFeatures()),this.source_.addEventListener(Ke.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Ke.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!e)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(Be.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(Be.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=t.snapToPointer===void 0?!this.hitDetection_:t.snapToPointer}addFeature_(t){const e=t.getGeometry();if(e){const i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}const n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(ot.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Gr;const n=this.featuresBeingModified_.getArray();for(let i=0,o=e.length;i<o;++i){const a=e[i];for(let l=0,u=a.length;l<u;++l){const c=a[l].feature;c&&!n.includes(c)&&this.featuresBeingModified_.push(c)}}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new By(Dy.MODIFYSTART,this.featuresBeingModified_,t))}}removeFeature_(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(ot.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(t){const e=this.rBush_,n=[];e.forEach(function(i){t===i.feature&&n.push(i)});for(let i=n.length-1;i>=0;--i){const o=n[i];for(let a=this.dragSegments_.length-1;a>=0;--a)this.dragSegments_[a][0]===o&&this.dragSegments_.splice(a,1);e.remove(o)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){const e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){const n=e.getCoordinates(),i={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),i)}writeMultiPointGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i],l={feature:t,geometry:e,depth:[i],index:i,segment:[a,a]};this.rBush_.insert(e.getExtent(),l)}}writeLineStringGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length-1;i<o;++i){const a=n.slice(i,i+2),l={feature:t,geometry:e,index:i,segment:a};this.rBush_.insert(bn(a),l)}}writeMultiLineStringGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length-1;l<u;++l){const c=a.slice(l,l+2),h={feature:t,geometry:e,depth:[i],index:l,segment:c};this.rBush_.insert(bn(c),h)}}}writePolygonGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length-1;l<u;++l){const c=a.slice(l,l+2),h={feature:t,geometry:e,depth:[i],index:l,segment:c};this.rBush_.insert(bn(c),h)}}}writeMultiPolygonGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length;l<u;++l){const c=a[l];for(let h=0,f=c.length-1;h<f;++h){const d=c.slice(h,h+2),g={feature:t,geometry:e,depth:[l,i],index:h,segment:d};this.rBush_.insert(bn(d),g)}}}}writeCircleGeometry_(t,e){const n=e.getCenter(),i={feature:t,geometry:e,index:aw,segment:[n,n]},o={feature:t,geometry:e,index:nh,segment:[n,n]},a=[i,o];i.featureSegments=a,o.featureSegments=a,this.rBush_.insert(Ml(n),i);let l=e;this.rBush_.insert(l.getExtent(),o)}writeGeometryCollectionGeometry_(t,e){const n=e.getGeometriesArray();for(let i=0;i<n.length;++i){const o=n[i],a=this.SEGMENT_WRITERS_[o.getType()];a(t,o)}}createOrUpdateVertexFeature_(t,e,n){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(t):(i=new Ye(new or(t)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set("features",e),i.set("geometries",n),i}handleEvent(t){if(!t.originalEvent)return!0;this.lastPointerEvent_=t;let e;return!t.map.getView().getInteracting()&&t.type==Bt.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(t.type!=Bt.SINGLECLICK||!this.ignoreNextSingleClick_?e=this.removePoint():e=!0),t.type==Bt.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(t)&&!e}handleDragEvent(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);const e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],i=[];for(let o=0,a=this.dragSegments_.length;o<a;++o){const l=this.dragSegments_[o],u=l[0],c=u.feature;n.includes(c)||n.push(c);const h=u.geometry;i.includes(h)||i.push(h);const f=u.depth;let d;const g=u.segment,p=l[1];for(;e.length<h.getStride();)e.push(g[p][e.length]);switch(h.getType()){case"Point":d=e,g[0]=e,g[1]=e;break;case"MultiPoint":d=h.getCoordinates(),d[u.index]=e,g[0]=e,g[1]=e;break;case"LineString":d=h.getCoordinates(),d[u.index+p]=e,g[p]=e;break;case"MultiLineString":d=h.getCoordinates(),d[f[0]][u.index+p]=e,g[p]=e;break;case"Polygon":d=h.getCoordinates(),d[f[0]][u.index+p]=e,g[p]=e;break;case"MultiPolygon":d=h.getCoordinates(),d[f[1]][f[0]][u.index+p]=e,g[p]=e;break;case"Circle":if(g[0]=e,g[1]=e,u.index===aw)this.changingFeature_=!0,h.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0,t.map.getView().getProjection();let m=af(de(h.getCenter()),de(e));h.setRadius(m),this.changingFeature_=!1}break}d&&this.setGeometryCoordinates_(h,d)}this.createOrUpdateVertexFeature_(e,n,i)}handleDownEvent(t){if(!this.condition_(t))return!1;const e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;const n=this.vertexFeature_;if(n){t.map.getView().getProjection();const i=[],o=n.getGeometry().getCoordinates(),a=bn([o]),l=this.rBush_.getInExtent(a),u={};l.sort(DD);for(let c=0,h=l.length;c<h;++c){const f=l[c],d=f.segment;let g=Z(f.geometry);const p=f.depth;if(p&&(g+="-"+p.join("-")),u[g]||(u[g]=new Array(2)),f.geometry.getType()==="Circle"&&f.index===nh){const m=cw(e,f);ki(m,o)&&!u[g][0]&&(this.dragSegments_.push([f,0]),u[g][0]=f);continue}if(ki(d[0],o)&&!u[g][0]){this.dragSegments_.push([f,0]),u[g][0]=f;continue}if(ki(d[1],o)&&!u[g][1]){if(u[g][0]&&u[g][0].index===0){let m=f.geometry.getCoordinates();switch(f.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":m=m[p[1]];case"Polygon":if(f.index!==m[p[0]].length-2)continue;break}}this.dragSegments_.push([f,1]),u[g][1]=f;continue}Z(d)in this.vertexSegments_&&!u[g][0]&&!u[g][1]&&this.insertVertexCondition_(t)&&i.push(f)}i.length&&this.willModifyFeatures_(t,[i]);for(let c=i.length-1;c>=0;--c)this.insertVertex_(i[c],o)}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){const n=this.dragSegments_[e][0],i=n.geometry;if(i.getType()==="Circle"){const o=i.getCenter(),a=n.featureSegments[0],l=n.featureSegments[1];a.segment[0]=o,a.segment[1]=o,l.segment[0]=o,l.segment[1]=o,this.rBush_.update(Ml(o),a);let u=i;this.rBush_.update(u.getExtent(),l)}else this.rBush_.update(bn(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new By(Dy.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)}handlePointerAtPixel_(t,e,n){const i=n||e.getCoordinateFromPixel(t);e.getView().getProjection();const o=function(u,c){return uw(i,u)-uw(i,c)};let a,l;if(this.hitDetection_){const u=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;e.forEachFeatureAtPixel(t,(c,h,f)=>{f&&f.getType()==="Point"&&(f=new or(Ga(f.getCoordinates())));const d=f||c.getGeometry();if(c instanceof Ye&&this.features_.getArray().includes(c)){l=d;const g=c.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:c,geometry:l,segment:[g,g]}]}return!0},{layerFilter:u})}if(!a){const u=ps(Ml(i,lw)),c=e.getView().getResolution()*this.pixelTolerance_,h=gc(xr(u,c,lw));a=this.rBush_.getInExtent(h)}if(a&&a.length>0){const u=a.sort(o)[0],c=u.segment;let h=cw(i,u);const f=e.getPixelFromCoordinate(h);let d=af(t,f);if(l||d<=this.pixelTolerance_){const g={};if(g[Z(c)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-i[0],this.delta_[1]=h[1]-i[1]),u.geometry.getType()==="Circle"&&u.index===nh)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[u.feature],[u.geometry]);else{const p=e.getPixelFromCoordinate(c[0]),m=e.getPixelFromCoordinate(c[1]),y=Js(f,p),E=Js(f,m);d=Math.sqrt(Math.min(y,E)),this.snappedToVertex_=d<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>E?c[1]:c[0]),this.createOrUpdateVertexFeature_(h,[u.feature],[u.geometry]);const _={};_[Z(u.geometry)]=!0;for(let v=1,x=a.length;v<x;++v){const w=a[v].segment;if(ki(c[0],w[0])&&ki(c[1],w[1])||ki(c[0],w[1])&&ki(c[1],w[0])){const I=Z(a[v].geometry);I in _||(_[I]=!0,g[Z(w)]=!0)}else break}}this.vertexSegments_=g;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(t,e){const n=t.segment,i=t.feature,o=t.geometry,a=t.depth,l=t.index;let u;for(;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":u=o.getCoordinates(),u[a[0]].splice(l+1,0,e);break;case"Polygon":u=o.getCoordinates(),u[a[0]].splice(l+1,0,e);break;case"MultiPolygon":u=o.getCoordinates(),u[a[1]][a[0]].splice(l+1,0,e);break;case"LineString":u=o.getCoordinates(),u.splice(l+1,0,e);break;default:return}this.setGeometryCoordinates_(o,u);const c=this.rBush_;c.remove(t),this.updateSegmentIndices_(o,l,a,1);const h={segment:[n[0],e],feature:i,geometry:o,depth:a,index:l};c.insert(bn(h.segment),h),this.dragSegments_.push([h,1]);const f={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:l+1};c.insert(bn(f.segment),f),this.dragSegments_.push([f,0]),this.ignoreNextSingleClick_=!0}removePoint(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Bt.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);const e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new By(Dy.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1}removeVertex_(){const t=this.dragSegments_,e={};let n=!1,i,o,a,l,u,c,h,f,d,g,p;for(u=t.length-1;u>=0;--u)a=t[u],g=a[0],p=Z(g.feature),g.depth&&(p+="-"+g.depth.join("-")),p in e||(e[p]={}),a[1]===0?(e[p].right=g,e[p].index=g.index):a[1]==1&&(e[p].left=g,e[p].index=g.index+1);for(p in e){switch(d=e[p].right,h=e[p].left,c=e[p].index,f=c-1,h!==void 0?g=h:g=d,f<0&&(f=0),l=g.geometry,o=l.getCoordinates(),i=o,n=!1,l.getType()){case"MultiLineString":o[g.depth[0]].length>2&&(o[g.depth[0]].splice(c,1),n=!0);break;case"LineString":o.length>2&&(o.splice(c,1),n=!0);break;case"MultiPolygon":i=i[g.depth[1]];case"Polygon":i=i[g.depth[0]],i.length>4&&(c==i.length-1&&(c=0),i.splice(c,1),n=!0,c===0&&(i.pop(),i.push(i[0]),f=i.length-1));break}if(n){this.setGeometryCoordinates_(l,o);const m=[];if(h!==void 0&&(this.rBush_.remove(h),m.push(h.segment[0])),d!==void 0&&(this.rBush_.remove(d),m.push(d.segment[1])),h!==void 0&&d!==void 0){const y={depth:g.depth,feature:g.feature,geometry:g.geometry,index:f,segment:m};this.rBush_.insert(bn(y.segment),y)}this.updateSegmentIndices_(l,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return n}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,n,i){this.rBush_.forEachInExtent(t.getExtent(),function(o){o.geometry===t&&(n===void 0||o.depth===void 0||fs(o.depth,n))&&o.index>e&&(o.index+=i)})}}function DD(r,t){return r.index-t.index}function uw(r,t,e){const n=t.geometry;if(n.getType()==="Circle"){let o=n;if(t.index===nh){const a=Js(o.getCenter(),de(r)),l=Math.sqrt(a)-o.getRadius();return l*l}}const i=de(r);return gu[0]=de(t.segment[0]),gu[1]=de(t.segment[1]),TP(i,gu)}function cw(r,t,e){const n=t.geometry;if(n.getType()==="Circle"&&t.index===nh)return Ga(n.getClosestPoint(de(r)));const i=de(r);return gu[0]=de(t.segment[0]),gu[1]=de(t.segment[1]),Ga(dp(i,gu))}function BD(){const r=Lm();return function(t,e){return r.Point}}const Gy=FD,GD={SELECT:"select"};class kD extends Er{constructor(t,e,n,i){super(t),this.selected=e,this.deselected=n,this.mapBrowserEvent=i}}const Ad={};class ky extends iu{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=t.condition?t.condition:i1,this.addCondition_=t.addCondition?t.addCondition:oy,this.removeCondition_=t.removeCondition?t.removeCondition:oy,this.toggleCondition_=t.toggleCondition?t.toggleCondition:ly,this.multi_=t.multi?t.multi:!1,this.filter_=t.filter?t.filter:qs,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=t.style!==void 0?t.style:zD(),this.features_=t.features||new Gr;let e;if(t.layers)if(typeof t.layers=="function")e=t.layers;else{const n=t.layers;e=function(i){return n.includes(i)}}else e=qs;this.layerFilter_=e,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,e){this.featureLayerAssociation_[Z(t)]=e}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[Z(t)]}setHitTolerance(t){this.hitTolerance_=t}setMap(t){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(t),t?(this.features_.addEventListener(Be.ADD,this.boundAddFeature_),this.features_.addEventListener(Be.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(Be.ADD,this.boundAddFeature_),this.features_.removeEventListener(Be.REMOVE,this.boundRemoveFeature_))}addFeature_(t){const e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){const n=this.getMap().getAllLayers().find(function(i){if(i instanceof Ur&&i.getSource()&&i.getSource().hasFeature(e))return i});n&&this.addFeatureLayerAssociation_(e,n)}}removeFeature_(t){this.style_&&this.restorePreviousStyle_(t.element)}getStyle(){return this.style_}applySelectedStyle_(t){const e=Z(t);e in Ad||(Ad[e]=t.getStyle()),t.setStyle(this.style_)}restorePreviousStyle_(t){const e=this.getMap().getInteractions().getArray();for(let i=e.length-1;i>=0;--i){const o=e[i];if(o!==this&&o instanceof ky&&o.getStyle()&&o.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(o.getStyle());return}}const n=Z(t);t.setStyle(Ad[n]),delete Ad[n]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[Z(t)]}handleEvent(t){if(!this.condition_(t))return!0;const e=this.addCondition_(t),n=this.removeCondition_(t),i=this.toggleCondition_(t),o=!e&&!n&&!i,a=t.map,l=this.getFeatures(),u=[],c=[];if(o){La(this.featureLayerAssociation_),a.forEachFeatureAtPixel(t.pixel,(h,f)=>{if(!(!(h instanceof Ye)||!this.filter_(h,f)))return this.addFeatureLayerAssociation_(h,f),c.push(h),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let h=l.getLength()-1;h>=0;--h){const f=l.item(h),d=c.indexOf(f);d>-1?c.splice(d,1):(l.remove(f),u.push(f))}c.length!==0&&l.extend(c)}else{a.forEachFeatureAtPixel(t.pixel,(h,f)=>{if(!(!(h instanceof Ye)||!this.filter_(h,f)))return(e||i)&&!l.getArray().includes(h)?(this.addFeatureLayerAssociation_(h,f),c.push(h)):(n||i)&&l.getArray().includes(h)&&(u.push(h),this.removeFeatureLayerAssociation_(h)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let h=u.length-1;h>=0;--h)l.remove(u[h]);l.extend(c)}return(c.length>0||u.length>0)&&this.dispatchEvent(new kD(GD.SELECT,c,u,t)),!0}}function zD(){const r=Lm();return Pn(r.Polygon,r.LineString),Pn(r.GeometryCollection,r.LineString),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}}const hw=ky,UD={SNAP:"snap"};class VD extends Er{constructor(t,e){super(t),this.vertex=e.vertex,this.vertexPixel=e.vertexPixel,this.feature=e.feature,this.segment=e.segment}}function fw(r){return r.feature?r.feature:r.element?r.element:null}const zy=[];class jD extends Jo{constructor(t){t=t||{};const e=t;e.handleDownEvent||(e.handleDownEvent=qs),e.stopDown||(e.stopDown=Aa),super(e),this.on,this.once,this.un,this.source_=t.source?t.source:null,this.vertex_=t.vertex!==void 0?t.vertex:!0,this.edge_=t.edge!==void 0?t.edge:!0,this.features_=t.features?t.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.rBush_=new bf,this.GEOMETRY_SEGMENTERS_={Point:this.segmentPointGeometry_.bind(this),LineString:this.segmentLineStringGeometry_.bind(this),LinearRing:this.segmentLineStringGeometry_.bind(this),Polygon:this.segmentPolygonGeometry_.bind(this),MultiPoint:this.segmentMultiPointGeometry_.bind(this),MultiLineString:this.segmentMultiLineStringGeometry_.bind(this),MultiPolygon:this.segmentMultiPolygonGeometry_.bind(this),GeometryCollection:this.segmentGeometryCollectionGeometry_.bind(this),Circle:this.segmentCircleGeometry_.bind(this)}}addFeature(t,e){e=e!==void 0?e:!0;const n=Z(t),i=t.getGeometry();if(i){const o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[n]=i.getExtent(An());const a=[];if(o(a,i),a.length===1)this.rBush_.insert(bn(a[0]),{feature:t,segment:a[0]});else if(a.length>1){const l=a.map(c=>bn(c)),u=a.map(c=>({feature:t,segment:c}));this.rBush_.load(l,u)}}}e&&(this.featureChangeListenerKeys_[n]=yt(t,ot.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t}handleEvent(t){const e=this.snapTo(t.pixel,t.coordinate,t.map);return e&&(t.coordinate=e.vertex.slice(0,2),t.pixel=e.vertexPixel,this.dispatchEvent(new VD(UD.SNAP,{vertex:t.coordinate,vertexPixel:t.pixel,feature:e.feature,segment:e.segment}))),super.handleEvent(t)}handleFeatureAdd_(t){const e=fw(t);e&&this.addFeature(e)}handleFeatureRemove_(t){const e=fw(t);e&&this.removeFeature(e)}handleFeatureChange_(t){const e=t.target;if(this.handlingDownUpSequence){const n=Z(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)}handleUpEvent(t){const e=Object.values(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1}removeFeature(t,e){const n=e!==void 0?e:!0,i=Z(t),o=this.indexedFeaturesExtents_[i];if(o){const a=this.rBush_,l=[];a.forEachInExtent(o,function(u){t===u.feature&&l.push(u)});for(let u=l.length-1;u>=0;--u)a.remove(l[u])}n&&(Ht(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])}setMap(t){const e=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();e&&(n.forEach(Ht),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(Ht),this.featureChangeListenerKeys_={}),super.setMap(t),t&&(this.features_?n.push(yt(this.features_,Be.ADD,this.handleFeatureAdd_,this),yt(this.features_,Be.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(yt(this.source_,Ke.ADDFEATURE,this.handleFeatureAdd_,this),yt(this.source_,Ke.REMOVEFEATURE,this.handleFeatureRemove_,this)),i.forEach(o=>this.addFeature(o)))}snapTo(t,e,n){n.getView().getProjection();const i=de(e),o=gc(xr(bn([i]),n.getView().getResolution()*this.pixelTolerance_)),a=this.rBush_.getInExtent(o),l=a.length;if(l===0)return null;let u,c=1/0,h,f=null;const d=this.pixelTolerance_*this.pixelTolerance_,g=()=>{if(u){const p=n.getPixelFromCoordinate(u);if(Js(t,p)<=d)return{vertex:u,vertexPixel:[Math.round(p[0]),Math.round(p[1])],feature:h,segment:f}}return null};if(this.vertex_){for(let m=0;m<l;++m){const y=a[m];y.feature.getGeometry().getType()!=="Circle"&&y.segment.forEach(E=>{const _=de(E),v=Js(i,_);v<c&&(u=E,c=v,h=y.feature)})}const p=g();if(p)return p}if(this.edge_){for(let m=0;m<l;++m){let y=null;const E=a[m];if(E.feature.getGeometry().getType()==="Circle"){let _=E.feature.getGeometry();y=IP(i,_)}else{const[_,v]=E.segment;v&&(zy[0]=de(_),zy[1]=de(v),y=dp(i,zy))}if(y){const _=Js(i,y);_<c&&(u=Ga(y),f=E.feature.getGeometry().getType()==="Circle"?null:E.segment,c=_,h=E.feature)}}const p=g();if(p)return p}return null}updateFeature_(t){this.removeFeature(t,!1),this.addFeature(t,!1)}segmentCircleGeometry_(t,e){this.getMap().getView().getProjection();const o=lb(e).getCoordinates()[0];for(let a=0,l=o.length-1;a<l;++a)t.push(o.slice(a,a+2))}segmentGeometryCollectionGeometry_(t,e){const n=e.getGeometriesArray();for(let i=0;i<n.length;++i){const o=this.GEOMETRY_SEGMENTERS_[n[i].getType()];o&&o(t,n[i])}}segmentLineStringGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length-1;i<o;++i)t.push(n.slice(i,i+2))}segmentMultiLineStringGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length-1;l<u;++l)t.push(a.slice(l,l+2))}}segmentMultiPointGeometry_(t,e){e.getCoordinates().forEach(n=>{t.push([n])})}segmentMultiPolygonGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length;l<u;++l){const c=a[l];for(let h=0,f=c.length-1;h<f;++h)t.push(c.slice(h,h+2))}}}segmentPointGeometry_(t,e){t.push([e.getCoordinates()])}segmentPolygonGeometry_(t,e){const n=e.getCoordinates();for(let i=0,o=n.length;i<o;++i){const a=n[i];for(let l=0,u=a.length-1;l<u;++l)t.push(a.slice(l,l+2))}}}const Ld=jD;class Uy{constructor(t={showTip:!1,maxLength:1e5}){zt(this,"listener",null);zt(this,"conditions",{});zt(this,"projection",eh().prj);zt(this,"geometryChangeEvent",null);zt(this,"measureTooltip",null);zt(this,"map",null);this.conditions=t}initialize(t){this.drawListener(t)}registerEvent(t,e){t==="on-change"&&(this.geometryChangeEvent=e)}drawListener({map:t,draw:e}){this.map=t;const n=this,{projection:i}=this,{showTip:o,maxLength:a}=this.conditions;let l;o&&u();function u(){l&&l.parentNode.removeChild(l),l=document.createElement("div"),l.className="ol-tooltip ol-tooltip-measure",n.measureTooltip=new hd({element:l,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),t.addOverlay(n.measureTooltip)}const c=function(f){const d=lf(f,{projection:i});let g;return d>100?g=Math.round(d/1e3*100)/100+" km":g=Math.round(d*100)/100+" m",g},h=function(f,d){return f&&d?dc(f,d):0};e.on("drawstart",f=>{const d=f.feature;let g=[];d.getGeometry().getType()==="LineString"&&(g=f.coordinate||d.getGeometry().getCoordinateAt(1));let p=[],m=!1;this.listener=d.getGeometry().on("change",function(y){const E=y.target;let _,v=0;if(E.getType()==="")_=formatArea(E),g=E.getInteriorPoint().getCoordinates();else if(E.getType()==="LineString"){_=c(E),g=E.getLastCoordinate();const x=E.getCoordinates(),w=x[x.length-2];v=parseInt(h(w,g)),v===0&&m?(m=!1,e.removeLastPoint()):v>0&&v<=a?(p=[...g],m=!1,n.geometryChangeEvent&&n.geometryChangeEvent(d,E)):v>a&&(x.pop(),x.push(p),E.setCoordinates(x),m=!0)}o&&(l.innerHTML=_,n.measureTooltip.setPosition(g))})})}destroy(){np(this.listener),this.map.removeOverlay(this.measureTooltip)}}class dw extends ws{constructor(){super();zt(this,"defaultStyle",new ye({fill:new Dt({color:"rgba(255, 208, 75, 0.5)"}),stroke:new Je({color:"#ffcc33",width:2}),image:new lr({radius:7,fill:new Dt({color:"#ffcc33"})})}))}feature2wkt(e){return e.getGeometry().getType()==="Circle"?"":new ws().writeFeature(e)}layer2wkt(e){if(e){const n=e.getSource().getFeatures();return n.length===1?new ws().writeFeature(n[0]):n.length>1?new ws().writeFeatures(n):"layer is null"}else return"layer is null"}wkt2layer(e,{id:n=oi(),style:i=this.defaultStyle}={id:oi(),style:this.defaultStyle}){let o=new ws().readFeature(e);o.setStyle(i);let a=new Un({features:[o]});return new Ur({id:n,source:a,visible:!0})}geojson2wkt(e){const n=new Qo().readFeatures(e);return new ws().writeFeatures(n)}wkt2geojson(e){const n=new ws().readFeatures(i),i=new Qo().writeFeatures(n);return i}}var Mn=63710088e-1,Vy={centimeters:Mn*100,centimetres:Mn*100,degrees:Mn/111325,feet:Mn*3.28084,inches:Mn*39.37,kilometers:Mn/1e3,kilometres:Mn/1e3,meters:Mn,metres:Mn,miles:Mn/1609.344,millimeters:Mn*1e3,millimetres:Mn*1e3,nauticalmiles:Mn/1852,radians:1,yards:Mn*1.0936},WD={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Mn,yards:1.0936133},jy={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function jr(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function YD(r,t,e){switch(r){case"Point":return ur(t).geometry;case"LineString":return li(t).geometry;case"Polygon":return Hn(t).geometry;case"MultiPoint":return gw(t).geometry;case"MultiLineString":return Wy(t).geometry;case"MultiPolygon":return Yy(t).geometry;default:throw new Error(r+" is invalid")}}function ur(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Nd(r[0])||!Nd(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return jr(n,t,e)}function XD(r,t,e){return e===void 0&&(e={}),Pe(r.map(function(n){return ur(n,t)}),e)}function Hn(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:r};return jr(l,t,e)}function HD(r,t,e){return e===void 0&&(e={}),Pe(r.map(function(n){return Hn(n,t)}),e)}function li(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return jr(n,t,e)}function qD(r,t,e){return e===void 0&&(e={}),Pe(r.map(function(n){return li(n,t)}),e)}function Pe(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Wy(r,t,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:r};return jr(n,t,e)}function gw(r,t,e){e===void 0&&(e={});var n={type:"MultiPoint",coordinates:r};return jr(n,t,e)}function Yy(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return jr(n,t,e)}function ZD(r,t,e){e===void 0&&(e={});var n={type:"GeometryCollection",geometries:r};return jr(n,t,e)}function KD(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}function Md(r,t){t===void 0&&(t="kilometers");var e=Vy[t];if(!e)throw new Error(t+" units is invalid");return r*e}function rh(r,t){t===void 0&&(t="kilometers");var e=Vy[t];if(!e)throw new Error(t+" units is invalid");return r/e}function JD(r,t){return ih(rh(r,t))}function QD(r){var t=r%360;return t<0&&(t+=360),t}function ih(r){var t=r%(2*Math.PI);return t*180/Math.PI}function ui(r){var t=r%360;return t*Math.PI/180}function $D(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Md(rh(r,t),e)}function tB(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var n=jy[t];if(!n)throw new Error("invalid original units");var i=jy[e];if(!i)throw new Error("invalid final units");return r/n*i}function Nd(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function eB(r){return!!r&&r.constructor===Object}function nB(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!Nd(t))throw new Error("bbox must only contain numbers")})}function rB(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}const iB=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:jy,bearingToAzimuth:QD,convertArea:tB,convertLength:$D,degreesToRadians:ui,earthRadius:Mn,factors:Vy,feature:jr,featureCollection:Pe,geometry:YD,geometryCollection:ZD,isNumber:Nd,isObject:eB,lengthToDegrees:JD,lengthToRadians:rh,lineString:li,lineStrings:qD,multiLineString:Wy,multiPoint:gw,multiPolygon:Yy,point:ur,points:XD,polygon:Hn,polygons:HD,radiansToDegrees:ih,radiansToLength:Md,round:KD,unitsFactors:WD,validateBBox:nB,validateId:rB},Symbol.toStringTag,{value:"Module"}));function Od(r,t,e){if(r!==null)for(var n,i,o,a,l,u,c,h=0,f=0,d,g=r.type,p=g==="FeatureCollection",m=g==="Feature",y=p?r.features.length:1,E=0;E<y;E++){c=p?r.features[E].geometry:m?r.geometry:r,d=c?c.type==="GeometryCollection":!1,l=d?c.geometries.length:1;for(var _=0;_<l;_++){var v=0,x=0;if(a=d?c.geometries[_]:c,a!==null){u=a.coordinates;var w=a.type;switch(h=e&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(t(u,f,E,v,x)===!1)return!1;f++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,E,v,x)===!1)return!1;f++,w==="MultiPoint"&&v++}w==="LineString"&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(t(u[n][i],f,E,v,x)===!1)return!1;f++}w==="MultiLineString"&&v++,w==="Polygon"&&x++}w==="Polygon"&&v++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(x=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-h;o++){if(t(u[n][i][o],f,E,v,x)===!1)return!1;f++}x++}v++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Od(a.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ss(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function sB(r,t,e){var n=e;return Ss(r,function(i,o){o===0&&e===void 0?n=i:n=t(n,i,o)}),n}function Xy(r,t){var e,n,i,o,a,l,u,c,h,f,d=0,g=r.type==="FeatureCollection",p=r.type==="Feature",m=g?r.features.length:1;for(e=0;e<m;e++){for(l=g?r.features[e].geometry:p?r.geometry:r,c=g?r.features[e].properties:p?r.properties:{},h=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=l?l.type==="GeometryCollection":!1,a=u?l.geometries.length:1,i=0;i<a;i++){if(o=u?l.geometries[i]:l,o===null){if(t(null,d,c,h,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,d,c,h,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],d,c,h,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function $a(r,t){Xy(r,function(e,n,i,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(jr(e,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var c=0;c<e.coordinates.length;c++){var h=e.coordinates[c],f={type:u,coordinates:h};if(t(jr(f,i),n,c)===!1)return!1}})}function Cs(r){var t=[1/0,1/0,-1/0,-1/0];return Od(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Cs.default=Cs;function Is(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Wi(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function oB(r,t,e){if(!r)throw new Error("No featureCollection passed");if(!e)throw new Error(".collectionOf() requires a name");if(!r||r.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,i=r.features;n<i.length;n++){var o=i[n];if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!o.geometry||o.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+o.geometry.type)}}function ta(r){return r.type==="Feature"?r.geometry:r}function Hy(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}var pw={exports:{}};(function(r,t){(function(e,n){r.exports=n()})(Pc,function(){function e(_,v,x,w,I){(function C(T,R,M,P,b){for(;P>M;){if(P-M>600){var A=P-M+1,L=R-M+1,B=Math.log(A),F=.5*Math.exp(2*B/3),V=.5*Math.sqrt(B*F*(A-F)/A)*(L-A/2<0?-1:1),Y=Math.max(M,Math.floor(R-L*F/A+V)),st=Math.min(P,Math.floor(R+(A-L)*F/A+V));C(T,R,Y,st,b)}var Q=T[R],et=M,H=P;for(n(T,M,R),b(T[P],Q)>0&&n(T,M,P);et<H;){for(n(T,et,H),et++,H--;b(T[et],Q)<0;)et++;for(;b(T[H],Q)>0;)H--}b(T[M],Q)===0?n(T,M,H):n(T,++H,P),H<=R&&(M=H+1),R<=H&&(P=H-1)}})(_,v,x||0,w||_.length-1,I||i)}function n(_,v,x){var w=_[v];_[v]=_[x],_[x]=w}function i(_,v){return _<v?-1:_>v?1:0}var o=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(_,v,x){if(!x)return v.indexOf(_);for(var w=0;w<v.length;w++)if(x(_,v[w]))return w;return-1}function l(_,v){u(_,0,_.children.length,v,_)}function u(_,v,x,w,I){I||(I=y(null)),I.minX=1/0,I.minY=1/0,I.maxX=-1/0,I.maxY=-1/0;for(var C=v;C<x;C++){var T=_.children[C];c(I,_.leaf?w(T):T)}return I}function c(_,v){return _.minX=Math.min(_.minX,v.minX),_.minY=Math.min(_.minY,v.minY),_.maxX=Math.max(_.maxX,v.maxX),_.maxY=Math.max(_.maxY,v.maxY),_}function h(_,v){return _.minX-v.minX}function f(_,v){return _.minY-v.minY}function d(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function g(_){return _.maxX-_.minX+(_.maxY-_.minY)}function p(_,v){return _.minX<=v.minX&&_.minY<=v.minY&&v.maxX<=_.maxX&&v.maxY<=_.maxY}function m(_,v){return v.minX<=_.maxX&&v.minY<=_.maxY&&v.maxX>=_.minX&&v.maxY>=_.minY}function y(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function E(_,v,x,w,I){for(var C=[v,x];C.length;)if(!((x=C.pop())-(v=C.pop())<=w)){var T=v+Math.ceil((x-v)/w/2)*w;e(_,T,v,x,I),C.push(v,T,T,x)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(_){var v=this.data,x=[];if(!m(_,v))return x;for(var w=this.toBBox,I=[];v;){for(var C=0;C<v.children.length;C++){var T=v.children[C],R=v.leaf?w(T):T;m(_,R)&&(v.leaf?x.push(T):p(_,R)?this._all(T,x):I.push(T))}v=I.pop()}return x},o.prototype.collides=function(_){var v=this.data;if(!m(_,v))return!1;for(var x=[];v;){for(var w=0;w<v.children.length;w++){var I=v.children[w],C=v.leaf?this.toBBox(I):I;if(m(_,C)){if(v.leaf||p(_,C))return!0;x.push(I)}}v=x.pop()}return!1},o.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var v=0;v<_.length;v++)this.insert(_[v]);return this}var x=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var w=this.data;this.data=x,x=w}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},o.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},o.prototype.clear=function(){return this.data=y([]),this},o.prototype.remove=function(_,v){if(!_)return this;for(var x,w,I,C=this.data,T=this.toBBox(_),R=[],M=[];C||R.length;){if(C||(C=R.pop(),w=R[R.length-1],x=M.pop(),I=!0),C.leaf){var P=a(_,C.children,v);if(P!==-1)return C.children.splice(P,1),R.push(C),this._condense(R),this}I||C.leaf||!p(C,T)?w?(x++,C=w.children[x],I=!1):C=null:(R.push(C),M.push(x),x=0,w=C,C=C.children[0])}return this},o.prototype.toBBox=function(_){return _},o.prototype.compareMinX=function(_,v){return _.minX-v.minX},o.prototype.compareMinY=function(_,v){return _.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(_){return this.data=_,this},o.prototype._all=function(_,v){for(var x=[];_;)_.leaf?v.push.apply(v,_.children):x.push.apply(x,_.children),_=x.pop();return v},o.prototype._build=function(_,v,x,w){var I,C=x-v+1,T=this._maxEntries;if(C<=T)return l(I=y(_.slice(v,x+1)),this.toBBox),I;w||(w=Math.ceil(Math.log(C)/Math.log(T)),T=Math.ceil(C/Math.pow(T,w-1))),(I=y([])).leaf=!1,I.height=w;var R=Math.ceil(C/T),M=R*Math.ceil(Math.sqrt(T));E(_,v,x,M,this.compareMinX);for(var P=v;P<=x;P+=M){var b=Math.min(P+M-1,x);E(_,P,b,R,this.compareMinY);for(var A=P;A<=b;A+=R){var L=Math.min(A+R-1,b);I.children.push(this._build(_,A,L,w-1))}}return l(I,this.toBBox),I},o.prototype._chooseSubtree=function(_,v,x,w){for(;w.push(v),!v.leaf&&w.length-1!==x;){for(var I=1/0,C=1/0,T=void 0,R=0;R<v.children.length;R++){var M=v.children[R],P=d(M),b=(A=_,L=M,(Math.max(L.maxX,A.maxX)-Math.min(L.minX,A.minX))*(Math.max(L.maxY,A.maxY)-Math.min(L.minY,A.minY))-P);b<C?(C=b,I=P<I?P:I,T=M):b===C&&P<I&&(I=P,T=M)}v=T||v.children[0]}var A,L;return v},o.prototype._insert=function(_,v,x){var w=x?_:this.toBBox(_),I=[],C=this._chooseSubtree(w,this.data,v,I);for(C.children.push(_),c(C,w);v>=0&&I[v].children.length>this._maxEntries;)this._split(I,v),v--;this._adjustParentBBoxes(w,I,v)},o.prototype._split=function(_,v){var x=_[v],w=x.children.length,I=this._minEntries;this._chooseSplitAxis(x,I,w);var C=this._chooseSplitIndex(x,I,w),T=y(x.children.splice(C,x.children.length-C));T.height=x.height,T.leaf=x.leaf,l(x,this.toBBox),l(T,this.toBBox),v?_[v-1].children.push(T):this._splitRoot(x,T)},o.prototype._splitRoot=function(_,v){this.data=y([_,v]),this.data.height=_.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(_,v,x){for(var w,I,C,T,R,M,P,b=1/0,A=1/0,L=v;L<=x-v;L++){var B=u(_,0,L,this.toBBox),F=u(_,L,x,this.toBBox),V=(I=B,C=F,T=void 0,R=void 0,M=void 0,P=void 0,T=Math.max(I.minX,C.minX),R=Math.max(I.minY,C.minY),M=Math.min(I.maxX,C.maxX),P=Math.min(I.maxY,C.maxY),Math.max(0,M-T)*Math.max(0,P-R)),Y=d(B)+d(F);V<b?(b=V,w=L,A=Y<A?Y:A):V===b&&Y<A&&(A=Y,w=L)}return w||x-v},o.prototype._chooseSplitAxis=function(_,v,x){var w=_.leaf?this.compareMinX:h,I=_.leaf?this.compareMinY:f;this._allDistMargin(_,v,x,w)<this._allDistMargin(_,v,x,I)&&_.children.sort(w)},o.prototype._allDistMargin=function(_,v,x,w){_.children.sort(w);for(var I=this.toBBox,C=u(_,0,v,I),T=u(_,x-v,x,I),R=g(C)+g(T),M=v;M<x-v;M++){var P=_.children[M];c(C,_.leaf?I(P):P),R+=g(C)}for(var b=x-v-1;b>=v;b--){var A=_.children[b];c(T,_.leaf?I(A):A),R+=g(T)}return R},o.prototype._adjustParentBBoxes=function(_,v,x){for(var w=x;w>=0;w--)c(v[w],_)},o.prototype._condense=function(_){for(var v=_.length-1,x=void 0;v>=0;v--)_[v].children.length===0?v>0?(x=_[v-1].children).splice(x.indexOf(_[v]),1):this.clear():l(_[v],this.toBBox)},o})})(pw);var aB=pw.exports;function ci(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=Is(r),i=ta(t),o=i.type,a=t.bbox,l=i.coordinates;if(a&&lB(n,a)===!1)return!1;o==="Polygon"&&(l=[l]);for(var u=!1,c=0;c<l.length&&!u;c++)if(mw(n,l[c][0],e.ignoreBoundary)){for(var h=!1,f=1;f<l[c].length&&!h;)mw(n,l[c][f],!e.ignoreBoundary)&&(h=!0),f++;h||(u=!0)}return u}function mw(r,t,e){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,o=t.length-1;i<t.length;o=i++){var a=t[i][0],l=t[i][1],u=t[o][0],c=t[o][1],h=r[1]*(a-u)+l*(u-r[0])+c*(r[0]-a)===0&&(a-r[0])*(u-r[0])<=0&&(l-r[1])*(c-r[1])<=0;if(h)return!e;var f=l>r[1]!=c>r[1]&&r[0]<(u-a)*(r[1]-l)/(c-l)+a;f&&(n=!n)}return n}function lB(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}function qn(r,t,e){e===void 0&&(e={});var n=Is(r),i=Is(t),o=ui(i[1]-n[1]),a=ui(i[0]-n[0]),l=ui(n[1]),u=ui(i[1]),c=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(u);return Md(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),e.units)}function uB(r){if(!r)throw new Error("geojson is required");switch(r.type){case"Feature":return yw(r);case"FeatureCollection":return cB(r);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return qy(r);default:throw new Error("unknown GeoJSON type")}}function yw(r){var t={type:"Feature"};return Object.keys(r).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:t[e]=r[e]}}),t.properties=_w(r.properties),t.geometry=qy(r.geometry),t}function _w(r){var t={};return r&&Object.keys(r).forEach(function(e){var n=r[e];typeof n=="object"?n===null?t[e]=null:Array.isArray(n)?t[e]=n.map(function(i){return i}):t[e]=_w(n):t[e]=n}),t}function cB(r){var t={type:"FeatureCollection"};return Object.keys(r).forEach(function(e){switch(e){case"type":case"features":return;default:t[e]=r[e]}}),t.features=r.features.map(function(e){return yw(e)}),t}function qy(r){var t={type:r.type};return r.bbox&&(t.bbox=r.bbox),r.type==="GeometryCollection"?(t.geometries=r.geometries.map(function(e){return qy(e)}),t):(t.coordinates=vw(r.coordinates),t)}function vw(r){var t=r;return typeof t[0]!="object"?t.slice():t.map(function(e){return vw(e)})}function hB(r,t){t===void 0&&(t={});var e=Number(r[0]),n=Number(r[1]),i=Number(r[2]),o=Number(r[3]);if(r.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[e,n],l=[e,o],u=[i,o],c=[i,n];return Hn([[a,c,u,l,a]],t.properties,{bbox:r,id:t.id})}function fB(r){return hB(Cs(r))}function dB(r){var t=r[0],e=r[1],n=r[2],i=r[3],o=qn(r.slice(0,2),[n,e]),a=qn(r.slice(0,2),[t,i]);if(o>=a){var l=(e+i)/2;return[t,l-(n-t)/2,n,l+(n-t)/2]}else{var u=(t+n)/2;return[u-(i-e)/2,e,u+(i-e)/2,i]}}function Ew(r,t,e,n){n===void 0&&(n={});var i=Is(r),o=ui(i[0]),a=ui(i[1]),l=ui(e),u=rh(t,n.units),c=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(l)),h=o+Math.atan2(Math.sin(l)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(c)),f=ih(h),d=ih(c);return ur([f,d],n.properties)}function xw(r,t,e){if(e===void 0&&(e={}),e.final===!0)return gB(r,t);var n=Is(r),i=Is(t),o=ui(n[0]),a=ui(i[0]),l=ui(n[1]),u=ui(i[1]),c=Math.sin(a-o)*Math.cos(u),h=Math.cos(l)*Math.sin(u)-Math.sin(l)*Math.cos(u)*Math.cos(a-o);return ih(Math.atan2(c,h))}function gB(r,t){var e=xw(t,r);return e=(e+180)%360,e}function pB(r,t){t===void 0&&(t={});var e=Cs(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return ur([n,i],t.properties,t)}function mB(r,t){t===void 0&&(t={});var e=0,n=0,i=0;return Od(r,function(o){e+=o[0],n+=o[1],i++},!0),ur([e/i,n/i],t.properties)}function Zy(r){if(!r)throw new Error("geojson is required");var t=[];return $a(r,function(e){yB(e,t)}),Pe(t)}function yB(r,t){var e=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":e=Wi(n);break;case"LineString":e=[Wi(n)]}e.forEach(function(i){var o=_B(i,r.properties);o.forEach(function(a){a.id=t.length,t.push(a)})})}}function _B(r,t){var e=[];return r.reduce(function(n,i){var o=li([n,i],t);return o.bbox=vB(n,i),e.push(o),i}),e}function vB(r,t){var e=r[0],n=r[1],i=t[0],o=t[1],a=e<i?e:i,l=n<o?n:o,u=e>i?e:i,c=n>o?n:o;return[a,l,u,c]}var Ky={exports:{}},ww={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function t(P,b,A){A===void 0&&(A={});var L={type:"Feature"};return(A.id===0||A.id)&&(L.id=A.id),A.bbox&&(L.bbox=A.bbox),L.properties=b||{},L.geometry=P,L}r.feature=t;function e(P,b,A){switch(P){case"Point":return n(b).geometry;case"LineString":return l(b).geometry;case"Polygon":return o(b).geometry;case"MultiPoint":return f(b).geometry;case"MultiLineString":return h(b).geometry;case"MultiPolygon":return d(b).geometry;default:throw new Error(P+" is invalid")}}r.geometry=e;function n(P,b,A){if(A===void 0&&(A={}),!P)throw new Error("coordinates is required");if(!Array.isArray(P))throw new Error("coordinates must be an Array");if(P.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!C(P[0])||!C(P[1]))throw new Error("coordinates must contain numbers");var L={type:"Point",coordinates:P};return t(L,b,A)}r.point=n;function i(P,b,A){return A===void 0&&(A={}),c(P.map(function(L){return n(L,b)}),A)}r.points=i;function o(P,b,A){A===void 0&&(A={});for(var L=0,B=P;L<B.length;L++){var F=B[L];if(F.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var V=0;V<F[F.length-1].length;V++)if(F[F.length-1][V]!==F[0][V])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:P};return t(Y,b,A)}r.polygon=o;function a(P,b,A){return A===void 0&&(A={}),c(P.map(function(L){return o(L,b)}),A)}r.polygons=a;function l(P,b,A){if(A===void 0&&(A={}),P.length<2)throw new Error("coordinates must be an array of two or more positions");var L={type:"LineString",coordinates:P};return t(L,b,A)}r.lineString=l;function u(P,b,A){return A===void 0&&(A={}),c(P.map(function(L){return l(L,b)}),A)}r.lineStrings=u;function c(P,b){b===void 0&&(b={});var A={type:"FeatureCollection"};return b.id&&(A.id=b.id),b.bbox&&(A.bbox=b.bbox),A.features=P,A}r.featureCollection=c;function h(P,b,A){A===void 0&&(A={});var L={type:"MultiLineString",coordinates:P};return t(L,b,A)}r.multiLineString=h;function f(P,b,A){A===void 0&&(A={});var L={type:"MultiPoint",coordinates:P};return t(L,b,A)}r.multiPoint=f;function d(P,b,A){A===void 0&&(A={});var L={type:"MultiPolygon",coordinates:P};return t(L,b,A)}r.multiPolygon=d;function g(P,b,A){A===void 0&&(A={});var L={type:"GeometryCollection",geometries:P};return t(L,b,A)}r.geometryCollection=g;function p(P,b){if(b===void 0&&(b=0),b&&!(b>=0))throw new Error("precision must be a positive number");var A=Math.pow(10,b||0);return Math.round(P*A)/A}r.round=p;function m(P,b){b===void 0&&(b="kilometers");var A=r.factors[b];if(!A)throw new Error(b+" units is invalid");return P*A}r.radiansToLength=m;function y(P,b){b===void 0&&(b="kilometers");var A=r.factors[b];if(!A)throw new Error(b+" units is invalid");return P/A}r.lengthToRadians=y;function E(P,b){return v(y(P,b))}r.lengthToDegrees=E;function _(P){var b=P%360;return b<0&&(b+=360),b}r.bearingToAzimuth=_;function v(P){var b=P%(2*Math.PI);return b*180/Math.PI}r.radiansToDegrees=v;function x(P){var b=P%360;return b*Math.PI/180}r.degreesToRadians=x;function w(P,b,A){if(b===void 0&&(b="kilometers"),A===void 0&&(A="kilometers"),!(P>=0))throw new Error("length must be a positive number");return m(y(P,b),A)}r.convertLength=w;function I(P,b,A){if(b===void 0&&(b="meters"),A===void 0&&(A="kilometers"),!(P>=0))throw new Error("area must be a positive number");var L=r.areaFactors[b];if(!L)throw new Error("invalid original units");var B=r.areaFactors[A];if(!B)throw new Error("invalid final units");return P/L*B}r.convertArea=I;function C(P){return!isNaN(P)&&P!==null&&!Array.isArray(P)}r.isNumber=C;function T(P){return!!P&&P.constructor===Object}r.isObject=T;function R(P){if(!P)throw new Error("bbox is required");if(!Array.isArray(P))throw new Error("bbox must be an Array");if(P.length!==4&&P.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");P.forEach(function(b){if(!C(b))throw new Error("bbox must only contain numbers")})}r.validateBBox=R;function M(P){if(!P)throw new Error("id is required");if(["string","number"].indexOf(typeof P)===-1)throw new Error("id must be a number or a string")}r.validateId=M})(ww);var un={};const EB=XE(iB);Object.defineProperty(un,"__esModule",{value:!0});var Zn=EB;function sh(r,t,e){if(r!==null)for(var n,i,o,a,l,u,c,h=0,f=0,d,g=r.type,p=g==="FeatureCollection",m=g==="Feature",y=p?r.features.length:1,E=0;E<y;E++){c=p?r.features[E].geometry:m?r.geometry:r,d=c?c.type==="GeometryCollection":!1,l=d?c.geometries.length:1;for(var _=0;_<l;_++){var v=0,x=0;if(a=d?c.geometries[_]:c,a!==null){u=a.coordinates;var w=a.type;switch(h=e&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(t(u,f,E,v,x)===!1)return!1;f++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,E,v,x)===!1)return!1;f++,w==="MultiPoint"&&v++}w==="LineString"&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(t(u[n][i],f,E,v,x)===!1)return!1;f++}w==="MultiLineString"&&v++,w==="Polygon"&&x++}w==="Polygon"&&v++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(x=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-h;o++){if(t(u[n][i][o],f,E,v,x)===!1)return!1;f++}x++}v++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(sh(a.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function xB(r,t,e,n){var i=e;return sh(r,function(o,a,l,u,c){a===0&&e===void 0?i=o:i=t(i,o,a,l,u,c)},n),i}function Sw(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function wB(r,t,e){var n=e;return Sw(r,function(i,o){o===0&&e===void 0?n=i:n=t(n,i,o)}),n}function Cw(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function SB(r,t,e){var n=e;return Cw(r,function(i,o){o===0&&e===void 0?n=i:n=t(n,i,o)}),n}function CB(r){var t=[];return sh(r,function(e){t.push(e)}),t}function Jy(r,t){var e,n,i,o,a,l,u,c,h,f,d=0,g=r.type==="FeatureCollection",p=r.type==="Feature",m=g?r.features.length:1;for(e=0;e<m;e++){for(l=g?r.features[e].geometry:p?r.geometry:r,c=g?r.features[e].properties:p?r.properties:{},h=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=l?l.type==="GeometryCollection":!1,a=u?l.geometries.length:1,i=0;i<a;i++){if(o=u?l.geometries[i]:l,o===null){if(t(null,d,c,h,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,d,c,h,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],d,c,h,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function IB(r,t,e){var n=e;return Jy(r,function(i,o,a,l,u){o===0&&e===void 0?n=i:n=t(n,i,o,a,l,u)}),n}function Fd(r,t){Jy(r,function(e,n,i,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(Zn.feature(e,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var c=0;c<e.coordinates.length;c++){var h=e.coordinates[c],f={type:u,coordinates:h};if(t(Zn.feature(f,i),n,c)===!1)return!1}})}function TB(r,t,e){var n=e;return Fd(r,function(i,o,a){o===0&&a===0&&e===void 0?n=i:n=t(n,i,o,a)}),n}function Iw(r,t){Fd(r,function(e,n,i){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,u=0,c=0,h=0;if(sh(e,function(f,d,g,p,m){if(l===void 0||n>u||p>c||m>h){l=f,u=n,c=p,h=m,o=0;return}var y=Zn.lineString([l,f],e.properties);if(t(y,n,i,m,o)===!1)return!1;o++,l=f})===!1)return!1}}})}function RB(r,t,e){var n=e,i=!1;return Iw(r,function(o,a,l,u,c){i===!1&&e===void 0?n=o:n=t(n,o,a,l,u,c),i=!0}),n}function Tw(r,t){if(!r)throw new Error("geojson is required");Fd(r,function(e,n,i){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,n,i,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(Zn.lineString(a[l],e.properties),n,i,l)===!1)return!1;break}}})}function PB(r,t,e){var n=e;return Tw(r,function(i,o,a,l){o===0&&e===void 0?n=i:n=t(n,i,o,a,l)}),n}function bB(r,t){if(t=t||{},!Zn.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var u=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=u.length+o-1),Zn.lineString([u[o],u[o+1]],a,t);case"Polygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o-1),Zn.lineString([u[i][o],u[i][o+1]],a,t);case"MultiLineString":return n<0&&(n=u.length+n),o<0&&(o=u[n].length+o-1),Zn.lineString([u[n][o],u[n][o+1]],a,t);case"MultiPolygon":return n<0&&(n=u.length+n),i<0&&(i=u[n].length+i),o<0&&(o=u[n][i].length-o-1),Zn.lineString([u[n][i][o],u[n][i][o+1]],a,t)}throw new Error("geojson is invalid")}function AB(r,t){if(t=t||{},!Zn.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var u=l.coordinates;switch(l.type){case"Point":return Zn.point(u,a,t);case"MultiPoint":return n<0&&(n=u.length+n),Zn.point(u[n],a,t);case"LineString":return o<0&&(o=u.length+o),Zn.point(u[o],a,t);case"Polygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),Zn.point(u[i][o],a,t);case"MultiLineString":return n<0&&(n=u.length+n),o<0&&(o=u[n].length+o),Zn.point(u[n][o],a,t);case"MultiPolygon":return n<0&&(n=u.length+n),i<0&&(i=u[n].length+i),o<0&&(o=u[n][i].length-o),Zn.point(u[n][i][o],a,t)}throw new Error("geojson is invalid")}un.coordAll=CB,un.coordEach=sh,un.coordReduce=xB,un.featureEach=Cw,un.featureReduce=SB,un.findPoint=AB,un.findSegment=bB,un.flattenEach=Fd,un.flattenReduce=TB,un.geomEach=Jy,un.geomReduce=IB,un.lineEach=Tw,un.lineReduce=PB,un.propEach=Sw,un.propReduce=wB,un.segmentEach=Iw,un.segmentReduce=RB;var Dd={},cn={},Yt={},Rw=Object.prototype.toString,Pw=function(t){var e=Rw.call(t),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Rw.call(t.callee)==="[object Function]"),n},Qy,bw;function LB(){if(bw)return Qy;bw=1;var r;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Pw,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(d){var g=d.constructor;return g&&g.prototype===d},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if(typeof window>"u")return!1;for(var d in window)try{if(!c["$"+d]&&t.call(window,d)&&window[d]!==null&&typeof window[d]=="object")try{u(window[d])}catch{return!0}}catch{return!0}return!1}(),f=function(d){if(typeof window>"u"||!h)return u(d);try{return u(d)}catch{return!1}};r=function(g){var p=g!==null&&typeof g=="object",m=e.call(g)==="[object Function]",y=n(g),E=p&&e.call(g)==="[object String]",_=[];if(!p&&!m&&!y)throw new TypeError("Object.keys called on a non-object");var v=a&&m;if(E&&g.length>0&&!t.call(g,0))for(var x=0;x<g.length;++x)_.push(String(x));if(y&&g.length>0)for(var w=0;w<g.length;++w)_.push(String(w));else for(var I in g)!(v&&I==="prototype")&&t.call(g,I)&&_.push(String(I));if(o)for(var C=f(g),T=0;T<l.length;++T)!(C&&l[T]==="constructor")&&t.call(g,l[T])&&_.push(l[T]);return _}}return Qy=r,Qy}var MB=Array.prototype.slice,NB=Pw,Aw=Object.keys,Bd=Aw?function(t){return Aw(t)}:LB(),Lw=Object.keys;Bd.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(n){return NB(n)?Lw(MB.call(n)):Lw(n)})}else Object.keys=Bd;return Object.keys||Bd};var $y=Bd,OB=Error,FB=EvalError,DB=RangeError,BB=ReferenceError,Mw=SyntaxError,ea=TypeError,GB=URIError,Gd=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==i||a.enumerable!==!0)return!1}return!0},Nw=typeof Symbol<"u"&&Symbol,kB=Gd,t_=function(){return typeof Nw!="function"||typeof Symbol!="function"||typeof Nw("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:kB()},e_={__proto__:null,foo:{}},zB=Object,UB=function(){return{__proto__:e_}.foo===e_.foo&&!(e_ instanceof zB)},VB="Function.prototype.bind called on incompatible ",jB=Object.prototype.toString,WB=Math.max,YB="[object Function]",Ow=function(t,e){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var o=0;o<e.length;o+=1)n[o+t.length]=e[o];return n},XB=function(t,e){for(var n=[],i=e||0,o=0;i<t.length;i+=1,o+=1)n[o]=t[i];return n},HB=function(r,t){for(var e="",n=0;n<r.length;n+=1)e+=r[n],n+1<r.length&&(e+=t);return e},qB=function(t){var e=this;if(typeof e!="function"||jB.apply(e)!==YB)throw new TypeError(VB+e);for(var n=XB(arguments,1),i,o=function(){if(this instanceof i){var h=e.apply(this,Ow(n,arguments));return Object(h)===h?h:this}return e.apply(t,Ow(n,arguments))},a=WB(0,e.length-n.length),l=[],u=0;u<a;u++)l[u]="$"+u;if(i=Function("binder","return function ("+HB(l,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var c=function(){};c.prototype=e.prototype,i.prototype=new c,c.prototype=null}return i},ZB=qB,n_=Function.prototype.bind||ZB,KB=Function.prototype.call,JB=Object.prototype.hasOwnProperty,QB=n_,Fw=QB.call(KB,JB),Ft,$B=OB,tG=FB,eG=DB,nG=BB,pu=Mw,mu=ea,rG=GB,Dw=Function,r_=function(r){try{return Dw('"use strict"; return ('+r+").constructor;")()}catch{}},tl=Object.getOwnPropertyDescriptor;if(tl)try{tl({},"")}catch{tl=null}var i_=function(){throw new mu},iG=tl?function(){try{return arguments.callee,i_}catch{try{return tl(arguments,"callee").get}catch{return i_}}}():i_,yu=t_(),sG=UB(),_n=Object.getPrototypeOf||(sG?function(r){return r.__proto__}:null),_u={},oG=typeof Uint8Array>"u"||!_n?Ft:_n(Uint8Array),el={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ft:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ft:ArrayBuffer,"%ArrayIteratorPrototype%":yu&&_n?_n([][Symbol.iterator]()):Ft,"%AsyncFromSyncIteratorPrototype%":Ft,"%AsyncFunction%":_u,"%AsyncGenerator%":_u,"%AsyncGeneratorFunction%":_u,"%AsyncIteratorPrototype%":_u,"%Atomics%":typeof Atomics>"u"?Ft:Atomics,"%BigInt%":typeof BigInt>"u"?Ft:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ft:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ft:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ft:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$B,"%eval%":eval,"%EvalError%":tG,"%Float32Array%":typeof Float32Array>"u"?Ft:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ft:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ft:FinalizationRegistry,"%Function%":Dw,"%GeneratorFunction%":_u,"%Int8Array%":typeof Int8Array>"u"?Ft:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ft:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ft:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":yu&&_n?_n(_n([][Symbol.iterator]())):Ft,"%JSON%":typeof JSON=="object"?JSON:Ft,"%Map%":typeof Map>"u"?Ft:Map,"%MapIteratorPrototype%":typeof Map>"u"||!yu||!_n?Ft:_n(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ft:Promise,"%Proxy%":typeof Proxy>"u"?Ft:Proxy,"%RangeError%":eG,"%ReferenceError%":nG,"%Reflect%":typeof Reflect>"u"?Ft:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ft:Set,"%SetIteratorPrototype%":typeof Set>"u"||!yu||!_n?Ft:_n(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ft:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":yu&&_n?_n(""[Symbol.iterator]()):Ft,"%Symbol%":yu?Symbol:Ft,"%SyntaxError%":pu,"%ThrowTypeError%":iG,"%TypedArray%":oG,"%TypeError%":mu,"%Uint8Array%":typeof Uint8Array>"u"?Ft:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ft:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ft:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ft:Uint32Array,"%URIError%":rG,"%WeakMap%":typeof WeakMap>"u"?Ft:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ft:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ft:WeakSet};if(_n)try{null.error}catch(r){var aG=_n(_n(r));el["%Error.prototype%"]=aG}var lG=function r(t){var e;if(t==="%AsyncFunction%")e=r_("async function () {}");else if(t==="%GeneratorFunction%")e=r_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=r_("async function* () {}");else if(t==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&_n&&(e=_n(i.prototype))}return el[t]=e,e},Bw={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},oh=n_,kd=Fw,uG=oh.call(Function.call,Array.prototype.concat),cG=oh.call(Function.apply,Array.prototype.splice),Gw=oh.call(Function.call,String.prototype.replace),zd=oh.call(Function.call,String.prototype.slice),hG=oh.call(Function.call,RegExp.prototype.exec),fG=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dG=/\\(\\)?/g,gG=function(t){var e=zd(t,0,1),n=zd(t,-1);if(e==="%"&&n!=="%")throw new pu("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new pu("invalid intrinsic syntax, expected opening `%`");var i=[];return Gw(t,fG,function(o,a,l,u){i[i.length]=l?Gw(u,dG,"$1"):a||o}),i},pG=function(t,e){var n=t,i;if(kd(Bw,n)&&(i=Bw[n],n="%"+i[0]+"%"),kd(el,n)){var o=el[n];if(o===_u&&(o=lG(n)),typeof o>"u"&&!e)throw new mu("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new pu("intrinsic "+t+" does not exist!")},Ts=function(t,e){if(typeof t!="string"||t.length===0)throw new mu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new mu('"allowMissing" argument must be a boolean');if(hG(/^%?[^%]*%?$/,t)===null)throw new pu("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gG(t),i=n.length>0?n[0]:"",o=pG("%"+i+"%",e),a=o.name,l=o.value,u=!1,c=o.alias;c&&(i=c[0],cG(n,uG([0,1],c)));for(var h=1,f=!0;h<n.length;h+=1){var d=n[h],g=zd(d,0,1),p=zd(d,-1);if((g==='"'||g==="'"||g==="`"||p==='"'||p==="'"||p==="`")&&g!==p)throw new pu("property names with quotes must have matching quotes");if((d==="constructor"||!f)&&(u=!0),i+="."+d,a="%"+i+"%",kd(el,a))l=el[a];else if(l!=null){if(!(d in l)){if(!e)throw new mu("base intrinsic for "+t+" exists, but the property is not available.");return}if(tl&&h+1>=n.length){var m=tl(l,d);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?l=m.get:l=l[d]}else f=kd(l,d),l=l[d];f&&!u&&(el[a]=l)}}return l},s_,kw;function o_(){if(kw)return s_;kw=1;var r=Ts,t=r("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return s_=t,s_}var mG=Ts,Ud=mG("%Object.getOwnPropertyDescriptor%",!0);if(Ud)try{Ud([],"length")}catch{Ud=null}var a_=Ud,zw=o_(),yG=Mw,vu=ea,Uw=a_,l_=function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new vu("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new vu("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new vu("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new vu("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new vu("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new vu("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,u=!!Uw&&Uw(t,e);if(zw)zw(t,e,{configurable:a===null&&u?u.configurable:!a,enumerable:i===null&&u?u.enumerable:!i,value:n,writable:o===null&&u?u.writable:!o});else if(l||!i&&!o&&!a)t[e]=n;else throw new yG("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},u_=o_(),Vw=function(){return!!u_};Vw.hasArrayLengthDefineBug=function(){if(!u_)return null;try{return u_([],"length",{value:1}).length!==1}catch{return!0}};var c_=Vw,_G=$y,vG=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",EG=Object.prototype.toString,xG=Array.prototype.concat,jw=l_,wG=function(r){return typeof r=="function"&&EG.call(r)==="[object Function]"},Ww=c_(),SG=function(r,t,e,n){if(t in r){if(n===!0){if(r[t]===e)return}else if(!wG(n)||!n())return}Ww?jw(r,t,e,!0):jw(r,t,e)},Yw=function(r,t){var e=arguments.length>2?arguments[2]:{},n=_G(t);vG&&(n=xG.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)SG(r,n[i],t[n[i]],e[n[i]])};Yw.supportsDescriptors=!!Ww;var nl=Yw,Xw={exports:{}},CG=Ts,Hw=l_,IG=c_(),qw=a_,Zw=ea,TG=CG("%Math.floor%"),RG=function(t,e){if(typeof t!="function")throw new Zw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||TG(e)!==e)throw new Zw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in t&&qw){var a=qw(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!n)&&(IG?Hw(t,"length",e,!0,!0):Hw(t,"length",e)),t};(function(r){var t=n_,e=Ts,n=RG,i=ea,o=e("%Function.prototype.apply%"),a=e("%Function.prototype.call%"),l=e("%Reflect.apply%",!0)||t.call(a,o),u=o_(),c=e("%Math.max%");r.exports=function(d){if(typeof d!="function")throw new i("a function is required");var g=l(t,a,arguments);return n(g,1+c(0,d.length-(arguments.length-1)),!0)};var h=function(){return l(t,o,arguments)};u?u(r.exports,"apply",{value:h}):r.exports.apply=h})(Xw);var Eu=Xw.exports,Kw=Ts,Jw=Eu,PG=Jw(Kw("String.prototype.indexOf")),hi=function(t,e){var n=Kw(t,!!e);return typeof n=="function"&&PG(t,".prototype.")>-1?Jw(n):n},bG=$y,Qw=Gd(),$w=hi,tS=Object,AG=$w("Array.prototype.push"),eS=$w("Object.prototype.propertyIsEnumerable"),LG=Qw?Object.getOwnPropertySymbols:null,nS=function(t,e){if(t==null)throw new TypeError("target must be an object");var n=tS(t);if(arguments.length===1)return n;for(var i=1;i<arguments.length;++i){var o=tS(arguments[i]),a=bG(o),l=Qw&&(Object.getOwnPropertySymbols||LG);if(l)for(var u=l(o),c=0;c<u.length;++c){var h=u[c];eS(o,h)&&AG(a,h)}for(var f=0;f<a.length;++f){var d=a[f];if(eS(o,d)){var g=o[d];n[d]=g}}}return n},h_=nS,MG=function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},n=0;n<t.length;++n)e[t[n]]=t[n];var i=Object.assign({},e),o="";for(var a in i)o+=a;return r!==o},NG=function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1},rS=function(){return!Object.assign||MG()||NG()?h_:Object.assign},OG=nl,FG=rS,DG=function(){var t=FG();return OG(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t},BG=nl,GG=Eu,kG=nS,iS=rS,zG=DG,UG=GG.apply(iS()),sS=function(t,e){return UG(Object,arguments)};BG(sS,{getPolyfill:iS,implementation:kG,shim:zG});var VG=sS,ah=function(){return typeof(function(){}).name=="string"},lh=Object.getOwnPropertyDescriptor;if(lh)try{lh([],"length")}catch{lh=null}ah.functionsHaveConfigurableNames=function(){if(!ah()||!lh)return!1;var t=lh(function(){},"name");return!!t&&!!t.configurable};var jG=Function.prototype.bind;ah.boundFunctionsHaveNames=function(){return ah()&&typeof jG=="function"&&(function(){}).bind().name!==""};var WG=ah,oS=l_,YG=c_(),XG=WG.functionsHaveConfigurableNames(),HG=ea,qG=function(t,e){if(typeof t!="function")throw new HG("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||XG)&&(YG?oS(t,"name",e,!0,!0):oS(t,"name",e)),t},ZG=qG,KG=ea,JG=Object,aS=ZG(function(){if(this==null||this!==JG(this))throw new KG("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),QG=aS,$G=nl.supportsDescriptors,tk=Object.getOwnPropertyDescriptor,lS=function(){if($G&&/a/mig.flags==="gim"){var t=tk(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return QG},ek=nl.supportsDescriptors,nk=lS,rk=Object.getOwnPropertyDescriptor,ik=Object.defineProperty,sk=TypeError,uS=Object.getPrototypeOf,ok=/a/,ak=function(){if(!ek||!uS)throw new sk("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=nk(),e=uS(ok),n=rk(e,"flags");return(!n||n.get!==t)&&ik(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},lk=nl,uk=Eu,ck=aS,cS=lS,hk=ak,hS=uk(cS());lk(hS,{getPolyfill:cS,implementation:ck,shim:hk});var fk=hS,Vd={exports:{}},dk=Gd,rl=function(){return dk()&&!!Symbol.toStringTag},gk=rl(),pk=hi,f_=pk("Object.prototype.toString"),jd=function(t){return gk&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:f_(t)==="[object Arguments]"},fS=function(t){return jd(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&f_(t)!=="[object Array]"&&f_(t.callee)==="[object Function]"},mk=function(){return jd(arguments)}();jd.isLegacyArguments=fS;var dS=mk?jd:fS;const yk=XE(zA);var d_=typeof Map=="function"&&Map.prototype,g_=Object.getOwnPropertyDescriptor&&d_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Wd=d_&&g_&&typeof g_.get=="function"?g_.get:null,gS=d_&&Map.prototype.forEach,p_=typeof Set=="function"&&Set.prototype,m_=Object.getOwnPropertyDescriptor&&p_?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Yd=p_&&m_&&typeof m_.get=="function"?m_.get:null,pS=p_&&Set.prototype.forEach,_k=typeof WeakMap=="function"&&WeakMap.prototype,uh=_k?WeakMap.prototype.has:null,vk=typeof WeakSet=="function"&&WeakSet.prototype,ch=vk?WeakSet.prototype.has:null,Ek=typeof WeakRef=="function"&&WeakRef.prototype,mS=Ek?WeakRef.prototype.deref:null,xk=Boolean.prototype.valueOf,wk=Object.prototype.toString,Sk=Function.prototype.toString,Ck=String.prototype.match,y_=String.prototype.slice,na=String.prototype.replace,Ik=String.prototype.toUpperCase,yS=String.prototype.toLowerCase,_S=RegExp.prototype.test,vS=Array.prototype.concat,Rs=Array.prototype.join,Tk=Array.prototype.slice,ES=Math.floor,__=typeof BigInt=="function"?BigInt.prototype.valueOf:null,v_=Object.getOwnPropertySymbols,E_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,xu=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Kn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===xu||"symbol")?Symbol.toStringTag:null,xS=Object.prototype.propertyIsEnumerable,wS=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function SS(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||_S.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-ES(-r):ES(r);if(n!==r){var i=String(n),o=y_.call(t,i.length+1);return na.call(i,e,"$&_")+"."+na.call(na.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return na.call(t,e,"$&_")}var x_=yk,CS=x_.custom,IS=PS(CS)?CS:null,Rk=function r(t,e,n,i){var o=e||{};if(ra(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ra(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=ra(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ra(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ra(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return AS(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var u=String(t);return l?SS(t,u):u}if(typeof t=="bigint"){var c=String(t)+"n";return l?SS(t,c):c}var h=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=h&&h>0&&typeof t=="object")return w_(t)?"[Array]":"[Object]";var f=Yk(o,n);if(typeof i>"u")i=[];else if(bS(i,t)>=0)return"[Circular]";function d(A,L,B){if(L&&(i=Tk.call(i),i.push(L)),B){var F={depth:o.depth};return ra(o,"quoteStyle")&&(F.quoteStyle=o.quoteStyle),r(A,F,n+1,i)}return r(A,o,n+1,i)}if(typeof t=="function"&&!RS(t)){var g=Dk(t),p=Xd(t,d);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(p.length>0?" { "+Rs.call(p,", ")+" }":"")}if(PS(t)){var m=xu?na.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):E_.call(t);return typeof t=="object"&&!xu?hh(m):m}if(Vk(t)){for(var y="<"+yS.call(String(t.nodeName)),E=t.attributes||[],_=0;_<E.length;_++)y+=" "+E[_].name+"="+TS(Pk(E[_].value),"double",o);return y+=">",t.childNodes&&t.childNodes.length&&(y+="..."),y+="</"+yS.call(String(t.nodeName))+">",y}if(w_(t)){if(t.length===0)return"[]";var v=Xd(t,d);return f&&!Wk(v)?"["+C_(v,f)+"]":"[ "+Rs.call(v,", ")+" ]"}if(Ak(t)){var x=Xd(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!xS.call(t,"cause")?"{ ["+String(t)+"] "+Rs.call(vS.call("[cause]: "+d(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Rs.call(x,", ")+" }"}if(typeof t=="object"&&a){if(IS&&typeof t[IS]=="function"&&x_)return x_(t,{depth:h-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Bk(t)){var w=[];return gS&&gS.call(t,function(A,L){w.push(d(L,t,!0)+" => "+d(A,t))}),LS("Map",Wd.call(t),w,f)}if(zk(t)){var I=[];return pS&&pS.call(t,function(A){I.push(d(A,t))}),LS("Set",Yd.call(t),I,f)}if(Gk(t))return S_("WeakMap");if(Uk(t))return S_("WeakSet");if(kk(t))return S_("WeakRef");if(Mk(t))return hh(d(Number(t)));if(Ok(t))return hh(d(__.call(t)));if(Nk(t))return hh(xk.call(t));if(Lk(t))return hh(d(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Pc<"u"&&t===Pc)return"{ [object globalThis] }";if(!bk(t)&&!RS(t)){var C=Xd(t,d),T=wS?wS(t)===Object.prototype:t instanceof Object||t.constructor===Object,R=t instanceof Object?"":"null prototype",M=!T&&Kn&&Object(t)===t&&Kn in t?y_.call(ia(t),8,-1):R?"Object":"",P=T||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",b=P+(M||R?"["+Rs.call(vS.call([],M||[],R||[]),": ")+"] ":"");return C.length===0?b+"{}":f?b+"{"+C_(C,f)+"}":b+"{ "+Rs.call(C,", ")+" }"}return String(t)};function TS(r,t,e){var n=(e.quoteStyle||t)==="double"?'"':"'";return n+r+n}function Pk(r){return na.call(String(r),/"/g,"&quot;")}function w_(r){return ia(r)==="[object Array]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function bk(r){return ia(r)==="[object Date]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function RS(r){return ia(r)==="[object RegExp]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function Ak(r){return ia(r)==="[object Error]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function Lk(r){return ia(r)==="[object String]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function Mk(r){return ia(r)==="[object Number]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function Nk(r){return ia(r)==="[object Boolean]"&&(!Kn||!(typeof r=="object"&&Kn in r))}function PS(r){if(xu)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!E_)return!1;try{return E_.call(r),!0}catch{}return!1}function Ok(r){if(!r||typeof r!="object"||!__)return!1;try{return __.call(r),!0}catch{}return!1}var Fk=Object.prototype.hasOwnProperty||function(r){return r in this};function ra(r,t){return Fk.call(r,t)}function ia(r){return wk.call(r)}function Dk(r){if(r.name)return r.name;var t=Ck.call(Sk.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function bS(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1}function Bk(r){if(!Wd||!r||typeof r!="object")return!1;try{Wd.call(r);try{Yd.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Gk(r){if(!uh||!r||typeof r!="object")return!1;try{uh.call(r,uh);try{ch.call(r,ch)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function kk(r){if(!mS||!r||typeof r!="object")return!1;try{return mS.call(r),!0}catch{}return!1}function zk(r){if(!Yd||!r||typeof r!="object")return!1;try{Yd.call(r);try{Wd.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Uk(r){if(!ch||!r||typeof r!="object")return!1;try{ch.call(r,ch);try{uh.call(r,uh)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Vk(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function AS(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return AS(y_.call(r,0,t.maxStringLength),t)+n}var i=na.call(na.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,jk);return TS(i,"single",t)}function jk(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Ik.call(t.toString(16))}function hh(r){return"Object("+r+")"}function S_(r){return r+" { ? }"}function LS(r,t,e,n){var i=n?C_(e,n):Rs.call(e,", ");return r+" ("+t+") {"+i+"}"}function Wk(r){for(var t=0;t<r.length;t++)if(bS(r[t],`
453
+ `)>=0)return!1;return!0}function Yk(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=Rs.call(Array(r.indent+1)," ");else return null;return{base:e,prev:Rs.call(Array(t+1),e)}}function C_(r,t){if(r.length===0)return"";var e=`
454
+ `+t.prev+t.base;return e+Rs.call(r,","+e)+`
455
+ `+t.prev}function Xd(r,t){var e=w_(r),n=[];if(e){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ra(r,i)?t(r[i],r):""}var o=typeof v_=="function"?v_(r):[],a;if(xu){a={};for(var l=0;l<o.length;l++)a["$"+o[l]]=o[l]}for(var u in r)ra(r,u)&&(e&&String(Number(u))===u&&u<r.length||xu&&a["$"+u]instanceof Symbol||(_S.call(/[^\w$]/,u)?n.push(t(u,r)+": "+t(r[u],r)):n.push(u+": "+t(r[u],r))));if(typeof v_=="function")for(var c=0;c<o.length;c++)xS.call(r,o[c])&&n.push("["+t(o[c])+"]: "+t(r[o[c]],r));return n}var MS=Ts,wu=hi,Xk=Rk,Hk=ea,Hd=MS("%WeakMap%",!0),qd=MS("%Map%",!0),qk=wu("WeakMap.prototype.get",!0),Zk=wu("WeakMap.prototype.set",!0),Kk=wu("WeakMap.prototype.has",!0),Jk=wu("Map.prototype.get",!0),Qk=wu("Map.prototype.set",!0),$k=wu("Map.prototype.has",!0),I_=function(r,t){for(var e=r,n;(n=e.next)!==null;e=n)if(n.key===t)return e.next=n.next,n.next=r.next,r.next=n,n},t3=function(r,t){var e=I_(r,t);return e&&e.value},e3=function(r,t,e){var n=I_(r,t);n?n.value=e:r.next={key:t,next:r.next,value:e}},n3=function(r,t){return!!I_(r,t)},NS=function(){var t,e,n,i={assert:function(o){if(!i.has(o))throw new Hk("Side channel does not contain "+Xk(o))},get:function(o){if(Hd&&o&&(typeof o=="object"||typeof o=="function")){if(t)return qk(t,o)}else if(qd){if(e)return Jk(e,o)}else if(n)return t3(n,o)},has:function(o){if(Hd&&o&&(typeof o=="object"||typeof o=="function")){if(t)return Kk(t,o)}else if(qd){if(e)return $k(e,o)}else if(n)return n3(n,o);return!1},set:function(o,a){Hd&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new Hd),Zk(t,o,a)):qd?(e||(e=new qd),Qk(e,o,a)):(n||(n={key:{},next:null}),e3(n,o,a))}};return i},r3=Fw,fh=NS(),go=ea,T_={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new go("`O` is not an object");if(typeof t!="string")throw new go("`slot` must be a string");if(fh.assert(r),!T_.has(r,t))throw new go("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new go("`O` is not an object");if(typeof t!="string")throw new go("`slot` must be a string");var e=fh.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new go("`O` is not an object");if(typeof t!="string")throw new go("`slot` must be a string");var e=fh.get(r);return!!e&&r3(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new go("`O` is not an object");if(typeof t!="string")throw new go("`slot` must be a string");var n=fh.get(r);n||(n={},fh.set(r,n)),n["$"+t]=e}};Object.freeze&&Object.freeze(T_);var i3=T_,dh=i3,s3=SyntaxError,OS=typeof StopIteration=="object"?StopIteration:null,o3=function(t){if(!OS)throw new s3("this environment lacks StopIteration");dh.set(t,"[[Done]]",!1);var e={next:function(){var i=dh.get(this,"[[Iterator]]"),o=dh.get(i,"[[Done]]");try{return{done:o,value:o?void 0:i.next()}}catch(a){if(dh.set(i,"[[Done]]",!0),a!==OS)throw a;return{done:!0,value:void 0}}}};return dh.set(e,"[[Iterator]]",t),e},a3={}.toString,FS=Array.isArray||function(r){return a3.call(r)=="[object Array]"},l3=String.prototype.valueOf,u3=function(t){try{return l3.call(t),!0}catch{return!1}},c3=Object.prototype.toString,h3="[object String]",f3=rl(),DS=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:f3?u3(t):c3.call(t)===h3},R_=typeof Map=="function"&&Map.prototype?Map:null,d3=typeof Set=="function"&&Set.prototype?Set:null,Zd;R_||(Zd=function(t){return!1});var BS=R_?Map.prototype.has:null,GS=d3?Set.prototype.has:null;!Zd&&!BS&&(Zd=function(t){return!1});var kS=Zd||function(t){if(!t||typeof t!="object")return!1;try{if(BS.call(t),GS)try{GS.call(t)}catch{return!0}return t instanceof R_}catch{}return!1},g3=typeof Map=="function"&&Map.prototype?Map:null,P_=typeof Set=="function"&&Set.prototype?Set:null,Kd;P_||(Kd=function(t){return!1});var zS=g3?Map.prototype.has:null,US=P_?Set.prototype.has:null;!Kd&&!US&&(Kd=function(t){return!1});var VS=Kd||function(t){if(!t||typeof t!="object")return!1;try{if(US.call(t),zS)try{zS.call(t)}catch{return!0}return t instanceof P_}catch{}return!1},jS=dS,WS=o3;if(t_()||Gd()){var b_=Symbol.iterator;Vd.exports=function(t){if(t!=null&&typeof t[b_]<"u")return t[b_]();if(jS(t))return Array.prototype[b_].call(t)}}else{var p3=FS,m3=DS,YS=Ts,y3=YS("%Map%",!0),_3=YS("%Set%",!0),Yi=hi,XS=Yi("Array.prototype.push"),HS=Yi("String.prototype.charCodeAt"),v3=Yi("String.prototype.slice"),E3=function(t,e){var n=t.length;if(e+1>=n)return e+1;var i=HS(t,e);if(i<55296||i>56319)return e+1;var o=HS(t,e+1);return o<56320||o>57343?e+1:e+2},A_=function(t){var e=0;return{next:function(){var i=e>=t.length,o;return i||(o=t[e],e+=1),{done:i,value:o}}}},qS=function(t,e){if(p3(t)||jS(t))return A_(t);if(m3(t)){var n=0;return{next:function(){var o=E3(t,n),a=v3(t,n,o);return n=o,{done:o>t.length,value:a}}}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()};if(!y3&&!_3)Vd.exports=function(t){if(t!=null)return qS(t,!0)};else{var x3=kS,w3=VS,ZS=Yi("Map.prototype.forEach",!0),KS=Yi("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var JS=Yi("Map.prototype.iterator",!0),QS=Yi("Set.prototype.iterator",!0);var $S=Yi("Map.prototype.@@iterator",!0)||Yi("Map.prototype._es6-shim iterator_",!0),tC=Yi("Set.prototype.@@iterator",!0)||Yi("Set.prototype._es6-shim iterator_",!0),S3=function(t){if(x3(t)){if(JS)return WS(JS(t));if($S)return $S(t);if(ZS){var e=[];return ZS(t,function(i,o){XS(e,[o,i])}),A_(e)}}if(w3(t)){if(QS)return WS(QS(t));if(tC)return tC(t);if(KS){var n=[];return KS(t,function(i){XS(n,i)}),A_(n)}}};Vd.exports=function(t){return S3(t)||qS(t)}}}var C3=Vd.exports,eC=function(r){return r!==r},nC=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||eC(t)&&eC(e))},I3=nC,rC=function(){return typeof Object.is=="function"?Object.is:I3},T3=rC,R3=nl,P3=function(){var t=T3();return R3(Object,{is:t},{is:function(){return Object.is!==t}}),t},b3=nl,A3=Eu,L3=nC,iC=rC,M3=P3,sC=A3(iC(),Object);b3(sC,{getPolyfill:iC,implementation:L3,shim:M3});var N3=sC,O3=Eu,oC=hi,F3=Ts,L_=F3("%ArrayBuffer%",!0),Jd=oC("ArrayBuffer.prototype.byteLength",!0),D3=oC("Object.prototype.toString"),aC=!!L_&&!Jd&&new L_(0).slice,lC=!!aC&&O3(aC),uC=Jd||lC?function(t){if(!t||typeof t!="object")return!1;try{return Jd?Jd(t):lC(t,0),!0}catch{return!1}}:L_?function(t){return D3(t)==="[object ArrayBuffer]"}:function(t){return!1},B3=Date.prototype.getDay,G3=function(t){try{return B3.call(t),!0}catch{return!1}},k3=Object.prototype.toString,z3="[object Date]",U3=rl(),V3=function(t){return typeof t!="object"||t===null?!1:U3?G3(t):k3.call(t)===z3},M_=hi,cC=rl(),hC,fC,N_,O_;if(cC){hC=M_("Object.prototype.hasOwnProperty"),fC=M_("RegExp.prototype.exec"),N_={};var F_=function(){throw N_};O_={toString:F_,valueOf:F_},typeof Symbol.toPrimitive=="symbol"&&(O_[Symbol.toPrimitive]=F_)}var j3=M_("Object.prototype.toString"),W3=Object.getOwnPropertyDescriptor,Y3="[object RegExp]",X3=cC?function(t){if(!t||typeof t!="object")return!1;var e=W3(t,"lastIndex"),n=e&&hC(e,"value");if(!n)return!1;try{fC(t,O_)}catch(i){return i===N_}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:j3(t)===Y3},H3=hi,dC=H3("SharedArrayBuffer.prototype.byteLength",!0),q3=dC?function(t){if(!t||typeof t!="object")return!1;try{return dC(t),!0}catch{return!1}}:function(t){return!1},Z3=Number.prototype.toString,K3=function(t){try{return Z3.call(t),!0}catch{return!1}},J3=Object.prototype.toString,Q3="[object Number]",$3=rl(),t5=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:$3?K3(t):J3.call(t)===Q3},gC=hi,e5=gC("Boolean.prototype.toString"),n5=gC("Object.prototype.toString"),r5=function(t){try{return e5(t),!0}catch{return!1}},i5="[object Boolean]",s5=rl(),o5=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:s5&&Symbol.toStringTag in t?r5(t):n5(t)===i5},D_={exports:{}},a5=Object.prototype.toString,l5=t_();if(l5){var u5=Symbol.prototype.toString,c5=/^Symbol\(.*\)$/,h5=function(t){return typeof t.valueOf()!="symbol"?!1:c5.test(u5.call(t))};D_.exports=function(t){if(typeof t=="symbol")return!0;if(a5.call(t)!=="[object Symbol]")return!1;try{return h5(t)}catch{return!1}}}else D_.exports=function(t){return!1};var f5=D_.exports,B_={exports:{}},pC=typeof BigInt<"u"&&BigInt,d5=function(){return typeof pC=="function"&&typeof BigInt=="function"&&typeof pC(42)=="bigint"&&typeof BigInt(42)=="bigint"},g5=d5();if(g5){var p5=BigInt.prototype.valueOf,m5=function(t){try{return p5.call(t),!0}catch{}return!1};B_.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:m5(t)}}else B_.exports=function(t){return!1};var y5=B_.exports,_5=DS,v5=t5,E5=o5,x5=f5,w5=y5,S5=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(_5(t))return"String";if(v5(t))return"Number";if(E5(t))return"Boolean";if(x5(t))return"Symbol";if(w5(t))return"BigInt"},Qd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,mC=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,$d;Qd||($d=function(t){return!1});var G_=Qd?Qd.prototype.has:null,k_=mC?mC.prototype.has:null;!$d&&!G_&&($d=function(t){return!1});var C5=$d||function(t){if(!t||typeof t!="object")return!1;try{if(G_.call(t,G_),k_)try{k_.call(t,k_)}catch{return!0}return t instanceof Qd}catch{}return!1},z_={exports:{}},I5=Ts,yC=hi,T5=I5("%WeakSet%",!0),U_=yC("WeakSet.prototype.has",!0);if(U_){var V_=yC("WeakMap.prototype.has",!0);z_.exports=function(t){if(!t||typeof t!="object")return!1;try{if(U_(t,U_),V_)try{V_(t,V_)}catch{return!0}return t instanceof T5}catch{}return!1}}else z_.exports=function(t){return!1};var R5=z_.exports,P5=kS,b5=VS,A5=C5,L5=R5,M5=function(t){if(t&&typeof t=="object"){if(P5(t))return"Map";if(b5(t))return"Set";if(A5(t))return"WeakMap";if(L5(t))return"WeakSet"}return!1},_C=Function.prototype.toString,Su=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,j_,tg;if(typeof Su=="function"&&typeof Object.defineProperty=="function")try{j_=Object.defineProperty({},"length",{get:function(){throw tg}}),tg={},Su(function(){throw 42},null,j_)}catch(r){r!==tg&&(Su=null)}else Su=null;var N5=/^\s*class\b/,W_=function(t){try{var e=_C.call(t);return N5.test(e)}catch{return!1}},Y_=function(t){try{return W_(t)?!1:(_C.call(t),!0)}catch{return!1}},eg=Object.prototype.toString,O5="[object Object]",F5="[object Function]",D5="[object GeneratorFunction]",B5="[object HTMLAllCollection]",G5="[object HTML document.all class]",k5="[object HTMLCollection]",z5=typeof Symbol=="function"&&!!Symbol.toStringTag,U5=!(0 in[,]),X_=function(){return!1};if(typeof document=="object"){var V5=document.all;eg.call(V5)===eg.call(document.all)&&(X_=function(t){if((U5||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=eg.call(t);return(e===B5||e===G5||e===k5||e===O5)&&t("")==null}catch{}return!1})}var j5=Su?function(t){if(X_(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Su(t,null,j_)}catch(e){if(e!==tg)return!1}return!W_(t)&&Y_(t)}:function(t){if(X_(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(z5)return Y_(t);if(W_(t))return!1;var e=eg.call(t);return e!==F5&&e!==D5&&!/^\[object HTML/.test(e)?!1:Y_(t)},W5=j5,Y5=Object.prototype.toString,vC=Object.prototype.hasOwnProperty,X5=function(t,e,n){for(var i=0,o=t.length;i<o;i++)vC.call(t,i)&&(n==null?e(t[i],i,t):e.call(n,t[i],i,t))},H5=function(t,e,n){for(var i=0,o=t.length;i<o;i++)n==null?e(t.charAt(i),i,t):e.call(n,t.charAt(i),i,t)},q5=function(t,e,n){for(var i in t)vC.call(t,i)&&(n==null?e(t[i],i,t):e.call(n,t[i],i,t))},Z5=function(t,e,n){if(!W5(e))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Y5.call(t)==="[object Array]"?X5(t,e,i):typeof t=="string"?H5(t,e,i):q5(t,e,i)},K5=Z5,J5=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],H_=J5,Q5=typeof globalThis>"u"?Pc:globalThis,$5=function(){for(var t=[],e=0;e<H_.length;e++)typeof Q5[H_[e]]=="function"&&(t[t.length]=H_[e]);return t},ng=K5,t4=$5,EC=Eu,q_=hi,rg=a_,e4=q_("Object.prototype.toString"),xC=rl(),wC=typeof globalThis>"u"?Pc:globalThis,Z_=t4(),K_=q_("String.prototype.slice"),J_=Object.getPrototypeOf,n4=q_("Array.prototype.indexOf",!0)||function(t,e){for(var n=0;n<t.length;n+=1)if(t[n]===e)return n;return-1},ig={__proto__:null};xC&&rg&&J_?ng(Z_,function(r){var t=new wC[r];if(Symbol.toStringTag in t){var e=J_(t),n=rg(e,Symbol.toStringTag);if(!n){var i=J_(e);n=rg(i,Symbol.toStringTag)}ig["$"+r]=EC(n.get)}}):ng(Z_,function(r){var t=new wC[r],e=t.slice||t.set;e&&(ig["$"+r]=EC(e))});var r4=function(t){var e=!1;return ng(ig,function(n,i){if(!e)try{"$"+n(t)===i&&(e=K_(i,1))}catch{}}),e},i4=function(t){var e=!1;return ng(ig,function(n,i){if(!e)try{n(t),e=K_(i,1)}catch{}}),e},s4=function(t){if(!t||typeof t!="object")return!1;if(!xC){var e=K_(e4(t),8,-1);return n4(Z_,e)>-1?e:e!=="Object"?!1:i4(t)}return rg?r4(t):null},o4=hi,SC=o4("ArrayBuffer.prototype.byteLength",!0),a4=uC,l4=function(t){return a4(t)?SC?SC(t):t.byteLength:NaN},CC=VG,Ps=hi,IC=fk,u4=Ts,Cu=C3,c4=NS,TC=N3,RC=dS,PC=FS,bC=uC,AC=V3,LC=X3,MC=q3,NC=$y,OC=S5,FC=M5,DC=s4,BC=l4,GC=Ps("SharedArrayBuffer.prototype.byteLength",!0),kC=Ps("Date.prototype.getTime"),Q_=Object.getPrototypeOf,zC=Ps("Object.prototype.toString"),sg=u4("%Set%",!0),$_=Ps("Map.prototype.has",!0),og=Ps("Map.prototype.get",!0),UC=Ps("Map.prototype.size",!0),ag=Ps("Set.prototype.add",!0),VC=Ps("Set.prototype.delete",!0),lg=Ps("Set.prototype.has",!0),ug=Ps("Set.prototype.size",!0);function jC(r,t,e,n){for(var i=Cu(r),o;(o=i.next())&&!o.done;)if(Xi(t,o.value,e,n))return VC(r,o.value),!0;return!1}function WC(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}function h4(r,t,e,n,i,o){var a=WC(e);if(a!=null)return a;var l=og(t,a),u=CC({},i,{strict:!1});return typeof l>"u"&&!$_(t,a)||!Xi(n,l,u,o)?!1:!$_(r,a)&&Xi(n,l,u,o)}function f4(r,t,e){var n=WC(e);return n??(lg(t,n)&&!lg(r,n))}function YC(r,t,e,n,i,o){for(var a=Cu(r),l,u;(l=a.next())&&!l.done;)if(u=l.value,Xi(e,u,i,o)&&Xi(n,og(t,u),i,o))return VC(r,u),!0;return!1}function Xi(r,t,e,n){var i=e||{};if(i.strict?TC(r,t):r===t)return!0;var o=OC(r),a=OC(t);if(o!==a)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return i.strict?TC(r,t):r==t;var l=n.has(r),u=n.has(t),c;if(l&&u){if(n.get(r)===n.get(t))return!0}else c={};return l||n.set(r,c),u||n.set(t,c),p4(r,t,i,n)}function XC(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function d4(r,t,e,n){if(ug(r)!==ug(t))return!1;for(var i=Cu(r),o=Cu(t),a,l,u;(a=i.next())&&!a.done;)if(a.value&&typeof a.value=="object")u||(u=new sg),ag(u,a.value);else if(!lg(t,a.value)){if(e.strict||!f4(r,t,a.value))return!1;u||(u=new sg),ag(u,a.value)}if(u){for(;(l=o.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!jC(u,l.value,e.strict,n))return!1}else if(!e.strict&&!lg(r,l.value)&&!jC(u,l.value,e.strict,n))return!1;return ug(u)===0}return!0}function g4(r,t,e,n){if(UC(r)!==UC(t))return!1;for(var i=Cu(r),o=Cu(t),a,l,u,c,h,f;(a=i.next())&&!a.done;)if(c=a.value[0],h=a.value[1],c&&typeof c=="object")u||(u=new sg),ag(u,c);else if(f=og(t,c),typeof f>"u"&&!$_(t,c)||!Xi(h,f,e,n)){if(e.strict||!h4(r,t,c,h,e,n))return!1;u||(u=new sg),ag(u,c)}if(u){for(;(l=o.next())&&!l.done;)if(c=l.value[0],f=l.value[1],c&&typeof c=="object"){if(!YC(u,r,c,f,e,n))return!1}else if(!e.strict&&(!r.has(c)||!Xi(og(r,c),f,e,n))&&!YC(u,r,c,f,CC({},e,{strict:!1}),n))return!1;return ug(u)===0}return!0}function p4(r,t,e,n){var i,o;if(typeof r!=typeof t||r==null||t==null||zC(r)!==zC(t)||RC(r)!==RC(t))return!1;var a=PC(r),l=PC(t);if(a!==l)return!1;var u=r instanceof Error,c=t instanceof Error;if(u!==c||(u||c)&&(r.name!==t.name||r.message!==t.message))return!1;var h=LC(r),f=LC(t);if(h!==f||(h||f)&&(r.source!==t.source||IC(r)!==IC(t)))return!1;var d=AC(r),g=AC(t);if(d!==g||(d||g)&&kC(r)!==kC(t)||e.strict&&Q_&&Q_(r)!==Q_(t))return!1;var p=DC(r),m=DC(t);if(p!==m)return!1;if(p||m){if(r.length!==t.length)return!1;for(i=0;i<r.length;i++)if(r[i]!==t[i])return!1;return!0}var y=XC(r),E=XC(t);if(y!==E)return!1;if(y||E){if(r.length!==t.length)return!1;for(i=0;i<r.length;i++)if(r[i]!==t[i])return!1;return!0}var _=bC(r),v=bC(t);if(_!==v)return!1;if(_||v)return BC(r)!==BC(t)?!1:typeof Uint8Array=="function"&&Xi(new Uint8Array(r),new Uint8Array(t),e,n);var x=MC(r),w=MC(t);if(x!==w)return!1;if(x||w)return GC(r)!==GC(t)?!1:typeof Uint8Array=="function"&&Xi(new Uint8Array(r),new Uint8Array(t),e,n);if(typeof r!=typeof t)return!1;var I=NC(r),C=NC(t);if(I.length!==C.length)return!1;for(I.sort(),C.sort(),i=I.length-1;i>=0;i--)if(I[i]!=C[i])return!1;for(i=I.length-1;i>=0;i--)if(o=I[i],!Xi(r[o],t[o],e,n))return!1;var T=FC(r),R=FC(t);return T!==R?!1:T==="Set"||R==="Set"?d4(r,t,e,n):T==="Map"?g4(r,t,e,n):!0}var m4=function(t,e,n){return Xi(t,e,n,c4())};Object.defineProperty(Yt,"__esModule",{value:!0});function y4(r){return r&&r.__esModule?r:{default:r}}var _4=Object.defineProperty,re=(r,t)=>_4(r,"name",{value:t,configurable:!0}),v4=m4,E4=y4(v4),HC=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,n,i;this.precision=10**-((e=t==null?void 0:t.precision)!=null?e:17),this.direction=(n=t==null?void 0:t.direction)!=null?n:!1,this.compareProperties=(i=t==null?void 0:t.compareProperties)!=null?i:!0}compare(t,e){if(t.type!==e.type||!gh(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){const n=tv(t),i=tv(e);return n.every(o=>i.some(a=>this.compare(o,a)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((n,i)=>Math.abs(n-e[i])<this.precision)}compareLine(t,e,n=0,i=!1){if(!gh(t,e))return!1;const o=t;let a=e;if(i&&!this.compareCoord(o[0],a[0])){const u=this.fixStartIndex(a,o);if(u)a=u;else return!1}const l=this.compareCoord(o[n],a[n]);return this.direction||l?this.comparePath(o,a):this.compareCoord(o[n],a[a.length-(1+n)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(t,e){let n,i=-1;for(let o=0;o<t.length;o++)if(this.compareCoord(t[o],e[0])){i=o;break}return i>=0&&(n=[].concat(t.slice(i,t.length),t.slice(1,i+1))),n}comparePath(t,e){return t.every((n,i)=>this.compareCoord(n,e[i]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){const n=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length);return n.every(o=>i.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(t,e){return gh(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((n,i)=>this.compare(n,e.geometries[i]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?E4.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return gh(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((n,i)=>this.compare(n,e.features[i]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}};re(HC,"GeojsonEquality");var x4=HC;function gh(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}re(gh,"sameLength");function tv(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}re(tv,"explode");var Rr=63710088e-1,ev={centimeters:Rr*100,centimetres:Rr*100,degrees:360/(2*Math.PI),feet:Rr*3.28084,inches:Rr*39.37,kilometers:Rr/1e3,kilometres:Rr/1e3,meters:Rr,metres:Rr,miles:Rr/1609.344,millimeters:Rr*1e3,millimetres:Rr*1e3,nauticalmiles:Rr/1852,radians:1,yards:Rr*1.0936},nv={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function po(r,t,e={}){const n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}re(po,"feature");function qC(r,t,e={}){switch(r){case"Point":return cg(t).geometry;case"LineString":return fg(t).geometry;case"Polygon":return hg(t).geometry;case"MultiPoint":return iv(t).geometry;case"MultiLineString":return rv(t).geometry;case"MultiPolygon":return sv(t).geometry;default:throw new Error(r+" is invalid")}}re(qC,"geometry");function cg(r,t,e={}){if(!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!mh(r[0])||!mh(r[1]))throw new Error("coordinates must contain numbers");return po({type:"Point",coordinates:r},t,e)}re(cg,"point");function ZC(r,t,e={}){return ph(r.map(n=>cg(n,t)),e)}re(ZC,"points");function hg(r,t,e={}){for(const i of r){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return po({type:"Polygon",coordinates:r},t,e)}re(hg,"polygon");function KC(r,t,e={}){return ph(r.map(n=>hg(n,t)),e)}re(KC,"polygons");function fg(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return po({type:"LineString",coordinates:r},t,e)}re(fg,"lineString");function JC(r,t,e={}){return ph(r.map(n=>fg(n,t)),e)}re(JC,"lineStrings");function ph(r,t={}){const e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}re(ph,"featureCollection");function rv(r,t,e={}){return po({type:"MultiLineString",coordinates:r},t,e)}re(rv,"multiLineString");function iv(r,t,e={}){return po({type:"MultiPoint",coordinates:r},t,e)}re(iv,"multiPoint");function sv(r,t,e={}){return po({type:"MultiPolygon",coordinates:r},t,e)}re(sv,"multiPolygon");function QC(r,t,e={}){return po({type:"GeometryCollection",geometries:r},t,e)}re(QC,"geometryCollection");function $C(r,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");const e=Math.pow(10,t||0);return Math.round(r*e)/e}re($C,"round");function ov(r,t="kilometers"){const e=ev[t];if(!e)throw new Error(t+" units is invalid");return r*e}re(ov,"radiansToLength");function dg(r,t="kilometers"){const e=ev[t];if(!e)throw new Error(t+" units is invalid");return r/e}re(dg,"lengthToRadians");function tI(r,t){return av(dg(r,t))}re(tI,"lengthToDegrees");function eI(r){let t=r%360;return t<0&&(t+=360),t}re(eI,"bearingToAzimuth");function av(r){return r%(2*Math.PI)*180/Math.PI}re(av,"radiansToDegrees");function nI(r){return r%360*Math.PI/180}re(nI,"degreesToRadians");function rI(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return ov(dg(r,t),e)}re(rI,"convertLength");function iI(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");const n=nv[t];if(!n)throw new Error("invalid original units");const i=nv[e];if(!i)throw new Error("invalid final units");return r/n*i}re(iI,"convertArea");function mh(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}re(mh,"isNumber");function sI(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}re(sI,"isObject");function oI(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(t=>{if(!mh(t))throw new Error("bbox must only contain numbers")})}re(oI,"validateBBox");function aI(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}re(aI,"validateId"),Yt.GeojsonEquality=x4,Yt.areaFactors=nv,Yt.bearingToAzimuth=eI,Yt.convertArea=iI,Yt.convertLength=rI,Yt.degreesToRadians=nI,Yt.earthRadius=Rr,Yt.factors=ev,Yt.feature=po,Yt.featureCollection=ph,Yt.geometry=qC,Yt.geometryCollection=QC,Yt.isNumber=mh,Yt.isObject=sI,Yt.lengthToDegrees=tI,Yt.lengthToRadians=dg,Yt.lineString=fg,Yt.lineStrings=JC,Yt.multiLineString=rv,Yt.multiPoint=iv,Yt.multiPolygon=sv,Yt.point=cg,Yt.points=ZC,Yt.polygon=hg,Yt.polygons=KC,Yt.radiansToDegrees=av,Yt.radiansToLength=ov,Yt.round=$C,Yt.validateBBox=oI,Yt.validateId=aI,Object.defineProperty(cn,"__esModule",{value:!0});var w4=Object.defineProperty,Nn=(r,t)=>w4(r,"name",{value:t,configurable:!0}),Jn=Yt;function Iu(r,t,e){if(r!==null)for(var n,i,o,a,l,u,c,h=0,f=0,d,g=r.type,p=g==="FeatureCollection",m=g==="Feature",y=p?r.features.length:1,E=0;E<y;E++){c=p?r.features[E].geometry:m?r.geometry:r,d=c?c.type==="GeometryCollection":!1,l=d?c.geometries.length:1;for(var _=0;_<l;_++){var v=0,x=0;if(a=d?c.geometries[_]:c,a!==null){u=a.coordinates;var w=a.type;switch(h=e&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(t(u,f,E,v,x)===!1)return!1;f++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,E,v,x)===!1)return!1;f++,w==="MultiPoint"&&v++}w==="LineString"&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(t(u[n][i],f,E,v,x)===!1)return!1;f++}w==="MultiLineString"&&v++,w==="Polygon"&&x++}w==="Polygon"&&v++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(x=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-h;o++){if(t(u[n][i][o],f,E,v,x)===!1)return!1;f++}x++}v++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Iu(a.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}Nn(Iu,"coordEach");function lI(r,t,e,n){var i=e;return Iu(r,function(o,a,l,u,c){a===0&&e===void 0?i=o:i=t(i,o,a,l,u,c)},n),i}Nn(lI,"coordReduce");function lv(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}Nn(lv,"propEach");function uI(r,t,e){var n=e;return lv(r,function(i,o){o===0&&e===void 0?n=i:n=t(n,i,o)}),n}Nn(uI,"propReduce");function uv(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}Nn(uv,"featureEach");function cI(r,t,e){var n=e;return uv(r,function(i,o){o===0&&e===void 0?n=i:n=t(n,i,o)}),n}Nn(cI,"featureReduce");function hI(r){var t=[];return Iu(r,function(e){t.push(e)}),t}Nn(hI,"coordAll");function gg(r,t){var e,n,i,o,a,l,u,c,h,f,d=0,g=r.type==="FeatureCollection",p=r.type==="Feature",m=g?r.features.length:1;for(e=0;e<m;e++){for(l=g?r.features[e].geometry:p?r.geometry:r,c=g?r.features[e].properties:p?r.properties:{},h=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=l?l.type==="GeometryCollection":!1,a=u?l.geometries.length:1,i=0;i<a;i++){if(o=u?l.geometries[i]:l,o===null){if(t(null,d,c,h,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,d,c,h,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],d,c,h,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}Nn(gg,"geomEach");function fI(r,t,e){var n=e;return gg(r,function(i,o,a,l,u){o===0&&e===void 0?n=i:n=t(n,i,o,a,l,u)}),n}Nn(fI,"geomReduce");function yh(r,t){gg(r,function(e,n,i,o,a){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(Jn.feature.call(void 0,e,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var u;switch(l){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var c=0;c<e.coordinates.length;c++){var h=e.coordinates[c],f={type:u,coordinates:h};if(t(Jn.feature.call(void 0,f,i),n,c)===!1)return!1}})}Nn(yh,"flattenEach");function dI(r,t,e){var n=e;return yh(r,function(i,o,a){o===0&&a===0&&e===void 0?n=i:n=t(n,i,o,a)}),n}Nn(dI,"flattenReduce");function cv(r,t){yh(r,function(e,n,i){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,u=0,c=0,h=0;if(Iu(e,function(f,d,g,p,m){if(l===void 0||n>u||p>c||m>h){l=f,u=n,c=p,h=m,o=0;return}var y=Jn.lineString.call(void 0,[l,f],e.properties);if(t(y,n,i,m,o)===!1)return!1;o++,l=f})===!1)return!1}}})}Nn(cv,"segmentEach");function gI(r,t,e){var n=e,i=!1;return cv(r,function(o,a,l,u,c){i===!1&&e===void 0?n=o:n=t(n,o,a,l,u,c),i=!0}),n}Nn(gI,"segmentReduce");function hv(r,t){if(!r)throw new Error("geojson is required");yh(r,function(e,n,i){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,n,i,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(Jn.lineString.call(void 0,a[l],e.properties),n,i,l)===!1)return!1;break}}})}Nn(hv,"lineEach");function pI(r,t,e){var n=e;return hv(r,function(i,o,a,l){o===0&&e===void 0?n=i:n=t(n,i,o,a,l)}),n}Nn(pI,"lineReduce");function mI(r,t){if(t=t||{},!Jn.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var u=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=u.length+o-1),Jn.lineString.call(void 0,[u[o],u[o+1]],a,t);case"Polygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o-1),Jn.lineString.call(void 0,[u[i][o],u[i][o+1]],a,t);case"MultiLineString":return n<0&&(n=u.length+n),o<0&&(o=u[n].length+o-1),Jn.lineString.call(void 0,[u[n][o],u[n][o+1]],a,t);case"MultiPolygon":return n<0&&(n=u.length+n),i<0&&(i=u[n].length+i),o<0&&(o=u[n][i].length-o-1),Jn.lineString.call(void 0,[u[n][i][o],u[n][i][o+1]],a,t)}throw new Error("geojson is invalid")}Nn(mI,"findSegment");function yI(r,t){if(t=t||{},!Jn.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,l;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,l=r.features[e].geometry;break;case"Feature":a=a||r.properties,l=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=r;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var u=l.coordinates;switch(l.type){case"Point":return Jn.point.call(void 0,u,a,t);case"MultiPoint":return n<0&&(n=u.length+n),Jn.point.call(void 0,u[n],a,t);case"LineString":return o<0&&(o=u.length+o),Jn.point.call(void 0,u[o],a,t);case"Polygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),Jn.point.call(void 0,u[i][o],a,t);case"MultiLineString":return n<0&&(n=u.length+n),o<0&&(o=u[n].length+o),Jn.point.call(void 0,u[n][o],a,t);case"MultiPolygon":return n<0&&(n=u.length+n),i<0&&(i=u[n].length+i),o<0&&(o=u[n][i].length-o),Jn.point.call(void 0,u[n][i][o],a,t)}throw new Error("geojson is invalid")}Nn(yI,"findPoint"),cn.coordAll=hI,cn.coordEach=Iu,cn.coordReduce=lI,cn.featureEach=uv,cn.featureReduce=cI,cn.findPoint=yI,cn.findSegment=mI,cn.flattenEach=yh,cn.flattenReduce=dI,cn.geomEach=gg,cn.geomReduce=fI,cn.lineEach=hv,cn.lineReduce=pI,cn.propEach=lv,cn.propReduce=uI,cn.segmentEach=cv,cn.segmentReduce=gI,Object.defineProperty(Dd,"__esModule",{value:!0});var S4=Object.defineProperty,C4=(r,t)=>S4(r,"name",{value:t,configurable:!0}),I4=cn;function fv(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;const e=[1/0,1/0,-1/0,-1/0];return I4.coordEach.call(void 0,r,n=>{e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}C4(fv,"bbox");var T4=fv;Dd.bbox=fv,Dd.default=T4;var bs=aB,_I=ww,vI=un,Tu=Dd.default,R4=vI.featureEach;vI.coordEach,_I.polygon;var EI=_I.featureCollection;function xI(r){var t=new bs(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Tu(e),bs.prototype.insert.call(this,e)},t.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:Tu(i),n.push(i)}):R4(e,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:Tu(i),n.push(i)}),bs.prototype.load.call(this,n)},t.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Tu(e),bs.prototype.remove.call(this,e,n)},t.clear=function(){return bs.prototype.clear.call(this)},t.search=function(e){var n=bs.prototype.search.call(this,this.toBBox(e));return EI(n)},t.collides=function(e){return bs.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=bs.prototype.all.call(this);return EI(e)},t.toJSON=function(){return bs.prototype.toJSON.call(this)},t.fromJSON=function(e){return bs.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=Tu(e);else if(e.type==="FeatureCollection")n=Tu(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}Ky.exports=xI,Ky.exports.default=xI;var P4=Ky.exports;const dv=vm(P4);function _h(r,t){var e={},n=[];if(r.type==="LineString"&&(r=jr(r)),t.type==="LineString"&&(t=jr(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=wI(r,t);return i&&n.push(i),Pe(n)}var o=dv();return o.load(Zy(t)),Ss(Zy(r),function(a){Ss(o.search(a),function(l){var u=wI(a,l);if(u){var c=Wi(u).join(",");e[c]||(e[c]=!0,n.push(u))}})}),Pe(n)}function wI(r,t){var e=Wi(r),n=Wi(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=e[0][0],o=e[0][1],a=e[1][0],l=e[1][1],u=n[0][0],c=n[0][1],h=n[1][0],f=n[1][1],d=(f-c)*(a-i)-(h-u)*(l-o),g=(h-u)*(o-c)-(f-c)*(i-u),p=(a-i)*(o-c)-(l-o)*(i-u);if(d===0)return null;var m=g/d,y=p/d;if(m>=0&&m<=1&&y>=0&&y<=1){var E=i+m*(a-i),_=o+m*(l-o);return ur([E,_])}return null}function gv(r,t,e){e===void 0&&(e={});var n=ur([1/0,1/0],{dist:1/0}),i=0;return $a(r,function(o){for(var a=Wi(o),l=0;l<a.length-1;l++){var u=ur(a[l]);u.properties.dist=qn(t,u,e);var c=ur(a[l+1]);c.properties.dist=qn(t,c,e);var h=qn(u,c,e),f=Math.max(u.properties.dist,c.properties.dist),d=xw(u,c),g=Ew(t,f,d+90,e),p=Ew(t,f,d-90,e),m=_h(li([g.geometry.coordinates,p.geometry.coordinates]),li([u.geometry.coordinates,c.geometry.coordinates])),y=null;m.features.length>0&&(y=m.features[0],y.properties.dist=qn(t,y,e),y.properties.location=i+qn(u,y,e)),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=l,n.properties.location=i),c.properties.dist<n.properties.dist&&(n=c,n.properties.index=l+1,n.properties.location=i+h),y&&y.properties.dist<n.properties.dist&&(n=y,n.properties.index=l),i+=h}}),n}function b4(r,t,e){var n=Wi(e);if(Hy(e)!=="LineString")throw new Error("line must be a LineString");var i=gv(e,r),o=gv(e,t),a;i.properties.index<=o.properties.index?a=[i,o]:a=[o,i];for(var l=[a[0].geometry.coordinates],u=a[0].properties.index+1;u<a[1].properties.index+1;u++)l.push(n[u]);return l.push(a[1].geometry.coordinates),li(l,e.properties)}function pg(r,t,e){e===void 0&&(e={});for(var n=Is(r),i=Wi(t),o=0;o<i.length-1;o++){var a=!1;if(e.ignoreEndVertices&&(o===0&&(a="start"),o===i.length-2&&(a="end"),o===0&&o+1===i.length-1&&(a="both")),A4(i[o],i[o+1],n,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function A4(r,t,e,n,i){var o=e[0],a=e[1],l=r[0],u=r[1],c=t[0],h=t[1],f=e[0]-l,d=e[1]-u,g=c-l,p=h-u,m=f*p-d*g;if(i!==null){if(Math.abs(m)>i)return!1}else if(m!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(p)?g>0?l<o&&o<=c:c<=o&&o<l:p>0?u<a&&a<=h:h<=a&&a<u;if(n==="end")return Math.abs(g)>=Math.abs(p)?g>0?l<=o&&o<c:c<o&&o<=l:p>0?u<=a&&a<h:h<a&&a<=u;if(n==="both")return Math.abs(g)>=Math.abs(p)?g>0?l<o&&o<c:c<o&&o<l:p>0?u<a&&a<h:h<a&&a<u}else return Math.abs(g)>=Math.abs(p)?g>0?l<=o&&o<=c:c<=o&&o<=l:p>0?u<=a&&a<=h:h<=a&&a<=u;return!1}function L4(r,t){var e=ta(r),n=ta(t),i=e.type,o=n.type;switch(i){case"Point":switch(o){case"MultiPoint":return M4(e,n);case"LineString":return pg(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ci(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":return N4(e,n);case"LineString":return O4(e,n);case"Polygon":case"MultiPolygon":return F4(e,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":return D4(e,n);case"Polygon":case"MultiPolygon":return B4(e,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":return G4(e,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function M4(r,t){var e,n=!1;for(e=0;e<t.coordinates.length;e++)if(CI(t.coordinates[e],r.coordinates)){n=!0;break}return n}function N4(r,t){for(var e=0;e<r.coordinates.length;e++){for(var n=!1,i=0;i<t.coordinates.length;i++)CI(r.coordinates[e],t.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function O4(r,t){for(var e=!1,n=0;n<r.coordinates.length;n++){if(!pg(r.coordinates[n],t))return!1;e||(e=pg(r.coordinates[n],t,{ignoreEndVertices:!0}))}return e}function F4(r,t){for(var e=!0,n=!1,i=0;i<r.coordinates.length;i++){if(n=ci(r.coordinates[1],t),!n){e=!1;break}n=ci(r.coordinates[1],t,{ignoreBoundary:!0})}return e&&n}function D4(r,t){for(var e=0;e<r.coordinates.length;e++)if(!pg(r.coordinates[e],t))return!1;return!0}function B4(r,t){var e=Cs(t),n=Cs(r);if(!SI(e,n))return!1;for(var i=!1,o=0;o<r.coordinates.length-1;o++){if(!ci(r.coordinates[o],t))return!1;if(i||(i=ci(r.coordinates[o],t,{ignoreBoundary:!0})),!i){var a=k4(r.coordinates[o],r.coordinates[o+1]);i=ci(a,t,{ignoreBoundary:!0})}}return i}function G4(r,t){var e=Cs(r),n=Cs(t);if(!SI(n,e))return!1;for(var i=0;i<r.coordinates[0].length;i++)if(!ci(r.coordinates[0][i],t))return!1;return!0}function SI(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function CI(r,t){return r[0]===t[0]&&r[1]===t[1]}function k4(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}function z4(r,t,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],i=r[0],o=r[1],a=r[2],l=r[3],u=t/qn([i,o],[a,o],e),c=u*(a-i),h=t/qn([i,o],[i,l],e),f=h*(l-o),d=a-i,g=l-o,p=Math.floor(d/c),m=Math.floor(g/f),y=(d-p*c)/2,E=(g-m*f)/2,_=i+y;_<=a;){for(var v=o+E;v<=l;){var x=ur([_,v],e.properties);e.mask?L4(x,e.mask)&&n.push(x):n.push(x),v+=f}_+=c}return Pe(n)}function U4(r,t){t===void 0&&(t={});var e=t.precision,n=t.coordinates,i=t.mutate;if(e=e==null||isNaN(e)?6:e,n=n==null||isNaN(n)?3:n,!r)throw new Error("<geojson> is required");if(typeof e!="number")throw new Error("<precision> must be a number");if(typeof n!="number")throw new Error("<coordinates> must be a number");(i===!1||i===void 0)&&(r=JSON.parse(JSON.stringify(r)));var o=Math.pow(10,e);return Od(r,function(a){V4(a,o,n)}),r}function V4(r,t,e){r.length>e&&r.splice(e,r.length);for(var n=0;n<r.length;n++)r[n]=Math.round(r[n]*t)/t;return r}function j4(r,t){if(!r)throw new Error("line is required");if(!t)throw new Error("splitter is required");var e=Hy(r),n=Hy(t);if(e!=="LineString")throw new Error("line must be LineString");if(n==="FeatureCollection")throw new Error("splitter cannot be a FeatureCollection");if(n==="GeometryCollection")throw new Error("splitter cannot be a GeometryCollection");var i=U4(t,{precision:7});switch(n){case"Point":return pv(r,i);case"MultiPoint":return II(r,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return II(r,_h(r,i))}}function II(r,t){var e=[],n=dv();return $a(t,function(i){if(e.forEach(function(l,u){l.id=u}),!e.length)e=pv(r,i).features,e.forEach(function(l){l.bbox||(l.bbox=dB(Cs(l)))}),n.load(Pe(e));else{var o=n.search(i);if(o.features.length){var a=TI(i,o);e=e.filter(function(l){return l.id!==a.id}),n.remove(a),Ss(pv(a,i),function(l){e.push(l),n.insert(l)})}}}),Pe(e)}function pv(r,t){var e=[],n=Wi(r)[0],i=Wi(r)[r.geometry.coordinates.length-1];if(mv(n,Is(t))||mv(i,Is(t)))return Pe([r]);var o=dv(),a=Zy(r);o.load(a);var l=o.search(t);if(!l.features.length)return Pe([r]);var u=TI(t,l),c=[n],h=sB(a,function(f,d,g){var p=Wi(d)[1],m=Is(t);return g===u.id?(f.push(m),e.push(li(f)),mv(m,p)?[m]:[m,p]):(f.push(p),f)},c);return h.length>1&&e.push(li(h)),Pe(e)}function TI(r,t){if(!t.features.length)throw new Error("lines must contain features");if(t.features.length===1)return t.features[0];var e,n=1/0;return Ss(t,function(i){var o=gv(i,r),a=o.properties.dist;a<n&&(e=i,n=a)}),e}function mv(r,t){return r[0]===t[0]&&r[1]===t[1]}function yv(r,t){t===void 0&&(t={});var e=ta(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return W4(e,t);case"MultiPolygon":return Y4(e,t);default:throw new Error("invalid poly")}}function W4(r,t){t===void 0&&(t={});var e=ta(r),n=e.coordinates,i=t.properties?t.properties:r.type==="Feature"?r.properties:{};return RI(n,i)}function Y4(r,t){t===void 0&&(t={});var e=ta(r),n=e.coordinates,i=t.properties?t.properties:r.type==="Feature"?r.properties:{},o=[];return n.forEach(function(a){o.push(RI(a,i))}),Pe(o)}function RI(r,t){return r.length>1?Wy(r,t):li(r[0],t)}function X4(r,t){var e=!0;return $a(r,function(n){$a(t,function(i){if(e===!1)return!1;e=H4(n.geometry,i.geometry)})}),e}function H4(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!J4(r.coordinates,t.coordinates);case"LineString":return!PI(t,r);case"Polygon":return!ci(r,t)}break;case"LineString":switch(t.type){case"Point":return!PI(r,t);case"LineString":return!q4(r,t);case"Polygon":return!bI(t,r)}break;case"Polygon":switch(t.type){case"Point":return!ci(t,r);case"LineString":return!bI(r,t);case"Polygon":return!Z4(t,r)}}return!1}function PI(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(K4(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}function q4(r,t){var e=_h(r,t);return e.features.length>0}function bI(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){var i=n[e];if(ci(i,r))return!0}var o=_h(t,yv(r));return o.features.length>0}function Z4(r,t){for(var e=0,n=r.coordinates[0];e<n.length;e++){var i=n[e];if(ci(i,t))return!0}for(var o=0,a=t.coordinates[0];o<a.length;o++){var l=a[o];if(ci(l,r))return!0}var u=_h(yv(r),yv(t));return u.features.length>0}function K4(r,t,e){var n=e[0]-r[0],i=e[1]-r[1],o=t[0]-r[0],a=t[1]-r[1],l=n*a-i*o;return l!==0?!1:Math.abs(o)>=Math.abs(a)?o>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:a>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}function J4(r,t){return r[0]===t[0]&&r[1]===t[1]}function Q4(r,t){var e=!1;return $a(r,function(n){$a(t,function(i){if(e===!0)return!0;e=!X4(n.geometry,i.geometry)})}),e}globalThis&&globalThis.__spreadArrays;function $4(r){return Array.isArray(r)?MI(r):r&&r.bbox?MI(r.bbox):[tz(),ez()]}function AI(r,t){t===void 0&&(t={}),r==null&&(r=1);for(var e=[],n=0;n<r;n++)e.push(ur($4(t.bbox)));return Pe(e)}function LI(){return Math.random()-.5}function tz(){return LI()*360}function ez(){return LI()*180}function MI(r){return[Math.random()*(r[2]-r[0])+r[0],Math.random()*(r[3]-r[1])+r[1]]}/**
456
+ * splaytree v3.1.2
457
+ * Fast Splay tree for Node and browser
458
+ *
459
+ * @author Alexander Milevski <info@w8r.name>
460
+ * @license MIT
461
+ * @preserve
462
+ *//*! *****************************************************************************
463
+ Copyright (c) Microsoft Corporation. All rights reserved.
464
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
465
+ this file except in compliance with the License. You may obtain a copy of the
466
+ License at http://www.apache.org/licenses/LICENSE-2.0
467
+
468
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
469
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
470
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
471
+ MERCHANTABLITY OR NON-INFRINGEMENT.
472
+
473
+ See the Apache Version 2.0 License for specific language governing permissions
474
+ and limitations under the License.
475
+ ***************************************************************************** */function nz(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(c){return function(h){return u([c,h])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1],o=c;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(c);break}o[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(r,e)}catch(h){c=[6,h],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var sa=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function rz(r,t){return r>t?1:r<t?-1:0}function oa(r,t,e){for(var n=new sa(null,null),i=n,o=n;;){var a=e(r,t.key);if(a<0){if(t.left===null)break;if(e(r,t.left.key)<0){var l=t.left;if(t.left=l.right,l.right=t,t=l,t.left===null)break}o.left=t,o=t,t=t.left}else if(a>0){if(t.right===null)break;if(e(r,t.right.key)>0){var l=t.right;if(t.right=l.left,l.left=t,t=l,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function _v(r,t,e,n){var i=new sa(r,t);if(e===null)return i.left=i.right=null,i;e=oa(r,e,n);var o=n(r,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function NI(r,t,e){var n=null,i=null;if(t){t=oa(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function iz(r,t,e){return t===null?r:(r===null||(t=oa(r.key,t,e),t.left=r),t)}function vv(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
476
+ `);var o=t+(e?" ":"│ ");r.left&&vv(r.left,o,!1,n,i),r.right&&vv(r.right,o,!0,n,i)}}var Ev=function(){function r(t){t===void 0&&(t=rz),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=_v(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new sa(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=oa(t,this._root,i),a=i(t,o.key);return a===0?this._root=o:(a<0?(n.left=o.left,n.right=o,o.left=null):a>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=oa(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=oa(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=oa(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=oa(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],a=this._comparator,l=this._root,u;o.length!==0||l;)if(l)o.push(l),l=l.left;else{if(l=o.pop(),u=a(l.key,e),u>0)break;if(a(l.key,t)>=0&&n.call(i,l))return this;l=l.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return oz(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&Sv(t,e,0,i-1,o),this._root===null)this._root=xv(t,e,0,i),this._size=i;else{var a=az(this.toList(),sz(t,e),o);i=this._size+i,this._root=wv({head:a},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return vv(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=NI(t,this._root,i),a=o.left,l=o.right;i(t,e)<0?l=_v(e,n,l,i):a=_v(e,n,a,i),this._root=iz(a,l,i)},r.prototype.split=function(t){return NI(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return nz(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function xv(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),a=r[o],l=t[o],u=new sa(a,l);return u.left=xv(r,t,e,o),u.right=xv(r,t,o+1,n),u}return null}function sz(r,t){for(var e=new sa(null,null),n=e,i=0;i<r.length;i++)n=n.next=new sa(r[i],t[i]);return n.next=null,e.next}function oz(r){for(var t=r,e=[],n=!1,i=new sa(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function wv(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=wv(r,t,i),a=r.head;return a.left=o,r.head=r.head.next,a.right=wv(r,i+1,e),a}return null}function az(r,t,e){for(var n=new sa(null,null),i=n,o=r,a=t;o!==null&&a!==null;)e(o.key,a.key)<0?(i.next=o,o=o.next):(i.next=a,a=a.next),i=i.next;return o!==null?i.next=o:a!==null&&(i.next=a),n.next}function Sv(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],a=e-1,l=n+1;;){do a++;while(i(r[a],o)<0);do l--;while(i(r[l],o)>0);if(a>=l)break;var u=r[a];r[a]=r[l],r[l]=u,u=t[a],t[a]=t[l],t[l]=u}Sv(r,t,e,l,i),Sv(r,t,l+1,n,i)}}const mo=11102230246251565e-32,Qn=134217729,lz=(3+8*mo)*mo;function Cv(r,t,e,n,i){let o,a,l,u,c=t[0],h=n[0],f=0,d=0;h>c==h>-c?(o=c,c=t[++f]):(o=h,h=n[++d]);let g=0;if(f<r&&d<e)for(h>c==h>-c?(a=c+o,l=o-(a-c),c=t[++f]):(a=h+o,l=o-(a-h),h=n[++d]),o=a,l!==0&&(i[g++]=l);f<r&&d<e;)h>c==h>-c?(a=o+c,u=a-o,l=o-(a-u)+(c-u),c=t[++f]):(a=o+h,u=a-o,l=o-(a-u)+(h-u),h=n[++d]),o=a,l!==0&&(i[g++]=l);for(;f<r;)a=o+c,u=a-o,l=o-(a-u)+(c-u),c=t[++f],o=a,l!==0&&(i[g++]=l);for(;d<e;)a=o+h,u=a-o,l=o-(a-u)+(h-u),h=n[++d],o=a,l!==0&&(i[g++]=l);return(o!==0||g===0)&&(i[g++]=o),g}function uz(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function vh(r){return new Float64Array(r)}const cz=(3+16*mo)*mo,hz=(2+12*mo)*mo,fz=(9+64*mo)*mo*mo,Ru=vh(4),OI=vh(8),FI=vh(12),DI=vh(16),cr=vh(4);function dz(r,t,e,n,i,o,a){let l,u,c,h,f,d,g,p,m,y,E,_,v,x,w,I,C,T;const R=r-i,M=e-i,P=t-o,b=n-o;x=R*b,d=Qn*R,g=d-(d-R),p=R-g,d=Qn*b,m=d-(d-b),y=b-m,w=p*y-(x-g*m-p*m-g*y),I=P*M,d=Qn*P,g=d-(d-P),p=P-g,d=Qn*M,m=d-(d-M),y=M-m,C=p*y-(I-g*m-p*m-g*y),E=w-C,f=w-E,Ru[0]=w-(E+f)+(f-C),_=x+E,f=_-x,v=x-(_-f)+(E-f),E=v-I,f=v-E,Ru[1]=v-(E+f)+(f-I),T=_+E,f=T-_,Ru[2]=_-(T-f)+(E-f),Ru[3]=T;let A=uz(4,Ru),L=hz*a;if(A>=L||-A>=L||(f=r-R,l=r-(R+f)+(f-i),f=e-M,c=e-(M+f)+(f-i),f=t-P,u=t-(P+f)+(f-o),f=n-b,h=n-(b+f)+(f-o),l===0&&u===0&&c===0&&h===0)||(L=fz*a+lz*Math.abs(A),A+=R*h+b*l-(P*c+M*u),A>=L||-A>=L))return A;x=l*b,d=Qn*l,g=d-(d-l),p=l-g,d=Qn*b,m=d-(d-b),y=b-m,w=p*y-(x-g*m-p*m-g*y),I=u*M,d=Qn*u,g=d-(d-u),p=u-g,d=Qn*M,m=d-(d-M),y=M-m,C=p*y-(I-g*m-p*m-g*y),E=w-C,f=w-E,cr[0]=w-(E+f)+(f-C),_=x+E,f=_-x,v=x-(_-f)+(E-f),E=v-I,f=v-E,cr[1]=v-(E+f)+(f-I),T=_+E,f=T-_,cr[2]=_-(T-f)+(E-f),cr[3]=T;const B=Cv(4,Ru,4,cr,OI);x=R*h,d=Qn*R,g=d-(d-R),p=R-g,d=Qn*h,m=d-(d-h),y=h-m,w=p*y-(x-g*m-p*m-g*y),I=P*c,d=Qn*P,g=d-(d-P),p=P-g,d=Qn*c,m=d-(d-c),y=c-m,C=p*y-(I-g*m-p*m-g*y),E=w-C,f=w-E,cr[0]=w-(E+f)+(f-C),_=x+E,f=_-x,v=x-(_-f)+(E-f),E=v-I,f=v-E,cr[1]=v-(E+f)+(f-I),T=_+E,f=T-_,cr[2]=_-(T-f)+(E-f),cr[3]=T;const F=Cv(B,OI,4,cr,FI);x=l*h,d=Qn*l,g=d-(d-l),p=l-g,d=Qn*h,m=d-(d-h),y=h-m,w=p*y-(x-g*m-p*m-g*y),I=u*c,d=Qn*u,g=d-(d-u),p=u-g,d=Qn*c,m=d-(d-c),y=c-m,C=p*y-(I-g*m-p*m-g*y),E=w-C,f=w-E,cr[0]=w-(E+f)+(f-C),_=x+E,f=_-x,v=x-(_-f)+(E-f),E=v-I,f=v-E,cr[1]=v-(E+f)+(f-I),T=_+E,f=T-_,cr[2]=_-(T-f)+(E-f),cr[3]=T;const V=Cv(F,FI,4,cr,DI);return DI[V-1]}function gz(r,t,e,n,i,o){const a=(t-o)*(e-i),l=(r-i)*(n-o),u=a-l,c=Math.abs(a+l);return Math.abs(u)>=cz*c?u:-dz(r,t,e,n,i,o,c)}const Eh=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,Iv=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,o=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:o}}};let aa=Number.EPSILON;aa===void 0&&(aa=Math.pow(2,-52));const pz=aa*aa,BI=(r,t)=>{if(-aa<r&&r<aa&&-aa<t&&t<aa)return 0;const e=r-t;return e*e<pz*r*t?0:r<t?-1:1};class mz{constructor(){this.reset()}reset(){this.xRounder=new GI,this.yRounder=new GI}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class GI{constructor(){this.tree=new Ev,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&BI(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&BI(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const xh=new mz,mg=(r,t)=>r.x*t.y-r.y*t.x,kI=(r,t)=>r.x*t.x+r.y*t.y,zI=(r,t,e)=>{const n=gz(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},yg=r=>Math.sqrt(kI(r,r)),yz=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return mg(i,n)/yg(i)/yg(n)},_z=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return kI(i,n)/yg(i)/yg(n)},UI=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},VI=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},vz=(r,t,e,n)=>{if(t.x===0)return VI(e,n,r.x);if(n.x===0)return VI(r,t,e.x);if(t.y===0)return UI(e,n,r.y);if(n.y===0)return UI(r,t,e.y);const i=mg(t,n);if(i==0)return null;const o={x:e.x-r.x,y:e.y-r.y},a=mg(o,t)/i,l=mg(o,n)/i,u=r.x+l*t.x,c=e.x+a*n.x,h=r.y+l*t.y,f=e.y+a*n.y,d=(u+c)/2,g=(h+f)/2;return{x:d,y:g}};class fi{static compare(t,e){const n=fi.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:la.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,i=e.length;n<i;n++){const o=e[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const o=i.otherSE;e.set(i,{sine:yz(this.point,t.point,o.point),cosine:_z(this.point,t.point,o.point)})};return(i,o)=>{e.has(i)||n(i),e.has(o)||n(o);const{sine:a,cosine:l}=e.get(i),{sine:u,cosine:c}=e.get(o);return a>=0&&u>=0?l<c?1:l>c?-1:0:a<0&&u<0?l<c?-1:l>c?1:0:u<a?-1:u>a?1:0}}}let Ez=0;class la{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,o=t.rightSE.point.x,a=e.rightSE.point.x;if(a<n)return 1;if(o<i)return-1;const l=t.leftSE.point.y,u=e.leftSE.point.y,c=t.rightSE.point.y,h=e.rightSE.point.y;if(n<i){if(u<l&&u<c)return 1;if(u>l&&u>c)return-1;const f=t.comparePoint(e.leftSE.point);if(f<0)return 1;if(f>0)return-1;const d=e.comparePoint(t.rightSE.point);return d!==0?d:-1}if(n>i){if(l<u&&l<h)return-1;if(l>u&&l>h)return 1;const f=e.comparePoint(t.leftSE.point);if(f!==0)return f;const d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(l<u)return-1;if(l>u)return 1;if(o<a){const f=e.comparePoint(t.rightSE.point);if(f!==0)return f}if(o>a){const f=t.comparePoint(e.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(o!==a){const f=c-l,d=o-n,g=h-u,p=a-i;if(f>d&&g<p)return 1;if(f<d&&g>p)return-1}return o>a?1:o<a||c<h?-1:c>h?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++Ez,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,o,a;const l=fi.comparePoints(t,e);if(l<0)i=t,o=e,a=1;else if(l>0)i=e,o=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const u=new fi(i,!0),c=new fi(o,!1);return new la(u,c,[n],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const o=(t.y-e.y)/i.y,a=e.x+o*i.x;if(t.x===a)return 0;const l=(t.x-e.x)/i.x,u=e.y+l*i.y;return t.y===u?0:t.y<u?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=Iv(e,n);if(i===null)return null;const o=this.leftSE.point,a=this.rightSE.point,l=t.leftSE.point,u=t.rightSE.point,c=Eh(e,l)&&this.comparePoint(l)===0,h=Eh(n,o)&&t.comparePoint(o)===0,f=Eh(e,u)&&this.comparePoint(u)===0,d=Eh(n,a)&&t.comparePoint(a)===0;if(h&&c)return d&&!f?a:!d&&f?u:null;if(h)return f&&o.x===u.x&&o.y===u.y?null:o;if(c)return d&&a.x===l.x&&a.y===l.y?null:l;if(d&&f)return null;if(d)return a;if(f)return u;const g=vz(o,this.vector(),l,t.vector());return g===null||!Eh(i,g)?null:xh.round(g.x,g.y)}split(t){const e=[],n=t.events!==void 0,i=new fi(t,!0),o=new fi(t,!1),a=this.rightSE;this.replaceRightSE(o),e.push(o),e.push(i);const l=new la(i,a,this.rings.slice(),this.windings.slice());return fi.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),fi.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=la.compare(e,n);if(i!==0){if(i>0){const o=e;e=n,n=o}if(e.prev===n){const o=e;e=n,n=o}for(let o=0,a=n.rings.length;o<a;o++){const l=n.rings[o],u=n.windings[o],c=e.rings.indexOf(l);c===-1?(e.rings.push(l),e.windings.push(u)):e.windings[c]+=u}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let l=0,u=this.rings.length;l<u;l++){const c=this.rings[l],h=this.windings[l],f=e.indexOf(c);f===-1?(e.push(c),n.push(h)):n[f]+=h}const o=[],a=[];for(let l=0,u=e.length;l<u;l++){if(n[l]===0)continue;const c=e[l],h=c.poly;if(a.indexOf(h)===-1)if(c.isExterior)o.push(h);else{a.indexOf(h)===-1&&a.push(h);const f=o.indexOf(c.poly);f!==-1&&o.splice(f,1)}}for(let l=0,u=o.length;l<u;l++){const c=o[l].multiPoly;i.indexOf(c)===-1&&i.push(c)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Hi.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===Hi.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Hi.type}`)}return this._isInResult}}class jI{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=xh.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let a=1,l=t.length;a<l;a++){if(typeof t[a][0]!="number"||typeof t[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let u=xh.round(t[a][0],t[a][1]);u.x===o.x&&u.y===o.y||(this.segments.push(la.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(la.fromRing(o,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class xz{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new jI(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=t.length;n<i;n++){const o=new jI(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let o=0,a=i.length;o<a;o++)t.push(i[o])}return t}}class WI{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const o=new xz(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let o=0,a=i.length;o<a;o++)t.push(i[o])}return t}}class _g{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.isInResult()||o.ringOut)continue;let a=null,l=o.leftSE,u=o.rightSE;const c=[l],h=l.point,f=[];for(;a=l,l=u,c.push(l),l.point!==h;)for(;;){const d=l.getAvailableLinkedEvents();if(d.length===0){const m=c[0].point,y=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${m.x}, ${m.y}]. Last matching segment found ends at [${y.x}, ${y.y}].`)}if(d.length===1){u=d[0].otherSE;break}let g=null;for(let m=0,y=f.length;m<y;m++)if(f[m].point===l.point){g=m;break}if(g!==null){const m=f.splice(g)[0],y=c.splice(m.index);y.unshift(y[0].otherSE),e.push(new _g(y.reverse()));continue}f.push({index:c.length,point:l.point});const p=l.getLeftmostComparator(a);u=d.sort(p)[0].otherSE;break}e.push(new _g(c))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let c=1,h=this.events.length-1;c<h;c++){const f=this.events[c].point,d=this.events[c+1].point;zI(f,t,d)!==0&&(e.push(f),t=f)}if(e.length===1)return null;const n=e[0],i=e[1];zI(n,t,i)===0&&e.shift(),e.push(e[0]);const o=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,u=[];for(let c=a;c!=l;c+=o)u.push([e[c].x,e[c].y]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const a=this.events[i];fi.compare(t,a)>0&&(t=a)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class YI{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class wz{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.poly)if(o.isExteriorRing())e.push(new YI(o));else{const a=o.enclosingRing();a.poly||e.push(new YI(a)),a.poly.addInterior(o)}}return e}}class Sz{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:la.compare;this.queue=t,this.tree=new Ev(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let o=i,a=i,l,u;for(;l===void 0;)o=this.tree.prev(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);for(;u===void 0;)a=this.tree.next(a),a===null?u=null:a.key.consumedBy===void 0&&(u=a.key);if(t.isLeft){let c=null;if(l){const f=l.getIntersection(e);if(f!==null&&(e.isAnEndpoint(f)||(c=f),!l.isAnEndpoint(f))){const d=this._splitSafely(l,f);for(let g=0,p=d.length;g<p;g++)n.push(d[g])}}let h=null;if(u){const f=u.getIntersection(e);if(f!==null&&(e.isAnEndpoint(f)||(h=f),!u.isAnEndpoint(f))){const d=this._splitSafely(u,f);for(let g=0,p=d.length;g<p;g++)n.push(d[g])}}if(c!==null||h!==null){let f=null;c===null?f=h:h===null?f=c:f=fi.comparePoints(c,h)<=0?c:h,this.queue.remove(e.rightSE),n.push(e.rightSE);const d=e.split(f);for(let g=0,p=d.length;g<p;g++)n.push(d[g])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=l)}else{if(l&&u){const c=l.getIntersection(u);if(c!==null){if(!l.isAnEndpoint(c)){const h=this._splitSafely(l,c);for(let f=0,d=h.length;f<d;f++)n.push(h[f])}if(!u.isAnEndpoint(c)){const h=this._splitSafely(u,c);for(let f=0,d=h.length;f<d;f++)n.push(h[f])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const XI=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Cz=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Iz{run(t,e,n){Hi.type=t,xh.reset();const i=[new WI(e,!0)];for(let f=0,d=n.length;f<d;f++)i.push(new WI(n[f],!1));if(Hi.numMultiPolys=i.length,Hi.type==="difference"){const f=i[0];let d=1;for(;d<i.length;)Iv(i[d].bbox,f.bbox)!==null?d++:i.splice(d,1)}if(Hi.type==="intersection")for(let f=0,d=i.length;f<d;f++){const g=i[f];for(let p=f+1,m=i.length;p<m;p++)if(Iv(g.bbox,i[p].bbox)===null)return[]}const o=new Ev(fi.compare);for(let f=0,d=i.length;f<d;f++){const g=i[f].getSweepEvents();for(let p=0,m=g.length;p<m;p++)if(o.insert(g[p]),o.size>XI)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new Sz(o);let l=o.size,u=o.pop();for(;u;){const f=u.key;if(o.size===l){const g=f.segment;throw new Error(`Unable to pop() ${f.isLeft?"left":"right"} SweepEvent [${f.point.x}, ${f.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(o.size>XI)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>Cz)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const d=a.process(f);for(let g=0,p=d.length;g<p;g++){const m=d[g];m.consumedBy===void 0&&o.insert(m)}l=o.size,u=o.pop()}xh.reset();const c=_g.factory(a.segments);return new wz(c).getGeom()}}const Hi=new Iz;var Tz={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Hi.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Hi.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Hi.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Hi.run("difference",r,e)}};"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(o=o<0?Math.max(n+arguments[2],0):Math.min(o,n);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var il=function(){};il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il},il.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var se=function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),ut=function(){},HI={MAX_VALUE:{configurable:!0}};ut.isNaN=function(t){return Number.isNaN(t)},ut.doubleToLongBits=function(t){return t},ut.longBitsToDouble=function(t){return t},ut.isInfinite=function(t){return!Number.isFinite(t)},HI.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(ut,HI);var Pr=function(){},vg=function(){},Pu=function(){};function br(){}var N=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},sl={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};N.prototype.setOrdinate=function(t,e){switch(t){case N.X:this.x=e;break;case N.Y:this.y=e;break;case N.Z:this.z=e;break;default:throw new se("Invalid ordinate index: "+t)}},N.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!il.equalsWithTolerance(this.x,e.x,n)||!il.equalsWithTolerance(this.y,e.y,n))}},N.prototype.getOrdinate=function(t){switch(t){case N.X:return this.x;case N.Y:return this.y;case N.Z:return this.z}throw new se("Invalid ordinate index: "+t)},N.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||ut.isNaN(this.z))&&ut.isNaN(t.z)},N.prototype.equals=function(t){return t instanceof N?this.equals2D(t):!1},N.prototype.equalInZ=function(t,e){return il.equalsWithTolerance(this.z,t.z,e)},N.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},N.prototype.clone=function(){},N.prototype.copy=function(){return new N(this)},N.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},N.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},N.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},N.prototype.hashCode=function(){var t=17;return t=37*t+N.hashCode(this.x),t=37*t+N.hashCode(this.y),t},N.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},N.prototype.interfaces_=function(){return[Pr,vg,br]},N.prototype.getClass=function(){return N},N.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=ut.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},sl.DimensionalComparator.get=function(){return yo},sl.serialVersionUID.get=function(){return 6683108902428367e3},sl.NULL_ORDINATE.get=function(){return ut.NaN},sl.X.get=function(){return 0},sl.Y.get=function(){return 1},sl.Z.get=function(){return 2},Object.defineProperties(N,sl);var yo=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new se("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};yo.prototype.compare=function(t,e){var n=t,i=e,o=yo.compare(n.x,i.x);if(o!==0)return o;var a=yo.compare(n.y,i.y);if(a!==0)return a;if(this._dimensionsToTest<=2)return 0;var l=yo.compare(n.z,i.z);return l},yo.prototype.interfaces_=function(){return[Pu]},yo.prototype.getClass=function(){return yo},yo.compare=function(t,e){return t<e?-1:t>e?1:ut.isNaN(t)?ut.isNaN(e)?0:-1:ut.isNaN(e)?1:0};var bu=function(){};bu.prototype.create=function(){},bu.prototype.interfaces_=function(){return[]},bu.prototype.getClass=function(){return bu};var O=function(){},wh={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new se("Unknown location value: "+t)},wh.INTERIOR.get=function(){return 0},wh.BOUNDARY.get=function(){return 1},wh.EXTERIOR.get=function(){return 2},wh.NONE.get=function(){return-1},Object.defineProperties(O,wh);var it=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},hr=function(){},qI={LOG_10:{configurable:!0}};hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr},hr.log10=function(t){var e=Math.log(t);return ut.isInfinite(e)||ut.isNaN(e)?e:e/hr.LOG_10},hr.min=function(t,e,n,i){var o=t;return e<o&&(o=e),n<o&&(o=n),i<o&&(o=i),o},hr.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],a=arguments[2];return i<o?o:i>a?a:i}},hr.wrap=function(t,e){return t<0?e- -t%e:t%e},hr.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3],c=o;return a>c&&(c=a),l>c&&(c=l),u>c&&(c=u),c}},hr.average=function(t,e){return(t+e)/2},qI.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(hr,qI);var di=function(t){this.str=t};di.prototype.append=function(t){this.str+=t},di.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},di.prototype.toString=function(t){return this.str};var gi=function(t){this.value=t};gi.prototype.intValue=function(){return this.value},gi.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},gi.isNaN=function(t){return Number.isNaN(t)};var Sh=function(){};Sh.isWhitespace=function(t){return t<=32&&t>=0||t===127},Sh.toUpperCase=function(t){return t.toUpperCase()};var D=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},Wr={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};D.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},D.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=D.magnitude(n._hi),o=D.TEN.pow(i);n=n.divide(o),n.gt(D.TEN)?(n=n.divide(D.TEN),i+=1):n.lt(D.ONE)&&(n=n.multiply(D.TEN),i-=1);for(var a=i+1,l=new di,u=D.MAX_PRINT_DIGITS-1,c=0;c<=u;c++){t&&c===a&&l.append(".");var h=Math.trunc(n._hi);if(h<0)break;var f=!1,d=0;h>9?(f=!0,d="9"):d="0"+h,l.append(d),n=n.subtract(D.valueOf(h)).multiply(D.TEN),f&&n.selfAdd(D.TEN);var g=!0,p=D.magnitude(n._hi);if(p<0&&Math.abs(p)>=u-c&&(g=!1),!g)break}return e[0]=i,l.toString()},D.prototype.sqr=function(){return this.multiply(this)},D.prototype.doubleValue=function(){return this._hi+this._lo},D.prototype.subtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},D.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},D.prototype.isZero=function(){return this._hi===0&&this._lo===0},D.prototype.selfSubtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},D.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},D.prototype.min=function(t){return this.le(t)?this:t},D.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,a=null,l=null,u=null,c=null,h=null,f=null,d=null;return c=this._hi/n,h=D.SPLIT*c,o=h-c,d=D.SPLIT*n,o=h-o,a=c-o,l=d-n,f=c*n,l=d-l,u=n-l,d=o*l-f+o*u+a*l+a*u,h=(this._hi-f-d+this._lo-c*i)/n,d=c+h,this._hi=d,this._lo=c-d+h,this}},D.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},D.prototype.divide=function(){if(arguments[0]instanceof D){var t=arguments[0],e=null,n=null,i=null,o=null,a=null,l=null,u=null,c=null;a=this._hi/t._hi,l=D.SPLIT*a,e=l-a,c=D.SPLIT*t._hi,e=l-e,n=a-e,i=c-t._hi,u=a*t._hi,i=c-i,o=t._hi-i,c=e*i-u+e*o+n*i+n*o,l=(this._hi-u-c+this._lo-a*t._lo)/t._hi,c=a+l;var h=c,f=a-c+l;return new D(h,f)}else if(typeof arguments[0]=="number"){var d=arguments[0];return ut.isNaN(d)?D.createNaN():D.copy(this).selfDivide(d,0)}},D.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},D.prototype.pow=function(t){if(t===0)return D.valueOf(1);var e=new D(this),n=D.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},D.prototype.ceil=function(){if(this.isNaN())return D.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new D(t,e)},D.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},D.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},D.prototype.setValue=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},D.prototype.max=function(t){return this.ge(t)?this:t},D.prototype.sqrt=function(){if(this.isZero())return D.valueOf(0);if(this.isNegative())return D.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=D.valueOf(e),i=this.subtract(n.sqr()),o=i._hi*(t*.5);return n.add(o)},D.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,o=null,a=null,l=null,u=null;return o=this._hi+e,l=o-this._hi,a=o-l,a=e-l+(this._hi-a),u=a+this._lo,n=o+u,i=u+(o-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var c=arguments[0],h=arguments[1],f=null,d=null,g=null,p=null,m=null,y=null,E=null,_=null;m=this._hi+c,g=this._lo+h,E=m-this._hi,_=g-this._lo,y=m-E,p=g-_,y=c-E+(this._hi-y),p=h-_+(this._lo-p),E=y+g,f=m+E,d=E+(m-f),E=p+d;var v=f+E,x=E+(f-v);return this._hi=v,this._lo=x,this}},D.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,a=null,l=null,u=null,c=null,h=null;c=D.SPLIT*this._hi,o=c-this._hi,h=D.SPLIT*n,o=c-o,a=this._hi-o,l=h-n,c=this._hi*n,l=h-l,u=n-l,h=o*l-c+o*u+a*l+a*u+(this._hi*i+this._lo*n);var f=c+h;o=c-f;var d=h+o;return this._hi=f,this._lo=d,this}},D.prototype.selfSqr=function(){return this.selfMultiply(this)},D.prototype.floor=function(){if(this.isNaN())return D.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new D(t,e)},D.prototype.negate=function(){return this.isNaN()?this:new D(-this._hi,-this._lo)},D.prototype.clone=function(){},D.prototype.multiply=function(){if(arguments[0]instanceof D){var t=arguments[0];return t.isNaN()?D.createNaN():D.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return ut.isNaN(e)?D.createNaN():D.copy(this).selfMultiply(e,0)}},D.prototype.isNaN=function(){return ut.isNaN(this._hi)},D.prototype.intValue=function(){return Math.trunc(this._hi)},D.prototype.toString=function(){var t=D.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},D.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,o=n;if(n.charAt(0)===".")o="0"+n;else if(i<0)o="0."+D.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var a=i-n.length,l=D.stringOfChar("0",a);o=n+l+".0"}return this.isNegative()?"-"+o:o},D.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,o=null,a=null,l=null,u=null;o=1/this._hi,a=D.SPLIT*o,t=a-o,u=D.SPLIT*this._hi,t=a-t,e=o-t,n=u-this._hi,l=o*this._hi,n=u-n,i=this._hi-n,u=t*n-l+t*i+e*n+e*i,a=(1-l-u-o*this._lo)/this._hi;var c=o+a,h=o-c+a;return new D(c,h)},D.prototype.toSciNotation=function(){if(this.isZero())return D.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=D.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var o="";n.length>1&&(o=n.substring(1));var a=n.charAt(0)+"."+o;return this.isNegative()?"-"+a+i:a+i},D.prototype.abs=function(){return this.isNaN()?D.NaN:this.isNegative()?this.negate():new D(this)},D.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},D.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},D.prototype.add=function(){if(arguments[0]instanceof D){var t=arguments[0];return D.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return D.copy(this).selfAdd(e)}},D.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof D){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},D.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},D.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},D.prototype.trunc=function(){return this.isNaN()?D.NaN:this.isPositive()?this.floor():this.ceil()},D.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},D.prototype.interfaces_=function(){return[br,Pr,vg]},D.prototype.getClass=function(){return D},D.sqr=function(t){return D.valueOf(t).selfMultiply(t)},D.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return D.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new D(e)}},D.sqrt=function(t){return D.valueOf(t).sqrt()},D.parse=function(t){for(var e=0,n=t.length;Sh.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var a=new D,l=0,u=0,c=0;!(e>=n);){var h=t.charAt(e);if(e++,Sh.isDigit(h)){var f=h-"0";a.selfMultiply(D.TEN),a.selfAdd(f),l++;continue}if(h==="."){u=l;continue}if(h==="e"||h==="E"){var d=t.substring(e);try{c=gi.parseInt(d)}catch(E){throw E instanceof Error?new Error("Invalid exponent "+d+" in string "+t):E}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+e+" in string "+t)}var g=a,p=l-u-c;if(p===0)g=a;else if(p>0){var m=D.TEN.pow(p);g=a.divide(m)}else if(p<0){var y=D.TEN.pow(-p);g=a.multiply(y)}return i?g.negate():g},D.createNaN=function(){return new D(ut.NaN,ut.NaN)},D.copy=function(t){return new D(t)},D.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},D.stringOfChar=function(t,e){for(var n=new di,i=0;i<e;i++)n.append(t);return n.toString()},Wr.PI.get=function(){return new D(3.141592653589793,12246467991473532e-32)},Wr.TWO_PI.get=function(){return new D(6.283185307179586,24492935982947064e-32)},Wr.PI_2.get=function(){return new D(1.5707963267948966,6123233995736766e-32)},Wr.E.get=function(){return new D(2.718281828459045,14456468917292502e-32)},Wr.NaN.get=function(){return new D(ut.NaN,ut.NaN)},Wr.EPS.get=function(){return 123259516440783e-46},Wr.SPLIT.get=function(){return 134217729},Wr.MAX_PRINT_DIGITS.get=function(){return 32},Wr.TEN.get=function(){return D.valueOf(10)},Wr.ONE.get=function(){return D.valueOf(1)},Wr.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Wr.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(D,Wr);var On=function(){},ZI={DP_SAFE_EPSILON:{configurable:!0}};On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},On.orientationIndex=function(t,e,n){var i=On.orientationIndexFilter(t,e,n);if(i<=1)return i;var o=D.valueOf(e.x).selfAdd(-t.x),a=D.valueOf(e.y).selfAdd(-t.y),l=D.valueOf(n.x).selfAdd(-e.x),u=D.valueOf(n.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(a.selfMultiply(l)).signum()},On.signOfDet2x2=function(t,e,n,i){var o=t.multiply(i).selfSubtract(e.multiply(n));return o.signum()},On.intersection=function(t,e,n,i){var o=D.valueOf(i.y).selfSubtract(n.y).selfMultiply(D.valueOf(e.x).selfSubtract(t.x)),a=D.valueOf(i.x).selfSubtract(n.x).selfMultiply(D.valueOf(e.y).selfSubtract(t.y)),l=o.subtract(a),u=D.valueOf(i.x).selfSubtract(n.x).selfMultiply(D.valueOf(t.y).selfSubtract(n.y)),c=D.valueOf(i.y).selfSubtract(n.y).selfMultiply(D.valueOf(t.x).selfSubtract(n.x)),h=u.subtract(c),f=h.selfDivide(l).doubleValue(),d=D.valueOf(t.x).selfAdd(D.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=D.valueOf(e.x).selfSubtract(t.x).selfMultiply(D.valueOf(t.y).selfSubtract(n.y)),p=D.valueOf(e.y).selfSubtract(t.y).selfMultiply(D.valueOf(t.x).selfSubtract(n.x)),m=g.subtract(p),y=m.selfDivide(l).doubleValue(),E=D.valueOf(n.y).selfAdd(D.valueOf(i.y).selfSubtract(n.y).selfMultiply(y)).doubleValue();return new N(d,E)},On.orientationIndexFilter=function(t,e,n){var i=null,o=(t.x-n.x)*(e.y-n.y),a=(t.y-n.y)*(e.x-n.x),l=o-a;if(o>0){if(a<=0)return On.signum(l);i=o+a}else if(o<0){if(a>=0)return On.signum(l);i=-o-a}else return On.signum(l);var u=On.DP_SAFE_EPSILON*i;return l>=u||-l>=u?On.signum(l):2},On.signum=function(t){return t>0?1:t<0?-1:0},ZI.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(On,ZI);var Rt=function(){},Ch={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ch.X.get=function(){return 0},Ch.Y.get=function(){return 1},Ch.Z.get=function(){return 2},Ch.M.get=function(){return 3},Rt.prototype.setOrdinate=function(t,e,n){},Rt.prototype.size=function(){},Rt.prototype.getOrdinate=function(t,e){},Rt.prototype.getCoordinate=function(){},Rt.prototype.getCoordinateCopy=function(t){},Rt.prototype.getDimension=function(){},Rt.prototype.getX=function(t){},Rt.prototype.clone=function(){},Rt.prototype.expandEnvelope=function(t){},Rt.prototype.copy=function(){},Rt.prototype.getY=function(t){},Rt.prototype.toCoordinateArray=function(){},Rt.prototype.interfaces_=function(){return[vg]},Rt.prototype.getClass=function(){return Rt},Object.defineProperties(Rt,Ch);var KI=function(){},Au=function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(KI),$e=function(){};$e.arraycopy=function(t,e,n,i,o){for(var a=0,l=e;l<e+o;l++)n[i+a]=t[l],a++},$e.getProperty=function(t){return{"line.separator":`
477
+ `}[t]};var Yr=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof N&&arguments[1]instanceof N){var a=arguments[0],l=arguments[1];this.x=a.y-l.y,this.y=l.x-a.x,this.w=a.x*l.y-l.x*a.y}}else if(arguments.length===3){var u=arguments[0],c=arguments[1],h=arguments[2];this.x=u,this.y=c,this.w=h}else if(arguments.length===4){var f=arguments[0],d=arguments[1],g=arguments[2],p=arguments[3],m=f.y-d.y,y=d.x-f.x,E=f.x*d.y-d.x*f.y,_=g.y-p.y,v=p.x-g.x,x=g.x*p.y-p.x*g.y;this.x=y*x-v*E,this.y=_*E-m*x,this.w=m*v-_*y}};Yr.prototype.getY=function(){var t=this.y/this.w;if(ut.isNaN(t)||ut.isInfinite(t))throw new Au;return t},Yr.prototype.getX=function(){var t=this.x/this.w;if(ut.isNaN(t)||ut.isInfinite(t))throw new Au;return t},Yr.prototype.getCoordinate=function(){var t=new N;return t.x=this.getX(),t.y=this.getY(),t},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.intersection=function(t,e,n,i){var o=t.y-e.y,a=e.x-t.x,l=t.x*e.y-e.x*t.y,u=n.y-i.y,c=i.x-n.x,h=n.x*i.y-i.x*n.y,f=a*h-c*l,d=u*l-o*h,g=o*c-u*a,p=f/g,m=d/g;if(ut.isNaN(p)||ut.isInfinite(p)||ut.isNaN(m)||ut.isInfinite(m))throw new Au;return new N(p,m)};var K=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3];this.init(o,a,l,u)}},JI={serialVersionUID:{configurable:!0}};K.prototype.getArea=function(){return this.getWidth()*this.getHeight()},K.prototype.equals=function(t){if(!(t instanceof K))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},K.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new K;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new K(e,i,n,o)},K.prototype.isNull=function(){return this._maxx<this._minx},K.prototype.getMaxX=function(){return this._maxx},K.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof K){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},K.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof K){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof N){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},K.prototype.getMinY=function(){return this._miny},K.prototype.getMinX=function(){return this._minx},K.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof K){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},K.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},K.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},K.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},K.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},K.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},K.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},K.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},K.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},K.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},K.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof K){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof N){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},K.prototype.centre=function(){return this.isNull()?null:new N((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},K.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof K){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3];o<a?(this._minx=o,this._maxx=a):(this._minx=a,this._maxx=o),l<u?(this._miny=l,this._maxy=u):(this._miny=u,this._maxy=l)}},K.prototype.getMaxY=function(){return this._maxy},K.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},K.prototype.hashCode=function(){var t=17;return t=37*t+N.hashCode(this._minx),t=37*t+N.hashCode(this._maxx),t=37*t+N.hashCode(this._miny),t=37*t+N.hashCode(this._maxy),t},K.prototype.interfaces_=function(){return[Pr,br]},K.prototype.getClass=function(){return K},K.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=Math.min(a.x,l.x),c=Math.max(a.x,l.x),h=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(h>c||f<u||(u=Math.min(a.y,l.y),c=Math.max(a.y,l.y),h=Math.min(i.y,o.y),f=Math.max(i.y,o.y),h>c)||f<u)}},JI.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(K,JI);var pi={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Eg=function(t){this.geometryFactory=t||new vt};Eg.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var o=pi.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=pi.emptyTypeStr.exec(t),o[2]=void 0),o&&(n=o[1].toLowerCase(),i=o[2],Lu[n]&&(e=Lu[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Eg.prototype.write=function(t){return this.extractGeometry(t)},Eg.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!As[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+As[e].apply(this,[t])+")",i};var As={coordinate:function(t){return t.x+" "+t.y},point:function(t){return As.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+As.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(As.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(As.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+As.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+As.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)n.push("("+As.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+As.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},Lu={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(pi.spaces);return this.geometryFactory.createPoint(new N(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),o=[],a=0,l=i.length;a<l;++a)n=i[a].replace(pi.trimParens,"$1"),o.push(Lu.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,o=0,a=e.length;o<a;++o)i=e[o].trim().split(pi.spaces),n.push(new N(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,o=0,a=e.length;o<a;++o)i=e[o].trim().split(pi.spaces),n.push(new N(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(pi.parenComma),o=[],a=0,l=i.length;a<l;++a)n=i[a].replace(pi.trimParens,"$1"),o.push(Lu.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,o,a=t.trim().split(pi.parenComma),l,u=[],c=0,h=a.length;c<h;++c)n=a[c].replace(pi.trimParens,"$1"),i=Lu.linestring.apply(e,[n]),o=e.geometryFactory.createLinearRing(i._points),c===0?l=o:u.push(o);return this.geometryFactory.createPolygon(l,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(pi.doubleParenComma),o=[],a=0,l=i.length;a<l;++a)n=i[a].replace(pi.trimParens,"$1"),o.push(Lu.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],o=0,a=n.length;o<a;++o)i.push(e.read(n[o]));return this.geometryFactory.createGeometryCollection(i)}},Xr=function(t){this.parser=new Eg(t)};Xr.prototype.write=function(t){return this.parser.write(t)},Xr.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Ls=function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),xg=function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ls),ft=function(){};ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.shouldNeverReachHere=function(){if(arguments.length===0)ft.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new xg("Should never reach here"+(t!==null?": "+t:""))}},ft.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],ft.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new xg:new xg(e)},ft.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],ft.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new xg("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var ae=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new N,this._intPt[1]=new N,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},al={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ae.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ae.prototype.getTopologySummary=function(){var t=new di;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ae.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},ae.prototype.getIntersectionNum=function(){return this._result},ae.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ae.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ae.prototype.setPrecisionModel=function(t){this._precisionModel=t},ae.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},ae.prototype.getIntersection=function(t){return this._intPt[t]},ae.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ae.prototype.hasIntersection=function(){return this._result!==ae.NO_INTERSECTION},ae.prototype.getEdgeDistance=function(t,e){var n=ae.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},ae.prototype.isCollinear=function(){return this._result===ae.COLLINEAR_INTERSECTION},ae.prototype.toString=function(){return Xr.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Xr.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ae.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ae.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},ae.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),o=Math.abs(n.y-e.y),a=-1;if(t.equals(e))a=0;else if(t.equals(n))i>o?a=i:a=o;else{var l=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?a=l:a=u,a===0&&!t.equals(e)&&(a=Math.max(l,u))}return ft.isTrue(!(a===0&&!t.equals(e)),"Bad distance calculation"),a},ae.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,a=Math.sqrt(i*i+o*o);return ft.isTrue(!(a===0&&!t.equals(e)),"Invalid distance calculation"),a},al.DONT_INTERSECT.get=function(){return 0},al.DO_INTERSECT.get=function(){return 1},al.COLLINEAR.get=function(){return 2},al.NO_INTERSECTION.get=function(){return 0},al.POINT_INTERSECTION.get=function(){return 1},al.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ae,al);var ua=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new K(this._inputLines[0][0],this._inputLines[0][1]),o=new K(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&o.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,K.intersects(i,o,n)&&W.orientationIndex(i,o,n)===0&&W.orientationIndex(o,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(o))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,o,a,l){l.x=this.smallestInAbsValue(n.x,i.x,o.x,a.x),l.y=this.smallestInAbsValue(n.y,i.y,o.y,a.y),n.x-=l.x,n.y-=l.y,i.x-=l.x,i.y-=l.y,o.x-=l.x,o.y-=l.y,a.x-=l.x,a.y-=l.y},t.prototype.safeHCoordinateIntersection=function(n,i,o,a){var l=null;try{l=Yr.intersection(n,i,o,a)}catch(u){if(u instanceof Au)l=t.nearestEndpoint(n,i,o,a);else throw u}finally{}return l},t.prototype.intersection=function(n,i,o,a){var l=this.intersectionWithNormalization(n,i,o,a);return this.isInSegmentEnvelopes(l)||(l=new N(t.nearestEndpoint(n,i,o,a))),this._precisionModel!==null&&this._precisionModel.makePrecise(l),l},t.prototype.smallestInAbsValue=function(n,i,o,a){var l=n,u=Math.abs(l);return Math.abs(i)<u&&(l=i,u=Math.abs(i)),Math.abs(o)<u&&(l=o,u=Math.abs(o)),Math.abs(a)<u&&(l=a),l},t.prototype.checkDD=function(n,i,o,a,l){var u=On.intersection(n,i,o,a),c=this.isInSegmentEnvelopes(u);$e.out.println("DD in env = "+c+" --------------------- "+u),l.distance(u)>1e-4&&$e.out.println("Distance = "+l.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,o,a){var l=new N(n),u=new N(i),c=new N(o),h=new N(a),f=new N;this.normalizeToEnvCentre(l,u,c,h,f);var d=this.safeHCoordinateIntersection(l,u,c,h);return d.x+=f.x,d.y+=f.y,d},t.prototype.computeCollinearIntersection=function(n,i,o,a){var l=K.intersects(n,i,o),u=K.intersects(n,i,a),c=K.intersects(o,a,n),h=K.intersects(o,a,i);return l&&u?(this._intPt[0]=o,this._intPt[1]=a,r.COLLINEAR_INTERSECTION):c&&h?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!u&&!h?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=a,this._intPt[1]=n,a.equals(n)&&!l&&!h?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=a,this._intPt[1]=i,a.equals(i)&&!l&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,o,a,l){var u=n.x<i.x?n.x:i.x,c=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,d=o.x<a.x?o.x:a.x,g=o.y<a.y?o.y:a.y,p=o.x>a.x?o.x:a.x,m=o.y>a.y?o.y:a.y,y=u>d?u:d,E=h<p?h:p,_=c>g?c:g,v=f<m?f:m,x=(y+E)/2,w=(_+v)/2;l.x=x,l.y=w,n.x-=l.x,n.y-=l.y,i.x-=l.x,i.y-=l.y,o.x-=l.x,o.y-=l.y,a.x-=l.x,a.y-=l.y},t.prototype.computeIntersect=function(n,i,o,a){if(this._isProper=!1,!K.intersects(n,i,o,a))return r.NO_INTERSECTION;var l=W.orientationIndex(n,i,o),u=W.orientationIndex(n,i,a);if(l>0&&u>0||l<0&&u<0)return r.NO_INTERSECTION;var c=W.orientationIndex(o,a,n),h=W.orientationIndex(o,a,i);if(c>0&&h>0||c<0&&h<0)return r.NO_INTERSECTION;var f=l===0&&u===0&&c===0&&h===0;return f?this.computeCollinearIntersection(n,i,o,a):(l===0||u===0||c===0||h===0?(this._isProper=!1,n.equals2D(o)||n.equals2D(a)?this._intPt[0]=n:i.equals2D(o)||i.equals2D(a)?this._intPt[0]=i:l===0?this._intPt[0]=new N(o):u===0?this._intPt[0]=new N(a):c===0?this._intPt[0]=new N(n):h===0&&(this._intPt[0]=new N(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,o,a)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,o,a){var l=n,u=W.distancePointLine(n,o,a),c=W.distancePointLine(i,o,a);return c<u&&(u=c,l=i),c=W.distancePointLine(o,n,i),c<u&&(u=c,l=o),c=W.distancePointLine(a,n,i),c<u&&(u=c,l=a),l},t}(ae),ll=function(){};ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll},ll.orientationIndex=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,a=n.x-e.x,l=n.y-e.y;return ll.signOfDet2x2(i,o,a,l)},ll.signOfDet2x2=function(t,e,n,i){var o=null,a=null,l=null;if(o=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-o:o:n>0?o:-o;if(e===0||n===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,a=t,t=n,n=a,a=e,e=i,i=a):e<=-i?(o=-o,n=-n,i=-i):(a=t,t=-n,n=a,a=e,e=-i,i=a):i>0?-e<=i?(o=-o,t=-t,e=-e):(a=-t,t=n,n=a,a=-e,e=i,i=a):e>=i?(t=-t,e=-e,n=-n,i=-i):(o=-o,a=-t,t=-n,n=a,a=-e,e=-i,i=a),t>0)if(n>0){if(!(t<=n))return o}else return o;else{if(n>0)return-o;if(t>=n)o=-o,t=-t,n=-n;else return-o}for(;;){if(l=Math.floor(n/t),n=n-l*t,i=i-l*e,i<0)return-o;if(i>e)return o;if(t>n+n){if(e<i+i)return o}else{if(e>i+i)return-o;n=t-n,i=e-i,o=-o}if(i===0)return n===0?0:-o;if(n===0||(l=Math.floor(t/n),t=t-l*n,e=e-l*i,e<0))return o;if(e>i)return-o;if(n>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=n-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var mi=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};mi.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,a=t.y-this._p.y,l=e.x-this._p.x,u=e.y-this._p.y,c=ll.signOfDet2x2(o,a,l,u);if(c===0)return this._isPointOnSegment=!0,null;u<a&&(c=-c),c>0&&this._crossingCount++}},mi.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},mi.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2===1?O.INTERIOR:O.EXTERIOR},mi.prototype.isOnSegment=function(){return this._isPointOnSegment},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},mi.locatePointInRing=function(){if(arguments[0]instanceof N&&it(arguments[1],Rt)){for(var t=arguments[0],e=arguments[1],n=new mi(t),i=new N,o=new N,a=1;a<e.size();a++)if(e.getCoordinate(a,i),e.getCoordinate(a-1,o),n.countSegment(i,o),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof N&&arguments[1]instanceof Array){for(var l=arguments[0],u=arguments[1],c=new mi(l),h=1;h<u.length;h++){var f=u[h],d=u[h-1];if(c.countSegment(f,d),c.isOnSegment())return c.getLocation()}return c.getLocation()}};var W=function(){},ul={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W},W.orientationIndex=function(t,e,n){return On.orientationIndex(t,e,n)},W.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-n,a=t[i+1].y,l=t[i-1].y;e+=o*(l-a)}return e/2}else if(it(arguments[0],Rt)){var u=arguments[0],c=u.size();if(c<3)return 0;var h=new N,f=new N,d=new N;u.getCoordinate(0,f),u.getCoordinate(1,d);var g=f.x;d.x-=g;for(var p=0,m=1;m<c-1;m++)h.y=f.y,f.x=d.x,f.y=d.y,u.getCoordinate(m+1,d),d.x-=g,p+=f.x*(h.y-d.y);return p/2}},W.distanceLineLine=function(t,e,n,i){if(t.equals(e))return W.distancePointLine(t,n,i);if(n.equals(i))return W.distancePointLine(i,t,e);var o=!1;if(!K.intersects(t,e,n,i))o=!0;else{var a=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(a===0)o=!0;else{var l=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),c=u/a,h=l/a;(h<0||h>1||c<0||c>1)&&(o=!0)}}return o?hr.min(W.distancePointLine(t,n,i),W.distancePointLine(e,n,i),W.distancePointLine(n,t,e),W.distancePointLine(i,t,e)):0},W.isPointInRing=function(t,e){return W.locatePointInRing(t,e)!==O.EXTERIOR},W.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new N;t.getCoordinate(0,i);for(var o=i.x,a=i.y,l=1;l<e;l++){t.getCoordinate(l,i);var u=i.x,c=i.y,h=u-o,f=c-a;n+=Math.sqrt(h*h+f*f),o=u,a=c}return n},W.isCCW=function(t){var e=t.length-1;if(e<3)throw new se("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,o=1;o<=e;o++){var a=t[o];a.y>n.y&&(n=a,i=o)}var l=i;do l=l-1,l<0&&(l=e);while(t[l].equals2D(n)&&l!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var c=t[l],h=t[u];if(c.equals2D(n)||h.equals2D(n)||c.equals2D(h))return!1;var f=W.computeOrientation(c,n,h),d=!1;return f===0?d=c.x>h.x:d=f>0,d},W.locatePointInRing=function(t,e){return mi.locatePointInRing(t,e)},W.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},W.computeOrientation=function(t,e,n){return W.orientationIndex(t,e,n)},W.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new se("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=W.distancePointLine(t,e[i],e[i+1]);o<n&&(n=o)}return n}else if(arguments.length===3){var a=arguments[0],l=arguments[1],u=arguments[2];if(l.x===u.x&&l.y===u.y)return a.distance(l);var c=(u.x-l.x)*(u.x-l.x)+(u.y-l.y)*(u.y-l.y),h=((a.x-l.x)*(u.x-l.x)+(a.y-l.y)*(u.y-l.y))/c;if(h<=0)return a.distance(l);if(h>=1)return a.distance(u);var f=((l.y-a.y)*(u.x-l.x)-(l.x-a.x)*(u.y-l.y))/c;return Math.abs(f)*Math.sqrt(c)}},W.isOnLine=function(t,e){for(var n=new ua,i=1;i<e.length;i++){var o=e[i-1],a=e[i];if(n.computeIntersection(t,o,a),n.hasIntersection())return!0}return!1},ul.CLOCKWISE.get=function(){return-1},ul.RIGHT.get=function(){return W.CLOCKWISE},ul.COUNTERCLOCKWISE.get=function(){return 1},ul.LEFT.get=function(){return W.COUNTERCLOCKWISE},ul.COLLINEAR.get=function(){return 0},ul.STRAIGHT.get=function(){return W.COLLINEAR},Object.defineProperties(W,ul);var Ms=function(){};Ms.prototype.filter=function(t){},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms};var nt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},qi={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};nt.prototype.isGeometryCollection=function(){return this.getSortIndex()===nt.SORTINDEX_GEOMETRYCOLLECTION},nt.prototype.getFactory=function(){return this._factory},nt.prototype.getGeometryN=function(t){return this},nt.prototype.getArea=function(){return 0},nt.prototype.isRectangle=function(){return!1},nt.prototype.equals=function(){if(arguments[0]instanceof nt){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof nt))return!1;var n=e;return this.equalsExact(n)}},nt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},nt.prototype.geometryChanged=function(){this.apply(nt.geometryChangedFilter)},nt.prototype.geometryChangedAction=function(){this._envelope=null},nt.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},nt.prototype.getLength=function(){return 0},nt.prototype.getNumGeometries=function(){return 1},nt.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},nt.prototype.getUserData=function(){return this._userData},nt.prototype.getSRID=function(){return this._SRID},nt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},nt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===nt.SORTINDEX_GEOMETRYCOLLECTION)throw new se("This method does not support GeometryCollection arguments")},nt.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},nt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},nt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},nt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new K(this._envelope)},nt.prototype.setSRID=function(t){this._SRID=t},nt.prototype.setUserData=function(t){this._userData=t},nt.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var o=n.next(),a=i.next(),l=o.compareTo(a);if(l!==0)return l}return n.hasNext()?1:i.hasNext()?-1:0},nt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},nt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===nt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===nt.SORTINDEX_MULTIPOINT||this.getSortIndex()===nt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===nt.SORTINDEX_MULTIPOLYGON},nt.prototype.interfaces_=function(){return[vg,Pr,br]},nt.prototype.getClass=function(){return nt},nt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},nt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},qi.serialVersionUID.get=function(){return 8763622679187377e3},qi.SORTINDEX_POINT.get=function(){return 0},qi.SORTINDEX_MULTIPOINT.get=function(){return 1},qi.SORTINDEX_LINESTRING.get=function(){return 2},qi.SORTINDEX_LINEARRING.get=function(){return 3},qi.SORTINDEX_MULTILINESTRING.get=function(){return 4},qi.SORTINDEX_POLYGON.get=function(){return 5},qi.SORTINDEX_MULTIPOLYGON.get=function(){return 6},qi.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},qi.geometryChangedFilter.get=function(){return Tv},Object.defineProperties(nt,qi);var Tv=function(){};Tv.interfaces_=function(){return[Ms]},Tv.filter=function(t){t.geometryChangedAction()};var Zi=function(){};Zi.prototype.filter=function(t){},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi};var Ar=function(){},Ns={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Ar.prototype.isInBoundary=function(t){},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ns.Mod2BoundaryNodeRule.get=function(){return Mu},Ns.EndPointBoundaryNodeRule.get=function(){return Nu},Ns.MultiValentEndPointBoundaryNodeRule.get=function(){return Ou},Ns.MonoValentEndPointBoundaryNodeRule.get=function(){return Fu},Ns.MOD2_BOUNDARY_RULE.get=function(){return new Mu},Ns.ENDPOINT_BOUNDARY_RULE.get=function(){return new Nu},Ns.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ou},Ns.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Fu},Ns.OGC_SFS_BOUNDARY_RULE.get=function(){return Ar.MOD2_BOUNDARY_RULE},Object.defineProperties(Ar,Ns);var Mu=function(){};Mu.prototype.isInBoundary=function(t){return t%2===1},Mu.prototype.interfaces_=function(){return[Ar]},Mu.prototype.getClass=function(){return Mu};var Nu=function(){};Nu.prototype.isInBoundary=function(t){return t>0},Nu.prototype.interfaces_=function(){return[Ar]},Nu.prototype.getClass=function(){return Nu};var Ou=function(){};Ou.prototype.isInBoundary=function(t){return t>1},Ou.prototype.interfaces_=function(){return[Ar]},Ou.prototype.getClass=function(){return Ou};var Fu=function(){};Fu.prototype.isInBoundary=function(t){return t===1},Fu.prototype.interfaces_=function(){return[Ar]},Fu.prototype.getClass=function(){return Fu};var be=function(){};be.prototype.add=function(){},be.prototype.addAll=function(){},be.prototype.isEmpty=function(){},be.prototype.iterator=function(){},be.prototype.size=function(){},be.prototype.toArray=function(){},be.prototype.remove=function(){};function Rv(r){this.message=r||""}Rv.prototype=new Error,Rv.prototype.name="IndexOutOfBoundsException";var Du=function(){};Du.prototype.hasNext=function(){},Du.prototype.next=function(){},Du.prototype.remove=function(){};var Hr=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(be);function Bu(r){this.message=r||""}Bu.prototype=new Error,Bu.prototype.name="NoSuchElementException";var j=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof be&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,be]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(n,i){var o=this.array_[n];return this.array_[n]=i,o},t.prototype.iterator=function(){return new Rz(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Rv;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],o=0,a=this.array_.length;o<a;o++)i.push(n.array_[o]);return i},t.prototype.remove=function(n){for(var i=this,o=!1,a=0,l=this.array_.length;a<l;a++)if(i.array_[a]===n){i.array_.splice(a,1),o=!0;break}return o},t}(Hr),Rz=function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Bu;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(Du),Ih=function(r){function t(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],a=arguments[1],l=!1,u=o.iterator();u.hasNext();)i.add(u.next(),a),l=!0;return l}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=r.prototype.clone.call(this),a=0;a<this.size();a++)o.add(a,i.get(a).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];r.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var a=arguments[0],l=arguments[1];return this.add(a,l,!0),!0}else if(arguments[0]instanceof N&&typeof arguments[1]=="boolean"){var u=arguments[0],c=arguments[1];if(!c&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],d=arguments[1];return this.add(f,d),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],m=arguments[2];if(m)for(var y=0;y<g.length;y++)i.add(g[y],p);else for(var E=g.length-1;E>=0;E--)i.add(g[E],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof N){var _=arguments[0],v=arguments[1],x=arguments[2];if(!x){var w=this.size();if(w>0){if(_>0){var I=this.get(_-1);if(I.equals2D(v))return null}if(_<w){var C=this.get(_);if(C.equals2D(v))return null}}}r.prototype.add.call(this,_,v)}}else if(arguments.length===4){var T=arguments[0],R=arguments[1],M=arguments[2],P=arguments[3],b=1;M>P&&(b=-1);for(var A=M;A!==P;A+=b)i.add(T[A],R);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new N(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(j),_t=function(){},wg={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};wg.ForwardComparator.get=function(){return Th},wg.BidirectionalComparator.get=function(){return Gu},wg.coordArrayType.get=function(){return new Array(0).fill(null)},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},_t.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(_t.indexOf(i,e)<0)return i}return null},_t.scroll=function(t,e){var n=_t.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);$e.arraycopy(t,n,i,0,t.length-n),$e.arraycopy(t,0,i,t.length-n,n),$e.arraycopy(i,0,t,0,t.length)},_t.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var l=0;l<i.length;l++)if(a.compare(i[l],o[l])!==0)return!1;return!0}},_t.intersection=function(t,e){for(var n=new Ih,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},_t.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},_t.removeRepeatedPoints=function(t){if(!_t.hasRepeatedPoints(t))return t;var e=new Ih(t,!1);return e.toCoordinateArray()},_t.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},_t.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,a=0;a<t.length;a++)t[a]!==null&&(i[o++]=t[a]);return i},_t.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new N(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=arguments[4],c=0;c<u;c++)a[l+c]=new N(i[o+c])},_t.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[t.length-n-1];if(i.compareTo(o)!==0)return!1}return!0},_t.envelope=function(t){for(var e=new K,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},_t.toCoordinateArray=function(t){return t.toArray(_t.coordArrayType)},_t.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},_t.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},_t.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},_t.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},_t.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},_t.extract=function(t,e,n){e=hr.clamp(e,0,t.length),n=hr.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var a=0,l=e;l<=n;l++)o[a++]=t[l];return o},Object.defineProperties(_t,wg);var Th=function(){};Th.prototype.compare=function(t,e){var n=t,i=e;return _t.compare(n,i)},Th.prototype.interfaces_=function(){return[Pu]},Th.prototype.getClass=function(){return Th};var Gu=function(){};Gu.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var o=_t.compare(n,i),a=_t.isEqualReversed(n,i);return a?0:o},Gu.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var o=_t.increasingDirection(n),a=_t.increasingDirection(i),l=o>0?0:n.length-1,u=a>0?0:n.length-1,c=0;c<n.length;c++){var h=n[l].compareTo(i[u]);if(h!==0)return h;l+=o,u+=a}return 0},Gu.prototype.interfaces_=function(){return[Pu]},Gu.prototype.getClass=function(){return Gu};var cl=function(){};cl.prototype.get=function(){},cl.prototype.put=function(){},cl.prototype.size=function(){},cl.prototype.values=function(){},cl.prototype.entrySet=function(){};var Pz=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(cl);function Rh(r){this.message=r||""}Rh.prototype=new Error,Rh.prototype.name="OperationNotSupported";function Sg(){}Sg.prototype=new be,Sg.prototype.contains=function(){};var Pv=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof be&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,o=0,a=this.array_.length;o<a;o++){var l=i.array_[o];if(l===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],o=0,a=this.array_.length;o<a;o++)i.push(n.array_[o]);return i},t.prototype.iterator=function(){return new bz(this)},t}(Sg),bz=function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Bu;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Rh},t}(Du),Os=0,ca=1;function QI(r){return r===null?Os:r.color}function Kt(r){return r===null?null:r.parent}function Fs(r,t){r!==null&&(r.color=t)}function bv(r){return r===null?null:r.left}function $I(r){return r===null?null:r.right}function hn(){this.root_=null,this.size_=0}hn.prototype=new Pz,hn.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},hn.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:Os,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var a={key:r,left:null,right:null,value:t,parent:n,color:Os,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null},hn.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=ca;r!=null&&r!==this.root_&&r.parent.color===ca;)if(Kt(r)===bv(Kt(Kt(r)))){var e=$I(Kt(Kt(r)));QI(e)===ca?(Fs(Kt(r),Os),Fs(e,Os),Fs(Kt(Kt(r)),ca),r=Kt(Kt(r))):(r===$I(Kt(r))&&(r=Kt(r),t.rotateLeft(r)),Fs(Kt(r),Os),Fs(Kt(Kt(r)),ca),t.rotateRight(Kt(Kt(r))))}else{var n=bv(Kt(Kt(r)));QI(n)===ca?(Fs(Kt(r),Os),Fs(n,Os),Fs(Kt(Kt(r)),ca),r=Kt(Kt(r))):(r===bv(Kt(r))&&(r=Kt(r),t.rotateRight(r)),Fs(Kt(r),Os),Fs(Kt(Kt(r)),ca),t.rotateLeft(Kt(Kt(r))))}this.root_.color=Os},hn.prototype.values=function(){var r=new j,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=hn.successor(t))!==null;)r.add(t.value);return r},hn.prototype.entrySet=function(){var r=new Pv,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=hn.successor(t))!==null;)r.add(t);return r},hn.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},hn.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},hn.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},hn.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},hn.prototype.size=function(){return this.size_};var Ph=function(){};Ph.prototype.interfaces_=function(){return[]},Ph.prototype.getClass=function(){return Ph};function tT(){}tT.prototype=new Sg;function yi(){this.array_=[],arguments[0]instanceof be&&this.addAll(arguments[0])}yi.prototype=new tT,yi.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},yi.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},yi.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},yi.prototype.remove=function(r){throw new Rh},yi.prototype.size=function(){return this.array_.length},yi.prototype.isEmpty=function(){return this.array_.length===0},yi.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},yi.prototype.iterator=function(){return new Cg(this)};var Cg=function(r){this.treeSet_=r,this.position_=0};Cg.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Bu;return this.treeSet_.array_[this.position_++]},Cg.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Cg.prototype.remove=function(){throw new Rh};var ha=function(){};ha.sort=function(){var t=arguments[0],e,n,i,o;if(arguments.length===1)o=function(l,u){return l.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(l,u){return i.compare(l,u)},t.sort(o);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var a=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<a.length;e++)t.push(a[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(l,u){return i.compare(l,u)},n.sort(o),a=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<a.length;e++)t.push(a[e])},ha.asList=function(t){for(var e=new j,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var At=function(){},qr={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};qr.P.get=function(){return 0},qr.L.get=function(){return 1},qr.A.get=function(){return 2},qr.FALSE.get=function(){return-1},qr.TRUE.get=function(){return-2},qr.DONTCARE.get=function(){return-3},qr.SYM_FALSE.get=function(){return"F"},qr.SYM_TRUE.get=function(){return"T"},qr.SYM_DONTCARE.get=function(){return"*"},qr.SYM_P.get=function(){return"0"},qr.SYM_L.get=function(){return"1"},qr.SYM_A.get=function(){return"2"},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.toDimensionSymbol=function(t){switch(t){case At.FALSE:return At.SYM_FALSE;case At.TRUE:return At.SYM_TRUE;case At.DONTCARE:return At.SYM_DONTCARE;case At.P:return At.SYM_P;case At.L:return At.SYM_L;case At.A:return At.SYM_A}throw new se("Unknown dimension value: "+t)},At.toDimensionValue=function(t){switch(Sh.toUpperCase(t)){case At.SYM_FALSE:return At.FALSE;case At.SYM_TRUE:return At.TRUE;case At.SYM_DONTCARE:return At.DONTCARE;case At.SYM_P:return At.P;case At.SYM_L:return At.L;case At.SYM_A:return At.A}throw new se("Unknown dimension symbol: "+t)},Object.defineProperties(At,qr);var _i=function(){};_i.prototype.filter=function(t){},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var Zr=function(){};Zr.prototype.filter=function(t,e){},Zr.prototype.isDone=function(){},Zr.prototype.isGeometryChanged=function(){},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr};var vn=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new se("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new K,a=0;a<this._geometries.length;a++)o.expandToInclude(i._geometries[a].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),a=-1,l=0;l<this._geometries.length;l++)for(var u=i._geometries[l].getCoordinates(),c=0;c<u.length;c++)a++,o[a]=u[c];return o},t.prototype.getArea=function(){for(var i=this,o=0,a=0;a<this._geometries.length;a++)o+=i._geometries[a].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],a=arguments[1];if(!this.isEquivalentClass(o))return!1;var l=o;if(this._geometries.length!==l._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(l._geometries[u],a))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();ha.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=At.FALSE,a=0;a<this._geometries.length;a++)o=Math.max(o,i._geometries[a].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=At.FALSE,a=0;a<this._geometries.length;a++)o=Math.max(o,i._geometries[a].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,a=0;a<this._geometries.length;a++)o+=i._geometries[a].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,a=0;a<this._geometries.length;a++)o+=i._geometries[a].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,a=new Array(o).fill(null),l=0;l<this._geometries.length;l++)a[l]=i._geometries[l].reverse();return this.getFactory().createGeometryCollection(a)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],a=new yi(ha.asList(this._geometries)),l=new yi(ha.asList(o._geometries));return this.compare(a,l)}else if(arguments.length===2){for(var u=arguments[0],c=arguments[1],h=u,f=this.getNumGeometries(),d=h.getNumGeometries(),g=0;g<f&&g<d;){var p=i.getGeometryN(g),m=h.getGeometryN(g),y=p.compareToSameClass(m,c);if(y!==0)return y;g++}return g<f?1:g<d?-1:0}},t.prototype.apply=function(){var i=this;if(it(arguments[0],Zi))for(var o=arguments[0],a=0;a<this._geometries.length;a++)i._geometries[a].apply(o);else if(it(arguments[0],Zr)){var l=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(l),!l.isDone());u++);l.isGeometryChanged()&&this.geometryChanged()}else if(it(arguments[0],_i)){var c=arguments[0];c.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(c)}else if(it(arguments[0],Ms)){var f=arguments[0];f.filter(this);for(var d=0;d<this._geometries.length;d++)i._geometries[d].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ft.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var a=0;a<this._geometries.length;a++)o._geometries[a]=i._geometries[a].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),a=0;a<o.length;a++)o[a]=i._geometries[a].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(nt),fa=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return nt.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?At.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,a=new Array(o).fill(null),l=0;l<this._geometries.length;l++)a[o-1-l]=i._geometries[l].reverse();return this.getFactory().createMultiLineString(a)},t.prototype.getBoundary=function(){return new Lr(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),a=0;a<o.length;a++)o[a]=i._geometries[a].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[Ph]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(vn),Lr=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Ar.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};Lr.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Lr.prototype.getBoundary=function(){return this._geom instanceof ge?this.boundaryLineString(this._geom):this._geom instanceof fa?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Lr.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Lr.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Lr.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new j;this._endpointMap=new hn;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var a=this._endpointMap.entrySet().iterator();a.hasNext();){var l=a.next(),u=l.getValue(),c=u.count;e._bnRule.isInBoundary(c)&&n.add(l.getKey())}return _t.toCoordinateArray(n)},Lr.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Ig,this._endpointMap.put(t,e)),e.count++},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Lr(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Lr(n,i);return o.getBoundary()}};var Ig=function(){this.count=null};Ig.prototype.interfaces_=function(){return[]},Ig.prototype.getClass=function(){return Ig};function Az(){}function Lz(){}var Mz=function(){};function Nz(){}function Oz(){}function Fz(){}var Mr=function(){},Av={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},Mr.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Nz,n=new Az;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],a="";new Lz(Mr.getStackTrace(i));for(var l=new Fz,u=0;u<o;u++)try{a+=l.readLine()+Mr.NEWLINE}catch(c){if(c instanceof Oz)ft.shouldNeverReachHere();else throw c}finally{}return a}},Mr.split=function(t,e){for(var n=e.length,i=new j,o=""+t,a=o.indexOf(e);a>=0;){var l=o.substring(0,a);i.add(l),o=o.substring(a+n),a=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),c=0;c<u.length;c++)u[c]=i.get(c);return u},Mr.toString=function(){if(arguments.length===1){var t=arguments[0];return Mr.SIMPLE_ORDINATE_FORMAT.format(t)}},Mr.spaces=function(t){return Mr.chars(" ",t)},Av.NEWLINE.get=function(){return $e.getProperty("line.separator")},Av.SIMPLE_ORDINATE_FORMAT.get=function(){return new Mz},Object.defineProperties(Mr,Av);var _e=function(){};_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e},_e.copyCoord=function(t,e,n,i){for(var o=Math.min(t.getDimension(),n.getDimension()),a=0;a<o;a++)n.setOrdinate(i,a,t.getOrdinate(e,a))},_e.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Rt.X)===t.getOrdinate(e-1,Rt.X)&&t.getOrdinate(0,Rt.Y)===t.getOrdinate(e-1,Rt.Y)},_e.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),a=0;a<n;a++)for(var l=0;l<o;l++){var u=t.getOrdinate(a,l),c=e.getOrdinate(a,l);if(t.getOrdinate(a,l)!==e.getOrdinate(a,l)&&!(ut.isNaN(u)&&ut.isNaN(c)))return!1}return!0},_e.extend=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();if(_e.copy(e,0,i,0,o),o>0)for(var a=o;a<n;a++)_e.copy(e,o-1,i,a,1);return i},_e.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)_e.swap(t,i,e-i)},_e.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,o)}},_e.copy=function(t,e,n,i,o){for(var a=0;a<o;a++)_e.copyCoord(t,e+a,n,i+a)},_e.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new di;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var a=0;a<n;a++)a>0&&i.append(","),i.append(Mr.toString(t.getOrdinate(o,a)))}return i.append(")"),i.toString()}},_e.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return _e.createClosedRing(t,e,4);var i=e.getOrdinate(0,Rt.X)===e.getOrdinate(n-1,Rt.X)&&e.getOrdinate(0,Rt.Y)===e.getOrdinate(n-1,Rt.Y);return i?e:_e.createClosedRing(t,e,n+1)},_e.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();_e.copy(e,0,i,0,o);for(var a=o;a<n;a++)_e.copy(e,0,i,a,1);return i};var ge=function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new K:this._points.expandEnvelope(new K)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],a=arguments[1];if(!this.isEquivalentClass(o))return!1;var l=o;if(this._points.size()!==l._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),l._points.getCoordinate(u),a))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var a=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(a)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(a))>0&&_e.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?At.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return W.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();_e.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],a=o,l=0,u=0;l<this._points.size()&&u<a._points.size();){var c=i._points.getCoordinate(l).compareTo(a._points.getCoordinate(u));if(c!==0)return c;l++,u++}return l<this._points.size()?1:u<a._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],f=arguments[1],d=h;return f.compare(this._points,d._points)}},t.prototype.apply=function(){var i=this;if(it(arguments[0],Zi))for(var o=arguments[0],a=0;a<this._points.size();a++)o.filter(i._points.getCoordinate(a));else if(it(arguments[0],Zr)){var l=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(l.filter(i._points,u),!l.isDone());u++);l.isGeometryChanged()&&this.geometryChanged()}else if(it(arguments[0],_i)){var c=arguments[0];c.filter(this)}else if(it(arguments[0],Ms)){var h=arguments[0];h.filter(this)}},t.prototype.getBoundary=function(){return new Lr(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new se("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,a=0;a<this._points.size();a++)if(o._points.getCoordinate(a).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[Ph]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(nt),bh=function(){};bh.prototype.interfaces_=function(){return[]},bh.prototype.getClass=function(){return bh};var $n=function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new K;var i=new K;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return At.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var a=arguments[0],l=arguments[1],u=a;return l.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(it(arguments[0],Zi)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(it(arguments[0],Zr)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(it(arguments[0],_i)){var a=arguments[0];a.filter(this)}else if(it(arguments[0],Ms)){var l=arguments[0];l.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),ft.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[bh]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(nt),_o=function(){};_o.prototype.interfaces_=function(){return[]},_o.prototype.getClass=function(){return _o};var Ae=function(r){function t(n,i,o){if(r.call(this,o),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new se("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new se("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),a=-1,l=this._shell.getCoordinates(),u=0;u<l.length;u++)a++,o[a]=l[u];for(var c=0;c<this._holes.length;c++)for(var h=i._holes[c].getCoordinates(),f=0;f<h.length;f++)a++,o[a]=h[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(W.signedArea(this._shell.getCoordinateSequence()));for(var a=0;a<this._holes.length;a++)o-=Math.abs(W.signedArea(i._holes[a].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),a=0;a<5;a++){var l=i.getX(a);if(!(l===o.getMinX()||l===o.getMaxX()))return!1;var u=i.getY(a);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var c=i.getX(0),h=i.getY(0),f=1;f<=4;f++){var d=i.getX(f),g=i.getY(f),p=d!==c,m=g!==h;if(p===m)return!1;c=d,h=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],a=arguments[1];if(!this.isEquivalentClass(o))return!1;var l=o,u=this._shell,c=l._shell;if(!u.equalsExact(c,a)||this._holes.length!==l._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!i._holes[h].equalsExact(l._holes[h],a))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);ha.sort(this._holes)}else if(arguments.length===2){var a=arguments[0],l=arguments[1];if(a.isEmpty())return null;var u=new Array(a.getCoordinates().length-1).fill(null);$e.arraycopy(a.getCoordinates(),0,u,0,u.length);var c=_t.minCoordinate(a.getCoordinates());_t.scroll(u,c),$e.arraycopy(u,0,a.getCoordinates(),0,u.length),a.getCoordinates()[u.length]=u[0],W.isCCW(a.getCoordinates())===l&&_t.reverse(a.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var a=0;a<this._holes.length;a++)o+=i._holes[a].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),a=0;a<this._holes.length;a++)o+=i._holes[a].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var a=0;a<this._holes.length;a++)o._holes[a]=i._holes[a].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],a=this._shell,l=o._shell;return a.compareToSameClass(l)}else if(arguments.length===2){var u=arguments[0],c=arguments[1],h=u,f=this._shell,d=h._shell,g=f.compareToSameClass(d,c);if(g!==0)return g;for(var p=this.getNumInteriorRing(),m=h.getNumInteriorRing(),y=0;y<p&&y<m;){var E=i.getInteriorRingN(y),_=h.getInteriorRingN(y),v=E.compareToSameClass(_,c);if(v!==0)return v;y++}return y<p?1:y<m?-1:0}},t.prototype.apply=function(i){var o=this;if(it(i,Zi)){this._shell.apply(i);for(var a=0;a<this._holes.length;a++)o._holes[a].apply(i)}else if(it(i,Zr)){if(this._shell.apply(i),!i.isDone())for(var l=0;l<this._holes.length&&(o._holes[l].apply(i),!i.isDone());l++);i.isGeometryChanged()&&this.geometryChanged()}else if(it(i,_i))i.filter(this);else if(it(i,Ms)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var a=0;a<this._holes.length;a++)o[a+1]=i._holes[a];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var a=0;a<this._holes.length;a++)o._holes[a]=i._holes[a].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),a=new Array(this._holes.length).fill(null),l=0;l<a.length;l++)a[l]=i._holes[l].copy();return new t(o,a,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[_o]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(nt),ku=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return nt.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return At.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),a=0;a<o.length;a++)o[a]=i._geometries[a].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[bh]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(vn),Ki=function(r){function t(n,i){n instanceof N&&i instanceof vt&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return nt.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return At.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();_e.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new se("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new se("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(ge),Ji=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return nt.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,a=new Array(o).fill(null),l=0;l<this._geometries.length;l++)a[l]=i._geometries[l].reverse();return this.getFactory().createMultiPolygon(a)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new j,a=0;a<this._geometries.length;a++)for(var l=i._geometries[a],u=l.getBoundary(),c=0;c<u.getNumGeometries();c++)o.add(u.getGeometryN(c));var h=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(h))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),a=0;a<o.length;a++)o[a]=i._geometries[a].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[_o]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(vn),Nr=function(t){this._factory=t||null,this._isUserDataCopied=!1},Tg={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Nr.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Nr.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Nr.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof vn?this.editGeometryCollection(t,e):t instanceof Ae?this.editPolygon(t,e):t instanceof $n?e.edit(t,this._factory):t instanceof ge?e.edit(t,this._factory):(ft.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Nr.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),o=new j,a=0;a<i.getNumGeometries();a++){var l=n.edit(i.getGeometryN(a),e);l===null||l.isEmpty()||o.add(l)}return i.getClass()===ku?this._factory.createMultiPoint(o.toArray([])):i.getClass()===fa?this._factory.createMultiLineString(o.toArray([])):i.getClass()===Ji?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Nr.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var a=new j,l=0;l<i.getNumInteriorRing();l++){var u=n.edit(i.getInteriorRingN(l),e);u===null||u.isEmpty()||a.add(u)}return this._factory.createPolygon(o,a.toArray([]))},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.GeometryEditorOperation=function(){},Tg.NoOpGeometryOperation.get=function(){return Ah},Tg.CoordinateOperation.get=function(){return Lh},Tg.CoordinateSequenceOperation.get=function(){return Mh},Object.defineProperties(Nr,Tg);var Ah=function(){};Ah.prototype.edit=function(t,e){return t},Ah.prototype.interfaces_=function(){return[Nr.GeometryEditorOperation]},Ah.prototype.getClass=function(){return Ah};var Lh=function(){};Lh.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Ki?e.createLinearRing(n):t instanceof ge?e.createLineString(n):t instanceof $n?n.length>0?e.createPoint(n[0]):e.createPoint():t},Lh.prototype.interfaces_=function(){return[Nr.GeometryEditorOperation]},Lh.prototype.getClass=function(){return Lh};var Mh=function(){};Mh.prototype.edit=function(t,e){return t instanceof Ki?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ge?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof $n?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Mh.prototype.interfaces_=function(){return[Nr.GeometryEditorOperation]},Mh.prototype.getClass=function(){return Mh};var ve=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new N}else if(it(arguments[0],Rt)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var a=arguments[0],l=arguments[1];this._coordinates=a,this._dimension=l,a===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],c=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=c;for(var h=0;h<u;h++)t._coordinates[h]=new N}}},eT={serialVersionUID:{configurable:!0}};ve.prototype.setOrdinate=function(t,e,n){switch(e){case Rt.X:this._coordinates[t].x=n;break;case Rt.Y:this._coordinates[t].y=n;break;case Rt.Z:this._coordinates[t].z=n;break;default:throw new se("invalid ordinateIndex")}},ve.prototype.size=function(){return this._coordinates.length},ve.prototype.getOrdinate=function(t,e){switch(e){case Rt.X:return this._coordinates[t].x;case Rt.Y:return this._coordinates[t].y;case Rt.Z:return this._coordinates[t].z}return ut.NaN},ve.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ve.prototype.getCoordinateCopy=function(t){return new N(this._coordinates[t])},ve.prototype.getDimension=function(){return this._dimension},ve.prototype.getX=function(t){return this._coordinates[t].x},ve.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new ve(e,this._dimension)},ve.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},ve.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new ve(e,this._dimension)},ve.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new di(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},ve.prototype.getY=function(t){return this._coordinates[t].y},ve.prototype.toCoordinateArray=function(){return this._coordinates},ve.prototype.interfaces_=function(){return[Rt,br]},ve.prototype.getClass=function(){return ve},eT.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ve,eT);var Qi=function(){},Lv={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Qi.prototype.readResolve=function(){return Qi.instance()},Qi.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new ve(t)}else if(it(arguments[0],Rt)){var e=arguments[0];return new ve(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new ve(n):new ve(n,i)}},Qi.prototype.interfaces_=function(){return[bu,br]},Qi.prototype.getClass=function(){return Qi},Qi.instance=function(){return Qi.instanceObject},Lv.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Lv.instanceObject.get=function(){return new Qi},Object.defineProperties(Qi,Lv);var nT=function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new j,i=this.map_.values(),o=i.next();!o.done;)n.add(o.value),o=i.next();return n},t.prototype.entrySet=function(){var n=new Pv;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}(cl),Lt=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof vi){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},Mv={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Lt.prototype.equals=function(t){if(!(t instanceof Lt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Lt.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new gi(n).compareTo(new gi(i))},Lt.prototype.getScale=function(){return this._scale},Lt.prototype.isFloating=function(){return this._modelType===Lt.FLOATING||this._modelType===Lt.FLOATING_SINGLE},Lt.prototype.getType=function(){return this._modelType},Lt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Lt.FLOATING?t="Floating":this._modelType===Lt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Lt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Lt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(ut.isNaN(t))return t;if(this._modelType===Lt.FLOATING_SINGLE){var e=t;return e}return this._modelType===Lt.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof N){var n=arguments[0];if(this._modelType===Lt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Lt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Lt.FLOATING?t=16:this._modelType===Lt.FLOATING_SINGLE?t=6:this._modelType===Lt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Lt.prototype.setScale=function(t){this._scale=Math.abs(t)},Lt.prototype.interfaces_=function(){return[br,Pr]},Lt.prototype.getClass=function(){return Lt},Lt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Mv.serialVersionUID.get=function(){return 7777263578777804e3},Mv.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Lt,Mv);var vi=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},Nv={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};vi.prototype.readResolve=function(){return vi.nameToTypeMap.get(this._name)},vi.prototype.toString=function(){return this._name},vi.prototype.interfaces_=function(){return[br]},vi.prototype.getClass=function(){return vi},Nv.serialVersionUID.get=function(){return-552860263173159e4},Nv.nameToTypeMap.get=function(){return new nT},Object.defineProperties(vi,Nv),Lt.Type=vi,Lt.FIXED=new vi("FIXED"),Lt.FLOATING=new vi("FLOATING"),Lt.FLOATING_SINGLE=new vi("FLOATING SINGLE");var vt=function r(){this._precisionModel=new Lt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?it(arguments[0],bu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Lt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},rT={serialVersionUID:{configurable:!0}};vt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new N(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new N(t.getMinX(),t.getMinY()),new N(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new N(t.getMinX(),t.getMinY()),new N(t.getMinX(),t.getMaxY()),new N(t.getMaxX(),t.getMaxY()),new N(t.getMaxX(),t.getMinY()),new N(t.getMinX(),t.getMinY())]),null)},vt.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ge(this.getCoordinateSequenceFactory().create(t),this);if(it(t,Rt))return new ge(t,this)}else return new ge(this.getCoordinateSequenceFactory().create([]),this)},vt.prototype.createMultiLineString=function(){if(arguments.length===0)return new fa(null,this);if(arguments.length===1){var t=arguments[0];return new fa(t,this)}},vt.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,o=t.iterator();o.hasNext();){var a=o.next(),l=a.getClass();e===null&&(e=l),l!==e&&(n=!0),a.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(vt.toGeometryArray(t));var u=t.iterator().next(),c=t.size()>1;if(c){if(u instanceof Ae)return this.createMultiPolygon(vt.toPolygonArray(t));if(u instanceof ge)return this.createMultiLineString(vt.toLineStringArray(t));if(u instanceof $n)return this.createMultiPoint(vt.toPointArray(t));ft.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},vt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},vt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof N){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(it(arguments[0],Rt)){var e=arguments[0];return new $n(e,this)}}},vt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},vt.prototype.createPolygon=function(){if(arguments.length===0)return new Ae(null,null,this);if(arguments.length===1){if(it(arguments[0],Rt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Ki){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new Ae(i,o,this)}},vt.prototype.getSRID=function(){return this._SRID},vt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new vn(null,this);if(arguments.length===1){var t=arguments[0];return new vn(t,this)}},vt.prototype.createGeometry=function(t){var e=new Nr(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},vt.prototype.getPrecisionModel=function(){return this._precisionModel},vt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(it(arguments[0],Rt)){var e=arguments[0];return new Ki(e,this)}}},vt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ji(null,this);if(arguments.length===1){var t=arguments[0];return new Ji(t,this)}},vt.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new ku(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new ku(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(it(arguments[0],Rt)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),a=0;a<i.size();a++){var l=t.getCoordinateSequenceFactory().create(1,i.getDimension());_e.copy(i,a,l,0,1),o[a]=t.createPoint(l)}return this.createMultiPoint(o)}}},vt.prototype.interfaces_=function(){return[br]},vt.prototype.getClass=function(){return vt},vt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.getDefaultCoordinateSequenceFactory=function(){return Qi.instance()},vt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},vt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},rT.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(vt,rT);var Dz=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Rg=function(t){this.geometryFactory=t||new vt};Rg.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!Ei[n])throw new Error("Unknown GeoJSON type: "+e.type);return Dz.indexOf(n)!==-1?Ei[n].apply(this,[e.coordinates]):n==="GeometryCollection"?Ei[n].apply(this,[e.geometries]):Ei[n].apply(this,[e])},Rg.prototype.write=function(t){var e=t.getGeometryType();if(!Ds[e])throw new Error("Geometry is not supported");return Ds[e].apply(this,[t])};var Ei={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!Ei[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=Ei.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new N(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new N(r[0],r[1]),new N(r[2],r[1]),new N(r[2],r[3]),new N(r[0],r[3]),new N(r[0],r[1])])},Point:function(r){var t=new N(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(Ei.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=Ei.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(Ei.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=Ei.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],o=1;o<r.length;++o){var a=r[o],l=Ei.coordinates.apply(t,[a]),u=t.geometryFactory.createLinearRing(l);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(Ei.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Ds={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=Ds.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Ds.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var o=n[i];e.push(Ds.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Ds.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=Ds.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var o=r._holes[i],a=Ds.LineString.apply(t,[o]);e.push(a.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Ds.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=i.getGeometryType();e.push(Ds[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Ov=function(t){this.geometryFactory=t||new vt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Rg(this.geometryFactory)};Ov.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Lt.FIXED&&this.reducePrecision(e),e},Ov.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var iT=function(){this.parser=new Rg(this.geometryFactory)};iT.prototype.write=function(t){return this.parser.write(t)};var U=function(){},Pg={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.opposite=function(t){return t===U.LEFT?U.RIGHT:t===U.RIGHT?U.LEFT:t},Pg.ON.get=function(){return 0},Pg.LEFT.get=function(){return 1},Pg.RIGHT.get=function(){return 2},Object.defineProperties(U,Pg);function bg(r){this.message=r||""}bg.prototype=new Error,bg.prototype.name="EmptyStackException";function xi(){this.array_=[]}xi.prototype=new Hr,xi.prototype.add=function(r){return this.array_.push(r),!0},xi.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},xi.prototype.push=function(r){return this.array_.push(r),r},xi.prototype.pop=function(r){if(this.array_.length===0)throw new bg;return this.array_.pop()},xi.prototype.peek=function(){if(this.array_.length===0)throw new bg;return this.array_[this.array_.length-1]},xi.prototype.empty=function(){return this.array_.length===0},xi.prototype.isEmpty=function(){return this.empty()},xi.prototype.search=function(r){return this.array_.indexOf(r)},xi.prototype.size=function(){return this.array_.length},xi.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var wi=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};wi.prototype.getCoordinate=function(){return this._minCoord},wi.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},wi.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();ft.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=W.computeOrientation(this._minCoord,n,e),o=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===W.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===W.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},wi.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=U.LEFT;return i[e].y<i[e+1].y&&(o=U.RIGHT),o},wi.prototype.getEdge=function(){return this._orientedDe},wi.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},wi.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},wi.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}ft.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var o=this.getRightmostSide(this._minDe,this._minIndex);o===U.LEFT&&(this._orientedDe=this._minDe.getSym())},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Bs=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new N(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t}(Ls),Ag=function(){this.array_=[]};Ag.prototype.addLast=function(t){this.array_.push(t)},Ag.prototype.removeFirst=function(){return this.array_.shift()},Ag.prototype.isEmpty=function(){return this.array_.length===0};var En=function(){this._finder=null,this._dirEdgeList=new j,this._nodes=new j,this._rightMostCoord=null,this._env=null,this._finder=new wi};En.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},En.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},En.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){n=o;break}}if(n===null)throw new Bs("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var a=t.getEdges().iterator();a.hasNext();){var l=a.next();l.setVisited(!0),e.copySymDepths(l)}},En.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(U.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},En.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},En.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(U.RIGHT)>=1&&e.getDepth(U.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},En.prototype.computeDepths=function(t){var e=this,n=new Pv,i=new Ag,o=t.getNode();for(i.addLast(o),n.add(o),t.setVisited(!0);!i.isEmpty();){var a=i.removeFirst();n.add(a),e.computeNodeDepth(a);for(var l=a.getEdges().iterator();l.hasNext();){var u=l.next(),c=u.getSym();if(!c.isVisited()){var h=c.getNode();n.contains(h)||(i.addLast(h),n.add(h))}}}},En.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},En.prototype.getEnvelope=function(){if(this._env===null){for(var t=new K,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},En.prototype.addReachable=function(t){var e=this,n=new xi;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},En.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(U.LEFT,t.getDepth(U.RIGHT)),e.setDepth(U.RIGHT,t.getDepth(U.LEFT))},En.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();n._dirEdgeList.add(o);var a=o.getSym(),l=a.getNode();l.isVisited()||e.push(l)}},En.prototype.getNodes=function(){return this._nodes},En.prototype.getDirectedEdges=function(){return this._dirEdgeList},En.prototype.interfaces_=function(){return[Pr]},En.prototype.getClass=function(){return En};var Jt=function r(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[U.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var a=arguments[0],l=arguments[1],u=arguments[2];this.init(3),this.location[U.ON]=a,this.location[U.LEFT]=l,this.location[U.RIGHT]=u}};Jt.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},Jt.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==O.NONE)return!1;return!0},Jt.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===O.NONE&&(e.location[n]=t)},Jt.prototype.isLine=function(){return this.location.length===1},Jt.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[U.ON]=this.location[U.ON],n[U.LEFT]=O.NONE,n[U.RIGHT]=O.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===O.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},Jt.prototype.getLocations=function(){return this.location},Jt.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[U.LEFT];this.location[U.LEFT]=this.location[U.RIGHT],this.location[U.RIGHT]=t},Jt.prototype.toString=function(){var t=new di;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[U.LEFT])),t.append(O.toLocationSymbol(this.location[U.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[U.RIGHT])),t.toString()},Jt.prototype.setLocations=function(t,e,n){this.location[U.ON]=t,this.location[U.LEFT]=e,this.location[U.RIGHT]=n},Jt.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},Jt.prototype.isArea=function(){return this.location.length>1},Jt.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===O.NONE)return!0;return!1},Jt.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(U.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},Jt.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},Jt.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Jt.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var kt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new Jt(t),this.elt[1]=new Jt(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new Jt(e.elt[0]),this.elt[1]=new Jt(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Jt(O.NONE),this.elt[1]=new Jt(O.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];this.elt[0]=new Jt(o,a,l),this.elt[1]=new Jt(o,a,l)}else if(arguments.length===4){var u=arguments[0],c=arguments[1],h=arguments[2],f=arguments[3];this.elt[0]=new Jt(O.NONE,O.NONE,O.NONE),this.elt[1]=new Jt(O.NONE,O.NONE,O.NONE),this.elt[u].setLocations(c,h,f)}};kt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},kt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},kt.prototype.isNull=function(t){return this.elt[t].isNull()},kt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},kt.prototype.isLine=function(t){return this.elt[t].isLine()},kt.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new Jt(t.elt[n]):e.elt[n].merge(t.elt[n])},kt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},kt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(U.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},kt.prototype.toString=function(){var t=new di;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},kt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},kt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},kt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(U.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this.elt[n].setLocation(i,o)}},kt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},kt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},kt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Jt(this.elt[t].location[0]))},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.toLineLabel=function(t){for(var e=new kt(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ce=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new j,this._pts=new j,this._label=new kt(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new j,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ce.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=W.isCCW(this._ring.getCoordinates())},Ce.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ce.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Bs("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Bs("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var o=n.getLabel();ft.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},Ce.prototype.getLinearRing=function(){return this._ring},Ce.prototype.getCoordinate=function(t){return this._pts.get(t)},Ce.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Ce.prototype.addPoints=function(t,e,n){var i=this,o=t.getCoordinates();if(e){var a=1;n&&(a=0);for(var l=a;l<o.length;l++)i._pts.add(o[l])}else{var u=o.length-2;n&&(u=o.length-1);for(var c=u;c>=0;c--)i._pts.add(o[c])}},Ce.prototype.isHole=function(){return this._isHole},Ce.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ce.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!W.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},Ce.prototype.addHole=function(t){this._holes.add(t)},Ce.prototype.isShell=function(){return this._shell===null},Ce.prototype.getLabel=function(){return this._label},Ce.prototype.getEdges=function(){return this._edges},Ce.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ce.prototype.getShell=function(){return this._shell},Ce.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=e.getLocation(n,U.RIGHT);if(i===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,i),null}},Ce.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Ce.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),n);return o},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Bz=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ce),Gz=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new j,o=this._startDe;do{if(o.getMinEdgeRing()===null){var a=new Bz(o,n._geometryFactory);i.add(a)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ce),fr=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};fr.prototype.setVisited=function(t){this._isVisited=t},fr.prototype.setInResult=function(t){this._isInResult=t},fr.prototype.isCovered=function(){return this._isCovered},fr.prototype.isCoveredSet=function(){return this._isCoveredSet},fr.prototype.setLabel=function(t){this._label=t},fr.prototype.getLabel=function(){return this._label},fr.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},fr.prototype.updateIM=function(t){ft.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},fr.prototype.isInResult=function(){return this._isInResult},fr.prototype.isVisited=function(){return this._isVisited},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr};var Lg=function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new kt(0,O.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var o=O.NONE;if(o=this._label.getLocation(i),!n.isNull(i)){var a=n.getLocation(i);o!==O.BOUNDARY&&(o=a)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new kt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof kt)for(var o=arguments[0],a=0;a<2;a++){var l=n.computeMergedLocation(o,a),u=n._label.getLocation(a);u===O.NONE&&n._label.setLocation(a,l)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=O.NONE;this._label!==null&&(i=this._label.getLocation(n));var o=null;switch(i){case O.BOUNDARY:o=O.INTERIOR;break;case O.INTERIOR:o=O.BOUNDARY;break;default:o=O.BOUNDARY;break}this._label.setLocation(n,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fr),Si=function(){this.nodeMap=new hn,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Si.prototype.find=function(t){return this.nodeMap.get(t)},Si.prototype.addNode=function(){if(arguments[0]instanceof N){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Lg){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},Si.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Si.prototype.iterator=function(){return this.nodeMap.values().iterator()},Si.prototype.values=function(){return this.nodeMap.values()},Si.prototype.getBoundaryNodes=function(t){for(var e=new j,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===O.BOUNDARY&&e.add(i)}return e},Si.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var jt=function(){},Nh={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.isNorthern=function(t){return t===jt.NE||t===jt.NW},jt.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},jt.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},jt.isInHalfPlane=function(t,e){return e===jt.SE?t===jt.SE||t===jt.SW:t===e||t===e+1},jt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new se("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?jt.NE:jt.SE:e>=0?jt.NW:jt.SW}else if(arguments[0]instanceof N&&arguments[1]instanceof N){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new se("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?jt.NE:jt.SE:i.y>=n.y?jt.NW:jt.SW}},Nh.NE.get=function(){return 0},Nh.NW.get=function(){return 1},Nh.SW.get=function(){return 2},Nh.SE.get=function(){return 3},Object.defineProperties(jt,Nh);var fn=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(n,i),this._label=o}else if(arguments.length===4){var a=arguments[0],l=arguments[1],u=arguments[2],c=arguments[3];this._edge=a,this.init(l,u),this._label=c}};fn.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:W.computeOrientation(t._p0,t._p1,this._p1)},fn.prototype.getDy=function(){return this._dy},fn.prototype.getCoordinate=function(){return this._p0},fn.prototype.setNode=function(t){this._node=t},fn.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),o=n.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},fn.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},fn.prototype.getDirectedCoordinate=function(){return this._p1},fn.prototype.getDx=function(){return this._dx},fn.prototype.getLabel=function(){return this._label},fn.prototype.getEdge=function(){return this._edge},fn.prototype.getQuadrant=function(){return this._quadrant},fn.prototype.getNode=function(){return this._node},fn.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},fn.prototype.computeLabel=function(t){},fn.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=jt.quadrant(this._dx,this._dy),ft.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},fn.prototype.interfaces_=function(){return[Pr]},fn.prototype.getClass=function(){return fn};var Fv=function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new kt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Bs("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,o=0;o<2;o++)n._label.isArea(o)&&n._label.getLocation(o,U.LEFT)===O.INTERIOR&&n._label.getLocation(o,U.RIGHT)===O.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[U.LEFT]+"/"+this._depth[U.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,O.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.EXTERIOR);return n&&i&&o},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var a=1;n===U.LEFT&&(a=-1);var l=U.opposite(n),u=o*a,c=i+u;this.setDepth(n,i),this.setDepth(l,c)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===O.EXTERIOR&&i===O.INTERIOR?1:n===O.INTERIOR&&i===O.EXTERIOR?-1:0},t}(fn),zu=function(){};zu.prototype.createNode=function(t){return new Lg(t,null)},zu.prototype.interfaces_=function(){return[]},zu.prototype.getClass=function(){return zu};var le=function(){if(this._edges=new j,this._nodes=null,this._edgeEndList=new j,arguments.length===0)this._nodes=new Si(new zu);else if(arguments.length===1){var t=arguments[0];this._nodes=new Si(t)}};le.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},le.prototype.find=function(t){return this._nodes.find(t)},le.prototype.addNode=function(){if(arguments[0]instanceof Lg){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof N){var e=arguments[0];return this._nodes.addNode(e)}},le.prototype.getNodeIterator=function(){return this._nodes.iterator()},le.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},le.prototype.debugPrintln=function(t){$e.out.println(t)},le.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===O.BOUNDARY},le.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},le.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?W.computeOrientation(t,e,i)===W.COLLINEAR&&jt.quadrant(t,e)===jt.quadrant(n,i):!1},le.prototype.getEdgeEnds=function(){return this._edgeEndList},le.prototype.debugPrint=function(t){$e.out.print(t)},le.prototype.getEdgeIterator=function(){return this._edges.iterator()},le.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),a=o.getCoordinates();if(n.matchInSameDirection(t,e,a[0],a[1])||n.matchInSameDirection(t,e,a[a.length-1],a[a.length-2]))return o}return null},le.prototype.insertEdge=function(t){this._edges.add(t)},le.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},le.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var o=new Fv(i,!0),a=new Fv(i,!1);o.setSym(a),a.setSym(o),e.add(o),e.add(a)}},le.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},le.prototype.getNodes=function(){return this._nodes.values()},le.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),a=o.getCoordinates();if(t.equals(a[0])&&e.equals(a[1]))return o}return null},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var tr=function(){this._geometryFactory=null,this._shellList=new j;var t=arguments[0];this._geometryFactory=t};tr.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?n.add(o):e.add(o)}},tr.prototype.computePolygons=function(t){for(var e=this,n=new j,i=t.iterator();i.hasNext();){var o=i.next(),a=o.toPolygon(e._geometryFactory);n.add(a)}return n},tr.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var a=n.findEdgeRingContaining(o,t);if(a===null)throw new Bs("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(a)}}},tr.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,o=new j,a=t.iterator();a.hasNext();){var l=a.next();if(l.getMaxNodeDegree()>2){l.linkDirectedEdgesForMinimalEdgeRings();var u=l.buildMinimalRings(),c=i.findShell(u);c!==null?(i.placePolygonHoles(c,u),e.add(c)):n.addAll(u)}else o.add(l)}return o},tr.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},tr.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new j,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var a=new Gz(o,e._geometryFactory);n.add(a),a.setInResult()}}return n},tr.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},tr.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},tr.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),o=n.getCoordinateN(0),a=null,l=null,u=e.iterator();u.hasNext();){var c=u.next(),h=c.getLinearRing(),f=h.getEnvelopeInternal();a!==null&&(l=a.getLinearRing().getEnvelopeInternal());var d=!1;f.contains(i)&&W.isPointInRing(o,h.getCoordinates())&&(d=!0),d&&(a===null||l.contains(f))&&(a=c)}return a},tr.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(n=o,e++)}return ft.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},tr.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];le.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),o=new j,a=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(a,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var Uu=function(){};Uu.prototype.getBounds=function(){},Uu.prototype.interfaces_=function(){return[]},Uu.prototype.getClass=function(){return Uu};var Kr=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Kr.prototype.getItem=function(){return this._item},Kr.prototype.getBounds=function(){return this._bounds},Kr.prototype.interfaces_=function(){return[Uu,br]},Kr.prototype.getClass=function(){return Kr};var Gs=function(){this._size=null,this._items=null,this._size=0,this._items=new j,this._items.add(null)};Gs.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Gs.prototype.size=function(){return this._size},Gs.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},Gs.prototype.clear=function(){this._size=0,this._items.clear()},Gs.prototype.isEmpty=function(){return this._size===0},Gs.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Gs.prototype.interfaces_=function(){return[]},Gs.prototype.getClass=function(){return Gs};var vo=function(){};vo.prototype.visitItem=function(t){},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo};var hl=function(){};hl.prototype.insert=function(t,e){},hl.prototype.remove=function(t,e){},hl.prototype.query=function(){},hl.prototype.interfaces_=function(){return[]},hl.prototype.getClass=function(){return hl};var Le=function(){if(this._childBoundables=new j,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},sT={serialVersionUID:{configurable:!0}};Le.prototype.getLevel=function(){return this._level},Le.prototype.size=function(){return this._childBoundables.size()},Le.prototype.getChildBoundables=function(){return this._childBoundables},Le.prototype.addChildBoundable=function(t){ft.isTrue(this._bounds===null),this._childBoundables.add(t)},Le.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Le.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Le.prototype.interfaces_=function(){return[Uu,br]},Le.prototype.getClass=function(){return Le},sT.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Le,sT);var Jr=function(){};Jr.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},Jr.min=function(t){return Jr.sort(t),t.get(0)},Jr.sort=function(t,e){var n=t.toArray();e?ha.sort(n,e):ha.sort(n);for(var i=t.iterator(),o=0,a=n.length;o<a;o++)i.next(),i.set(n[o])},Jr.singletonList=function(t){var e=new j;return e.add(t),e};var Ie=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Ie.prototype.expandToQueue=function(t,e){var n=Ie.isComposite(this._boundable1),i=Ie.isComposite(this._boundable2);if(n&&i)return Ie.area(this._boundable1)>Ie.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new se("neither boundable is composite")},Ie.prototype.isLeaves=function(){return!(Ie.isComposite(this._boundable1)||Ie.isComposite(this._boundable2))},Ie.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Ie.prototype.expand=function(t,e,n,i){for(var o=this,a=t.getChildBoundables(),l=a.iterator();l.hasNext();){var u=l.next(),c=new Ie(u,e,o._itemDistance);c.getDistance()<i&&n.add(c)}},Ie.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Ie.prototype.getDistance=function(){return this._distance},Ie.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ie.prototype.interfaces_=function(){return[Pr]},Ie.prototype.getClass=function(){return Ie},Ie.area=function(t){return t.getBounds().getArea()},Ie.isComposite=function(t){return t instanceof Le};var Xe=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new j,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];ft.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Mg={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Xe.prototype.getNodeCapacity=function(){return this._nodeCapacity},Xe.prototype.lastNode=function(t){return t.get(t.size()-1)},Xe.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Le?n+=t.size(o):o instanceof Kr&&(n+=1)}return n}},Xe.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Kr&&o.getItem()===e&&(n=o)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Xe.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new j:e}else if(arguments.length===1){for(var n=arguments[0],i=new j,o=n.getChildBoundables().iterator();o.hasNext();){var a=o.next();if(a instanceof Le){var l=t.itemsTree(a);l!==null&&i.add(l)}else a instanceof Kr?i.add(a.getItem()):ft.shouldNeverReachHere()}return i.size()<=0?null:i}},Xe.prototype.insert=function(t,e){ft.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Kr(t,e))},Xe.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new j;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2];if(ft.isTrue(i>-2),o.getLevel()===i)return a.add(o),null;for(var l=o.getChildBoundables().iterator();l.hasNext();){var u=l.next();u instanceof Le?t.boundablesAtLevel(i,u,a):(ft.isTrue(u instanceof Kr),i===-1&&a.add(u))}return null}},Xe.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new j;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(it(arguments[2],vo)&&arguments[0]instanceof Object&&arguments[1]instanceof Le)for(var a=arguments[0],l=arguments[1],u=arguments[2],c=l.getChildBoundables(),h=0;h<c.size();h++){var f=c.get(h);t.getIntersectsOp().intersects(f.getBounds(),a)&&(f instanceof Le?t.query(a,f,u):f instanceof Kr?u.visitItem(f.getItem()):ft.shouldNeverReachHere())}else if(it(arguments[2],Hr)&&arguments[0]instanceof Object&&arguments[1]instanceof Le)for(var d=arguments[0],g=arguments[1],p=arguments[2],m=g.getChildBoundables(),y=0;y<m.size();y++){var E=m.get(y);t.getIntersectsOp().intersects(E.getBounds(),d)&&(E instanceof Le?t.query(d,E,p):E instanceof Kr?p.add(E.getItem()):ft.shouldNeverReachHere())}}},Xe.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Xe.prototype.getRoot=function(){return this.build(),this._root},Xe.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2],l=this.removeItem(o,a);if(l)return!0;for(var u=null,c=o.getChildBoundables().iterator();c.hasNext();){var h=c.next();if(t.getIntersectsOp().intersects(h.getBounds(),i)&&h instanceof Le&&(l=t.remove(i,h,a),l)){u=h;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),l}},Xe.prototype.createHigherLevels=function(t,e){ft.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},Xe.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof Le){var a=t.depth(o);a>n&&(n=a)}}return n+1}},Xe.prototype.createParentBoundables=function(t,e){var n=this;ft.isTrue(!t.isEmpty());var i=new j;i.add(this.createNode(e));var o=new j(t);Jr.sort(o,this.getComparator());for(var a=o.iterator();a.hasNext();){var l=a.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(l)}return i},Xe.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Xe.prototype.interfaces_=function(){return[br]},Xe.prototype.getClass=function(){return Xe},Xe.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Mg.IntersectsOp.get=function(){return kz},Mg.serialVersionUID.get=function(){return-3886435814360241e3},Mg.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Xe,Mg);var kz=function(){},Vu=function(){};Vu.prototype.distance=function(t,e){},Vu.prototype.interfaces_=function(){return[]},Vu.prototype.getClass=function(){return Vu};var oT=function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var a=this;ft.isTrue(i.length>0);for(var l=new j,u=0;u<i.length;u++)l.addAll(a.createParentBoundablesFromVerticalSlice(i[u],o));return l},t.prototype.createNode=function(i){return new aT(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,o)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var a=Math.trunc(Math.ceil(i.size()/o)),l=new Array(o).fill(null),u=i.iterator(),c=0;c<o;c++){l[c]=new j;for(var h=0;u.hasNext()&&h<a;){var f=u.next();l[c].add(f),h++}}return l},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];r.prototype.query.call(this,o,a)}else if(arguments.length===3){if(it(arguments[2],vo)&&arguments[0]instanceof Object&&arguments[1]instanceof Le){var l=arguments[0],u=arguments[1],c=arguments[2];r.prototype.query.call(this,l,u,c)}else if(it(arguments[2],Hr)&&arguments[0]instanceof Object&&arguments[1]instanceof Le){var h=arguments[0],f=arguments[1],d=arguments[2];r.prototype.query.call(this,h,f,d)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return r.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return r.prototype.remove.call(this,i,o)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){ft.isTrue(!i.isEmpty());var a=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),l=new j(i);Jr.sort(l,t.xComparator);var u=this.verticalSlices(l,Math.trunc(Math.ceil(Math.sqrt(a))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(it(arguments[0],Vu)){var i=arguments[0],o=new Ie(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof Ie){var a=arguments[0];return this.nearestNeighbour(a,ut.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&it(arguments[1],Vu)){var l=arguments[0],u=arguments[1],c=new Ie(this.getRoot(),l.getRoot(),u);return this.nearestNeighbour(c)}else if(arguments[0]instanceof Ie&&typeof arguments[1]=="number"){var h=arguments[0],f=arguments[1],d=f,g=null,p=new Gs;for(p.add(h);!p.isEmpty()&&d>0;){var m=p.poll(),y=m.getDistance();if(y>=d)break;m.isLeaves()?(d=y,g=m):m.expandToQueue(p,d)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var E=arguments[0],_=arguments[1],v=arguments[2],x=new Kr(E,_),w=new Ie(this.getRoot(),x,v);return this.nearestNeighbour(w)[0]}},t.prototype.interfaces_=function(){return[hl,br]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return aT},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Pu]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Pu]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Xe),aT=function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();n===null?n=new K(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Le),Fn=function(){};Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Fn.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Fn.relativeSign(e.x,n.x),o=Fn.relativeSign(e.y,n.y);switch(t){case 0:return Fn.compareValue(i,o);case 1:return Fn.compareValue(o,i);case 2:return Fn.compareValue(o,-i);case 3:return Fn.compareValue(-i,o);case 4:return Fn.compareValue(-i,-o);case 5:return Fn.compareValue(-o,-i);case 6:return Fn.compareValue(-o,i);case 7:return Fn.compareValue(i,-o)}return ft.shouldNeverReachHere("invalid octant value"),0},Fn.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Eo=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new N(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};Eo.prototype.getCoordinate=function(){return this.coord},Eo.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Eo.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Fn.compare(this._segmentOctant,this.coord,e.coord)},Eo.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},Eo.prototype.isInterior=function(){return this._isInterior},Eo.prototype.interfaces_=function(){return[Pr]},Eo.prototype.getClass=function(){return Eo};var xn=function(){this._nodeMap=new hn,this._edge=null;var t=arguments[0];this._edge=t};xn.prototype.getSplitCoordinates=function(){var t=this,e=new Ih;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},xn.prototype.addCollapsedNodes=function(){var t=this,e=new j;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},xn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},xn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),o=e._edge.getCoordinate(n+2);i.equals2D(o)&&t.add(new gi(n+1))}},xn.prototype.addEdgeCoordinates=function(t,e,n){var i=this,o=this._edge.getCoordinate(e.segmentIndex),a=e.isInterior()||!e.coord.equals2D(o);n.add(new N(t.coord),!1);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)n.add(i._edge.getCoordinate(l));a&&n.add(new N(e.coord))},xn.prototype.iterator=function(){return this._nodeMap.values().iterator()},xn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),a=e.createSplitEdge(i,o);t.add(a),i=o}},xn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},xn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var a=i.next(),l=e.findCollapseIndex(o,a,n);l&&t.add(new gi(n[0])),o=a}},xn.prototype.getEdge=function(){return this._edge},xn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},xn.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),a=e.isInterior()||!e.coord.equals2D(o);a||i--;var l=new Array(i).fill(null),u=0;l[u++]=new N(t.coord);for(var c=t.segmentIndex+1;c<=e.segmentIndex;c++)l[u++]=n._edge.getCoordinate(c);return a&&(l[u]=new N(e.coord)),new Ee(l,this._edge.getData())},xn.prototype.add=function(t,e){var n=new Eo(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(ft.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},xn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new Ls("bad split edge start point at "+i);var o=t.get(t.size()-1),a=o.getCoordinates(),l=a[a.length-1];if(!l.equals2D(e[e.length-1]))throw new Ls("bad split edge end point at "+l)},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var fl=function(){};fl.prototype.interfaces_=function(){return[]},fl.prototype.getClass=function(){return fl},fl.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new se("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof N&&arguments[1]instanceof N){var o=arguments[0],a=arguments[1],l=a.x-o.x,u=a.y-o.y;if(l===0&&u===0)throw new se("Cannot compute the octant for two identical points "+o);return fl.octant(l,u)}};var $i=function(){};$i.prototype.getCoordinates=function(){},$i.prototype.size=function(){},$i.prototype.getCoordinate=function(t){},$i.prototype.isClosed=function(){},$i.prototype.setData=function(t){},$i.prototype.getData=function(){},$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i};var Oh=function(){};Oh.prototype.addIntersection=function(t,e){},Oh.prototype.interfaces_=function(){return[$i]},Oh.prototype.getClass=function(){return Oh};var Ee=function(){this._nodeList=new xn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ee.prototype.getCoordinates=function(){return this._pts},Ee.prototype.size=function(){return this._pts.length},Ee.prototype.getCoordinate=function(t){return this._pts[t]},Ee.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ee.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Ee.prototype.setData=function(t){this._data=t},Ee.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:fl.octant(t,e)},Ee.prototype.getData=function(){return this._data},Ee.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[3],a=new N(n.getIntersection(o));this.addIntersection(a,i)}},Ee.prototype.toString=function(){return Xr.toLineString(new ve(this._pts))},Ee.prototype.getNodeList=function(){return this._nodeList},Ee.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(n=i)}var a=this._nodeList.add(t,n);return a},Ee.prototype.addIntersections=function(t,e,n){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,n,o)},Ee.prototype.interfaces_=function(){return[Oh]},Ee.prototype.getClass=function(){return Ee},Ee.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new j;return Ee.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],o=n.iterator();o.hasNext();){var a=o.next();a.getNodeList().addSplitEdges(i)}};var J=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new N,this.p1=new N;else if(arguments.length===1){var t=arguments[0];this.p0=new N(t.p0),this.p1=new N(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],o=arguments[3];this.p0=new N(e,n),this.p1=new N(i,o)}},lT={serialVersionUID:{configurable:!0}};J.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},J.prototype.orientationIndex=function(){if(arguments[0]instanceof J){var t=arguments[0],e=W.orientationIndex(this.p0,this.p1,t.p0),n=W.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof N){var i=arguments[0];return W.orientationIndex(this.p0,this.p1,i)}},J.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},J.prototype.isVertical=function(){return this.p0.x===this.p1.x},J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},J.prototype.intersection=function(t){var e=new ua;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},J.prototype.project=function(){if(arguments[0]instanceof N){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new N(t);var e=this.projectionFactor(t),n=new N;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof J){var i=arguments[0],o=this.projectionFactor(i.p0),a=this.projectionFactor(i.p1);if(o>=1&&a>=1||o<=0&&a<=0)return null;var l=this.project(i.p0);o<0&&(l=this.p0),o>1&&(l=this.p1);var u=this.project(i.p1);return a<0&&(u=this.p0),a>1&&(u=this.p1),new J(l,u)}},J.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},J.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},J.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},J.prototype.distancePerpendicular=function(t){return W.distancePointLinePerpendicular(t,this.p0,this.p1)},J.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},J.prototype.midPoint=function(){return J.midPoint(this.p0,this.p1)},J.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return ut.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return o},J.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=ut.MAX_VALUE,o=null,a=this.closestPoint(t.p0);i=a.distance(t.p0),n[0]=a,n[1]=t.p0;var l=this.closestPoint(t.p1);o=l.distance(t.p1),o<i&&(i=o,n[0]=l,n[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,n[0]=this.p0,n[1]=u);var c=t.closestPoint(this.p1);return o=c.distance(this.p1),o<i&&(i=o,n[0]=this.p1,n[1]=c),n},J.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},J.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},J.prototype.getLength=function(){return this.p0.distance(this.p1)},J.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},J.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},J.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},J.prototype.lineIntersection=function(t){try{var e=Yr.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof Au))throw n}finally{}return null},J.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},J.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,l=Math.sqrt(o*o+a*a),u=0,c=0;if(e!==0){if(l<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/l,c=e*a/l}var h=n-c,f=i+u,d=new N(h,f);return d},J.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},J.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||ut.isNaN(e))&&(e=1),e},J.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},J.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},J.prototype.distance=function(){if(arguments[0]instanceof J){var t=arguments[0];return W.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof N){var e=arguments[0];return W.distancePointLine(e,this.p0,this.p1)}},J.prototype.pointAlong=function(t){var e=new N;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},J.prototype.hashCode=function(){var t=ut.doubleToLongBits(this.p0.x);t^=ut.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=ut.doubleToLongBits(this.p1.x);n^=ut.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},J.prototype.interfaces_=function(){return[Pr,br]},J.prototype.getClass=function(){return J},J.midPoint=function(t,e){return new N((t.x+e.x)/2,(t.y+e.y)/2)},lT.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(J,lT);var Fh=function(){this.tempEnv1=new K,this.tempEnv2=new K,this._overlapSeg1=new J,this._overlapSeg2=new J};Fh.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh};var er=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};er.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},er.prototype.computeSelect=function(t,e,n,i){var o=this._pts[e],a=this._pts[n];if(i.tempEnv1.init(o,a),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var l=Math.trunc((e+n)/2);e<l&&this.computeSelect(t,e,l,i),l<n&&this.computeSelect(t,l,n,i)},er.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},er.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},er.prototype.setId=function(t){this._id=t},er.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},er.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new K(t,e)}return this._env},er.prototype.getEndIndex=function(){return this._end},er.prototype.getStartIndex=function(){return this._start},er.prototype.getContext=function(){return this._context},er.prototype.getId=function(){return this._id},er.prototype.computeOverlapsInternal=function(t,e,n,i,o,a){var l=this._pts[t],u=this._pts[e],c=n._pts[i],h=n._pts[o];if(e-t===1&&o-i===1)return a.overlap(this,t,n,i),null;if(a.tempEnv1.init(l,u),a.tempEnv2.init(c,h),!a.tempEnv1.intersects(a.tempEnv2))return null;var f=Math.trunc((t+e)/2),d=Math.trunc((i+o)/2);t<f&&(i<d&&this.computeOverlapsInternal(t,f,n,i,d,a),d<o&&this.computeOverlapsInternal(t,f,n,d,o,a)),f<e&&(i<d&&this.computeOverlapsInternal(f,e,n,i,d,a),d<o&&this.computeOverlapsInternal(f,e,n,d,o,a))},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var Ci=function(){};Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci},Ci.getChainStartIndices=function(t){var e=0,n=new j;n.add(new gi(e));do{var i=Ci.findChainEnd(t,e);n.add(new gi(i)),e=i}while(e<t.length-1);var o=Ci.toIntArray(n);return o},Ci.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=jt.quadrant(t[n],t[n+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var a=jt.quadrant(t[o-1],t[o]);if(a!==i)break}o++}return o-1},Ci.getChains=function(){if(arguments.length===1){var t=arguments[0];return Ci.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new j,o=Ci.getChainStartIndices(e),a=0;a<o.length-1;a++){var l=new er(e,o[a],o[a+1],n);i.add(l)}return i}},Ci.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 da=function(){};da.prototype.computeNodes=function(t){},da.prototype.getNodedSubstrings=function(){},da.prototype.interfaces_=function(){return[]},da.prototype.getClass=function(){return da};var Dh=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Dh.prototype.setSegmentIntersector=function(t){this._segInt=t},Dh.prototype.interfaces_=function(){return[da]},Dh.prototype.getClass=function(){return Dh};var Dv=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new j,this._index=new oT,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return Ee.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,a=Ci.getChains(i.getCoordinates(),i),l=a.iterator();l.hasNext();){var u=l.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var a=i.iterator();a.hasNext();)o.add(a.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new uT(this._segInt),a=this._monoChains.iterator();a.hasNext();)for(var l=a.next(),u=i._index.query(l.getEnvelope()),c=u.iterator();c.hasNext();){var h=c.next();if(h.getId()>l.getId()&&(l.computeOverlaps(h,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return uT},Object.defineProperties(t,e),t}(Dh),uT=function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],l=n.getContext(),u=o.getContext();this._si.processIntersections(l,i,u,a)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fh),Mt=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(l)}}},ks={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Mt.prototype.getEndCapStyle=function(){return this._endCapStyle},Mt.prototype.isSingleSided=function(){return this._isSingleSided},Mt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Mt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Mt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Mt.JOIN_ROUND&&(this._quadrantSegments=Mt.DEFAULT_QUADRANT_SEGMENTS)},Mt.prototype.getJoinStyle=function(){return this._joinStyle},Mt.prototype.setJoinStyle=function(t){this._joinStyle=t},Mt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Mt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Mt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Mt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Mt.prototype.getMitreLimit=function(){return this._mitreLimit},Mt.prototype.setMitreLimit=function(t){this._mitreLimit=t},Mt.prototype.setSingleSided=function(t){this._isSingleSided=t},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},ks.CAP_ROUND.get=function(){return 1},ks.CAP_FLAT.get=function(){return 2},ks.CAP_SQUARE.get=function(){return 3},ks.JOIN_ROUND.get=function(){return 1},ks.JOIN_MITRE.get=function(){return 2},ks.JOIN_BEVEL.get=function(){return 3},ks.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},ks.DEFAULT_MITRE_LIMIT.get=function(){return 5},ks.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Mt,ks);var pe=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=W.COUNTERCLOCKWISE,this._inputLine=t||null},Bh={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};pe.prototype.isDeletable=function(t,e,n,i){var o=this._inputLine[t],a=this._inputLine[e],l=this._inputLine[n];return!this.isConcave(o,a,l)||!this.isShallow(o,a,l,i)?!1:this.isShallowSampled(o,a,t,n,i)},pe.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),o=!1;i<this._inputLine.length;){var a=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=pe.DELETE,a=!0,o=!0),a?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return o},pe.prototype.isShallowConcavity=function(t,e,n,i){var o=W.computeOrientation(t,e,n),a=o===this._angleOrientation;if(!a)return!1;var l=W.distancePointLine(e,t,n);return l<i},pe.prototype.isShallowSampled=function(t,e,n,i,o){var a=this,l=Math.trunc((i-n)/pe.NUM_PTS_TO_CHECK);l<=0&&(l=1);for(var u=n;u<i;u+=l)if(!a.isShallow(t,e,a._inputLine[u],o))return!1;return!0},pe.prototype.isConcave=function(t,e,n){var i=W.computeOrientation(t,e,n),o=i===this._angleOrientation;return o},pe.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=W.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},pe.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===pe.DELETE;)e++;return e},pe.prototype.isShallow=function(t,e,n,i){var o=W.distancePointLine(e,t,n);return o<i},pe.prototype.collapseLine=function(){for(var t=this,e=new Ih,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==pe.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.simplify=function(t,e){var n=new pe(t);return n.simplify(e)},Bh.INIT.get=function(){return 0},Bh.DELETE.get=function(){return 1},Bh.KEEP.get=function(){return 1},Bh.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(pe,Bh);var dr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new j},cT={COORDINATE_ARRAY_TYPE:{configurable:!0}};dr.prototype.getCoordinates=function(){var t=this._ptList.toArray(dr.COORDINATE_ARRAY_TYPE);return t},dr.prototype.setPrecisionModel=function(t){this._precisionModel=t},dr.prototype.addPt=function(t){var e=new N(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},dr.prototype.revere=function(){},dr.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)n.addPt(t[o])},dr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},dr.prototype.toString=function(){var t=new vt,e=t.createLineString(this.getCoordinates());return e.toString()},dr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new N(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},dr.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},cT.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(dr,cT);var It=function(){},dl={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.toDegrees=function(t){return t*180/Math.PI},It.normalize=function(t){for(;t>Math.PI;)t-=It.PI_TIMES_2;for(;t<=-Math.PI;)t+=It.PI_TIMES_2;return t},It.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,o=n.y-e.y;return Math.atan2(o,i)}},It.isAcute=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,a=n.x-e.x,l=n.y-e.y,u=i*a+o*l;return u>0},It.isObtuse=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,a=n.x-e.x,l=n.y-e.y,u=i*a+o*l;return u<0},It.interiorAngle=function(t,e,n){var i=It.angle(e,t),o=It.angle(e,n);return Math.abs(o-i)},It.normalizePositive=function(t){if(t<0){for(;t<0;)t+=It.PI_TIMES_2;t>=It.PI_TIMES_2&&(t=0)}else{for(;t>=It.PI_TIMES_2;)t-=It.PI_TIMES_2;t<0&&(t=0)}return t},It.angleBetween=function(t,e,n){var i=It.angle(e,t),o=It.angle(e,n);return It.diff(i,o)},It.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},It.toRadians=function(t){return t*Math.PI/180},It.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?It.COUNTERCLOCKWISE:n<0?It.CLOCKWISE:It.NONE},It.angleBetweenOriented=function(t,e,n){var i=It.angle(e,t),o=It.angle(e,n),a=o-i;return a<=-Math.PI?a+It.PI_TIMES_2:a>Math.PI?a-It.PI_TIMES_2:a},dl.PI_TIMES_2.get=function(){return 2*Math.PI},dl.PI_OVER_2.get=function(){return Math.PI/2},dl.PI_OVER_4.get=function(){return Math.PI/4},dl.COUNTERCLOCKWISE.get=function(){return W.COUNTERCLOCKWISE},dl.CLOCKWISE.get=function(){return W.CLOCKWISE},dl.NONE.get=function(){return W.COLLINEAR},Object.defineProperties(It,dl);var ie=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new J,this._seg1=new J,this._offset0=new J,this._offset1=new J,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new ua,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Mt.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},Gh={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ie.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=W.computeOrientation(this._s0,this._s1,this._s2),i=n===W.CLOCKWISE&&this._side===U.LEFT||n===W.COUNTERCLOCKWISE&&this._side===U.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},ie.prototype.addLineEndCap=function(t,e){var n=new J(t,e),i=new J;this.computeOffsetSegment(n,U.LEFT,this._distance,i);var o=new J;this.computeOffsetSegment(n,U.RIGHT,this._distance,o);var a=e.x-t.x,l=e.y-t.y,u=Math.atan2(l,a);switch(this._bufParams.getEndCapStyle()){case Mt.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,W.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case Mt.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case Mt.CAP_SQUARE:var c=new N;c.x=Math.abs(this._distance)*Math.cos(u),c.y=Math.abs(this._distance)*Math.sin(u);var h=new N(i.p1.x+c.x,i.p1.y+c.y),f=new N(o.p1.x+c.x,o.p1.y+c.y);this._segList.addPt(h),this._segList.addPt(f);break}},ie.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ie.prototype.addMitreJoin=function(t,e,n,i){var o=!0,a=null;try{a=Yr.intersection(e.p0,e.p1,n.p0,n.p1);var l=i<=0?1:a.distance(t)/Math.abs(i);l>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Au)a=new N(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(a):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},ie.prototype.addFilletCorner=function(t,e,n,i,o){var a=e.x-t.x,l=e.y-t.y,u=Math.atan2(l,a),c=n.x-t.x,h=n.y-t.y,f=Math.atan2(h,c);i===W.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(n)},ie.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ie.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Mt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Mt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},ie.prototype.createSquare=function(t){this._segList.addPt(new N(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new N(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new N(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new N(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ie.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ie.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ie.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ie.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},ie.prototype.addLimitedMitreJoin=function(t,e,n,i){var o=this._seg0.p1,a=It.angle(o,this._seg0.p0),l=It.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=l/2,c=It.normalize(a+u),h=It.normalize(c+Math.PI),f=i*n,d=f*Math.abs(Math.sin(u)),g=n-d,p=o.x+f*Math.cos(h),m=o.y+f*Math.sin(h),y=new N(p,m),E=new J(o,y),_=E.pointAlongOffset(1,g),v=E.pointAlongOffset(1,-g);this._side===U.LEFT?(this._segList.addPt(_),this._segList.addPt(v)):(this._segList.addPt(v),this._segList.addPt(_))},ie.prototype.computeOffsetSegment=function(t,e,n,i){var o=e===U.LEFT?1:-1,a=t.p1.x-t.p0.x,l=t.p1.y-t.p0.y,u=Math.sqrt(a*a+l*l),c=o*n*a/u,h=o*n*l/u;i.p0.x=t.p0.x-h,i.p0.y=t.p0.y+c,i.p1.x=t.p1.x-h,i.p1.y=t.p1.y+c},ie.prototype.addFilletArc=function(t,e,n,i,o){var a=this,l=i===W.CLOCKWISE?-1:1,u=Math.abs(e-n),c=Math.trunc(u/this._filletAngleQuantum+.5);if(c<1)return null;for(var h=0,f=u/c,d=h,g=new N;d<u;){var p=e+l*d;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),a._segList.addPt(g),d+=f}},ie.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ie.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new N((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new N((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},ie.prototype.createCircle=function(t){var e=new N(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ie.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ie.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new dr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ie.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ie.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===Mt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Mt.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,W.CLOCKWISE,this._distance))},ie.prototype.closeRing=function(){this._segList.closeRing()},ie.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},Gh.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Gh.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Gh.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Gh.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ie,Gh);var Dn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Dn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,n,o);var a=o.getCoordinates();return n&&_t.reverse(a),a},Dn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var o=pe.simplify(t,-i),a=o.length-1;n.initSideSegments(o[a],o[a-1],U.LEFT),n.addFirstSegment();for(var l=a-2;l>=0;l--)n.addNextSegment(o[l],!0)}else{n.addSegments(t,!1);var u=pe.simplify(t,i),c=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var h=2;h<=c;h++)n.addNextSegment(u[h],!0)}n.addLastSegment(),n.closeRing()},Dn.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===U.RIGHT&&(i=-i);var o=pe.simplify(t,i),a=o.length-1;n.initSideSegments(o[a-1],o[0],e);for(var l=1;l<=a;l++){var u=l!==1;n.addNextSegment(o[l],u)}n.closeRing()},Dn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=pe.simplify(t,n),o=i.length-1;e.initSideSegments(i[0],i[1],U.LEFT);for(var a=2;a<=o;a++)e.addNextSegment(i[a],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var l=pe.simplify(t,-n),u=l.length-1;e.initSideSegments(l[u],l[u-1],U.LEFT);for(var c=u-2;c>=0;c--)e.addNextSegment(l[c],!0);e.addLastSegment(),e.addLineEndCap(l[1],l[0]),e.closeRing()},Dn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Mt.CAP_ROUND:e.createCircle(t);break;case Mt.CAP_SQUARE:e.createSquare(t);break}},Dn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var a=i.getCoordinates();return a},Dn.prototype.getBufferParameters=function(){return this._bufParams},Dn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Dn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return Dn.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},Dn.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var o=pe.simplify(t,-i),a=o.length-1;n.initSideSegments(o[a],o[a-1],U.LEFT),n.addFirstSegment();for(var l=a-2;l>=0;l--)n.addNextSegment(o[l],!0)}else{var u=pe.simplify(t,i),c=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var h=2;h<=c;h++)n.addNextSegment(u[h],!0)}n.addLastSegment()},Dn.prototype.getSegGen=function(t){return new ie(this._precisionModel,this._bufParams,t)},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new N(t[n]);return e};var gl=function(){this._subgraphs=null,this._seg=new J,this._cga=new W;var t=arguments[0];this._subgraphs=t},hT={DepthSegment:{configurable:!0}};gl.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new j,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),a=o.getEnvelope();e.y<a.getMinY()||e.y>a.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(it(arguments[2],Hr)&&arguments[0]instanceof N&&arguments[1]instanceof Fv)for(var l=arguments[0],u=arguments[1],c=arguments[2],h=u.getEdge().getCoordinates(),f=0;f<h.length-1;f++){t._seg.p0=h[f],t._seg.p1=h[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var d=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(d<l.x)&&!t._seg.isHorizontal()&&!(l.y<t._seg.p0.y||l.y>t._seg.p1.y)&&W.computeOrientation(t._seg.p0,t._seg.p1,l)!==W.RIGHT){var g=u.getDepth(U.LEFT);t._seg.p0.equals(h[f])||(g=u.getDepth(U.RIGHT));var p=new ga(t._seg,g);c.add(p)}}else if(it(arguments[2],Hr)&&arguments[0]instanceof N&&it(arguments[1],Hr))for(var m=arguments[0],y=arguments[1],E=arguments[2],_=y.iterator();_.hasNext();){var v=_.next();v.isForward()&&t.findStabbedSegments(m,v,E)}}},gl.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=Jr.min(e);return n._leftDepth},gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl},hT.DepthSegment.get=function(){return ga},Object.defineProperties(gl,hT);var ga=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new J(t),this._leftDepth=e};ga.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},ga.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},ga.prototype.toString=function(){return this._upwardSeg.toString()},ga.prototype.interfaces_=function(){return[Pr]},ga.prototype.getClass=function(){return ga};var Nt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Nt.prototype.area=function(){return Nt.area(this.p0,this.p1,this.p2)},Nt.prototype.signedArea=function(){return Nt.signedArea(this.p0,this.p1,this.p2)},Nt.prototype.interpolateZ=function(t){if(t===null)throw new se("Supplied point is null.");return Nt.interpolateZ(t,this.p0,this.p1,this.p2)},Nt.prototype.longestSideLength=function(){return Nt.longestSideLength(this.p0,this.p1,this.p2)},Nt.prototype.isAcute=function(){return Nt.isAcute(this.p0,this.p1,this.p2)},Nt.prototype.circumcentre=function(){return Nt.circumcentre(this.p0,this.p1,this.p2)},Nt.prototype.area3D=function(){return Nt.area3D(this.p0,this.p1,this.p2)},Nt.prototype.centroid=function(){return Nt.centroid(this.p0,this.p1,this.p2)},Nt.prototype.inCentre=function(){return Nt.inCentre(this.p0,this.p1,this.p2)},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Nt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Nt.det=function(t,e,n,i){return t*i-e*n},Nt.interpolateZ=function(t,e,n,i){var o=e.x,a=e.y,l=n.x-o,u=i.x-o,c=n.y-a,h=i.y-a,f=l*h-u*c,d=t.x-o,g=t.y-a,p=(h*d-u*g)/f,m=(-c*d+l*g)/f,y=e.z+p*(n.z-e.z)+m*(i.z-e.z);return y},Nt.longestSideLength=function(t,e,n){var i=t.distance(e),o=e.distance(n),a=n.distance(t),l=i;return o>l&&(l=o),a>l&&(l=a),l},Nt.isAcute=function(t,e,n){return!(!It.isAcute(t,e,n)||!It.isAcute(e,n,t)||!It.isAcute(n,t,e))},Nt.circumcentre=function(t,e,n){var i=n.x,o=n.y,a=t.x-i,l=t.y-o,u=e.x-i,c=e.y-o,h=2*Nt.det(a,l,u,c),f=Nt.det(l,a*a+l*l,c,u*u+c*c),d=Nt.det(a,a*a+l*l,u,u*u+c*c),g=i-f/h,p=o+d/h;return new N(g,p)},Nt.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,o=new Yr(t.x+n/2,t.y+i/2,1),a=new Yr(t.x-i+n/2,t.y+n+i/2,1);return new Yr(o,a)},Nt.angleBisector=function(t,e,n){var i=e.distance(t),o=e.distance(n),a=i/(i+o),l=n.x-t.x,u=n.y-t.y,c=new N(t.x+a*l,t.y+a*u);return c},Nt.area3D=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,a=e.z-t.z,l=n.x-t.x,u=n.y-t.y,c=n.z-t.z,h=o*c-a*u,f=a*l-i*c,d=i*u-o*l,g=h*h+f*f+d*d,p=Math.sqrt(g)/2;return p},Nt.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,o=(t.y+e.y+n.y)/3;return new N(i,o)},Nt.inCentre=function(t,e,n){var i=e.distance(n),o=t.distance(n),a=t.distance(e),l=i+o+a,u=(i*t.x+o*e.x+a*n.x)/l,c=(i*t.y+o*e.y+a*n.y)/l;return new N(u,c)};var Or=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new j;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Or.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Or.prototype.addPolygon=function(t){var e=this,n=this._distance,i=U.LEFT;this._distance<0&&(n=-this._distance,i=U.RIGHT);var o=t.getExteriorRing(),a=_t.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&a.length<3)return null;this.addPolygonRing(a,n,i,O.EXTERIOR,O.INTERIOR);for(var l=0;l<t.getNumInteriorRing();l++){var u=t.getInteriorRingN(l),c=_t.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(c,n,U.opposite(i),O.INTERIOR,O.EXTERIOR)}},Or.prototype.isTriangleErodedCompletely=function(t,e){var n=new Nt(t[0],t[1],t[2]),i=n.inCentre(),o=W.distancePointLine(i,n.p0,n.p1);return o<Math.abs(e)},Or.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=_t.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Or.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new Ee(t,new kt(0,O.BOUNDARY,e,n));this._curveList.add(i)},Or.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Or.prototype.addPolygonRing=function(t,e,n,i,o){if(e===0&&t.length<Ki.MINIMUM_VALID_SIZE)return null;var a=i,l=o;t.length>=Ki.MINIMUM_VALID_SIZE&&W.isCCW(t)&&(a=o,l=i,n=U.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,a,l)},Or.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ae?this.addPolygon(t):t instanceof ge?this.addLineString(t):t instanceof $n?this.addPoint(t):t instanceof ku?this.addCollection(t):t instanceof fa?this.addCollection(t):t instanceof Ji?this.addCollection(t):t instanceof vn&&this.addCollection(t)},Or.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},Or.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or};var ju=function(){};ju.prototype.locate=function(t){},ju.prototype.interfaces_=function(){return[]},ju.prototype.getClass=function(){return ju};var ts=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};ts.prototype.next=function(){if(this._atStart)return this._atStart=!1,ts.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Bu;var t=this._parent.getGeometryN(this._index++);return t instanceof vn?(this._subcollectionIterator=new ts(t),this._subcollectionIterator.next()):t},ts.prototype.remove=function(){throw new Error(this.getClass().getName())},ts.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},ts.prototype.interfaces_=function(){return[Du]},ts.prototype.getClass=function(){return ts},ts.isAtomic=function(t){return!(t instanceof vn)};var gr=function(){this._geom=null;var t=arguments[0];this._geom=t};gr.prototype.locate=function(t){return gr.locate(t,this._geom)},gr.prototype.interfaces_=function(){return[ju]},gr.prototype.getClass=function(){return gr},gr.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?W.isPointInRing(t,e.getCoordinates()):!1},gr.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!gr.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(gr.isPointInRing(t,o))return!1}return!0},gr.containsPoint=function(t,e){if(e instanceof Ae)return gr.containsPointInPolygon(t,e);if(e instanceof vn)for(var n=new ts(e);n.hasNext();){var i=n.next();if(i!==e&&gr.containsPoint(t,i))return!0}return!1},gr.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:gr.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var dn=function(){this._edgeMap=new hn,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]};dn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},dn.prototype.propagateSideLabels=function(t){for(var e=O.NONE,n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,U.LEFT)!==O.NONE&&(e=o.getLocation(t,U.LEFT))}if(e===O.NONE)return null;for(var a=e,l=this.iterator();l.hasNext();){var u=l.next(),c=u.getLabel();if(c.getLocation(t,U.ON)===O.NONE&&c.setLocation(t,U.ON,a),c.isArea(t)){var h=c.getLocation(t,U.LEFT),f=c.getLocation(t,U.RIGHT);if(f!==O.NONE){if(f!==a)throw new Bs("side location conflict",u.getCoordinate());h===O.NONE&&ft.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),a=h}else ft.isTrue(c.getLocation(t,U.LEFT)===O.NONE,"found single null side"),c.setLocation(t,U.RIGHT,a),c.setLocation(t,U.LEFT,a)}}},dn.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},dn.prototype.print=function(t){$e.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},dn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},dn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),o=i.getLocation(t,U.LEFT);ft.isTrue(o!==O.NONE,"Found unlabelled area edge");for(var a=o,l=this.iterator();l.hasNext();){var u=l.next(),c=u.getLabel();ft.isTrue(c.isArea(t),"Found non-area edge");var h=c.getLocation(t,U.LEFT),f=c.getLocation(t,U.RIGHT);if(h===f||f!==a)return!1;a=h}return!0},dn.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},dn.prototype.iterator=function(){return this.getEdges().iterator()},dn.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new j(this._edgeMap.values())),this._edgeList},dn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=gr.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},dn.prototype.toString=function(){var t=new di;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
478
+ `);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
479
+ `)}return t.toString()},dn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},dn.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),a=o.getLabel(),l=0;l<2;l++)a.isLine(l)&&a.getLocation(l)===O.BOUNDARY&&(n[l]=!0);for(var u=this.iterator();u.hasNext();)for(var c=u.next(),h=c.getLabel(),f=0;f<2;f++)if(h.isAnyNull(f)){var d=O.NONE;if(n[f])d=O.EXTERIOR;else{var g=c.getCoordinate();d=e.getLocation(f,g,t)}h.setAllLocationsIfNull(f,d)}},dn.prototype.getDegree=function(){return this._edgeMap.size()},dn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn};var zz=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,o=null,a=this._SCANNING_FOR_INCOMING,l=0;l<this._resultAreaEdgeList.size();l++){var u=n._resultAreaEdgeList.get(l),c=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),a){case n._SCANNING_FOR_INCOMING:if(!c.isInResult())continue;o=c,a=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),a=n._SCANNING_FOR_INCOMING;break}}if(a===this._LINKING_TO_OUTGOING){if(i===null)throw new Bs("no outgoing dirEdge found",this.getCoordinate());ft.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var o=n.get(0);if(i===1)return o;var a=n.get(i-1),l=o.getQuadrant(),u=a.getQuadrant();return jt.isNorthern(l)&&jt.isNorthern(u)?o:!jt.isNorthern(l)&&!jt.isNorthern(u)?a:o.getDy()!==0?o:a.getDy()!==0?a:(ft.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){$e.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();n.print("out "),o.print(n),n.println(),n.print("in "),o.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new j;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&n._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var o=i.next(),a=o.getLabel();a.setAllLocationsIfNull(0,n.getLocation(0)),a.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,o=null,a=this._edgeList.size()-1;a>=0;a--){var l=n._edgeList.get(a),u=l.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=l}o.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),a=i.getDepth(U.LEFT),l=i.getDepth(U.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),a),c=this.computeDepths(0,o,u);if(c!==l)throw new Bs("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],f=arguments[1],d=arguments[2],g=d,p=h;p<f;p++){var m=n._edgeList.get(p);m.setEdgeDepths(U.RIGHT,g),g=m.getDepth(U.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,o=null,a=null,l=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var c=i._resultAreaEdgeList.get(u),h=c.getSym();switch(o===null&&c.getEdgeRing()===n&&(o=c),l){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==n)continue;a=h,l=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(c.getEdgeRing()!==n)continue;a.setNextMin(c),l=i._SCANNING_FOR_INCOMING;break}}l===this._LINKING_TO_OUTGOING&&(ft.isTrue(o!==null,"found null for first outgoing dirEdge"),ft.isTrue(o.getEdgeRing()===n,"unable to link last incoming dirEdge"),a.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&n++}return n}else if(arguments.length===1){for(var a=arguments[0],l=0,u=this.iterator();u.hasNext();){var c=u.next();c.getEdgeRing()===a&&l++}return l}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=O.NONE,i=this.iterator();i.hasNext();){var o=i.next(),a=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){n=O.INTERIOR;break}if(a.isInResult()){n=O.EXTERIOR;break}}}if(n===O.NONE)return null;for(var l=n,u=this.iterator();u.hasNext();){var c=u.next(),h=c.getSym();c.isLineEdge()?c.getEdge().setCovered(l===O.INTERIOR):(c.isInResult()&&(l=O.EXTERIOR),h.isInResult()&&(l=O.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new kt(O.NONE);for(var o=this.iterator();o.hasNext();)for(var a=o.next(),l=a.getEdge(),u=l.getLabel(),c=0;c<2;c++){var h=u.getLocation(c);(h===O.INTERIOR||h===O.BOUNDARY)&&i._label.setLocation(c,O.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(dn),fT=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new Lg(n,new zz)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(zu),xo=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};xo.prototype.compareTo=function(t){var e=t,n=xo.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},xo.prototype.interfaces_=function(){return[Pr]},xo.prototype.getClass=function(){return xo},xo.orientation=function(t){return _t.increasingDirection(t)===1},xo.compareOriented=function(t,e,n,i){for(var o=e?1:-1,a=i?1:-1,l=e?t.length:-1,u=i?n.length:-1,c=e?0:t.length-1,h=i?0:n.length-1;;){var f=t[c].compareTo(n[h]);if(f!==0)return f;c+=o,h+=a;var d=c===l,g=h===u;if(d&&!g)return-1;if(!d&&g)return 1;if(d&&g)return 0}};var Qr=function(){this._edges=new j,this._ocaMap=new hn};Qr.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),a=0;a<o.length;a++)a>0&&t.print(","),t.print(o[a].x+" "+o[a].y);t.println(")")}t.print(") ")},Qr.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Qr.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Qr.prototype.iterator=function(){return this._edges.iterator()},Qr.prototype.getEdges=function(){return this._edges},Qr.prototype.get=function(t){return this._edges.get(t)},Qr.prototype.findEqualEdge=function(t){var e=new xo(t.getCoordinates()),n=this._ocaMap.get(e);return n},Qr.prototype.add=function(t){this._edges.add(t);var e=new xo(t.getCoordinates());this._ocaMap.put(e,t)},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var pa=function(){};pa.prototype.processIntersections=function(t,e,n,i){},pa.prototype.isDone=function(){},pa.prototype.interfaces_=function(){return[]},pa.prototype.getClass=function(){return pa};var pr=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};pr.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(pr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},pr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},pr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},pr.prototype.getLineIntersector=function(){return this._li},pr.prototype.hasProperIntersection=function(){return this._hasProper},pr.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],l=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},pr.prototype.hasIntersection=function(){return this._hasIntersection},pr.prototype.isDone=function(){return!1},pr.prototype.hasInteriorIntersection=function(){return this._hasInterior},pr.prototype.interfaces_=function(){return[pa]},pr.prototype.getClass=function(){return pr},pr.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Ii=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new N(t),this.segmentIndex=e,this.dist=n};Ii.prototype.getSegmentIndex=function(){return this.segmentIndex},Ii.prototype.getCoordinate=function(){return this.coord},Ii.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Ii.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Ii.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Ii.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Ii.prototype.getDistance=function(){return this.dist},Ii.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Ii.prototype.interfaces_=function(){return[Pr]},Ii.prototype.getClass=function(){return Ii};var es=function(){this._nodeMap=new hn,this.edge=null;var t=arguments[0];this.edge=t};es.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},es.prototype.iterator=function(){return this._nodeMap.values().iterator()},es.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),a=e.createSplitEdge(i,o);t.add(a),i=o}},es.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)},es.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],a=e.dist>0||!e.coord.equals2D(o);a||i--;var l=new Array(i).fill(null),u=0;l[u++]=new N(t.coord);for(var c=t.segmentIndex+1;c<=e.segmentIndex;c++)l[u++]=n.edge.pts[c];return a&&(l[u]=e.coord),new Ng(l,new kt(this.edge._label))},es.prototype.add=function(t,e,n){var i=new Ii(t,e,n),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},es.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var ma=function(){};ma.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new j;i.add(new gi(n));do{var o=e.findChainEnd(t,n);i.add(new gi(o)),n=o}while(n<t.length-1);var a=ma.toIntArray(i);return a},ma.prototype.findChainEnd=function(t,e){for(var n=jt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=jt.quadrant(t[i-1],t[i]);if(o!==n)break;i++}return i-1},ma.prototype.interfaces_=function(){return[]},ma.prototype.getClass=function(){return ma},ma.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 zs=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new K,this.env2=new K;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new ma;this.startIndex=e.getChainStartIndices(this.pts)};zs.prototype.getCoordinates=function(){return this.pts},zs.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},zs.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},zs.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3],c=arguments[4],h=arguments[5],f=this.pts[o],d=this.pts[a],g=l.pts[u],p=l.pts[c];if(a-o===1&&c-u===1)return h.addIntersections(this.e,o,l.e,u),null;if(this.env1.init(f,d),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var m=Math.trunc((o+a)/2),y=Math.trunc((u+c)/2);o<m&&(u<y&&this.computeIntersectsForChain(o,m,l,u,y,h),y<c&&this.computeIntersectsForChain(o,m,l,y,c,h)),m<a&&(u<y&&this.computeIntersectsForChain(m,a,l,u,y,h),y<c&&this.computeIntersectsForChain(m,a,l,y,c,h))}},zs.prototype.getStartIndexes=function(){return this.startIndex},zs.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)n.computeIntersectsForChain(i,t,o,e)},zs.prototype.interfaces_=function(){return[]},zs.prototype.getClass=function(){return zs};var tn=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},dT={NULL_VALUE:{configurable:!0}};tn.prototype.getDepth=function(t,e){return this._depth[t][e]},tn.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tn.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==tn.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===tn.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],a=arguments[1];return this._depth[o][a]===tn.NULL_VALUE}},tn.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>n&&(o=1),t._depth[e][i]=o}}},tn.prototype.getDelta=function(t){return this._depth[t][U.RIGHT]-this._depth[t][U.LEFT]},tn.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},tn.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tn.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var o=e.getLocation(n,i);(o===O.EXTERIOR||o===O.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=tn.depthAtLocation(o):t._depth[n][i]+=tn.depthAtLocation(o))}else if(arguments.length===3){var a=arguments[0],l=arguments[1],u=arguments[2];u===O.INTERIOR&&this._depth[a][l]++}},tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn},tn.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:tn.NULL_VALUE},dT.NULL_VALUE.get=function(){return-1},Object.defineProperties(tn,dT);var Ng=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new es(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tn,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,kt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var o=n;if(this.pts.length!==o.pts.length)return!1;for(var a=!0,l=!0,u=this.pts.length,c=0;c<this.pts.length;c++)if(i.pts[c].equals2D(o.pts[c])||(a=!1),i.pts[c].equals2D(o.pts[--u])||(l=!1),!a&&!l)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&n.print(","),n.print(i.pts[o].x+" "+i.pts[o].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)n.print(i.pts[o]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new zs(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new K;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,o,a){var l=new N(n.getIntersection(a)),u=i,c=n.getEdgeDistance(o,a),h=u+1;if(h<this.pts.length){var f=this.pts[h];l.equals2D(f)&&(u=h,c=0)}this.eiList.add(l,u,c)},t.prototype.toString=function(){var n=this,i=new di;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(n.pts[o].x+" "+n.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(n.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,o){for(var a=this,l=0;l<n.getIntersectionNum();l++)a.addIntersection(n,i,o,l)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,U.ON),n.getLocation(1,U.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,U.LEFT),n.getLocation(1,U.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,U.RIGHT),n.getLocation(1,U.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(fr),wn=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Qr,this._bufParams=t||null};wn.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},wn.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new kt(t.getLabel()),i.flip()),n.merge(i);var o=wn.depthDelta(i),a=e.getDepthDelta(),l=a+o;e.setDepthDelta(l)}else this._edgeList.add(t),t.setDepthDelta(wn.depthDelta(t.getLabel()))},wn.prototype.buildSubgraphs=function(t,e){for(var n=new j,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getRightmostCoordinate(),l=new gl(n),u=l.getDepth(a);o.computeDepth(u),o.findResultEdges(),n.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},wn.prototype.createSubgraphs=function(t){for(var e=new j,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var o=new En;o.create(i),e.add(o)}}return Jr.sort(e,Jr.reverseOrder()),e},wn.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},wn.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Dv,n=new ua;return n.setPrecisionModel(t),e.setSegmentIntersector(new pr(n)),e},wn.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new Dn(n,this._bufParams),o=new Or(t,e,i),a=o.getCurves();if(a.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(a,n),this._graph=new le(new fT),this._graph.addEdges(this._edgeList.getEdges());var l=this.createSubgraphs(this._graph),u=new tr(this._geomFact);this.buildSubgraphs(l,u);var c=u.getPolygons();if(c.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(c);return h},wn.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),a=o.iterator();a.hasNext();){var l=a.next(),u=l.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var c=l.getData(),h=new Ng(l.getCoordinates(),new kt(c));n.insertUniqueEdge(h)}}},wn.prototype.setNoder=function(t){this._workingNoder=t},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.depthDelta=function(t){var e=t.getLocation(0,U.LEFT),n=t.getLocation(0,U.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},wn.convertSegStrings=function(t){for(var e=new vt,n=new j;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());n.add(o)}return e.buildGeometry(n)};var wo=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){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(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=o,this._offsetY=a,this._isScaled=!this.isIntegerPrecision()}};wo.prototype.rescale=function(){var t=this;if(it(arguments[0],be))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=0;a<o.length;a++)o[a].x=o[a].x/t._scaleFactor+t._offsetX,o[a].y=o[a].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&$e.out.println(o)}},wo.prototype.scale=function(){var t=this;if(it(arguments[0],be)){for(var e=arguments[0],n=new j,i=e.iterator();i.hasNext();){var o=i.next();n.add(new Ee(t.scale(o.getCoordinates()),o.getData()))}return n}else if(arguments[0]instanceof Array){for(var a=arguments[0],l=new Array(a.length).fill(null),u=0;u<a.length;u++)l[u]=new N(Math.round((a[u].x-t._offsetX)*t._scaleFactor),Math.round((a[u].y-t._offsetY)*t._scaleFactor),a[u].z);var c=_t.removeRepeatedPoints(l);return c}},wo.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},wo.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},wo.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},wo.prototype.interfaces_=function(){return[da]},wo.prototype.getClass=function(){return wo};var Ti=function(){this._li=new ua,this._segStrings=null;var t=arguments[0];this._segStrings=t},gT={fact:{configurable:!0}};Ti.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],a=arguments[1],l=a.iterator();l.hasNext();)for(var u=l.next(),c=u.getCoordinates(),h=1;h<c.length-1;h++)if(c[h].equals(o))throw new Ls("found endpt/interior pt intersection at index "+h+" :pt "+o)}},Ti.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(n,o)}else if(arguments.length===2)for(var a=arguments[0],l=arguments[1],u=a.getCoordinates(),c=l.getCoordinates(),h=0;h<u.length-1;h++)for(var f=0;f<c.length-1;f++)t.checkInteriorIntersections(a,h,l,f);else if(arguments.length===4){var d=arguments[0],g=arguments[1],p=arguments[2],m=arguments[3];if(d===p&&g===m)return null;var y=d.getCoordinates()[g],E=d.getCoordinates()[g+1],_=p.getCoordinates()[m],v=p.getCoordinates()[m+1];if(this._li.computeIntersection(y,E,_,v),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,y,E)||this.hasInteriorIntersection(this._li,_,v)))throw new Ls("found non-noded intersection at "+y+"-"+E+" and "+_+"-"+v)}},Ti.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Ti.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),a=0;a<o.length-2;a++)t.checkCollapse(o[a],o[a+1],o[a+2])},Ti.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(n)))return!0}return!1},Ti.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Ls("found non-noded collapse at "+Ti.fact.createLineString([t,e,n]))},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},gT.fact.get=function(){return new vt},Object.defineProperties(Ti,gT);var Bn=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 se("Scale factor must be non-zero");e!==1&&(this._pt=new N(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new N,this._p1Scaled=new N),this.initCorners(this._pt)},pT={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Bn.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),a=Math.max(t.y,e.y),l=this._maxx<n||this._minx>i||this._maxy<o||this._miny>a;if(l)return!1;var u=this.intersectsToleranceSquare(t,e);return ft.isTrue(!(l&&u),"Found bad envelope test"),u},Bn.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new N(this._maxx,this._maxy),this._corner[1]=new N(this._minx,this._maxy),this._corner[2]=new N(this._minx,this._miny),this._corner[3]=new N(this._maxx,this._miny)},Bn.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Bn.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Bn.prototype.getCoordinate=function(){return this._originalPt},Bn.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Bn.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Bn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new K(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Bn.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()))},Bn.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!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()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},Bn.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},pT.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Bn,pT);var kh=function(){this.tempEnv1=new K,this.selectedSegment=new J};kh.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},kh.prototype.interfaces_=function(){return[]},kh.prototype.getClass=function(){return kh};var Wu=function(){this._index=null;var t=arguments[0];this._index=t},mT={HotPixelSnapAction:{configurable:!0}};Wu.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),a=new yT(e,n,i);return this._index.query(o,{interfaces_:function(){return[vo]},visitItem:function(l){var u=l;u.select(o,a)}}),a.isNodeAdded()}},Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu},mT.HotPixelSnapAction.get=function(){return yT},Object.defineProperties(Wu,mT);var yT=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],o=n.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(kh),pl=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new j};pl.prototype.processIntersections=function(t,e,n,i){var o=this;if(t===n&&e===i)return null;var a=t.getCoordinates()[e],l=t.getCoordinates()[e+1],u=n.getCoordinates()[i],c=n.getCoordinates()[i+1];if(this._li.computeIntersection(a,l,u,c),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)o._interiorIntersections.add(o._li.getIntersection(h));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},pl.prototype.isDone=function(){return!1},pl.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pl.prototype.interfaces_=function(){return[pa]},pl.prototype.getClass=function(){return pl};var ns=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 ua,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};ns.prototype.checkCorrectness=function(t){var e=Ee.getNodedSubstrings(t),n=new Ti(e);try{n.checkValid()}catch(i){if(i instanceof KI)i.printStackTrace();else throw i}finally{}},ns.prototype.getNodedSubstrings=function(){return Ee.getNodedSubstrings(this._nodedSegStrings)},ns.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},ns.prototype.findInteriorIntersections=function(t,e){var n=new pl(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},ns.prototype.computeVertexSnaps=function(){var t=this;if(it(arguments[0],be))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof Ee)for(var o=arguments[0],a=o.getCoordinates(),l=0;l<a.length;l++){var u=new Bn(a[l],t._scaleFactor,t._li),c=t._pointSnapper.snap(u,o,l);c&&o.addIntersection(a[l],l)}},ns.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Dv,this._pointSnapper=new Wu(this._noder.getIndex()),this.snapRound(t,this._li)},ns.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=new Bn(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},ns.prototype.interfaces_=function(){return[da]},ns.prototype.getClass=function(){return ns};var en=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Mt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},Yu={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};en.prototype.bufferFixedPrecision=function(t){var e=new wo(new ns(new Lt(1)),t.getScale()),n=new wn(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},en.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=en.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(a){if(a instanceof Bs)t._saveException=a;else throw a}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=en.precisionScaleFactor(this._argGeom,this._distance,n),o=new Lt(i);this.bufferFixedPrecision(o)}},en.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Lt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},en.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},en.prototype.bufferOriginalPrecision=function(){try{var t=new wn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Ls)this._saveException=e;else throw e}finally{}},en.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},en.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new en(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof nt&&typeof arguments[1]=="number"){var o=arguments[0],a=arguments[1],l=arguments[2],u=new en(o);u.setQuadrantSegments(l);var c=u.getResultGeometry(a);return c}else if(arguments[2]instanceof Mt&&arguments[0]instanceof nt&&typeof arguments[1]=="number"){var h=arguments[0],f=arguments[1],d=arguments[2],g=new en(h,d),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var m=arguments[0],y=arguments[1],E=arguments[2],_=arguments[3],v=new en(m);v.setQuadrantSegments(E),v.setEndCapStyle(_);var x=v.getResultGeometry(y);return x}},en.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),o=hr.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),a=e>0?e:0,l=o+2*a,u=Math.trunc(Math.log(l)/Math.log(10)+1),c=n-u,h=Math.pow(10,c);return h},Yu.CAP_ROUND.get=function(){return Mt.CAP_ROUND},Yu.CAP_BUTT.get=function(){return Mt.CAP_FLAT},Yu.CAP_FLAT.get=function(){return Mt.CAP_FLAT},Yu.CAP_SQUARE.get=function(){return Mt.CAP_SQUARE},Yu.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(en,Yu);var Sn=function(){this._pt=[new N,new N],this._distance=ut.NaN,this._isNull=!0};Sn.prototype.getCoordinates=function(){return this._pt},Sn.prototype.getCoordinate=function(t){return this._pt[t]},Sn.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Sn.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){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(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},Sn.prototype.getDistance=function(){return this._distance},Sn.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn};var rs=function(){};rs.prototype.interfaces_=function(){return[]},rs.prototype.getClass=function(){return rs},rs.computeDistance=function(){if(arguments[2]instanceof Sn&&arguments[0]instanceof ge&&arguments[1]instanceof N)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),o=new J,a=0;a<i.length-1;a++){o.setCoordinates(i[a],i[a+1]);var l=o.closestPoint(e);n.setMinimum(l,e)}else if(arguments[2]instanceof Sn&&arguments[0]instanceof Ae&&arguments[1]instanceof N){var u=arguments[0],c=arguments[1],h=arguments[2];rs.computeDistance(u.getExteriorRing(),c,h);for(var f=0;f<u.getNumInteriorRing();f++)rs.computeDistance(u.getInteriorRingN(f),c,h)}else if(arguments[2]instanceof Sn&&arguments[0]instanceof nt&&arguments[1]instanceof N){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ge)rs.computeDistance(d,g,p);else if(d instanceof Ae)rs.computeDistance(d,g,p);else if(d instanceof vn)for(var m=d,y=0;y<m.getNumGeometries();y++){var E=m.getGeometryN(y);rs.computeDistance(E,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof Sn&&arguments[0]instanceof J&&arguments[1]instanceof N){var _=arguments[0],v=arguments[1],x=arguments[2],w=_.closestPoint(v);x.setMinimum(w,v)}};var ya=function(t){this._maxPtDist=new Sn,this._inputGeom=t||null},Bv={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};ya.prototype.computeMaxMidpointDistance=function(t){var e=new So(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ya.prototype.computeMaxVertexDistance=function(t){var e=new ml(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ya.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},ya.prototype.getDistancePoints=function(){return this._maxPtDist},ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya},Bv.MaxPointDistanceFilter.get=function(){return ml},Bv.MaxMidpointDistanceFilter.get=function(){return So},Object.defineProperties(ya,Bv);var ml=function(t){this._maxPtDist=new Sn,this._minPtDist=new Sn,this._geom=t||null};ml.prototype.filter=function(t){this._minPtDist.initialize(),rs.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ml.prototype.getMaxPointDistance=function(){return this._maxPtDist},ml.prototype.interfaces_=function(){return[Zi]},ml.prototype.getClass=function(){return ml};var So=function(t){this._maxPtDist=new Sn,this._minPtDist=new Sn,this._geom=t||null};So.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new N((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),rs.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},So.prototype.isDone=function(){return!1},So.prototype.isGeometryChanged=function(){return!1},So.prototype.getMaxPointDistance=function(){return this._maxPtDist},So.prototype.interfaces_=function(){return[Zr]},So.prototype.getClass=function(){return So};var Us=function(t){this._comps=t||null};Us.prototype.filter=function(t){t instanceof Ae&&this._comps.add(t)},Us.prototype.interfaces_=function(){return[_i]},Us.prototype.getClass=function(){return Us},Us.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Us.getPolygons(t,new j)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Ae?n.add(e):e instanceof vn&&e.apply(new Us(n)),n}};var nn=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};nn.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ki){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ge&&this._lines.add(t)},nn.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},nn.prototype.interfaces_=function(){return[Ms]},nn.prototype.getClass=function(){return nn},nn.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(nn.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(nn.getLines(e,n))}},nn.getLines=function(){if(arguments.length===1){var t=arguments[0];return nn.getLines(t,!1)}else if(arguments.length===2){if(it(arguments[0],be)&&it(arguments[1],be)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();nn.getLines(o,n)}return n}else if(arguments[0]instanceof nt&&typeof arguments[1]=="boolean"){var a=arguments[0],l=arguments[1],u=new j;return a.apply(new nn(u,l)),u}else if(arguments[0]instanceof nt&&it(arguments[1],be)){var c=arguments[0],h=arguments[1];return c instanceof ge?h.add(c):c.apply(new nn(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&it(arguments[0],be)&&it(arguments[1],be)){for(var f=arguments[0],d=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var m=p.next();nn.getLines(m,d,g)}return d}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof nt&&it(arguments[1],be)){var y=arguments[0],E=arguments[1],_=arguments[2];return y.apply(new nn(E,_)),E}}};var $r=function(){if(this._boundaryRule=Ar.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new se("Rule must be non-null");this._boundaryRule=t}}};$r.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof N&&arguments[1]instanceof Ae){var e=arguments[0],n=arguments[1];if(n.isEmpty())return O.EXTERIOR;var i=n.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===O.EXTERIOR)return O.EXTERIOR;if(o===O.BOUNDARY)return O.BOUNDARY;for(var a=0;a<n.getNumInteriorRing();a++){var l=n.getInteriorRingN(a),u=t.locateInPolygonRing(e,l);if(u===O.INTERIOR)return O.EXTERIOR;if(u===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}else if(arguments[0]instanceof N&&arguments[1]instanceof ge){var c=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(c))return O.EXTERIOR;var f=h.getCoordinates();return!h.isClosed()&&(c.equals(f[0])||c.equals(f[f.length-1]))?O.BOUNDARY:W.isOnLine(c,f)?O.INTERIOR:O.EXTERIOR}else if(arguments[0]instanceof N&&arguments[1]instanceof $n){var d=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(d)?O.INTERIOR:O.EXTERIOR}},$r.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?W.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},$r.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},$r.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},$r.prototype.computeLocation=function(t,e){var n=this;if(e instanceof $n&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ge)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ae)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof fa)for(var i=e,o=0;o<i.getNumGeometries();o++){var a=i.getGeometryN(o);n.updateLocationInfo(n.locateInternal(t,a))}else if(e instanceof Ji)for(var l=e,u=0;u<l.getNumGeometries();u++){var c=l.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,c))}else if(e instanceof vn)for(var h=new ts(e);h.hasNext();){var f=h.next();f!==e&&n.computeLocation(t,f)}},$r.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof ge?this.locateInternal(t,e):e instanceof Ae?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)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Cn=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._component=n,this._segIndex=i,this._pt=o}},_T={INSIDE_AREA:{configurable:!0}};Cn.prototype.isInsideArea=function(){return this._segIndex===Cn.INSIDE_AREA},Cn.prototype.getCoordinate=function(){return this._pt},Cn.prototype.getGeometryComponent=function(){return this._component},Cn.prototype.getSegmentIndex=function(){return this._segIndex},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},_T.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cn,_T);var Co=function(t){this._pts=t||null};Co.prototype.filter=function(t){t instanceof $n&&this._pts.add(t)},Co.prototype.interfaces_=function(){return[_i]},Co.prototype.getClass=function(){return Co},Co.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof $n?Jr.singletonList(t):Co.getPoints(t,new j)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof $n?n.add(e):e instanceof vn&&e.apply(new Co(n)),n}};var yl=function(){this._locations=null;var t=arguments[0];this._locations=t};yl.prototype.filter=function(t){(t instanceof $n||t instanceof ge||t instanceof Ae)&&this._locations.add(new Cn(t,0,t.getCoordinate()))},yl.prototype.interfaces_=function(){return[_i]},yl.prototype.getClass=function(){return yl},yl.getLocations=function(t){var e=new j;return t.apply(new yl(e)),e};var rn=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new $r,this._minDistanceLocation=null,this._minDistance=ut.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=o}};rn.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=1-n,a=Us.getPolygons(this._geom[n]);if(a.size()>0){var l=yl.getLocations(this._geom[o]);if(this.computeContainmentDistance(l,a,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&it(arguments[0],Hr)&&it(arguments[1],Hr)){for(var u=arguments[0],c=arguments[1],h=arguments[2],f=0;f<u.size();f++)for(var d=u.get(f),g=0;g<c.size();g++)if(t.computeContainmentDistance(d,c.get(g),h),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Cn&&arguments[1]instanceof Ae){var p=arguments[0],m=arguments[1],y=arguments[2],E=p.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(E,m))return this._minDistance=0,y[0]=p,y[1]=new Cn(m,E),null}}},rn.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var a=t.get(o),l=0;l<e.size();l++){var u=e.get(l);if(i.computeMinDistance(a,u,n),i._minDistance<=i._terminateDistance)return null}},rn.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=nn.getLines(this._geom[0]),n=nn.getLines(this._geom[1]),i=Co.getPoints(this._geom[0]),o=Co.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},rn.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},rn.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},rn.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},rn.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof ge&&arguments[1]instanceof $n){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),a=n.getCoordinate(),l=0;l<o.length-1;l++){var u=W.distancePointLine(a,o[l],o[l+1]);if(u<t._minDistance){t._minDistance=u;var c=new J(o[l],o[l+1]),h=c.closestPoint(a);i[0]=new Cn(e,l,h),i[1]=new Cn(n,0,a)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ge&&arguments[1]instanceof ge){var f=arguments[0],d=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(d.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),m=d.getCoordinates(),y=0;y<p.length-1;y++)for(var E=0;E<m.length-1;E++){var _=W.distanceLineLine(p[y],p[y+1],m[E],m[E+1]);if(_<t._minDistance){t._minDistance=_;var v=new J(p[y],p[y+1]),x=new J(m[E],m[E+1]),w=v.closestPoints(x);g[0]=new Cn(f,y,w[0]),g[1]=new Cn(d,E,w[1])}if(t._minDistance<=t._terminateDistance)return null}}}},rn.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var a=t.get(o),l=0;l<e.size();l++){var u=e.get(l),c=a.getCoordinate().distance(u.getCoordinate());if(c<i._minDistance&&(i._minDistance=c,n[0]=new Cn(a,0,a.getCoordinate()),n[1]=new Cn(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},rn.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new se("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},rn.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var a=t.get(o),l=0;l<e.size();l++){var u=e.get(l);if(i.computeMinDistance(a,u,n),i._minDistance<=i._terminateDistance)return null}},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.distance=function(t,e){var n=new rn(t,e);return n.distance()},rn.isWithinDistance=function(t,e,n){var i=new rn(t,e,n);return i.distance()<=n},rn.nearestPoints=function(t,e){var n=new rn(t,e);return n.nearestPoints()};var gn=function(){this._pt=[new N,new N],this._distance=ut.NaN,this._isNull=!0};gn.prototype.getCoordinates=function(){return this._pt},gn.prototype.getCoordinate=function(t){return this._pt[t]},gn.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},gn.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){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(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},gn.prototype.toString=function(){return Xr.toLineString(this._pt[0],this._pt[1])},gn.prototype.getDistance=function(){return this._distance},gn.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.computeDistance=function(){if(arguments[2]instanceof gn&&arguments[0]instanceof ge&&arguments[1]instanceof N)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new J,o=t.getCoordinates(),a=0;a<o.length-1;a++){i.setCoordinates(o[a],o[a+1]);var l=i.closestPoint(e);n.setMinimum(l,e)}else if(arguments[2]instanceof gn&&arguments[0]instanceof Ae&&arguments[1]instanceof N){var u=arguments[0],c=arguments[1],h=arguments[2];Ri.computeDistance(u.getExteriorRing(),c,h);for(var f=0;f<u.getNumInteriorRing();f++)Ri.computeDistance(u.getInteriorRingN(f),c,h)}else if(arguments[2]instanceof gn&&arguments[0]instanceof nt&&arguments[1]instanceof N){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ge)Ri.computeDistance(d,g,p);else if(d instanceof Ae)Ri.computeDistance(d,g,p);else if(d instanceof vn)for(var m=d,y=0;y<m.getNumGeometries();y++){var E=m.getGeometryN(y);Ri.computeDistance(E,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof gn&&arguments[0]instanceof J&&arguments[1]instanceof N){var _=arguments[0],v=arguments[1],x=arguments[2],w=_.closestPoint(v);x.setMinimum(w,v)}};var Fr=function(){this._g0=null,this._g1=null,this._ptDist=new gn,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Gv={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Fr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Fr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new se("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Fr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Fr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Fr.prototype.computeOrientedDistance=function(t,e,n){var i=new _l(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new Io(e,this._densifyFrac);t.apply(o),n.setMaximum(o.getMaxPointDistance())}},Fr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},Fr.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Fr(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2],l=new Fr(i,o);return l.setDensifyFraction(a),l.distance()}},Gv.MaxPointDistanceFilter.get=function(){return _l},Gv.MaxDensifiedByFractionDistanceFilter.get=function(){return Io},Object.defineProperties(Fr,Gv);var _l=function(){this._maxPtDist=new gn,this._minPtDist=new gn,this._euclideanDist=new Ri,this._geom=null;var t=arguments[0];this._geom=t};_l.prototype.filter=function(t){this._minPtDist.initialize(),Ri.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},_l.prototype.getMaxPointDistance=function(){return this._maxPtDist},_l.prototype.interfaces_=function(){return[Zi]},_l.prototype.getClass=function(){return _l};var Io=function(){this._maxPtDist=new gn,this._minPtDist=new gn,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Io.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),a=(o.x-i.x)/this._numSubSegs,l=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var c=i.x+u*a,h=i.y+u*l,f=new N(c,h);n._minPtDist.initialize(),Ri.computeDistance(n._geom,f,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},Io.prototype.isDone=function(){return!1},Io.prototype.isGeometryChanged=function(){return!1},Io.prototype.getMaxPointDistance=function(){return this._maxPtDist},Io.prototype.interfaces_=function(){return[Zr]},Io.prototype.getClass=function(){return Io};var nr=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},kv={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};nr.prototype.checkMaximumDistance=function(t,e,n){var i=new Fr(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Xr.toLineString(o[0],o[1])+")"}},nr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=nr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),nr.VERBOSE&&$e.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},nr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ae||this._input instanceof Ji||this._input instanceof vn))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},nr.prototype.getErrorIndicator=function(){return this._errorIndicator},nr.prototype.checkMinimumDistance=function(t,e,n){var i=new rn(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Xr.toLineString(o[0],o[1])+" )"}},nr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},nr.prototype.getErrorLocation=function(){return this._errorLocation},nr.prototype.getPolygonLines=function(t){for(var e=new j,n=new nn(e),i=Us.getPolygons(t),o=i.iterator();o.hasNext();){var a=o.next();a.apply(n)}return t.getFactory().buildGeometry(e)},nr.prototype.getErrorMessage=function(){return this._errMsg},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},kv.VERBOSE.get=function(){return!1},kv.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(nr,kv);var sn=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},zv={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};sn.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},sn.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*sn.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new K(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new K(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")},sn.prototype.checkDistance=function(){var t=new nr(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")},sn.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")},sn.prototype.checkPolygonal=function(){this._result instanceof Ae||this._result instanceof Ji||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},sn.prototype.getErrorIndicator=function(){return this._errorIndicator},sn.prototype.getErrorLocation=function(){return this._errorLocation},sn.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},sn.prototype.report=function(t){if(!sn.VERBOSE)return null;$e.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},sn.prototype.getErrorMessage=function(){return this._errorMsg},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},sn.isValidMsg=function(t,e,n){var i=new sn(t,e,n);return i.isValid()?null:i.getErrorMessage()},sn.isValid=function(t,e,n){var i=new sn(t,e,n);return!!i.isValid()},zv.VERBOSE.get=function(){return!1},zv.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(sn,zv);var Pi=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Pi.prototype.getCoordinates=function(){return this._pts},Pi.prototype.size=function(){return this._pts.length},Pi.prototype.getCoordinate=function(t){return this._pts[t]},Pi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Pi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:fl.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Pi.prototype.setData=function(t){this._data=t},Pi.prototype.getData=function(){return this._data},Pi.prototype.toString=function(){return Xr.toLineString(new ve(this._pts))},Pi.prototype.interfaces_=function(){return[$i]},Pi.prototype.getClass=function(){return Pi};var He=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new j,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};He.prototype.getInteriorIntersection=function(){return this._interiorIntersection},He.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},He.prototype.getIntersectionSegments=function(){return this._intSegments},He.prototype.count=function(){return this._intersectionCount},He.prototype.getIntersections=function(){return this._intersections},He.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},He.prototype.setKeepIntersections=function(t){this._keepIntersections=t},He.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!o)return null}var a=t.getCoordinates()[e],l=t.getCoordinates()[e+1],u=n.getCoordinates()[i],c=n.getCoordinates()[i+1];this._li.computeIntersection(a,l,u,c),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=a,this._intSegments[1]=l,this._intSegments[2]=u,this._intSegments[3]=c,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},He.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},He.prototype.hasIntersection=function(){return this._interiorIntersection!==null},He.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},He.prototype.interfaces_=function(){return[pa]},He.prototype.getClass=function(){return He},He.createAllIntersectionsFinder=function(t){var e=new He(t);return e.setFindAllIntersections(!0),e},He.createAnyIntersectionFinder=function(t){return new He(t)},He.createIntersectionCounter=function(t){var e=new He(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var ti=function(){this._li=new ua,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};ti.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},ti.prototype.getIntersections=function(){return this._segInt.getIntersections()},ti.prototype.isValid=function(){return this.execute(),this._isValid},ti.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},ti.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new He(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Dv;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},ti.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Bs(this.getErrorMessage(),this._segInt.getInteriorIntersection())},ti.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Xr.toLineString(t[0],t[1])+" and "+Xr.toLineString(t[2],t[3])},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.computeIntersections=function(t){var e=new ti(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var _a=function r(){this._nv=null;var t=arguments[0];this._nv=new ti(r.toSegmentStrings(t))};_a.prototype.checkValid=function(){this._nv.checkValid()},_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a},_a.toSegmentStrings=function(t){for(var e=new j,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Pi(i.getCoordinates(),i))}return e},_a.checkValid=function(t){var e=new _a(t);e.checkValid()};var vl=function(t){this._mapOp=t};vl.prototype.map=function(t){for(var e=this,n=new j,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||n.add(o)}return t.getFactory().createGeometryCollection(vt.toGeometryArray(n))},vl.prototype.interfaces_=function(){return[]},vl.prototype.getClass=function(){return vl},vl.map=function(t,e){var n=new vl(e);return n.map(t)};var bi=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new j,this._resultLineList=new j;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};bi.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},bi.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},bi.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},bi.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&ct.isResultOfOp(i,e)&&!o.isCovered()&&(n.add(o),t.setVisitedEdge(!0))},bi.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),a=o.getEdge();if(o.isLineEdge()&&!a.isCoveredSet()){var l=t._op.isCoveredByA(o.getCoordinate());a.setCovered(l)}}},bi.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},bi.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},bi.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;ft.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),ct.isResultOfOp(i,e)&&e===ct.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var El=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new j;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};El.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},El.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===ct.INTERSECTION)){var o=i.getLabel();ct.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},El.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var Gn=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Gn.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Gn.prototype.transformPolygon=function(t,e){var n=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Ki)||o.isEmpty())&&(i=!1);for(var a=new j,l=0;l<t.getNumInteriorRing();l++){var u=n.transformLinearRing(t.getInteriorRingN(l),t);u===null||u.isEmpty()||(u instanceof Ki||(i=!1),a.add(u))}if(i)return this._factory.createPolygon(o,a.toArray([]));var c=new j;return o!==null&&c.add(o),c.addAll(a),this._factory.buildGeometry(c)},Gn.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Gn.prototype.getInputGeometry=function(){return this._inputGeom},Gn.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new j,o=0;o<t.getNumGeometries();o++){var a=n.transformLineString(t.getGeometryN(o),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)},Gn.prototype.transformCoordinates=function(t,e){return this.copy(t)},Gn.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Gn.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new j,o=0;o<t.getNumGeometries();o++){var a=n.transformPoint(t.getGeometryN(o),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)},Gn.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new j,o=0;o<t.getNumGeometries();o++){var a=n.transformPolygon(t.getGeometryN(o),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)},Gn.prototype.copy=function(t){return t.copy()},Gn.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new j,o=0;o<t.getNumGeometries();o++){var a=n.transform(t.getGeometryN(o));a!==null&&(n._pruneEmptyGeometry&&a.isEmpty()||i.add(a))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(vt.toGeometryArray(i)):this._factory.buildGeometry(i)},Gn.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof $n)return this.transformPoint(t,null);if(t instanceof ku)return this.transformMultiPoint(t,null);if(t instanceof Ki)return this.transformLinearRing(t,null);if(t instanceof ge)return this.transformLineString(t,null);if(t instanceof fa)return this.transformMultiLineString(t,null);if(t instanceof Ae)return this.transformPolygon(t,null);if(t instanceof Ji)return this.transformMultiPolygon(t,null);if(t instanceof vn)return this.transformGeometryCollection(t,null);throw new se("Unknown Geometry subtype: "+t.getClass().getName())},Gn.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var is=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new J,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ge&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};is.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var a=t.get(o),l=n.findSnapForVertex(a,e);l!==null&&(t.set(o,new N(l)),o===0&&n._isClosed&&t.set(t.size()-1,new N(l)))}},is.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},is.prototype.snapTo=function(t){var e=new Ih(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},is.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var a=e[o],l=n.findSegmentIndexToSnap(a,t);l>=0&&t.add(l+1,new N(a),!1)}},is.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=ut.MAX_VALUE,o=-1,a=0;a<e.size()-1;a++){if(n._seg.p0=e.get(a),n._seg.p1=e.get(a+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var l=n._seg.distance(t);l<n._snapTolerance&&l<i&&(i=l,o=a)}return o},is.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},is.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var xe=function(t){this._srcGeom=t||null},vT={SNAP_PRECISION_FACTOR:{configurable:!0}};xe.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new ET(e,n);return i.transform(this._srcGeom)},xe.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new ET(t,n,!0),o=i.transform(this._srcGeom),a=o;return e&&it(a,_o)&&(a=o.buffer(0)),a},xe.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},xe.prototype.extractTargetCoordinates=function(t){for(var e=new yi,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},xe.prototype.computeMinimumSegmentLength=function(t){for(var e=ut.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe},xe.snap=function(t,e,n){var i=new Array(2).fill(null),o=new xe(t);i[0]=o.snapTo(e,n);var a=new xe(e);return i[1]=a.snapTo(i[0],n),i},xe.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=xe.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Lt.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],a=arguments[1];return Math.min(xe.computeOverlaySnapTolerance(o),xe.computeOverlaySnapTolerance(a))}},xe.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*xe.SNAP_PRECISION_FACTOR;return i},xe.snapToSelf=function(t,e,n){var i=new xe(t);return i.snapToSelf(e,n)},vT.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(xe,vT);var ET=function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var o=new is(n,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var o=n.toCoordinateArray(),a=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Gn),In=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};In.prototype.getCommon=function(){return ut.longBitsToDouble(this._commonBits)},In.prototype.add=function(t){var e=ut.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=In.signExpBits(this._commonBits),this._isFirst=!1,null;var n=In.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=In.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=In.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},In.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=ut.longBitsToDouble(t),n=ut.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64),a=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return a}},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.getBit=function(t,e){var n=1<<e;return t&n?1:0},In.signExpBits=function(t){return t>>52},In.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,o=t&i;return o},In.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(In.getBit(t,i)!==In.getBit(e,i))return n;n++}return 52};var To=function(){this._commonCoord=null,this._ccFilter=new xl},Uv={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};To.prototype.addCommonBits=function(t){var e=new Ro(this._commonCoord);t.apply(e),t.geometryChanged()},To.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new N(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Ro(e);return t.apply(n),t.geometryChanged(),t},To.prototype.getCommonCoordinate=function(){return this._commonCoord},To.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},To.prototype.interfaces_=function(){return[]},To.prototype.getClass=function(){return To},Uv.CommonCoordinateFilter.get=function(){return xl},Uv.Translater.get=function(){return Ro},Object.defineProperties(To,Uv);var xl=function(){this._commonBitsX=new In,this._commonBitsY=new In};xl.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},xl.prototype.getCommonCoordinate=function(){return new N(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},xl.prototype.interfaces_=function(){return[Zi]},xl.prototype.getClass=function(){return xl};var Ro=function(){this.trans=null;var t=arguments[0];this.trans=t};Ro.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},Ro.prototype.isDone=function(){return!1},Ro.prototype.isGeometryChanged=function(){return!0},Ro.prototype.interfaces_=function(){return[Zr]},Ro.prototype.getClass=function(){return Ro};var qe=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()};qe.prototype.selfSnap=function(t){var e=new xe(t),n=e.snapTo(t,this._snapTolerance);return n},qe.prototype.removeCommonBits=function(t){this._cbr=new To,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},qe.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},qe.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=ct.overlayOp(e[0],e[1],t);return this.prepareResult(n)},qe.prototype.checkValid=function(t){t.isValid()||$e.out.println("Snapped geometry is invalid")},qe.prototype.computeSnapTolerance=function(){this._snapTolerance=xe.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},qe.prototype.snap=function(t){var e=this.removeCommonBits(t),n=xe.snap(e[0],e[1],this._snapTolerance);return n},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.overlayOp=function(t,e,n){var i=new qe(t,e);return i.getResultGeometry(n)},qe.union=function(t,e){return qe.overlayOp(t,e,ct.UNION)},qe.intersection=function(t,e){return qe.overlayOp(t,e,ct.INTERSECTION)},qe.symDifference=function(t,e){return qe.overlayOp(t,e,ct.SYMDIFFERENCE)},qe.difference=function(t,e){return qe.overlayOp(t,e,ct.DIFFERENCE)};var Tn=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Tn.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=ct.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(n=!0)}catch(a){if(a instanceof Ls)i=a;else throw a}finally{}if(!n)try{e=qe.overlayOp(this._geom[0],this._geom[1],t)}catch(a){throw a instanceof Ls?i:a}finally{}return e},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.overlayOp=function(t,e,n){var i=new Tn(t,e);return i.getResultGeometry(n)},Tn.union=function(t,e){return Tn.overlayOp(t,e,ct.UNION)},Tn.intersection=function(t,e){return Tn.overlayOp(t,e,ct.INTERSECTION)},Tn.symDifference=function(t,e){return Tn.overlayOp(t,e,ct.SYMDIFFERENCE)},Tn.difference=function(t,e){return Tn.overlayOp(t,e,ct.DIFFERENCE)};var zh=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};zh.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},zh.prototype.interfaces_=function(){return[]},zh.prototype.getClass=function(){return zh};var rr=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=o}},Vv={INSERT:{configurable:!0},DELETE:{configurable:!0}};rr.prototype.isDelete=function(){return this._eventType===rr.DELETE},rr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},rr.prototype.getObject=function(){return this._obj},rr.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},rr.prototype.getInsertEvent=function(){return this._insertEvent},rr.prototype.isInsert=function(){return this._eventType===rr.INSERT},rr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},rr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},rr.prototype.interfaces_=function(){return[Pr]},rr.prototype.getClass=function(){return rr},Vv.INSERT.get=function(){return 1},Vv.DELETE.get=function(){return 2},Object.defineProperties(rr,Vv);var Og=function(){};Og.prototype.interfaces_=function(){return[]},Og.prototype.getClass=function(){return Og};var on=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};on.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(on.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},on.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},on.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},on.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},on.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},on.prototype.hasProperIntersection=function(){return this._hasProper},on.prototype.hasIntersection=function(){return this._hasIntersection},on.prototype.isDone=function(){return this._isDone},on.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},on.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},on.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],l=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,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))))},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},on.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Uz=function(r){function t(){r.call(this),this.events=new j,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;Jr.sort(this.events);for(var i=0;i<this.events.size();i++){var o=n.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var a=n.events.get(o);if(a.isInsert()&&n.processOverlaps(o,a.getDeleteEventIndex(),a,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof on&&it(arguments[0],Hr)&&it(arguments[1],Hr)){var l=arguments[0],u=arguments[1],c=arguments[2];this.addEdges(l,l),this.addEdges(u,u),this.computeIntersections(c)}else if(typeof arguments[2]=="boolean"&&it(arguments[0],Hr)&&arguments[1]instanceof on){var h=arguments[0],f=arguments[1],d=arguments[2];d?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(f)}}},t.prototype.addEdge=function(n,i){for(var o=this,a=n.getMonotoneChainEdge(),l=a.getStartIndexes(),u=0;u<l.length-1;u++){var c=new zh(a,u),h=new rr(i,a.getMinX(u),c);o.events.add(h),o.events.add(new rr(a.getMaxX(u),h))}},t.prototype.processOverlaps=function(n,i,o,a){for(var l=this,u=o.getObject(),c=n;c<i;c++){var h=l.events.get(c);if(h.isInsert()){var f=h.getObject();o.isSameLabel(h)||(u.computeIntersections(f,a),l.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var a=o.next();n.addEdge(a,a)}else if(arguments.length===2)for(var l=arguments[0],u=arguments[1],c=l.iterator();c.hasNext();){var h=c.next();n.addEdge(h,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Og),ss=function(){this._min=ut.POSITIVE_INFINITY,this._max=ut.NEGATIVE_INFINITY},xT={NodeComparator:{configurable:!0}};ss.prototype.getMin=function(){return this._min},ss.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},ss.prototype.getMax=function(){return this._max},ss.prototype.toString=function(){return Xr.toLineString(new N(this._min,0),new N(this._max,0))},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss},xT.NodeComparator.get=function(){return Uh},Object.defineProperties(ss,xT);var Uh=function(){};Uh.prototype.compare=function(t,e){var n=t,i=e,o=(n._min+n._max)/2,a=(i._min+i._max)/2;return o<a?-1:o>a?1:0},Uh.prototype.interfaces_=function(){return[Pu]},Uh.prototype.getClass=function(){return Uh};var Vz=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ss),jz=function(r){function t(){r.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 r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,o),this._node2!==null&&this._node2.query(n,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ss),os=function(){this._leaves=new j,this._root=null,this._level=0};os.prototype.buildTree=function(){var t=this;Jr.sort(this._leaves,new ss.NodeComparator);for(var e=this._leaves,n=null,i=new j;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},os.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Vz(t,e,n))},os.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},os.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},os.prototype.printNode=function(t){$e.out.println(Xr.toLineString(new N(t._min,this._level),new N(t._max,this._level)))},os.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},os.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),o=n+1<t.size()?t.get(n):null;if(o===null)e.add(i);else{var a=new jz(t.get(n),t.get(n+1));e.add(a)}}},os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os};var Xu=function(){this._items=new j};Xu.prototype.visitItem=function(t){this._items.add(t)},Xu.prototype.getItems=function(){return this._items},Xu.prototype.interfaces_=function(){return[vo]},Xu.prototype.getClass=function(){return Xu};var Hu=function(){this._index=null;var t=arguments[0];if(!it(t,_o))throw new se("Argument must be Polygonal");this._index=new va(t)},jv={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Hu.prototype.locate=function(t){var e=new mi(t),n=new qu(e);return this._index.query(t.y,t.y,n),e.getLocation()},Hu.prototype.interfaces_=function(){return[ju]},Hu.prototype.getClass=function(){return Hu},jv.SegmentVisitor.get=function(){return qu},jv.IntervalIndexedGeometry.get=function(){return va},Object.defineProperties(Hu,jv);var qu=function(){this._counter=null;var t=arguments[0];this._counter=t};qu.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},qu.prototype.interfaces_=function(){return[vo]},qu.prototype.getClass=function(){return qu};var va=function(){this._index=new os;var t=arguments[0];this.init(t)};va.prototype.init=function(t){for(var e=this,n=nn.getLines(t),i=n.iterator();i.hasNext();){var o=i.next(),a=o.getCoordinates();e.addLine(a)}},va.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new J(t[n-1],t[n]),o=Math.min(i.p0.y,i.p1.y),a=Math.max(i.p0.y,i.p1.y);e._index.insert(o,a,i)}},va.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Xu;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2];this._index.query(i,o,a)}},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var Vh=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new nT,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new $r,arguments.length===2){var e=arguments[0],n=arguments[1],i=Ar.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];this._argIndex=o,this._parentGeom=a,this._boundaryNodeRule=l,a!==null&&this.add(a)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var o=this._nodes.addNode(i),a=o.getLabel(),l=1,u=O.NONE;u=a.getLocation(n,U.ON),u===O.BOUNDARY&&l++;var c=t.determineBoundary(this._boundaryNodeRule,l);a.setLocation(n,c)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2],u=new on(o,!0,!1);u.setIsDoneIfProperInt(l);var c=this.createEdgeSetIntersector(),h=this._parentGeom instanceof Ki||this._parentGeom instanceof Ae||this._parentGeom instanceof Ji,f=a||!h;return c.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,o){var a=new on(i,o,!0);a.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var l=this.createEdgeSetIntersector();return l.computeIntersections(this._edges,n._edges,a),a},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof $n){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,O.INTERIOR)}else if(arguments[0]instanceof N){var o=arguments[0];this.insertPoint(this._argIndex,o,O.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o);i.addPolygonRing(a,O.INTERIOR,O.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],O.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],O.BOUNDARY)},t.prototype.addLineString=function(n){var i=_t.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Ng(i,new kt(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(n,o),this.insertEdge(o),ft.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),o=0,a=n.iterator();a.hasNext();){var l=a.next();i[o++]=l.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,o){if(this.isBoundaryNode(n,i))return null;o===O.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,o)},t.prototype.addPolygonRing=function(n,i,o){if(n.isEmpty())return null;var a=_t.removeRepeatedPoints(n.getCoordinates());if(a.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=a[0],null;var l=i,u=o;W.isCCW(a)&&(l=o,u=i);var c=new Ng(a,new kt(this._argIndex,O.BOUNDARY,l,u));this._lineEdgeMap.put(n,c),this.insertEdge(c),this.insertPoint(this._argIndex,a[0],O.BOUNDARY)},t.prototype.insertPoint=function(n,i,o){var a=this._nodes.addNode(i),l=a.getLabel();l===null?a._label=new kt(n,o):l.setLocation(n,o)},t.prototype.createEdgeSetIntersector=function(){return new Uz},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var a=o.next(),l=a.getLabel().getLocation(n),u=a.eiList.iterator();u.hasNext();){var c=u.next();i.addSelfIntersectionNode(n,c.coord,l)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Ji&&(this._useBoundaryDeterminationRule=!1),n instanceof Ae)this.addPolygon(n);else if(n instanceof ge)this.addLineString(n);else if(n instanceof $n)this.addPoint(n);else if(n instanceof ku)this.addCollection(n);else if(n instanceof fa)this.addCollection(n);else if(n instanceof Ji)this.addCollection(n);else if(n instanceof vn)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,o=0;o<n.getNumGeometries();o++){var a=n.getGeometryN(o);i.add(a)}},t.prototype.locate=function(n){return it(this._parentGeom,_o)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Hu(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?O.BOUNDARY:O.INTERIOR},t}(le),Zu=function(){if(this._li=new ua,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Vh(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=Ar.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 Vh(0,e,i),this._arg[1]=new Vh(1,n,i)}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];o.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vh(0,o,l),this._arg[1]=new Vh(1,a,l)}};Zu.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Zu.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu};var Ea=function(){};Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea},Ea.map=function(){if(arguments[0]instanceof nt&&it(arguments[1],Ea.MapOp)){for(var t=arguments[0],e=arguments[1],n=new j,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&n.add(o)}return t.getFactory().buildGeometry(n)}else if(it(arguments[0],be)&&it(arguments[1],Ea.MapOp)){for(var a=arguments[0],l=arguments[1],u=new j,c=a.iterator();c.hasNext();){var h=c.next(),f=l.map(h);f!==null&&u.add(f)}return u}},Ea.MapOp=function(){};var ct=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new $r,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Qr,this._resultPolyList=new j,this._resultLineList=new j,this._resultPointList=new j,this._graph=new le(new fT),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var o=i.getLabel(),a=n.getLabel();i.isPointwiseEqual(n)||(a=new kt(n.getLabel()),a.flip());var l=i.getDepth();l.isNull()&&l.add(o),l.add(a),o.merge(a)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,o,a){var l=new j;return l.addAll(n),l.addAll(i),l.addAll(o),l.isEmpty()?t.createEmptyResult(a,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(l)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var o=this,a=i.iterator();a.hasNext();){var l=a.next(),u=o._ptLocator.locate(n,l);if(u!==O.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new j,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),n.add(o.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,o=n.iterator();o.hasNext();){var a=o.next();i.insertUniqueEdge(a)}},t.prototype.computeOverlay=function(n){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 i=new j;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),_a.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var o=new tr(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var a=new bi(this,this._geomFact,this._ptLocator);this._resultLineList=a.build(n);var l=new El(this,this._geomFact,this._ptLocator);this._resultPointList=l.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var o=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(n){for(var i=this,o=this._arg[n].getNodeIterator();o.hasNext();){var a=o.next(),l=i._graph.addNode(a.getCoordinate());l.setLabel(n,a.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),a=o.getLabel();a.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(a.getLocation(0,U.RIGHT),a.getLocation(1,U.RIGHT),n)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),o=i.getLabel(),a=i.getDepth();if(!a.isNull()){a.normalize();for(var l=0;l<2;l++)!o.isNull(l)&&o.isArea()&&!a.isNull(l)&&(a.getDelta(l)===0?o.toLine(l):(ft.isTrue(!a.isNull(l,U.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(l,U.LEFT,a.getLocation(l,U.LEFT)),ft.isTrue(!a.isNull(l,U.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(l,U.RIGHT,a.getLocation(l,U.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),a=o.getLabel();o.isIsolated()&&(a.isNull(0)?n.labelIncompleteNode(o,0):n.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(a)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Zu);ct.overlayOp=function(r,t,e){var n=new ct(r,t),i=n.getResultGeometry(e);return i},ct.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return ct.createEmptyResult(ct.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return vl.map(r,{interfaces_:function(){return[Ea.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),Tn.overlayOp(r,t,ct.INTERSECTION)},ct.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return ct.createEmptyResult(ct.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),Tn.overlayOp(r,t,ct.SYMDIFFERENCE)},ct.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),o=-1;switch(r){case ct.INTERSECTION:o=Math.min(n,i);break;case ct.UNION:o=Math.max(n,i);break;case ct.DIFFERENCE:o=n;break;case ct.SYMDIFFERENCE:o=Math.max(n,i);break}return o},ct.createEmptyResult=function(r,t,e,n){var i=null;switch(ct.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},ct.difference=function(r,t){return r.isEmpty()?ct.createEmptyResult(ct.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),Tn.overlayOp(r,t,ct.DIFFERENCE))},ct.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return ct.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),a){case ct.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case ct.UNION:return i===O.INTERIOR||o===O.INTERIOR;case ct.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case ct.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},ct.INTERSECTION=1,ct.UNION=2,ct.DIFFERENCE=3,ct.SYMDIFFERENCE=4;var Po=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new $r,this._seg=new J;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Po.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),o=i.getCoordinateSequence(),a=0;a<o.size()-1;a++){o.getCoordinate(a,e._seg.p0),o.getCoordinate(a+1,e._seg.p1);var l=e._seg.distance(t);if(l<=e._boundaryDistanceTolerance)return!0}return!1},Po.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Po.prototype.extractLinework=function(t){var e=new Ku;t.apply(e);var n=e.getLinework(),i=vt.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},Po.prototype.interfaces_=function(){return[]},Po.prototype.getClass=function(){return Po};var Ku=function(){this._linework=null,this._linework=new j};Ku.prototype.getLinework=function(){return this._linework},Ku.prototype.filter=function(t){var e=this;if(t instanceof Ae){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},Ku.prototype.interfaces_=function(){return[_i]},Ku.prototype.getClass=function(){return Ku};var xa=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};xa.prototype.extractPoints=function(t,e,n){for(var i=this,o=t.getCoordinates(),a=0;a<o.length-1;a++)i.computeOffsetPoints(o[a],o[a+1],e,n)},xa.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},xa.prototype.getPoints=function(t){for(var e=this,n=new j,i=nn.getLines(this._g),o=i.iterator();o.hasNext();){var a=o.next();e.extractPoints(a,t,n)}return n},xa.prototype.computeOffsetPoints=function(t,e,n,i){var o=e.x-t.x,a=e.y-t.y,l=Math.sqrt(o*o+a*a),u=n*o/l,c=n*a/l,h=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var d=new N(h-c,f+u);i.add(d)}if(this._doRight){var g=new N(h+c,f-u);i.add(g)}},xa.prototype.interfaces_=function(){return[]},xa.prototype.getClass=function(){return xa};var mr=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new j;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new Po(this._geom[0],this._boundaryDistanceTolerance),new Po(this._geom[1],this._boundaryDistanceTolerance),new Po(this._geom[2],this._boundaryDistanceTolerance)]},wT={TOLERANCE:{configurable:!0}};mr.prototype.reportResult=function(t,e,n){$e.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},mr.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},mr.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],a=arguments[1];return this._location[0]=this._locFinder[0].getLocation(a),this._location[1]=this._locFinder[1].getLocation(a),this._location[2]=this._locFinder[2].getLocation(a),mr.hasLocation(this._location,O.BOUNDARY)?!0:this.isValidResult(o,this._location)}},mr.prototype.addTestPts=function(t){var e=new xa(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},mr.prototype.isValidResult=function(t,e){var n=ct.isResultOfOp(e[0],e[1],t),i=e[2]===O.INTERIOR,o=!(n^i);return o||this.reportResult(t,e,n),o},mr.prototype.getInvalidLocation=function(){return this._invalidLocation},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},mr.computeBoundaryDistanceTolerance=function(t,e){return Math.min(xe.computeSizeBasedSnapTolerance(t),xe.computeSizeBasedSnapTolerance(e))},mr.isValid=function(t,e,n,i){var o=new mr(t,e,i);return o.isValid(n)},wT.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(mr,wT);var yr=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};yr.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);n._skipEmpty&&o.isEmpty()||e.add(o)}},yr.prototype.combine=function(){for(var t=this,e=new j,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},yr.combine=function(){if(arguments.length===1){var t=arguments[0],e=new yr(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new yr(yr.createList(n,i));return o.combine()}else if(arguments.length===3){var a=arguments[0],l=arguments[1],u=arguments[2],c=new yr(yr.createList(a,l,u));return c.combine()}},yr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},yr.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new j;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],a=arguments[2],l=new j;return l.add(i),l.add(o),l.add(a),l}};var Te=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new j)},ST={STRTREE_NODE_CAPACITY:{configurable:!0}};Te.prototype.reduceToGeometries=function(t){for(var e=this,n=new j,i=t.iterator();i.hasNext();){var o=i.next(),a=null;it(o,Hr)?a=e.unionTree(o):o instanceof nt&&(a=o),n.add(a)}return n},Te.prototype.extractByEnvelope=function(t,e,n){for(var i=new j,o=0;o<e.getNumGeometries();o++){var a=e.getGeometryN(o);a.getEnvelopeInternal().intersects(t)?i.add(a):n.add(a)}return this._geomFactory.buildGeometry(i)},Te.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var o=yr.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var a=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,a)},Te.prototype.union=function(){if(this._inputPolys===null)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 oT(Te.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},Te.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var o=Te.getGeometry(e,n);return this.unionSafe(o,null)}else{if(i-n===2)return this.unionSafe(Te.getGeometry(e,n),Te.getGeometry(e,n+1));var a=Math.trunc((i+n)/2),l=this.binaryUnion(e,n,a),u=this.binaryUnion(e,a,i);return this.unionSafe(l,u)}}},Te.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},Te.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Te.prototype.unionActual=function(t,e){return Te.restrictToPolygons(t.union(e))},Te.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},Te.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new j,o=this.extractByEnvelope(n,t,i),a=this.extractByEnvelope(n,e,i),l=this.unionActual(o,a);i.add(l);var u=yr.combine(i);return u},Te.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],a=arguments[1],l=o.getFactory(),u=l.createGeometryCollection([o,a]),c=u.buffer(0);return c}},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.restrictToPolygons=function(t){if(it(t,_o))return t;var e=Us.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(vt.toPolygonArray(e))},Te.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Te.union=function(t){var e=new Te(t);return e.union()},ST.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Te,ST);var Fg=function(){};Fg.prototype.interfaces_=function(){return[]},Fg.prototype.getClass=function(){return Fg},Fg.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return ct.createEmptyResult(ct.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Tn.overlayOp(t,e,ct.UNION)};function wa(){return new Dg}function Dg(){this.reset()}Dg.prototype={constructor:Dg,reset:function(){this.s=this.t=0},add:function(r){CT(Bg,r,this.t),CT(this,Bg.s,this.s),this.s?this.t+=Bg.t:this.s=Bg.t},valueOf:function(){return this.s}};var Bg=new Dg;function CT(r,t,e){var n=r.s=t+e,i=n-t,o=n-i;r.t=t-o+(e-i)}var me=1e-6,Xt=Math.PI,Vs=Xt/2,IT=Xt/4,js=Xt*2,Sa=180/Xt,Ai=Xt/180,Rn=Math.abs,Wz=Math.atan,Ju=Math.atan2,Me=Math.cos,Ne=Math.sin,Qu=Math.sqrt;function TT(r){return r>1?0:r<-1?Xt:Math.acos(r)}function wl(r){return r>1?Vs:r<-1?-Vs:Math.asin(r)}function jh(){}function Gg(r,t){r&&PT.hasOwnProperty(r.type)&&PT[r.type](r,t)}var RT={Feature:function(r,t){Gg(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)Gg(e[n].geometry,t)}},PT={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){Wv(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Wv(e[n],t,0)},Polygon:function(r,t){bT(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)bT(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)Gg(e[n],t)}};function Wv(r,t,e){var n=-1,i=r.length-e,o;for(t.lineStart();++n<i;)o=r[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function bT(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)Wv(r[e],t,1);t.polygonEnd()}function Yz(r,t){r&&RT.hasOwnProperty(r.type)?RT[r.type](r,t):Gg(r,t)}wa(),wa();function Yv(r){return[Ju(r[1],r[0]),wl(r[2])]}function $u(r){var t=r[0],e=r[1],n=Me(e);return[n*Me(t),n*Ne(t),Ne(e)]}function kg(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function zg(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function Xv(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function Ug(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function Hv(r){var t=Qu(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}wa();function AT(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function qv(r,t){return[r>Xt?r-js:r<-Xt?r+js:r,t]}qv.invert=qv;function Xz(r,t,e){return(r%=js)?t||e?AT(MT(r),NT(t,e)):MT(r):t||e?NT(t,e):qv}function LT(r){return function(t,e){return t+=r,[t>Xt?t-js:t<-Xt?t+js:t,e]}}function MT(r){var t=LT(r);return t.invert=LT(-r),t}function NT(r,t){var e=Me(r),n=Ne(r),i=Me(t),o=Ne(t);function a(l,u){var c=Me(u),h=Me(l)*c,f=Ne(l)*c,d=Ne(u),g=d*e+h*n;return[Ju(f*i-g*o,h*e-d*n),wl(g*i+f*o)]}return a.invert=function(l,u){var c=Me(u),h=Me(l)*c,f=Ne(l)*c,d=Ne(u),g=d*i-f*o;return[Ju(f*i+d*o,h*e+g*n),wl(g*e-h*n)]},a}function Hz(r,t,e,n,i,o){if(e){var a=Me(t),l=Ne(t),u=n*e;i==null?(i=t+n*js,o=t-u/2):(i=OT(a,i),o=OT(a,o),(n>0?i<o:i>o)&&(i+=n*js));for(var c,h=i;n>0?h>o:h<o;h-=u)c=Yv([a,-l*Me(h),-l*Ne(h)]),r.point(c[0],c[1])}}function OT(r,t){t=$u(t),t[0]-=r,Hv(t);var e=TT(-t[1]);return((-t[2]<0?-e:e)+js-me)%js}function FT(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:jh,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function qz(r,t,e,n,i,o){var a=r[0],l=r[1],u=t[0],c=t[1],h=0,f=1,d=u-a,g=c-l,p;if(p=e-a,!(!d&&p>0)){if(p/=d,d<0){if(p<h)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>h&&(h=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>h&&(h=p)}else if(d>0){if(p<h)return;p<f&&(f=p)}if(p=n-l,!(!g&&p>0)){if(p/=g,g<0){if(p<h)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>h&&(h=p)}if(p=o-l,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>h&&(h=p)}else if(g>0){if(p<h)return;p<f&&(f=p)}return h>0&&(r[0]=a+h*d,r[1]=l+h*g),f<1&&(t[0]=a+f*d,t[1]=l+f*g),!0}}}}}function Vg(r,t){return Rn(r[0]-t[0])<me&&Rn(r[1]-t[1])<me}function jg(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function DT(r,t,e,n,i){var o=[],a=[],l,u;if(r.forEach(function(p){if(!((m=p.length-1)<=0)){var m,y=p[0],E=p[m],_;if(Vg(y,E)){for(i.lineStart(),l=0;l<m;++l)i.point((y=p[l])[0],y[1]);i.lineEnd();return}o.push(_=new jg(y,p,null,!0)),a.push(_.o=new jg(y,null,_,!1)),o.push(_=new jg(E,p,null,!1)),a.push(_.o=new jg(E,null,_,!0))}}),!!o.length){for(a.sort(t),BT(o),BT(a),l=0,u=a.length;l<u;++l)a[l].e=e=!e;for(var c=o[0],h,f;;){for(var d=c,g=!0;d.v;)if((d=d.n)===c)return;h=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(g)for(l=0,u=h.length;l<u;++l)i.point((f=h[l])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(g)for(h=d.p.z,l=h.length-1;l>=0;--l)i.point((f=h[l])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,h=d.z,g=!g}while(!d.v);i.lineEnd()}}}function BT(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function GT(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function Zz(r){return r.length===1&&(r=Kz(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)<0?n=o+1:i=o}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)>0?i=o:n=o+1}return n}}}function Kz(r){return function(t,e){return GT(r(t),e)}}Zz(GT);function kT(r){for(var t=r.length,e,n=-1,i=0,o,a;++n<t;)i+=r[n].length;for(o=new Array(i);--t>=0;)for(a=r[t],e=a.length;--e>=0;)o[--i]=a[e];return o}var Wh=1e9,Wg=-Wh;function Jz(r,t,e,n){function i(c,h){return r<=c&&c<=e&&t<=h&&h<=n}function o(c,h,f,d){var g=0,p=0;if(c==null||(g=a(c,f))!==(p=a(h,f))||u(c,h)<0^f>0)do d.point(g===0||g===3?r:e,g>1?n:t);while((g=(g+f+4)%4)!==p);else d.point(h[0],h[1])}function a(c,h){return Rn(c[0]-r)<me?h>0?0:3:Rn(c[0]-e)<me?h>0?2:1:Rn(c[1]-t)<me?h>0?1:0:h>0?3:2}function l(c,h){return u(c.x,h.x)}function u(c,h){var f=a(c,1),d=a(h,1);return f!==d?f-d:f===0?h[1]-c[1]:f===1?c[0]-h[0]:f===2?c[1]-h[1]:h[0]-c[0]}return function(c){var h=c,f=FT(),d,g,p,m,y,E,_,v,x,w,I,C={point:T,lineStart:b,lineEnd:A,polygonStart:M,polygonEnd:P};function T(B,F){i(B,F)&&h.point(B,F)}function R(){for(var B=0,F=0,V=g.length;F<V;++F)for(var Y=g[F],st=1,Q=Y.length,et=Y[0],H,Et,G=et[0],bt=et[1];st<Q;++st)H=G,Et=bt,et=Y[st],G=et[0],bt=et[1],Et<=n?bt>n&&(G-H)*(n-Et)>(bt-Et)*(r-H)&&++B:bt<=n&&(G-H)*(n-Et)<(bt-Et)*(r-H)&&--B;return B}function M(){h=f,d=[],g=[],I=!0}function P(){var B=R(),F=I&&B,V=(d=kT(d)).length;(F||V)&&(c.polygonStart(),F&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),V&&DT(d,l,B,o,c),c.polygonEnd()),h=c,d=g=p=null}function b(){C.point=L,g&&g.push(p=[]),w=!0,x=!1,_=v=NaN}function A(){d&&(L(m,y),E&&x&&f.rejoin(),d.push(f.result())),C.point=T,x&&h.lineEnd()}function L(B,F){var V=i(B,F);if(g&&p.push([B,F]),w)m=B,y=F,E=V,w=!1,V&&(h.lineStart(),h.point(B,F));else if(V&&x)h.point(B,F);else{var Y=[_=Math.max(Wg,Math.min(Wh,_)),v=Math.max(Wg,Math.min(Wh,v))],st=[B=Math.max(Wg,Math.min(Wh,B)),F=Math.max(Wg,Math.min(Wh,F))];qz(Y,st,r,t,e,n)?(x||(h.lineStart(),h.point(Y[0],Y[1])),h.point(st[0],st[1]),V||h.lineEnd(),I=!1):V&&(h.lineStart(),h.point(B,F),I=!1)}_=B,v=F,x=V}return C}}var Zv=wa();function Qz(r,t){var e=t[0],n=t[1],i=[Ne(e),-Me(e),0],o=0,a=0;Zv.reset();for(var l=0,u=r.length;l<u;++l)if(h=(c=r[l]).length)for(var c,h,f=c[h-1],d=f[0],g=f[1]/2+IT,p=Ne(g),m=Me(g),y=0;y<h;++y,d=_,p=x,m=w,f=E){var E=c[y],_=E[0],v=E[1]/2+IT,x=Ne(v),w=Me(v),I=_-d,C=I>=0?1:-1,T=C*I,R=T>Xt,M=p*x;if(Zv.add(Ju(M*C*Ne(T),m*w+M*Me(T))),o+=R?I+C*js:I,R^d>=e^_>=e){var P=zg($u(f),$u(E));Hv(P);var b=zg(i,P);Hv(b);var A=(R^I>=0?-1:1)*wl(b[2]);(n>A||n===A&&(P[0]||P[1]))&&(a+=R^I>=0?1:-1)}}return(o<-me||o<me&&Zv<-me)^a&1}wa();function zT(r){return r}wa(),wa();var tc=1/0,Yg=tc,Yh=-tc,Xg=Yh,UT={point:$z,lineStart:jh,lineEnd:jh,polygonStart:jh,polygonEnd:jh,result:function(){var r=[[tc,Yg],[Yh,Xg]];return Yh=Xg=-(Yg=tc=1/0),r}};function $z(r,t){r<tc&&(tc=r),r>Yh&&(Yh=r),t<Yg&&(Yg=t),t>Xg&&(Xg=t)}wa();function VT(r,t,e,n){return function(i,o){var a=t(o),l=i.invert(n[0],n[1]),u=FT(),c=t(u),h=!1,f,d,g,p={point:m,lineStart:E,lineEnd:_,polygonStart:function(){p.point=v,p.lineStart=x,p.lineEnd=w,d=[],f=[]},polygonEnd:function(){p.point=m,p.lineStart=E,p.lineEnd=_,d=kT(d);var I=Qz(f,l);d.length?(h||(o.polygonStart(),h=!0),DT(d,eU,I,e,o)):I&&(h||(o.polygonStart(),h=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),h&&(o.polygonEnd(),h=!1),d=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function m(I,C){var T=i(I,C);r(I=T[0],C=T[1])&&o.point(I,C)}function y(I,C){var T=i(I,C);a.point(T[0],T[1])}function E(){p.point=y,a.lineStart()}function _(){p.point=m,a.lineEnd()}function v(I,C){g.push([I,C]);var T=i(I,C);c.point(T[0],T[1])}function x(){c.lineStart(),g=[]}function w(){v(g[0][0],g[0][1]),c.lineEnd();var I=c.clean(),C=u.result(),T,R=C.length,M,P,b;if(g.pop(),f.push(g),g=null,!!R){if(I&1){if(P=C[0],(M=P.length-1)>0){for(h||(o.polygonStart(),h=!0),o.lineStart(),T=0;T<M;++T)o.point((b=P[T])[0],b[1]);o.lineEnd()}return}R>1&&I&2&&C.push(C.pop().concat(C.shift())),d.push(C.filter(tU))}}return p}}function tU(r){return r.length>1}function eU(r,t){return((r=r.x)[0]<0?r[1]-Vs-me:Vs-r[1])-((t=t.x)[0]<0?t[1]-Vs-me:Vs-t[1])}const jT=VT(function(){return!0},nU,iU,[-Xt,-Vs]);function nU(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(o,a){var l=o>0?Xt:-Xt,u=Rn(o-t);Rn(u-Xt)<me?(r.point(t,e=(e+a)/2>0?Vs:-Vs),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(l,e),r.point(o,e),i=0):n!==l&&u>=Xt&&(Rn(t-n)<me&&(t-=n*me),Rn(o-l)<me&&(o-=l*me),e=rU(t,e,o,a),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(l,e),i=0),r.point(t=o,e=a),n=l},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function rU(r,t,e,n){var i,o,a=Ne(r-e);return Rn(a)>me?Wz((Ne(t)*(o=Me(n))*Ne(e)-Ne(n)*(i=Me(t))*Ne(r))/(i*o*a)):(t+n)/2}function iU(r,t,e,n){var i;if(r==null)i=e*Vs,n.point(-Xt,i),n.point(0,i),n.point(Xt,i),n.point(Xt,0),n.point(Xt,-i),n.point(0,-i),n.point(-Xt,-i),n.point(-Xt,0),n.point(-Xt,i);else if(Rn(r[0]-t[0])>me){var o=r[0]<t[0]?Xt:-Xt;i=e*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])}function sU(r,t){var e=Me(r),n=e>0,i=Rn(e)>me;function o(h,f,d,g){Hz(g,r,t,d,h,f)}function a(h,f){return Me(h)*Me(f)>e}function l(h){var f,d,g,p,m;return{lineStart:function(){p=g=!1,m=1},point:function(y,E){var _=[y,E],v,x=a(y,E),w=n?x?0:c(y,E):x?c(y+(y<0?Xt:-Xt),E):0;if(!f&&(p=g=x)&&h.lineStart(),x!==g&&(v=u(f,_),(!v||Vg(f,v)||Vg(_,v))&&(_[0]+=me,_[1]+=me,x=a(_[0],_[1]))),x!==g)m=0,x?(h.lineStart(),v=u(_,f),h.point(v[0],v[1])):(v=u(f,_),h.point(v[0],v[1]),h.lineEnd()),f=v;else if(i&&f&&n^x){var I;!(w&d)&&(I=u(_,f,!0))&&(m=0,n?(h.lineStart(),h.point(I[0][0],I[0][1]),h.point(I[1][0],I[1][1]),h.lineEnd()):(h.point(I[1][0],I[1][1]),h.lineEnd(),h.lineStart(),h.point(I[0][0],I[0][1])))}x&&(!f||!Vg(f,_))&&h.point(_[0],_[1]),f=_,g=x,d=w},lineEnd:function(){g&&h.lineEnd(),f=null},clean:function(){return m|(p&&g)<<1}}}function u(h,f,d){var g=$u(h),p=$u(f),m=[1,0,0],y=zg(g,p),E=kg(y,y),_=y[0],v=E-_*_;if(!v)return!d&&h;var x=e*E/v,w=-e*_/v,I=zg(m,y),C=Ug(m,x),T=Ug(y,w);Xv(C,T);var R=I,M=kg(C,R),P=kg(R,R),b=M*M-P*(kg(C,C)-1);if(!(b<0)){var A=Qu(b),L=Ug(R,(-M-A)/P);if(Xv(L,C),L=Yv(L),!d)return L;var B=h[0],F=f[0],V=h[1],Y=f[1],st;F<B&&(st=B,B=F,F=st);var Q=F-B,et=Rn(Q-Xt)<me,H=et||Q<me;if(!et&&Y<V&&(st=V,V=Y,Y=st),H?et?V+Y>0^L[1]<(Rn(L[0]-B)<me?V:Y):V<=L[1]&&L[1]<=Y:Q>Xt^(B<=L[0]&&L[0]<=F)){var Et=Ug(R,(-M+A)/P);return Xv(Et,C),[L,Yv(Et)]}}}function c(h,f){var d=n?r:Xt-r,g=0;return h<-d?g|=1:h>d&&(g|=2),f<-d?g|=4:f>d&&(g|=8),g}return VT(a,l,o,n?[0,-r]:[-Xt,r-Xt])}function WT(r){return function(t){var e=new Kv;for(var n in r)e[n]=r[n];return e.stream=t,e}}function Kv(){}Kv.prototype={constructor:Kv,point:function(r,t){this.stream.point(r,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function YT(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o!=null&&r.clipExtent(null),Yz(e,r.stream(UT));var a=UT.result(),l=Math.min(n/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),u=+t[0][0]+(n-l*(a[1][0]+a[0][0]))/2,c=+t[0][1]+(i-l*(a[1][1]+a[0][1]))/2;return o!=null&&r.clipExtent(o),r.scale(l*150).translate([u,c])}function oU(r,t,e){return YT(r,[[0,0],t],e)}var XT=16,aU=Me(30*Ai);function HT(r,t){return+t?uU(r,t):lU(r)}function lU(r){return WT({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function uU(r,t){function e(n,i,o,a,l,u,c,h,f,d,g,p,m,y){var E=c-n,_=h-i,v=E*E+_*_;if(v>4*t&&m--){var x=a+d,w=l+g,I=u+p,C=Qu(x*x+w*w+I*I),T=wl(I/=C),R=Rn(Rn(I)-1)<me||Rn(o-f)<me?(o+f)/2:Ju(w,x),M=r(R,T),P=M[0],b=M[1],A=P-n,L=b-i,B=_*A-E*L;(B*B/v>t||Rn((E*A+_*L)/v-.5)>.3||a*d+l*g+u*p<aU)&&(e(n,i,o,a,l,u,P,b,R,x/=C,w/=C,I,m,y),y.point(P,b),e(P,b,R,x,w,I,c,h,f,d,g,p,m,y))}}return function(n){var i,o,a,l,u,c,h,f,d,g,p,m,y={point:E,lineStart:_,lineEnd:x,polygonStart:function(){n.polygonStart(),y.lineStart=w},polygonEnd:function(){n.polygonEnd(),y.lineStart=_}};function E(T,R){T=r(T,R),n.point(T[0],T[1])}function _(){f=NaN,y.point=v,n.lineStart()}function v(T,R){var M=$u([T,R]),P=r(T,R);e(f,d,h,g,p,m,f=P[0],d=P[1],h=T,g=M[0],p=M[1],m=M[2],XT,n),n.point(f,d)}function x(){y.point=E,n.lineEnd()}function w(){_(),y.point=I,y.lineEnd=C}function I(T,R){v(i=T,R),o=f,a=d,l=g,u=p,c=m,y.point=v}function C(){e(f,d,h,g,p,m,o,a,i,l,u,c,XT,n),y.lineEnd=x,x()}return y}}var cU=WT({point:function(r,t){this.stream.point(r*Ai,t*Ai)}});function hU(r){return fU(function(){return r})()}function fU(r){var t,e=150,n=480,i=250,o,a,l=0,u=0,c=0,h=0,f=0,d,g,p=null,m=jT,y=null,E,_,v,x=zT,w=.5,I=HT(P,w),C,T;function R(L){return L=g(L[0]*Ai,L[1]*Ai),[L[0]*e+o,a-L[1]*e]}function M(L){return L=g.invert((L[0]-o)/e,(a-L[1])/e),L&&[L[0]*Sa,L[1]*Sa]}function P(L,B){return L=t(L,B),[L[0]*e+o,a-L[1]*e]}R.stream=function(L){return C&&T===L?C:C=cU(m(d,I(x(T=L))))},R.clipAngle=function(L){return arguments.length?(m=+L?sU(p=L*Ai,6*Ai):(p=null,jT),A()):p*Sa},R.clipExtent=function(L){return arguments.length?(x=L==null?(y=E=_=v=null,zT):Jz(y=+L[0][0],E=+L[0][1],_=+L[1][0],v=+L[1][1]),A()):y==null?null:[[y,E],[_,v]]},R.scale=function(L){return arguments.length?(e=+L,b()):e},R.translate=function(L){return arguments.length?(n=+L[0],i=+L[1],b()):[n,i]},R.center=function(L){return arguments.length?(l=L[0]%360*Ai,u=L[1]%360*Ai,b()):[l*Sa,u*Sa]},R.rotate=function(L){return arguments.length?(c=L[0]%360*Ai,h=L[1]%360*Ai,f=L.length>2?L[2]%360*Ai:0,b()):[c*Sa,h*Sa,f*Sa]},R.precision=function(L){return arguments.length?(I=HT(P,w=L*L),A()):Qu(w)},R.fitExtent=function(L,B){return YT(R,L,B)},R.fitSize=function(L,B){return oU(R,L,B)};function b(){g=AT(d=Xz(c,h,f),t);var L=t(l,u);return o=n-L[0]*e,a=i+L[1]*e,A()}function A(){return C=T=null,R}return function(){return t=r.apply(this,arguments),R.invert=t.invert&&M,b()}}function qT(r){return function(t,e){var n=Me(t),i=Me(e),o=r(n*i);return[o*i*Ne(t),o*Ne(e)]}}function ZT(r){return function(t,e){var n=Qu(t*t+e*e),i=r(n),o=Ne(i),a=Me(i);return[Ju(t*o,n*a),wl(n&&e*o/n)]}}var dU=qT(function(r){return Qu(2/(1+r))});dU.invert=ZT(function(r){return 2*wl(r/2)});var KT=qT(function(r){return(r=TT(r))&&r/Ne(r)});KT.invert=ZT(function(r){return r});function gU(){return hU(KT).scale(79.4188).clipAngle(180-.001)}function JT(r,t){return[r,t]}JT.invert=JT;function pU(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(r.type){case"GeometryCollection":return Xy(r,function(a){var l=Hg(a,t,n,i);l&&o.push(l)}),Pe(o);case"FeatureCollection":return Ss(r,function(a){var l=Hg(a,t,n,i);l&&Ss(l,function(u){u&&o.push(u)})}),Pe(o)}return Hg(r,t,n,i)}function Hg(r,t,e,n){var i=r.properties||{},o=r.type==="Feature"?r.geometry:r;if(o.type==="GeometryCollection"){var a=[];return Xy(r,function(m){var y=Hg(m,t,e,n);y&&a.push(y)}),Pe(a)}var l=mU(o),u={type:o.type,coordinates:$T(o.coordinates,l)},c=new Ov,h=c.read(u),f=Md(rh(t,e),"meters"),d=en.bufferOp(h,f,n),g=new iT;if(d=g.write(d),!QT(d.coordinates)){var p={type:d.type,coordinates:tR(d.coordinates,l)};return jr(p,i)}}function QT(r){return Array.isArray(r[0])?QT(r[0]):isNaN(r[0])}function $T(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return $T(e,t)})}function tR(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return tR(e,t)})}function mU(r){var t=pB(r).geometry.coordinates,e=[-t[0],-t[1]];return gU().rotate(e).scale(Mn)}function qg(r,t,e){e===void 0&&(e={});var n=ta(r),i=ta(t),o=Tz.intersection(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?Hn(o[0],e.properties):Yy(o,e.properties)}function yU(r,t,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),i=r[0],o=r[1],a=r[2],l=r[3],u=(o+l)/2,c=(i+a)/2,h=t*2/qn([i,u],[a,u],e),f=h*(a-i),d=t*2/qn([c,o],[c,l],e),g=d*(l-o),p=f/2,m=p*2,y=Math.sqrt(3)/2*g,E=a-i,_=l-o,v=3/4*m,x=y,w=(E-m)/(m-p/2),I=Math.floor(w),C=(I*v-p/2-E)/2-p/2+v/2,T=Math.floor((_-y)/y),R=(_-T*y)/2,M=T*y-_>y/2;M&&(R-=y/4);for(var P=[],b=[],A=0;A<6;A++){var L=2*Math.PI/6*A;P.push(Math.cos(L)),b.push(Math.sin(L))}for(var B=[],F=0;F<=I;F++)for(var V=0;V<=T;V++){var Y=F%2===1;if(!(V===0&&Y)&&!(V===0&&M)){var st=F*v+i-C,Q=V*x+o+R;if(Y&&(Q-=y/2),e.triangles===!0)vU([st,Q],f/2,g/2,JSON.parse(n),P,b).forEach(function(H){e.mask?qg(e.mask,H)&&B.push(H):B.push(H)});else{var et=_U([st,Q],f/2,g/2,JSON.parse(n),P,b);e.mask?qg(e.mask,et)&&B.push(et):B.push(et)}}}return Pe(B)}function _U(r,t,e,n,i,o){for(var a=[],l=0;l<6;l++){var u=r[0]+t*i[l],c=r[1]+e*o[l];a.push([u,c])}return a.push(a[0].slice()),Hn([a],n)}function vU(r,t,e,n,i,o){for(var a=[],l=0;l<6;l++){var u=[];u.push(r),u.push([r[0]+t*i[l],r[1]+e*o[l]]),u.push([r[0]+t*i[(l+1)%6],r[1]+e*o[(l+1)%6]]),u.push(r),a.push(Hn([u],n))}return a}function EU(r,t,e,n){n===void 0&&(n={});for(var i=[],o=r[0],a=r[1],l=r[2],u=r[3],c=t/qn([o,a],[l,a],n),h=c*(l-o),f=e/qn([o,a],[o,u],n),d=f*(u-a),g=l-o,p=u-a,m=Math.floor(g/h),y=Math.floor(p/d),E=(g-m*h)/2,_=(p-y*d)/2,v=o+E,x=0;x<m;x++){for(var w=a+_,I=0;I<y;I++){var C=Hn([[[v,w],[v,w+d],[v+h,w+d],[v+h,w],[v,w]]],n.properties);n.mask?Q4(n.mask,C)&&i.push(C):i.push(C),w+=d}v+=h}return Pe(i)}function xU(r,t,e){return e===void 0&&(e={}),EU(r,t,t,e)}function wU(r,t,e){e===void 0&&(e={});for(var n=[],i=t/qn([r[0],r[1]],[r[2],r[1]],e),o=i*(r[2]-r[0]),a=t/qn([r[0],r[1]],[r[0],r[3]],e),l=a*(r[3]-r[1]),u=0,c=r[0];c<=r[2];){for(var h=0,f=r[1];f<=r[3];){var d=null,g=null;u%2===0&&h%2===0?(d=Hn([[[c,f],[c,f+l],[c+o,f],[c,f]]],e.properties),g=Hn([[[c,f+l],[c+o,f+l],[c+o,f],[c,f+l]]],e.properties)):u%2===0&&h%2===1?(d=Hn([[[c,f],[c+o,f+l],[c+o,f],[c,f]]],e.properties),g=Hn([[[c,f],[c,f+l],[c+o,f+l],[c,f]]],e.properties)):h%2===0&&u%2===1?(d=Hn([[[c,f],[c,f+l],[c+o,f+l],[c,f]]],e.properties),g=Hn([[[c,f],[c+o,f+l],[c+o,f],[c,f]]],e.properties)):h%2===1&&u%2===1&&(d=Hn([[[c,f],[c,f+l],[c+o,f],[c,f]]],e.properties),g=Hn([[[c,f+l],[c+o,f+l],[c+o,f],[c,f+l]]],e.properties)),e.mask?(qg(e.mask,d)&&n.push(d),qg(e.mask,g)&&n.push(g)):(n.push(d),n.push(g)),f+=l,h++}u++,c+=o}return Pe(n)}function SU(r,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,i=e.property,o=e.weight;if(!r)throw new Error("points is required");if(oB(r,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(o!==void 0&&typeof o!="number")throw new Error("weight must be a number");i=i||"elevation",n=n||"square",o=o||1;var a=Cs(r),l;switch(n){case"point":case"points":l=z4(a,t,e);break;case"square":case"squares":l=xU(a,t,e);break;case"hex":case"hexes":l=yU(a,t,e);break;case"triangle":case"triangles":l=wU(a,t,e);break;default:throw new Error("invalid gridType")}var u=[];return Ss(l,function(c){var h=0,f=0;Ss(r,function(g){var p=n==="point"?c:mB(c),m=qn(p,g,e),y;if(i!==void 0&&(y=g.properties[i]),y===void 0&&(y=g.geometry.coordinates[2]),y===void 0)throw new Error("zValue is missing");m===0&&(h=y);var E=1/Math.pow(m,o);f+=E,h+=E*y});var d=uB(c);d.properties[i]=h/f,u.push(d)}),Pe(u)}function CU(r){const t=[];r.forEach(u=>{t.push(point(u))});const e=Pe(t);var n=fB(e);const[i,o,a,l]=n.bbox;return{xmin:i,ymin:o,xmax:a,ymax:l}}function IU(r,t,e="miles"){return pU(r,t,{units:e})}function TU(r=50,t=[117.57071648609964,29.612017196294367,118.56681691790034,30.1558200567]){return AI(r,{bbox:t})}function RU(r,t,e="solRad",n={start:0,end:255}){let{start:i,end:o}=n;const a=AI(r,{bbox:t});return Ss(a,(l,u)=>{l.properties[e]=Wn.getRandomFloatNumberByRange(i||0,o||255)}),a}function PU(r,t=1,e={gridType:"points",property:"solRad",units:"miles"}){return SU(r,t,e)}function bU(r,t){let e=li(r),n=ur(t),i=j4(e,n);const{features:o}=i;if(o.length===2){const a=o[0].geometry.coordinates,l=o[1].geometry.coordinates;return a.pop(),{success:!0,coordinates:a.concat(l),result:o}}else return{success:!1,result:o}}function eR(r,t,e){console.log(r,t,e);var n=li(r),i=ur(t),o=ur(e),a=b4(i,o,n);return a}function AU(r,t,e){for(let n=0;n<r.length;n++){const i=r[n],o=eR(i,t,e);console.log(o)}return sliced}function nR(r){lineString([[126,-11],[129,-21]]),lineString([[123,-18],[131,-14]]),nR()}function rR(r,t){var e=lineString(r),n=t(t);const i=booleanWithin(n,e),o=rR(e,n),a=booleanPointOnLine(n,e),l=booleanIntersects(e,n);return console.log("within....................................",i,o,a,l),i}const LU=Object.freeze(Object.defineProperty({__proto__:null,booleanContains:rR,createBuffer:IU,createPointsFromBox:TU,createPointsFromBoxWithProperty:RU,getEnvelop:CU,interpolateFromPoints:PU,lineIntersect:nR,lineSplit:bU,spliceLine:eR,spliceMultiLine:AU},Symbol.toStringTag,{value:"Module"}));function MU(r,t){return new Sr(r).intersectsCoordinate(t)}const Zg={...LU,...Object.freeze(Object.defineProperty({__proto__:null,testIntersect:MU},Symbol.toStringTag,{value:"Module"}))},ec={Point:"Point",LineString:"LineString",Polygon:"Polygon",Circle:"Circle",Box:"Box",Ring:"Ring"};class iR extends ty{constructor(e=null){super();zt(this,"curFeature",null);zt(this,"flag",!1);zt(this,"remenberDrawCoordinates",[]);zt(this,"rememberCoordsClone",[]);zt(this,"step",0);zt(this,"drawConditions",null);zt(this,"timer",null);zt(this,"spliceSnaps",[]);zt(this,"splicePoints",[]);zt(this,"spliceFeature",null);zt(this,"spliceLinestring",null);zt(this,"splicePointsLayerId","splicePointsLayer-id");this.draw=null,this.snap=null,this.modify=null,this.select=null,this.bInit=!1,this.selectEnable=!1,this.map=e,this.layerHandler=new Ny(e),this.layerId="layerId_draw",this.imageStyle={radius:7},this.defaultStyle=new ye({fill:new Dt({color:"rgba(255, 208, 75, 0.5)"}),stroke:new Je({color:"#ffcc33",width:2}),image:new lr({fill:new Dt({color:"#ffcc33"}),...this.imageStyle})}),this.source=null,this.vector=null}getDrawType(){return ec}getLayer(){return this.vector}createLayer(e){const{radius:n=5,strokeColor:i="#ffcc33",color:o="rgba(255, 204, 51,0.7)",width:a=2}=e;return this.defaultStyle=new ye({fill:new Dt({color:o}),stroke:new Je({color:i,width:a}),image:new lr({fill:new Dt({color:o}),radius:n})}),this.source=new Un({wrapX:!1}),this.vector=new Ur({id:this.layerId,source:this.source,style:this.defaultStyle}),this.vector}initVectorLayer(e){let{vector:n}=this;e.addLayer(n)}removeInteraction(e){let{draw:n,snap:i,modify:o,select:a}=this;o&&e.removeInteraction(o),a&&e.removeInteraction(a),i&&e.removeInteraction(i),n&&e.removeInteraction(n)}activeSnap(){let{source:e,snap:n,map:i}=this;n&&i.removeInteraction(n),this.snap=new Ld({source:e}),i.addInteraction(this.snap)}activeModify(e=this.map){let{modify:n}=this;n&&e.addInteraction(n)}addModify(e,n=!1,i=!1){let{source:o}=this;n?(this.select=new hw({wrapX:!1}),this.modify=new Gy({features:this.select.getFeatures()}),e.addInteraction(this.select),e.addInteraction(this.modify)):i&&(this.modify=new Gy({source:o}),e.addInteraction(this.modify))}addSelect(e){}drawByType({map:e=this.map,type:n="Point",snapEnable:i=!1,modifyEnable:o=!1,selectEnable:a=!1,onceOnly:l=!1,freehand:u=!1,drawEndHandle:c=null,style:h={},conditions:f={}}={type:"Point",snapEnable:!1,modifyEnable:!1,onceOnly:!1,drawEndHandle:null,conditions:{},style:{}}){if(Wn.isNullOrUndifiend(e))return console.error("map不能为空"),!1;if(!ec[n])return console.error("未知类型",n),!1;this.selectEnable=a;let d=null,{layerId:g}=this;this.draw!==null&&this.removeInteraction(e),this.layerHandler.checkLayerIsExist(e,g)||e.addLayer(this.createLayer(h));let{source:p}=this;const{innerR:m=0,outerR:y=0}=h;e.set("mouseStatus",ba.draw),n===ec.Box?d=new bd({source:p,type:"Circle",geometryFunction:ND()}):n===ec.Ring?d=new bd({source:p,type:"Point"}):d=new bd({source:p,type:n,freehand:u}),this.draw=d,e.addInteraction(d);let E="";d.on("drawend",_=>{_.stopPropagation(),_.dbClick=!1;const v=_.feature;n===ec.Ring&&this.createRing(v.getGeometry().getCoordinates(),m,y),E===""?E=new Date().getTime():(new Date().getTime()-E<500?_.dbClick=!0:_.dbClick=!1,E=new Date().getTime()),setTimeout(()=>{l?(this.removeInteraction(e),this.addModify(e,a,o)):this.addModify(e,!1)},200),c&&c({e:_,feature:v,coordinates:v.getGeometry().getCoordinates(),type:v.getGeometry().getType(),wkt:new dw().feature2wkt(v)}),e.set("mouseStatus",ba.none),this.remenberDrawCoordinates=[],this.step=0,this.curFeature=null}),i&&this.activeSnap(),JSON.stringify(f)!="{}"&&this.initConditions(f)}createRing(e,n=0,i=0){this.layerHandler.createRingLayer({map:this.map,center:e,outerR:i,innerR:n}).getSource().getFeatures().forEach(l=>{this.vector.getSource().addFeature(l)}),clearInterval(this.timer);let a=0;this.timer=setInterval(()=>{const l=this.vector.getSource().getFeatures().at(-1);if(l&&l.getGeometry().getType()==="Point"&&(this.vector.getSource().removeFeature(l),clearInterval(this.timer)),a>50){for(let u=this.vector.getSource().getFeatures().length-1;u<this.vector.getSource().getFeatures().length;u--){const c=this.vector.getSource().getFeatures()[u];if(c&&c.getGeometry().getType()==="Point"){this.vector.getSource().removeFeature(c);break}}clearInterval(this.timer)}a++},10)}initConditions(e){const{map:n,draw:i}=this,o=new Uy(e);this.drawConditions=o,o.initialize({map:n,draw:i}),o.registerEvent("on-change",(a,l)=>{this.curFeature=a,this.remenberDrawCoordinates=sd(l.getCoordinates()),this.step=this.remenberDrawCoordinates.length})}drawPoint(e,n=this.map){this.drawByType({map:n,drawEndHandle:e})}endDraw(e=this.map){this.removeInteraction(e),this.endSpliceLine()}endInteraction(e=this.map){this.selectEnable=!1,this.removeInteraction(e)}clear(e=this.map){this.vector&&e.removeLayer(this.vector),this.drawConditions&&this.drawConditions.destroy()}backward(){let{draw:e}=this;e.removeLastPoint()}spliceLine({source:e,line:n,style:i,callback:o}){this.endSpliceLine(),this.drawByType({type:ec.Point,onceOnly:!1,style:{radius:0},drawEndHandle:({e:u,coordinates:c})=>{if(u.dbClick){const h=this.splicePoints[0],f=this.splicePoints.at(-1),d=Zg.spliceLine(this.spliceLinestring.getCoordinates(),h,f);o&&o(d),this.splicePoints=[],this.spliceFeature=null,this.spliceLinestring=null,o&&o(d)}else{const h=e.getFeatures();for(let f=0;f<h.length;f++){const d=h[f];if(d.getGeometry().intersectsCoordinate(c)){if(this.spliceFeature||(this.spliceFeature=d),!this.spliceLinestring)this.spliceLinestring=this.getIntersectLinestring(this.spliceFeature.getGeometry(),c);else if(!Zg.testIntersect(this.spliceLinestring.getCoordinates(),c)){console.warn("非连续线段");return}this.splicePoints.push(c),this.createSplitPointsLayer(c,i);return}}console.warn("不在线上")}}});let a=new Ld({source:e});this.map.addInteraction(a),this.spliceSnaps.push(a);const l=this.layerHandler.getVectorLayer({id:this.splicePointsLayerId,style:ao(i)});l.setZIndex(1999),this.map.addLayer(l),a=new Ld({source:l.getSource()}),this.map.addInteraction(a),this.spliceSnaps.push(a)}createSplitPointsLayer(e,n){const i={geom:`POINT(${e[0]} ${e[1]})`};this.layerHandler.createPoints({layerId:this.splicePointsLayerId,points:[i],map:this.map,zIndex:1001,style:n})}getIntersectLinestring(e,n){const i=e.getType();if(i==="LineString")return Zg.testIntersect(e.getCoordinates(),n)?e:null;if(i==="MultiLineString"){const o=e.getLineStrings();for(let a=0;a<o.length;a++){const l=o[a],u=this.getIntersectLinestring(l,n);if(u)return u}return null}}removeLastPoint(){const e=this.vector.getSource().getFeatures().at(-1);this.vector.getSource().removeFeature(e)}endSpliceLine(){this.spliceSnaps.length>0&&(this.spliceSnaps.forEach(e=>{this.map.removeInteraction(e)}),this.spliceSnaps=[],this.layerHandler.removeLayerById(this.splicePointsLayerId),this.splicePoints=[],this.spliceFeature=null,this.spliceLinestring=null,this.removeInteraction(this.map))}}let Kg,nc,Jg,Xh,Hh=[],sR="",Jv,Qv=[],$v=[];function oR(r){Kg&&r.un("pointermove",Kg),r&&r.removeOverlay(Jg),r&&r.removeInteraction(nc),r&&r.set("mouseStatus",ba.none)}function t0(r){if(Hh.length>0)for(let t=Hh.length-1;t>=0;t--){const e=Hh[t];r.removeOverlay(e)}Qv.forEach(t=>{r.removeLayer(t)}),$v.forEach(t=>{r.removeLayer(t)}),Qv=[],$v=[],Hh=[]}function aR(r,t){sR=t;const e=new Un;let n,i,o;const a="双击结束测量",l="双击结束测量";Kg=function(m){if(m.dragging)return;let y="单击开始测量";if(n){const E=n.getGeometry();E instanceof ar?y=a:E instanceof Sr&&(y=l)}i.innerHTML=y,Jg.setPosition(m.coordinate),i.classList.remove("hidden")},r.on("pointermove",Kg),r.getViewport().addEventListener("mouseout",()=>{i.classList.add("hidden")});const u=function(m){const y=lf(m,{projection:r.getView().getProjection().getCode()});let E;return y>100?E=`${Math.round(y/1e3*100)/100} km`:E=`${Math.round(y*100)/100} m`,E},c=function(m){const y=b0(m,{projection:r.getView().getProjection().getCode()});let E;return y>1e4?E=`${Math.round(y/1e6*100)/100} km<sup>2</sup>`:E=`${Math.round(y*100)/100} m<sup>2</sup>`,E};function h(m){const y=m==="area"?"Polygon":"LineString";nc=new bd({source:e,type:y,style:new ye({fill:new Dt({color:"rgba(0, 0, 255, 0.1)"}),stroke:new Je({color:"rgba(255,204, 0, 1)",lineDash:[10,10],width:3}),image:new lr({radius:5,stroke:new Je({color:"rgba(0, 0, 0, 0.7)"}),fill:new Dt({color:"rgba(255, 255, 255, 0.2)"})})})}),r.removeInteraction(nc),r.addInteraction(nc),d(),f();let E;nc.on("drawstart",_=>{n=_.feature;let v=_.coordinate;E=n.getGeometry().on("change",x=>{const w=x.target;let I;Jv=w,w instanceof ar?(I=c(w),v=w.getInteriorPoint().getCoordinates()):w instanceof Sr&&(I=u(w),v=w.getLastCoordinate()),o.innerHTML=I,Xh.setPosition(v)})}),nc.on("drawend",()=>{oR(r),o.className="ol-tooltip ol-tooltip-static",Xh.setOffset([0,-7]),sR==="area"?g(Jv):p(Jv),o=null,d(),np(E)})}function f(){i&&i.parentNode.removeChild(i),i=document.createElement("div"),i.className="ol-tooltip hidden",Jg=new hd({element:i,offset:[15,0],positioning:"center-left"}),r.addOverlay(Jg)}function d(){o&&o.parentNode.removeChild(o),o=document.createElement("div"),o.className="ol-tooltip ol-tooltip-measure",Xh=new hd({element:o,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),Hh.push(Xh),r.addOverlay(Xh)}function g(m){const y=new Ye({geometry:m}),E=[new ye({stroke:new Je({color:"orange",width:3}),fill:new Dt({color:"rgba(0, 0, 255, 0.1)"})}),new ye({image:new lr({radius:5,fill:new Dt({color:"orange"})}),geometry:function(x){const w=x.getGeometry().getCoordinates()[0];return new Uo(w)}})];new ye({stroke:new Je({color:"orange",width:3}),fill:new Dt({color:"rgba(255,217,102, 0.2)"})}),y.setStyle(E);const _=new Un({features:[y]}),v=new Ur({source:_});Qv.push(v),r.addLayer(v)}function p(m){const y=new Ye({geometry:m}),E=[new ye({stroke:new Je({color:"orange",width:3}),fill:new Dt({color:"rgba(0, 0, 255, 0.1)"})}),new ye({image:new lr({radius:5,fill:new Dt({color:"orange"})}),geometry:function(x){const w=x.getGeometry().getCoordinates();return new Uo(w)}})];new ye({stroke:new Je({color:"orange",width:3}),fill:new Dt({color:"rgba(255,217,102, 0.2)"})}),y.setStyle(E);const _=new Un({features:[y]}),v=new Ur({source:_});$v.push(v),r.addLayer(v)}h(t)}class lR extends ty{constructor(t){super(),this.map=t}measureLength(t=this.map,e=!1){t.set("mouseStatus",ba.mesure),e&&t0(t),aR(t,"length")}measureArea(t=this.map,e=!1){t.set("mouseStatus",ba.mesure),e&&t0(t),aR(t,"area")}clearResult(t=this.map){oR(t),t0(t)}}class uR{constructor(){}queryByCondition(t,e){var n=new Y1().writeGetFeature(e);return new Promise((i,o)=>{fetch(t,{method:"POST",body:new XMLSerializer().serializeToString(n)}).then(function(a){return a.json()}).then(function(a){var l=new Qo().readFeatures(a);i(l)})})}handleGeometry(t,e="geom"){t.getGeometry().applyTransform((i,o,a)=>{for(var l=0;l<i.length;l+=a){var u=i[l],c=i[l+1];i[l]=c,i[l+1]=u}}),t.setGeometryName(e)}transact(t,e){const{featureType:n,srsName:i,featureNS:o,transactType:a,features:l}=e;var u=new Y1,c=new VF({featureNS:o,featureType:n,gmlOptions:{srsName:i}});let h=null,f;switch(a){case"insert":h=u.writeTransaction(l,null,null,c),f="插入";break;case"update":h=u.writeTransaction(null,l,null,c),f="更新";break;case"delete":h=u.writeTransaction(null,null,l,c),f="删除";break}return new Promise((d,g)=>{fetch(t,{method:"POST",body:new XMLSerializer().serializeToString(h)}).then(p=>{if(p.status===200**p.ok)return d({success:!0,msg:f});d({success:!1,msg:f})})})}applyTransform(t){return t.applyTransform((e,n,i)=>{for(var o=0;o<e.length;o+=i){var a=e[o],l=e[o+1];e[o]=l,e[o+1]=a}}),t}}class Qg{constructor(t,e){zt(this,"step",0);zt(this,"historyModifyedGeometry",[]);zt(this,"selectedFeature",null);zt(this,"snapList",[]);this.map=t,this.layers=e.layers,this.selectable=!1,this.modifyable=!1,this.select=new hw({wrapX:!1,...e}),this.modify=new Gy({features:this.select.getFeatures()})}enableSelect(t=!0,e){const n=i=>{const o=i.selected;let a=null;this.step=0,this.selectedFeature=null,this.historyModifyedGeometry=[],o.length>0&&(a=this.select.getLayer(o[0]),this.selectedFeature=o[0],this.historyModifyedGeometry=[o[0].getGeometry().clone()]),e&&e({e:i,layer:a,selected:o,selectedAllFeatures:this.select.getFeatures().getArray()})};!this.selectable&&t?(this.select&&this.map.addInteraction(this.select),this.select.on("select",n)):this.selectable&&!t&&(this.select.un("select",n),this.select&&this.map.removeInteraction(this.select)),this.selectable=t}enableModify(t=!0,e){const n=o=>{const{type:a}=o,l=o.selected;let u=null;this.step=0,this.selectedFeature=null,this.historyModifyedGeometry=[],(l==null?void 0:l.length)>0&&(u=this.select.getLayer(l[0]),this.selectedFeature=l[0],this.historyModifyedGeometry=[l[0].getGeometry().clone()]),e&&e({e:o,feature:l[0],selected:l,selectedAllFeatures:this.select.getFeatures().getArray(),layer:u,type:a})},i=o=>{const{type:a}=o,l=o.features.getArray();let u=null;l.length>0&&(u=this.select.getLayer(l[0]),this.step++,this.historyModifyedGeometry.push(l[0].getGeometry().clone())),e&&e({e:o,feature:l[0],selected:l,selectedAllFeatures:this.select.getFeatures().getArray(),layer:u,type:a})};!this.modifyable&&t?(this.select&&this.map.addInteraction(this.select),this.modify&&this.map.addInteraction(this.modify),this.layers.forEach(o=>{this.addSnap({source:o.getSource()})}),this.select.on("select",n),this.select.on("change",n),this.modify.on("modifyend",i)):this.modifyable&&!t&&(this.select.un("select",n),this.select.un("change",n),this.select.un("modifyend",i),this.select&&this.map.removeInteraction(this.select),this.modify&&this.map.removeInteraction(this.modify),this.removeAllSnap()),this.modifyable=t}destorySelect(){this.enableSelect(!1)}destoryModify(){this.enableModify(!1)}release(){this.enableSelect(!1),this.enableModify(!1),this.removeAllSnap()}backward(){this.step>0&&this.selectedFeature&&this.selectedFeature.setGeometry(this.historyModifyedGeometry[--this.step])}forward(){this.step<this.historyModifyedGeometry.length-1&&this.selectedFeature&&this.selectedFeature.setGeometry(this.historyModifyedGeometry[++this.step])}canBackward(){return this.historyModifyedGeometry.length>1&&this.step>0}canForward(){return this.historyModifyedGeometry.length>1&&this.step<this.historyModifyedGeometry.length-1}addSnap({source:t,features:e,map:n=this.map}){const i=new Ld({source:t});return n.addInteraction(i),this.snapList.push(i),i}removeSnap(t,e=this.map){e.removeInteraction(t)}removeAllSnap(t=this.map){this.snapList.forEach(e=>{t.removeInteraction(e)}),this.snapList=[]}}function NU(r,t){let e=r.getView().getProjection().getMetersPerUnit();return t/e}function OU(r,t){let e=r.getView().getProjection().getMetersPerUnit();return t*e}function FU(r,t){let e,n=t.getCenter(),i=[n[0],n[1]+t.getRadius()],o=r.getView().getProjection(),a=Ba(n,o,"EPSG:4326"),l=Ba(i,o,"EPSG:4326");return e=dc(a,l),e}const DU=Object.freeze(Object.defineProperty({__proto__:null,tranMeters2Radius:NU,tranRadius2Meters:OU,tranRadius2Meters2:FU},Symbol.toStringTag,{value:"Module"}));Array.prototype.max=function(){return Math.max.apply(null,this)},Array.prototype.min=function(){return Math.min.apply(null,this)},Array.prototype.mean=function(){var r,t;for(r=0,t=0;r<this.length;r++)t+=this[r];return t/this.length},Array.prototype.pip=function(r,t){var e,n,i=!1;for(e=0,n=this.length-1;e<this.length;n=e++)this[e][1]>t!=this[n][1]>t&&r<(this[n][0]-this[e][0])*(t-this[e][1])/(this[n][1]-this[e][1])+this[e][0]&&(i=!i);return i};var BU=function(){var r={},t=function(d,g){for(var p=[],m=0;m<g;m++)p.push(d);return p},e=function(d,g){var p,m=t(0,g*g);for(p=0;p<g;p++)m[p*g+p]=d;return m},n=function(d,g,p){var m,y,E=Array(p*g);for(m=0;m<g;m++)for(y=0;y<p;y++)E[y*g+m]=d[m*p+y];return E},i=function(d,g,p,m){var y,E,_=Array(p*m);for(y=0;y<p;y++)for(E=0;E<m;E++)_[y*m+E]=d[y*m+E]+g[y*m+E];return _},o=function(d,g,p,m,y){var E,_,v,x=Array(p*y);for(E=0;E<p;E++)for(_=0;_<y;_++)for(x[E*y+_]=0,v=0;v<m;v++)x[E*y+_]+=d[E*m+v]*g[v*y+_];return x},a=function(d,g){var p,m,y,E=Array(g);for(p=0;p<g;p++)E[p]=d[p*g+p];for(p=0;p<g;p++){for(m=0;m<p;m++)E[p]-=d[p*g+m]*d[p*g+m];if(E[p]<=0)return!1;for(E[p]=Math.sqrt(E[p]),m=p+1;m<g;m++){for(y=0;y<p;y++)d[m*g+p]-=d[m*g+y]*d[p*g+y];d[m*g+p]/=E[p]}}for(p=0;p<g;p++)d[p*g+p]=E[p];return!0},l=function(d,g){var p,m,y,E;for(p=0;p<g;p++)for(d[p*g+p]=1/d[p*g+p],m=p+1;m<g;m++){for(E=0,y=p;y<m;y++)E-=d[m*g+y]*d[y*g+p];d[m*g+p]=E/d[m*g+m]}for(p=0;p<g;p++)for(m=p+1;m<g;m++)d[p*g+m]=0;for(p=0;p<g;p++){for(d[p*g+p]*=d[p*g+p],y=p+1;y<g;y++)d[p*g+p]+=d[y*g+p]*d[y*g+p];for(m=p+1;m<g;m++)for(y=m;y<g;y++)d[p*g+m]+=d[y*g+p]*d[y*g+m]}for(p=0;p<g;p++)for(m=0;m<p;m++)d[p*g+m]=d[m*g+p]},u=function(d,g){var p=g,m=Array(g*g),y=Array(g),E=Array(g),_=Array(g),v,x,w,I,C,T,R,M,P,b,A;for(v=0;v<g;v++)for(I=0;I<g;I++)v==I?m[v*g+I]=1:m[v*g+I]=0;for(I=0;I<g;I++)_[I]=0;for(v=0;v<g;v++){for(M=0,I=0;I<g;I++)if(_[I]!=1)for(C=0;C<g;C++)_[C]==0&&Math.abs(d[I*g+C])>=M&&(M=Math.abs(d[I*g+C]),w=I,x=C);if(++_[x],w!=x){for(T=0;T<g;T++)A=d[w*g+T],d[w*g+T]=d[x*g+T],d[x*g+T]=A;for(T=0;T<p;T++)A=m[w*g+T],m[w*g+T]=m[x*g+T],m[x*g+T]=A}if(E[v]=w,y[v]=x,d[x*g+x]==0)return!1;for(b=1/d[x*g+x],d[x*g+x]=1,T=0;T<g;T++)d[x*g+T]*=b;for(T=0;T<p;T++)m[x*g+T]*=b;for(R=0;R<g;R++)if(R!=x){for(P=d[R*g+x],d[R*g+x]=0,T=0;T<g;T++)d[R*g+T]-=d[x*g+T]*P;for(T=0;T<p;T++)m[R*g+T]-=m[x*g+T]*P}}for(T=g-1;T>=0;T--)if(E[T]!=y[T])for(C=0;C<g;C++)A=d[C*g+E[T]],d[C*g+E[T]]=d[C*g+y[T]],d[C*g+y[T]]=A;return!0},c=function(d,g,p,m,y){return g+(m-g)/p*(1-Math.exp(-(1/y)*Math.pow(d/p,2)))},h=function(d,g,p,m,y){return g+(m-g)/p*(1-Math.exp(-(1/y)*(d/p)))},f=function(d,g,p,m,y){return d>p?g+(m-g)/p:g+(m-g)/p*(1.5*(d/p)-.5*Math.pow(d/p,3))};return r.train=function(d,g,p,m,y,E){var _={t:d,x:g,y:p,nugget:0,range:0,sill:0,A:.3333333333333333,n:0};switch(m){case"gaussian":_.model=c;break;case"exponential":_.model=h;break;case"spherical":_.model=f;break}var v,x,w,I,C=d.length,T=Array((C*C-C)/2);for(v=0,w=0;v<C;v++)for(x=0;x<v;x++,w++)T[w]=Array(2),T[w][0]=Math.pow(Math.pow(g[v]-g[x],2)+Math.pow(p[v]-p[x],2),.5),T[w][1]=Math.abs(d[v]-d[x]);T.sort(function(G,bt){return G[0]-bt[0]}),_.range=T[(C*C-C)/2-1][0];var R=(C*C-C)/2>30?30:(C*C-C)/2,M=_.range/R,P=t(0,R),b=t(0,R);if(R<30)for(I=0;I<R;I++)P[I]=T[I][0],b[I]=T[I][1];else{for(v=0,x=0,w=0,I=0;v<R&&x<(C*C-C)/2;v++,w=0){for(;T[x][0]<=(v+1)*M&&(P[I]+=T[x][0],b[I]+=T[x][1],x++,w++,!(x>=(C*C-C)/2)););w>0&&(P[I]/=w,b[I]/=w,I++)}if(I<2)return _}C=I,_.range=P[C-1]-P[0];var A=t(1,2*C),L=Array(C),B=_.A;for(v=0;v<C;v++){switch(m){case"gaussian":A[v*2+1]=1-Math.exp(-(1/B)*Math.pow(P[v]/_.range,2));break;case"exponential":A[v*2+1]=1-Math.exp(-(1/B)*P[v]/_.range);break;case"spherical":A[v*2+1]=1.5*(P[v]/_.range)-.5*Math.pow(P[v]/_.range,3);break}L[v]=b[v]}var F=n(A,C,2),V=o(F,A,2,C,2);V=i(V,e(1/E,2),2,2);var Y=V.slice(0);a(V,2)?l(V,2):(u(Y,2),V=Y);var st=o(o(V,F,2,2,C),L,2,C,1);_.nugget=st[0],_.sill=st[1]*_.range+_.nugget,_.n=g.length,C=g.length;var H=Array(C*C);for(v=0;v<C;v++){for(x=0;x<v;x++)H[v*C+x]=_.model(Math.pow(Math.pow(g[v]-g[x],2)+Math.pow(p[v]-p[x],2),.5),_.nugget,_.range,_.sill,_.A),H[x*C+v]=H[v*C+x];H[v*C+v]=_.model(0,_.nugget,_.range,_.sill,_.A)}var Q=i(H,e(y,C),C,C),et=Q.slice(0);a(Q,C)?l(Q,C):(u(et,C),Q=et);var H=Q.slice(0),Et=o(Q,d,C,C,1);return _.K=H,_.M=Et,_},r.predict=function(d,g,p){var m,y=Array(p.n);for(m=0;m<p.n;m++)y[m]=p.model(Math.pow(Math.pow(d-p.x[m],2)+Math.pow(g-p.y[m],2),.5),p.nugget,p.range,p.sill,p.A);return o(y,p.M,1,p.n,1)[0]},r.variance=function(d,g,p){var m,y=Array(p.n);for(m=0;m<p.n;m++)y[m]=p.model(Math.pow(Math.pow(d-p.x[m],2)+Math.pow(g-p.y[m],2),.5),p.nugget,p.range,p.sill,p.A);return p.model(0,p.nugget,p.range,p.sill,p.A)+o(o(y,p.K,1,p.n,p.n),y,1,p.n,1)[0]},r.grid=function(d,g,p){var m,y,E,_=d.length;if(_!=0){var v=[d[0][0][0],d[0][0][0]],x=[d[0][0][1],d[0][0][1]];for(m=0;m<_;m++)for(y=0;y<d[m].length;y++)d[m][y][0]<v[0]&&(v[0]=d[m][y][0]),d[m][y][0]>v[1]&&(v[1]=d[m][y][0]),d[m][y][1]<x[0]&&(x[0]=d[m][y][1]),d[m][y][1]>x[1]&&(x[1]=d[m][y][1]);var w,I,C=Array(2),T=Array(2),R=Array(2),M=Array(2),P=Math.ceil((v[1]-v[0])/p),b=Math.ceil((x[1]-x[0])/p),A=Array(P+1);for(m=0;m<=P;m++)A[m]=Array(b+1);for(m=0;m<_;m++){for(R[0]=d[m][0][0],R[1]=R[0],M[0]=d[m][0][1],M[1]=M[0],y=1;y<d[m].length;y++)d[m][y][0]<R[0]&&(R[0]=d[m][y][0]),d[m][y][0]>R[1]&&(R[1]=d[m][y][0]),d[m][y][1]<M[0]&&(M[0]=d[m][y][1]),d[m][y][1]>M[1]&&(M[1]=d[m][y][1]);for(C[0]=Math.floor((R[0]-(R[0]-v[0])%p-v[0])/p),C[1]=Math.ceil((R[1]-(R[1]-v[1])%p-v[0])/p),T[0]=Math.floor((M[0]-(M[0]-x[0])%p-x[0])/p),T[1]=Math.ceil((M[1]-(M[1]-x[1])%p-x[0])/p),y=C[0];y<=C[1];y++)for(E=T[0];E<=T[1];E++)w=v[0]+y*p,I=x[0]+E*p,d[m].pip(w,I)&&(A[y][E]=r.predict(w,I,g))}return A.xlim=v,A.ylim=x,A.zlim=[g.t.min(),g.t.max()],A.width=p,A}},r.contour=function(d,g,p){},r.plot=function(d,g,p,m,y){var E=d.getContext("2d");E.clearRect(0,0,d.width,d.height);var _=[p[1]-p[0],m[1]-m[0],g.zlim[1]-g.zlim[0]],v,x,w,I,C,T=g.length,R=g[0].length,M=Math.ceil(g.width*d.width/(p[1]-p[0])),P=Math.ceil(g.width*d.height/(m[1]-m[0]));for(v=0;v<T;v++)for(x=0;x<R;x++)g[v][x]!=null&&(w=d.width*(v*g.width+g.xlim[0]-p[0])/_[0],I=d.height*(1-(x*g.width+g.ylim[0]-m[0])/_[1]),C=(g[v][x]-g.zlim[0])/_[2],C<0&&(C=0),C>1&&(C=1),E.fillStyle=y[Math.floor((y.length-1)*C)],E.fillRect(Math.round(w-M/2),Math.round(I-P/2),M,P))},r}();class GU extends ty{constructor(e="map-view"){super();zt(this,"map",null);zt(this,"target","");zt(this,"defaultStyle",new ye({fill:new Dt({color:"rgba(255, 208, 75, 0.5)"}),stroke:new Je({color:"#ffcc33",width:2}),image:new lr({fill:new Dt({color:"#ffcc33"}),radius:7})}));this.target=e,this.mapConfig=eh(),this.mouseMoveHandle=null,this.mouseClickHandle=null,this.mouseDbClickHandle=null,this.mouseMoveEndHandle=null,this.prj=this.mapConfig.prj,this.mapInitExtent=this.mapConfig.defaultView,this.mouseStatusKey="mouseStatus",this.overlay=null,this.popupOverlayCollection=[],this.drawHandler=null,this.drawConditions=null,this.measureHandler=null,this.wktHandler=null,this.wfsHandler=null,this.interactionHandler=null,this.GeoHandler=TD,this.TransHandler=DU,this.StyleHandler=jO,this.kriging=BU,this.baseLayerCollection={}}static whoami(){return this.name}static initMapOSM({target:e="map-view"}){const n=new cd({layers:[new Cr({source:new QE})],target:e,view:new Br({center:[0,0],zoom:2})});this.map=n}installPlugin(e){e.initialize(this)}initMapOSM(){const e=new cd({logo:!1,controls:ld({attribution:!1,zoom:!0,rotate:!1,scaleLine:!0}).extend([]),layers:[new Cr({source:new QE})],target:this.target,view:new Br({center:[0,0],zoom:2})});this.map=e,this.map.addControl(new hy({units:"metric"})),this.initEvent()}initMap(e,n={controls:{},showBasemap:!0,dragging:!0}){if(!this.target)return;this.mapConfig=sd(e),this.getLayerHandler();const{controls:i,showBasemap:o,dragPan:a}=n,{baseLayers:l,prj:u,defaultBaseLayerId:c,defaultView:h}=this.mapConfig;h.projection==="EPSG:3857"&&(h.center=MP(h.center)),this.prj=u;const f=[],d=[];Wn.tree2list(l,d);const g=l.filter(m=>m.id===c);g.length>0&&this.getBaseLayer(g[0]).forEach(m=>{f.push(m)});const p=new cd({logo:!1,controls:ld({attribution:!1,zoom:!1,rotate:!1,scaleLine:!0,...i}).extend([]),interactions:new l1({dragPan:a}),layers:o?f:[],target:this.target,view:new Br(h)});return this.map=p,i.scaleLine&&this.map.addControl(new hy({units:"metric",bar:!1,steps:2,text:!0,minWidth:100,maxWidth:100,target:"vmap-status-bar"})),this.layerHandler.setMap(this.map),this.initEvent(),new Promise((m,y)=>{this.mapInitExtent=this.map.getView().calculateExtent(this.map.getSize()),m({map:p})})}initCustomMap({target:e=this.target,view:n={projection:"EPSG:4326",center:[104.53125000000001,32.70263671875],zoom:5,minZoom:0,maxZoom:20},baseLayers:i=[],controls:o={},callback:a}){if(!this.target){console.warn("地图容器不存在");return}const l=[];i.forEach((c,h)=>{const f=this.getLayerByType(c);f&&(f.setZIndex(h),l.push(f))});const u=new cd({logo:!1,controls:ld({attribution:!1,zoom:!0,rotate:!1,scaleLine:!0,...o}).extend([]),layers:l,target:e,view:new Br(n)});u.addControl(new hy({units:"metric"})),setTimeout(()=>{this.mapInitExtent=this.map.getView().calculateExtent(this.map.getSize()),a&&a(u)},500),this.map=u,this.layerHandler.setMap(this.map),this.initEvent()}initEvent(){const{map:e}=this;e.on("singleclick",n=>{this.mouseClickHandle&&this.mouseClickHandle(n)}),e.on("doubleClick",n=>{this.mouseDbClickHandle&&this.mouseDbClickHandle(n)}),e.on("pointermove",n=>{this.mouseMoveHandle&&this.mouseMoveHandle(n)}),e.on("moveend",n=>{this.mouseMoveEndHandle&&this.mouseMoveEndHandle(n)})}registerMouseClick(e){this.mouseClickHandle=e}releaseMouseClick(){this.mouseClickHandle=null}registerMouseDbClick(e){this.mouseDbClickHandle=e}releaseMouseDbClick(){this.mouseDbClickHandle=null}registerMouseMove(e){this.mouseMoveHandle=e}relaeseMouseMove(){this.mouseMoveHandle=null}registerMouseMoveEnd(e){this.mouseMoveEndHandle=e}relaeseMouseMoveEnd(){this.mouseMoveEndHandle=null}addOverlay(e,n){const i=this.layerHandler.getOverlayLayer(e,n);return this.overlay=i,this.map.addOverlay(i),i}createOverlay({popupId:e,center:n,html:i="",offset:o=[0,-15],collection:a=!0,options:l}={}){let{map:u}=this;document.getElementById(e)&&(document.getElementById(e).style.display="block");let c=document.getElementById(e);if(!c)return;let h=document.getElementById(e+"_content");i!==""&&(h.innerHTML=i);const f=this.layerHandler.getOverlayLayer(c,l);return f.setPosition(n),f.setOffset(o),u.addOverlay(f),a&&this.popupOverlayCollection.push(f),f}removeAllOverlay(){this.popupOverlayCollection.forEach(e=>{this.map.removeOverlay(e)}),this.popupOverlayCollection=[]}addLayerByType(e,n=this.mapConfig.prj){let{id:i,visible:o,once:a,type:l}=e;if(l)if(i||(i=Wn.uuid(),e.id=i),a&&this.removeLayerById(i),this.checkLayerIsExist(i))this.setLayerVisibleById(i,o);else{let u=this.getLayerByType(e,n);if(u)return this.map.addLayer(u),u}}getBaseLayer(e){const{prj:n}=this.mapConfig;let i=[],o=null;return this.resetBaseLayer(),e.children.forEach(a=>{const{id:l,visible:u,opacity:c,type:h}=a;if(this.checkLayer(a)){let f=a;h===Ot.tdt&&(f={type:h,url:d0({mapStyle:l,prj:n}),visible:u,opacity:c}),o=this.getLayerByType(f),o&&(this.baseLayerCollection[l]=o,i.push(o))}}),i}resetBaseLayer(){for(const e in this.baseLayerCollection)if(Object.hasOwnProperty.call(this.baseLayerCollection,e)){const n=this.baseLayerCollection[e];this.map.removeLayer(n),delete this.baseLayerCollection[e]}}checkLayer(){return!0}getLayerByType(e,n=this.mapConfig.prj){switch(this.parseLayerOptions(e),e.type){case Ot.wmts:return this.layerHandler.getWmtsByPrj({prj:n,options:e});case Ot.tdt:return this.layerHandler.getTdtByPrj({prj:n,options:e});case Ot.supermap:return this.layerHandler.getSuperMapWmts({prj:n,options:e});case Ot.geoserverwmts:return this.layerHandler.getWmtsGeoserver({options:e});case Ot.wmsimagetile:return this.layerHandler.getWmsTile(e);case Ot.wmsimage:return this.layerHandler.getWmsImage(e);case Ot.arcgisimage:return this.layerHandler.getArcgisImage(e);case Ot.arcgisimagetile:return this.layerHandler.getArcgisImageTile(e);case Ot.arcgistile:return this.layerHandler.getXYZ(e);case Ot.geojson:return this.layerHandler.getGeojsonLayerWithRender(e);case Ot.heatmap:return this.layerHandler.getHeatMapLayer(e.geojson,e);case Ot.clustermap:return this.layerHandler.getClusterLayerFromGeojson(e.geojson,e);case Ot.xyz:return this.layerHandler.getXYZ(e);case Ot.tms:return this.layerHandler.getTmsLayer(e);case Ot.gdmap:return this.layerHandler.getGaodeLayer(e);case Ot.bdmap:return this.layerHandler.getBaiduLayer(e);case Ot.geoservermvt:return this.layerHandler.getMvt({prj:n,options:e});case Ot.mapboxmvt:return this.layerHandler.getMapboxVt(e);default:return null}}parseLayerOptions(e){e.hasOwnProperty("opacity")&&(e.opacity=Number(e.opacity)),e.hasOwnProperty("zIndex")&&(e.zIndex=Number(e.zIndex)),e.hasOwnProperty("opacity")&&(e.opacity=Number(e.opacity))}addSuperMapLayer(e){this.map.addLayer(this.layerHandler.getSuperMapWmts({options:e,prj:this.mapConfig.prj}))}addSuperMapXYZ(e){this.map.addLayer(this.layerHandler.getSuperMapXYZ({options:e,prj:this.mapConfig.prj}))}addTdtLayer(e){this.map.addLayer(this.layerHandler.getTdtByPrj({options:e,prj:this.mapConfig.prj}))}addWmtsLayer(e){this.map.addLayer(this.layerHandler.getWmts(e))}addGeoserverWmts(e){this.map.addLayer(this.layerHandler.getWmtsGeoserver({options:e,prj:this.mapConfig.prj}))}addWmsLayer(e){this.map.addLayer(this.layerHandler.getWmsTile(e))}addWmsImageLayer(e){this.map.addLayer(this.layerHandler.getWmsImage(e))}addArcgisTileLayer(e){this.map.addLayer(this.layerHandler.getArcgisImageTile(e))}addArcgisImageLayer(e){this.map.addLayer(this.layerHandler.getArcgisImage(e))}addArcgisWmtsLayer(e){this.map.addLayer(this.layerHandler.getXYZ(e))}addHeatMapLayer(e,n){this.map.addLayer(this.layerHandler.getHeatMapLayer(e,n))}addClusterLayer(e,n){this.map.addLayer(this.layerHandler.getClusterLayerFromGeojson(e,n))}addXYZLayer(e){this.map.addLayer(this.layerHandler.getXYZ(e))}addGeojsonLayer(e){this.map.addLayer(this.layerHandler.getGeojsonLayer(e))}checkLayerIsExist(e){return this.layerHandler.checkLayerIsExist(this.map,e)}getLayerById(e,n=this.map){return this.layerHandler.getLayerById(e,n)}removeLayerById(e,n=!0){const{map:i}=this;this.layerHandler.removeLayerById(e,i,n)}removeAllLayer(){this.layerHandler.removeAllLayer(this.map)}setLayerVisibleById(e,n){const{map:i}=this;this.layerHandler.setLayerVisibleById(e,n,i)}dragZoom(e){let{map:n,dragZoomIns:i}=this;i&&(this.map.removeInteraction(i),i=null),i=new a1({condition:Kc,out:e}),this.dragZoomIns=i,i.setActive(!0),n.addInteraction(i),document.querySelector(`#${this.target}`).style.cursor="crosshair"}endDragZoom(){let{map:e,dragZoomIns:n}=this;n&&(n.setActive(!1),e.removeInteraction(n),document.querySelector(`#${this.target}`).style.cursor="default",n=null)}getLayerHandler(e=this.map){return this.layerHandler==null&&(this.layerHandler=new Ny(e),this.layerHandler.prj=this.mapConfig.prj),this.layerHandler}newMeasureHandler(e=this.map){return new lR(e)}getMeasureHandler(e=this.map){return this.measureHandler==null&&(this.measureHandler=new lR(e)),this.measureHandler}newDrawHandler(e=this.map){return new iR(e)}getDrawHandler(e=this.map){return this.drawHandler==null&&(this.drawHandler=new iR(e)),this.drawHandler}destoryDrawHandler(){this.drawHandler&&(this.drawHandler.endDraw(),this.drawHandler=null)}newDrawConditions(){const e=new Uy;return e.projection=this.mapConfig.prj,e}getDrawCondtions(){return this.drawConditions==null&&(this.drawConditions=new Uy,this.drawConditions.projection=this.mapConfig.prj),this.drawConditions}newWfsHandler(e=this.map){return new uR(e)}getWfsHandler(e=this.map){return this.wfsHandler==null&&(this.wfsHandler=new uR(e)),this.wfsHandler}newInteraction(e,n=this.map){return new Qg(n,e)}getInteraction(e=this.map,n){return this.interactionHandler==null&&(this.interactionHandler=new Qg(e,n)),this.interactionHandler}destoryInteraction(){this.interactionHandler&&(this.interactionHandler.enableSelect(!1),this.interactionHandler=!1)}getWktHandler(){return this.wktHandler==null&&(this.wktHandler=new dw),this.wktHandler}getExtent(e=this.map){return{center:e.getView().getCenter(),extent:e.getView().calculateExtent(e.getSize())}}fullExtent(e={}){this.map.getView().fit(this.mapInitExtent,e)}zoomToExtent(e,n={duration:1e3}){this.map.getView().fit(e,n)}zoomToPoint(e,n=674727e-9){const i=new or(e);this.zoomToGeometry(i,n)}zoomToGeometry(e,n=674727e-9){this.map.getView().fit(e,{duration:1e3,minResolution:n})}zoomToLayerById(e,n=this.map){const i=this.getLayerById(e,n);this.zoomToLayer(i)}zoomToLayer(e){e&&this.zoomToExtent(e.getSource().getExtent())}fly2layer(e,n={duration:1e3,minResolution:.005274727}){const{map:i}=this;if(i&&e){const o=e.getSource();i.getView().fit(o.getExtent(),n)}}fly2extent(e,n={duration:1e3}){const{map:i}=this;i&&i.getView().fit(e,n)}getCenterByFeature(e){let n=[];return e instanceof Ye?n=e.getGeometry().getExtent():e instanceof df&&(n=e.getExtent()),[(n[2]+n[0])/2,(n[3]+n[1])/2]}getLengthByLayer(e){let n=0;for(let i=0;i<e.getSource().getFeatures().length;i++){const o=e.getSource().getFeatures()[i];n+=lf(o.getGeometry(),{projection:"EPSG:4326"})}return n}}class e0 extends GU{constructor(e="ol-map-container"){super(e);zt(this,"name","OlHandler class");zt(this,"target","");this.layerCollection={},this.layerIdForBasinBound="vectorLayerPoint_wrzoneLayer",this.layerIdForHighlight="layerId_highlight",this.layerIdForAllStations="allStationsPointFromSQHS",this.svgMap={}}getMap(){return this.map}setMap(e){this.map=e}toggleBaseLayer(e){this.map.getLayers().getArray().forEach(n=>{n&&n.getProperties().id&&n.getProperties().id.indexOf("baseMap")!==-1&&n.setVisible(!1)}),this.map.getLayers().getArray().forEach(n=>{if(n&&n.getProperties().id)for(let i=0;i<e.length;i++){const o=e[i];if(n.getProperties().id.indexOf(o)!==-1){n.setVisible(!0);break}}})}getGeojsonLayerWithRender(){const e=new Un({features:getFeaturesFromGeojson(geojson)});new Ur({id,visible,source:e});let n=this.layerHandler.getUserDefinedXYZ(options);this.map.addLayer(n)}interpolation(e){let n=[117.57071648609964,29.612017196294367,118.56681691790034,30.1558200567],{map:i}=this,{id:o}=e;this.removeLayerById(o),this.removeLayerById(o+"_kri");let a=[],l=[],u=[],c=[],h=[];const f=this.layerHandler.getGeojsonLayerWithRender(e);f.getSource().forEachFeature(d=>{a.push(d.getProperties().testField),l.push(d.getGeometry().getCoordinates()[0]),u.push(d.getGeometry().getCoordinates()[1]),c.push(d.getGeometry().getCoordinates())}),h=[[[n[0],n[1]],[n[0],n[3]],[n[2],n[3]],[n[2],n[1]],[n[0],n[1]]]],i.addLayer(f),this.drawKriging({id:o,values:a,lngs:l,lats:u,interpolationPolygons:h,boxExtent:n})}drawKriging({id:e,values:n,lngs:i,lats:o,interpolationPolygons:a,boxExtent:l}){let{map:u,kriging:c}=this;const h={krigingModel:"exponential",krigingSigma2:0,krigingAlpha:226,canvasAlpha:.75,colors:["#00A600","#01A600","#03A700","#04A700","#05A800","#07A800","#08A900","#09A900","#0BAA00","#0CAA00","#0DAB00","#0FAB00","#10AC00","#12AC00","#13AD00","#14AD00","#16AE00","#17AE00","#19AF00","#1AAF00","#1CB000","#1DB000","#1FB100","#20B100","#22B200","#23B200","#25B300","#26B300","#28B400","#29B400","#2BB500","#2CB500","#2EB600","#2FB600","#31B700","#33B700","#34B800","#36B800","#37B900","#39B900","#3BBA00","#3CBA00","#3EBB00","#3FBB00","#41BC00","#43BC00","#44BD00","#46BD00","#48BE00","#49BE00","#4BBF00","#4DBF00","#4FC000","#50C000","#52C100","#54C100","#55C200","#57C200","#59C300","#5BC300","#5DC400","#5EC400","#60C500","#62C500","#64C600","#66C600","#67C700","#69C700","#6BC800","#6DC800","#6FC900","#71C900","#72CA00","#74CA00","#76CB00","#78CB00","#7ACC00","#7CCC00","#7ECD00","#80CD00","#82CE00","#84CE00","#86CF00","#88CF00","#8AD000","#8BD000","#8DD100","#8FD100","#91D200","#93D200","#95D300","#97D300","#9AD400","#9CD400","#9ED500","#A0D500","#A2D600","#A4D600","#A6D700","#A8D700","#AAD800","#ACD800","#AED900","#B0D900","#B2DA00","#B5DA00","#B7DB00","#B9DB00","#BBDC00","#BDDC00","#BFDD00","#C2DD00","#C4DE00","#C6DE00","#C8DF00","#CADF00","#CDE000","#CFE000","#D1E100","#D3E100","#D6E200","#D8E200","#DAE300","#DCE300","#DFE400","#E1E400","#E3E500","#E6E600","#E6E402","#E6E204","#E6E105","#E6DF07","#E6DD09","#E6DC0B","#E6DA0D","#E6D90E","#E6D710","#E6D612","#E7D414","#E7D316","#E7D217","#E7D019","#E7CF1B","#E7CE1D","#E7CD1F","#E7CB21","#E7CA22","#E7C924","#E8C826","#E8C728","#E8C62A","#E8C52B","#E8C42D","#E8C32F","#E8C231","#E8C133","#E8C035","#E8BF36","#E9BE38","#E9BD3A","#E9BC3C","#E9BB3E","#E9BB40","#E9BA42","#E9B943","#E9B945","#E9B847","#E9B749","#EAB74B","#EAB64D","#EAB64F","#EAB550","#EAB552","#EAB454","#EAB456","#EAB358","#EAB35A","#EAB35C","#EBB25D","#EBB25F","#EBB261","#EBB263","#EBB165","#EBB167","#EBB169","#EBB16B","#EBB16C","#EBB16E","#ECB170","#ECB172","#ECB174","#ECB176","#ECB178","#ECB17A","#ECB17C","#ECB17E","#ECB27F","#ECB281","#EDB283","#EDB285","#EDB387","#EDB389","#EDB38B","#EDB48D","#EDB48F","#EDB591","#EDB593","#EDB694","#EEB696","#EEB798","#EEB89A","#EEB89C","#EEB99E","#EEBAA0","#EEBAA2","#EEBBA4","#EEBCA6","#EEBDA8","#EFBEAA","#EFBEAC","#EFBFAD","#EFC0AF","#EFC1B1","#EFC2B3","#EFC3B5","#EFC4B7","#EFC5B9","#EFC7BB","#F0C8BD","#F0C9BF","#F0CAC1","#F0CBC3","#F0CDC5","#F0CEC7","#F0CFC9","#F0D1CB","#F0D2CD","#F0D3CF","#F1D5D1","#F1D6D3","#F1D8D5","#F1D9D7","#F1DBD8","#F1DDDA","#F1DEDC","#F1E0DE","#F1E2E0","#F1E3E2","#F2E5E4","#F2E7E6","#F2E9E8","#F2EBEA","#F2ECEC","#F2EEEE","#F2F0F0","#F2F2F2"]};let f=l,d=null;if(n.length>3){let g=c.train(n,i,o,h.krigingModel,h.krigingSigma2,h.krigingAlpha),p=c.grid(a,g,(f[2]-f[0])/200);d!==null&&u.removeLayer(d),d=new $p({id:e+"_kri",source:new eA({canvasFunction:(m,y,E,_,v)=>{let x=document.createElement("canvas");return x.width=_[0],x.height=_[1],x.style.display="block",x.getContext("2d").globalAlpha=h.canvasAlpha,c.plot(x,p,[m[0],m[2]],[m[1],m[3]],h.colors),x},projection:"EPSG:4326"})}),u.addLayer(d)}else alert("有效样点个数不足,无法插值")}getSvg(e,n,i){if(n===i)return e;const o=e+i;if(this.svgMap.hasOwnProperty(o))return this.svgMap.uid;let a=new XMLHttpRequest;a.open("GET",e,!1),a.setRequestHeader("Content-type","application/ison;charset=utf-8;"),a.send(JSON.stringify());let l=a.responseText;l=l.replaceAll(n,i);const u="data:image/svg+xml,"+escape(l);return this.svgMap[o]=u,u}addVectorLayer({id:e=Wn.UUIDGenerator(),features:n=[],geometries:i,zIndex:o=1e3,visible:a=!0,style:l={image:{},stroke:{},fill:{}},map:u=this.map}){i&&i.forEach(f=>{const d=new Ye({geometry:f});n.push(d)});const c=new Un({features:n}),h=new Ur({id:e,visible:a,source:c,style:ao(l)});return u.addLayer(h),h.setZIndex(o),h}}function cR(r){return new e0(r)}const kU=["ready","mouse-move","mouse-click","mouse-dbclick","mouse-moveend","draw-end"],zU=r=>`vmap-theme-${r}`,K6="",Ca=(r,t)=>{const e=r.__vccOpts||r;for(const[n,i]of t)e[n]=i;return e},UU=["id"],VU={key:0,class:"vmap-title"},jU={class:"popup-title"},WU=["id"],YU={__name:"index",props:{theme:{type:String,default:ei.light},visible:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!1},title:{type:String,default:"标题"},popupId:{require:!0,type:String,default:""},contentHtml:{type:String,default:""}},emits:["on-close"],setup(r,{emit:t}){const e=r,{theme:n,popupId:i}=S.toRefs(e),o=t;let a=S.ref(i.value+"_content");const l=()=>{o("on-close")},u=S.computed(()=>["vmap-ol-popup",n.value]);return S.onMounted(()=>{S.nextTick(c=>{})}),S.onUnmounted(()=>{}),(c,h)=>S.withDirectives((S.openBlock(),S.createElementBlock("div",{id:S.unref(i),class:S.normalizeClass(u.value)},[r.showTitle?(S.openBlock(),S.createElementBlock("div",VU,[S.createElementVNode("span",jU,S.toDisplayString(r.title),1),S.createElementVNode("span",{class:"popup-title-close",onClick:l})])):S.createCommentVNode("",!0),S.createElementVNode("div",{id:S.unref(a),class:"vmap-popup-content"},[S.renderSlot(c.$slots,"default",{},void 0,!0)],8,WU)],10,UU)),[[S.vShow,r.visible]])}},n0=Ca(YU,[["__scopeId","data-v-ca23b738"]]),hR={theme:{type:String,default:ei.light},visible:{type:Boolean,default:!1},title:{type:String,default:"属性"},showTitle:{type:Boolean,default:!0},tableHeight:{type:Number,default:200},tableHeader:{type:Array,default(){return[{label:"属性",value:"label"},{label:"值",value:"value"}]}}},XU={__name:"index",props:{...hR,showTitle:{type:Boolean,default:!0},position:{type:Array,default(){return[]}}},emits:["on-close"],setup(r,{emit:t}){const e=S.inject("olHandler"),n=r,i=t,o="vmap-popup-id-"+oi(),a=S.ref(""),l=S.ref(!1),u=S.ref("vmap-popup-visible-"+oi()),{showTitle:c,position:h}=S.toRefs(n);S.watch(h,m=>{f===null&&d(m),f.setPosition(m)},{deep:!0});let f=null;const d=(m,y=[])=>{f=e.createOverlay({popupId:o,center:m,offset:[0,0],collection:!1}),l.value=!0},g=()=>(f.setPosition(void 0),i("on-close"),!1),p=()=>{f&&(e.map.removeOverlay(f),f=null)};return S.onUnmounted(()=>{p()}),(m,y)=>S.withDirectives((S.openBlock(),S.createBlock(n0,{theme:m.theme,title:m.title,"show-title":S.unref(c),popupId:o,contentHtml:a.value,onOnClose:g,class:S.normalizeClass(u.value)},{default:S.withCtx(()=>[S.renderSlot(m.$slots,"default")]),_:3},8,["theme","title","show-title","contentHtml","class"])),[[S.vShow,l.value]])}};var fR={exports:{}},HU=fR.exports={};HU.forEach=function(r,t){for(var e=0;e<r.length;e++){var n=t(r[e]);if(n)return n}};var dR=fR.exports,qU=function(r){var t=r.stateHandler.getState;function e(a){var l=t(a);return l&&!!l.isDetectable}function n(a){t(a).isDetectable=!0}function i(a){return!!t(a).busy}function o(a,l){t(a).busy=!!l}return{isDetectable:e,markAsDetectable:n,isBusy:i,markBusy:o}},ZU=function(r){var t={};function e(a){var l=r.get(a);return l===void 0?[]:t[l]||[]}function n(a,l){var u=r.get(a);t[u]||(t[u]=[]),t[u].push(l)}function i(a,l){for(var u=e(a),c=0,h=u.length;c<h;++c)if(u[c]===l){u.splice(c,1);break}}function o(a){var l=e(a);l&&(l.length=0)}return{get:e,add:n,removeListener:i,removeAllListeners:o}},KU=function(){var r=1;function t(){return r++}return{generate:t}},JU=function(r){var t=r.idGenerator,e=r.stateHandler.getState;function n(o){var a=e(o);return a&&a.id!==void 0?a.id:null}function i(o){var a=e(o);if(!a)throw new Error("setId required the element to have a resize detection state.");var l=t.generate();return a.id=l,l}return{get:n,set:i}},QU=function(r){function t(){}var e={log:t,warn:t,error:t};if(!r&&window.console){var n=function(i,o){i[o]=function(){var l=console[o];if(l.apply)l.apply(console,arguments);else for(var u=0;u<arguments.length;u++)l(arguments[u])}};n(e,"log"),n(e,"warn"),n(e,"error")}return e},gR={exports:{}},pR=gR.exports={};pR.isIE=function(r){function t(){var n=navigator.userAgent.toLowerCase();return n.indexOf("msie")!==-1||n.indexOf("trident")!==-1||n.indexOf(" edge/")!==-1}if(!t())return!1;if(!r)return!0;var e=function(){var n,i=3,o=document.createElement("div"),a=o.getElementsByTagName("i");do o.innerHTML="<!--[if gt IE "+ ++i+"]><i></i><![endif]-->";while(a[0]);return i>4?i:n}();return r===e},pR.isLegacyOpera=function(){return!!window.opera};var mR=gR.exports,yR={exports:{}},$U=yR.exports={};$U.getOption=tV;function tV(r,t,e){var n=r[t];return n==null&&e!==void 0?e:n}var eV=yR.exports,_R=eV,nV=function(t){t=t||{};var e=t.reporter,n=_R.getOption(t,"async",!0),i=_R.getOption(t,"auto",!0);i&&!n&&(e&&e.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),n=!0);var o=vR(),a,l=!1;function u(p,m){!l&&i&&n&&o.size()===0&&f(),o.add(p,m)}function c(){for(l=!0;o.size();){var p=o;o=vR(),p.process()}l=!1}function h(p){l||(p===void 0&&(p=n),a&&(d(a),a=null),p?f():c())}function f(){a=g(c)}function d(p){var m=clearTimeout;return m(p)}function g(p){var m=function(y){return setTimeout(y,0)};return m(p)}return{add:u,force:h}};function vR(){var r={},t=0,e=0,n=0;function i(l,u){u||(u=l,l=0),l>e?e=l:l<n&&(n=l),r[l]||(r[l]=[]),r[l].push(u),t++}function o(){for(var l=n;l<=e;l++)for(var u=r[l],c=0;c<u.length;c++){var h=u[c];h()}}function a(){return t}return{add:i,process:o,size:a}}var r0="_erd";function rV(r){return r[r0]={},ER(r)}function ER(r){return r[r0]}function iV(r){delete r[r0]}var sV={initState:rV,getState:ER,cleanState:iV},qh=mR,oV=function(r){r=r||{};var t=r.reporter,e=r.batchProcessor,n=r.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function i(c,h){function f(){h(c)}if(qh.isIE(8))n(c).object={proxy:f},c.attachEvent("onresize",f);else{var d=l(c);if(!d)throw new Error("Element is not detectable by this strategy.");d.contentDocument.defaultView.addEventListener("resize",f)}}function o(c){var h=r.important?" !important; ":"; ";return(c.join(h)+h).trim()}function a(c,h,f){f||(f=h,h=c,c=null),c=c||{},c.debug;function d(g,p){var m=o(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),y=!1,E=window.getComputedStyle(g),_=g.offsetWidth,v=g.offsetHeight;n(g).startSize={width:_,height:v};function x(){function w(){if(E.position==="static"){g.style.setProperty("position","relative",c.important?"important":"");var T=function(R,M,P,b){function A(B){return B.replace(/[^-\d\.]/g,"")}var L=P[b];L!=="auto"&&A(L)!=="0"&&(R.warn("An element that is positioned static has style."+b+"="+L+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+b+" will be set to 0. Element: ",M),M.style.setProperty(b,"0",c.important?"important":""))};T(t,g,E,"top"),T(t,g,E,"right"),T(t,g,E,"bottom"),T(t,g,E,"left")}}function I(){y||w();function T(M,P){if(!M.contentDocument){var b=n(M);b.checkForObjectDocumentTimeoutId&&window.clearTimeout(b.checkForObjectDocumentTimeoutId),b.checkForObjectDocumentTimeoutId=setTimeout(function(){b.checkForObjectDocumentTimeoutId=0,T(M,P)},100);return}P(M.contentDocument)}var R=this;T(R,function(P){p(g)})}E.position!==""&&(w(),y=!0);var C=document.createElement("object");C.style.cssText=m,C.tabIndex=-1,C.type="text/html",C.setAttribute("aria-hidden","true"),C.onload=I,qh.isIE()||(C.data="about:blank"),n(g)&&(g.appendChild(C),n(g).object=C,qh.isIE()&&(C.data="about:blank"))}e?e.add(x):x()}qh.isIE(8)?f(h):d(h,f)}function l(c){return n(c).object}function u(c){if(n(c)){var h=l(c);h&&(qh.isIE(8)?c.detachEvent("onresize",h.proxy):c.removeChild(h),n(c).checkForObjectDocumentTimeoutId&&window.clearTimeout(n(c).checkForObjectDocumentTimeoutId),delete n(c).object)}}return{makeDetectable:a,addListener:i,uninstall:u}},aV=dR.forEach,lV=function(r){r=r||{};var t=r.reporter,e=r.batchProcessor,n=r.stateHandler.getState;r.stateHandler.hasState;var i=r.idHandler;if(!e)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var o=h(),a="erd_scroll_detection_scrollbar_style",l="erd_scroll_detection_container";function u(x){f(x,a,l)}u(window.document);function c(x){var w=r.important?" !important; ":"; ";return(x.join(w)+w).trim()}function h(){var x=500,w=500,I=document.createElement("div");I.style.cssText=c(["position: absolute","width: "+x*2+"px","height: "+w*2+"px","visibility: hidden","margin: 0","padding: 0"]);var C=document.createElement("div");C.style.cssText=c(["position: absolute","width: "+x+"px","height: "+w+"px","overflow: scroll","visibility: none","top: "+-x*3+"px","left: "+-w*3+"px","visibility: hidden","margin: 0","padding: 0"]),C.appendChild(I),document.body.insertBefore(C,document.body.firstChild);var T=x-C.clientWidth,R=w-C.clientHeight;return document.body.removeChild(C),{width:T,height:R}}function f(x,w,I){function C(P,b){b=b||function(L){x.head.appendChild(L)};var A=x.createElement("style");return A.innerHTML=P,A.id=w,b(A),A}if(!x.getElementById(w)){var T=I+"_animation",R=I+"_animation_active",M=`/* Created by the element-resize-detector library. */
480
+ `;M+="."+I+" > div::-webkit-scrollbar { "+c(["display: none"])+` }
481
+
482
+ `,M+="."+R+" { "+c(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+T,"animation-name: "+T])+` }
483
+ `,M+="@-webkit-keyframes "+T+` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
484
+ `,M+="@keyframes "+T+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",C(M)}}function d(x){x.className+=" "+l+"_animation_active"}function g(x,w,I){if(x.addEventListener)x.addEventListener(w,I);else if(x.attachEvent)x.attachEvent("on"+w,I);else return t.error("[scroll] Don't know how to add event listeners.")}function p(x,w,I){if(x.removeEventListener)x.removeEventListener(w,I);else if(x.detachEvent)x.detachEvent("on"+w,I);else return t.error("[scroll] Don't know how to remove event listeners.")}function m(x){return n(x).container.childNodes[0].childNodes[0].childNodes[0]}function y(x){return n(x).container.childNodes[0].childNodes[0].childNodes[1]}function E(x,w){var I=n(x).listeners;if(!I.push)throw new Error("Cannot add listener to an element that is not detectable.");n(x).listeners.push(w)}function _(x,w,I){I||(I=w,w=x,x=null),x=x||{};function C(){if(x.debug){var q=Array.prototype.slice.call(arguments);if(q.unshift(i.get(w),"Scroll: "),t.log.apply)t.log.apply(null,q);else for(var dt=0;dt<q.length;dt++)t.log(q[dt])}}function T(q){function dt(oe){var ir=oe.getRootNode&&oe.getRootNode().contains(oe);return oe===oe.ownerDocument.body||oe.ownerDocument.body.contains(oe)||ir}return!dt(q)||window.getComputedStyle(q)===null}function R(q){var dt=n(q).container.childNodes[0],oe=window.getComputedStyle(dt);return!oe.width||oe.width.indexOf("px")===-1}function M(){var q=window.getComputedStyle(w),dt={};return dt.position=q.position,dt.width=w.offsetWidth,dt.height=w.offsetHeight,dt.top=q.top,dt.right=q.right,dt.bottom=q.bottom,dt.left=q.left,dt.widthCSS=q.width,dt.heightCSS=q.height,dt}function P(){var q=M();n(w).startSize={width:q.width,height:q.height},C("Element start size",n(w).startSize)}function b(){n(w).listeners=[]}function A(){if(C("storeStyle invoked."),!n(w)){C("Aborting because element has been uninstalled");return}var q=M();n(w).style=q}function L(q,dt,oe){n(q).lastWidth=dt,n(q).lastHeight=oe}function B(q){return m(q).childNodes[0]}function F(){return 2*o.width+1}function V(){return 2*o.height+1}function Y(q){return q+10+F()}function st(q){return q+10+V()}function Q(q){return q*2+F()}function et(q){return q*2+V()}function H(q,dt,oe){var ir=m(q),as=y(q),_r=Y(dt),Li=st(oe),Ue=Q(dt),Ut=et(oe);ir.scrollLeft=_r,ir.scrollTop=Li,as.scrollLeft=Ue,as.scrollTop=Ut}function Et(){var q=n(w).container;if(!q){q=document.createElement("div"),q.className=l,q.style.cssText=c(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),n(w).container=q,d(q),w.appendChild(q);var dt=function(){n(w).onRendered&&n(w).onRendered()};g(q,"animationstart",dt),n(w).onAnimationStart=dt}return q}function G(){function q(){var we=n(w).style;if(we.position==="static"){w.style.setProperty("position","relative",x.important?"important":"");var he=function(Ra,Xs,tp,Pa){function i0(ep){return ep.replace(/[^-\d\.]/g,"")}var Kh=tp[Pa];Kh!=="auto"&&i0(Kh)!=="0"&&(Ra.warn("An element that is positioned static has style."+Pa+"="+Kh+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+Pa+" will be set to 0. Element: ",Xs),Xs.style[Pa]=0)};he(t,w,we,"top"),he(t,w,we,"right"),he(t,w,we,"bottom"),he(t,w,we,"left")}}function dt(we,he,Ra,Xs){return we=we?we+"px":"0",he=he?he+"px":"0",Ra=Ra?Ra+"px":"0",Xs=Xs?Xs+"px":"0",["left: "+we,"top: "+he,"right: "+Xs,"bottom: "+Ra]}if(C("Injecting elements"),!n(w)){C("Aborting because element has been uninstalled");return}q();var oe=n(w).container;oe||(oe=Et());var ir=o.width,as=o.height,_r=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),Li=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(dt(-(1+ir),-(1+as),-as,-ir))),Ue=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),Ut=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),kn=c(["position: absolute","left: 0","top: 0"]),ls=c(["position: absolute","width: 200%","height: 200%"]),Ze=document.createElement("div"),Ve=document.createElement("div"),sr=document.createElement("div"),Ws=document.createElement("div"),Mi=document.createElement("div"),us=document.createElement("div");Ze.dir="ltr",Ze.style.cssText=_r,Ze.className=l,Ve.className=l,Ve.style.cssText=Li,sr.style.cssText=Ue,Ws.style.cssText=kn,Mi.style.cssText=Ut,us.style.cssText=ls,sr.appendChild(Ws),Mi.appendChild(us),Ve.appendChild(sr),Ve.appendChild(Mi),Ze.appendChild(Ve),oe.appendChild(Ze);function Ys(){var we=n(w);we&&we.onExpand?we.onExpand():C("Aborting expand scroll handler: element has been uninstalled")}function cs(){var we=n(w);we&&we.onShrink?we.onShrink():C("Aborting shrink scroll handler: element has been uninstalled")}g(sr,"scroll",Ys),g(Mi,"scroll",cs),n(w).onExpandScroll=Ys,n(w).onShrinkScroll=cs}function bt(){function q(Ue,Ut,kn){var ls=B(Ue),Ze=Y(Ut),Ve=st(kn);ls.style.setProperty("width",Ze+"px",x.important?"important":""),ls.style.setProperty("height",Ve+"px",x.important?"important":"")}function dt(Ue){var Ut=w.offsetWidth,kn=w.offsetHeight,ls=Ut!==n(w).lastWidth||kn!==n(w).lastHeight;C("Storing current size",Ut,kn),L(w,Ut,kn),e.add(0,function(){if(ls){if(!n(w)){C("Aborting because element has been uninstalled");return}if(!oe()){C("Aborting because element container has not been initialized");return}if(x.debug){var Ve=w.offsetWidth,sr=w.offsetHeight;(Ve!==Ut||sr!==kn)&&t.warn(i.get(w),"Scroll: Size changed before updating detector elements.")}q(w,Ut,kn)}}),e.add(1,function(){if(!n(w)){C("Aborting because element has been uninstalled");return}if(!oe()){C("Aborting because element container has not been initialized");return}H(w,Ut,kn)}),ls&&Ue&&e.add(2,function(){if(!n(w)){C("Aborting because element has been uninstalled");return}if(!oe()){C("Aborting because element container has not been initialized");return}Ue()})}function oe(){return!!n(w).container}function ir(){function Ue(){return n(w).lastNotifiedWidth===void 0}C("notifyListenersIfNeeded invoked");var Ut=n(w);if(Ue()&&Ut.lastWidth===Ut.startSize.width&&Ut.lastHeight===Ut.startSize.height)return C("Not notifying: Size is the same as the start size, and there has been no notification yet.");if(Ut.lastWidth===Ut.lastNotifiedWidth&&Ut.lastHeight===Ut.lastNotifiedHeight)return C("Not notifying: Size already notified");C("Current size not notified, notifying..."),Ut.lastNotifiedWidth=Ut.lastWidth,Ut.lastNotifiedHeight=Ut.lastHeight,aV(n(w).listeners,function(kn){kn(w)})}function as(){if(C("startanimation triggered."),R(w)){C("Ignoring since element is still unrendered...");return}C("Element rendered.");var Ue=m(w),Ut=y(w);(Ue.scrollLeft===0||Ue.scrollTop===0||Ut.scrollLeft===0||Ut.scrollTop===0)&&(C("Scrollbars out of sync. Updating detector elements..."),dt(ir))}function _r(){if(C("Scroll detected."),R(w)){C("Scroll event fired while unrendered. Ignoring...");return}dt(ir)}if(C("registerListenersAndPositionElements invoked."),!n(w)){C("Aborting because element has been uninstalled");return}n(w).onRendered=as,n(w).onExpand=_r,n(w).onShrink=_r;var Li=n(w).style;q(w,Li.width,Li.height)}function ue(){if(C("finalizeDomMutation invoked."),!n(w)){C("Aborting because element has been uninstalled");return}var q=n(w).style;L(w,q.width,q.height),H(w,q.width,q.height)}function Qt(){I(w)}function ce(){C("Installing..."),b(),P(),e.add(0,A),e.add(1,G),e.add(2,bt),e.add(3,ue),e.add(4,Qt)}C("Making detectable..."),T(w)?(C("Element is detached"),Et(),C("Waiting until element is attached..."),n(w).onRendered=function(){C("Element is now attached"),ce()}):ce()}function v(x){var w=n(x);w&&(w.onExpandScroll&&p(m(x),"scroll",w.onExpandScroll),w.onShrinkScroll&&p(y(x),"scroll",w.onShrinkScroll),w.onAnimationStart&&p(w.container,"animationstart",w.onAnimationStart),w.container&&x.removeChild(w.container))}return{makeDetectable:_,addListener:E,uninstall:v,initDocument:u}},Zh=dR.forEach,uV=qU,cV=ZU,hV=KU,fV=JU,dV=QU,xR=mR,gV=nV,Ia=sV,pV=oV,mV=lV;function wR(r){return Array.isArray(r)||r.length!==void 0}function SR(r){if(Array.isArray(r))return r;var t=[];return Zh(r,function(e){t.push(e)}),t}function CR(r){return r&&r.nodeType===1}var yV=function(r){r=r||{};var t;if(r.idHandler)t={get:function(_){return r.idHandler.get(_,!0)},set:r.idHandler.set};else{var e=hV(),n=fV({idGenerator:e,stateHandler:Ia});t=n}var i=r.reporter;if(!i){var o=i===!1;i=dV(o)}var a=Ta(r,"batchProcessor",gV({reporter:i})),l={};l.callOnAdd=!!Ta(r,"callOnAdd",!0),l.debug=!!Ta(r,"debug",!1);var u=cV(t),c=uV({stateHandler:Ia}),h,f=Ta(r,"strategy","object"),d=Ta(r,"important",!1),g={reporter:i,batchProcessor:a,stateHandler:Ia,idHandler:t,important:d};if(f==="scroll"&&(xR.isLegacyOpera()?(i.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),f="object"):xR.isIE(9)&&(i.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),f="object")),f==="scroll")h=mV(g);else if(f==="object")h=pV(g);else throw new Error("Invalid strategy name: "+f);var p={};function m(_,v,x){function w(P){var b=u.get(P);Zh(b,function(L){L(P)})}function I(P,b,A){u.add(b,A),P&&A(b)}if(x||(x=v,v=_,_={}),!v)throw new Error("At least one element required.");if(!x)throw new Error("Listener required.");if(CR(v))v=[v];else if(wR(v))v=SR(v);else return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");var C=0,T=Ta(_,"callOnAdd",l.callOnAdd),R=Ta(_,"onReady",function(){}),M=Ta(_,"debug",l.debug);Zh(v,function(b){Ia.getState(b)||(Ia.initState(b),t.set(b));var A=t.get(b);if(M&&i.log("Attaching listener to element",A,b),!c.isDetectable(b)){if(M&&i.log(A,"Not detectable."),c.isBusy(b)){M&&i.log(A,"System busy making it detectable"),I(T,b,x),p[A]=p[A]||[],p[A].push(function(){C++,C===v.length&&R()});return}return M&&i.log(A,"Making detectable..."),c.markBusy(b,!0),h.makeDetectable({debug:M,important:d},b,function(B){if(M&&i.log(A,"onElementDetectable"),Ia.getState(B)){c.markAsDetectable(B),c.markBusy(B,!1),h.addListener(B,w),I(T,B,x);var F=Ia.getState(B);if(F&&F.startSize){var V=B.offsetWidth,Y=B.offsetHeight;(F.startSize.width!==V||F.startSize.height!==Y)&&w(B)}p[A]&&Zh(p[A],function(st){st()})}else M&&i.log(A,"Element uninstalled before being detectable.");delete p[A],C++,C===v.length&&R()})}M&&i.log(A,"Already detecable, adding listener."),I(T,b,x),C++}),C===v.length&&R()}function y(_){if(!_)return i.error("At least one element is required.");if(CR(_))_=[_];else if(wR(_))_=SR(_);else return i.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");Zh(_,function(v){u.removeAllListeners(v),h.uninstall(v),Ia.cleanState(v)})}function E(_){h.initDocument&&h.initDocument(_)}return{listenTo:m,removeListener:u.removeListener,removeAllListeners:u.removeAllListeners,uninstall:y,initDocument:E}};function Ta(r,t,e){var n=r[t];return n==null&&e!==void 0?e:n}const _V=vm(yV);function vV({tableHeight:r,container:t="table-container",offset:e=0}){const n=`.${t}`;S.nextTick(()=>{_V().listenTo(document.querySelector(n),i=>{r.value=i.clientHeight+e}),r.value=document.querySelector(n).clientHeight+e})}const J6="",$g=Ca(Object.assign({name:"VTable"},{props:{showPagination:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!1},tableData:{type:Array,default(){return[]}},tableHeader:{type:Array,default(){return[]}},tableHandler:{type:Array,default(){return[]}}},emits:["on-handler"],setup(r,{emit:t}){const e=r,n=t,{tableData:i,tableHeader:o,tableHandler:a,showPagination:l}=S.toRefs(e);let u=S.ref("table-"+parseInt(Math.random()*1e9)),c=S.ref(100);const h=()=>({"background-color":"#e4f0fd",color:"#547d9b"});S.onMounted(()=>{vV({tableHeight:c,container:u.value,offset:-30})});const f=(d,g)=>{n("on-handler",d.method,g)};return(d,g)=>{const p=S.resolveComponent("el-table-column"),m=S.resolveComponent("el-icon"),y=S.resolveComponent("el-button"),E=S.resolveComponent("el-table"),_=S.resolveComponent("el-pagination");return S.openBlock(),S.createElementBlock("div",{class:S.normalizeClass(S.unref(u)),style:{width:"100%",height:"100%"}},[S.createVNode(E,{data:S.unref(i),height:S.unref(c),style:{width:"100%"},"show-header":r.showHeader,border:"","header-cell-style":h},{default:S.withCtx(()=>[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(S.unref(o),(v,x)=>(S.openBlock(),S.createBlock(p,{type:v.type||"",key:x,prop:v.value,label:v.label,width:v.width||"auto",align:v.align||"center","show-overflow-tooltip":""},null,8,["type","prop","label","width","align"]))),128)),(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(S.unref(a),(v,x)=>(S.openBlock(),S.createBlock(p,{key:x,label:v.label,align:"center"},{default:S.withCtx(({row:w})=>[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(v.children,(I,C)=>(S.openBlock(),S.createElementBlock(S.Fragment,null,[I.type==="icon"?(S.openBlock(),S.createBlock(m,{key:0,onClick:T=>f(I,w)},{default:S.withCtx(()=>[(S.openBlock(),S.createBlock(S.resolveDynamicComponent(I.value)))]),_:2},1032,["onClick"])):(S.openBlock(),S.createBlock(y,{key:1,link:"",onClick:T=>f(I,w)},{default:S.withCtx(()=>[S.createTextVNode(S.toDisplayString(I.label),1)]),_:2},1032,["onClick"]))],64))),256))]),_:2},1032,["label"]))),128))]),_:1},8,["data","height","show-header"]),S.unref(l)?(S.openBlock(),S.createBlock(_,{key:0,small:"",background:"",layout:"prev, pager, next",total:1e3,style:{margin:"5px 0",float:"right"}})):S.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-6d26499a"]]),EV={__name:"index",props:{...hR,showTitle:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},position:{type:Array,default(){return[]}},properties:{type:Array,default(){return[]}}},setup(r){const t=S.inject("olHandler"),e=r,n="vmap-popup-id-"+oi(),i=S.ref(""),o=S.ref(!1),a=S.ref("vmap-popup-visible-"+oi()),{showTitle:l,position:u,properties:c}=S.toRefs(e);S.watch(c,m=>{d(u.value,c.value)},{deep:!0}),S.watch(u,m=>{h===null&&d(m),h.setPosition(m)},{deep:!0});let h=null;const f=S.ref([]),d=(m,y=[])=>{h=t.createOverlay({popupId:n,center:m,offset:[0,0],collection:!1}),f.value=y,o.value=!0},g=()=>(h.setPosition(void 0),!1),p=()=>{h&&(t.map.removeOverlay(h),h=null)};return S.onUnmounted(()=>{p()}),(m,y)=>S.withDirectives((S.openBlock(),S.createBlock(XU,{theme:m.theme,title:m.title,"show-title":S.unref(l),popupId:n,contentHtml:i.value,onOnClose:g,class:S.normalizeClass(a.value)},{default:S.withCtx(()=>[S.renderSlot(m.$slots,"default",{data:S.unref(c)},()=>[S.createVNode($g,{style:S.normalizeStyle({height:m.tableHeight+"px"}),"table-header":m.tableHeader,"show-header":r.showHeader,"table-data":f.value},null,8,["style","table-header","show-header","table-data"])])]),_:3},8,["theme","title","show-title","contentHtml","class"])),[[S.vShow,o.value]])}},tj="",xV={class:"vmap-status-bar"},wV={__name:"index",props:{theme:{type:String,default:ei.light},position:{type:Array,default(){return[-1,-1]}},zoom:{type:Number,default:0}},setup(r){S.inject("olHandler");const t=r,e=S.computed(()=>{let o="经度 ",a="纬度 ",l="°",[u,c]=t.position;return u<180&&u>-180||([u,c]=NP(t.position,eh().prj)),[o+parseFloat(u).toFixed(4)+l,a+parseFloat(c).toFixed(4)+l]}),{theme:n}=S.toRefs(t),i=S.computed(()=>[zU(n.value)]);return(o,a)=>(S.openBlock(),S.createElementBlock("div",xV,[S.createElementVNode("div",{class:S.normalizeClass(["item",i.value]),style:{display:"flex","justify-content":"space-around",width:"380px"}},[S.createElementVNode("span",null,S.toDisplayString(e.value[0]),1),S.createElementVNode("span",null,S.toDisplayString(e.value[1]),1),S.createTextVNode(" 层级 "+S.toDisplayString(parseInt(r.zoom)),1)],2)]))}},ej="",nj="",SV={class:"vmap-container"},CV=["id"],IV=Object.assign({name:"OlMap"},{props:{mapConfig:{type:Object,default(){return eh()}},theme:{type:String,default:ei.light},showFeaturePopup:{type:Boolean,default:!1},singlePopupTableHeight:{type:Number,default:200},singlePopupTableHeader:{type:Array,default(){return[{label:"属性",value:"label"},{label:"值",value:"value",width:100}]}},multiplePopupTableHeight:{type:Number,default:200},multiplePopupTableHeader:{type:Array,default(){return[{label:"属性",value:"label"},{label:"值",value:"value",width:100}]}},multiplePopupConfig:{type:Object,default(){return{tableHeight:180}}},featurePopupTitle:{type:String,default:"标题"},featurePopup:{type:Object,default(){return{}}},showMultiplePopup:{type:Boolean,default:!1},multiplePopup:{type:Array,default(){return[]}},identify:{type:Boolean,default:!1},identifyConfig:{type:Object,default(){return{height:200,header:[{label:"属性",value:"label"},{label:"值",value:"value"}],showHeader:!1,theme:"light"}}},showStatusbar:{type:Boolean,default:!0},showBasemap:{type:Boolean,default:!0},dragPan:{type:Boolean,default:!0},controls:{type:Object,default(){return{zoom:!0,scaleLine:!0}}}},emits:kU,setup(r,{emit:t}){const e=cR(),n=S.ref([]);S.provide("olHandler",e),S.provide("mapCenter",n);const i=r,{featurePopupTitle:o,featurePopup:a,multiplePopup:l,mapConfig:u,controls:c,showBasemap:h,showFeaturePopup:f,showMultiplePopup:d,identify:g,dragPan:p}=S.toRefs(i),m=t;S.provide("mapConfig",u.value);const y=S.ref(`${Wn.uuidOnlyStr()}-vmap-id`);let E=S.ref(!1),_=S.ref([0,0]);S.ref(!1);let v=S.ref(!1),x=S.ref(!1),w=null;const I="ol-custom-popup-id",C="ol-custom-popups-id";let T="";const R="m-custom-popup-";S.ref(!1);let M=S.ref(""),P=S.ref([]);const b=S.ref([]),A=S.computed(()=>l.value.map(G=>({...G,id:R+parseInt(Math.random()*1e6)})));S.watch(a,(G,bt)=>{if(L(G)){const{location:ue,attributes:Qt}=G;Qt instanceof Array&&Qt.length>0&&et(ue,Qt)}},{deep:!0}),S.watch(l,(G,bt)=>{B(G)&&(x.value=!1,setTimeout(()=>{H()},0))},{deep:!0});const L=G=>!!(E.value&&f.value&&JSON.stringify(G)!="{}"&&G.hasOwnProperty("location")&&G.hasOwnProperty("attributes")),B=G=>!!(E.value&&d.value&&G instanceof Array),F=()=>{};S.ref([]),S.ref(!0);const V=S.ref(0);S.onMounted(()=>{e.target=y.value,e.initMap(u.value,{controls:c.value,showBasemap:h.value,dragPan:p.value}).then(({map:G})=>{E.value=!0,G.set("mouseStatus",ba.none),m("ready",e),V.value=G.getView().getZoom(),Y()})});const Y=()=>{e.registerMouseMove(G=>{_.value=[G.coordinate[0].toFixed(4),G.coordinate[1].toFixed(4)],m("mouse-move",G)}),e.registerMouseClick(G=>{g.value&&!f.value&&Q(G),m("mouse-click",G)}),e.registerMouseDbClick(G=>{m("mouse-dbclick",G)}),e.registerMouseMoveEnd(G=>{m("mouse-moveend",G),V.value=e.map.getView().getZoom(),n.value=e.map.getView().getCenter()})},st=S.ref([]),Q=G=>{let bt=e.map.getFeaturesAtPixel(G.pixel)||[];const ue=G.coordinate;bt.length!==0&&(st.value=ue,P.value=[],bt.forEach((Qt,ce)=>{M.value="要素_1",P.value.push({name:"要素_"+(ce+1),location:ue,attributes:Wn.object2Array(Qt.getProperties())})}))},et=(G,bt)=>{w=e.createOverlay({popupId:I,center:G,offset:[0,0],collection:!1}),b.value=bt,v.value=!0},H=()=>{d.value&&(A.value.forEach(G=>{const{id:bt,location:ue,attributes:Qt}=G;e.createOverlay({popupId:bt,center:ue,offset:[0,0]})}),x.value=!0)},Et=()=>(w.setPosition(void 0),!1);return(G,bt)=>{const ue=S.resolveComponent("el-tab-pane"),Qt=S.resolveComponent("el-tabs");return S.openBlock(),S.createElementBlock("div",SV,[S.createElementVNode("div",{id:y.value,class:"vmap-view"},null,8,CV),S.renderSlot(G.$slots,"popup",{},void 0,!0),S.unref(E)?S.renderSlot(G.$slots,"default",{key:0},void 0,!0):S.createCommentVNode("",!0),r.showStatusbar?(S.openBlock(),S.createBlock(wV,{key:1,theme:r.theme,position:S.unref(_),zoom:V.value},null,8,["theme","position","zoom"])):S.createCommentVNode("",!0),S.withDirectives(S.createVNode(n0,{popupId:I,title:S.unref(o),contentHtml:S.unref(T),onOnClose:Et},{default:S.withCtx(()=>[S.createVNode($g,{style:S.normalizeStyle({height:r.singlePopupTableHeight+"px"}),"table-header":r.singlePopupTableHeader,"table-data":b.value},null,8,["style","table-header","table-data"])]),_:1},8,["title","contentHtml"]),[[S.vShow,S.unref(v)]]),S.withDirectives(S.createElementVNode("div",{id:C},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(A.value,(ce,q)=>(S.openBlock(),S.createBlock(n0,{popupId:ce.id,key:ce.id,"show-title":!1},{default:S.withCtx(()=>[S.createVNode($g,{style:S.normalizeStyle({height:r.multiplePopupTableHeight+"px"}),"table-header":r.multiplePopupTableHeader,"table-data":ce.attributes},null,8,["style","table-header","table-data"])]),_:2},1032,["popupId"]))),128))],512),[[S.vShow,S.unref(x)]]),S.createVNode(EV,{title:"属性",theme:r.identifyConfig.theme,position:st.value},{default:S.withCtx(()=>[S.createVNode(Qt,{modelValue:S.unref(M),"onUpdate:modelValue":bt[0]||(bt[0]=ce=>S.isRef(M)?M.value=ce:M=ce),style:{"max-width":"200px"},onTabClick:F},{default:S.withCtx(()=>[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(S.unref(P),(ce,q)=>(S.openBlock(),S.createBlock(ue,{label:ce.name,name:ce.name,key:q},{default:S.withCtx(()=>[S.createVNode($g,{style:S.normalizeStyle({height:r.identifyConfig.height+"px"}),"table-header":r.identifyConfig.header,"show-header":r.identifyConfig.showHeader,"table-data":ce.attributes},null,8,["style","table-header","show-header","table-data"])]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["theme","position"])])}}}),IR=Ca(IV,[["__scopeId","data-v-68a19aef"]]),TV="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAWVJREFUWEftls9Kw0AQxr9JQTx4FxTP3hoPepUQ0ZvRiz5Ai0L6DuJT+KdI+wCetBexxRS8i43voOgbBA8Z2ZKWIG52mxjNYXPd2Znffpnd+QganzeIfDCOAaxphOuEjAC0ezvzl6SK9gafPjg+V8XlXPfVAP1I0No5C6i2jXQAWJWlwHr83wAwANVRYKv7csPMGwCW0k21sLJaoMfUW8cKuJ1Q2umlA7jd8BqMAwB3HNPJ8Kj+lOb2+lGZ1xDkdsJ3AIsc0/r34gLkLwDGJwya9o8NaQCMAkYBo0AVFCjXkk0Gkewl3L2PWkQ4U8+1HBGElpgFmU+xSJtACFv+W+Y0BFnt3vbchRZAjrNNR7xM2UlOA1AJBV6FD5QZkjz/37l6dizLGgJ4C5r2clYOSszonsySzQogilOtdkrMDhHdPjTq+5kAKlM6K0A6XnUDROzUhiXmdFP4wyJFAXyA8Bg07EOdPF/o6uB9Vuth3wAAAABJRU5ErkJggg==",RV={position:{type:String,default:"top-right"},offset:{type:Array,default(){return[0,0]}}},PV=({position:r,offset:t})=>S.computed(()=>{const e={},[n,i]=r.value.split("-");return e[n]=20+t.value[1]+"px",e[i]=20+t.value[0]+"px",{...e,position:"absolute"}}),ij="",bV=["src"],AV={for:""},LV={class:"image"},MV={class:"image-2"},NV=["src","onClick"],OV=Object.assign({name:"OlBasemap"},{props:{...RV},emits:["change"],setup(r,{emit:t}){const e=S.inject("olHandler"),n=S.inject("mapConfig"),i=r,o=t,a=PV(S.toRefs(i));let l=n.defaultBaseLayerId,u=S.ref(l),c=S.ref(!1);S.ref("");let h=S.ref(n.baseLayers);const f=()=>{c.value=!0},d=p=>{u.value=p.id,g(p)},g=p=>{e.getBaseLayer(p).forEach(y=>{e.map.addLayer(y)}),o("change",p.id)};return(p,m)=>(S.openBlock(),S.createElementBlock("div",{class:"vmap-base-layer",style:S.normalizeStyle(S.unref(a))},[S.createElementVNode("img",{class:"vmap-layer-btn",src:S.unref(TV),onMouseover:f},null,40,bV),S.createVNode(S.Transition,{name:"fade",mode:"out-in",appear:""},{default:S.withCtx(()=>[S.withDirectives(S.createElementVNode("div",{class:"vmap-layers",onMouseleave:m[0]||(m[0]=y=>S.isRef(c)?c.value=!1:c=!1)},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(S.unref(h),(y,E)=>(S.openBlock(),S.createElementBlock("div",{key:E,class:"item"},[S.createElementVNode("label",AV,S.toDisplayString(y.label),1),S.createElementVNode("div",LV,[S.createElementVNode("div",MV,[S.createElementVNode("img",{src:y.children[0].image,alt:"",class:S.normalizeClass(S.unref(u)===y.id?"active":""),onClick:_=>d(y)},null,10,NV)])])]))),128))],544),[[S.vShow,S.unref(c)]])]),_:1})],4))}}),TR=Ca(OV,[["__scopeId","data-v-06ca68e8"]]),FV={fill:"currentColor",t:"1688979639463",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"10678",width:"25",height:"25"},DV=[S.createElementVNode("path",{d:"M844.7 281.5h-80.9V189c0-69.9-56.8-126.8-126.6-126.8H410.7C341 62.2 284.2 119 284.2 189v92.6H179.3c-64.7 0-117.3 52.8-117.3 117v88.1h343.5c18.2-25.5 48.1-41.8 81.7-41.8H568c33.6 0 63.5 16.4 81.7 41.8H962v-88.1c0-64.5-52.8-117.1-117.3-117.1z m-186.1 0H389.5V189c0-11.9 9.5-21.4 21.2-21.4h226.6c11.7 0 21.2 9.5 21.2 21.4v92.5zM962 583v261.8c0 64.3-52.6 117-117.3 117H179.3c-64.5 0-117.3-52.6-117.3-117V583h324.1v43.9c0 55.6 45.3 101.1 101.1 101.1H568c55.8 0 101.1-45.5 101.1-101.1V583H962z","p-id":"10679",fill:"#1296db"},null,-1),S.createElementVNode("path",{d:"M588.2 546v80.9c0 10.9-9.3 20.2-20.2 20.2h-80.9c-10.9 0-20.2-9.3-20.2-20.2V546c0-11.1 9.3-20.2 20.2-20.2H568c10.9-0.1 20.2 9 20.2 20.2z","p-id":"10680",fill:"#1296db"},null,-1)];function BV(r,t){return S.openBlock(),S.createElementBlock("svg",FV,[...DV])}const GV={name:"vc-toolbox",render:BV},kV={theme:{type:String,default:ei.light},position:{type:String,default:"top-right"},offset:{type:Array,default(){return[0,0]}}},zV=["change"],UV=({position:r,offset:t})=>S.computed(()=>{const e={},[n,i]=r.value.split("-");return e[n]=20+t.value[1]+"px",e[i]=20+t.value[0]+"px",{...e,position:"absolute"}}),lj="",uj="",VV={class:"tool"},jV=["onClick"],WV=["src","title"],YV=Object.assign({name:"OlToolbar"},{props:{...kV,offset:{type:Array,default(){return[0,50]}}},emits:[...zV],setup(r,{emit:t}){const e=S.inject("olHandler"),n=S.inject("mapConfig"),i=r,o=t,a=UV(S.toRefs(i)),l=S.ref({...a.value,width:"36px","text-align":"center"});let u=S.ref([]);S.onMounted(()=>{u.value=n.toolbar.filter(p=>p.visible)});let c=S.ref(!1);const h=()=>{c.value=!c.value},f=S.ref(-1),d=(p,m)=>{m!==6?f.value=m:f.value=-1;const{key:y,handler:E}=p;g({key:y,handler:E})},g=(p,m)=>{const{key:y,handler:E}=p;if(E){o("change",E);return}switch(y){case"fullExtent":e.fullExtent();break;case"zoomIn":e.dragZoom(!1);break;case"zoomOut":e.dragZoom(!0);break;case"pointer":e.endDragZoom(),e.map.set("mouseStatus",ba.none);break;case"LineString":e.getMeasureHandler().measureLength();break;case"Polygon":e.getMeasureHandler().measureArea();break;case"clear":e.getMeasureHandler().clearResult();break}};return(p,m)=>{const y=GV;return S.openBlock(),S.createElementBlock("div",{class:"vmap-mapbar",style:S.normalizeStyle(l.value)},[S.createElementVNode("a",{class:"active",onClick:h},[S.createVNode(y)]),S.createVNode(S.Transition,{name:"el-zoom-in-top"},{default:S.withCtx(()=>[S.withDirectives(S.createElementVNode("div",VV,[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(S.unref(u),(E,_)=>(S.openBlock(),S.createElementBlock("a",{key:_,class:S.normalizeClass(f.value===_?"active2":""),onClick:v=>d(E,_)},[S.createElementVNode("img",{class:"navItem",src:E.image,title:E.label},null,8,WV)],10,jV))),128))],512),[[S.vShow,!S.unref(c)]])]),_:1})],4)}}}),RR=Ca(YV,[["__scopeId","data-v-d89c21d6"]]),XV={width:"1.2em",height:"1.2em",fill:"currentColor",t:"1692337764968",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4234"},HV=[S.createElementVNode("path",{d:"M170.413315 31.525627m40.226519 40.226519l740.570216 740.570217q40.226519 40.226519 0 80.453038l0 0q-40.226519 40.226519-80.453038 0l-740.570217-740.570217q-40.226519-40.226519 0-80.453038l0 0q40.226519-40.226519 80.453039 0Z",fill:"","p-id":"4235"},null,-1),S.createElementVNode("path",{d:"M90.107379 852.984472m40.226519-40.226519l740.570217-740.570217q40.226519-40.226519 80.453038 0l0 0q40.226519 40.226519 0 80.453038l-740.570217 740.570217q-40.226519 40.226519-80.453038 0l0 0q-40.226519-40.226519 0-80.453038Z",fill:"","p-id":"4236"},null,-1)];function qV(r,t){return S.openBlock(),S.createElementBlock("svg",XV,[...HV])}const PR={name:"vc-close",render:qV},ZV={width:"1.2em",height:"1.2em",fill:"currentColor",t:"1692338624655",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5392"},KV=[S.createElementVNode("path",{d:"M752.3 91.3l-34.7-16.8c-26.1-12.6-57.5-1.7-70.1 24.5L531.8 338.4l-6.9-3.4c-64.1-30.9-141.1-4.1-172 60l-10 20.7 375.2 181.2 10-20.7c30.9-64.1 4.1-141.1-60-172l-6.9-3.3 115.6-239.4c12.6-26.2 1.7-57.6-24.5-70.2zM702 630L326.3 448.6c-22.9 30-52.5 63.8-90.1 97.4-57.5 51.4-114.5 85.3-159.6 107.4 13.1 41.4 40.8 61.3 60.3 82.3 7.2 7.8 118.3-112.3 126.3-104.6 8 7.7-87 143.1-78.3 150.6 25.9 22.2 55 43.4 86.7 63.3 6.5 4.1 145.1-185 151.3-181.6 12.4 6.8-87.9 217.4-74.8 223.7 13 6.3 26.1 12.2 39.1 17.7 45.1 19 89.9 33 132.8 42.2 13.1 2.8 82-234.4 94.6-232.5 12.7 1.9-30.8 242.9-18.7 243.9 36.5 3 70.6 1.9 100.9-3.3-10.5-54.4-18.2-124.6-12.5-205.8 3.2-44.5 9.9-84.5 17.7-119.3z","p-id":"5393"},null,-1)];function JV(r,t){return S.openBlock(),S.createElementBlock("svg",ZV,[...KV])}const QV={name:"vc-clean",render:JV},$V={fill:"currentColor",t:"1688700699595",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"14042",width:"16",height:"16"},t6=[S.createElementVNode("path",{d:"M664.7 265.6l-519.4 96.7-7.8 7.8v332.7l10.2 10.4 712.3 55 1.2-1.8 4.5-5.4-194.1-488.5-6.9-6.9z m59.4-147.2c45.1 0 83.4 38.8 83.4 84.4 0 33.7-14.8 61-39.3 75.1l-8.5 4.2-3.4 1.1 191.5 452.5 1.2 0.1c23.8 2.6 45.9 15.3 56.7 32.4l3.5 6.6 2.4 7c13.1 33.1 11.4 64.7-7 89.5-19.4 26.2-51.6 38.9-81.2 32.7-29.8 0-55.6-15.6-69-40.1l-4-8.5-2.7-8.1-685.1-49.1-2.2 6.8c-9.5 23.8-29.7 40.9-54.6 46.6l-9.5 1.6-8.9 0.5C42.3 853.7 4 814.9 4 769.3c0-33.7 14.8-61 39.3-75.1l8.5-4.2 7.5-2.7V385.6l-7.5-2.6C28 373.1 11.5 351.9 6 324.3l-1.5-10.6-0.4-10c0-44.8 37.5-78.8 83.4-78.8 29.8 0 55.6 15.6 69 40.1l4 8.5 1.8 5.3L648 176.3l0.2-0.9c7.8-28.1 29.7-48.6 57.5-54.9l9.5-1.6 8.9-0.5z","p-id":"14043"},null,-1)];function e6(r,t){return S.openBlock(),S.createElementBlock("svg",$V,[...t6])}const n6={name:"vc-polygon",render:e6},r6={fill:"currentColor",t:"1688700548539",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5996",width:"16",height:"16"},i6=[S.createElementVNode("path",{d:"M419.2 102.4c51.2 0 92.8 41.6 92.8 96 0 25.6-9.6 51.2-28.8 70.4l166.4 416c19.2-12.8 44.8-16 67.2-9.6l172.8-272c-19.2-32-12.8-76.8 19.2-99.2 32-22.4 73.6-12.8 96 22.4 19.2 32 12.8 76.8-19.2 99.2-9.6 6.4-25.6 12.8-38.4 12.8l-176 275.2c28.8 41.6 19.2 102.4-19.2 131.2-41.6 32-99.2 22.4-128-22.4-16-22.4-19.2-48-16-73.6L422.4 291.2h-3.2c-12.8 0-22.4-3.2-32-6.4l-208 243.2c25.6 44.8 6.4 102.4-38.4 128s-99.2 6.4-124.8-38.4-6.4-102.4 38.4-128c22.4-12.8 51.2-16 76.8-6.4l208-243.2c-25.6-44.8-6.4-102.4 38.4-128 12.8-6.4 28.8-9.6 41.6-9.6z","p-id":"5997"},null,-1)];function s6(r,t){return S.openBlock(),S.createElementBlock("svg",r6,[...i6])}const o6={name:"vc-polyline",render:s6},a6={fill:"currentColor",t:"1688700146309",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2263",width:"16",height:"16"},l6=[S.createElementVNode("path",{d:"M512 320a192.064 192.064 0 0 1 0 384 192 192 0 0 1 0-384z",fill:"","p-id":"2264"},null,-1)];function u6(r,t){return S.openBlock(),S.createElementBlock("svg",a6,[...l6])}const c6={name:"vc-point",render:u6},yj="",h6=Ca({__name:"MapDraw",emits:["draw-change","close"],setup(r,{emit:t}){const e=t,n=o=>{e("draw-change",o)},i=()=>{e("close")};return(o,a)=>{const l=c6,u=S.resolveComponent("el-icon"),c=S.resolveComponent("el-button"),h=o6,f=n6,d=QV,g=PR;return S.openBlock(),S.createElementBlock("div",null,[S.createVNode(c,{type:"primary",circle:"",onClick:a[0]||(a[0]=p=>n("Point"))},{default:S.withCtx(()=>[S.createVNode(u,{class:"custom-class",size:"22"},{default:S.withCtx(()=>[S.createVNode(l)]),_:1})]),_:1}),S.createVNode(c,{type:"primary",circle:"",onClick:a[1]||(a[1]=p=>n("LineString"))},{default:S.withCtx(()=>[S.createVNode(u,{class:"custom-class",size:"22"},{default:S.withCtx(()=>[S.createVNode(h)]),_:1})]),_:1}),S.createVNode(c,{type:"primary",circle:"",onClick:a[2]||(a[2]=p=>n("Polygon"))},{default:S.withCtx(()=>[S.createVNode(u,{class:"custom-class",size:"22"},{default:S.withCtx(()=>[S.createVNode(f)]),_:1})]),_:1}),S.createVNode(c,{type:"primary",circle:"",onClick:a[3]||(a[3]=p=>n("Clear"))},{default:S.withCtx(()=>[S.createVNode(u,{class:"custom-class",size:"22",color:"white"},{default:S.withCtx(()=>[S.createVNode(d)]),_:1})]),_:1}),S.createVNode(c,{type:"danger",circle:"",onClick:i},{default:S.withCtx(()=>[S.createVNode(u,{class:"custom-class",size:"22"},{default:S.withCtx(()=>[S.createVNode(g)]),_:1})]),_:1})])}}},[["__scopeId","data-v-e4c1688d"]]),bR=Object.assign({name:"OlDrawer"},{props:{snapEnable:{type:Boolean,default:!1},modifyEnable:{type:Boolean,default:!1},onceOnly:{type:Boolean,default:!1},selectEnable:{type:Boolean,default:!1}},emits:["draw-end","close"],setup(r,{emit:t}){const e=r,n=t,{snapEnable:i,selectEnable:o,modifyEnable:a,onceOnly:l}=S.toRefs(e);let u=cR();u=S.inject("olHandler");const c=f=>{var d,g;f==="End"?(d=u.getDrawHandler())==null||d.endDraw():f==="Clear"?(g=u.getDrawHandler())==null||g.clear():u.getDrawHandler().drawByType({type:f,snapEnable:i.value,modifyEnable:a.value,onceOnly:l.value,selectEnable:o.value,drawEndHandle:p=>{n("draw-end",p)}})},h=()=>{var f,d;(f=u.getDrawHandler())==null||f.clear(),(d=u.getDrawHandler())==null||d.endDraw(),n("close")};return(f,d)=>(S.openBlock(),S.createBlock(h6,{onDrawChange:c,onClose:h}))}}),Ej="",f6=["id"],d6={key:0,class:"vmap-title"},g6={class:"popup-title"},p6=["id"],m6=Object.assign({name:"OlOverlay"},{props:{theme:{type:String,default:ei.dark},showTitle:{type:Boolean,default:!1},title:{type:String,default:"标题"},position:{type:[Array,String],default(){}},content:{type:Object,default(){return{}}},contentHtml:{type:String,default:""}},emits:["on-close"],setup(r,{emit:t}){const e=S.inject("olHandler"),n=r,i=t,o=S.ref("overlay-id-"+oi()),a=S.ref(o.value+"_content");let l=null;const{position:u,theme:c}=S.toRefs(n);S.watch(u,()=>{d.value&&(l?l.setPosition(u.value):f())});const h=S.computed(()=>["vmap-ol-popup",c.value]);S.onMounted(()=>{S.nextTick(p=>{f()})});const f=()=>{d.value&&(l&&e.map.removeOverlay(l),l=e.createOverlay({popupId:o.value,center:u.value,offset:[0,0],collection:!1,options:{className:"vmap-overlay-top"}}))},d=S.computed(()=>u.value instanceof Array&&u.value.length===2||u.value===void 0?!0:(console.warn("不合法的postion"),!1)),g=()=>{l&&l.setPosition(void 0),i("on-close")};return S.onUnmounted(()=>{l&&e.map.removeOverlay(l)}),(p,m)=>S.withDirectives((S.openBlock(),S.createElementBlock("div",{id:o.value,class:S.normalizeClass(h.value)},[r.showTitle?(S.openBlock(),S.createElementBlock("div",d6,[S.createElementVNode("span",g6,S.toDisplayString(r.title),1),S.createElementVNode("span",{class:"popup-title-close",onClick:g})])):S.createCommentVNode("",!0),S.createElementVNode("div",{id:a.value,class:"vmap-popup-content"},[S.renderSlot(p.$slots,"default",{},void 0,!0)],8,p6)],10,f6)),[[S.vShow,!1]])}}),AR=Ca(m6,[["__scopeId","data-v-90ca11b9"]]),LR={name:{type:String,default:"layer"},layerId:{type:String,default:""},layerName:{type:String,default:""},layerStyle:{type:[Object,Function],default(){return{}}},visible:{type:Boolean,default:!0},opacity:{type:[Number,String],default:1},extent:{type:Array,default:[]},zIndex:{type:[Number,String,void 0],default:void 0},minZoom:{type:[Number,void 0],default:void 0},maxZoom:{type:[Number,void 0],default:void 0},extent:{type:[Array,void 0],default:void 0}},MR=["ready","error"],NR=({visible:r,zIndex:t,opacity:e,minZoom:n,maxZoom:i,layerStyle:o},a)=>{S.watch(r,l=>{a.value.setVisible(l)}),S.watch(t,l=>{a.value.setZindex(Number(l))}),S.watch(e,l=>{a.value.setOpacity(Number(l))}),S.watch(n,l=>{a.value.setMinZoom(Number(l))}),S.watch(i,l=>{a.value.seMaxZoom(Number(l))}),S.watch(o,l=>{a.value.setStyle(l)})},OR=Object.assign({name:"OlVector"},{props:{...LR,source:{type:Object,default(){return{features:[]}}},features:{type:[Array,Object],default(){return[]}},multiple:{type:Boolean,default:!0},geometrys:{type:Array,default(){return[]}},layerStyle:{type:Object,default(){return{}}},selectable:{type:Boolean,default:!1},modifiable:{type:Boolean,default:!1},clusterOptions:{type:[Object,null],default(){return null}},geomField:{type:String,default:"wktstr"}},emits:[...MR,"select-change","modify-end"],setup(r,{emit:t}){let e=null;e=S.inject("olHandler");const n=r,i=t,{layerId:o,features:a,layerStyle:l,visible:u,zIndex:c,selectable:h,modifiable:f,clusterOptions:d,geomField:g}=S.toRefs(n);S.onMounted(()=>{S.nextTick(()=>{m()})});let p=S.ref(null);NR(S.toRefs(n),p),S.watch(a,()=>{m()},{deep:!0}),S.watch(h,()=>{v()}),S.watch(f,()=>{x()});const m=()=>{E()&&(d.value?(e.removeLayerById(y.value),p.value=e.getLayerHandler().getClusterLayer(a.value,{id:y.value,visible:u.value,style:l.value,zIndex:c.value,geomField:g.value,...d.value}),e.map.addLayer(p.value)):p.value=e.getLayerHandler().createCustomLayer({...n,clear:!0,layerId:y.value,style:l.value}),v(),x(),i("ready",p.value))},y=S.computed(()=>o.value||od()),E=()=>o.value&&e.getLayerById(o.value)?(console.warn("重复的图层id"),!1):!0;let _=null;const v=()=>{_===null&&(_=new Qg(e.map,{layers:[e.getLayerById(y.value)]})),_.enableSelect(h.value,w=>{i("select-change",w)})},x=()=>{_===null&&(_=new Qg(e.map,{layers:[e.getLayerById(y.value)]})),_.enableModify(f.value,w=>{i("modify-end",w)})};return S.onUnmounted(()=>{_&&(_.release(),_=null)}),(w,I)=>null}}),rc={__name:"index",props:{...LR,url:{type:String,default:""},mapProvider:{type:String,default:"",validator(r){return nu(r)&&["tdt","supermap","wmts","xyz","wmsimagetile","wmsimage","arcgistile","arcgisimagetile","mapbox","geoserver"].includes(r.toLowerCase())}},mapStyle:{type:[String,Array],default:""},token:{type:String,default:""},requestParams:{type:Object,default(){return{}}}},emits:MR,setup(r,{emit:t}){let e=new e0;e=S.inject("olHandler");const n=r,i=t,{layerId:o,url:a,mapProvider:l,mapStyle:u,token:c,requestParams:h}=S.toRefs(n);let f=S.ref(null);NR(S.toRefs(n),f),S.watch(u,R=>{C()});const d=S.computed(()=>o.value||od()),g=S.computed(()=>l.value.toLowerCase()),p=S.computed(()=>g.value===Ot.tdt),m=S.computed(()=>g.value===Ot.supermap),y=S.computed(()=>g.value===Ot.wmts);S.computed(()=>g.value===Ot.xyz);const E=S.computed(()=>g.value===Ot.arcgistile);S.computed(()=>g.value===Ot.arcgisimagetile),S.computed(()=>g.value===Ot.arcgisimage);const _=S.computed(()=>[Ot.wmsimagetile,Ot.wmsimage].includes(g.value));S.computed(()=>g.value===Ot.wmsimage);const v=S.computed(()=>g.value===Ot.geoservermvt);S.computed(()=>g.value===Ot.mapboxmvt);const x=S.computed(()=>{if(a.value)return m.value?w():_.value?I():E.value?a.value+"/tile/{z}/{y}/{x}":a.value;if(p.value)return d0({mapStyle:l.value+"_"+u.value,prj:e.map.getView().getProjection().getCode().split(":")[1],token:c.value})}),w=()=>{const R={request:"gettile",version:"1.0.0",service:"wmts",format:"image/png",style:"default",...h.value};if(Object.keys(h.value).length===0)return a.value;{let M=[];for(const P in R)if(Object.hasOwnProperty.call(R,P)){const b=R[P];M.push(`${P}=${b}`)}return a.value.split("?")[0]+"?"+M.join("&")}},I=()=>{const R={TILED:!0,...h.value};if(Object.keys(h.value).length===0)return a.value;{let M=[];for(const P in R)if(Object.hasOwnProperty.call(R,P)){const b=R[P];M.push(`${P}=${b}`)}return a.value.split("?")[0]+"?"+M.join("&")}},C=()=>{const R=Ot[g.value];if(!R){console.error("未知的地图提供者");return}const M=d.value;x.value&&T()&&(e.removeLayerById(M),y.value?f.value=e.getLayerByType({...n,id:M,type:R,url:x.value,params:{...h.value}}):v.value?f.value=e.getLayerByType({...n,id:M,type:R,url:x.value,params:{...h.value,style:n.layerStyle}}):f.value=e.getLayerByType({...n,id:M,type:R,url:x.value}),f.value&&(e.map.addLayer(f.value),i("ready",f.value)))},T=()=>!0;return S.onMounted(R=>{S.nextTick(M=>{C()})}),S.onUnmounted(()=>{e&&e.removeLayerById(d.value)}),(R,M)=>null}},FR=Object.assign({name:"OlTile"},{props:{mapProvider:{type:String,default:"",require:!0,validator(r){return nu(r)&&["tdt","wmts","xyz","supermap","arcgistile"].includes(r.toLowerCase())}}},setup(r){return(t,e)=>(S.openBlock(),S.createBlock(rc,{"map-provider":r.mapProvider},null,8,["map-provider"]))}}),DR=Object.assign({name:"OlTdt"},{props:{mapStyle:{type:[String,Array],default:"img",validator(r){return nu(r)&&["img","vec","ter"].includes(r.toLowerCase())}}},setup(r){return(t,e)=>(S.openBlock(),S.createBlock(rc,{"map-provider":"tdt","map-style":r.mapStyle},null,8,["map-style"]))}}),BR=Object.assign({name:"OlSupermap"},{setup(r){return(t,e)=>(S.openBlock(),S.createBlock(rc,{"map-provider":"supermap"}))}}),GR=Object.assign({name:"OlArcgis"},{props:{mapProvider:{type:String,default:"imagetile",validator(r){return nu(r)&&["imagetile","image","tile"].includes(r.toLowerCase())}}},setup(r){const t=r,{mapProvider:e}=S.toRefs(t),n=S.computed(()=>"arcgis"+e.value.toLowerCase());return(i,o)=>(S.openBlock(),S.createBlock(rc,{"map-provider":n.value},null,8,["map-provider"]))}}),kR=Object.assign({name:"OlWms"},{props:{mapProvider:{type:String,default:"imagetile",validator(r){return nu(r)&&["imagetile","image"].includes(r)}}},setup(r){const t=r,{mapProvider:e}=S.toRefs(t),n=S.computed(()=>"wms"+e.value.toLowerCase());return(i,o)=>(S.openBlock(),S.createBlock(rc,{"map-provider":n.value},null,8,["map-provider"]))}}),zR=Object.assign({name:"OlVectortile"},{props:{mapProvider:{type:String,default:"geoserverMvt"}},setup(r){const t=r;S.toRefs(t);const e=S.computed(()=>"geoservermvt");return(n,i)=>(S.openBlock(),S.createBlock(rc,{"map-provider":e.value},null,8,["map-provider"]))}}),bj="",y6={name:"VDraggable",components:{},props:{title:{type:String,default:""},initTop:{},initBottom:{},initLeft:{},initRight:{},initWidth:{},initHeight:{},marginNum:{type:Number,default:2},parentClassName:{type:String,default:"vmap-container"}},data(){return{testHeight:"",titleName:null,initPosition:{top:100,left:100,width:100,height:100},themeIsBlue:!0,showContent:!0,handleImgSrc:"",leftStyle:{},slotStyle:{},rightStyle:{},offsetTop:70}},watch:{initWidth(){}},created:function(){(this.initTop||this.initTop!=null)&&(this.initPosition.top=this.initTop),(this.initLeft||this.initLeft!=null)&&(this.initPosition.left=this.initLeft),(this.initWidth||this.initWidth!=null)&&(this.initPosition.width=this.initWidth),(this.initHeight||this.initHeight!=null)&&(this.initPosition.height=this.initHeight),this.initBottom||this.initBottom!=null,this.initRight||this.initRight!=null,this.marginNum===void 0&&(this.marginNum=0)},mounted:function(){this.titleName=this.title,this.init(),this.$nextTick(r=>{this.updatePosition()})},computed:{},methods:{updatePosition(){document.getElementsByClassName(this.parentClassName);const r=document.getElementsByClassName(this.parentClassName)[0].clientWidth,t=document.getElementsByClassName(this.parentClassName)[0].clientHeight;let e=r,n=t;this.initTop||this.initTop!=null?this.initPosition.top=this.initTop:this.initPosition.top=(n-this.initHeight)/2,this.initLeft||this.initLeft!=null?this.initPosition.left=this.initLeft:this.initPosition.left=(e-this.initWidth)/2,(this.initWidth||this.initWidth!=null)&&(this.initPosition.width=this.initWidth),(this.initHeight||this.initHeight!=null)&&(this.initPosition.height=this.initHeight),(this.initBottom||this.initBottom!=null)&&(this.initPosition.top=n-this.initHeight-this.initBottom),(this.initRight||this.initRight!=null)&&(this.initPosition.left=e-this.initWidth-this.initRight)},closeResult:function(){this.$emit("closeDraggable")},init:function(){this.testHeight=this.$refs.draggableRef.offsetHeight},btnMinPanel(){this.showContent=!this.showContent,this.initPosition.height=this.showContent?this.initHeight:20,this.initPosition.width=this.showContent?this.initWidth:120},mousedownfun:function(r){let t=this;var e=this.$refs.draggableRef,n=r.pageX-e.offsetLeft,i=r.pageY-e.offsetTop;document.onmousemove=function(o){t.initPosition.left=o.pageX-n,o.pageY-i>0&&(t.initPosition.top=o.pageY-i)},document.onmouseup=function(){document.onmousemove=document.onmouseup=null}},mousedown_bottom:function(r){var t=this;t.$refs.draggableRef,document.getElementsByClassName(this.parentClassName).length>0&&document.getElementsByClassName(this.parentClassName)[0].offsetTop+this.offsetTop;var e=r.pageY,n=t.initPosition.height;document.onmousemove=function(i){t.initPosition.height=parseFloat(n)+(i.pageY-e)},document.onmouseup=function(){document.onmousemove=document.onmouseup=null}},mousedown_left:function(r){let t=this;var e=this.$refs.draggableRef;e.parentElement.offsetLeft;var n=r.pageX,i=e.offsetWidth,o=parseFloat(e.style.left.replace("px","")),a=r.pageX;document.onmousemove=function(l){e.offsetLeft-(n-l.pageX);var u=n-l.pageX+i;t.initPosition.left=`${o-(a-l.pageX)}`,t.initPosition.width=`${u}`},document.onmouseup=function(){document.onmousemove=document.onmouseup=null}},mousedown_right:function(r){var t=this,e=this.$refs.draggableRef,n=r.pageX,i=e.offsetWidth;document.onmousemove=function(o){var a=o.pageX-n+i;t.initPosition.width=a+"",t.$emit("sizeChange",a)},document.onmouseup=function(){document.onmousemove=document.onmouseup=null}}}},_6={style:{"font-size":"16px","white-space":"nowrap"}},v6={class:"slotClass",style:{"padding-bottom":"0px"}};function E6(r,t,e,n,i,o){const a=PR;return S.openBlock(),S.createElementBlock("div",{id:"draggableContainer",class:"draggable-container-class",ref:"draggableRef",style:S.normalizeStyle({top:i.initPosition.top+"px",left:i.initPosition.left+"px",width:i.initPosition.width+"px",height:i.initPosition.height+"px","border-radius":"7px"})},[S.createElementVNode("div",{class:S.normalizeClass({draggableTitleClass:!0}),onMousedown:t[0]||(t[0]=(...l)=>o.mousedownfun&&o.mousedownfun(...l))},[S.createElementVNode("div",_6,S.toDisplayString(e.title),1),S.createVNode(a,{class:"draggableClose",onClick:o.closeResult},null,8,["onClick"])],32),S.withDirectives(S.createElementVNode("div",{class:"draggable_content",style:S.normalizeStyle([{},{height:"calc(100% - 26px)"}])},[S.createElementVNode("div",{onMousedown:t[1]||(t[1]=(...l)=>o.mousedown_left&&o.mousedown_left(...l)),class:"leftClass",style:S.normalizeStyle({"border-left":e.marginNum+"px solid rgb(255, 255, 255)"})},null,36),S.createElementVNode("div",v6,[S.renderSlot(r.$slots,"default",{},void 0,!0)]),S.createElementVNode("div",{onMousedown:t[2]||(t[2]=(...l)=>o.mousedown_right&&o.mousedown_right(...l)),class:"rightClass",style:S.normalizeStyle({"border-right":e.marginNum+"px solid rgb(255, 255, 255)"})},null,36)],512),[[S.vShow,i.showContent]]),S.createElementVNode("div",{onMousedown:t[3]||(t[3]=(...l)=>o.mousedown_bottom&&o.mousedown_bottom(...l)),class:"bottomClass",style:S.normalizeStyle({"border-bottom":e.marginNum+1+"px solid rgb(255, 255, 255)"})},null,36)],4)}const UR=Ca(y6,[["render",E6],["__scopeId","data-v-76f7695d"]]),x6=[IR,TR,RR,bR,AR,OR,FR,DR,BR,GR,kR,zR,UR],VR=r=>{x6.forEach(t=>{r.component(t.name,t)})};typeof window<"u"&&window.Vue&&VR(window.Vue);const w6={install:VR};$t.OlArcgis=GR,$t.OlBasemap=TR,$t.OlDrawer=bR,$t.OlHandler=e0,$t.OlMap=IR,$t.OlOverlay=AR,$t.OlSupermap=BR,$t.OlTdt=DR,$t.OlTile=FR,$t.OlToolbar=RR,$t.OlVector=OR,$t.OlVectortile=zR,$t.OlWms=kR,$t.VMapUtils=Zg,$t.VUtils=Wn,$t.V_MAP_TYPE=Ot,$t.VueDraggable=UR,$t.default=w6,Object.defineProperties($t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});