vue3-openstreet-map
Version:
Simple Vue 3 Openlayers Map Picker & Geocoder
1 lines • 323 kB
JavaScript
(function(Ze,At){typeof exports=="object"&&typeof module<"u"?At(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],At):(Ze=typeof globalThis<"u"?globalThis:Ze||self,At(Ze.VueOpenMap={},Ze.Vue))})(this,function(Ze,At){"use strict";class _e{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const fi={PROPERTYCHANGE:"propertychange"};class xs{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function al(n,t,e){let i,s;e=e||Ae;let r=0,o=n.length,a=!1;for(;r<o;)i=r+(o-r>>1),s=+e(n[i],t),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function Ae(n,t){return n>t?1:n<t?-1:0}function ws(n,t,e){if(n[0]<=t)return 0;const i=n.length;if(t<=n[i-1])return i-1;if(typeof e=="function"){for(let s=1;s<i;++s){const r=n[s];if(r===t)return s;if(r<t)return e(t,n[s-1],r)>0?s-1:s}return i-1}if(e>0){for(let s=1;s<i;++s)if(n[s]<t)return s-1;return i-1}if(e<0){for(let s=1;s<i;++s)if(n[s]<=t)return s;return i-1}for(let s=1;s<i;++s){if(n[s]==t)return s;if(n[s]<t)return n[s-1]-t<t-n[s]?s-1:s}return i-1}function ll(n,t,e){for(;t<e;){const i=n[t];n[t]=n[e],n[e]=i,++t,--e}}function Cs(n,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let s=0;s<i;s++)n[n.length]=e[s]}function Pe(n,t){const e=n.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(n[i]!==t[i])return!1;return!0}function hl(n,t,e){const i=t||Ae;return n.every(function(s,r){if(r===0)return!0;const o=i(n[r-1],s);return!(o>0||e&&o===0)})}function Vi(){return!0}function bn(){return!1}function gi(){}function Or(n){let t=!1,e,i,s;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==s||!Pe(r,i))&&(t=!0,s=this,i=r,e=n.apply(this,arguments)),e}}function Ui(n){for(const t in n)delete n[t]}function _i(n){let t;for(t in n)return!1;return!t}class Ln extends xs{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),s=i[t]||(i[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=e?new _e(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let h=0,c=s.length;h<c;++h)if("handleEvent"in s[h]?l=s[h].handleEvent(r):l=s[h].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[i]===0){let h=a[i];for(delete a[i];h--;)this.removeEventListener(i,gi);delete o[i]}return l}disposeInternal(){this.listeners_&&Ui(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 i=this.listeners_[t];if(!i)return;const s=i.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[s]=gi,++this.pendingRemovals_[t]):(i.splice(s,1),i.length===0&&delete this.listeners_[t]))}}const j={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 H(n,t,e,i,s){if(i&&i!==n&&(e=e.bind(i)),s){const o=e;e=function(){n.removeEventListener(t,e),o.apply(this,arguments)}}const r={target:n,type:t,listener:e};return n.addEventListener(t,e),r}function Mn(n,t,e,i){return H(n,t,e,i,!0)}function ht(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Ui(n))}class Zi extends Ln{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(j.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r<i;++r)s[r]=H(this,t[r],e);return s}return H(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const s=t.length;i=new Array(s);for(let r=0;r<s;++r)i[r]=Mn(this,t[r],e)}else i=Mn(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)cl(i);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],e);else this.removeEventListener(t,e)}}Zi.prototype.on,Zi.prototype.once,Zi.prototype.un;function cl(n){if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)ht(n[t]);else ht(n)}function Q(){throw new Error("Unimplemented abstract method.")}let ul=0;function tt(n){return n.ol_uid||(n.ol_uid=String(++ul))}class Fr extends _e{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class Qt extends Zi{constructor(t){super(),this.on,this.once,this.un,tt(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 i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new Fr(i,t,e)),i=fi.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Fr(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const s=this.values_||(this.values_={});if(i)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],_i(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const Pt={ADD:"add",REMOVE:"remove"},Dr={LENGTH:"length"};class An extends _e{constructor(t,e,i){super(t),this.element=e,this.index=i}}class oe extends Qt{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,s=this.array_.length;i<s;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,s=e.length;i<s;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(Dr.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 An(Pt.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 i=0,s=e.length;i<s;++i)if(e[i]===t)return this.removeAt(i)}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 An(Pt.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new An(Pt.REMOVE,s,t)),this.dispatchEvent(new An(Pt.ADD,e,t))}updateLength_(){this.set(Dr.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,s=this.array_.length;i<s;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}const Oe=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",dl=Oe.includes("firefox");Oe.includes("safari")&&!Oe.includes("chrom")&&(Oe.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Oe));const fl=Oe.includes("webkit")&&!Oe.includes("edge"),kr=Oe.includes("macintosh"),Nr=typeof devicePixelRatio<"u"?devicePixelRatio:1,vs=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Gr=typeof Image<"u"&&Image.prototype.decode,zr=function(){let n=!1;try{const t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();function J(n,t){if(!n)throw new Error(t)}new Array(6);function te(){return[1,0,0,1,0,0]}function gl(n,t,e,i,s,r,o){return n[0]=t,n[1]=e,n[2]=i,n[3]=s,n[4]=r,n[5]=o,n}function _l(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function mt(n,t){const e=t[0],i=t[1];return t[0]=n[0]*e+n[2]*i+n[4],t[1]=n[1]*e+n[3]*i+n[5],t}function ml(n,t,e){return gl(n,t,0,0,e,0,0)}function me(n,t,e,i,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return n[0]=i*h,n[1]=s*l,n[2]=-i*l,n[3]=s*h,n[4]=o*i*h-a*i*l+t,n[5]=o*s*l+a*s*h+e,n}function Ts(n,t){const e=pl(t);J(e!==0,"Transformation matrix cannot be inverted");const i=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5];return n[0]=o/e,n[1]=-s/e,n[2]=-r/e,n[3]=i/e,n[4]=(r*l-o*a)/e,n[5]=-(i*l-s*a)/e,n}function pl(n){return n[0]*n[3]-n[1]*n[2]}let Xr;function Wr(n){const t="matrix("+n.join(", ")+")";if(vs)return t;const e=Xr||(Xr=document.createElement("div"));return e.style.transform=t,e.style.transform}const pt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Yr(n){const t=Ut();for(let e=0,i=n.length;e<i;++e)qi(t,n[e]);return t}function yl(n,t,e){const i=Math.min.apply(null,n),s=Math.min.apply(null,t),r=Math.max.apply(null,n),o=Math.max.apply(null,t);return pe(i,s,r,o,e)}function Rs(n,t,e){return e?(e[0]=n[0]-t,e[1]=n[1]-t,e[2]=n[2]+t,e[3]=n[3]+t,e):[n[0]-t,n[1]-t,n[2]+t,n[3]+t]}function Br(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n.slice()}function jr(n,t,e){let i,s;return t<n[0]?i=n[0]-t:n[2]<t?i=t-n[2]:i=0,e<n[1]?s=n[1]-e:n[3]<e?s=e-n[3]:s=0,i*i+s*s}function Pn(n,t){return Vr(n,t[0],t[1])}function Ke(n,t){return n[0]<=t[0]&&t[2]<=n[2]&&n[1]<=t[1]&&t[3]<=n[3]}function Vr(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function Is(n,t){const e=n[0],i=n[1],s=n[2],r=n[3],o=t[0],a=t[1];let l=pt.UNKNOWN;return o<e?l=l|pt.LEFT:o>s&&(l=l|pt.RIGHT),a<i?l=l|pt.BELOW:a>r&&(l=l|pt.ABOVE),l===pt.UNKNOWN&&(l=pt.INTERSECTING),l}function Ut(){return[1/0,1/0,-1/0,-1/0]}function pe(n,t,e,i,s){return s?(s[0]=n,s[1]=t,s[2]=e,s[3]=i,s):[n,t,e,i]}function Ki(n){return pe(1/0,1/0,-1/0,-1/0,n)}function Ur(n,t){const e=n[0],i=n[1];return pe(e,i,e,i,t)}function Ss(n,t,e,i,s){const r=Ki(s);return Zr(r,n,t,e,i)}function $i(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function El(n,t){return t[0]<n[0]&&(n[0]=t[0]),t[2]>n[2]&&(n[2]=t[2]),t[1]<n[1]&&(n[1]=t[1]),t[3]>n[3]&&(n[3]=t[3]),n}function qi(n,t){t[0]<n[0]&&(n[0]=t[0]),t[0]>n[2]&&(n[2]=t[0]),t[1]<n[1]&&(n[1]=t[1]),t[1]>n[3]&&(n[3]=t[1])}function Zr(n,t,e,i,s){for(;e<i;e+=s)xl(n,t[e],t[e+1]);return n}function xl(n,t,e){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],e),n[2]=Math.max(n[2],t),n[3]=Math.max(n[3],e)}function Kr(n,t){let e;return e=t(On(n)),e||(e=t(Fn(n)),e)||(e=t(Dn(n)),e)||(e=t(qe(n)),e)?e:!1}function bs(n){let t=0;return Ji(n)||(t=ot(n)*Xt(n)),t}function On(n){return[n[0],n[1]]}function Fn(n){return[n[2],n[1]]}function $e(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function wl(n,t){let e;if(t==="bottom-left")e=On(n);else if(t==="bottom-right")e=Fn(n);else if(t==="top-left")e=qe(n);else if(t==="top-right")e=Dn(n);else throw new Error("Invalid corner");return e}function Ls(n,t,e,i,s){const[r,o,a,l,h,c,u,d]=Ms(n,t,e,i);return pe(Math.min(r,a,h,u),Math.min(o,l,c,d),Math.max(r,a,h,u),Math.max(o,l,c,d),s)}function Ms(n,t,e,i){const s=t*i[0]/2,r=t*i[1]/2,o=Math.cos(e),a=Math.sin(e),l=s*o,h=s*a,c=r*o,u=r*a,d=n[0],f=n[1];return[d-l+u,f-h-c,d-l-u,f-h+c,d+l-u,f+h+c,d+l+u,f+h-c,d-l+u,f-h-c]}function Xt(n){return n[3]-n[1]}function Hi(n,t,e){const i=e||Ut();return Ot(n,t)?(n[0]>t[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]<t[2]?i[2]=n[2]:i[2]=t[2],n[3]<t[3]?i[3]=n[3]:i[3]=t[3]):Ki(i),i}function qe(n){return[n[0],n[3]]}function Dn(n){return[n[2],n[3]]}function ot(n){return n[2]-n[0]}function Ot(n,t){return n[0]<=t[2]&&n[2]>=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function Ji(n){return n[2]<n[0]||n[3]<n[1]}function Cl(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n}function vl(n,t,e){let i=!1;const s=Is(n,t),r=Is(n,e);if(s===pt.INTERSECTING||r===pt.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],h=n[3],c=t[0],u=t[1],d=e[0],f=e[1],g=(f-u)/(d-c);let _,m;r&pt.ABOVE&&!(s&pt.ABOVE)&&(_=d-(f-h)/g,i=_>=o&&_<=l),!i&&r&pt.RIGHT&&!(s&pt.RIGHT)&&(m=f-(d-l)*g,i=m>=a&&m<=h),!i&&r&pt.BELOW&&!(s&pt.BELOW)&&(_=d-(f-a)/g,i=_>=o&&_<=l),!i&&r&pt.LEFT&&!(s&pt.LEFT)&&(m=f-(d-o)*g,i=m>=a&&m<=h)}return i}function Tl(n,t,e,i){if(Ji(n))return Ki(e);let s=[];if(i>1){const a=n[2]-n[0],l=n[3]-n[1];for(let h=0;h<i;++h)s.push(n[0]+a*h/i,n[1],n[2],n[1]+l*h/i,n[2]-a*h/i,n[3],n[0],n[3]-l*h/i)}else s=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]];t(s,s,2);const r=[],o=[];for(let a=0,l=s.length;a<l;a+=2)r.push(s[a]),o.push(s[a+1]);return yl(r,o,e)}function $r(n,t){const e=t.getExtent(),i=$e(n);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){const s=ot(e),o=Math.floor((i[0]-e[0])/s)*s;n[0]-=o,n[2]-=o}return n}function Rl(n,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[e[0],n[1],e[2],n[3]]];$r(n,t);const i=ot(e);if(ot(n)>i)return[[e[0],n[1],e[2],n[3]]];if(n[0]<e[0])return[[n[0]+i,n[1],e[2],n[3]],[e[0],n[1],n[2],n[3]]];if(n[2]>e[2])return[[n[0],n[1],e[2],n[3]],[e[0],n[1],n[2]-i,n[3]]]}return[n]}const Qi={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var xt={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};xt.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]}},xt.max=xt.whitepoint[2].D65,xt.rgb=function(n,t){t=t||xt.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],s=n[2]/t[2],r,o,a;return r=e*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=e*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,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,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]},Qi.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,s=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+i*.35758433938387+s*.18048078840183,o=e*.21263900587151+i*.71516867876775+s*.072192315360733,a=e*.019330818715591+i*.11919477979462+s*.95053215224966;return t=t||xt.whitepoint[2].E,[r*t[0],o*t[1],a*t[2]]};const As={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,s,r,o,a,l,h,c,u,d,f,g,_;if(r=n[0],o=n[1],a=n[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=xt.whitepoint[e][t][0],d=xt.whitepoint[e][t][1],f=xt.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),i=o/(13*r)+g||0,s=a/(13*r)+_||0,h=r>8?d*Math.pow((r+16)/116,3):d*r*m,l=h*9*i/(4*s)||0,c=h*(12-3*i-20*s)/(4*s)||0,[l,h,c]}};xt.luv=function(n,t,e){var i,s,r,o,a,l,h,c,u,d,f,g,_,m=.008856451679035631,p=903.2962962962961;t=t||"D65",e=e||2,u=xt.whitepoint[e][t][0],d=xt.whitepoint[e][t][1],f=xt.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),l=n[0],h=n[1],c=n[2],i=4*l/(l+15*h+3*c)||0,s=9*h/(l+15*h+3*c)||0;var y=h/d;return r=y<=m?p*y:116*Math.pow(y,1/3)-16,o=13*r*(i-g),a=13*r*(s-_),[r,o,a]};var qr={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],s,r,o;return o=i/360*2*Math.PI,s=e*Math.cos(o),r=e*Math.sin(o),[t,s,r]},xyz:function(n){return As.xyz(qr.luv(n))}};As.lchuv=function(n){var t=n[0],e=n[1],i=n[2],s=Math.sqrt(e*e+i*i),r=Math.atan2(i,e),o=r*360/2/Math.PI;return o<0&&(o+=360),[t,s,o]},xt.lchuv=function(n){return As.lchuv(xt.luv(n))};var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ps(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function ye(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var e=function i(){return this instanceof i?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(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),e}var Il={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]};const Jr=Ps(Il);var Qr={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Sl(n){var c,u;var t,e=[],i=1,s;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),Jr[n])e=Jr[n].slice(),s="rgb";else if(n==="transparent")i=0,s="rgb",e=[0,0,0];else if(n[0]==="#"){var r=n.slice(1),o=r.length,a=o<=4;i=1,a?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];s=l.replace(/a$/,"");var h=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(d,f){if(d[d.length-1]==="%")return d=parseFloat(d)/100,f===3?d:s==="rgb"?d*255:s[0]==="h"||s[0]==="l"&&!f?d*100:s==="lab"?d*125:s==="lch"?f<2?d*150:d*360:s[0]==="o"&&!f?d:s==="oklab"?d*.4:s==="oklch"?f<2?d*.4:d*360:d;if(s[f]==="h"||f===2&&s[s.length-1]==="h"){if(Qr[d]!==void 0)return Qr[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)}),i=e.length>h?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),s=((u=(c=n.match(/([a-z])/ig))==null?void 0:c.join(""))==null?void 0:u.toLowerCase())||"rgb");return{space:s,values:e,alpha:i}}const Os={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s,r,o,a,l,h=0;if(e===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[0,0,0];h<3;)o=t+1/3*-(h-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[h++]=l*255;return a}};Qi.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a,l,h;return r===s?a=0:t===r?a=(e-i)/o:e===r?a=2+(i-t)/o:i===r&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),h=(s+r)/2,r===s?l=0:h<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,h*100]};function bl(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e=Sl(n);if(!e.space)return[];const i=e.space[0]==="h"?Os.min:Qi.min,s=e.space[0]==="h"?Os.max:Qi.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],i[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],i[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],i[2]),s[2]),e.space[0]==="h"&&(t=Os.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function ut(n,t,e){return Math.min(Math.max(n,t),e)}function Ll(n,t,e,i,s,r){const o=s-e,a=r-i;if(o!==0||a!==0){const l=((n-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=s,i=r):l>0&&(e+=o*l,i+=a*l)}return mi(n,t,e,i)}function mi(n,t,e,i){const s=e-n,r=i-t;return s*s+r*r}function Ml(n){const t=n.length;for(let i=0;i<t;i++){let s=i,r=Math.abs(n[i][i]);for(let a=i+1;a<t;a++){const l=Math.abs(n[a][i]);l>r&&(r=l,s=a)}if(r===0)return null;const o=n[s];n[s]=n[i],n[i]=o;for(let a=i+1;a<t;a++){const l=-n[a][i]/n[i][i];for(let h=i;h<t+1;h++)i==h?n[a][h]=0:n[a][h]+=l*n[i][h]}}const e=new Array(t);for(let i=t-1;i>=0;i--){e[i]=n[i][t]/n[i][i];for(let s=i-1;s>=0;s--)n[s][t]-=n[s][i]*e[i]}return e}function kn(n){return n*Math.PI/180}function He(n,t){const e=n%t;return e*t<0?e+t:e}function Zt(n,t,e){return n+e*(t-n)}function Fs(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}function Nn(n,t){return Math.floor(Fs(n,t))}function Gn(n,t){return Math.ceil(Fs(n,t))}function to(n){return typeof n=="string"?n:no(n)}const Al=1024,tn={};let Ds=0;function Pl(n){if(n.length===4)return n;const t=n.slice();return t[3]=1,t}function eo(n){const t=xt.lchuv(Qi.xyz(n));return t[3]=n[3],t}function Ol(n){const t=xt.rgb(qr.xyz(n));return t[3]=n[3],t}function ks(n){if(tn.hasOwnProperty(n))return tn[n];if(Ds>=Al){let e=0;for(const i in tn)e++&3||(delete tn[i],--Ds)}const t=bl(n);if(t.length!==4)throw new Error('Failed to parse "'+n+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+n+'" as color');return io(t),tn[n]=t,++Ds,t}function zn(n){return Array.isArray(n)?n:ks(n)}function io(n){return n[0]=ut(n[0]+.5|0,0,255),n[1]=ut(n[1]+.5|0,0,255),n[2]=ut(n[2]+.5|0,0,255),n[3]=ut(n[3],0,1),n}function no(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const s=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+t+","+e+","+i+","+s+")"}function Fl(n){try{return ks(n),!0}catch{return!1}}class Dl{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const s=so(t,e,i);return s in this.cache_?this.cache_[s]:null}set(t,e,i,s){const r=so(t,e,i);this.cache_[r]=s,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function so(n,t,e){const i=e?to(e):"null";return t+":"+n+":"+i}const Xn=new Dl,st={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"};class ro extends Qt{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[st.OPACITY]=t.opacity!==void 0?t.opacity:1,J(typeof e[st.OPACITY]=="number","Layer opacity must be a number"),e[st.VISIBLE]=t.visible!==void 0?t.visible:!0,e[st.Z_INDEX]=t.zIndex,e[st.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[st.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[st.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[st.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},i=this.getZIndex();return e.opacity=ut(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,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 Q()}getLayerStatesArray(t){return Q()}getExtent(){return this.get(st.EXTENT)}getMaxResolution(){return this.get(st.MAX_RESOLUTION)}getMinResolution(){return this.get(st.MIN_RESOLUTION)}getMinZoom(){return this.get(st.MIN_ZOOM)}getMaxZoom(){return this.get(st.MAX_ZOOM)}getOpacity(){return this.get(st.OPACITY)}getSourceState(){return Q()}getVisible(){return this.get(st.VISIBLE)}getZIndex(){return this.get(st.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(st.EXTENT,t)}setMaxResolution(t){this.set(st.MAX_RESOLUTION,t)}setMinResolution(t){this.set(st.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(st.MAX_ZOOM,t)}setMinZoom(t){this.set(st.MIN_ZOOM,t)}setOpacity(t){J(typeof t=="number","Layer opacity must be a number"),this.set(st.OPACITY,t)}setVisible(t){this.set(st.VISIBLE,t)}setZIndex(t){this.set(st.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const ae={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Ct={ANIMATING:0,INTERACTING:1},ee={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},kl=42,Ns=256,pi={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Nl{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_||pi[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 Gs=Nl,en=6378137,yi=Math.PI*en,Gl=[-yi,-yi,yi,yi],zl=[-180,-85,180,85],Wn=en*Math.log(Math.tan(Math.PI/2));class Ei extends Gs{constructor(t){super({code:t,units:"m",extent:Gl,global:!0,worldExtent:zl,getPointResolution:function(e,i){return e/Math.cosh(i[1]/en)}})}}const oo=[new Ei("EPSG:3857"),new Ei("EPSG:102100"),new Ei("EPSG:102113"),new Ei("EPSG:900913"),new Ei("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ei("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Xl(n,t,e){const i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let s=0;s<i;s+=e){t[s]=yi*n[s]/180;let r=en*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));r>Wn?r=Wn:r<-Wn&&(r=-Wn),t[s+1]=r}return t}function Wl(n,t,e){const i=n.length;e=e>1?e:2,t===void 0&&(e>2?t=n.slice():t=new Array(i));for(let s=0;s<i;s+=e)t[s]=180*n[s]/yi,t[s+1]=360*Math.atan(Math.exp(n[s+1]/en))/Math.PI-90;return t}const Yl=6378137,ao=[-180,-90,180,90],Bl=Math.PI*Yl/180;class Je extends Gs{constructor(t,e){super({code:t,units:"degrees",extent:ao,axisOrientation:e,global:!0,metersPerUnit:Bl,worldExtent:ao})}}const lo=[new Je("CRS:84"),new Je("EPSG:4326","neu"),new Je("urn:ogc:def:crs:OGC:1.3:CRS84"),new Je("urn:ogc:def:crs:OGC:2:84"),new Je("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Je("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Je("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Yn={};function jl(){Yn={}}function Vl(n){return Yn[n]||Yn[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Ul(n,t){Yn[n]=t}let Qe={};function Zl(){Qe={}}function xi(n,t,e){const i=n.getCode(),s=t.getCode();i in Qe||(Qe[i]={}),Qe[i][s]=e}function Kl(n,t){let e;return n in Qe&&t in Qe[n]&&(e=Qe[n][t]),e}function $l(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Bn(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function zs(n,t){const e=Math.cos(t),i=Math.sin(t),s=n[0]*e-n[1]*i,r=n[1]*e+n[0]*i;return n[0]=s,n[1]=r,n}function ql(n,t){return n[0]*=t,n[1]*=t,n}function ho(n,t){if(t.canWrapX()){const e=ot(t.getExtent()),i=co(n,t,e);i&&(n[0]-=i*e)}return n}function co(n,t,e){const i=t.getExtent();let s=0;return t.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(e=e||ot(i),s=Math.floor((n[0]-i[0])/e)),s}const Hl=63710088e-1;function uo(n,t,e){e=e||Hl;const i=kn(n[1]),s=kn(t[1]),r=(s-i)/2,o=kn(t[0]-n[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function fo(...n){console.warn(...n)}let Xs=!0;function Ws(n){Xs=!(n===void 0?!0:n)}function jn(n,t){if(t!==void 0){for(let e=0,i=n.length;e<i;++e)t[e]=n[e];t=t}else t=n.slice();return t}function Ys(n,t){if(t!==void 0&&n!==t){for(let e=0,i=n.length;e<i;++e)t[e]=n[e];n=t}return n}function go(n){Ul(n.getCode(),n),xi(n,n,jn)}function _o(n){n.forEach(go)}function yt(n){return typeof n=="string"?Vl(n):n||null}function Bs(n,t,e,i){n=yt(n);let s;const r=n.getPointResolutionFunc();if(r){if(s=r(t,e),i&&i!==n.getUnits()){const o=n.getMetersPerUnit();o&&(s=s*o/pi[i])}}else{const o=n.getUnits();if(o=="degrees"&&!i||i=="degrees")s=t;else{const a=wi(n,yt("EPSG:4326"));if(a===Ys&&o!=="degrees")s=t*n.getMetersPerUnit();else{let h=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];h=a(h,h,2);const c=uo(h.slice(0,2),h.slice(2,4)),u=uo(h.slice(4,6),h.slice(6,8));s=(c+u)/2}const l=i?pi[i]:n.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function js(n){_o(n),n.forEach(function(t){n.forEach(function(e){t!==e&&xi(t,e,jn)})})}function mo(n,t,e,i){n.forEach(function(s){t.forEach(function(r){xi(s,r,e),xi(r,s,i)})})}function Jl(){jl(),Zl()}function Vn(n,t){return n?typeof n=="string"?yt(n):n:yt(t)}function Vs(n){return function(t,e,i){const s=t.length;i=i!==void 0?i:2,e=e!==void 0?e:new Array(s);for(let r=0;r<s;r+=i){const o=n(t.slice(r,r+i)),a=o.length;for(let l=0,h=i;l<h;++l)e[r+l]=l>=a?t[r+l]:o[l]}return e}}function Ql(n,t,e,i){const s=yt(n),r=yt(t);xi(s,r,Vs(e)),xi(r,s,Vs(i))}function po(n,t){return Ws(),vi(n,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function yo(n,t){const e=vi(n,t!==void 0?t:"EPSG:3857","EPSG:4326"),i=e[0];return(i<-180||i>180)&&(e[0]=He(i+180,360)-180),e}function ti(n,t){if(n===t)return!0;const e=n.getUnits()===t.getUnits();return(n.getCode()===t.getCode()||wi(n,t)===jn)&&e}function wi(n,t){const e=n.getCode(),i=t.getCode();let s=Kl(e,i);return s||(s=Ys),s}function Ci(n,t){const e=yt(n),i=yt(t);return wi(e,i)}function vi(n,t,e){return Ci(t,e)(n,void 0,n.length)}function Us(n,t,e,i){const s=Ci(t,e);return Tl(n,s,void 0,i)}function th(n,t,e){return wi(t,e)(n)}let Lt=null;function Eo(n){Lt=yt(n)}function eh(){Lt=null}function Zs(){return Lt}function ih(){Eo("EPSG:4326")}function Un(n,t){return Lt?vi(n,t,Lt):n}function le(n,t){return Lt?vi(n,Lt,t):(Xs&&!Bn(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Xs=!1,fo("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function Zn(n,t){return Lt?Us(n,t,Lt):n}function Fe(n,t){return Lt?Us(n,Lt,t):n}function xo(n,t){if(!Lt)return n;const e=yt(t).getMetersPerUnit(),i=Lt.getMetersPerUnit();return e&&i?n*e/i:n}function nh(n,t){if(!Lt)return n;const e=yt(t).getMetersPerUnit(),i=Lt.getMetersPerUnit();return e&&i?n*i/e:n}function sh(n,t,e){return function(i){let s,r;if(n.canWrapX()){const o=n.getExtent(),a=ot(o);i=i.slice(0),r=co(i,n,a),r&&(i[0]=i[0]-r*a),i[0]=ut(i[0],o[0],o[2]),i[1]=ut(i[1],o[1],o[3]),s=e(i)}else s=e(i);return r&&t.canWrapX()&&(s[0]+=r*ot(t.getExtent())),s}}function wo(){js(oo),js(lo),mo(lo,oo,Xl,Wl)}wo();const rh=Object.freeze(Object.defineProperty({__proto__:null,METERS_PER_UNIT:pi,Projection:Gs,addCommon:wo,addCoordinateTransforms:Ql,addEquivalentProjections:js,addEquivalentTransforms:mo,addProjection:go,addProjections:_o,clearAllProjections:Jl,clearUserProjection:eh,cloneTransform:jn,createProjection:Vn,createSafeCoordinateTransform:sh,createTransformFromCoordinateTransform:Vs,disableCoordinateWarning:Ws,equivalent:ti,fromLonLat:po,fromUserCoordinate:le,fromUserExtent:Fe,fromUserResolution:nh,get:yt,getPointResolution:Bs,getTransform:Ci,getTransformFromProjections:wi,getUserProjection:Zs,identityTransform:Ys,setUserProjection:Eo,toLonLat:yo,toUserCoordinate:Un,toUserExtent:Zn,toUserResolution:xo,transform:vi,transformExtent:Us,transformWithProjections:th,useGeographic:ih},Symbol.toStringTag,{value:"Module"}));function Co(n,t,e){return function(i,s,r,o,a){if(!i)return;if(!s&&!t)return i;const l=t?0:r[0]*s,h=t?0:r[1]*s,c=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+c,f=n[2]-l/2+c,g=n[1]+h/2+u,_=n[3]-h/2+u;d>f&&(d=(f+d)/2,f=d),g>_&&(g=(_+g)/2,_=g);let m=ut(i[0],d,f),p=ut(i[1],g,_);if(o&&e&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),p+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-_)/y)}return[m,p]}}function oh(n){return n}function Ks(n,t,e,i){const s=ot(t)/e[0],r=Xt(t)/e[1];return i?Math.min(n,Math.max(s,r)):Math.min(n,Math.min(s,r))}function $s(n,t,e){let i=Math.min(n,t);const s=50;return i*=Math.log(1+s*Math.max(0,n/t-1))/s+1,e&&(i=Math.max(i,e),i/=Math.log(1+s*Math.max(0,e/n-1))/s+1),ut(i,e/2,t*2)}function ah(n,t,e,i){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=n[0],h=n[n.length-1],c=e?Ks(l,e,o,i):l;if(a)return t?$s(s,c,h):ut(s,h,c);const u=Math.min(c,s),d=Math.floor(ws(n,u,r));return n[d]>c&&d<n.length-1?n[d+1]:n[d]}}}function lh(n,t,e,i,s,r){return i=i!==void 0?i:!0,e=e!==void 0?e:0,function(o,a,l,h){if(o!==void 0){const c=s?Ks(t,s,l,r):t;if(h)return i?$s(o,c,e):ut(o,e,c);const u=1e-9,d=Math.ceil(Math.log(t/c)/Math.log(n)-u),f=-a*(.5-u)+.5,g=Math.min(c,o),_=Math.floor(Math.log(t/g)/Math.log(n)+f),m=Math.max(d,_),p=t/Math.pow(n,m);return ut(p,e,c)}}}function vo(n,t,e,i,s){return e=e!==void 0?e:!0,function(r,o,a,l){if(r!==void 0){const h=i?Ks(n,i,a,s):n;return!e||!l?ut(r,t,h):$s(r,h,t)}}}function qs(n){if(n!==void 0)return 0}function To(n){if(n!==void 0)return n}function hh(n){const t=2*Math.PI/n;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function ch(n){const t=n===void 0?kn(5):n;return function(e,i){return i||e===void 0?e:Math.abs(e)<=t?0:e}}function Ro(n){return Math.pow(n,3)}function Ti(n){return 1-Ro(1-n)}function uh(n){return 3*n*n-2*n*n*n}function dh(n){return n}function De(n,t,e,i,s,r){r=r||[];let o=0;for(let a=t;a<e;a+=i){const l=n[a],h=n[a+1];r[o++]=s[0]*l+s[2]*h+s[4],r[o++]=s[1]*l+s[3]*h+s[5]}return r&&r.length!=o&&(r.length=o),r}function Io(n,t,e,i,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],c=r[1];let u=0;for(let d=t;d<e;d+=i){const f=n[d]-h,g=n[d+1]-c;o[u++]=h+f*a-g*l,o[u++]=c+f*l+g*a;for(let _=d+2;_<d+i;++_)o[u++]=n[_]}return o&&o.length!=u&&(o.length=u),o}function fh(n,t,e,i,s,r,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=i){const d=n[u]-l,f=n[u+1]-h;a[c++]=l+s*d,a[c++]=h+r*f;for(let g=u+2;g<u+i;++g)a[c++]=n[g]}return a&&a.length!=c&&(a.length=c),a}function gh(n,t,e,i,s,r,o){o=o||[];let a=0;for(let l=t;l<e;l+=i){o[a++]=n[l]+s,o[a++]=n[l+1]+r;for(let h=l+2;h<l+i;++h)o[a++]=n[h]}return o&&o.length!=a&&(o.length=a),o}const So=te();class _h extends Qt{constructor(){super(),this.extent_=Ut(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Or((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return Q()}closestPointXY(t,e,i,s){return Q()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[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 Q()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Ki(e),this.extentRevision_=this.getRevision()}return Cl(this.extent_,t)}rotate(t,e){Q()}scale(t,e,i){Q()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return Q()}getType(){return Q()}applyTransform(t){Q()}intersectsExtent(t){return Q()}translate(t,e){Q()}transform(t,e){const i=yt(t),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),h=i.getWorldExtent(),c=Xt(h)/Xt(l);return me(So,h[0],h[3],c,-c,0,0,0),De(r,0,r.length,a,So,o),Ci(i,e)(r,o,a)}:Ci(i,e);return this.applyTransform(s),this}}class Hs extends _h{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Ss(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return Q()}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=bo(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){Q()}setLayout(t,e,i){let s;if(t)s=bo(t);else{for(let r=0;r<i;++r){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}s=e.length,t=mh(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const s=this.getStride();Io(i,0,i.length,s,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=$e(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();fh(s,0,s.length,r,t,e,i,s),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const s=this.getStride();gh(i,0,i.length,s,t,e,i),this.changed()}}}function mh(n){let t;return n==2?t="XY":n==3?t="XYZ":n==4&&(t="XYZM"),t}function bo(n){let t;return n=="XY"?t=2:n=="XYZ"||n=="XYM"?t=3:n=="XYZM"&&(t=4),t}function ph(n,t,e){const i=n.getFlatCoordinates();if(!i)return null;const s=n.getStride();return De(i,0,i.length,s,t,e)}function Lo(n,t,e,i,s,r,o){const a=n[t],l=n[t+1],h=n[e]-a,c=n[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((s-a)*h+(r-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let f=0;f<i;++f)o[f]=Zt(n[t+f],n[e+f],d);o.length=i;return}else u=t}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function Mo(n,t,e,i,s){let r=n[t],o=n[t+1];for(t+=i;t<e;t+=i){const a=n[t],l=n[t+1],h=mi(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function yh(n,t,e,i,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=Mo(n,t,a,i,s),t=a}return s}function Ao(n,t,e,i,s,r,o,a,l,h,c){if(t==e)return h;let u,d;if(s===0){if(d=mi(o,a,n[t],n[t+1]),d<h){for(u=0;u<i;++u)l[u]=n[t+u];return l.length=i,d}return h}c=c||[NaN,NaN];let f=t+i;for(;f<e;)if(Lo(n,f-i,f,i,o,a,c),d=mi(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i,f+=i}else f+=i*Math.max((Math.sqrt(d)-Math.sqrt(h))/s|0,1);if(r&&(Lo(n,e-i,t,i,o,a,c),d=mi(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<i;++u)l[u]=c[u];l.length=i}return h}function Eh(n,t,e,i,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const f=e[u];h=Ao(n,t,f,i,s,r,o,a,l,h,c),t=f}return h}function xh(n,t,e,i){for(let s=0,r=e.length;s<r;++s)n[t++]=e[s];return t}function Po(n,t,e,i){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0;a<i;++a)n[t++]=o[a]}return t}function wh(n,t,e,i,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=Po(n,t,e[o],i);s[r++]=l,t=l}return s.length=r,s}function Js(n,t,e,i,s,r,o){const a=(e-t)/i;if(a<3){for(;t<e;t+=i)r[o++]=n[t],r[o++]=n[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-i];let c=0;for(;h.length>0;){const u=h.pop(),d=h.pop();let f=0;const g=n[d],_=n[d+1],m=n[u],p=n[u+1];for(let y=d+i;y<u;y+=i){const w=n[y],C=n[y+1],v=Ll(w,C,g,_,m,p);v>f&&(c=y,f=v)}f>s&&(l[(c-t)/i]=1,d+i<c&&h.push(d,c),c+i<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(r[o++]=n[t+u*i],r[o++]=n[t+u*i+1]);return o}function Ch(n,t,e,i,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=Js(n,t,c,i,s,r,o),a.push(o),t=c}return o}function ei(n,t){return t*Math.round(n/t)}function vh(n,t,e,i,s,r,o){if(t==e)return o;let a=ei(n[t],s),l=ei(n[t+1],s);t+=i,r[o++]=a,r[o++]=l;let h,c;do if(h=ei(n[t],s),c=ei(n[t+1],s),t+=i,t==e)return r[o++]=h,r[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=ei(n[t],s),d=ei(n[t+1],s);if(t+=i,u==h&&d==c)continue;const f=h-a,g=c-l,_=u-a,m=d-l;if(f*m==g*_&&(f<0&&_<f||f==_||f>0&&_>f)&&(g<0&&m<g||g==m||g>0&&m>g)){h=u,c=d;continue}r[o++]=h,r[o++]=c,a=h,l=c,h=u,c=d}return r[o++]=h,r[o++]=c,o}function Oo(n,t,e,i,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=vh(n,t,c,i,s,r,o),a.push(o),t=c}return o}function Ri(n,t,e,i,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<e;o+=i)s[r++]=n.slice(o,o+i);return s.length=r,s}function Kn(n,t,e,i,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=Ri(n,t,l,i,s[r]),t=l}return s.length=r,s}function Fo(n,t,e,i,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=l.length===1&&l[0]===t?[]:Kn(n,t,l,i,s[r]),t=l[l.length-1]}return s.length=r,s}function Do(n,t,e,i){let s=0,r=n[e-i],o=n[e-i+1];for(;t<e;t+=i){const a=n[t],l=n[t+1];s+=o*a-r*l,r=a,o=l}return s/2}function Th(n,t,e,i){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=Do(n,t,a,i),t=a}return s}class nn extends Hs{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 nn(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,s){return s<jr(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Mo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,s))}getArea(){return Do(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Ri(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Js(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new nn(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Po(this.flatCoordinates,0,t,this.stride),this.changed()}}class $n extends Hs{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new $n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,s){const r=this.flatCoordinates,o=mi(t,e,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)i[l]=r[l];return i.length=a,o}return s}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return Ur(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return Vr(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=xh(this.flatCoordinates,0,t,this.stride),this.changed()}}const Rh=Object.freeze(Object.defineProperty({__proto__:null,default:$n},Symbol.toStringTag,{value:"Module"}));function Ih(n,t,e,i,s){return!Kr(s,function(o){return!ii(n,t,e,i,o[0],o[1])})}function ii(n,t,e,i,s,r){let o=0,a=n[e-i],l=n[e-i+1];for(;t<e;t+=i){const h=n[t],c=n[t+1];l<=r?c>r&&(h-a)*(r-l)-(s-a)*(c-l)>0&&o++:c<=r&&(h-a)*(r-l)-(s-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function ko(n,t,e,i,s,r){if(e.length===0||!ii(n,t,e[0],i,s,r))return!1;for(let o=1,a=e.length;o<a;++o)if(ii(n,e[o-1],e[o],i,s,r))return!1;return!0}function Qs(n,t,e,i,s,r,o){let a,l,h,c,u,d,f;const g=s[r+1],_=[];for(let y=0,w=e.length;y<w;++y){const C=e[y];for(c=n[C-i],d=n[C-i+1],a=t;a<C;a+=i)u=n[a],f=n[a+1],(g<=d&&f<=g||d<=g&&g<=f)&&(h=(g-d)/(f-d)*(u-c)+c,_.push(h)),c=u,d=f}let m=NaN,p=-1/0;for(_.sort(Ae),c=_[0],a=1,l=_.length;a<l;++a){u=_[a];const y=Math.abs(u-c);y>p&&(h=(c+u)/2,ko(n,t,e,i,h,g)&&(m=h,p=y)),c=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,g,p),o):[m,g,p]}function Sh(n,t,e,i,s){let r=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];r=Qs(n,t,l,i,s,2*o,r),t=l[l.length-1]}return r}function bh(n,t,e,i,s){let r;for(t+=i;t<e;t+=i)if(r=s(n.slice(t-i,t),n.slice(t,t+i)),r)return r;return!1}function No(n,t,e,i,s){const r=Zr(Ut(),n,t,e,i);return Ot(s,r)?Ke(s,r)||r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:bh(n,t,e,i,function(o,a){return vl(s,o,a)}):!1}function Go(n,t,e,i,s){return!!(No(n,t,e,i,s)||ii(n,t,e,i,s[0],s[1])||ii(n,t,e,i,s[0],s[3])||ii(n,t,e,i,s[2],s[1])||ii(n,t,e,i,s[2],s[3]))}function Lh(n,t,e,i,s){if(!Go(n,t,e[0],i,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r<o;++r)if(Ih(n,e[r-1],e[r],i,s)&&!No(n,e[r-1],e[r],i,s))return!1;return!0}function Mh(n,t,e,i){for(;t<e-i;){for(let s=0;s<i;++s){const r=n[t+s];n[t+s]=n[e-i+s],n[e-i+s]=r}t+=i,e-=i}}function tr(n,t,e,i){let s=0,r=n[e-i],o=n[e-i+1];for(;t<e;t+=i){const a=n[t],l=n[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function Ah(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=tr(n,t,a,i);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;t=a}return!0}function zo(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=tr(n,t,a,i);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&Mh(n,t,a,i),t=a}return t}function Ph(n,t){const e=[];let i=0,s=0,r;for(let o=0,a=t.length;o<a;++o