/usr/share/grafana/public/build
"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8271],{20276:(Vd,pi,y)=>{y.d(pi,{w:()=>K});var v=y(74848),Wt=y(22803),E=y(96540),sn=y(63142);const Ys=10,K=({colorPalette:Ee,min:D,max:on,display:Be,hoverValue:It,useStopsPercentage:Rt})=>{const[Sn,Xt]=(0,E.useState)([]),[Pt,M]=(0,E.useState)({isShown:!1,value:0}),[Zt,U]=(0,E.useState)(null),Er=(0,sn.$j)(),He=Hs(Er,Sn);(0,E.useEffect)(()=>{Xt(gi({colorArray:Ee,stops:Ys,useStopsPercentage:Rt}))},[Ee,Rt]);const Ks=yi=>{const qs=yi.nativeEvent.offsetX,an=yi.currentTarget.offsetWidth,vi=Math.floor(qs*100/an+1),Qs=Math.floor((on-D)*vi/100+D);M({isShown:!0,value:Qs}),U(vi)},Js=()=>{M({isShown:!1,value:0})};return(0,E.useEffect)(()=>{U(It==null?null:mi((It-D)/(on-D)))},[It,D,on]),(0,v.jsxs)("div",{className:He.scaleWrapper,onMouseMove:Ks,onMouseLeave:Js,children:[(0,v.jsx)("div",{className:He.scaleGradient,children:Be&&(Pt.isShown||It!==void 0)&&(0,v.jsx)("div",{className:He.followerContainer,children:(0,v.jsx)("div",{className:He.follower,style:{left:`${Zt}%`}})})}),Be&&(0,v.jsxs)("div",{className:He.followerContainer,children:[(0,v.jsxs)("div",{className:He.legendValues,children:[(0,v.jsx)("span",{className:He.disabled,children:Be(D)}),(0,v.jsx)("span",{className:He.disabled,children:Be(on)})]}),Zt!=null&&(Pt.isShown||It!==void 0)&&(0,v.jsx)("span",{className:He.hoverValue,style:{left:`${Zt}%`},children:Be(It??Pt.value)})]})]})},gi=({colorArray:Ee,stops:D,useStopsPercentage:on=!0})=>{const Be=Ee.length;if(on&&Be<=20){const Xt=1/Be*100;let Pt=0;const M=[];for(const Zt of Ee)Pt>0?M.push(`${Zt} ${Pt}%`):M.push(Zt),Pt+=Xt,M.push(`${Zt} ${Pt}%`);return M}const It=Ee[Be-1],Rt=Math.ceil(Be/D),Sn=new Set;for(let Xt=0;Xt<Be;Xt+=Rt)Sn.add(Ee[Xt]);return Sn.add(It),[...Sn]};function mi(Ee){return Ee>1?100:Ee<0?0:Ee*100}const Hs=(Ee,D)=>({scaleWrapper:(0,Wt.css)({width:"100%",fontSize:"11px",opacity:1}),scaleGradient:(0,Wt.css)({background:`linear-gradient(90deg, ${D.join()})`,height:"9px",pointerEvents:"none",borderRadius:Ee.shape.radius.default}),legendValues:(0,Wt.css)({display:"flex",justifyContent:"space-between",pointerEvents:"none"}),hoverValue:(0,Wt.css)({position:"absolute",marginTop:"-14px",padding:"3px 15px",transform:"translateX(-50%)"}),followerContainer:(0,Wt.css)({position:"relative",pointerEvents:"none",whiteSpace:"nowrap"}),follower:(0,Wt.css)({position:"absolute",height:"13px",width:"13px",borderRadius:Ee.shape.radius.default,transform:"translateX(-50%) translateY(-50%)",border:`2px solid ${Ee.colors.text.primary}`,top:"5px"}),disabled:(0,Wt.css)({color:Ee.colors.text.disabled})})},38271:(Vd,pi,y)=>{y.r(pi),y.d(pi,{plugin:()=>Fv});var v=y(74848),Wt=y(16207),E=y(92745),sn=y(43173),Ys=y(45013),K=y(22803),gi=y(17437),mi=y(91765),Hs=y(57456),Ee=y(25176),D=y(82922),on=y(10972);const Be="units",It=[1,2,5],Rt=25.4/.28;class Sn extends on.A{constructor(e){e=e||{};const t=document.createElement("div");t.style.pointerEvents="none",super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+Ee.XI,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(Be,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(Be)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(Be,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=e.center,r=e.projection,i=this.getUnits(),s=i=="degrees"?"degrees":"m";let o=(0,D.hO)(r,e.resolution,t,s);const a=this.minWidth_*(this.dpi_||Rt)/Rt,l=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||Rt)/Rt:void 0;let c=a*o,u="";if(i=="degrees"){const b=D.Ig.degrees;c*=b,c<b/60?(u="\u2033",o*=3600):c<b?(u="\u2032",o*=60):u="\xB0"}else if(i=="imperial")c<.9144?(u="in",o/=.0254):c<1609.344?(u="ft",o/=.3048):(u="mi",o/=1609.344);else if(i=="nautical")o/=1852,u="NM";else if(i=="metric")c<1e-6?(u="nm",o*=1e9):c<.001?(u="\u03BCm",o*=1e6):c<1?(u="mm",o*=1e3):c<1e3?u="m":(u="km",o/=1e3);else if(i=="us")c<.9144?(u="in",o*=39.37):c<1609.344?(u="ft",o/=.30480061):(u="mi",o/=1609.3472);else throw new Error("Invalid units");let d=3*Math.floor(Math.log(a*o)/Math.log(10)),h,f,p,g=0,m,x;for(;;){p=Math.floor(d/3);const b=Math.pow(10,p);if(h=It[(d%3+3)%3]*b,f=Math.round(h/o),isNaN(f)){this.element.style.display="none",this.renderedVisible_=!1;return}if(l!==void 0&&f>=l){h=g,f=m,p=x;break}else if(f>=a)break;g=h,m=f,x=p,++d}const w=this.scaleBar_?this.createScaleBar(f,h,u):h.toFixed(p<0?-p:0)+" "+u;this.renderedHTML_!=w&&(this.innerElement_.innerHTML=w,this.renderedHTML_=w),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,r){const i=this.getScaleForResolution(),s=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),o=this.scaleBarSteps_,a=e/o,l=[this.createMarker("absolute")];for(let u=0;u<o;++u){const d=u%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";l.push(`<div><div class="ol-scale-singlebar ${d}" style="width: ${a}px;"></div>`+this.createMarker("relative")+(u%2===0||o===2?this.createStepText(u,e,!1,t,r):"")+"</div>")}return l.push(this.createStepText(o,e,!0,t,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+s+"</div>":"")+l.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,t,r,i,s){const a=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+s),l=e===0?-3:t/this.scaleBarSteps_*-1,c=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${l}px;text-align: ${e===0?"left":"center"};min-width: ${c}px;left: ${r?t+"px":"unset"};">`+a+"</div>"}getScaleForResolution(){const e=(0,D.hO)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),t=this.dpi_||Rt,r=1e3/25.4;return e*r*t}render(e){const t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}}const Xt=Sn;var Pt=y(69186),M=y(70915),Zt=y(88751),U=y(96540),Er=y(64423),He=y(57852),Ks=y(64400),Js=y(45229),yi=y(88813),qs=y(87745),an=y(63142);const vi=({topRight1:n,topRight2:e,bottomLeft:t,blStyle:r})=>{const i=(n&&n.length>0)??!1,s=(0,an.of)(Qs(i));return(0,v.jsxs)("div",{className:s.overlay,children:[!!n?.length&&(0,v.jsx)("div",{className:s.TR1,children:n}),!!e?.length&&(0,v.jsx)("div",{className:s.TR2,children:e}),!!t?.length&&(0,v.jsx)("div",{className:s.BL,style:r,children:t})]})},Qs=n=>e=>({overlay:(0,K.css)({position:"absolute",width:"100%",height:"100%",zIndex:500,pointerEvents:"none"}),TR1:(0,K.css)({right:"0.5em",pointerEvents:"auto",position:"absolute",top:"0.5em"}),TR2:(0,K.css)({position:"absolute",top:n?"80px":"8px",right:"8px",pointerEvents:"auto"}),BL:(0,K.css)({position:"absolute",bottom:"8px",left:"8px",pointerEvents:"auto"})});var Ud=y(18828),Wd=y(93225),Xd=y(15245),Zd=y(71076),Yd=y(15840),$e=y(2543),_r=y(95004),Hd=y(16515),Kd=y(13941),Jd=y(89599),tl=y(53049),qd=y(27359),Qd=y(13326);const nl=({feature:n})=>{let e,t=0;if(!n)return null;if(e=n.get("frame"),e)t=n.get("rowIndex");else{const{geometry:r,...i}=n.getProperties();e=new qd.f([i])}return(0,v.jsx)(Qd.e,{data:e,rowIndex:t})},eh=({layers:n,activeTabIndex:e})=>{const t=(0,an.of)(nh),[r,i]=(0,U.useState)(new Map),s=(o,a)=>{i(new Map(r.set(o,a)))};return(0,v.jsx)(Kd.J,{children:n.map((o,a)=>a===e&&(0,v.jsx)("div",{children:(0,v.jsx)("div",{children:o.features.map((l,c)=>{const u=l.getId()??c;return o.features.length>1?(0,v.jsx)(Jd.S,{label:th(l,c),isOpen:r.get(u),onToggle:()=>{s(u,!r.get(u))},className:t.collapsibleRow,children:(0,v.jsx)(nl,{feature:l})},u):(0,v.jsx)(nl,{feature:l},u)})})},o.layer.getName()))})},th=(n,e)=>{const t=["Name","name","Title","ID","id"];let r=n.getProperties(),i="";const s=n.get("frame");if(s){const o=n.get("rowIndex");for(const a of s.fields)if(a.type===_r.PU.string){const l=(0,Hd.Ct)(a,s);i||(i=l),r[l]=a.values[o]}}for(let o of t){const a=r[o];if(a)return a}if(i)return(0,v.jsxs)("span",{children:[i,": ",(0,tl.A)(r[i])]});for(let o of Object.keys(r)){const a=r[o];if((0,$e.isString)(a))return(0,v.jsxs)("span",{children:[o,": ",(0,tl.A)(a)]})}return`Match: ${e+1}`},nh=n=>({collapsibleRow:(0,K.css)({marginBottom:0})});var rh=y(54314),ih=y(60208);const sh=({layers:n,setActiveTabIndex:e,activeTabIndex:t})=>(0,v.jsx)(rh.U,{children:n&&n.map((r,i)=>(0,v.jsx)(ih.o,{label:r.layer.getName(),active:i===t,counter:r.features.length>1?r.features.length:null,onChangeTab:()=>{e(i)}},i))}),oh=({layers:n,onClose:e,isOpen:t})=>{const[r,i]=(0,U.useState)(0);return n?(0,v.jsxs)(v.Fragment,{children:[t&&(0,v.jsx)(Yd.J,{style:{zIndex:1},onClick:e}),(0,v.jsx)(sh,{layers:n,setActiveTabIndex:i,activeTabIndex:r}),(0,v.jsx)(eh,{layers:n,activeTabIndex:r})]}):null},ah=({ttip:n,onClose:e,isOpen:t})=>{const r=(0,U.createRef)(),{overlayProps:i}=(0,Wd.e)({onClose:e,isDismissable:!0,isOpen:t},r),{dialogProps:s}=(0,Ud.s)({},r);return(0,v.jsx)(v.Fragment,{children:n&&n.layers&&(0,v.jsx)(Xd.ZL,{children:(0,v.jsx)(Zd.o,{position:{x:n.pageX,y:n.pageY},offset:{x:10,y:10},allowPointerEvents:!0,children:(0,v.jsx)("section",{ref:r,...i,...s,children:(0,v.jsx)(oh,{layers:n.layers,isOpen:t,onClose:e})})})})})};var kt=y(84140),rl=y(51898),Cn=y(65642);class lh extends U.PureComponent{constructor(e){super(e),this.style=ch(Cn.$W.theme2),this.updateViewState=()=>{const t=this.props.map.getView();this.setState({zoom:t.getZoom(),center:(0,D.pd)(t.getCenter(),t.getProjection(),"EPSG:4326")})},this.state={zoom:0,center:[0,0]}}componentDidMount(){this.props.map.on("moveend",this.updateViewState),this.updateViewState()}render(){const{zoom:e,center:t}=this.state;return(0,v.jsx)("div",{className:this.style.infoWrap,"aria-label":rl.Tp.components.DebugOverlay.wrapper,children:(0,v.jsx)("table",{children:(0,v.jsxs)("tbody",{children:[(0,v.jsxs)("tr",{children:[(0,v.jsx)("th",{children:(0,v.jsx)(E.x6,{i18nKey:"geomap.debug-overlay.zoom",children:"Zoom:"})}),(0,v.jsx)("td",{children:e?.toFixed(1)})]}),(0,v.jsxs)("tr",{children:[(0,v.jsxs)("th",{children:[(0,v.jsx)(E.x6,{i18nKey:"geomap.debug-overlay.center",children:"Center:"}),"\xA0"]}),(0,v.jsxs)("td",{children:[t[0].toFixed(5),", ",t[1].toFixed(5)]})]})]})})})}}const ch=n=>({infoWrap:(0,K.css)({color:n.colors.text.primary,background:(0,kt.A)(n.components.panel.background).setAlpha(.7).toString(),borderRadius:n.shape.radius.default,padding:n.spacing(1)})});var Un=y(77824),xi=y(45861),Wn=y(18857),eo=y(76319),it=y(55386);const Ve=[{value:"length",label:"Length",geometry:"LineString",units:[{label:"Metric (m/km)",value:"m",format:n=>(0,it.j_)("lengthm")(n)},{label:"Feet (ft)",value:"ft",format:n=>(0,it.j_)("lengthft")(n*3.28084)},{label:"Miles (mi)",value:"mi",format:n=>(0,it.j_)("lengthmi")(n/1609)},{label:"Nautical miles (nmi)",value:"nmi",format:n=>(0,it.j_)("nmi")(n/1852)}],getUnit:n=>{const e=Ve[0].units;return n?.endsWith("2")&&(n=n.substring(0,n.length-1)),e.find(t=>t.value===n)??e[0]}},{value:"area",label:"Area",geometry:"Polygon",units:[{label:"Square Meters (m\xB2)",value:"m2",format:n=>(0,it.j_)("areaM2")(n)},{label:"Square Kilometers (km\xB2)",value:"km2",format:n=>(0,it.G8)("km\xB2")(n*1e-6)},{label:"Square Feet (ft\xB2)",value:"ft2",format:n=>(0,it.j_)("areaF2")(n*10.76391)},{label:"Square Miles (mi\xB2)",value:"mi2",format:n=>(0,it.j_)("areaMI2")(n*3861e-10)},{label:"Acres",value:"acre2",format:n=>(0,it.G8)("acre")(n*247105e-9)},{label:"Hectare",value:"hectare2",format:n=>(0,it.G8)("ha")(n*1e-4)}],getUnit:n=>{const e=Ve[1].units;return n?.endsWith("2")||(n+="2"),e.find(t=>t.value===n)??e[0]}}];var gt=y(71064),je=y(11217),Ue=y(44294),to=y(50071),wi=y(32135),_e=y(86717),st=y(73445),Xn=y(66514),fe=y(6933),An=y(1685),mt=y(6837),Yt=y(58704),yt=y(82986),uh=y(28450),vt=y(90588),xt=y(9438);let il=!1;function sl(n,e,t,r,i,s,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,r,i):n,!0),e.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=il,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let u;c=="text"||c=="json"?u=a.responseText:c=="xml"?u=a.responseXML||a.responseText:c=="arraybuffer"&&(u=a.response),u?s(e.readFeatures(u,{extent:t,featureProjection:i}),e.readProjection(u)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ol(n,e){return function(t,r,i,s,o){sl(n,e,t,r,i,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}function Mv(n){il=n}var ln=y(74238);function al(n,e){return[[-1/0,-1/0,1/0,1/0]]}function dh(n,e){return[n]}function Lv(n){return function(e,t,r){const i=n.getZForResolution(fromUserResolution(t,r)),s=n.getTileRangeForExtentAndZ(fromUserExtent(e,r),i),o=[],a=[i,0,0];for(a[1]=s.minX;a[1]<=s.maxX;++a[1])for(a[2]=s.minY;a[2]<=s.maxY;++a[2])o.push(toUserExtent(n.getTileCoordExtent(a),r));return o}}var bi=y(43530),Mt=y(24778),hh=y(42375),W=y(4087);class fh{constructor(e){this.rbush_=new hh.A(e),this.items_={}}insert(e,t){const r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(r),this.items_[(0,W.v6)(t)]=r}load(e,t){const r=new Array(t.length);for(let i=0,s=t.length;i<s;i++){const o=e[i],a=t[i],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};r[i]=l,this.items_[(0,W.v6)(a)]=l}this.rbush_.load(r)}remove(e){const t=(0,W.v6)(e),r=this.items_[t];return delete this.items_[t],this.rbush_.remove(r)!==null}update(e,t){const r=this.items_[(0,W.v6)(t)],i=[r.minX,r.minY,r.maxX,r.maxY];(0,M.aI)(i,e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(i){return i.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let r;for(let i=0,s=e.length;i<s;i++)if(r=t(e[i]),r)return r;return r}isEmpty(){return(0,bi.p)(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return(0,M.N)(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const t in e.items_)this.items_[t]=e.items_[t]}}const no=fh;var ph=y(34120);class gh extends ph.A{constructor(e){super(),this.projection=(0,D.Jt)(e.projection),this.attributions_=ll(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(r,i){t.viewResolver=r,t.viewRejector=i})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=ll(e),this.changed()}setState(e){this.state_=e,this.changed()}}function ll(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),e=>n):null}const Zn=gh;var Fe=y(88280);class cn extends An.Ay{constructor(e,t,r){super(e),this.feature=t,this.features=r}}class mh extends Zn{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=ln.tV,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&((0,vt.v)(this.format_,"`format` must be set when `url` is set"),this.loader_=ol(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:al;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new no:null,this.loadedExtentsRtree_=new no,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let r,i;Array.isArray(e.features)?i=e.features:e.features&&(r=e.features,i=r.getArray()),!t&&r===void 0&&(r=new to.A(i)),i!==void 0&&this.addFeaturesInternal(i),r!==void 0&&this.bindFeaturesCollection_(r)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=(0,W.v6)(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);const r=e.getGeometry();if(r){const i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new cn(Fe.A.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof Mt.Ay||(this.featureChangeKeys_[e]=[(0,xt.KT)(t,mt.A.CHANGE,this.handleFeatureChange_,this),(0,xt.KT)(t,uh.A.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let r=!0;if(t.getId()!==void 0){const i=String(t.getId());if(!(i in this.idIndex_))this.idIndex_[i]=t;else if(t instanceof Mt.Ay){const s=this.idIndex_[i];s instanceof Mt.Ay?Array.isArray(s)?s.push(t):this.idIndex_[i]=[s,t]:r=!1}else r=!1}return r&&((0,vt.v)(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),r}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const t=[],r=[],i=[];for(let s=0,o=e.length;s<o;s++){const a=e[s],l=(0,W.v6)(a);this.addToIndex_(l,a)&&r.push(a)}for(let s=0,o=r.length;s<o;s++){const a=r[s],l=(0,W.v6)(a);this.setupChangeEvents_(l,a);const c=a.getGeometry();if(c){const u=c.getExtent();t.push(u),i.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,i),this.hasListener(Fe.A.ADDFEATURE))for(let s=0,o=r.length;s<o;s++)this.dispatchEvent(new cn(Fe.A.ADDFEATURE,r[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(Fe.A.ADDFEATURE,function(r){t||(t=!0,e.push(r.feature),t=!1)}),this.addEventListener(Fe.A.REMOVEFEATURE,function(r){t||(t=!0,e.remove(r.feature),t=!1)}),e.addEventListener(wi.A.ADD,r=>{t||(t=!0,this.addFeature(r.element),t=!1)}),e.addEventListener(wi.A.REMOVE,r=>{t||(t=!0,this.removeFeature(r.element),t=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const r in this.featureChangeKeys_)this.featureChangeKeys_[r].forEach(xt.JH);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(r=>{this.removeFeatureInternal(r)});for(const r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const t=new cn(Fe.A.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,function(i){const s=i.getGeometry();if(s instanceof Mt.Ay||s.intersectsCoordinate(e))return t(i)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(r){const i=r.getGeometry();if(i instanceof Mt.Ay||i.intersectsExtent(e)){const s=t(r);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),(0,bi.p)(this.nullGeometryFeatures_)||(0,Xn.X$)(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const t=[];return this.forEachFeatureAtCoordinateDirect(e,function(r){t.push(r)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const i=(0,M.QJ)(e,t);return[].concat(...i.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){const r=e[0],i=e[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return t=t||ln.rT,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const u=c.getGeometry(),d=a;if(a=u instanceof Mt.Ay?0:u.closestPointXY(r,i,o,a),a<d){s=c;const h=Math.sqrt(a);l[0]=r-h,l[1]=i-h,l[2]=r+h,l[3]=i+h}}}),s}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const t=this.idIndex_[e.toString()];return t!==void 0?t:null}getFeatureByUid(e){const t=this.uidIndex_[e];return t!==void 0?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const t=e.target,r=(0,W.v6)(t),i=t.getGeometry();if(!i)r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[r]=t);else{const o=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(o,t)):this.featuresRtree_&&this.featuresRtree_.update(o,t)}const s=t.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[o]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[r]=t;this.changed(),this.dispatchEvent(new cn(Fe.A.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:(0,W.v6)(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&(0,bi.p)(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,r){const i=this.loadedExtentsRtree_,s=this.strategy_(e,t,r);for(let o=0,a=s.length;o<a;++o){const l=s[o];i.forEachInExtent(l,function(u){return(0,M.ms)(u.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new cn(Fe.A.FEATURESLOADSTART)),this.loader_.call(this,l,t,r,u=>{--this.loadingExtentsCount_,this.dispatchEvent(new cn(Fe.A.FEATURESLOADEND,void 0,u))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new cn(Fe.A.FEATURESLOADERROR))}),i.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_,r=t.forEachInExtent(e,function(i){if((0,M.aI)(i.extent,e))return i});r&&t.remove(r)}removeFeatures(e){let t=!1;for(let r=0,i=e.length;r<i;++r)t=this.removeFeatureInternal(e[r])||t;t&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const t=(0,W.v6)(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[t]?.forEach(xt.JH),delete this.featureChangeKeys_[t];const i=e.getId();if(i!==void 0){const s=i.toString(),o=this.idIndex_[s];o===e?delete this.idIndex_[s]:Array.isArray(o)&&(o.splice(o.indexOf(e),1),o.length===1&&(this.idIndex_[s]=o[0]))}return delete this.uidIndex_[t],this.hasListener(Fe.A.REMOVEFEATURE)&&this.dispatchEvent(new cn(Fe.A.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){(0,vt.v)(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(ol(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const Re=mh;var X=y(29276),cl=y(21409);const ul=0,Fr=1,dl=[0,0,0,0],Yn=[],ro={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class io extends An.Ay{constructor(e,t,r){super(e),this.features=t,this.mapBrowserEvent=r}}class yh extends cl.A{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:Yt.fs,this.defaultDeleteCondition_=function(r){return(0,Yt.Js)(r)&&(0,Yt.t5)(r)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Yt.Gk,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new no,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new yt.A({source:new Re({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:xh(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new to.A(this.source_.getFeatures()),this.source_.addEventListener(Fe.A.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Fe.A.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(wi.A.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(wi.A.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const i=this.SEGMENT_WRITERS_[t.getType()];i&&i(e,t)}const r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(r.getCoordinateFromPixel(this.lastPixel_)),e.addEventListener(mt.A.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new to.A;const r=this.featuresBeingModified_.getArray();for(let i=0,s=t.length;i<s;++i){const o=t[i].feature;o&&!r.includes(o)&&this.featuresBeingModified_.push(o)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new io(ro.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(mt.A.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){const t=this.rBush_,r=[];t.forEach(function(i){e===i.feature&&r.push(i)});for(let i=r.length-1;i>=0;--i){const s=r[i];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);t.remove(s)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const r=t.getCoordinates(),i={feature:e,geometry:t,segment:[r,r]};this.rBush_.insert(t.getExtent(),i)}writeMultiPointGeometry_(e,t){const r=t.getCoordinates();for(let i=0,s=r.length;i<s;++i){const o=r[i],a={feature:e,geometry:t,depth:[i],index:i,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){const r=t.getCoordinates();for(let i=0,s=r.length-1;i<s;++i){const o=r.slice(i,i+2),a={feature:e,geometry:t,index:i,segment:o};this.rBush_.insert((0,M.Tr)(o),a)}}writeMultiLineStringGeometry_(e,t){const r=t.getCoordinates();for(let i=0,s=r.length;i<s;++i){const o=r[i];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),u={feature:e,geometry:t,depth:[i],index:a,segment:c};this.rBush_.insert((0,M.Tr)(c),u)}}}writePolygonGeometry_(e,t){const r=t.getCoordinates();for(let i=0,s=r.length;i<s;++i){const o=r[i];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),u={feature:e,geometry:t,depth:[i],index:a,segment:c};this.rBush_.insert((0,M.Tr)(c),u)}}}writeMultiPolygonGeometry_(e,t){const r=t.getCoordinates();for(let i=0,s=r.length;i<s;++i){const o=r[i];for(let a=0,l=o.length;a<l;++a){const c=o[a];for(let u=0,d=c.length-1;u<d;++u){const h=c.slice(u,u+2),f={feature:e,geometry:t,depth:[a,i],index:u,segment:h};this.rBush_.insert((0,M.Tr)(h),f)}}}}writeCircleGeometry_(e,t){const r=t.getCenter(),i={feature:e,geometry:t,index:ul,segment:[r,r]},s={feature:e,geometry:t,index:Fr,segment:[r,r]},o=[i,s];i.featureSegments=o,s.featureSegments=o,this.rBush_.insert((0,M.dP)(r),i);let a=t;const l=(0,D.Tf)();if(l&&this.getMap()){const c=this.getMap().getView().getProjection();a=a.clone().transform(l,c),a=(0,gt.nD)(a).transform(c,l)}this.rBush_.insert(a.getExtent(),s)}writeGeometryCollectionGeometry_(e,t){const r=t.getGeometriesArray();for(let i=0;i<r.length;++i){const s=r[i],o=this.SEGMENT_WRITERS_[s.getType()];o(e,s)}}createOrUpdateVertexFeature_(e,t,r,i){let s=this.vertexFeature_;return s?s.getGeometry().setCoordinates(e):(s=new _e.A(new Ue.A(e)),this.vertexFeature_=s,this.overlay_.getSource().addFeature(s)),s.set("features",t),s.set("geometries",r),s.set("existing",i),s}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==st.A.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(e.type!=st.A.SINGLECLICK||!this.ignoreNextSingleClick_?t=this.removePoint():t=!0),e.type==st.A.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null;const t=this.vertexFeature_;if(!t)return;const r=this.getMap().getView().getProjection(),i=[],s=t.getGeometry().getCoordinates(),o=(0,M.Tr)([s]),a=this.rBush_.getInExtent(o),l={};a.sort(vh);for(let c=0,u=a.length;c<u;++c){const d=a[c],h=d.segment;let f=(0,W.v6)(d.geometry);const p=d.depth;if(p&&(f+="-"+p.join("-")),l[f]||(l[f]=new Array(2)),d.geometry.getType()==="Circle"&&d.index===Fr){const g=fl(e,d,r);(0,fe.aI)(g,s)&&!l[f][0]&&(this.dragSegments_.push([d,0]),l[f][0]=d);continue}if((0,fe.aI)(h[0],s)&&!l[f][0]){this.dragSegments_.push([d,0]),l[f][0]=d;continue}if((0,fe.aI)(h[1],s)&&!l[f][1]){if(l[f][0]&&l[f][0].index===0){let g=d.geometry.getCoordinates();switch(d.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":g=g[p[1]];case"Polygon":if(d.index!==g[p[0]].length-2)continue;break;default:}}this.dragSegments_.push([d,1]),l[f][1]=d;continue}(0,W.v6)(h)in this.vertexSegments_&&!l[f][0]&&!l[f][1]&&i.push(d)}return i}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([s])=>s));const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],r=[],i=[];for(let s=0,o=this.dragSegments_.length;s<o;++s){const a=this.dragSegments_[s],l=a[0],c=l.feature;r.includes(c)||r.push(c);const u=l.geometry;i.includes(u)||i.push(u);const d=l.depth;let h;const f=l.segment,p=a[1];for(;t.length<u.getStride();)t.push(f[p][t.length]);switch(u.getType()){case"Point":h=t,f[0]=t,f[1]=t;break;case"MultiPoint":h=u.getCoordinates(),h[l.index]=t,f[0]=t,f[1]=t;break;case"LineString":h=u.getCoordinates(),h[l.index+p]=t,f[p]=t;break;case"MultiLineString":h=u.getCoordinates(),h[d[0]][l.index+p]=t,f[p]=t;break;case"Polygon":h=u.getCoordinates(),h[d[0]][l.index+p]=t,f[p]=t;break;case"MultiPolygon":h=u.getCoordinates(),h[d[1]][d[0]][l.index+p]=t,f[p]=t;break;case"Circle":const g=u;if(f[0]=t,f[1]=t,l.index===ul)this.changingFeature_=!0,g.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0;const m=e.map.getView().getProjection();let x=(0,fe.Io)((0,D.Ad)(g.getCenter(),m),(0,D.Ad)(t,m));const w=(0,D.Tf)();if(w){const b=g.clone().transform(w,m);b.setRadius(x),x=b.transform(m,w).getRadius()}g.setRadius(x),this.changingFeature_=!1}break;default:}h&&this.setGeometryCoordinates_(u,h)}this.createOrUpdateVertexFeature_(t,r,i,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;const t=e.coordinate,r=this.findInsertVerticesAndUpdateDragSegments_(t);if(r?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,r),this.vertexFeature_)){const i=this.vertexFeature_.getGeometry().getCoordinates();for(let s=r.length-1;s>=0;--s)this.insertVertex_(r[s],i);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const r=this.dragSegments_[t][0],i=r.geometry;if(i.getType()==="Circle"){const s=i,o=s.getCenter(),a=r.featureSegments[0],l=r.featureSegments[1];a.segment[0]=o,a.segment[1]=o,l.segment[0]=o,l.segment[1]=o,this.rBush_.update((0,M.dP)(o),a);let c=s;const u=(0,D.Tf)();if(u){const d=e.map.getView().getProjection();c=c.clone().transform(u,d),c=(0,gt.nD)(c).transform(d,u)}this.rBush_.update(c.getExtent(),l)}else this.rBush_.update((0,M.Tr)(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new io(ro.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.coordinate)}handlePointerAtPixel_(e){const t=this.getMap(),r=t.getPixelFromCoordinate(e),i=t.getView().getProjection(),s=function(l,c){return hl(e,l,i)-hl(e,c,i)};let o,a;if(this.hitDetection_){const l=typeof this.hitDetection_=="object"?c=>c===this.hitDetection_:void 0;t.forEachFeatureAtPixel(r,(c,u,d)=>{d&&d.getType()==="Point"&&(d=new Ue.A((0,D.te)(d.getCoordinates(),i)));const h=d||c.getGeometry();if(h&&h.getType()==="Point"&&c instanceof _e.A&&this.features_.getArray().includes(c)){a=h;const f=c.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:c,geometry:a,segment:[f,f]}]}return!0},{layerFilter:l})}if(!o){const l=(0,D.SD)((0,M.dP)(e,dl),i),c=t.getView().getResolution()*this.pixelTolerance_,u=(0,D.JR)((0,M.r)(l,c,dl),i);o=this.rBush_.getInExtent(u)}if(o&&o.length>0){const l=o.sort(s)[0],c=l.segment;let u=fl(e,l,i);const d=t.getPixelFromCoordinate(u);let h=(0,fe.Io)(r,d);if(a||h<=this.pixelTolerance_){const f={};if(f[(0,W.v6)(c)]=!0,this.snapToPointer_||(this.delta_[0]=u[0]-e[0],this.delta_[1]=u[1]-e[1]),l.geometry.getType()==="Circle"&&l.index===Fr)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(u,[l.feature],[l.geometry],this.snappedToVertex_);else{const p=t.getPixelFromCoordinate(c[0]),g=t.getPixelFromCoordinate(c[1]),m=(0,fe.hG)(d,p),x=(0,fe.hG)(d,g);if(h=Math.sqrt(Math.min(m,x)),this.snappedToVertex_=h<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);return}this.snappedToVertex_&&(u=m>x?c[1]:c[0]),this.createOrUpdateVertexFeature_(u,[l.feature],[l.geometry],this.snappedToVertex_);const w={};w[(0,W.v6)(l.geometry)]=!0;for(let b=1,T=o.length;b<T;++b){const S=o[b].segment;if((0,fe.aI)(c[0],S[0])&&(0,fe.aI)(c[1],S[1])||(0,fe.aI)(c[0],S[1])&&(0,fe.aI)(c[1],S[0])){const A=(0,W.v6)(o[b].geometry);A in w||(w[A]=!0,f[(0,W.v6)(S)]=!0)}else break}}this.vertexSegments_=f;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(e,t){const r=e.segment,i=e.feature,s=e.geometry,o=e.depth,a=e.index;let l;for(;t.length<s.getStride();)t.push(0);switch(s.getType()){case"MultiLineString":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"Polygon":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"MultiPolygon":l=s.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,t);break;case"LineString":l=s.getCoordinates(),l.splice(a+1,0,t);break;default:return!1}this.setGeometryCoordinates_(s,l);const c=this.rBush_;c.remove(e),this.updateSegmentIndices_(s,a,o,1);const u={segment:[r[0],t],feature:i,geometry:s,depth:o,index:a};c.insert((0,M.Tr)(u.segment),u),this.dragSegments_.push([u,1]);const d={segment:[t,r[1]],feature:i,geometry:s,depth:o,index:a+1};return c.insert((0,M.Tr)(d.segment),d),this.dragSegments_.push([d,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){const e=this.vertexFeature_?.getGeometry().getCoordinates();return e?(0,D.te)(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(r=>r.getType()==="Circle"||r.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent((0,M.Tr)([e])).some(({segment:r})=>(0,fe.aI)(r[0],e)||(0,fe.aI)(r[1],e))}removePoint(e){if(e&&(e=(0,D.Ad)(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=st.A.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([i])=>i));const r=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new io(ro.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,r}return!1}removeVertex_(){const e=this.dragSegments_,t={};let r=!1,i,s,o,a,l,c,u,d,h,f,p;for(l=e.length-1;l>=0;--l)o=e[l],f=o[0],p=(0,W.v6)(f.feature),f.depth&&(p+="-"+f.depth.join("-")),p in t||(t[p]={}),o[1]===0?(t[p].right=f,t[p].index=f.index):o[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(h=t[p].right,u=t[p].left,c=t[p].index,d=c-1,u!==void 0?f=u:f=h,d<0&&(d=0),a=f.geometry,s=a.getCoordinates(),i=s,r=!1,a.getType()){case"MultiLineString":s[f.depth[0]].length>2&&(s[f.depth[0]].splice(c,1),r=!0);break;case"LineString":s.length>2&&(s.splice(c,1),r=!0);break;case"MultiPolygon":i=i[f.depth[1]];case"Polygon":i=i[f.depth[0]],i.length>4&&(c==i.length-1&&(c=0),i.splice(c,1),r=!0,c===0&&(i.pop(),i.push(i[0]),d=i.length-1));break;default:}if(r){this.setGeometryCoordinates_(a,s);const g=[];if(u!==void 0&&(this.rBush_.remove(u),g.push(u.segment[0])),h!==void 0&&(this.rBush_.remove(h),g.push(h.segment[1])),u!==void 0&&h!==void 0){const m={depth:f.depth,feature:f.feature,geometry:f.geometry,index:d,segment:g};this.rBush_.insert((0,M.Tr)(m.segment),m)}this.updateSegmentIndices_(a,c,f.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return r}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(r=>r.getType()==="Circle"||r.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent((0,M.Tr)([e])).some(({segment:r})=>!((0,fe.aI)(r[0],e)||(0,fe.aI)(r[1],e)))}insertPoint(e){const t=e?(0,D.Ad)(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((i,s)=>i||this.insertVertex_(s,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,r,i){this.rBush_.forEachInExtent(e.getExtent(),function(s){s.geometry===e&&(r===void 0||s.depth===void 0||(0,Xn.aI)(s.depth,r))&&s.index>t&&(s.index+=i)})}}function vh(n,e){return n.index-e.index}function hl(n,e,t){const r=e.geometry;if(r.getType()==="Circle"){let s=r;if(e.index===Fr){const o=(0,D.Tf)();o&&(s=s.clone().transform(o,t));const a=(0,fe.hG)(s.getCenter(),(0,D.Ad)(n,t)),l=Math.sqrt(a)-s.getRadius();return l*l}}const i=(0,D.Ad)(n,t);return Yn[0]=(0,D.Ad)(e.segment[0],t),Yn[1]=(0,D.Ad)(e.segment[1],t),(0,fe.$x)(i,Yn)}function fl(n,e,t){const r=e.geometry;if(r.getType()==="Circle"&&e.index===Fr){let s=r;const o=(0,D.Tf)();return o&&(s=s.clone().transform(o,t)),(0,D.te)(s.getClosestPoint((0,D.Ad)(n,t)),t)}const i=(0,D.Ad)(n,t);return Yn[0]=(0,D.Ad)(e.segment[0],t),Yn[1]=(0,D.Ad)(e.segment[1],t),(0,D.te)((0,fe.sG)(i,Yn),t)}function xh(){const n=(0,X.mY)();return function(e,t){return n.Point}}const wh=yh;var bh=y(10277),Ir=y(62096),Sh=y(92497),so=y(87622);class Si extends Ir.Ay{constructor(e,t,r){super(),r!==void 0&&t===void 0?this.setFlatCoordinates(r,e):(t=t||0,this.setCenterAndRadius(e,t,r))}clone(){const e=new Si(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,r,i){const s=this.flatCoordinates,o=e-s[0],a=t-s[1],l=o*o+a*a;if(l<i){if(l===0)for(let c=0;c<this.stride;++c)r[c]=s[c];else{const c=this.getRadius()/Math.sqrt(l);r[0]=s[0]+c*o,r[1]=s[1]+c*a;for(let u=2;u<this.stride;++u)r[u]=s[u]}return r.length=this.stride,l}return i}containsXY(e,t){const r=this.flatCoordinates,i=e-r[0],s=t-r[1];return i*i+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const t=this.flatCoordinates,r=t[this.stride]-t[0];return(0,M.N)(t[0]-r,t[1]-r,t[0]+r,t[1]+r,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return"Circle"}intersectsExtent(e){const t=this.getExtent();if((0,M.HY)(e,t)){const r=this.getCenter();return e[0]<=r[0]&&e[2]>=r[0]||e[1]<=r[1]&&e[3]>=r[1]?!0:(0,M.sB)(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,r=this.flatCoordinates[t]-this.flatCoordinates[0],i=e.slice();i[t]=i[0]+r;for(let s=1;s<t;++s)i[t+s]=e[s];this.setFlatCoordinates(this.layout,i),this.changed()}setCenterAndRadius(e,t,r){this.setLayout(r,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const i=this.flatCoordinates;let s=(0,Sh._n)(i,0,e,this.stride);i[s++]=i[0]+t;for(let o=1,a=this.stride;o<a;++o)i[s++]=i[o];i.length=s,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){const r=this.getCenter(),i=this.getStride();this.setCenter((0,so.e$)(r,0,r.length,i,e,t,r)),this.changed()}}Si.prototype.transform;const pl=Si;var Ch=y(34338),Rr=y(96702),gl=y(30503),Tn=y(2871),Se=y(61597),Ah=y(82187);const Ci={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Ai extends An.Ay{constructor(e,t){super(e),this.feature=t}}function Th(n,e){const t=[];for(let r=0;r<e.length;++r){const s=e[r].getGeometry();ml(n,s,t)}return t}function Ti(n,e){return(0,Se.hG)(n[0],n[1],e[0],e[1])}function Hn(n,e){const t=n.length;return e<0?n[e+t]:e>=t?n[e-t]:n[e]}function Ei(n,e,t){let r,i;e<t?(r=e,i=t):(r=t,i=e);const s=Math.ceil(r),o=Math.floor(i);if(s>o){const l=Kn(n,r),c=Kn(n,i);return Ti(l,c)}let a=0;if(r<s){const l=Kn(n,r),c=Hn(n,s);a+=Ti(l,c)}if(o<i){const l=Hn(n,o),c=Kn(n,i);a+=Ti(l,c)}for(let l=s;l<o-1;++l){const c=Hn(n,l),u=Hn(n,l+1);a+=Ti(c,u)}return a}function ml(n,e,t){if(e instanceof je.A){_i(n,e.getCoordinates(),!1,t);return}if(e instanceof Rr.A){const r=e.getCoordinates();for(let i=0,s=r.length;i<s;++i)_i(n,r[i],!1,t);return}if(e instanceof gt.Ay){const r=e.getCoordinates();for(let i=0,s=r.length;i<s;++i)_i(n,r[i],!0,t);return}if(e instanceof Tn.A){const r=e.getCoordinates();for(let i=0,s=r.length;i<s;++i){const o=r[i];for(let a=0,l=o.length;a<l;++a)_i(n,o[a],!0,t)}return}if(e instanceof Ch.A){const r=e.getGeometries();for(let i=0;i<r.length;++i)ml(n,r[i],t);return}}const oo={index:-1,endIndex:NaN};function Eh(n,e,t,r){const i=n[0],s=n[1];let o=1/0,a=-1,l=NaN;for(let d=0;d<e.targets.length;++d){const h=e.targets[d],f=h.coordinates;let p=1/0,g;for(let m=0;m<f.length-1;++m){const x=f[m],w=f[m+1],b=yl(i,s,x,w);b.squaredDistance<p&&(p=b.squaredDistance,g=m+b.along)}p<o&&(o=p,h.ring&&e.targetIndex===d&&(h.endIndex>h.startIndex?g<h.startIndex&&(g+=f.length):h.endIndex<h.startIndex&&g>h.startIndex&&(g-=f.length)),l=g,a=d)}const c=e.targets[a];let u=c.ring;if(e.targetIndex===a&&u){const d=Kn(c.coordinates,l),h=t.getPixelFromCoordinate(d);(0,fe.Io)(h,e.startPx)>r&&(u=!1)}if(u){const d=c.coordinates,h=d.length,f=c.startIndex,p=l;if(f<p){const g=Ei(d,f,p);Ei(d,f,p-h)<g&&(l-=h)}else{const g=Ei(d,f,p);Ei(d,f,p+h)<g&&(l+=h)}}return oo.index=a,oo.endIndex=l,oo}function _i(n,e,t,r){const i=n[0],s=n[1];for(let o=0,a=e.length-1;o<a;++o){const l=e[o],c=e[o+1],u=yl(i,s,l,c);if(u.squaredDistance===0){const d=o+u.along;r.push({coordinates:e,ring:t,startIndex:d,endIndex:d});return}}}const ao={along:0,squaredDistance:0};function yl(n,e,t,r){const i=t[0],s=t[1],o=r[0],a=r[1],l=o-i,c=a-s;let u=0,d=i,h=s;return(l!==0||c!==0)&&(u=(0,Se.qE)(((n-i)*l+(e-s)*c)/(l*l+c*c),0,1),d+=l*u,h+=c*u),ao.along=u,ao.squaredDistance=(0,Se.Mg)((0,Se.hG)(n,e,d,h),10),ao}function Kn(n,e){const t=n.length;let r=Math.floor(e);const i=e-r;r>=t?r-=t:r<0&&(r+=t);let s=r+1;s>=t&&(s-=t);const o=n[r],a=o[0],l=o[1],c=n[s],u=c[0]-a,d=c[1]-l;return[a+u*i,l+d*i]}class _h extends cl.A{constructor(e){const t=e;t.stopDown||(t.stopDown=ln.W8),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=Ih(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:ln.rT,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let r=e.geometryFunction;if(!r){const i=this.mode_;if(i==="Circle")r=(s,o,a)=>{const l=o||new pl([NaN,NaN]),c=(0,D.Ad)(s[0],a),u=(0,fe.hG)(c,(0,D.Ad)(s[s.length-1],a));l.setCenterAndRadius(c,Math.sqrt(u),this.geometryLayout_);const d=(0,D.Tf)();return d&&l.transform(a,d),l};else{let s;i==="Point"?s=Ue.A:i==="LineString"?s=je.A:i==="Polygon"&&(s=gt.Ay),r=(o,a,l)=>(a?i==="Polygon"?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])],this.geometryLayout_):a.setCoordinates([],this.geometryLayout_):a.setCoordinates(o,this.geometryLayout_):a=new s(o,this.geometryLayout_),a)}}this.geometryFunction_=r,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new yt.A({source:new Re({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:Fh(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Yt.TS,this.freehandCondition_,e.freehand?this.freehandCondition_=Yt.Gk:this.freehandCondition_=e.freehandCondition?e.freehandCondition:Yt.Kg,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Ah.A.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=Yt.Gk:t=e:t=Yt.Zm,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===mt.A.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===st.A.POINTERMOVE,r=!0;return!this.freehand_&&this.lastDragTime_&&e.type===st.A.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===st.A.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===st.A.POINTERDOWN?r=!1:t&&this.getPointerCount()<2?(r=e.type===st.A.POINTERMOVE,r&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===st.A.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===st.A.DBLCLICK&&(r=!1),super.handleEvent(e)&&r}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new bh.A(st.A.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),r=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),i=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),s=(0,M.Tr)([r,i]),o=this.traceSource_.getFeaturesInExtent(s);if(o.length===0)return;const a=Th(e.coordinate,o);a.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:a,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const r=e.startIndex<=e.endIndex,i=e.startIndex<=t;r===i?r&&t>e.endIndex||!r&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(r&&t<e.endIndex||!r&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let r=0;if(e<t){const i=Math.ceil(e);let s=Math.floor(t);s===t&&(s-=1),r=s-i+1}else{const i=Math.floor(e);let s=Math.ceil(t);s===t&&(s+=1),r=i-s+1}r>0&&this.removeLastPoints_(r)}addTracedCoordinates_(e,t,r){if(t===r)return;const i=[];if(t<r){const s=Math.ceil(t);let o=Math.floor(r);o===r&&(o-=1);for(let a=s;a<=o;++a)i.push(Hn(e.coordinates,a))}else{const s=Math.floor(t);let o=Math.ceil(r);o===r&&(o+=1);for(let a=s;a>=o;--a)i.push(Hn(e.coordinates,a))}i.length&&this.appendCoordinates(i)}updateTrace_(e){const t=this.traceState_;if(!t.active||t.targetIndex===-1&&(0,fe.Io)(t.startPx,e.pixel)<this.snapTolerance_)return;const r=Eh(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==r.index){if(t.targetIndex!==-1){const l=t.targets[t.targetIndex];this.removeTracedCoordinates_(l.startIndex,l.endIndex)}const a=t.targets[r.index];this.addTracedCoordinates_(a,a.startIndex,r.endIndex)}else{const a=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(a,r.endIndex)}t.targetIndex=r.index;const i=t.targets[t.targetIndex];i.endIndex=r.endIndex;const s=Kn(i.coordinates,i.endIndex),o=this.getMap().getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(o[0]),Math.round(o[1])]}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const r=this.traceState_.active;if(this.toggleTraceState_(e),this.shouldHandle_){const i=!this.finishCoordinate_;i&&this.startDrawing_(e.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_==="Point")&&(this.atFinish_(e.pixel,r)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const t=this.downPx_,r=e.pixel,i=t[0]-r[0],s=t[1]-r[1],o=i*i+s*s;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let r=!1;if(this.sketchFeature_){let i=!1,s=[this.finishCoordinate_];const o=this.mode_;if(o==="Point")r=!0;else if(o==="Circle")r=this.sketchCoords_.length===2;else if(o==="LineString")i=!t&&this.sketchCoords_.length>this.minPoints_;else if(o==="Polygon"){const a=this.sketchCoords_;i=a[0].length>this.minPoints_,s=[a[0][0],a[0][a[0].length-2]],t?s=[a[0][0]]:s=[a[0][0],a[0][a[0].length-2]]}if(i){const a=this.getMap();for(let l=0,c=s.length;l<c;l++){const u=s[l],d=a.getPixelFromCoordinate(u),h=e[0]-d[0],f=e[1]-d[1],p=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(h*h+f*f)<=p,r){this.finishCoordinate_=u;break}}}}return r}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new _e.A(new Ue.A(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new _e.A);const t=e.getLinearRing(0);let r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),r.changed()):(r=new je.A(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(r))}startDrawing_(e){const t=this.getMap().getView().getProjection(),r=(0,Ir.dn)(this.geometryLayout_);for(;e.length<r;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new _e.A(new je.A(this.sketchLineCoords_)));const i=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new _e.A,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Ai(Ci.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const t=this.getMap(),r=this.sketchFeature_.getGeometry(),i=t.getView().getProjection(),s=(0,Ir.dn)(this.geometryLayout_);let o,a;for(;e.length<s;)e.push(0);this.mode_==="Point"?a=this.sketchCoords_:this.mode_==="Polygon"?(o=this.sketchCoords_[0],a=o[o.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(o=this.sketchCoords_,a=o[o.length-1]),a[0]=e[0],a[1]=e[1],this.geometryFunction_(this.sketchCoords_,r,i),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),r.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(r):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const t=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();let i,s;const o=this.mode_;return o==="LineString"||o==="Circle"?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():i=!0),s.push(e.slice()),this.geometryFunction_(s,t,r)):o==="Polygon"&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():i=!0),s.push(e.slice()),i&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,t,r)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),i?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i=this.mode_;for(let s=0;s<e;++s){let o;if(i==="LineString"||i==="Circle"){if(o=this.sketchCoords_,o.splice(-2,1),o.length>=2){this.finishCoordinate_=o[o.length-2].slice();const a=this.finishCoordinate_.slice();o[o.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(o,t,r),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(i==="Polygon"){o=this.sketchCoords_[0],o.splice(-2,1);const a=this.sketchLine_.getGeometry();if(o.length>=2){const l=o[o.length-2].slice();o[o.length-1]=l,this.createOrUpdateSketchPoint_(l)}a.setCoordinates(o),this.geometryFunction_(this.sketchCoords_,t,r)}if(o.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const r=e.getGeometry(),i=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,r,i)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,r,i),t=r.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new gl.A([t])):this.type_==="MultiLineString"?e.setGeometry(new Rr.A([t])):this.type_==="MultiPolygon"&&e.setGeometry(new Tn.A([t])),this.dispatchEvent(new Ai(Ci.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new Ai(Ci.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,r=!this.sketchFeature_;r&&this.startDrawing_(e[0]);let i;if(t==="LineString"||t==="Circle")i=this.sketchCoords_;else if(t==="Polygon")i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;r&&i.shift(),i.pop();for(let o=0;o<e.length;o++)this.addToDrawing_(e[o]);const s=e[e.length-1];this.sketchFeature_=this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const r=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=r.getCoordinates();const i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new _e.A(new Ue.A(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Ai(Ci.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){const e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}}function Fh(){const n=(0,X.mY)();return function(e,t){return n[e.getGeometry().getType()]}}function zv(n,e){return function(t,r,i){const s=fromUserCoordinate(t[0],i),o=fromUserCoordinate(t[t.length-1],i),a=Math.sqrt(squaredCoordinateDistance(s,o));r=r||fromCircle(new Circle(s),n);let l=e;if(!e&&e!==0){const u=o[0]-s[0],d=o[1]-s[1];l=Math.atan2(d,u)}makeRegular(r,s,a,l);const c=getUserProjection();return c&&r.transform(i,c),r}}function Dv(){return function(n,e,t){const r=boundingExtent([n[0],n[n.length-1]].map(function(o){return fromUserCoordinate(o,t)})),i=[[getBottomLeft(r),getBottomRight(r),getTopRight(r),getTopLeft(r),getBottomLeft(r)]];e?e.setCoordinates(i):e=new Polygon(i);const s=getUserProjection();return s&&e.transform(t,s),e}}function Ih(n){switch(n){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+n)}}const Rh=_h;var vl=y(52490),En=y(81426),ae=y(13628),Je=y(86936),Ht=y(27733),oe=y(953);class xl extends yt.A{constructor(){super({source:new Re}),this.opts={action:"length",unit:"m"},this.segmentStyle=new X.Ay({text:new En.A({font:"12px Calibri,sans-serif",fill:new ae.A({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new ae.A({color:"rgba(0, 0, 0, 0.4)"}),padding:[2,2,2,2],textBaseline:"bottom",offsetY:-12}),image:new Je.A({radius:6,points:3,angle:Math.PI,displacement:[0,8],fill:new ae.A({color:"rgba(0, 0, 0, 0.4)"})})}),this.segmentStyles=[this.segmentStyle],this.shapeStyle=[new X.Ay({fill:new ae.A({color:"rgba(255, 255, 255, 0.2)"}),image:new Ht.A({radius:5,stroke:new oe.A({color:"rgba(0, 0, 0, 0.7)"}),fill:new ae.A({color:"rgba(255, 255, 255, 0.2)"})})}),new X.Ay({stroke:new oe.A({color:[0,0,0,1],width:2,lineDash:[4,8],lineDashOffset:6})}),new X.Ay({stroke:new oe.A({color:[255,255,255,1],width:2,lineDash:[4,8]})})],this.labelStyle=new X.Ay({text:new En.A({font:"14px Calibri,sans-serif",fill:new ae.A({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new ae.A({color:"rgba(0, 0, 0, 0.7)"}),padding:[3,3,3,3],textBaseline:"bottom",offsetY:-15}),image:new Je.A({radius:8,points:3,angle:Math.PI,displacement:[0,10],fill:new ae.A({color:"rgba(0, 0, 0, 0.7)"})})}),this.tipStyle=new X.Ay({text:new En.A({font:"12px Calibri,sans-serif",fill:new ae.A({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new ae.A({color:"rgba(0, 0, 0, 0.4)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})}),this.modifyStyle=new X.Ay({image:new Ht.A({radius:5,stroke:new oe.A({color:"rgba(0, 0, 0, 0.7)"}),fill:new ae.A({color:"rgba(0, 0, 0, 0.4)"})}),text:new En.A({text:"Drag to modify",font:"12px Calibri,sans-serif",fill:new ae.A({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new ae.A({color:"rgba(0, 0, 0, 0.7)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})}),this.modify=new wh({source:this.getSource(),style:this.modifyStyle}),this.setStyle(e=>this.styleFunction(e,!1)),this.setVisible(!0)}setOptions(e){this.opts=e,this.getSource()?.refresh()}getMapMeasurement(e){let t=0,r=Ve[0];return this.opts.action==="area"?(r=Ve[1],t=(0,vl.UG)(e)):t=(0,vl.R3)(e),(0,it.cN)(r.getUnit(this.opts.unit).format(t))}styleFunction(e,t,r,i){const s=[...this.shapeStyle],o=e.getGeometry();if(o){const a=o.getType();let l,c,u;if((!r||r===a)&&(a==="Polygon"&&o instanceof gt.Ay?(l=o.getInteriorPoint(),c=this.getMapMeasurement(o),u=new je.A(o.getCoordinates()[0])):a==="LineString"&&o instanceof je.A&&(l=new Ue.A(o.getLastCoordinate()),c=this.getMapMeasurement(o))),t&&u){let d=0;u.forEachSegment((h,f)=>{const p=new je.A([h,f]),g=this.getMapMeasurement(p);this.segmentStyles.length-1<d&&this.segmentStyles.push(this.segmentStyle.clone());const m=new Ue.A(p.getCoordinateAt(.5));this.segmentStyles[d].setGeometry(m),this.segmentStyles[d].getText()?.setText(g),s.push(this.segmentStyles[d]),d++})}c&&(this.labelStyle.setGeometry(l),this.labelStyle.getText()?.setText(c),s.push(this.labelStyle)),i&&a==="Point"&&o instanceof Ue.A&&!this.modify.getOverlay().getSource()?.getFeatures().length&&(this.tipPoint=o,this.tipStyle.getText()?.setText(i),s.push(this.tipStyle))}return s}addInteraction(e,t,r,i){const s=t,o=" Click to continue "+(s==="Polygon"?"polygon":"line")+` (double-click to end) `,a=" Click to start ";let l=a;this.draw=new Rh({source:this.getSource(),type:s,style:c=>this.styleFunction(c,r,s,l)}),this.draw.on("drawstart",()=>{i&&this.getSource().clear(),this.modify.setActive(!1),l=o}),this.draw.on("drawend",()=>{this.modifyStyle.setGeometry(this.tipPoint),this.modify.setActive(!0),e.once("pointermove",()=>{this.modifyStyle.setGeometry("")}),l=a}),this.modify.setActive(!0),e.addInteraction(this.draw)}}const Ph=({map:n,menuActiveState:e})=>{const t=(0,U.useRef)(new xl),r=kh(Cn.$W.theme2),[i,s]=(0,U.useState)(!0),[o,a]=(0,U.useState)(!1),[l,c]=(0,U.useState)({action:Ve[0].value,unit:Ve[0].units[0].value}),u=(0,U.useMemo)(()=>{const p=Ve.find(m=>m.value===l.action)??Ve[0],g=p.getUnit(l.unit);return t.current.setOptions(l),{current:g,options:p.units}},[l]),d=!0,h=!1;function f(){if(a(!o),e(!o),o)n.removeInteraction(t.current.draw),t.current.setVisible(!1);else{i&&(s(!1),t.current.setZIndex(1),n.addLayer(t.current),n.addInteraction(t.current.modify)),t.current.setVisible(!0),n.removeInteraction(t.current.draw);const p=Ve.find(g=>g.value===l.action)??Ve[0];t.current.addInteraction(n,p.geometry,h,d)}}return(0,v.jsx)("div",{className:`${r.infoWrap} ${o?null:r.infoWrapClosed}`,children:o?(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{className:r.rowGroup,children:[(0,v.jsx)(Un.z,{value:l.action,options:Ve,size:"md",fullWidth:!1,onChange:p=>{n.removeInteraction(t.current.draw);const g=Ve.find(x=>x.value===p)??Ve[0],m=g.getUnit(l.unit);c({...l,action:g.value,unit:m.value}),t.current.addInteraction(n,g.geometry,h,d)}}),(0,v.jsx)(xi.$n,{"aria-label":(0,E.t)("geomap.measure-overlay.aria-label-close","Close measure tools"),className:r.button,icon:"times",variant:"secondary",size:"sm",onClick:f})]}),(0,v.jsx)(Wn.l6,{className:r.unitSelect,value:u.current,options:u.options,isSearchable:!1,onChange:p=>{const g=Ve.find(x=>x.value===l.action)??Ve[0],m=g.getUnit(p.value)??g.units[0];c({...l,unit:m.value})}})]}):(0,v.jsx)(eo.K,{className:r.icon,"data-testid":rl.Tp.components.PanelEditor.measureButton,name:"ruler-combined",tooltip:(0,E.t)("geomap.measure-overlay.tooltip-show-measure-tools","Show measure tools"),tooltipPlacement:"left",onClick:f})})},kh=n=>({button:(0,K.css)({marginLeft:"auto"}),icon:(0,K.css)({backgroundColor:n.colors.secondary.main,display:"inline-block",height:"19.25px",margin:"1px",width:"19.25px"}),infoWrap:(0,K.css)({color:`${n.colors.text}`,backgroundColor:n.colors.background.secondary,borderRadius:"4px",padding:"2px"}),infoWrapClosed:(0,K.css)({height:"25.25px",width:"25.25px"}),rowGroup:(0,K.css)({display:"flex",justifyContent:"flex-end"}),unitSelect:(0,K.css)({minWidth:"200px"})});var jv=y(99639);function Mh(n){return(0,gi.css)({".ol-scale-line":{background:n.colors.border.weak},".ol-scale-line-inner":{border:`1px solid ${n.colors.text.primary}`,borderTop:0,color:n.colors.text.primary},".ol-control":{backgroundColor:n.colors.background.primary},".ol-control:hover":{backgroundColor:n.colors.background.secondary},".ol-control button":{color:n.colors.secondary.text,backgroundColor:n.colors.secondary.main},".ol-control button:hover":{color:n.colors.secondary.text,backgroundColor:n.colors.secondary.shade},".ol-control button:focus":{color:n.colors.secondary.text,backgroundColor:n.colors.secondary.main},".ol-attribution ul":{color:n.colors.text.primary,textShadow:"none"},".ol-attribution:not(.ol-collapsed)":{backgroundColor:n.colors.background.secondary}})}var Oe=y(98020),un=y(35598),Pr=y(63425),Fi=y(39741),Ce=y(739),wt=y(87039);function Lh(n){return new _e.A(n)}class kr extends Re{constructor(e){super({}),this.location=e}update(e){this.clear(!0);const t=(0,wt.FM)(e,this.location);if(!t.field){this.changed();return}for(let r=0;r<e.length;r++){const i=t.field.values[r];this.addFeatureInternal(Lh({frame:e,rowIndex:r,geometry:i}))}this.changed()}}var Ii=y(24120),wl=y(62467),bl=y(76637),zh=y(79118),Dh=y(20276),jh=y(30868),Oh=y(68706);function Sl(n){const{layerName:e,styleConfig:t,layer:r}=n,i=(0,an.of)(Nh),s=(0,Ii.A)(r?.__state?.mouseEvents??(0,wl.of)(void 0)),o=t?.dims?.color?.field,a=(0,U.useMemo)(()=>{if(!o||!s)return;const p=s.getProperties();if(!p.frame)return;const m=p.rowIndex;return o.values[m]},[s,o]);if(!t)return(0,v.jsx)(v.Fragment,{});const{color:l,opacity:c}=t?.base??{},u=t?.config.symbol?.fixed;if(l&&u&&!o)return(0,v.jsxs)("div",{className:i.infoWrap,children:[(0,v.jsx)("div",{className:i.layerName,children:e}),(0,v.jsx)("div",{className:(0,K.cx)(i.layerBody,i.fixedColorContainer),children:(0,v.jsx)(jh.y,{src:`${window.__grafana_public_path__}build/${u}`,className:i.legendSymbol,title:(0,E.t)("geomap.markers-legend.title-symbol","Symbol"),style:{fill:l,opacity:c}})})]});if(!o)return(0,v.jsx)(v.Fragment,{});const d=(0,bl.Qi)(o);if(d.isContinuous&&d.getColors){const p=d.getColors(Cn.$W.theme2),g=(0,zh.AP)(o),m=o.display?x=>(0,it.cN)(o.display(x)):x=>`${x}`;return(0,v.jsxs)("div",{className:i.infoWrap,children:[(0,v.jsx)("div",{className:i.layerName,children:e}),(0,v.jsx)("div",{className:(0,K.cx)(i.layerBody,i.colorScaleWrapper),children:(0,v.jsx)(Dh.w,{hoverValue:a,colorPalette:p,min:g.min??0,max:g.max??100,display:m,useStopsPercentage:!1})})]})}const h=o?.config?.thresholds;if(!h||h.steps.length<2)return(0,v.jsx)("div",{});const f=(0,Oh.EI)(o.config,Cn.$W.theme2);return(0,v.jsxs)("div",{className:i.infoWrap,children:[(0,v.jsx)("div",{className:i.layerName,children:e}),(0,v.jsx)("div",{className:(0,K.cx)(i.layerBody,i.legend),children:f.map((p,g)=>(0,v.jsxs)("div",{className:i.legendItem,children:[(0,v.jsx)("i",{style:{background:p.color}}),p.label]},`${g}/${p.label}`))})]})}const Nh=n=>({infoWrap:(0,K.css)({display:"flex",flexDirection:"column",background:n.colors.background.secondary,borderRadius:"1px",padding:n.spacing(1),borderBottom:`2px solid ${n.colors.border.strong}`,minWidth:"150px"}),layerName:(0,K.css)({fontSize:n.typography.body.fontSize}),layerBody:(0,K.css)({paddingLeft:"10px"}),legend:(0,K.css)({lineHeight:"18px",display:"flex",flexDirection:"column",fontSize:n.typography.bodySmall.fontSize,padding:"5px 10px 0",i:{width:"15px",height:"15px",float:"left",marginRight:"8px",opacity:.7,borderRadius:n.shape.radius.circle}}),legendItem:(0,K.css)({whiteSpace:"nowrap"}),fixedColorContainer:(0,K.css)({minWidth:"80px",fontSize:n.typography.bodySmall.fontSize,paddingTop:"5px"}),legendSymbol:(0,K.css)({height:"18px",width:"18px",margin:"auto"}),colorScaleWrapper:(0,K.css)({minWidth:"200px",fontSize:n.typography.bodySmall.fontSize,paddingTop:"10px"})});class Cl extends U.Component{constructor(e){super(e),this.state={subProps:e.initialSubProps}}componentDidMount(){this.sub=this.props.watch.subscribe({next:e=>{this.setState({subProps:e})},complete:()=>{},error:e=>{}})}componentWillUnmount(){this.sub&&this.sub.unsubscribe()}render(){const{subProps:e}=this.state;return(0,v.jsx)(this.props.child,{...e})}}var bt=y(97095),qe=y(18027),Ke=y(37386),Gh=y(79233),Bh=y(35427),Al=y(41654),lo=y(85053),Tl=y(21253),$h=y(87405),El=y(44798),_l=y(68694),Fl=y(71820),Vh=y(22001),Ri=y(4896),_=y(53497),Pi=y(49700),Il=y(63704),ki=y(42954),Rl=y(20012),Uh=(n=>(n.circle="circle",n.square="square",n.triangle="triangle",n.star="star",n.cross="cross",n.x="x",n))(Uh||{});const Kt={circle:"img/icons/marker/circle.svg",square:"img/icons/marker/square.svg",triangle:"img/icons/marker/triangle.svg",star:"img/icons/marker/star.svg",cross:"img/icons/marker/cross.svg",x:"img/icons/marker/x-mark.svg"};function Jn(n){const e=n.opacity==null?.8:n.opacity;if(e===1)return new ae.A({color:n.color});if(e>0){const t=(0,kt.A)(n.color).setAlpha(e).toRgbString();return new ae.A({color:t})}}function Wh(n){const e=n.opacity==null?.8:n.opacity;if(e===1)return new oe.A({color:n.color,width:n.lineWidth??1});if(e>0){const t=(0,kt.A)(n.color).setAlpha(e).toRgbString();return new oe.A({color:t,width:n.lineWidth??1})}}const Lt=n=>{if(!n.text)return;const e=sn.$.theme2.typography.fontFamily,t={..._.T5.textConfig,...n.textConfig};return new En.A({text:n.text,fill:new ae.A({color:n.color??_.T5.color.fixed}),font:`normal ${t.fontSize}px ${e}`,...t})},Pl=n=>new X.Ay({text:Lt(n)}),kl=n=>{const e=new oe.A({color:n.color,width:n.lineWidth??1}),t=n.size??_._7;return new X.Ay({image:new Ht.A({stroke:e,fill:Jn(n),radius:t,displacement:dn(n.symbolAlign??_.T5.symbolAlign,t)}),text:Lt(n),stroke:e})},Mr=n=>new X.Ay({fill:Jn(n),stroke:new oe.A({color:n.color,width:n.lineWidth??1}),text:Lt(n)}),co=n=>new X.Ay({fill:Jn(n),stroke:Wh(n),text:Lt(n)}),Ml=n=>{const e=n.size??_._7,t=new oe.A({color:"#F00",width:1});return[new X.Ay({image:new Je.A({stroke:t,points:4,radius:e,angle:Math.PI/4})}),new X.Ay({image:new Je.A({stroke:t,points:4,radius:e,radius2:0,angle:0})})]},Xh=[{id:"circle",name:"Circle",aliasIds:[Kt.circle],make:kl},{id:"square",name:"Square",aliasIds:[Kt.square],make:n=>{const e=n.size??_._7,t=n.rotation??0;return new X.Ay({image:new Je.A({stroke:new oe.A({color:n.color,width:n.lineWidth??1}),fill:Jn(n),points:4,radius:e,angle:Math.PI/4,rotation:t*Math.PI/180,displacement:dn(n.symbolAlign??_.T5.symbolAlign,e)}),text:Lt(n)})}},{id:"triangle",name:"Triangle",aliasIds:[Kt.triangle],make:n=>{const e=n.size??_._7,t=n.rotation??0;return new X.Ay({image:new Je.A({stroke:new oe.A({color:n.color,width:n.lineWidth??1}),fill:Jn(n),points:3,radius:e,rotation:t*Math.PI/180,angle:0,displacement:dn(n.symbolAlign??_.T5.symbolAlign,e)}),text:Lt(n)})}},{id:"star",name:"Star",aliasIds:[Kt.star],make:n=>{const e=n.size??_._7,t=n.rotation??0;return new X.Ay({image:new Je.A({stroke:new oe.A({color:n.color,width:n.lineWidth??1}),fill:Jn(n),points:5,radius:e,radius2:e*.4,angle:0,rotation:t*Math.PI/180,displacement:dn(n.symbolAlign??_.T5.symbolAlign,e)}),text:Lt(n)})}},{id:"cross",name:"Cross",aliasIds:[Kt.cross],make:n=>{const e=n.size??_._7,t=n.rotation??0;return new X.Ay({image:new Je.A({stroke:new oe.A({color:n.color,width:n.lineWidth??1}),points:4,radius:e,radius2:0,angle:0,rotation:t*Math.PI/180,displacement:dn(n.symbolAlign??_.T5.symbolAlign,e)}),text:Lt(n)})}},{id:"x",name:"X",aliasIds:[Kt.x],make:n=>{const e=n.size??_._7,t=n.rotation??0;return new X.Ay({image:new Je.A({stroke:new oe.A({color:n.color,width:n.lineWidth??1}),points:4,radius:e,radius2:0,angle:Math.PI/4,rotation:t*Math.PI/180,displacement:dn(n.symbolAlign??_.T5.symbolAlign,e)}),text:Lt(n)})}}];async function Ll(n,e,t){return fetch(n,{method:"GET"}).then(r=>r.text()).then(r=>{r=Il.sQ.sanitizeSVGContent(r);const s=new DOMParser().parseFromString(r,"image/svg+xml"),o=s.getElementsByTagName("svg")[0];if(!o)return"";const a=e??100,l=o.getAttribute("width")??a,c=o.getAttribute("height")??a;if(o.setAttribute("fill","#fff"),o.setAttribute("width",`${l}px`),o.setAttribute("height",`${c}px`),t){const h=o.getAttribute("viewBox")?.split(" ")??[0,0,l,c],f=Number(h[2])/2,p=Number(h[3])/2,g=s.createElementNS("http://www.w3.org/2000/svg","circle");g.setAttribute("cx",f.toString()),g.setAttribute("cy",p.toString()),g.setAttribute("fill","none"),g.setAttribute("r",(f/2).toString()),g.setAttribute("stroke",`rgba(255,255,255,${t})`),g.setAttribute("stroke-width",f.toString()),o.prepend(g)}const u=new XMLSerializer().serializeToString(o);return`data:image/svg+xml,${encodeURIComponent(u)}`}).catch(r=>(console.error(r),""))}const uo=new ki.O(()=>Xh);function Zh(n){const e=uo.getIfExists(n);if(e?.aliasIds?.length)return e.aliasIds[0]}const Lr=["color",["get","red"],["get","green"],["get","blue"],["get","opacity"]],Mi=["get","size"],ho=["get","opacity"],zl=["get","rotation"],fo=["array",["get","offsetX"],["get","offsetY"]],Dl={"shape-radius":["/",Mi,2],"shape-fill-color":Lr,"shape-stroke-color":Lr,"shape-stroke-width":1,"shape-opacity":ho,"shape-rotation":zl,"shape-displacement":fo},jl={"circle-radius":["/",Mi,2],"circle-fill-color":Lr,"circle-stroke-color":Lr,"circle-stroke-width":1,"circle-opacity":ho,"circle-displacement":fo};async function Yh(n,e){if(n===Kt.circle)return jl;if(n===Kt.square)return{...Dl,"shape-points":4,"shape-angle":Math.PI/4};if(n===Kt.triangle)return{...Dl,"shape-points":3,"shape-angle":0};if(n&&n.endsWith(".svg")){const t=e===0?0:.1/(e??1);return{"icon-src":await Ll((0,Rl.D)(n),void 0,t),"icon-width":Mi,"icon-height":Mi,"icon-opacity":ho,"icon-rotation":zl,"icon-displacement":fo,"icon-color":Lr}}return jl}async function Hh(n,e){if(!n)return e?Pl:kl;let t=uo.getIfExists(n);if(t)return t.make;if(n.endsWith(".svg")){const r=await Ll((0,Rl.D)(n));return t={id:n,name:n,aliasIds:[],make:r?i=>{const s=i.size??_._7,o=i.rotation??0;return[new X.Ay({image:new Pi.A({src:r,color:i.color,opacity:i.opacity??1,scale:(_._7+s)/100,rotation:o*Math.PI/180,displacement:dn(i.symbolAlign??_.T5.symbolAlign,s/2)}),text:i?.text?Lt(i):void 0}),new X.Ay({image:new Je.A({fill:new ae.A({color:"rgba(0,0,0,0)"}),points:4,radius:s,rotation:o*Math.PI/180+Math.PI/4})})]}:Ml},uo.register(t),t.make}return Ml}function po(n){const e=n?.text;return e?!!(e.mode===Ce.RU.Fixed&&e.fixed?.length||e.mode===Ce.RU.Field&&e.field?.length):!1}async function Jt(n){n||(n=_.T5);const e=po(n),t={},r=await Hh(n.symbol?.fixed,e),i={config:n,hasText:e,fields:t,base:{color:sn.$.theme2.visualization.getColorByName(n.color?.fixed??_.T5.color.fixed),opacity:n.opacity??_.T5.opacity,lineWidth:n.lineWidth??1,size:n.size?.fixed??_.T5.size.fixed,rotation:n.rotation?.fixed??_.T5.rotation.fixed,symbolAlign:n.symbolAlign??_.T5.symbolAlign},maker:r};return n.color?.field?.length&&(t.color=n.color.field),n.size?.field?.length&&(t.size=n.size.field),n.rotation?.field?.length&&(t.rotation=n.rotation.field),e&&(i.base.text=n.text?.fixed,i.base.textConfig=n.textConfig??_.T5.textConfig,n.text?.field?.length&&(t.text=n.text.field)),Object.keys(t).length||(i.fields=void 0),i}function dn(n,e){const t=[0,0];return n?.horizontal===_.wq.Left?t[0]=-e:n?.horizontal===_.wq.Right&&(t[0]=e),n?.vertical===_.G4.Top?t[1]=e:n?.vertical===_.G4.Bottom&&(t[1]=-e),t}function Kh(n){return n.startsWith("#")?Jh(n):n.startsWith("rgb")?qh(n):(console.warn(`Unsupported color format: ${n}`),null)}function Jh(n){n=n.slice(1);const e=parseInt(n.slice(0,2),16),t=parseInt(n.slice(2,4),16),r=parseInt(n.slice(4,6),16);return{r:e,g:t,b:r}}function qh(n){const e=n.match(/\d+\.?\d*/g);if(e){if(e.length===3)return{r:parseInt(e[0],10),g:parseInt(e[1],10),b:parseInt(e[2],10)};if(e.length===4)return{r:parseInt(e[0],10),g:parseInt(e[1],10),b:parseInt(e[2],10),a:parseFloat(e[3])};console.warn(`Unsupported color format: ${n}`)}else console.warn(`Unsupported color format: ${n}`);return null}const hn=n=>{const{value:e,onChange:t,item:r}=n,i=(0,U.useMemo)(()=>r.settings?.frameMatcher?{...n.context,data:n.context.data.filter(r.settings.frameMatcher)}:n.context,[n.context,r.settings]),s=r.settings,o=Q=>{t({...e,size:Q})},a=Q=>{t({...e,symbol:Q})},l=Q=>{t({...e,color:Q})},c=Q=>{t({...e,opacity:Q})},u=Q=>{t({...e,rotation:Q})},d=Q=>{t({...e,text:Q})},h=Q=>{t({...e,textConfig:{...e.textConfig,fontSize:Q}})},f=Q=>{t({...e,textConfig:{...e.textConfig,offsetX:Q}})},p=Q=>{t({...e,textConfig:{...e.textConfig,offsetY:Q}})},g=Q=>{t({...e,textConfig:{...e.textConfig,textAlign:Q}})},m=Q=>{t({...e,textConfig:{...e.textConfig,textBaseline:Q}})},x=Q=>{t({...e,symbolAlign:{...e?.symbolAlign,horizontal:Q}})},w=Q=>{t({...e,symbolAlign:{...e?.symbolAlign,vertical:Q}})},T=(0,Ii.A)(s?.layerInfo??(0,wl.of)())?.geometryType===_.W_.Point,S=po(e),A=2e3,C=(0,U.useId)(),R=(0,U.useId)(),j=(0,U.useId)(),B=(0,U.useId)(),P=(0,U.useId)(),G=(0,U.useId)(),$=(0,U.useId)(),Z=(0,U.useId)(),I=(0,U.useId)(),k=(0,U.useId)(),V=(0,U.useId)(),we=(0,U.useId)(),Ae=(0,U.useId)(),be=(0,U.useId)();return s?.simpleFixedValues?(0,v.jsxs)(v.Fragment,{children:[T&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.style-editor.label-symbol","Symbol"),children:(0,v.jsx)(El.m,{id:C,value:e?.symbol??_.T5.symbol,context:i,onChange:a,item:{settings:{resourceType:"icon",folderName:Ri.Iu.Marker,placeholderText:S?(0,E.t)("geomap.style-editor.placeholderText-select-symbol","Select a symbol"):(0,E.t)("geomap.style-editor.placeholderText-select-symbol-or-add-text","Select a symbol or add a text label"),placeholderValue:_.T5.symbol.fixed,showSourceRadio:!1,maxFiles:A}}})})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-rotation-angle","Rotation angle"),children:(0,v.jsx)(_l.A,{id:R,value:e?.rotation??_.T5.rotation,context:i,onChange:u,item:{settings:{min:_.T5.rotation.min,max:_.T5.rotation.max}}})})]}),(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.style-editor.label-color","Color"),labelWidth:10,children:(0,v.jsx)(Gh.c,{width:4,children:(0,v.jsx)(Bh.sk,{id:j,color:e?.color?.fixed??_.T5.color.fixed,onChange:Q=>{l({fixed:Q})}})})})}),(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.style-editor.label-opacity","Opacity"),labelWidth:10,grow:!0,children:(0,v.jsx)(Tl.G,{id:B,value:e?.opacity??_.T5.opacity,context:i,onChange:c,item:{settings:{min:0,max:1,step:.1}}})})})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-size","Size"),children:(0,v.jsx)(Fl.g,{id:P,value:e?.size??_.T5.size,context:i,onChange:o,item:{settings:{min:1,max:100}}})}),!s?.hideSymbol&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-symbol","Symbol"),children:(0,v.jsx)(El.m,{id:G,value:e?.symbol??_.T5.symbol,context:i,onChange:a,item:{settings:{resourceType:Ri.zu.Icon,folderName:Ri.Iu.Marker,placeholderText:S?(0,E.t)("geomap.style-editor.placeholderText-select-symbol","Select a symbol"):(0,E.t)("geomap.style-editor.placeholderText-select-symbol-or-add-text","Select a symbol or add a text label"),placeholderValue:_.T5.symbol.fixed,showSourceRadio:!1,maxFiles:A}}})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-symbol-vertical-align","Symbol vertical align"),children:(0,v.jsx)(Un.z,{id:$,value:e?.symbolAlign?.vertical??_.T5.symbolAlign.vertical,onChange:w,options:[{value:_.G4.Top,label:(0,E.t)("geomap.style-editor.vertical-align-options.label-top","Top")},{value:_.G4.Center,label:(0,E.t)("geomap.style-editor.vertical-align-options.label-center","Center")},{value:_.G4.Bottom,label:(0,E.t)("geomap.style-editor.vertical-align-options.label-bottom","Bottom")}]})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-symbol-horizontal-align","Symbol horizontal align"),children:(0,v.jsx)(Un.z,{value:e?.symbolAlign?.horizontal??_.T5.symbolAlign.horizontal,onChange:x,options:[{value:_.wq.Left,label:(0,E.t)("geomap.style-editor.horizontal-align-options.label-left","Left")},{value:_.wq.Center,label:(0,E.t)("geomap.style-editor.horizontal-align-options.label-center","Center")},{value:_.wq.Right,label:(0,E.t)("geomap.style-editor.horizontal-align-options.label-right","Right")}]})})]}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-color","Color"),children:(0,v.jsx)($h.N,{id:Z,value:e?.color??_.T5.color,context:i,onChange:l,item:{}})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-fill-opacity","Fill opacity"),children:(0,v.jsx)(Tl.G,{id:I,value:e?.opacity??_.T5.opacity,context:i,onChange:c,item:{settings:{min:0,max:1,step:.1}}})}),s?.displayRotation&&(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-rotation-angle","Rotation angle"),children:(0,v.jsx)(_l.A,{id:k,value:e?.rotation??_.T5.rotation,context:i,onChange:u,item:{settings:{min:_.T5.rotation.min,max:_.T5.rotation.max}}})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-text-label","Text label"),children:(0,v.jsx)(Vh.h,{id:V,value:e?.text??Ri.nG,context:i,onChange:d,item:{}})}),S&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(Al.B,{children:[(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-font-size","Font size"),children:(0,v.jsx)(lo.w,{id:we,value:e?.textConfig?.fontSize??_.T5.textConfig.fontSize,context:i,onChange:h,item:{}})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-x-offset","X offset"),children:(0,v.jsx)(lo.w,{id:Ae,value:e?.textConfig?.offsetX??_.T5.textConfig.offsetX,context:i,onChange:f,item:{}})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-y-offset","Y offset"),children:(0,v.jsx)(lo.w,{id:be,value:e?.textConfig?.offsetY??_.T5.textConfig.offsetY,context:i,onChange:p,item:{}})})]}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-align","Align"),children:(0,v.jsx)(Un.z,{value:e?.textConfig?.textAlign??_.T5.textConfig.textAlign,onChange:g,options:[{value:_.DY.Left,label:(0,$e.capitalize)(_.DY.Left)},{value:_.DY.Center,label:(0,$e.capitalize)(_.DY.Center)},{value:_.DY.Right,label:(0,$e.capitalize)(_.DY.Right)}]})}),(0,v.jsx)(Ke.D,{label:(0,E.t)("geomap.style-editor.label-baseline","Baseline"),children:(0,v.jsx)(Un.z,{value:e?.textConfig?.textBaseline??_.T5.textConfig.textBaseline,onChange:m,options:[{value:_.fX.Top,label:(0,$e.capitalize)(_.fX.Top)},{value:_.fX.Middle,label:(0,$e.capitalize)(_.fX.Middle)},{value:_.fX.Bottom,label:(0,$e.capitalize)(_.fX.Bottom)}]})})]})]})};var Pe=y(48629);const zr={style:_.T5,showLegend:!0},go="markers",mo={type:go,name:"",config:zr,location:{mode:Ce.aG.Auto},tooltip:!0},Qh={id:go,name:"Markers",description:"Use markers to render each data point",isBaseMap:!1,showLocation:!0,hideOpacity:!0,create:async(n,e,t,r)=>{const i={...zr,...e?.config},s=await Jt(i.style),o=i.style.symbol?.fixed,a=await Yh(o,i.style.opacity),l=po(i.style),c=await(0,wt.nE)(e.location),u=new kr(c),d=new Pr.A({source:u,style:a}),h=new Oe.A({source:u,declutter:!0});let f=l;const p=new un.A({layers:f?o?[d,h]:[h]:[d]}),g=new Fi.m(1);let m=null;return i.showLegend&&(m=(0,v.jsx)(Cl,{watch:g,initialSubProps:{},child:Sl})),{init:()=>p,legend:m,update:x=>{if(!x.series?.length){u.clear();return}for(const w of x.series){s.dims=(0,Pe.ue)(w,s,r),m&&g.next({styleConfig:s,size:s.dims?.size,layerName:e.name,layer:d}),u.update(w);let b=!1;const T=new Set,S=(C,R)=>{const j=`${C[0]},${C[1]}`,{color:B,size:P,text:G,rotation:$}=R;return`markerAddressKey|${j}|${B}|${P}|${G}|${$}`};u.forEachFeature(C=>{const R=C.getGeometry(),j=R?.getType()==="LineString";j&&(b=!0);const B=C.get("rowIndex"),P=s.dims,G={...s.base};if(P?.color&&(G.color=P.color.get(B)),P?.size&&(G.size=P.size.get(B)),P?.text&&(G.text=P.text.get(B)),P?.rotation&&(G.rotation=P.rotation.get(B)),R?.getType()==="Point"){const $=R.getCoordinates();if(!$||$.length<2)return;const Z=S($,G);if(T.has(Z))return;T.add(Z)}if(j){const $=s.maker(G);C.setStyle($)}else{const $=(0,kt.A)(r.visualization.getColorByName(G.color)).toString(),Z=Kh($),I=G.size??_._7,k=dn(G.symbolAlign??_.T5.symbolAlign,I);C.setProperties({red:Z?.r??255}),C.setProperties({green:Z?.g??255}),C.setProperties({blue:Z?.b??255}),C.setProperties({size:(G.size??1)*2}),C.setProperties({rotation:(G.rotation??0)*Math.PI/180}),C.setProperties({opacity:(G.opacity??1)*(Z?.a??1)}),C.setProperties({offsetX:k[0]}),C.setProperties({offsetY:k[1]})}if(l){const $=Pl(G);C.setStyle($)}}),f=l||b;const A=p.getLayers();A.clear(),f?A.extend(o?[d,h]:[h]):A.extend([d]);break}},registerOptionsUI:x=>{x.addCustomEditor({id:"config.style",path:"config.style",name:(0,E.t)("geomap.markers-layer.name-styles","Styles"),editor:hn,settings:{displayRotation:!0},defaultValue:zr.style}).addBooleanSwitch({path:"config.showLegend",name:(0,E.t)("geomap.markers-layer.name-show-legend","Show legend"),description:(0,E.t)("geomap.markers-layer.description-show-legend","Show map legend"),defaultValue:zr.showLegend})}}},defaultOptions:zr};var Li=y(11594),Dr=y(92780),zt=y(6782),_n=y(91110),ef=y(4350),zi=y(40186),Di=y(57115);const qn=[0,0,0],fn=5;class tf{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,(0,vt.v)((0,Xn.WC)(this.resolutions_,(i,s)=>s-i,!0),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let i=0,s=this.resolutions_.length-1;i<s;++i)if(!t)t=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,(0,vt.v)(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=(0,M.Py)(r)),(0,vt.v)(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,(0,vt.v)(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:Di.R,(0,vt.v)(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,s)=>{const o=new _n.A(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const a=this.getTileRangeForExtentAndZ(r,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,t,r){const i=this.getTileRangeForExtentAndZ(e,t);for(let s=i.minX,o=i.maxX;s<=o;++s)for(let a=i.minY,l=i.maxY;a<=l;++a)r([t,s,a])}forEachTileCoordParentTileRange(e,t,r,i){let s,o,a,l=null,c=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,i);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=(0,_n.N)(o,o,a,a,r)):s=this.getTileRangeForExtentAndZ(l,c,r),t(c,s))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const s=e[1]*2,o=e[2]*2;return(0,_n.N)(s,s+1,o,o+1,t)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,r){if(t>this.maxZoom||t<this.minZoom)return null;const i=e[0],s=e[1],o=e[2];if(t===i)return(0,_n.N)(s,o,s,o,r);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-i),c=Math.floor(s*l),u=Math.floor(o*l);if(t<i)return(0,_n.N)(c,c,u,u,r);const d=Math.floor(l*(s+1))-1,h=Math.floor(l*(o+1))-1;return(0,_n.N)(c,d,u,h,r)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,r)}getTileRangeForExtentAndZ(e,t,r){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,qn);const i=qn[1],s=qn[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,qn);const o=qn[1],a=qn[2];return(0,_n.N)(i,o,s,a,r)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=(0,zt.xq)(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*i[0]*r,t[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,t){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),s=(0,zt.xq)(this.getTileSize(e[0]),this.tmpSize_),o=r[0]+e[1]*s[0]*i,a=r[1]-(e[2]+1)*s[1]*i,l=o+s[0]*i,c=a+s[1]*i;return(0,M.N)(o,a,l,c,t)}getTileCoordForCoordAndResolution(e,t,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,r)}getTileCoordForXYAndResolution_(e,t,r,i,s){const o=this.getZForResolution(r),a=r/this.getResolution(o),l=this.getOrigin(o),c=(0,zt.xq)(this.getTileSize(o),this.tmpSize_);let u=a*(e-l[0])/r/c[0],d=a*(l[1]-t)/r/c[1];return i?(u=(0,Se.mk)(u,fn)-1,d=(0,Se.mk)(d,fn)-1):(u=(0,Se.RI)(u,fn),d=(0,Se.RI)(d,fn)),(0,zi.N)(o,u,d,s)}getTileCoordForXYAndZ_(e,t,r,i,s){const o=this.getOrigin(r),a=this.getResolution(r),l=(0,zt.xq)(this.getTileSize(r),this.tmpSize_);let c=(e-o[0])/a/l[0],u=(o[1]-t)/a/l[1];return i?(c=(0,Se.mk)(c,fn)-1,u=(0,Se.mk)(u,fn)-1):(c=(0,Se.RI)(c,fn),u=(0,Se.RI)(u,fn)),(0,zi.N)(r,c,u,s)}getTileCoordForCoordAndZ(e,t,r){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const r=(0,Xn.FT)(this.resolutions_,e,t||0);return(0,Se.qE)(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return(0,ef.sj)(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const t=this.resolutions_.length,r=new Array(t);for(let i=this.minZoom;i<t;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}const ji=tf;function Ol(n){let e=n.getDefaultTileGrid();return e||(e=sf(n),n.setDefaultTileGrid(e)),e}function nf(n,e,t){const r=e[0],i=n.getTileCoordCenter(e),s=jr(t);if(!(0,M.Ym)(s,i)){const o=(0,M.RG)(s),a=Math.ceil((s[0]-i[0])/o);return i[0]+=o*a,n.getTileCoordForCoordAndZ(i,r)}return e}function rf(n,e,t,r){r=r!==void 0?r:"top-left";const i=Nl(n,e,t);return new ji({extent:n,origin:(0,M.qF)(n,r),resolutions:i,tileSize:t})}function Oi(n){const e=n||{},t=e.extent||(0,D.Jt)("EPSG:3857").getExtent(),r={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Nl(t,e.maxZoom,e.tileSize,e.maxResolution)};return new ji(r)}function Nl(n,e,t,r){e=e!==void 0?e:Di.L,t=(0,zt.xq)(t!==void 0?t:Di.R);const i=(0,M.Oq)(n),s=(0,M.RG)(n);r=r>0?r:Math.max(s/t[0],i/t[1]);const o=e+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=r/Math.pow(2,l);return a}function sf(n,e,t,r){const i=jr(n);return rf(i,e,t,r)}function jr(n){n=(0,D.Jt)(n);let e=n.getExtent();if(!e){const t=180*D.Ig.degrees/n.getMetersPerUnit();e=(0,M.N)(-t,-t,t,t)}return e}var of=y(40190),ne=y(11078),af=y(97404);function Ov(n,e){const t=[];Object.keys(e).forEach(function(i){e[i]!==null&&e[i]!==void 0&&t.push(i+"="+encodeURIComponent(e[i]))});const r=t.join("&");return n=n.replace(/[?&]$/,""),n+=n.includes("?")?"&":"?",n+r}const lf=/\{z\}/g,cf=/\{x\}/g,uf=/\{y\}/g,df=/\{-y\}/g;function hf(n,e,t,r,i){return n.replace(lf,e.toString()).replace(cf,t.toString()).replace(uf,r.toString()).replace(df,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function Nv(n,e,t,r){const i=hashZXY(e,t,r),s=modulo(i,n.length);return n[s]}function ff(n){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(n);if(t){const r=t[1].charCodeAt(0),i=t[2].charCodeAt(0);let s;for(s=r;s<=i;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){const r=parseInt(t[2],10);for(let i=parseInt(t[1],10);i<=r;i++)e.push(n.replace(t[0],i.toString()));return e}return e.push(n),e}function pf(n,e){return function(t,r,i){if(!t)return;let s;const o=t[0];if(e){const a=e.getFullTileRange(o);a&&(s=a.getHeight()-1)}return hf(n,o,t[1],t[2],s)}}function Gl(n,e){const t=n.length,r=new Array(t);for(let i=0;i<t;++i)r[i]=pf(n[i],e);return gf(r)}function gf(n){return n.length===1?n[0]:function(e,t,r){if(!e)return;const i=(0,zi.tW)(e),s=(0,Se.xP)(i,n.length);return n[s](e,t,r)}}function Gv(n,e,t){}class mf extends Zn{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&(0,zt.xq)(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tmpSize=[0,0],this.key_=e.key||(0,W.v6)(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,r,i,s){return(0,W.b0)()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:Ol(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,r){const i=this.getTileGridForProjection(r),s=this.getTilePixelRatio(t),o=(0,zt.xq)(i.getTileSize(e),this.tmpSize);return s==1?o:(0,zt.hs)(o,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){const r=t!==void 0?t:this.getProjection(),i=t!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=nf(i,e,r)),(0,zi.N5)(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class yf extends An.Ay{constructor(e,t){super(e),this.tile=t}}const Bl=mf,yo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class vo extends Bl{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===vo.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,r=(0,W.v6)(t),i=t.getState();let s;i==ne.A.LOADING?(this.tileLoadingKeys_[r]=!0,s=yo.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],s=i==ne.A.ERROR?yo.TILELOADERROR:i==ne.A.LOADED?yo.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new yf(s,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,typeof t<"u"?this.setKey(t):this.changed()}setUrl(e){const t=ff(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(` `);this.generateTileUrlFunction_?this.setTileUrlFunction(Gl(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,r){}}const $l=vo;class vf extends $l{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:xf,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:of.A,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!(0,D.tI)(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||(0,D.tI)(t,e)))return this.tileGrid;const r=(0,W.v6)(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Ol(e)),this.tileGridForProjection[r]}createTile_(e,t,r,i,s,o){const a=[e,t,r],l=this.getTileCoordForTileUrlFunction(a,s),c=l?this.tileUrlFunction(l,i,s):void 0,u=new this.tileClass(a,c!==void 0?ne.A.IDLE:ne.A.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(mt.A.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,t,r,i,s){const o=this.getProjection();if(!o||!s||(0,D.tI)(o,s))return this.getTileInternal(e,t,r,i,o||s);const a=[e,t,r],l=this.getKey(),c=this.getTileGridForProjection(o),u=this.getTileGridForProjection(s),d=this.getTileCoordForTileUrlFunction(a,s),h=new af.A(o,c,s,u,a,d,this.getTilePixelRatio(i),this.getGutter(),(f,p,g,m)=>this.getTileInternal(f,p,g,m,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return h.key=l,h}getTileInternal(e,t,r,i,s){const o=this.getKey();return this.createTile_(e,t,r,i,s,o)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const r=(0,D.Jt)(e);if(r){const i=(0,W.v6)(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=t)}}}function xf(n,e){n.getImage().src=e}const Vl=vf;class wf extends Vl{constructor(e){e=e||{};const t=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:Oi({extent:jr(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const xo=wf;var bf=(n=>(n.Auto="auto",n.Light="light",n.Dark="dark",n))(bf||{});const Ni={theme:"auto",showLabels:!0},Ul={id:"carto",name:"CARTO basemap",description:"Add layer CARTO Raster basemaps",isBaseMap:!0,defaultOptions:Ni,create:async(n,e,t,r)=>({init:()=>{const i={...Ni,...e.config};let s=i.theme;(!s||s==="auto")&&(s=r.isDark?"dark":"light"),i.showLabels?s+="_all":s+="_nolabels";const o=window.devicePixelRatio>1?"@2x":"",a=e.noRepeat??!1;return new Dr.A({source:new xo({attributions:'<a href="https://carto.com/attribution/">\xA9CARTO</a> <a href="https://www.openstreetmap.org/copyright">\xA9OpenStreetMap</a> contributors',url:`https://{1-4}.basemaps.cartocdn.com/${s}/{z}/{x}/{y}${o}.png`,wrapX:!a})})},registerOptionsUI:i=>{i.addRadio({path:"config.theme",name:"Theme",settings:{options:[{value:"auto",label:"Auto",description:"Match grafana theme"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]},defaultValue:Ni.theme}).addBooleanSwitch({path:"config.showLabels",name:"Show labels",description:"",defaultValue:Ni.showLabels})}})},Sf=[Ul],Wl="https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",Qn={url:Wl+"/tile/{z}/{y}/{x}",attribution:`Tiles \xA9 <a href="${Wl}">ArcGIS</a>`},Xl={id:"xyz",name:"XYZ Tile layer",description:"Add map from a generic tile layer",isBaseMap:!0,create:async(n,e,t,r)=>({init:()=>{const i={...e.config};i.url||(i.url=Qn.url,i.attribution=i.attribution??Qn.attribution);const s=e.noRepeat??!1;return new Dr.A({source:new xo({url:i.url,attributions:i.attribution,wrapX:!s}),minZoom:i.minZoom,maxZoom:i.maxZoom})},registerOptionsUI:i=>{i.addTextInput({path:"config.url",name:"URL template",description:"Must include {x}, {y} or {-y}, and {z} placeholders",settings:{placeholder:Qn.url}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:Qn.attribution}})}})},Cf=[Xl],Gi="custom",wo="streets",Zl=new ki.O(()=>[{id:wo,name:"World Street Map",slug:"World_Street_Map"},{id:"world-imagery",name:"World Imagery",slug:"World_Imagery"},{id:"world-physical",name:"World Physical",slug:"World_Physical_Map"},{id:"topo",name:"Topographic",slug:"World_Topo_Map"},{id:"usa-topo",name:"USA Topographic",slug:"USA_Topo_Maps"},{id:"ocean",name:"World Ocean",slug:"Ocean/World_Ocean_Base"},{id:Gi,name:"Custom MapServer",description:"Use a custom MapServer with pre-cached values",slug:""}]),Af=[{id:"esri-xyz",name:"ArcGIS MapServer",description:"Add layer from an ESRI ArcGIS MapServer",isBaseMap:!0,create:async(n,e,t,r)=>{const i={...e.config},s=Zl.getIfExists(i.server??wo);if(s.id!==Gi){const a="https://services.arcgisonline.com/ArcGIS/rest/services/";i.url=`${a}${s.slug}/MapServer/tile/{z}/{y}/{x}`,i.attribution=`Tiles \xA9 <a href="${a}${s.slug}/MapServer">ArcGIS</a>`}const o={...e,config:i};return Xl.create(n,o,t,r).then(a=>(a.registerOptionsUI=l=>{l.addSelect({path:"config.server",name:"Server instance",settings:{options:Zl.selectOptions().options}}).addTextInput({path:"config.url",name:"URL template",description:"Must include {x}, {y} or {-y}, and {z} placeholders",settings:{placeholder:Qn.url},showIf:c=>c.config?.server===Gi}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:Qn.attribution},showIf:c=>c.config?.server===Gi})},a))},defaultOptions:{server:wo}}];var Tf=8,Ef={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},_f={"*":{type:"source"}},Ff=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],If={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Rf={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Pf={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},kf={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Mf={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Lf={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},zf={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Df=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],jf={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Of={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Nf={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Gf={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Bf={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},$f={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Vf={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Uf={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wf={type:"array",value:"*"},Xf={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Zf={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Yf={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Hf={type:"array",value:"*",minimum:1},Kf={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Jf={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},qf={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},Qf={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},ep=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],tp={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},np={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},rp={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},ip={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},sp={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},op={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ap={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},lp={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},cp={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},up={"*":{type:"string"}},ke={$version:Tf,$root:Ef,sources:_f,source:Ff,source_vector:If,source_raster:Rf,source_raster_dem:Pf,source_geojson:kf,source_video:Mf,source_image:Lf,layer:zf,layout:Df,layout_background:jf,layout_fill:Of,layout_circle:Nf,layout_heatmap:Gf,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Bf,layout_symbol:$f,layout_raster:Vf,layout_hillshade:Uf,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:Wf,filter_operator:Xf,geometry_type:Zf,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:Yf,expression:Hf,light:Kf,sky:Jf,terrain:qf,projection:Qf,paint:ep,paint_fill:tp,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:np,paint_circle:rp,paint_heatmap:ip,paint_symbol:sp,paint_raster:op,paint_hillshade:ap,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:lp,transition:cp,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:up};const Yl=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dp(n,e){const t={};for(const r in n)r!=="ref"&&(t[r]=n[r]);return Yl.forEach(r=>{r in e&&(t[r]=e[r])}),t}function Hl(n){n=n.slice();const e=Object.create(null);for(let t=0;t<n.length;t++)e[n[t].id]=n[t];for(let t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=dp(n[t],e[n[t].ref]));return n}function re(n,e){if(Array.isArray(n)){if(!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!re(n[t],e[t]))return!1;return!0}if(typeof n=="object"&&n!==null&&e!==null){if(typeof e!="object"||Object.keys(n).length!==Object.keys(e).length)return!1;for(const r in n)if(!re(n[r],e[r]))return!1;return!0}return n===e}function ot(n,e){n.push(e)}function Kl(n,e,t){ot(t,{command:"addSource",args:[n,e[n]]})}function Jl(n,e,t){ot(e,{command:"removeSource",args:[n]}),t[n]=!0}function hp(n,e,t,r){Jl(n,t,r),Kl(n,e,t)}function fp(n,e,t){let r;for(r in n[t])if(Object.prototype.hasOwnProperty.call(n[t],r)&&r!=="data"&&!re(n[t][r],e[t][r]))return!1;for(r in e[t])if(Object.prototype.hasOwnProperty.call(e[t],r)&&r!=="data"&&!re(n[t][r],e[t][r]))return!1;return!0}function pp(n,e,t,r){n=n||{},e=e||{};let i;for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(Object.prototype.hasOwnProperty.call(e,i)||Jl(i,t,r));for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(n,i)?re(n[i],e[i])||(n[i].type==="geojson"&&e[i].type==="geojson"&&fp(n,e,i)?ot(t,{command:"setGeoJSONSourceData",args:[i,e[i].data]}):hp(i,e,t,r)):Kl(i,e,t))}function Bi(n,e,t,r,i,s){n=n||{},e=e||{};for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&(re(n[o],e[o])||t.push({command:s,args:[r,o,e[o],i]}));for(const o in e)!Object.prototype.hasOwnProperty.call(e,o)||Object.prototype.hasOwnProperty.call(n,o)||re(n[o],e[o])||t.push({command:s,args:[r,o,e[o],i]})}function ql(n){return n.id}function Ql(n,e){return n[e.id]=e,n}function gp(n,e,t){n=n||[],e=e||[];const r=n.map(ql),i=e.map(ql),s=n.reduce(Ql,{}),o=e.reduce(Ql,{}),a=r.slice(),l=Object.create(null);let c,u,d,h,f;for(let p=0,g=0;p<r.length;p++)c=r[p],Object.prototype.hasOwnProperty.call(o,c)?g++:(ot(t,{command:"removeLayer",args:[c]}),a.splice(a.indexOf(c,g),1));for(let p=0,g=0;p<i.length;p++)c=i[i.length-1-p],a[a.length-1-p]!==c&&(Object.prototype.hasOwnProperty.call(s,c)?(ot(t,{command:"removeLayer",args:[c]}),a.splice(a.lastIndexOf(c,a.length-g),1)):g++,h=a[a.length-p],ot(t,{command:"addLayer",args:[o[c],h]}),a.splice(a.length-p,0,c),l[c]=!0);for(let p=0;p<i.length;p++)if(c=i[p],u=s[c],d=o[c],!(l[c]||re(u,d))){if(!re(u.source,d.source)||!re(u["source-layer"],d["source-layer"])||!re(u.type,d.type)){ot(t,{command:"removeLayer",args:[c]}),h=a[a.lastIndexOf(c)+1],ot(t,{command:"addLayer",args:[d,h]});continue}Bi(u.layout,d.layout,t,c,null,"setLayoutProperty"),Bi(u.paint,d.paint,t,c,null,"setPaintProperty"),re(u.filter,d.filter)||ot(t,{command:"setFilter",args:[c,d.filter]}),(!re(u.minzoom,d.minzoom)||!re(u.maxzoom,d.maxzoom))&&ot(t,{command:"setLayerZoomRange",args:[c,d.minzoom,d.maxzoom]});for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(f==="layout"||f==="paint"||f==="filter"||f==="metadata"||f==="minzoom"||f==="maxzoom"||(f.indexOf("paint.")===0?Bi(u[f],d[f],t,c,f.slice(6),"setPaintProperty"):re(u[f],d[f])||ot(t,{command:"setLayerProperty",args:[c,f,d[f]]})));for(f in d)!Object.prototype.hasOwnProperty.call(d,f)||Object.prototype.hasOwnProperty.call(u,f)||f==="layout"||f==="paint"||f==="filter"||f==="metadata"||f==="minzoom"||f==="maxzoom"||(f.indexOf("paint.")===0?Bi(u[f],d[f],t,c,f.slice(6),"setPaintProperty"):re(u[f],d[f])||ot(t,{command:"setLayerProperty",args:[c,f,d[f]]}))}}function $v(n,e){if(!n)return[{command:"setStyle",args:[e]}];let t=[];try{if(!re(n.version,e.version))return[{command:"setStyle",args:[e]}];re(n.center,e.center)||t.push({command:"setCenter",args:[e.center]}),re(n.state,e.state)||t.push({command:"setGlobalState",args:[e.state]}),re(n.centerAltitude,e.centerAltitude)||t.push({command:"setCenterAltitude",args:[e.centerAltitude]}),re(n.zoom,e.zoom)||t.push({command:"setZoom",args:[e.zoom]}),re(n.bearing,e.bearing)||t.push({command:"setBearing",args:[e.bearing]}),re(n.pitch,e.pitch)||t.push({command:"setPitch",args:[e.pitch]}),re(n.roll,e.roll)||t.push({command:"setRoll",args:[e.roll]}),re(n.sprite,e.sprite)||t.push({command:"setSprite",args:[e.sprite]}),re(n.glyphs,e.glyphs)||t.push({command:"setGlyphs",args:[e.glyphs]}),re(n.transition,e.transition)||t.push({command:"setTransition",args:[e.transition]}),re(n.light,e.light)||t.push({command:"setLight",args:[e.light]}),re(n.terrain,e.terrain)||t.push({command:"setTerrain",args:[e.terrain]}),re(n.sky,e.sky)||t.push({command:"setSky",args:[e.sky]}),re(n.projection,e.projection)||t.push({command:"setProjection",args:[e.projection]});const r={},i=[];pp(n.sources,e.sources,i,r);const s=[];n.layers&&n.layers.forEach(o=>{"source"in o&&r[o.source]?t.push({command:"removeLayer",args:[o.id]}):s.push(o)}),t=t.concat(i),gp(s,e.layers,t)}catch(r){console.warn("Unable to compute style diff:",r),t=[{command:"setStyle",args:[e]}]}return t}class F{constructor(e,t,r,i){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),t!=null&&t.__line__&&(this.line=t.__line__)}}class Vv{constructor(e){this.error=e,this.message=e.message;const t=e.message.match(/line (\d+)/);this.line=t?parseInt(t[1],10):0}}function er(n,...e){for(const t of e)for(const r in t)n[r]=t[r];return n}class Dt extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class bo{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[r,i]of t)this.bindings[r]=i}concat(e){return new bo(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}}const $i={kind:"null"},L={kind:"number"},J={kind:"string"},H={kind:"boolean"},jt={kind:"color"},Vi={kind:"projectionDefinition"},Fn={kind:"object"},Y={kind:"value"},mp={kind:"error"},Ui={kind:"collator"},Wi={kind:"formatted"},Xi={kind:"padding"},Or={kind:"colorArray"},Zi={kind:"numberArray"},Nr={kind:"resolvedImage"},Yi={kind:"variableAnchorOffsetCollection"};function Qe(n,e){return{kind:"array",itemType:n,N:e}}function de(n){if(n.kind==="array"){const e=de(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const yp=[$i,L,J,H,jt,Vi,Wi,Fn,Qe(Y),Xi,Zi,Or,Nr,Yi];function Gr(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Gr(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const t of yp)if(!Gr(t,e))return null}}return`Expected ${de(n)} but found ${de(e)} instead.`}function So(n,e){return e.some(t=>t.kind===n.kind)}function In(n,e){return e.some(t=>t==="null"?n===null:t==="array"?Array.isArray(n):t==="object"?n&&!Array.isArray(n)&&typeof n=="object":t===typeof n)}function pn(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const ec=.96422,tc=1,nc=.82521,rc=4/29,tr=6/29,ic=3*tr*tr,vp=tr*tr*tr,xp=Math.PI/180,wp=180/Math.PI;function sc(n){return n=n%360,n<0&&(n+=360),n}function oc([n,e,t,r]){n=Co(n),e=Co(e),t=Co(t);let i,s;const o=Ao((.2225045*n+.7168786*e+.0606169*t)/tc);n===e&&e===t?i=s=o:(i=Ao((.4360747*n+.3850649*e+.1430804*t)/ec),s=Ao((.0139322*n+.0971045*e+.7141733*t)/nc));const a=116*o-16;return[a<0?0:a,500*(i-o),200*(o-s),r]}function Co(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Ao(n){return n>vp?Math.pow(n,1/3):n/ic+rc}function ac([n,e,t,r]){let i=(n+16)/116,s=isNaN(e)?i:i+e/500,o=isNaN(t)?i:i-t/200;return i=tc*Eo(i),s=ec*Eo(s),o=nc*Eo(o),[To(3.1338561*s-1.6168667*i-.4906146*o),To(-.9787684*s+1.9161415*i+.033454*o),To(.0719453*s-.2289914*i+1.4052427*o),r]}function To(n){return n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055,n<0?0:n>1?1:n}function Eo(n){return n>tr?n*n*n:ic*(n-rc)}function bp(n){const[e,t,r,i]=oc(n),s=Math.sqrt(t*t+r*r);return[Math.round(s*1e4)?sc(Math.atan2(r,t)*wp):NaN,s,e,i]}function Sp([n,e,t,r]){return n=isNaN(n)?0:n*xp,ac([t,Math.cos(n)*e,Math.sin(n)*e,r])}function Cp([n,e,t,r]){n=sc(n),e/=100,t/=100;function i(s){const o=(s+n/30)%12,a=e*Math.min(t,1-t);return t-a*Math.max(-1,Math.min(o-3,9-o,1))}return[i(0),i(8),i(4),r]}const Ap=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Br(n,e){return Ap(n,e)?n[e]:void 0}function Tp(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=Br(Ep,n);if(e){const[i,s,o]=e;return[i/255,s/255,o/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const s=n.length<6?1:2;let o=1;return[Hi(n.slice(o,o+=s)),Hi(n.slice(o,o+=s)),Hi(n.slice(o,o+=s)),Hi(n.slice(o,o+s)||"ff")]}if(n.startsWith("rgb")){const i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,s=n.match(i);if(s){const[o,a,l,c,u,d,h,f,p,g,m,x]=s,w=[c||" ",h||" ",g].join("");if(w===" "||w===" /"||w===",,"||w===",,,"){const b=[l,d,p].join(""),T=b==="%%%"?100:b===""?255:0;if(T){const S=[nr(+a/T,0,1),nr(+u/T,0,1),nr(+f/T,0,1),m?lc(+m,x):1];if(cc(S))return S}}return}}const t=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=n.match(t);if(r){const[i,s,o,a,l,c,u,d,h]=r,f=[o||" ",l||" ",u].join("");if(f===" "||f===" /"||f===",,"||f===",,,"){const p=[+s,nr(+a,0,100),nr(+c,0,100),d?lc(+d,h):1];if(cc(p))return Cp(p)}}}function Hi(n){return parseInt(n.padEnd(2,n),16)/255}function lc(n,e){return nr(e?n/100:n,0,1)}function nr(n,e,t){return Math.min(Math.max(e,n),t)}function cc(n){return!n.some(Number.isNaN)}const Ep={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function gn(n,e,t){return n+t*(e-n)}function rr(n,e,t){return n.map((r,i)=>gn(r,e[i],t))}function _p(n){return n==="rgb"||n==="hcl"||n==="lab"}class ee{constructor(e,t,r,i=1,s=!0){this.r=e,this.g=t,this.b=r,this.a=i,s||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,r,i]))}static parse(e){if(e instanceof ee)return e;if(typeof e!="string")return;const t=Tp(e);if(t)return new ee(...t,!1)}get rgb(){const{r:e,g:t,b:r,a:i}=this,s=i||1/0;return this.overwriteGetter("rgb",[e/s,t/s,r/s,i])}get hcl(){return this.overwriteGetter("hcl",bp(this.rgb))}get lab(){return this.overwriteGetter("lab",oc(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,i]=this.rgb;return`rgba(${[e,t,r].map(s=>Math.round(s*255)).join(",")},${i})`}static interpolate(e,t,r,i="rgb"){switch(i){case"rgb":{const[s,o,a,l]=rr(e.rgb,t.rgb,r);return new ee(s,o,a,l,!1)}case"hcl":{const[s,o,a,l]=e.hcl,[c,u,d,h]=t.hcl;let f,p;if(!isNaN(s)&&!isNaN(c)){let b=c-s;c>s&&b>180?b-=360:c<s&&s-c>180&&(b+=360),f=s+r*b}else isNaN(s)?isNaN(c)?f=NaN:(f=c,(a===1||a===0)&&(p=u)):(f=s,(d===1||d===0)&&(p=o));const[g,m,x,w]=Sp([f,p??gn(o,u,r),gn(a,d,r),gn(l,h,r)]);return new ee(g,m,x,w,!1)}case"lab":{const[s,o,a,l]=ac(rr(e.lab,t.lab,r));return new ee(s,o,a,l,!1)}}}}ee.black=new ee(0,0,0,1),ee.white=new ee(1,1,1,1),ee.transparent=new ee(0,0,0,0),ee.red=new ee(1,0,0,1);class _o{constructor(e,t,r){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Fp=["bottom","center","top"];class Fo{constructor(e,t,r,i,s,o){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=s,this.verticalAlign=o}}class Ot{constructor(e){this.sections=e}static fromString(e){return new Ot([new Fo(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ot?e:Ot.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class We{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof We)return e;if(typeof e=="number")return new We([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if(typeof t!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new We(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new We(rr(e.values,t.values,r))}}class Xe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xe)return e;if(typeof e=="number")return new Xe([e]);if(Array.isArray(e)){for(const t of e)if(typeof t!="number")return;return new Xe(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Xe(rr(e.values,t.values,r))}}class Me{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Me)return e;if(typeof e=="string"){const r=ee.parse(e);return r?new Me([r]):void 0}if(!Array.isArray(e))return;const t=[];for(const r of e){if(typeof r!="string")return;const i=ee.parse(r);if(!i)return;t.push(i)}return new Me(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,i="rgb"){const s=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let o=0;o<e.values.length;o++)s.push(ee.interpolate(e.values[o],t.values[o],r,i));return new Me(s)}}class pe extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Ip=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class at{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof at)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t<e.length;t+=2){const r=e[t],i=e[t+1];if(typeof r!="string"||!Ip.has(r)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new at(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const i=e.values,s=t.values;if(i.length!==s.length)throw new pe(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const o=[];for(let a=0;a<i.length;a+=2){if(i[a]!==s[a])throw new pe(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${i[a]}, to[${a}]: ${s[a]}`);o.push(i[a]);const[l,c]=i[a+1],[u,d]=s[a+1];o.push([gn(l,u,r),gn(c,d,r)])}return new at(o)}}class qt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new qt({name:e,available:!1}):null}}class lt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new lt(e,t,r)}static parse(e){if(e instanceof lt)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new lt(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new lt(e.from,e.to,e.transition);if(typeof e=="string")return new lt(e,e,1)}}function uc(n,e,t,r){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof r>"u"||typeof r=="number"&&r>=0&&r<=1?null:`Invalid rgba value [${[n,e,t,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r=="number"?[n,e,t,r]:[n,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function $r(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof lt||n instanceof ee||n instanceof _o||n instanceof Ot||n instanceof We||n instanceof Xe||n instanceof Me||n instanceof at||n instanceof qt)return!0;if(Array.isArray(n)){for(const e of n)if(!$r(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!$r(n[e]))return!1;return!0}else return!1}function xe(n){if(n===null)return $i;if(typeof n=="string")return J;if(typeof n=="boolean")return H;if(typeof n=="number")return L;if(n instanceof ee)return jt;if(n instanceof lt)return Vi;if(n instanceof _o)return Ui;if(n instanceof Ot)return Wi;if(n instanceof We)return Xi;if(n instanceof Xe)return Zi;if(n instanceof Me)return Or;if(n instanceof at)return Yi;if(n instanceof qt)return Nr;if(Array.isArray(n)){const e=n.length;let t;for(const r of n){const i=xe(r);if(!t)t=i;else{if(t===i)continue;t=Y;break}}return Qe(t||Y,e)}else return Fn}function Vr(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof ee||n instanceof lt||n instanceof Ot||n instanceof We||n instanceof Xe||n instanceof Me||n instanceof at||n instanceof qt?n.toString():JSON.stringify(n)}class ir{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!$r(e[1]))return t.error("invalid value");const r=e[1];let i=xe(r);const s=t.expectedType;return i.kind==="array"&&i.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(i=s),new ir(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ki={string:J,number:L,boolean:H,object:Fn};class St{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=1,i;const s=e[0];if(s==="array"){let a;if(e.length>2){const c=e[1];if(typeof c!="string"||!(c in Ki)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ki[c],r++}else a=Y;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],r++}i=Qe(a,l)}else{if(!Ki[s])throw new Error(`Types doesn't contain name = ${s}`);i=Ki[s]}const o=[];for(;r<e.length;r++){const a=t.parse(e[r],r,Y);if(!a)return null;o.push(a)}return new St(i,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(Gr(this.type,xe(r))){if(t===this.args.length-1)throw new pe(`Expected value to be of type ${de(this.type)}, but found ${de(xe(r))} instead.`)}else return r}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const dc={"to-boolean":H,"to-color":jt,"to-number":L,"to-string":J};class mn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!dc[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");const i=dc[r],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,Y);if(!a)return null;s.push(a)}return new mn(i,s)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(const i of this.args){if(t=i.evaluate(e),r=null,t instanceof ee)return t;if(typeof t=="string"){const s=e.parseColor(t);if(s)return s}else if(Array.isArray(t)&&(t.length<3||t.length>4?r=`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:r=uc(t[0],t[1],t[2],t[3]),!r))return new ee(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new pe(r||`Could not parse color from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const i=We.parse(t);if(i)return i}throw new pe(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const i=Xe.parse(t);if(i)return i}throw new pe(`Could not parse numberArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const i=Me.parse(t);if(i)return i}throw new pe(`Could not parse colorArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const i=at.parse(t);if(i)return i}throw new pe(`Could not parse variableAnchorOffsetCollection from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),t===null)return 0;const i=Number(t);if(!isNaN(i))return i}throw new pe(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ot.fromString(Vr(this.args[0].evaluate(e)));case"resolvedImage":return qt.fromString(Vr(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Vr(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Rp=["Unknown","Point","LineString","Polygon"];class hc{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Rp[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=ee.parse(e),this._parseColorCache.set(e,t)),t}}class Ji{constructor(e,t,r=[],i,s=new bo,o=[]){this.registry=e,this.path=r,this.key=r.map(a=>`[${a}]`).join(""),this.scope=s,this.errors=o,this.expectedType=i,this._isConstant=t}parse(e,t,r,i,s={}){return t?this.concat(t,r,i)._parse(e,s):this._parse(e,s)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function r(i,s,o){return o==="assert"?new St(s,[i]):o==="coerce"?new mn(s,[i]):i}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[i];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){const a=this.expectedType,l=o.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&l.kind==="value")o=r(o,a,t.typeAnnotation||"assert");else if(a.kind==="projectionDefinition"&&["string","array"].includes(l.kind)||["color","formatted","resolvedImage"].includes(a.kind)&&["value","string"].includes(l.kind)||["padding","numberArray"].includes(a.kind)&&["value","number","array"].includes(l.kind)||a.kind==="colorArray"&&["value","string","array"].includes(l.kind)||a.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(l.kind))o=r(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(o instanceof ir)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new hc;try{o=new ir(o.type,o.evaluate(a))}catch(l){return this.error(l.message),null}}return o}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const i=typeof e=="number"?this.path.concat(e):this.path,s=r?this.scope.concat(r):this.scope;return new Ji(this.registry,this._isConstant,i,t||null,s,this.errors)}error(e,...t){const r=`${this.key}${t.map(i=>`[${i}]`).join("")}`;this.errors.push(new Dt(r,e))}checkSubtype(e,t){const r=Gr(e,t);return r&&this.error(r),r}}class qi{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let s=1;s<e.length-1;s+=2){const o=e[s];if(typeof o!="string")return t.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",s);const a=t.parse(e[s+1],s+1);if(!a)return null;r.push([o,a])}const i=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return i?new qi(r,i):null}outputDefined(){return this.result.outputDefined()}}class Qi{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Qi(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Io{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,L),i=t.parse(e[2],2,Qe(t.expectedType||Y));if(!r||!i)return null;const s=i.type;return new Io(s.itemType,r,i)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new pe(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new pe(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new pe(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Ro{constructor(e,t){this.type=H,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Y),i=t.parse(e[2],2,Y);return!r||!i?null:So(r.type,[H,J,L,$i,Y])?new Ro(r,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${de(r.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!In(t,["boolean","string","number","null"]))throw new pe(`Expected first argument to be of type boolean, string, number or null, but found ${de(xe(t))} instead.`);if(!In(r,["string","array"]))throw new pe(`Expected second argument to be of type array or string, but found ${de(xe(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class es{constructor(e,t,r){this.type=L,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Y),i=t.parse(e[2],2,Y);if(!r||!i)return null;if(!So(r.type,[H,J,L,$i,Y]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${de(r.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,L);return s?new es(r,i,s):null}else return new es(r,i)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!In(t,["boolean","string","number","null"]))throw new pe(`Expected first argument to be of type boolean, string, number or null, but found ${de(xe(t))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),In(r,["string"])){const s=r.indexOf(t,i);return s===-1?-1:[...r.slice(0,s)].length}else{if(In(r,["array"]))return r.indexOf(t,i);throw new pe(`Expected second argument to be of type array or string, but found ${de(xe(r))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Po{constructor(e,t,r,i,s,o){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=s,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let r,i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const s={},o=[];for(let c=2;c<e.length-1;c+=2){let u=e[c];const d=e[c+1];Array.isArray(u)||(u=[u]);const h=t.concat(c);if(u.length===0)return h.error("Expected at least one branch label.");for(const p of u){if(typeof p!="number"&&typeof p!="string")return h.error("Branch labels must be numbers or strings.");if(typeof p=="number"&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return h.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof p=="number"&&Math.floor(p)!==p)return h.error("Numeric branch labels must be integer values.");if(!r)r=xe(p);else if(h.checkSubtype(r,xe(p)))return null;if(typeof s[String(p)]<"u")return h.error("Branch labels must be unique.");s[String(p)]=o.length}const f=t.parse(d,c,i);if(!f)return null;i=i||f.type,o.push(f)}const a=t.parse(e[1],1,Y);if(!a)return null;const l=t.parse(e[e.length-1],e.length-1,i);return!l||a.type.kind!=="value"&&t.concat(1).checkSubtype(r,a.type)?null:new Po(r,i,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(xe(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class ko{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);const i=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,H);if(!a)return null;const l=t.parse(e[o+1],o+1,r);if(!l)return null;i.push([a,l]),r=r||l.type}const s=t.parse(e[e.length-1],e.length-1,r);if(!s)return null;if(!r)throw new Error("Can't infer output type");return new ko(r,i,s)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class ts{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Y),i=t.parse(e[2],2,L);if(!r||!i)return null;if(!So(r.type,[Qe(Y),J,Y]))return t.error(`Expected first argument to be of type array or string, but found ${de(r.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,L);return s?new ts(r.type,r,i,s):null}else return new ts(r.type,r,i)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),In(t,["string"]))return[...t].slice(r,i).join("");if(In(t,["array"]))return t.slice(r,i);throw new pe(`Expected first argument to be of type array or string, but found ${de(xe(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function ns(n,e){const t=n.length-1;let r=0,i=t,s=0,o,a;for(;r<=i;)if(s=Math.floor((r+i)/2),o=n[s],a=n[s+1],o<=e){if(s===t||e<a)return s;r=s+1}else if(o>e)i=s-1;else throw new pe("Input is not a number.");return 0}class rs{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[i,s]of r)this.labels.push(i),this.outputs.push(s)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,L);if(!r)return null;const i=[];let s=null;t.expectedType&&t.expectedType.kind!=="value"&&(s=t.expectedType);for(let o=1;o<e.length;o+=2){const a=o===1?-1/0:e[o],l=e[o+1],c=o,u=o+1;if(typeof a!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(i.length&&i[i.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);const d=t.parse(l,u,s);if(!d)return null;s=s||d.type,i.push([a,d])}return new rs(s,r,i)}evaluate(e){const t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const s=t.length;if(i>=t[s-1])return r[s-1].evaluate(e);const o=ns(t,i);return r[o].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Pp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mo,fc;function kp(){if(fc)return Mo;fc=1,Mo=n;function n(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}return n.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var s=this.sampleCurveX(r)-e;if(Math.abs(s)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-s/o}var a=0,l=1;for(r=e,i=0;i<20&&(s=this.sampleCurveX(r),!(Math.abs(s-e)<t));i++)e>s?a=r:l=r,r=(l-a)*.5+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Mo}var Mp=kp(),Lp=Pp(Mp);class ct{constructor(e,t,r,i,s){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[o,a]of s)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,r,i){let s=0;if(e.name==="exponential")s=Lo(t,e.base,r,i);else if(e.name==="linear")s=Lo(t,1,r,i);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new Lp(o[0],o[1],o[2],o[3]).solve(Lo(t,1,r,i))}return s}static parse(e,t){let[r,i,s,...o]=e;if(!Array.isArray(i)||i.length===0)return t.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){const c=i[1];if(typeof c!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:c}}else if(i[0]==="cubic-bezier"){const c=i.slice(1);if(c.length!==4||c.some(u=>typeof u!="number"||u<0||u>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:c}}else return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(s=t.parse(s,2,L),!s)return null;const a=[];let l=null;(r==="interpolate-hcl"||r==="interpolate-lab")&&t.expectedType!=Or?l=jt:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){const u=o[c],d=o[c+1],h=c+3,f=c+4;if(typeof u!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(a.length&&a[a.length-1][0]>=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);const p=t.parse(d,f,l);if(!p)return null;l=l||p.type,a.push([u,p])}return!pn(l,L)&&!pn(l,Vi)&&!pn(l,jt)&&!pn(l,Xi)&&!pn(l,Zi)&&!pn(l,Or)&&!pn(l,Yi)&&!pn(l,Qe(L))?t.error(`Type ${de(l)} is not interpolatable.`):new ct(l,r,i,s,a)}evaluate(e){const t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const s=t.length;if(i>=t[s-1])return r[s-1].evaluate(e);const o=ns(t,i),a=t[o],l=t[o+1],c=ct.interpolationFactor(this.interpolation,i,a,l),u=r[o].evaluate(e),d=r[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return gn(u,d,c);case"color":return ee.interpolate(u,d,c);case"padding":return We.interpolate(u,d,c);case"colorArray":return Me.interpolate(u,d,c);case"numberArray":return Xe.interpolate(u,d,c);case"variableAnchorOffsetCollection":return at.interpolate(u,d,c);case"array":return rr(u,d,c);case"projectionDefinition":return lt.interpolate(u,d,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return ee.interpolate(u,d,c,"hcl");case"colorArray":return Me.interpolate(u,d,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return ee.interpolate(u,d,c,"lab");case"colorArray":return Me.interpolate(u,d,c,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Lo(n,e,t,r){const i=r-t,s=n-t;return i===0?0:e===1?s/i:(Math.pow(e,s)-1)/(Math.pow(e,i)-1)}const zp={color:ee.interpolate,number:gn,padding:We.interpolate,numberArray:Xe.interpolate,colorArray:Me.interpolate,variableAnchorOffsetCollection:at.interpolate,array:rr};class Ur{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const i=t.expectedType;i&&i.kind!=="value"&&(r=i);const s=[];for(const a of e.slice(1)){const l=t.parse(a,1+s.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,s.push(l)}if(!r)throw new Error("No output type");return i&&s.some(a=>Gr(i,a.type))?new Ur(Y,s):new Ur(r,s)}evaluate(e){let t=null,r=0,i;for(const s of this.args)if(r++,t=s.evaluate(e),t&&t instanceof qt&&!t.available&&(i||(i=t.name),t=null,r===this.args.length&&(t=i)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function pc(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Dp(n,e,t){return e===t}function jp(n,e,t){return e!==t}function Op(n,e,t){return e<t}function Np(n,e,t){return e>t}function Gp(n,e,t){return e<=t}function Bp(n,e,t){return e>=t}function gc(n,e,t,r){return r.compare(e,t)===0}function $p(n,e,t,r){return!gc(n,e,t,r)}function Vp(n,e,t,r){return r.compare(e,t)<0}function Up(n,e,t,r){return r.compare(e,t)>0}function Wp(n,e,t,r){return r.compare(e,t)<=0}function Xp(n,e,t,r){return r.compare(e,t)>=0}function sr(n,e,t){const r=n!=="=="&&n!=="!=";return class $d{constructor(s,o,a){this.type=H,this.lhs=s,this.rhs=o,this.collator=a,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");const a=s[0];let l=o.parse(s[1],1,Y);if(!l)return null;if(!pc(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${de(l.type)}'.`);let c=o.parse(s[2],2,Y);if(!c)return null;if(!pc(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${de(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${de(l.type)}' and '${de(c.type)}'.`);r&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new St(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new St(l.type,[c])));let u=null;if(s.length===4){if(l.type.kind!=="string"&&c.type.kind!=="string"&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(u=o.parse(s[3],3,Ui),!u)return null}return new $d(l,c,u)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(r&&this.hasUntypedArgument){const l=xe(o),c=xe(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new pe(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${l.kind}, ${c.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const l=xe(o),c=xe(a);if(l.kind!=="string"||c.kind!=="string")return e(s,o,a)}return this.collator?t(s,o,a,this.collator.evaluate(s)):e(s,o,a)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}}}const Zp=sr("==",Dp,gc),Yp=sr("!=",jp,$p),Hp=sr("<",Op,Vp),Kp=sr(">",Np,Up),Jp=sr("<=",Gp,Wp),qp=sr(">=",Bp,Xp);class is{constructor(e,t,r){this.type=Ui,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");const r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");const i=t.parse(r["case-sensitive"]===void 0?!1:r["case-sensitive"],1,H);if(!i)return null;const s=t.parse(r["diacritic-sensitive"]===void 0?!1:r["diacritic-sensitive"],1,H);if(!s)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,J),!o)?null:new is(i,s,o)}evaluate(e){return new _o(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class zo{constructor(e,t,r,i,s){this.type=J,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=s}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const r=t.parse(e[1],1,L);if(!r)return null;const i=e[2];if(typeof i!="object"||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let s=null;if(i.locale&&(s=t.parse(i.locale,1,J),!s))return null;let o=null;if(i.currency&&(o=t.parse(i.currency,1,J),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=t.parse(i["min-fraction-digits"],1,L),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=t.parse(i["max-fraction-digits"],1,L),!l)?null:new zo(r,s,o,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Do{constructor(e){this.type=Wi,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");const i=[];let s=!1;for(let o=1;o<=e.length-1;++o){const a=e[o];if(s&&typeof a=="object"&&!Array.isArray(a)){s=!1;let l=null;if(a["font-scale"]&&(l=t.parse(a["font-scale"],1,L),!l))return null;let c=null;if(a["text-font"]&&(c=t.parse(a["text-font"],1,Qe(J)),!c))return null;let u=null;if(a["text-color"]&&(u=t.parse(a["text-color"],1,jt),!u))return null;let d=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!Fp.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(d=t.parse(a["vertical-align"],1,J),!d)return null}const h=i[i.length-1];h.scale=l,h.font=c,h.textColor=u,h.verticalAlign=d}else{const l=t.parse(e[o],1,Y);if(!l)return null;const c=l.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,i.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Do(i)}evaluate(e){const t=r=>{const i=r.content.evaluate(e);return xe(i)===Nr?new Fo("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Fo(Vr(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)};return new Ot(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class jo{constructor(e){this.type=Nr,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const r=t.parse(e[1],1,J);return r?new jo(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=qt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Oo{constructor(e){this.type=L,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${de(r.type)} instead.`):new Oo(r):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return[...t].length;if(Array.isArray(t))return t.length;throw new pe(`Expected value to be of type string or array, but found ${de(xe(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Nt=8192;function Qp(n,e){const t=eg(n[0]),r=ng(n[1]),i=Math.pow(2,e.z);return[Math.round(t*i*Nt),Math.round(r*i*Nt)]}function No(n,e){const t=Math.pow(2,e.z),r=(n[0]/Nt+e.x)/t,i=(n[1]/Nt+e.y)/t;return[tg(r),rg(i)]}function eg(n){return(180+n)/360}function tg(n){return n*360-180}function ng(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function rg(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function Wr(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function Xr(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function ig(n,e,t){return e[1]>n[1]!=t[1]>n[1]&&n[0]<(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1])+e[0]}function sg(n,e,t){const r=n[0]-e[0],i=n[1]-e[1],s=n[0]-t[0],o=n[1]-t[1];return r*o-s*i===0&&r*s<=0&&i*o<=0}function ss(n,e,t,r){const i=[e[0]-n[0],e[1]-n[1]],s=[r[0]-t[0],r[1]-t[1]];return cg(s,i)===0?!1:!!(yc(n,e,t,r)&&yc(t,r,n,e))}function og(n,e,t){for(const r of t)for(let i=0;i<r.length-1;++i)if(ss(n,e,r[i],r[i+1]))return!0;return!1}function or(n,e,t=!1){let r=!1;for(const i of e)for(let s=0;s<i.length-1;s++){if(sg(n,i[s],i[s+1]))return t;ig(n,i[s],i[s+1])&&(r=!r)}return r}function ag(n,e){for(const t of e)if(or(n,t))return!0;return!1}function mc(n,e){for(const t of n)if(!or(t,e))return!1;for(let t=0;t<n.length-1;++t)if(og(n[t],n[t+1],e))return!1;return!0}function lg(n,e){for(const t of e)if(mc(n,t))return!0;return!1}function cg(n,e){return n[0]*e[1]-n[1]*e[0]}function yc(n,e,t,r){const i=n[0]-t[0],s=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1],l=r[0]-t[0],c=r[1]-t[1],u=i*c-l*s,d=o*c-l*a;return u>0&&d<0||u<0&&d>0}function Go(n,e,t){const r=[];for(let i=0;i<n.length;i++){const s=[];for(let o=0;o<n[i].length;o++){const a=Qp(n[i][o],t);Wr(e,a),s.push(a)}r.push(s)}return r}function vc(n,e,t){const r=[];for(let i=0;i<n.length;i++){const s=Go(n[i],e,t);r.push(s)}return r}function xc(n,e,t,r){if(n[0]<t[0]||n[0]>t[2]){const i=r*.5;let s=n[0]-t[0]>i?-r:t[0]-n[0]>i?r:0;s===0&&(s=n[0]-t[2]>i?-r:t[2]-n[0]>i?r:0),n[0]+=s}Wr(e,n)}function ug(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function wc(n,e,t,r){const i=Math.pow(2,r.z)*Nt,s=[r.x*Nt,r.y*Nt],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];xc(c,e,t,i),o.push(c)}return o}function bc(n,e,t,r){const i=Math.pow(2,r.z)*Nt,s=[r.x*Nt,r.y*Nt],o=[];for(const a of n){const l=[];for(const c of a){const u=[c.x+s[0],c.y+s[1]];Wr(e,u),l.push(u)}o.push(l)}if(e[2]-e[0]<=i/2){ug(e);for(const a of o)for(const l of a)xc(l,e,t,i)}return o}function dg(n,e){const t=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=n.canonicalID();if(e.type==="Polygon"){const s=Go(e.coordinates,r,i),o=wc(n.geometry(),t,r,i);if(!Xr(t,r))return!1;for(const a of o)if(!or(a,s))return!1}if(e.type==="MultiPolygon"){const s=vc(e.coordinates,r,i),o=wc(n.geometry(),t,r,i);if(!Xr(t,r))return!1;for(const a of o)if(!ag(a,s))return!1}return!0}function hg(n,e){const t=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=n.canonicalID();if(e.type==="Polygon"){const s=Go(e.coordinates,r,i),o=bc(n.geometry(),t,r,i);if(!Xr(t,r))return!1;for(const a of o)if(!mc(a,s))return!1}if(e.type==="MultiPolygon"){const s=vc(e.coordinates,r,i),o=bc(n.geometry(),t,r,i);if(!Xr(t,r))return!1;for(const a of o)if(!lg(a,s))return!1}return!0}class Rn{constructor(e,t){this.type=H,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if($r(e[1])){const r=e[1];if(r.type==="FeatureCollection"){const i=[];for(const s of r.features){const{type:o,coordinates:a}=s.geometry;o==="Polygon"&&i.push(a),o==="MultiPolygon"&&i.push(...a)}if(i.length){const s={type:"MultiPolygon",coordinates:i};return new Rn(r,s)}}else if(r.type==="Feature"){const i=r.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new Rn(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Rn(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return dg(e,this.geometries);if(e.geometryType()==="LineString")return hg(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Sc{constructor(e=[],t=(r,i)=>r<i?-1:r>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,i=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(r(i,o)>=0)break;t[e]=o,e=s}t[e]=i}_down(e){const{data:t,compare:r}=this,i=this.length>>1,s=t[e];for(;e<i;){let o=(e<<1)+1;const a=o+1;if(a<this.length&&r(t[a],t[o])<0&&(o=a),r(t[o],s)>=0)break;t[e]=t[o],e=o}t[e]=s}}function Cc(n,e,t=0,r=n.length-1,i=fg){for(;r>t;){if(r-t>600){const l=r-t+1,c=e-t+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(t,Math.floor(e-c*d/l+h)),p=Math.min(r,Math.floor(e+(l-c)*d/l+h));Cc(n,e,f,p,i)}const s=n[e];let o=t,a=r;for(Zr(n,t,e),i(n[r],s)>0&&Zr(n,t,r);o<a;){for(Zr(n,o,a),o++,a--;i(n[o],s)<0;)o++;for(;i(n[a],s)>0;)a--}i(n[t],s)===0?Zr(n,t,a):(a++,Zr(n,a,r)),a<=e&&(t=a+1),e<=a&&(r=a-1)}}function Zr(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function fg(n,e){return n<e?-1:n>e?1:0}function pg(n,e){if(n.length<=1)return[n];const r=[];let i,s;for(const o of n){const a=mg(o);a!==0&&(o.area=Math.abs(a),s===void 0&&(s=a<0),s===a<0?(i&&r.push(i),i=[o]):i.push(o))}if(i&&r.push(i),e>1)for(let o=0;o<r.length;o++)r[o].length<=e||(Cc(r[o],e,1,r[o].length-1,gg),r[o]=r[o].slice(0,e));return r}function gg(n,e){return e.area-n.area}function mg(n){let e=0;for(let t=0,r=n.length,i=r-1,s,o;t<r;i=t++)s=n[t],o=n[i],e+=(o.x-s.x)*(s.y+o.y);return e}const yg=6378.137,Ac=1/298.257223563,Tc=Ac*(2-Ac),Ec=Math.PI/180;class Bo{constructor(e){const t=Ec*yg*1e3,r=Math.cos(e*Ec),i=1/(1-Tc*(1-r*r)),s=Math.sqrt(i);this.kx=t*s*r,this.ky=t*s*i*(1-Tc)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r=1/0,i,s,o,a;for(let l=0;l<e.length-1;l++){let c=e[l][0],u=e[l][1],d=this.wrap(e[l+1][0]-c)*this.kx,h=(e[l+1][1]-u)*this.ky,f=0;(d!==0||h!==0)&&(f=(this.wrap(t[0]-c)*this.kx*d+(t[1]-u)*this.ky*h)/(d*d+h*h),f>1?(c=e[l+1][0],u=e[l+1][1]):f>0&&(c+=d/this.kx*f,u+=h/this.ky*f)),d=this.wrap(t[0]-c)*this.kx,h=(t[1]-u)*this.ky;const p=d*d+h*h;p<r&&(r=p,i=c,s=u,o=l,a=f)}return{point:[i,s],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}const $o=100,Vo=50;function _c(n,e){return e[0]-n[0]}function os(n){return n[1]-n[0]+1}function Qt(n,e){return n[1]>=n[0]&&n[1]<e}function Uo(n,e){if(n[0]>n[1])return[null,null];const t=os(n);if(e){if(t===2)return[n,null];const i=Math.floor(t/2);return[[n[0],n[0]+i],[n[0]+i,n[1]]]}if(t===1)return[n,null];const r=Math.floor(t/2)-1;return[[n[0],n[0]+r],[n[0]+r+1,n[1]]]}function Wo(n,e){if(!Qt(e,n.length))return[1/0,1/0,-1/0,-1/0];const t=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Wr(t,n[r]);return t}function Xo(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const r of t)Wr(e,r);return e}function Fc(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function Zo(n,e,t){if(!Fc(n)||!Fc(e))return NaN;let r=0,i=0;return n[2]<e[0]&&(r=e[0]-n[2]),n[0]>e[2]&&(r=n[0]-e[2]),n[1]>e[3]&&(i=n[1]-e[3]),n[3]<e[1]&&(i=e[1]-n[3]),t.distance([0,0],[r,i])}function Pn(n,e,t){const r=t.pointOnLine(e,n);return t.distance(n,r.point)}function Yo(n,e,t,r,i){const s=Math.min(Pn(n,[t,r],i),Pn(e,[t,r],i)),o=Math.min(Pn(t,[n,e],i),Pn(r,[n,e],i));return Math.min(s,o)}function vg(n,e,t,r,i){if(!(Qt(e,n.length)&&Qt(r,t.length)))return 1/0;let o=1/0;for(let a=e[0];a<e[1];++a){const l=n[a],c=n[a+1];for(let u=r[0];u<r[1];++u){const d=t[u],h=t[u+1];if(ss(l,c,d,h))return 0;o=Math.min(o,Yo(l,c,d,h,i))}}return o}function xg(n,e,t,r,i){if(!(Qt(e,n.length)&&Qt(r,t.length)))return NaN;let o=1/0;for(let a=e[0];a<=e[1];++a)for(let l=r[0];l<=r[1];++l)if(o=Math.min(o,i.distance(n[a],t[l])),o===0)return o;return o}function wg(n,e,t){if(or(n,e,!0))return 0;let r=1/0;for(const i of e){const s=i[0],o=i[i.length-1];if(s!==o&&(r=Math.min(r,Pn(n,[o,s],t)),r===0))return r;const a=t.pointOnLine(i,n);if(r=Math.min(r,t.distance(n,a.point)),r===0)return r}return r}function bg(n,e,t,r){if(!Qt(e,n.length))return NaN;for(let s=e[0];s<=e[1];++s)if(or(n[s],t,!0))return 0;let i=1/0;for(let s=e[0];s<e[1];++s){const o=n[s],a=n[s+1];for(const l of t)for(let c=0,u=l.length,d=u-1;c<u;d=c++){const h=l[d],f=l[c];if(ss(o,a,h,f))return 0;i=Math.min(i,Yo(o,a,h,f,r))}}return i}function Ic(n,e){for(const t of n)for(const r of t)if(or(r,e,!0))return!0;return!1}function Sg(n,e,t,r=1/0){const i=Xo(n),s=Xo(e);if(r!==1/0&&Zo(i,s,t)>=r)return r;if(Xr(i,s)){if(Ic(n,e))return 0}else if(Ic(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,u=c-1;l<c;u=l++){const d=a[u],h=a[l];for(const f of e)for(let p=0,g=f.length,m=g-1;p<g;m=p++){const x=f[m],w=f[p];if(ss(d,h,x,w))return 0;o=Math.min(o,Yo(d,h,x,w,t))}}return o}function Rc(n,e,t,r,i,s){if(!s)return;const o=Zo(Wo(r,s),i,t);o<e&&n.push([o,s,[0,0]])}function as(n,e,t,r,i,s,o){if(!s||!o)return;const a=Zo(Wo(r,s),Wo(i,o),t);a<e&&n.push([a,s,o])}function ls(n,e,t,r,i=1/0){let s=Math.min(r.distance(n[0],t[0][0]),i);if(s===0)return s;const o=new Sc([[0,[0,n.length-1],[0,0]]],_c),a=Xo(t);for(;o.length>0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],u=e?Vo:$o;if(os(c)<=u){if(!Qt(c,n.length))return NaN;if(e){const d=bg(n,c,t,r);if(isNaN(d)||d===0)return d;s=Math.min(s,d)}else for(let d=c[0];d<=c[1];++d){const h=wg(n[d],t,r);if(s=Math.min(s,h),s===0)return 0}}else{const d=Uo(c,e);Rc(o,s,r,n,a,d[0]),Rc(o,s,r,n,a,d[1])}}return s}function cs(n,e,t,r,i,s=1/0){let o=Math.min(s,i.distance(n[0],t[0]));if(o===0)return o;const a=new Sc([[0,[0,n.length-1],[0,t.length-1]]],_c);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],u=l[2],d=e?Vo:$o,h=r?Vo:$o;if(os(c)<=d&&os(u)<=h){if(!Qt(c,n.length)&&Qt(u,t.length))return NaN;let f;if(e&&r)f=vg(n,c,t,u,i),o=Math.min(o,f);else if(e&&!r){const p=n.slice(c[0],c[1]+1);for(let g=u[0];g<=u[1];++g)if(f=Pn(t[g],p,i),o=Math.min(o,f),o===0)return o}else if(!e&&r){const p=t.slice(u[0],u[1]+1);for(let g=c[0];g<=c[1];++g)if(f=Pn(n[g],p,i),o=Math.min(o,f),o===0)return o}else f=xg(n,c,t,u,i),o=Math.min(o,f)}else{const f=Uo(c,e),p=Uo(u,r);as(a,o,i,n,t,f[0],p[0]),as(a,o,i,n,t,f[0],p[1]),as(a,o,i,n,t,f[1],p[0]),as(a,o,i,n,t,f[1],p[1])}}return o}function Cg(n,e){const t=n.geometry(),r=t.flat().map(o=>No([o.x,o.y],n.canonical));if(t.length===0)return NaN;const i=new Bo(r[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,cs(r,!1,[o.coordinates],!1,i,s));break;case"LineString":s=Math.min(s,cs(r,!1,o.coordinates,!0,i,s));break;case"Polygon":s=Math.min(s,ls(r,!1,o.coordinates,i,s));break}if(s===0)return s}return s}function Ag(n,e){const t=n.geometry(),r=t.flat().map(o=>No([o.x,o.y],n.canonical));if(t.length===0)return NaN;const i=new Bo(r[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,cs(r,!0,[o.coordinates],!1,i,s));break;case"LineString":s=Math.min(s,cs(r,!0,o.coordinates,!0,i,s));break;case"Polygon":s=Math.min(s,ls(r,!0,o.coordinates,i,s));break}if(s===0)return s}return s}function Tg(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const r=pg(t,0).map(o=>o.map(a=>a.map(l=>No([l.x,l.y],n.canonical)))),i=new Bo(r[0][0][0][1]);let s=1/0;for(const o of e)for(const a of r){switch(o.type){case"Point":s=Math.min(s,ls([o.coordinates],!1,a,i,s));break;case"LineString":s=Math.min(s,ls(o.coordinates,!0,a,i,s));break;case"Polygon":s=Math.min(s,Sg(a,o.coordinates,i,s));break}if(s===0)return s}return s}function Ho(n){return n.type==="MultiPolygon"?n.coordinates.map(e=>({type:"Polygon",coordinates:e})):n.type==="MultiLineString"?n.coordinates.map(e=>({type:"LineString",coordinates:e})):n.type==="MultiPoint"?n.coordinates.map(e=>({type:"Point",coordinates:e})):[n]}class kn{constructor(e,t){this.type=L,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if($r(e[1])){const r=e[1];if(r.type==="FeatureCollection")return new kn(r,r.features.map(i=>Ho(i.geometry)).flat());if(r.type==="Feature")return new kn(r,Ho(r.geometry));if("type"in r&&"coordinates"in r)return new kn(r,Ho(r))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return Cg(e,this.geometries);if(e.geometryType()==="LineString")return Ag(e,this.geometries);if(e.geometryType()==="Polygon")return Tg(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Yr{constructor(e){this.type=Y,this.key=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return r==null?t.error("Global state property must be defined."):typeof r!="string"?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Yr(r)}evaluate(e){var t;const r=(t=e.globals)===null||t===void 0?void 0:t.globalState;return!r||Object.keys(r).length===0?null:Br(r,this.key)}eachChild(){}outputDefined(){return!1}}const us={"==":Zp,"!=":Yp,">":Kp,"<":Hp,">=":qp,"<=":Jp,array:St,at:Io,boolean:St,case:ko,coalesce:Ur,collator:is,format:Do,image:jo,in:Ro,"index-of":es,interpolate:ct,"interpolate-hcl":ct,"interpolate-lab":ct,length:Oo,let:qi,literal:ir,match:Po,number:St,"number-format":zo,object:St,slice:ts,step:rs,string:St,"to-boolean":mn,"to-color":mn,"to-number":mn,"to-string":mn,var:Qi,within:Rn,distance:kn,"global-state":Yr};class et{constructor(e,t,r,i){this.name=e,this.type=t,this._evaluate=r,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],i=et.definitions[r];if(!i)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,a=o.filter(([c])=>!Array.isArray(c)||c.length===e.length-1);let l=null;for(const[c,u]of a){l=new Ji(t.registry,ds,t.path,null,t.scope);const d=[];let h=!1;for(let f=1;f<e.length;f++){const p=e[f],g=Array.isArray(c)?c[f-1]:c.type,m=l.parse(p,1+d.length,g);if(!m){h=!0;break}d.push(m)}if(!h){if(Array.isArray(c)&&c.length!==d.length){l.error(`Expected ${c.length} arguments, but found ${d.length} instead.`);continue}for(let f=0;f<d.length;f++){const p=Array.isArray(c)?c[f]:c.type,g=d[f];l.concat(f+1).checkSubtype(p,g.type)}if(l.errors.length===0)return new et(r,s,u,d)}}if(a.length===1)t.errors.push(...l.errors);else{const u=(a.length?a:o).map(([h])=>_g(h)).join(" | "),d=[];for(let h=1;h<e.length;h++){const f=t.parse(e[h],1+d.length);if(!f)return null;d.push(de(f.type))}t.error(`Expected arguments of type ${u}, but found (${d.join(", ")}) instead.`)}return null}static register(e,t){et.definitions=t;for(const r in t)e[r]=et}}function Pc(n,[e,t,r,i]){e=e.evaluate(n),t=t.evaluate(n),r=r.evaluate(n);const s=i?i.evaluate(n):1,o=uc(e,t,r,s);if(o)throw new pe(o);return new ee(e/255,t/255,r/255,s,!1)}function kc(n,e){return n in e}function Ko(n,e){const t=e[n];return typeof t>"u"?null:t}function Eg(n,e,t,r){for(;t<=r;){const i=t+r>>1;if(e[i]===n)return!0;e[i]>n?r=i-1:t=i+1}return!1}function Mn(n){return{type:n}}et.register(us,{error:[mp,[J],(n,[e])=>{throw new pe(e.evaluate(n))}],typeof:[J,[Y],(n,[e])=>de(xe(e.evaluate(n)))],"to-rgba":[Qe(L,4),[jt],(n,[e])=>{const[t,r,i,s]=e.evaluate(n).rgb;return[t*255,r*255,i*255,s]}],rgb:[jt,[L,L,L],Pc],rgba:[jt,[L,L,L,L],Pc],has:{type:H,overloads:[[[J],(n,[e])=>kc(e.evaluate(n),n.properties())],[[J,Fn],(n,[e,t])=>kc(e.evaluate(n),t.evaluate(n))]]},get:{type:Y,overloads:[[[J],(n,[e])=>Ko(e.evaluate(n),n.properties())],[[J,Fn],(n,[e,t])=>Ko(e.evaluate(n),t.evaluate(n))]]},"feature-state":[Y,[J],(n,[e])=>Ko(e.evaluate(n),n.featureState||{})],properties:[Fn,[],n=>n.properties()],"geometry-type":[J,[],n=>n.geometryType()],id:[Y,[],n=>n.id()],zoom:[L,[],n=>n.globals.zoom],"heatmap-density":[L,[],n=>n.globals.heatmapDensity||0],elevation:[L,[],n=>n.globals.elevation||0],"line-progress":[L,[],n=>n.globals.lineProgress||0],accumulated:[Y,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[L,Mn(L),(n,e)=>{let t=0;for(const r of e)t+=r.evaluate(n);return t}],"*":[L,Mn(L),(n,e)=>{let t=1;for(const r of e)t*=r.evaluate(n);return t}],"-":{type:L,overloads:[[[L,L],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[L],(n,[e])=>-e.evaluate(n)]]},"/":[L,[L,L],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[L,[L,L],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[L,[],()=>Math.LN2],pi:[L,[],()=>Math.PI],e:[L,[],()=>Math.E],"^":[L,[L,L],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[L,[L],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[L,[L],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[L,[L],(n,[e])=>Math.log(e.evaluate(n))],log2:[L,[L],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[L,[L],(n,[e])=>Math.sin(e.evaluate(n))],cos:[L,[L],(n,[e])=>Math.cos(e.evaluate(n))],tan:[L,[L],(n,[e])=>Math.tan(e.evaluate(n))],asin:[L,[L],(n,[e])=>Math.asin(e.evaluate(n))],acos:[L,[L],(n,[e])=>Math.acos(e.evaluate(n))],atan:[L,[L],(n,[e])=>Math.atan(e.evaluate(n))],min:[L,Mn(L),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[L,Mn(L),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[L,[L],(n,[e])=>Math.abs(e.evaluate(n))],round:[L,[L],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[L,[L],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[L,[L],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[H,[J,Y],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[H,[Y],(n,[e])=>n.id()===e.value],"filter-type-==":[H,[J],(n,[e])=>n.geometryType()===e.value],"filter-<":[H,[J,Y],(n,[e,t])=>{const r=n.properties()[e.value],i=t.value;return typeof r==typeof i&&r<i}],"filter-id-<":[H,[Y],(n,[e])=>{const t=n.id(),r=e.value;return typeof t==typeof r&&t<r}],"filter->":[H,[J,Y],(n,[e,t])=>{const r=n.properties()[e.value],i=t.value;return typeof r==typeof i&&r>i}],"filter-id->":[H,[Y],(n,[e])=>{const t=n.id(),r=e.value;return typeof t==typeof r&&t>r}],"filter-<=":[H,[J,Y],(n,[e,t])=>{const r=n.properties()[e.value],i=t.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[H,[Y],(n,[e])=>{const t=n.id(),r=e.value;return typeof t==typeof r&&t<=r}],"filter->=":[H,[J,Y],(n,[e,t])=>{const r=n.properties()[e.value],i=t.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[H,[Y],(n,[e])=>{const t=n.id(),r=e.value;return typeof t==typeof r&&t>=r}],"filter-has":[H,[Y],(n,[e])=>e.value in n.properties()],"filter-has-id":[H,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[H,[Qe(J)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[H,[Qe(Y)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[H,[J,Qe(Y)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[H,[J,Qe(Y)],(n,[e,t])=>Eg(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:H,overloads:[[[H,H],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[Mn(H),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:H,overloads:[[[H,H],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[Mn(H),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[H,[H],(n,[e])=>!e.evaluate(n)],"is-supported-script":[H,[J],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[J,[J],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[J,[J],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[J,Mn(Y),(n,e)=>e.map(t=>Vr(t.evaluate(n))).join("")],"resolved-locale":[J,[Ui],(n,[e])=>e.evaluate(n).resolvedLocale()]});function _g(n){return Array.isArray(n)?`(${n.map(de).join(", ")})`:`(${de(n.type)}...)`}function ds(n){if(n instanceof Qi)return ds(n.boundExpression);if(n instanceof et&&n.name==="error")return!1;if(n instanceof is)return!1;if(n instanceof Rn)return!1;if(n instanceof kn)return!1;if(n instanceof Yr)return!1;const e=n instanceof mn||n instanceof St;let t=!0;return n.eachChild(r=>{e?t=t&&ds(r):t=t&&r instanceof ir}),t?hs(n)&&fs(n,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function hs(n){if(n instanceof et){if(n.name==="get"&&n.args.length===1)return!1;if(n.name==="feature-state")return!1;if(n.name==="has"&&n.args.length===1)return!1;if(n.name==="properties"||n.name==="geometry-type"||n.name==="id")return!1;if(/^filter-/.test(n.name))return!1}if(n instanceof Rn||n instanceof kn)return!1;let e=!0;return n.eachChild(t=>{e&&!hs(t)&&(e=!1)}),e}function Hr(n){if(n instanceof et&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!Hr(t)&&(e=!1)}),e}function fs(n,e){if(n instanceof et&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(r=>{t&&!fs(r,e)&&(t=!1)}),t}function Jo(n){return{result:"success",value:n}}function ar(n){return{result:"error",value:n}}function ps(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function Mc(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function qo(n){return!!n.expression&&n.expression.interpolated}function q(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function lr(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&xe(n)===Fn}function Fg(n){return n}function Ig(n){switch(n.type){case"color":return ee.parse;case"padding":return We.parse;case"numberArray":return Xe.parse;case"colorArray":return Me.parse;default:return null}}function Rg(n){switch(n){case"exponential":return Lc;case"interval":return kg;case"categorical":return Pg;case"identity":return Mg;default:throw new Error(`Unknown function type "${n}"`)}}function Qo(n,e){const t=n.stops&&typeof n.stops[0][0]=="object",r=t||n.property!==void 0,i=t||!r,s=n.type||(qo(e)?"exponential":"interval"),o=Ig(e);if(o&&(n=er({},n),n.stops&&(n.stops=n.stops.map(u=>[u[0],o(u[1])])),n.default?n.default=o(n.default):n.default=o(e.default)),n.colorSpace&&!_p(n.colorSpace))throw new Error(`Unknown color space: "${n.colorSpace}"`);const a=Rg(s);let l,c;if(s==="categorical"){l=Object.create(null);for(const u of n.stops)l[u[0]]=u[1];c=typeof n.stops[0][0]}if(t){const u={},d=[];for(let p=0;p<n.stops.length;p++){const g=n.stops[p],m=g[0].zoom;u[m]===void 0&&(u[m]={zoom:m,type:n.type,property:n.property,default:n.default,stops:[]},d.push(m)),u[m].stops.push([g[0].value,g[1]])}const h=[];for(const p of d)h.push([u[p].zoom,Qo(u[p],e)]);const f={name:"linear"};return{kind:"composite",interpolationType:f,interpolationFactor:ct.interpolationFactor.bind(void 0,f),zoomStops:h.map(p=>p[0]),evaluate({zoom:p},g){return Lc({stops:h,base:n.base},e,p).evaluate(p,g)}}}else if(i){const u=s==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:u,interpolationFactor:ct.interpolationFactor.bind(void 0,u),zoomStops:n.stops.map(d=>d[0]),evaluate:({zoom:d})=>a(n,e,d,l,c)}}else return{kind:"source",evaluate(u,d){const h=d&&d.properties?d.properties[n.property]:void 0;return h===void 0?Kr(n.default,e.default):a(n,e,h,l,c)}}}function Kr(n,e,t){if(n!==void 0)return n;if(e!==void 0)return e;if(t!==void 0)return t}function Pg(n,e,t,r,i){const s=typeof t===i?r[t]:void 0;return Kr(s,n.default,e.default)}function kg(n,e,t){if(q(t)!=="number")return Kr(n.default,e.default);const r=n.stops.length;if(r===1||t<=n.stops[0][0])return n.stops[0][1];if(t>=n.stops[r-1][0])return n.stops[r-1][1];const i=ns(n.stops.map(s=>s[0]),t);return n.stops[i][1]}function Lc(n,e,t){const r=n.base!==void 0?n.base:1;if(q(t)!=="number")return Kr(n.default,e.default);const i=n.stops.length;if(i===1||t<=n.stops[0][0])return n.stops[0][1];if(t>=n.stops[i-1][0])return n.stops[i-1][1];const s=ns(n.stops.map(u=>u[0]),t),o=Lg(t,r,n.stops[s][0],n.stops[s+1][0]),a=n.stops[s][1],l=n.stops[s+1][1],c=zp[e.type]||Fg;return typeof a.evaluate=="function"?{evaluate(...u){const d=a.evaluate.apply(void 0,u),h=l.evaluate.apply(void 0,u);if(!(d===void 0||h===void 0))return c(d,h,o,n.colorSpace)}}:c(a,l,o,n.colorSpace)}function Mg(n,e,t){switch(e.type){case"color":t=ee.parse(t);break;case"formatted":t=Ot.fromString(t.toString());break;case"resolvedImage":t=qt.fromString(t.toString());break;case"padding":t=We.parse(t);break;case"colorArray":t=Me.parse(t);break;case"numberArray":t=Xe.parse(t);break;default:q(t)!==e.type&&(e.type!=="enum"||!e.values[t])&&(t=void 0)}return Kr(t,n.default,e.default)}function Lg(n,e,t,r){const i=r-t,s=n-t;return i===0?0:e===1?s/i:(Math.pow(e,s)-1)/(Math.pow(e,i)-1)}class zc{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new hc,this._defaultValue=t?Og(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,s,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,s,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null;try{const a=this.expression.evaluate(this._evaluator);if(a==null||typeof a=="number"&&a!==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new pe(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(a)} instead.`);return a}catch(a){return this._warningHistory[a.message]||(this._warningHistory[a.message]=!0,typeof console<"u"&&console.warn(a.message)),this._defaultValue}}}function cr(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in us}function gs(n,e){const t=new Ji(us,ds,[],e?jg(e):void 0),r=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return r?Jo(new zc(r,e)):ar(t.errors)}class ea{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Hr(t.expression),this.globalStateRefs=xs(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,s,o)}evaluate(e,t,r,i,s,o){return this._styleExpression.evaluate(e,t,r,i,s,o)}}class ta{constructor(e,t,r,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Hr(t.expression),this.globalStateRefs=xs(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,s,o)}evaluate(e,t,r,i,s,o){return this._styleExpression.evaluate(e,t,r,i,s,o)}interpolationFactor(e,t,r){return this.interpolationType?ct.interpolationFactor(this.interpolationType,e,t,r):0}}function zg(n){return n._styleExpression!==void 0}function ms(n,e){const t=gs(n,e);if(t.result==="error")return t;const r=t.value.expression,i=hs(r);if(!i&&!ps(e))return ar([new Dt("","data expressions not supported")]);const s=fs(r,["zoom"]);if(!s&&!Mc(e))return ar([new Dt("","zoom expressions not supported")]);const o=vs(r);if(!o&&!s)return ar([new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Dt)return ar([o]);if(o instanceof ct&&!qo(e))return ar([new Dt("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Jo(i?new ea("constant",t.value):new ea("source",t.value));const a=o instanceof ct?o.interpolation:void 0;return Jo(i?new ta("camera",t.value,o.labels,a):new ta("composite",t.value,o.labels,a))}class ys{constructor(e,t){this._parameters=e,this._specification=t,er(this,Qo(this._parameters,this._specification))}static deserialize(e){return new ys(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Dg(n,e){if(lr(n))return new ys(n,e);if(cr(n)){const t=ms(n,e);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return t.value}else{let t=n;return e.type==="color"&&typeof n=="string"?t=ee.parse(n):e.type==="padding"&&(typeof n=="number"||Array.isArray(n))?t=We.parse(n):e.type==="numberArray"&&(typeof n=="number"||Array.isArray(n))?t=Xe.parse(n):e.type==="colorArray"&&(typeof n=="string"||Array.isArray(n))?t=Me.parse(n):e.type==="variableAnchorOffsetCollection"&&Array.isArray(n)?t=at.parse(n):e.type==="projectionDefinition"&&typeof n=="string"&&(t=lt.parse(n)),{globalStateRefs:new Set,kind:"constant",evaluate:()=>t}}}function vs(n){let e=null;if(n instanceof qi)e=vs(n.result);else if(n instanceof Ur){for(const t of n.args)if(e=vs(t),e)break}else(n instanceof rs||n instanceof ct)&&n.input instanceof et&&n.input.name==="zoom"&&(e=n);return e instanceof Dt||n.eachChild(t=>{const r=vs(t);r instanceof Dt?e=r:!e&&r?e=new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new Dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function xs(n,e=new Set){return n instanceof Yr&&e.add(n.key),n.eachChild(t=>{xs(t,e)}),e}function jg(n){const e={color:jt,string:J,number:L,enum:J,boolean:H,formatted:Wi,padding:Xi,numberArray:Zi,colorArray:Or,projectionDefinition:Vi,resolvedImage:Nr,variableAnchorOffsetCollection:Yi};return n.type==="array"?Qe(e[n.value]||Y,n.length):e[n.type]}function Og(n){if(n.type==="color"&&lr(n.default))return new ee(0,0,0,0);switch(n.type){case"color":return ee.parse(n.default)||null;case"padding":return We.parse(n.default)||null;case"numberArray":return Xe.parse(n.default)||null;case"colorArray":return Me.parse(n.default)||null;case"variableAnchorOffsetCollection":return at.parse(n.default)||null;case"projectionDefinition":return lt.parse(n.default)||null;default:return n.default===void 0?null:n.default}}function Jr(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!Jr(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Ng={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Gg(n){if(n==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Jr(n)||(n=ws(n));const e=gs(n,Ng);if(e.result==="error")throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));{const t=Dc(n);return{filter:(r,i,s)=>e.value.evaluate(r,i,{},s),needGeometry:t,getGlobalStateRefs:()=>xs(e.value.expression)}}}function Bg(n,e){return n<e?-1:n>e?1:0}function Dc(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e<n.length;e++)if(Dc(n[e]))return!0;return!1}function ws(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?na(n[1],n[2],"=="):e==="!="?bs(na(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?na(n[1],n[2],e):e==="any"?$g(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(ws)):e==="none"?["all"].concat(n.slice(1).map(ws).map(bs)):e==="in"?jc(n[1],n.slice(2)):e==="!in"?bs(jc(n[1],n.slice(2))):e==="has"?Oc(n[1]):e==="!has"?bs(Oc(n[1])):!0}function na(n,e,t){switch(n){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,n,e]}}function $g(n){return["any"].concat(n.map(ws))}function jc(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",n,["literal",e.sort(Bg)]]:["filter-in-small",n,["literal",e]]}}function Oc(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function bs(n){return["!",n]}function Ss(n,e={}){if(Jr(n))return n;if(!n)return!0;const t=n,r=t[0];if(n.length<=1)return r!=="any";switch(r){case"==":case"!=":case"<":case">":case"<=":case">=":{const[,i,s]=n;return Ug(i,s,r,e)}case"any":{const[,...i]=t;return["any",...i.map(o=>{const a={},l=Ss(o,a),c=Vg(a);return c===!0?l:["case",c,l,!1]})]}case"all":{const[,...i]=t,s=i.map(o=>Ss(o,e));return s.length>1?["all",...s]:s[0]}case"none":{const[,...i]=t;return["!",Ss(["any",...i],{})]}case"in":{const[,i,...s]=t;return Nc(i,s)}case"!in":{const[,i,...s]=t;return Nc(i,s,!0)}case"has":return Gc(t[1]);case"!has":return["!",Gc(t[1])];default:return!0}}function Vg(n){const e=[];for(const t in n){const r=t==="$id"?["id"]:["get",t];e.push(["==",["typeof",r],n[t]])}return e.length===0?!0:e.length===1?e[0]:["all",...e]}function Ug(n,e,t,r){let i;if(n==="$type")return[t,["geometry-type"],e];if(n==="$id"?i=["id"]:i=["get",n],r&&e!==null){const s=typeof e;r[n]=s}return t==="=="&&n!=="$id"&&e===null?["all",["has",n],["==",i,null]]:t==="!="&&n!=="$id"&&e===null?["any",["!",["has",n]],["!=",i,null]]:[t,i,e]}function Nc(n,e,t=!1){if(e.length===0)return t;let r;n==="$type"?r=["geometry-type"]:n==="$id"?r=["id"]:r=["get",n];let i=!0;const s=typeof e[0];for(const o of e)if(typeof o!==s){i=!1;break}if(i&&(s==="string"||s==="number")){const o=e.sort().filter((a,l)=>l===0||e[l-1]!==a);return["match",r,o,!t,t]}return t?["all",...e.map(o=>["!=",r,o])]:["any",...e.map(o=>["==",r,o])]}function Gc(n){return n==="$type"?!0:n==="$id"?["!=",["id"],null]:["has",n]}function qr(n){return typeof n=="object"?["literal",n]:n}function ra(n,e){let t=n.stops;if(!t)return Wg(n,e);const r=t&&typeof t[0][0]=="object",i=r||n.property!==void 0,s=r||!i;return t=t.map(o=>!i&&e.tokens&&typeof o[1]=="string"?[o[0],$c(o[1])]:[o[0],qr(o[1])]),r?Xg(n,e,t):s?Yg(n,e,t):sa(n,e,t)}function Wg(n,e){const t=["get",n.property];if(n.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,n.default];{const r=[e.type==="color"?"to-color":e.type,t,qr(n.default)];return e.type==="array"&&r.splice(1,0,e.value,e.length||null),r}}function ia(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Xg(n,e,t){const r={},i={},s=[];for(let a=0;a<t.length;a++){const l=t[a],c=l[0].zoom;r[c]===void 0&&(r[c]={zoom:c,type:n.type,property:n.property,default:n.default},i[c]=[],s.push(c)),i[c].push([l[0].value,l[1]])}if(aa({},e)==="exponential"){const a=[ia(n),["linear"],["zoom"]];for(const l of s){const c=sa(r[l],e,i[l]);ur(a,l,c,!1)}return a}else{const a=["step",["zoom"]];for(const l of s){const c=sa(r[l],e,i[l]);ur(a,l,c,!0)}return oa(a),a}}function Zg(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function Bc(n,e){const t=qr(Zg(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function sa(n,e,t){const r=aa(n,e),i=["get",n.property];if(r==="categorical"&&typeof t[0][0]=="boolean"){const s=["case"];for(const o of t)s.push(["==",i,o[0]],o[1]);return s.push(Bc(n,e)),s}else if(r==="categorical"){const s=["match",i];for(const o of t)ur(s,o[0],o[1],!1);return s.push(Bc(n,e)),s}else if(r==="interval"){const s=["step",["number",i]];for(const o of t)ur(s,o[0],o[1],!0);return oa(s),n.default===void 0?s:["case",["==",["typeof",i],"number"],s,qr(n.default)]}else if(r==="exponential"){const s=n.base!==void 0?n.base:1,o=[ia(n),s===1?["linear"]:["exponential",s],["number",i]];for(const a of t)ur(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",i],"number"],o,qr(n.default)]}else throw new Error(`Unknown property function type ${r}`)}function Yg(n,e,t,r=["zoom"]){const i=aa(n,e);let s,o=!1;if(i==="interval")s=["step",r],o=!0;else if(i==="exponential"){const a=n.base!==void 0?n.base:1;s=[ia(n),a===1?["linear"]:["exponential",a],r]}else throw new Error(`Unknown zoom function type "${i}"`);for(const a of t)ur(s,a[0],a[1],o);return oa(s),s}function oa(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function ur(n,e,t,r){n.length>3&&e===n[n.length-2]||(r&&n.length===2||n.push(e),n.push(t))}function aa(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function $c(n){const e=["concat"],t=/{([^{}]+)}/g;let r=0;for(let i=t.exec(n);i!==null;i=t.exec(n)){const s=n.slice(r,t.lastIndex-i[0].length);r=t.lastIndex,s.length>0&&e.push(s),e.push(["get",i[1]])}if(e.length===1)return n;if(r<n.length)e.push(n.slice(r));else if(e.length===2)return["to-string",e[1]];return e}function Hg(n){for(let e=0;e<ke.layout.length;e++)for(const t in ke[ke.layout[e]])if(t===n)return ke[ke.layout[e]][t];for(let e=0;e<ke.paint.length;e++)for(const t in ke[ke.paint[e]])if(t===n)return ke[ke.paint[e]][t];return null}function Vc(n,e){for(const t in n.sources)e(n.sources[t])}function dr(n,e){for(const t of n.layers)e(t)}function Cs(n,e,t){function r(i,s){const o=i[s];o&&Object.keys(o).forEach(a=>{t({path:[i.id,s,a],key:a,value:o[a],reference:Hg(a),set(l){o[a]=l}})})}dr(n,i=>{e.paint&&r(i,"paint"),e.layout&&r(i,"layout")})}function la(n){const e=typeof n;if(e==="number"||e==="boolean"||e==="string"||n===void 0||n===null)return JSON.stringify(n);if(Array.isArray(n)){let i="[";for(const s of n)i+=`${la(s)},`;return`${i}]`}const t=Object.keys(n).sort();let r="{";for(let i=0;i<t.length;i++)r+=`${JSON.stringify(t[i])}:${la(n[t[i]])},`;return`${r}}`}function Kg(n){let e="";for(const t of Yl)e+=`/${la(n[t])}`;return e}function Uv(n,e){const t={};for(let i=0;i<n.length;i++){const s=e&&e[n[i].id]||Kg(n[i]);e&&(e[n[i].id]=s);let o=t[s];o||(o=t[s]=[]),o.push(n[i])}const r=[];for(const i in t)r.push(t[i]);return r}function Wv(){const n={},e=ke.$version;for(const t in ke.$root){const r=ke.$root[t];if(r.required){let i=null;t==="version"?i=e:r.type==="array"?i=[]:i={},i!=null&&(n[t]=i)}}return n}function Uc(n){const e=n.key,t=n.value;return t?[new F(e,t,"constants have been deprecated as of v8")]:[]}function me(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function Ln(n){if(Array.isArray(n))return n.map(Ln);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const t in n)e[t]=Ln(n[t]);return e}return me(n)}function ut(n){const e=n.key,t=n.value,r=n.valueSpec||{},i=n.objectElementValidators||{},s=n.style,o=n.styleSpec,a=n.validateSpec;let l=[];const c=q(t);if(c!=="object")return[new F(e,t,`object expected, ${c} found`)];for(const u in t){const d=u.split(".")[0],h=Br(r,d)||r["*"];let f;if(Br(i,d))f=i[d];else if(Br(r,d))f=a;else if(i["*"])f=i["*"];else if(r["*"])f=a;else{l.push(new F(e,t[u],`unknown property "${u}"`));continue}l=l.concat(f({key:(e&&`${e}.`)+u,value:t[u],valueSpec:h,style:s,styleSpec:o,object:t,objectKey:u,validateSpec:a},t))}for(const u in r)i[u]||r[u].required&&r[u].default===void 0&&t[u]===void 0&&l.push(new F(e,t,`missing required property "${u}"`));return l}function ca(n){const e=n.value,t=n.valueSpec,r=n.validateSpec,i=n.style,s=n.styleSpec,o=n.key,a=n.arrayElementValidator||r;if(q(e)!=="array")return[new F(o,e,`array expected, ${q(e)} found`)];if(t.length&&e.length!==t.length)return[new F(o,e,`array length ${t.length} expected, length ${e.length} found`)];if(t["min-length"]&&e.length<t["min-length"])return[new F(o,e,`array length at least ${t["min-length"]} expected, length ${e.length} found`)];let l={type:t.value,values:t.values};s.$version<7&&(l.function=t.function),q(t.value)==="object"&&(l=t.value);let c=[];for(let u=0;u<e.length;u++)c=c.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:l,validateSpec:n.validateSpec,style:i,styleSpec:s,key:`${o}[${u}]`}));return c}function As(n){const e=n.key,t=n.value,r=n.valueSpec;let i=q(t);return i==="number"&&t!==t&&(i="NaN"),i!=="number"?[new F(e,t,`number expected, ${i} found`)]:"minimum"in r&&t<r.minimum?[new F(e,t,`${t} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&t>r.maximum?[new F(e,t,`${t} is greater than the maximum value ${r.maximum}`)]:[]}function Wc(n){const e=n.valueSpec,t=me(n.value.type);let r,i={},s,o;const a=t!=="categorical"&&n.value.property===void 0,l=!a,c=q(n.value.stops)==="array"&&q(n.value.stops[0])==="array"&&q(n.value.stops[0][0])==="object",u=ut({key:n.key,value:n.value,valueSpec:n.styleSpec.function,validateSpec:n.validateSpec,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:d,default:p}});return t==="identity"&&a&&u.push(new F(n.key,n.value,'missing required property "property"')),t!=="identity"&&!n.value.stops&&u.push(new F(n.key,n.value,'missing required property "stops"')),t==="exponential"&&n.valueSpec.expression&&!qo(n.valueSpec)&&u.push(new F(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(l&&!ps(n.valueSpec)?u.push(new F(n.key,n.value,"property functions not supported")):a&&!Mc(n.valueSpec)&&u.push(new F(n.key,n.value,"zoom functions not supported"))),(t==="categorical"||c)&&n.value.property===void 0&&u.push(new F(n.key,n.value,'"property" property is required')),u;function d(g){if(t==="identity")return[new F(g.key,g.value,'identity function may not have a "stops" property')];let m=[];const x=g.value;return m=m.concat(ca({key:g.key,value:x,valueSpec:g.valueSpec,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,arrayElementValidator:h})),q(x)==="array"&&x.length===0&&m.push(new F(g.key,x,"array must have at least one stop")),m}function h(g){let m=[];const x=g.value,w=g.key;if(q(x)!=="array")return[new F(w,x,`array expected, ${q(x)} found`)];if(x.length!==2)return[new F(w,x,`array length 2 expected, length ${x.length} found`)];if(c){if(q(x[0])!=="object")return[new F(w,x,`object expected, ${q(x[0])} found`)];if(x[0].zoom===void 0)return[new F(w,x,"object stop key must have zoom")];if(x[0].value===void 0)return[new F(w,x,"object stop key must have value")];if(o&&o>me(x[0].zoom))return[new F(w,x[0].zoom,"stop zoom values must appear in ascending order")];me(x[0].zoom)!==o&&(o=me(x[0].zoom),s=void 0,i={}),m=m.concat(ut({key:`${w}[0]`,value:x[0],valueSpec:{zoom:{}},validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{zoom:As,value:f}}))}else m=m.concat(f({key:`${w}[0]`,value:x[0],validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec},x));return cr(Ln(x[1]))?m.concat([new F(`${w}[1]`,x[1],"expressions are not allowed in function stops.")]):m.concat(g.validateSpec({key:`${w}[1]`,value:x[1],valueSpec:e,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec}))}function f(g,m){const x=q(g.value),w=me(g.value),b=g.value!==null?g.value:m;if(!r)r=x;else if(x!==r)return[new F(g.key,b,`${x} stop domain type must match previous stop domain type ${r}`)];if(x!=="number"&&x!=="string"&&x!=="boolean")return[new F(g.key,b,"stop domain value must be a number, string, or boolean")];if(x!=="number"&&t!=="categorical"){let T=`number expected, ${x} found`;return ps(e)&&t===void 0&&(T+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new F(g.key,b,T)]}return t==="categorical"&&x==="number"&&(!isFinite(w)||Math.floor(w)!==w)?[new F(g.key,b,`integer expected, found ${w}`)]:t!=="categorical"&&x==="number"&&s!==void 0&&w<s?[new F(g.key,b,"stop domain values must appear in ascending order")]:(s=w,t==="categorical"&&w in i?[new F(g.key,b,"stop domain values must be unique")]:(i[w]=!0,[]))}function p(g){return g.validateSpec({key:g.key,value:g.value,valueSpec:e,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec})}}function hr(n){const e=(n.expressionContext==="property"?ms:gs)(Ln(n.value),n.valueSpec);if(e.result==="error")return e.value.map(r=>new F(`${n.key}${r.key}`,n.value,r.message));const t=e.value.expression||e.value._styleExpression.expression;if(n.expressionContext==="property"&&n.propertyKey==="text-font"&&!t.outputDefined())return[new F(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if(n.expressionContext==="property"&&n.propertyType==="layout"&&!Hr(t))return[new F(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if(n.expressionContext==="filter"&&!Hr(t))return[new F(n.key,n.value,'"feature-state" data expressions are not supported with filters.')];if(n.expressionContext&&n.expressionContext.indexOf("cluster")===0){if(!fs(t,["zoom","feature-state"]))return[new F(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(n.expressionContext==="cluster-initial"&&!hs(t))return[new F(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jg(n){const e=n.value,t=n.key,r=q(e);return r!=="boolean"?[new F(t,e,`boolean expected, ${r} found`)]:[]}function ua(n){const e=n.key,t=n.value,r=q(t);return r!=="string"?[new F(e,t,`color expected, ${r} found`)]:ee.parse(String(t))?[]:[new F(e,t,`color expected, "${t}" found`)]}function Qr(n){const e=n.key,t=n.value,r=n.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(me(t))===-1&&i.push(new F(e,t,`expected one of [${r.values.join(", ")}], ${JSON.stringify(t)} found`)):Object.keys(r.values).indexOf(me(t))===-1&&i.push(new F(e,t,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(t)} found`)),i}function da(n){return Jr(Ln(n.value))?hr(er({},n,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Xc(n)}function Xc(n){const e=n.value,t=n.key;if(q(e)!=="array")return[new F(t,e,`array expected, ${q(e)} found`)];const r=n.styleSpec;let i,s=[];if(e.length<1)return[new F(t,e,"filter array must have at least 1 element")];switch(s=s.concat(Qr({key:`${t}[0]`,value:e[0],valueSpec:r.filter_operator,style:n.style,styleSpec:n.styleSpec})),me(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&me(e[1])==="$type"&&s.push(new F(t,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&s.push(new F(t,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=q(e[1]),i!=="string"&&s.push(new F(`${t}[1]`,e[1],`string expected, ${i} found`)));for(let o=2;o<e.length;o++)i=q(e[o]),me(e[1])==="$type"?s=s.concat(Qr({key:`${t}[${o}]`,value:e[o],valueSpec:r.geometry_type,style:n.style,styleSpec:n.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&s.push(new F(`${t}[${o}]`,e[o],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let o=1;o<e.length;o++)s=s.concat(Xc({key:`${t}[${o}]`,value:e[o],style:n.style,styleSpec:n.styleSpec}));break;case"has":case"!has":i=q(e[1]),e.length!==2?s.push(new F(t,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&s.push(new F(`${t}[1]`,e[1],`string expected, ${i} found`));break}return s}function Zc(n,e){const t=n.key,r=n.validateSpec,i=n.style,s=n.styleSpec,o=n.value,a=n.objectKey,l=s[`${e}_${n.layerType}`];if(!l)return[];const c=a.match(/^(.*)-transition$/);if(e==="paint"&&c&&l[c[1]]&&l[c[1]].transition)return r({key:t,value:o,valueSpec:s.transition,style:i,styleSpec:s});const u=n.valueSpec||l[a];if(!u)return[new F(t,o,`unknown property "${a}"`)];let d;if(q(o)==="string"&&ps(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new F(t,o,`"${a}" does not support interpolation syntax Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];const h=[];return n.layerType==="symbol"&&(a==="text-field"&&i&&!i.glyphs&&h.push(new F(t,o,'use of "text-field" requires a style "glyphs" property')),a==="text-font"&&lr(Ln(o))&&me(o.type)==="identity"&&h.push(new F(t,o,'"text-font" does not support identity functions'))),h.concat(r({key:n.key,value:o,valueSpec:u,style:i,styleSpec:s,expressionContext:"property",propertyType:e,propertyKey:a}))}function Yc(n){return Zc(n,"paint")}function Hc(n){return Zc(n,"layout")}function Kc(n){let e=[];const t=n.value,r=n.key,i=n.style,s=n.styleSpec;if(q(t)!=="object")return[new F(r,t,`object expected, ${q(t)} found`)];!t.type&&!t.ref&&e.push(new F(r,t,'either "type" or "ref" is required'));let o=me(t.type);const a=me(t.ref);if(t.id){const l=me(t.id);for(let c=0;c<n.arrayIndex;c++){const u=i.layers[c];me(u.id)===l&&e.push(new F(r,t.id,`duplicate layer id "${t.id}", previously used at line ${u.id.__line__}`))}}if("ref"in t){["type","source","source-layer","filter","layout"].forEach(c=>{c in t&&e.push(new F(r,t[c],`"${c}" is prohibited for ref layers`))});let l;i.layers.forEach(c=>{me(c.id)===a&&(l=c)}),l?l.ref?e.push(new F(r,t.ref,"ref cannot reference another ref layer")):o=me(l.type):e.push(new F(r,t.ref,`ref layer "${a}" not found`))}else if(o!=="background")if(!t.source)e.push(new F(r,t,'missing required property "source"'));else{const l=i.sources&&i.sources[t.source],c=l&&me(l.type);l?c==="vector"&&o==="raster"?e.push(new F(r,t.source,`layer "${t.id}" requires a raster source`)):c!=="raster-dem"&&o==="hillshade"?e.push(new F(r,t.source,`layer "${t.id}" requires a raster-dem source`)):c!=="raster-dem"&&o==="color-relief"?e.push(new F(r,t.source,`layer "${t.id}" requires a raster-dem source`)):c==="raster"&&o!=="raster"?e.push(new F(r,t.source,`layer "${t.id}" requires a vector source`)):c==="vector"&&!t["source-layer"]?e.push(new F(r,t,`layer "${t.id}" must specify a "source-layer"`)):c==="raster-dem"&&o!=="hillshade"&&o!=="color-relief"?e.push(new F(r,t.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):o==="line"&&t.paint&&t.paint["line-gradient"]&&(c!=="geojson"||!l.lineMetrics)&&e.push(new F(r,t,`layer "${t.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new F(r,t.source,`source "${t.source}" not found`))}return e=e.concat(ut({key:r,value:t,valueSpec:s.layer,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,objectElementValidators:{"*"(){return[]},type(){return n.validateSpec({key:`${r}.type`,value:t.type,valueSpec:s.layer.type,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,object:t,objectKey:"type"})},filter:da,layout(l){return ut({layer:t,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return Hc(er({layerType:o},c))}}})},paint(l){return ut({layer:t,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return Yc(er({layerType:o},c))}}})}}})),e}function zn(n){const e=n.value,t=n.key,r=q(e);return r!=="string"?[new F(t,e,`string expected, ${r} found`)]:[]}function qg(n){var e;const t=(e=n.sourceName)!==null&&e!==void 0?e:"",r=n.value,i=n.styleSpec,s=i.source_raster_dem,o=n.style;let a=[];const l=q(r);if(r===void 0)return a;if(l!=="object")return a.push(new F("source_raster_dem",r,`object expected, ${l} found`)),a;const u=me(r.encoding)==="custom",d=["redFactor","greenFactor","blueFactor","baseShift"],h=n.value.encoding?`"${n.value.encoding}"`:"Default";for(const f in r)!u&&d.includes(f)?a.push(new F(f,r[f],`In "${t}": "${f}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):s[f]?a=a.concat(n.validateSpec({key:f,value:r[f],valueSpec:s[f],validateSpec:n.validateSpec,style:o,styleSpec:i})):a.push(new F(f,r[f],`unknown property "${f}"`));return a}const Jc={promoteId:Qg};function qc(n){const e=n.value,t=n.key,r=n.styleSpec,i=n.style,s=n.validateSpec;if(!e.type)return[new F(t,e,'"type" is required')];const o=me(e.type);let a;switch(o){case"vector":case"raster":return a=ut({key:t,value:e,valueSpec:r[`source_${o.replace("-","_")}`],style:n.style,styleSpec:r,objectElementValidators:Jc,validateSpec:s}),a;case"raster-dem":return a=qg({sourceName:t,value:e,style:n.style,styleSpec:r,validateSpec:s}),a;case"geojson":if(a=ut({key:t,value:e,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:s,objectElementValidators:Jc}),e.cluster)for(const l in e.clusterProperties){const[c,u]=e.clusterProperties[l],d=typeof c=="string"?[c,["accumulated"],["get",l]]:c;a.push(...hr({key:`${t}.${l}.map`,value:u,expressionContext:"cluster-map"})),a.push(...hr({key:`${t}.${l}.reduce`,value:d,expressionContext:"cluster-reduce"}))}return a;case"video":return ut({key:t,value:e,valueSpec:r.source_video,style:i,validateSpec:s,styleSpec:r});case"image":return ut({key:t,value:e,valueSpec:r.source_image,style:i,validateSpec:s,styleSpec:r});case"canvas":return[new F(t,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Qr({key:`${t}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Qg({key:n,value:e}){if(q(e)==="string")return zn({key:n,value:e});{const t=[];for(const r in e)t.push(...zn({key:`${n}.${r}`,value:e[r]}));return t}}function Qc(n){const e=n.value,t=n.styleSpec,r=t.light,i=n.style;let s=[];const o=q(e);if(e===void 0)return s;if(o!=="object")return s=s.concat([new F("light",e,`object expected, ${o} found`)]),s;for(const a in e){const l=a.match(/^(.*)-transition$/);l&&r[l[1]]&&r[l[1]].transition?s=s.concat(n.validateSpec({key:a,value:e[a],valueSpec:t.transition,validateSpec:n.validateSpec,style:i,styleSpec:t})):r[a]?s=s.concat(n.validateSpec({key:a,value:e[a],valueSpec:r[a],validateSpec:n.validateSpec,style:i,styleSpec:t})):s=s.concat([new F(a,e[a],`unknown property "${a}"`)])}return s}function eu(n){const e=n.value,t=n.styleSpec,r=t.sky,i=n.style,s=q(e);if(e===void 0)return[];if(s!=="object")return[new F("sky",e,`object expected, ${s} found`)];let o=[];for(const a in e)r[a]?o=o.concat(n.validateSpec({key:a,value:e[a],valueSpec:r[a],style:i,styleSpec:t})):o=o.concat([new F(a,e[a],`unknown property "${a}"`)]);return o}function tu(n){const e=n.value,t=n.styleSpec,r=t.terrain,i=n.style;let s=[];const o=q(e);if(e===void 0)return s;if(o!=="object")return s=s.concat([new F("terrain",e,`object expected, ${o} found`)]),s;for(const a in e)r[a]?s=s.concat(n.validateSpec({key:a,value:e[a],valueSpec:r[a],validateSpec:n.validateSpec,style:i,styleSpec:t})):s=s.concat([new F(a,e[a],`unknown property "${a}"`)]);return s}function em(n){return zn(n).length===0?[]:hr(n)}function tm(n){return zn(n).length===0?[]:hr(n)}function nm(n){const e=n.key,t=n.value;if(q(t)==="array"){if(t.length<1||t.length>4)return[new F(e,t,`padding requires 1 to 4 values; ${t.length} values found`)];const i={type:"number"};let s=[];for(let o=0;o<t.length;o++)s=s.concat(n.validateSpec({key:`${e}[${o}]`,value:t[o],validateSpec:n.validateSpec,valueSpec:i}));return s}else return As({key:e,value:t,valueSpec:{}})}function rm(n){const e=n.key,t=n.value;if(q(t)==="array"){const i={type:"number"};if(t.length<1)return[new F(e,t,"array length at least 1 expected, length 0 found")];let s=[];for(let o=0;o<t.length;o++)s=s.concat(n.validateSpec({key:`${e}[${o}]`,value:t[o],validateSpec:n.validateSpec,valueSpec:i}));return s}else return As({key:e,value:t,valueSpec:{}})}function im(n){const e=n.key,t=n.value;if(q(t)==="array"){if(t.length<1)return[new F(e,t,"array length at least 1 expected, length 0 found")];let i=[];for(let s=0;s<t.length;s++)i=i.concat(ua({key:`${e}[${s}]`,value:t[s]}));return i}else return ua({key:e,value:t})}function sm(n){const e=n.key,t=n.value,r=q(t),i=n.styleSpec;if(r!=="array"||t.length<1||t.length%2!==0)return[new F(e,t,"variableAnchorOffsetCollection requires a non-empty array of even length")];let s=[];for(let o=0;o<t.length;o+=2)s=s.concat(Qr({key:`${e}[${o}]`,value:t[o],valueSpec:i.layout_symbol["text-anchor"]})),s=s.concat(ca({key:`${e}[${o+1}]`,value:t[o+1],valueSpec:{length:2,value:"number"},validateSpec:n.validateSpec,style:n.style,styleSpec:i}));return s}function nu(n){let e=[];const t=n.value,r=n.key;if(Array.isArray(t)){const i=[],s=[];for(const o in t){t[o].id&&i.includes(t[o].id)&&e.push(new F(r,t,`all the sprites' ids must be unique, but ${t[o].id} is duplicated`)),i.push(t[o].id),t[o].url&&s.includes(t[o].url)&&e.push(new F(r,t,`all the sprites' URLs must be unique, but ${t[o].url} is duplicated`)),s.push(t[o].url);const a={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(ut({key:`${r}[${o}]`,value:t[o],valueSpec:a,validateSpec:n.validateSpec}))}return e}else return zn({key:r,value:t})}function om(n){const e=n.value,t=n.styleSpec,r=t.projection,i=n.style,s=q(e);if(e===void 0)return[];if(s!=="object")return[new F("projection",e,`object expected, ${s} found`)];let o=[];for(const a in e)r[a]?o=o.concat(n.validateSpec({key:a,value:e[a],valueSpec:r[a],style:i,styleSpec:t})):o=o.concat([new F(a,e[a],`unknown property "${a}"`)]);return o}function am(n){const e=n.key;let t=n.value;t=t instanceof String?t.valueOf():t;const r=q(t);return r==="array"&&!cm(t)&&!lm(t)?[new F(e,t,`projection expected, invalid array ${JSON.stringify(t)} found`)]:["array","string"].includes(r)?[]:[new F(e,t,`projection expected, invalid type "${r}" found`)]}function lm(n){return!!["interpolate","step","literal"].includes(n[0])}function cm(n){return Array.isArray(n)&&n.length===3&&typeof n[0]=="string"&&typeof n[1]=="string"&&typeof n[2]=="number"}function um(n){return!!n&&n.constructor===Object}function ru(n){return um(n.value)?[]:[new F(n.key,n.value,`object expected, ${q(n.value)} found`)]}const iu={"*"(){return[]},array:ca,boolean:Jg,number:As,color:ua,constants:Uc,enum:Qr,filter:da,function:Wc,layer:Kc,object:ut,source:qc,light:Qc,sky:eu,terrain:tu,projection:om,projectionDefinition:am,string:zn,formatted:em,resolvedImage:tm,padding:nm,numberArray:rm,colorArray:im,variableAnchorOffsetCollection:sm,sprite:nu,state:ru};function Ts(n){const e=n.value,t=n.valueSpec,r=n.styleSpec;return n.validateSpec=Ts,t.expression&&lr(me(e))?Wc(n):t.expression&&cr(Ln(e))?hr(n):t.type&&iu[t.type]?iu[t.type](n):ut(er({},n,{valueSpec:t.type?r[t.type]:t}))}function su(n){const e=n.value,t=n.key,r=zn(n);return r.length||(e.indexOf("{fontstack}")===-1&&r.push(new F(t,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&r.push(new F(t,e,'"glyphs" url must include a "{range}" token'))),r}function Ct(n,e=ke){let t=[];return t=t.concat(Ts({key:"",value:n,valueSpec:e.$root,styleSpec:e,style:n,validateSpec:Ts,objectElementValidators:{glyphs:su,"*"(){return[]}}})),n.constants&&(t=t.concat(Uc({key:"constants",value:n.constants}))),ou(t)}Ct.source=Tt(At(qc)),Ct.sprite=Tt(At(nu)),Ct.glyphs=Tt(At(su)),Ct.light=Tt(At(Qc)),Ct.sky=Tt(At(eu)),Ct.terrain=Tt(At(tu)),Ct.state=Tt(At(ru)),Ct.layer=Tt(At(Kc)),Ct.filter=Tt(At(da)),Ct.paintProperty=Tt(At(Yc)),Ct.layoutProperty=Tt(At(Hc));function At(n){return function(e){return n({...e,validateSpec:Ts})}}function ou(n){return[].concat(n).sort((e,t)=>e.line-t.line)}function Tt(n){return function(...e){return ou(n.apply(this,e))}}const dm=/("(?:[^\\"]|\\.)*")|[:,]/g;function hm(n,e={}){const t=JSON.stringify([1],void 0,e.indent===void 0?2:e.indent).slice(2,-3),r=t===""?1/0:e.maxLength===void 0?80:e.maxLength;let{replacer:i}=e;return function s(o,a,l){o&&typeof o.toJSON=="function"&&(o=o.toJSON());const c=JSON.stringify(o,i);if(c===void 0)return c;const u=r-a.length-l;if(c.length<=u){const d=c.replace(dm,(h,f)=>f||`${h} `);if(d.length<=u)return d}if(i!=null&&(o=JSON.parse(c),i=void 0),typeof o=="object"&&o!==null){const d=a+t,h=[];let f=0,p,g;if(Array.isArray(o)){p="[",g="]";const{length:m}=o;for(;f<m;f++)h.push(s(o[f],d,f===m-1?0:1)||"null")}else{p="{",g="}";const m=Object.keys(o),{length:x}=m;for(;f<x;f++){const w=m[f],b=`${JSON.stringify(w)}: `,T=s(o[w],d,b.length+(f===x-1?0:1));T!==void 0&&h.push(b+T)}}if(h.length>0)return[p,t+h.join(`, ${d}`),g].join(` ${a}`)}return c}(n,"",0)}function au(n,e){const t={};for(const r in e)n[r]!==void 0&&(t[r]=n[r]);for(const r in n)t[r]===void 0&&(t[r]=n[r]);return t}function Xv(n,e=2){return n=au(n,ke.$root),n.layers&&(n.layers=n.layers.map(t=>au(t,ke.layer))),hm(n,{indent:e})}function ha(n,e){for(const t in n)t.indexOf("layout")===0&&e(n[t],t)}function lu(n,e){for(const t in n)t.indexOf("paint")===0&&e(n[t],t)}function fa(n,e){return typeof e=="string"&&e[0]==="@"?fa(n,n.constants[e]):e}function fm(n){return Array.isArray(n.stops)}function ei(n,e,t){n[t]=n[e],delete n[e]}function pm(n){n.version=8,Vc(n,i=>{i.type==="video"&&i.url!==void 0&&ei(i,"url","urls"),i.type==="video"&&i.coordinates.forEach(s=>s.reverse())}),dr(n,i=>{ha(i,s=>{s["symbol-min-distance"]!==void 0&&ei(s,"symbol-min-distance","symbol-spacing")}),lu(i,s=>{s["background-image"]!==void 0&&ei(s,"background-image","background-pattern"),s["line-image"]!==void 0&&ei(s,"line-image","line-pattern"),s["fill-image"]!==void 0&&ei(s,"fill-image","fill-pattern")})}),Cs(n,{paint:!0,layout:!0},i=>{const s=fa(n,i.value);fm(s)&&s.stops.forEach(o=>{o[1]=fa(n,o[1])}),i.set(s)}),delete n.constants,dr(n,i=>{ha(i,s=>{delete s["text-max-size"],delete s["icon-max-size"]}),lu(i,s=>{s["text-size"]&&(i.layout||(i.layout={}),i.layout["text-size"]=s["text-size"],delete s["text-size"]),s["icon-size"]&&(i.layout||(i.layout={}),i.layout["icon-size"]=s["icon-size"],delete s["icon-size"])})});function e(i){function s(o){return o.split(",").map(a=>a.trim())}if(Array.isArray(i))return i;if(typeof i=="string")return s(i);if(typeof i=="object")return i.stops.forEach(o=>{o[1]=s(o[1])}),i;throw new Error("unexpected font value")}dr(n,i=>{ha(i,s=>{s["text-font"]&&(s["text-font"]=e(s["text-font"]))})});let t=0;for(let i=n.layers.length-1;i>=0;i--)if(n.layers[i].type!=="symbol"){t=i+1;break}const r=n.layers.splice(t);return r.reverse(),n.layers=n.layers.concat(r),n}function gm(n){const e=[];return dr(n,t=>{t.filter&&(t.filter=Ss(t.filter))}),Cs(n,{paint:!0,layout:!0},({path:t,value:r,reference:i,set:s})=>{cr(r)||(typeof r=="object"&&!Array.isArray(r)?(s(ra(r,i)),e.push(t.join("."))):i.tokens&&typeof r=="string"&&s($c(r)))}),n}function mm(n){return JSON.parse(ym(JSON.stringify(n)))}function ym(n){return n.replace(/"hsla?\((.+?)\)"/gi,(e,t)=>{const r=t.match(/^(.+?)\s*,\s*(.+?)\s*,\s*(.+?)(?:\s*,\s*(.+))?$/i);if(r){let[i,s,o,a]=r.slice(1);return[s,o]=[s,o].map(l=>l.endsWith("%")?l:`${parseFloat(l)*100}%`),`"hsl${typeof a=="string"?"a":""}(${[i,s,o,a].filter(Boolean).join(",")})"`}return e})}function Zv(n){let e=!1;if(n.version===7&&(n=pm(n),e=!0),n.version===8&&(e=!!gm(n),e=!0),Cs(n,{paint:!0,layout:!0},({value:t,reference:r,set:i})=>{r.type==="color"&&i(mm(t))}),!e)throw new Error(`Cannot migrate from ${n.version}`);return n}const vm=ke,Yv={StyleExpression:zc,StylePropertyFunction:ys,ZoomConstantExpression:ea,ZoomDependentExpression:ta,createExpression:gs,createPropertyExpression:ms,isExpression:cr,isExpressionFilter:Jr,isZoomExpression:zg,normalizePropertyExpression:Dg},Hv={convertFunction:ra,createFunction:Qo,isFunction:lr},Kv={eachLayer:dr,eachProperty:Cs,eachSource:Vc};var cu={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},ti=" ",uu=/(italic|oblique)$/i,du={};function pa(n,e,t){var r=du[n];if(!r){Array.isArray(n)||(n=[n]);for(var i=400,s="normal",o=[],a,l,c=0,u=n.length;c<u;++c){var d=n[c],h=d.split(" "),f=h[h.length-1].toLowerCase();f=="normal"||f=="italic"||f=="oblique"?(s=l?s:f,l=!0,h.pop(),f=h[h.length-1].toLowerCase()):uu.test(f)&&(f=f.replace(uu,""),s=l?s:h[h.length-1].replace(f,""),l=!0);for(var p in cu){var g=h.length>1?h[h.length-2].toLowerCase():"";if(f==p||f==p.replace("-","")||g+"-"+f==p){i=a?i:cu[p],h.pop(),g&&p.startsWith(g)&&h.pop();break}}!a&&typeof f=="number"&&(i=f,a=!0);var m=h.join(ti).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");m.indexOf(ti)!==-1&&(m='"'+m+'"'),o.push(m)}r=du[n]=[s,i,o]}return r[0]+ti+r[1]+ti+e+"px"+(t?"/"+t:"")+ti+r[2]}var Es=y(52653),xm=y(38774),hu=y(8143);class wm extends hu.A{constructor(e,t,r,i,s,o){super(e,t,o),this.extent=null,this.format_=i,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=r,this.key=r}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==ne.A.IDLE&&(this.setState(ne.A.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(ne.A.ERROR)}setFeatures(e){this.features_=e,this.setState(ne.A.LOADED)}setLoader(e){this.loader_=e}}const fu=wm,pu="https://api.mapbox.com";function ga(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function bm(n,e,t){if(typeof n=="string")return[{id:"default",url:gu(n,e,t)}];for(const r of n)r.url=gu(r.url,e,t);return n}function gu(n,e,t){const r=ga(n);if(!r)return decodeURI(new URL(n,t).href);const i="sprites/";if(r.indexOf(i)!==0)throw new Error(`unexpected sprites url: ${n}`);const s=r.slice(i.length);return`${pu}/styles/v1/${s}/sprite?access_token=${e}`}function _s(n,e){const t=ga(n);if(!t)return decodeURI(new URL(n,location.href).href);const r="styles/";if(t.indexOf(r)!==0)throw new Error(`unexpected style url: ${n}`);const i=t.slice(r.length);return`${pu}/styles/v1/${i}?&access_token=${e}`}const Sm=["a","b","c","d"];function Fs(n,e,t,r){const i=new URL(n,r||location.href),s=ga(n);if(!s)return e?(i.searchParams.has(t)||i.searchParams.set(t,e),[decodeURI(i.href)]):[decodeURI(i.href)];if(s==="mapbox.satellite"){const o=window.devicePixelRatio>=1.5?"@2x":"";return[`https://api.mapbox.com/v4/${s}/{z}/{x}/{y}${o}.webp?access_token=${e}`]}return Sm.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}const Et=Object.freeze({}),Is={},mu={};let Cm=0;function ma(n){return n.id||(n.id=Cm++),n.id}function Am(n,e){return ma(n)+"."+(0,W.v6)(e)}function yu(n){let e=Is[n.id];return e||(e={},Is[ma(n)]=e),e}function Jv(){for(const n in Is)delete Is[n]}function Tm(n){let e=mu[n.id];return e||(e={},mu[ma(n)]=e),e}function ya(n){return n*Math.PI/180}const Gt=function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n}();function Rs(n,e){if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(n,e);const t=document.createElement("canvas");return t.width=n,t.height=e,t}function va(n,e){let t=0;const r=e.length;for(;t<r;++t)if(e[t]<n&&t+1<r){const s=e[t]/e[t+1];return t+Math.log(e[t]/n)/Math.log(s)}return r-1}function ni(n,e){const t=Math.floor(n),r=Math.pow(2,n-t);return e[t]/r}const fr={};function pr(n,e,t={},r){if(e in fr)return r&&(r.url=fr[e][0].url),fr[e][1];const i=t.transformRequest&&t.transformRequest(e,n)||e,s=function(l){return delete fr[e],Promise.reject(new Error("Error fetching source "+e))},o=function(l){return delete fr[e],l.ok?l.json():Promise.reject(new Error("Error fetching source "+e))},a=(0,ln.hq)(()=>i).then(l=>l instanceof Response?(r&&(r.url=l.url),o(l)):(l instanceof Request||(l=new Request(l)),l.headers.get("Accept")||l.headers.set("Accept","application/json"),r&&(r.url=l.url),fetch(l).then(o).catch(s))).catch(s);return fr[e]=[i,a],a}function xa(n,e){if(typeof n=="string")if(n.trim().startsWith("{"))try{const t=JSON.parse(n);return Promise.resolve(t)}catch(t){return Promise.reject(t)}else return n=_s(n,e.accessToken),pr("Style",n,e);else return Promise.resolve(n)}const vu={};function xu(n,e,t={}){const r=[e,JSON.stringify(n)].toString();let i=vu[r];if(!i||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof fu)a.setLoader((u,d,h)=>{const f=function(p){p.arrayBuffer().then(g=>{const x=a.getFormat().readFeatures(g,{extent:u,featureProjection:h});a.setFeatures(x)})};(0,ln.hq)(()=>c).then(p=>{if(p instanceof Response)return f(p);fetch(p).then(f).catch(g=>a.setState(ne.A.ERROR))}).catch(p=>a.setState(ne.A.ERROR))});else{const u=a.getImage();(0,ln.hq)(()=>c).then(d=>{if(typeof d=="string"){u.src=d;return}const h=f=>f.blob().then(p=>{const g=URL.createObjectURL(p);u.addEventListener("load",()=>URL.revokeObjectURL(g)),u.addEventListener("error",()=>URL.revokeObjectURL(g)),u.src=g});if(d instanceof Response)return h(d);fetch(d).then(h).catch(f=>a.setState(ne.A.ERROR))}).catch(d=>a.setState(ne.A.ERROR))}});const o=n.url;if(o&&!n.tiles){const a=Fs(o,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(o.startsWith("mapbox://"))i=Promise.resolve({tileJson:Object.assign({},n,{url:void 0,tiles:a}),tileLoadFunction:s});else{const l={};i=pr("Source",a[0],t,l).then(function(c){return c.tiles=c.tiles.map(function(u){return c.scheme==="tms"&&(u=u.replace("{y}","{-y}")),Fs(u,t.accessToken,t.accessTokenParam||"access_token",l.url)[0]}),Promise.resolve({tileJson:c,tileLoadFunction:s})})}}else n.tiles?(n=Object.assign({},n,{tiles:n.tiles.map(function(a){return n.scheme==="tms"&&(a=a.replace("{y}","{-y}")),Fs(a,t.accessToken,t.accessTokenParam||"access_token",e||location.href)[0]})}),i=Promise.resolve({tileJson:Object.assign({},n),tileLoadFunction:s})):i=Promise.reject(new Error("source has no `tiles` nor `url`"));vu[r]=i}return i}function wu(n,e,t,r){const i=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=Rs(i[0],i[1]),o=s.getContext("2d");o.drawImage(n,e.x,e.y,e.width,e.height,t*e.pixelRatio,t*e.pixelRatio,e.width,e.height);const a=o.getImageData(0,0,i[0],i[1]);o.globalCompositeOperation="destination-over",o.fillStyle=`rgba(${r.r*255},${r.g*255},${r.b*255},${r.a})`;const l=a.data;for(let c=0,u=a.width;c<u;++c)for(let d=0,h=a.height;d<h;++d){const f=(d*u+c)*4;l[f+3]>0&&o.arc(c,d,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function Em(n,e,t){const r=Math.max(0,Math.min(1,(t-n)/(e-n)));return r*r*(3-2*r)}function bu(n,e,t){const r=Rs(e.width,e.height),i=r.getContext("2d");i.drawImage(n,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),o=s.data;for(let a=0,l=s.width;a<l;++a)for(let c=0,u=s.height;c<u;++c){const d=(c*l+a)*4,h=o[d+3]/255,f=.75,p=.1,g=Em(f-p,f+p,h);g>0?(o[d+0]=Math.round(255*t.r*g),o[d+1]=Math.round(255*t.g*g),o[d+2]=Math.round(255*t.b*g),o[d+3]=Math.round(255*g)):o[d+3]=0}return i.putImageData(s,0,0),r}const _m=Array(256).join("\u200A");function wa(n,e){if(e>=.05){let t="";const r=n.split(` `),i=_m.slice(0,Math.round(e/.1));for(let s=0,o=r.length;s<o;++s)s>0&&(t+=` `),t+=r[s].split("").join(i);return t}return n}let ba;function Su(){return ba||(ba=Rs(1,1).getContext("2d")),ba}function Dn(n,e){return Su().measureText(n).width+(n.length-1)*e}const Ps={};xm.yY.on("propertychange",()=>{for(const n in Ps)delete Ps[n]});function Sa(n,e,t,r){if(n.indexOf(` `)!==-1){const o=n.split(` `),a=[];for(let l=0,c=o.length;l<c;++l)a.push(Sa(o[l],e,t,r));return a.join(` `)}const i=t+","+e+","+n+","+r;let s=Ps[i];if(!s){const o=n.split(" ");if(o.length>1){const a=Su();a.font=e;const c=a.measureText("M").width*t;let u="";const d=[];for(let h=0,f=o.length;h<f;++h){const p=o[h],g=u+(u?" ":"")+p;Dn(g,r)<=c?u=g:(u&&d.push(u),u=p)}u&&d.push(u);for(let h=0,f=d.length;h<f&&f>1;++h){const p=d[h];if(Dn(p,r)<c*.35){const g=h>0?Dn(d[h-1],r):1/0,m=h<f-1?Dn(d[h+1],r):1/0;d.splice(h,1),f-=1,g<m?(d[h-1]+=" "+p,h-=1):d[h]=p+" "+d[h]}}for(let h=0,f=d.length-1;h<f;++h){const p=d[h],g=d[h+1];if(Dn(p,r)>c*.7&&Dn(g,r)<c*.6){const m=p.split(" "),x=m.pop();Dn(x,r)<c*.2&&(d[h]=m.join(" "),d[h+1]=x+" "+g),f-=1}}s=d.join(` `)}else s=n;s=wa(s,r),Ps[i]=s}return s}const Fm=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],Cu={};function Im(n,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){let t;for(let r=0,i=n.length;r<i;++r){const s=n[r];if(s in Cu)continue;Cu[s]=!0;const a=pa(s,16).split(" ");t||(t=[]),t.push([a.slice(3).join(" ").replace(/"/g,""),a[1],a[0]])}return t&&(async()=>{await document.fonts.ready;for(let r=0,i=t.length;r<i;++r){const s=t[r],o=s[0];if(Fm.includes(o))continue;const a=s[1],l=s[2];if(!(await document.fonts.load(`${l} ${a} 16px "${o}"`)).some(u=>u.family.replace(/^['"]|['"]$/g,"").toLowerCase()===o.toLowerCase()&&u.weight==a&&u.style===l)){const u=e.replace("{font-family}",o.replace(/ /g,"-").toLowerCase()).replace("{Font+Family}",o.replace(/ /g,"+")).replace("{fontweight}",a).replace("{-fontstyle}",l.replace("normal","").replace(/(.+)/,"-$1")).replace("{fontstyle}",l);if(!document.querySelector('link[href="'+u+'"]')){const d=document.createElement("link");d.href=u,d.rel="stylesheet",document.head.appendChild(d)}}}})(),n}const Rm={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Pm={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},km=function(n,e){const t=ms(n,e);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return t.value},tt={zoom:0,distanceFromCenter:0};et.register(us,{...et.definitions,pitch:[{kind:"number"},[],n=>tt.pitch||90],"distance-from-center":[{kind:"number"},[],n=>tt.distanceFromCenter||0]});let ks,Ca;function N(n,e,t,r,i,s){const o=n.id;i||(i={},console.warn("No functionCache provided to getValue()")),i[o]||(i[o]={});const a=i[o];if(!a[t]){let l=(n[e]||Et)[t];const c=vm[`${e}_${n.type}`][t];l===void 0&&(l=c.default);let u=cr(l);if(!u&&lr(l)&&(l=ra(l,c),u=!0),u){const d=km(l,c);a[t]=d.evaluate.bind(d)}else c.type=="color"&&(l=ee.parse(l)),a[t]=function(){return l}}return a[t](tt,r,s)}function Au(n,e,t,r){return N(n,"layout",`${t}-allow-overlap`,e,r)?N(n,"layout",`${t}-ignore-placement`,e,r)?"none":"obstacle":"declutter"}function Mm(n,e,t,r){if(r||console.warn("No filterCache provided to evaluateFilter()"),!(n in r))try{r[n]=Gg(e).filter}catch(i){console.warn("Filter will evaluate to false: "+i.message),r[n]=function(){return!1}}return r[n](tt,t)}let Aa=!1;function qv(n){n!==Aa&&(clearFunctionCache(),Aa=n)}function yn(n,e){if(n){if(!Aa&&(n.a===0||e===0))return;const t=n.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(n.r*255/t)+","+Math.round(n.g*255/t)+","+Math.round(n.b*255/t)+","+t*e+")"}return n}const Lm=/\{[^{}}]*\}/g;function Ta(n,e){return n.replace(Lm,function(t){return e[t.slice(1,-1)]||""})}function Tu(n,e){let t=n.split(":")[0];return t===n&&(t="default"),e[t]}let Eu=!1;function Qv(n=!1){Eu=n}const zm={};function Dm(n,e,t,r=Gt,i=void 0,s=void 0,o=void 0,a=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");zm[Am(e,n)]=Array.from(arguments);const l={};(typeof s=="string"||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const S in s){const A=s[S];(0,ln.hq)(()=>A).then(async C=>{let R;if(typeof Image<"u"){const j=new Image;if(typeof C=="string")j.crossOrigin="anonymous",j.src=C;else{let B;C instanceof Request?B=await fetch(C):C instanceof Response&&(B=C);const P=await B.blob();R=URL.createObjectURL(P),j.src=R}j.addEventListener("load",function B(){j.removeEventListener("load",B),l[S]={image:j,size:[j.width,j.height]},n.changed(),R&&URL.revokeObjectURL(R)}),j.addEventListener("error",function B(){URL.revokeObjectURL(R),j.removeEventListener("error",B)})}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const j=self;j.postMessage({action:"loadImage",src:C}),j.addEventListener("message",function(P){P.data.action==="imageLoaded"&&P.data.src===C&&(l[S]={image:P.data.image,size:[P.data.image.width,P.data.image.height]})})}})}const c=Hl(e.layers),u={},d=[],h={},f={},p=yu(e),g=Tm(e);let m;for(let S=0,A=c.length;S<A;++S){const C=c[S],R=C.id;if(typeof t=="string"&&C.source==t||Array.isArray(t)&&t.indexOf(R)!==-1){const j=C["source-layer"];if(m){if(C.source!==m)throw new Error(`Layer "${R}" does not use source "${m}`)}else{m=C.source;const P=e.sources[m];if(!P)throw new Error(`Source "${m}" is not defined`);const G=P.type;if(G!=="vector"&&G!=="geojson")throw new Error(`Source "${m}" is not of type "vector" or "geojson", but "${G}"`)}let B=u[j];B||(B=[],u[j]=B),B.push({layer:C,index:S}),d.push(R)}}const x=new oe.A,w=new ae.A,b=[],T=function(S,A,C){const R=n.getSource?.()?.format_?.layerName_??"mvt:layer",j=S.getProperties(),B=u[j[R]];if(!B)return;let P=r.indexOf(A);P==-1&&(P=va(A,r)),tt.zoom=P,tt.distanceFromCenter=0;const G=S.getGeometry(),$=Rm[G.getType()],Z=n.get("map");if(Z&&Z instanceof Es.A&&$===1){const Ae=Z.getSize();if(Ae){const be=Z.getView().getCenter(),Q=(0,M.q1)(G.getExtent());tt.distanceFromCenter=(0,fe.Io)(be,Q)/A/Ae[1]}}const I={id:S.getId(),properties:j,type:$},k=n.get("mapbox-featurestate")[S.getId()];let V=-1,we;for(let Ae=0,be=B.length;Ae<be;++Ae){const Q=B[Ae],z=Q.layer,_t=z.id;if(C!==void 0&&C!==_t)continue;const xn=z.layout||Et,nn=z.paint||Et;if(xn.visibility==="none"||"minzoom"in z&&P<z.minzoom||"maxzoom"in z&&P>=z.maxzoom)continue;const ui=z.filter;if(!ui||Mm(_t,ui,I,g)){we=z;let Le,Ne,Vn,Vt,rn,O;const Ar=Q.index;if($==3&&(z.type=="fill"||z.type=="fill-extrusion"))if(Ne=N(z,"paint",z.type+"-opacity",I,p,k),z.type+"-pattern"in nn){const ge=N(z,"paint",z.type+"-pattern",I,p,k);if(ge){const he=typeof ge=="string"?Ta(ge,j):ge.toString(),ce=Tu(he,l);if(i&&i[he]&&ce){++V,O=b[V],(!O||!O.getFill()||O.getStroke()||O.getText())&&(O=new X.Ay({fill:new ae.A}),b[V]=O),Vn=O.getFill(),O.setZIndex(Ar);const le=he+"."+Ne;let Te=f[le];if(!Te){const te=i[he],se=Rs(te.width,te.height),Ie=se.getContext("2d");Ie.globalAlpha=Ne,Ie.drawImage(ce.image,te.x,te.y,te.width,te.height,0,0,te.width,te.height),Te=Ie.createPattern(se,"repeat"),f[le]=Te}Vn.setColor(Te)}}}else Le=yn(N(z,"paint",z.type+"-color",I,p,k),Ne),z.type+"-outline-color"in nn&&(rn=yn(N(z,"paint",z.type+"-outline-color",I,p,k),Ne)),rn||(rn=Le),(Le||rn)&&(++V,O=b[V],(!O||Le&&!O.getFill()||!Le&&O.getFill()||rn&&!O.getStroke()||!rn&&O.getStroke()||O.getText())&&(O=new X.Ay({fill:Le?new ae.A:void 0,stroke:rn?new oe.A:void 0}),b[V]=O),Le&&(Vn=O.getFill(),Vn.setColor(Le)),rn&&(Vt=O.getStroke(),Vt.setColor(rn),Vt.setWidth(.5)),O.setZIndex(Ar));if($!=1&&z.type=="line"){"line-pattern"in nn?Le=void 0:Le=yn(N(z,"paint","line-color",I,p,k),N(z,"paint","line-opacity",I,p,k));const ge=N(z,"paint","line-width",I,p,k);Le&&ge>0&&(++V,O=b[V],(!O||!O.getStroke()||O.getFill()||O.getText())&&(O=new X.Ay({stroke:new oe.A}),b[V]=O),Vt=O.getStroke(),Vt.setLineCap(N(z,"layout","line-cap",I,p,k)),Vt.setLineJoin(N(z,"layout","line-join",I,p,k)),Vt.setMiterLimit(N(z,"layout","line-miter-limit",I,p,k)),Vt.setColor(Le),Vt.setWidth(ge),Vt.setLineDash(nn["line-dasharray"]?N(z,"paint","line-dasharray",I,p,k).map(function(he){return he*ge}):null),O.setZIndex(Ar))}let Zs=!1,ie=null,Bd=0,Tr,Ze,qa;if(($==1||$==2)&&"icon-image"in xn){const ge=N(z,"layout","icon-image",I,p,k);if(ge){Tr=typeof ge=="string"?Ta(ge,j):ge.toString();let he;const ce=a?a(n,Tr):void 0,le=Tu(Tr,l);if(i&&i[Tr]&&le||ce){const Te=N(z,"layout","icon-rotation-alignment",I,p,k);if($==2){const te=S.getGeometry();if(te.getFlatMidpoint||te.getFlatMidpoints){const se=te.getExtent();if(Math.sqrt(Math.max(Math.pow((se[2]-se[0])/A,2),Math.pow((se[3]-se[1])/A,2)))>150){const De=te.getType()==="MultiLineString"?te.getFlatMidpoints():te.getFlatMidpoint();if(Ca||(ks=[NaN,NaN],Ca=new Mt.Ay("Point",ks,[],2,{},void 0)),he=Ca,ks[0]=De[0],ks[1]=De[1],N(z,"layout","symbol-placement",I,p,k)==="line"&&Te==="map"){const Ft=te.getStride(),Ye=te.getFlatCoordinates();for(let rt=0,ye=Ye.length-Ft;rt<ye;rt+=Ft){const Ge=Ye[rt],pt=Ye[rt+1],ve=Ye[rt+Ft],bn=Ye[rt+Ft+1],Iv=Math.min(Ge,ve),Rv=Math.max(Ge,ve),el=De[0],Pv=De[1],kv=(bn-pt)*(el-Ge)-(ve-Ge)*(Pv-pt);if(Math.abs(kv)<.001&&el<=Rv&&el>=Iv){Bd=Math.atan2(pt-bn,ve-Ge);break}}}}}}if($!==2||he){const te=N(z,"layout","icon-size",I,p,k),se=nn["icon-color"]!==void 0?N(z,"paint","icon-color",I,p,k):null;if(!se||se.a!==0){const Ie=N(z,"paint","icon-halo-color",I,p,k),De=N(z,"paint","icon-halo-width",I,p,k);let Ut=`${Tr}.${te}.${De}.${Ie}`;if(se!==null&&(Ut+=`.${se}`),Ze=h[Ut],!Ze){const Ft=Au(z,I,"icon",p);let Ye;"icon-offset"in xn&&(Ye=N(z,"layout","icon-offset",I,p,k).slice(0),Ye[0]*=te,Ye[1]*=-te);let rt=se?[se.r*255,se.g*255,se.b*255,se.a]:void 0;if(ce){const ye={color:rt,rotateWithView:Te==="map",displacement:Ye,declutterMode:Ft,scale:te};typeof ce=="string"?ye.src=ce:(ye.img=ce,ye.imgSize=[ce.width,ce.height]),Ze=new Pi.A(ye)}else{const ye=i[Tr];let Ge,pt,ve;if(De)ye.sdf?(Ge=wu(bu(le.image,ye,se||[0,0,0,1]),{x:0,y:0,width:ye.width,height:ye.height,pixelRatio:ye.pixelRatio},De,Ie),rt=void 0):Ge=wu(le.image,ye,De,Ie);else{if(ye.sdf&&!le.unSDFed){const bn=bu(le.image,{x:0,y:0,width:le.size[0],height:le.size[1]},{r:1,g:1,b:1,a:1});le.image=bn,le.unSDFed=!0}Ge=le.image,pt=[ye.width,ye.height],ve=[ye.x,ye.y]}Ze=new Pi.A({color:rt,img:Ge,imgSize:le.size,size:pt,offset:ve,rotateWithView:Te==="map",scale:te/ye.pixelRatio,displacement:Ye,declutterMode:Ft})}h[Ut]=Ze}}Ze&&(++V,O=b[V],(!O||!O.getImage()||O.getFill()||O.getStroke())&&(O=new X.Ay,b[V]=O),O.setGeometry(he),Ze.setRotation(Bd+ya(N(z,"layout","icon-rotate",I,p,k))),Ze.setOpacity(N(z,"paint","icon-opacity",I,p,k)),Ze.setAnchor(Pm[N(z,"layout","icon-anchor",I,p,k)]),O.setImage(Ze),ie=O.getText(),O.setText(void 0),O.setZIndex(Ar),Zs=!0,qa=!1)}else qa=!0}}}if($==1&&z.type==="circle"){++V,O=b[V],(!O||!O.getImage()||O.getFill()||O.getStroke())&&(O=new X.Ay,b[V]=O);const ge="circle-radius"in nn?N(z,"paint","circle-radius",I,p,k):5,he=yn(N(z,"paint","circle-stroke-color",I,p,k),N(z,"paint","circle-stroke-opacity",I,p,k)),ce=N(z,"paint","circle-translate",I,p,k),le=yn(N(z,"paint","circle-color",I,p,k),N(z,"paint","circle-opacity",I,p,k)),Te=N(z,"paint","circle-stroke-width",I,p,k),te=ge+"."+he+"."+le+"."+Te+"."+ce[0]+"."+ce[1];Ze=h[te],Ze||(Ze=new Ht.A({radius:ge,displacement:[ce[0],-ce[1]],stroke:he&&Te>0?new oe.A({width:Te,color:he}):void 0,fill:le?new ae.A({color:le}):void 0,declutterMode:"none"}),h[te]=Ze),O.setImage(Ze),ie=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(Ar),Zs=!0}let ze,di,hi,wn,fi,Qa;if("text-field"in xn){wn=Math.round(N(z,"layout","text-size",I,p,k));const ge=N(z,"layout","text-font",I,p,k);hi=N(z,"layout","text-line-height",I,p,k),di=pa(o?o(ge,e.metadata?e.metadata["ol:webfonts"]:void 0):ge,wn,hi),di.includes("sans-serif")||(di+=",sans-serif"),fi=N(z,"layout","text-letter-spacing",I,p,k),Qa=N(z,"layout","text-max-width",I,p,k);const he=N(z,"layout","text-field",I,p,k);typeof he=="object"&&he.sections?he.sections.length===1?ze=he.toString():ze=he.sections.reduce((ce,le,Te)=>{const te=le.fontStack?le.fontStack.split(","):ge,se=pa(o?o(te):te,wn*(le.scale||1),hi);let Ie=le.text;if(Ie===` `)return ce.push(` `,""),ce;if($==2)return ce.push(wa(Ie,fi),se),ce;Ie=Sa(Ie,se,Qa,fi).split(` `);for(let De=0,Ut=Ie.length;De<Ut;++De)De>0&&ce.push(` `,""),ce.push(Ie[De],se);return ce},[]):ze=Ta(he,j).trim(),Ne=N(z,"paint","text-opacity",I,p,k)}if(ze&&Ne&&!qa){Zs||(++V,O=b[V],(!O||!O.getText()||O.getFill()||O.getStroke())&&(O=new X.Ay,b[V]=O),O.setImage(void 0),O.setGeometry(void 0));const ge=Au(z,I,"text",p);O.getText()||O.setText(ie),ie=O.getText(),(!ie||"getDeclutterMode"in ie&&ie.getDeclutterMode()!==ge)&&(ie=new En.A({padding:[2,2,2,2],declutterMode:ge}),O.setText(ie));const he=N(z,"layout","text-transform",I,p,k);he=="uppercase"?ze=Array.isArray(ze)?ze.map((ve,bn)=>bn%2?ve:ve.toUpperCase()):ze.toUpperCase():he=="lowercase"&&(ze=Array.isArray(ze)?ze.map((ve,bn)=>bn%2?ve:ve.toLowerCase()):ze.toLowerCase());const ce=Array.isArray(ze)?ze:$==2?wa(ze,fi):Sa(ze,di,Qa,fi);if(ie.setText(ce),ie.setFont(di),ie.setRotation(ya(N(z,"layout","text-rotate",I,p,k))),typeof ie.setKeepUpright=="function"){const ve=N(z,"layout","text-keep-upright",I,p,k);ie.setKeepUpright(ve)}const le=N(z,"layout","text-anchor",I,p,k),Te=Zs||$==1?"point":N(z,"layout","symbol-placement",I,p,k);let te;if(Te==="line-center"?(ie.setPlacement("line"),te="center"):ie.setPlacement(Te),Te==="line"&&typeof ie.setRepeat=="function"){const ve=N(z,"layout","symbol-spacing",I,p,k);ie.setRepeat(ve*2)}ie.setOverflow(Te==="point");let se=N(z,"paint","text-halo-width",I,p,k);const Ie=N(z,"layout","text-offset",I,p,k),De=N(z,"paint","text-translate",I,p,k);let Ut=0,Ft=0;if(Te=="point"){te="center",le.indexOf("left")!==-1?(te="left",Ft=se):le.indexOf("right")!==-1&&(te="right",Ft=-se);const ve=N(z,"layout","text-rotation-alignment",I,p,k);ie.setRotateWithView(ve=="map")}else ie.setMaxAngle(ya(N(z,"layout","text-max-angle",I,p,k))*ze.length/ce.length),ie.setRotateWithView(!1);ie.setTextAlign(te);let Ye="middle";le.indexOf("bottom")==0?(Ye="bottom",Ut=-se-.5*(hi-1)*wn):le.indexOf("top")==0&&(Ye="top",Ut=se+.5*(hi-1)*wn),ie.setTextBaseline(Ye);const rt=N(z,"layout","text-justify",I,p,k);ie.setJustify(rt==="auto"?void 0:rt),ie.setOffsetX(Ie[0]*wn+Ft+De[0]),ie.setOffsetY(Ie[1]*wn+Ut+De[1]),w.setColor(yn(N(z,"paint","text-color",I,p,k),Ne)),ie.setFill(w);const ye=yn(N(z,"paint","text-halo-color",I,p,k),Ne);if(ye&&se>0){x.setColor(ye),se*=2;const ve=.5*wn;x.setWidth(se<=ve?se:ve),ie.setStroke(x)}else ie.setStroke(void 0);const Ge=N(z,"layout","text-padding",I,p,k),pt=ie.getPadding();Ge!==pt[0]&&(pt[0]=Ge,pt[1]=Ge,pt[2]=Ge,pt[3]=Ge),O.setZIndex(Ar)}}}if(V>-1)return b.length=V+1,Eu&&("set"in S?S.set("mapbox-layer",we):S.getProperties()["mapbox-layer"]=we),b};return n.setStyle(T),n.set("mapbox-layers",d),n.set("mapbox-source",m),n.set("mapbox-featurestate",n.get("mapbox-featurestate")||{}),T}function ex(n,e,t,r){const i=t.getStyleFunction();if(i.length===3)return i(n,e,r)}var Ms=y(11365);const Ea=65536*65536,_u=1/Ea,jm=12,Fu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),_a=0,Ls=1,ri=2,zs=5;class Om{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,r=this.length){for(;this.pos<r;){const i=this.readVarint(),s=i>>3,o=this.pos;this.type=i&7,e(s,t,this),this.pos===o&&this.skip(i)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Ea;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Ea;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let r,i;return i=t[this.pos++],r=i&127,i<128||(i=t[this.pos++],r|=(i&127)<<7,i<128)||(i=t[this.pos++],r|=(i&127)<<14,i<128)||(i=t[this.pos++],r|=(i&127)<<21,i<128)?r:(i=t[this.pos],r|=(i&15)<<28,Nm(r,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=jm&&Fu?Fu.decode(this.buf.subarray(t,e)):qm(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===ri?this.readVarint()+this.pos:this.pos+1}skip(e){const t=e&7;if(t===_a)for(;this.buf[this.pos++]>127;);else if(t===ri)this.pos=this.readVarint()+this.pos;else if(t===zs)this.pos+=4;else if(t===Ls)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*_u),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*_u),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Gm(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const t=this.pos;this.pos=Qm(this.buf,e,this.pos);const r=this.pos-t;r>=128&&Iu(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let r=0;r<t;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,t){this.pos++;const r=this.pos;e(t,this);const i=this.pos-r;i>=128&&Iu(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,t,r){this.writeTag(e,ri),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Vm,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Um,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Zm,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Wm,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Xm,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,Ym,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Hm,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Km,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Jm,t)}writeBytesField(e,t){this.writeTag(e,ri),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,zs),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,zs),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Ls),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Ls),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,_a),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,_a),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,ri),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,zs),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Ls),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function Nm(n,e,t){const r=t.buf;let i,s;if(s=r[t.pos++],i=(s&112)>>4,s<128||(s=r[t.pos++],i|=(s&127)<<3,s<128)||(s=r[t.pos++],i|=(s&127)<<10,s<128)||(s=r[t.pos++],i|=(s&127)<<17,s<128)||(s=r[t.pos++],i|=(s&127)<<24,s<128)||(s=r[t.pos++],i|=(s&1)<<31,s<128))return gr(n,i,e);throw new Error("Expected varint not more than 10 bytes")}function gr(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function Gm(n,e){let t,r;if(n>=0?(t=n%4294967296|0,r=n/4294967296|0):(t=~(-n%4294967296),r=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,r=r+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Bm(t,r,e),$m(r,e)}function Bm(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function $m(n,e){const t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function Iu(n,e,t){const r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(r);for(let i=t.pos-1;i>=n;i--)t.buf[i+r]=t.buf[i]}function Vm(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t])}function Um(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t])}function Wm(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t])}function Xm(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t])}function Zm(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t])}function Ym(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t])}function Hm(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t])}function Km(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t])}function Jm(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t])}function qm(n,e,t){let r="",i=e;for(;i<t;){const s=n[i];let o=null,a=s>239?4:s>223?3:s>191?2:1;if(i+a>t)break;let l,c,u;a===1?s<128&&(o=s):a===2?(l=n[i+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=n[i+1],c=n[i+2],(l&192)===128&&(c&192)===128&&(o=(s&15)<<12|(l&63)<<6|c&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=n[i+1],c=n[i+2],u=n[i+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(o=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),i+=a}return r}function Qm(n,e,t){for(let r=0,i,s;r<e.length;r++){if(i=e.charCodeAt(r),i>55295&&i<57344)if(s)if(i<56320){n[t++]=239,n[t++]=191,n[t++]=189,s=i;continue}else i=s-55296<<10|i-56320|65536,s=null;else{i>56319||r+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):s=i;continue}else s&&(n[t++]=239,n[t++]=191,n[t++]=189,s=null);i<128?n[t++]=i:(i<2048?n[t++]=i>>6|192:(i<65536?n[t++]=i>>12|224:(n[t++]=i>>18|240,n[t++]=i>>12&63|128),n[t++]=i>>6&63|128),n[t++]=i&63|128)}return t}var Ru=y(83402),ey=y(95286),Pu=y(98217);class ty extends Pu.Ay{constructor(e){super(),e=e||{},this.dataProjection=new ey.A({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:Mt.Ay,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,r,i){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,l=0,c=0,u=0,d=0;for(;e.pos<s;){if(!a){const h=e.readVarint();o=h&7,a=h>>3}if(a--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&u>d&&(i.push(u),d=u),r.push(l,c),u+=2;else if(o===7)u>d&&(r.push(r[d],r[d+1]),u+=2);else throw new Error("Invalid command found in the PBF")}u>d&&(i.push(u),d=u)}createFeature_(e,t,r){const i=t.type;if(i===0)return null;let s;const o=t.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=t.id,o[this.layerName_]=t.layer.name;const l=[],c=[];this.readRawGeometry_(e,t,l,c);const u=oy(i,c.length);if(this.featureClass===Mt.Ay)s=new this.featureClass(u,l,c,2,o,a),s.transform(r.dataProjection);else{let d;if(u=="Polygon"){const p=(0,Ru.yJ)(l,c);d=p.length>1?new Tn.A(l,"XY",p):new gt.Ay(l,"XY",c)}else d=u==="Point"?new Ue.A(l,"XY"):u==="LineString"?new je.A(l,"XY"):u==="MultiPoint"?new gl.A(l,"XY"):u==="MultiLineString"?new Rr.A(l,"XY",c):null;const h=this.featureClass;s=new h,this.geometryName_&&s.setGeometryName(this.geometryName_);const f=(0,Pu.hX)(d,!1,r);s.setGeometry(f),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return"arraybuffer"}readFeatures(e,t){const r=this.layers_;t=this.adaptOptions(t);const i=(0,D.Jt)(t.dataProjection);i.setWorldExtent(t.extent),t.dataProjection=i;const s=new Om(e),o=s.readFields(ny,{}),a=[];for(const l in o){if(r&&!r.includes(l))continue;const c=o[l],u=c?[0,0,c.extent,c.extent]:null;i.setExtent(u);for(let d=0,h=c.length;d<h;++d){const f=sy(s,c,d),p=this.createFeature_(s,f,t);p!==null&&a.push(p)}}return a}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function ny(n,e,t){if(n===3){const r={keys:[],values:[],features:[]},i=t.readVarint()+t.pos;t.readFields(ry,r,i),r.length=r.features.length,r.length&&(e[r.name]=r)}}function ry(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){let r=null;const i=t.readVarint()+t.pos;for(;t.pos<i;)n=t.readVarint()>>3,r=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(r)}}function iy(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const r=t.readVarint()+t.pos;for(;t.pos<r;){const i=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[i]=s}}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function sy(n,e,t){n.pos=e.features[t];const r=n.readVarint()+n.pos,i={layer:e,type:0,properties:{}};return n.readFields(iy,i,r),i}function oy(n,e){let t;return n===1?t=e===1?"Point":"MultiPoint":n===2?t=e===1?"LineString":"MultiLineString":n===3&&(t="Polygon"),t}const Fa=ty;var ku=y(44181),Mu=y(60764),vn=y(62703),ay=y(70136),Ia=y(27343),ly=y(40808),ii=y(77727),ue=y(9703),Ra=y(73608),cy=y(24029);const uy={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},Lu={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class dy extends cy.A{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=(0,ue.vt)(),this.tileClipContexts_=null}drawTile(e,t,r,i,s,o,a,l){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,r,i,s,o,a,l)}getTile(e,t,r,i){const s=this.getOrCreateTile(e,t,r,i);if(!s)return null;const a=i.viewState.resolution,l=i.viewHints;return(!(l[vn.A.ANIMATING]||l[vn.A.INTERACTING])||!s.wantedResolution)&&(s.wantedResolution=a),s}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,r){const i=this.getLayer(),s=i.getRevision(),o=i.getRenderOrder()||null,a=e.wantedResolution,l=e.getReplayState(i);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==o)return;const c=i.getSource(),u=!!i.getDeclutter(),d=c.getTileGrid(),f=c.getTileGridForProjection(r).getTileCoordExtent(e.wrappedTileCoord),p=c.getSourceTiles(t,r,e),g=(0,W.v6)(i);delete e.hitDetectionImageData[g],e.executorGroups[g]=[],l.dirty=!1;for(let m=0,x=p.length;m<x;++m){const w=p[m];if(w.getState()!=ne.A.LOADED)continue;const b=w.tileCoord,T=d.getTileCoordExtent(b),S=(0,M._N)(f,T),A=(0,M.r)(S,i.getRenderBuffer()*a,this.tempExtent),C=(0,M.aI)(T,S)?null:A,R=new ay.A(0,S,a,t),j=(0,Ra.j)(a,t),B=function(I,k){let V;const we=I.getStyleFunction()||i.getStyleFunction();if(we&&(V=we(I,a)),V){const Ae=this.renderFeature(I,j,V,R,u,k);l.dirty=l.dirty||Ae}},P=w.getFeatures();o&&o!==l.renderedRenderOrder&&P.sort(o);for(let I=0,k=P.length;I<k;++I){const V=P[I];(!C||(0,M.HY)(C,V.getGeometry().getExtent()))&&B.call(this,V,I)}const G=R.finish(),$=i.getRenderMode()!=="vector"&&u&&p.length===1?null:S,Z=new Ia.Ay($,a,t,c.getOverlaps(),G,i.getRenderBuffer(),!0);e.executorGroups[g].push(Z)}l.renderedRevision=s,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,r,i,s){const o=t.viewState.resolution,a=t.viewState.rotation;r=r??0;const l=this.getLayer(),u=l.getSource().getTileGridForProjection(t.viewState.projection),d=(0,M.Tr)([e]);(0,M.r)(d,o*r,d);const h={},f=function(b,T,S){let A=b.getId();A===void 0&&(A=(0,W.v6)(b));const C=h[A];if(C){if(C!==!0&&S<C.distanceSq){if(S===0)return h[A]=!0,s.splice(s.lastIndexOf(C),1),i(b,l,T);C.geometry=T,C.distanceSq=S}}else{if(S===0)return h[A]=!0,i(b,l,T);s.push(h[A]={feature:b,layer:l,geometry:T,distanceSq:S,callback:i})}},p=this.renderedTiles,g=(0,W.v6)(l),m=l.getDeclutter(),x=m?t.declutter?.[m]?.all().map(b=>b.value):null;let w;e:for(let b=0,T=p.length;b<T;++b){const S=p[b],A=u.getTileCoordExtent(S.wrappedTileCoord);if(!(0,M.HY)(A,d))continue;const C=S.executorGroups[g];for(let R=0,j=C.length;R<j;++R)if(w=C[R].forEachFeatureAtCoordinate(e,o,a,r,f,x),w)break e}return w}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,r)=>{const i=this.getLayer(),s=i.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,c=s.getTileGridForProjection(o),u=(0,ue.Bb)(this.renderedPixelToCoordinateTransform_,e.slice()),d=c.getTileCoordForCoordAndResolution(u,l).toString(),h=this.renderedTiles.find(b=>b.tileCoord.toString()===d&&b.getState()===ne.A.LOADED);if(!h||h.loadingSourceTiles>0){t([]);return}s.getWrapX()&&o.canWrapX()&&!(0,M.ms)(a,c.getTileCoordExtent(h.tileCoord))&&(0,fe.Li)(u,o);const f=(0,W.v6)(i),p=c.getTileCoordExtent(h.wrappedTileCoord),g=(0,M.Py)(p),m=[(u[0]-g[0])/l,(g[1]-u[1])/l],x=h.getSourceTiles().reduce((b,T)=>b.concat(T.getFeatures()),[]);let w=h.hitDetectionImageData[f];if(!w){const b=(0,zt.xq)(c.getTileSize(c.getZForResolution(l,s.zDirection))),T=this.renderedRotation_,S=[this.getRenderTransform(c.getTileCoordCenter(h.wrappedTileCoord),l,0,ii.tF,b[0]*ii.tF,b[1]*ii.tF,0)];w=(0,ii._7)(b,S,x,i.getStyleFunction(),c.getTileCoordExtent(h.wrappedTileCoord),h.getReplayState(i).renderedResolution,T),h.hitDetectionImageData[f]=w}t((0,ii.F8)(m,x,w))})}getFeaturesInExtent(e){const t=[],r=this.getTileCache();if(r.getCount()===0)return t;const s=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),o=s.getZForResolution(this.renderedResolution),a={};return r.forEach(l=>{if(l.tileCoord[0]!==o||l.getState()!==ne.A.LOADED)return;const c=l.getSourceTiles();for(let u=0,d=c.length;u<d;++u){const h=c[u],f=h.getKey();if(f in a)continue;a[f]=!0;const p=h.tileCoord;if((0,M.HY)(e,s.getTileCoordExtent(p))){const g=h.getFeatures();if(g)for(let m=0,x=g.length;m<x;++m){const w=g[m],b=w.getGeometry();(0,M.HY)(e,b.getExtent())&&t.push(w)}}}}),t}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){const r=this.context,i=r.globalAlpha;r.globalAlpha=t.opacity;const s=e.viewHints,o=!(s[vn.A.ANIMATING]||s[vn.A.INTERACTING]),a=[this.context.canvas.width,this.context.canvas.height],l=this.getLayer().getDeclutter(),c=l?e.declutter?.[l]:void 0,u=(0,W.v6)(this.getLayer()),d=this.renderedTiles;for(let h=0,f=d.length;h<f;++h){const p=d[h],g=p.executorGroups[u];if(g)for(let m=g.length-1;m>=0;--m)g[m].execute(this.context,a,this.getTileRenderTransform(p,e),e.viewState.rotation,o,Ia.$i,c)}r.globalAlpha=i}renderDeferredInternal(e){const t=this.renderedTiles,r=(0,W.v6)(this.getLayer()),i=t.reduce((l,c,u)=>(c.executorGroups[r].forEach(d=>l.push({executorGroup:d,index:u})),l),[]),s=i.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,c=i.length;l<c;++l){const u=i[l].executorGroup.getDeferredZIndexContexts();for(const d in u)o[d]=!0}Object.keys(o).map(Number).sort(Xn.V_).forEach(l=>{s.forEach((c,u)=>{c[l]&&(c[l].forEach(d=>{const{executorGroup:h,index:f}=i[u],p=h.getRenderedContext(),g=p.globalAlpha;p.globalAlpha=this.renderedOpacity_;const m=this.tileClipContexts_[f];m&&m.draw(p),d.draw(p),m&&p.restore(),p.globalAlpha=g,d.clear()}),c[l].length=0)})})}getTileRenderTransform(e,t){const r=t.pixelRatio,i=t.viewState,s=i.center,o=i.resolution,a=i.rotation,l=t.size,c=Math.round(l[0]*r),u=Math.round(l[1]*r),h=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),f=e.tileCoord,p=h.getTileCoordExtent(e.wrappedTileCoord),g=h.getTileCoordExtent(f,this.tempExtent)[0]-p[0];return(0,ue.lw)((0,ue.hs)(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(s,o,a,r,c,u,g))}postRender(e,t){const r=t.viewHints,i=!(r[vn.A.ANIMATING]||r[vn.A.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),c=l?Lu[o].filter(S=>!Ia.$i.includes(S)):Lu[o],u=t.viewState,d=u.rotation,h=s.getSource(),p=h.getTileGridForProjection(u.projection).getZForResolution(u.resolution,h.zDirection),g=this.renderedTiles,m=[],x=[],w=[],b=(0,W.v6)(s);let T=!0;for(let S=g.length-1;S>=0;--S){const A=g[S];T=T&&!A.getReplayState(s).dirty;const C=A.executorGroups[b].filter(Z=>Z.hasExecutors(c));if(C.length===0)continue;const R=this.getTileRenderTransform(A,t),j=A.tileCoord[0];let B=!1;const P=C[0].getClipCoords(R);let G=e,$;if(P){$=new ly.A,G=$.getContext();for(let Z=0,I=m.length;Z<I;++Z)if(p!==j&&j<x[Z]){const k=m[Z];(0,M.HY)([P[0],P[3],P[4],P[7]],[k[0],k[3],k[4],k[7]])&&(B||(G.save(),B=!0),G.beginPath(),G.moveTo(P[0],P[1]),G.lineTo(P[2],P[3]),G.lineTo(P[4],P[5]),G.lineTo(P[6],P[7]),G.moveTo(k[6],k[7]),G.lineTo(k[4],k[5]),G.lineTo(k[2],k[3]),G.lineTo(k[0],k[1]),G.clip())}m.push(P),x.push(j)}for(let Z=0,I=C.length;Z<I;++Z)C[Z].execute(e,[e.canvas.width,e.canvas.height],R,d,i,c,t.declutter?.[l]);B&&(G===e?G.restore():w[S]=$)}e.globalAlpha=a,this.ready=T,this.tileClipContexts_=w,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,r,i,s,o){if(!r)return!1;let a=!1;if(Array.isArray(r))for(let l=0,c=r.length;l<c;++l)a=(0,Ra.nl)(i,e,r[l],t,this.boundHandleStyleImageChange_,void 0,s,o)||a;else a=(0,Ra.nl)(i,e,r,t,this.boundHandleStyleImageChange_,void 0,s,o);return a}tileImageNeedsRender_(e){const t=this.getLayer();if(t.getRenderMode()==="vector")return!1;const r=e.getReplayState(t),i=t.getRevision(),s=e.wantedResolution;return r.renderedTileResolution!==s||r.renderedTileRevision!==i}renderTileImage_(e,t){const r=this.getLayer(),i=e.getReplayState(r),s=r.getRevision(),o=e.executorGroups[(0,W.v6)(r)];i.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],c=r.getSource();let u=t.pixelRatio;const h=t.viewState.projection,f=c.getTileGridForProjection(h),p=f.getResolution(e.tileCoord[0]),g=t.pixelRatio/e.wantedResolution*p,m=f.getResolution(l),x=e.getContext();u=Math.round(Math.max(u,g/u));const w=c.getTilePixelSize(l,u,h);x.canvas.width=w[0],x.canvas.height=w[1];const b=u/g;if(b!==1){const C=(0,ue.cL)(this.tmpTransform_);(0,ue.hs)(C,b,b),x.setTransform.apply(x,C)}const T=f.getTileCoordExtent(a,this.tempExtent),S=g/m,A=(0,ue.cL)(this.tmpTransform_);(0,ue.hs)(A,S,-S),(0,ue.Tl)(A,-T[0],-T[3]);for(let C=0,R=o.length;C<R;++C)o[C].execute(x,[x.canvas.width*b,x.canvas.height*b],A,0,!0,uy[r.getRenderMode()],null);i.renderedTileResolution=e.wantedResolution}}const hy=dy;var Pa=y(94720),Ds=y(45360);class fy extends Pa.A{constructor(e){e=e||{};const t=Object.assign({},e);delete t.preload;const r=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=r;const i=e.renderMode||"hybrid";(0,vt.v)(i=="hybrid"||i=="vector","`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=i,this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new hy(this,{cacheSize:this.cacheSize_})}getFeatures(e){return super.getFeatures(e)}getFeaturesInExtent(e){return this.getRenderer().getFeaturesInExtent(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(Ds.A.PRELOAD)}getUseInterimTilesOnError(){return this.get(Ds.A.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Ds.A.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Ds.A.USE_INTERIM_TILES_ON_ERROR,e)}}const mr=fy;var ka=y(8100),py=y(90025),gy=y(67238),my=y(36813),yr=y(68711),zu=y(43938),nt=y(6141),Du=y(33513),Ma=y(34889),yy=y(52913),vy=y(93101);class xy extends zu.Ay{constructor(e,t,r,i,s,o,a){let l=e.getExtent();l&&e.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);const u=c?(0,M._N)(r,c):r,d=(0,M.q1)(u),h=(0,Du.KQ)(e,t,d,i),f=vy.l,p=new yy.A(e,t,u,l,h*f,i),g=p.calculateSourceExtent(),m=(0,M.Im)(g)?null:o(g,h,s),x=m?nt.A.IDLE:nt.A.EMPTY,w=m?m.getPixelRatio():1;super(r,i,w,x),this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=p,this.targetResolution_=i,this.targetExtent_=r,this.sourceImage_=m,this.sourcePixelRatio_=w,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==nt.A.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==nt.A.LOADED){const t=(0,M.RG)(this.targetExtent_)/this.targetResolution_,r=(0,M.Oq)(this.targetExtent_)/this.targetResolution_;this.canvas_=(0,Du.XX)(t,r,this.sourcePixelRatio_,(0,Ma.m)(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=e,this.changed()}load(){if(this.state==nt.A.IDLE){this.state=nt.A.LOADING,this.changed();const e=this.sourceImage_.getState();e==nt.A.LOADED||e==nt.A.ERROR?this.reproject_():(this.sourceListenerKey_=(0,xt.KT)(this.sourceImage_,mt.A.CHANGE,t=>{const r=this.sourceImage_.getState();(r==nt.A.LOADED||r==nt.A.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){(0,xt.JH)(this.sourceListenerKey_),this.sourceListenerKey_=null}}const wy=xy,tx="1.3.0",js=4,La={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class by extends An.Ay{constructor(e,t){super(e),this.image=t}}class Sy extends Zn{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate!==void 0?e.interpolate:!0}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=e.loader?e.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(e){this.resolutions_=e}findNearestResolution(e){const t=this.getResolutions();if(t){const r=(0,Xn.FT)(t,e,0);e=t[r]}return e}getImage(e,t,r,i){const s=this.getProjection();if(!s||!i||(0,D.tI)(s,i))return s&&(i=s),this.getImageInternal(e,t,r,i);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&(0,D.tI)(this.reprojectedImage_.getProjection(),i)&&this.reprojectedImage_.getResolution()==t&&(0,M.aI)(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new wy(s,i,e,t,r,(o,a,l)=>this.getImageInternal(o,a,l,s),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,r,i){if(this.loader){const s=Cy(e,t,r,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===i&&(this.wantedExtent_&&(0,M.ms)(this.wantedExtent_,s)||(0,M.ms)(this.image.getExtent(),s))&&(this.wantedResolution_&&(0,Ma.m)(this.wantedResolution_)===o||(0,Ma.m)(this.image.getResolution())===o)))return this.image;this.wantedProjection_=i,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new zu.Ay(s,o,r,this.loader),this.image.addEventListener(mt.A.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let r;switch(t.getState()){case nt.A.LOADING:this.loading=!0,r=La.IMAGELOADSTART;break;case nt.A.LOADED:this.loading=!1,r=La.IMAGELOADEND;break;case nt.A.ERROR:this.loading=!1,r=La.IMAGELOADERROR;break;default:return}this.hasListener(r)&&this.dispatchEvent(new by(r,t))}}function nx(n,e){n.getImage().src=e}function Cy(n,e,t,r){const i=e/t,s=(0,M.q1)(n),o=(0,Se.mk)((0,M.RG)(n)/i,js),a=(0,Se.mk)((0,M.Oq)(n)/i,js),l=(0,Se.mk)((r-1)*o/2,js),c=o+2*l,u=(0,Se.mk)((r-1)*a/2,js),d=a+2*u;return(0,M.Bg)(s,i,0,[c,d])}const ju=Sy;var Ay=y(48287).Buffer;function Ou(n){return function(e){const t=e.buffers,r=e.meta,i=e.imageOps,s=e.width,o=e.height,a=t.length,l=t[0].byteLength;if(i){const h=new Array(a);for(let p=0;p<a;++p)h[p]=new ImageData(new Uint8ClampedArray(t[p]),s,o);return n(h,r).data.buffer}const c=new Uint8ClampedArray(l),u=new Array(a),d=new Array(a);for(let h=0;h<a;++h)u[h]=new Uint8ClampedArray(t[h]),d[h]=[0,0,0,0];for(let h=0;h<l;h+=4){for(let p=0;p<a;++p){const g=u[p];d[p][0]=g[h],d[p][1]=g[h+1],d[p][2]=g[h+2],d[p][3]=g[h+3]}const f=n(d,r);c[h]=f[0],c[h+1]=f[1],c[h+2]=f[2],c[h+3]=f[3]}return c.buffer}}function Ty(n,e){const r=Object.keys(n.lib||{}).map(function(s){return"const "+s+" = "+n.lib[s].toString()+";"}).concat(["const __minion__ = ("+Ou.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {'," const buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),i=new Worker(typeof Blob>"u"?"data:text/javascript;base64,"+Ay.from(r.join(` `),"binary").toString("base64"):URL.createObjectURL(new Blob(r,{type:"text/javascript"})));return i.addEventListener("message",e),i}function Ey(n,e){const t=Ou(n.operation);let r=!1;return{postMessage:function(i){setTimeout(function(){r||e({data:{buffer:t(i),meta:i.meta}})},0)},terminate:function(){r=!0}}}class _y extends py.A{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;e.threads===0?t=0:this.imageOps_?t=1:t=e.threads||1;const r=new Array(t);if(t)for(let i=0;i<t;++i)r[i]=Ty(e,this.onWorkerMessage_.bind(this,i));else r[0]=Ey(e,this.onWorkerMessage_.bind(this,0));this.workers_=r,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,r){this.enqueue_({inputs:e,meta:t,callback:r}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;const e=this.queue_.shift();this.job_=e;const t=e.inputs[0].width,r=e.inputs[0].height,i=e.inputs.map(function(l){return l.data.buffer}),s=this.workers_.length;if(this.running_=s,s===1){this.workers_[0].postMessage({buffers:i,meta:e.meta,imageOps:this.imageOps_,width:t,height:r},i);return}const o=e.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;l<s;++l){const c=l*a,u=[];for(let d=0,h=i.length;d<h;++d)u.push(i[d].slice(c,c+a));this.workers_[l].postMessage({buffers:u,meta:e.meta,imageOps:this.imageOps_,width:t,height:r},u)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){const e=this.job_,t=this.workers_.length;let r,i;if(t===1)r=new Uint8ClampedArray(this.dataLookup_[0].buffer),i=this.dataLookup_[0].meta;else{const s=e.inputs[0].data.length;r=new Uint8ClampedArray(s),i=new Array(t);const o=4*Math.ceil(s/4/t);for(let a=0;a<t;++a){const l=this.dataLookup_[a].buffer,c=a*o;r.set(new Uint8ClampedArray(l),c),i[a]=this.dataLookup_[a].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(r,e.inputs[0].width,e.inputs[0].height),i),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}}const Nu={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"};class Gu extends An.Ay{constructor(e,t,r){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=r}}class Bu extends ju{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType!==void 0?e.operationType:"pixel",this.threads_=e.threads!==void 0?e.threads:1,this.layers_=Ry(e.sources);const t=this.changed.bind(this);for(let r=0,i=this.layers_.length;r<i;++r)this.layers_[r].addEventListener(mt.A.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new my.A(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:(0,ue.vt)(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:Iy(this.layers_),pixelRatio:1,pixelToCoordinateTransform:(0,ue.vt)(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:(0,W.v6)(this),renderTargets:{}},this.setAttributions(function(r){const i=[];for(let s=0,o=e.sources.length;s<o;++s){const a=e.sources[s],l=a instanceof Zn?a:a.getSource();if(!l)continue;const c=l.getAttributions()?.(r);typeof c=="string"?i.push(c):c!==void 0&&i.push(...c)}return i}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new _y({operation:e,imageOps:this.operationType_==="image",queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,r){const i=Object.assign({},this.frameState_);i.viewState=Object.assign({},i.viewState);const s=(0,M.q1)(e);i.size[0]=Math.ceil((0,M.RG)(e)/t),i.size[1]=Math.ceil((0,M.Oq)(e)/t),i.extent=[s[0]-i.size[0]*t/2,s[1]-i.size[1]*t/2,s[0]+i.size[0]*t/2,s[1]+i.size[1]*t/2],i.time=Date.now();const o=i.viewState;return o.center=s,o.projection=r,o.resolution=t,i}allSourcesReady_(){let e=!0,t;for(let r=0,i=this.layers_.length;r<i;++r)if(t=this.layers_[r].getSource(),!t||t.getState()!=="ready"){e=!1;break}return e}getImage(e,t,r,i){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);const s=this.updateFrameState_(e,t,i);if(this.requestedFrameState_=s,this.renderedImageCanvas_){const o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();(t!==o||!(0,M.aI)(s.extent,a))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),s.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const e=this.requestedFrameState_,t=this.layers_.length,r=new Array(t);for(let s=0;s<t;++s){e.layerIndex=s,e.renderTargets={};const o=Fy(this.layers_[s],e);if(o)r[s]=o;else return}const i={};this.dispatchEvent(new Gu(Nu.BEFOREOPERATIONS,e,i)),this.processor_.process(r,i,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,r,i){if(t||!r)return;const s=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!(0,M.aI)(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round((0,M.RG)(s)/o),c=Math.round((0,M.Oq)(s)/o);a=(0,yr.Y)(l,c),this.renderedImageCanvas_=new gy.A(s,o,1,a.canvas)}a.putImageData(r,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Gu(Nu.AFTEROPERATIONS,e,i))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let r=0,i=this.layers_.length;r<i&&(t=this.layers_[r].getSource().getResolutions(e),!t);++r);return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Bu.prototype.dispose;let jn=null;function Fy(n,e){const t=n.getRenderer();if(!t)throw new Error("Unsupported layer type: "+n);if(!t.prepareFrame(e))return null;const r=e.size[0],i=e.size[1];if(r===0||i===0)return null;const s=t.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===r&&o.height===i)return o.getContext("2d").getImageData(0,0,r,i)}if(!jn)jn=(0,yr.Y)(r,i,void 0,{willReadFrequently:!0});else{const a=jn.canvas;a.width!==r||a.height!==i?jn=(0,yr.Y)(r,i,void 0,{willReadFrequently:!0}):jn.clearRect(0,0,r,i)}return jn.drawImage(o,0,0,r,i),jn.getImageData(0,0,r,i)}function Iy(n){return n.map(function(e){return e.getLayerState()})}function Ry(n){const e=n.length,t=new Array(e);for(let r=0;r<e;++r)t[r]=Py(n[r]);return t}function Py(n){let e;return n instanceof Zn?n instanceof Bl?e=new Dr.A({source:n}):n instanceof ju&&(e=new ku.A({source:n})):e=n,e}const ky=Bu;function My(n,e,t,r){const i=document.createElement("script"),s="olc_"+(0,W.v6)(e);function o(){delete window[s],i.parentNode.removeChild(i)}i.async=!0,i.src=n+(n.includes("?")?"&":"?")+(r||"callback")+"="+s;const a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(l){clearTimeout(a),o(),e(l)},document.head.appendChild(i)}class Ly extends Error{constructor(e){const t="Unexpected response status: "+e.status;super(t),this.name="ResponseError",this.response=e}}class zy extends Error{constructor(e){super("Failed to issue request"),this.name="ClientError",this.client=e}}function rx(n){return new Promise(function(e,t){function r(o){const a=o.target;if(!a.status||a.status>=200&&a.status<300){let l;try{l=JSON.parse(a.responseText)}catch(c){const u="Error parsing response text as JSON: "+c.message;t(new Error(u));return}e(l);return}t(new Ly(a))}function i(o){t(new zy(o.target))}const s=new XMLHttpRequest;s.addEventListener("load",r),s.addEventListener("error",i),s.open("GET",n),s.setRequestHeader("Accept","application/json"),s.send()})}function ix(n,e){return e.includes("://")?e:new URL(e,n).href}let $u;function sx(n){typeof XMLHttpRequest<"u"&&($u=XMLHttpRequest),global.XMLHttpRequest=n}function ox(){global.XMLHttpRequest=$u}class Dy extends Vl{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:(0,D.Jt)("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)My(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",e.url),t.send()}else if(e.tileJSON)this.handleTileJSONResponse(e.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let r;try{r=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(r)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=(0,D.Jt)("EPSG:4326"),r=this.getProjection();let i;if(e.bounds!==void 0){const c=(0,D.FO)(t,r);i=(0,M.NW)(e.bounds,c)}const s=jr(r),o=e.minzoom||0,a=e.maxzoom||22,l=Oi({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Gl(e.tiles,l),e.attribution&&!this.getAttributions()){const c=i!==void 0?i:s;this.setAttributions(function(u){return(0,M.HY)(c,u.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}const Vu=Dy,Uu=[];class jy extends hu.A{constructor(e,t,r,i,s){super(e,t,{transition:0}),this.context_=null,this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.removeSourceTiles_=s,this.wrappedTileCoord=r}getContext(){return this.context_||(this.context_=(0,yr.Y)(1,1,Uu)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=(0,W.v6)(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&((0,yr.Yg)(this.context_),Uu.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}const Oy=jy;class Ny extends $l{constructor(e){const t=e.projection||"EPSG:3857",r=e.extent||jr(t),i=e.tileGrid||Oi({extent:r,maxResolution:e.maxResolution,maxZoom:e.maxZoom!==void 0?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,projection:t,state:e.state,tileGrid:i,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Wu,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection===void 0?1:e.zDirection}),this.format_=e.format?e.format:null,this.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=e.overlaps==null?!0:e.overlaps,this.tileClass=e.tileClass?e.tileClass:fu,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,r){if(r.getState()===ne.A.IDLE){r.setState(ne.A.LOADING);const i=r.wrappedTileCoord,s=this.getTileGridForProjection(t),o=s.getTileCoordExtent(i),a=i[0],l=s.getResolution(a);(0,M.r)(o,-l,o);const c=this.tileGrid,u=c.getExtent();u&&(0,M._N)(o,u,o);const d=c.getZForResolution(l,this.zDirection);c.forEachTileCoord(o,d,h=>{const f=this.tileUrlFunction(h,e,t);this.sourceTiles_[f]||(this.sourceTiles_[f]=new this.tileClass(h,f?ne.A.IDLE:ne.A.EMPTY,f,this.format_,this.tileLoadFunction));const p=this.sourceTiles_[f];r.sourceTiles.push(p),this.tileKeysBySourceTileUrl_[f]||(this.tileKeysBySourceTileUrl_[f]=[]),this.tileKeysBySourceTileUrl_[f].push(r.getKey());const g=p.getState();if(g<ne.A.LOADED){const m=x=>{this.handleTileChange(x);const w=p.getState();if(w===ne.A.LOADED||w===ne.A.ERROR){const b=p.getKey();b in r.errorTileKeys?p.getState()===ne.A.LOADED&&delete r.errorTileKeys[b]:r.loadingSourceTiles--,w===ne.A.ERROR?r.errorTileKeys[b]=!0:p.removeEventListener(mt.A.CHANGE,m),r.loadingSourceTiles===0&&r.setState((0,bi.p)(r.errorTileKeys)?ne.A.LOADED:ne.A.ERROR)}};p.addEventListener(mt.A.CHANGE,m),r.loadingSourceTiles++}g===ne.A.IDLE&&(p.extent=c.getTileCoordExtent(h),p.projection=t,p.resolution=c.getResolution(h[0]),p.load())}),r.loadingSourceTiles||r.setState(r.sourceTiles.some(h=>h.getState()===ne.A.ERROR)?ne.A.ERROR:ne.A.LOADED)}return r.sourceTiles}removeSourceTiles(e){const t=e.getKey(),r=e.sourceTiles;for(let i=0,s=r.length;i<s;++i){const o=r[i].getTileUrl();if(!this.tileKeysBySourceTileUrl_[o])return;const a=this.tileKeysBySourceTileUrl_[o].indexOf(t);a!==-1&&(this.tileKeysBySourceTileUrl_[o].splice(a,1),this.tileKeysBySourceTileUrl_[o].length===0&&(delete this.tileKeysBySourceTileUrl_[o],delete this.sourceTiles_[o]))}}getTile(e,t,r,i,s){const o=[e,t,r];let a=this.getTileCoordForTileUrlFunction(o,s);const l=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(s);if(a&&l){const h=c.getTileCoordExtent(a);(0,M.r)(h,-c.getResolution(e),h),(0,M.HY)(l,h)||(a=null)}let u=!0;if(a!==null){const h=this.tileGrid,f=c.getResolution(e),p=h.getZForResolution(f,1),g=c.getTileCoordExtent(a);(0,M.r)(g,-f,g),h.forEachTileCoord(g,p,m=>{u=u&&!this.tileUrlFunction(m,i,s)})}const d=new Oy(o,u?ne.A.EMPTY:ne.A.IDLE,a,this.getSourceTiles.bind(this,i,s),this.removeSourceTiles.bind(this));return d.key=this.getKey(),d}getTileGridForProjection(e){const t=e.getCode();let r=this.tileGrids_[t];if(!r){const i=this.getProjection();(0,vt.v)(i===null||(0,D.tI)(i,e),"A VectorTile source can only be rendered if it has a projection compatible with the view projection.");const s=this.tileGrid,o=s.getResolutions().slice(),a=o.map(function(u,d){return s.getOrigin(d)}),l=o.map(function(u,d){return s.getTileSize(d)}),c=Di.L+1;for(let u=o.length;u<c;++u)o.push(o[u-1]/2),a.push(a[u-1]),l.push(l[u-1]);r=new ji({extent:s.getExtent(),origins:a,resolutions:o,tileSizes:l}),this.tileGrids_[t]=r}return r}getTilePixelRatio(e){return e}getTilePixelSize(e,t,r){const i=this.getTileGridForProjection(r),s=(0,zt.xq)(i.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}}const Os=Ny;function Wu(n,e){n.setLoader(function(t,r,i){sl(e,n.getFormat(),t,r,i,n.onLoad.bind(n),n.onError.bind(n))})}function Gy(n,e){const t=n[0],r=t.width,i=t.height,s=t.data,o=new Uint8ClampedArray(s.length),a=e.resolution*2,l=r-1,c=i-1,u=[0,0,0,0],d=2*Math.PI,h=Math.PI/2,f=Math.PI*e.sunEl/180,p=Math.PI*e.sunAz/180,g=Math.cos(f),m=Math.sin(f),x=e.highlightColor,w=e.shadowColor,b=e.accentColor,T=e.encoding;let S,A,C,R,j,B,P,G,$,Z,I,k,V,we,Ae,be,Q,z,_t,xn,nn,ui;function Le(Ne,Vn="mapbox"){if(Vn==="mapbox")return(Ne[0]*256*256+Ne[1]*256+Ne[2])*.1-1e4;if(Vn==="terrarium")return Ne[0]*256+Ne[1]+Ne[2]/256-32768}for(A=0;A<=c;++A)for(j=A===0?0:A-1,B=A===c?c:A+1,S=0;S<=l;++S)C=S===0?0:S-1,R=S===l?l:S+1,P=(A*r+C)*4,u[0]=s[P],u[1]=s[P+1],u[2]=s[P+2],u[3]=s[P+3],G=e.vert*Le(u,T),P=(A*r+R)*4,u[0]=s[P],u[1]=s[P+1],u[2]=s[P+2],u[3]=s[P+3],$=e.vert*Le(u,T),Z=($-G)/a,P=(j*r+S)*4,u[0]=s[P],u[1]=s[P+1],u[2]=s[P+2],u[3]=s[P+3],G=e.vert*Le(u,T),P=(B*r+S)*4,u[0]=s[P],u[1]=s[P+1],u[2]=s[P+2],u[3]=s[P+3],$=e.vert*Le(u,T),I=($-G)/a,V=Math.atan2(I,-Z),V<0?V=h-V:V>h?V=d-V+h:V=h-V,k=Math.atan(Math.sqrt(Z*Z+I*I)),ui=m*Math.cos(k)+g*Math.sin(k)*Math.cos(p-V),we=Math.cos(k),Ae=255*ui,_t=Math.min(Math.max(2*e.sunEl,0),1),xn=1.875-e.opacity*1.75,nn=e.opacity!==.5?h*((Math.pow(xn,k)-1)/(Math.pow(xn,h)-1)):k,Q={r:(1-we)*b.r*_t*255,g:(1-we)*b.g*_t*255,b:(1-we)*b.b*_t*255,a:(1-we)*b.a*_t*255},be=Math.abs(((V+p)/Math.PI+.5)%2-1),z={r:(x.r*(1-be)+w.r*be)*Ae,g:(x.g*(1-be)+w.g*be)*Ae,b:(x.b*(1-be)+w.b*be)*Ae,a:(x.a*(1-be)+w.a*be)*Ae},P=(A*r+S)*4,o[P]=Q.r*(1-be)+z.r,o[P+1]=Q.g*(1-be)+z.g,o[P+2]=Q.b*(1-be)+z.b,o[P+3]=s[P+3]*e.opacity*_t*Math.sin(nn);return new ImageData(o,r,i)}function By(n,e=512){return n.getExtent()?Oi({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Gt}function Xu(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((r,i)=>{e.accessToken=r,e.accessTokenParam=i})),e}function Zu(n,e,t="",r={},i=void 0){let s,o,a,l,c=!0;return typeof t!="string"&&!Array.isArray(t)?(a=t,l=a.source||a.layers,r=a):l=t,typeof r=="string"?(s=r,a={}):(s=r.styleUrl,a=r),a.updateSource===!1&&(c=!1),i||(i=a.resolutions),!s&&typeof e=="string"&&!e.trim().startsWith("{")&&(s=e),s&&(s=s.startsWith("data:")?location.href:_s(s,a.accessToken),a=Xu(s,a)),new Promise(function(u,d){xa(e,a).then(function(h){if(h.version!=8)return d(new Error("glStyle version 8 required."));if(!(n instanceof yt.A||n instanceof mr))return d(new Error("Can only apply to VectorLayer or VectorTileLayer"));const f=n instanceof mr?"vector":"geojson";if(l?Array.isArray(l)?o=h.layers.find(function(T){return T.id===l[0]}).source:o=l:(o=h.layers.find(function(T){return T.source&&h.sources[T.source].type===f}).source,l=o),!o)return d(new Error(`No ${f} source found in the glStyle.`));function p(){if(!c)return Promise.resolve();if(n instanceof mr)return za(h.sources[o],s,a).then(function(C){const R=n.getSource();R?C!==R&&(R.setTileUrlFunction(C.getTileUrlFunction()),typeof R.setUrls=="function"&&typeof C.getUrls=="function"&&R.setUrls(C.getUrls()),R.format_||(R.format_=C.format_),R.getAttributions()||R.setAttributions(C.getAttributions()),R.getTileLoadFunction()===Wu&&R.setTileLoadFunction(C.getTileLoadFunction()),(0,D.tI)(R.getProjection(),C.getProjection())&&(R.tileGrid=C.getTileGrid())):n.setSource(C);const j=n.getSource().getTileGrid();!isFinite(n.getMaxResolution())&&!isFinite(n.getMinZoom())&&j.getMinZoom()>0&&n.setMaxResolution(ni(Math.max(0,j.getMinZoom()-1e-12),j.getResolutions()))});const T=h.sources[o];let S=n.getSource();(!S||S.get("mapbox-source")!==T)&&(S=Da(T,s,a));const A=n.getSource();return A?S!==A&&(A.getAttributions()||A.setAttributions(S.getAttributions()),A.format_||(A.format_=S.getFormat()),A.url_=S.getUrl()):n.setSource(S),Promise.resolve()}let g,m;const x={},w={};function b(){if(!m&&(!h.sprite||x)){if(a.projection&&!i){const C=(0,D.Jt)(a.projection).getUnits();C!=="m"&&(i=Gt.map(R=>R/ka.I[C]))}let T;const S=n.getSource();S instanceof Os&&S.format_ instanceof Fa&&(T=S.format_.layerName_),m=Dm(n,h,l,i,x,w,(A,C=a.webfonts)=>Im(A,C),a.getImage,T),n.getStyle()?p().then(u).catch(d):d(new Error(`Nothing to show for source [${o}]`))}else m?(n.setStyle(m),p().then(u).catch(d)):d(new Error("Something went wrong trying to apply style."))}if(h.sprite){const T=bm(h.sprite,a.accessToken,s||location.href);g=window.devicePixelRatio>=1.5?.5:1;const S=g==.5?"@2x":"";Promise.all(T.map(function(A){const C=new URL(A.url);let R=C.origin+C.pathname+S+".json"+C.search;return new Promise(function(j,B){pr("Sprite",R,a).then(j).catch(function(P){R=C.origin+C.pathname+".json"+C.search,pr("Sprite",R,a).then(j).catch(B)})}).then(function(j){j===void 0&&d(new Error("No sprites found."));let B;if(B=C.origin+C.pathname+S+".png"+C.search,a.transformRequest){const P=a.transformRequest(B,"SpriteImage")||B;(P instanceof Request||P instanceof Promise)&&(B=P)}w[A.id]=B;for(const P in j){const G=A.id=="default"?P:`${A.id}:${P}`;x[G]=j[P]}}).catch(function(j){d(new Error(`Sprites cannot be loaded: ${R}: ${j.message}`))})})).then(b).catch(d)}else b()}).catch(d)})}function $y(n,e,t){e.layers.some(function(r){if(r.type==="background"){if(n instanceof Mu.A)return n.setBackground(function(i){return Ku(r,i,t,{})}),!0;if(n instanceof Es.A||n instanceof un.A)return n.getLayers().insertAt(0,Ju(r,t,{})),!0}})}function Vy(n,e,t={}){return xa(e,t).then(function(r){$y(n,r,t)})}function Yu(n,e){let t;return n.some(function(r){if(r.id==e)return t=r.source,!0}),t}function Uy(n,e){const t=n.bounds;if(t){const r=(0,D.Rb)([t[0],t[1]],e),i=(0,D.Rb)([t[2],t[3]],e);return[r[0],r[1],i[0],i[1]]}return(0,D.Jt)(e).getExtent()}function Hu(n,e,t){const r=new Vu({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),i=r.getTileJSON(),s=r.getTileGrid(),o=(0,D.Jt)(t.projection||"EPSG:3857"),a=Uy(i,o),l=o.getExtent(),c=i.minzoom||0,u=i.maxzoom||22,d={attributions:r.getAttributions(),projection:o,tileGrid:new ji({origin:l?(0,M.Py)(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:By(o,e.tileSize).slice(0,u+1),tileSize:s.getTileSize(0)})};return Array.isArray(i.tiles)?d.urls=i.tiles:d.url=i.tiles,d}function Ku(n,e,t,r){const i={id:n.id,type:n.type},s=n.layout||{},o=n.paint||{};i.paint=o,tt.zoom=va(e,t.resolutions||Gt),tt.distanceFromCenter=0;let a;const l=N(i,"paint","background-color",Et,r);return o["background-opacity"]!==void 0&&(a=N(i,"paint","background-opacity",Et,r)),s.visibility=="none"?void 0:yn(l,a)}function Ju(n,e,t){const r=document.createElement("div");return r.className="ol-mapbox-style-background",r.style.position="absolute",r.style.width="100%",r.style.height="100%",new Mu.A({source:new Zn({}),render(i){const s=Ku(n,i.viewState.resolution,e,t);return r.style.backgroundColor=s,r}})}function za(n,e,t){return new Promise(function(r,i){xu(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=Hu(n,s,t);a.tileLoadFunction=o,a.format=new Fa({layerName:"mvt:layer"});const l=new Os(a);l.set("mapbox-source",n),r(l)}).catch(i)})}function Wy(n,e,t){const r=new mr({declutter:!0,visible:!1});return za(n,e,t).then(function(i){r.setSource(i)}).catch(function(i){r.setSource(void 0)}),r}function qu(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Qu(n,e,t){return new Promise(function(r,i){xu(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new Vu({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=Hu(n,s,t).tileGrid,t.projection&&(a.projection=(0,D.Jt)(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,u,d){const h=qu(d);let f=l(c,u,d);if(f.indexOf(h)!=-1){const p=a.getTileGrid().getTileCoordExtent(c);f=f.replace(h,p.toString())}return f}),a.set("mapbox-source",n),r(a)}).catch(function(s){i(s)})})}function ed(n,e,t){const r=new Dr.A;return Qu(n,e,t).then(function(i){r.setSource(i)}).catch(function(){r.setSource(void 0)}),r}function Xy(n,e,t){const r=ed(n,e,t);return new ku.A({source:new ky({operationType:"image",operation:Gy,sources:[r]})})}function Da(n,e,t){const r=t.projection?new Ms.A({dataProjection:t.projection}):new Ms.A,i=n.data,s={};if(typeof i=="string"){const[a]=Fs(i,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(d,h,f)=>{const p=qu(f);return a.replace(p,`${d.join(",")}`)},u=new Re({attributions:n.attribution,format:r,loader:(d,h,f,p,g)=>{const m=typeof c=="function"?c(d,h,f):c;pr("GeoJSON",m,t).then(x=>{const w=u.getFormat().readFeatures(x,{featureProjection:f});u.addFeatures(w),p(w)}).catch(x=>{u.removeLoadedExtent(d),g()})},strategy:dh});return u.set("mapbox-source",n),u}const l=new Re({attributions:n.attribution,format:r,url:a,loader:(c,u,d,h,f)=>{pr("GeoJSON",a,t).then(p=>{const g=l.getFormat().readFeatures(p,{featureProjection:d});l.addFeatures(g),h(g)}).catch(p=>{l.removeLoadedExtent(c),f()})}});return l}s.features=r.readFeatures(i,{featureProjection:(0,D.Tf)()||"EPSG:3857"});const o=new Re(Object.assign({attributions:n.attribution,format:r},s));return o.set("mapbox-source",n),o}function Zy(n,e,t){return new yt.A({declutter:!0,source:Da(n,e,t),visible:!1})}function Yy(n,e,t){let r=null;return function(i){n.paint&&"raster-opacity"in n.paint&&i.frameState.viewState.zoom!==r&&(r=i.frameState.viewState.zoom,delete t[n.id],Hy(n,e,r,t))}}function Hy(n,e,t,r){tt.zoom=t,tt.distanceFromCenter=0;const i=N(n,"paint","raster-opacity",Et,r);e.setOpacity(i)}function Ky(n,e){function t(){const r=e.get("mapbox-style");if(!r)return;const i=Hl(r.layers),s=n.get("mapbox-layers"),o=i.filter(function(a){return s.includes(a.id)}).some(function(a){return!a.layout||!a.layout.visibility||a.layout.visibility==="visible"});n.get("visible")!==o&&n.setVisible(o)}n.on("change",t),t()}function td(n,e,t,r){const i=yu(n),s=n.layers,o=t.type,a=t.source||Yu(s,t.ref),l=n.sources[a];let c;if(o=="background")c=Ju(t,r,i);else if(l.type=="vector")c=Wy(l,e,r);else if(l.type=="raster")c=ed(l,e,r),c.setVisible(t.layout?t.layout.visibility!=="none":!0),c.on("prerender",Yy(t,c,i));else if(l.type=="geojson")c=Zy(l,e,r);else if(l.type=="raster-dem"&&t.type=="hillshade"){const d=Xy(l,e,r);c=d,d.getSource().on("beforeoperations",function(h){const f=h.data;f.resolution=(0,D.hO)(r.projection||"EPSG:3857",h.resolution,(0,M.q1)(h.extent),"m"),tt.zoom=va(h.resolution,r.resolutions||Gt),tt.distanceFromCenter=0,f.encoding=l.encoding,f.vert=5*N(t,"paint","hillshade-exaggeration",Et,i),f.sunAz=N(t,"paint","hillshade-illumination-direction",Et,i),f.sunEl=35,f.opacity=.3,f.highlightColor=N(t,"paint","hillshade-highlight-color",Et,i),f.shadowColor=N(t,"paint","hillshade-shadow-color",Et,i),f.accentColor=N(t,"paint","hillshade-accent-color",Et,i)}),c.setVisible(t.layout?t.layout.visibility!=="none":!0)}const u=a;return c&&c.set("mapbox-source",u),c}function nd(n,e,t,r){const i=[];let s=null;if(e instanceof Es.A){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const d=r.projection?(0,D.Jt)(r.projection):s.getProjection();s=new mi.Ay(Object.assign(s.getProperties(),{maxResolution:Gt[0]/ka.I[d.getUnits()],projection:r.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter((0,D.Rb)(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(Gt[0]/ka.I[s.getProjection().getUnits()]/Math.pow(2,n.zoom)),(!s.getCenter()||s.getZoom()===void 0)&&s.fit(s.getProjection().getExtent(),{nearest:!0,size:e.getSize()})}e.set("mapbox-style",n),e.set("mapbox-metadata",{styleUrl:t,options:r});const o=n.layers;let a=[],l,c,u;for(let d=0,h=o.length;d<h;++d){const f=o[d],p=f.type;if(p=="heatmap"){console.debug(`layers[${d}].type "${p}" not supported`);continue}else u=f.source||Yu(o,f.ref),(!u||u!=c)&&(a.length&&(i.push(Ns(l,a,n,t,e,r)),a=[]),l=td(n,t,f,r),l instanceof yt.A||l instanceof mr||(a=[]),c=l.get("mapbox-source")),a.push(f.id)}return i.push(Ns(l,a,n,t,e,r)),Promise.all(i)}function rd(n,e,t={}){let r,i;if(typeof n=="string"||n instanceof HTMLElement?i=new Es.A({target:n}):i=n,typeof e=="string"){const s=e.startsWith("data:")?location.href:_s(e,t.accessToken);t=Xu(s,t),r=new Promise(function(o,a){xa(e,t).then(function(l){nd(l,i,s,t).then(function(){o(i)}).catch(a)}).catch(function(l){a(new Error(`Could not load ${e}: ${l.message}`))})})}else r=new Promise(function(s,o){nd(e,i,!t.styleUrl||t.styleUrl.startsWith("data:")?location.href:_s(t.styleUrl,t.accessToken),t).then(function(){s(i)}).catch(o)});return r}function Ns(n,e,t,r,i,s={}){let o=24,a=0;const l=t.layers;for(let c=0,u=l.length;c<u;++c){const d=l[c];e.indexOf(d.id)!==-1&&(o=Math.min("minzoom"in d?d.minzoom:0,o),a=Math.max("maxzoom"in d?d.maxzoom:24,a))}return new Promise(function(c,u){const d=function(){const f=n.getSource();if(!f||f.getState()==="error"){u(new Error("Error accessing data for source "+n.get("mapbox-source")));return}if("getTileGrid"in f){const p=f.getTileGrid();if(p){const g=p.getMinZoom();(o>0||g>0)&&n.setMaxResolution(Math.min(ni(Math.max(0,o-1e-12),Gt),ni(Math.max(0,g-1e-12),p.getResolutions()))),a<24&&n.setMinResolution(ni(a,Gt))}}else o>0&&n.setMaxResolution(ni(Math.max(0,o-1e-12),Gt));f instanceof Re||f instanceof Os?Zu(n,t,e,Object.assign({styleUrl:r},s)).then(function(){Ky(n,i),c()}).catch(u):c()};n.set("mapbox-layers",e);const h=i.getLayers();h.getArray().indexOf(n)===-1&&h.push(n),n.getSource()?d():n.once("change:source",d)})}function Jy(n,e){return n.get("mapbox-style").layers.find(function(i){return i.id===e})}function ax(n,e,t){const r=n.get("mapbox-style"),i=r.layers;let s,o=-1;if(t!==void 0){const u=Jy(n,t);if(u===void 0)throw new Error(`Layer with id "${t}" not found.`);s=i.indexOf(u)}else s=i.length;let a;if(s>0&&i[s-1].source===e.source?(o=s-1,a=-1):s<i.length&&i[s].source===e.source&&(o=s,a=0),o===-1){const{options:u,styleUrl:d}=n.get("mapbox-metadata"),h=td(r,d,e,u);if(t){const f=On(n,t),p=n.getLayers().getArray().indexOf(f);n.getLayers().insertAt(p,h)}return i.splice(s,0,e),Ns(h,[e.id],r,d,n,u)}if(i.some(u=>u.id===e.id))throw new Error(`Layer with id "${e.id}" already exists.`);const l=i[o].id,c=styleFunctionArgs[getStyleFunctionKey(n.get("mapbox-style"),On(n,l))];if(i.splice(s,0,e),c){const[u,d,h,f,p,g,m,x]=c;if(Array.isArray(h)){const w=h.indexOf(l)+a;h.splice(w,0,e.id)}applyStylefunction(u,d,h,f,p,g,m,x)}else On(n,i[o].id).changed();return Promise.resolve()}function lx(n,e){const t=n.get("mapbox-style"),r=t.layers,i=r.findIndex(function(u){return u.id===e.id});if(i===-1)throw new Error(`Layer with id "${e.id}" not found.`);if(r[i].source!==e.source)throw new Error("Updated layer and previous version must use the same source.");delete getFunctionCache(t)[e.id],delete getFilterCache(t)[e.id],r[i]=e;const o=styleFunctionArgs[getStyleFunctionKey(n.get("mapbox-style"),On(n,e.id))];if(o)return applyStylefunction.apply(void 0,o),Promise.resolve();const a=On(n,e.id),{options:l,styleUrl:c}=n.get("mapbox-metadata");return Ns(a,[e.id],t,c,n,l)}function cx(n,e,t){const r=qy(n,e),i=n.getLayers().getArray().filter(function(a){return(a instanceof VectorLayer||a instanceof TileLayer||a instanceof VectorTileLayer)&&a.getSource()===r}),s=n.get("mapbox-metadata");let o;switch(t.type){case"vector":o=za(t,s.styleUrl,s.options);break;case"geojson":o=Promise.resolve(Da(t,s.styleUrl,s.options));break;case"raster":case"raster-dem":o=Qu(t,s.styleUrl,s.options);break;default:return Promise.reject(new Error("Unsupported source type "+t.type))}return o.then(function(a){i.forEach(function(l){l.setSource(a)})}),o}function ux(n,e){const t=typeof e=="string"?e:e.id,r=On(n,t),i=r.get("mapbox-layers");if(i.length===1)throw new Error("Cannot remove last Mapbox layer from an OpenLayers layer.");i.splice(i.indexOf(t),1);const s=n.get("mapbox-style"),o=s.layers;o.splice(o.findIndex(l=>l.id===t),1);const a=styleFunctionArgs[getStyleFunctionKey(s,r)];if(a){const[l,c,u,d,h,f,p,g]=a;Array.isArray(u)&&u.splice(u.findIndex(m=>m===t),1),applyStylefunction(l,c,u,d,h,f,p,g)}else On(n,t).changed()}function On(n,e){const t=n.getLayers().getArray();for(let r=0,i=t.length;r<i;++r){const s=t[r].get("mapbox-layers");if(s&&s.indexOf(e)!==-1)return t[r]}}function id(n,e){const t=[],r=n.getLayers().getArray();for(let i=0,s=r.length;i<s;++i)r[i].get("mapbox-source")===e&&t.push(r[i]);return t}function qy(n,e){const t=n.getLayers().getArray();for(let r=0,i=t.length;r<i;++r){const s=t[r].getSource();if(t[r].get("mapbox-source")===e)return s}}function dx(n,e,t){const r="getLayers"in n?id(n,e.source):[n];for(let i=0,s=r.length;i<s;++i){const o=r[i].get("mapbox-featurestate");if(o)t?o[e.id]=t:delete o[e.id],r[i].changed();else throw new Error(`Map or layer for source "${e.source}" not found.`)}}function hx(n,e){const t="getLayers"in n?id(n,e.source):[n];for(let r=0,i=t.length;r<i;++r){const s=t[r].get("mapbox-featurestate");if(s&&s[e.id])return s[e.id]}}class Qy extends An.Ay{constructor(e){super(mt.A.ERROR),this.error=e}}class fx extends mr{constructor(e){const t="declutter"in e?e.declutter:!0,r=new Os({state:"loading",format:new Fa({layerName:"mvt:layer"})});super({source:r,background:e.background===!1?null:e.background,declutter:t,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),e.accessToken&&(this.accessToken=e.accessToken);const i=e.styleUrl,s=[Zu(this,i,e.layers||e.source,{accessToken:this.accessToken})];this.getBackground()===void 0&&s.push(Vy(this,e.styleUrl,{accessToken:this.accessToken})),Promise.all(s).then(()=>{r.setState("ready")}).catch(o=>{this.dispatchEvent(new Qy(o)),this.getSource().setState("error")})}}const e0="background",t0="background-opacity",sd={url:"https://tiles.stadiamaps.com/styles/alidade_smooth.json"},n0=[{id:"maplibre",name:"MapLibre layer",description:"Add layer using MapLibre style.json URL",isBaseMap:!0,create:async(n,e,t,r)=>({init:()=>{const i={...e.config};i.url||(i.url=sd.url);const s=e.opacity??1,o=e.noRepeat??!1,a=new un.A({opacity:s}),l=()=>{if(o){const d=a.getLayers().item(0);if(d&&"getSource"in d&&typeof d.getSource=="function"){const h=d.getSource();h&&"setWrapX"in h&&typeof h.setWrapX=="function"&&h.setWrapX(!1)}}},c=async()=>{try{if(!i.url){console.warn("No URL provided for MapLibre style, layer will be empty");return}const d=await fetch(i.url);if(!d.ok){console.warn(`Failed to load MapLibre style from ${i.url}: ${d.status} ${d.statusText}`),await u();return}const h=await d.json();if(Array.isArray(h?.layers))for(const f of h.layers)f&&f.type===e0&&(f.paint=f.paint||{},f.paint[t0]=s);await rd(a,h,{styleUrl:i.url,accessToken:i.accessToken}),l()}catch(d){console.warn("Failed to parse or apply MapLibre style JSON:",d),await u()}},u=async()=>{try{if(!i.url){console.warn("No URL available for MapLibre fallback, layer will be empty");return}await rd(a,i.url,{accessToken:i.accessToken}),l()}catch(d){console.warn("Failed to load MapLibre style from both JSON and direct URL approaches:",d)}};return c(),a},registerOptionsUI:i=>{i.addTextInput({path:"config.url",name:"URL template",description:"URL to the styles.json file.",settings:{placeholder:sd.url}}).addTextInput({path:"config.accessToken",name:"Public access token",description:"Public access token for mapbox:// urls",settings:{placeholder:""}})}})}],r0='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class i0 extends xo{constructor(e){e=e||{};let t;e.attributions!==void 0?t=e.attributions:t=[r0];const r=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",i=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:r,interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:i,wrapX:e.wrapX,zDirection:e.zDirection})}}const s0=i0,ja=[...[{id:"osm-standard",name:"Open Street Map",description:"Add map from a collaborative free geographic world database",isBaseMap:!0,create:async(n,e,t)=>({init:()=>{const r=e.noRepeat??!1;return new Dr.A({source:new s0({wrapX:!r})})}})}],...Sf,...Af,...Cf,...n0];var Bt=class extends Re{constructor(e){e=e||{},e.strategy=al,super(e),this.setLoader(this._loader),this.set("time",e.time||new Date),this.set("step",e.step||1)}static _sunEclipticPosition(e){var t=Math.PI/180,r=e-2451545,i=280.46+.9856474*r;i%=360;var s=357.528+.9856003*r;s%=360;var o=i+1.915*Math.sin(s*t)+.02*Math.sin(2*s*t),a=1.00014-.01671*Math.cos(s*t)-.0014*Math.cos(2*s*t);return{lambda:o,R:a}}static _eclipticObliquity(e){var t=e-2451545,r=t/36525,i=23.43929111-r*(46.836769/3600-r*(1831e-7/3600+r*(.0020034/3600-r*(576e-9/3600-r*434e-10/3600))));return i}static _sunEquatorialPosition(e,t){var r=180/Math.PI,i=Math.PI/180,s=Math.atan(Math.cos(t*i)*Math.tan(e*i))*r,o=Math.asin(Math.sin(t*i)*Math.sin(e*i))*r,a=Math.floor(e/90)*90,l=Math.floor(s/90)*90;return s=s+(a-l),{alpha:s,delta:o}}static getNightLat(e,t){var r=180/Math.PI,i=Math.PI/180,s=t?new Date(t):new Date,o=s/864e5+24405875e-1,a=(18.697374558+24.06570982441908*(o-2451545))%24,l=Bt._sunEclipticPosition(o),c=Bt._eclipticObliquity(o),u=Bt._sunEquatorialPosition(l.lambda,c),d=a*15+e-u.alpha,h=Math.atan(-Math.cos(d*i)/Math.tan(u.delta*i))*r;return h}_loader(e,t,r){var i=this.getCoordinates(this.get("time")),s=new gt.Ay([i]);s.transform("EPSG:4326",r),this.addFeature(new _e.A(s))}setTime(e){this.set("time",e),this.refresh()}getSunPosition(e){var t=e?new Date(e):new Date,r=t/864e5+24405875e-1,i=(18.697374558+24.06570982441908*(r-2451545))%24,s=Bt._sunEclipticPosition(r),o=Bt._eclipticObliquity(r),a=Bt._sunEquatorialPosition(s.lambda,o);return[a.alpha-i*15,a.delta]}getCoordinates(e,t){for(var r=180/Math.PI,i=Math.PI/180,s=e?new Date(e):new Date,o=s/864e5+24405875e-1,a=(18.697374558+24.06570982441908*(o-2451545))%24,l=[],c=Bt._sunEclipticPosition(o),u=Bt._eclipticObliquity(o),d=Bt._sunEquatorialPosition(c.lambda,u),h=this.get("step")||1,f=-180;f<=180;f+=h){var p=f,g=a*15+p-d.alpha,m=Math.atan(-Math.cos(g*i)/Math.tan(d.delta*i))*r;l.push([p,m])}switch(t){case"line":break;case"day":d.delta*=-1;default:{m=d.delta<0?90:-90;for(var x=180;x>=-180;x-=h)l.push([x,m]);l.push(l[0]);break}}if(t==="daynight"){var w=[];l.forEach(function(b){w.push(b.slice())}),w[0][1]=-w[0][1],w[w.length-1][1]=-w[0][1],w[w.length-1][1]=-w[0][1],l=[l,w]}return l}};const o0=Bt;var a0=(n=>(n.From="from",n.To="to",n))(a0||{});const Nn={show:"to",sun:!1,nightColor:"#a7a6ba4D"},od="dayNight",vx={type:od,name:"",config:Nn,tooltip:!0},l0={id:od,name:"Night / Day",description:"Show day and night regions",isBaseMap:!1,create:async(n,e,t,r)=>{const i={...Nn,...e?.config},s=new o0({}),o=Object.getPrototypeOf(s),a=new Oe.A({source:s,style:new X.Ay({fill:new ae.A({color:r.visualization.getColorByName(i.nightColor)})})}),l=new Oe.A({source:new Re({features:[]}),style:new X.Ay({stroke:new oe.A({color:"#607D8B",width:1.5,lineDash:[2,3]})})}),c=new _e.A({geometry:new Ue.A([])}),u=new Oe.A({source:new Re({features:[c]}),style:new X.Ay({image:new Ht.A({radius:13,fill:new ae.A({color:"rgb(253,184,19)"})})})}),d=new _e.A({geometry:new Ue.A([])}),h=new X.Ay({image:new Ht.A({radius:13,stroke:new oe.A({color:"rgb(253,184,19)",width:1.5})})}),f=new X.Ay({image:new Ht.A({radius:15,stroke:new oe.A({color:"#607D8B",width:1.5,lineDash:[2,3]})})}),p=new Oe.A({source:new Re({features:[d]}),style:[f,h]}),g=new un.A({layers:i.sun?[a,u,p,l]:[a,l]}),m=new Er.yU;return{init:()=>g,dispose:()=>m.unsubscribe(),update:x=>{const w=new Date(x.timeRange.from.valueOf()),b=new Date(x.timeRange.to.valueOf());let T=new Date,S=[];i.show==="from"?T=w:T=b,s.setTime(T),i.sun&&(S=o.getSunPosition(T),c.getGeometry()?.setCoordinates((0,D.Rb)(S)))},registerOptionsUI:x=>{e.config?.nightColor||(e.config={...Nn,...e.config}),x.addRadio({path:"config.show",name:"Show",settings:{options:[{label:"From",value:"from"},{label:"To",value:"to"}]},defaultValue:Nn.show}),x.addColorPicker({path:"config.nightColor",name:"Night region color",description:"Pick color of night region",defaultValue:Nn.nightColor,settings:[{enableNamedColors:!1}]}),x.addBooleanSwitch({path:"config.sun",name:"Display sun",description:"Show the sun",defaultValue:Nn.sun})}}},defaultOptions:Nn};var ad=y(11854),ld=y(57532),cd=y(81160),ud=y(59427),c0=y(53685);const dd=(n,e)=>{const t=e.get(n.property);return(0,c0.c)(t,n.operation,n.value)};function hd(n){const e=new Set,t=new Set;n.some((i,s)=>{for(const o in i.getProperties()){if(o==="geometry")continue;t.add(o);const a=i.getGeometry();a&&e.add(a.getType())}return s>10});let r=_.W_.Any;if(e.size===1)switch(e.values().next().value){case"Point":case"MultiPoint":r=_.W_.Point;break;case"Line":case"MultiLine":r=_.W_.Line;break;case"Polygon":r=_.W_.Polygon}return{geometryType:r,propertes:Array.from(t.keys()).map(i=>({label:i,value:i}))}}function u0(n,e){const t=new Set;for(const i of n){const s=i.get(e);s!=null&&t.add(`${s}`)}const r=Array.from(t);return r.sort(),r}const vr={src:"public/maps/countries.geojson",rules:[],style:_.T5,dataStyle:{}},xx={style:_.T5,check:{property:"",operation:Ce.zT.EQ,value:""}},wx={type:"dynamic-geojson",name:"Dynamic GeoJSON",config:vr,tooltip:!0},d0={id:"dynamic-geojson",name:"Dynamic GeoJSON",description:"Style a geojson file based on query results",isBaseMap:!1,state:Li.pn.alpha,create:async(n,e,t,r)=>{const i={...vr,...e.config},s=new Re({url:i.src,format:new Ms.A}),o=new Fi.m,a=g=>{h0(s,g,i.idField,h)},l=s.on("change",()=>{s.getState()==="ready"&&((0,ad.e)(l),o.next(s.getFeatures()),f&&a(f))}),c=[];if(i.rules){for(const g of i.rules)if(g.style){const m=await Jt(g.style);c.push({state:m,rule:g.check})}}const u=await Jt(i.style);c.push({state:u});const d=await Jt(i.style),h=new Map;let f;const p=new Oe.A({source:s,style:g=>{const m=g.getId(),x=m!=null?h.get(String(m)):void 0,w=d.dims;if(x!==void 0&&w)return new X.Ay({fill:new ae.A({color:w.color?.get(x)}),stroke:new oe.A({color:d.base.color,width:d.base.lineWidth??1})});const b=g.getGeometry()?.getType()==="Point";for(const T of c)if(!(T.rule&&!dd(T.rule,g))){if(T.state.fields){const S={...T.state.base},{text:A}=T.state.fields;return A&&(S.text=`${g.get(A)}`),b?T.state.maker(S):Mr(S)}return b?(T.point||(T.point=T.state.maker(T.state.base)),T.point):(T.poly||(T.poly=Mr(T.state.base)),T.poly)}}});return{init:()=>p,update:g=>{const m=g.series[0];m&&(f=m,a(m),d.dims=(0,Pe.ue)(m,d,r,i.dataStyle)),p.changed()},registerOptionsUI:g=>{const m=o.pipe((0,ld.$)(),(0,cd.T)(x=>hd(x)));g.addSelect({path:"config.src",name:"GeoJSON URL",settings:{options:(0,Pe.G_)()??[],allowCustomValue:!0},defaultValue:vr.src}).addFieldNamePicker({path:"config.idField",name:"ID Field"}).addCustomEditor({id:"config.dataStyle",path:"config.dataStyle",name:"Data style",editor:hn,settings:{displayRotation:!1},defaultValue:vr.dataStyle}).addCustomEditor({id:"config.style",path:"config.style",name:"Default style",description:"The style to apply when no rules above match",editor:hn,settings:{simpleFixedValues:!0,layerInfo:m},defaultValue:vr.style})}}},defaultOptions:vr};function h0(n,e,t,r){if(!e||!t)return;const i=(0,ud.UI)(e,t);i&&(r.clear(),i.values.forEach((s,o)=>r.set(String(s),o)),n.forEachFeature(s=>{const o=s.getId();if(o!=null){const a=r.get(String(o));a!==void 0&&(s.set("frame",e),s.set("rowIndex",a))}}))}var f0=y(2863),fd=y(18105),si=y(19753);function pd(n,e){if(n&&!e){const r={label:`${n}`,value:n};return{options:[r],current:r}}e||(e=[]);let t=e.find(r=>r.value===n);return n&&!t&&(t={label:`${n} (not found)`,value:n},e.push(t)),{options:e,current:t}}const p0=({value:n,onChange:e,item:t,context:r})=>{const i=t.settings;if(!i)throw Error("Settings not found");const{features:s,layerInfo:o}=i,a=(0,Ii.A)(o),l=(0,Ii.A)(s),c=(0,U.useMemo)(()=>{const S=n?.check?.property;return S&&l&&n.check?.operation===Ce.zT.EQ?u0(l,S).map(A=>{let C;return!isNaN(Number(A))?C={value:Number(A),label:A}:C={value:A,label:A},C}):[]},[l,n]),u=(0,an.of)(g0),d=10,h=(0,U.useCallback)(S=>{e({...n,check:{...n.check,property:S?.value}})},[e,n]),f=(0,U.useCallback)(S=>{e({...n,check:{...n.check,operation:S.value??Ce.zT.EQ}})},[e,n]),p=(0,U.useCallback)(S=>{e({...n,check:{...n.check,value:S?.value}})},[e,n]),g=(0,U.useCallback)(S=>{e({...n,check:{...n.check,value:S}})},[e,n]),m=(0,U.useCallback)(S=>{e({...n,style:S})},[e,n]),x=(0,U.useCallback)(()=>{e(void 0)},[e]),w=n.check??gd.check,b=pd(w.property,a?.propertes),T=pd(w.value,c);return(0,v.jsxs)("div",{className:u.rule,children:[(0,v.jsxs)(bt.C,{className:u.row,children:[(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.style-rule-editor.label-rule","Rule"),labelWidth:d,grow:!0,children:(0,v.jsx)(Wn.l6,{placeholder:(0,E.t)("geomap.style-rule-editor.placeholder-feature-property","Feature property"),value:b.current,options:b.options,onChange:h,"aria-label":(0,E.t)("geomap.style-rule-editor.aria-label-feature-property","Feature property"),isClearable:!0,allowCustomValue:!0})}),(0,v.jsx)(qe.I,{className:u.inline,children:(0,v.jsx)(Wn.l6,{value:fd.N.find(S=>S.value===w.operation),options:fd.N,onChange:f,"aria-label":(0,E.t)("geomap.style-rule-editor.aria-label-comparison-operator","Comparison operator"),width:8})}),(0,v.jsx)(qe.I,{className:u.inline,grow:!0,children:(0,v.jsxs)("div",{className:u.flexRow,children:[(w.operation===Ce.zT.EQ||w.operation===Ce.zT.NEQ)&&(0,v.jsx)(Wn.l6,{placeholder:(0,E.t)("geomap.style-rule-editor.placeholder-value","value"),value:T.current,options:T.options,onChange:p,"aria-label":(0,E.t)("geomap.style-rule-editor.aria-label-comparison-value","Comparison value"),isClearable:!0,allowCustomValue:!0}),w.operation!==Ce.zT.EQ&&(0,v.jsx)(si.Q,{value:isNaN(Number(w.value))?0:Number(w.value),placeholder:(0,E.t)("geomap.style-rule-editor.placeholder-numeric-value","Numeric value"),onChange:g},`${w.property}/${w.operation}`)]})}),(0,v.jsx)(xi.$n,{size:"md",icon:"trash-alt",onClick:()=>x(),variant:"secondary","aria-label":(0,E.t)("geomap.style-rule-editor.aria-label-delete-style-rule","Delete style rule"),className:u.button})]}),(0,v.jsx)("div",{children:(0,v.jsx)(hn,{value:n.style??_.T5,context:r,onChange:m,item:{settings:{simpleFixedValues:!0,layerInfo:o}}})})]})},g0=n=>({rule:(0,K.css)({marginBottom:n.spacing(1)}),row:(0,K.css)({display:"flex",marginBottom:"4px"}),inline:(0,K.css)({marginBottom:0,marginLeft:"4px"}),button:(0,K.css)({marginLeft:"4px"}),flexRow:(0,K.css)({display:"flex",flexDirection:"row",alignItems:"flex-start"})}),m0=({value:n,onChange:e,context:t,item:r})=>{const i=(0,an.$j)(),s=r.settings,o=(0,U.useCallback)(()=>{const{palette:c}=i.visualization,u={fixed:c[Math.floor(Math.random()*c.length)]},d=[...n,{...gd,style:{..._.T5,color:u}}];e(d)},[e,n,i.visualization]),a=(0,U.useCallback)(c=>u=>{const d=[...n];u?d[c]=u:d.splice(c,1),e(d)},[e,n]),l=n&&n.map((c,u)=>{const d={settings:s};return(0,v.jsx)(p0,{value:c,onChange:a(u),context:t,item:d},`${u}-${c.check?.property}`)});return(0,v.jsxs)(v.Fragment,{children:[l,(0,v.jsx)(xi.$n,{size:"sm",icon:"plus",onClick:o,variant:"secondary","aria-label":(0,E.t)("geomap.geomap-style-rules-editor.aria-label-add-geomap-style-rule","Add geomap style rule"),children:"Add style rule"})]})},Gs={src:"public/maps/countries.geojson",rules:[],style:_.T5},gd={style:_.T5,check:{property:"",operation:Ce.zT.EQ,value:""}},y0={id:"geojson",name:"GeoJSON",description:"Load static data from a geojson file",isBaseMap:!1,create:async(n,e,t,r)=>{const i={...Gs,...e.config},s=(0,f0.w)().replace(i.src||""),a=s.startsWith("http")?s:`${window.__grafana_public_path__}${s.replace(/^(public\/)/,"")}`,l=new Re({url:a,format:new Ms.A}),c=new Fi.m,u=l.on("change",()=>{l.getState()==="ready"&&((0,ad.e)(u),c.next(l.getFeatures()))}),d=[];if(i.rules){for(const x of i.rules)if(x.style){const w=await Jt(x.style);d.push({state:w,rule:x.check})}}const h=await Jt(i.style);d.push({state:h});const f=Object.values(_.Sq),p=Object.values(_.yQ),g=Object.values(_.yu),m=new Oe.A({source:l,style:x=>{const w=x.getGeometry()?.getType(),b=w==="Point"||w==="MultiPoint",T=w==="Polygon"||w==="MultiPolygon",S=w==="LineString"||w==="MultiLineString";for(const A of d){if(A.rule&&!dd(A.rule,x))continue;if(A.state.fields){const R={...A.state.base},{text:j}=A.state.fields;return j&&(R.text=`${x.get(j)}`),b?A.state.maker(R):Mr(R)}const C=x.getProperties();if(T&&Object.keys(C).some(R=>f.includes(R))){const R={color:C[_.Sq.color]??A.state.base.color,opacity:C[_.Sq.opacity]??A.state.base.opacity,lineWidth:C[_.Sq.lineWidth]??A.state.base.lineWidth};return Mr(R)}else if(S&&Object.keys(C).some(R=>g.includes(R))){const R={color:C[_.yu.color]??A.state.base.color,lineWidth:C[_.yu.lineWidth]??A.state.base.lineWidth};return A.state.maker(R)}else if(b&&Object.keys(C).some(R=>p.includes(R))){const R={color:C[_.yQ.color]??A.state.base.color,size:C[_.yQ.size]??A.state.base.size};return A.state.maker(R)}return b?(A.point||(A.point=A.state.maker(A.state.base)),A.point):(A.poly||(A.poly=Mr(A.state.base)),A.poly)}}});return{init:()=>m,registerOptionsUI:x=>{const w=c.pipe((0,ld.$)(),(0,cd.T)(b=>hd(b)));x.addSelect({path:"config.src",name:"GeoJSON URL",settings:{options:(0,Pe.G_)()??[],allowCustomValue:!0,supportVariables:!0},defaultValue:Gs.src}).addCustomEditor({id:"config.style",path:"config.style",name:"Default style",description:"The style to apply when no rules above match",editor:hn,settings:{simpleFixedValues:!0,layerInfo:w},defaultValue:Gs.style}).addCustomEditor({id:"config.rules",path:"config.rules",name:"Style rules",description:"Apply styles based on feature properties",editor:m0,settings:{features:c,layerInfo:w},defaultValue:[]})}}},defaultOptions:Gs};var Gn=y(49825),Oa=y(25847),v0=y(1486),Bn=y(34835);class Bs{constructor(){this.globalCounter_=0,this.refToFeature_=new Map,this.uidToRef_=new Map,this.freeGlobalRef_=[],this.polygonBatch={entries:{},geometriesCount:0,verticesCount:0,ringsCount:0},this.pointBatch={entries:{},geometriesCount:0},this.lineStringBatch={entries:{},geometriesCount:0,verticesCount:0}}addFeatures(e,t){for(let r=0;r<e.length;r++)this.addFeature(e[r],t)}addFeature(e,t){let r=e.getGeometry();r&&(t&&(r=r.clone(),r.applyTransform(t)),this.addGeometry_(r,e))}clearFeatureEntryInPointBatch_(e){const t=(0,W.v6)(e),r=this.pointBatch.entries[t];if(r)return this.pointBatch.geometriesCount-=r.flatCoordss.length,delete this.pointBatch.entries[t],r}clearFeatureEntryInLineStringBatch_(e){const t=(0,W.v6)(e),r=this.lineStringBatch.entries[t];if(r)return this.lineStringBatch.verticesCount-=r.verticesCount,this.lineStringBatch.geometriesCount-=r.flatCoordss.length,delete this.lineStringBatch.entries[t],r}clearFeatureEntryInPolygonBatch_(e){const t=(0,W.v6)(e),r=this.polygonBatch.entries[t];if(r)return this.polygonBatch.verticesCount-=r.verticesCount,this.polygonBatch.ringsCount-=r.ringsCount,this.polygonBatch.geometriesCount-=r.flatCoordss.length,delete this.polygonBatch.entries[t],r}addGeometry_(e,t){const r=e.getType();switch(r){case"GeometryCollection":{const i=e.getGeometriesArray();for(const s of i)this.addGeometry_(s,t);break}case"MultiPolygon":{const i=e;this.addCoordinates_(r,i.getFlatCoordinates(),i.getEndss(),t,(0,W.v6)(t),i.getStride());break}case"MultiLineString":{const i=e;this.addCoordinates_(r,i.getFlatCoordinates(),i.getEnds(),t,(0,W.v6)(t),i.getStride());break}case"MultiPoint":{const i=e;this.addCoordinates_(r,i.getFlatCoordinates(),null,t,(0,W.v6)(t),i.getStride());break}case"Polygon":{const i=e;this.addCoordinates_(r,i.getFlatCoordinates(),i.getEnds(),t,(0,W.v6)(t),i.getStride());break}case"Point":{const i=e;this.addCoordinates_(r,i.getFlatCoordinates(),null,t,(0,W.v6)(t),i.getStride());break}case"LineString":case"LinearRing":{const i=e,s=i.getStride();this.addCoordinates_(r,i.getFlatCoordinates(),null,t,(0,W.v6)(t),s,i.getLayout?.());break}default:}}addCoordinates_(e,t,r,i,s,o,a){let l;switch(e){case"MultiPolygon":{const c=r;for(let u=0,d=c.length;u<d;u++){let h=c[u];const f=u>0?c[u-1]:null,p=f?f[f.length-1]:0,g=h[h.length-1];h=p>0?h.map(m=>m-p):h,this.addCoordinates_("Polygon",t.slice(p,g),h,i,s,o,a)}break}case"MultiLineString":{const c=r;for(let u=0,d=c.length;u<d;u++){const h=u>0?c[u-1]:0;this.addCoordinates_("LineString",t.slice(h,c[u]),null,i,s,o,a)}break}case"MultiPoint":for(let c=0,u=t.length;c<u;c+=o)this.addCoordinates_("Point",t.slice(c,c+2),null,i,s,null,null);break;case"Polygon":{const c=r;if(i instanceof Mt.Ay){const h=(0,Ru.yJ)(t,c);if(h.length>1){this.addCoordinates_("MultiPolygon",t,h,i,s,o,a);return}}this.polygonBatch.entries[s]||(this.polygonBatch.entries[s]=this.addRefToEntry_(s,{feature:i,flatCoordss:[],verticesCount:0,ringsCount:0,ringsVerticesCounts:[]})),l=t.length/o;const u=r.length,d=r.map((h,f,p)=>f>0?(h-p[f-1])/o:h/o);this.polygonBatch.verticesCount+=l,this.polygonBatch.ringsCount+=u,this.polygonBatch.geometriesCount++,this.polygonBatch.entries[s].flatCoordss.push(x0(t,o)),this.polygonBatch.entries[s].ringsVerticesCounts.push(d),this.polygonBatch.entries[s].verticesCount+=l,this.polygonBatch.entries[s].ringsCount+=u;for(let h=0,f=c.length;h<f;h++){const p=h>0?c[h-1]:0;this.addCoordinates_("LinearRing",t.slice(p,c[h]),null,i,s,o,a)}break}case"Point":this.pointBatch.entries[s]||(this.pointBatch.entries[s]=this.addRefToEntry_(s,{feature:i,flatCoordss:[]})),this.pointBatch.geometriesCount++,this.pointBatch.entries[s].flatCoordss.push(t);break;case"LineString":case"LinearRing":this.lineStringBatch.entries[s]||(this.lineStringBatch.entries[s]=this.addRefToEntry_(s,{feature:i,flatCoordss:[],verticesCount:0})),l=t.length/o,this.lineStringBatch.verticesCount+=l,this.lineStringBatch.geometriesCount++,this.lineStringBatch.entries[s].flatCoordss.push(w0(t,o,a)),this.lineStringBatch.entries[s].verticesCount+=l;break;default:}}addRefToEntry_(e,t){const r=this.uidToRef_.get(e),i=r||this.freeGlobalRef_.pop()||++this.globalCounter_;return t.ref=i,r||(this.refToFeature_.set(i,t.feature),this.uidToRef_.set(e,i)),t}removeRef_(e,t){if(!e)throw new Error("This feature has no ref: "+t);this.refToFeature_.delete(e),this.uidToRef_.delete(t),this.freeGlobalRef_.push(e)}changeFeature(e,t){if(!this.uidToRef_.get((0,W.v6)(e)))return;this.removeFeature(e);let r=e.getGeometry();r&&(t&&(r=r.clone(),r.applyTransform(t)),this.addGeometry_(r,e))}removeFeature(e){let t=this.clearFeatureEntryInPointBatch_(e);t=this.clearFeatureEntryInPolygonBatch_(e)||t,t=this.clearFeatureEntryInLineStringBatch_(e)||t,t&&this.removeRef_(t.ref,(0,W.v6)(t.feature))}clear(){this.polygonBatch.entries={},this.polygonBatch.geometriesCount=0,this.polygonBatch.verticesCount=0,this.polygonBatch.ringsCount=0,this.lineStringBatch.entries={},this.lineStringBatch.geometriesCount=0,this.lineStringBatch.verticesCount=0,this.pointBatch.entries={},this.pointBatch.geometriesCount=0,this.globalCounter_=0,this.freeGlobalRef_=[],this.refToFeature_.clear(),this.uidToRef_.clear()}getFeatureFromRef(e){return this.refToFeature_.get(e)}isEmpty(){return this.globalCounter_===0}filter(e){const t=new Bs;t.globalCounter_=this.globalCounter_,t.uidToRef_=this.uidToRef_,t.refToFeature_=this.refToFeature_;let r=!0;for(const i of this.refToFeature_.values())e(i)&&(t.addFeature(i),r=!1);return r?new Bs:t}}function x0(n,e){return e===2?n:n.filter((t,r)=>r%e<2)}function w0(n,e,t){return e===3&&t==="XYM"?n:e===4?n.filter((r,i)=>i%e!==2):e===3?n.map((r,i)=>i%e!==2?r:0):new Array(n.length*1.5).fill(0).map((r,i)=>i%3===2?0:n[Math.round(i/1.5)])}const b0=Bs;var md=y(409),yd=y(20259),dt=y(9777),$s=y(90130),S0=y(35339),Na=y(835),vd=y(3422);function Ga(n,e,t,r){let i=0;for(const s in e){const o=e[s],a=o.callback.call(t,t.feature);let l=a?.[0]??a;l===Oa.t7&&console.warn('The "has" operator might return false positives.'),l===void 0?l=Oa.t7:l===null&&(l=0),n[r+i++]=l,!(!o.size||o.size===1)&&(n[r+i++]=a[1],!(o.size<3)&&(n[r+i++]=a[2],!(o.size<4)&&(n[r+i++]=a[3])))}return i}function Vs(n){return Object.keys(n).reduce((e,t)=>e+(n[t].size||1),0)}function C0(n,e,t,r){const i=(2+Vs(t))*n.geometriesCount;(!e||e.length!==i)&&(e=new Float32Array(i));const s=[];let o=0;for(const a in n.entries){const l=n.entries[a];for(let c=0,u=l.flatCoordss.length;c<u;c++)s[0]=l.flatCoordss[c][0],s[1]=l.flatCoordss[c][1],(0,ue.Bb)(r,s),e[o++]=s[0],e[o++]=s[1],o+=Ga(e,t,l,o)}return e}function A0(n,e,t,r){const i=3*n.verticesCount+(1+Vs(t))*n.geometriesCount;(!e||e.length!==i)&&(e=new Float32Array(i));const s=[];let o=0;for(const a in n.entries){const l=n.entries[a];for(let c=0,u=l.flatCoordss.length;c<u;c++){s.length=l.flatCoordss[c].length,(0,so.Rc)(l.flatCoordss[c],0,s.length,3,r,s,3),o+=Ga(e,t,l,o),e[o++]=s.length/3;for(let d=0,h=s.length;d<h;d+=3)e[o++]=s[d],e[o++]=s[d+1],e[o++]=s[d+2]}}return e}function T0(n,e,t,r){const i=2*n.verticesCount+(1+Vs(t))*n.geometriesCount+n.ringsCount;(!e||e.length!==i)&&(e=new Float32Array(i));const s=[];let o=0;for(const a in n.entries){const l=n.entries[a];for(let c=0,u=l.flatCoordss.length;c<u;c++){s.length=l.flatCoordss[c].length,(0,so.Rc)(l.flatCoordss[c],0,s.length,2,r,s),o+=Ga(e,t,l,o),e[o++]=l.ringsVerticesCounts[c].length;for(let d=0,h=l.ringsVerticesCounts[c].length;d<h;d++)e[o++]=l.ringsVerticesCounts[c][d];for(let d=0,h=s.length;d<h;d+=2)e[o++]=s[d],e[o++]=s[d+1]}}return e}var xd=y(71259);const E0=[];let Ba;function _0(){return Ba||(Ba=(0,S0.v)()),Ba}let F0=0;const $t={POSITION:"a_position",INDEX:"a_index",SEGMENT_START:"a_segmentStart",SEGMENT_END:"a_segmentEnd",MEASURE_START:"a_measureStart",MEASURE_END:"a_measureEnd",PARAMETERS:"a_parameters",JOIN_ANGLES:"a_joinAngles",DISTANCE:"a_distance"};class I0{constructor(e,t,r,i,s){this.helper_,this.hitDetectionEnabled_=!!i;let o=e;if(!("builder"in e)){const u=e,d=(0,xd.my)(u.style,t,u.filter);o={builder:d.builder,attributes:d.attributes,uniforms:d.uniforms}}this.fillProgram_,this.strokeProgram_,this.symbolProgram_,this.hasFill_=!!o.builder.getFillVertexShader(),this.hasFill_&&(this.fillVertexShader_=o.builder.getFillVertexShader(),this.fillFragmentShader_=o.builder.getFillFragmentShader()),this.hasStroke_=!!o.builder.getStrokeVertexShader(),this.hasStroke_&&(this.strokeVertexShader_=o.builder.getStrokeVertexShader(),this.strokeFragmentShader_=o.builder.getStrokeFragmentShader()),this.hasSymbol_=!!o.builder.getSymbolVertexShader(),this.hasSymbol_&&(this.symbolVertexShader_=o.builder.getSymbolVertexShader(),this.symbolFragmentShader_=o.builder.getSymbolFragmentShader()),this.featureFilter_=null,s&&(this.featureFilter_=this.computeFeatureFilter(s));const l=this.hitDetectionEnabled_?{hitColor:{callback(){return(0,vd.b)(this.ref,E0)},size:4}}:{};this.customAttributes_=Object.assign({},l,o.attributes),this.uniforms_=o.uniforms;const c=Object.entries(this.customAttributes_).map(([u,d])=>({name:`a_${u}`,size:d.size||1,type:dt.jQ.FLOAT}));this.polygonAttributesDesc_=[{name:$t.POSITION,size:2,type:dt.jQ.FLOAT},...c],this.lineStringAttributesDesc_=[{name:$t.SEGMENT_START,size:2,type:dt.jQ.FLOAT},{name:$t.MEASURE_START,size:1,type:dt.jQ.FLOAT},{name:$t.SEGMENT_END,size:2,type:dt.jQ.FLOAT},{name:$t.MEASURE_END,size:1,type:dt.jQ.FLOAT},{name:$t.JOIN_ANGLES,size:2,type:dt.jQ.FLOAT},{name:$t.DISTANCE,size:1,type:dt.jQ.FLOAT},{name:$t.PARAMETERS,size:1,type:dt.jQ.FLOAT},...c],this.pointAttributesDesc_=[{name:$t.POSITION,size:2,type:dt.jQ.FLOAT},{name:$t.INDEX,size:1,type:dt.jQ.FLOAT},...c],this.setHelper(r)}computeFeatureFilter(e){const t=(0,Gn.SR)();let r;try{r=(0,md.n)(e,Gn.T8,t)}catch{return null}if(t.mapState||t.variables.size>0)return null;const i=(0,md.A)();return s=>{if(i.properties=s.getPropertiesInternal(),t.featureId){const o=s.getId();o!==void 0?i.featureId=o:i.featureId=null}return i.geometryType=(0,Gn.Ye)(s.getGeometry()),r(i)}}async generateBuffers(e,t){let r=e;if(this.featureFilter_&&(r=r.filter(this.featureFilter_),r.isEmpty()))return null;const i=this.generateRenderInstructions_(r,t),[s,o,a]=await Promise.all([this.generateBuffersForType_(i.polygonInstructions,"Polygon",t),this.generateBuffersForType_(i.lineStringInstructions,"LineString",t),this.generateBuffersForType_(i.pointInstructions,"Point",t)]),l=(0,ue.T9)((0,ue.vt)(),t);return{polygonBuffers:s,lineStringBuffers:o,pointBuffers:a,invertVerticesTransform:l}}generateRenderInstructions_(e,t){const r=this.hasFill_?T0(e.polygonBatch,new Float32Array(0),this.customAttributes_,t):null,i=this.hasStroke_?A0(e.lineStringBatch,new Float32Array(0),this.customAttributes_,t):null,s=this.hasSymbol_?C0(e.pointBatch,new Float32Array(0),this.customAttributes_,t):null;return{polygonInstructions:r,lineStringInstructions:i,pointInstructions:s}}generateBuffersForType_(e,t,r){if(e===null)return null;const i=F0++;let s;switch(t){case"Polygon":s=Na.x.GENERATE_POLYGON_BUFFERS;break;case"LineString":s=Na.x.GENERATE_LINE_STRING_BUFFERS;break;case"Point":s=Na.x.GENERATE_POINT_BUFFERS;break;default:}const o={id:i,type:s,renderInstructions:e.buffer,renderInstructionsTransform:r,customAttributesSize:Vs(this.customAttributes_)},a=_0();return a.postMessage(o,[e.buffer]),e=null,new Promise(l=>{const c=u=>{const d=u.data;if(d.id!==i||(a.removeEventListener("message",c),!this.helper_.getGL()))return;const h=new yd.Ay($s.H7,$s.Be).fromArrayBuffer(d.vertexBuffer),f=new yd.Ay($s.IP,$s.Be).fromArrayBuffer(d.indexBuffer);this.helper_.flushBufferData(h),this.helper_.flushBufferData(f),l([f,h])};a.addEventListener("message",c)})}render(e,t,r){this.hasFill_&&this.renderInternal_(e.polygonBuffers[0],e.polygonBuffers[1],this.fillProgram_,this.polygonAttributesDesc_,t,r),this.hasStroke_&&this.renderInternal_(e.lineStringBuffers[0],e.lineStringBuffers[1],this.strokeProgram_,this.lineStringAttributesDesc_,t,r),this.hasSymbol_&&this.renderInternal_(e.pointBuffers[0],e.pointBuffers[1],this.symbolProgram_,this.pointAttributesDesc_,t,r)}renderInternal_(e,t,r,i,s,o){const a=e.getSize();a!==0&&(this.helper_.useProgram(r,s),this.helper_.bindBuffer(t),this.helper_.bindBuffer(e),this.helper_.enableAttributes(i),o(),this.helper_.drawElements(0,a))}setHelper(e,t=null){this.helper_=e,this.hasFill_&&(this.fillProgram_=this.helper_.getProgram(this.fillFragmentShader_,this.fillVertexShader_)),this.hasStroke_&&(this.strokeProgram_=this.helper_.getProgram(this.strokeFragmentShader_,this.strokeVertexShader_)),this.hasSymbol_&&(this.symbolProgram_=this.helper_.getProgram(this.symbolFragmentShader_,this.symbolVertexShader_)),this.helper_.addUniforms(this.uniforms_),t&&(t.polygonBuffers&&(this.helper_.flushBufferData(t.polygonBuffers[0]),this.helper_.flushBufferData(t.polygonBuffers[1])),t.lineStringBuffers&&(this.helper_.flushBufferData(t.lineStringBuffers[0]),this.helper_.flushBufferData(t.lineStringBuffers[1])),t.pointBuffers&&(this.helper_.flushBufferData(t.pointBuffers[0]),this.helper_.flushBufferData(t.pointBuffers[1])))}}const R0=I0;var $a=y(83954),P0=y(89940),k0=y(38111),M0=y(49189);const xr={...dt.M8,RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",GLOBAL_ALPHA:"u_globalAlpha"};class L0 extends k0.A{constructor(e,t){const r={[xr.RENDER_EXTENT]:[0,0,0,0],[xr.PATTERN_ORIGIN]:[0,0],[xr.GLOBAL_ALPHA]:1};super(e,{uniforms:r,postProcesses:t.postProcesses}),this.hitDetectionEnabled_=!t.disableHitDetection,this.hitRenderTarget_,this.sourceRevision_=-1,this.previousExtent_=(0,M.S5)(),this.currentTransform_=(0,ue.vt)(),this.tmpCoords_=[0,0],this.tmpTransform_=(0,ue.vt)(),this.tmpMat4_=(0,$a.vt)(),this.currentFrameStateTransform_=(0,ue.vt)(),this.styleVariables_={},this.styles_=[],this.styleRenderers_=[],this.buffers_=[],this.applyOptions_(t),this.batch_=new b0,this.initialFeaturesAdded_=!1,this.sourceListenKeys_=null}addInitialFeatures_(e){const t=this.getLayer().getSource(),r=(0,D.Tf)();let i;r&&(i=(0,D.FO)(r,e.viewState.projection)),this.batch_.addFeatures(t.getFeatures(),i),this.sourceListenKeys_=[(0,xt.KT)(t,Fe.A.ADDFEATURE,this.handleSourceFeatureAdded_.bind(this,i)),(0,xt.KT)(t,Fe.A.CHANGEFEATURE,this.handleSourceFeatureChanged_.bind(this,i),this),(0,xt.KT)(t,Fe.A.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),(0,xt.KT)(t,Fe.A.CLEAR,this.handleSourceFeatureClear_,this)]}applyOptions_(e){this.styleVariables_=e.variables,this.styles_=(0,xd.iA)(e.style)}createRenderers_(){this.buffers_=[],this.styleRenderers_=this.styles_.map(e=>new R0(e,this.styleVariables_,this.helper,this.hitDetectionEnabled_,"filter"in e?e.filter:null))}reset(e){this.applyOptions_(e),this.helper&&this.createRenderers_(),super.reset(e)}afterHelperCreated(){this.styleRenderers_.length?this.styleRenderers_.forEach((e,t)=>e.setHelper(this.helper,this.buffers_[t])):this.createRenderers_(),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new P0.A(this.helper))}handleSourceFeatureAdded_(e,t){const r=t.feature;this.batch_.addFeature(r,e)}handleSourceFeatureChanged_(e,t){const r=t.feature;this.batch_.changeFeature(r,e)}handleSourceFeatureDelete_(e){const t=e.feature;this.batch_.removeFeature(t)}handleSourceFeatureClear_(){this.batch_.clear()}applyUniforms_(e){(0,ue.k3)(this.tmpTransform_,this.currentFrameStateTransform_),(0,ue.lw)(this.tmpTransform_,e),this.helper.setUniformMatrixValue(xr.PROJECTION_MATRIX,(0,$a.Z1)(this.tmpMat4_,this.tmpTransform_)),(0,ue.T9)(this.tmpTransform_,this.tmpTransform_),this.helper.setUniformMatrixValue(xr.SCREEN_TO_WORLD_MATRIX,(0,$a.Z1)(this.tmpMat4_,this.tmpTransform_)),this.tmpCoords_[0]=0,this.tmpCoords_[1]=0,(0,ue.T9)(this.tmpTransform_,e),(0,ue.Bb)(this.tmpTransform_,this.tmpCoords_),this.helper.setUniformFloatVec2(xr.PATTERN_ORIGIN,this.tmpCoords_)}renderFrame(e){const t=this.helper.getGL();this.preRender(t,e);const[r,i,s]=(0,M0.v)(e,this.getLayer());this.helper.prepareDraw(e),this.renderWorlds(e,!1,r,i,s),this.helper.finalizeDraw(e,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const o=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderWorlds(e,!0,r,i,s),this.hitRenderTarget_.clearCachedData()),this.postRender(t,e),o}prepareFrameInternal(e){this.initialFeaturesAdded_||(this.addInitialFeatures_(e),this.initialFeaturesAdded_=!0);const t=this.getLayer(),r=t.getSource(),i=e.viewState,s=!e.viewHints[vn.A.ANIMATING]&&!e.viewHints[vn.A.INTERACTING],o=!(0,M.aI)(this.previousExtent_,e.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),s&&(o||a)){const l=i.projection,c=i.resolution,u=t instanceof Pa.A?t.getRenderBuffer():0,d=(0,M.r)(e.extent,u*c),h=(0,D.Tf)();h?r.loadFeatures((0,D.JR)(d,h),(0,D.vN)(c,l),h):r.loadFeatures(d,c,l),this.ready=!1;const f=this.helper.makeProjectionTransform(e,(0,ue.vt)()),p=this.styleRenderers_.map((g,m)=>g.generateBuffers(this.batch_,f).then(x=>{this.buffers_[m]&&this.disposeBuffers(this.buffers_[m]),this.buffers_[m]=x}));Promise.all(p).then(()=>{this.ready=!0,this.getLayer().changed()}),this.previousExtent_=e.extent.slice()}return!0}renderWorlds(e,t,r,i,s){let o=r;t&&(this.hitRenderTarget_.setSize([Math.floor(e.size[0]/2),Math.floor(e.size[1]/2)]),this.helper.prepareDrawToRenderTarget(e,this.hitRenderTarget_,!0));do{this.helper.makeProjectionTransform(e,this.currentFrameStateTransform_),(0,ue.Tl)(this.currentFrameStateTransform_,o*s,0);for(let a=0,l=this.styleRenderers_.length;a<l;a++){const c=this.styleRenderers_[a],u=this.buffers_[a];u&&c.render(u,e,()=>{this.applyUniforms_(u.invertVerticesTransform),this.helper.applyHitDetectionUniform(t)})}}while(++o<i)}forEachFeatureAtCoordinate(e,t,r,i,s){if((0,vt.v)(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has been disabled using the `disableHitDetection: true` option."),!this.styleRenderers_.length||!this.hitDetectionEnabled_)return;const o=(0,ue.Bb)(t.coordinateToPixelTransform,e.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),l=[a[0]/255,a[1]/255,a[2]/255,a[3]/255],c=(0,vd.L)(l),u=this.batch_.getFeatureFromRef(c);if(u)return i(u,this.getLayer(),null)}disposeBuffers(e){const t=r=>{for(const i of r)i&&this.helper.deleteBuffer(i)};e.pointBuffers&&t(e.pointBuffers),e.lineStringBuffers&&t(e.lineStringBuffers),e.polygonBuffers&&t(e.polygonBuffers)}disposeInternal(){this.buffers_.forEach(e=>{e&&this.disposeBuffers(e)}),this.sourceListenKeys_&&(this.sourceListenKeys_.forEach(function(e){(0,xt.JH)(e)}),this.sourceListenKeys_=null),super.disposeInternal()}renderDeclutter(){}}const z0=L0,en={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},D0=["#00f","#0ff","#0f0","#ff0","#f00"];class j0 extends Pa.A{constructor(e){e=e||{};const t=Object.assign({},e);delete t.gradient,delete t.radius,delete t.blur,delete t.weight,super(t),this.filter_=e.filter??!0,this.styleVariables_=e.variables||{},this.gradient_=null,this.addChangeListener(en.GRADIENT,this.handleGradientChanged_),this.setGradient(e.gradient?e.gradient:D0),this.setBlur(e.blur!==void 0?e.blur:15),this.setRadius(e.radius!==void 0?e.radius:8);const r=e.weight?e.weight:"weight";this.weight_=r,this.setRenderOrder(null)}getBlur(){return this.get(en.BLUR)}getGradient(){return this.get(en.GRADIENT)}getRadius(){return this.get(en.RADIUS)}handleGradientChanged_(){this.gradient_=O0(this.getGradient())}setBlur(e){const t=this.get(en.BLUR);if(this.set(en.BLUR,e),typeof e=="number"&&typeof t=="number"){this.changed();return}this.clearRenderer()}setGradient(e){this.set(en.GRADIENT,e)}setRadius(e){const t=this.get(en.RADIUS);if(this.set(en.RADIUS,e),typeof e=="number"&&typeof t=="number"){this.changed();return}this.clearRenderer()}setFilter(e){this.filter_=e,this.changed(),this.clearRenderer()}setWeight(e){this.weight_=e,this.changed(),this.clearRenderer()}createRenderer(){const e=new v0.N,t=(0,Oa.z0)(),r=(0,Bn.s2)(t,this.filter_,Gn.T8);let i=(0,Bn.s2)(t,this.getRadius(),Gn.wl),s=(0,Bn.s2)(t,this.getBlur(),Gn.wl);const o={};typeof this.getBlur()=="number"&&(s="a_blur",o.a_blur=()=>this.getBlur(),e.addUniform("a_blur","float")),typeof this.getRadius()=="number"&&(i="a_radius",o.a_radius=()=>this.getRadius(),e.addUniform("a_radius","float"));const a={};let l=null;if(typeof this.weight_=="string"||typeof this.weight_=="function"){const d=typeof this.weight_=="string"?h=>h.get(this.weight_):this.weight_;a.prop_weight={size:1,callback:h=>{const f=d(h);return f!==void 0?(0,Se.qE)(f,0,1):1}},l="a_prop_weight",e.addAttribute("a_prop_weight","float")}else{const d=["clamp",this.weight_,0,1];l=(0,Bn.s2)(t,d,Gn.wl)}e.addFragmentShaderFunction(`float getBlurSlope() { float blur = max(1., ${s}); float radius = ${i}; return radius / blur; }`).setSymbolSizeExpression(`vec2(${i} + ${s}) * 2.`).setSymbolColorExpression(`vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * getBlurSlope()) * ${l})`).setStrokeColorExpression(`vec4(smoothstep(0., 1., (1. - length(currentRadiusPx * 2. / v_width)) * getBlurSlope()) * ${l})`).setStrokeWidthExpression(`(${i} + ${s}) * 2.`).setFillColorExpression(`vec4(${l})`).setFragmentDiscardExpression(`!${r}`),(0,Bn.mf)(e,t);const c=(0,Bn.mh)(t),u=(0,Bn.kc)(t,this.styleVariables_);return new z0(this,{className:this.getClassName(),variables:this.styleVariables_,style:{builder:e,attributes:{...c,...a},uniforms:{...u,...o}},disableHitDetection:!1,postProcesses:[{fragmentShader:` precision mediump float; uniform sampler2D u_image; uniform sampler2D u_gradientTexture; uniform float u_opacity; varying vec2 v_texCoord; void main() { vec4 color = texture2D(u_image, v_texCoord); gl_FragColor.a = color.a * u_opacity; gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb; gl_FragColor.rgb *= gl_FragColor.a; }`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}renderDeclutter(){}}function O0(n){const r=(0,yr.Y)(1,256),i=r.createLinearGradient(0,0,1,256),s=1/(n.length-1);for(let o=0,a=n.length;o<a;++o)i.addColorStop(o*s,n[o]);return r.fillStyle=i,r.fillRect(0,0,1,256),r.canvas}const N0=j0;var G0=y(88011);const Us={weight:{fixed:1,min:0,max:1},blur:15,radius:5},B0={id:"heatmap",name:"Heatmap",description:"Visualizes a heatmap of the data",isBaseMap:!1,showLocation:!0,create:async(n,e,t,r)=>{const i={...Us,...e.config},s=await(0,wt.nE)(e.location),o=new kr(s),a="_weight",l=new N0({source:o,blur:i.blur,radius:i.radius,weight:c=>c.get(a)});return{init:()=>l,update:c=>{const u=c.series[0];if(!u)return;o.update(u);const d=(0,G0.hX)(u,i.weight);o.forEachFeature(p=>{const g=p.get("rowIndex");g!=null&&p.set(a,d.get(g))});let h=["#00f","#0ff","#0f0","#ff0","#f00"];const f=d.field??u.fields.find(p=>p.type===_r.PU.number);if(f){const p=(0,bl.Qi)(f);p.isContinuous&&p.getColors&&(h=p.getColors(r))}l.setGradient(h)},registerOptionsUI:c=>{c.addCustomEditor({id:"config.weight",path:"config.weight",name:"Weight values",description:"Scale the distribution for each row",editor:Fl.g,settings:{min:0,max:1,hideRange:!0},defaultValue:{fixed:1,min:0,max:1}}).addSliderInput({path:"config.radius",description:"Configures the size of clusters",name:"Radius",defaultValue:Us.radius,settings:{min:1,max:50,step:1}}).addSliderInput({path:"config.blur",description:"Configures the amount of blur of clusters",name:"Blur",defaultValue:Us.blur,settings:{min:1,max:50,step:1}})}}},defaultOptions:Us},wd={icon:"https://openlayers.org/en/latest/examples/data/icon.png"},$0={id:"last-point-tracker",name:"Icon at last point",description:"Show an icon at the last point",isBaseMap:!1,showLocation:!0,state:Li.pn.alpha,create:async(n,e,t,r)=>{const i=new _e.A({}),s={...wd,...e.config};i.setStyle(new X.Ay({image:new Pi.A({src:s.icon})}));const o=new Re({features:[i]}),a=new yt.A({source:o}),l=await(0,wt.nE)(e.location);return{init:()=>a,update:c=>{const u=c.series[0];if(u&&u.length){const d=(0,wt.FM)(u,l);if(!d.field)return;i.setGeometry(d.field.values[u.length-1])}}}},defaultOptions:wd};var wr=y(89352),ht=function(n,e){var t=n[0]-e[0],r=n[1]-e[1];return Math.sqrt(t*t+r*r)},Va=function(n,e){return n[0]==e[0]&&n[1]==e[1]},bx=function(n){return V0(n.getGeometry())},V0=function(n){switch(n.getType()){case"Point":return n.getCoordinates();case"MultiPolygon":n=n.getPolygon(0);case"Polygon":return n.getInteriorPoint().getCoordinates();default:return n.getClosestPoint(ol_extent_getCenter(n.getExtent()))}},Sx=function(n,e){var t=[],r=n.length-1,i=r,s,o,a,l,c,u,d,h,f,p,g,m,x,w=Va(n[0],n[r]);w||(g=n[0],m=n[1],x=[g[0]+(m[1]-g[1])/ht(g,m)*e,g[1]-(m[0]-g[0])/ht(g,m)*e],t.push(x),n.push(n[r]),r++,i--);for(var b=0;b<i;b++)g=n[b],m=n[(b+1)%r],x=n[(b+2)%r],s=(m[1]-g[1])/(m[0]-g[0]),o=(x[1]-m[1])/(x[0]-m[0]),Math.abs(s-o)>1e-10&&(a=Math.sqrt((m[0]-g[0])*(m[0]-g[0])+(m[1]-g[1])*(m[1]-g[1])),l=Math.sqrt((x[0]-m[0])*(x[0]-m[0])+(x[1]-m[1])*(x[1]-m[1])),c=g[0]+e*(m[1]-g[1])/a,u=m[0]+e*(x[1]-m[1])/l,d=g[1]-e*(m[0]-g[0])/a,h=m[1]-e*(x[0]-m[0])/l,f=(o*u-s*c+d-h)/(o-s),p=(s*o*(u-c)+o*d-s*h)/(o-s),m[0]-g[0]==0&&(f=m[0]+e*(m[1]-g[1])/Math.abs(m[1]-g[1]),p=o*f-o*u+h),x[0]-m[0]==0&&(f=x[0]+e*(x[1]-m[1])/Math.abs(x[1]-m[1]),p=s*f-s*c+d),t.push([f,p]));return w?t.push(t[0]):(n.pop(),g=n[n.length-1],m=n[n.length-2],x=[g[0]-(m[1]-g[1])/ht(g,m)*e,g[1]+(m[0]-g[0])/ht(g,m)*e],t.push(x)),t},Cx=function(n,e){for(var t=0;t<e.length-1;t++){var r=e[t],i=e[t+1];if(Va(n,r)||Va(n,i))return{index:1,segment:[r,i]};var s=ht(r,i),o=[(i[0]-r[0])/s,(i[1]-r[1])/s],a=ht(r,n),l=[(n[0]-r[0])/a,(n[1]-r[1])/a];if(Math.abs(o[0]*l[1]-o[1]*l[0])<1e-10)return{index:1,segment:[r,i]}}return{index:-1}},Ax=function(n,e,t){for(var r,i,s=[],o=0;o<n.length-1;o++)!n[o].length||!n[o+1].length||(n[o][1]<=e&&n[o+1][1]>e||n[o][1]>=e&&n[o+1][1]<e)&&(i=(e-n[o][1])/(n[o+1][1]-n[o][1]),r=i*(n[o+1][0]-n[o][0])+n[o][0],s.push({contour:t,index:o,pt:[r,e],abs:i}));s.sort(function(c,u){return c.pt[0]-u.pt[0]});for(var a=[],l=0;l<s.length-1;l+=2)a.push([s[l],s[l+1]]);return a},Tx=function(n,e){switch(n){case"LineString":return new ol_geom_LineString(e);case"LinearRing":return new ol_geom_LinearRing(e);case"MultiLineString":return new ol_geom_MultiLineString(e);case"MultiPoint":return new ol_geom_MultiPoint(e);case"MultiPolygon":return new ol_geom_MultiPolygon(e);case"Point":return new ol_geom_Point(e);case"Polygon":return new ol_geom_Polygon(e);default:return console.error("[createFromType] Unsupported type: "+n),null}},Ex=function(n,e){var t=n[1][0]-n[0][0],r=n[1][1]-n[0][1],i=e[1][0]-e[0][0],s=e[1][1]-e[0][1],o=t*s-r*i;if(o!=0){var a=(t*n[0][1]-t*e[0][1]-r*n[0][0]+r*e[0][0])/o;return[e[0][0]+a*i,e[0][1]+a*s]}else return!1},bd;(function(){function n(t,r){var i;for(let s=t.length-1;s>0;s--)(t[s][0]>r&&t[s-1][0]<r||t[s][0]<r&&t[s-1][0]>r)&&(i=[r,(r-t[s][0])/(t[s-1][0]-t[s][0])*(t[s-1][1]-t[s][1])+t[s][1]],t.splice(s,0,i))}function e(t,r){var i;for(let s=t.length-1;s>0;s--)(t[s][1]>r&&t[s-1][1]<r||t[s][1]<r&&t[s-1][1]>r)&&(i=[(r-t[s][1])/(t[s-1][1]-t[s][1])*(t[s-1][0]-t[s][0])+t[s][0],r],t.splice(s,0,i))}bd=function(t,r){var i=r.getType()==="Polygon";if(!i&&r.getType()!=="MultiPolygon")return null;var s=r.getCoordinates();return i&&(s=[s]),s.forEach(function(o){o.forEach(function(a){n(a,t[0]),n(a,t[2]),e(a,t[1]),e(a,t[3])})}),s.forEach(function(o){o.forEach(function(a){a.forEach(function(l){l[0]<t[0]?l[0]=t[0]:l[0]>t[2]&&(l[0]=t[2]),l[1]<t[1]?l[1]=t[1]:l[1]>t[3]&&(l[1]=t[3])})})}),i?new gt.Ay(s[0]):new Tn.A(s)}})();var Ws=function(n,e,t,r){var i=[];r!==!1&&i.push(n);var s=ht(n,e);if(s){var o=Math.round(s/t);if(o>1)for(var a=(e[0]-n[0])/o,l=(e[1]-n[1])/o,c=1;c<o;c++)i.push([n[0]+a*c,n[1]+l*c])}return i.push(e),i};je.A.prototype.sampleAt=function(n){for(var e=this.getCoordinates(),t=[],r=1;r<e.length;r++)t=t.concat(Ws(e[r-1],e[r],n,r===1));return new je.A(t)},Rr.A.prototype.sampleAt=function(n){var e=this.getCoordinates(),t=[];return e.forEach(function(r){for(var i=[],s=1;s<r.length;s++)i=i.concat(Ws(r[s-1],r[s],n,s===1));t.push(i)}),new Rr.A(t)},gt.Ay.prototype.sampleAt=function(n){var e=this.getCoordinates(),t=[];return e.forEach(function(r){for(var i=[],s=1;s<r.length;s++)i=i.concat(Ws(r[s-1],r[s],n,s===1));t.push(i)}),new gt.Ay(t)},Tn.A.prototype.sampleAt=function(n){var e=this.getCoordinates(),t=[];return e.forEach(function(r){var i=[];t.push(i),r.forEach(function(s){for(var o=[],a=1;a<s.length;a++)o=o.concat(Ws(s[a-1],s[a],n,a===1));i.push(o)})}),new Tn.A(t)},pl.prototype.intersection=function(n,e){if(n.sampleAt){var t=(0,M.r)(this.getCenter().concat(this.getCenter()),this.getRadius());n=bd(t,n),n=n.simplify(e);var r=this.getCenter(),i=this.getRadius(),s=n.sampleAt(e).getCoordinates();switch(n.getType()){case"Polygon":s=[s];case"MultiPolygon":{var o=!1,a=[];return s.forEach(function(l){var c=[];a.push(c),l.forEach(function(u){var d=[];c.push(d),u.forEach(function(h){var f=ht(r,h);f>i?(o=!0,d.push([r[0]+i/f*(h[0]-r[0]),r[1]+i/f*(h[1]-r[1])])):d.push(h)})})}),o?n.getType()==="Polygon"?new gt.Ay(a[0]):new Tn.A(a):n}}}else console.warn("[ol/geom/Circle~intersection] Unsupported geometry type: "+n.getType());return n};var U0=class extends X.Ay{constructor(e){e=e||{},super({stroke:e.stroke,text:e.text,zIndex:e.zIndex,geometry:e.geometry}),this.setRenderer(this._render.bind(this)),this._visible=e.visible!==!1,typeof e.width=="function"?this._widthFn=e.width:this.setWidth(e.width),this.setWidth2(e.width2),typeof e.color=="function"?this._colorFn=e.color:this.setColor(e.color),this.setColor2(e.color2),this.setLineCap(e.lineCap),this.setArrow(e.arrow),this.setArrowSize(e.arrowSize),this.setArrowColor(e.arrowColor),this._offset=[0,0],this.setOffset(e.offset0,0),this.setOffset(e.offset1,1),this._noOverlap=e.noOverlap}setWidth(e){this._width=e||0}setWidth2(e){this._width2=e}getOffset(e){return this._offset[e]}setOffset(e,t){switch(e=Math.max(0,parseFloat(e)),t){case 0:{this._offset[0]=e;break}case 1:{this._offset[1]=e;break}}}setLineCap(e){this._lineCap=e==="round"?"round":"butt"}getWidth(e,t){if(this._widthFn)return this._widthFn(e,t);var r=typeof this._width2=="number"?this._width2:this._width;return this._width+(r-this._width)*t}setColor(e){try{this._color=(0,wr._j)(e)}catch{this._color=[0,0,0,1]}}setColor2(e){try{this._color2=(0,wr._j)(e)}catch{this._color2=null}}setArrowColor(e){try{this._acolor=(0,wr.oJ)(e)}catch{this._acolor=null}}getColor(e,t){if(this._colorFn)return(0,wr.oJ)(this._colorFn(e,t));var r=this._color,i=this._color2||this._color;return"rgba("+ +Math.round(r[0]+(i[0]-r[0])*t)+","+Math.round(r[1]+(i[1]-r[1])*t)+","+Math.round(r[2]+(i[2]-r[2])*t)+","+(r[3]+(i[3]-r[3])*t)+")"}getArrow(){return this._arrow}setArrow(e){this._arrow=parseInt(e),(this._arrow<-1||this._arrow>2)&&(this._arrow=0)}getArrowSize(){return this._arrowSize||[16,16]}setArrowSize(e){Array.isArray(e)?this._arrowSize=e:typeof e=="number"&&(this._arrowSize=[e,e])}drawArrow(e,t,r,i,s){var o=this.getArrowSize()[0]*s,a=ht(t,r),l=(t[0]-r[0])/a,c=(t[1]-r[1])/a;i=Math.max(this.getArrowSize()[1]/2,i/2)*s,e.beginPath(),e.moveTo(t[0],t[1]),e.lineTo(t[0]-o*l+i*c,t[1]-o*c-i*l),e.lineTo(t[0]-o*l-i*c,t[1]-o*c+i*l),e.lineTo(t[0],t[1]),e.fill()}_render(e,t){if(t.geometry.getType()==="LineString"){var r,i,s,o=t.context;if(!this._visible){var a=t.pixelRatio/t.resolution,l=Math.cos(t.rotation),c=Math.sin(t.rotation);i=t.geometry.getCoordinates();var u=e[0][0]-i[0][0]*a*l-i[0][1]*a*c,d=e[0][1]-i[0][0]*a*c+i[0][1]*a*l;for(e=[],r=0;s=i[r];r++)e[r]=[u+s[0]*a*l+s[1]*a*c,d+s[0]*a*c-s[1]*a*l,s[2]]}var h=this.getArrowSize()[0]*t.pixelRatio;o.save(),this.getOffset(0)&&this._splitAsize(e,this.getOffset(0)*t.pixelRatio),this.getOffset(1)&&this._splitAsize(e,this.getOffset(1)*t.pixelRatio,!0),e.length>1&&(this.getArrow()===-1||this.getArrow()===2)&&(s=this._splitAsize(e,h),this._acolor?o.fillStyle=this._acolor:o.fillStyle=this.getColor(t.feature,0),this.drawArrow(o,s[0],s[1],this.getWidth(t.feature,0),t.pixelRatio)),e.length>1&&this.getArrow()>0&&(s=this._splitAsize(e,h,!0),this._acolor?o.fillStyle=this._acolor:o.fillStyle=this.getColor(t.feature,1),this.drawArrow(o,s[0],s[1],this.getWidth(t.feature,1),t.pixelRatio));var f=this._splitInto(e,255,2),p=0,g=f.length;if(o.lineJoin="round",o.lineCap=this._lineCap||"butt",f.length>1)for(p=0;p<f.length;p++){var m=p/g;for(i=f[p],o.lineWidth=this.getWidth(t.feature,m)*t.pixelRatio,o.strokeStyle=this.getColor(t.feature,m),o.beginPath(),o.moveTo(i[0][0],i[0][1]),r=1;s=i[r];r++)o.lineTo(s[0],s[1]);o.stroke()}o.restore()}}_splitAsize(e,t,r){var i,s,o,a,l=0;for(r?o=e.pop():o=e.shift(),i=o;e.length;){if(r?s=e.pop():s=e.shift(),a=ht(i,s),l+a>t){i=[i[0]+(s[0]-i[0])*(t-l)/a,i[1]+(s[1]-i[1])*(t-l)/a],a=ht(i,o),r?(e.push(s),e.push(i),e.push([i[0]+(o[0]-i[0])/a,i[1]+(o[1]-i[1])/a])):(e.unshift(s),e.unshift(i),e.unshift([i[0]+(o[0]-i[0])/a,i[1]+(o[1]-i[1])/a]));break}l+=a,i=s}return[o,i]}_splitInto(e,t,r){var i,s,o=this._noOverlap?1:.9,a=[],l,c=0;for(i=1;s=e[i];i++)c+=ht(e[i-1],s);var u=Math.max(r||2,c/(t||255)),d=e[0];c=0;var h=[d];for(i=1,s=e[1];i<e.length;){var f=s[0]-d[0],p=s[1]-d[1];if(l=Math.sqrt(f*f+p*p),c+l>u){var g=(u-c)/l;h.push([d[0]+f*g,d[1]+p*g]),a.push(h),d=[d[0]+f*g*o,d[1]+p*g*o],h=[d],c=0}else c+=l,d=s,h.push(d),i++,s=e[i]}return a.push(h),a}};const Sd=U0;var Cd=y(34072);const $n={style:_.T5,showLegend:!1,edgeStyle:_.T5,arrow:0},Ad="network",_x={type:Ad,name:"",config:$n,location:{mode:Ce.aG.Auto}},W0={id:Ad,name:"Network",description:"Render a node graph as a map layer",isBaseMap:!1,showLocation:!0,hideOpacity:!0,create:async(n,e,t,r)=>{const i={...$n,...e?.config},s=await Jt(i.style),o=await Jt(i.edgeStyle),a=await(0,wt.nE)(e.location),l=new kr(a),c=new Oe.A({source:l}),u=i.arrow===1||i.arrow===-1||i.arrow===2,d=new Fi.m(1);let h=null;return i.showLegend&&(h=(0,v.jsx)(Cl,{watch:d,initialSubProps:{},child:Sl})),c.setStyle(f=>{const p=f.getGeometry(),g=f.get("rowIndex"),m=s.dims;if(!s.fields&&!o.fields&&!u&&p?.getType()!=="LineString")return s.maker(s.base);if(p?.getType()==="LineString"&&p instanceof Ir.Ay){const w=o.dims,b=o.config.textConfig,T=Number(f.getId()),S=p.getCoordinates(),A=o.config.opacity??1;if(S&&w){const C=S[0],R=S[1],j=(0,kt.A)(r.visualization.getColorByName((w.color&&w.color.get(T))??o.base.color)).setAlpha(A).toString(),B=(0,kt.A)(r.visualization.getColorByName((w.color&&w.color.get(T))??o.base.color)).setAlpha(A).toString(),P=(w.size&&w.size.get(T))??o.base.size,G=(w.size&&w.size.get(T))??o.base.size,$=[],Z=new Sd({visible:!0,lineCap:i.arrow===0?"round":"square",color:j,color2:B,width:(w.size&&w.size.get(T))??o.base.size,width2:(w.size&&w.size.get(T))??o.base.size});i.arrow&&(Z.setArrow(i.arrow),i.arrow>0?(Z.setArrowColor(B),Z.setArrowSize((G??0)*2)):(Z.setArrowColor(j),Z.setArrowSize((P??0)*2)));const I=new je.A([C,R]);Z.setGeometry(I);const k=r.typography.fontFamily;if(w.text||o.config.text?.mode===Ce.RU.Fixed){const V=new X.Ay({zIndex:10,text:new En.A({text:w.text?.get(T)??o.config.text?.fixed,font:`normal ${b?.fontSize}px ${k}`,fill:new ae.A({color:j??_.T5.color.fixed}),stroke:new oe.A({color:(0,kt.A)(r.visualization.getColorByName("text")).setAlpha(A).toString(),width:Math.max(b?.fontSize/10,1)}),...b})});V.setGeometry(I),$.push(V)}return $.push(Z),$}}if(!m||!(0,$e.isNumber)(g))return s.maker(s.base);const x={...s.base};return m.color&&(x.color=m.color.get(g)),m.size&&(x.size=m.size.get(g)),m.text&&(x.text=m.text.get(g)),m.rotation&&(x.rotation=m.rotation.get(g)),s.maker(x)}),{init:()=>c,legend:h,update:f=>{if(!f.series?.length){l.clear();return}h&&d.next({styleConfig:s,size:s.dims?.size,layerName:e.name,layer:c});const p=(0,Cd.CP)(f.series);for(const g of f.series)g===p.edges[0]?o.dims=(0,Pe.ue)(g,o,r):s.dims=(0,Pe.ue)(g,s,r),X0(l,p)},registerOptionsUI:(f,p)=>{const g=(0,Cd.CP)(p.data),m=g.nodes[0],x=g.edges[0];f.addCustomEditor({id:"config.style",category:["Node Styles"],path:"config.style",name:"Node Styles",editor:hn,settings:{displayRotation:!0,frameMatcher:w=>w===m},defaultValue:$n.style}).addCustomEditor({id:"config.edgeStyle",category:["Edge Styles"],path:"config.edgeStyle",name:"Edge Styles",editor:hn,settings:{hideSymbol:!0,frameMatcher:w=>w===x},defaultValue:$n.style}).addRadio({path:"config.arrow",name:"Arrow",settings:{options:[{label:"None",value:0},{label:"Forward",value:1},{label:"Reverse",value:-1},{label:"Both",value:2}]},defaultValue:$n.arrow}).addBooleanSwitch({path:"config.showLegend",name:"Show legend",description:"Show map legend",defaultValue:$n.showLegend})}}},defaultOptions:$n};function X0(n,e){n.clear(!0);const t=e.nodes[0],r=e.edges[0];if(!t||!r)return;const i=(0,wt.FM)(t,n.location);if(!i.field){n.changed();return}const s=i.field,o=t.fields.findIndex(h=>h.name==="id"),a=t.fields[o].values,l=r.fields.findIndex(h=>h.name==="source"),c=r.fields.findIndex(h=>h.name==="target"),u=r.fields[l].values,d=r.fields[c].values;for(let h=0;h<u.length;h++){const f=u[h],p=d[h],g=a.findIndex(b=>b===f),m=a.findIndex(b=>b===p);if(!s.values[g]||!s.values[m])continue;const x=new je.A([s.values[g].getCoordinates(),s.values[m].getCoordinates()]),w=new _e.A({geometry:x});w.setId(h),n.addFeatureInternal(w)}for(let h=0;h<t.length;h++)n.addFeatureInternal(new _e.A({frameNodes:t,rowIndex:h,geometry:i.field.values[h]}));n.changed()}var Td=class extends Je.A{constructor(e){e=e||{},e.displacement||(e.displacement=[e.offsetX||0,-e.offsetY||0]);var t=e.kind==="anchored"?8:0,r=Number(e.shadow)||0;e.stroke||(e.stroke=new oe.A({width:0,color:"#000"}));var i=e.stroke.getWidth();if(i<0&&(i=0),e.kind=="folio"&&(i+=6),e.stroke.setWidth(i),super({radius:e.radius+i+t/2+r/2,points:0,displacement:[e.displacement[0]||0,(e.displacement[1]||0)+t],fill:Je.A.prototype.render?new ae.A({color:[0,0,0,0]}):null,declutterMode:e.declutterMode}),this.sanchor_=t,this._shadow=r,!this.getHitDetectionImage){var s=super.getImage.call(this);if(!this.hitDetectionCanvas_){for(var o in this)if(this[o]&&this[o].getContext&&this[o]!==s){this.hitDetectionCanvas_=this[o];break}}this.hitDetectionCanvas_=document.createElement("canvas"),this.hitDetectionCanvas_.width=s.width,this.hitDetectionCanvas_.height=s.height;var a=this.hitDetectionCanvas_;this.getHitDetectionImage=function(){return a}}this._stroke=e.stroke,this._fill=e.fill,this._crop=e.crop,this._crossOrigin=e.crossOrigin,this._kind=e.kind||"default",this._radius=e.radius,this._src=e.src,this._offset=[e.offsetX?e.offsetX:0,e.offsetY?e.offsetY:0],this._onload=e.onload,this._onerror=e.onerror,typeof e.opacity=="number"&&this.setOpacity(e.opacity),typeof e.rotation=="number"&&this.setRotation(e.rotation),this.render(),this.getImage()}setOffset(e){this._offset=[e[0]||0,e[1]||0],this.render(),this.getImage()}clone(){var e=new Td({stroke:this._stroke,fill:this._fill,shadow:this._shadow,crop:this._crop,crossOrigin:this._crossOrigin,kind:this._kind,radius:this._radius,src:this._src,offsetX:this._offset[0],offsetY:this._offset[1],opacity:this.getOpacity(),rotation:this.getRotation(),declutterMode:this.getDeclutterMode?this.getDeclutterMode():null});return e.render(),e.getImage(),e}drawBack_(e,t,r,i){var s=this._shadow,o=e.canvas;e.beginPath(),e.fillStyle=t,e.clearRect(0,0,o.width,o.height);var a=o.width/i,l=o.height/i;switch(this._kind){case"square":{e.rect(0,0,a-s,l-s);break}case"circle":{e.arc(this._radius+r,this._radius+r,this._radius+r,0,2*Math.PI,!1);break}case"folio":{var c=6;r-=c,e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=1;var u=a-s-2*c,d=Math.atan(6/u);e.save(),e.rotate(-d),e.translate(-6,2),e.beginPath(),e.rect(c,c,u,u),e.stroke(),e.fill(),e.restore(),e.save(),e.translate(6,-1),e.rotate(d),e.beginPath(),e.rect(c,c,u,u),e.stroke(),e.fill(),e.restore(),e.beginPath(),e.rect(c,c,u,u),e.stroke();break}case"anchored":{e.roundRect(this.sanchor_/2,0,a-this.sanchor_-s,l-this.sanchor_-s,r),e.moveTo(a/2-this.sanchor_-s/2,l-this.sanchor_-s),e.lineTo(a/2+this.sanchor_-s/2,l-this.sanchor_-s),e.lineTo(a/2-s/2,l-s);break}default:{e.roundRect(0,0,a-s,l-s,r);break}}e.closePath()}createRenderOptions(){var e=super.createRenderOptions();return e.photoOptions=["photo",this._crossOrigin,this._crop,this._src,this._shadow,this._kind].join("-"),e}getImage(e){e=e||window.devicePixelRatio;var t=super.getImage(e);if((this._gethit||this.img_)&&this._currentRatio===e)return t;this._currentRatio=e;var r,i=0;this._stroke&&(r=(0,wr.oJ)(this._stroke.getColor()),i=this._stroke.getWidth()),this._gethit=!0;var s=this.getHitDetectionImage().getContext("2d");s.save(),s.setTransform(1,0,0,1,0,0),this.drawBack_(s,"#000",i,1),s.fill(),s.restore(),this._gethit=!1,s=t.getContext("2d"),s.save(),s.setTransform(e,0,0,e,0,0),this.drawBack_(s,r,i,e),this._shadow&&(s.shadowColor="rgba(0,0,0,0.5)",s.shadowBlur=e*this._shadow/2,s.shadowOffsetX=e*this._shadow/2,s.shadowOffsetY=e*this._shadow/2),s.fill(),s.restore();var o=this,a=this.img_=new Image;if(this._crossOrigin&&(a.crossOrigin=this._crossOrigin),a.src=this._src,a.width?o.drawImage_(t,a,e):(a.onload=function(){o.drawImage_(t,a,e),o._onload&&o._onload()},o._onerror&&(a.onerror=function(){o._onerror()})),!this.getDisplacement){var l=this.getAnchor();l[0]=(t.width/e-this._shadow)/2-this._offset[0],this.sanchor_?l[1]=t.height/e-this._shadow-this._offset[1]:l[1]=(t.height/e-this._shadow)/2-this._offset[1]}return t}getPhoto(){return this.img_}drawImage_(e,t,r){var i=e.getContext("2d"),s=0;this._stroke&&(s=this._stroke.getWidth());var o=2*this._radius;i.save(),Je.A.prototype.render&&i.setTransform(r,0,0,r,0,0),this._kind=="circle"&&(i.beginPath(),i.arc(this._radius+s,this._radius+s,this._radius,0,2*Math.PI,!1),i.clip());var a,l,c,u,d,h,f,p,g;this._crop?(a=Math.min(t.width/o,t.height/o),p=g=a*o,h=(t.width-p)/2,f=(t.height-g)/2,l=c=0,u=d=o+1):(a=Math.min(o/t.width,o/t.height),h=f=0,p=t.width,g=t.height,u=a*p,d=a*g,l=(o-u)/2,c=(o-d)/2),l+=s+this.sanchor_/2,c+=s,i.drawImage(t,h,f,p,g,l,c,u,d),this._kind=="circle"&&s&&(i.beginPath(),i.strokeStyle=(0,wr.oJ)(this._stroke.getColor()),i.lineWidth=s/4,i.arc(this._radius+s,this._radius+s,this._radius,0,2*Math.PI,!1),i.stroke()),i.restore()}};CanvasRenderingContext2D.prototype.roundRect=function(n,e,t,r,i){return i?(t<2*i&&(i=t/2),r<2*i&&(i=r/2),this.beginPath(),this.moveTo(n+i,e),this.arcTo(n+t,e,n+t,e+r,i),this.arcTo(n+t,e+r,n,e+r,i),this.arcTo(n,e+r,n,e,i),this.arcTo(n,e,n+t,e,i),this.closePath()):this.rect(n,e,t,r),this};const Ua=Td,tn={kind:"square",border:2,shadow:!0,crop:!0,radius:20,color:"rgb(200, 200, 200)"},Ed="photos",Fx={type:Ed,name:"",config:tn,location:{mode:Ce.aG.Auto},tooltip:!0},Wa="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBjbGFzcz0iY3NzLWV5eDRkbyI+PHBhdGggZD0iTTExLjI5LDE1LjI5YTEuNTgsMS41OCwwLDAsMC0uMTIuMTUuNzYuNzYsMCwwLDAtLjA5LjE4LjY0LjY0LDAsMCwwLS4wNi4xOCwxLjM2LDEuMzYsMCwwLDAsMCwuMi44NC44NCwwLDAsMCwuMDguMzguOS45LDAsMCwwLC41NC41NC45NC45NCwwLDAsMCwuNzYsMCwuOS45LDAsMCwwLC41NC0uNTRBMSwxLDAsMCwwLDEzLDE2YTEsMSwwLDAsMC0uMjktLjcxQTEsMSwwLDAsMCwxMS4yOSwxNS4yOVpNMTIsMkExMCwxMCwwLDEsMCwyMiwxMiwxMCwxMCwwLDAsMCwxMiwyWm0wLDE4YTgsOCwwLDEsMSw4LThBOCw4LDAsMCwxLDEyLDIwWk0xMiw3QTMsMywwLDAsMCw5LjQsOC41YTEsMSwwLDEsMCwxLjczLDFBMSwxLDAsMCwxLDEyLDlhMSwxLDAsMCwxLDAsMiwxLDEsMCwwLDAtMSwxdjFhMSwxLDAsMCwwLDIsMHYtLjE4QTMsMywwLDAsMCwxMiw3WiI+PC9wYXRoPjwvc3ZnPgo=",Z0="data:image/svg+xml;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";let oi=[];const Y0={id:Ed,name:"Photos",description:"Render photos at each data point",isBaseMap:!1,showLocation:!0,hideOpacity:!0,create:async(n,e,t,r)=>{const i={...tn,...e?.config},s=await(0,wt.nE)(e.location),o=new kr(s),a=new Oe.A({source:o});let l=[];return a.setStyle(c=>{let u=Wa,d=1/0;l.length>0&&(d=c.get("rowIndex"),u=l[d]??Wa);const h=new X.Ay({image:new Ua({src:u,radius:i.radius,crop:i.crop,kind:i.kind,shadow:0,stroke:new oe.A({width:0,color:"rgba(0,0,0,0)"}),onload:()=>{a.changed(),oi&&!oi.includes(d)&&oi.push(d)}})}),f=new X.Ay({image:new Ua({src:Z0,radius:i.radius,crop:!1,kind:i.kind,shadow:i.shadow?2:0,stroke:new oe.A({width:i.border??0,color:r.visualization.getColorByName(i.color)}),onload:()=>{a.changed()}})}),p=new X.Ay({image:new Ua({src:Wa,radius:i.radius,crop:!1,kind:i.kind,shadow:0,stroke:new oe.A({width:0,color:"rgba(0,0,0,0)"}),onload:()=>{a.changed()}})});return oi&&oi.includes(d)?[f,h]:[f,p,h]}),{init:()=>a,update:c=>{if(!c.series?.length){o.clear();return}for(const u of c.series){if(o.update(u),i.src){const d=(0,ud.UI)(u,i.src);d&&(l=d?.values)}else for(let d=0;d<u.fields.length;d++){const h=u.fields[d];if(h.type===_r.PU.string){l=h.values;break}}break}},registerOptionsUI:c=>{c.addFieldNamePicker({path:"config.src",name:"Image Source field",settings:{filter:u=>u.type===_r.PU.string,noFieldsMessage:(0,E.t)("geomap.photos-layer.noFieldsMessage-no-string-fields","No string fields found")}}).addRadio({path:"config.kind",name:"Kind",settings:{options:[{label:"Square",value:"square"},{label:"Circle",value:"circle"},{label:"Anchored",value:"anchored"},{label:"Folio",value:"folio"}]},defaultValue:tn.kind}).addBooleanSwitch({path:"config.crop",name:"Crop",settings:{},defaultValue:tn.crop}).addBooleanSwitch({path:"config.shadow",name:"Shadow",settings:{},defaultValue:tn.shadow}).addSliderInput({path:"config.border",name:"Border",settings:{min:0,max:10},defaultValue:tn.border}).addColorPicker({path:"config.color",name:"Border color",defaultValue:tn.color,settings:[{enableNamedColors:!1}]}).addSliderInput({path:"config.radius",name:"Radius",settings:{min:1,max:100},defaultValue:tn.radius})}}},defaultOptions:tn};var H0=y(99165),_d=y(6773);const ai={style:{..._.T5,opacity:1,lineWidth:2},arrow:0},Fd="route",Ix={type:Fd,name:"",config:ai,location:{mode:Ce.aG.Auto},tooltip:!1};var K0=(n=>(n[n.x1=0]="x1",n[n.y1=1]="y1",n[n.x2=2]="x2",n[n.y2=3]="y2",n))(K0||{});const Xa="#607D8B",J0={id:Fd,name:"Route",description:"Render data points as a route",isBaseMap:!1,showLocation:!0,create:async(n,e,t,r)=>{const i={...ai,...e?.config},s=await Jt(i.style),o=await(0,wt.nE)(e.location),a=new kr(o),l=new Oe.A({source:a}),c=i.arrow===1||i.arrow===-1;if(!s.fields&&!c){const S=co(s.base);s.config.size&&s.config.size.fixed&&S.getStroke()?.setWidth(s.config.size.fixed),l.setStyle(S)}else l.setStyle(S=>{const A=S.get("rowIndex"),C=s.dims;if(!C||!(0,$e.isNumber)(A))return co(s.base);const R=[],j=S.getGeometry(),B=s.config.opacity??1;if(j instanceof Ir.Ay){const G=j.getCoordinates();if(G){let $=0;const Z=2;for(let I=0;I<G.length-1;I++){const k=G[$],V=G[I+1],we=(0,kt.A)(r.visualization.getColorByName((C.color&&C.color.get($))??s.base.color)).setAlpha(B).toString(),Ae=(0,kt.A)(r.visualization.getColorByName((C.color&&C.color.get(I+1))??s.base.color)).setAlpha(B).toString(),be=(C.size&&C.size.get($))??s.base.size,Q=(C.size&&C.size.get(I+1))??s.base.size,z=new Sd({visible:!0,lineCap:i.arrow===0?"round":"square",color:we,color2:Ae,width:(C.size&&C.size.get($))??s.base.size,width2:(C.size&&C.size.get(I+1))??s.base.size});if(i.arrow&&(z.setArrow(i.arrow),i.arrow>0?(z.setArrowColor(Ae),z.setArrowSize((Q??0)*1.5)):(z.setArrowColor(we),z.setArrowSize((be??0)*1.5))),(0,Pe.o3)(n,Z,k,V)){const _t=new je.A([k,V]);z.setGeometry(_t),R.push(z),$=I+1}}if(R.length===0){const I=new Ue.A(G[0]),k=((C.size&&C.size.get(0))??s.base.size??10)/2,V=(0,kt.A)(r.visualization.getColorByName((C.color&&C.color.get(0))??s.base.color)).setAlpha(B).toString(),we=new X.Ay({image:new Ht.A({radius:k,fill:new ae.A({color:V})})});we.setGeometry(I),R.push(we)}}return R}const P={...s.base};return C.color&&(P.color=C.color.get(A)),co(P)});const u=new _e.A({}),d=new _e.A({}),h=new _e.A({}),f=[d,h],p=(s.base.lineWidth||6)+3,g=new X.Ay({image:new Ht.A({radius:p,stroke:new oe.A({color:_d.MV.alpha(Xa,1),width:1}),fill:new ae.A({color:_d.MV.alpha(Xa,.4)})})}),m=new X.Ay({stroke:new oe.A({color:Xa,width:1,lineDash:[3,3],lineCap:"square"})}),x=new Oe.A({source:new Re({features:[u]}),style:g}),w=new Oe.A({source:new Re({features:f}),style:m}),b=new un.A({layers:[l,x,w]}),T=new Er.yU;return T.add(t.getStream(He.b_).pipe((0,H0.c)(8)).subscribe({next:S=>{const A=n.getView().calculateExtent(n.getSize()),R=a.getFeatures()[0]?.get("frame"),j=S.payload?.point?.time;if(R&&j){const B=R.fields.find(P=>P.type===_r.PU.time);if(B){const P=B.values,G=q0(P,j);if(G!==null){const $=(0,wt.FM)(R,o);if($.field){const Z=$.field.values[G],I=Z.getCoordinates();u.setGeometry(Z),u.setStyle(g),d.setGeometry(new je.A([[A[0],I[1]],[A[2],I[1]]])),h.setGeometry(new je.A([[I[0],A[1]],[I[0],A[3]]])),f.forEach(k=>k.setStyle(m))}}}}}})),T.add(t.subscribe(He.ql,S=>{u.setStyle(new X.Ay({})),f.forEach(A=>A.setStyle(new X.Ay({})))})),{init:()=>b,dispose:()=>T.unsubscribe(),update:S=>{if(S.series?.length)for(const A of S.series){(s.fields||c)&&(s.dims=(0,Pe.ue)(A,s,r)),a.clear(!0);const C=(0,wt.FM)(A,o);if(!C.field){a.changed();break}const R=[];for(const j of C.field.values)j instanceof Ue.A&&R.push(j.getCoordinates());if(R.length>=2){const j=new je.A(R);a.addFeatureInternal(new _e.A({frame:A,rowIndex:0,geometry:j}))}a.changed();break}},registerOptionsUI:S=>{S.addCustomEditor({id:"config.style",path:"config.style",name:"Style",editor:hn,settings:{simpleFixedValues:!1},defaultValue:ai.style}).addRadio({path:"config.arrow",name:"Arrow",settings:{options:[{label:"None",value:0},{label:"Forward",value:1},{label:"Reverse",value:-1}]},defaultValue:ai.arrow})}}},defaultOptions:ai};function q0(n,e){if(n.length===0)return null;if(n.length===1)return 0;const t=n.length-1;if(e<n[0])return 0;if(e>n[t])return t;const r=Math.abs(Math.round(t*(e-n[0])/(n[t]-n[0])));if(e<n[r]){for(let i=r;i>0;i--)if(e>n[i])return i<t?i+1:t;return 0}else{for(let i=r;i<t;i++)if(e<n[i])return i>0?i-1:0;return t}}const Id=[Qh,B0,$0,y0,d0,l0,J0,Y0,W0],br={type:"default",name:"",config:{}},Rd={id:br.type,name:"Default base layer",isBaseMap:!0,create:(n,e,t,r)=>{const i=Cn.$W?.geomapDefaultBaseLayerConfig?.type;if(i){const s=li.getIfExists(i);if(!s)throw new Error("Invalid basemap configuration on server");return s.create(n,Cn.$W.geomapDefaultBaseLayerConfig,t,r)}return Ul.create(n,e,t,r)}},li=new ki.O(()=>[Rd,...ja,...Id]);function Pd(n,e){const t={options:[],current:[]},r=[];for(const i of n){const s={label:i.name,value:i.id,description:i.description};switch(i.state){case Li.pn.alpha:if(!Cn.yn)break;s.label=`${i.name} (Alpha)`,s.icon="bolt",r.push(s);break;case Li.pn.beta:s.label=`${i.name} (Beta)`;default:t.options.push(s)}i.id===e&&t.current.push(s)}for(const i of r)t.options.push(i);return t}function kd(n,e){return Pd(n?[Rd,...ja]:[...Id,...ja],e)}const Rx={layers:[]},Md={allLayers:!0,id:"zero",lat:0,lon:0,noRepeat:!1,zoom:1};var Sr=(n=>(n.Details="details",n.None="none",n))(Sr||{}),Q0=(n=>(n.Coords="coords",n.Fit="fit",n.Zero="zero",n))(Q0||{}),ev=y(13752),Ld=y(36638);const Za=new WeakMap,Ya=(n,e,t)=>{if(n.update){let r=t;if(e.filterData){const i=(0,Ld.Dq)(e.filterData);r.series.some(i)&&(r={...r,series:r.series.filter(i)})}n.update(r)}};async function tv(n,e,t){if(!n.map)return!1;const r=n.byName.get(e);if(!r)return!1;let i=-1;const s=n.map?.getLayers();for(let a=0;a<s?.getLength();a++)if(s.item(a)===r.layer){i=a;break}if(t.name!==e){if(!t.name)t.name=e;else if(n.byName.has(t.name))return!1;n.byName.delete(e),e=t.name,n.byName.set(e,r)}r.options.type,t.type;const o=n.layers.slice(0);try{const a=await Xs(n,n.map,t,r.isBasemap);o[i]?.handler.dispose?.(),o[i]=a,s.setAt(i,a.layer),Ya(a.handler,t,n.props.data)}catch(a){return console.warn("ERROR",a),!1}return n.setState({legends:[]}),n.layers=o,n.doOptionsUpdate(i),!0}async function Xs(n,e,t,r){r&&(!t?.type||sn.$.geomapDisableCustomBaseLayer)&&(t=br),t?.type||(t={type:go,name:(0,Pe.q)(n),config:{}});const i=li.getIfExists(t.type);if(!i)return Promise.reject("unknown layer: "+t.type);t.config?.attribution&&(t.config.attribution=Il.sQ.sanitizeTextPanelContent(t.config.attribution));const s=await i.create(e,t,n.props.eventBus,sn.$.theme2),o=s.init();t.opacity!=null&&o.setOpacity(t.opacity),t.name||(t.name=(0,Pe.q)(n));const a=t.name,l={isBasemap:r,options:t,layer:o,handler:s,mouseEvents:new ev.B,getName:()=>a,onChange:c=>{tv(n,a,c)}};return n.byName.set(a,l),Za.set(l.layer,l),o instanceof un.A&&o.getLayers().getArray().forEach(c=>{c instanceof Pr.A&&Za.set(c,l)}),Ya(s,t,n.props.data),l}const zd=n=>n?Za.get(n):void 0,nv=n=>({selectLayer:t=>{const r=n.layers.findIndex(i=>i.options.name===t);n.panelContext&&n.panelContext.onInstanceStateChange&&n.panelContext.onInstanceStateChange({map:n.map,layers:n.layers,selected:r,actions:n.actions})},canRename:t=>!n.byName.has(t),deleteLayer:t=>{const r=[];for(const i of n.layers)i.options.name===t?n.map?.removeLayer(i.layer):r.push(i);n.layers=r,n.doOptionsUpdate(0)},addlayer:t=>{const r=li.getIfExists(t);r&&Xs(n,n.map,{type:r.id,name:(0,Pe.q)(n),config:(0,$e.cloneDeep)(r.defaultOptions),location:r.showLocation?{mode:Ce.aG.Auto}:void 0,tooltip:!0,...!r.hideOpacity&&{opacity:_.T5.opacity}},!1).then(i=>{n.layers=n.layers.slice(0),n.layers.push(i),n.map?.addLayer(i.layer),n.doOptionsUpdate(n.layers.length-1)})},reorder:(t,r)=>{const i=Array.from(n.layers),[s]=i.splice(t,1);i.splice(r,0,s),n.layers=i,n.doOptionsUpdate(r);const o=n.map?.getLayers();o.clear(),n.layers.forEach(a=>o.push(a.layer))}});function rv(n=[],e=!1,t=!1,r){return n.filter(i=>i.layer instanceof yt.A||i.layer instanceof un.A||i.layer instanceof Oe.A).flatMap(i=>{const s=i.options.name,o=i.layer;if(o instanceof un.A)return!e&&s!==r?[]:iv(o,t);if(o instanceof yt.A||o instanceof Oe.A){if(e)return[o.getSource().getExtent()];if(t&&r===s){const a=o.getSource().getFeatures(),c=a[a.length-1]?.getGeometry();return c?[c.getExtent()]:[]}else if(!t&&r===s)return[o.getSource().getExtent()];return[]}else return[]}).reduce(M.X$,(0,M.S5)())}function iv(n,e){return n.getLayers().getArray().filter(t=>t instanceof yt.A||t instanceof Oe.A||t instanceof Pr.A).map(t=>{if(t instanceof yt.A||t instanceof Oe.A||t instanceof Pr.A){if(e){const r=t.getSource().getFeatures(),s=r[r.length-1]?.getGeometry();if(s){const o=s.flatCoordinates,a=o.length;if(a>1){const l=o[a-2],c=o[a-1];return[l,c,l,c]}}return[]}return t.getSource().getExtent()??[]}else return[]})}const sv=n=>{n.map?.on("singleclick",e=>Dd(e,n)),n.map?.on("pointermove",(0,$e.debounce)(e=>Ha(e,n),200)),n.map?.getViewport().addEventListener("mouseout",e=>{n.props.eventBus.publish(new He.ql)})},Dd=(n,e)=>{Ha(n,e)&&(n.preventDefault(),n.stopPropagation(),e.mapDiv.style.cursor="auto",e.setState({ttipOpen:!0}))},Ha=(n,e)=>{if(e.state.measureMenuActive)return!0;if(!e.map||e.state.ttipOpen&&e.state?.ttip?.layers?.length||!(n.originalEvent instanceof MouseEvent))return!1;const t=n.originalEvent,r=e.map.getEventPixel(t),i=(0,D.WP)(e.map.getCoordinateFromPixel(r)),{hoverPayload:s}=e;s.pageX=t.pageX,s.pageY=t.pageY-window.scrollY,s.point={lat:i[1],lon:i[0]},s.data=void 0,s.columnIndex=void 0,s.rowIndex=void 0,s.layers=void 0;const o=[],a=new Map;let l={};e.map.forEachFeatureAtPixel(r,(u,d,h)=>{const f=zd(d);if(!s.data){const p=u.getProperties(),g=p.frame;g&&(s.data=l.data=g,s.rowIndex=l.rowIndex=p.rowIndex),f?.mouseEvents&&f.mouseEvents.next(u)}if(f){let p=a.get(f);if(p||(p={layer:f,features:[]},a.set(f,p),o.push(p)),p.features.some(g=>g===u)||p.features.push(u),d instanceof Pr.A){const g=u.getGeometry();if(g instanceof Ue.A){const m=g.getCoordinates(),x=d.getSource();let w=!1;x.forEachFeature(b=>{if(b!==u&&!p.features.some(T=>T===b)){const T=b.getGeometry();if(T instanceof Ue.A){const S=T.getCoordinates();S[0]===m[0]&&S[1]===m[1]&&(p.features.push(b),w=!0)}}}),w&&p.features.sort((b,T)=>{const S=b.getProperties().rowIndex!==void 0?Number(b.getProperties().rowIndex):Number.MAX_SAFE_INTEGER,A=T.getProperties().rowIndex!==void 0?Number(T.getProperties().rowIndex):Number.MAX_SAFE_INTEGER;return S-A})}}}},{layerFilter:u=>zd(u)?.options?.tooltip!==!1}),e.hoverPayload.layers=o.length?o:void 0,e.props.eventBus.publish(e.hoverEvent),(e.state.ttip===void 0||e.state.ttip?.layers!==s.layers||s.layers)&&e.setState({ttip:{...s}}),o.length||e.layers.forEach(u=>{u.mouseEvents.next(void 0)});const c=!!o.length;return e.mapDiv.style.cursor=c?"pointer":"auto",c};var ft=(n=>(n.Zero="zero",n.Coordinates="coords",n.Fit="fit",n))(ft||{});const ci=new ki.O(()=>[{id:"fit",name:"Fit to data",zoom:15},{id:"zero",name:"(0\xB0, 0\xB0)",lat:0,lon:0},{id:"coords",name:"Coordinates"},{id:"north-america",name:"North America",lat:40,lon:-100,zoom:4},{id:"south-america",name:"South America",lat:-20,lon:-60,zoom:3},{id:"europe",name:"Europe",lat:46,lon:14,zoom:4},{id:"africa",name:"Africa",lat:0,lon:30,zoom:3},{id:"west-asia",name:"West Asia",lat:26,lon:53,zoom:4},{id:"s-asia",name:"South Asia",lat:19.5,lon:80,zoom:4},{id:"se-asia",name:"South-East Asia",lat:10,lon:106,zoom:4},{id:"e-asia",name:"East Asia",lat:33,lon:120,zoom:4},{id:"australia",name:"Australia",lat:-25,lon:135,zoom:4},{id:"oceania",name:"Oceania",lat:-10,lon:-140,zoom:3}]);let Ka;class ov extends U.Component{constructor(e){super(e),this.panelContext=void 0,this.subs=new Er.yU,this.globalCSS=Mh(sn.$.theme2),this.hoverPayload={point:{},pageX:-1,pageY:-1},this.hoverEvent=new He.b_(this.hoverPayload),this.layers=[],this.byName=new Map,this.actions=nv(this),this.initMapRef=async t=>{if(!t)return;this.mapDiv=t,this.map&&this.map.dispose();const{options:r}=this.props,i=(0,Pe.rd)(this,r,t);this.byName.clear();const s=[];try{const o={...r.basemap??br,noRepeat:r.view?.noRepeat??!1};s.push(await Xs(this,i,o,!0)),r.layers||(r.layers=[mo]);for(const a of r.layers)s.push(await Xs(this,i,a,!1))}catch(o){console.error("error loading layers",o)}for(const o of s)i.addLayer(o.layer);this.layers=s,this.map=i,this.initViewExtent(i.getView(),r.view),this.mouseWheelZoom=new Zt.A,this.map?.addInteraction(this.mouseWheelZoom),(0,Pe.Lc)(this,r),sv(this),(0,Pe.Bz)(this,s,s.length-1),this.setState({legends:this.getLegends()})},this.clearTooltip=()=>{this.state.ttip&&!this.state.ttipOpen&&this.tooltipPopupClosed()},this.tooltipPopupClosed=()=>{this.setState({ttipOpen:!1,ttip:void 0})},this.pointerClickListener=t=>{Dd(t,this)},this.pointerMoveListener=t=>{Ha(t,this)},this.initMapView=t=>{const r=t.noRepeat??!1;let i={center:[0,0],zoom:1};if(r){const o=[-180,-85.05112878,180,85.05112878],a=(0,D.DI)(o,"EPSG:4326","EPSG:3857");i.extent=a,i.showFullExtent=!1,i.constrainOnlyCenter=!1}let s=new mi.Ay(i);return t.shared&&(Ka?s=Ka:Ka=s),this.initViewExtent(s,t),s},this.state={ttipOpen:!1,legends:[]},this.subs.add(this.props.eventBus.subscribe(qs.i0,t=>{this.mapDiv&&this.props.id===t.payload&&this.initMapRef(this.mapDiv)})),this.subs.add(Js.l.subscribe(yi.og,()=>{this.mapDiv&&this.layers.some(r=>{const i=r.options.config;return!i||typeof i!="object"?!1:(0,Pe.cA)(i)})&&this.initMapRef(this.mapDiv)}))}static{this.contextType=Ks.e4}componentDidMount(){this.panelContext=this.context}componentWillUnmount(){this.subs.unsubscribe();for(const e of this.layers)e.handler.dispose?.();this.map?.dispose()}shouldComponentUpdate(e){return this.map&&((this.props.height!==e.height||this.props.width!==e.width)&&this.map.updateSize(),this.props.data!==e.data&&this.dataChanged(e.data)),!0}componentDidUpdate(e){this.map&&(this.props.height!==e.height||this.props.width!==e.width)&&this.map.updateSize(),this.map&&this.props.data!==e.data&&this.dataChanged(this.props.data),this.props.options!==e.options&&this.optionsChanged(e.options,this.props.options)}doOptionsUpdate(e){const{options:t,onOptionsChange:r}=this.props,i=this.layers;this.map?.getLayers().forEach(s=>{s instanceof xl&&(this.map?.removeLayer(s),this.map?.addLayer(s))}),r({...t,basemap:i[0].options,layers:i.slice(1).map(s=>s.options)}),(0,Pe.Bz)(this,i,e),this.setState({legends:this.getLegends()})}optionsChanged(e,t){if(e.view?.noRepeat!==t.view?.noRepeat){this.mapDiv&&this.initMapRef(this.mapDiv);return}if(e.view!==t.view){const i=this.initMapView(t.view);this.map&&i&&this.map.setView(i)}t.controls!==e.controls&&this.initControls(t.controls??{showZoom:!0,showAttribution:!0})}dataChanged(e){if(e===this.props.data)for(const r of this.layers)Ya(r.handler,r.options,this.props.data);const t=ci.getIfExists(this.props.options.view.id);if(t&&t.id===ft.Fit){const r=this.initMapView(this.props.options.view);this.map&&r&&this.map.setView(r)}this.setState({legends:this.getLegends()})}initViewExtent(e,t){const r=ci.getIfExists(t.id);if(r){let i;if(r.lat==null){if(r.id===ft.Coordinates)i=[t.lon??0,t.lat??0];else if(r.id===ft.Fit){const s=rv(this.layers,t.allLayers,t.lastOnly,t.layer);if(!(0,M.Im)(s)){const o=t.padding??5,a=e.getResolutionForExtent(s,this.map?.getSize()),l=t.zoom??t.maxZoom;e.fit(s,{maxZoom:l}),e.setResolution(a*(o/100+1));const c=e.getZoom();c&&l&&c>l&&e.setZoom(l)}}}else i=[r.lon??0,r.lat??0];i&&e.setCenter((0,D.Rb)(i))}t.maxZoom&&e.setMaxZoom(t.maxZoom),t.minZoom&&e.setMaxZoom(t.minZoom),t.zoom&&r?.id!==ft.Fit&&e.setZoom(t.zoom)}initControls(e){if(!this.map)return;this.map.getControls().clear(),e.showZoom&&this.map.addControl(new Pt.A),e.showScale&&this.map.addControl(new Xt({units:e.scaleUnits,minWidth:100})),this.mouseWheelZoom?.setActive(!!e.mouseWheelZoom),e.showAttribution&&this.map.addControl(new Hs.A({collapsed:!0,collapsible:!0}));let t=[];e.showMeasure&&(t=[(0,v.jsx)(Ph,{map:this.map,menuActiveState:i=>{this.setState({ttipOpen:i,measureMenuActive:i})}},"measure")]);let r=[];e.showDebug&&(r=[(0,v.jsx)(lh,{map:this.map},"debug")]),this.setState({topRight1:t,topRight2:r})}getLegends(){const e=[];for(const t of this.layers)t.handler.legend&&(0,Pe.sN)(t.layer)&&e.push((0,v.jsx)("div",{children:t.handler.legend},t.options.name));return e}render(){let{ttip:e,ttipOpen:t,topRight1:r,legends:i,topRight2:s}=this.state;const{options:o}=this.props,a=o.controls.showScale;return!t&&o.tooltip?.mode===Sr.None&&(e=void 0),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(gi.Global,{styles:this.globalCSS}),(0,v.jsxs)("div",{className:jd.wrap,onMouseLeave:this.clearTooltip,children:[(0,v.jsx)("div",{role:"application",className:jd.map,tabIndex:0,"aria-label":(0,E.t)("geomap.geomap-panel.aria-label-map","Navigable map"),ref:this.initMapRef}),(0,v.jsx)(vi,{bottomLeft:i,topRight1:r,topRight2:s,blStyle:{bottom:a?"35px":"8px"}})]}),(0,v.jsx)(ah,{ttip:e,isOpen:t,onClose:this.tooltipPopupClosed})]})}}const jd={wrap:(0,K.css)({position:"relative",width:"100%",height:"100%"}),map:(0,K.css)({position:"absolute",zIndex:0,width:"100%",height:"100%"})};var av=y(32881),lv=y(86956),Ja=y(89332),cv=y(30703),uv=y(34316);const dv="layer-drag-drop-list",hv=({layers:n,getLayerInfo:e,onDragEnd:t,onSelect:r,onDelete:i,onDuplicate:s,showActions:o,selection:a,excludeBaseLayer:l,onNameChange:c,verifyLayerNameUniqueness:u})=>{const d=(0,an.of)(fv),h=f=>f?`${d.row} ${d.sel}`:d.row;return(0,v.jsx)(Ja.JY,{onDragEnd:t,children:(0,v.jsx)(Ja.gL,{droppableId:"droppable",children:(f,p)=>(0,v.jsxs)("div",{...f.droppableProps,ref:f.innerRef,"data-testid":dv,children:[(()=>{const g=[],m=l?1:0,x=l?2:1;for(let w=n.length-1;w>=m;w--){const b=n[w],T=b.getName(),S=!!a?.includes(T);g.push((0,v.jsx)(Ja.sx,{draggableId:T,index:g.length,children:(A,C)=>(0,v.jsxs)("div",{className:h(S),ref:A.innerRef,...A.draggableProps,...A.dragHandleProps,onClick:()=>r(b),onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),r(b))},role:"button",tabIndex:0,children:[(0,v.jsx)(uv.R,{name:T,onChange:R=>c(b,R),verifyLayerNameUniqueness:u??void 0}),(0,v.jsxs)("div",{className:d.textWrapper,children:["\xA0 ",e(b)]}),o(b)&&(0,v.jsxs)(v.Fragment,{children:[s?(0,v.jsx)(eo.K,{name:"copy",tooltip:(0,E.t)("layers.layer-drag-drop-list.duplicate-tooltip","Duplicate"),className:d.actionIcon,onClick:()=>s(b)}):null,(0,v.jsx)(eo.K,{name:"trash-alt",tooltip:(0,E.t)("layers.layer-drag-drop-list.remove-tooltip","Remove"),className:(0,K.cx)(d.actionIcon,d.dragIcon),onClick:()=>i(b)})]}),n.length>x&&(0,v.jsx)(cv.I,{"aria-label":(0,E.t)("layers.layer-drag-drop-list.draggable-aria-label","Drag and drop to reorder"),name:"draggabledots",size:"lg",className:d.dragIcon})]})},T))}return g})(),f.placeholder]})})})},fv=n=>({wrapper:(0,K.css)({marginBottom:n.spacing(2)}),row:(0,K.css)({padding:n.spacing(.5,1),borderRadius:n.shape.radius.default,background:n.colors.background.secondary,minHeight:n.spacing(4),display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"3px",cursor:"pointer",border:`1px solid ${n.components.input.borderColor}`,"&:hover":{border:`1px solid ${n.components.input.borderHover}`}}),sel:(0,K.css)({border:`1px solid ${n.colors.primary.border}`,"&:hover":{border:`1px solid ${n.colors.primary.border}`}}),dragIcon:(0,K.css)({cursor:"drag"}),actionIcon:(0,K.css)({color:n.colors.text.secondary,"&:hover":{color:n.colors.text.primary}}),typeWrapper:(0,K.css)({color:n.colors.primary.text,marginRight:"5px"}),textWrapper:(0,K.css)({display:"flex",alignItems:"center",flexGrow:1,overflow:"hidden",marginRight:n.spacing(1)})}),pv=n=>{const{layers:e,selected:t,actions:r}=n.context.instanceState??{};if(!e||!r)return(0,v.jsx)("div",{children:(0,v.jsx)(E.x6,{i18nKey:"geomap.layers-editor.no-layers",children:"No layers?"})});const i=u=>{if(!u.destination)return;const{layers:d,actions:h}=n.context.instanceState??{};if(!d||!h)return;const f=d.length-1,p=(u.source.index-f)*-1,g=(u.destination.index-f)*-1;h.reorder(p,g)},s=u=>{r.selectLayer(u.options.name)},o=u=>{r.deleteLayer(u.options.name)},a=u=>u.options.type,l=(u,d)=>{u.onChange({...u.options,name:d})},c=t?[e[t]?.getName()]:[];return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(av.mc,{children:(0,v.jsx)(lv.r,{onChange:u=>r.addlayer(u.value),options:kd(!1).options,label:(0,E.t)("geomap.layers-editor.label-add-layer","Add layer")})}),(0,v.jsx)("br",{}),(0,v.jsx)(hv,{layers:e,showActions:()=>e.length>2,getLayerInfo:a,onDragEnd:i,onSelect:s,onDelete:o,selection:c,excludeBaseLayer:!0,onNameChange:l,verifyLayerNameUniqueness:r.canRename})]})},gv=({labelWidth:n,value:e,onChange:t})=>{const r=s=>{t({...e,lat:s})},i=s=>{t({...e,lon:s})};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.coordinates-map-view-editor.label-latitude","Latitude"),labelWidth:n,grow:!0,children:(0,v.jsx)(si.Q,{value:e.lat,min:-90,max:90,step:.001,onChange:r})})}),(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.coordinates-map-view-editor.label-longitude","Longitude"),labelWidth:n,grow:!0,children:(0,v.jsx)(si.Q,{value:e.lon,min:-180,max:180,step:.001,onChange:i})})})]})};var Od=(n=>(n.all="all",n.layer="layer",n.last="last",n))(Od||{}),Nd=(n=>(n.all="All layers",n.layer="Layer",n.last="Last value",n))(Nd||{});const mv=Object.values(Od).map(n=>({label:Nd[n],value:n})),yv=({labelWidth:n,value:e,onChange:t,context:r})=>{const i=(0,U.useMemo)(()=>r.options?.layers?r.options.layers.map(d=>({label:d.name,value:d.name,description:void 0})):[],[r.options?.layers]),s=(0,U.useCallback)(d=>{t({...e,layer:d.value})},[e,t]),o=(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.fit-map-view-editor.all-layers-editor-fragment.label-layer","Layer"),labelWidth:n,grow:!0,children:(0,v.jsx)(Wn.l6,{options:i,onChange:s,placeholder:i[0]?.label,value:e.layer})})}),a=d=>{t({...e,padding:d})},l=(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.fit-map-view-editor.last-only-editor-fragment.label-padding","Padding"),labelWidth:n,grow:!0,tooltip:(0,E.t)("geomap.fit-map-view-editor.last-only-editor-fragment.tooltip-padding-relative-percent-beyond-extent","Sets padding in relative percent beyond data extent"),children:(0,v.jsx)(si.Q,{value:e?.padding??5,min:0,step:1,onChange:a})})}),c=e.allLayers?"all":!e.allLayers&&e.lastOnly?"last":"layer",u=d=>{d!=="all"&&!e.layer?t({...e,allLayers:d==="all",lastOnly:d==="last",layer:i[0].value}):t({...e,allLayers:d==="all",lastOnly:d==="last"})};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.fit-map-view-editor.label-data","Data"),labelWidth:n,grow:!0,children:(0,v.jsx)(Un.z,{value:c,options:mv,onChange:u})})}),!e?.allLayers&&o,!e?.lastOnly&&l]})},vv=({value:n,onChange:e,context:t})=>{const i=(0,U.useMemo)(()=>{const c=[];return n?.id?c.push(n.id):c.push(ci.list()[0].id),ci.selectOptions(c)},[n?.id]),s=(0,U.useCallback)(()=>{const c=t.instanceState?.map;if(c){const u=c.getView(),d=u.getCenter();if(d){const h=(0,D.WP)(d,u.getProjection());e({...n,id:ft.Coordinates,lon:+h[0].toFixed(6),lat:+h[1].toFixed(6),zoom:+u.getZoom().toFixed(2)})}}},[n,e,t.instanceState]),o=(0,U.useCallback)(c=>{const u=ci.getIfExists(c.value);u&&e({...n,id:u.id,lat:u.lat??n?.lat,lon:u.lon??n?.lon,zoom:u.zoom??n?.zoom})},[n,e]),a=(0,U.useId)(),l=(0,U.useId)();return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:(0,E.t)("geomap.map-view-editor.label-view","View"),labelWidth:10,grow:!0,children:(0,v.jsx)(Wn.l6,{inputId:a,options:i.options,value:i.current,onChange:o})})}),n.id===ft.Coordinates&&(0,v.jsx)(gv,{labelWidth:10,value:n,onChange:e}),n.id===ft.Fit&&(0,v.jsx)(yv,{labelWidth:10,value:n,onChange:e,context:t}),(0,v.jsx)(bt.C,{children:(0,v.jsx)(qe.I,{label:n?.id===ft.Fit?(0,E.t)("geomap.map-view-editor.label-max-zoom","Max Zoom"):(0,E.t)("geomap.map-view-editor.label-zoom","Zoom"),labelWidth:10,grow:!0,children:(0,v.jsx)(si.Q,{id:l,value:n?.zoom??1,min:1,max:18,step:.01,onChange:c=>{e({...n,zoom:c})}})})}),(0,v.jsx)(Al.B,{direction:"column",children:(0,v.jsx)(xi.$n,{variant:"secondary",size:"sm",fullWidth:!0,onClick:s,children:(0,v.jsx)("span",{children:(0,v.jsx)(E.x6,{i18nKey:"geomap.map-view-editor.use-current-map-settings",children:"Use current map settings"})})})})]})};var xv=y(61215),wv=y(90267),bv=y(42240);function Gd(n){return{category:n.category,path:"--",defaultValue:n.basemaps?br:mo,values:e=>({getContext:t=>({...t,options:n.state.options,instanceState:n.state}),getValue:t=>(0,$e.get)(n.state.options,t),onChange:(t,r)=>{const{state:i}=n,{options:s}=i;if(t==="type"&&r){const o=li.getIfExists(r);if(o){const a={...s,type:o.id,config:{...o.defaultOptions}};o.showLocation&&(a.location?.mode?delete a.location:a.location={mode:Ce.aG.Auto}),i.onChange(a);return}}i.onChange((0,xv.Sf)(s,t,r))}}),build:(e,t)=>{if(!n.state)return;const{handler:r,options:i}=n.state,s=li.getIfExists(i?.type),o=kd(n.basemaps,i?.type?i.type:br.type);if(e.addSelect({path:"type",name:(0,E.t)("geomap.layer-editor.name-layer-type","Layer type"),settings:{options:o.options}}),r.update&&e.addCustomEditor({id:"filterData",path:"filterData",name:(0,E.t)("geomap.layer-editor.name-data","Data"),editor:bv.x,defaultValue:void 0}),!!s&&i.type!==br.type){if(s.showLocation){let a=t.data;if(i.filterData){const l=(0,Ld.Dq)(i.filterData);a.some(l)&&(a=a.filter(l))}(0,wv.G)("Location","location.",e,i.location,a)}r.registerOptionsUI&&r.registerOptionsUI(e,t),(0,$e.isEqual)(n.category,[(0,E.t)("geomap.layer-editor.category-base-layer","Base layer")])||(s.hideOpacity||e.addSliderInput({path:"opacity",name:(0,E.t)("geomap.layer-editor.name-opacity","Opacity"),defaultValue:1,settings:{min:0,max:1,step:.1}}),e.addBooleanSwitch({path:"layer-tooltip",name:(0,E.t)("geomap.layer-editor.name-display-tooltip","Display tooltip"),description:(0,E.t)("geomap.layer-editor.description-display-tooltip","Show the tooltip for layer"),defaultValue:!0}))}}}}var Sv=y(46644),Cv=y(64761),Av=y(33553);const Tv=(n,e,t,r)=>{if(e==="grafana-worldmap-panel"&&t.angular){const{fieldConfig:i,options:s,xform:o}=Ev({...t.angular,fieldConfig:r});return o?.id?.length&&(n.transformations=n.transformations?[...n.transformations,o]:[o]),n.fieldConfig=i,s}return{}};function Ev(n){const e={defaults:{},overrides:[]},t=(0,$e.cloneDeep)(mo),r={view:{id:ft.Zero},controls:{showZoom:!0,mouseWheelZoom:!!n.mouseWheelZoom},basemap:{type:"default",name:"Basemap"},layers:[t],tooltip:{mode:Sr.Details}};let i=Cr(n.decimals);i&&(e.defaults.decimals=i);const s=t.config.style;i=Cr(n.circleMaxSize),i&&(s.size.max=i),i=Cr(n.circleMinSize),i&&(s.size.min=i);let o;const a=Sv.AS.getIfExists(n.valueName);if(a&&n.locationData?.length)switch(o={id:Cv.F.reduce,options:{reducers:[a.id]}},n.locationData){case"countries":case"countries_3letter":t.location={mode:Ce.aG.Lookup,gazetteer:"public/gazetteer/countries.json",lookup:void 0};break;case"states":t.location={mode:Ce.aG.Lookup,gazetteer:"public/gazetteer/usa-states.json",lookup:void 0};break}if(n.thresholds&&n.colors){const c=n.thresholds.split(",").map(d=>Number(d.trim())),u=[];for(const d of n.colors){const h=u.length-1;h>=0?u.push({value:c[h],color:d}):u.push({value:-1/0,color:d})}e.defaults.thresholds={mode:Av.O.Absolute,steps:u}}i=Cr(n.initialZoom),i&&(r.view.zoom=i);const l={"(0\xB0, 0\xB0)":ft.Zero,"North America":"north-america",Europe:"europe","West Asia":"west-asia","SE Asia":"se-asia","Last GeoHash":ft.Coordinates};return r.view.id=l[n.mapCenter],r.view.lat=Cr(n.mapCenterLatitude),r.view.lon=Cr(n.mapCenterLongitude),{fieldConfig:e,options:r,xform:o}}function Cr(n){const e=Number(n);return isNaN(e)?void 0:e}const _v=n=>{const e=n?.pluginVersion??"";if((e.startsWith("8.1")||e.startsWith("8.2"))&&n.options?.layers?.length===1){const r=n.options.layers[0];if(r?.type==="markers"&&r.config){const i=r.config,s={style:(0,$e.cloneDeep)(_.T5),showLegend:!!i.showLegend};i.size&&(s.style.size=i.size),i.color&&(s.style.color=i.color),i.fillOpacity&&(s.style.opacity=i.fillOpacity);const o=Zh(i.shape);return o&&(s.style.symbol={fixed:o,mode:Ce.q_.Fixed}),{...n.options,layers:[{...r,config:s}]}}}return n.options},Fv=new Wt.m(ov).setNoPadding().setPanelChangeHandler(Tv).setMigrationHandler(_v).useFieldConfig({useCustomConfig:n=>{Ys.e(n)}}).setPanelOptions((n,e)=>{let t=[(0,E.t)("geomap.category-map-view","Map view")];n.addCustomEditor({category:t,id:"view",path:"view",name:(0,E.t)("geomap.name-initial-view","Initial view"),description:(0,E.t)("geomap.description-initial-view","This location will show when the panel first loads."),editor:vv,defaultValue:Md}),n.addBooleanSwitch({category:t,path:"view.shared",description:(0,E.t)("geomap.description-share-view","Use the same view across multiple panels. Note: this may require a dashboard reload."),name:(0,E.t)("geomap.name-share-view","Share view"),defaultValue:Md.shared}),n.addBooleanSwitch({category:t,path:"view.noRepeat",name:(0,E.t)("geomap.name-no-repeat","No map repeating"),description:(0,E.t)("geomap.description-no-repeat","Prevent the map from repeating horizontally"),defaultValue:!1});const r=e.instanceState;if(r?.layers){const i=[(0,E.t)("geomap.category-map-layers","Map layers")],s=[(0,E.t)("geomap.category-basemap-layer","Basemap layer")];n.addCustomEditor({category:i,id:"layers",path:"",name:"",editor:pv});const o=r.layers[r.selected];r.selected&&o&&n.addNestedOptions(Gd({state:o,category:i,basemaps:!1}));const a=r.layers[0];sn.$.geomapDisableCustomBaseLayer?n.addCustomEditor({category:s,id:"layers",path:"",name:"",editor:()=>(0,v.jsx)("div",{children:(0,v.jsx)(E.x6,{i18nKey:"geomap.plugin.basemap-layer-configured-server-admin",children:"The basemap layer is configured by the server admin."})})}):a&&n.addNestedOptions(Gd({state:a,category:s,basemaps:!0}))}t=[(0,E.t)("geomap.category-map-controls","Map controls")],n.addBooleanSwitch({category:t,path:"controls.showZoom",description:(0,E.t)("geomap.description-show-zoom","Show zoom control buttons in the upper left corner"),name:(0,E.t)("geomap.name-show-zoom","Show zoom control"),defaultValue:!0}).addBooleanSwitch({category:t,path:"controls.mouseWheelZoom",description:(0,E.t)("geomap.description-mouse-wheel-zoom","Enable zoom control via mouse wheel"),name:(0,E.t)("geomap.name-mouse-wheel-zoom","Mouse wheel zoom"),defaultValue:!0}).addBooleanSwitch({category:t,path:"controls.showAttribution",name:(0,E.t)("geomap.name-show-attribution","Show attribution"),description:(0,E.t)("geomap.description-show-attribution","Show the map source attribution info in the lower right"),defaultValue:!0}).addBooleanSwitch({category:t,path:"controls.showScale",name:(0,E.t)("geomap.name-show-scale","Show scale"),description:(0,E.t)("geomap.description-show-scale","Indicate map scale"),defaultValue:!1}).addBooleanSwitch({category:t,path:"controls.showMeasure",name:(0,E.t)("geomap.name-show-measure","Show measure tools"),description:(0,E.t)("geomap.description-show-measure","Show tools for making measurements on the map"),defaultValue:!1}).addBooleanSwitch({category:t,path:"controls.showDebug",name:(0,E.t)("geomap.name-show-debug","Show debug"),description:(0,E.t)("geomap.description-show-debug","Show map info"),defaultValue:!1}).addRadio({category:t,path:"tooltip.mode",name:(0,E.t)("geomap.name-tooltip","Tooltip"),defaultValue:Sr.Details,settings:{options:[{label:(0,E.t)("geomap.tooltip-options.label-none","None"),value:Sr.None,description:(0,E.t)("geomap.tooltip-options.description-none","Show contents on click, not hover")},{label:(0,E.t)("geomap.tooltip-options.label-details","Details"),value:Sr.Details,description:(0,E.t)("geomap.tooltip-options.description-details","Show popup on hover")}]}})})}}]); //# sourceMappingURL=8271.0ee36e030014244adb47.js.map
.
Edit
..
Edit
1117.145ac642f59357bc40d8.js
Edit
1117.145ac642f59357bc40d8.js.map
Edit
1118.c684d1aadf16a6c70620.js
Edit
1118.c684d1aadf16a6c70620.js.map
Edit
1122.5fbf0d7cd148c610616d.js
Edit
1122.5fbf0d7cd148c610616d.js.map
Edit
1142.a4b35a0e8699cafd901e.js
Edit
1142.a4b35a0e8699cafd901e.js.map
Edit
1162.81868b3ac499fa5ea04b.js
Edit
1162.81868b3ac499fa5ea04b.js.map
Edit
1183.7444f51e5996a7f23c7d.js
Edit
1183.7444f51e5996a7f23c7d.js.map
Edit
1282.ae38cac1b732d8ac1d96.js
Edit
1282.ae38cac1b732d8ac1d96.js.map
Edit
130.a58aaeea748f37ee6482.js
Edit
130.a58aaeea748f37ee6482.js.map
Edit
1419.59f53ae25085b28e1e11.js
Edit
1419.59f53ae25085b28e1e11.js.map
Edit
1420.e63ce495727f83b8887d.js
Edit
1420.e63ce495727f83b8887d.js.map
Edit
1438.ccdd05d7188edf4191ff.js
Edit
1438.ccdd05d7188edf4191ff.js.map
Edit
1446.fe7b1f4563629b80793f.js
Edit
1446.fe7b1f4563629b80793f.js.map
Edit
1484.3da94e44ecdadcd342d4.js
Edit
1484.3da94e44ecdadcd342d4.js.map
Edit
1492.4026c6e7130c3afdae87.js
Edit
1494.ef220afb67ff6c52c7af.js
Edit
1494.ef220afb67ff6c52c7af.js.map
Edit
1560.538cd2395be11ba4e2c9.js
Edit
1560.538cd2395be11ba4e2c9.js.map
Edit
1579.c391ef869d4f7bfc0d1c.js
Edit
1579.c391ef869d4f7bfc0d1c.js.map
Edit
1646.d7d87a40853795910533.js
Edit
1646.d7d87a40853795910533.js.map
Edit
1710.7db3f56c6714c0c340e0.js
Edit
1710.7db3f56c6714c0c340e0.js.map
Edit
1716.f71f518289da5d2229bc.js
Edit
1716.f71f518289da5d2229bc.js.map
Edit
1740.baf38e7ee007e1a6935e.js
Edit
1740.baf38e7ee007e1a6935e.js.map
Edit
1821.c9a2456dc8d78cf6b02f.js
Edit
1821.c9a2456dc8d78cf6b02f.js.map
Edit
1888.d33142738af4fbf8a230.js
Edit
1888.d33142738af4fbf8a230.js.map
Edit
1914.5f33b3c2133b5bb7ea6e.js
Edit
1914.5f33b3c2133b5bb7ea6e.js.map
Edit
198.65a768ff6c601d19ea3f.js
Edit
198.65a768ff6c601d19ea3f.js.map
Edit
1990.9171129a8deabb59bf30.js
Edit
1990.9171129a8deabb59bf30.js.map
Edit
2018.5ff00ee0456301c1cf43.js
Edit
2018.5ff00ee0456301c1cf43.js.map
Edit
205.2eb73847215c8d021cc9.js
Edit
205.2eb73847215c8d021cc9.js.map
Edit
2077.a5848ca4b4b9fdebca17.js
Edit
2077.a5848ca4b4b9fdebca17.js.map
Edit
2094.97e7f0876201e76a77fd.js
Edit
2094.97e7f0876201e76a77fd.js.map
Edit
2150.7576285186c713978b39.js
Edit
2150.7576285186c713978b39.js.map
Edit
2152.b55841e6f422682a3891.js
Edit
2152.b55841e6f422682a3891.js.map
Edit
221.0fc4d14d0a67f3a25d64.js
Edit
221.0fc4d14d0a67f3a25d64.js.map
Edit
2218.623d73bd0985ddf5f8c4.js
Edit
2218.623d73bd0985ddf5f8c4.js.map
Edit
2223.e65417164a45701ed9dc.js
Edit
2223.e65417164a45701ed9dc.js.map
Edit
2244.70c156ada2487a05595c.js
Edit
2244.70c156ada2487a05595c.js.map
Edit
2278.f887de0a65e1b784ea9f.js
Edit
2278.f887de0a65e1b784ea9f.js.map
Edit
2288.6a65ba08c6c0f4f83435.js
Edit
2288.6a65ba08c6c0f4f83435.js.map
Edit
2311.73e1a2b949d289f5d6c9.js
Edit
2311.73e1a2b949d289f5d6c9.js.map
Edit
2398.d142e32be48079fc63c0.js
Edit
2398.d142e32be48079fc63c0.js.map
Edit
2405.c1b37a7cc8182472f6a6.js
Edit
2405.c1b37a7cc8182472f6a6.js.map
Edit
2446.0418c7ea000998178d8b.js
Edit
2446.0418c7ea000998178d8b.js.map
Edit
2450.d73c024ff7273aebf911.js
Edit
2450.d73c024ff7273aebf911.js.map
Edit
2586.668c65b61e9ea31b5bca.js
Edit
2586.668c65b61e9ea31b5bca.js.map
Edit
265.ed6933785cc750cbd9ed.js
Edit
265.ed6933785cc750cbd9ed.js.map
Edit
2658.7f70ebc378803654a814.js
Edit
2658.7f70ebc378803654a814.js.map
Edit
2686.ae267304ddd1380c30c7.js
Edit
2686.ae267304ddd1380c30c7.js.map
Edit
2692.fa24ada7d987a7ee05f1.js
Edit
2692.fa24ada7d987a7ee05f1.js.map
Edit
2699.b79e57051a1a63376320.js
Edit
2699.b79e57051a1a63376320.js.map
Edit
2710.e1ac8e57578a838f5bd8.js
Edit
2710.e1ac8e57578a838f5bd8.js.map
Edit
2744.d6b14bf01022bdb8eab5.js
Edit
2744.d6b14bf01022bdb8eab5.js.map
Edit
2745.8049d948cb362dfc6cb3.js
Edit
2745.8049d948cb362dfc6cb3.js.map
Edit
2835.01beb5b1a252d779aad7.js
Edit
2835.01beb5b1a252d779aad7.js.map
Edit
2961.4b27b21453fdbb115dd4.js
Edit
2961.4b27b21453fdbb115dd4.js.map
Edit
2962.85c9dc0cca68efab5e0c.js
Edit
2962.85c9dc0cca68efab5e0c.js.map
Edit
2975.e64aaea6ff35a7d3b3fd.js
Edit
2975.e64aaea6ff35a7d3b3fd.js.map
Edit
3003.f51365051eb27cf765d8.js
Edit
3003.f51365051eb27cf765d8.js.map
Edit
3042.44bad7d2d0536000b808.js
Edit
3042.44bad7d2d0536000b808.js.map
Edit
3062.ad5844391370fcc7525a.js
Edit
3062.ad5844391370fcc7525a.js.map
Edit
3082.704af6779ad700a5fa42.js
Edit
3082.704af6779ad700a5fa42.js.map
Edit
3096.aed61083f1ba4803ae84.js
Edit
3096.aed61083f1ba4803ae84.js.map
Edit
3126.10c85e1f02105e470a69.js
Edit
3126.10c85e1f02105e470a69.js.map
Edit
3169.0b88a5a2340f70961599.js
Edit
3169.0b88a5a2340f70961599.js.map
Edit
3171.c79c28e2611563e2dbcb.js
Edit
3171.c79c28e2611563e2dbcb.js.map
Edit
3182.831f754ed3b6f10441a0.js
Edit
3182.831f754ed3b6f10441a0.js.map
Edit
3192.2cb90eadf3399270363e.js
Edit
3192.2cb90eadf3399270363e.js.map
Edit
3217.c6faaa4f5637068f90f3.js
Edit
3217.c6faaa4f5637068f90f3.js.map
Edit
3259.c8e4d6ad93201a56e49f.js
Edit
3259.c8e4d6ad93201a56e49f.js.map
Edit
3284.79c2897655286b0c1f6d.js
Edit
3284.79c2897655286b0c1f6d.js.map
Edit
3303.225dae64cff0c2280c3b.js
Edit
3303.225dae64cff0c2280c3b.js.map
Edit
3326.cabc370d66d7ecfbd2c3.js
Edit
3326.cabc370d66d7ecfbd2c3.js.map
Edit
344.85cff3029cbbb5463c7e.js
Edit
344.85cff3029cbbb5463c7e.js.map
Edit
3466.fda7da0cb4150e59da98.js
Edit
3466.fda7da0cb4150e59da98.js.map
Edit
3474.74dfd856a9528c758a57.js
Edit
3474.74dfd856a9528c758a57.js.map
Edit
348.fd20e2547f12dbed76c7.js
Edit
348.fd20e2547f12dbed76c7.js.map
Edit
3495.9c1ae6f61edf7aef207b.js
Edit
3495.9c1ae6f61edf7aef207b.js.map
Edit
3501.a0ee7c2b24136aa91eb5.js
Edit
3501.a0ee7c2b24136aa91eb5.js.map
Edit
3520.a3c2b474e2dcaf9879fc.js
Edit
3520.a3c2b474e2dcaf9879fc.js.map
Edit
3605.41e3c44dfe2ca2966198.js
Edit
3605.41e3c44dfe2ca2966198.js.map
Edit
362.e5ce68af98ee6713a4e7.js
Edit
362.e5ce68af98ee6713a4e7.js.map
Edit
3622.0b196041f825b42c5233.js
Edit
3622.0b196041f825b42c5233.js.map
Edit
3630.1ffe9229d5c27fd0823a.js
Edit
3630.1ffe9229d5c27fd0823a.js.map
Edit
3659.f5dc1bb19d36546aadb8.js
Edit
3659.f5dc1bb19d36546aadb8.js.map
Edit
3688.ec5e74c60569e9498687.js
Edit
3688.ec5e74c60569e9498687.js.map
Edit
3718.b570aa4fa35f8dfc686e.js
Edit
3718.b570aa4fa35f8dfc686e.js.map
Edit
3726.84ef8bb1304f7adbc7f3.js
Edit
3726.84ef8bb1304f7adbc7f3.js.map
Edit
398.ceeafcf522343c717c4b.js
Edit
398.ceeafcf522343c717c4b.js.map
Edit
4064.e52eb763993ad947e4a1.js
Edit
4064.e52eb763993ad947e4a1.js.map
Edit
407.594046bd73cc88c29e80.js
Edit
407.594046bd73cc88c29e80.js.map
Edit
4113.3fa5432815c4662eb03e.js
Edit
4113.3fa5432815c4662eb03e.js.map
Edit
4114.c4741f0a73781d3f87dc.js
Edit
4114.c4741f0a73781d3f87dc.js.map
Edit
4120.968e1408d894f8515330.js
Edit
4120.968e1408d894f8515330.js.map
Edit
4162.8b8a683fa98d677f9137.js
Edit
4162.8b8a683fa98d677f9137.js.map
Edit
4209.de7f2b850ee1292a67e5.js
Edit
4209.de7f2b850ee1292a67e5.js.map
Edit
4224.cc13db0c6e3f7fdb05c9.js
Edit
4224.cc13db0c6e3f7fdb05c9.js.map
Edit
4251.28e90ad13c8fe749062c.js
Edit
4251.28e90ad13c8fe749062c.js.map
Edit
4334.396d65b7ba31733108e9.js
Edit
4334.396d65b7ba31733108e9.js.map
Edit
4350.6db49924324f8061d361.js
Edit
4350.6db49924324f8061d361.js.map
Edit
4463.24a3e34bed64cbbb8b99.js
Edit
4463.24a3e34bed64cbbb8b99.js.map
Edit
4514.03e966fee9064d7305dd.js
Edit
4514.03e966fee9064d7305dd.js.map
Edit
4564.ea4a09ba96ddbf74a0ee.js
Edit
4564.ea4a09ba96ddbf74a0ee.js.map
Edit
46.7809585ddbb4791e248a.js
Edit
46.7809585ddbb4791e248a.js.map
Edit
4630.54d7f3b9d384c6b95bbc.js
Edit
4630.54d7f3b9d384c6b95bbc.js.map
Edit
4656.a07d832134b096826a58.js
Edit
4656.a07d832134b096826a58.js.map
Edit
468.d3a2ba8b0d226ca1475b.js
Edit
468.d3a2ba8b0d226ca1475b.js.map
Edit
4680.abd86af55b75e75326ab.js
Edit
4680.abd86af55b75e75326ab.js.map
Edit
4691.2f69f76af87a66a1513c.js
Edit
4691.2f69f76af87a66a1513c.js.map
Edit
4698.c9a2c562b12da12dc66e.js
Edit
4698.c9a2c562b12da12dc66e.js.map
Edit
4791.fc3ef0337811ab73b164.js
Edit
4791.fc3ef0337811ab73b164.js.map
Edit
4814.2d8cb562606e508512d8.js
Edit
4814.2d8cb562606e508512d8.js.map
Edit
4824.2da8107f19d58bf153e0.js
Edit
4824.2da8107f19d58bf153e0.js.map
Edit
4839.f4d2edd5c2678ef2b624.js
Edit
4839.f4d2edd5c2678ef2b624.js.map
Edit
4857.4971a98037d2ec3b663d.js
Edit
4857.4971a98037d2ec3b663d.js.map
Edit
4865.be02c1283a83523c4414.js
Edit
4865.be02c1283a83523c4414.js.map
Edit
494.5463fc5a297eaedd150f.js
Edit
494.5463fc5a297eaedd150f.js.map
Edit
4958.226af5f19bf47305a407.js
Edit
4958.226af5f19bf47305a407.js.map
Edit
4962.bbff24c5a85e9314600a.js
Edit
4962.bbff24c5a85e9314600a.js.map
Edit
4964.1f2cc5acc0078feb7b08.js
Edit
4964.1f2cc5acc0078feb7b08.js.map
Edit
4965.ccdc00d808390be53820.js
Edit
4965.ccdc00d808390be53820.js.map
Edit
5065.a2c71dab50ccb4174ee2.js
Edit
5065.a2c71dab50ccb4174ee2.js.map
Edit
5074.92e2d1ae98dcd913506e.js
Edit
5074.92e2d1ae98dcd913506e.js.map
Edit
5091.987ffc33b70121541e5d.js
Edit
5091.987ffc33b70121541e5d.js.map
Edit
5106.581eaf66a6592320d97a.js
Edit
5106.581eaf66a6592320d97a.js.map
Edit
5110.96d49ea826be96c65045.js
Edit
5110.96d49ea826be96c65045.js.map
Edit
5130.cbdddcd716a093bdbaac.js
Edit
5130.cbdddcd716a093bdbaac.js.map
Edit
5196.9b7364caf64a8583ad01.js
Edit
5196.9b7364caf64a8583ad01.js.map
Edit
5198.2cd64d4e16a385dd9b91.js
Edit
5198.2cd64d4e16a385dd9b91.js.map
Edit
5280.2c29942977baa2dfbe0e.js
Edit
5280.2c29942977baa2dfbe0e.js.map
Edit
5364.0288d9c98f74f26b73e7.js
Edit
5364.0288d9c98f74f26b73e7.js.map
Edit
5446.ad01d0b233122dd49849.js
Edit
5446.ad01d0b233122dd49849.js.map
Edit
5550.5bf3e7d23d6b104740fd.js
Edit
5550.5bf3e7d23d6b104740fd.js.map
Edit
5618.909592bbe054b70f2377.js
Edit
5618.909592bbe054b70f2377.js.map
Edit
5648.a1fc2b0cbbca9bfa1d94.js
Edit
5648.a1fc2b0cbbca9bfa1d94.js.map
Edit
5664.c55be32f6d459ac3f3d8.js
Edit
5664.c55be32f6d459ac3f3d8.js.map
Edit
5671.e1e396b75d7b95ef461f.js
Edit
5671.e1e396b75d7b95ef461f.js.map
Edit
5742.117597ec799ab75cb2f4.js
Edit
5742.117597ec799ab75cb2f4.js.map
Edit
5747.b9389680058c12ffba68.js
Edit
5747.b9389680058c12ffba68.js.map
Edit
5757.5a4b7f2368dd09da42be.js
Edit
5786.c45dfaf9e1d969472e5e.js
Edit
5786.c45dfaf9e1d969472e5e.js.map
Edit
5790.29b0a5797fd46e9664f5.js
Edit
5790.29b0a5797fd46e9664f5.js.map
Edit
5923.b9c876b4bf528d8511cb.js
Edit
5923.b9c876b4bf528d8511cb.js.map
Edit
5984.1efdc4bb85100bd19ca9.js
Edit
5984.1efdc4bb85100bd19ca9.js.map
Edit
5995.5c7a375f33ea1cd16daa.js
Edit
5995.5c7a375f33ea1cd16daa.js.map
Edit
6018.befdd11bf701ea71f7bf.js
Edit
6018.befdd11bf701ea71f7bf.js.map
Edit
6029.bdcbf27bcdd36812f646.js
Edit
6029.bdcbf27bcdd36812f646.js.map
Edit
6088.7f526abfdb4003574c68.js
Edit
6088.7f526abfdb4003574c68.js.map
Edit
613.084d33252856771cf6e1.js
Edit
613.084d33252856771cf6e1.js.map
Edit
6185.2a7c893c6b3f2f0dadb8.js
Edit
6185.2a7c893c6b3f2f0dadb8.js.map
Edit
6208.571f272269524cfd14e7.js
Edit
6208.571f272269524cfd14e7.js.map
Edit
6236.30d1fa6aee173c946c50.js
Edit
6236.30d1fa6aee173c946c50.js.map
Edit
6244.64f83fc5d05560979c51.js
Edit
6244.64f83fc5d05560979c51.js.map
Edit
6260.b8be95165766a81dade2.js
Edit
6260.b8be95165766a81dade2.js.map
Edit
630.56b78dcdaeeb9d9c2967.js
Edit
630.56b78dcdaeeb9d9c2967.js.map
Edit
6302.a2ffa52069511df9772f.js
Edit
6302.a2ffa52069511df9772f.js.map
Edit
6315.f4d87fc6f8ae3cb40e38.js
Edit
6315.f4d87fc6f8ae3cb40e38.js.map
Edit
6414.7520859a2d9cc0a63d7f.js
Edit
6414.7520859a2d9cc0a63d7f.js.map
Edit
6446.1d75a8140260005fffbd.js
Edit
6446.1d75a8140260005fffbd.js.map
Edit
6743.67a52a99e2fdd1ae1e10.js
Edit
6743.67a52a99e2fdd1ae1e10.js.map
Edit
6759.0454d3c1e41385379bdc.js
Edit
6759.0454d3c1e41385379bdc.js.map
Edit
6772.0d4a074848bc323be8f8.js
Edit
6772.0d4a074848bc323be8f8.js.map
Edit
680.726adca366b4ecb272db.js
Edit
680.726adca366b4ecb272db.js.map
Edit
6830.a4b0ecf3a6d784ca7609.js
Edit
6830.a4b0ecf3a6d784ca7609.js.map
Edit
6834.0c9ef40e2f2b5428983d.js
Edit
6834.0c9ef40e2f2b5428983d.js.map
Edit
6857.252a60422ee275193aa7.js
Edit
6857.252a60422ee275193aa7.js.map
Edit
6940.b6c74df14413f0188f0d.js
Edit
6940.b6c74df14413f0188f0d.js.map
Edit
6990.d663924714fc213b17c6.js
Edit
6990.d663924714fc213b17c6.js.map
Edit
7018.5a037d2577fedc8d10f1.js
Edit
7018.5a037d2577fedc8d10f1.js.map
Edit
7031.047b15171c23b248efa0.js
Edit
7031.047b15171c23b248efa0.js.map
Edit
7033.141597840e42815ef6a4.js
Edit
7033.141597840e42815ef6a4.js.map
Edit
7048.3746fc9a274bf8ff72f1.js
Edit
7048.3746fc9a274bf8ff72f1.js.map
Edit
7051.604a402d305e093c00c2.js
Edit
7051.604a402d305e093c00c2.js.map
Edit
7061.f18464bcd6c6d7455662.js
Edit
7061.f18464bcd6c6d7455662.js.map
Edit
7080.9cdd1b7a0bf62b48e1fe.js
Edit
7080.9cdd1b7a0bf62b48e1fe.js.map
Edit
7200.d4425528f6cee80f9931.js
Edit
7200.d4425528f6cee80f9931.js.map
Edit
7235.46f071d3e4d0bb976223.js
Edit
7235.46f071d3e4d0bb976223.js.map
Edit
7246.03f5a8496e53f64602e2.js
Edit
7246.03f5a8496e53f64602e2.js.map
Edit
7249.3bea4aaf890f89fdad45.js
Edit
7249.3bea4aaf890f89fdad45.js.map
Edit
7299.cdff402b076dfea09ead.js
Edit
7299.cdff402b076dfea09ead.js.map
Edit
7348.6fd722455e8c7e077815.js
Edit
7348.6fd722455e8c7e077815.js.map
Edit
7396.ded473b7a47dc42fbb59.js
Edit
7396.ded473b7a47dc42fbb59.js.map
Edit
7466.b7c17c526c7b734dd5f7.js
Edit
7466.b7c17c526c7b734dd5f7.js.map
Edit
7539.5f405cae3b15e1e2f6fa.js
Edit
7539.5f405cae3b15e1e2f6fa.js.map
Edit
7585.084552e02c66201a55be.js
Edit
7585.084552e02c66201a55be.js.map
Edit
7626.38819cc0696f2d25cf99.js
Edit
7626.38819cc0696f2d25cf99.js.map
Edit
7651.5024ed8dd1beb08d01ab.js
Edit
7651.5024ed8dd1beb08d01ab.js.map
Edit
7681.7ef7b4f86e99abd7b7e1.js
Edit
7681.7ef7b4f86e99abd7b7e1.js.map
Edit
7691.0ad86f0c686b19ce829e.js
Edit
7691.0ad86f0c686b19ce829e.js.map
Edit
7790.4c141092868e7208a087.js
Edit
7790.4c141092868e7208a087.js.map
Edit
7806.dff3509790e494ca5a45.js
Edit
7806.dff3509790e494ca5a45.js.map
Edit
7836.afe37ef4be354f0a3b91.js
Edit
7836.afe37ef4be354f0a3b91.js.map
Edit
7882.e1721e9d6ac2d421bcda.js
Edit
7882.e1721e9d6ac2d421bcda.js.map
Edit
7886.8499ded396232466be7d.js
Edit
7886.8499ded396232466be7d.js.map
Edit
7887.a6dcfd824d57598ba1c3.js
Edit
7887.a6dcfd824d57598ba1c3.js.map
Edit
7969.a048d8060cabf1aede33.js
Edit
7969.a048d8060cabf1aede33.js.map
Edit
7996.bd232896e4559d37a26f.js
Edit
7996.bd232896e4559d37a26f.js.map
Edit
8016.8145cd87abcdd0646db2.js
Edit
8016.8145cd87abcdd0646db2.js.map
Edit
8018.c31846109f2dff21d8c4.js
Edit
8018.c31846109f2dff21d8c4.js.map
Edit
8056.4e8f71ed4d507f89b487.js
Edit
8056.4e8f71ed4d507f89b487.js.map
Edit
8177.52abd0953ac914f69e26.js
Edit
8177.52abd0953ac914f69e26.js.map
Edit
8220.aeea4a8f0893b3447b56.js
Edit
8220.aeea4a8f0893b3447b56.js.map
Edit
8224.75bd73bf51ff7a2fc4a0.js
Edit
8224.75bd73bf51ff7a2fc4a0.js.map
Edit
8230.d65bce2998eec95c6082.js
Edit
8230.d65bce2998eec95c6082.js.map
Edit
8260.c1da67af19b9259d5651.js
Edit
8260.c1da67af19b9259d5651.js.map
Edit
8271.0ee36e030014244adb47.js
Edit
8271.0ee36e030014244adb47.js.map
Edit
8332.a62e8632a336661f2969.js
Edit
8332.a62e8632a336661f2969.js.map
Edit
8334.1196f5ddcef25711fc25.js
Edit
8334.1196f5ddcef25711fc25.js.map
Edit
8347.de402f9280cd7a316c57.js
Edit
8347.de402f9280cd7a316c57.js.map
Edit
8390.9de755da2e214cc845a3.js
Edit
8390.9de755da2e214cc845a3.js.map
Edit
8393.30e95ae45cbe5455dcda.js
Edit
8393.30e95ae45cbe5455dcda.js.map
Edit
8477.4dad0537d13cf9315e86.js
Edit
8477.4dad0537d13cf9315e86.js.map
Edit
8494.659892f00c9d15ae441a.js
Edit
8494.659892f00c9d15ae441a.js.map
Edit
8530.0460c988ee4a40ce7769.js
Edit
8530.0460c988ee4a40ce7769.js.map
Edit
8542.317c15ed57f68fcf0c97.js
Edit
8542.317c15ed57f68fcf0c97.js.map
Edit
8547.390120a5caf7646e0e3e.js
Edit
8547.390120a5caf7646e0e3e.js.map
Edit
8566.5c8f392bb383ab92eed0.js
Edit
8566.5c8f392bb383ab92eed0.js.map
Edit
8622.5acf73c1485a11dfb0ab.js
Edit
8622.5acf73c1485a11dfb0ab.js.map
Edit
8706.f17afa6bcdfd511d5b03.js
Edit
8706.f17afa6bcdfd511d5b03.js.map
Edit
874.d24410518317d605c708.js
Edit
874.d24410518317d605c708.js.map
Edit
8813.e5137844631f6ddedbce.js
Edit
8813.e5137844631f6ddedbce.js.map
Edit
8856.2720526447b3adb5c75f.js
Edit
8856.2720526447b3adb5c75f.js.map
Edit
886.5f3383e84b10a6530b97.js
Edit
886.5f3383e84b10a6530b97.js.map
Edit
8864.2f4ee982114c25634e55.js
Edit
8864.2f4ee982114c25634e55.js.map
Edit
8902.71f14964ec6cea84dc8e.js
Edit
8902.71f14964ec6cea84dc8e.js.map
Edit
8932.e59e50ddb63414e0f2b9.js
Edit
8932.e59e50ddb63414e0f2b9.js.map
Edit
8990.665213a5c89afd6b2f83.js
Edit
8990.665213a5c89afd6b2f83.js.map
Edit
9034.a32e36472481cbe5d72d.js
Edit
9034.a32e36472481cbe5d72d.js.map
Edit
9038.f03b25f160057d4a0bf6.js
Edit
9038.f03b25f160057d4a0bf6.js.map
Edit
904.b68cd2a0cd6d68c5f1ae.js
Edit
904.b68cd2a0cd6d68c5f1ae.js.map
Edit
9044.441f64d6d946cc93be46.js
Edit
9044.441f64d6d946cc93be46.js.map
Edit
9147.8309cadbc384209d62e5.js
Edit
9147.8309cadbc384209d62e5.js.map
Edit
9150.38487365ffd149b730af.js
Edit
9150.38487365ffd149b730af.js.map
Edit
9292.e6befb57f8f116ad95a8.js
Edit
9292.e6befb57f8f116ad95a8.js.map
Edit
9355.95d7e1782f93f339549e.js
Edit
9355.95d7e1782f93f339549e.js.map
Edit
9388.88d95a230e9432e7037b.js
Edit
9388.88d95a230e9432e7037b.js.map
Edit
9390.c72fcd228017f7647b38.js
Edit
9390.c72fcd228017f7647b38.js.map
Edit
9414.642bfe0d5eb16efd0c16.js
Edit
9414.642bfe0d5eb16efd0c16.js.map
Edit
9449.502f2a824d0203e88d4d.js
Edit
9449.502f2a824d0203e88d4d.js.map
Edit
946.48c5e8c688cf29424295.js
Edit
946.48c5e8c688cf29424295.js.map
Edit
9473.e6fc327da88d88712828.js
Edit
9473.e6fc327da88d88712828.js.map
Edit
9510.1e255e96fe40aad2ed6f.js
Edit
9510.1e255e96fe40aad2ed6f.js.map
Edit
9521.e65411d726c29d77c526.js
Edit
9521.e65411d726c29d77c526.js.map
Edit
9538.a2289ff9ad06e24e391f.js
Edit
9538.a2289ff9ad06e24e391f.js.map
Edit
957.3c35d66aa698d8bdfe05.js
Edit
957.3c35d66aa698d8bdfe05.js.map
Edit
9571.41558d40bff9ea8c0726.js
Edit
9571.41558d40bff9ea8c0726.js.map
Edit
9578.9cfae16465bb9bc1f336.js
Edit
9578.9cfae16465bb9bc1f336.js.map
Edit
968.d4b150f9211c478b7b05.js
Edit
968.d4b150f9211c478b7b05.js.map
Edit
970.46f17b76711e4961a575.js
Edit
970.46f17b76711e4961a575.js.map
Edit
9700.02180b7a06c8a1f7606b.js
Edit
9700.02180b7a06c8a1f7606b.js.map
Edit
9744.aa6baaf988a68fa6a9ba.js
Edit
9744.aa6baaf988a68fa6a9ba.js.map
Edit
9820.6b462d83575efd05c883.js
Edit
9820.6b462d83575efd05c883.js.map
Edit
9838.06bd7dfd4290786f80e3.js
Edit
9838.06bd7dfd4290786f80e3.js.map
Edit
9992.fb08517d3ff77e887443.js
Edit
9992.fb08517d3ff77e887443.js.map
Edit
9996.21c451f22ff76b4bb683.js
Edit
9996.21c451f22ff76b4bb683.js.map
Edit
AdminAuthentication.076c98c6380fd1e42f7e.js
Edit
AdminAuthentication.076c98c6380fd1e42f7e.js.map
Edit
AdminEditOrgPage.8df8167ea6ff8f4803bd.js
Edit
AdminEditOrgPage.8df8167ea6ff8f4803bd.js.map
Edit
AdminListOrgsPage.176dac9ed391bda8952b.js
Edit
AdminListOrgsPage.176dac9ed391bda8952b.js.map
Edit
AdminSettings.7373ed8fa9b943bb2098.js
Edit
AdminSettings.7373ed8fa9b943bb2098.js.map
Edit
AlertGroups.81264e6e5009c36eed6e.js
Edit
AlertGroups.81264e6e5009c36eed6e.js.map
Edit
AlertRuleListIndex.98e7328feeaa2ffe67eb.js
Edit
AlertRuleListIndex.98e7328feeaa2ffe67eb.js.map
Edit
AlertingDisabled.b2c834be0ca4666dd793.js
Edit
AlertingDisabled.b2c834be0ca4666dd793.js.map
Edit
AlertingGroupDetails.3a2c6ef8085b505852e4.js
Edit
AlertingGroupDetails.3a2c6ef8085b505852e4.js.map
Edit
AlertingGroupEdit.69cfe9d5f37a1fc65326.js
Edit
AlertingGroupEdit.69cfe9d5f37a1fc65326.js.map
Edit
AlertingHome.06f307ab9a2a5d8b7f93.js
Edit
AlertingHome.06f307ab9a2a5d8b7f93.js.map
Edit
AlertingImportFromDSRules.f1224bcb622d25e2c94f.js
Edit
AlertingImportFromDSRules.f1224bcb622d25e2c94f.js.map
Edit
AlertingRedirectToRule.9ed1d16829d6833d2827.js
Edit
AlertingRedirectToRule.9ed1d16829d6833d2827.js.map
Edit
AlertingRuleForm.2e69d3f00eb6221e7355.js
Edit
AlertingRuleForm.2e69d3f00eb6221e7355.js.map
Edit
AlertingSettings.7a5f782f877cec4790cb.js
Edit
AlertingSettings.7a5f782f877cec4790cb.js.map
Edit
AlertingTriage.1174f36b4937ad0047c1.js
Edit
AlertingTriage.1174f36b4937ad0047c1.js.map
Edit
BenchmarksPage.ef387f4598ba2b2236ad.js
Edit
BenchmarksPage.ef387f4598ba2b2236ad.js.map
Edit
BookmarksPage.8fe93eb7377073f0c985.js
Edit
BookmarksPage.8fe93eb7377073f0c985.js.map
Edit
ChangePasswordPage.f21b0b1dd107ccd33c1a.js
Edit
ChangePasswordPage.f21b0b1dd107ccd33c1a.js.map
Edit
Connections.949b6389e73bcadb2109.js
Edit
Connections.949b6389e73bcadb2109.js.map
Edit
ContactPoints.9ae2d1927d60c6169b87.js
Edit
ContactPoints.9ae2d1927d60c6169b87.js.map
Edit
CorrelationsFeatureToggle.ec2f1aefce6b456e15eb.js
Edit
CorrelationsFeatureToggle.ec2f1aefce6b456e15eb.js.map
Edit
CorrelationsPage.bd7fcd24ed0b5fe8ac3e.js
Edit
CorrelationsPage.bd7fcd24ed0b5fe8ac3e.js.map
Edit
CreateTeam.429acf93986740280312.js
Edit
CreateTeam.429acf93986740280312.js.map
Edit
DashboardImport.3e9b6f980b81d6f1c755.js
Edit
DashboardImport.3e9b6f980b81d6f1c755.js.map
Edit
DashboardListPage.abeb0c29f072f888f9fb.js
Edit
DashboardListPage.abeb0c29f072f888f9fb.js.map
Edit
DashboardPage.72557fe6dd1a022b7d48.js
Edit
DashboardPage.72557fe6dd1a022b7d48.js.map
Edit
DashboardPageProxy.80adfefad8a885d8e2ef.js
Edit
DashboardPageProxy.80adfefad8a885d8e2ef.js.map
Edit
DashboardScenePage.83fe1fa9509b50120d65.js
Edit
DashboardScenePage.83fe1fa9509b50120d65.js.map
Edit
EditContactPoint.0c33428ddc8ba974d946.js
Edit
EditContactPoint.0c33428ddc8ba974d946.js.map
Edit
EditMuteTiming.8760cc9c77560acf0cd6.js
Edit
EditMuteTiming.8760cc9c77560acf0cd6.js.map
Edit
EditRepositoryPage.d71faaab1af2c8d70a22.js
Edit
EditRepositoryPage.d71faaab1af2c8d70a22.js.map
Edit
EmbeddedDashboard.57de550bce819e3d52e6.js
Edit
EmbeddedDashboard.57de550bce819e3d52e6.js.map
Edit
FileHistoryPage.154ab77c19bbe0ebed20.js
Edit
FileHistoryPage.154ab77c19bbe0ebed20.js.map
Edit
FileStatusPage.36f58cd61202ec603d22.js
Edit
FileStatusPage.36f58cd61202ec603d22.js.map
Edit
FolderAlerting.0b9acb6c42276aaee57d.js
Edit
FolderAlerting.0b9acb6c42276aaee57d.js.map
Edit
FolderLibraryPanelsPage.44f8cabf542ec314d176.js
Edit
FolderLibraryPanelsPage.44f8cabf542ec314d176.js.map
Edit
GettingStartedPage.4bea37f1c9bdcfd0f41b.js
Edit
GettingStartedPage.4bea37f1c9bdcfd0f41b.js.map
Edit
GlobalConfig.1377596507974d18caf6.js
Edit
GlobalConfig.1377596507974d18caf6.js.map
Edit
HistoryPage.4da98f4fa313ee3676ca.js
Edit
HistoryPage.4da98f4fa313ee3676ca.js.map
Edit
LdapSettingsPage.0e9f08d5e59150ecf466.js
Edit
LdapSettingsPage.0e9f08d5e59150ecf466.js.map
Edit
LibraryPanelsPage.824580d7751526c658e2.js
Edit
LibraryPanelsPage.824580d7751526c658e2.js.map
Edit
ListPublicDashboardPage.64c26ffd3ebe6c9076f3.js
Edit
ListPublicDashboardPage.64c26ffd3ebe6c9076f3.js.map
Edit
LoginPage.db48423ed1b455431daa.js
Edit
LoginPage.db48423ed1b455431daa.js.map
Edit
MetricsDrilldownRedirect.fcad4bdff346974952f4.js
Edit
MetricsDrilldownRedirect.fcad4bdff346974952f4.js.map
Edit
MigrateToCloud.5b474ad00e8a3d979750.js
Edit
MigrateToCloud.5b474ad00e8a3d979750.js.map
Edit
NewMuteTiming.2f6302420674f1c73aba.js
Edit
NewMuteTiming.2f6302420674f1c73aba.js.map
Edit
NewOrgPage.be31eaee06e2043d609b.js
Edit
NewOrgPage.be31eaee06e2043d609b.js.map
Edit
NewReceiverView.f1d83eb66a39882b8661.js
Edit
NewReceiverView.f1d83eb66a39882b8661.js.map
Edit
NewSilencePage.2643a48031f7e5d8f376.js
Edit
NewSilencePage.2643a48031f7e5d8f376.js.map
Edit
NotificationPoliciesPage.9333d10ecad1452ebf27.js
Edit
NotificationPoliciesPage.9333d10ecad1452ebf27.js.map
Edit
NotificationsPage.57df4ff5ba1433a4345d.js
Edit
NotificationsPage.57df4ff5ba1433a4345d.js.map
Edit
OrgDetailsPage.7b5835c30585aae81343.js
Edit
OrgDetailsPage.7b5835c30585aae81343.js.map
Edit
PlaylistEditPage.8310e384af659e40c313.js
Edit
PlaylistEditPage.8310e384af659e40c313.js.map
Edit
PlaylistNewPage.f45b642a98a747e28c0d.js
Edit
PlaylistNewPage.f45b642a98a747e28c0d.js.map
Edit
PlaylistPage.9af74957a1cdfb125338.js
Edit
PlaylistPage.9af74957a1cdfb125338.js.map
Edit
PlaylistStartPage.8011a98267ac64c7fa05.js
Edit
PlaylistStartPage.8011a98267ac64c7fa05.js.map
Edit
PluginExtensionsLog.54c02047d569b0c05823.js
Edit
PluginExtensionsLog.54c02047d569b0c05823.js.map
Edit
PluginListPage.e50c18fed21c23ca4ee8.js
Edit
PluginListPage.e50c18fed21c23ca4ee8.js.map
Edit
PluginPage.ae424531bce63dd4721e.js
Edit
PluginPage.ae424531bce63dd4721e.js.map
Edit
ProfileFeatureTogglePage.27378dcbb7520611348e.js
Edit
ProfileFeatureTogglePage.27378dcbb7520611348e.js.map
Edit
ProvisioningWizardPage.c4e4a8f431b4719b0e95.js
Edit
ProvisioningWizardPage.c4e4a8f431b4719b0e95.js.map
Edit
PublicDashboardPage.33d6ec8f685f1b70b9a6.js
Edit
PublicDashboardPage.33d6ec8f685f1b70b9a6.js.map
Edit
RecentlyDeleted.5e0ec16474d939fd9683.js
Edit
RecentlyDeleted.5e0ec16474d939fd9683.js.map
Edit
RecentlyDeletedPage.1dbc2b80b28204de8237.js
Edit
RecentlyDeletedPage.1dbc2b80b28204de8237.js.map
Edit
RepositoryListPage.ec3a0af1cbe2740800bf.js
Edit
RepositoryListPage.ec3a0af1cbe2740800bf.js.map
Edit
RepositoryStatusPage.9aee60589e35a4a19ec2.js
Edit
RepositoryStatusPage.9aee60589e35a4a19ec2.js.map
Edit
SelectOrgPage.910a8d842019a6d7fe93.js
Edit
SelectOrgPage.910a8d842019a6d7fe93.js.map
Edit
SendResetMailPage.513361d6980f98ff8139.js
Edit
SendResetMailPage.513361d6980f98ff8139.js.map
Edit
ServerStats.2830ca154f465dbdecea.js
Edit
ServerStats.2830ca154f465dbdecea.js.map
Edit
ServiceAccountCreatePage.80fcbdd2b7f5aa4e2da1.js
Edit
ServiceAccountCreatePage.80fcbdd2b7f5aa4e2da1.js.map
Edit
ServiceAccountPage.48944056459bb412ff33.js
Edit
ServiceAccountPage.48944056459bb412ff33.js.map
Edit
ServiceAccountsPage.d20b1eb9f87661f10b45.js
Edit
ServiceAccountsPage.d20b1eb9f87661f10b45.js.map
Edit
SignupInvited.fe2c29f380e9888c28cf.js
Edit
SignupInvited.fe2c29f380e9888c28cf.js.map
Edit
SilencesTablePage.b998fdbdcc3d60a81739.js
Edit
SilencesTablePage.b998fdbdcc3d60a81739.js.map
Edit
SnapshotListPage.6feaf24adb92e6a302ec.js
Edit
SnapshotListPage.6feaf24adb92e6a302ec.js.map
Edit
SoloPanelPage.7fc6a934aaadf4c1f84d.js
Edit
SoloPanelPage.7fc6a934aaadf4c1f84d.js.map
Edit
SoloPanelPageOld.bde57e000dd0a0108685.js
Edit
SoloPanelPageOld.bde57e000dd0a0108685.js.map
Edit
SupportBundles.1f46603ad3494624d67a.js
Edit
SupportBundles.1f46603ad3494624d67a.js.map
Edit
SupportBundlesCreate.5eaea61a9713f057277b.js
Edit
SupportBundlesCreate.5eaea61a9713f057277b.js.map
Edit
TeamList.6b088f83e6e8cb66b21d.js
Edit
TeamList.6b088f83e6e8cb66b21d.js.map
Edit
TeamPages.9d8b5dceef8be43c6923.js
Edit
TeamPages.9d8b5dceef8be43c6923.js.map
Edit
Templates.7a02a8497ebca052dcfb.js
Edit
Templates.7a02a8497ebca052dcfb.js.map
Edit
TestStuffPage.982c641592b2f7c9db40.js
Edit
TestStuffPage.982c641592b2f7c9db40.js.map
Edit
ThemePlayground.aeeec77fd8e9c1482f55.js
Edit
ThemePlayground.aeeec77fd8e9c1482f55.js.map
Edit
UserAdminPage.fc4d562eef05d9f59aca.js
Edit
UserAdminPage.fc4d562eef05d9f59aca.js.map
Edit
UserCreatePage.b7036214c66612fb31e9.js
Edit
UserCreatePage.b7036214c66612fb31e9.js.map
Edit
UserInvitePage.4a9bcd4084d7ae454c73.js
Edit
UserInvitePage.4a9bcd4084d7ae454c73.js.map
Edit
UserListPage.a452e1153ae820f58ac9.js
Edit
UserListPage.a452e1153ae820f58ac9.js.map
Edit
UserProfileEditPage.82c11690282e669eabb1.js
Edit
UserProfileEditPage.82c11690282e669eabb1.js.map
Edit
alert-rules-drawer-content.c95bb5ddd3fc813cae92.js
Edit
alert-rules-drawer-content.c95bb5ddd3fc813cae92.js.map
Edit
alert-rules-toolbar-button.0d86c1adae7edb55ff76.js
Edit
alert-rules-toolbar-button.0d86c1adae7edb55ff76.js.map
Edit
alertListPanel.0110106a8d1ab70d65d5.js
Edit
alertListPanel.0110106a8d1ab70d65d5.js.map
Edit
alertmanagerPlugin.2b59de5e7b7a556f87f1.js
Edit
alertmanagerPlugin.2b59de5e7b7a556f87f1.js.map
Edit
annoListPanel.0005a0eab0b05e24d970.js
Edit
annoListPanel.0005a0eab0b05e24d970.js.map
Edit
app.8385deda1df49aa75ec2.js
Edit
app.8385deda1df49aa75ec2.js.map
Edit
assets-manifest.json
Edit
barChartPanel.eecdaeab7d146d477721.js
Edit
barChartPanel.eecdaeab7d146d477721.js.map
Edit
barGaugePanel.6d9e94bbb72ba92a0e9b.js
Edit
barGaugePanel.6d9e94bbb72ba92a0e9b.js.map
Edit
candlestickPanel.af0e0decd06e7b7ab286.js
Edit
candlestickPanel.af0e0decd06e7b7ab286.js.map
Edit
canvasPanel.ddab72fab6e58c3419b2.js
Edit
canvasPanel.ddab72fab6e58c3419b2.js.map
Edit
cloudwatchPlugin.06ef34f60000c4f7ea37.js
Edit
cloudwatchPlugin.06ef34f60000c4f7ea37.js.map
Edit
dark.b66fa87185b9a313ec14.js
Edit
dashListPanel.23b954da0c4888602048.js
Edit
dashListPanel.23b954da0c4888602048.js.map
Edit
dataGridPanel.bb5d4b678cba38dd380b.js
Edit
debugPanel.fff63da32084d7a2e236.js
Edit
debugPanel.fff63da32084d7a2e236.js.map
Edit
elasticsearchPlugin.3f2edb012f5162b48903.js
Edit
elasticsearchPlugin.3f2edb012f5162b48903.js.map
Edit
explore-feature-toggle-page.3de03fa91c88d05cea1c.js
Edit
explore-feature-toggle-page.3de03fa91c88d05cea1c.js.map
Edit
explore.dd32637df83326225e0d.js
Edit
explore.dd32637df83326225e0d.js.map
Edit
flamegraphPanel.cc6c5b4bcd69e406fbb7.js
Edit
flamegraphPanel.cc6c5b4bcd69e406fbb7.js.map
Edit
gaugePanel.5da3c4e39a652e281cc4.js
Edit
gaugePanel.5da3c4e39a652e281cc4.js.map
Edit
gazetteer
Edit
geomapPanel.67ebb4567e9b5fa5074b.js
Edit
gettingStartedPanel.833059170dbbf8d5c4bf.js
Edit
gettingStartedPanel.833059170dbbf8d5c4bf.js.map
Edit
grafana.1492.25120d27db88f863e058.css
Edit
grafana.4350.a45e45977094df4a0bc9.css
Edit
grafana.5790.ffb3a9cd952d3cd7471b.css
Edit
grafana.DashboardPage.a66335f88cd003e4a44f.css
Edit
grafana.DashboardPageProxy.a66335f88cd003e4a44f.css
Edit
grafana.app.1f6473bb54b1e1647be8.css
Edit
grafana.dark.1e8d85816912aadbbba5.css
Edit
grafana.dataGridPanel.c1fc5db1829b1b31eb4d.css
Edit
grafana.geomapPanel.0057d964fa972bb207ec.css
Edit
grafana.light.111a5a99fcebc0962ddc.css
Edit
grafana.livePanel.25120d27db88f863e058.css
Edit
grafana.react-monaco-editor.ffb3a9cd952d3cd7471b.css
Edit
grafana.swagger.d0a2da197b9827204ac1.css
Edit
grafana.tablePanel.25120d27db88f863e058.css
Edit
grafanaPlugin.f21cdb4b84a732cc9dd8.js
Edit
grafanaPlugin.f21cdb4b84a732cc9dd8.js.map
Edit
heatmapPanel.7834b997bc573eddba88.js
Edit
heatmapPanel.7834b997bc573eddba88.js.map
Edit
histogramPanel.9953bfeccf8774500c0c.js
Edit
histogramPanel.9953bfeccf8774500c0c.js.map
Edit
img
Edit
influxdbPlugin.7a899e63be0a65d41e13.js
Edit
influxdbPlugin.7a899e63be0a65d41e13.js.map
Edit
light.827d442410485e491818.js
Edit
livePanel.2a43f499bc746d928d45.js
Edit
livePanel.2a43f499bc746d928d45.js.map
Edit
logsPanel.a328022d248508a083c1.js
Edit
logsPanel.a328022d248508a083c1.js.map
Edit
loki-query-field.f9a0b82b636d4821760c.js
Edit
loki-query-field.f9a0b82b636d4821760c.js.map
Edit
maps
Edit
mixedPlugin.3a69de93f366afbb2f85.js
Edit
newsPanel.c17f40f7c88ea14620e7.js
Edit
newsPanel.c17f40f7c88ea14620e7.js.map
Edit
nodeGraphPanel.f717a9075d994a9a8af4.js
Edit
nodeGraphPanel.f717a9075d994a9a8af4.js.map
Edit
opentsdbPlugin.1795eab1c223ea030c2e.js
Edit
opentsdbPlugin.1795eab1c223ea030c2e.js.map
Edit
pieChartPanel.45166aa6d57d163817ea.js
Edit
pieChartPanel.45166aa6d57d163817ea.js.map
Edit
prometheusPlugin.c3a55eb5353085fc3d2b.js
Edit
prometheusPlugin.c3a55eb5353085fc3d2b.js.map
Edit
radialBarPanel.294c52d497d8f5c2bebb.js
Edit
radialBarPanel.294c52d497d8f5c2bebb.js.map
Edit
runtime.a37cc2f12a959f33871a.js
Edit
runtime.a37cc2f12a959f33871a.js.map
Edit
sql-query-editor.e767d4a2aef360034bd9.js
Edit
sql-query-editor.e767d4a2aef360034bd9.js.map
Edit
statPanel.3a7f191bfb27fd320014.js
Edit
statPanel.3a7f191bfb27fd320014.js.map
Edit
stateTimelinePanel.08d857b143ef89dc195f.js
Edit
stateTimelinePanel.08d857b143ef89dc195f.js.map
Edit
static
Edit
statusHistoryPanel.29f7b8dc01039ba795af.js
Edit
statusHistoryPanel.29f7b8dc01039ba795af.js.map
Edit
swagger.06875a6266679f54141d.js
Edit
swagger.06875a6266679f54141d.js.map
Edit
tablePanel.43861ce2a60617dcd19d.js
Edit
tablePanel.43861ce2a60617dcd19d.js.map
Edit
textPanel.867ee60d01b2039aa159.js
Edit
textPanel.867ee60d01b2039aa159.js.map
Edit
timeseriesPanel.b4a947da450030262a31.js
Edit
timeseriesPanel.b4a947da450030262a31.js.map
Edit
tracesPanel.35bfc3e5ff6bea4212a3.js
Edit
tracesPanel.35bfc3e5ff6bea4212a3.js.map
Edit
trendPanel.001aff2bd153e737c464.js
Edit
trendPanel.001aff2bd153e737c464.js.map
Edit
vis-data.b34535ebabc0fcb91557.js
Edit
vis-data.b34535ebabc0fcb91557.js.map
Edit
vis-network.1b41caf21892c9525709.js
Edit
vis-network.1b41caf21892c9525709.js.map
Edit
welcomeBanner.1a693c9dc02006be4f0b.js
Edit
welcomeBanner.1a693c9dc02006be4f0b.js.map
Edit
xychart.cb20af67a6c495ba6ccd.js
Edit
xychart.cb20af67a6c495ba6ccd.js.map
Edit