ry-vue-mapv3 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +16569 -0
- package/package.json +13 -4
- package/dist/ry-vue-mapV3.js +0 -53503
- package/dist/ry-vue-mapV3.umd.cjs +0 -78
- /package/dist/{ry-vue-mapV3.css → ry-vue-mapv3.css} +0 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(X,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("ry-mapts"),require("vue"),require("element-plus"),require("ol")):typeof define=="function"&&define.amd?define(["exports","ry-mapts","vue","element-plus","ol"],R):(X=typeof globalThis<"u"?globalThis:X||self,R(X.RyVueMapV3={},X.ryMapts,X.Vue,X.ElementPlus))})(this,(function(X,R,c,de){"use strict";var Ih=Object.defineProperty;var bh=(X,R,c)=>R in X?Ih(X,R,{enumerable:!0,configurable:!0,writable:!0,value:c}):X[R]=c;var y=(X,R,c)=>bh(X,typeof R!="symbol"?R+"":R,c);const Jt={install(n){n.directive("lmap",{mounted:(e,t)=>{t.value(e)}}),n.directive("lGeoSvg",{mounted:(e,t)=>{const{geoJSON:i,svgModel:r=new R.SvgModel,isStringConvertGeoJso:s=!0}=t.value;s?e.innerHTML=R.geo2svg(JSON.parse(i),r):e.innerHTML=R.geo2svg(i,r)},update:(e,t)=>{const{geoJSON:i,svgModel:r=new R.SvgModel,isStringConvertGeoJso:s=!0}=t.value;s?e.innerHTML=R.geo2svg(JSON.parse(i),r):e.innerHTML=R.geo2svg(i,r)}})}};class zs{constructor(){y(this,"switchMapDefaultTypeOrLayer",{type:Array,default:()=>null});y(this,"height",{type:Number,default:40});y(this,"isSwitchMapRight",{type:Boolean,default:!0});y(this,"bottomRight",{type:Boolean,default:!0});y(this,"isDisabled",{type:Boolean,default:!1});y(this,"mapTypeAndLayer",{type:Array,default:()=>[{id:0,icon:"el-icon--tianditu",activeIcon:"el-icon--tianditu-copy",name:"天地图",layer:[{id:0,name:"地图"},{id:1,name:"卫星"},{id:2,name:"卫星组合"}]},{id:1,icon:"el-icon--gaode",activeIcon:"el-icon--gaode-copy",name:"高德地图",layer:[{id:0,name:"地图"},{id:1,name:"卫星"},{id:2,name:"卫星组合"}]},{id:2,icon:"el-icon--Bing",activeIcon:"el-icon--Bing-copy",name:"Bing地图",layer:[{id:1,name:"卫星"},{id:2,name:"卫星组合"}]}]})}}const js={key:0,class:"switch-map"},Zs={key:1,class:"icon"},Xs=["onClick"],Ks=["onClick"],Ys=c.defineComponent({__name:"index",props:{...new zs},emits:["changeSwitchMap"],setup(n,{emit:e}){const t=c.ref(!0),i=c.ref(1),r=c.ref(2),s=c.ref(!0),o=c.ref([]),a=c.ref([]),l=n,h=e;c.onMounted(()=>{m(l.switchMapDefaultTypeOrLayer),l.switchMapDefaultTypeOrLayer||setTimeout(()=>{h("changeSwitchMap",{mapType:1,layerType:2})},100)}),c.watch(()=>l.switchMapDefaultTypeOrLayer,p=>{if(!p)return;const C=u(p);if(!C)return;const T=r.value,L=C||!C?p[0]:1,w=C||C?T:2;setTimeout(()=>{h("changeSwitchMap",{mapType:L,layerType:w})},100)}),c.watch(()=>l.mapTypeAndLayer,p=>{!Array.isArray(p)||!p[1]||p.forEach((C,T)=>{T===1&&!l.switchMapDefaultTypeOrLayer&&(a.value=[C.layer[2]],o.value=[C])})},{immediate:!0});const u=p=>{var v,A,I,x,P,k;const C=[1,2],T=Array.isArray(p),L=C.includes(p.length),w=p[0]>=0&&p[0]<=l.mapTypeAndLayer.length-1,M=p[1]>=0&&p[1]<=((v=l.mapTypeAndLayer[p[0]])==null?void 0:v.layer.length)-1;if(!T||!L)return!1;if(!w||!M){const F=i.value,W=r.value;return o.value=[l.mapTypeAndLayer[F]],a.value=[(A=l.mapTypeAndLayer[F])==null?void 0:A.layer[W]],r.value=(I=a.value[0])==null?void 0:I.id,!1}return w&&!M?(i.value=p[0],o.value=[l.mapTypeAndLayer[p[0]]],0):M&&!w?(a.value=[(x=l.mapTypeAndLayer[p[0]])==null?void 0:x.layer[p[1]]],r.value=a.value[0].id,1):w&&M?(i.value=p[0],o.value=[l.mapTypeAndLayer[p[0]]],a.value=[(P=l.mapTypeAndLayer[p[0]])==null?void 0:P.layer[p[1]]],r.value=(k=a.value[0])==null?void 0:k.id,!0):!1},d=()=>{if(!l.isDisabled){if(t.value=!t.value,t.value){o.value=l.mapTypeAndLayer.filter((p,C)=>i.value===C),s.value||(s.value=!0,a.value=l.mapTypeAndLayer[i.value].layer.filter(p=>r.value===p.id));return}o.value=[...l.mapTypeAndLayer]}},f=()=>{s.value=!s.value;const p=i.value,C=l.mapTypeAndLayer[p].layer;if(s.value){a.value=C.filter(T=>r.value===T.id);return}a.value=[...C]},g=({id:p})=>{if(i.value===p||t.value)return;const C=l.mapTypeAndLayer[p].layer;i.value=p,r.value=C[C.length-1].id,s.value?a.value=C.filter(T=>r.value===T.id):a.value=C,h("changeSwitchMap",{mapType:i.value,layerType:r.value,isDisabled:!1})},E=({id:p})=>{r.value===p||s.value||(r.value=p,h("changeSwitchMap",{mapType:i.value,layerType:r.value}))},m=p=>{if(!p)return;const C=u(p);if(!C)return;const T=r.value,L=C||!C?p[0]:1,w=C||C?T:2;setTimeout(()=>{h("changeSwitchMap",{mapType:L,layerType:w})},100)};return(p,C)=>{const T=c.resolveComponent("ArrowLeft"),L=c.resolveComponent("ArrowRight"),w=c.resolveComponent("el-icon"),M=c.resolveComponent("ArrowDown"),v=c.resolveComponent("ArrowUp");return p.mapTypeAndLayer&&p.mapTypeAndLayer.length>0?(c.openBlock(),c.createElementBlock("div",js,[c.createElementVNode("div",{class:"top",style:c.normalizeStyle({height:p.height+"px"})},[p.isDisabled?(c.openBlock(),c.createElementBlock("p",Zs)):(c.openBlock(),c.createBlock(w,{key:0,class:"icon",onClick:d},{default:c.withCtx(()=>[c.withDirectives(c.createVNode(T,null,null,512),[[c.vShow,p.bottomRight&&t.value]]),c.withDirectives(c.createVNode(L,null,null,512),[[c.vShow,p.bottomRight&&!t.value]])]),_:1})),c.createElementVNode("ul",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,(A,I)=>(c.openBlock(),c.createElementBlock("li",{key:I,onClick:x=>g(A),class:c.normalizeClass({color:t.value?!0:i.value===A.id})},[c.createElementVNode("i",{class:c.normalizeClass(t.value||i.value===A.id?A.activeIcon:A.icon)},null,2),c.createTextVNode(" "+c.toDisplayString(A.name),1)],10,Xs))),128))])],4),c.createElementVNode("ul",{class:c.normalizeClass({bottom:!0,marginLeft:p.bottomRight})},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(a.value,(A,I)=>(c.openBlock(),c.createElementBlock("li",{key:I,class:c.normalizeClass({color:s.value?!0:r.value===A.id}),style:c.normalizeStyle({height:p.height+"px"})},[c.createElementVNode("span",{onClick:x=>E(A)},c.toDisplayString(A.name),9,Ks),c.withDirectives(c.createVNode(w,{class:"icon",onClick:f},{default:c.withCtx(()=>[c.withDirectives(c.createVNode(M,null,null,512),[[c.vShow,s.value]]),c.withDirectives(c.createVNode(v,null,null,512),[[c.vShow,!s.value]])]),_:1},512),[[c.vShow,I===0]])],6))),128))],2)])):c.createCommentVNode("",!0)}}}),Qt=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},$s=Qt(Ys,[["__scopeId","data-v-249d256e"]]);class Ji{constructor(){y(this,"lMap",{type:Object,default:()=>null});y(this,"isHideAreaAndKM",{type:Boolean,default:!1});y(this,"switchMapPosTop",{type:Number,default:50});y(this,"switchMapPosLeftOrRight",{type:Number,default:20});y(this,"isSwitchMapRight",{type:Boolean,default:!0});y(this,"switchMapHeight",{type:Number,default:40});y(this,"isShowRangingTool",{type:Boolean,default:!0});y(this,"isShowDrawTool",{type:Boolean,default:!1});y(this,"isRight",{type:Boolean,default:!0});y(this,"isCrossHair",{type:Boolean,default:!1});y(this,"isCrossHairCreateDarw",{type:Boolean,default:!1});y(this,"initModifyPolygon",{type:[String,Object],default:()=>null});y(this,"hideAdd",{type:Boolean,default:!1});y(this,"hidePoint",{type:Boolean,default:!1});y(this,"hideCancel",{type:Boolean,default:!1});y(this,"hideDelete",{type:Boolean,default:!1});y(this,"hideSave",{type:Boolean,default:!1});y(this,"hideLine",{type:Boolean,default:!1});y(this,"hideArea",{type:Boolean,default:!1});y(this,"isSwitchMap",{type:Boolean,default:!0});y(this,"gpsType",{type:Number,default:0});y(this,"drawZIndex",{type:Number,default:1})}}function Hs(n){let e=null,t=null,i=-1,r=null,s=0,o=0;function a(v,A){e=v,r=A}function l(){if(!e||!n.initModifyPolygon||!n.isShowDrawTool)return;const{coordinates:v,bbox:A}=h();if(d(),t=e.onCreatePolygon(()=>{},n.isHideAreaAndKM),i=n.gpsType,t.type=n.gpsType,t.initCoordinates(v),r("loadDrawPolygonEvent"),A){const I=[A[0],A[3],A[2],A[1]],x=[A[2],A[1],A[0],A[3]];e.fit([I,x])}}c.watch(()=>n.initModifyPolygon,()=>l()),c.watch(()=>n.gpsType,v=>{i!=v&&(i=v,t&&(t.type=v),w(v))});function h(){let v=null;if(n.initModifyPolygon instanceof Object)v=n.initModifyPolygon;else if(typeof n.initModifyPolygon=="string")v=JSON.parse(n.initModifyPolygon);else return v;const{geometry:A,bbox:I}=v;return{coordinates:A.coordinates,bbox:I}}function u(){e&&(t=e.onCreatePolygon(()=>{},n.isHideAreaAndKM),i=n.gpsType,t.type=n.gpsType,r("loadDrawPolygonEvent",M))}function d(){e&&t&&(e.onDelete(()=>{}),t=null)}function f(){if(t){const v=e.getCenter();if(s==v[0]&&o==v[1])return;s=v[0],o=v[1];let A=v;if(n.gpsType){const{lon:I,lat:x}=R.GPS.gcj_decrypt(v[0],v[1]);A=[I,x]}t.setCoordinates(A,n.gpsType),r("crossHairClick",{pointArr:v,delete:d});return}g(null,0)}function g(v,A=0){r("error",{geoJson:v,delete:d,type:A,mu:(t==null?void 0:t.getAreaMu(!1))??0})}function E(){const v=e.getPolygonGeoJson();if(!v){g(v);return}if(!e.isTruePolygon){g(v,1);return}v&&r("success",{geoJson:v,mu:t.getAreaMu(!1),delete:d})}function m(){if(!t&&n.isCrossHairCreateDarw&&u(),t){const v=e.getCenter();if(s==v[0]&&o==v[1])return;s=v[0],o=v[1];let A=v;if(n.gpsType){const{lon:I,lat:x}=R.GPS.gcj_decrypt(v[0],v[1]);A=[I,x]}t.setCoordinates(A,n.gpsType),r("crossHairClick",{pointArr:v,delete:d});return}g(null,0)}function p(){return e?e.getPolygonGeoJson():null}function C(){if(!e)return null;e.onCancel()}function T(){const v=e.onCreateLine(({id:A,type:I})=>{r("drawLineEvent",{draw:v,id:A,type:I})});v.Id=R.generateGuid()}function L(){const v=e.onCreateArea(({id:A,type:I})=>{r("drawPolygonEvent",{draw:v,id:A,type:I})});v.Id=R.generateGuid()}function w(v){e.removeDrawArr(),t&&t.selectGPS(v,!0)}c.onMounted(()=>{l()});const M={init:a,onPointEvent:f,onSave:E,onDelete:d,onClick:m,getGeoJson:p,onCancel:C,onCreateLine:T,onCreateArea:L,selectGPSAll:w,onCreatePolygon:u};return{...M}}class Us{constructor(){y(this,"map",{type:Object,default:()=>null});y(this,"isHide",{type:Boolean,default:!0})}}const Ws=c.defineComponent({__name:"index",props:{...new Us},emits:["click"],setup(n,{emit:e}){let t=null;const i=e;n.isHide&&!t&&r();function r(){t=new R.CrossHair(()=>{i("click",o())}),n.map&&n.map.addControl(t)}function s(){!n.map||!t||(n.map.removeControl(t),t=null)}function o(){if(n.map)return;const a=n.map.getView();let[l,h]=a.getCenter();return[l,h]}return c.watch(()=>n.isHide,a=>{if(a&&!t){r();return}s()}),(a,l)=>null}}),qs={class:"draw-tool-box"},Js={key:0,class:"map-button-box"},Qs={key:1,class:"map-control",style:{"margin-left":"60px"}},eo={key:0,class:"map-control",style:{"margin-right":"60px"}},to={key:1,class:"map-button-box"},no=c.defineComponent({__name:"index",props:{...new Ji},emits:["loadDrawPolygonEvent","crossHairClick","success","error","drawLineEvent","drawPolygonEvent"],setup(n,{emit:e}){const t=n,{init:i,onPointEvent:r,onSave:s,onClick:o,onCreateLine:a,onCreateArea:l,onCreatePolygon:h,onDelete:u}=Hs(t),d=e;return i(t.lMap,d),(f,g)=>(c.openBlock(),c.createElementBlock("div",qs,[f.isRight?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[f.isShowRangingTool?(c.openBlock(),c.createElementBlock("aside",eo,[f.hideLine?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:0,class:"ele-text-primary el-icon--changdu",onClick:g[7]||(g[7]=c.withModifiers(E=>c.unref(a)(),["stop"]))})),f.hideArea?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:1,class:"ele-text-primary el-icon--mianji",onClick:g[8]||(g[8]=c.withModifiers(E=>c.unref(l)(),["stop"]))})),c.renderSlot(f.$slots,"default",{},void 0,!0)])):c.createCommentVNode("",!0),f.isShowDrawTool?(c.openBlock(),c.createElementBlock("aside",to,[f.hideAdd?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:0,class:"ele-text-primary el-icon--add",onClick:g[9]||(g[9]=c.withModifiers(E=>c.unref(h)(),["stop"]))})),f.hidePoint?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:1,class:"ele-text-primary el-icon--dadian",onClick:g[10]||(g[10]=c.withModifiers(E=>c.unref(r)(),["stop"]))})),f.hideCancel?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:2,class:"ele-text-primary el-icon--back",onClick:g[11]||(g[11]=c.withModifiers(E=>f.lMap.onCancel(),["stop"]))})),f.hideDelete?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:3,class:"ele-text-primary el-icon--ashbin",onClick:g[12]||(g[12]=c.withModifiers(E=>c.unref(u)(),["stop"]))})),f.hideSave?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:4,class:"ele-text-primary el-icon--duihao",onClick:g[13]||(g[13]=c.withModifiers(E=>c.unref(s)(),["stop"]))})),c.renderSlot(f.$slots,"default",{},void 0,!0)])):c.createCommentVNode("",!0)],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[f.isShowDrawTool?(c.openBlock(),c.createElementBlock("aside",Js,[f.hideAdd?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:0,class:"ele-text-primary el-icon--add",onClick:g[0]||(g[0]=c.withModifiers(E=>c.unref(h)(),["stop"]))})),f.hidePoint?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:1,class:"ele-text-primary el-icon--dadian",onClick:g[1]||(g[1]=c.withModifiers(E=>c.unref(r)(),["stop"]))})),f.hideCancel?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:2,class:"ele-text-primary el-icon--back",onClick:g[2]||(g[2]=c.withModifiers(E=>f.lMap.onCancel(),["stop"]))})),f.hideDelete?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:3,class:"ele-text-primary el-icon--ashbin",onClick:g[3]||(g[3]=c.withModifiers(E=>c.unref(u)(),["stop"]))})),f.hideSave?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:4,class:"ele-text-primary el-icon--duihao",onClick:g[4]||(g[4]=c.withModifiers(E=>c.unref(s)(),["stop"]))})),c.renderSlot(f.$slots,"default",{},void 0,!0)])):c.createCommentVNode("",!0),f.isShowRangingTool?(c.openBlock(),c.createElementBlock("aside",Qs,[f.hideLine?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:0,class:"ele-text-primary el-icon--changdu",onClick:g[5]||(g[5]=c.withModifiers(E=>c.unref(a)(),["stop"]))})),f.hideArea?c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(c.unref(de.ElButton),{key:1,class:"ele-text-primary el-icon--mianji",onClick:g[6]||(g[6]=c.withModifiers(E=>c.unref(l)(),["stop"]))})),c.renderSlot(f.$slots,"default",{},void 0,!0)])):c.createCommentVNode("",!0)],64)),f.lMap?(c.openBlock(),c.createBlock(Ws,{key:2,isHide:f.isCrossHair,map:f.lMap.map,onClick:g[14]||(g[14]=E=>c.unref(o)(E))},null,8,["isHide","map"])):c.createCommentVNode("",!0)]))}}),io=Qt(no,[["__scopeId","data-v-dfd4cfff"]]),At={PROPERTYCHANGE:"propertychange"},j={CHANGE:"change",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Xn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Qi(n,e){return n>e?1:n<e?-1:0}function er(n,e,t){if(n[0]<=e)return 0;const i=n.length;if(e<=n[i-1])return i-1;if(typeof t=="function"){for(let r=1;r<i;++r){const s=n[r];if(s===e)return r;if(s<e)return t(e,n[r-1],s)>0?r-1:r}return i-1}if(t>0){for(let r=1;r<i;++r)if(n[r]<e)return r-1;return i-1}if(t<0){for(let r=1;r<i;++r)if(n[r]<=e)return r;return i-1}for(let r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return n[r-1]-e<e-n[r]?r-1:r}return i-1}function ro(n,e){const t=Array.isArray(e)?e:[e],i=t.length;for(let r=0;r<i;r++)n[n.length]=t[r]}function Kn(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function en(){return!0}function tn(){return!1}function nn(){}function so(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!Kn(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function oo(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}function rn(n){for(const e in n)delete n[e]}function tr(n){let e;for(e in n)return!1;return!e}class Ve{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Yn extends Xn{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){const t=typeof e=="string",i=t?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=t?new Ve(e):e;s.target||(s.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,u=r.length;h<u;++h)if("handleEvent"in r[h]?l=r[h].handleEvent(s):l=r[h].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let h=a[i];for(delete a[i];h--;)this.removeEventListener(i,nn);delete o[i]}return l}disposeInternal(){this.listeners_&&rn(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const r=i.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=nn,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}function H(n,e,t,i,r){if(r){const o=t;t=function(a){return n.removeEventListener(e,t),o.call(i??this,a)}}else i&&i!==n&&(t=t.bind(i));const s={target:n,type:e,listener:t};return n.addEventListener(e,t),s}function nr(n,e,t,i){return H(n,e,t,i,!0)}function ne(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),rn(n))}class ao extends Yn{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(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=H(this,e[s],t);return r}return H(this,e,t)}onceInternal(e,t){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=nr(this,e[s],t)}else i=nr(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)lo(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}}function lo(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)ne(n[e]);else ne(n)}function U(){throw new Error("Unimplemented abstract method.")}let co=0;function Je(n){return n.ol_uid||(n.ol_uid=String(++co))}class ir extends Ve{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class xe extends ao{constructor(e){super(),this.on,this.once,this.un,Je(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}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(e,t){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new ir(i,e,t)),i=At.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new ir(i,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,i){const r=this.values_||(this.values_={});if(i)r[e]=t;else{const s=r[e];r[e]=t,s!==t&&this.notify(e,s)}}setProperties(e,t){for(const i in e)this.set(i,e[i],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],tr(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}function ie(n,e){if(!n)throw new Error(e)}function re(n,e,t){return Math.min(Math.max(n,e),t)}function ho(n,e,t,i,r,s){const o=r-t,a=s-i;if(o!==0||a!==0){const l=((n-t)*o+(e-i)*a)/(o*o+a*a);l>1?(t=r,i=s):l>0&&(t+=o*l,i+=a*l)}return Qe(n,e,t,i)}function Qe(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function rr(n){return n*180/Math.PI}function Rt(n){return n*Math.PI/180}function sr(n,e){const t=n%e;return t*e<0?t+e:t}function uo(n,e,t){return n+t*(e-n)}function fo(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function $n(n,e,t){if(n>=e&&n<t)return n;const i=t-e;return((n-e)%i+i)%i+e}const $={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 or extends xe{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const t=Object.assign({},e);typeof e.properties=="object"&&(delete t.properties,Object.assign(t,e.properties)),t[$.OPACITY]=e.opacity!==void 0?e.opacity:1,ie(typeof t[$.OPACITY]=="number","Layer opacity must be a number"),t[$.VISIBLE]=e.visible!==void 0?e.visible:!0,t[$.Z_INDEX]=e.zIndex,t[$.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[$.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[$.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[$.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return t.opacity=re(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=i===void 0&&!t.managed?1/0:i,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return U()}getLayerStatesArray(e){return U()}getExtent(){return this.get($.EXTENT)}getMaxResolution(){return this.get($.MAX_RESOLUTION)}getMinResolution(){return this.get($.MIN_RESOLUTION)}getMinZoom(){return this.get($.MIN_ZOOM)}getMaxZoom(){return this.get($.MAX_ZOOM)}getOpacity(){return this.get($.OPACITY)}getSourceState(){return U()}getVisible(){return this.get($.VISIBLE)}getZIndex(){return this.get($.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set($.EXTENT,e)}setMaxResolution(e){this.set($.MAX_RESOLUTION,e)}setMinResolution(e){this.set($.MIN_RESOLUTION,e)}setMaxZoom(e){this.set($.MAX_ZOOM,e)}setMinZoom(e){this.set($.MIN_ZOOM,e)}setOpacity(e){ie(typeof e=="number","Layer opacity must be a number"),this.set($.OPACITY,e)}setVisible(e){this.set($.VISIBLE,e)}setZIndex(e){this.set($.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}function go(n){let e=null;c.watch(()=>n.center,s=>{console.log("val===",s)},{deep:!0});function t(){return{projection:n.projection,center:n.center,zoom:n.zoom,minZoom:n.minZoom,maxZoom:n.maxZoom}}function i(s){!s.length||!e||R.fitNew(e,[s],{})}function r(s,o,a){o.DrawZIndex=n.drawZIndex,o.init({el:s,type:n.mapType,layerType:n.layerType,viewOptions:t(),callback:(l,h)=>{e=l,i(n.bbox),a({map:e,mapServices:o,layers:h})}})}return{initMap:r}}function mo(n){let e=null,t=null;function i(h,u){e=u,t=h}c.watch(()=>n.center,h=>{h.length&&l(h)}),c.watch(()=>n.bbox,h=>{h.length&&r(h)}),c.watch(()=>n.zoom,h=>{a(h)}),c.watch(()=>n.maxZoom,h=>{s(h)}),c.watch(()=>n.minZoom,h=>{o(h)});function r(h){!h.length||!t||R.fitNew(t,[h],{})}function s(h){e.setMaxZoom(h)}function o(h){e.setMinZoom(h)}function a(h){e.setZoom(h)}function l(h){e.setCenter(h,15)}return{init:i}}function po(n){let e=null,t=null,i=null,r=0,s=0,o=0,a=null;function l(A,I,x){e=I,t=A,i=x}function h(A){o=A}c.watch(()=>n.bindMapClick,A=>{g(A)}),c.watch(()=>n.bindMapMoveend,A=>{E(A)}),c.watch(()=>n.bindContextmenu,A=>{C(A)}),c.watch(()=>n.binddblClick,A=>{L(A)}),c.watch(()=>n.resolution,A=>{v(A)});function u(A){if(A.dragging)return;const I=t.getEventPixel(A.originalEvent);return t.hasFeatureAtPixel(I)}function d(A,I="doubleClickEvent"){if(u(A)){const k=t.forEachFeatureAtPixel(A.pixel,F=>F).getId();if(k===void 0)return;i(I,k)}A.preventDefault()}function f(A){if(u(A)){const x=t.forEachFeatureAtPixel(A.pixel,k=>k);i("mapClick2",x);const P=x.getId();if(P===void 0)return;i("mapClick",P)}}function g(A=!1){if(A){t.on("singleclick",f);return}t.un("singleclick",f)}function E(A=!1){if(A){t.on("moveend",m);return}t.un("moveend",m)}function m(A){const[I,x]=e.getCenter();let P=0;if(r!==I&&s!==x){P=R.caculateLL(s,r,x,I),i("mapMoveend",{m:P,oversteSetValue:P>=n.m,x:I,y:x,e:A}),P>=n.m&&(r=I,s=x);return}i("mapMoveend",{m:P,oversteSetValue:!1,x:I,y:x,e:A})}function p(A){d(A,"contextmenuClick")}function C(A=!1){if(A){t.on("contextmenu",p);return}t.un("contextmenu",p)}function T(A){d(A)}function L(A=!1){if(A){t.on("dblclick",T);return}t.un("dblclick",T)}function w(A,I){A==2||I==0?e.setMaxZoom(28):e.setMaxZoom(18)}function M({mapType:A,layerType:I},x){e.selectMapLayer(A,I),w(A,I);let P=A;if(A>1&&(P=0),o==P)return;o=P,x&&x(o);const k=e.getCenter();if(k&&k.length)if(P==0){const{lon:F,lat:W}=R.GPS.gcj_decrypt(k[0],k[1]);e.setCenter([F,W],0)}else{const{lon:F,lat:W}=R.GPS.gcj_encrypt(k[0],k[1]);e.setCenter([F,W],0)}i("changeSwitchMap",{mapType:P,layerType:I,type:A})}function v(A=!1){const I=t.getView(),x=n.zoomedIn;if(!I)return;let P=I.getZoom()>x;a=()=>{const k=I.getZoom();k>x&&!P?(P=!0,i("resolutionEvent",{zoom:k,status:P})):k<=x&&P&&(P=!1,i("resolutionEvent",{zoom:k,status:P}))},A?I.on("change:resolution",a):I.un("change:resolution",a)}return{init:l,mapClickOnce:g,mapMoveend:E,mapContextmenu:C,dblClick:L,setLastMapType:h,changeSwitch:M,bingResolutionEvent:v}}const me={ADD:"add",REMOVE:"remove"},ar={LENGTH:"length"};class sn extends Ve{constructor(e,t,i){super(e),this.element=t,this.index=i}}class we extends xe{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let i=1,r=this.array_.length;i<r;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,i=e.length;t<i;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)e(t[i],i,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(ar.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new sn(me.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)if(t[i]===e)return this.removeAt(i)}removeAt(e){if(e<0||e>=this.getLength())return;const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new sn(me.REMOVE,t,e)),t}setAt(e,t){const i=this.getLength();if(e>=i){this.insertAt(e,t);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t,e);const r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new sn(me.REMOVE,r,e)),this.dispatchEvent(new sn(me.ADD,t,e))}updateLength_(){this.set(ar.LENGTH,this.array_.length)}assertUnique_(e,t){const i=this.array_;for(let r=0,s=i.length;r<s;++r)if(i[r]===e&&r!==t)throw new Error("Duplicate item added to a unique collection")}}class et extends Ve{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}class ke extends et{constructor(e,t,i,r,s,o){super(e,t,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const J={SINGLECLICK:"singleclick",CLICK:j.CLICK,DBLCLICK:j.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ze=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";ze.includes("safari")&&!ze.includes("chrom")&&(ze.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ze));const yo=ze.includes("webkit")&&!ze.includes("edge"),lr=ze.includes("macintosh"),_o=typeof devicePixelRatio<"u"?devicePixelRatio:1,tt=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,wo=typeof Image<"u"&&Image.prototype.decode,cr=(function(){let n=!1;try{const e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n})(),Hn={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class Eo extends Yn{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=H(i,Hn.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=H(i,Hn.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(j.TOUCHMOVE,this.boundHandleTouchMove_,cr?{passive:!1}:!1)}emulateClick_(e){let t=new ke(J.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new ke(J.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new ke(J.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==J.POINTERUP||t.type==J.POINTERCANCEL){delete this.trackedTouches_[i];for(const r in this.trackedTouches_)if(this.trackedTouches_[r].target!==t.target){delete this.trackedTouches_[r];break}}else(t.type==J.POINTERDOWN||t.type==J.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new ke(J.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(ne),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const t=new ke(J.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(H(i,J.POINTERMOVE,this.handlePointerMove_,this),H(i,J.POINTERUP,this.handlePointerUp_,this),H(this.element_,J.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(H(this.element_.getRootNode(),J.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new ke(J.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new ke(J.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(ne(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(j.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ne(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ne),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Oe={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},le={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Mt={IDLE:0,LOADED:2,ERROR:3,EMPTY:4},on=1/0;class Co{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,rn(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,i=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){ie(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const t=this.priorityFunction_(e);return t!=on?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,i=this.priorities_,r=t.length,s=t[e],o=i[e],a=e;for(;e<r>>1;){const l=this.getLeftChildIndex_(e),h=this.getRightChildIndex_(e),u=h<r&&i[h]<i[l]?h:l;t[e]=t[u],i[e]=i[u],e=u}t[e]=s,i[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const i=this.elements_,r=this.priorities_,s=i[t],o=r[t];for(;t>e;){const a=this.getParentIndex_(t);if(r[a]>o)i[t]=i[a],r[t]=r[a],t=a;else break}i[t]=s,r[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,i=this.priorities_;let r=0;const s=t.length;let o,a,l;for(a=0;a<s;++a)o=t[a],l=e(o),l==on?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}class vo extends Co{constructor(e,t){super(i=>e.apply(null,i),i=>i[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(j.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===Mt.LOADED||i===Mt.ERROR||i===Mt.EMPTY){i!==Mt.ERROR&&t.removeEventListener(j.CHANGE,this.boundHandleTileChange_);const r=t.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let i=0;for(;this.tilesLoading_<e&&i<t&&this.getCount()>0;){const r=this.dequeue()[0],s=r.getKey();r.getState()===Mt.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function Ao(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return on;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}const pe={ANIMATING:0,INTERACTING:1},Ee={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function hr(n,e,t){return(function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const l=e?0:s[0]*r,h=e?0:s[1]*r,u=a?a[0]:0,d=a?a[1]:0;let f=n[0]+l/2+u,g=n[2]-l/2+u,E=n[1]+h/2+d,m=n[3]-h/2+d;f>g&&(f=(g+f)/2,g=f),E>m&&(E=(m+E)/2,m=E);let p=re(i[0],f,g),C=re(i[1],E,m);if(o&&t&&r){const T=30*r;p+=-T*Math.log(1+Math.max(0,f-i[0])/T)+T*Math.log(1+Math.max(0,i[0]-g)/T),C+=-T*Math.log(1+Math.max(0,E-i[1])/T)+T*Math.log(1+Math.max(0,i[1]-m)/T)}return[p,C]})}function Ro(n){return n}const se={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Mo(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function ur(n,e,t){let i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function Po(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function dr(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=se.UNKNOWN;return o<t?l=l|se.LEFT:o>r&&(l=l|se.RIGHT),a<i?l=l|se.BELOW:a>s&&(l=l|se.ABOVE),l===se.UNKNOWN&&(l=se.INTERSECTING),l}function Un(){return[1/0,1/0,-1/0,-1/0]}function Wn(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function an(n){return Wn(1/0,1/0,-1/0,-1/0,n)}function Lo(n,e){const t=n[0],i=n[1];return Wn(t,i,t,i,e)}function To(n,e,t,i,r){const s=an(r);return gr(s,n,e,t,i)}function fr(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function gr(n,e,t,i,r){for(;t<i;t+=r)So(n,e[t],e[t+1]);return n}function So(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function Io(n,e){let t;return t=e(bo(n)),t||(t=e(xo(n)),t)||(t=e(No(n)),t)||(t=e(Do(n)),t)?t:!1}function bo(n){return[n[0],n[1]]}function xo(n){return[n[2],n[1]]}function ln(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function qn(n,e,t,i,r){const[s,o,a,l,h,u,d,f]=ko(n,e,t,i);return Wn(Math.min(s,a,h,d),Math.min(o,l,u,f),Math.max(s,a,h,d),Math.max(o,l,u,f),r)}function ko(n,e,t,i){const r=e*i[0]/2,s=e*i[1]/2,o=Math.cos(t),a=Math.sin(t),l=r*o,h=r*a,u=s*o,d=s*a,f=n[0],g=n[1];return[f-l+d,g-h-u,f-l-d,g-h+u,f+l-d,g+h+u,f+l+d,g+h-u,f-l+d,g-h-u]}function Pt(n){return n[3]-n[1]}function Oo(n,e,t){const i=t||Un();return Jn(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):an(i),i}function Do(n){return[n[0],n[3]]}function No(n){return[n[2],n[3]]}function nt(n){return n[2]-n[0]}function Jn(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Qn(n){return n[2]<n[0]||n[3]<n[1]}function Go(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function Bo(n,e,t){let i=!1;const r=dr(n,e),s=dr(n,t);if(r===se.INTERSECTING||s===se.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],h=n[3],u=e[0],d=e[1],f=t[0],g=t[1],E=(g-d)/(f-u);let m,p;s&se.ABOVE&&!(r&se.ABOVE)&&(m=f-(g-h)/E,i=m>=o&&m<=l),!i&&s&se.RIGHT&&!(r&se.RIGHT)&&(p=g-(f-l)*E,i=p>=a&&p<=h),!i&&s&se.BELOW&&!(r&se.BELOW)&&(m=f-(g-a)/E,i=m>=o&&m<=l),!i&&s&se.LEFT&&!(r&se.LEFT)&&(p=g-(f-o)*E,i=p>=a&&p<=h)}return i}function Fo(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function cn(n,e){let t=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=e[i]){t=!1;break}return t}function ei(n,e){const t=Math.cos(e),i=Math.sin(e),r=n[0]*t-n[1]*i,s=n[1]*t+n[0]*i;return n[0]=r,n[1]=s,n}function Vo(n,e){return n[0]*=e,n[1]*=e,n}function zo(n,e){if(e.canWrapX()){const t=nt(e.getExtent()),i=jo(n,e,t);i&&(n[0]-=i*t)}return n}function jo(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(t=t||nt(i),r=Math.floor((n[0]-i[0])/t)),r}function Zo(n){return Math.pow(n,3)}function it(n){return 1-Zo(1-n)}function Xo(n){return 3*n*n-2*n*n*n}function Ko(n){return n}function mr(...n){console.warn(...n)}const pr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ti{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||pr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Lt=6378137,rt=Math.PI*Lt,Yo=[-rt,-rt,rt,rt],$o=[-180,-85,180,85],hn=Lt*Math.log(Math.tan(Math.PI/2));class st extends ti{constructor(e){super({code:e,units:"m",extent:Yo,global:!0,worldExtent:$o,getPointResolution:function(t,i){return t/Math.cosh(i[1]/Lt)}})}}const yr=[new st("EPSG:3857"),new st("EPSG:102100"),new st("EPSG:102113"),new st("EPSG:900913"),new st("http://www.opengis.net/def/crs/EPSG/0/3857"),new st("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ho(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;s<r;s+=i){e[s]=rt*n[s]/180;let o=Lt*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>hn?o=hn:o<-hn&&(o=-hn),e[s+1]=o}return e}function Uo(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;s<r;s+=i)e[s]=180*n[s]/rt,e[s+1]=360*Math.atan(Math.exp(n[s+1]/Lt))/Math.PI-90;return e}const Wo=6378137,_r=[-180,-90,180,90],qo=Math.PI*Wo/180;class je extends ti{constructor(e,t){super({code:e,units:"degrees",extent:_r,axisOrientation:t,global:!0,metersPerUnit:qo,worldExtent:_r})}}const wr=[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 ni={};function Jo(n){return ni[n]||ni[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Qo(n,e){ni[n]=e}let ot={};function Tt(n,e,t){const i=n.getCode(),r=e.getCode();i in ot||(ot[i]={}),ot[i][r]=t}function ii(n,e){return n in ot&&e in ot[n]?ot[n][e]:null}const un=.9996,ye=.00669438,dn=ye*ye,fn=dn*ye,Ze=ye/(1-ye),Er=Math.sqrt(1-ye),at=(1-Er)/(1+Er),Cr=at*at,ri=Cr*at,si=ri*at,vr=si*at,Ar=1-ye/4-3*dn/64-5*fn/256,ea=3*ye/8+3*dn/32+45*fn/1024,ta=15*dn/256+45*fn/1024,na=35*fn/3072,ia=3/2*at-27/32*ri+269/512*vr,ra=21/16*Cr-55/32*si,sa=151/96*ri-417/128*vr,oa=1097/512*si,gn=6378137;function aa(n,e,t){const i=n-5e5,o=(t.north?e:e-1e7)/un/(gn*Ar),a=o+ia*Math.sin(2*o)+ra*Math.sin(4*o)+sa*Math.sin(6*o)+oa*Math.sin(8*o),l=Math.sin(a),h=l*l,u=Math.cos(a),d=l/u,f=d*d,g=f*f,E=1-ye*h,m=Math.sqrt(1-ye*h),p=gn/m,C=(1-ye)/E,T=Ze*u**2,L=T*T,w=i/(p*un),M=w*w,v=M*w,A=v*w,I=A*w,x=I*w,P=a-d/C*(M/2-A/24*(5+3*f+10*T-4*L-9*Ze))+x/720*(61+90*f+298*T+45*g-252*Ze-3*L);let k=(w-v/6*(1+2*f+T)+I/120*(5-2*T+28*f-3*L+8*Ze+24*g))/u;return k=$n(k+Rt(Pr(t.number)),-Math.PI,Math.PI),[rr(k),rr(P)]}const Rr=-80,Mr=84,la=-180,ca=180;function ha(n,e,t){n=$n(n,la,ca),e<Rr?e=Rr:e>Mr&&(e=Mr);const i=Rt(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,h=Rt(n),u=Pr(t.number),d=Rt(u),f=gn/Math.sqrt(1-ye*r**2),g=Ze*s**2,E=s*$n(h-d,-Math.PI,Math.PI),m=E*E,p=m*E,C=p*E,T=C*E,L=T*E,w=gn*(Ar*i-ea*Math.sin(2*i)+ta*Math.sin(4*i)-na*Math.sin(6*i)),M=un*f*(E+p/6*(1-a+g)+T/120*(5-18*a+l+72*g-58*Ze))+5e5;let v=un*(w+f*o*(m/2+C/24*(5-a+9*g+4*g**2)+L/720*(61-58*a+l+600*g-330*Ze)));return t.north||(v+=1e7),[M,v]}function Pr(n){return(n-1)*6-180+3}const ua=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Lr(n){let e=0;for(const r of ua){const s=n.match(r);if(s){e=parseInt(s[1]);break}}if(!e)return null;let t=0,i=!1;return e>32700&&e<32761?t=e-32700:e>32600&&e<32661&&(i=!0,t=e-32600),t?{number:t,north:i}:null}function Tr(n,e){return function(t,i,r,s){const o=t.length;r=r>1?r:2,s=s??r,i||(r>2?i=t.slice():i=new Array(o));for(let a=0;a<o;a+=s){const l=t[a],h=t[a+1],u=n(l,h,e);i[a]=u[0],i[a+1]=u[1]}return i}}function da(n){return Lr(n)?new ti({code:n,units:"m"}):null}function fa(n){const e=Lr(n.getCode());return e?{forward:Tr(ha,e),inverse:Tr(aa,e)}:null}const ga=[fa],ma=[da];let oi=!0;function pa(n){oi=!1}function Sr(n,e){if(e!==void 0){for(let t=0,i=n.length;t<i;++t)e[t]=n[t];e=e}else e=n.slice();return e}function ai(n){Qo(n.getCode(),n),Tt(n,n,Sr)}function ya(n){n.forEach(ai)}function St(n){if(typeof n!="string")return n;const e=Jo(n);if(e)return e;for(const t of ma){const i=t(n);if(i)return i}return null}function Ir(n){ya(n),n.forEach(function(e){n.forEach(function(t){e!==t&&Tt(e,t,Sr)})})}function _a(n,e,t,i){n.forEach(function(r){e.forEach(function(s){Tt(r,s,t),Tt(s,r,i)})})}function li(n,e){return n?typeof n=="string"?St(n):n:St(e)}function wa(n,e){const t=n.getCode(),i=e.getCode();let r=ii(t,i);if(r)return r;let s=null,o=null;for(const l of ga)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=ci(s.inverse,o.forward);else{const l=ii(t,a);l&&(r=ci(l,o.forward))}else{const l=ii(a,i);l&&(r=ci(s.inverse,l))}return r&&(ai(n),ai(e),Tt(n,e,r)),r}function ci(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function br(n,e){const t=St(n),i=St(e);return wa(t,i)}function hi(n,e){return n}function Le(n,e){return oi&&!cn(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(oi=!1,mr("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Ea(n,e){return n}function mn(n,e){return n}function Ca(){Ir(yr),Ir(wr),_a(wr,yr,Ho,Uo)}Ca(),new Array(6);function ui(){return[1,0,0,1,0,0]}function xr(n,e){const t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function kr(n,e,t,i,r,s,o,a){const l=Math.sin(s),h=Math.cos(s);return n[0]=i*h,n[1]=r*l,n[2]=-i*l,n[3]=r*h,n[4]=o*i*h-a*i*l+e,n[5]=o*r*l+a*r*h+t,n}function va(n,e){const t=Aa(e);ie(t!==0,"Transformation matrix cannot be inverted");const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*l-o*a)/t,n[5]=-(i*l-r*a)/t,n}function Aa(n){return n[0]*n[3]-n[1]*n[2]}function Ra(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function Ma(n,e,t,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<t;l+=i){const h=n[l],u=n[l+1];s[a++]=r[0]*h+r[2]*u+r[4],s[a++]=r[1]*h+r[3]*u+r[5];for(let d=2;d<o;d++)s[a++]=n[l+d]}return s&&s.length!=a&&(s.length=a),s}function Pa(n,e,t,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),h=s[0],u=s[1];let d=0;for(let f=e;f<t;f+=i){const g=n[f]-h,E=n[f+1]-u;o[d++]=h+g*a-E*l,o[d++]=u+g*l+E*a;for(let m=f+2;m<f+i;++m)o[d++]=n[m]}return o&&o.length!=d&&(o.length=d),o}function La(n,e,t,i,r,s,o,a){a=a||[];const l=o[0],h=o[1];let u=0;for(let d=e;d<t;d+=i){const f=n[d]-l,g=n[d+1]-h;a[u++]=l+r*f,a[u++]=h+s*g;for(let E=d+2;E<d+i;++E)a[u++]=n[E]}return a&&a.length!=u&&(a.length=u),a}function Ta(n,e,t,i,r,s,o){o=o||[];let a=0;for(let l=e;l<t;l+=i){o[a++]=n[l]+r,o[a++]=n[l+1]+s;for(let h=l+2;h<l+i;++h)o[a++]=n[h]}return o&&o.length!=a&&(o.length=a),o}const Or=ui(),Sa=[NaN,NaN];class Ia extends xe{constructor(){super(),this.extent_=Un(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=so((e,t,i)=>{if(!i)return this.getSimplifiedGeometry(t);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return U()}closestPointXY(e,t,i,r){return U()}containsXY(e,t){return this.closestPointXY(e,t,Sa,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return U()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&an(t),this.extentRevision_=this.getRevision()}return Go(this.extent_,e)}rotate(e,t){U()}scale(e,t,i){U()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return U()}getType(){return U()}applyTransform(e){U()}intersectsExtent(e){return U()}translate(e,t){U()}transform(e,t){const i=St(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),h=i.getWorldExtent(),u=Pt(h)/Pt(l);kr(Or,h[0],h[3],u,-u,0,0,0);const d=Ma(s,0,s.length,a,Or,o),f=br(i,t);return f?f(d,d,a):d}:br(i,t);return this.applyTransform(r),this}}class di extends Ia{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return To(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return U()}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(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=Dr(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){U()}setLayout(e,t,i){let r;if(e)r=Dr(e);else{for(let s=0;s<i;++s){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}r=t.length,e=ba(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Pa(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){t===void 0&&(t=e),i||(i=ln(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();La(r,0,r.length,s,e,t,i,r),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Ta(i,0,i.length,r,e,t,i),this.changed()}}}function ba(n){let e;return n==2?e="XY":n==3?e="XYZ":n==4&&(e="XYZM"),e}function Dr(n){let e;return n=="XY"?e=2:n=="XYZ"||n=="XYM"?e=3:n=="XYZM"&&(e=4),e}function Nr(n,e,t,i){let r=0;const s=n[t-i],o=n[t-i+1];let a=0,l=0;for(;e<t;e+=i){const h=n[e]-s,u=n[e+1]-o;r+=l*h-a*u,a=h,l=u}return r/2}function xa(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=Nr(n,e,a,i),e=a}return r}function Gr(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],h=n[t]-a,u=n[t+1]-l;let d;if(h===0&&u===0)d=e;else{const f=((r-a)*h+(s-l)*u)/(h*h+u*u);if(f>1)d=t;else if(f>0){for(let g=0;g<i;++g)o[g]=uo(n[e+g],n[t+g],f);o.length=i;return}else d=e}for(let f=0;f<i;++f)o[f]=n[d+f];o.length=i}function Br(n,e,t,i,r){let s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){const a=n[e],l=n[e+1],h=Qe(s,o,a,l);h>r&&(r=h),s=a,o=l}return r}function ka(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Br(n,e,a,i,r),e=a}return r}function Fr(n,e,t,i,r,s,o,a,l,h,u){if(e==t)return h;let d,f;if(r===0){if(f=Qe(o,a,n[e],n[e+1]),f<h){for(d=0;d<i;++d)l[d]=n[e+d];return l.length=i,f}return h}u=u||[NaN,NaN];let g=e+i;for(;g<t;)if(Gr(n,g-i,g,i,o,a,u),f=Qe(o,a,u[0],u[1]),f<h){for(h=f,d=0;d<i;++d)l[d]=u[d];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(f)-Math.sqrt(h))/r|0,1);if(Gr(n,t-i,e,i,o,a,u),f=Qe(o,a,u[0],u[1]),f<h){for(h=f,d=0;d<i;++d)l[d]=u[d];l.length=i}return h}function Oa(n,e,t,i,r,s,o,a,l,h,u){u=u||[NaN,NaN];for(let d=0,f=t.length;d<f;++d){const g=t[d];h=Fr(n,e,g,i,r,s,o,a,l,h,u),e=g}return h}function Da(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function Vr(n,e,t,i){for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0;a<i;++a)n[e++]=o[a]}return e}function Na(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=Vr(n,e,t[o],i);r[s++]=l,e=l}return r.length=s,r}function zr(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=e;o<t;o+=i)r[s++]=n.slice(o,o+i);return r.length=s,r}function Ga(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=zr(n,e,l,i,r[s]),e=l}return r.length=s,r}function Ba(n,e,t,i,r,s,o){const a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[e,t-i];let u=0;for(;h.length>0;){const d=h.pop(),f=h.pop();let g=0;const E=n[f],m=n[f+1],p=n[d],C=n[d+1];for(let T=f+i;T<d;T+=i){const L=n[T],w=n[T+1],M=ho(L,w,E,m,p,C);M>g&&(u=T,g=M)}g>r&&(l[(u-e)/i]=1,f+i<u&&h.push(f,u),u+i<d&&h.push(u,d))}for(let d=0;d<a;++d)l[d]&&(s[o++]=n[e+d*i],s[o++]=n[e+d*i+1]);return o}function lt(n,e){return e*Math.round(n/e)}function Fa(n,e,t,i,r,s,o){if(e==t)return o;let a=lt(n[e],r),l=lt(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let h,u;do if(h=lt(n[e],r),u=lt(n[e+1],r),e+=i,e==t)return s[o++]=h,s[o++]=u,o;while(h==a&&u==l);for(;e<t;){const d=lt(n[e],r),f=lt(n[e+1],r);if(e+=i,d==h&&f==u)continue;const g=h-a,E=u-l,m=d-a,p=f-l;if(g*p==E*m&&(g<0&&m<g||g==m||g>0&&m>g)&&(E<0&&p<E||E==p||E>0&&p>E)){h=d,u=f;continue}s[o++]=h,s[o++]=u,a=h,l=u,h=d,u=f}return s[o++]=h,s[o++]=u,o}function Va(n,e,t,i,r,s,o,a){for(let l=0,h=t.length;l<h;++l){const u=t[l];o=Fa(n,e,u,i,r,s,o),a.push(o),e=u}return o}class It extends di{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new It(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<ur(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Br(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return Nr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=Ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new It(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Vr(this.flatCoordinates,0,e,this.stride),this.changed()}}class fi extends di{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new fi(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=Qe(e,t,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return Lo(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return Po(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Da(this.flatCoordinates,0,e,this.stride),this.changed()}}function za(n,e,t,i,r){return!Io(r,function(o){return!Xe(n,e,t,i,o[0],o[1])})}function Xe(n,e,t,i,r,s){let o=0,a=n[t-i],l=n[t-i+1];for(;e<t;e+=i){const h=n[e],u=n[e+1];l<=s?u>s&&(h-a)*(s-l)-(r-a)*(u-l)>0&&o++:u<=s&&(h-a)*(s-l)-(r-a)*(u-l)<0&&o--,a=h,l=u}return o!==0}function jr(n,e,t,i,r,s){if(t.length===0||!Xe(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(Xe(n,t[o-1],t[o],i,r,s))return!1;return!0}function ja(n,e,t,i,r,s,o){let a,l,h,u,d,f,g;const E=r[s+1],m=[];for(let T=0,L=t.length;T<L;++T){const w=t[T];for(u=n[w-i],f=n[w-i+1],a=e;a<w;a+=i)d=n[a],g=n[a+1],(E<=f&&g<=E||f<=E&&E<=g)&&(h=(E-f)/(g-f)*(d-u)+u,m.push(h)),u=d,f=g}let p=NaN,C=-1/0;for(m.sort(Qi),u=m[0],a=1,l=m.length;a<l;++a){d=m[a];const T=Math.abs(d-u);T>C&&(h=(u+d)/2,jr(n,e,t,i,h,E)&&(p=h,C=T)),u=d}return isNaN(p)&&(p=r[s]),[p,E,C]}function Za(n,e,t,i,r){let s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function Zr(n,e,t,i,r,s){return s=s??gr(Un(),n,e,t,i),Jn(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Za(n,e,t,i,function(o,a){return Bo(r,o,a)}):!1}function Xa(n,e,t,i,r){return!!(Zr(n,e,t,i,r)||Xe(n,e,t,i,r[0],r[1])||Xe(n,e,t,i,r[0],r[3])||Xe(n,e,t,i,r[2],r[1])||Xe(n,e,t,i,r[2],r[3]))}function Ka(n,e,t,i,r){if(!Xa(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(let s=1,o=t.length;s<o;++s)if(za(n,t[s-1],t[s],i,r)&&!Zr(n,t[s-1],t[s],i,r))return!1;return!0}function Ya(n,e,t,i){for(;e<t-i;){for(let r=0;r<i;++r){const s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function Xr(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],l=n[e+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function $a(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=Xr(n,e,a,i);if(s===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;e=a}return!0}function Kr(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=Xr(n,e,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&Ya(n,e,a,i),e=a}return e}class bt extends di{constructor(e,t,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&i?(this.setFlatCoordinates(t,e),this.ends_=i):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?ro(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new bt(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<ur(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ka(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Oa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return jr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Kr(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,Ga(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=ln(this.getExtent());this.flatInteriorPoint_=ja(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new fi(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new It(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],h=new It(t.slice(s,l),e);r.push(h),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;$a(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Kr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Va(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new bt(t,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Na(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Yr(n){if(Qn(n))throw new Error("Cannot create polygon from empty extent");const e=n[0],t=n[1],i=n[2],r=n[3],s=[e,t,e,r,i,r,i,t,e,t];return new bt(s,"XY",[s.length])}function gi(n,e,t,i){const r=nt(e)/t[0],s=Pt(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function mi(n,e,t){let i=Math.min(n,e);const r=50;return i*=Math.log(1+r*Math.max(0,n/e-1))/r+1,t&&(i=Math.max(i,t),i/=Math.log(1+r*Math.max(0,t/n-1))/r+1),re(i,t/2,e*2)}function Ha(n,e,t,i){return e=e!==void 0?e:!0,(function(r,s,o,a){if(r!==void 0){const l=n[0],h=n[n.length-1],u=t?gi(l,t,o,i):l;if(a)return e?mi(r,u,h):re(r,h,u);const d=Math.min(u,r),f=Math.floor(er(n,d,s));return n[f]>u&&f<n.length-1?n[f+1]:n[f]}})}function Ua(n,e,t,i,r,s){return i=i!==void 0?i:!0,t=t!==void 0?t:0,(function(o,a,l,h){if(o!==void 0){const u=r?gi(e,r,l,s):e;if(h)return i?mi(o,u,t):re(o,t,u);const d=1e-9,f=Math.ceil(Math.log(e/u)/Math.log(n)-d),g=-a*(.5-d)+.5,E=Math.min(u,o),m=Math.floor(Math.log(e/E)/Math.log(n)+g),p=Math.max(f,m),C=e/Math.pow(n,p);return re(C,t,u)}})}function $r(n,e,t,i,r){return t=t!==void 0?t:!0,(function(s,o,a,l){if(s!==void 0){const h=i?gi(n,i,a,r):n;return!t||!l?re(s,e,h):mi(s,h,e)}})}function pi(n){if(n!==void 0)return 0}function Hr(n){if(n!==void 0)return n}function Wa(n){const e=2*Math.PI/n;return(function(t,i){if(i)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t})}function qa(n){const e=Rt(5);return(function(t,i){return i||t===void 0?t:Math.abs(t)<=e?0:t})}const Ja=256,yi=0;class Te extends xe{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=li(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&&pa(),e.center&&(e.center=Le(e.center,this.projection_)),e.extent&&(e.extent=mn(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in Ee)delete t[a];this.setProperties(t,!0);const i=el(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 r=Qa(e),s=i.constraint,o=tl(e);this.constraints_={center:r,resolution:s,rotation:o},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 r=e||[0,0,0,0];t=t||[0,0,0,0];const s=this.getResolution(),o=s/2*(r[3]-t[3]+t[1]-r[1]),a=s/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([i[0]+o,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 r=arguments[i];r.center&&(r=Object.assign({},r),r.center=Le(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=Le(r.anchor,this.getProjection())),t[i]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,i;t>1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){const u=arguments[r];u.center&&this.setCenterInternal(u.center),u.zoom!==void 0?this.setZoom(u.zoom):u.resolution&&this.setResolution(u.resolution),u.rotation!==void 0&&this.setRotation(u.rotation)}if(r===t){i&&pn(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;r<t;++r){const u=arguments[r],d={start:s,complete:!1,anchor:u.anchor,duration:u.duration!==void 0?u.duration:1e3,easing:u.easing||Xo,callback:i};if(u.center&&(d.sourceCenter=o,d.targetCenter=u.center.slice(),o=d.targetCenter),u.zoom!==void 0?(d.sourceResolution=a,d.targetResolution=this.getResolutionForZoom(u.zoom),a=d.targetResolution):u.resolution&&(d.sourceResolution=a,d.targetResolution=u.resolution,a=d.targetResolution),u.rotation!==void 0){d.sourceRotation=l;const f=sr(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=l+f,l=d.targetRotation}nl(d)?d.complete=!0:s+=d.duration,h.push(d)}this.animations_.push(h),this.setHint(pe.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[pe.ANIMATING]>0}getInteracting(){return this.hints_[pe.INTERACTING]>0}cancelAnimations(){this.setHint(pe.ANIMATING,-this.hints_[pe.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&pn(r[0].callback,!1),!e)for(let s=0,o=r.length;s<o;++s){const a=r[s];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 r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(l.complete)continue;const h=e-l.start;let u=l.duration>0?h/l.duration:1;u>=1?(l.complete=!0,u=1):s=!1;const d=l.easing(u);if(l.sourceCenter){const f=l.sourceCenter[0],g=l.sourceCenter[1],E=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;const p=f+d*(E-f),C=g+d*(m-g);this.targetCenter_=[p,C]}if(l.sourceResolution&&l.targetResolution){const f=d===1?l.targetResolution:l.sourceResolution+d*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),E=this.constraints_.resolution(f,0,g,!0);this.targetCenter_=this.calculateCenterZoom(E,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const f=d===1?sr(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+d*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(pe.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&pn(o,!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 r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-t[0],r[1]-t[1]],ei(i,e-this.getRotation()),Fo(i,t)),i}calculateCenterZoom(e,t){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const o=t[0]-e*(t[0]-r[0])/s,a=t[1]-e*(t[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(e){const t=this.viewportSize_;if(e){const i=t[0],r=t[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&hi(e,this.getProjection())}getCenterInternal(){return this.get(Ee.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return Ea(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();ie(t,"The view center is not defined");const i=this.getResolution();ie(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return ie(r!==void 0,"The view rotation is not defined"),qn(t,i,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(Ee.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(mn(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=nt(e)/t[0],r=Pt(e)/t[1];return Math.max(i,r)}getResolutionForValueFunction(e){e=e||2;const t=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(t/i)/Math.log(e);return(function(s){return t/Math.pow(e,s*r)})}getRotation(){return this.get(Ee.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/t;return(function(o){return Math.log(i/o)/t/s})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const i=this.padding_;return i&&(t=[t[0]-i[1]-i[3],t[1]-i[0]-i[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();r=_i(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],t,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,i,r;if(this.resolutions_){const s=er(this.resolutions_,e,1);t=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){var t;if((t=this.resolutions_)!=null&&t.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=re(Math.floor(e),0,this.resolutions_.length-2),r=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(r,re(e-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(ie(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){ie(!Qn(e),"Cannot fit empty extent provided as `geometry`");const r=mn(e,this.getProjection());i=Yr(r)}else if(e.getType()==="Circle"){const r=mn(e.getExtent(),this.getProjection());i=Yr(r),i.rotate(this.getRotation(),ln(r))}else i=e;this.fitInternal(i,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),i=Math.cos(t),r=Math.sin(-t),s=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,h=-1/0,u=-1/0;for(let d=0,f=s.length;d<f;d+=o){const g=s[d]*i-s[d+1]*r,E=s[d]*r+s[d+1]*i;a=Math.min(a,g),l=Math.min(l,E),h=Math.max(h,g),u=Math.max(u,E)}return[a,l,h,u]}fitInternal(e,t){t=t||{};let i=t.size;i||(i=this.getViewportSizeMinusPadding_());const r=t.padding!==void 0?t.padding:[0,0,0,0],s=t.nearest!==void 0?t.nearest:!1;let o;t.minResolution!==void 0?o=t.minResolution:t.maxZoom!==void 0?o=this.getResolutionForZoom(t.maxZoom):o=0;const a=this.rotatedExtentForGeometry(e);let l=this.getResolutionForExtentInternal(a,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);const h=this.getRotation(),u=Math.sin(h),d=Math.cos(h),f=ln(a);f[0]+=(r[1]-r[3])/2*l,f[1]+=(r[0]-r[2])/2*l;const g=f[0]*d-f[1]*u,E=f[1]*d+f[0]*u,m=this.getConstrainedCenter([g,E],l),p=t.callback?t.callback:nn;t.duration!==void 0?this.animateInternal({resolution:l,center:m,duration:t.duration,easing:t.easing},p):(this.targetResolution_=l,this.targetCenter_=m,this.applyTargetState_(!1,!0),pn(p,!0))}centerOn(e,t,i){this.centerOnInternal(Le(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal(_i(e,t,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,i,r){let s;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-i),l=_i(e,r,[a[0]/2+o[3],a[1]/2+o[0]],t,i);s=[e[0]-l[0],e[1]-l[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=hi(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&Le(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);t&&(this.targetCenter_=this.calculateCenterZoom(s,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=Le(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&Le(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const i=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,s,i),a=this.constraints_.center(this.targetCenter_,o,s,i,this.calculateCenterShift(this.targetCenter_,o,r,s));this.get(Ee.ROTATION)!==r&&this.set(Ee.ROTATION,r),this.get(Ee.RESOLUTION)!==o&&(this.set(Ee.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(Ee.CENTER)||!cn(this.get(Ee.CENTER),a))&&this.set(Ee.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,i){e=e!==void 0?e:200;const r=t||0,s=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(s),a=this.constraints_.resolution(this.targetResolution_,r,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,s,o));if(e===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=s,this.targetCenter_=l,this.applyTargetState_();return}i=i||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==s||!this.getCenterInternal()||!cn(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:l,resolution:a,duration:e,easing:it,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(pe.INTERACTING,1)}endInteraction(e,t,i){i=i&&Le(i,this.getProjection()),this.endInteractionInternal(e,t,i)}endInteractionInternal(e,t,i){this.getInteracting()&&(this.setHint(pe.INTERACTING,-1),this.resolveConstraints(e,t,i))}getConstrainedCenter(e,t){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),i)}getConstrainedZoom(e,t){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,t))}getConstrainedResolution(e,t){t=t||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,i)}}function pn(n,e){setTimeout(function(){n(e)},0)}function Qa(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return hr(n.extent,n.constrainOnlyCenter,t)}const e=li(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,hr(t,!1,!1)}return Ro}function el(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:yi,a=n.maxZoom!==void 0?n.maxZoom:28;const l=n.zoomFactor!==void 0?n.zoomFactor:2,h=n.multiWorld!==void 0?n.multiWorld:!1,u=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,d=n.showFullExtent!==void 0?n.showFullExtent:!1,f=li(n.projection,"EPSG:3857"),g=f.getExtent();let E=n.constrainOnlyCenter,m=n.extent;if(!h&&!m&&f.isGlobal()&&(E=!1,m=g),n.resolutions!==void 0){const p=n.resolutions;t=p[o],i=p[a]!==void 0?p[a]:p[p.length-1],n.constrainResolution?e=Ha(p,u,!E&&m,d):e=$r(t,i,u,!E&&m,d)}else{const C=(g?Math.max(nt(g),Pt(g)):360*pr.degrees/f.getMetersPerUnit())/Ja/Math.pow(2,yi),T=C/Math.pow(2,28-yi);t=n.maxResolution,t!==void 0?o=0:t=C/Math.pow(l,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=t/Math.pow(l,a):i=C/Math.pow(l,a):i=T),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=Ua(l,t,i,u,!E&&m,d):e=$r(t,i,u,!E&&m,d)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function tl(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?qa():t===!1?Hr:typeof t=="number"?Wa(t):Hr}return pi}function nl(n){return!(n.sourceCenter&&n.targetCenter&&!cn(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function _i(n,e,t,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=n[0]*s-n[1]*o,l=n[1]*s+n[0]*o;a+=(e[0]/2-t[0])*i,l+=(t[1]-e[1]/2)*i,o=-o;const h=a*s-l*o,u=l*s+a*o;return[h,u]}const yn="ol-hidden",_n="ol-unselectable",wi="ol-control",Ur="ol-collapsed";function De(n,e,t,i){let r;return tt?r=new class extends OffscreenCanvas{constructor(){super(...arguments);y(this,"style",{})}}(n??300,e??150):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}let Ei;function Wr(){return Ei||(Ei=De(1,1)),Ei}function qr(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function il(n){for(;n.lastChild;)n.lastChild.remove()}function rl(n,e){const t=n.childNodes;for(let i=0;;++i){const r=t[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){n.appendChild(s);continue}if(!s){n.removeChild(r),--i;continue}n.insertBefore(s,r)}}}function sl(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){const t=this.childNodes.indexOf(e);if(t===-1)throw new Error("Node to remove was not found");return this.childNodes.splice(t,1),e},insertBefore:function(e,t){const i=this.childNodes.indexOf(t);if(i===-1)throw new Error("Reference node not found");return this.childNodes.splice(i,0,e),e},style:{}},{get(e,t,i){return t==="firstElementChild"?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,i)}})}function Ke(n){return typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}class Ci extends xe{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){var t;this.map_&&((t=this.element)==null||t.remove());for(let i=0,r=this.listenerKeys.length;i<r;++i)ne(this.listenerKeys[i]);if(this.listenerKeys.length=0,this.map_=e,e){const i=this.target_??e.getOverlayContainerStopEvent();this.element&&i.appendChild(this.element),this.render!==nn&&this.listenerKeys.push(H(e,Oe.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class ol extends Ci{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;const t=e.className!==void 0?e.className:"ol-attribution",i=e.tipLabel!==void 0?e.tipLabel:"Attributions",r=e.expandClassName!==void 0?e.expandClassName:t+"-expand",s=e.collapseLabel!==void 0?e.collapseLabel:"›",o=e.collapseClassName!==void 0?e.collapseClassName:t+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;const a=e.label!==void 0?e.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(j.CLICK,this.handleClick_.bind(this),!1);const h=t+" "+_n+" "+wi+(this.collapsed_&&this.collapsible_?" "+Ur:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=h,u.appendChild(this.toggleButton_),u.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t=this.getMap().getAllLayers(),i=new Set(t.flatMap(r=>r.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(r=>i.add(r)):i.add(this.attributions_)),!this.overrideCollapsible_){const r=!t.some(s=>{var o;return((o=s.getSource())==null?void 0:o.getAttributionsCollapsible())===!1});this.setCollapsible(r)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=await Promise.all(this.collectSourceAttributions_(e).map(r=>oo(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Kn(t,this.renderedAttributions_)){il(this.ulElement_);for(let r=0,s=t.length;r<s;++r){const o=document.createElement("li");o.innerHTML=t[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Ur),this.collapsed_?qr(this.collapseLabel_,this.label_):qr(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}class al extends Ci{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});const t=e.className!==void 0?e.className:"ol-rotate",i=e.label!==void 0?e.label:"⇧",r=e.compassClassName!==void 0?e.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=r,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(r));const s=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=t+"-reset",o.setAttribute("type","button"),o.title=s,o.appendChild(this.label_),o.addEventListener(j.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+_n+" "+wi,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration!==void 0?e.duration:250,this.autoHide_=e.autoHide!==void 0?e.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(yn)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const i=t.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:it}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const i=t.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(yn);!s&&i===0?this.element.classList.add(yn):s&&i!==0&&this.element.classList.remove(yn)}this.label_.style.transform=r}this.rotation_=i}}class ll extends Ci{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const t=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,r=e.zoomInClassName!==void 0?e.zoomInClassName:t+"-in",s=e.zoomOutClassName!==void 0?e.zoomOutClassName:t+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",h=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(j.CLICK,this.handleClick_.bind(this,i),!1);const d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=h,d.appendChild(typeof a=="string"?document.createTextNode(a):a),d.addEventListener(j.CLICK,this.handleClick_.bind(this,-i),!1);const f=t+" "+_n+" "+wi,g=this.element;g.className=f,g.appendChild(u),g.appendChild(d),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:it})):i.setZoom(s)}}}function cl(n){n=n||{};const e=new we;return(n.zoom!==void 0?n.zoom:!0)&&e.push(new ll(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&e.push(new al(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&e.push(new ol(n.attributionOptions)),e}class hl{constructor(e,t,i){this.decay_=e,this.minVelocity_=t,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let i=t-3;for(;i>0&&this.points_[i+2]>e;)i-=3;const r=this.points_[t+2]-this.points_[i+2];if(r<1e3/60)return!1;const s=this.points_[t]-this.points_[i],o=this.points_[t+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Jr={ACTIVE:"active"};class xt extends xe{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Jr.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Jr.ACTIVE,e)}setMap(e){this.map_=e}}function ul(n,e,t){const i=n.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:Ko,center:n.getConstrainedCenter(r)})}}function vi(n,e,t,i){const r=n.getZoom();if(r===void 0)return;const s=n.getConstrainedZoom(r+e),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:i!==void 0?i:250,easing:it})}class dl extends xt{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let t=!1;if(e.type==J.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();vi(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function Ai(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](t),!!i);++r);return i}}const fl=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},gl=function(n){const e=n.map.getTargetElement(),t=e.getRootNode(),i=n.map.getOwnerDocument().activeElement;return t instanceof ShadowRoot?t.host.contains(i):e.contains(i)},Qr=function(n){const e=n.map.getTargetElement(),t=e.getRootNode();return(t instanceof ShadowRoot?t.host:e).hasAttribute("tabindex")?gl(n):!0},ml=en,es=function(n){const e=n.originalEvent;return"pointerId"in e&&e.button==0&&!(yo&&lr&&e.ctrlKey)},ts=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},pl=function(n){const e=n.originalEvent;return lr?e.metaKey:e.ctrlKey},yl=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ns=function(n){const e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},Ri=function(n){const e=n.originalEvent;return"pointerId"in e&&e.pointerType=="mouse"},_l=function(n){const e=n.originalEvent;return"pointerId"in e&&e.isPrimary&&e.button===0};class kt extends xt{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==J.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==J.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==J.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==J.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function Mi(n){const e=n.length;let t=0,i=0;for(let r=0;r<e;r++)t+=n[r].clientX,i+=n[r].clientY;return{clientX:t/e,clientY:i/e}}class wl extends kt{constructor(e){super({stopDown:tn}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:Ai(ts,_l);this.condition_=e.onFocusOnly?Ai(Qr,t):t,this.noKinetic_=!1}handleDragEvent(e){const t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());const i=this.targetPointers,r=t.getEventPixel(Mi(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){const s=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],a=e.map.getView();Vo(s,a.getResolution()),ei(s,a.getRotation()),a.adjustCenterInternal(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=i.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,i=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),l=t.getCoordinateFromPixelInternal([a[0]-r*Math.cos(s),a[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(l),duration:500,easing:it})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class El extends kt{constructor(e){e=e||{},super({stopDown:tn}),this.condition_=e.condition?e.condition:fl,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!Ri(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===pi)return;const r=t.getSize(),s=e.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return Ri(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Ri(e)&&es(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Cl extends Xn{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],t[0])+i,r.top=Math.min(e[1],t[1])+i,r.width=Math.abs(t[0]-e[0])+i,r.height=Math.abs(t[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new bt([r])}getGeometry(){return this.geometry_}}const ct={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Ot extends Ve{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class vl extends kt{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new Cl(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??es,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,i){const r=i[0]-t[0],s=i[1]-t[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Ot(ct.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Ot(t?ct.BOXEND:ct.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ot(ct.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Ot(ct.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Ot(ct.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class Al extends vl{constructor(e){e=e||{};const t=e.condition?e.condition:yl;super({condition:t,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:it})}}const Ye={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Rl extends xt{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return ts(t)&&ns(t)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==j.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==Ye.DOWN||r==Ye.LEFT||r==Ye.RIGHT||r==Ye.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,h=0;r==Ye.DOWN?h=-a:r==Ye.LEFT?l=-a:r==Ye.RIGHT?l=a:h=a;const u=[l,h];ei(u,o.getRotation()),ul(o,u,this.duration_),i.preventDefault(),t=!0}}return!t}}class Ml extends xt{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!pl(t)&&ns(t)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let t=!1;if(e.type==j.KEYDOWN||e.type==j.KEYPRESS){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==="+"||r==="-")){const s=e.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();vi(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}const Pl=40,Ll=300;class Tl extends xt{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const t=e.condition?e.condition:ml;this.condition_=e.onFocusOnly?Ai(Qr,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==j.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let s=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:s*=Pl;break;case WheelEvent.DOM_DELTA_PAGE:s*=Ll;break}if(s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-re(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),vi(t,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}class Sl extends kt{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=tn),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let t=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=l}this.lastAngle_=s;const o=e.map,a=o.getView();a.getConstraints().rotation!==pi&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Mi(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}class Il extends kt{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=tn),super(t),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,h=l.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Mi(this.targetPointers))),l.render(),h.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}function is(n){n=n||{};const e=new we,t=new hl(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&e.push(new El),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&e.push(new dl({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&e.push(new wl({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&e.push(new Sl),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&e.push(new Il({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(e.push(new Rl),e.push(new Ml({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&e.push(new Tl({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&e.push(new Al({duration:n.zoomDuration})),e}const Ne={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Ge extends Ve{constructor(e,t){super(e),this.layer=t}}const Pi={LAYERS:"layers"};class ht extends or{constructor(e){e=e||{};const t=Object.assign({},e);delete t.layers;let i=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Pi.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new we(i.slice(),{unique:!0}):ie(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new we(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(ne),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(H(e,me.ADD,this.handleLayersAdd_,this),H(e,me.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(ne);rn(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i<r;i++){const s=t[i];this.registerLayerListeners_(s),this.dispatchEvent(new Ge(Ne.ADDLAYER,s))}this.changed()}registerLayerListeners_(e){const t=[H(e,At.PROPERTYCHANGE,this.handleLayerChange_,this),H(e,j.CHANGE,this.handleLayerChange_,this)];e instanceof ht&&t.push(H(e,Ne.ADDLAYER,this.handleLayerGroupAdd_,this),H(e,Ne.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[Je(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new Ge(Ne.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new Ge(Ne.REMOVELAYER,e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new Ge(Ne.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=Je(t);this.listenerKeys_[i].forEach(ne),delete this.listenerKeys_[i],this.dispatchEvent(new Ge(Ne.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(Pi.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const i=t.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new Ge(Ne.REMOVELAYER,i[r]))}this.set(Pi.LAYERS,e)}getLayersArray(e){return e=e!==void 0?e:[],this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){const t=e!==void 0?e:[],i=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let o=i,a=t.length;o<a;o++){const l=t[o];l.opacity*=r.opacity,l.visible=l.visible&&r.visible,l.maxResolution=Math.min(l.maxResolution,r.maxResolution),l.minResolution=Math.max(l.minResolution,r.minResolution),l.minZoom=Math.max(l.minZoom,r.minZoom),l.maxZoom=Math.min(l.maxZoom,r.maxZoom),r.extent!==void 0&&(l.extent!==void 0?l.extent=Oo(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return"ready"}}const ut={PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class Li extends or{constructor(e){const t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener($.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get($.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(ne(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=H(e,j.CHANGE,this.handleSourceChange_,this),e.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof Te?t={viewState:e.getState(),extent:e.calculateExtent()}:t=e,!t.layerStatesArray&&i&&(t.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(o=>o.layer===this),!r)return!1}else r=this.getLayerState();const s=this.getExtent();return Ti(r,t.viewState)&&(!s||Jn(s,t.extent))}getAttributions(e){var s;if(!this.isVisible(e))return[];const t=(s=this.getSource())==null?void 0:s.getAttributions();if(!t)return[];const i=e instanceof Te?e.getViewStateAndExtent():e;let r=t(i);return Array.isArray(r)||(r=[r]),r}render(e,t){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){const t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set($.MAP,e)}getMapInternal(){return this.get($.MAP)}setMap(e){this.mapPrecomposeKey_&&(ne(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(ne(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=H(e,ut.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=H(this,j.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);ie(!t.some(r=>r.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(i)}setSource(e){this.set($.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function Ti(n,e){if(!n.visible)return!1;const t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}function rs(n,e,t=0,i=n.length-1,r=bl){for(;i>t;){if(i-t>600){const l=i-t+1,h=e-t+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(h-l/2<0?-1:1),g=Math.max(t,Math.floor(e-h*d/l+f)),E=Math.min(i,Math.floor(e+(l-h)*d/l+f));rs(n,e,g,E,r)}const s=n[e];let o=t,a=i;for(Dt(n,t,e),r(n[i],s)>0&&Dt(n,t,i);o<a;){for(Dt(n,o,a),o++,a--;r(n[o],s)<0;)o++;for(;r(n[a],s)>0;)a--}r(n[t],s)===0?Dt(n,t,a):(a++,Dt(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function Dt(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function bl(n,e){return n<e?-1:n>e?1:0}class xl{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!En(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?r(a):a;En(e,l)&&(t.leaf?i.push(a):Ii(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!En(e,t))return!1;const i=[];for(;t;){for(let r=0;r<t.children.length;r++){const s=t.children[r],o=t.leaf?this.toBBox(s):s;if(En(e,o)){if(t.leaf||Ii(e,o))return!0;i.push(s)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=ft([]),this}remove(e,t){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],o=[];let a,l,h;for(;i||s.length;){if(i||(i=s.pop(),l=s[s.length-1],a=o.pop(),h=!0),i.leaf){const u=kl(e,i.children,t);if(u!==-1)return i.children.splice(u,1),s.push(i),this._condense(s),this}!h&&!i.leaf&&Ii(i,r)?(s.push(i),o.push(a),a=0,l=i,i=i.children[0]):l?(a++,i=l.children[a],h=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,r){const s=i-t+1;let o=this._maxEntries,a;if(s<=o)return a=ft(e.slice(t,i+1)),dt(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=ft([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),h=l*Math.ceil(Math.sqrt(o));ss(e,t,i,h,this.compareMinX);for(let u=t;u<=i;u+=h){const d=Math.min(u+h-1,i);ss(e,u,d,l,this.compareMinY);for(let f=u;f<=d;f+=l){const g=Math.min(f+l-1,d);a.children.push(this._build(e,f,g,r-1))}}return dt(a,this.toBBox),a}_chooseSubtree(e,t,i,r){for(;r.push(t),!(t.leaf||r.length-1===i);){let s=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const h=t.children[l],u=Si(h),d=Nl(e,h)-u;d<o?(o=d,s=u<s?u:s,a=h):d===o&&u<s&&(s=u,a=h)}t=a||t.children[0]}return t}_insert(e,t,i){const r=i?e:this.toBBox(e),s=[],o=this._chooseSubtree(r,this.data,t,s);for(o.children.push(e),Gt(o,r);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)}_split(e,t){const i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const o=this._chooseSplitIndex(i,s,r),a=ft(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,dt(i,this.toBBox),dt(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=ft([e,t]),this.data.height=e.height+1,this.data.leaf=!1,dt(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let r,s=1/0,o=1/0;for(let a=t;a<=i-t;a++){const l=Nt(e,0,a,this.toBBox),h=Nt(e,a,i,this.toBBox),u=Gl(l,h),d=Si(l)+Si(h);u<s?(s=u,r=a,o=d<o?d:o):u===s&&d<o&&(o=d,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:Ol,s=e.leaf?this.compareMinY:Dl,o=this._allDistMargin(e,t,i,r),a=this._allDistMargin(e,t,i,s);o<a&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);const s=this.toBBox,o=Nt(e,0,t,s),a=Nt(e,i-t,i,s);let l=wn(o)+wn(a);for(let h=t;h<i-t;h++){const u=e.children[h];Gt(o,e.leaf?s(u):u),l+=wn(o)}for(let h=i-t-1;h>=t;h--){const u=e.children[h];Gt(a,e.leaf?s(u):u),l+=wn(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)Gt(t[r],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():dt(e[t],this.toBBox)}}function kl(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i<e.length;i++)if(t(n,e[i]))return i;return-1}function dt(n,e){Nt(n,0,n.children.length,e,n)}function Nt(n,e,t,i,r){r||(r=ft(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<t;s++){const o=n.children[s];Gt(r,n.leaf?i(o):o)}return r}function Gt(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function Ol(n,e){return n.minX-e.minX}function Dl(n,e){return n.minY-e.minY}function Si(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function wn(n){return n.maxX-n.minX+(n.maxY-n.minY)}function Nl(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function Gl(n,e){const t=Math.max(n.minX,e.minX),i=Math.max(n.minY,e.minY),r=Math.min(n.maxX,e.maxX),s=Math.min(n.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,s-i)}function Ii(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function En(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function ft(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ss(n,e,t,i,r){const s=[e,t];for(;s.length;){if(t=s.pop(),e=s.pop(),t-e<=i)continue;const o=e+Math.ceil((t-e)/i/2)*i;rs(n,o,e,t,r),s.push(e,o,o,t)}}const bi=[NaN,NaN,NaN,0];let xi;function Bl(){return xi||(xi=De(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),xi}const Fl=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Vl=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,zl=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,jl=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Cn(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function Bt(n){throw new Error('failed to parse "'+n+'" as color')}function os(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(Vl)||n.match(Fl)||n.match(zl);if(s){const o=s[4],a=100/255;return[re(Cn(s[1],a)+.5|0,0,255),re(Cn(s[2],a)+.5|0,0,255),re(Cn(s[3],a)+.5|0,0,255),o!==void 0?re(Cn(o,100),0,1):1]}Bt(n)}if(n.startsWith("#")){if(jl.test(n)){const s=n.substring(1),o=s.length<=4?1:2,a=[0,0,0,255];for(let l=0,h=s.length;l<h;l+=o){let u=parseInt(s.substring(l,l+o),16);o===1&&(u+=u<<4),a[l/o]=u}return a[3]=a[3]/255,a}Bt(n)}const e=Bl();e.fillStyle="#abcdef";let t=e.fillStyle;e.fillStyle=n,e.fillStyle===t&&(e.fillStyle="#fedcba",t=e.fillStyle,e.fillStyle=n,e.fillStyle===t&&Bt(n));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return os(i);e.clearRect(0,0,1,1),e.fillRect(0,0,1,1);const r=Array.from(e.getImageData(0,0,1,1).data);return r[3]=fo(r[3]/255,3),r}function Zl(n){return typeof n=="string"?n:Fi(n)}const Xl=1024,Ft={};let ki=0;function Kl(n){if(n.length===4)return n;const e=n.slice();return e[3]=1,e}function Oi(n){return n>.0031308?Math.pow(n,1/2.4)*269.025-14.025:n*3294.6}function Di(n){return n>.2068965?Math.pow(n,3):(n-4/29)*(108/841)}function Ni(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function Gi(n){return n>.0088564?Math.pow(n,1/3):n/(108/841)+4/29}function as(n){const e=Ni(n[0]),t=Ni(n[1]),i=Ni(n[2]),r=Gi(e*.222488403+t*.716873169+i*.06060791),s=500*(Gi(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-Gi(e*.016863605+t*.117638439+i*.865350722)),a=Math.atan2(o,s)*(180/Math.PI);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,n[3]]}function Yl(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=Di(e),s=Di(e+t/500*Math.cos(i)),o=Di(e-t/200*Math.sin(i)),a=Oi(s*3.021973625-r*1.617392459-o*.404875592),l=Oi(s*-.943766287+r*1.916279586+o*.027607165),h=Oi(s*.069407491-r*.22898585+o*1.159737864);return[re(a+.5|0,0,255),re(l+.5|0,0,255),re(h+.5|0,0,255),n[3]]}function Bi(n){if(n==="none")return bi;if(Ft.hasOwnProperty(n))return Ft[n];if(ki>=Xl){let t=0;for(const i in Ft)(t++&3)===0&&(delete Ft[i],--ki)}const e=os(n);e.length!==4&&Bt(n);for(const t of e)isNaN(t)&&Bt(n);return Ft[n]=e,++ki,e}function Vt(n){return Array.isArray(n)?n:Bi(n)}function Fi(n){let e=n[0];e!=(e|0)&&(e=e+.5|0);let t=n[1];t!=(t|0)&&(t=t+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const r=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+e+","+t+","+i+","+r+")"}function ls(n){return n[0]>0&&n[1]>0}function gt(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let $e=0;const ce=1<<$e++,z=1<<$e++,fe=1<<$e++,Ce=1<<$e++,He=1<<$e++,zt=1<<$e++,vn=Math.pow(2,$e)-1,Vi={[ce]:"boolean",[z]:"number",[fe]:"string",[Ce]:"color",[He]:"number[]",[zt]:"size"},$l=Object.keys(Vi).map(Number).sort(Qi);function Hl(n){return n in Vi}function jt(n){const e=[];for(const t of $l)Zt(n,t)&&e.push(Vi[t]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Zt(n,e){return(n&e)===e}function Be(n,e){return n===e}class Q{constructor(e,t){if(!Hl(e))throw new Error(`literal expressions must have a specific type, got ${jt(e)}`);this.type=e,this.value=t}}class Ul{constructor(e,t,...i){this.type=e,this.operator=t,this.args=i}}function cs(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function oe(n,e,t){switch(typeof n){case"boolean":{if(Be(e,fe))return new Q(fe,n?"true":"false");if(!Zt(e,ce))throw new Error(`got a boolean, but expected ${jt(e)}`);return new Q(ce,n)}case"number":{if(Be(e,zt))return new Q(zt,gt(n));if(Be(e,ce))return new Q(ce,!!n);if(Be(e,fe))return new Q(fe,n.toString());if(!Zt(e,z))throw new Error(`got a number, but expected ${jt(e)}`);return new Q(z,n)}case"string":{if(Be(e,Ce))return new Q(Ce,Bi(n));if(Be(e,ce))return new Q(ce,!!n);if(!Zt(e,fe))throw new Error(`got a string, but expected ${jt(e)}`);return new Q(fe,n)}}if(!Array.isArray(n))throw new Error("expression must be an array or a primitive value");if(n.length===0)throw new Error("empty expression");if(typeof n[0]=="string")return oc(n,e,t);for(const i of n)if(typeof i!="number")throw new Error("expected an array of numbers");if(Be(e,zt)){if(n.length!==2)throw new Error(`expected an array of two values for a size, got ${n.length}`);return new Q(zt,n)}if(Be(e,Ce)){if(n.length===3)return new Q(Ce,[...n,1]);if(n.length===4)return new Q(Ce,n);throw new Error(`expected an array of 3 or 4 values for a color, got ${n.length}`)}if(!Zt(e,He))throw new Error(`got an array of numbers, but expected ${jt(e)}`);return new Q(He,n)}const S={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",LineMetric:"line-metric",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},Wl={[S.Get]:N(B(1,1/0),hs),[S.Var]:N(B(1,1),ql),[S.Has]:N(B(1,1/0),hs),[S.Id]:N(Jl,mt),[S.Concat]:N(B(2,1/0),K(fe)),[S.GeometryType]:N(Ql,mt),[S.LineMetric]:N(mt),[S.Resolution]:N(zi,mt),[S.Zoom]:N(zi,mt),[S.Time]:N(zi,mt),[S.Any]:N(B(2,1/0),K(ce)),[S.All]:N(B(2,1/0),K(ce)),[S.Not]:N(B(1,1),K(ce)),[S.Equal]:N(B(2,2),K(vn)),[S.NotEqual]:N(B(2,2),K(vn)),[S.GreaterThan]:N(B(2,2),K(z)),[S.GreaterThanOrEqualTo]:N(B(2,2),K(z)),[S.LessThan]:N(B(2,2),K(z)),[S.LessThanOrEqualTo]:N(B(2,2),K(z)),[S.Multiply]:N(B(2,1/0),us),[S.Coalesce]:N(B(2,1/0),us),[S.Divide]:N(B(2,2),K(z)),[S.Add]:N(B(2,1/0),K(z)),[S.Subtract]:N(B(2,2),K(z)),[S.Clamp]:N(B(3,3),K(z)),[S.Mod]:N(B(2,2),K(z)),[S.Pow]:N(B(2,2),K(z)),[S.Abs]:N(B(1,1),K(z)),[S.Floor]:N(B(1,1),K(z)),[S.Ceil]:N(B(1,1),K(z)),[S.Round]:N(B(1,1),K(z)),[S.Sin]:N(B(1,1),K(z)),[S.Cos]:N(B(1,1),K(z)),[S.Atan]:N(B(1,2),K(z)),[S.Sqrt]:N(B(1,1),K(z)),[S.Match]:N(B(4,1/0),ds,tc),[S.Between]:N(B(3,3),K(z)),[S.Interpolate]:N(B(6,1/0),ds,nc),[S.Case]:N(B(3,1/0),ec,ic),[S.In]:N(B(2,2),rc),[S.Number]:N(B(1,1/0),K(vn)),[S.String]:N(B(1,1/0),K(vn)),[S.Array]:N(B(1,1/0),K(z)),[S.Color]:N(B(1,4),K(z)),[S.Band]:N(B(1,3),K(z)),[S.Palette]:N(B(2,2),sc),[S.ToString]:N(B(1,1),K(ce|z|fe|Ce))};function hs(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=n[s+1];switch(typeof o){case"number":{r[s]=new Q(z,o);break}case"string":{r[s]=new Q(fe,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}s===0&&t.properties.add(String(o))}return r}function ql(n,e,t){const i=n[1];if(typeof i!="string")throw new Error("expected a string argument for var operation");return t.variables.add(i),[new Q(fe,i)]}function Jl(n,e,t){t.featureId=!0}function Ql(n,e,t){t.geometryType=!0}function zi(n,e,t){t.mapState=!0}function mt(n,e,t){const i=n[0];if(n.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function B(n,e){return function(t,i,r){const s=t[0],o=t.length-1;if(n===e){if(o!==n){const a=n===1?"":"s";throw new Error(`expected ${n} argument${a} for ${s}, got ${o}`)}}else if(o<n||o>e){const a=e===1/0?`${n} or more`:`${n} to ${e}`;throw new Error(`expected ${a} arguments for ${s}, got ${o}`)}}}function us(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=oe(n[s+1],e,t);r[s]=o}return r}function K(n){return function(e,t,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const a=oe(e[o+1],n,i);s[o]=a}return s}}function ec(n,e,t){const i=n[0],r=n.length-1;if(r%2===0)throw new Error(`expected an odd number of arguments for ${i}, got ${r} instead`)}function ds(n,e,t){const i=n[0],r=n.length-1;if(r%2===1)throw new Error(`expected an even number of arguments for operation ${i}, got ${r} instead`)}function tc(n,e,t){const i=n.length-1,r=fe|z|ce,s=oe(n[1],r,t),o=oe(n[n.length-1],e,t),a=new Array(i-2);for(let l=0;l<i-2;l+=2){try{const h=oe(n[l+2],s.type,t);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+1} of match expression: ${h.message}`)}try{const h=oe(n[l+3],o.type,t);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+2} of match expression: ${h.message}`)}}return[s,...a,o]}function nc(n,e,t){const i=n[1];let r;switch(i[0]){case"linear":r=1;break;case"exponential":const l=i[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);r=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const s=new Q(z,r);let o;try{o=oe(n[2],z,t)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(n.length-3);for(let l=0;l<a.length;l+=2){try{const h=oe(n[l+3],z,t);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${h.message}`)}try{const h=oe(n[l+4],e,t);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${h.message}`)}}return[s,o,...a]}function ic(n,e,t){const i=oe(n[n.length-1],e,t),r=new Array(n.length-1);for(let s=0;s<r.length-1;s+=2){try{const o=oe(n[s+1],ce,t);r[s]=o}catch(o){throw new Error(`failed to parse argument ${s} of case expression: ${o.message}`)}try{const o=oe(n[s+2],i.type,t);r[s+1]=o}catch(o){throw new Error(`failed to parse argument ${s+1} of case expression: ${o.message}`)}}return r[r.length-1]=i,r}function rc(n,e,t){let i=n[2];if(!Array.isArray(i))throw new Error('the second argument for the "in" operator must be an array');let r;if(typeof i[0]=="string"){if(i[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(i[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');i=i[1],r=fe}else r=z;const s=new Array(i.length);for(let a=0;a<s.length;a++)try{const l=oe(i[a],r,t);s[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[oe(n[1],r,t),...s]}function sc(n,e,t){let i;try{i=oe(n[1],z,t)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const r=n[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let o=0;o<s.length;o++){let a;try{a=oe(r[o],Ce,t)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof Q))throw new Error(`the palette color at index ${o} must be a literal value`);s[o]=a}return[i,...s]}function N(...n){return function(e,t,i){const r=e[0];let s;for(let o=0;o<n.length;o++){const a=n[o](e,t,i);if(o==n.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");s=a}}return new Ul(t,r,...s)}}function oc(n,e,t){const i=n[0],r=Wl[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(n,e,t)}function fs(n){if(!n)return"";const e=n.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return fs(n.getGeometries()[0]);default:return""}}function gs(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function Re(n,e,t){const i=oe(n,e,t);return ve(i)}function ve(n,e){if(n instanceof Q){if(n.type===Ce&&typeof n.value=="string"){const i=Bi(n.value);return function(){return i}}return function(){return n.value}}const t=n.operator;switch(t){case S.Number:case S.String:case S.Coalesce:return ac(n);case S.Get:case S.Var:case S.Has:return lc(n);case S.Id:return i=>i.featureId;case S.GeometryType:return i=>i.geometryType;case S.Concat:{const i=n.args.map(r=>ve(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case S.Resolution:return i=>i.resolution;case S.Any:case S.All:case S.Between:case S.In:case S.Not:return hc(n);case S.Equal:case S.NotEqual:case S.LessThan:case S.LessThanOrEqualTo:case S.GreaterThan:case S.GreaterThanOrEqualTo:return cc(n);case S.Multiply:case S.Divide:case S.Add:case S.Subtract:case S.Clamp:case S.Mod:case S.Pow:case S.Abs:case S.Floor:case S.Ceil:case S.Round:case S.Sin:case S.Cos:case S.Atan:case S.Sqrt:return uc(n);case S.Case:return dc(n);case S.Match:return fc(n);case S.Interpolate:return gc(n);case S.ToString:return mc(n);default:throw new Error(`Unsupported operator ${t}`)}}function ac(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ve(n.args[s]);switch(t){case S.Coalesce:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case S.Number:case S.String:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a===t)return a}throw new Error(`Expected one of the values to be a ${t}`)};default:throw new Error(`Unsupported assertion operator ${t}`)}}function lc(n,e){const i=n.args[0].value;switch(n.operator){case S.Get:return r=>{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const u=s[a].value;o=o[u]}return o};case S.Var:return r=>r.variables[i];case S.Has:return r=>{const s=n.args;if(!(i in r.properties))return!1;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const u=s[a].value;if(!o||!Object.hasOwn(o,u))return!1;o=o[u]}return!0};default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function cc(n,e){const t=n.operator,i=ve(n.args[0]),r=ve(n.args[1]);switch(t){case S.Equal:return s=>i(s)===r(s);case S.NotEqual:return s=>i(s)!==r(s);case S.LessThan:return s=>i(s)<r(s);case S.LessThanOrEqualTo:return s=>i(s)<=r(s);case S.GreaterThan:return s=>i(s)>r(s);case S.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function hc(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ve(n.args[s]);switch(t){case S.Any:return s=>{for(let o=0;o<i;++o)if(r[o](s))return!0;return!1};case S.All:return s=>{for(let o=0;o<i;++o)if(!r[o](s))return!1;return!0};case S.Between:return s=>{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case S.In:return s=>{const o=r[0](s);for(let a=1;a<i;++a)if(o===r[a](s))return!0;return!1};case S.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function uc(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ve(n.args[s]);switch(t){case S.Multiply:return s=>{let o=1;for(let a=0;a<i;++a)o*=r[a](s);return o};case S.Divide:return s=>r[0](s)/r[1](s);case S.Add:return s=>{let o=0;for(let a=0;a<i;++a)o+=r[a](s);return o};case S.Subtract:return s=>r[0](s)-r[1](s);case S.Clamp:return s=>{const o=r[0](s),a=r[1](s);if(o<a)return a;const l=r[2](s);return o>l?l:o};case S.Mod:return s=>r[0](s)%r[1](s);case S.Pow:return s=>Math.pow(r[0](s),r[1](s));case S.Abs:return s=>Math.abs(r[0](s));case S.Floor:return s=>Math.floor(r[0](s));case S.Ceil:return s=>Math.ceil(r[0](s));case S.Round:return s=>Math.round(r[0](s));case S.Sin:return s=>Math.sin(r[0](s));case S.Cos:return s=>Math.cos(r[0](s));case S.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case S.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function dc(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ve(n.args[r]);return r=>{for(let s=0;s<t-1;s+=2)if(i[s](r))return i[s+1](r);return i[t-1](r)}}function fc(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ve(n.args[r]);return r=>{const s=i[0](r);for(let o=1;o<t-1;o+=2)if(s===i[o](r))return i[o+1](r);return i[t-1](r)}}function gc(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ve(n.args[r]);return r=>{const s=i[0](r),o=i[1](r);let a,l;for(let h=2;h<t;h+=2){const u=i[h](r);let d=i[h+1](r);const f=Array.isArray(d);if(f&&(d=Kl(d)),u>=o)return h===2?d:f?pc(s,o,a,l,u,d):Xt(s,o,a,l,u,d);a=u,l=d}return l}}function mc(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ve(n.args[s]);switch(t){case S.ToString:return s=>{const o=r[0](s);return n.args[0].type===Ce?Fi(o):o.toString()};default:throw new Error(`Unsupported convert operator ${t}`)}}function Xt(n,e,t,i,r,s){const o=r-t;if(o===0)return i;const a=e-t,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(s-i)}function pc(n,e,t,i,r,s){if(r-t===0)return i;const a=as(i),l=as(s);let h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);const u=[Xt(n,e,t,a[0],r,l[0]),Xt(n,e,t,a[1],r,l[1]),a[2]+Xt(n,e,t,0,r,h),Xt(n,e,t,i[3],r,s[3])];return Yl(u)}const Y={IDLE:0,LOADING:1,LOADED:2,ERROR:3};function yc(n,e){return new Promise((t,i)=>{function r(){o(),t(n)}function s(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",r),n.removeEventListener("error",s)}n.addEventListener("load",r),n.addEventListener("error",s)})}function _c(n,e){return e&&(n.src=e),n.src&&wo?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):yc(n)}class wc{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const t in this.cache_){const i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t){const i=ji(e,t);return i in this.cache_?this.cache_[i]:null}getPattern(e,t){const i=ji(e,t);return i in this.patternCache_?this.patternCache_[i]:null}set(e,t,i,r){const s=ji(e,t),o=s in this.cache_;this.cache_[s]=i,r&&(i.getImageState()===Y.IDLE&&i.load(),i.getImageState()===Y.LOADING?i.ready().then(()=>{this.patternCache_[s]=Wr().createPattern(i.getImage(1),"repeat")}):this.patternCache_[s]=Wr().createPattern(i.getImage(1),"repeat")),o||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function ji(n,e){const t=e?Vt(e):"null";return n+":"+t}const _e=new wc;let Kt=null;class ms extends Yn{constructor(e,t,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i==null?void 0:i.crossOrigin,this.referrerPolicy_=i==null?void 0:i.referrerPolicy,this.canvas_={},this.color_=s,this.imageState_=r===void 0?Y.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Y.LOADED){Kt||(Kt=De(1,1,void 0,{willReadFrequently:!0})),Kt.drawImage(this.image_,0,0);try{Kt.getImageData(0,0,1,1),this.tainted_=!1}catch{Kt=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(j.CHANGE)}handleImageError_(){this.imageState_=Y.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Y.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}setImage(e){this.image_=e}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],t=this.size_[1],i=De(e,t);i.fillRect(0,0,e,t),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Y.IDLE){this.image_||this.initializeImage_(),this.imageState_=Y.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&_c(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==Y.LOADED)return;const t=this.image_,i=De(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=i.canvas;i.scale(e,e),i.drawImage(t,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Zl(this.color_),i.fillRect(0,0,r.width/e,r.height/e),i.globalCompositeOperation="destination-in",i.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)e();else{const t=()=>{(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)&&(this.removeEventListener(j.CHANGE,t),e())};this.addEventListener(j.CHANGE,t)}})),this.ready_}}function Yt(n,e,t,i,r,s){let o=e===void 0?void 0:_e.get(e,r);return o||(o=new ms(n,n&&"src"in n?n.src||void 0:e,t,i,r),_e.set(e,r,o,s)),s&&o&&!_e.getPattern(e,r)&&_e.set(e,r,o,s),o}function ps(n){return n?Array.isArray(n)?Fi(n):typeof n=="object"&&"src"in n?Ec(n):n:null}function Ec(n){if(!n.offset||!n.size)return _e.getPattern(n.src,n.color);const e=n.src+":"+n.offset,t=_e.getPattern(e,n.color);if(t)return t;const i=_e.get(n.src,null);if(i.getImageState()!==Y.LOADED)return null;const r=De(n.size[0],n.size[1]);return r.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),Yt(r.canvas,e,void 0,Y.LOADED,n.color,!0),_e.getPattern(e,n.color)}const ys="#000",_s="round",ws="round",Cc=10,vc="#000",Ac=1,Rc=new xe;class An{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=gt(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new An({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return U()}getImage(e){return U()}getHitDetectionImage(){return U()}getPixelRatio(e){return 1}getImageState(){return U()}getImageSize(){return U()}getOrigin(){return U()}getSize(){return U()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=gt(e)}listenImageChange(e){U()}load(){U()}unlistenImageChange(e){U()}ready(){return Promise.resolve()}}class Rn extends An{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?Y.LOADING:Y.LOADED,this.imageState_===Y.LOADING&&this.ready().then(()=>this.imageState_=Y.LOADED),this.render()}clone(){const e=this.getScale(),t=new Rn({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}getAnchor(){const e=this.size_,t=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-t[0]/i[0],e[1]/2+t[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){var s,o;const t=(s=this.fill_)==null?void 0:s.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(",");let r=(o=_e.get(i,null))==null?void 0:o.getImage(1);if(!r){const a=this.renderOptions_,l=Math.ceil(a.size*e),h=De(l,l);this.draw_(a,h,e),r=h.canvas;const u=new ms(r,void 0,null,Y.LOADED,null);_e.set(i,null,u),createImageBitmap(r).then(d=>{u.setImage(d)})}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,i){if(t===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return t;let r=this.radius,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const v=r;r=s,s=v}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=s*Math.sin(a),h=Math.sqrt(s*s-l*l),u=r-h,d=Math.sqrt(l*l+u*u),f=d/l;if(e==="miter"&&f<=i)return f*t;const g=t/2/f,E=t/2*(u/d),p=Math.sqrt((r+g)*(r+g)+E*E)-r;if(this.radius2_===void 0||e==="bevel")return p*2;const C=r*Math.sin(a),T=Math.sqrt(r*r-C*C),L=s-T,M=Math.sqrt(C*C+L*L)/C;if(M<=i){const v=M*t/2-s-r;return 2*Math.max(p,v)}return p*2}createRenderOptions(){let e=_s,t=ws,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=ps(this.stroke_.getColor()??vc),a=this.stroke_.getWidth()??Ac,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??ws,e=this.stroke_.getLineCap()??_s,i=this.stroke_.getMiterLimit()??Cc);const l=this.calculateLineJoinSize_(t,a,i),h=Math.max(this.radius,this.radius2_||0),u=Math.ceil(2*h+l);return{strokeStyle:o,strokeWidth:a,size:u,lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:t,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,i){if(t.scale(i,i),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let r=this.fill_.getColor();r===null&&(r=ys),t.fillStyle=ps(r),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let i=this.fill_.getColor(),r=0;typeof i=="string"&&(i=Vt(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(t=De(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_;const i=this.radius;if(t===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(t*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/t;for(let a=0;a<t;a++){const l=s+a*o,h=a%2===0?i:r;e.lineTo(h*Math.cos(l),h*Math.sin(l))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=ys,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class Mn extends Rn{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){const e=this.getScale(),t=new Mn({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}}class pt{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new pt({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const t=Yt(null,e.src,{crossOrigin:"anonymous"},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===Y.IDLE&&t.load(),t.getImageState()===Y.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?Je(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:Vt(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Es(n,e,t,i){return t!==void 0&&i!==void 0?[t/n,i/e]:t!==void 0?t/n:i!==void 0?i/e:1}class Zi extends An{constructor(e){e=e||{};const t=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,r=e.scale!==void 0?e.scale:1,s=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:t,rotation:i,scale:r,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:s,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null,this.referrerPolicy_=e.referrerPolicy;const o=e.img!==void 0?e.img:null;let a=e.src;ie(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||Je(o)),ie(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),ie(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(e.src!==void 0?l=Y.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?Y.LOADED:Y.IDLE:l=Y.LOADING:l=Y.LOADED),this.color_=e.color!==void 0?Vt(e.color):null,this.iconImage_=Yt(o,a,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let h,u;if(e.size)[h,u]=e.size;else{const d=this.getImage(1);if(d.width&&d.height)h=d.width,u=d.height;else if(d instanceof HTMLImageElement){this.initialOptions_=e;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(Es(g[0],g[1],e.width,e.height))};this.listenImageChange(f);return}}h!==void 0&&this.setScale(Es(h,u,e.width,e.height))}}clone(){let e,t,i;return this.initialOptions_?(t=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new Zi({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:t,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=r[0]),this.anchorYUnits_=="fraction"&&(e[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+r[1])}this.normalizedAnchor_=e}const t=this.getDisplacement(),i=this.getScaleArray();return[e[0]-t[0]/i[0],e[1]+t[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}setColor(e){const t=e?Vt(e):null;if(this.color_===t||this.color_&&t&&this.color_.length===t.length&&this.color_.every((o,a)=>o===t[a]))return;this.color_=t;const i=this.getSrc(),r=i!==void 0?null:this.getHitDetectionImage(),s=i!==void 0?Y.IDLE:this.iconImage_.getImageState();this.iconImage_=Yt(r,i,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},s,this.color_)}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=Yt(null,e,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},Y.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==Y.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==Y.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(j.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(j.CHANGE,e)}ready(){return this.iconImage_.ready()}}class Pn{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.offset_=e.offset,this.width_=e.width}clone(){const e=this.getColor();return new Pn({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),offset:this.getOffset(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getOffset(){return this.offset_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}}class Ue{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=vs,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Ue({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=vs,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function Mc(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(ie(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let Xi=null;function Cs(n,e){if(!Xi){const t=new pt({color:"rgba(255,255,255,0.4)"}),i=new Pn({color:"#3399CC",width:1.25});Xi=[new Ue({image:new Mn({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return Xi}function vs(n){return n.getGeometry()}const Pc="#333";class Ki{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=gt(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new pt({color:Pc}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Ki({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof pt?this.getFill().clone():this.getFill(),stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=gt(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}function Lc(n){return!0}function Tc(n){const e=cs(),t=Sc(n,e),i=gs();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,e.featureId){const o=r.getId();o!==void 0?i.featureId=o:i.featureId=null}return e.geometryType&&(i.geometryType=fs(r.getGeometry())),t(i)}}function As(n){const e=cs(),t=n.length,i=new Array(t);for(let o=0;o<t;++o)i[o]=Yi(n[o],e);const r=gs(),s=new Array(t);return function(o,a){if(r.properties=o.getPropertiesInternal(),r.resolution=a,e.featureId){const h=o.getId();h!==void 0?r.featureId=h:r.featureId=null}let l=0;for(let h=0;h<t;++h){const u=i[h](r);u&&(s[l]=u,l+=1)}return s.length=l,s}}function Sc(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r){const s=n[r],o="filter"in s?Re(s.filter,ce,e):Lc;let a;if(Array.isArray(s.style)){const l=s.style.length;a=new Array(l);for(let h=0;h<l;++h)a[h]=Yi(s.style[h],e)}else a=[Yi(s.style,e)];i[r]={filter:o,styles:a}}return function(r){const s=[];let o=!1;for(let a=0;a<t;++a){const l=i[a].filter;if(l(r)&&!(n[a].else&&o)){o=!0;for(const h of i[a].styles){const u=h(r);u&&s.push(u)}}}return s}}function Yi(n,e){const t=$t(n,"",e),i=Ht(n,"",e),r=Ic(n,e),s=bc(n,e),o=ae(n,"z-index",e);if(!t&&!i&&!r&&!s&&!tr(n))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(n));const a=new Ue;return function(l){let h=!0;if(t){const u=t(l);u&&(h=!1),a.setFill(u)}if(i){const u=i(l);u&&(h=!1),a.setStroke(u)}if(r){const u=r(l);u&&(h=!1),a.setText(u)}if(s){const u=s(l);u&&(h=!1),a.setImage(u)}return o&&a.setZIndex(o(l)),h?null:a}}function $t(n,e,t){let i;if(e+"fill-pattern-src"in n)i=Dc(n,e+"fill-",t);else{if(n[e+"fill-color"]==="none")return s=>null;i=Ln(n,e+"fill-color",t)}if(!i)return null;const r=new pt;return function(s){const o=i(s);return o===bi?null:(r.setColor(o),r)}}function Ht(n,e,t){const i=ae(n,e+"stroke-width",t),r=Ln(n,e+"stroke-color",t);if(!i&&!r)return null;const s=Ie(n,e+"stroke-line-cap",t),o=Ie(n,e+"stroke-line-join",t),a=Rs(n,e+"stroke-line-dash",t),l=ae(n,e+"stroke-line-dash-offset",t),h=ae(n,e+"stroke-miter-limit",t),u=ae(n,e+"stroke-offset",t),d=new Pn;return function(f){if(r){const g=r(f);if(g===bi)return null;d.setColor(g)}if(i&&d.setWidth(i(f)),s){const g=s(f);if(g!=="butt"&&g!=="round"&&g!=="square")throw new Error("Expected butt, round, or square line cap");d.setLineCap(g)}if(o){const g=o(f);if(g!=="bevel"&&g!=="round"&&g!=="miter")throw new Error("Expected bevel, round, or miter line join");d.setLineJoin(g)}return a&&d.setLineDash(a(f)),l&&d.setLineDashOffset(l(f)),h&&d.setMiterLimit(h(f)),u&&d.setOffset(u(f)),d}}function Ic(n,e){const t="text-",i=Ie(n,t+"value",e);if(!i)return null;const r=$t(n,t,e),s=$t(n,t+"background-",e),o=Ht(n,t,e),a=Ht(n,t+"background-",e),l=Ie(n,t+"font",e),h=ae(n,t+"max-angle",e),u=ae(n,t+"offset-x",e),d=ae(n,t+"offset-y",e),f=yt(n,t+"overflow",e),g=Ie(n,t+"placement",e),E=ae(n,t+"repeat",e),m=Sn(n,t+"scale",e),p=yt(n,t+"rotate-with-view",e),C=ae(n,t+"rotation",e),T=Ie(n,t+"align",e),L=Ie(n,t+"justify",e),w=Ie(n,t+"baseline",e),M=yt(n,t+"keep-upright",e),v=Rs(n,t+"padding",e),A=In(n,t+"declutter-mode"),I=new Ki({declutterMode:A});return function(x){if(I.setText(i(x)),r&&I.setFill(r(x)),s&&I.setBackgroundFill(s(x)),o&&I.setStroke(o(x)),a&&I.setBackgroundStroke(a(x)),l&&I.setFont(l(x)),h&&I.setMaxAngle(h(x)),u&&I.setOffsetX(u(x)),d&&I.setOffsetY(d(x)),f&&I.setOverflow(f(x)),g){const P=g(x);if(P!=="point"&&P!=="line")throw new Error("Expected point or line for text-placement");I.setPlacement(P)}if(E&&I.setRepeat(E(x)),m&&I.setScale(m(x)),p&&I.setRotateWithView(p(x)),C&&I.setRotation(C(x)),T){const P=T(x);if(P!=="left"&&P!=="center"&&P!=="right"&&P!=="end"&&P!=="start")throw new Error("Expected left, right, center, start, or end for text-align");I.setTextAlign(P)}if(L){const P=L(x);if(P!=="left"&&P!=="right"&&P!=="center")throw new Error("Expected left, right, or center for text-justify");I.setJustify(P)}if(w){const P=w(x);if(P!=="bottom"&&P!=="top"&&P!=="middle"&&P!=="alphabetic"&&P!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");I.setTextBaseline(P)}return v&&I.setPadding(v(x)),M&&I.setKeepUpright(M(x)),I}}function bc(n,e){return"icon-src"in n?xc(n,e):"shape-points"in n?kc(n,e):"circle-radius"in n?Oc(n,e):null}function xc(n,e){const t="icon-",i=t+"src",r=Ts(n[i],i),s=Tn(n,t+"anchor",e),o=Sn(n,t+"scale",e),a=ae(n,t+"opacity",e),l=Tn(n,t+"displacement",e),h=ae(n,t+"rotation",e),u=yt(n,t+"rotate-with-view",e),d=Ps(n,t+"anchor-origin"),f=Ls(n,t+"anchor-x-units"),g=Ls(n,t+"anchor-y-units"),E=Se(n,t+"color");let m,p=null;E!==void 0&&(Array.isArray(E)&&E.length>0&&typeof E[0]=="string"?p=Ln(n,t+"color",e):m=Ss(E,t+"color"));const C=Gc(n,t+"cross-origin"),T=Bc(n,t+"offset"),L=Ps(n,t+"offset-origin"),w=$i(n,t+"width"),M=$i(n,t+"height"),v=Nc(n,t+"size"),A=In(n,t+"declutter-mode"),I={src:r,anchorOrigin:d,anchorXUnits:f,anchorYUnits:g,crossOrigin:C,offset:T,offsetOrigin:L,height:M,width:w,size:v,declutterMode:A};let x=null;return function(P){if(x)p&&x.setColor(p(P));else{const k=p?p(P):m;x=new Zi(k!==void 0?Object.assign({},I,{color:k}):Object.assign({},I))}return a&&x.setOpacity(a(P)),l&&x.setDisplacement(l(P)),h&&x.setRotation(h(P)),u&&x.setRotateWithView(u(P)),o&&x.setScale(o(P)),s&&x.setAnchor(s(P)),x}}function kc(n,e){const t="shape-",i=t+"points",r=t+"radius",s=Hi(n[i],i);if(!(r in n))throw new Error(`Expected a number for ${r}`);const o=ae(n,r,e),a=typeof n[r]=="number"?n[r]:5,l=t+"radius2",h=ae(n,l,e),u=typeof n[l]=="number"?n[l]:void 0,d=$t(n,t,e),f=Ht(n,t,e),g=Sn(n,t+"scale",e),E=Tn(n,t+"displacement",e),m=ae(n,t+"rotation",e),p=yt(n,t+"rotate-with-view",e),C=$i(n,t+"angle"),T=In(n,t+"declutter-mode"),L=new Rn({points:s,radius:a,radius2:u,angle:C,declutterMode:T});return function(w){return o&&L.setRadius(o(w)),h&&L.setRadius2(h(w)),d&&L.setFill(d(w)),f&&L.setStroke(f(w)),E&&L.setDisplacement(E(w)),m&&L.setRotation(m(w)),p&&L.setRotateWithView(p(w)),g&&L.setScale(g(w)),L}}function Oc(n,e){const t="circle-",i=$t(n,t,e),r=Ht(n,t,e),s=ae(n,t+"radius",e),o=Sn(n,t+"scale",e),a=Tn(n,t+"displacement",e),l=ae(n,t+"rotation",e),h=yt(n,t+"rotate-with-view",e),u=In(n,t+"declutter-mode"),d=new Mn({radius:5,declutterMode:u});return function(f){return s&&d.setRadius(s(f)),i&&d.setFill(i(f)),r&&d.setStroke(r(f)),a&&d.setDisplacement(a(f)),l&&d.setRotation(l(f)),h&&d.setRotateWithView(h(f)),o&&d.setScale(o(f)),d}}function Se(n,e){if(!(e in n))return;const t=n[e];return t===void 0?void 0:t}function ae(n,e,t){const i=Se(n,e);if(i===void 0)return;const r=Re(i,z,t);return function(s){return Hi(r(s),e)}}function Ie(n,e,t){const i=Se(n,e);if(i===void 0)return null;const r=Re(i,fe,t);return function(s){return Ts(r(s),e)}}function Dc(n,e,t){const i=Ie(n,e+"pattern-src",t),r=Ms(n,e+"pattern-offset",t),s=Ms(n,e+"pattern-size",t),o=Ln(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function yt(n,e,t){const i=Se(n,e);if(i===void 0)return null;const r=Re(i,ce,t);return function(s){const o=r(s);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${e}`);return o}}function Ln(n,e,t){const i=Se(n,e);if(i===void 0)return null;const r=Re(i,Ce,t);return function(s){return Ss(r(s),e)}}function Rs(n,e,t){const i=Se(n,e);if(i===void 0)return null;if(Array.isArray(i)&&(i.length===0||typeof i[0]!="string")){const s=i.map((o,a)=>{if(typeof o=="number")return()=>o;const l=Re(o,z,t);return function(h){return Hi(l(h),`${e}[${a}]`)}});return function(o){const a=new Array(s.length);for(let l=0;l<s.length;++l)a[l]=s[l](o);return a}}const r=Re(i,He,t);return function(s){return Ut(r(s),e)}}function Tn(n,e,t){const i=Se(n,e);if(i===void 0)return null;const r=Re(i,He,t);return function(s){const o=Ut(r(s),e);if(o.length!==2)throw new Error(`Expected two numbers for ${e}`);return o}}function Ms(n,e,t){const i=Se(n,e);if(i===void 0)return null;const r=Re(i,He,t);return function(s){return Is(r(s),e)}}function Sn(n,e,t){const i=Se(n,e);if(i===void 0)return null;const r=Re(i,He|z,t);return function(s){return Fc(r(s),e)}}function $i(n,e){const t=n[e];if(t!==void 0){if(typeof t!="number")throw new Error(`Expected a number for ${e}`);return t}}function Nc(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return gt(t);if(!Array.isArray(t))throw new Error(`Expected a number or size array for ${e}`);if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return t}}function Gc(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);return t}}function Ps(n,e){const t=n[e];if(t!==void 0){if(t!=="bottom-left"&&t!=="bottom-right"&&t!=="top-left"&&t!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return t}}function Ls(n,e){const t=n[e];if(t!==void 0){if(t!=="pixels"&&t!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return t}}function Bc(n,e){const t=n[e];if(t!==void 0)return Ut(t,e)}function In(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);if(t!=="declutter"&&t!=="obstacle"&&t!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return t}}function Ut(n,e){if(!Array.isArray(n))throw new Error(`Expected an array for ${e}`);const t=n.length;for(let i=0;i<t;++i)if(typeof n[i]!="number")throw new Error(`Expected an array of numbers for ${e}`);return n}function Ts(n,e){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}function Hi(n,e){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}function Ss(n,e){if(typeof n=="string")return n;const t=Ut(n,e),i=t.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return t}function Is(n,e){const t=Ut(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function Fc(n,e){return typeof n=="number"?n:Is(n,e)}const bs={RENDER_ORDER:"renderOrder"};class Vc extends Li{constructor(e){e=e||{};const t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(bs.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new xl(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(bs.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?Cs:e;const t=zc(e);this.styleFunction_=e===null?void 0:Mc(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function zc(n){if(n===void 0)return Cs;if(!n)return null;if(typeof n=="function"||n instanceof Ue)return n;if(!Array.isArray(n))return As([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof Ue){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!(o instanceof Ue))throw new Error("Expected a list of style instances");r[s]=o}return r}if("style"in t){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!("style"in o))throw new Error("Expected a list of rules with a style property");r[s]=o}return Tc(r)}return As(n)}class jc extends Ve{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}class Zc extends Xn{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){U()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;kr(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),va(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let h;const u=t.viewState;function d(w,M,v,A){return s.call(o,M,w?v:null,A)}const f=u.projection,g=zo(e.slice(),f),E=[[0,0]];if(f.canWrapX()&&r){const w=f.getExtent(),M=nt(w);E.push([-M,0],[M,0])}const m=t.layerStatesArray,p=m.length,C=[],T=[];for(let w=0;w<E.length;w++)for(let M=p-1;M>=0;--M){const v=m[M],A=v.layer;if(A.hasRenderer()&&Ti(v,u)&&a.call(l,A)){const I=A.getRenderer(),x=A.getSource();if(I&&x){const P=x.getWrapX()?g:e,k=d.bind(null,v.managed);T[0]=P[0]+E[w][0],T[1]=P[1]+E[w][1],h=I.forEachFeatureAtCoordinate(T,t,i,k,C)}if(h)return h}}if(C.length===0)return;const L=1/C.length;return C.forEach((w,M)=>w.distanceSq+=M*L),C.sort((w,M)=>w.distanceSq-M.distanceSq),C.some(w=>h=w.callback(w.feature,w.layer,w.geometry)),h}hasFeatureAtCoordinate(e,t,i,r,s,o){return this.forEachFeatureAtCoordinate(e,t,i,r,en,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){U()}scheduleExpireIconCache(e){_e.canExpireCache()&&e.postRenderFunctions.push(Xc)}}function Xc(n,e){_e.expire()}class Kc extends Zc{constructor(e){super(e),this.fontChangeListenerKey_=H(Rc,At.PROPERTYCHANGE,e.redrawText,e),this.element_=tt?sl():document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=_n+" ol-layers";const i=e.getViewport();i&&i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const i=this.getMap();if(i.hasListener(e)){const r=new jc(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){ne(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(ut.PRECOMPOSE,e);const t=e.layerStatesArray.sort((h,u)=>h.zIndex-u.zIndex);t.some(h=>h.layer instanceof Vc&&h.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let h=0,u=t.length;h<u;++h){const d=t[h];e.layerIndex=h;const f=d.layer,g=f.getSourceState();if(!Ti(d,r)||g!="ready"&&g!="undefined"){f.unrender();continue}const E=f.render(e,o);E&&(E!==o&&(this.children_.push(E),o=E),s.push(d))}this.declutter(e,s),rl(this.element_,this.children_);const l=this.getMap().getTargetElement();if(Ke(l)){const h=l.getContext("2d");for(const u of this.children_){const d=u.firstElementChild||u,f=u.style.backgroundColor;if(f&&(!Ke(d)||d.width>0)&&(h.fillStyle=f,h.fillRect(0,0,l.width,l.height)),Ke(d)&&d.width>0){h.save();const g=u.style.opacity||d.style.opacity;h.globalAlpha=g===""?1:Number(g);const E=d.style.transform;if(E)h.transform(...Ra(E));else{const m=parseFloat(d.style.width)/d.width,p=parseFloat(d.style.height)/d.height;h.transform(m,0,0,p,0,0)}h.drawImage(d,0,0),h.restore()}}}this.dispatchRenderEvent(ut.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let i=t.length-1;i>=0;--i){const r=t[i],s=r.layer;s.getDeclutter()&&s.renderDeclutter(e,r)}t.forEach(i=>i.layer.renderDeferred(e))}}}function xs(n){if(n instanceof Li){n.setMapInternal(null);return}n instanceof ht&&n.getLayers().forEach(xs)}function ks(n,e){if(n instanceof Li){n.setMapInternal(e);return}if(n instanceof ht){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)ks(t[i],e)}}let Yc=class extends xe{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=$c(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:_o,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=ui(),this.pixelToCoordinateTransform_=ui(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,tt||(this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,tt||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(tt?new we:cl()),this.interactions=t.interactions||(tt?new we:is({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new vo(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(le.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(le.VIEW,this.handleViewChanged_),this.addChangeListener(le.SIZE,this.handleSizeChanged_),this.addChangeListener(le.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof Te)&&e.view.then(function(r){i.setView(new Te(r))}),this.controls.addEventListener(me.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(me.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(me.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(me.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(me.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(me.REMOVE,r=>{const s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){ks(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){var e;this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),(e=this.resizeObserver_)==null||e.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:en,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,t,null,o,null)}getFeaturesAtPixel(e,t){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},t),i}getAllLayers(){const e=[];function t(i){i.forEach(function(r){r instanceof ht?t(r.getLayers()):e.push(r)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const r=t.layerFilter!==void 0?t.layerFilter:en,s=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(le.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return hi(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?xr(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(le.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof we){t.setLayers(e);return}const i=t.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t];if(!r.visible)continue;const s=r.layer.getRenderer();if(s&&!s.ready)return!0;const o=r.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(e){const t=Le(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?xr(t.coordinateToPixelTransform,e.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(e){this.pixelRatio_!==e&&(this.pixelRatio_=e,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get(le.SIZE)}getView(){return this.get(le.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,i,r){return Ao(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){t=t||e.type;const i=new ke(t,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===Hn.POINTERDOWN||i===j.WHEEL||i===j.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=t.target,a=s instanceof ShadowRoot?s.host===o?s.host.ownerDocument:s:s===r?r.documentElement:s;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=0;s--){const o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const o=e.viewHints;if(o[pe.ANIMATING]||o[pe.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(ut.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(ut.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new et(Oe.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new et(Oe.LOADSTART,this,e))));const i=this.postRenderFunctions_;if(e)for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){var i,r;if(this.mapBrowserEventHandler_){for(let s=0,o=this.targetChangeHandlerKeys_.length;s<o;++s)ne(this.targetChangeHandlerKeys_[s]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(j.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(j.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!Ke(this.targetElement_)){(i=this.resizeObserver_)==null||i.unobserve(this.targetElement_);const s=this.targetElement_.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.unobserve(s.host),this.setSize(void 0)}const e=this.getTarget(),t=typeof e=="string"?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{if(Ke(t)||t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Kc(this)),!Ke(t)){this.mapBrowserEventHandler_=new Eo(this,this.moveTolerance_);for(const o in J)this.mapBrowserEventHandler_.addEventListener(J[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(j.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(j.WHEEL,this.boundHandleBrowserEvent_,cr?{passive:!1}:!1);let s;if(this.keyboardEventTarget_)s=this.keyboardEventTarget_;else{const o=t.getRootNode();s=o instanceof ShadowRoot?o.host:t}if(this.targetChangeHandlerKeys_=[H(s,j.KEYDOWN,this.handleBrowserEvent,this),H(s,j.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){const o=t.getRootNode();o instanceof ShadowRoot&&this.resizeObserver_.observe(o.host),(r=this.resizeObserver_)==null||r.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(ne(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(ne(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=H(e,At.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=H(e,j.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(ne),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new Ge("addlayer",e)),this.layerGroupPropertyListenerKeys_=[H(e,At.PROPERTYCHANGE,this.render,this),H(e,j.CHANGE,this.render,this),H(e,"addlayer",this.handleLayerAdd_,this),H(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;const e=this.frameState_.layerStatesArray;for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){xs(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(t!==void 0&&ls(t)&&i&&i.isDef()){const o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:qn(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Je(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=qn(a.nextCenter,a.nextResolution,l,t)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!Qn(this.previousExtent_)&&!fr(s.extent,this.previousExtent_))&&(this.dispatchEvent(new et(Oe.MOVESTART,this,r)),this.previousExtent_=an(this.previousExtent_)),this.previousExtent_&&!s.viewHints[pe.ANIMATING]&&!s.viewHints[pe.INTERACTING]&&!fr(s.extent,this.previousExtent_)&&(this.dispatchEvent(new et(Oe.MOVEEND,this,s)),Mo(s.extent,this.previousExtent_))),this.dispatchEvent(new et(Oe.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(Oe.LOADSTART)||this.hasListener(Oe.LOADEND)||this.hasListener(ut.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new Ge("removelayer",t)),this.set(le.LAYERGROUP,e)}setSize(e){this.set(le.SIZE,e)}setTarget(e){this.set(le.TARGET,e)}setView(e){if(!e||e instanceof Te){this.set(le.VIEW,e);return}this.set(le.VIEW,new Te);const t=this;e.then(function(i){t.setView(new Te(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){let r,s;if(Ke(e)){const o=e.getContext("2d").getTransform();r=e.width/o.a,s=e.height/o.d}else{const o=getComputedStyle(e);r=e.offsetWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight)-parseFloat(o.borderRightWidth),s=e.offsetHeight-parseFloat(o.borderTopWidth)-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom)-parseFloat(o.borderBottomWidth)}!isNaN(r)&&!isNaN(s)&&(t=[Math.max(0,r),Math.max(0,s)],!ls(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&mr("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!Kn(t,i))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function $c(n){let e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const t={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new ht({layers:n.layers});t[le.LAYERGROUP]=i,t[le.TARGET]=n.target,t[le.VIEW]=n.view instanceof Te?n.view:new Te;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new we(n.controls.slice()):(ie(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new we(n.interactions.slice()):(ie(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new we(n.overlays.slice()):(ie(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new we,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}class Os{constructor(){y(this,"map",null);y(this,"_lPolygon",null);y(this,"_measureTooltip",null);y(this,"currentLayer",[!1,!1,!0]);y(this,"polygonGeojsonArr",[]);y(this,"polygonGeojson",null);y(this,"lModifyEventArr",[]);y(this,"lmap",null);y(this,"lMEvent",null);y(this,"am",new R.AM);y(this,"type",2);y(this,"lPolygonNewArr",[]);y(this,"polygonGeojsonMap",new Map);y(this,"drawPolygonArr",new Set);y(this,"drawLineArr",new Set);y(this,"_lRectangle",null);y(this,"layers",[]);y(this,"drawZIndex",1)}init(e){const{el:t,type:i,callback:r,viewOptions:s,layerType:o,mapType:a}=e;this.initMap({el:t,callback:r,viewOptions:s,type:i,layerType:o})}initMap({el:e,callback:t,type:i,viewOptions:r,layerType:s}){this.lmap||(this.lmap=new R.LMap({controls:R.MapConfig.Defaults,interactions:is({pinchRotate:!1})})),setTimeout(()=>{(async()=>{var l,h;this.map&&(this.map=null);const a=await((l=this.lmap)==null?void 0:l.onLoad(e,i,s));this.map=(a==null?void 0:a.map)??null,this.layers=(a==null?void 0:a.layers)??[],R.MapConfig.View=r,(h=this.map)==null||h.setView(R.MapConfig.View),t&&t(this.map,this.layers)})()},100)}get getMapTypeLength(){var e;return(e=this.lmap)==null?void 0:e.getMapTypeLength}get getLayeTypeLength(){var e;return(e=this.lmap)==null?void 0:e.getLayeTypeLength}selectMapLayer(e,t){return this.lmap?this.lmap.selectLayers(e,t):0}initBingMap(e,t,i){this.lmap||(this.lmap=new R.LMap({controls:R.MapConfig.Defaults})),setTimeout(()=>{(async()=>{var o,a;this.map;const s=await((o=this.lmap)==null?void 0:o.onLoad(e,2,2));this.map=(s==null?void 0:s.map)??null,this.layers=(s==null?void 0:s.layers)??[],R.MapConfig.View=i,(a=this.map)==null||a.setView(R.MapConfig.View),t&&t(this.map,s==null?void 0:s.layers)})()},100)}initBingMapNew(e,t,i){this.lmap||(this.lmap=new R.LMap({controls:R.MapConfig.Defaults})),setTimeout(()=>{(async()=>{var o,a;this.map;const s=await((o=this.lmap)==null?void 0:o.onLoad(e,0,2));this.map=(s==null?void 0:s.map)??null,this.layers=(s==null?void 0:s.layers)??[],R.MapConfig.View=i,(a=this.map)==null||a.setView(R.MapConfig.View),t&&t(this.map,s==null?void 0:s.layers)})()},100)}async initVectorMap(e){const{el:t,isAnalysisBBOX:i,isAnalysisCenter:r,callback:s,delaytime:o,isDrag:a}=e,l=new R.VectorMap({isAnalysisBBOX:i,isAnalysisCenter:r,isDrag:a,isFistData:!1,callback:h=>{s&&s(h)}});return new Promise(h=>{setTimeout(async()=>{const u=await l.onLoad(t);h({map:u,vmap:l})},o||100)})}async initStaticMap(e,t){return await new Promise((i,r)=>{setTimeout(()=>{const s=new Yc({target:e,view:t.view,layers:[t.layer]});if(this.map=s,this.layers=[t.layer],s){i(s);return}r(null)},30)})}getVectorLayerView(){return R.MapConfig.getVectorLayerView}onSetLayers(e){this.type=e,this.currentLayer=this.currentLayer.map(t=>!1),this.currentLayer[e]=!0,this.removeLayers(e),this.addLayers(e)}removeLayers(e){R.MapConfig.TMapLayerArr[e].forEach((t,i)=>{var r;(r=this.map)==null||r.removeLayer(t)})}addLayers(e){R.MapConfig.TMapLayerArr[e].forEach((t,i)=>{var r;(r=this.map)==null||r.addLayer(t)})}onCreatePolygon(e,t=!1){var i;if(this.polygonGeojson&&((i=this.map)==null||i.removeLayer(this.polygonGeojson)),this._lPolygon&&this.clearlPolygon(),!!this.map)return this._lPolygon=new R.LPolygon(this.map,{strokeColor:"rgba(255,201,14, 1)",fillColor:"rgba(255,201,14, 0.4)"},t),this._lPolygon}skipCurrentDraw(){this._lPolygon&&this._lPolygon.skipCurrentDraw()}onCancel(){this._lPolygon&&this._lPolygon.removeLastPoint()}onDelete(e){this._lPolygon&&(this._lPolygon.remove(),this._lPolygon=null,this._removeMeasureTooltip(),e&&e())}getGeoJson(){if(this._lPolygon){const[e,t]=this._lPolygon.getCenterPoint();return R.createGeoJson(this._lPolygon.getCoordinates(),{ruleId:"",centerlon:e,centerlat:t})}return null}getGeoJsonNew(e){if(this.polygonGeojson){const t=this.polygonGeojson;return R.createGeoJson(t.getSource().getFeatures()[0].getGeometry().getCoordinates(),{ruleId:"",centerlon:0,centerlat:0})}return null}getPolygonGeoJson(){return this._lPolygon?this._lPolygon.getGeoJson():null}onCreateLine(e){if(this.map){const t=new R.LDraw("LineString",e||(()=>{}),this.map,this.drawZIndex);return this.drawLineArr.add(t),t}return null}onCreateArea(e){if(this.map){const t=new R.LDraw("Polygon",e||(()=>{}),this.map,this.drawZIndex);return this.drawPolygonArr.add(t),t}return null}removeDrawArr(){this.drawLineArr.forEach(e=>{if(e)try{e.clear()}catch{}}),this.drawLineArr.clear(),this.drawPolygonArr.forEach(e=>{if(e)try{e.clear()}catch{}}),this.drawPolygonArr.clear()}clearlPolygon(){this.map&&this._lPolygon&&(this._lPolygon.remove(),this._lPolygon=null)}_createMeasureTooltip(){const e=new R.MeasureTooltip;return e.setOffset([0,-30]),this._measureTooltip=e,e}_removeMeasureTooltip(){this.map&&this._measureTooltip&&this.map.removeOverlay(this._measureTooltip.getMarker())}createPolygonGeojson(e,t="rgba(255, 255, 255, 0.3)",i="rgba(00, 131, 241, 1)",r,s=!1,o=[]){if(this.map){const a=R.createPolygonGeojson(e,t,i,r,s,o);this.polygonGeojsonArr.push(a),this.polygonGeojson=null,this.map.addLayer(a)}}createPolygonGeojsonNew(e,t="rgba(255, 255, 255, 0.3)",i="rgba(00, 131, 241, 1)",r,s=!1){if(this.polygonGeojson&&(this.polygonGeojson=null),this.map){const o=R.createPolygonGeojson(e,t,i,r,s);this.polygonGeojson=o,this.map.addLayer(o)}}removePolygonGeojsons(){var t;if(!this.polygonGeojsonArr.length)return;let e=null;for(;e=this.polygonGeojsonArr.shift();)(t=this.map)==null||t.removeLayer(e),e=null}removePolygonGeojsonNew(){var e;this.polygonGeojson&&((e=this.map)==null||e.removeLayer(this.polygonGeojson),this.polygonGeojson=null)}clear(){this.map&&(this.am&&(this.am=new R.AM),this.removeOverlays(),this.removeLModifyEventArr(),this.removePolygonGeojsons(),this.clearlPolygon(),this.removeLModifyEvent(),this.removePolygonGeojsonNew(),this.removeMapsLayers())}clearNew(){this.removeOverlays(),this.removeLModifyEventArr(),this.removePolygonGeojsons(),this.clearlPolygon(),this.removeLModifyEvent(),this.removePolygonGeojsonNew()}getMap(){return this.map}setCenter([e,t],i){if(!this.map)return;const r=this.map.getView();r.setCenter([e,t]),i>0&&r.setZoom(i)}setZoom(e){if(!this.map)return;this.map.getView().setZoom(e)}setMaxZoom(e){if(!this.map)return;this.map.getView().setMaxZoom(e)}setMinZoom(e){if(!this.map)return;this.map.getView().setMinZoom(e)}get getZoom(){return this.map?this.map.getView().getZoom():0}getCenter(){if(!this.map)return;const e=this.map.getView(),[t,i]=e.getCenter();return[t,i]}fit(e){this.map&&R.fitNew(this.map,e,null)}createMarker(e,t=15,i=15){return new R.LMarker(e,t,i)}removeMarker(e){var t;(t=this.map)==null||t.removeOverlay(e.getMarker())}lModifyEvent_(){this.lModifyEventArr=[],this.polygonGeojsonArr.forEach((e,t)=>{const i=new R.LModifyEvent(e,this.map);i.setActive(),this.lModifyEventArr.push(i)})}removeLModifyEventArr(){if(!this.lModifyEventArr.length)return;let e=null;for(;e=this.lModifyEventArr.shift();)e.setActive(!1),e.remove(),e=null}lModifyEvent(){if(this.map&&this.polygonGeojson){const e=new R.LModifyEvent(this.polygonGeojson,this.map);e.setActive(),this.lMEvent=e}}removeLModifyEvent(){this.lMEvent&&(this.lMEvent.setActive(!1),this.lMEvent.remove())}convertWGS84GeoJSONgcj_encrypt(e){const{bbox:t,geometry:i,properties:r}=e,s=[];for(let l=0;l<t.length;l+=2){const{lon:h,lat:u}=R.GPS.gcj_encrypt(t[l],t[l+1]);s.push(h),s.push(u)}e.bbox=s;const o=i.coordinates,a=[];for(let l=0;l<o.length;l++){a.push(o[l]);for(let h=0;h<o[l].length;h++){const u=o[l][h],{lon:d,lat:f}=R.GPS.gcj_encrypt(u[0],u[1]);a[l][h]=[d,f]}}if(i.coordinates=a,r&&r.center){const[l,h]=r.center,{lat:u,lon:d}=R.GPS.gcj_encrypt(l,h);e.properties.center=[u,d]}return e}gcj_encryptConvertWGS84GeoJSON(e){const{bbox:t,geometry:i,properties:r}=e,s=[];for(let l=0;l<t.length;l+=2){const{lon:h,lat:u}=R.GPS.gcj_decrypt(t[l],t[l+1]);s.push(h),s.push(u)}e.bbox=s;const o=i.coordinates,a=[];for(let l=0;l<o.length;l++){a.push(o[l]);for(let h=0;h<o[l].length;h++){const u=o[l][h],{lon:d,lat:f}=R.GPS.gcj_decrypt(u[0],u[1]);a[l][h]=[d,f]}}if(i.coordinates=a,r&&r.center){const[l,h]=r.center,{lat:u,lon:d}=R.GPS.gcj_decrypt(l,h);e.properties.center=[u,d]}return e}gcj_encrypt(e,t){return R.GPS.gcj_encrypt(e,t)}gcj_decrypt(e,t){return R.GPS.gcj_decrypt(e,t)}formatArea(){return!this._lPolygon||!this._lPolygon.getGeometry()?0:R.formatArea(this._lPolygon.getGeometry())}formatLength(){return!this._lPolygon||!this._lPolygon.getGeometry()?0:R.formatLength(this._lPolygon.getGeometry())}createPolylinePointList(e,t=!1,i=!0,r=null,s=0){let o=[];const a=R.createPolylinePoints(e,t);if(o=R.addPolylinePoint(a,this.map),R.createGPSPoints(e,t,this.am)!=null){let h=this.am.getLngLats();if(s&&(h=this.am.getLngLatGCJ02()),!this.map)return;R.fitNew(this.map,[h[0],h[1],h[2],h[3]],null)}return o}removeAreaCenterPoint(){window.localStorage.removeItem("createPointData")}polygonStyle(){return R.polygonStyle}removeMapsLayers(){var t,i;const e=(t=this.map)==null?void 0:t.getLayers().getArray();if(e)for(let r=e.length;0<=r;r--)(i=this.map)==null||i.removeLayer(e[r])}removeOverlays(){if(!this.map)return;const e=this.map.getOverlays().getArray();for(let t=e.length;0<=t;t--)this.map.removeOverlay(e[t])}resetAM(){this.am=new R.AM}createPolygonBoundary(e,t){var r;const i=R.createPolygonBoundary(e,t);i&&(this.polygonGeojsonArr.push(i),(r=this.map)==null||r.addLayer(i))}createPolylinePointListNew(e,t,i={isGCJ02Point:!1,isFit:!1}){let r=[];const s=R.createPolylinePoints(e,!1);if(r=R.addPolylinePointNew(s,this.map,t),R.createGPSPoints(e,!1,this.am)!=null&&i.isFit){let a=this.am.getLngLats();if(t.type&&(a=this.am.getLngLatGCJ02()),!this.map)return;R.fitNew(this.map,[a[0],a[1],a[2],a[3]],null)}return r}createLPolygonNew(e,t){this.lPolygonNewArr.push(new R.LPolygonNew(e,t))}setPolygonColor(e,t=["rgba(255,201,14, 0.4)","rgba(255,201,14, 1)"]){this.lPolygonNewArr.forEach(i=>{if(i.Id==e){i.setPolygonColor(t);return}})}setPolygonColorAll(e=["rgba(184, 233, 134, 0.56)","rgba(23, 168, 162, 0.56)"]){this.lPolygonNewArr.forEach(t=>{t.setPolygonColor(e)})}removePolygonNew(){this.lPolygonNewArr.forEach(e=>{e.removePolygon(),e=null}),this.lPolygonNewArr=[]}caculateLL(e,t,i,r){return R.caculateLL(e,t,i,r)}get LPolygonNewArr(){return this.lPolygonNewArr}get isTruePolygon(){return this._lPolygon?this._lPolygon.isTruePolygon:!1}onCreateRectangle(){return this._lRectangle&&this.clearRectangle(),this._lRectangle=new R.LRectangle("Circle",this.map,()=>{}),this._lRectangle}getRectangleData(){if(!this._lRectangle)return[];const t=this._lRectangle.getCoordinates()[0];if(t.length){const i=[];return i.push([t[0][0],t[1][1]]),i.push([t[1][0],t[2][1]]),i}return[]}getRectangleDataNew(){if(!this._lRectangle)return[];const t=this._lRectangle.getCoordinates()[0];if(t.length){const i=[];return i.push([t[0][0],t[1][1]]),i.push([t[1][0],t[2][1]]),i}return[]}clearRectangle(){this.map&&this._lRectangle&&(this._lRectangle.getCoordinates(),this._lRectangle.remove(),this._lRectangle=null)}async initOfflineMap(e,t){const{el:i,urls:r,callback:s}=t;this.lmap=new R.OfflineMap,setTimeout(async o=>{const{map:a,layers:l}=await this.lmap.onLoad(i,r);this.map=a,this.layers=l,s({map:a,lMap:this.lmap})},50)}set DrawZIndex(e){this.drawZIndex=e}get DrawZIndex(){return this.drawZIndex}}let Hc=class{constructor(){y(this,"mapType",{type:Number,default:0});y(this,"layerType",{type:Number,default:2});y(this,"isSwitchMapTool",{type:Boolean,default:!0});y(this,"isRyMapTool",{type:Boolean,default:!1});y(this,"isRight",{type:Boolean,default:!1});y(this,"bindMapClick",{type:Boolean,default:!1});y(this,"bindContextmenu",{type:Boolean,default:!1});y(this,"binddblClick",{type:Boolean,default:!1});y(this,"bindMapMoveend",{type:Boolean,default:!1});y(this,"isDisabledSwitchMapTabEvent",{type:Boolean,default:!1});y(this,"initModifyPolygon",{type:[String,Object],default:()=>null});y(this,"m",{type:Number,default:()=>3e3});y(this,"switchMapDefaultTypeOrLayer",{type:Array,default:()=>null});y(this,"mapTypeAndLayer",{type:Array,default:()=>[{id:0,icon:"el-icon--tianditu",activeIcon:"el-icon--tianditu-copy",name:"天地图",layer:[{id:0,name:"地图"},{id:1,name:"卫星"},{id:2,name:"卫星组合"}]},{id:1,icon:"el-icon--gaode",activeIcon:"el-icon--gaode-copy",name:"高德地图",layer:[{id:0,name:"地图"},{id:1,name:"卫星"},{id:2,name:"卫星组合"}]},{id:2,icon:"el-icon--Bing",activeIcon:"el-icon--Bing-copy",name:"Bing地图",layer:[{id:1,name:"卫星"},{id:2,name:"卫星组合"}]}]});y(this,"isShowSwitchMap",{type:Boolean,default:!0});y(this,"resolution",{type:Boolean,default:!1});y(this,"zoomedIn",{type:Number,default:17})}};class Uc{constructor(){y(this,"zoom",{type:Number,default:10});y(this,"maxZoom",{type:Number,default:18});y(this,"minZoom",{type:Number,default:1});y(this,"center",{type:Array,default:()=>[116.40769,39.89945]});y(this,"projection",{type:String,default:"EPSG:4326"});y(this,"bbox",{type:Array,default:()=>[]})}}const Wc={class:"map-box"},qc={class:"map-style"},Jc=c.defineComponent({__name:"index",props:{...new Hc,...new Uc,...new Ji},emits:["load","crossHairClick","drawSuccess","drawError","drawPolygonEvent","drawLineEvent","mapClick2","mapClick","dblclick","contextmenuClick","mapMoveend","loadDrawPolygonEvent","changeSwitchMap"],setup(n,{emit:e}){const t=new Os;let i=c.ref(null);const r=c.ref(),s=n,o=e,{initMap:a}=go(s),{init:l}=mo(s),h=c.ref(0),{init:u,mapClickOnce:d,mapMoveend:f,mapContextmenu:g,dblClick:E,setLastMapType:m,changeSwitch:p,bingResolutionEvent:C}=po(s),T={mounted:(M,v)=>{v.value(M)}};function L(M){p(M,v=>h.value=v)}const w=M=>{a(M,t,({map:v,mapServices:A,layers:I})=>{i.value=v,l(v,t),u(v,t,o),d(s.bindMapClick),f(s.bindMapMoveend),g(s.bindContextmenu),E(s.binddblClick),C(s.resolution),o("load",{map:v,mapServices:A,layers:I,ryMapTool:r}),s.isShowSwitchMap||m(s.mapType>2?0:s.mapType)})};return(M,v)=>(c.openBlock(),c.createElementBlock("div",Wc,[c.withDirectives(c.createElementVNode("div",qc,null,512),[[T,w]]),c.unref(i)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.renderSlot(M.$slots,"polygon",{mapDto:{map:c.unref(i),lMap:c.unref(t)}},void 0,!0),c.renderSlot(M.$slots,"marker",{mapDto:{map:c.unref(i),lMap:c.unref(t)}},void 0,!0)],64)):c.createCommentVNode("",!0),M.isSwitchMapTool&&M.isShowSwitchMap?(c.openBlock(),c.createBlock($s,c.mergeProps({key:1,class:"move-box"},s,{style:{top:M.switchMapPosTop+"px",right:M.isSwitchMapRight?M.switchMapPosLeftOrRight+"px":"none",left:M.isSwitchMapRight?"none":M.switchMapPosLeftOrRight+"px"},onChangeSwitchMap:L}),null,16,["style"])):c.createCommentVNode("",!0),c.unref(t).map&&M.isRyMapTool?(c.openBlock(),c.createBlock(io,{key:2,ref_key:"mapTool",ref:r,class:c.normalizeClass(["ry-map-tool",{left:!M.isRight,right:M.isRight}]),onCrossHairClick:v[0]||(v[0]=A=>o("crossHairClick",A)),lMap:c.unref(t),isShowRangingTool:M.isShowRangingTool,initModifyPolygon:M.initModifyPolygon,isShowDrawTool:M.isShowDrawTool,isRight:M.isRight,isCrossHair:M.isCrossHair,hideAdd:M.hideAdd,hidePoint:M.hidePoint,hideCancel:M.hideCancel,hideDelete:M.hideDelete,hideSave:M.hideSave,hideLine:M.hideLine,hideArea:M.hideArea,isSwitchMap:M.isSwitchMap,isSwitchMapRight:M.isSwitchMapRight,gpsType:h.value,isCrossHairCreateDarw:M.isCrossHairCreateDarw,onLoadDrawPolygonEvent:v[1]||(v[1]=()=>o("loadDrawPolygonEvent")),onSuccess:v[2]||(v[2]=A=>o("drawSuccess",A)),onDrawPolygonEvent:v[3]||(v[3]=A=>o("drawPolygonEvent",A)),onDrawLineEvent:v[4]||(v[4]=A=>o("drawLineEvent",A)),onError:v[5]||(v[5]=A=>o("drawError",A))},{default:c.withCtx(()=>[c.renderSlot(M.$slots,"maptool",{},void 0,!0)]),_:3},8,["class","lMap","isShowRangingTool","initModifyPolygon","isShowDrawTool","isRight","isCrossHair","hideAdd","hidePoint","hideCancel","hideDelete","hideSave","hideLine","hideArea","isSwitchMap","isSwitchMapRight","gpsType","isCrossHairCreateDarw"])):c.createCommentVNode("",!0)]))}}),bn=Qt(Jc,[["__scopeId","data-v-21fe8852"]]);bn.install=n=>{n.component("RyMap",bn)};let Qc=class{constructor(){y(this,"map",{type:Object,default:()=>null});y(this,"model",{type:Object,default:()=>null});y(this,"isShow",{type:Boolean,default:!0});y(this,"clear",{type:Boolean,default:!1});y(this,"isFit",{type:Boolean,default:!0});y(this,"isStandardGeo",{type:Boolean,default:!1})}};const xn=c.defineComponent({__name:"index",props:{...new Qc},emits:["onLoad"],setup(n,{emit:e}){const t=e,i=n,r=c.reactive({polygon:null,bbox:[],bboxGCJ02:[],lastType:-1});c.watch(()=>i.isShow,g=>{r.polygon&&(g?d():f())}),c.watch(()=>i.clear,g=>{g&&h()}),c.watch(()=>i.model,g=>{g&&(h(),s())}),c.watch(()=>i.isFit,g=>{g&&a()}),c.watch(()=>i.gpsType,g=>{r.lastType!=g&&(r.lastType=g,u(i.gpsType))});const s=()=>{if(r.lastType=i.gpsType,!(!i.model||!i.model.geo)){if(i.model.geo){const{coordinates:g,center:E,bbox:m}=l();r.bbox=m,r.bboxGCJ02=o(m)}else{if(i.isStandardGeo)return;r.bbox=R.getLngAndLatMaxMin(i.model.coordinates),r.bboxGCJ02=o(r.bbox)}r.polygon=R.createPolygonBoundary(i.model.geo,i.model),i.map.addLayer(r.polygon),i.isFit&&a(i.gpsType==1?r.bboxGCJ02:r.bbox),r.polygon.isShowPolygon=!0,i.isShow?d():f(),i.clear&&h(),t("onLoad",{polygon:r.polygon})}},o=g=>{const E=[],{lat:m,lon:p}=R.GPS.gcj_encrypt(g[0],g[1]),{lon:C,lat:T}=R.GPS.gcj_encrypt(g[2],g[3]);return E.push(p),E.push(m),E.push(C),E.push(T),E},a=g=>{if(!g.length||!i.map)return;const E=[g[0],g[3],g[2],g[1]],m=[g[2],g[1],g[0],g[3]];R.fitNew(i.map,[E,m])},l=()=>{let g=null;if(i.model.geo instanceof Object)g=i.model.geo;else if(typeof i.model.geo=="string")g=JSON.parse(i.model.geo);else return g;const{bbox:E,geometry:m,properties:p}=g;let C=[];return p&&p.center&&(C=p.center),{bbox:E,coordinates:m.coordinates,center:C.length?C:R.getCenterPoint(m.coordinates)}},h=()=>{i.map&&r.polygon&&(i.map.removeLayer(r.polygon),r.polygon=null)},u=()=>{},d=()=>{},f=()=>{};return c.onMounted(()=>{s()}),()=>{}}});xn.install=n=>{n.component("RyPolygonGeo",xn)};class eh{constructor(){y(this,"map",{type:Object,default:()=>null});y(this,"modelArr",{type:Array,default:()=>[]});y(this,"insert",{type:Object,default:()=>null});y(this,"inserts",{type:Array,default:()=>[]});y(this,"isShowAll",{type:Boolean,default:!0});y(this,"isShow",{type:Object,default:()=>null});y(this,"clear",{type:Boolean,default:!1})}}const kn=c.defineComponent({__name:"index",props:{...new eh},setup(n){const e=n,t=c.reactive({wmsMap:new Map,isCreate:!0});c.watch(()=>e.modelArr,u=>{o()}),c.watch(()=>e.insert,u=>{u&&s(u)}),c.watch(()=>e.inserts,u=>{u&&r(u)}),c.watch(()=>e.clear,u=>{u&&o()}),c.watch(()=>e.isShowAll,u=>{if(u){a();return}l()}),c.watch(()=>e.isShow,u=>{u&&h(u)},{deep:!0});const i=u=>{!u||!u.length||u.forEach(d=>{s(d)})},r=u=>{u.forEach(d=>{s(d)})},s=u=>{if(!t.wmsMap.has(u.id)){const d=new R.LWMS({map:e.map,...u});t.wmsMap.set(u.id,d)}},o=()=>{t.wmsMap.forEach(u=>u.removeLayer())},a=()=>{t.wmsMap.forEach(u=>u.show())},l=()=>{t.wmsMap.forEach(u=>u.hide())},h=u=>{const d=u.id;if(t.wmsMap.has(d)){const f=t.wmsMap.get(d);if(u.isShow){f.show();return}f.hide()}};return c.onMounted(()=>{if(e.modelArr.length){i(e.modelArr);return}e.inserts.length&&i(e.inserts)}),()=>{}}});kn.install=n=>{n.component("RyWMSs",kn)};class th{constructor(){y(this,"map",{type:Object,default:()=>null});y(this,"modelArr",{type:Array,default:()=>[]});y(this,"insert",{type:Object,default:()=>null});y(this,"inserts",{type:Array,default:()=>[]});y(this,"isShowAll",{type:Boolean,default:!0});y(this,"clear",{type:Boolean,default:!1});y(this,"isShow",{type:Object,default:()=>null})}}const On=c.defineComponent({__name:"index",props:{...new th},setup(n){const e=n,t=c.reactive({wmtsMap:new Map,isCreate:!0});c.watch(()=>e.modelArr,u=>{o()}),c.watch(()=>e.insert,u=>{u&&s(u)}),c.watch(()=>e.inserts,u=>{u&&r(u)}),c.watch(()=>e.clear,u=>{u&&o()}),c.watch(()=>e.isShowAll,u=>{if(u){a();return}l()}),c.watch(()=>e.isShow,u=>{u&&h(u)});const i=u=>{!u||!u.length||u.forEach(d=>{s(d)})},r=u=>{u.forEach(d=>{s(d)})},s=u=>{if(!t.wmtsMap.has(u.id)){const d=new R.LWMTS({map:e.map,...u});t.wmtsMap.set(u.id,d)}},o=()=>{t.wmtsMap.forEach(u=>u.removeLayer())},a=()=>{t.wmtsMap.forEach(u=>u.show())},l=()=>{t.wmtsMap.forEach(u=>u.hide())},h=u=>{const d=u.id;if(t.wmtsMap.has(d)){const f=t.wmtsMap.get(d);if(u.isShow){f.show();return}f.hide()}};return c.onMounted(()=>{if(e.modelArr.length){i(e.modelArr);return}e.inserts.length&&i(e.inserts)}),()=>{}}});On.install=n=>{n.component("RyWMTSs",On)};class We{constructor(){y(this,"map",{type:Object,default:()=>null});y(this,"gpsType",{type:Number,default:0})}}const nh={color:"red",width:2,zIndex:1};class ih extends We{constructor(){super(...arguments);y(this,"model",{type:Object,default:()=>null});y(this,"linenIsert",{type:Object,default:()=>null});y(this,"isLineFit",{type:Boolean,default:!0});y(this,"isShowPlayback",{type:Boolean,default:!1});y(this,"lineAppend",{type:Array,default:()=>[]});y(this,"startMarkerDto",{type:Object,default:()=>null});y(this,"endMarkerDto",{type:Object,default:()=>null});y(this,"moveMarkerDto",{type:Object,default:()=>null});y(this,"clearLiens",{type:Boolean,default:!1});y(this,"endMarkerPoint",{type:Array,default:()=>null});y(this,"lineDto",{type:Object,default:()=>nh})}}const rh={key:0,class:"el-slider-box"},sh={class:"control-panel"},oh=c.defineComponent({__name:"index",props:{...new ih},emits:["trackPlayEvent"],setup(n,{emit:e}){const t=n,i=e,r=c.ref(0),s=c.ref(!1),o=c.ref(!1),a=c.ref({}),l=c.ref({}),h=c.ref([]),u=c.computed(()=>h.value.length-1),d=c.ref([!1,!0,!1,!1]),f=c.ref(100),g=c.ref(null),E=c.ref([]),m=c.ref([]),p=c.ref([]),C=c.ref(0),T=c.ref(null),L=c.ref(null),w=c.ref(null),M=c.ref(new Map),v=c.ref(new Map),A=c.ref(0),I=c.ref(0),x=c.ref(0),P=c.ref(0),k=c.ref(new Map),F=c.ref(null),W=c.ref(-1),he=c.ref([]),Me=c.ref(new R.AM);c.watch(()=>t.model,b=>{Ae(),b&&be(b.pointArr)}),c.watch(()=>t.linenIsert,b=>{!t.map||!b||(be(b),Fe(b))}),c.watch(()=>t.gpsType,b=>{Lh(b)}),c.watch(()=>t.clearLiens,b=>{b&&Ns()}),c.watch(()=>t.lineAppend,b=>{b.length>0&&t.map&&(Bs(b),qt(L.value,b))}),c.watch(()=>t.isShowPlayback,b=>{if(!b){ue(),r.value=0,Fs();return}delete l.value[C.value],a.value=l.value}),c.watch(()=>t.isShowAll,b=>{if(!b){qe(),Et();return}_t(),wt()});function _t(){he.value.forEach(b=>{b.show()})}function qe(){he.value.forEach(b=>{b.hide()})}function wt(){L.value&&L.value.show(),w.value&&w.value.show(),T.value&&T.value.show()}function Et(){L.value&&L.value.hide(),w.value&&w.value.hide(),T.value&&T.value.hide()}const Ae=()=>{t.map&&(Ns(),!(!t.model&&!t.linenIsert)&&(W.value=t.gpsType,t.model&&(be(t.model),Fe(t.model)),t.linenIsert&&(be(t.linenIsert),Fe(t.linenIsert))))},be=b=>{if(b){const{playbackColor:O,pointArr:V}=b;if(!V)return;const Z=V.length;if(!V.length)return;C.value+=Z,h.value.push(...V),M.value.set(C.value,O),m.value.push(Z),l.value[C.value]="",p.value.push(C.value),k.value.set(C.value,b)}},Fe=b=>{const O=b.pointArr;if(t.isLineFit&&wh(O),Eh(O[0]),!b.isAppend){Gs(b,[A.value,I.value]);const Z=Ui(b),ee=O.length-1;qt(L.value,O[ee]);const{x:te,y:ge}=Wi(O);A.value=te,I.value=ge,he.value.push(Z);return}O.forEach(Z=>{Bs(Z)});const V=O.length-1;qt(L.value,O[V]),Wi(O)},Wt=b=>{Gs(b,[x.value,P.value]);const O=b.pointArr,V=Ui(b),{x:Z,y:ee}=Wi(O);x.value=Z,x.value=ee,E.value.push(V)},Ct=(b,O)=>{d.value=d.value.map(()=>!1),d.value[b]=!0,f.value=O,o.value=!1,_()},_=()=>{g.value&&clearInterval(g.value)},D=()=>{o.value||r.value===0&&ue(),s.value=!0,o.value=!0,q()},G=()=>{o.value=!1,_()},q=()=>{E.value.length||Pe(p.value[0],0),g.value=Number(setInterval(()=>{if(r.value>=C.value-1||!s.value){const Z=E.value[E.value.length-1],ee=h.value[r.value];qt(T.value,ee),Z.appendCoordinate(ee,t.gpsType),i("trackPlayEvent",{index:r.value,points:ee}),_(),r.value=0,o.value=!1,i("trackPlayEvent",{index:r.value,points:h.value[0]});return}const b=yh(r.value);if(M.value.has(b)&&!v.value.has(b)){Pe(b,r.value);const Z=E.value[E.value.length-1];v.value.set(b,Z);const ee=r.value-1===-1?0:r.value-1;Z.appendCoordinate(h.value[ee],t.gpsType)}const O=E.value[E.value.length-1],V=h.value[r.value];qt(T.value,V),O.appendCoordinate(V,t.gpsType),i("trackPlayEvent",{index:r.value,points:V}),r.value++},f.value))},ue=()=>{_(),E.value.forEach(b=>{b.removePolyline()}),T.value&&t.map.removeOverlay(T.value.getMarker()),s.value=!1,o.value=!1,E.value=[],v.value.clear(),T.value=null,x.value=0,P.value=0},Pe=(b=0,O=0)=>{const{playbackColor:V,width:Z,zIndex:ee}=k.value.get(b),te=Ui({color:V,isAppend:!1,width:Z,pointArr:[],zIndex:ee},t.gpsType);F.value=V,E.value.push(te),t.moveMarkerDto&&!T.value&&(T.value=vt(t.moveMarkerDto,h.value[O]))},vt=({offset:b,url:O,width:V,height:Z},ee=[])=>{const te=new R.LMarker(O,V,Z);return te.setOffset(b),ee.length&&te.setPosition(ee,t.gpsType),t.map.addOverlay(te.getMarker()),te},qt=(b,O)=>{b&&O.length>1&&b.setPosition(O,t.gpsType)},yh=b=>{for(let O of p.value)if(b<=O)return O;return 0},_h=b=>{const O=[];for(let V of p.value){if(b>=V){O.push(V);continue}O.push(V);break}return O},Ui=(b={color:"rgb(0,0,255)",width:2,pointArr:null,zIndex:1},O)=>new R.Polyline({...b,type:O??t.gpsType},t.map),Ns=()=>{Fs(),vh(),Ah(),h.value=[],F.value=null,A.value=0,I.value=0,Me.value=new R.AM,a.value={},l.value={},_(),Rh()},wh=async b=>await new Promise(O=>{b.forEach(Z=>{Me.value.getLngAndLatMaxMin({X:Z[0],Y:Z[1]})});let V;t.gpsType?V=Me.value.getLngLatGCJ02():V=Me.value.getLngLats(),R.fitNew(t.map,[[V[0],V[1]],[V[2],V[3]]]),O()}),Eh=b=>{!t.startMarkerDto&&!t.endMarkerDto||!w.value&&!L.value&&(w.value=vt(t.startMarkerDto,b),L.value=vt(t.endMarkerDto))},Gs=(b,O)=>{const[V,Z]=O;V>0&&Z>0&&b&&b.pointArr.unshift(O)},Bs=(b=[])=>{if(!b.length)return;he.value.length||Fe({...t.lineDto,pointArr:[b],isAppend:!1}),he.value[he.value.length-1].appendCoordinate(b,t.gpsType)},Ch=b=>b/100,Wi=b=>{if(b.length>0){const[O,V]=b[b.length-1];return{x:O,y:V}}return{x:0,y:0}},vh=()=>{he.value.forEach(b=>{b.removePolyline()}),he.value=[]},Ah=()=>{t.map&&(L.value&&t.map.removeOverlay(L.value.getMarker()),w.value&&t.map.removeOverlay(w.value.getMarker()),T.value&&t.map.removeOverlay(T.value.getMarker()),T.value=null,L.value=null,w.value=null)},Fs=()=>{d.value=[!1,!0,!1,!1,!1],f.value=100},Rh=()=>{ue(),m.value=[],h.value=[],M.value.clear(),k.value.clear(),C.value=0,p.value=[],r.value=0},Mh=(b,O,V)=>{const Z=[],ee=[...O];if(b.length<=1){const te=b[0],{width:ge,zIndex:qi}=k.value.get(te);return Z.push({isAppend:!1,color:M.value.get(te),width:ge,zIndex:qi,pointArr:ee.splice(0,V+1)}),Z}for(let te=0;te<b.length;te++){const ge=b[te],{width:qi,zIndex:Th}=k.value.get(ge),Vs=ee.splice(0,m.value[te]);if(Vs.length){const Sh={color:M.value.get(ge),width:qi,zIndex:Th,pointArr:Vs};Z.push(Sh)}}return Z},Ph=b=>{if(ue(),b===0){i("trackPlayEvent",{index:b,points:h.value[0]});return}const O=h.value.slice(0,b+1);if(Mh(_h(b),O,b).forEach(Z=>Wt(Z)),O.length&&i("trackPlayEvent",{index:b,points:O[O.length-1]}),t.moveMarkerDto&&!T.value&&O.length){T.value=vt(t.moveMarkerDto,O[O.length-1]);return}},Lh=b=>{he.value.forEach(O=>{O.selectGPS(b)}),ue(),r.value=0,w.value&&w.value.selectGPS(b),L.value&&L.value.selectGPS(b),T.value&&T.value.selectGPS(b)};return c.onMounted(()=>{Ae()}),(b,O)=>{const V=c.resolveComponent("el-button"),Z=c.resolveComponent("el-col"),ee=c.resolveComponent("el-slider"),te=c.resolveComponent("el-row");return c.openBlock(),c.createElementBlock("div",null,[b.isShowPlayback?(c.openBlock(),c.createElementBlock("div",rh,[c.createVNode(te,{justify:"center"},{default:c.withCtx(()=>[c.createVNode(Z,{span:1},{default:c.withCtx(()=>[!r.value||!o.value?(c.openBlock(),c.createBlock(V,{key:0,class:"button-paly",onClick:O[0]||(O[0]=c.withModifiers(ge=>D(),["stop"]))})):(c.openBlock(),c.createBlock(V,{key:1,class:"button-stop",onClick:O[1]||(O[1]=c.withModifiers(ge=>G(),["stop"]))}))]),_:1}),c.createVNode(Z,{style:{"margin-left":"30px"},xs:13,sm:19,md:19,lg:19,xl:22},{default:c.withCtx(()=>[c.createVNode(ee,{modelValue:r.value,"onUpdate:modelValue":O[2]||(O[2]=ge=>r.value=ge),marks:a.value,"show-tooltip":"",step:1,min:0,max:u.value,onChange:Ph,"format-tooltip":Ch},null,8,["modelValue","marks","max"])]),_:1})]),_:1}),c.createVNode(te,{justify:"end"},{default:c.withCtx(()=>[c.createVNode(Z,null,{default:c.withCtx(()=>[c.createElementVNode("section",sh,[O[7]||(O[7]=c.createElementVNode("span",null,"播放倍速:",-1)),c.createElementVNode("span",{class:c.normalizeClass({active:d.value[0]}),onClick:O[3]||(O[3]=c.withModifiers(ge=>Ct(0,200),["stop"]))},"0.5x",2),c.createElementVNode("span",{class:c.normalizeClass({active:d.value[1]}),onClick:O[4]||(O[4]=c.withModifiers(ge=>Ct(1,100),["stop"]))},"正常",2),c.createElementVNode("span",{class:c.normalizeClass({active:d.value[2]}),onClick:O[5]||(O[5]=c.withModifiers(ge=>Ct(2,50),["stop"]))},"1.5x",2),c.createElementVNode("span",{class:c.normalizeClass({active:d.value[3]}),onClick:O[6]||(O[6]=c.withModifiers(ge=>Ct(3,5),["stop"]))},"2.0x",2)])]),_:1})]),_:1})])):c.createCommentVNode("",!0)])}}}),Dn=Qt(oh,[["__scopeId","data-v-05741d46"]]);Dn.install=n=>{n.component("RyLines",Dn)};class ah{constructor(){y(this,"modelArr",{type:Array,default:()=>[]});y(this,"clusterPolygonModel",{type:Object,default:()=>lh});y(this,"map",{type:Object,default:()=>null});y(this,"gpsType",{type:Number,default:0});y(this,"color",{type:String,default:"#fff"});y(this,"fontSize",{type:Number,default:14});y(this,"offsetX",{type:Number,default:0});y(this,"offsetY",{type:Number,default:0});y(this,"distance",{type:Number,default:30})}}const lh={fillColor:"rgba(184, 233, 134, 0.56)",stroke:"rgba(23, 168, 162, 0.56)",width:3,text:"块"},Nn=c.defineComponent({__name:"index",props:{...new ah},emits:["callback"],setup(n,{emit:e}){const t=n,i=e,r=c.ref([]),s=c.ref(null),o=c.ref(new Map),a=new R.GrahamScan,l=c.ref(new Set);c.watch(()=>t.modelArr,()=>{t.map&&f()}),c.watch(()=>t.gpsType,C=>{p(C)}),c.onMounted(()=>{s.value=new R.FeaturePolygon(t.gpsType),f()});const h=C=>{let T=[],L=new Set;C.forEach(M=>{if(M){const v=M.getId();if(o.value.has(v)){const A=o.value.get(v);L.add(v),A.forEach(I=>{T.push(I)})}}}),a.setPoints(T),a.getHull(),L.forEach(M=>{u(M)});const w={...t.clusterPolygonModel,coordinates:[a.getHull()],ids:L};l.value.add(new R.LPolygonNew({...w,gpsType:t.gpsType},t.map))},u=C=>{let T=[];l.value.size!==0&&(l.value.forEach(L=>{L.Ids.has(C)&&(L.removePolygon(),T.push(L))}),T.forEach(L=>{l.value.has(L)&&l.value.delete(L)}))},d=(C,T)=>new R.FeaturePolygonModel(T,C),f=()=>{E(),m()},g=C=>{let T=null;try{C instanceof Object?T=C:typeof C=="string"&&(T=JSON.parse(C))}catch{return null}const{bbox:L,geometry:w,properties:M}=T;let v=[];return M&&M.center&&(v=M.center),{bbox:L,coordinates:w.coordinates,center:v.length?v:R.getCenterPoint(w.coordinates)}},E=()=>{t.modelArr.forEach(C=>{const T=g(C.geo),L=d(C.id,T.center);r.value.push(L)})},m=()=>{var w;const C=new R.LCluster((...M)=>{const v=M[0].getId();if(M[2]){console.log(o),i("callback",{id:v,isShow:!0}),o.value.has(v)&&o.value.delete(v);return}else{if(!o.value.has(v)){const A=t.modelArr.find(I=>I.id==v);if(A){const I=g(A.geo);o.value.set(v,I.coordinates[0])}}i("callback",{id:v,isShow:!1})}},{text:t.clusterPolygonModel.text,offsetX:t.offsetX,offsetY:t.offsetY,fontSize:t.fontSize,color:t.color,aggregationCallback:M=>{h(M)},removeAggregationCallback:M=>{const v=M.getId();v&&u(v)}}),T=(w=s.value)==null?void 0:w.getVectorSource(r.value),L=C.getVectorLayer(T,t.distance);t.map.addLayer(L)},p=C=>{l.value.forEach(T=>{T.selectGPS(C)}),s.value&&s.value.selectGPSAll(C)};return(C,T)=>(c.openBlock(),c.createElementBlock("div"))}});Nn.install=n=>{n.component("RyClusters",Nn)};class ch{constructor(){y(this,"modelArr",{type:Array,default:()=>[]});y(this,"text",{type:String,default:()=>"台"});y(this,"map",{type:Object,default:()=>null});y(this,"gpsType",{type:Number,default:0});y(this,"distance",{type:Number,default:200});y(this,"fontColor",{type:String,default:"#fff"});y(this,"src",{type:String,default:()=>null});y(this,"fontSize",{type:Number,default:14});y(this,"offsetX",{type:Number,default:0});y(this,"offsetY",{type:Number,default:0})}}const Gn=c.defineComponent({__name:"index",props:{...new ch},emits:["callback"],setup(n,{emit:e}){const t=n,i=e,r=c.ref([]),s=new R.FeaturePolygon(t.gpsType);c.watch(()=>t.modelArr,()=>{t.map&&a()}),c.watch(()=>t.gpsType,d=>{u(d)}),c.onMounted(()=>a());const o=(d,f)=>new R.FeaturePolygonModel(f,d),a=()=>{l(),h()},l=()=>{t.modelArr.forEach(d=>{const f=o(d.id,[d.x,d.y]);r.value.push(f)})},h=()=>{const d=new R.LClusterMarker((...E)=>{const m=E[0].getId();if(E[2]){i("callback",{id:m,isShow:!0});return}else i("callback",{id:m,isShow:!1})},{text:t.text,offsetX:t.offsetX,offsetY:t.offsetY,fontSize:t.fontSize,color:t.fontColor,src:t.src,aggregationCallback:()=>{},removeAggregationCallback:()=>{}}),f=s.getVectorSource(r.value),g=d.getVectorLayer(f,t.distance);t.map.addLayer(g)},u=d=>{s&&s.selectGPSAll(d)};return(d,f)=>(c.openBlock(),c.createElementBlock("div"))}});Gn.install=n=>{n.component("RyClustersMarker",Gn)};class hh extends We{constructor(){super(...arguments);y(this,"model",{type:Object,default:()=>null});y(this,"isShow",{type:Boolean,default:!0});y(this,"clear",{type:Boolean,default:!1});y(this,"isCheckPointHide",{type:Boolean,default:!1});y(this,"polygonColor",{type:Array,default:()=>[]});y(this,"text",{type:String,default:null});y(this,"isFit",{type:Boolean,default:!0})}}const Bn=c.defineComponent({__name:"index",props:{...new hh},emits:["onLoad"],setup(n,{emit:e}){const t=n,i=e,r=c.ref(null),s=c.ref([]),o=c.ref([]),a=c.ref(-1);function l(w,M){const{text:v,center:A,isShow:I}=M;w.setShowText(I),w.setText(v),w.setCenter(A)}const h=()=>{if(a.value=t.gpsType,!t.model||!t.model.geo&&!t.model.coordinates)return;let w=[];const M={...t.model};if(M.geo){const{coordinates:v,center:A,bbox:I}=m();M.coordinates=v,s.value=I,o.value=p(s.value),w=A}else s.value=R.getLngAndLatMaxMin(M.coordinates),o.value=p(s.value);r.value=new R.LPolygonNew({...M,type:t.gpsType},t.map),t.isFit&&E(t.gpsType===1?o.value:s.value),t.isCheckPointHide?l(r.value,{text:M.text,center:w,isShow:!1}):l(r.value,{text:M.text,center:w,isShow:!0}),r.value.isShowPolygon=!0,t.isShow?u():d(),t.clear&&f(),i("onLoad",{polygon:r.value})},u=()=>{r.value&&r.value.show()},d=()=>{r.value&&r.value.hide()},f=()=>{r.value&&(r.value.removePolygon(),r.value=null),s.value=[],o.value=[]},g=w=>{if(r.value){r.value.setPolygonColor(w);const M=t.map.getView().getZoom();t.map.getView().setZoom(M+1e-5),t.map.getView().setZoom(M-1e-4)}},E=w=>{if(!w.length||!t.map)return;const M=[w[0],w[3],w[2],w[1]],v=[w[2],w[1],w[0],w[3]];R.fitNew(t.map,[M,v])},m=()=>{let w=null;t.model.geo instanceof Object?w=t.model.geo:typeof t.model.geo=="string"&&(w=JSON.parse(t.model.geo));const{bbox:M,geometry:v,properties:A}=w;let I=[];return A&&A.center&&(I=A.center),{bbox:M,coordinates:v.coordinates,center:I.length?I:R.getCenterPoint(v.coordinates)}},p=w=>{const M=[],{lat:v,lon:A}=R.GPS.gcj_encrypt(w[0],w[1]),{lon:I,lat:x}=R.GPS.gcj_encrypt(w[2],w[3]);return M.push(A),M.push(v),M.push(I),M.push(x),M},C=()=>{r.value&&r.value.setTextVisible(!0)},T=()=>{r.value&&r.value.setTextVisible(!1)},L=w=>{r.value&&r.value.selectGPS(w)};return c.watch(()=>t.isShow,w=>{r.value&&(w?u():d())},{immediate:!0}),c.watch(()=>t.clear,w=>{w&&f()},{immediate:!0}),c.watch(()=>t.model,w=>{f(),w&&h()},{immediate:!0,deep:!0}),c.watch(()=>t.isCheckPointHide,w=>{if(w){T();return}C()},{immediate:!0}),c.watch(()=>t.polygonColor,w=>{w.length&&g(w)},{immediate:!0}),c.watch(()=>t.isFit,w=>{w&&E(s.value)},{immediate:!0}),c.watch(()=>t.gpsType,w=>{a.value!==w&&(a.value=w,L(w))},{immediate:!0}),(w,M)=>(c.openBlock(),c.createElementBlock("div"))}});Bn.install=n=>{n.component("RyPolygon",Bn)};class uh extends We{constructor(){super(...arguments);y(this,"modelArr",{type:Array,default:()=>[]});y(this,"insert",{type:Object,default:()=>null});y(this,"inserts",{type:Array,default:()=>[]});y(this,"isShowAll",{type:Boolean,default:!0});y(this,"isShowPolygon",{type:Object,default:()=>null});y(this,"isShowPolygons",{type:Array,default:()=>[]});y(this,"clear",{type:Boolean,default:!1});y(this,"isCheckPointHideAll",{type:Boolean,default:!1});y(this,"isCheckPointHide",{type:Object,default:()=>null});y(this,"isCheckPointHides",{type:Array,default:()=>[]});y(this,"polygonColor",{type:Object,default:()=>null});y(this,"polygonColors",{type:Array,default:()=>[]});y(this,"text",{type:Object,default:()=>null});y(this,"isFit",{type:Boolean,default:!0});y(this,"remove",{type:[String,Number,Object],default:()=>null});y(this,"removes",{type:Array,default:()=>[]});y(this,"ranges",{type:Array,default:()=>[]});y(this,"range",{type:[String,Number,Object],default:()=>null});y(this,"restFit",{type:Boolean,default:!1});y(this,"correct",{type:Number,default:0})}}const Fn=c.defineComponent({__name:"index",props:{...new uh},emits:["onLoad"],setup(n,{emit:e}){const t=n,i=e,r=c.ref([]),s=c.ref(new Map),o=c.ref([]),a=c.ref(new Map),l=c.ref(new Map),h=c.ref(-1);c.onMounted(()=>{});function u(){!t.modelArr||!t.modelArr.length||(t.modelArr.forEach(_=>{Ae(_)}),t.polygonColor&&M(t.polygonColor.id,t.polygonColor.colorArr),A(t.polygonColors),qe(t.remove),_t(t.removes),wt(t.ranges),Et(t.range),Ae(t.insert),be(t.inserts),t.isFit&&m(),t.isShowAll||L(),t.isCheckPointHideAll&&k(),t.isShowPolygon&&x(t.isShowPolygon),P(t.isShowPolygons),t.isCheckPointHide&&F(t.isCheckPointHide),W(t.isCheckPointHides),Fe())}function d(_,D){if(!l.value.has(_.id)){const G=new R.LPolygonNew({..._,type:t.gpsType},t.map);G.isShowPolygon=!0,l.value.set(_.id,G);const q=_.text;t.isCheckPointHideAll?!t.isCheckPointHideAll&&_.isShowText!==void 0&&_.isShowText!==null?f(G,{text:q,center:D,isShow:_.isShowText}):f(G,{text:q,center:D,isShow:!0}):f(G,{text:q,center:D,isShow:!1})}}function f(_,D){const{text:G,center:q,isShow:ue}=D;_.setShowText(ue),_.setText(G),_.setCenter(q)}function g(_){l.value.forEach(D=>{D.selectGPS(_)})}function E(_,D){if(s.value.has(_)||(r.value.push(D),s.value.set(_,D)),!a.value.has(_)){const G=Ct(D);o.value.push(G),a.value.set(_,G)}}function m(){if(!(!r.value.length||!t.map)){if(r.value.length>1){R.fitNew(t.map,t.gpsType==1?o.value:r.value);return}p(t.gpsType==1?o.value[0]:r.value[0])}}function p(_){const D=[_[0],_[3],_[2],_[1]],G=[_[2],_[1],_[0],_[3]];R.fitNew(t.map,[D,G])}function C(_){let D=null;try{_ instanceof Object?D=_:typeof _=="string"&&(D=JSON.parse(_))}catch{return null}const{bbox:G,geometry:q,properties:ue}=D;let Pe=[];return ue&&ue.center&&(Pe=ue.center),{bbox:G,coordinates:q.coordinates,center:Pe.length?Pe:R.getCenterPoint(q.coordinates)}}function T(){l.value.forEach(_=>_.show()),t.restFit&&Wt()}function L(){l.value.forEach(_=>_.hide())}function w(){l.value.forEach(_=>{_.removePolygon(),_=null}),l.value.clear(),s.value.clear(),r.value=[],o.value=[],a.value.clear()}function M(_,D,G=!0){l.value.has(_)&&(l.value.get(_).setPolygonColor(D),G&&v())}function v(){const _=t.map.getView().getZoom();t.map.getView().setZoom(_+1e-5),t.map.getView().setZoom(_-1e-4)}function A(_){_.forEach(D=>{M(D.id,D.colorArr,!1)}),_.length&&v()}function I(){t.map&&l.value.forEach(_=>{_.setTextVisible(!0)})}function x(_){const D=_.id;if(l.value.has(D)){const G=l.value.get(D);if(_.isShow){G.show();return}G.hide()}}function P(_){_.forEach(D=>{x(D)}),t.restFit&&Wt()}function k(){l.value.forEach(_=>_.setTextVisible(!1))}function F(_){const D=_.id;if(l.value.has(D)){const G=l.value.get(D);if(_.isShow){G.setTextVisible(!0);return}G.setTextVisible(!1)}}function W(_){_.forEach(D=>{F(D)})}function he(_,D){if(l.value.has(_)){const G=l.value.get(_);G==null||G.setText(D)}}function Me(){r.value=[],o.value=[],s.value.forEach(_=>{r.value.push(_)}),a.value.forEach(_=>{o.value.push(_)})}function _t(_){_.forEach(D=>{qe(D)}),_.length&&Me()}function qe(_,D=!0){l.value.has(_)&&(l.value.get(_).removePolygon(),l.value.delete(_)),s.value.has(_)&&s.value.delete(_),a.value.has(_)&&a.value.delete(_)}function wt(_){const D=[];_.forEach(G=>{if(s.value.has(G)&&t.gpsType!=1){const q=s.value.get(G);D.push(q)}else if(a.value.has(G)&&t.gpsType==1){const q=a.value.get(G);D.push(q)}}),D.length&&R.fitNew(t.map,D)}function Et(_){if(s.value.has(_)&&t.gpsType!=1){const D=s.value.get(_);R.fitNew(t.map,[D])}else if(a.value.has(_)&&t.gpsType==1){const D=a.value.get(_);R.fitNew(t.map,[D])}}function Ae(_,D){if(!_)return;let G=[],q=[];if(!_.coordinates){const{coordinates:ue,center:Pe,bbox:vt}=C(_.geo);_.coordinates=ue,G=Pe}d(_,G),E(_.id,q.length?q:R.getLngAndLatMaxMin(_.coordinates)),D&&Fe()}function be(_){h.value=t.gpsType,_.forEach(D=>{Ae(D,!1)}),_.length&&Fe()}function Fe(){i("onLoad",{polygonMap:l.value,bboxMap:s.value,bboxMapGCJ02:a.value})}function Wt(){let _=[];t.gpsType!=1?s.value.forEach((D,G)=>{t.isShowPolygons.findIndex(q=>q.id==G)===-1&&_.push(s.value.get(G))}):t.gpsType==1&&a.value.forEach((D,G)=>{t.isShowPolygons.findIndex(q=>q.id==G)===-1&&_.push(a.value.get(G))}),_.length&&(_.length>1?R.fitNew(t.map,_):p(_[0]))}function Ct(_){const D=[],{lat:G,lon:q}=R.GPS.gcj_encrypt(_[0],_[1]),{lon:ue,lat:Pe}=R.GPS.gcj_encrypt(_[2],_[3]);return D.push(q),D.push(G),D.push(ue),D.push(Pe),D}return c.computed(()=>(u(),t.modelArr)),c.watch(()=>t.modelArr,(_,D)=>{w(),_.length&&u()},{immediate:!0}),c.watch(()=>t.isShowAll,_=>{_?T():L()}),c.watch(()=>t.isShowPolygon,_=>{_&&x(_)}),c.watch(()=>t.isShowPolygons,_=>{!_||!_.length||(P(_),t.restFit&&Wt())}),c.watch(()=>t.clear,_=>{_&&w()}),c.watch(()=>t.isCheckPointHideAll,_=>{_?k():I()}),c.watch(()=>t.isCheckPointHide,_=>{_&&F(_)}),c.watch(()=>t.isCheckPointHides,_=>{!_||!_.length||W(_)}),c.watch(()=>t.polygonColor,_=>{_&&M(_.id,_.colorArr)}),c.watch(()=>t.polygonColors,_=>{_&&A(_)}),c.watch(()=>t.isFit,_=>{_&&m()}),c.watch(()=>t.remove,_=>{qe(_)}),c.watch(()=>t.removes,_=>{_t(_)}),c.watch(()=>t.ranges,_=>{wt(_)}),c.watch(()=>t.range,_=>{Et(_)}),c.watch(()=>t.insert,_=>{Ae(_)}),c.watch(()=>t.inserts,_=>{be(_)}),c.watch(()=>t.text,_=>{_&&_.id&&_.text&&he(_.id,_.text)}),c.watch(()=>t.gpsType,_=>{h.value!=_&&(h.value=_,g(_))}),(_,D)=>(c.openBlock(),c.createElementBlock("div"))}});Fn.install=n=>{n.component("RyPolygons",Fn)};class dh extends We{constructor(){super(...arguments);y(this,"model",{type:Object,default:()=>null});y(this,"isShow",{type:Boolean,default:!0});y(this,"clear",{type:Boolean,default:!1});y(this,"isFit",{type:Boolean,default:!0})}}const Vn=c.defineComponent({__name:"index",props:{...new dh},setup(n){const e=n,t=c.ref([]),i=c.ref([]),r=c.ref(null),s=c.ref(-1),o=c.ref(null),a=c.ref(null);c.watch(()=>e.model,L=>{m(),L&&(e.model=L,l(L))}),c.watch(()=>e.clear,L=>{L&&m()}),c.watch(()=>e.isShow,L=>{if(L){C();return}T()}),c.watch(()=>e.gpsType,L=>{s.value!==L&&(e.gpsType=L,s.value=L,p(e.gpsType))});const l=L=>{h(L),e.isFit&&setTimeout(()=>{f()},50)},h=L=>{const{id:w,url:M,bbox:v,isShow:A,stroke:I,fillColor:x,zIndex:P,width:k,extractStyles:F,gcj02Url:W}=L;r.value=new R.LKML({id:w,url:e.gpsType===1?W:M,bbox:v,isShow:A,stroke:I,fillColor:x,zIndex:P,width:k},e.map,F),o.value=M,a.value=W,u(v)},u=L=>{t.value=L,i.value=E(L)},d=L=>{r.value&&r.value.setUrl(L)},f=()=>{!t.value.length||!e.map||g(e.gpsType===1?i.value:t.value)},g=L=>{const w=[L[0],L[3],L[2],L[1]],M=[L[2],L[1],L[0],L[3]];R.fitNew(e.map,[w,M])},E=L=>{const w=[],{lat:M,lon:v}=R.GPS.gcj_encrypt(L[0],L[1]),{lon:A,lat:I}=R.GPS.gcj_encrypt(L[2],L[3]);return w.push(v),w.push(M),w.push(A),w.push(I),w},m=()=>{r.value&&(r.value.removeKML(),t.value=[],i.value=[],o.value=null,a.value=null)},p=L=>{const w=L===1?a.value:o.value;d(w)},C=()=>{r.value&&(r.value.show(),e.isFit&&setTimeout(()=>{f()},50))},T=()=>{r.value&&r.value.hide()};return c.onMounted(()=>{s.value=e.gpsType,e.model&&l(e.model)}),()=>{}}});Vn.install=n=>{n.component("RyKML",Vn)};class fh extends We{constructor(){super(...arguments);y(this,"modelArr",{type:Array,default:()=>[]});y(this,"insert",{type:Object,default:()=>null});y(this,"inserts",{type:Array,default:()=>[]});y(this,"isShowAll",{type:Boolean,default:!0});y(this,"clear",{type:Boolean,default:!1});y(this,"isFit",{type:Boolean,default:!0});y(this,"setColor",{type:Object,default:()=>null})}}const zn=c.defineComponent({__name:"index",props:{...new fh},setup(n){const e=n,t=c.ref([]),i=c.ref(new Map),r=c.ref([]),s=c.ref(new Map),o=c.ref(new Map);c.ref(!0);const a=c.ref(-1),l=c.ref(new Map),h=c.ref(new Map),u=c.ref(null),d=c.ref(0);c.watch(()=>e.modelArr,P=>{M(),P.length&&(e.modelArr=P,f(P))}),c.watch(()=>e.gpsType,P=>{a.value!==P&&(e.gpsType=P,a.value=P,v(e.gpsType))}),c.watch(()=>e.insert,P=>{E(P),e.isFit&&setTimeout(()=>{T()},50)}),c.watch(()=>e.inserts,P=>{g(P)}),c.watch(()=>e.clear,P=>{P&&M()}),c.watch(()=>e.isShowAll,P=>{if(P){I();return}x()}),c.watch(()=>e.setColor,P=>{P&&A(P)});const f=P=>{!P||!P.length||(P.forEach(k=>{E(k)}),e.isFit&&setTimeout(()=>{T()},50))},g=P=>{a.value=e.gpsType,P.forEach(k=>{E(k)}),e.isFit&&setTimeout(()=>{T()},50)},E=P=>{const{id:k,url:F,bbox:W,isShow:he,stroke:Me,fillColor:_t,zIndex:qe,width:wt,extractStyles:Et,gcj02Url:Ae}=P;if(!o.value.has(k)){const be=new R.LKML({id:k,url:e.gpsType===1?Ae:F,bbox:W,isShow:he,stroke:Me,fillColor:_t,zIndex:qe,width:wt},e.map,Et);o.value.set(k,be),l.value.set(k,F),Ae&&h.value.set(k,Ae)}p(P.id,W)},m=()=>{var k,F,W;const P=(k=e.map)==null?void 0:k.getView().getZoom();typeof P>"u"||((F=e.map)==null||F.getView().setZoom(P+1e-5),(W=e.map)==null||W.getView().setZoom(P-1e-5))},p=(P,k)=>{if(i.value.has(P)||(t.value.push(k),i.value.set(P,k)),!s.value.has(P)){const F=w(k);r.value.push(F),s.value.set(P,F)}},C=(P,k)=>{var F;o.value.has(P)&&((F=o.value.get(P))==null||F.setUrl(k))},T=()=>{if(!(!t.value.length||!e.map)){if(t.value.length>1){R.fitNew(e.map,e.gpsType===1?r.value:t.value);return}L(e.gpsType===1?r.value[0]:t.value[0])}},L=P=>{const k=[P[0],P[3],P[2],P[1]],F=[P[2],P[1],P[0],P[3]];R.fitNew(e.map,[k,F])},w=P=>{const k=[],{lat:F,lon:W}=R.GPS.gcj_encrypt(P[0],P[1]),{lon:he,lat:Me}=R.GPS.gcj_encrypt(P[2],P[3]);return k.push(W),k.push(F),k.push(he),k.push(Me),k},M=()=>{o.value.forEach(P=>{P.removeKML(),P=null}),o.value.clear(),i.value.clear(),t.value=[],r.value=[],s.value.clear(),l.value.clear(),h.value.clear(),u.value=null,d.value=0},v=P=>{(P===1?h.value:l.value).forEach((F,W)=>{C(W,F)})},A=P=>{const{color:k,id:F}=P;o.value.has(F)&&o.value.get(F).setPolygonColor([k,k]),m()},I=()=>{o.value.forEach(P=>P.show())},x=()=>{o.value.forEach(P=>P.hide())};return c.onMounted(()=>{if(a.value=e.gpsType,e.modelArr.length){f(e.modelArr);return}e.inserts.length&&f(e.inserts)}),()=>{}}});zn.install=n=>{n.component("RyKMLs",zn)};class gh extends We{constructor(){super(...arguments);y(this,"model",{type:Object,default:()=>null});y(this,"isShow",{type:Boolean,default:!0});y(this,"clear",{type:Boolean,default:!1});y(this,"isFit",{type:Boolean,default:!0})}}const jn=c.defineComponent({__name:"index",props:{...new gh},setup(n){const e=n,t=c.ref([]),i=c.ref([]),r=c.ref(null),s=c.ref(-1);c.watch(()=>e.model,m=>{f(),m&&o(m)}),c.watch(()=>e.gpsType,m=>{s.value!=m&&(s.value=m,g(e.gpsType))}),c.watch(()=>e.clear,m=>m&&f()),c.watch(()=>e.isShow,m=>E(m)),c.onMounted(()=>{s.value=e.gpsType,o(e.model)});const o=m=>{m&&(a(m),e.isFit&&setTimeout(()=>{h()},50))},a=m=>{const{id:p,url:C,bbox:T,zIndex:L,projection:w}=m;let M="EPSG:4326";w instanceof Object&&(M=w);const v=new R.staticImage({id:p,url:C,imageExtent:T,zIndex:L,type:e.gpsType,projection:M},e.map);r.value=v,l(T)},l=m=>{t.value.push(m);const p=d(m);i.value.push(p)},h=()=>{if(!(!t.value.length||!e.map)){if(t.value.length>1){R.fitNew(e.map,e.gpsType==1?i.value:t.value,{});return}u(e.gpsType==1?i.value[0]:t.value[0])}},u=m=>{const p=[m[0],m[3],m[2],m[1]],C=[m[2],m[1],m[0],m[3]];R.fitNew(e.map,[p,C],{})},d=m=>{const p=[],{lat:C,lon:T}=R.GPS.gcj_encrypt(m[0],m[1]),{lon:L,lat:w}=R.GPS.gcj_encrypt(m[2],m[3]);return p.push(T),p.push(C),p.push(L),p.push(w),p},f=()=>{r.value&&r.value.removeImageLayer(),r.value=null,t.value=[],i.value=[]},g=m=>{r.value&&r.value.selectGPS(m)},E=m=>{var p;if(r.value){const C=r.value;(p=C==null?void 0:C[m?"show":"hide"])==null||p.call(C)}};return(m,p)=>(c.openBlock(),c.createElementBlock("div"))}});jn.install=n=>{n.component("RyStaticLayer",jn)};class mh extends We{constructor(){super(...arguments);y(this,"modelArr",{type:Array,default:()=>[]});y(this,"insert",{type:Object,default:()=>null});y(this,"inserts",{type:Array,default:()=>[]});y(this,"isShowAll",{type:Boolean,default:!0});y(this,"isShow",{type:Object,default:()=>null});y(this,"clear",{type:Boolean,default:!1});y(this,"isFit",{type:Boolean,default:!0})}}const Zn=c.defineComponent({__name:"index",props:{...new mh},setup(n){const e=n,t=c.reactive({bbox:[],bboxMap:new Map,bboxGCJ02:[],bboxMapGCJ02:new Map,staticMap:new Map,isCreate:!0,lastType:-1});c.watch(()=>e.modelArr,m=>{u(),m.length&&i(m)}),c.watch(()=>e.gpsType,m=>{t.lastType!=m&&(t.lastType=m,d(e.gpsType))}),c.watch(()=>e.insert,m=>{s(m),e.isFit&&setTimeout(()=>a(),50)}),c.watch(()=>e.inserts,m=>r(m)),c.watch(()=>e.clear,m=>m&&u()),c.watch(()=>e.isShowAll,m=>m?f():g()),c.watch(()=>e.isShow,m=>m&&E),c.onMounted(()=>{t.lastType=e.gpsType,i(e.modelArr)});const i=m=>{!m||!m.length||(m.forEach(p=>{s(p)}),e.isFit&&setTimeout(()=>a(),50))},r=m=>{t.lastType=e.gpsType,m.forEach(p=>s(p)),e.isFit&&setTimeout(()=>a(),50)},s=m=>{const{id:p,url:C,bbox:T,zIndex:L,projection:w}=m;if(!t.staticMap.has(p)){const M=new R.staticImage({id:p,url:C,imageExtent:T,zIndex:L,type:e.gpsType,projection:w},e.map);t.staticMap.set(p,M)}o(m.id,T)},o=(m,p)=>{if(t.bboxMap.has(m)||(t.bbox.push(p),t.bboxMap.set(m,p)),!t.bboxMapGCJ02.has(m)){const C=h(p);t.bboxGCJ02.push(C),t.bboxMapGCJ02.set(m,C)}},a=()=>{if(!(!t.bbox.length||!e.map)){if(t.bbox.length>1){R.fitNew(e.map,e.gpsType==1?t.bboxGCJ02:t.bbox);return}l(e.gpsType==1?t.bboxGCJ02[0]:t.bbox[0])}},l=m=>{const p=[m[0],m[3],m[2],m[1]],C=[m[2],m[1],m[0],m[3]];R.fitNew(e.map,[p,C])},h=m=>{const p=[],{lat:C,lon:T}=R.GPS.gcj_encrypt(m[0],m[1]),{lon:L,lat:w}=R.GPS.gcj_encrypt(m[2],m[3]);return p.push(T),p.push(C),p.push(L),p.push(w),p},u=()=>{t.staticMap.forEach(m=>{m.removeImageLayer(),m=null}),t.staticMap.clear(),t.bboxMap.clear(),t.bbox=[],t.bboxGCJ02=[],t.bboxMapGCJ02.clear()},d=m=>{t.staticMap.forEach(p=>p.selectGPS(m))},f=()=>{t.staticMap.forEach(m=>m.show())},g=()=>{t.staticMap.forEach(m=>m.hide())},E=m=>{const p=m.id;if(t.staticMap.has(p)){const C=t.staticMap.get(p);if(m.show){C.show();return}C.hide()}};return(m,p)=>(c.openBlock(),c.createElementBlock("div"))}});Zn.install=n=>{n.component("RyStaticLayers",Zn)};const ph=[bn,xn,kn,On,Dn,Nn,Gn,Bn,Fn,Vn,zn,jn,Zn],Ds={install(n){Jt&&Jt.install&&n.use(Jt),ph.forEach(e=>{e&&typeof e.install=="function"&&e.install(n)})}};X.Directives=Jt,X.LMapServices=Os,X.RyClusters=Nn,X.RyClustersMarker=Gn,X.RyKML=Vn,X.RyKMLs=zn,X.RyLines=Dn,X.RyMap=bn,X.RyPolygon=Bn,X.RyPolygonGeo=xn,X.RyPolygons=Fn,X.RyStaticLayer=jn,X.RyStaticLayers=Zn,X.RyUIMap=Ds,X.RyWMSs=kn,X.RyWMTSs=On,X.default=Ds,Object.defineProperties(X,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|