xgis-ol
Version:
基于openlayers + ol-ext库进行封装
1 lines • 1.34 MB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var u=require("vue"),h1=require("ol"),un=require("@iconify/vue");class Di{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}var ha="propertychange";class Ws{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function En(e,t){return e>t?1:e<t?-1:0}function tC(e,t){return e<t?1:e>t?-1:0}function Fu(e,t,i){if(e[0]<=t)return 0;const n=e.length;if(t<=e[n-1])return n-1;if(typeof i=="function"){for(let o=1;o<n;++o){const r=e[o];if(r===t)return o;if(r<t)return i(t,e[o-1],r)>0?o-1:o}return n-1}if(i>0){for(let o=1;o<n;++o)if(e[o]<t)return o-1;return n-1}if(i<0){for(let o=1;o<n;++o)if(e[o]<=t)return o;return n-1}for(let o=1;o<n;++o){if(e[o]==t)return o;if(e[o]<t)return e[o-1]-t<t-e[o]?o-1:o}return n-1}function iC(e,t,i){for(;t<i;){const n=e[t];e[t]=e[i],e[i]=n,++t,--i}}function Ln(e,t){const i=Array.isArray(t)?t:[t],n=i.length;for(let o=0;o<n;o++)e[e.length]=i[o]}function Mo(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function da(){return!0}function pa(){return!1}function ma(){}function d1(e){let t,i,n;return function(){const o=Array.prototype.slice.call(arguments);return i&&this===n&&Mo(o,i)||(n=this,i=o,t=e.apply(this,arguments)),t}}function hr(e){return function(){let t;try{t=e()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}()}function Xs(e){for(const t in e)delete e[t]}function ko(e){let t;for(t in e)return!1;return!t}class Ks extends Ws{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,i){if(!t||!i)return;const n=this.listeners_||(this.listeners_={}),o=n[t]||(n[t]=[]);o.includes(i)||o.push(i)}dispatchEvent(t){const i=typeof t=="string",n=i?t:t.type,o=this.listeners_&&this.listeners_[n];if(!o)return;const r=i?new Di(t):t;r.target||(r.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});let l;n in a||(a[n]=0,s[n]=0),++a[n];for(let c=0,h=o.length;c<h;++c)if(l="handleEvent"in o[c]?o[c].handleEvent(r):o[c].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--a[n]==0){let c=s[n];for(delete s[n];c--;)this.removeEventListener(n,ma);delete a[n]}return l}disposeInternal(){this.listeners_&&Xs(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)}removeEventListener(t,i){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const o=n.indexOf(i);o!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[o]=ma,++this.pendingRemovals_[t]):(n.splice(o,1),n.length===0&&delete this.listeners_[t]))}}var xt="change",p1="error",Wd="contextmenu",Ys="click",nC="dblclick",Ou="keydown",m1="keypress",oC="load",f1="touchmove",Zs="wheel";function at(e,t,i,n,o){if(o){const a=i;i=function(){e.removeEventListener(t,i),a.apply(n??this,arguments)}}else n&&n!==e&&(i=i.bind(n));const r={target:e,type:t,listener:i};return e.addEventListener(t,i),r}function Du(e,t,i,n){return at(e,t,i,n,!0)}function Tt(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Xs(e))}class Qs extends Ks{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(xt)}getRevision(){return this.revision_}onInternal(t,i){if(Array.isArray(t)){const n=t.length,o=new Array(n);for(let r=0;r<n;++r)o[r]=at(this,t[r],i);return o}return at(this,t,i)}onceInternal(t,i){let n;if(Array.isArray(t)){const o=t.length;n=new Array(o);for(let r=0;r<o;++r)n[r]=Du(this,t[r],i)}else n=Du(this,t,i);return i.ol_key=n,n}unInternal(t,i){const n=i.ol_key;if(n)Xi(n);else if(Array.isArray(t))for(let o=0,r=t.length;o<r;++o)this.removeEventListener(t[o],i);else this.removeEventListener(t,i)}}function Xi(e){if(Array.isArray(e))for(let t=0,i=e.length;t<i;++t)Tt(e[t]);else Tt(e)}function $e(){throw new Error("Unimplemented abstract method.")}Qs.prototype.on,Qs.prototype.once,Qs.prototype.un;let rC=0;function We(e){return e.ol_uid||(e.ol_uid=String(++rC))}class g1 extends Di{constructor(t,i,n){super(t),this.key=i,this.oldValue=n}}class Ki extends Qs{constructor(t){super(),this.on,this.once,this.un,We(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let i;return this.values_&&this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i}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,i){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new g1(n,t,i)),n=ha,this.hasListener(n)&&this.dispatchEvent(new g1(n,t,i))}addChangeListener(t,i){this.addEventListener(`change:${t}`,i)}removeChangeListener(t,i){this.removeEventListener(`change:${t}`,i)}set(t,i,n){const o=this.values_||(this.values_={});if(n)o[t]=i;else{const r=o[t];o[t]=i,r!==i&&this.notify(t,r)}}setProperties(t,i){for(const n in t)this.set(n,t[n],i)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,i){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],ko(this.values_)&&(this.values_=null),i||this.notify(t,n)}}}var dr="add",pr="remove";const v1="length";class Nu extends Di{constructor(t,i,n){super(t),this.element=i,this.index=n}}class Yi extends Ki{constructor(t,i){if(super(),this.on,this.once,this.un,i=i||{},this.unique_=!!i.unique,this.array_=t||[],this.unique_)for(let n=0,o=this.array_.length;n<o;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let i=0,n=t.length;i<n;++i)this.push(t[i]);return this}forEach(t){const i=this.array_;for(let n=0,o=i.length;n<o;++n)t(i[n],n,i)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(v1)}insertAt(t,i){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new Nu(dr,i,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const i=this.getLength();return this.insertAt(i,t),this.getLength()}remove(t){const i=this.array_;for(let n=0,o=i.length;n<o;++n)if(i[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Nu(pr,i,t)),i}setAt(t,i){if(t>=this.getLength())return void this.insertAt(t,i);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i,t);const n=this.array_[t];this.array_[t]=i,this.dispatchEvent(new Nu(pr,n,t)),this.dispatchEvent(new Nu(dr,i,t))}updateLength_(){this.set(v1,this.array_.length)}assertUnique_(t,i){for(let n=0,o=this.array_.length;n<o;++n)if(this.array_[n]===t&&n!==i)throw new Error("Duplicate item added to a unique collection")}}var Bu="opacity",Xd="visible",y1="extent",Kd="zIndex",Yd="maxResolution",Zd="minResolution",Qd="maxZoom",Jd="minZoom",ep="source",_1="map";function ft(e,t){if(!e)throw new Error(t)}function zt(e,t,i){return Math.min(Math.max(e,t),i)}function aC(e,t,i,n,o,r){const a=o-i,s=r-n;if(a!==0||s!==0){const l=((e-i)*a+(t-n)*s)/(a*a+s*s);l>1?(i=o,n=r):l>0&&(i+=a*l,n+=s*l)}return to(e,t,i,n)}function to(e,t,i,n){const o=i-e,r=n-t;return o*o+r*r}function b1(e){return 180*e/Math.PI}function cn(e){return e*Math.PI/180}function To(e,t){const i=e%t;return i*t<0?i+t:i}function Ni(e,t,i){return e+i*(t-e)}function Js(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}function x1(e,t){return Math.round(Js(e,t))}function Vu(e,t){return Math.floor(Js(e,t))}function Eo(e,t){return Math.ceil(Js(e,t))}function tp(e,t,i){if(e>=t&&e<i)return e;const n=i-t;return((e-t)%n+n)%n+t}class w1 extends Ki{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const i=Object.assign({},t);typeof t.properties=="object"&&(delete i.properties,Object.assign(i,t.properties)),i[Bu]=t.opacity!==void 0?t.opacity:1,ft(typeof i[Bu]=="number","Layer opacity must be a number"),i[Xd]=t.visible===void 0||t.visible,i[Kd]=t.zIndex,i[Yd]=t.maxResolution!==void 0?t.maxResolution:1/0,i[Zd]=t.minResolution!==void 0?t.minResolution:0,i[Jd]=t.minZoom!==void 0?t.minZoom:-1/0,i[Qd]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,this.setProperties(i),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const i=this.state_||{layer:this,managed:t===void 0||t},n=this.getZIndex();return i.opacity=zt(Math.round(100*this.getOpacity())/100,0,1),i.visible=this.getVisible(),i.extent=this.getExtent(),i.zIndex=n!==void 0||i.managed?n:1/0,i.maxResolution=this.getMaxResolution(),i.minResolution=Math.max(this.getMinResolution(),0),i.minZoom=this.getMinZoom(),i.maxZoom=this.getMaxZoom(),this.state_=i,i}getLayersArray(t){return $e()}getLayerStatesArray(t){return $e()}getExtent(){return this.get(y1)}getMaxResolution(){return this.get(Yd)}getMinResolution(){return this.get(Zd)}getMinZoom(){return this.get(Jd)}getMaxZoom(){return this.get(Qd)}getOpacity(){return this.get(Bu)}getSourceState(){return $e()}getVisible(){return this.get(Xd)}getZIndex(){return this.get(Kd)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(y1,t)}setMaxResolution(t){this.set(Yd,t)}setMinResolution(t){this.set(Zd,t)}setMaxZoom(t){this.set(Qd,t)}setMinZoom(t){this.set(Jd,t)}setOpacity(t){ft(typeof t=="number","Layer opacity must be a number"),this.set(Bu,t)}setVisible(t){this.set(Xd,t)}setZIndex(t){this.set(Kd,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}var ip="prerender",np="postrender",S1="precompose",sC="postcompose",op="rendercomplete",Bi=0,hn=1,dn={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const rp=256,io={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class In{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,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_||io[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 el=6378137,fa=Math.PI*el,lC=[-fa,-fa,fa,fa],uC=[-180,-85,180,85],ju=el*Math.log(Math.tan(Math.PI/2));class ga extends In{constructor(t){super({code:t,units:"m",extent:lC,global:!0,worldExtent:uC,getPointResolution:function(i,n){return i/Math.cosh(n[1]/el)}})}}const C1=[new ga("EPSG:3857"),new ga("EPSG:102100"),new ga("EPSG:102113"),new ga("EPSG:900913"),new ga("http://www.opengis.net/def/crs/EPSG/0/3857"),new ga("http://www.opengis.net/gml/srs/epsg.xml#3857")];function cC(e,t,i,n){const o=e.length;i=i>1?i:2,n=n??i,t===void 0&&(t=i>2?e.slice():new Array(o));for(let r=0;r<o;r+=n){t[r]=fa*e[r]/180;let a=el*Math.log(Math.tan(Math.PI*(+e[r+1]+90)/360));a>ju?a=ju:a<-ju&&(a=-ju),t[r+1]=a}return t}function hC(e,t,i,n){const o=e.length;i=i>1?i:2,n=n??i,t===void 0&&(t=i>2?e.slice():new Array(o));for(let r=0;r<o;r+=n)t[r]=180*e[r]/fa,t[r+1]=360*Math.atan(Math.exp(e[r+1]/el))/Math.PI-90;return t}const M1=[-180,-90,180,90],dC=6378137*Math.PI/180;class mr extends In{constructor(t,i){super({code:t,units:"degrees",extent:M1,axisOrientation:i,global:!0,metersPerUnit:dC,worldExtent:M1})}}const k1=[new mr("CRS:84"),new mr("EPSG:4326","neu"),new mr("urn:ogc:def:crs:OGC:1.3:CRS84"),new mr("urn:ogc:def:crs:OGC:2:84"),new mr("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new mr("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new mr("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ap={};function $u(e){return ap[e]||ap[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}let va={};function fr(e,t,i){const n=e.getCode(),o=t.getCode();n in va||(va[n]={}),va[n][o]=i}function Gu(e,t){return e in va&&t in va[e]?va[e][t]:null}var T1=0,Hu=1,sp=2,lp=4,up=8,cp=16;function ya(e){const t=pC();for(let i=0,n=e.length;i<n;++i)tl(t,e[i]);return t}function Lo(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function E1(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function gr(e,t,i){let n,o;return n=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,o=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0,n*n+o*o}function vr(e,t){return hp(e,t[0],t[1])}function pn(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function hp(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function dp(e,t){const i=e[0],n=e[1],o=e[2],r=e[3],a=t[0],s=t[1];let l=T1;return a<i?l|=cp:a>o&&(l|=lp),s<n?l|=up:s>r&&(l|=sp),l===T1&&(l=Hu),l}function pC(){return[1/0,1/0,-1/0,-1/0]}function Pn(e,t,i,n,o){return o?(o[0]=e,o[1]=t,o[2]=i,o[3]=n,o):[e,t,i,n]}function _a(e){return Pn(1/0,1/0,-1/0,-1/0,e)}function L1(e,t){const i=e[0],n=e[1];return Pn(i,n,i,n,t)}function pp(e,t,i,n,o){return I1(_a(o),e,t,i,n)}function no(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function mp(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function tl(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function I1(e,t,i,n,o){for(;i<n;i+=o)mC(e,t[i],t[i+1]);return e}function mC(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function fp(e,t){let i;return i=t(Uu(e)),i||(i=t(Wu(e)),i||(i=t(Ku(e)),i||(i=t(Zi(e)),i||!1)))}function il(e){let t=0;return yr(e)||(t=Ye(e)*Ft(e)),t}function Uu(e){return[e[0],e[1]]}function Wu(e){return[e[2],e[1]]}function ki(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function fC(e,t){let i;if(t==="bottom-left")i=Uu(e);else if(t==="bottom-right")i=Wu(e);else if(t==="top-left")i=Zi(e);else{if(t!=="top-right")throw new Error("Invalid corner");i=Ku(e)}return i}function Xu(e,t,i,n,o){const[r,a,s,l,c,h,d,p]=function(m,f,g,b){const y=f*b[0]/2,x=f*b[1]/2,v=Math.cos(g),_=Math.sin(g),w=y*v,S=y*_,C=x*v,L=x*_,A=m[0],T=m[1];return[A-w+L,T-S-C,A-w-L,T-S+C,A+w-L,T+S+C,A+w+L,T+S-C,A-w+L,T-S-C]}(e,t,i,n);return Pn(Math.min(r,s,c,d),Math.min(a,l,h,p),Math.max(r,s,c,d),Math.max(a,l,h,p),o)}function Ft(e){return e[3]-e[1]}function _i(e,t,i){const n=i||[1/0,1/0,-1/0,-1/0];return Nt(e,t)?(e[0]>t[0]?n[0]=e[0]:n[0]=t[0],e[1]>t[1]?n[1]=e[1]:n[1]=t[1],e[2]<t[2]?n[2]=e[2]:n[2]=t[2],e[3]<t[3]?n[3]=e[3]:n[3]=t[3]):_a(n),n}function Zi(e){return[e[0],e[3]]}function Ku(e){return[e[2],e[3]]}function Ye(e){return e[2]-e[0]}function Nt(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function yr(e){return e[2]<e[0]||e[3]<e[1]}function Yu(e,t,i,n){if(yr(e))return _a(i);let o=[];if(n>1){const s=e[2]-e[0],l=e[3]-e[1];for(let c=0;c<n;++c)o.push(e[0]+s*c/n,e[1],e[2],e[1]+l*c/n,e[2]-s*c/n,e[3],e[0],e[3]-l*c/n)}else o=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(o,o,2);const r=[],a=[];for(let s=0,l=o.length;s<l;s+=2)r.push(o[s]),a.push(o[s+1]);return function(s,l,c){return Pn(Math.min.apply(null,s),Math.min.apply(null,l),Math.max.apply(null,s),Math.max.apply(null,l),c)}(r,a,i)}function P1(e,t){const i=t.getExtent(),n=ki(e);if(t.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const o=Ye(i),r=Math.floor((n[0]-i[0])/o)*o;e[0]-=r,e[2]-=r}return e}function gp(e,t,i){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];P1(e,t);const o=Ye(n);if(Ye(e)>o&&!i)return[[n[0],e[1],n[2],e[3]]];if(e[0]<n[0])return[[e[0]+o,e[1],n[2],e[3]],[n[0],e[1],e[2],e[3]]];if(e[2]>n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-o,e[3]]]}return[e]}function Zu(e,t){let i=!0;for(let n=e.length-1;n>=0;--n)if(e[n]!=t[n]){i=!1;break}return i}function vp(e,t){const i=Math.cos(t),n=Math.sin(t),o=e[0]*i-e[1]*n,r=e[1]*i+e[0]*n;return e[0]=o,e[1]=r,e}function R1(e,t){const i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function q1(e,t){return Math.sqrt(R1(e,t))}function A1(e,t){return function(i,n,o){return i?n.replace("{x}",i[0].toFixed(o)).replace("{y}",i[1].toFixed(o)):""}(e,"{x}, {y}",t)}function yp(e,t){if(t.canWrapX()){const i=Ye(t.getExtent()),n=z1(e,t,i);n&&(e[0]-=n*i)}return e}function z1(e,t,i){const n=t.getExtent();let o=0;return t.canWrapX()&&(e[0]<n[0]||e[0]>n[2])&&(i=i||Ye(n),o=Math.floor((e[0]-n[0])/i)),o}const _p=63710088e-1;function nl(e,t,i){i=i||_p;const n=cn(e[1]),o=cn(t[1]),r=(o-n)/2,a=cn(t[0]-e[0])/2,s=Math.sin(r)*Math.sin(r)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(o);return 2*i*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}function bp(e,t){let i=0;for(let n=0,o=e.length;n<o-1;++n)i+=nl(e[n],e[n+1],t);return i}function F1(e,t){const i=(t=t||{}).radius||_p,n=t.projection||"EPSG:3857",o=e.getType();o!=="GeometryCollection"&&(e=e.clone().transform(n,"EPSG:4326"));let r,a,s,l,c,h,d=0;switch(o){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":r=e.getCoordinates(),d=bp(r,i);break;case"MultiLineString":case"Polygon":for(r=e.getCoordinates(),s=0,l=r.length;s<l;++s)d+=bp(r[s],i);break;case"MultiPolygon":for(r=e.getCoordinates(),s=0,l=r.length;s<l;++s)for(a=r[s],c=0,h=a.length;c<h;++c)d+=bp(a[c],i);break;case"GeometryCollection":{const p=e.getGeometries();for(s=0,l=p.length;s<l;++s)d+=F1(p[s],t);break}default:throw new Error("Unsupported geometry type: "+o)}return d}function Qu(e,t){let i=0;const n=e.length;let o=e[n-1][0],r=e[n-1][1];for(let a=0;a<n;a++){const s=e[a][0],l=e[a][1];i+=cn(s-o)*(2+Math.sin(cn(r))+Math.sin(cn(l))),o=s,r=l}return i*t*t/2}function O1(e,t){const i=(t=t||{}).radius||_p,n=t.projection||"EPSG:3857",o=e.getType();o!=="GeometryCollection"&&(e=e.clone().transform(n,"EPSG:4326"));let r,a,s,l,c,h,d=0;switch(o){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(r=e.getCoordinates(),d=Math.abs(Qu(r[0],i)),s=1,l=r.length;s<l;++s)d-=Math.abs(Qu(r[s],i));break;case"MultiPolygon":for(r=e.getCoordinates(),s=0,l=r.length;s<l;++s)for(a=r[s],d+=Math.abs(Qu(a[0],i)),c=1,h=a.length;c<h;++c)d-=Math.abs(Qu(a[c],i));break;case"GeometryCollection":{const p=e.getGeometries();for(s=0,l=p.length;s<l;++s)d+=O1(p[s],t);break}default:throw new Error("Unsupported geometry type: "+o)}return d}const Ju=.9996,Rn=.00669438,D1=Rn*Rn,N1=D1*Rn,_r=Rn/(1-Rn),B1=Math.sqrt(1-Rn),ba=(1-B1)/(1+B1),V1=ba*ba,xp=V1*ba,wp=xp*ba,j1=wp*ba,$1=.9983242984503243,gC=15*D1/256+45*N1/1024,vC=35*N1/3072,yC=1.5*ba-27/32*xp+269/512*j1,_C=21/16*V1-55/32*wp,bC=151/96*xp-417/128*j1,xC=1097/512*wp,ec=6378137;function wC(e,t,i){const n=e-5e5,o=(i.north?t:t-1e7)/Ju/(ec*$1),r=o+yC*Math.sin(2*o)+_C*Math.sin(4*o)+bC*Math.sin(6*o)+xC*Math.sin(8*o),a=Math.sin(r),s=a*a,l=Math.cos(r),c=a/l,h=c*c,d=h*h,p=1-Rn*s,m=Math.sqrt(1-Rn*s),f=_r*l**2,g=f*f,b=n/(ec/m*Ju),y=b*b,x=y*b,v=x*b,_=v*b,w=r-c/((1-Rn)/p)*(y/2-v/24*(5+3*h+10*f-4*g-9*_r))+_*b/720*(61+90*h+298*f+45*d-252*_r-3*g);let S=(b-x/6*(1+2*h+f)+_/120*(5-2*f+28*h-3*g+8*_r+24*d))/l;return S=tp(S+cn(G1(i.number)),-Math.PI,Math.PI),[b1(S),b1(w)]}function SC(e,t,i){e=tp(e,-180,180),t<-80?t=-80:t>84&&(t=84);const n=cn(t),o=Math.sin(n),r=Math.cos(n),a=o/r,s=a*a,l=s*s,c=cn(e),h=cn(G1(i.number)),d=ec/Math.sqrt(1-Rn*o**2),p=_r*r**2,m=r*tp(c-h,-Math.PI,Math.PI),f=m*m,g=f*m,b=g*m,y=b*m,x=y*m,v=ec*($1*n-.002514607064228144*Math.sin(2*n)+gC*Math.sin(4*n)-vC*Math.sin(6*n)),_=Ju*d*(m+g/6*(1-s+p)+y/120*(5-18*s+l+72*p-58*_r))+5e5;let w=Ju*(v+d*a*(f/2+b/24*(5-s+9*p+4*p**2)+x/720*(61-58*s+l+600*p-330*_r)));return i.north||(w+=1e7),[_,w]}function G1(e){return 6*(e-1)-180+3}const CC=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function H1(e){let t=0;for(const o of CC){const r=e.match(o);if(r){t=parseInt(r[1]);break}}if(!t)return null;let i=0,n=!1;return t>32700&&t<32761?i=t-32700:t>32600&&t<32661&&(n=!0,i=t-32600),i?{number:i,north:n}:null}function U1(e,t){return function(i,n,o,r){const a=i.length;o=o>1?o:2,r=r??o,n||(n=o>2?i.slice():new Array(a));for(let s=0;s<a;s+=r){const l=i[s],c=i[s+1],h=e(l,c,t);n[s]=h[0],n[s+1]=h[1]}return n}}function W1(...e){console.warn(...e)}const MC=[function(e){const t=H1(e.getCode());return t?{forward:U1(SC,t),inverse:U1(wC,t)}:null}],kC=[function(e){return H1(e)?new In({code:e,units:"m"}):null}];let Sp=!0;function X1(e){Sp=!(e===void 0||e)}function Cp(e,t){if(t!==void 0)for(let i=0,n=e.length;i<n;++i)t[i]=e[i];else t=e.slice();return t}function ol(e){(function(t,i){ap[t]=i})(e.getCode(),e),fr(e,e,Cp)}function Ze(e){if(typeof e!="string")return e;const t=$u(e);if(t)return t;for(const i of kC){const n=i(e);if(n)return n}return null}function rl(e,t,i,n){let o;const r=(e=Ze(e)).getPointResolutionFunc();if(r){if(o=r(t,i),n&&n!==e.getUnits()){const a=e.getMetersPerUnit();a&&(o=o*a/io[n])}}else{const a=e.getUnits();if(a=="degrees"&&!n||n=="degrees")o=t;else{const s=xa(e,Ze("EPSG:4326"));if(s||a==="degrees"){let c=[i[0]-t/2,i[1],i[0]+t/2,i[1],i[0],i[1]-t/2,i[0],i[1]+t/2];c=s(c,c,2),o=(nl(c.slice(0,2),c.slice(2,4))+nl(c.slice(4,6),c.slice(6,8)))/2}else o=t*e.getMetersPerUnit();const l=n?io[n]:e.getMetersPerUnit();l!==void 0&&(o/=l)}}return o}function Mp(e){(function(t){t.forEach(ol)})(e),e.forEach(function(t){e.forEach(function(i){t!==i&&fr(t,i,Cp)})})}function kp(e,t){return e?typeof e=="string"?Ze(e):e:Ze(t)}function Tp(e){return function(t,i,n,o){const r=t.length;n=n!==void 0?n:2,o=o??n,i=i!==void 0?i:new Array(r);for(let a=0;a<r;a+=o){const s=e(t.slice(a,a+n)),l=s.length;for(let c=0,h=o;c<h;++c)i[a+c]=c>=l?t[a+c]:s[c]}return i}}function TC(e,t,i,n){const o=Ze(e),r=Ze(t);fr(o,r,Tp(i)),fr(r,o,Tp(n))}function Ep(e,t){return X1(),Io(e,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function qn(e,t){if(e===t)return!0;const i=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||xa(e,t)===Cp)&&i}function xa(e,t){const i=e.getCode(),n=t.getCode();let o=Gu(i,n);if(o)return o;let r=null,a=null;for(const l of MC)r||(r=l(e)),a||(a=l(t));if(!r&&!a)return null;const s="EPSG:4326";if(a)if(r)o=Lp(r.inverse,a.forward);else{const l=Gu(i,s);l&&(o=Lp(l,a.forward))}else{const l=Gu(s,n);l&&(o=Lp(r.inverse,l))}return o&&(ol(e),ol(t),fr(e,t,o)),o}function Lp(e,t){return function(i,n,o,r){return n=e(i,n,o,r),t(n,n,o,r)}}function br(e,t){return xa(Ze(e),Ze(t))}function Io(e,t,i){const n=br(t,i);if(!n){const o=Ze(t).getCode(),r=Ze(i).getCode();throw new Error(`No transform available between ${o} and ${r}`)}return n(e,void 0,e.length)}function Ip(e,t){return e}function mn(e,t){return Sp&&!Zu(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Sp=!1,W1("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function Pp(e,t){return e}function An(e,t){return e}function K1(e,t,i){return function(n){let o,r;if(e.canWrapX()){const a=e.getExtent(),s=Ye(a);r=z1(n=n.slice(0),e,s),r&&(n[0]=n[0]-r*s),n[0]=zt(n[0],a[0],a[2]),n[1]=zt(n[1],a[1],a[3]),o=i(n)}else o=i(n);return r&&t.canWrapX()&&(o[0]+=r*Ye(t.getExtent())),o}}var Y1,Z1,Q1;function J1(e,t,i){return function(n,o,r,a,s){if(!n)return;if(!o&&!t)return n;const l=t?0:r[0]*o,c=t?0:r[1]*o,h=s?s[0]:0,d=s?s[1]:0;let p=e[0]+l/2+h,m=e[2]-l/2+h,f=e[1]+c/2+d,g=e[3]-c/2+d;p>m&&(p=(m+p)/2,m=p),f>g&&(f=(g+f)/2,g=f);let b=zt(n[0],p,m),y=zt(n[1],f,g);if(a&&i&&o){const x=30*o;b+=-x*Math.log(1+Math.max(0,p-n[0])/x)+x*Math.log(1+Math.max(0,n[0]-m)/x),y+=-x*Math.log(1+Math.max(0,f-n[1])/x)+x*Math.log(1+Math.max(0,n[1]-g)/x)}return[b,y]}}function EC(e){return e}function Rp(e,t,i,n){const o=Ye(t)/i[0],r=Ft(t)/i[1];return n?Math.min(e,Math.max(o,r)):Math.min(e,Math.min(o,r))}function qp(e,t,i){let n=Math.min(e,t);return n*=Math.log(1+50*Math.max(0,e/t-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/e-1))/50+1),zt(n,i/2,2*t)}function ey(e,t,i,n,o){return i=i===void 0||i,function(r,a,s,l){if(r!==void 0){const c=n?Rp(e,n,s,o):e;return i&&l?qp(r,c,t):zt(r,t,c)}}}function Ap(e){if(e!==void 0)return 0}function ty(e){if(e!==void 0)return e}function iy(e){return Math.pow(e,3)}function wa(e){return 1-iy(1-e)}function LC(e){return 3*e*e-2*e*e*e}function IC(e){return e}Mp(C1),Mp(k1),Y1=C1,Z1=cC,Q1=hC,k1.forEach(function(e){Y1.forEach(function(t){fr(e,t,Z1),fr(t,e,Q1)})});const ny=new Array(6);function oy(e){return zp(e,1,0,0,1,0,0)}function tc(e,t){const i=e[0],n=e[1],o=e[2],r=e[3],a=e[4],s=e[5],l=t[0],c=t[1],h=t[2],d=t[3],p=t[4],m=t[5];return e[0]=i*l+o*c,e[1]=n*l+r*c,e[2]=i*h+o*d,e[3]=n*h+r*d,e[4]=i*p+o*m+a,e[5]=n*p+r*m+s,e}function zp(e,t,i,n,o,r,a){return e[0]=t,e[1]=i,e[2]=n,e[3]=o,e[4]=r,e[5]=a,e}function Kt(e,t){const i=t[0],n=t[1];return t[0]=e[0]*i+e[2]*n+e[4],t[1]=e[1]*i+e[3]*n+e[5],t}function Fp(e,t,i){return tc(e,zp(ny,t,0,0,i,0,0))}function zn(e,t,i,n,o,r,a,s){const l=Math.sin(r),c=Math.cos(r);return e[0]=n*c,e[1]=o*l,e[2]=-n*l,e[3]=o*c,e[4]=a*n*c-s*n*l+t,e[5]=a*o*l+s*o*c+i,e}function ry(e,t){const i=(n=t)[0]*n[3]-n[1]*n[2];var n;ft(i!==0,"Transformation matrix cannot be inverted");const o=t[0],r=t[1],a=t[2],s=t[3],l=t[4],c=t[5];return e[0]=s/i,e[1]=-r/i,e[2]=-a/i,e[3]=o/i,e[4]=(a*c-s*l)/i,e[5]=-(o*c-r*l)/i,e}const ay=[1e6,1e6,1e6,1e6,2,2];function Po(e,t,i,n,o,r,a){r=r||[],a=a||2;let s=0;for(let l=t;l<i;l+=n){const c=e[l],h=e[l+1];r[s++]=o[0]*c+o[2]*h+o[4],r[s++]=o[1]*c+o[3]*h+o[5];for(let d=2;d<a;d++)r[s++]=e[l+d]}return r&&r.length!=s&&(r.length=s),r}function Op(e,t,i,n,o,r,a){a=a||[];const s=Math.cos(o),l=Math.sin(o),c=r[0],h=r[1];let d=0;for(let p=t;p<i;p+=n){const m=e[p]-c,f=e[p+1]-h;a[d++]=c+m*s-f*l,a[d++]=h+m*l+f*s;for(let g=p+2;g<p+n;++g)a[d++]=e[g]}return a&&a.length!=d&&(a.length=d),a}const sy=[1,0,0,1,0,0];class ly extends Ki{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=d1((t,i,n)=>{if(!n)return this.getSimplifiedGeometry(i);const o=this.clone();return o.applyTransform(n),o.getSimplifiedGeometry(i)})}simplifyTransformed(t,i){return this.simplifyTransformedInternal(this.getRevision(),t,i)}clone(){return $e()}closestPointXY(t,i,n,o){return $e()}containsXY(t,i){const n=this.getClosestPoint([t,i]);return n[0]===t&&n[1]===i}getClosestPoint(t,i){return i=i||[NaN,NaN],this.closestPointXY(t[0],t[1],i,1/0),i}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return $e()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const i=this.computeExtent(this.extent_);(isNaN(i[0])||isNaN(i[1]))&&_a(i),this.extentRevision_=this.getRevision()}return function(i,n){return n?(n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n):i}(this.extent_,t)}rotate(t,i){$e()}scale(t,i,n){$e()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return $e()}getType(){return $e()}applyTransform(t){$e()}intersectsExtent(t){return $e()}translate(t,i){$e()}transform(t,i){const n=Ze(t),o=n.getUnits()=="tile-pixels"?function(r,a,s){const l=n.getExtent(),c=n.getWorldExtent(),h=Ft(c)/Ft(l);zn(sy,c[0],c[3],h,-h,0,0,0);const d=Po(r,0,r.length,s,sy,a),p=br(n,i);return p?p(d,d,s):d}:br(n,i);return this.applyTransform(o),this}}class Ro extends ly{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return pp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return $e()}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 i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?i:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,i){this.stride=ic(t),this.layout=t,this.flatCoordinates=i}setCoordinates(t,i){$e()}setLayout(t,i,n){let o;if(t)o=ic(t);else{for(let r=0;r<n;++r){if(i.length===0)return this.layout="XY",void(this.stride=2);i=i[0]}o=i.length,t=xr(o)}this.layout=t,this.stride=o}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,i){const n=this.getFlatCoordinates();if(n){const o=this.getStride();Op(n,0,n.length,o,t,i,n),this.changed()}}scale(t,i,n){i===void 0&&(i=t),n||(n=ki(this.getExtent()));const o=this.getFlatCoordinates();if(o){const r=this.getStride();(function(a,s,l,c,h,d,p,m){m=m||[];const f=p[0],g=p[1];let b=0;for(let y=s;y<l;y+=c){const x=a[y]-f,v=a[y+1]-g;m[b++]=f+h*x,m[b++]=g+d*v;for(let _=y+2;_<y+c;++_)m[b++]=a[_]}m&&m.length!=b&&(m.length=b)})(o,0,o.length,r,t,i,n,o),this.changed()}}translate(t,i){const n=this.getFlatCoordinates();if(n){const o=this.getStride();(function(r,a,s,l,c,h,d){d=d||[];let p=0;for(let m=a;m<s;m+=l){d[p++]=r[m]+c,d[p++]=r[m+1]+h;for(let f=m+2;f<m+l;++f)d[p++]=r[f]}d&&d.length!=p&&(d.length=p)})(n,0,n.length,o,t,i,n),this.changed()}}}function xr(e){let t;return e==2?t="XY":e==3?t="XYZ":e==4&&(t="XYZM"),t}function ic(e){let t;return e=="XY"?t=2:e=="XYZ"||e=="XYM"?t=3:e=="XYZM"&&(t=4),t}function uy(e,t,i,n,o,r,a){const s=e[t],l=e[t+1],c=e[i]-s,h=e[i+1]-l;let d;if(c===0&&h===0)d=t;else{const p=((o-s)*c+(r-l)*h)/(c*c+h*h);if(p>1)d=i;else{if(p>0){for(let m=0;m<n;++m)a[m]=Ni(e[t+m],e[i+m],p);return void(a.length=n)}d=t}}for(let p=0;p<n;++p)a[p]=e[d+p];a.length=n}function Dp(e,t,i,n,o){let r=e[t],a=e[t+1];for(t+=n;t<i;t+=n){const s=e[t],l=e[t+1],c=to(r,a,s,l);c>o&&(o=c),r=s,a=l}return o}function Np(e,t,i,n,o){for(let r=0,a=i.length;r<a;++r){const s=i[r];o=Dp(e,t,s,n,o),t=s}return o}function Bp(e,t,i,n,o,r,a,s,l,c,h){if(t==i)return c;let d,p;if(o===0){if(p=to(a,s,e[t],e[t+1]),p<c){for(d=0;d<n;++d)l[d]=e[t+d];return l.length=n,p}return c}h=h||[NaN,NaN];let m=t+n;for(;m<i;)if(uy(e,m-n,m,n,a,s,h),p=to(a,s,h[0],h[1]),p<c){for(c=p,d=0;d<n;++d)l[d]=h[d];l.length=n,m+=n}else m+=n*Math.max((Math.sqrt(p)-Math.sqrt(c))/o|0,1);if(r&&(uy(e,i-n,t,n,a,s,h),p=to(a,s,h[0],h[1]),p<c)){for(c=p,d=0;d<n;++d)l[d]=h[d];l.length=n}return c}function Vp(e,t,i,n,o,r,a,s,l,c,h){h=h||[NaN,NaN];for(let d=0,p=i.length;d<p;++d){const m=i[d];c=Bp(e,t,m,n,o,r,a,s,l,c,h),t=m}return c}function cy(e,t,i,n){for(let o=0,r=i.length;o<r;++o)e[t++]=i[o];return t}function nc(e,t,i,n){for(let o=0,r=i.length;o<r;++o){const a=i[o];for(let s=0;s<n;++s)e[t++]=a[s]}return t}function al(e,t,i,n,o){o=o||[];let r=0;for(let a=0,s=i.length;a<s;++a){const l=nc(e,t,i[a],n);o[r++]=l,t=l}return o.length=r,o}function hy(e,t,i,n,o){o=o||[];let r=0;for(let a=0,s=i.length;a<s;++a){const l=al(e,t,i[a],n,o[r]);l.length===0&&(l[0]=t),o[r++]=l,t=l[l.length-1]}return o.length=r,o}function oc(e,t,i,n,o,r,a){const s=(i-t)/n;if(s<3){for(;t<i;t+=n)r[a++]=e[t],r[a++]=e[t+1];return a}const l=new Array(s);l[0]=1,l[s-1]=1;const c=[t,i-n];let h=0;for(;c.length>0;){const d=c.pop(),p=c.pop();let m=0;const f=e[p],g=e[p+1],b=e[d],y=e[d+1];for(let x=p+n;x<d;x+=n){const v=aC(e[x],e[x+1],f,g,b,y);v>m&&(h=x,m=v)}m>o&&(l[(h-t)/n]=1,p+n<h&&c.push(p,h),h+n<d&&c.push(h,d))}for(let d=0;d<s;++d)l[d]&&(r[a++]=e[t+d*n],r[a++]=e[t+d*n+1]);return a}function dy(e,t,i,n,o,r,a,s){for(let l=0,c=i.length;l<c;++l){const h=i[l];a=oc(e,t,h,n,o,r,a),s.push(a),t=h}return a}function wr(e,t){return t*Math.round(e/t)}function PC(e,t,i,n,o,r,a){if(t==i)return a;let s,l,c=wr(e[t],o),h=wr(e[t+1],o);t+=n,r[a++]=c,r[a++]=h;do if(s=wr(e[t],o),l=wr(e[t+1],o),(t+=n)==i)return r[a++]=s,r[a++]=l,a;while(s==c&&l==h);for(;t<i;){const d=wr(e[t],o),p=wr(e[t+1],o);if(t+=n,d==s&&p==l)continue;const m=s-c,f=l-h,g=d-c,b=p-h;m*b==f*g&&(m<0&&g<m||m==g||m>0&&g>m)&&(f<0&&b<f||f==b||f>0&&b>f)?(s=d,l=p):(r[a++]=s,r[a++]=l,c=s,h=l,s=d,l=p)}return r[a++]=s,r[a++]=l,a}function jp(e,t,i,n,o,r,a,s){for(let l=0,c=i.length;l<c;++l){const h=i[l];a=PC(e,t,h,n,o,r,a),s.push(a),t=h}return a}function qo(e,t,i,n,o){o=o!==void 0?o:[];let r=0;for(let a=t;a<i;a+=n)o[r++]=e.slice(a,a+n);return o.length=r,o}function sl(e,t,i,n,o){o=o!==void 0?o:[];let r=0;for(let a=0,s=i.length;a<s;++a){const l=i[a];o[r++]=qo(e,t,l,n,o[r]),t=l}return o.length=r,o}function $p(e,t,i,n,o){o=o!==void 0?o:[];let r=0;for(let a=0,s=i.length;a<s;++a){const l=i[a];o[r++]=l.length===1&&l[0]===t?[]:sl(e,t,l,n,o[r]),t=l[l.length-1]}return o.length=r,o}function py(e,t,i,n){let o=0;const r=e[i-n],a=e[i-n+1];let s=0,l=0;for(;t<i;t+=n){const c=e[t]-r,h=e[t+1]-a;o+=l*c-s*h,s=c,l=h}return o/2}function my(e,t,i,n){let o=0;for(let r=0,a=i.length;r<a;++r){const s=i[r];o+=py(e,t,s,n),t=s}return o}class Au extends Ro{constructor(t,i){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,i===void 0||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}clone(){return new Au(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,i,n,o){return o<gr(this.getExtent(),t,i)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Dp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Bp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,n,o))}getArea(){return py(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return qo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const i=[];return i.length=oc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new Au(i,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=nc(this.flatCoordinates,0,t,this.stride),this.changed()}}class ln extends Ro{constructor(t,i){super(),this.setCoordinates(t,i)}clone(){const t=new ln(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,i,n,o){const r=this.flatCoordinates,a=to(t,i,r[0],r[1]);if(a<o){const s=this.stride;for(let l=0;l<s;++l)n[l]=r[l];return n.length=s,a}return o}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return L1(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return hp(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=cy(this.flatCoordinates,0,t,this.stride),this.changed()}}function RC(e,t,i,n,o){return!fp(o,function(r){return!Sr(e,t,i,n,r[0],r[1])})}function Sr(e,t,i,n,o,r){let a=0,s=e[i-n],l=e[i-n+1];for(;t<i;t+=n){const c=e[t],h=e[t+1];l<=r?h>r&&(c-s)*(r-l)-(o-s)*(h-l)>0&&a++:h<=r&&(c-s)*(r-l)-(o-s)*(h-l)<0&&a--,s=c,l=h}return a!==0}function Gp(e,t,i,n,o,r){if(i.length===0||!Sr(e,t,i[0],n,o,r))return!1;for(let a=1,s=i.length;a<s;++a)if(Sr(e,i[a-1],i[a],n,o,r))return!1;return!0}function Hp(e,t,i,n,o,r,a){let s,l,c,h,d,p,m;const f=o[r+1],g=[];for(let x=0,v=i.length;x<v;++x){const _=i[x];for(h=e[_-n],p=e[_-n+1],s=t;s<_;s+=n)d=e[s],m=e[s+1],(f<=p&&m<=f||p<=f&&f<=m)&&(c=(f-p)/(m-p)*(d-h)+h,g.push(c)),h=d,p=m}let b=NaN,y=-1/0;for(g.sort(En),h=g[0],s=1,l=g.length;s<l;++s){d=g[s];const x=Math.abs(d-h);x>y&&(c=(h+d)/2,Gp(e,t,i,n,c,f)&&(b=c,y=x)),h=d}return isNaN(b)&&(b=o[r]),a?(a.push(b,f,y),a):[b,f,y]}function fy(e,t,i,n,o){let r=[];for(let a=0,s=i.length;a<s;++a){const l=i[a];r=Hp(e,t,l,n,o,2*a,r),t=l[l.length-1]}return r}function gy(e,t,i,n,o){let r;for(t+=n;t<i;t+=n)if(r=o(e.slice(t-n,t),e.slice(t,t+n)),r)return r;return!1}function rc(e,t,i,n,o){const r=I1([1/0,1/0,-1/0,-1/0],e,t,i,n);return!!Nt(o,r)&&(!!pn(o,r)||r[0]>=o[0]&&r[2]<=o[2]||r[1]>=o[1]&&r[3]<=o[3]||gy(e,t,i,n,function(a,s){return function(l,c,h){let d=!1;const p=dp(l,c),m=dp(l,h);if(p===Hu||m===Hu)d=!0;else{const f=l[0],g=l[1],b=l[2],y=l[3],x=c[0],v=c[1],_=h[0],w=h[1],S=(w-v)/(_-x);let C,L;m&sp&&!(p&sp)&&(C=_-(w-y)/S,d=C>=f&&C<=b),d||!(m&lp)||p&lp||(L=w-(_-b)*S,d=L>=g&&L<=y),d||!(m&up)||p&up||(C=_-(w-g)/S,d=C>=f&&C<=b),d||!(m&cp)||p&cp||(L=w-(_-f)*S,d=L>=g&&L<=y)}return d}(o,a,s)}))}function vy(e,t,i,n,o){return!!rc(e,t,i,n,o)||!!Sr(e,t,i,n,o[0],o[1])||!!Sr(e,t,i,n,o[0],o[3])||!!Sr(e,t,i,n,o[2],o[1])||!!Sr(e,t,i,n,o[2],o[3])}function yy(e,t,i,n,o){if(!vy(e,t,i[0],n,o))return!1;if(i.length===1)return!0;for(let r=1,a=i.length;r<a;++r)if(RC(e,i[r-1],i[r],n,o)&&!rc(e,i[r-1],i[r],n,o))return!1;return!0}function qC(e,t,i,n){for(;t<i-n;){for(let o=0;o<n;++o){const r=e[t+o];e[t+o]=e[i-n+o],e[i-n+o]=r}t+=n,i-=n}}function Up(e,t,i,n){let o=0,r=e[i-n],a=e[i-n+1];for(;t<i;t+=n){const s=e[t],l=e[t+1];o+=(s-r)*(l+a),r=s,a=l}return o===0?void 0:o>0}function Wp(e,t,i,n,o){o=o!==void 0&&o;for(let r=0,a=i.length;r<a;++r){const s=i[r],l=Up(e,t,s,n);if(r===0){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;t=s}return!0}function _y(e,t,i,n,o){for(let r=0,a=i.length;r<a;++r){const s=i[r];if(!Wp(e,t,s,n,o))return!1;s.length&&(t=s[s.length-1])}return!0}function ac(e,t,i,n,o){o=o!==void 0&&o;for(let r=0,a=i.length;r<a;++r){const s=i[r],l=Up(e,t,s,n);(r===0?o&&l||!o&&!l:o&&!l||!o&&l)&&qC(e,t,s,n),t=s}return t}function Xp(e,t,i,n,o){for(let r=0,a=i.length;r<a;++r)t=ac(e,t,i[r],n,o);return t}function by(e,t){const i=[];let n,o=0,r=0;for(let a=0,s=t.length;a<s;++a){const l=t[a],c=Up(e,o,l,2);if(n===void 0&&(n=c),c===n)i.push(t.slice(r,a+1));else{if(i.length===0)continue;i[i.length-1].push(t[r])}r=a+1,o=l}return i}class Fi extends Ro{constructor(t,i,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,i!==void 0&&n?(this.setFlatCoordinates(i,t),this.ends_=n):this.setCoordinates(t,i)}appendLinearRing(t){this.flatCoordinates?Ln(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Fi(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,i,n,o){return o<gr(this.getExtent(),t,i)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Np(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Vp(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,n,o))}containsXY(t,i){return Gp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)}getArea(){return my(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let i;return t!==void 0?(i=this.getOrientedFlatCoordinates().slice(),ac(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,sl(i,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=ki(this.getExtent());this.flatInteriorPoint_=Hp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ln(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new Au(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,i=this.flatCoordinates,n=this.ends_,o=[];let r=0;for(let a=0,s=n.length;a<s;++a){const l=n[a],c=new Au(i.slice(r,l),t);o.push(c),r=l}return o}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Wp(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ac(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const i=[],n=[];return i.length=jp(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new Fi(i,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return yy(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,i){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=al(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function Kp(e){if(yr(e))throw new Error("Cannot create polygon from empty extent");const t=e[0],i=e[1],n=e[2],o=e[3],r=[t,i,t,o,n,o,n,i,t,i];return new Fi(r,"XY",[r.length])}function sc(e,t){setTimeout(function(){e(t)},0)}function AC(e){return!(e.sourceCenter&&e.targetCenter&&!Zu(e.sourceCenter,e.targetCenter))&&e.sourceResolution===e.targetResolution&&e.sourceRotation===e.targetRotation}function Yp(e,t,i,n,o){const r=Math.cos(-o);let a=Math.sin(-o),s=e[0]*r-e[1]*a,l=e[1]*r+e[0]*a;return s+=(t[0]/2-i[0])*n,l+=(i[1]-t[1]/2)*n,a=-a,[s*r-l*a,l*r+s*a]}var Vi=class extends Ki{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=kp(e.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,e.projection&&X1(),e.center&&(e.center=mn(e.center,this.projection_)),e.extent&&(e.extent=An(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in dn)delete t[a];this.setProperties(t,!0);const i=function(a){let s,l,c,p=a.minZoom!==void 0?a.minZoom:0,m=a.maxZoom!==void 0?a.maxZoom:28;const f=a.zoomFactor!==void 0?a.zoomFactor:2,g=a.multiWorld!==void 0&&a.multiWorld,b=a.smoothResolutionConstraint===void 0||a.smoothResolutionConstraint,y=a.showFullExtent!==void 0&&a.showFullExtent,x=kp(a.projection,"EPSG:3857"),v=x.getExtent();let _=a.constrainOnlyCenter,w=a.extent;if(g||w||!x.isGlobal()||(_=!1,w=v),a.resolutions!==void 0){const S=a.resolutions;l=S[p],c=S[m]!==void 0?S[m]:S[S.length-1],s=a.constrainResolution?function(C,L,A,T){return L=L===void 0||L,function(E,k,I,M){if(E!==void 0){const P=C[0],R=C[C.length-1],q=A?Rp(P,A,I,T):P;if(M)return L?qp(E,q,R):zt(E,R,q);const B=Math.min(q,E),V=Math.floor(Fu(C,B,k));return C[V]>q&&V<C.length-1?C[V+1]:C[V]}}}(S,b,!_&&w,y):ey(l,c,b,!_&&w,y)}else{const S=(v?Math.max(Ye(v),Ft(v)):360*io.degrees/x.getMetersPerUnit())/rp/Math.pow(2,0),C=S/Math.pow(2,28);l=a.maxResolution,l!==void 0?p=0:l=S/Math.pow(f,p),c=a.minResolution,c===void 0&&(c=a.maxZoom!==void 0?a.maxResolution!==void 0?l/Math.pow(f,m):S/Math.pow(f,m):C),m=p+Math.floor(Math.log(l/c)/Math.log(f)),c=l/Math.pow(f,m-p),s=a.constrainResolution?function(L,A,T,E,k,I){return E=E===void 0||E,T=T!==void 0?T:0,function(M,P,R,q){if(M!==void 0){const B=k?Rp(A,k,R,I):A;if(q)return E?qp(M,B,T):zt(M,T,B);const V=1e-9,N=Math.ceil(Math.log(A/B)/Math.log(L)-V),z=-P*(.5-V)+.5,Q=Math.min(B,M),ee=Math.floor(Math.log(A/Q)/Math.log(L)+z),J=Math.max(N,ee);return zt(A/Math.pow(L,J),T,B)}}}(f,l,c,b,!_&&w,y):ey(l,c,b,!_&&w,y)}return{constraint:s,maxResolution:l,minResolution:c,minZoom:p,zoomFactor:f}}(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const n=function(a){if(a.extent!==void 0){const l=a.smoothExtentConstraint===void 0||a.smoothExtentConstraint;return J1(a.extent,a.constrainOnlyCenter,l)}const s=kp(a.projection,"EPSG:3857");if(a.multiWorld!==!0&&s.isGlobal()){const l=s.getExtent().slice();return l[0]=-1/0,l[2]=1/0,J1(l,!1,!1)}return EC}(e),o=i.constraint,r=function(a){if(a.enableRotation===void 0||a.enableRotation){const l=a.constrainRotation;return l===void 0||l===!0?function(c){const h=c===void 0?cn(5):c;return function(d,p){return p||d===void 0?d:Math.abs(d)<=h?0:d}}():l===!1?ty:typeof l=="number"?function(c){const h=2*Math.PI/c;return function(d,p){return p?d:d!==void 0?d=Math.floor(d/h+.5)*h:void 0}}(l):ty}return Ap}(e);this.constraints_={center:n,resolution:o,rotation:r},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenterInternal();if(i){const n=e||[0,0,0,0];t=t||[0,0,0,0];const o=this.getResolution(),r=o/2*(n[3]-t[3]+t[1]-n[1]),a=o/2*(n[0]-t[0]+t[2]-n[2]);this.setCenterInternal([i[0]+r,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let n=arguments[i];n.center&&(n=Object.assign({},n),n.center=mn(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=mn(n.anchor,this.getProjection())),t[i]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t,i=arguments.length;i>1&&typeof arguments[i-1]=="function"&&(t=arguments[i-1],--i);let n=0;for(;n<i&&!this.isDef();++n){const c=arguments[n];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(n===i)return void(t&&sc(t,!0));let o=Date.now(),r=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_;const l=[];for(;n<i;++n){const c=arguments[n],h={start:o,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||LC,callback:t};if(c.center&&(h.sourceCenter=r,h.targetCenter=c.center.slice(),r=h.targetCenter),c.zoom!==void 0?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(c.zoom),a=h.targetResolution):c.resolution&&(h.sourceResolution=a,h.targetResolution=c.resolution,a=h.targetResolution),c.rotation!==void 0){h.sourceRotation=s;const d=To(c.rotation-s+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=s+d,s=h.targetRotation}AC(h)?h.complete=!0:o+=h.duration,l.push(h)}this.animations_.push(l),this.setHint(Bi,1),this.updateAnimations_()}getAnimating(){return this.hints_[Bi]>0}getInteracting(){return this.hints_[hn]>0}cancelAnimations(){let e;this.setHint(Bi,-this.hints_[Bi]);for(let t=0,i=this.animations_.length;t<i;++t){const n=this.animations_[t];if(n[0].callback&&sc(n[0].callback,!1),!e)for(let o=0,r=n.length;o<r;++o){const a=n[o];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,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 e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let o=!0;for(let r=0,a=n.length;r<a;++r){const s=n[r];if(s.complete)continue;const l=e-s.start;let c=s.duration>0?l/s.duration:1;c>=1?(s.complete=!0,c=1):o=!1;const h=s.easing(c);if(s.sourceCenter){const d=s.sourceCenter[0],p=s.sourceCenter[1],m=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;const g=d+h*(m-d),b=p+h*(f-p);this.targetCenter_=[g,b]}if(s.sourceResolution&&s.targetResolution){const d=h===1?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){const p=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(d,0,p,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(s.sourceRotation!==void 0&&s.targetRotation!==void 0){const d=h===1?To(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){const p=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(p,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),t=!0,!s.complete)break}if(o){this.animations_[i]=null,this.setHint(Bi,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const r=n[0].callback;r&&sc(r,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let i;const n=this.getCenterInternal();var o,r;return n!==void 0&&(i=[n[0]-t[0],n[1]-t[1]],vp(i,e-this.getRotation()),r=t,(o=i)[0]+=+r[0],o[1]+=+r[1]),i}calculateCenterZoom(e,t){let i;const n=this.getCenterInternal(),o=