bbl-mapbox-react 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`mapbox-gl`);l=s(l);let u=require(`@turf/turf`);u=s(u);let d=require(`react-dom/client`);d=s(d);let f=require(`react-dom`);f=s(f);let p=require(`react/jsx-runtime`);p=s(p);let m=require(`@arco-design/web-react`);m=s(m);const h={fillColor:`#ffffff`,fillOpacity:1,strokeColor:`rgba(0, 0, 0, 0.8)`,strokeWidth:1,strokeOpacity:1},g={fillColor:`#ffcc00`,fillOpacity:1,strokeColor:`#ff6600`,strokeWidth:2,strokeOpacity:1};function _(e,t,n=h){return{fillColor:e?.fillColor??t?.fillColor??n.fillColor,fillOpacity:e?.fillOpacity??t?.fillOpacity??n.fillOpacity,strokeColor:e?.strokeColor??t?.strokeColor??n.strokeColor,strokeWidth:e?.strokeWidth??t?.strokeWidth??n.strokeWidth,strokeOpacity:e?.strokeOpacity??t?.strokeOpacity??n.strokeOpacity}}const v={blue:{center:`#4285f4`,edge:`#4285f400`,mid:`#1a73e8`},green:{center:`#34a853`,edge:`#34a85300`,mid:`#0d652d`},red:{center:`#ea4335`,edge:`#ea433500`,mid:`#c5221f`},purple:{center:`#9c27b0`,edge:`#9c27b000`,mid:`#6a1b9a`},cyan:{center:`#00bcd4`,edge:`#00bcd400`,mid:`#00838f`},orange:{center:`#ff9800`,edge:`#ff980000`,mid:`#f57c00`}},y={rotationSpeed:1,initialRotation:0,colorScheme:`green`,opacity:70,gradientType:`conical`,showRings:!0,showCenter:!0,showScanLine:!0},b={trigger:`click`,position:`top`,offset:[0,-10],showCloseButton:!0,animation:`fade`,closeOnClickOutside:!0,closeOnEscape:!0,hoverDelay:300,maxWidth:320,zIndex:1e3},x=[{class:`motorway`,label:`高速公路`,color:`#E84E3C`},{class:`trunk`,label:`国道`,color:`#FF8C00`},{class:`primary`,label:`主干道`,color:`#FFD700`},{class:`secondary`,label:`次干道`,color:`#4CAF50`},{class:`tertiary`,label:`三级道路`,color:`#2196F3`},{class:`motorway_link`,label:`高速匝道`,color:`#FF6B6B`},{class:`trunk_link`,label:`国道匝道`,color:`#FFB84D`},{class:`primary_link`,label:`主干道匝道`,color:`#FFE066`},{class:`secondary_link`,label:`次干道匝道`,color:`#66BB6A`},{class:`tertiary_link`,label:`三级道路匝道`,color:`#42A5F5`},{class:`minor`,label:`小路`,color:`#81C784`},{class:`residential`,label:`居民区道路`,color:`#81C784`},{class:`unclassified`,label:`未分类道路`,color:`#9E9E9E`},{class:`service`,label:`服务道路`,color:`#64B5F6`},{class:`track`,label:`土路`,color:`#A1887F`},{class:`path`,label:`小径`,color:`#BCAAA4`}];function S(e,t,n){let r=u.point(e);return u.destination(r,t/1e3,n,{units:`kilometers`}).geometry.coordinates}function ee(e,t){return u.distance(u.point(e),u.point(t),{units:`kilometers`})*1e3}function C(e,t){return u.bearing(u.point(e),u.point(t))}const w=512,T=512/2,te=512/2-2;function ne(e){return e*Math.PI/180}function E(e=1){return .3+Math.max(0,Math.min(1,e))*.7}var re=class{constructor(e,t,n,r,i){this.isDestroyed=!1,this.isSelected=!1,this.map=e,this.entity=t,this.entityId=t.id,this.globalNameConfig=r,this.globalSelectNameConfig=i,this.sourceId=`${n}-source-${String(t.id)}`,this.layerId=`${n}-layer-${String(t.id)}`,this.labelSourceId=`${n}-label-source-${String(t.id)}`,this.labelLayerId=`${n}-label-layer-${String(t.id)}`,this.canvas=document.createElement(`canvas`),this.canvas.width=512,this.canvas.height=512,this.ctx=this.canvas.getContext(`2d`)}init(e){this.draw(),this.map.addSource(this.sourceId,{type:`canvas`,canvas:this.canvas,coordinates:e,animate:!0}),this.map.addLayer({id:this.layerId,type:`raster`,source:this.sourceId,paint:{"raster-fade-duration":0,"raster-opacity":1}}),this.initLabelLayer()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLabelLayer(){let e=this.getEntityCenter(),{name:t,confidence:n}=this.entity,r=E(n);this.map.addSource(this.labelSourceId,{type:`geojson`,data:{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:t||``,selected:this.isSelected,opacity:r}}}),this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.labelSourceId,layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.5],"text-allow-overlap":!0},paint:{"text-opacity":[`get`,`opacity`],"text-color":[`case`,[`get`,`selected`],this.selectNameStyle.fillColor,this.nameStyle.fillColor],"text-halo-color":[`case`,[`get`,`selected`],this.selectNameStyle.strokeColor,this.nameStyle.strokeColor],"text-halo-width":[`case`,[`get`,`selected`],this.selectNameStyle.strokeWidth,this.nameStyle.strokeWidth]}})}updateLabel(){let e=this.map.getSource(this.labelSourceId);if(!e)return;let t=E(this.entity.confidence);e.setData({type:`Feature`,geometry:{type:`Point`,coordinates:this.getEntityCenter()},properties:{name:this.entity.name||``,selected:this.isSelected,opacity:t}})}setSelected(e){this.isSelected!==e&&(this.isSelected=e,this.updateLabel())}colorWithAlpha(e,t){if(e.startsWith(`rgba`))return e;if(e.startsWith(`#`)){let n=e.slice(1),r=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return`rgba(${r}, ${i}, ${a}, ${t})`}return e.startsWith(`rgb(`)?e.replace(`rgb(`,`rgba(`).replace(`)`,`, ${t})`):e}updateSourceCoordinates(e){this.map.getSource(this.sourceId)?.setCoordinates(e)}getEntityId(){return this.entityId}getCenter(){return this.getEntityCenter()}getBounds(){return this.getEntityBounds()}getLayerId(){return this.layerId}getLabelLayerId(){return this.labelLayerId}destroy(){this.isDestroyed=!0,this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getSource(this.labelSourceId)&&this.map.removeSource(this.labelSourceId),this.map.getLayer(this.layerId)&&this.map.removeLayer(this.layerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId)}};function ie(e,t){let n=S(e,t,0),r=S(e,t,90),i=S(e,t,180),a=S(e,t,270)[0],o=r[0],s=i[1],c=n[1];return[[a,c],[o,c],[o,s],[a,s]]}var ae=class extends re{constructor(e,t,n,r){super(e,t,`radar`,n,r),this.animationFrameId=null,this.currentRotation=t.initialRotation??y.initialRotation;let i=ie(t.center,t.radius);this.init(i),t.isAnimating&&this.startAnimation()}getEntityCenter(){return this.entity.center}getEntityBounds(){let e=ie(this.entity.center,this.entity.radius),t=e[3][0],n=e[3][1],r=e[1][0],i=e[1][1];return[[t,n],[r,i]]}draw(){let e=this.ctx,t=this.entity;e.clearRect(0,0,512,512),e.globalAlpha=E(t.confidence),this.drawSector(e,t),(t.showRings??y.showRings)&&this.drawRings(e),(t.showScanLine??y.showScanLine)&&this.drawScanLine(e,t),(t.showCenter??y.showCenter)&&this.drawCenterDot(e,t),e.globalAlpha=1}drawSector(e,t){let n=t.colorScheme??y.colorScheme,r=v[n],i=(t.opacity??y.opacity)/100,a=t.sectorAngle,o=ne(this.currentRotation-a/2-90),s=ne(this.currentRotation+a/2-90),c=e.createRadialGradient(256,256,0,256,256,254);c.addColorStop(0,this.colorWithAlpha(r.center,i)),c.addColorStop(.5,this.colorWithAlpha(r.mid,i*.6)),c.addColorStop(1,this.colorWithAlpha(r.edge,0)),e.beginPath(),e.moveTo(256,256),e.arc(256,256,254,o,s),e.closePath(),e.fillStyle=c,e.fill()}drawRings(e){e.strokeStyle=`rgba(255, 255, 255, 0.2)`,e.lineWidth=2,e.setLineDash([5,5]);for(let t=1;t<=3;t++){let n=254*t/3;e.beginPath(),e.arc(256,256,n,0,Math.PI*2),e.stroke()}e.setLineDash([])}drawScanLine(e,t){let n=t.colorScheme??y.colorScheme,r=v[n],i=ne(this.currentRotation-90),a=256+Math.cos(i)*254,o=256+Math.sin(i)*254;e.beginPath(),e.moveTo(256,256),e.lineTo(a,o),e.strokeStyle=r.center,e.lineWidth=2,e.lineCap=`round`,e.globalAlpha=.8,e.stroke(),e.globalAlpha=1}drawCenterDot(e,t){let n=t.colorScheme??y.colorScheme,r=v[n];e.beginPath(),e.arc(256,256,5,0,Math.PI*2),e.fillStyle=r.center,e.fill(),e.strokeStyle=`white`,e.lineWidth=2,e.stroke()}startAnimation(){if(this.animationFrameId!==null||this.isDestroyed)return;let e=()=>{if(this.isDestroyed)return;let t=this.entity.rotationSpeed??y.rotationSpeed;this.currentRotation+=t,this.currentRotation>=360&&(this.currentRotation-=360),this.draw(),this.animationFrameId=requestAnimationFrame(e)};this.animationFrameId=requestAnimationFrame(e),this.map.getSource(this.sourceId)?.play()}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.map.getSource(this.sourceId)?.pause()}update(e){let t=this.entity;if(this.entity=e,t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.radius!==e.radius){let t=ie(e.center,e.radius);this.updateSourceCoordinates(t)}(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.name!==e.name||t.confidence!==e.confidence)&&this.updateLabel(),t.isAnimating!==e.isAnimating&&(e.isAnimating?this.startAnimation():this.stopAnimation()),e.isAnimating||this.draw()}isPointInEntity(e){let{center:t,radius:n}=this.entity,r=e[0]-t[0],i=e[1]-t[1],a=111320*Math.cos(t[1]*Math.PI/180);return Math.sqrt((r*a)**2+(i*110540)**2)<=n}destroy(){this.stopAnimation(),super.destroy()}};function oe(e,t,n){let r=t/2,i=n/2,a=S(e,i,0),o=S(e,r,90),s=S(e,i,180),c=S(e,r,270)[0],l=o[0],u=s[1],d=a[1];return[[c,d],[l,d],[l,u],[c,u]]}var se=class extends re{constructor(e,t,n,r){super(e,t,`image`,n,r),this.loadedImage=null,this.imageLoaded=!1,this.currentSrc=``,this.imageAspectRatio=1,this.loadImage(t.src,!0)}getSize(){let{width:e}=this.entity,t=e/this.imageAspectRatio;return[e,t]}loadImage(e,t=!1){if(!e){console.warn(`Image src is empty`);return}this.currentSrc=e;let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{if(e===this.currentSrc)if(this.loadedImage=n,this.imageLoaded=!0,this.imageAspectRatio=n.naturalWidth/n.naturalHeight,t){let[e,t]=this.getSize(),n=oe(this.entity.center,e,t);this.init(n)}else{let[e,t]=this.getSize(),n=oe(this.entity.center,e,t);this.updateSourceCoordinates(n),this.draw()}},n.onerror=()=>{console.error(`Failed to load image: ${e}`)},n.src=e}getEntityCenter(){return this.entity.center}getEntityBounds(){let[e,t]=this.getSize(),n=oe(this.entity.center,e,t),r=n[3][0],i=n[3][1],a=n[1][0],o=n[1][1];return[[r,i],[a,o]]}initLabelLayer(){let e=this.getEntityCenter(),{name:t,confidence:n}=this.entity,r=E(n);this.map.addSource(this.labelSourceId,{type:`geojson`,data:{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:t||``,selected:this.isSelected,opacity:r}}}),this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.labelSourceId,layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-opacity":[`get`,`opacity`],"text-color":[`case`,[`get`,`selected`],`#ffcc00`,`#ffffff`],"text-halo-color":[`case`,[`get`,`selected`],`#ff6600`,`rgba(0, 0, 0, 0.8)`],"text-halo-width":[`case`,[`get`,`selected`],2,1]}})}draw(){let e=this.ctx;if(e.clearRect(0,0,512,512),!this.imageLoaded||!this.loadedImage)return;e.globalAlpha=E(this.entity.confidence),e.save(),e.translate(256,256);let t=this.entity.rotation??0;t!==0&&e.rotate(ne(t)),e.drawImage(this.loadedImage,-508/2,-508/2,508,508),e.restore(),e.globalAlpha=1}update(e){let t=this.entity;if(this.entity=e,t.src!==e.src){this.imageLoaded=!1,this.loadedImage=null,this.loadImage(e.src);return}if(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.width!==e.width){let[t,n]=this.getSize(),r=oe(e.center,t,n);this.updateSourceCoordinates(r)}(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.name!==e.name||t.confidence!==e.confidence)&&this.updateLabel(),(t.rotation!==e.rotation||t.confidence!==e.confidence)&&this.draw()}isPointInEntity(e){let{center:t}=this.entity,[n,r]=this.getSize(),i=e[0]-t[0],a=e[1]-t[1],o=111320*Math.cos(t[1]*Math.PI/180),s=Math.abs(i*o),c=Math.abs(a*110540);return s<=n/2&&c<=r/2}},ce=class{constructor(e,t,n,r){this.marker=null,this.markerElement=null,this.imageElement=null,this.labelElement=null,this.placeholderElement=null,this.isSelected=!1,this.imageAspectRatio=1,this.imageLoaded=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.loadImageAndCreateMarker(t.src)}loadImageAndCreateMarker(e){if(!e){console.warn(`Marker src is empty`);return}let t=new Image;t.crossOrigin=`anonymous`,t.onload=()=>{this.imageAspectRatio=t.naturalWidth/t.naturalHeight,this.imageLoaded=!0,this.createMarker()},t.onerror=()=>{console.error(`Failed to load marker image: ${e}`)},t.src=e}createMarker(){let{center:e,src:t,width:n,rotation:r=0,anchor:i=`center`,name:a,confidence:o}=this.entity,s=n/this.imageAspectRatio;this.markerElement=document.createElement(`div`),this.markerElement.className=`mapbox-marker-container`,this.markerElement.setAttribute(`data-entity-id`,String(this.entity.id)),this.onBeforeImageCreate(),a&&(this.placeholderElement=document.createElement(`div`),this.placeholderElement.className=`mapbox-marker-placeholder`,this.placeholderElement.textContent=a,this.markerElement.appendChild(this.placeholderElement)),this.imageElement=document.createElement(`img`),this.imageElement.src=t,this.imageElement.style.width=`${n}px`,this.imageElement.style.height=`${s}px`,this.imageElement.style.transform=`rotate(${r}deg)`,this.imageElement.style.opacity=`${E(o)}`,this.imageElement.style.pointerEvents=`auto`,this.markerElement.appendChild(this.imageElement),a&&(this.labelElement=document.createElement(`div`),this.labelElement.className=`mapbox-marker-label`,this.labelElement.textContent=a,this.labelElement.setAttribute(`data-entity-id`,String(this.entity.id)),this.updateLabelStyle(),this.markerElement.appendChild(this.labelElement)),this.marker=new l.default.Marker({element:this.markerElement,anchor:i}).setLngLat(e).addTo(this.map),this.onMarkerCreated()}onBeforeImageCreate(){}onMarkerCreated(){}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}updateLabelStyle(){if(!this.labelElement)return;let{confidence:e}=this.entity,t=E(e),n=this.isSelected?this.selectNameStyle:this.nameStyle;this.labelElement.className=this.isSelected?`mapbox-marker-label mapbox-marker-label--selected`:`mapbox-marker-label`,this.labelElement.style.opacity=`${t}`,this.labelElement.style.color=n.fillColor,this.labelElement.style.textShadow=`0 0 ${n.strokeWidth}px ${n.strokeColor}, 0 0 ${n.strokeWidth}px ${n.strokeColor}`}getEntityId(){return this.entity.id}getCenter(){return this.entity.center}getBounds(){let{center:e,width:t}=this.entity,n=t/this.imageAspectRatio,r=this.map.getZoom(),i=156543.03392*Math.cos(e[1]*Math.PI/180)/2**r,a=t*i,o=n*i,s=111320*Math.cos(e[1]*Math.PI/180),c=a/2/s,l=o/2/110540;return[[e[0]-c,e[1]-l],[e[0]+c,e[1]+l]]}getLayerId(){return`marker-${this.entity.id}`}getLabelLayerId(){return null}setSelected(e){this.isSelected!==e&&(this.isSelected=e,this.updateLabelStyle())}isPointInEntity(e){if(!this.marker||!this.imageLoaded)return!1;let{center:t,width:n}=this.entity,r=n/this.imageAspectRatio,i=this.map.getZoom(),a=156543.03392*Math.cos(t[1]*Math.PI/180)/2**i,o=n*a,s=r*a,c=e[0]-t[0],l=e[1]-t[1],u=111320*Math.cos(t[1]*Math.PI/180),d=Math.abs(c*u),f=Math.abs(l*110540);return d<=o/2&&f<=s/2}update(e){let t=this.entity;if(this.entity=e,t.src!==e.src){this.destroy(),this.imageLoaded=!1,this.loadImageAndCreateMarker(e.src);return}if(!this.marker||!this.imageElement)return;(t.center[0]!==e.center[0]||t.center[1]!==e.center[1])&&this.marker.setLngLat(e.center);let n=e.width/this.imageAspectRatio,r=e.rotation??0,i=E(e.confidence);(t.width!==e.width||t.rotation!==e.rotation||t.confidence!==e.confidence)&&(this.imageElement.style.width=`${e.width}px`,this.imageElement.style.height=`${n}px`,this.imageElement.style.transform=`rotate(${r}deg)`,this.imageElement.style.opacity=`${i}`),t.name!==e.name&&(e.name&&!this.labelElement?(this.labelElement=document.createElement(`div`),this.labelElement.className=`mapbox-marker-label`,this.labelElement.textContent=e.name,this.updateLabelStyle(),this.markerElement?.appendChild(this.labelElement),this.placeholderElement=document.createElement(`div`),this.placeholderElement.className=`mapbox-marker-placeholder`,this.placeholderElement.textContent=e.name,this.markerElement?.insertBefore(this.placeholderElement,this.markerElement.firstChild)):!e.name&&this.labelElement?(this.labelElement.remove(),this.labelElement=null,this.placeholderElement?.remove(),this.placeholderElement=null):this.labelElement&&(this.labelElement.textContent=e.name||``,this.placeholderElement&&(this.placeholderElement.textContent=e.name||``))),t.confidence!==e.confidence&&this.updateLabelStyle()}destroy(){this.marker&&=(this.marker.remove(),null),this.markerElement=null,this.imageElement=null,this.labelElement=null,this.placeholderElement=null}},le=class extends ce{constructor(e,t,n,r){super(e,t,n,r),this.showTrajectory=0,this.showTrajectoryPoints=!1,this.trajInitialized=!1,this.statusElement=null,this.statusRoot=null,this.trajSourceId=`unit-traj-source-${t.id}`,this.trajLayerId=`unit-traj-layer-${t.id}`,this.trajPointsLayerId=`unit-traj-points-layer-${t.id}`,t.showTrajectory&&(this.showTrajectory=t.showTrajectory),this.showTrajectoryPoints=t.showTrajectoryPoints??!1}renderStatus(){return null}onBeforeImageCreate(){this.markerElement&&(this.statusElement=document.createElement(`div`),this.statusElement.className=`mapbox-unit-status`,this.markerElement.appendChild(this.statusElement),this.updateStatusContent())}updateStatusContent(){if(!this.statusElement)return;let e=this.renderStatus();e?(this.statusRoot||=(0,d.createRoot)(this.statusElement),this.statusRoot.render(e),this.statusElement.style.display=`block`):(this.statusRoot&&this.statusRoot.render(null),this.statusElement.style.display=`none`)}refreshStatus(){this.updateStatusContent()}getLayerId(){return`unit-${this.entity.id}`}onMarkerCreated(){this.entity.showTrajectory&&(this.showTrajectory=this.entity.showTrajectory,this.initTrajectoryLayer())}shouldShowTrajectory(){return this.showTrajectory===`all`||typeof this.showTrajectory==`number`&&this.showTrajectory>0}getTrajectoryCount(){let{predicted_traj:e}=this.entity;return!e||e.length===0?0:this.showTrajectory===`all`?e.length:typeof this.showTrajectory==`number`&&this.showTrajectory>0?Math.min(this.showTrajectory,e.length):0}initTrajectoryLayer(){if(this.trajInitialized)return;if(!this.map.isStyleLoaded()){requestAnimationFrame(()=>this.initTrajectoryLayer());return}let e=this.getTrajectoryGeoJSON();this.map.addSource(this.trajSourceId,{type:`geojson`,data:e});let t=this.shouldShowTrajectory()?`visible`:`none`,n=this.shouldShowTrajectory()&&this.showTrajectoryPoints?`visible`:`none`;this.map.addLayer({id:this.trajLayerId,type:`line`,source:this.trajSourceId,layout:{"line-join":`round`,"line-cap":`round`,visibility:t},paint:{"line-color":this.isSelected?`#ffcc00`:`#00ff88`,"line-width":3,"line-opacity":E(this.entity.confidence)*.8,"line-dasharray":[2,2]}}),this.map.addLayer({id:this.trajPointsLayerId,type:`circle`,source:this.trajSourceId,filter:[`==`,`$type`,`Point`],layout:{visibility:n},paint:{"circle-radius":4,"circle-color":this.isSelected?`#ffcc00`:`#00ff88`,"circle-stroke-color":`#ffffff`,"circle-stroke-width":1,"circle-opacity":E(this.entity.confidence)}}),this.trajInitialized=!0}getTrajectoryGeoJSON(){let{predicted_traj:e,center:t}=this.entity,n=this.getTrajectoryCount();if(!e||e.length===0||n===0)return{type:`FeatureCollection`,features:[]};let r=e.slice(0,n),i=[t],a=[];return r.forEach((e,t)=>{let n=[e.lon,e.lat];i.push(n),a.push({type:`Feature`,geometry:{type:`Point`,coordinates:n},properties:{index:t,alt:e.alt}})}),{type:`FeatureCollection`,features:[{type:`Feature`,geometry:{type:`LineString`,coordinates:i},properties:{}},...a]}}setShowTrajectory(e){let t=e===`all`||typeof e==`number`&&e>0;if(t&&!this.trajInitialized){this.showTrajectory=e,this.initTrajectoryLayer();return}let n=this.shouldShowTrajectory();if(this.showTrajectory=e,this.trajInitialized){let e=t?`visible`:`none`,r=t&&this.showTrajectoryPoints?`visible`:`none`;this.map.getLayer(this.trajLayerId)&&this.map.setLayoutProperty(this.trajLayerId,`visibility`,e),this.map.getLayer(this.trajPointsLayerId)&&this.map.setLayoutProperty(this.trajPointsLayerId,`visibility`,r),t&&n&&this.updateTrajectoryData()}}getShowTrajectory(){return this.showTrajectory}setShowTrajectoryPoints(e){if(this.showTrajectoryPoints=e,this.trajInitialized&&this.map.getLayer(this.trajPointsLayerId)){let t=this.shouldShowTrajectory()&&e?`visible`:`none`;this.map.setLayoutProperty(this.trajPointsLayerId,`visibility`,t)}}getShowTrajectoryPoints(){return this.showTrajectoryPoints}setSelected(e){let t=this.isSelected;super.setSelected(e),t!==e&&this.trajInitialized&&this.updateTrajectoryStyle()}updateTrajectoryStyle(){let e=this.isSelected?`#ffcc00`:`#00ff88`,t=E(this.entity.confidence);this.map.getLayer(this.trajLayerId)&&(this.map.setPaintProperty(this.trajLayerId,`line-color`,e),this.map.setPaintProperty(this.trajLayerId,`line-opacity`,t*.8)),this.map.getLayer(this.trajPointsLayerId)&&(this.map.setPaintProperty(this.trajPointsLayerId,`circle-color`,e),this.map.setPaintProperty(this.trajPointsLayerId,`circle-opacity`,t))}updateTrajectoryData(){if(!this.trajInitialized)return;let e=this.map.getSource(this.trajSourceId);e&&e.setData(this.getTrajectoryGeoJSON())}update(e){let t=this.entity;super.update(e),t.showTrajectory!==e.showTrajectory&&this.setShowTrajectory(e.showTrajectory??0),t.showTrajectoryPoints!==e.showTrajectoryPoints&&this.setShowTrajectoryPoints(e.showTrajectoryPoints??!1),this.updateTrajectoryData(),t.confidence!==e.confidence&&this.updateTrajectoryStyle()}destroy(){this.statusRoot&&=(this.statusRoot.unmount(),null),this.statusElement=null,this.trajInitialized&&(this.map.getLayer(this.trajPointsLayerId)&&this.map.removeLayer(this.trajPointsLayerId),this.map.getLayer(this.trajLayerId)&&this.map.removeLayer(this.trajLayerId),this.map.getSource(this.trajSourceId)&&this.map.removeSource(this.trajSourceId)),super.destroy()}},ue=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`polygon-source-${t.id}`,this.fillLayerId=`polygon-fill-${t.id}`,this.strokeLayerId=`polygon-stroke-${t.id}`,this.labelLayerId=`polygon-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],layout:{"line-join":`round`,"line-cap":`round`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{coordinates:e,name:t}=this.entity;if(!e||e.length<3)return{type:`FeatureCollection`,features:[]};let n=[...e];(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1])&&n.push(e[0]);let r=[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[n]},properties:{}}];if(t){let n=this.getBottomPoint(e);r.push({type:`Feature`,geometry:{type:`Point`,coordinates:n},properties:{name:t}})}return{type:`FeatureCollection`,features:r}}getBottomPoint(e){let t=e[0],n=e[0][1];for(let r of e)r[1]<n&&(n=r[1],t=r);return t}getEntityId(){return this.entity.id}getBounds(){let{coordinates:e}=this.entity;if(!e||e.length===0){let e=this.getCenter();return[e,e]}let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e)t=Math.min(t,a[0]),n=Math.max(n,a[0]),r=Math.min(r,a[1]),i=Math.max(i,a[1]);return[[t,r],[n,i]]}getCenter(){return this.entity.center?this.entity.center:this.calculateGeometricCenter()}calculateGeometricCenter(){let{coordinates:e}=this.entity;if(!e||e.length===0)return[0,0];let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];return[t/e.length,n/e.length]}getLayerId(){return this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{coordinates:t}=this.entity;return!t||t.length<3?!1:this.pointInPolygon(e,t)}pointInPolygon(e,t){let[n,r]=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let[o,s]=t[e],[c,l]=t[a];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.coordinates!==t.coordinates||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}},de=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,lineCap:`round`,lineJoin:`round`}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`polyline-source-${t.id}`,this.lineLayerId=`polyline-stroke-${t.id}`,this.labelLayerId=`polyline-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.lineLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`LineString`],layout:{"line-join":this.entity.lineJoin??e.DEFAULTS.lineJoin,"line-cap":this.entity.lineCap??e.DEFAULTS.lineCap},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r,...this.entity.dashArray?{"line-dasharray":this.entity.dashArray}:{}}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{coordinates:e,name:t}=this.entity;if(!e||e.length<2)return{type:`FeatureCollection`,features:[]};let n=[{type:`Feature`,geometry:{type:`LineString`,coordinates:e},properties:{}}];if(t){let r=this.getMidPoint(e);n.push({type:`Feature`,geometry:{type:`Point`,coordinates:r},properties:{name:t}})}return{type:`FeatureCollection`,features:n}}getMidPoint(e){if(e.length===1)return e[0];let t=Math.floor((e.length-1)/2),n=e[t],r=e[t+1];return[(n[0]+r[0])/2,(n[1]+r[1])/2]}getEntityId(){return this.entity.id}getBounds(){let{coordinates:e}=this.entity;if(!e||e.length===0){let e=this.getCenter();return[e,e]}let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e)t=Math.min(t,a[0]),n=Math.max(n,a[0]),r=Math.min(r,a[1]),i=Math.max(i,a[1]);return[[t,r],[n,i]]}getCenter(){return this.entity.center?this.entity.center:this.calculateGeometricCenter()}calculateGeometricCenter(){let{coordinates:e}=this.entity;if(!e||e.length===0)return[0,0];let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];return[t/e.length,n/e.length]}getLayerId(){return this.lineLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.lineLayerId)&&this.map.setPaintProperty(this.lineLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{coordinates:t}=this.entity;if(!t||t.length<2)return!1;let n=this.getClickThreshold();for(let r=0;r<t.length-1;r++)if(this.pointToSegmentDistance(e,t[r],t[r+1])<n)return!0;return!1}getClickThreshold(){return .001*2**(12-this.map.getZoom())}pointToSegmentDistance(e,t,n){let[r,i]=e,[a,o]=t,[s,c]=n,l=s-a,u=c-o,d=l*l+u*u;if(d===0)return Math.sqrt((r-a)*(r-a)+(i-o)*(i-o));let f=((r-a)*l+(i-o)*u)/d;f=Math.max(0,Math.min(1,f));let p=a+f*l,m=o+f*u;return Math.sqrt((r-p)*(r-p)+(i-m)*(i-m))}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.coordinates!==t.coordinates||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence||n.dashArray!==t.dashArray)&&this.map.getLayer(this.lineLayerId)&&(this.isSelected||this.map.setPaintProperty(this.lineLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.lineLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.lineLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i),t.dashArray&&this.map.setPaintProperty(this.lineLayerId,`line-dasharray`,t.dashArray)),(n.lineCap!==t.lineCap||n.lineJoin!==t.lineJoin)&&this.map.getLayer(this.lineLayerId)&&(this.map.setLayoutProperty(this.lineLayerId,`line-cap`,t.lineCap??e.DEFAULTS.lineCap),this.map.setLayoutProperty(this.lineLayerId,`line-join`,t.lineJoin??e.DEFAULTS.lineJoin)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.lineLayerId)&&this.map.removeLayer(this.lineLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}};function D(e,t,n=64){let[r,i]=e,a=[],o=t/6371e3,s=i*Math.PI/180;for(let e=0;e<=n;e++){let t=e/n*2*Math.PI,c=o*Math.cos(t),l=o*Math.sin(t)/Math.cos(s),u=i+c*180/Math.PI,d=r+l*180/Math.PI;a.push([d,u])}return a}var fe=class e{static{this.GRADIENT_STEPS=10}static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2,fillType:`solid`,showCenterPoint:!0,centerPointRadius:4}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.gradientLayerIds=[],this.gradientSourceIds=[],this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`circle-source-${t.id}`,this.fillLayerId=`circle-fill-${t.id}`,this.strokeLayerId=`circle-stroke-${t.id}`,this.centerPointLayerId=`circle-center-${t.id}`,this.labelLayerId=`circle-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);(this.entity.fillType??e.DEFAULTS.fillType)===`radial-gradient`?this.initGradientLayers(r):this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,[`get`,`type`],`circle`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,[`get`,`type`],`circle`],layout:{"line-join":`round`,"line-cap":`round`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),(this.entity.showCenterPoint??e.DEFAULTS.showCenterPoint)&&this.map.addLayer({id:this.centerPointLayerId,type:`circle`,source:this.sourceId,filter:[`==`,[`get`,`type`],`center`],paint:{"circle-radius":this.entity.centerPointRadius??e.DEFAULTS.centerPointRadius,"circle-color":this.entity.centerPointColor??this.entity.fillColor??e.DEFAULTS.fillColor,"circle-opacity":r,"circle-stroke-width":1,"circle-stroke-color":`#ffffff`,"circle-stroke-opacity":r*.8}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,[`get`,`type`],`center`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}initGradientLayers(t){let{center:n,radius:r}=this.entity,i=this.entity.fillColor??e.DEFAULTS.fillColor,a=this.entity.fillOpacity??e.DEFAULTS.fillOpacity,o=this.parseColor(i);for(let i=0;i<e.GRADIENT_STEPS;i++){let s=1-i/e.GRADIENT_STEPS,c=r*s,l=i/(e.GRADIENT_STEPS-1)*a*t,u=`${this.sourceId}-gradient-${i}`,d=`${this.fillLayerId}-gradient-${i}`,f=D(n,c);this.map.addSource(u,{type:`geojson`,data:{type:`Feature`,geometry:{type:`Polygon`,coordinates:[f]},properties:{}}}),this.map.addLayer({id:d,type:`fill`,source:u,paint:{"fill-color":`rgb(${o.r}, ${o.g}, ${o.b})`,"fill-opacity":l}}),this.gradientSourceIds.push(u),this.gradientLayerIds.push(d)}}parseColor(e){if(e.startsWith(`#`)){let t=e.slice(1);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return t?{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}:{r:51,g:136,b:255}}getGeoJSON(){let{center:e,radius:t,name:n}=this.entity;return{type:`FeatureCollection`,features:[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[D(e,t)]},properties:{type:`circle`}},{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{type:`center`,name:n||``}}]}}getEntityId(){return this.entity.id}getCenter(){return this.entity.center}getBounds(){let{center:e,radius:t}=this.entity,[n,r]=e,i=t/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r-o],[n+s,r+o]]}getLayerId(){return this.gradientLayerIds.length>0?this.gradientLayerIds[this.gradientLayerIds.length-1]:this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{center:t,radius:n}=this.entity;return this.calculateDistance(e,t)<=n}calculateDistance(e,t){let[n,r]=e,[i,a]=t,o=(a-r)*Math.PI/180,s=(i-n)*Math.PI/180,c=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r),a=t.fillType??e.DEFAULTS.fillType,o=n.fillType??e.DEFAULTS.fillType;if(a!==o){this.destroy(),this.initialized=!1,this.gradientLayerIds=[],this.gradientSourceIds=[],this.initLayers();return}if(n.center!==t.center||n.radius!==t.radius||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),a===`radial-gradient`&&this.updateGradientLayers(i),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,[`get`,`type`],`center`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}a===`solid`?(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)):(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.updateGradientLayerStyles(i),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),(n.centerPointColor!==t.centerPointColor||n.centerPointRadius!==t.centerPointRadius||n.fillColor!==t.fillColor||n.confidence!==t.confidence)&&this.map.getLayer(this.centerPointLayerId)&&(this.map.setPaintProperty(this.centerPointLayerId,`circle-color`,t.centerPointColor??t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.centerPointLayerId,`circle-radius`,t.centerPointRadius??e.DEFAULTS.centerPointRadius),this.map.setPaintProperty(this.centerPointLayerId,`circle-opacity`,i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}updateGradientLayers(t){let{center:n,radius:r}=this.entity;for(let t=0;t<this.gradientSourceIds.length;t++){let i=1-t/e.GRADIENT_STEPS,a=r*i,o=D(n,a),s=this.map.getSource(this.gradientSourceIds[t]);s&&s.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[o]},properties:{}})}this.updateGradientLayerStyles(t)}updateGradientLayerStyles(t){let n=this.entity.fillColor??e.DEFAULTS.fillColor,r=this.entity.fillOpacity??e.DEFAULTS.fillOpacity,i=this.parseColor(n);for(let n=0;n<this.gradientLayerIds.length;n++){let a=n/(e.GRADIENT_STEPS-1)*r*t;this.map.getLayer(this.gradientLayerIds[n])&&(this.map.setPaintProperty(this.gradientLayerIds[n],`fill-color`,`rgb(${i.r}, ${i.g}, ${i.b})`),this.map.setPaintProperty(this.gradientLayerIds[n],`fill-opacity`,a))}}destroy(){if(this.initialized){this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.centerPointLayerId)&&this.map.removeLayer(this.centerPointLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId);for(let e of this.gradientLayerIds)this.map.getLayer(e)&&this.map.removeLayer(e);for(let e of this.gradientSourceIds)this.map.getSource(e)&&this.map.removeSource(e);this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),this.initialized=!1}}};const O={gradientAnimation:`flicker`,animationSpeed:1,fillColor:`#3388ff`,fillOpacity:.6,strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,showCenterPoint:!0,centerPointRadius:4};function k(e,t){let n=S(e,t,0),r=S(e,t,90),i=S(e,t,180),a=S(e,t,270)[0],o=r[0],s=i[1],c=n[1];return[[a,c],[o,c],[o,s],[a,s]]}var pe=class extends re{constructor(e,t,n,r){super(e,t,`canvas-circle`,n,r),this.animationFrameId=null,this.animationTime=0,this.pulsePhase=0;let i=k(t.center,t.radius);this.init(i),t.isAnimating&&this.startAnimation()}getEntityCenter(){return this.entity.center}getEntityBounds(){let e=k(this.entity.center,this.entity.radius),t=e[3][0],n=e[3][1],r=e[1][0],i=e[1][1];return[[t,n],[r,i]]}draw(){let e=this.ctx,t=this.entity;switch(e.clearRect(0,0,512,512),e.globalAlpha=E(t.confidence),t.gradientAnimation??O.gradientAnimation){case`static`:this.drawStaticGradient(e);break;case`flicker`:this.drawFlickerGradient(e);break;case`breath`:this.drawBreathGradient(e);break;case`pulse`:this.drawPulseGradient(e);break;default:this.drawStaticGradient(e)}this.drawStroke(e),(t.showCenterPoint??O.showCenterPoint)&&this.drawCenterPoint(e),e.globalAlpha=1}drawStaticGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=e.createRadialGradient(256,256,0,256,256,254),i=this.parseColor(t);r.addColorStop(0,`rgba(${i.r}, ${i.g}, ${i.b}, ${n})`),r.addColorStop(.7,`rgba(${i.r}, ${i.g}, ${i.b}, ${n*.5})`),r.addColorStop(1,`rgba(${i.r}, ${i.g}, ${i.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=r,e.fill()}drawFlickerGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=this.entity.animationSpeed??O.animationSpeed,i=.5+.5*Math.sin(this.animationTime*r*8),a=n*(.3+.7*i),o=e.createRadialGradient(256,256,0,256,256,254),s=this.parseColor(t);o.addColorStop(0,`rgba(${s.r}, ${s.g}, ${s.b}, ${a})`),o.addColorStop(.7,`rgba(${s.r}, ${s.g}, ${s.b}, ${a*.5})`),o.addColorStop(1,`rgba(${s.r}, ${s.g}, ${s.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=o,e.fill()}drawBreathGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=this.entity.animationSpeed??O.animationSpeed,i=.5+.5*Math.sin(this.animationTime*r*2),a=n*(.2+.8*i),o=e.createRadialGradient(256,256,0,256,256,254),s=this.parseColor(t);o.addColorStop(0,`rgba(${s.r}, ${s.g}, ${s.b}, ${a})`),o.addColorStop(.7,`rgba(${s.r}, ${s.g}, ${s.b}, ${a*.5})`),o.addColorStop(1,`rgba(${s.r}, ${s.g}, ${s.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=o,e.fill()}drawPulseGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=this.parseColor(t),i=e.createRadialGradient(256,256,0,256,256,254);i.addColorStop(0,`rgba(${r.r}, ${r.g}, ${r.b}, ${n*.3})`),i.addColorStop(1,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=i,e.fill();for(let t=0;t<3;t++){let i=(this.pulsePhase+t/3)%1,a=254*i,o=n*(1-i)*.6;a>0&&o>0&&(e.beginPath(),e.arc(256,256,a,0,Math.PI*2),e.strokeStyle=`rgba(${r.r}, ${r.g}, ${r.b}, ${o})`,e.lineWidth=3,e.stroke())}}drawStroke(e){let t=this.entity.strokeColor??O.strokeColor,n=this.entity.strokeWidth??O.strokeWidth,r=this.entity.strokeOpacity??O.strokeOpacity;n>0&&r>0&&(e.beginPath(),e.arc(256,256,254-n/2,0,Math.PI*2),e.strokeStyle=this.colorWithAlpha(t,r),e.lineWidth=n,e.stroke())}drawCenterPoint(e){let t=this.entity.centerPointColor??this.entity.fillColor??O.fillColor,n=(this.entity.centerPointRadius??O.centerPointRadius)*2;e.beginPath(),e.arc(256,256,n,0,Math.PI*2),e.fillStyle=t,e.fill(),e.strokeStyle=`white`,e.lineWidth=2,e.stroke()}parseColor(e){if(e.startsWith(`#`)){let t=e.slice(1);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return t?{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}:{r:51,g:136,b:255}}startAnimation(){if(this.animationFrameId!==null||this.isDestroyed)return;let e=this.entity.animationSpeed??O.animationSpeed,t=performance.now(),n=r=>{if(this.isDestroyed)return;let i=(r-t)/1e3;t=r,this.animationTime+=i,this.pulsePhase+=i*e*.5,this.pulsePhase>=1&&--this.pulsePhase,this.draw(),this.animationFrameId=requestAnimationFrame(n)};this.animationFrameId=requestAnimationFrame(n),this.map.getSource(this.sourceId)?.play()}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.map.getSource(this.sourceId)?.pause()}update(e){let t=this.entity;if(this.entity=e,t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.radius!==e.radius){let t=k(e.center,e.radius);this.updateSourceCoordinates(t)}(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.name!==e.name||t.confidence!==e.confidence)&&this.updateLabel(),t.isAnimating!==e.isAnimating&&(e.isAnimating?this.startAnimation():this.stopAnimation()),e.isAnimating||this.draw()}isPointInEntity(e){let{center:t,radius:n}=this.entity,r=e[0]-t[0],i=e[1]-t[1],a=111320*Math.cos(t[1]*Math.PI/180);return Math.sqrt((r*a)**2+(i*110540)**2)<=n}destroy(){this.stopAnimation(),super.destroy()}};function A(e,t){let[n,r]=e,i=t/2/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r+o],[n+s,r+o],[n+s,r-o],[n-s,r-o],[n-s,r+o]]}var me=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`square-source-${t.id}`,this.fillLayerId=`square-fill-${t.id}`,this.strokeLayerId=`square-stroke-${t.id}`,this.labelLayerId=`square-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],layout:{"line-join":`miter`,"line-cap":`square`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{center:e,length:t,name:n}=this.entity,r=A(e,t),i=[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[r]},properties:{}}];if(n){let e=this.getBottomCenterPoint(r);i.push({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:n}})}return{type:`FeatureCollection`,features:i}}getBottomCenterPoint(e){let t=e[2],n=e[3];return[(t[0]+n[0])/2,(t[1]+n[1])/2]}getEntityId(){return this.entity.id}getCenter(){return this.entity.center}getBounds(){let{center:e,length:t}=this.entity,[n,r]=e,i=t/2/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r-o],[n+s,r+o]]}getLayerId(){return this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{center:t,length:n}=this.entity,r=A(t,n);return this.pointInPolygon(e,r)}pointInPolygon(e,t){let[n,r]=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let[o,s]=t[e],[c,l]=t[a];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.center!==t.center||n.length!==t.length||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}};function he(e){let[[t,n],[r,i]]=e,a=Math.min(t,r),o=Math.max(t,r),s=Math.min(n,i),c=Math.max(n,i);return[[a,c],[o,c],[o,s],[a,s],[a,c]]}var ge=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`rectangle-source-${t.id}`,this.fillLayerId=`rectangle-fill-${t.id}`,this.strokeLayerId=`rectangle-stroke-${t.id}`,this.labelLayerId=`rectangle-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],layout:{"line-join":`miter`,"line-cap":`square`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{bounds:e,name:t}=this.entity,n=he(e),r=[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[n]},properties:{}}];if(t){let e=this.getBottomCenterPoint(n);r.push({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:t}})}return{type:`FeatureCollection`,features:r}}getBottomCenterPoint(e){let t=e[2],n=e[3];return[(t[0]+n[0])/2,(t[1]+n[1])/2]}getEntityId(){return this.entity.id}getBounds(){let[[e,t],[n,r]]=this.entity.bounds,i=Math.min(e,n),a=Math.max(e,n);return[[i,Math.min(t,r)],[a,Math.max(t,r)]]}getCenter(){return this.entity.center?this.entity.center:this.calculateRectangleCenter()}calculateRectangleCenter(){let[[e,t],[n,r]]=this.entity.bounds;return[(e+n)/2,(t+r)/2]}getLayerId(){return this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{bounds:t}=this.entity,n=he(t);return this.pointInPolygon(e,n)}pointInPolygon(e,t){let[n,r]=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let[o,s]=t[e],[c,l]=t[a];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.bounds!==t.bounds||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}};const _e=({popupState:e,onClose:t,portalContainer:n,popupRef:r})=>{let i=(0,c.useRef)(null),[a,o]=(0,c.useState)(`entering`),[s,l]=(0,c.useState)(!1),u=(0,c.useRef)(e.position),d=(0,c.useRef)(!1),m=r||i;d.current||(u.current=e.position),(0,c.useEffect)(()=>{let e=setTimeout(()=>{l(!0)},60);return()=>clearTimeout(e)},[]),(0,c.useEffect)(()=>{if(a===`entering`&&s){let e=setTimeout(()=>o(`entered`),50);return()=>clearTimeout(e)}},[a,s]);let h=(0,c.useCallback)(()=>{e.config.animation===`none`?t():(d.current=!0,o(`exiting`),setTimeout(()=>t(),200))},[e.config.animation,t]);(0,c.useEffect)(()=>{if(!e.config.closeOnEscape)return;let t=e=>{e.key===`Escape`&&h()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e.config.closeOnEscape,h]),(0,c.useEffect)(()=>{if(!e.config.closeOnClickOutside)return;let t=e=>{m.current&&!m.current.contains(e.target)&&h()},n=setTimeout(()=>{document.addEventListener(`click`,t,!0)},0);return()=>{clearTimeout(n),document.removeEventListener(`click`,t,!0)}},[e.config.closeOnClickOutside,h,m]);let g=()=>{switch(e.actualPosition){case`top`:return`center bottom`;case`bottom`:return`center top`;case`left`:return`right center`;case`right`:return`left center`;case`center`:default:return`center center`}},_=u.current,v=(0,p.jsxs)(`div`,{ref:m,className:`entity-popup ${s?`entity-popup--${a} animation-${e.config.animation}`:``} ${e.config.className||``}`,style:{position:`fixed`,left:`${_.x}px`,top:`${_.y}px`,maxWidth:e.config.maxWidth,zIndex:e.config.zIndex,pointerEvents:`all`,opacity:s?void 0:0,transformOrigin:g(),...e.config.style},role:`dialog`,"aria-modal":`true`,children:[e.config.showCloseButton&&(0,p.jsx)(`button`,{className:`entity-popup__close`,onClick:h,"aria-label":`Close popup`,children:`×`}),(0,p.jsx)(`div`,{className:`entity-popup__content`,children:e.config.content})]});return(0,f.createPortal)(v,n)};var j=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20t='1768373933818'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20p-id='30344'%20width='200'%20height='200'%3e%3cpath%20d='M400.440142%201024h-0.073136a48.781895%2048.781895%200%200%201-45.490763-31.448598L3.383306%2066.061072a48.781895%2048.781895%200%200%201%2062.897196-62.897197l926.563466%20351.419801a48.928168%2048.928168%200%200%201%200.219409%2091.127799L597.761811%20597.688654l-151.904042%20395.082157a48.781895%2048.781895%200%200%201-45.490763%2031.229189zM133.053921%20132.907627l267.678766%20705.691916%20113.87318-296.201913a48.855032%2048.855032%200%200%201%2028.011193-27.938057l296.201913-113.87318-705.765052-267.678766z'%20p-id='30345'%20fill='%23ffffff'%20/%3e%3cscript%20xmlns=''%20/%3e%3c/svg%3e`;function ve({map:e,precision:t=6,className:n=``,style:r}){let[i,a]=(0,c.useState)(null),o=(0,c.useCallback)(e=>{a({lng:Number(e.lngLat.lng.toFixed(t)),lat:Number(e.lngLat.lat.toFixed(t))})},[t]);return(0,c.useEffect)(()=>{if(e)return e.on(`mousemove`,o),()=>{e.off(`mousemove`,o)}},[e,o]),i?(0,p.jsxs)(`div`,{className:`mapbox-coordinate-display ${n}`,style:r,children:[(0,p.jsx)(`img`,{src:j,alt:`location`,className:`mapbox-coordinate-display__icon`}),(0,p.jsxs)(`div`,{className:`mapbox-coordinate-display__content`,children:[(0,p.jsxs)(`span`,{className:`mapbox-coordinate-display__item`,children:[`经度:`,i.lng]}),(0,p.jsxs)(`span`,{className:`mapbox-coordinate-display__item`,children:[`纬度:`,i.lat]})]})]}):null}var ye=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20t='1768374054549'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20p-id='31504'%20width='200'%20height='200'%3e%3cpath%20d='M53.80096%20687.40096l282.79808%20282.79808%20633.6-633.6-282.79808-282.79808-90.39872%2090.39872-28.29824%2028.20096-42.7008%2042.7008-23.5008%2023.5008-63.20128%2063.19616-12.29824%2012.29824-373.20192%20373.30432z%20m282.79808%20212.10112l-212.10112-212.1984%2054.99904-54.99904%20106.10176%20106.10176%2028.29824-28.29824-106.10176-106.10176%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.69184-70.71232%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.70208-70.70208%2042.39872-42.39872%20106.10176%20106.10176%2028.29824-28.29824-106.09664-106.10688%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.70208-70.7072%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.70208-70.70208%2042.7008-42.7008%20106.10176%20106.10176%2028.29824-28.29824-105.99936-106.10176%2054.99904-54.99904%20212.10112%20212.10112L336.59904%20899.50208z'%20fill='%23ffffff'%20p-id='31505'%20/%3e%3cscript%20xmlns=''%20/%3e%3c/svg%3e`;function be({map:e,maxWidth:t=100,unit:n=`metric`,className:r=``,style:i}){let[a,o]=(0,c.useState)({width:100,label:`100 m`}),s=(0,c.useCallback)(()=>{if(!e)return;let r=e.getZoom(),i=e.getCenter().lat,a=40075016.686/(256*2**r),s=i*Math.PI/180,c=a*Math.cos(s)*t,l,u;if(n===`imperial`){let e=3.2808*c;if(e>5280){let n=e/5280;l=xe(n),u=`${l} mi`;let r=l/n;o({width:t*r,label:u})}else{l=xe(e),u=`${l} ft`;let n=l/e;o({width:t*n,label:u})}}else if(n===`nautical`){let e=c/1852;l=xe(e),u=`${l} nm`;let n=l/e;o({width:t*n,label:u})}else if(c>=1e3){l=xe(c/1e3),u=`${l} km`;let e=l/(c/1e3);o({width:t*e,label:u})}else{l=xe(c),u=`${l} m`;let e=l/c;o({width:t*e,label:u})}},[e,t,n]);return(0,c.useEffect)(()=>{if(e)return s(),e.on(`move`,s),e.on(`zoom`,s),()=>{e.off(`move`,s),e.off(`zoom`,s)}},[e,s]),(0,p.jsxs)(`div`,{className:`mapbox-scale-control ${r}`,style:i,children:[(0,p.jsxs)(`div`,{className:`mapbox-scale-control__bar-wrapper`,children:[(0,p.jsx)(`img`,{src:ye,alt:`scale`,className:`mapbox-scale-control__icon`}),(0,p.jsxs)(`div`,{className:`mapbox-scale-control__bar`,style:{width:`${a.width}px`},children:[(0,p.jsx)(`div`,{className:`mapbox-scale-control__tick mapbox-scale-control__tick--left`}),(0,p.jsx)(`div`,{className:`mapbox-scale-control__tick mapbox-scale-control__tick--right`})]})]}),(0,p.jsx)(`span`,{className:`mapbox-scale-control__label`,children:a.label})]})}function xe(e){let t=10**(`${Math.floor(e)}`.length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}var Se=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768989620222'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5780'%20width='128'%20height='128'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M938.666667%20602.752a42.666667%2042.666667%200%200%201%2042.368%2037.674667l0.298666%204.992V853.333333a128%20128%200%200%201-120.490666%20127.786667L853.333333%20981.333333h-208.896a42.666667%2042.666667%200%200%201-4.949333-85.034666l4.949333-0.298667H853.333333a42.666667%2042.666667%200%200%200%2042.368-37.674667L896%20853.333333v-207.914666a42.666667%2042.666667%200%200%201%2042.666667-42.666667z%20m-853.333334%203.285333a42.666667%2042.666667%200%200%201%2042.368%2037.674667l0.298667%204.992V853.333333a42.666667%2042.666667%200%200%200%2037.674667%2042.368L170.666667%20896h211.882666a42.666667%2042.666667%200%200%201%204.992%2085.034667L382.549333%20981.333333H170.666667a128%20128%200%200%201-127.786667-120.490666L42.666667%20853.333333v-204.629333a42.666667%2042.666667%200%200%201%2042.666666-42.666667zM381.866667%2042.666667A42.666667%2042.666667%200%200%201%20386.944%20127.701333L381.866667%20128H170.666667a42.666667%2042.666667%200%200%200-42.368%2037.674667L128%20170.666667v216.448a42.666667%2042.666667%200%200%201-85.034667%204.992L42.666667%20387.114667V170.666667A128%20128%200%200%201%20163.157333%2042.88L170.666667%2042.666667h211.2zM853.333333%2042.666667a128%20128%200%200%201%20127.786667%20120.490666L981.333333%20170.666667v216.064a42.666667%2042.666667%200%200%201-85.034666%204.992L896%20386.730667V170.666667a42.666667%2042.666667%200%200%200-37.674667-42.368L853.333333%20128h-214.4a42.666667%2042.666667%200%200%201-4.949333-85.034667L638.933333%2042.666667H853.333333z'%20fill='%23ffffff'%20p-id='5781'%3e%3c/path%3e%3cpath%20d='M512%20512m-128%200a128%20128%200%201%200%20256%200%20128%20128%200%201%200-256%200Z'%20fill='%23ffffff'%20p-id='5782'%3e%3c/path%3e%3c/svg%3e`;function Ce({map:e,initialCenter:t,initialZoom:n,initialPitch:r=0,initialBearing:i=0,className:a=``,style:o,duration:s=1e3}){return(0,p.jsxs)(`button`,{className:`mapbox-control-btn mapbox-reset-view-control ${a}`,onClick:()=>{e&&e.flyTo({center:t,zoom:n,pitch:r,bearing:i,duration:s})},style:o,title:`回到初始位置`,children:[(0,p.jsx)(`img`,{src:Se,alt:`home`,className:`mapbox-control-btn__icon`}),(0,p.jsx)(`span`,{children:`复位`})]})}var we=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769487141027'%20class='icon'%20viewBox='0%200%201517%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2644'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='189.625'%20height='128'%3e%3cpath%20d='M1.68121071-242.12320149h1508.24640296v1508.24640298h-1508.24640296z'%20fill='%23ffffff'%20fill-opacity='0'%20p-id='2645'%3e%3c/path%3e%3cpath%20d='M437.30078846%20170.6624h682.66239999v682.6624H437.30078846z'%20fill='%23ffffff'%20fill-opacity='0'%20p-id='2646'%3e%3c/path%3e%3cpath%20d='M1151.68343834%2040.66710748H373.42829443A81.76345149%2081.76345149%200%200%200%20292.90207634%20121.49379654v784.42363608c0%2040.42218191%2036.92257893%2077.41545989%2080.5262181%2077.4154599h781.6133488a81.76345149%2081.76345149%200%200%200%2080.52621814-80.82668906V121.49379654C1232.08593315%2077.76643404%201195.25172802%2040.66710748%201151.6657636%2040.66710748z%20m-325.39237822%20616.14222197H618.29445458V451.37556451h53.66057906c6.71640976%200%2013.41514477-3.35820487%2020.11387975-6.73408452l97.28189301-100.99359314h134.18679716v208.72127078c-46.96184405%2013.50351858-87.22495312%2053.90802574-97.28189299%20104.4048223z%20m130.7932427-20.23760311c23.50743418%200%2043.65666346%2020.21992834%2043.65666349%2043.76271204a44.50505206%2044.50505206%200%200%201-43.62131391%2043.7803868%2044.50505206%2044.50505206%200%200%201-43.6036392-43.7803868c0-23.54278369%2020.096205-43.76271203%2043.6036392-43.76271204h-0.05302433zM564.63387554%20926.10201142H373.42829443a22.87114272%2022.87114272%200%200%201-16.79102442-6.71640975%2023.04789036%2023.04789036%200%200%201-6.71640975-16.82637394V714.02253578h214.73069002v212.07947564z%20m0-269.31035673H349.92086026V118.13559167c0-10.1453137%2010.05693988-20.2376031%2023.50743417-20.23760309h553.4321645v188.53669194h-147.54891766c-6.69873499%200-13.39747001%203.35820487-20.096205%206.71640977l-97.28189297%2097.653063H460.61789801a26.44144475%2026.44144475%200%200%200-19.08874355%207.79457028%2026.63586714%2026.63586714%200%200%200-7.72387123%2019.1594426c0%2016.80869917%2013.39747001%2026.90098858%2026.81261478%2026.90098857h104.03365227v212.13249995z%20m610.48629795%20245.71454877c0.17674763%206.29221547-2.24469484%2012.37233377-6.68106024%2016.84404869s-10.49880895%206.89315739-16.77334965%206.75175927h-533.42433329v-212.0971504H829.63159021c13.39747001%2057.24855586%2067.07572382%2097.65306301%20127.48806219%2097.653063a128.67227125%20128.67227125%200%200%200%2093.05762473-37.87701612%20129.60903367%20129.60903367%200%200%200%2037.73561801-93.39344522c0-64.00031515-46.96184405-117.8553166-103.98062799-128.00063029v-208.73894554h194.56378599v558.91134088h-3.35820489v-0.05302427z%20m0-616.07152294H980.57406228V97.89798858h171.10937607c13.39747001%200%2023.45440988%2010.07461465%2023.4544099%2023.59580796v164.94088398z'%20fill='%23ffffff'%20p-id='2647'%3e%3c/path%3e%3c/svg%3e`,Te=`road-highlight-`,Ee=[{source:`composite`,sourceLayer:`road`},{source:`openmaptiles`,sourceLayer:`transportation`},{source:`maptiler_planet`,sourceLayer:`transportation`}];function De(e){let t=e.getStyle();if(!t||!t.sources)return null;for(let e of Ee){let n=t.sources[e.source];if(n&&n.type===`vector`)return e}for(let[e,n]of Object.entries(t.sources))if(n.type===`vector`)return{source:e,sourceLayer:`transportation`};return null}function Oe({map:e,highlightWidth:t=3,defaultRoadTypes:n=[],defaultMinWidth:r=0,source:i,sourceLayer:a,className:o=``,style:s}){let[u,d]=(0,c.useState)(!1),[f,h]=(0,c.useState)(n),[g,_]=(0,c.useState)(!1),v=(0,c.useRef)(null),y=(0,c.useRef)(null),b=(0,c.useRef)(null),S=(0,c.useCallback)((e,n,r)=>{if(!e.isStyleLoaded())return!1;let i=!0;return x.forEach(a=>{let o=`${Te}${a.class}`;if(!e.getLayer(o))try{e.addLayer({id:o,type:`line`,source:n,"source-layer":r,filter:[`==`,[`get`,`class`],a.class],paint:{"line-color":a.color,"line-width":t,"line-opacity":.8},layout:{visibility:`none`}}),console.log(`Added road highlight layer: ${o} (source: ${n}, source-layer: ${r})`)}catch(e){console.error(`Failed to add road highlight layer for ${a.class}:`,e),i=!1}}),i},[t]);(0,c.useEffect)(()=>{if(!e)return;let t=()=>{let t=i,n=a;if(!t||!n){let r=De(e);r&&(console.log(`Auto-detected vector source:`,r),t||=r.source,n||=r.sourceLayer)}t&&n?S(e,t,n)&&_(!0):console.warn(`No vector source found for road highlighting`)};e.isStyleLoaded()?t():e.once(`load`,t);let n=()=>{e.isStyleLoaded()&&t()};return e.on(`styledata`,n),()=>{e.off(`styledata`,n)}},[e,i,a,S]),(0,c.useEffect)(()=>{!e||!g||x.forEach(t=>{let n=`${Te}${t.class}`;if(e.getLayer(n))try{let r=f.includes(t.class);e.setLayoutProperty(n,`visibility`,r?`visible`:`none`)}catch(e){console.error(`Failed to update layer ${n}:`,e)}})},[e,g,f]),(0,c.useEffect)(()=>{if(!u)return;let e=e=>{v.current&&!v.current.contains(e.target)&&y.current&&!y.current.contains(e.target)&&d(!1)},t=setTimeout(()=>{document.addEventListener(`mousedown`,e)},0);return()=>{clearTimeout(t),document.removeEventListener(`mousedown`,e)}},[u]),(0,c.useEffect)(()=>()=>{e&&e.getStyle()&&x.forEach(t=>{let n=`${Te}${t.class}`;if(e.getLayer(n))try{e.removeLayer(n)}catch{}}),b.current&&=(b.current.remove(),null)},[e]);let ee=(0,c.useCallback)(e=>x.find(t=>t.class===e)?.label||e,[]),C=(0,c.useCallback)(t=>{if(!e||f.length===0){b.current&&b.current.remove(),e?.getCanvas().style.cursor&&(e.getCanvas().style.cursor=``);return}let n=f.map(e=>`${Te}${e}`),r=[[t.point.x-10,t.point.y-10],[t.point.x+10,t.point.y+10]],i=e.queryRenderedFeatures(r,{layers:n.filter(t=>e.getLayer(t))});if(i.length>0){let n=i[0].properties||{},r=t.lngLat,a=n.name||n.name_en||n.name_local||``,o=n.class||``,s=n.type||``,c=n.structure||``,u=n.oneway,d=n.layer,f=n.iso_3166_1||``,p=n.iso_3166_2||``,m=e=>!(e==null||e===``||typeof e==`string`&&e.toLowerCase()===`none`),h=[];m(o)&&h.push(`
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`mapbox-gl`);l=s(l);let u=require(`@turf/turf`);u=s(u);let d=require(`react-dom/client`);d=s(d);let f=require(`react-dom`);f=s(f);let p=require(`react/jsx-runtime`);p=s(p);let m=require(`@arco-design/web-react`);m=s(m);const h={fillColor:`#ffffff`,fillOpacity:1,strokeColor:`rgba(0, 0, 0, 0.8)`,strokeWidth:1,strokeOpacity:1},g={fillColor:`#ffcc00`,fillOpacity:1,strokeColor:`#ff6600`,strokeWidth:2,strokeOpacity:1};function _(e,t,n=h){return{fillColor:e?.fillColor??t?.fillColor??n.fillColor,fillOpacity:e?.fillOpacity??t?.fillOpacity??n.fillOpacity,strokeColor:e?.strokeColor??t?.strokeColor??n.strokeColor,strokeWidth:e?.strokeWidth??t?.strokeWidth??n.strokeWidth,strokeOpacity:e?.strokeOpacity??t?.strokeOpacity??n.strokeOpacity}}const v={blue:{center:`#4285f4`,edge:`#4285f400`,mid:`#1a73e8`},green:{center:`#34a853`,edge:`#34a85300`,mid:`#0d652d`},red:{center:`#ea4335`,edge:`#ea433500`,mid:`#c5221f`},purple:{center:`#9c27b0`,edge:`#9c27b000`,mid:`#6a1b9a`},cyan:{center:`#00bcd4`,edge:`#00bcd400`,mid:`#00838f`},orange:{center:`#ff9800`,edge:`#ff980000`,mid:`#f57c00`}},y={rotationSpeed:1,initialRotation:0,colorScheme:`green`,opacity:70,gradientType:`conical`,showRings:!0,showCenter:!0,showScanLine:!0},b={trigger:`click`,position:`top`,offset:[0,-10],showCloseButton:!0,animation:`fade`,closeOnClickOutside:!0,closeOnEscape:!0,hoverDelay:300,maxWidth:320,zIndex:1e3},x=[{class:`motorway`,label:`高速公路`,color:`#E84E3C`},{class:`trunk`,label:`国道`,color:`#FF8C00`},{class:`primary`,label:`主干道`,color:`#FFD700`},{class:`secondary`,label:`次干道`,color:`#4CAF50`},{class:`tertiary`,label:`三级道路`,color:`#2196F3`},{class:`motorway_link`,label:`高速匝道`,color:`#FF6B6B`},{class:`trunk_link`,label:`国道匝道`,color:`#FFB84D`},{class:`primary_link`,label:`主干道匝道`,color:`#FFE066`},{class:`secondary_link`,label:`次干道匝道`,color:`#66BB6A`},{class:`tertiary_link`,label:`三级道路匝道`,color:`#42A5F5`},{class:`minor`,label:`小路`,color:`#81C784`},{class:`residential`,label:`居民区道路`,color:`#81C784`},{class:`unclassified`,label:`未分类道路`,color:`#9E9E9E`},{class:`service`,label:`服务道路`,color:`#64B5F6`},{class:`track`,label:`土路`,color:`#A1887F`},{class:`path`,label:`小径`,color:`#BCAAA4`}];function S(e,t,n){let r=u.point(e);return u.destination(r,t/1e3,n,{units:`kilometers`}).geometry.coordinates}function ee(e,t){return u.distance(u.point(e),u.point(t),{units:`kilometers`})*1e3}function C(e,t){return u.bearing(u.point(e),u.point(t))}const w=512,T=512/2,te=512/2-2;function ne(e){return e*Math.PI/180}function E(e=1){return .3+Math.max(0,Math.min(1,e))*.7}var re=class{constructor(e,t,n,r,i){this.isDestroyed=!1,this.isSelected=!1,this.map=e,this.entity=t,this.entityId=t.id,this.globalNameConfig=r,this.globalSelectNameConfig=i,this.sourceId=`${n}-source-${String(t.id)}`,this.layerId=`${n}-layer-${String(t.id)}`,this.labelSourceId=`${n}-label-source-${String(t.id)}`,this.labelLayerId=`${n}-label-layer-${String(t.id)}`,this.canvas=document.createElement(`canvas`),this.canvas.width=512,this.canvas.height=512,this.ctx=this.canvas.getContext(`2d`)}init(e){this.draw(),this.map.addSource(this.sourceId,{type:`canvas`,canvas:this.canvas,coordinates:e,animate:!0}),this.map.addLayer({id:this.layerId,type:`raster`,source:this.sourceId,paint:{"raster-fade-duration":0,"raster-opacity":1}}),this.initLabelLayer()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLabelLayer(){let e=this.getEntityCenter(),{name:t,confidence:n}=this.entity,r=E(n);this.map.addSource(this.labelSourceId,{type:`geojson`,data:{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:t||``,selected:this.isSelected,opacity:r}}}),this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.labelSourceId,layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.5],"text-allow-overlap":!0},paint:{"text-opacity":[`get`,`opacity`],"text-color":[`case`,[`get`,`selected`],this.selectNameStyle.fillColor,this.nameStyle.fillColor],"text-halo-color":[`case`,[`get`,`selected`],this.selectNameStyle.strokeColor,this.nameStyle.strokeColor],"text-halo-width":[`case`,[`get`,`selected`],this.selectNameStyle.strokeWidth,this.nameStyle.strokeWidth]}})}updateLabel(){let e=this.map.getSource(this.labelSourceId);if(!e)return;let t=E(this.entity.confidence);e.setData({type:`Feature`,geometry:{type:`Point`,coordinates:this.getEntityCenter()},properties:{name:this.entity.name||``,selected:this.isSelected,opacity:t}})}setSelected(e){this.isSelected!==e&&(this.isSelected=e,this.updateLabel())}colorWithAlpha(e,t){if(e.startsWith(`rgba`))return e;if(e.startsWith(`#`)){let n=e.slice(1),r=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return`rgba(${r}, ${i}, ${a}, ${t})`}return e.startsWith(`rgb(`)?e.replace(`rgb(`,`rgba(`).replace(`)`,`, ${t})`):e}updateSourceCoordinates(e){this.map.getSource(this.sourceId)?.setCoordinates(e)}getEntityId(){return this.entityId}getCenter(){return this.getEntityCenter()}getBounds(){return this.getEntityBounds()}getLayerId(){return this.layerId}getLabelLayerId(){return this.labelLayerId}destroy(){this.isDestroyed=!0,this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getSource(this.labelSourceId)&&this.map.removeSource(this.labelSourceId),this.map.getLayer(this.layerId)&&this.map.removeLayer(this.layerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId)}};function ie(e,t){let n=S(e,t,0),r=S(e,t,90),i=S(e,t,180),a=S(e,t,270)[0],o=r[0],s=i[1],c=n[1];return[[a,c],[o,c],[o,s],[a,s]]}var ae=class extends re{constructor(e,t,n,r){super(e,t,`radar`,n,r),this.animationFrameId=null,this.currentRotation=t.initialRotation??y.initialRotation;let i=ie(t.center,t.radius);this.init(i),t.isAnimating&&this.startAnimation()}getEntityCenter(){return this.entity.center}getEntityBounds(){let e=ie(this.entity.center,this.entity.radius),t=e[3][0],n=e[3][1],r=e[1][0],i=e[1][1];return[[t,n],[r,i]]}draw(){let e=this.ctx,t=this.entity;e.clearRect(0,0,512,512),e.globalAlpha=E(t.confidence),this.drawSector(e,t),(t.showRings??y.showRings)&&this.drawRings(e),(t.showScanLine??y.showScanLine)&&this.drawScanLine(e,t),(t.showCenter??y.showCenter)&&this.drawCenterDot(e,t),e.globalAlpha=1}drawSector(e,t){let n=t.colorScheme??y.colorScheme,r=v[n],i=(t.opacity??y.opacity)/100,a=t.sectorAngle,o=ne(this.currentRotation-a/2-90),s=ne(this.currentRotation+a/2-90),c=e.createRadialGradient(256,256,0,256,256,254);c.addColorStop(0,this.colorWithAlpha(r.center,i)),c.addColorStop(.5,this.colorWithAlpha(r.mid,i*.6)),c.addColorStop(1,this.colorWithAlpha(r.edge,0)),e.beginPath(),e.moveTo(256,256),e.arc(256,256,254,o,s),e.closePath(),e.fillStyle=c,e.fill()}drawRings(e){e.strokeStyle=`rgba(255, 255, 255, 0.2)`,e.lineWidth=2,e.setLineDash([5,5]);for(let t=1;t<=3;t++){let n=254*t/3;e.beginPath(),e.arc(256,256,n,0,Math.PI*2),e.stroke()}e.setLineDash([])}drawScanLine(e,t){let n=t.colorScheme??y.colorScheme,r=v[n],i=ne(this.currentRotation-90),a=256+Math.cos(i)*254,o=256+Math.sin(i)*254;e.beginPath(),e.moveTo(256,256),e.lineTo(a,o),e.strokeStyle=r.center,e.lineWidth=2,e.lineCap=`round`,e.globalAlpha=.8,e.stroke(),e.globalAlpha=1}drawCenterDot(e,t){let n=t.colorScheme??y.colorScheme,r=v[n];e.beginPath(),e.arc(256,256,5,0,Math.PI*2),e.fillStyle=r.center,e.fill(),e.strokeStyle=`white`,e.lineWidth=2,e.stroke()}startAnimation(){if(this.animationFrameId!==null||this.isDestroyed)return;let e=()=>{if(this.isDestroyed)return;let t=this.entity.rotationSpeed??y.rotationSpeed;this.currentRotation+=t,this.currentRotation>=360&&(this.currentRotation-=360),this.draw(),this.animationFrameId=requestAnimationFrame(e)};this.animationFrameId=requestAnimationFrame(e),this.map.getSource(this.sourceId)?.play()}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.map.getSource(this.sourceId)?.pause()}update(e){let t=this.entity;if(this.entity=e,t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.radius!==e.radius){let t=ie(e.center,e.radius);this.updateSourceCoordinates(t)}(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.name!==e.name||t.confidence!==e.confidence)&&this.updateLabel(),t.isAnimating!==e.isAnimating&&(e.isAnimating?this.startAnimation():this.stopAnimation()),e.isAnimating||this.draw()}isPointInEntity(e){let{center:t,radius:n}=this.entity,r=e[0]-t[0],i=e[1]-t[1],a=111320*Math.cos(t[1]*Math.PI/180);return Math.sqrt((r*a)**2+(i*110540)**2)<=n}destroy(){this.stopAnimation(),super.destroy()}};function oe(e,t,n){let r=t/2,i=n/2,a=S(e,i,0),o=S(e,r,90),s=S(e,i,180),c=S(e,r,270)[0],l=o[0],u=s[1],d=a[1];return[[c,d],[l,d],[l,u],[c,u]]}var se=class extends re{constructor(e,t,n,r){super(e,t,`image`,n,r),this.loadedImage=null,this.imageLoaded=!1,this.currentSrc=``,this.imageAspectRatio=1,this.loadImage(t.src,!0)}getSize(){let{width:e}=this.entity,t=e/this.imageAspectRatio;return[e,t]}loadImage(e,t=!1){if(!e){console.warn(`Image src is empty`);return}this.currentSrc=e;let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{if(e===this.currentSrc)if(this.loadedImage=n,this.imageLoaded=!0,this.imageAspectRatio=n.naturalWidth/n.naturalHeight,t){let[e,t]=this.getSize(),n=oe(this.entity.center,e,t);this.init(n)}else{let[e,t]=this.getSize(),n=oe(this.entity.center,e,t);this.updateSourceCoordinates(n),this.draw()}},n.onerror=()=>{console.error(`Failed to load image: ${e}`)},n.src=e}getEntityCenter(){return this.entity.center}getEntityBounds(){let[e,t]=this.getSize(),n=oe(this.entity.center,e,t),r=n[3][0],i=n[3][1],a=n[1][0],o=n[1][1];return[[r,i],[a,o]]}initLabelLayer(){let e=this.getEntityCenter(),{name:t,confidence:n}=this.entity,r=E(n);this.map.addSource(this.labelSourceId,{type:`geojson`,data:{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:t||``,selected:this.isSelected,opacity:r}}}),this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.labelSourceId,layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-opacity":[`get`,`opacity`],"text-color":[`case`,[`get`,`selected`],`#ffcc00`,`#ffffff`],"text-halo-color":[`case`,[`get`,`selected`],`#ff6600`,`rgba(0, 0, 0, 0.8)`],"text-halo-width":[`case`,[`get`,`selected`],2,1]}})}draw(){let e=this.ctx;if(e.clearRect(0,0,512,512),!this.imageLoaded||!this.loadedImage)return;e.globalAlpha=E(this.entity.confidence),e.save(),e.translate(256,256);let t=this.entity.rotation??0;t!==0&&e.rotate(ne(t)),e.drawImage(this.loadedImage,-508/2,-508/2,508,508),e.restore(),e.globalAlpha=1}update(e){let t=this.entity;if(this.entity=e,t.src!==e.src){this.imageLoaded=!1,this.loadedImage=null,this.loadImage(e.src);return}if(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.width!==e.width){let[t,n]=this.getSize(),r=oe(e.center,t,n);this.updateSourceCoordinates(r)}(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.name!==e.name||t.confidence!==e.confidence)&&this.updateLabel(),(t.rotation!==e.rotation||t.confidence!==e.confidence)&&this.draw()}isPointInEntity(e){let{center:t}=this.entity,[n,r]=this.getSize(),i=e[0]-t[0],a=e[1]-t[1],o=111320*Math.cos(t[1]*Math.PI/180),s=Math.abs(i*o),c=Math.abs(a*110540);return s<=n/2&&c<=r/2}},ce=class{constructor(e,t,n,r){this.marker=null,this.markerElement=null,this.imageElement=null,this.labelElement=null,this.placeholderElement=null,this.isSelected=!1,this.imageAspectRatio=1,this.imageLoaded=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.loadImageAndCreateMarker(t.src)}loadImageAndCreateMarker(e){if(!e){console.warn(`Marker src is empty`);return}let t=new Image;t.crossOrigin=`anonymous`,t.onload=()=>{this.imageAspectRatio=t.naturalWidth/t.naturalHeight,this.imageLoaded=!0,this.createMarker()},t.onerror=()=>{console.error(`Failed to load marker image: ${e}`)},t.src=e}createMarker(){let{center:e,src:t,width:n,rotation:r=0,anchor:i=`center`,name:a,confidence:o}=this.entity,s=n/this.imageAspectRatio;this.markerElement=document.createElement(`div`),this.markerElement.className=`mapbox-marker-container`,this.markerElement.setAttribute(`data-entity-id`,String(this.entity.id)),this.onBeforeImageCreate(),a&&(this.placeholderElement=document.createElement(`div`),this.placeholderElement.className=`mapbox-marker-placeholder`,this.placeholderElement.textContent=a,this.markerElement.appendChild(this.placeholderElement)),this.imageElement=document.createElement(`img`),this.imageElement.src=t,this.imageElement.style.width=`${n}px`,this.imageElement.style.height=`${s}px`,this.imageElement.style.transform=`rotate(${r}deg)`,this.imageElement.style.opacity=`${E(o)}`,this.imageElement.style.pointerEvents=`auto`,this.markerElement.appendChild(this.imageElement),a&&(this.labelElement=document.createElement(`div`),this.labelElement.className=`mapbox-marker-label`,this.labelElement.textContent=a,this.labelElement.setAttribute(`data-entity-id`,String(this.entity.id)),this.updateLabelStyle(),this.markerElement.appendChild(this.labelElement)),this.marker=new l.default.Marker({element:this.markerElement,anchor:i}).setLngLat(e).addTo(this.map),this.onMarkerCreated()}onBeforeImageCreate(){}onMarkerCreated(){}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}updateLabelStyle(){if(!this.labelElement)return;let{confidence:e}=this.entity,t=E(e),n=this.isSelected?this.selectNameStyle:this.nameStyle;this.labelElement.className=this.isSelected?`mapbox-marker-label mapbox-marker-label--selected`:`mapbox-marker-label`,this.labelElement.style.opacity=`${t}`,this.labelElement.style.color=n.fillColor;let r=n.strokeWidth,i=n.strokeColor;this.labelElement.style.webkitTextStroke=`${r*1.5}px ${i}`,this.labelElement.style.paintOrder=`stroke fill`,this.labelElement.style.textShadow=`none`}getEntityId(){return this.entity.id}getCenter(){return this.entity.center}getBounds(){let{center:e,width:t}=this.entity,n=t/this.imageAspectRatio,r=this.map.getZoom(),i=156543.03392*Math.cos(e[1]*Math.PI/180)/2**r,a=t*i,o=n*i,s=111320*Math.cos(e[1]*Math.PI/180),c=a/2/s,l=o/2/110540;return[[e[0]-c,e[1]-l],[e[0]+c,e[1]+l]]}getLayerId(){return`marker-${this.entity.id}`}getLabelLayerId(){return null}setSelected(e){this.isSelected!==e&&(this.isSelected=e,this.updateLabelStyle())}isPointInEntity(e){if(!this.marker||!this.imageLoaded)return!1;let{center:t,width:n}=this.entity,r=n/this.imageAspectRatio,i=this.map.getZoom(),a=156543.03392*Math.cos(t[1]*Math.PI/180)/2**i,o=n*a,s=r*a,c=e[0]-t[0],l=e[1]-t[1],u=111320*Math.cos(t[1]*Math.PI/180),d=Math.abs(c*u),f=Math.abs(l*110540);return d<=o/2&&f<=s/2}update(e){let t=this.entity;if(this.entity=e,t.src!==e.src){this.destroy(),this.imageLoaded=!1,this.loadImageAndCreateMarker(e.src);return}if(!this.marker||!this.imageElement)return;(t.center[0]!==e.center[0]||t.center[1]!==e.center[1])&&this.marker.setLngLat(e.center);let n=e.width/this.imageAspectRatio,r=e.rotation??0,i=E(e.confidence);(t.width!==e.width||t.rotation!==e.rotation||t.confidence!==e.confidence)&&(this.imageElement.style.width=`${e.width}px`,this.imageElement.style.height=`${n}px`,this.imageElement.style.transform=`rotate(${r}deg)`,this.imageElement.style.opacity=`${i}`),t.name!==e.name&&(e.name&&!this.labelElement?(this.labelElement=document.createElement(`div`),this.labelElement.className=`mapbox-marker-label`,this.labelElement.textContent=e.name,this.updateLabelStyle(),this.markerElement?.appendChild(this.labelElement),this.placeholderElement=document.createElement(`div`),this.placeholderElement.className=`mapbox-marker-placeholder`,this.placeholderElement.textContent=e.name,this.markerElement?.insertBefore(this.placeholderElement,this.markerElement.firstChild)):!e.name&&this.labelElement?(this.labelElement.remove(),this.labelElement=null,this.placeholderElement?.remove(),this.placeholderElement=null):this.labelElement&&(this.labelElement.textContent=e.name||``,this.placeholderElement&&(this.placeholderElement.textContent=e.name||``))),t.confidence!==e.confidence&&this.updateLabelStyle()}destroy(){this.marker&&=(this.marker.remove(),null),this.markerElement=null,this.imageElement=null,this.labelElement=null,this.placeholderElement=null}},le=class extends ce{constructor(e,t,n,r){super(e,t,n,r),this.showTrajectory=0,this.showTrajectoryPoints=!1,this.trajInitialized=!1,this.statusElement=null,this.statusRoot=null,this.trajSourceId=`unit-traj-source-${t.id}`,this.trajLayerId=`unit-traj-layer-${t.id}`,this.trajPointsLayerId=`unit-traj-points-layer-${t.id}`,t.showTrajectory&&(this.showTrajectory=t.showTrajectory),this.showTrajectoryPoints=t.showTrajectoryPoints??!1}renderStatus(){return null}onBeforeImageCreate(){this.markerElement&&(this.statusElement=document.createElement(`div`),this.statusElement.className=`mapbox-unit-status`,this.markerElement.appendChild(this.statusElement),this.updateStatusContent())}updateStatusContent(){if(!this.statusElement)return;let e=this.renderStatus();e?(this.statusRoot||=(0,d.createRoot)(this.statusElement),this.statusRoot.render(e),this.statusElement.style.display=`block`):(this.statusRoot&&this.statusRoot.render(null),this.statusElement.style.display=`none`)}refreshStatus(){this.updateStatusContent()}getLayerId(){return`unit-${this.entity.id}`}onMarkerCreated(){this.entity.showTrajectory&&(this.showTrajectory=this.entity.showTrajectory,this.initTrajectoryLayer())}shouldShowTrajectory(){return this.showTrajectory===`all`||typeof this.showTrajectory==`number`&&this.showTrajectory>0}getTrajectoryCount(){let{predicted_traj:e}=this.entity;return!e||e.length===0?0:this.showTrajectory===`all`?e.length:typeof this.showTrajectory==`number`&&this.showTrajectory>0?Math.min(this.showTrajectory,e.length):0}initTrajectoryLayer(){if(this.trajInitialized)return;if(!this.map.isStyleLoaded()){requestAnimationFrame(()=>this.initTrajectoryLayer());return}let e=this.getTrajectoryGeoJSON();this.map.addSource(this.trajSourceId,{type:`geojson`,data:e});let t=this.shouldShowTrajectory()?`visible`:`none`,n=this.shouldShowTrajectory()&&this.showTrajectoryPoints?`visible`:`none`;this.map.addLayer({id:this.trajLayerId,type:`line`,source:this.trajSourceId,layout:{"line-join":`round`,"line-cap":`round`,visibility:t},paint:{"line-color":this.isSelected?`#ffcc00`:`#00ff88`,"line-width":3,"line-opacity":E(this.entity.confidence)*.8,"line-dasharray":[2,2]}}),this.map.addLayer({id:this.trajPointsLayerId,type:`circle`,source:this.trajSourceId,filter:[`==`,`$type`,`Point`],layout:{visibility:n},paint:{"circle-radius":4,"circle-color":this.isSelected?`#ffcc00`:`#00ff88`,"circle-stroke-color":`#ffffff`,"circle-stroke-width":1,"circle-opacity":E(this.entity.confidence)}}),this.trajInitialized=!0}getTrajectoryGeoJSON(){let{predicted_traj:e,center:t}=this.entity,n=this.getTrajectoryCount();if(!e||e.length===0||n===0)return{type:`FeatureCollection`,features:[]};let r=e.slice(0,n),i=[t],a=[];return r.forEach((e,t)=>{let n=[e.lon,e.lat];i.push(n),a.push({type:`Feature`,geometry:{type:`Point`,coordinates:n},properties:{index:t,alt:e.alt}})}),{type:`FeatureCollection`,features:[{type:`Feature`,geometry:{type:`LineString`,coordinates:i},properties:{}},...a]}}setShowTrajectory(e){let t=e===`all`||typeof e==`number`&&e>0;if(t&&!this.trajInitialized){this.showTrajectory=e,this.initTrajectoryLayer();return}let n=this.shouldShowTrajectory();if(this.showTrajectory=e,this.trajInitialized){let e=t?`visible`:`none`,r=t&&this.showTrajectoryPoints?`visible`:`none`;this.map.getLayer(this.trajLayerId)&&this.map.setLayoutProperty(this.trajLayerId,`visibility`,e),this.map.getLayer(this.trajPointsLayerId)&&this.map.setLayoutProperty(this.trajPointsLayerId,`visibility`,r),t&&n&&this.updateTrajectoryData()}}getShowTrajectory(){return this.showTrajectory}setShowTrajectoryPoints(e){if(this.showTrajectoryPoints=e,this.trajInitialized&&this.map.getLayer(this.trajPointsLayerId)){let t=this.shouldShowTrajectory()&&e?`visible`:`none`;this.map.setLayoutProperty(this.trajPointsLayerId,`visibility`,t)}}getShowTrajectoryPoints(){return this.showTrajectoryPoints}setSelected(e){let t=this.isSelected;super.setSelected(e),t!==e&&this.trajInitialized&&this.updateTrajectoryStyle()}updateTrajectoryStyle(){let e=this.isSelected?`#ffcc00`:`#00ff88`,t=E(this.entity.confidence);this.map.getLayer(this.trajLayerId)&&(this.map.setPaintProperty(this.trajLayerId,`line-color`,e),this.map.setPaintProperty(this.trajLayerId,`line-opacity`,t*.8)),this.map.getLayer(this.trajPointsLayerId)&&(this.map.setPaintProperty(this.trajPointsLayerId,`circle-color`,e),this.map.setPaintProperty(this.trajPointsLayerId,`circle-opacity`,t))}updateTrajectoryData(){if(!this.trajInitialized)return;let e=this.map.getSource(this.trajSourceId);e&&e.setData(this.getTrajectoryGeoJSON())}update(e){let t=this.entity;super.update(e),t.showTrajectory!==e.showTrajectory&&this.setShowTrajectory(e.showTrajectory??0),t.showTrajectoryPoints!==e.showTrajectoryPoints&&this.setShowTrajectoryPoints(e.showTrajectoryPoints??!1),this.updateTrajectoryData(),t.confidence!==e.confidence&&this.updateTrajectoryStyle()}destroy(){this.statusRoot&&=(this.statusRoot.unmount(),null),this.statusElement=null,this.trajInitialized&&(this.map.getLayer(this.trajPointsLayerId)&&this.map.removeLayer(this.trajPointsLayerId),this.map.getLayer(this.trajLayerId)&&this.map.removeLayer(this.trajLayerId),this.map.getSource(this.trajSourceId)&&this.map.removeSource(this.trajSourceId)),super.destroy()}},ue=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`polygon-source-${t.id}`,this.fillLayerId=`polygon-fill-${t.id}`,this.strokeLayerId=`polygon-stroke-${t.id}`,this.labelLayerId=`polygon-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],layout:{"line-join":`round`,"line-cap":`round`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{coordinates:e,name:t}=this.entity;if(!e||e.length<3)return{type:`FeatureCollection`,features:[]};let n=[...e];(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1])&&n.push(e[0]);let r=[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[n]},properties:{}}];if(t){let n=this.getBottomPoint(e);r.push({type:`Feature`,geometry:{type:`Point`,coordinates:n},properties:{name:t}})}return{type:`FeatureCollection`,features:r}}getBottomPoint(e){let t=e[0],n=e[0][1];for(let r of e)r[1]<n&&(n=r[1],t=r);return t}getEntityId(){return this.entity.id}getBounds(){let{coordinates:e}=this.entity;if(!e||e.length===0){let e=this.getCenter();return[e,e]}let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e)t=Math.min(t,a[0]),n=Math.max(n,a[0]),r=Math.min(r,a[1]),i=Math.max(i,a[1]);return[[t,r],[n,i]]}getCenter(){return this.entity.center?this.entity.center:this.calculateGeometricCenter()}calculateGeometricCenter(){let{coordinates:e}=this.entity;if(!e||e.length===0)return[0,0];let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];return[t/e.length,n/e.length]}getLayerId(){return this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{coordinates:t}=this.entity;return!t||t.length<3?!1:this.pointInPolygon(e,t)}pointInPolygon(e,t){let[n,r]=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let[o,s]=t[e],[c,l]=t[a];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.coordinates!==t.coordinates||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}},de=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,lineCap:`round`,lineJoin:`round`}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`polyline-source-${t.id}`,this.lineLayerId=`polyline-stroke-${t.id}`,this.labelLayerId=`polyline-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.lineLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`LineString`],layout:{"line-join":this.entity.lineJoin??e.DEFAULTS.lineJoin,"line-cap":this.entity.lineCap??e.DEFAULTS.lineCap},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r,...this.entity.dashArray?{"line-dasharray":this.entity.dashArray}:{}}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{coordinates:e,name:t}=this.entity;if(!e||e.length<2)return{type:`FeatureCollection`,features:[]};let n=[{type:`Feature`,geometry:{type:`LineString`,coordinates:e},properties:{}}];if(t){let r=this.getMidPoint(e);n.push({type:`Feature`,geometry:{type:`Point`,coordinates:r},properties:{name:t}})}return{type:`FeatureCollection`,features:n}}getMidPoint(e){if(e.length===1)return e[0];let t=Math.floor((e.length-1)/2),n=e[t],r=e[t+1];return[(n[0]+r[0])/2,(n[1]+r[1])/2]}getEntityId(){return this.entity.id}getBounds(){let{coordinates:e}=this.entity;if(!e||e.length===0){let e=this.getCenter();return[e,e]}let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e)t=Math.min(t,a[0]),n=Math.max(n,a[0]),r=Math.min(r,a[1]),i=Math.max(i,a[1]);return[[t,r],[n,i]]}getCenter(){return this.entity.center?this.entity.center:this.calculateGeometricCenter()}calculateGeometricCenter(){let{coordinates:e}=this.entity;if(!e||e.length===0)return[0,0];let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];return[t/e.length,n/e.length]}getLayerId(){return this.lineLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.lineLayerId)&&this.map.setPaintProperty(this.lineLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{coordinates:t}=this.entity;if(!t||t.length<2)return!1;let n=this.getClickThreshold();for(let r=0;r<t.length-1;r++)if(this.pointToSegmentDistance(e,t[r],t[r+1])<n)return!0;return!1}getClickThreshold(){return .001*2**(12-this.map.getZoom())}pointToSegmentDistance(e,t,n){let[r,i]=e,[a,o]=t,[s,c]=n,l=s-a,u=c-o,d=l*l+u*u;if(d===0)return Math.sqrt((r-a)*(r-a)+(i-o)*(i-o));let f=((r-a)*l+(i-o)*u)/d;f=Math.max(0,Math.min(1,f));let p=a+f*l,m=o+f*u;return Math.sqrt((r-p)*(r-p)+(i-m)*(i-m))}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.coordinates!==t.coordinates||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence||n.dashArray!==t.dashArray)&&this.map.getLayer(this.lineLayerId)&&(this.isSelected||this.map.setPaintProperty(this.lineLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.lineLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.lineLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i),t.dashArray&&this.map.setPaintProperty(this.lineLayerId,`line-dasharray`,t.dashArray)),(n.lineCap!==t.lineCap||n.lineJoin!==t.lineJoin)&&this.map.getLayer(this.lineLayerId)&&(this.map.setLayoutProperty(this.lineLayerId,`line-cap`,t.lineCap??e.DEFAULTS.lineCap),this.map.setLayoutProperty(this.lineLayerId,`line-join`,t.lineJoin??e.DEFAULTS.lineJoin)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.lineLayerId)&&this.map.removeLayer(this.lineLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}};function D(e,t,n=64){let[r,i]=e,a=[],o=t/6371e3,s=i*Math.PI/180;for(let e=0;e<=n;e++){let t=e/n*2*Math.PI,c=o*Math.cos(t),l=o*Math.sin(t)/Math.cos(s),u=i+c*180/Math.PI,d=r+l*180/Math.PI;a.push([d,u])}return a}var fe=class e{static{this.GRADIENT_STEPS=10}static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2,fillType:`solid`,showCenterPoint:!0,centerPointRadius:4}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.gradientLayerIds=[],this.gradientSourceIds=[],this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`circle-source-${t.id}`,this.fillLayerId=`circle-fill-${t.id}`,this.strokeLayerId=`circle-stroke-${t.id}`,this.centerPointLayerId=`circle-center-${t.id}`,this.labelLayerId=`circle-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);(this.entity.fillType??e.DEFAULTS.fillType)===`radial-gradient`?this.initGradientLayers(r):this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,[`get`,`type`],`circle`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,[`get`,`type`],`circle`],layout:{"line-join":`round`,"line-cap":`round`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),(this.entity.showCenterPoint??e.DEFAULTS.showCenterPoint)&&this.map.addLayer({id:this.centerPointLayerId,type:`circle`,source:this.sourceId,filter:[`==`,[`get`,`type`],`center`],paint:{"circle-radius":this.entity.centerPointRadius??e.DEFAULTS.centerPointRadius,"circle-color":this.entity.centerPointColor??this.entity.fillColor??e.DEFAULTS.fillColor,"circle-opacity":r,"circle-stroke-width":1,"circle-stroke-color":`#ffffff`,"circle-stroke-opacity":r*.8}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,[`get`,`type`],`center`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}initGradientLayers(t){let{center:n,radius:r}=this.entity,i=this.entity.fillColor??e.DEFAULTS.fillColor,a=this.entity.fillOpacity??e.DEFAULTS.fillOpacity,o=this.parseColor(i);for(let i=0;i<e.GRADIENT_STEPS;i++){let s=1-i/e.GRADIENT_STEPS,c=r*s,l=i/(e.GRADIENT_STEPS-1)*a*t,u=`${this.sourceId}-gradient-${i}`,d=`${this.fillLayerId}-gradient-${i}`,f=D(n,c);this.map.addSource(u,{type:`geojson`,data:{type:`Feature`,geometry:{type:`Polygon`,coordinates:[f]},properties:{}}}),this.map.addLayer({id:d,type:`fill`,source:u,paint:{"fill-color":`rgb(${o.r}, ${o.g}, ${o.b})`,"fill-opacity":l}}),this.gradientSourceIds.push(u),this.gradientLayerIds.push(d)}}parseColor(e){if(e.startsWith(`#`)){let t=e.slice(1);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return t?{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}:{r:51,g:136,b:255}}getGeoJSON(){let{center:e,radius:t,name:n}=this.entity;return{type:`FeatureCollection`,features:[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[D(e,t)]},properties:{type:`circle`}},{type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{type:`center`,name:n||``}}]}}getEntityId(){return this.entity.id}getCenter(){return this.entity.center}getBounds(){let{center:e,radius:t}=this.entity,[n,r]=e,i=t/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r-o],[n+s,r+o]]}getLayerId(){return this.gradientLayerIds.length>0?this.gradientLayerIds[this.gradientLayerIds.length-1]:this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{center:t,radius:n}=this.entity;return this.calculateDistance(e,t)<=n}calculateDistance(e,t){let[n,r]=e,[i,a]=t,o=(a-r)*Math.PI/180,s=(i-n)*Math.PI/180,c=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r),a=t.fillType??e.DEFAULTS.fillType,o=n.fillType??e.DEFAULTS.fillType;if(a!==o){this.destroy(),this.initialized=!1,this.gradientLayerIds=[],this.gradientSourceIds=[],this.initLayers();return}if(n.center!==t.center||n.radius!==t.radius||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),a===`radial-gradient`&&this.updateGradientLayers(i),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,[`get`,`type`],`center`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}a===`solid`?(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)):(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.updateGradientLayerStyles(i),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),(n.centerPointColor!==t.centerPointColor||n.centerPointRadius!==t.centerPointRadius||n.fillColor!==t.fillColor||n.confidence!==t.confidence)&&this.map.getLayer(this.centerPointLayerId)&&(this.map.setPaintProperty(this.centerPointLayerId,`circle-color`,t.centerPointColor??t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.centerPointLayerId,`circle-radius`,t.centerPointRadius??e.DEFAULTS.centerPointRadius),this.map.setPaintProperty(this.centerPointLayerId,`circle-opacity`,i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}updateGradientLayers(t){let{center:n,radius:r}=this.entity;for(let t=0;t<this.gradientSourceIds.length;t++){let i=1-t/e.GRADIENT_STEPS,a=r*i,o=D(n,a),s=this.map.getSource(this.gradientSourceIds[t]);s&&s.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[o]},properties:{}})}this.updateGradientLayerStyles(t)}updateGradientLayerStyles(t){let n=this.entity.fillColor??e.DEFAULTS.fillColor,r=this.entity.fillOpacity??e.DEFAULTS.fillOpacity,i=this.parseColor(n);for(let n=0;n<this.gradientLayerIds.length;n++){let a=n/(e.GRADIENT_STEPS-1)*r*t;this.map.getLayer(this.gradientLayerIds[n])&&(this.map.setPaintProperty(this.gradientLayerIds[n],`fill-color`,`rgb(${i.r}, ${i.g}, ${i.b})`),this.map.setPaintProperty(this.gradientLayerIds[n],`fill-opacity`,a))}}destroy(){if(this.initialized){this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.centerPointLayerId)&&this.map.removeLayer(this.centerPointLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId);for(let e of this.gradientLayerIds)this.map.getLayer(e)&&this.map.removeLayer(e);for(let e of this.gradientSourceIds)this.map.getSource(e)&&this.map.removeSource(e);this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),this.initialized=!1}}};const O={gradientAnimation:`flicker`,animationSpeed:1,fillColor:`#3388ff`,fillOpacity:.6,strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,showCenterPoint:!0,centerPointRadius:4};function k(e,t){let n=S(e,t,0),r=S(e,t,90),i=S(e,t,180),a=S(e,t,270)[0],o=r[0],s=i[1],c=n[1];return[[a,c],[o,c],[o,s],[a,s]]}var pe=class extends re{constructor(e,t,n,r){super(e,t,`canvas-circle`,n,r),this.animationFrameId=null,this.animationTime=0,this.pulsePhase=0;let i=k(t.center,t.radius);this.init(i),t.isAnimating&&this.startAnimation()}getEntityCenter(){return this.entity.center}getEntityBounds(){let e=k(this.entity.center,this.entity.radius),t=e[3][0],n=e[3][1],r=e[1][0],i=e[1][1];return[[t,n],[r,i]]}draw(){let e=this.ctx,t=this.entity;switch(e.clearRect(0,0,512,512),e.globalAlpha=E(t.confidence),t.gradientAnimation??O.gradientAnimation){case`static`:this.drawStaticGradient(e);break;case`flicker`:this.drawFlickerGradient(e);break;case`breath`:this.drawBreathGradient(e);break;case`pulse`:this.drawPulseGradient(e);break;default:this.drawStaticGradient(e)}this.drawStroke(e),(t.showCenterPoint??O.showCenterPoint)&&this.drawCenterPoint(e),e.globalAlpha=1}drawStaticGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=e.createRadialGradient(256,256,0,256,256,254),i=this.parseColor(t);r.addColorStop(0,`rgba(${i.r}, ${i.g}, ${i.b}, ${n})`),r.addColorStop(.7,`rgba(${i.r}, ${i.g}, ${i.b}, ${n*.5})`),r.addColorStop(1,`rgba(${i.r}, ${i.g}, ${i.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=r,e.fill()}drawFlickerGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=this.entity.animationSpeed??O.animationSpeed,i=.5+.5*Math.sin(this.animationTime*r*8),a=n*(.3+.7*i),o=e.createRadialGradient(256,256,0,256,256,254),s=this.parseColor(t);o.addColorStop(0,`rgba(${s.r}, ${s.g}, ${s.b}, ${a})`),o.addColorStop(.7,`rgba(${s.r}, ${s.g}, ${s.b}, ${a*.5})`),o.addColorStop(1,`rgba(${s.r}, ${s.g}, ${s.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=o,e.fill()}drawBreathGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=this.entity.animationSpeed??O.animationSpeed,i=.5+.5*Math.sin(this.animationTime*r*2),a=n*(.2+.8*i),o=e.createRadialGradient(256,256,0,256,256,254),s=this.parseColor(t);o.addColorStop(0,`rgba(${s.r}, ${s.g}, ${s.b}, ${a})`),o.addColorStop(.7,`rgba(${s.r}, ${s.g}, ${s.b}, ${a*.5})`),o.addColorStop(1,`rgba(${s.r}, ${s.g}, ${s.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=o,e.fill()}drawPulseGradient(e){let t=this.entity.fillColor??O.fillColor,n=this.entity.fillOpacity??O.fillOpacity,r=this.parseColor(t),i=e.createRadialGradient(256,256,0,256,256,254);i.addColorStop(0,`rgba(${r.r}, ${r.g}, ${r.b}, ${n*.3})`),i.addColorStop(1,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`),e.beginPath(),e.arc(256,256,254,0,Math.PI*2),e.fillStyle=i,e.fill();for(let t=0;t<3;t++){let i=(this.pulsePhase+t/3)%1,a=254*i,o=n*(1-i)*.6;a>0&&o>0&&(e.beginPath(),e.arc(256,256,a,0,Math.PI*2),e.strokeStyle=`rgba(${r.r}, ${r.g}, ${r.b}, ${o})`,e.lineWidth=3,e.stroke())}}drawStroke(e){let t=this.entity.strokeColor??O.strokeColor,n=this.entity.strokeWidth??O.strokeWidth,r=this.entity.strokeOpacity??O.strokeOpacity;n>0&&r>0&&(e.beginPath(),e.arc(256,256,254-n/2,0,Math.PI*2),e.strokeStyle=this.colorWithAlpha(t,r),e.lineWidth=n,e.stroke())}drawCenterPoint(e){let t=this.entity.centerPointColor??this.entity.fillColor??O.fillColor,n=(this.entity.centerPointRadius??O.centerPointRadius)*2;e.beginPath(),e.arc(256,256,n,0,Math.PI*2),e.fillStyle=t,e.fill(),e.strokeStyle=`white`,e.lineWidth=2,e.stroke()}parseColor(e){if(e.startsWith(`#`)){let t=e.slice(1);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return t?{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}:{r:51,g:136,b:255}}startAnimation(){if(this.animationFrameId!==null||this.isDestroyed)return;let e=this.entity.animationSpeed??O.animationSpeed,t=performance.now(),n=r=>{if(this.isDestroyed)return;let i=(r-t)/1e3;t=r,this.animationTime+=i,this.pulsePhase+=i*e*.5,this.pulsePhase>=1&&--this.pulsePhase,this.draw(),this.animationFrameId=requestAnimationFrame(n)};this.animationFrameId=requestAnimationFrame(n),this.map.getSource(this.sourceId)?.play()}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.map.getSource(this.sourceId)?.pause()}update(e){let t=this.entity;if(this.entity=e,t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.radius!==e.radius){let t=k(e.center,e.radius);this.updateSourceCoordinates(t)}(t.center[0]!==e.center[0]||t.center[1]!==e.center[1]||t.name!==e.name||t.confidence!==e.confidence)&&this.updateLabel(),t.isAnimating!==e.isAnimating&&(e.isAnimating?this.startAnimation():this.stopAnimation()),e.isAnimating||this.draw()}isPointInEntity(e){let{center:t,radius:n}=this.entity,r=e[0]-t[0],i=e[1]-t[1],a=111320*Math.cos(t[1]*Math.PI/180);return Math.sqrt((r*a)**2+(i*110540)**2)<=n}destroy(){this.stopAnimation(),super.destroy()}};function A(e,t){let[n,r]=e,i=t/2/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r+o],[n+s,r+o],[n+s,r-o],[n-s,r-o],[n-s,r+o]]}var me=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`square-source-${t.id}`,this.fillLayerId=`square-fill-${t.id}`,this.strokeLayerId=`square-stroke-${t.id}`,this.labelLayerId=`square-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],layout:{"line-join":`miter`,"line-cap":`square`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{center:e,length:t,name:n}=this.entity,r=A(e,t),i=[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[r]},properties:{}}];if(n){let e=this.getBottomCenterPoint(r);i.push({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:n}})}return{type:`FeatureCollection`,features:i}}getBottomCenterPoint(e){let t=e[2],n=e[3];return[(t[0]+n[0])/2,(t[1]+n[1])/2]}getEntityId(){return this.entity.id}getCenter(){return this.entity.center}getBounds(){let{center:e,length:t}=this.entity,[n,r]=e,i=t/2/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r-o],[n+s,r+o]]}getLayerId(){return this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{center:t,length:n}=this.entity,r=A(t,n);return this.pointInPolygon(e,r)}pointInPolygon(e,t){let[n,r]=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let[o,s]=t[e],[c,l]=t[a];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.center!==t.center||n.length!==t.length||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}};function he(e){let[[t,n],[r,i]]=e,a=Math.min(t,r),o=Math.max(t,r),s=Math.min(n,i),c=Math.max(n,i);return[[a,c],[o,c],[o,s],[a,s],[a,c]]}var ge=class e{static{this.DEFAULTS={strokeColor:`#3388ff`,strokeWidth:2,strokeOpacity:1,fillColor:`#3388ff`,fillOpacity:.2}}constructor(e,t,n,r){this.isSelected=!1,this.initialized=!1,this.map=e,this.entity=t,this.globalNameConfig=n,this.globalSelectNameConfig=r,this.sourceId=`rectangle-source-${t.id}`,this.fillLayerId=`rectangle-fill-${t.id}`,this.strokeLayerId=`rectangle-stroke-${t.id}`,this.labelLayerId=`rectangle-label-${t.id}`,this.initLayers()}get nameStyle(){return _(this.entity.nameConfig,this.globalNameConfig,h)}get selectNameStyle(){return _(this.entity.selectNameConfig,this.globalSelectNameConfig,g)}initLayers(){if(!this.initialized)try{let t=this.getGeoJSON();this.map.addSource(this.sourceId,{type:`geojson`,data:t});let n=this.entity.confidence??1,r=E(n);this.map.addLayer({id:this.fillLayerId,type:`fill`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":this.entity.fillColor??e.DEFAULTS.fillColor,"fill-opacity":(this.entity.fillOpacity??e.DEFAULTS.fillOpacity)*r}}),this.map.addLayer({id:this.strokeLayerId,type:`line`,source:this.sourceId,filter:[`==`,`$type`,`Polygon`],layout:{"line-join":`miter`,"line-cap":`square`},paint:{"line-color":this.isSelected?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor,"line-width":this.entity.strokeWidth??e.DEFAULTS.strokeWidth,"line-opacity":(this.entity.strokeOpacity??e.DEFAULTS.strokeOpacity)*r}}),this.entity.name&&this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":r}}),this.initialized=!0}catch{this.map.once(`idle`,()=>this.initLayers())}}getGeoJSON(){let{bounds:e,name:t}=this.entity,n=he(e),r=[{type:`Feature`,geometry:{type:`Polygon`,coordinates:[n]},properties:{}}];if(t){let e=this.getBottomCenterPoint(n);r.push({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{name:t}})}return{type:`FeatureCollection`,features:r}}getBottomCenterPoint(e){let t=e[2],n=e[3];return[(t[0]+n[0])/2,(t[1]+n[1])/2]}getEntityId(){return this.entity.id}getBounds(){let[[e,t],[n,r]]=this.entity.bounds,i=Math.min(e,n),a=Math.max(e,n);return[[i,Math.min(t,r)],[a,Math.max(t,r)]]}getCenter(){return this.entity.center?this.entity.center:this.calculateRectangleCenter()}calculateRectangleCenter(){let[[e,t],[n,r]]=this.entity.bounds;return[(e+n)/2,(t+r)/2]}getLayerId(){return this.fillLayerId}getLabelLayerId(){return this.entity.name?this.labelLayerId:null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.initialized&&(this.map.getLayer(this.strokeLayerId)&&this.map.setPaintProperty(this.strokeLayerId,`line-color`,t?`#ffcc00`:this.entity.strokeColor??e.DEFAULTS.strokeColor),this.map.getLayer(this.labelLayerId)&&(this.map.setPaintProperty(this.labelLayerId,`text-color`,t?this.selectNameStyle.fillColor:this.nameStyle.fillColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-color`,t?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor),this.map.setPaintProperty(this.labelLayerId,`text-halo-width`,t?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth))))}isPointInEntity(e){let{bounds:t}=this.entity,n=he(t);return this.pointInPolygon(e,n)}pointInPolygon(e,t){let[n,r]=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let[o,s]=t[e],[c,l]=t[a];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}update(t){let n=this.entity;if(this.entity=t,!this.initialized)return;let r=t.confidence??1,i=E(r);if(n.bounds!==t.bounds||n.name!==t.name){let e=this.map.getSource(this.sourceId);e&&e.setData(this.getGeoJSON()),!n.name&&t.name&&!this.map.getLayer(this.labelLayerId)?this.map.addLayer({id:this.labelLayerId,type:`symbol`,source:this.sourceId,filter:[`==`,`$type`,`Point`],layout:{"text-field":[`get`,`name`],"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`],"text-size":14,"text-anchor":`top`,"text-offset":[0,.8],"text-allow-overlap":!0},paint:{"text-color":this.isSelected?this.selectNameStyle.fillColor:this.nameStyle.fillColor,"text-halo-color":this.isSelected?this.selectNameStyle.strokeColor:this.nameStyle.strokeColor,"text-halo-width":this.isSelected?this.selectNameStyle.strokeWidth:this.nameStyle.strokeWidth,"text-opacity":i}}):n.name&&!t.name&&this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId)}(n.fillColor!==t.fillColor||n.fillOpacity!==t.fillOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.fillLayerId)&&(this.map.setPaintProperty(this.fillLayerId,`fill-color`,t.fillColor??e.DEFAULTS.fillColor),this.map.setPaintProperty(this.fillLayerId,`fill-opacity`,(t.fillOpacity??e.DEFAULTS.fillOpacity)*i)),(n.strokeColor!==t.strokeColor||n.strokeWidth!==t.strokeWidth||n.strokeOpacity!==t.strokeOpacity||n.confidence!==t.confidence)&&this.map.getLayer(this.strokeLayerId)&&(this.isSelected||this.map.setPaintProperty(this.strokeLayerId,`line-color`,t.strokeColor??e.DEFAULTS.strokeColor),this.map.setPaintProperty(this.strokeLayerId,`line-width`,t.strokeWidth??e.DEFAULTS.strokeWidth),this.map.setPaintProperty(this.strokeLayerId,`line-opacity`,(t.strokeOpacity??e.DEFAULTS.strokeOpacity)*i)),n.confidence!==t.confidence&&this.map.getLayer(this.labelLayerId)&&this.map.setPaintProperty(this.labelLayerId,`text-opacity`,i)}destroy(){this.initialized&&=(this.map.getLayer(this.labelLayerId)&&this.map.removeLayer(this.labelLayerId),this.map.getLayer(this.strokeLayerId)&&this.map.removeLayer(this.strokeLayerId),this.map.getLayer(this.fillLayerId)&&this.map.removeLayer(this.fillLayerId),this.map.getSource(this.sourceId)&&this.map.removeSource(this.sourceId),!1)}};const _e=({popupState:e,onClose:t,portalContainer:n,popupRef:r})=>{let i=(0,c.useRef)(null),[a,o]=(0,c.useState)(`entering`),[s,l]=(0,c.useState)(!1),u=(0,c.useRef)(e.position),d=(0,c.useRef)(!1),m=r||i;d.current||(u.current=e.position),(0,c.useEffect)(()=>{let e=setTimeout(()=>{l(!0)},60);return()=>clearTimeout(e)},[]),(0,c.useEffect)(()=>{if(a===`entering`&&s){let e=setTimeout(()=>o(`entered`),50);return()=>clearTimeout(e)}},[a,s]);let h=(0,c.useCallback)(()=>{e.config.animation===`none`?t():(d.current=!0,o(`exiting`),setTimeout(()=>t(),200))},[e.config.animation,t]);(0,c.useEffect)(()=>{if(!e.config.closeOnEscape)return;let t=e=>{e.key===`Escape`&&h()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e.config.closeOnEscape,h]),(0,c.useEffect)(()=>{if(!e.config.closeOnClickOutside)return;let t=e=>{m.current&&!m.current.contains(e.target)&&h()},n=setTimeout(()=>{document.addEventListener(`click`,t,!0)},0);return()=>{clearTimeout(n),document.removeEventListener(`click`,t,!0)}},[e.config.closeOnClickOutside,h,m]);let g=()=>{switch(e.actualPosition){case`top`:return`center bottom`;case`bottom`:return`center top`;case`left`:return`right center`;case`right`:return`left center`;case`center`:default:return`center center`}},_=u.current,v=(0,p.jsxs)(`div`,{ref:m,className:`entity-popup ${s?`entity-popup--${a} animation-${e.config.animation}`:``} ${e.config.className||``}`,style:{position:`fixed`,left:`${_.x}px`,top:`${_.y}px`,maxWidth:e.config.maxWidth,zIndex:e.config.zIndex,pointerEvents:`all`,opacity:s?void 0:0,transformOrigin:g(),...e.config.style},role:`dialog`,"aria-modal":`true`,children:[e.config.showCloseButton&&(0,p.jsx)(`button`,{className:`entity-popup__close`,onClick:h,"aria-label":`Close popup`,children:`×`}),(0,p.jsx)(`div`,{className:`entity-popup__content`,children:e.config.content})]});return(0,f.createPortal)(v,n)};var j=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20t='1768373933818'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20p-id='30344'%20width='200'%20height='200'%3e%3cpath%20d='M400.440142%201024h-0.073136a48.781895%2048.781895%200%200%201-45.490763-31.448598L3.383306%2066.061072a48.781895%2048.781895%200%200%201%2062.897196-62.897197l926.563466%20351.419801a48.928168%2048.928168%200%200%201%200.219409%2091.127799L597.761811%20597.688654l-151.904042%20395.082157a48.781895%2048.781895%200%200%201-45.490763%2031.229189zM133.053921%20132.907627l267.678766%20705.691916%20113.87318-296.201913a48.855032%2048.855032%200%200%201%2028.011193-27.938057l296.201913-113.87318-705.765052-267.678766z'%20p-id='30345'%20fill='%23ffffff'%20/%3e%3cscript%20xmlns=''%20/%3e%3c/svg%3e`;function ve({map:e,precision:t=6,className:n=``,style:r}){let[i,a]=(0,c.useState)(null),o=(0,c.useCallback)(e=>{a({lng:Number(e.lngLat.lng.toFixed(t)),lat:Number(e.lngLat.lat.toFixed(t))})},[t]);return(0,c.useEffect)(()=>{if(e)return e.on(`mousemove`,o),()=>{e.off(`mousemove`,o)}},[e,o]),i?(0,p.jsxs)(`div`,{className:`mapbox-coordinate-display ${n}`,style:r,children:[(0,p.jsx)(`img`,{src:j,alt:`location`,className:`mapbox-coordinate-display__icon`}),(0,p.jsxs)(`div`,{className:`mapbox-coordinate-display__content`,children:[(0,p.jsxs)(`span`,{className:`mapbox-coordinate-display__item`,children:[`经度:`,i.lng]}),(0,p.jsxs)(`span`,{className:`mapbox-coordinate-display__item`,children:[`纬度:`,i.lat]})]})]}):null}var ye=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20t='1768374054549'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20p-id='31504'%20width='200'%20height='200'%3e%3cpath%20d='M53.80096%20687.40096l282.79808%20282.79808%20633.6-633.6-282.79808-282.79808-90.39872%2090.39872-28.29824%2028.20096-42.7008%2042.7008-23.5008%2023.5008-63.20128%2063.19616-12.29824%2012.29824-373.20192%20373.30432z%20m282.79808%20212.10112l-212.10112-212.1984%2054.99904-54.99904%20106.10176%20106.10176%2028.29824-28.29824-106.10176-106.10176%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.69184-70.71232%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.70208-70.70208%2042.39872-42.39872%20106.10176%20106.10176%2028.29824-28.29824-106.09664-106.10688%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.70208-70.7072%2042.39872-42.39872%2070.70208%2070.70208%2028.29824-28.29824-70.70208-70.70208%2042.7008-42.7008%20106.10176%20106.10176%2028.29824-28.29824-105.99936-106.10176%2054.99904-54.99904%20212.10112%20212.10112L336.59904%20899.50208z'%20fill='%23ffffff'%20p-id='31505'%20/%3e%3cscript%20xmlns=''%20/%3e%3c/svg%3e`;function be({map:e,maxWidth:t=100,unit:n=`metric`,className:r=``,style:i}){let[a,o]=(0,c.useState)({width:100,label:`100 m`}),s=(0,c.useCallback)(()=>{if(!e)return;let r=e.getZoom(),i=e.getCenter().lat,a=40075016.686/(256*2**r),s=i*Math.PI/180,c=a*Math.cos(s)*t,l,u;if(n===`imperial`){let e=3.2808*c;if(e>5280){let n=e/5280;l=xe(n),u=`${l} mi`;let r=l/n;o({width:t*r,label:u})}else{l=xe(e),u=`${l} ft`;let n=l/e;o({width:t*n,label:u})}}else if(n===`nautical`){let e=c/1852;l=xe(e),u=`${l} nm`;let n=l/e;o({width:t*n,label:u})}else if(c>=1e3){l=xe(c/1e3),u=`${l} km`;let e=l/(c/1e3);o({width:t*e,label:u})}else{l=xe(c),u=`${l} m`;let e=l/c;o({width:t*e,label:u})}},[e,t,n]);return(0,c.useEffect)(()=>{if(e)return s(),e.on(`move`,s),e.on(`zoom`,s),()=>{e.off(`move`,s),e.off(`zoom`,s)}},[e,s]),(0,p.jsxs)(`div`,{className:`mapbox-scale-control ${r}`,style:i,children:[(0,p.jsxs)(`div`,{className:`mapbox-scale-control__bar-wrapper`,children:[(0,p.jsx)(`img`,{src:ye,alt:`scale`,className:`mapbox-scale-control__icon`}),(0,p.jsxs)(`div`,{className:`mapbox-scale-control__bar`,style:{width:`${a.width}px`},children:[(0,p.jsx)(`div`,{className:`mapbox-scale-control__tick mapbox-scale-control__tick--left`}),(0,p.jsx)(`div`,{className:`mapbox-scale-control__tick mapbox-scale-control__tick--right`})]})]}),(0,p.jsx)(`span`,{className:`mapbox-scale-control__label`,children:a.label})]})}function xe(e){let t=10**(`${Math.floor(e)}`.length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}var Se=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768989620222'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5780'%20width='128'%20height='128'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M938.666667%20602.752a42.666667%2042.666667%200%200%201%2042.368%2037.674667l0.298666%204.992V853.333333a128%20128%200%200%201-120.490666%20127.786667L853.333333%20981.333333h-208.896a42.666667%2042.666667%200%200%201-4.949333-85.034666l4.949333-0.298667H853.333333a42.666667%2042.666667%200%200%200%2042.368-37.674667L896%20853.333333v-207.914666a42.666667%2042.666667%200%200%201%2042.666667-42.666667z%20m-853.333334%203.285333a42.666667%2042.666667%200%200%201%2042.368%2037.674667l0.298667%204.992V853.333333a42.666667%2042.666667%200%200%200%2037.674667%2042.368L170.666667%20896h211.882666a42.666667%2042.666667%200%200%201%204.992%2085.034667L382.549333%20981.333333H170.666667a128%20128%200%200%201-127.786667-120.490666L42.666667%20853.333333v-204.629333a42.666667%2042.666667%200%200%201%2042.666666-42.666667zM381.866667%2042.666667A42.666667%2042.666667%200%200%201%20386.944%20127.701333L381.866667%20128H170.666667a42.666667%2042.666667%200%200%200-42.368%2037.674667L128%20170.666667v216.448a42.666667%2042.666667%200%200%201-85.034667%204.992L42.666667%20387.114667V170.666667A128%20128%200%200%201%20163.157333%2042.88L170.666667%2042.666667h211.2zM853.333333%2042.666667a128%20128%200%200%201%20127.786667%20120.490666L981.333333%20170.666667v216.064a42.666667%2042.666667%200%200%201-85.034666%204.992L896%20386.730667V170.666667a42.666667%2042.666667%200%200%200-37.674667-42.368L853.333333%20128h-214.4a42.666667%2042.666667%200%200%201-4.949333-85.034667L638.933333%2042.666667H853.333333z'%20fill='%23ffffff'%20p-id='5781'%3e%3c/path%3e%3cpath%20d='M512%20512m-128%200a128%20128%200%201%200%20256%200%20128%20128%200%201%200-256%200Z'%20fill='%23ffffff'%20p-id='5782'%3e%3c/path%3e%3c/svg%3e`;function Ce({map:e,initialCenter:t,initialZoom:n,initialPitch:r=0,initialBearing:i=0,className:a=``,style:o,duration:s=1e3}){return(0,p.jsxs)(`button`,{className:`mapbox-control-btn mapbox-reset-view-control ${a}`,onClick:()=>{e&&e.flyTo({center:t,zoom:n,pitch:r,bearing:i,duration:s})},style:o,title:`回到初始位置`,children:[(0,p.jsx)(`img`,{src:Se,alt:`home`,className:`mapbox-control-btn__icon`}),(0,p.jsx)(`span`,{children:`复位`})]})}var we=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769487141027'%20class='icon'%20viewBox='0%200%201517%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2644'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='189.625'%20height='128'%3e%3cpath%20d='M1.68121071-242.12320149h1508.24640296v1508.24640298h-1508.24640296z'%20fill='%23ffffff'%20fill-opacity='0'%20p-id='2645'%3e%3c/path%3e%3cpath%20d='M437.30078846%20170.6624h682.66239999v682.6624H437.30078846z'%20fill='%23ffffff'%20fill-opacity='0'%20p-id='2646'%3e%3c/path%3e%3cpath%20d='M1151.68343834%2040.66710748H373.42829443A81.76345149%2081.76345149%200%200%200%20292.90207634%20121.49379654v784.42363608c0%2040.42218191%2036.92257893%2077.41545989%2080.5262181%2077.4154599h781.6133488a81.76345149%2081.76345149%200%200%200%2080.52621814-80.82668906V121.49379654C1232.08593315%2077.76643404%201195.25172802%2040.66710748%201151.6657636%2040.66710748z%20m-325.39237822%20616.14222197H618.29445458V451.37556451h53.66057906c6.71640976%200%2013.41514477-3.35820487%2020.11387975-6.73408452l97.28189301-100.99359314h134.18679716v208.72127078c-46.96184405%2013.50351858-87.22495312%2053.90802574-97.28189299%20104.4048223z%20m130.7932427-20.23760311c23.50743418%200%2043.65666346%2020.21992834%2043.65666349%2043.76271204a44.50505206%2044.50505206%200%200%201-43.62131391%2043.7803868%2044.50505206%2044.50505206%200%200%201-43.6036392-43.7803868c0-23.54278369%2020.096205-43.76271203%2043.6036392-43.76271204h-0.05302433zM564.63387554%20926.10201142H373.42829443a22.87114272%2022.87114272%200%200%201-16.79102442-6.71640975%2023.04789036%2023.04789036%200%200%201-6.71640975-16.82637394V714.02253578h214.73069002v212.07947564z%20m0-269.31035673H349.92086026V118.13559167c0-10.1453137%2010.05693988-20.2376031%2023.50743417-20.23760309h553.4321645v188.53669194h-147.54891766c-6.69873499%200-13.39747001%203.35820487-20.096205%206.71640977l-97.28189297%2097.653063H460.61789801a26.44144475%2026.44144475%200%200%200-19.08874355%207.79457028%2026.63586714%2026.63586714%200%200%200-7.72387123%2019.1594426c0%2016.80869917%2013.39747001%2026.90098858%2026.81261478%2026.90098857h104.03365227v212.13249995z%20m610.48629795%20245.71454877c0.17674763%206.29221547-2.24469484%2012.37233377-6.68106024%2016.84404869s-10.49880895%206.89315739-16.77334965%206.75175927h-533.42433329v-212.0971504H829.63159021c13.39747001%2057.24855586%2067.07572382%2097.65306301%20127.48806219%2097.653063a128.67227125%20128.67227125%200%200%200%2093.05762473-37.87701612%20129.60903367%20129.60903367%200%200%200%2037.73561801-93.39344522c0-64.00031515-46.96184405-117.8553166-103.98062799-128.00063029v-208.73894554h194.56378599v558.91134088h-3.35820489v-0.05302427z%20m0-616.07152294H980.57406228V97.89798858h171.10937607c13.39747001%200%2023.45440988%2010.07461465%2023.4544099%2023.59580796v164.94088398z'%20fill='%23ffffff'%20p-id='2647'%3e%3c/path%3e%3c/svg%3e`,M=`road-highlight-`,Te=[{source:`composite`,sourceLayer:`road`},{source:`openmaptiles`,sourceLayer:`transportation`},{source:`maptiler_planet`,sourceLayer:`transportation`}];function Ee(e){let t=e.getStyle();if(!t||!t.sources)return null;for(let e of Te){let n=t.sources[e.source];if(n&&n.type===`vector`)return e}for(let[e,n]of Object.entries(t.sources))if(n.type===`vector`)return{source:e,sourceLayer:`transportation`};return null}function De({map:e,highlightWidth:t=3,defaultRoadTypes:n=[],defaultMinWidth:r=0,source:i,sourceLayer:a,className:o=``,style:s}){let[u,d]=(0,c.useState)(!1),[f,h]=(0,c.useState)(n),[g,_]=(0,c.useState)(!1),v=(0,c.useRef)(null),y=(0,c.useRef)(null),b=(0,c.useRef)(null),S=(0,c.useCallback)((e,n,r)=>{if(!e.isStyleLoaded())return!1;let i=!0;return x.forEach(a=>{let o=`${M}${a.class}`;if(!e.getLayer(o))try{e.addLayer({id:o,type:`line`,source:n,"source-layer":r,filter:[`==`,[`get`,`class`],a.class],paint:{"line-color":a.color,"line-width":t,"line-opacity":.8},layout:{visibility:`none`}}),console.log(`Added road highlight layer: ${o} (source: ${n}, source-layer: ${r})`)}catch(e){console.error(`Failed to add road highlight layer for ${a.class}:`,e),i=!1}}),i},[t]);(0,c.useEffect)(()=>{if(!e)return;let t=()=>{let t=i,n=a;if(!t||!n){let r=Ee(e);r&&(console.log(`Auto-detected vector source:`,r),t||=r.source,n||=r.sourceLayer)}t&&n?S(e,t,n)&&_(!0):console.warn(`No vector source found for road highlighting`)};e.isStyleLoaded()?t():e.once(`load`,t);let n=()=>{e.isStyleLoaded()&&t()};return e.on(`styledata`,n),()=>{e.off(`styledata`,n)}},[e,i,a,S]),(0,c.useEffect)(()=>{!e||!g||x.forEach(t=>{let n=`${M}${t.class}`;if(e.getLayer(n))try{let r=f.includes(t.class);e.setLayoutProperty(n,`visibility`,r?`visible`:`none`)}catch(e){console.error(`Failed to update layer ${n}:`,e)}})},[e,g,f]),(0,c.useEffect)(()=>{if(!u)return;let e=e=>{v.current&&!v.current.contains(e.target)&&y.current&&!y.current.contains(e.target)&&d(!1)},t=setTimeout(()=>{document.addEventListener(`mousedown`,e)},0);return()=>{clearTimeout(t),document.removeEventListener(`mousedown`,e)}},[u]),(0,c.useEffect)(()=>()=>{e&&e.getStyle()&&x.forEach(t=>{let n=`${M}${t.class}`;if(e.getLayer(n))try{e.removeLayer(n)}catch{}}),b.current&&=(b.current.remove(),null)},[e]);let ee=(0,c.useCallback)(e=>x.find(t=>t.class===e)?.label||e,[]),C=(0,c.useCallback)(t=>{if(!e||f.length===0){b.current&&b.current.remove(),e?.getCanvas().style.cursor&&(e.getCanvas().style.cursor=``);return}let n=f.map(e=>`${M}${e}`),r=[[t.point.x-10,t.point.y-10],[t.point.x+10,t.point.y+10]],i=e.queryRenderedFeatures(r,{layers:n.filter(t=>e.getLayer(t))});if(i.length>0){let n=i[0].properties||{},r=t.lngLat,a=n.name||n.name_en||n.name_local||``,o=n.class||``,s=n.type||``,c=n.structure||``,u=n.oneway,d=n.layer,f=n.iso_3166_1||``,p=n.iso_3166_2||``,m=e=>!(e==null||e===``||typeof e==`string`&&e.toLowerCase()===`none`),h=[];m(o)&&h.push(`
2
2
  <div class="road-highlight-popup__row">
3
3
  <span>道路类型:</span>
4
4
  <span class="road-highlight-popup__value">${ee(o)}</span>
@@ -48,13 +48,13 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
48
48
  ${a?`<div class="road-highlight-popup__title">${a}</div>`:``}
49
49
  <div class="road-highlight-popup__info">${h.join(``)}</div>
50
50
  </div>
51
- `;b.current||=new l.default.Popup({closeButton:!1,closeOnClick:!1,offset:15,className:`road-highlight-popup`}),b.current.setLngLat(r).setHTML(g).addTo(e),e.getCanvas().style.cursor=`pointer`}else b.current&&b.current.remove(),e.getCanvas().style.cursor=``},[e,f,ee]);(0,c.useEffect)(()=>{if(!(!e||!g))return e.on(`mousemove`,C),()=>{e.off(`mousemove`,C),b.current&&b.current.remove(),e.getCanvas().style.cursor=``}},[e,g,C]);let w=(e,t)=>{h(n=>t?[...n,e]:n.filter(t=>t!==e))},T=e=>{h(e?x.map(e=>e.class):[])},te=f.length>0;return(0,p.jsxs)(`div`,{className:`mapbox-road-highlight-control ${o}`,style:s,children:[(0,p.jsxs)(`button`,{ref:y,className:`mapbox-control-btn mapbox-road-highlight-control__btn ${te?`mapbox-road-highlight-control__btn--active`:``}`,onClick:()=>d(!u),title:`路网高亮${f.length>0?` (已选 ${f.length})`:``}`,children:[(0,p.jsx)(`img`,{src:we,alt:`road`,className:`mapbox-road-highlight-control__btn-icon`}),(0,p.jsxs)(`span`,{children:[`路网`,f.length>0?` (${f.length})`:``]})]}),u&&(0,p.jsxs)(`div`,{ref:v,className:`mapbox-road-highlight-control__panel`,children:[(0,p.jsxs)(`div`,{className:`mapbox-road-highlight-control__panel-header`,children:[(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__panel-title`,children:`道路类型`}),(0,p.jsx)(m.Checkbox,{checked:f.length===x.length,indeterminate:f.length>0&&f.length<x.length,onChange:T,style:{"--color-text-1":`#fff`,"--color-border-2":`rgba(255, 255, 255, 0.3)`},children:(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__type-label`,children:`全选`})})]}),(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__scroll`,children:(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__type-list`,children:x.map(e=>(0,p.jsxs)(`div`,{className:`mapbox-road-highlight-control__type-item`,onClick:()=>w(e.class,!f.includes(e.class)),children:[(0,p.jsx)(m.Checkbox,{checked:f.includes(e.class),onChange:t=>w(e.class,t),onClick:e=>e.stopPropagation(),style:{"--color-text-1":`#fff`,"--color-border-2":`rgba(255, 255, 255, 0.3)`,marginRight:0,flexShrink:0}}),(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__color-indicator`,style:{backgroundColor:e.color}}),(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__type-label`,children:e.label})]},e.class))})}),(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__tip`,children:`💡 选中道路类型后立即显示高亮`}),!g&&(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__warning`,children:`⚠️ 正在初始化图层...`})]})]})}var ke=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769397418113'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10253'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='128'%20height='128'%3e%3cpath%20d='M755.4048%20217.2928A348.3648%20348.3648%200%200%200%20512%20119.3472a348.3136%20348.3136%200%200%200-243.3536%2097.8944%20328.4992%20328.4992%200%200%200-100.864%20236.3392c0%2049.408%2011.7248%2095.744%2032%20137.728a378.0096%20378.0096%200%200%200%2091.136%20118.4256l203.5712%20179.456%2017.5104%2015.4624%2017.5104-15.4624%20203.4176-179.3536a378.6752%20378.6752%200%200%200%2091.2384-118.4768c20.2752-41.984%2032.0512-88.32%2032.0512-137.7792a328.448%20328.448%200%200%200-100.8128-236.288z%20m24.1152%20353.3824a329.216%20329.216%200%200%201-79.872%20103.0656l-188.0064%20164.6592-187.1872-164.7616a329.0624%20329.0624%200%200%201-79.7696-103.0144%20267.0592%20267.0592%200%200%201-27.136-117.0944c0-78.7968%2032.9728-150.1184%2086.272-201.728a298.3936%20298.3936%200%200%201%20208.2816-83.5584c81.3056%200%20154.9824%2031.9488%20208.2304%2083.6096a279.9104%20279.9104%200%200%201%2086.272%20201.728%20266.496%20266.496%200%200%201-27.0848%20117.0944z%20m-164.1472-212.1728l0.0512-0.0512a146.9952%20146.9952%200%200%200-104.2432-43.2128c-40.6528%200-77.568%2016.5376-104.2432%2043.2128l0.0512%200.0512a147.3536%20147.3536%200%200%200-0.0512%20208.6912%20147.0464%20147.0464%200%200%200%20208.4864%200%20147.5072%20147.5072%200%200%200-0.0512-208.6912z%20m-34.1504%20174.2336a97.536%2097.536%200%200%201-69.2736%2028.7232%2097.6384%2097.6384%200%200%201-69.3248-28.7232%2097.792%2097.792%200%200%201-0.1536-138.4448h0.1024a97.9456%2097.9456%200%200%201%20138.5984%200h0.1536c17.664%2017.6128%2028.5696%2042.1376%2028.5696%2069.2224a97.1776%2097.1776%200%200%201-28.672%2069.2224z'%20fill='%23ffffff'%20p-id='10254'%3e%3c/path%3e%3c/svg%3e`,Ae=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='160'%20y='240'%20width='704'%20height='544'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,je=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3ccircle%20cx='512'%20cy='512'%20r='384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,M=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolygon%20points='512,128%20864,384%20736,800%20288,800%20160,384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Me=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='192'%20y='192'%20width='640'%20height='640'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,Ne=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolyline%20points='160,768%20384,256%20640,576%20864,192'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c/svg%3e`;const Pe=({markerTemplates:e,selectedTemplate:t,onTemplateSelect:n,drawMode:r,onDrawModeChange:i,showRectangleTool:a=!1,showCircleTool:o=!1,showPolygonTool:s=!1,showSquareTool:l=!1,showPolylineTool:u=!1})=>{let[d,f]=(0,c.useState)(!1),m=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&f(!1)};if(d)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]);let h=e=>{t?.id===e.id?(n(null),i(null)):(n(e),i(`marker`)),f(!1)},g=()=>{r===`rectangle`?i(null):(n(null),i(`rectangle`))},_=()=>{r===`circle`?i(null):(n(null),i(`circle`))},v=()=>{r===`polygon`?i(null):(n(null),i(`polygon`))},y=()=>{r===`square`?i(null):(n(null),i(`square`))},b=()=>{r===`polyline`?i(null):(n(null),i(`polyline`))},x=()=>{(r===`rectangle`||r===`circle`||r===`polygon`||r===`square`||r===`polyline`)&&i(null),f(!d)},S=e=>e.size?{width:e.size,height:e.size}:{width:e.width||32,height:e.height||32},ee=d||t,C=r===`rectangle`,w=r===`circle`,T=r===`polygon`,te=r===`square`,ne=r===`polyline`;return(0,p.jsxs)(`div`,{ref:m,className:`mapbox-edit-control`,children:[(0,p.jsxs)(`div`,{className:`mapbox-edit-control__btn-group`,children:[(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${ee?`mapbox-control-btn--active`:``}`,onClick:x,title:`Marker`,children:[t?(0,p.jsx)(`img`,{src:t.icon,alt:t.name,className:`mapbox-edit-control__btn-icon`}):(0,p.jsx)(`img`,{src:ke,alt:`marker`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:t?t.name:`Marker`})]}),l&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${te?`mapbox-control-btn--active`:``}`,onClick:y,title:`绘制正方形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='192'%20y='192'%20width='640'%20height='640'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,alt:`square`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`正方形`})]}),a&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${C?`mapbox-control-btn--active`:``}`,onClick:g,title:`绘制矩形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='160'%20y='240'%20width='704'%20height='544'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,alt:`rectangle`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`矩形`})]}),o&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${w?`mapbox-control-btn--active`:``}`,onClick:_,title:`绘制圆形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3ccircle%20cx='512'%20cy='512'%20r='384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,alt:`circle`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`圆形`})]}),s&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${T?`mapbox-control-btn--active`:``}`,onClick:v,title:`绘制多边形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolygon%20points='512,128%20864,384%20736,800%20288,800%20160,384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'/%3e%3c/svg%3e`,alt:`polygon`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`多边形`})]}),u&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${ne?`mapbox-control-btn--active`:``}`,onClick:b,title:`绘制折线`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolyline%20points='160,768%20384,256%20640,576%20864,192'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c/svg%3e`,alt:`polyline`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`折线`})]})]}),d&&(0,p.jsxs)(`div`,{className:`mapbox-edit-control__panel`,children:[(0,p.jsx)(`div`,{className:`mapbox-edit-control__panel-header`,children:`选择 Marker`}),(0,p.jsx)(`div`,{className:`mapbox-edit-control__template-list`,children:e.map(e=>{let n=S(e),r=t?.id===e.id;return(0,p.jsxs)(`div`,{className:`mapbox-edit-control__template-item ${r?`mapbox-edit-control__template-item--selected`:``}`,onClick:()=>h(e),title:e.name,children:[(0,p.jsx)(`img`,{src:e.icon,alt:e.name,className:`mapbox-edit-control__template-icon`,style:{width:Math.min(n.width,24),height:Math.min(n.height,24)}}),(0,p.jsx)(`span`,{className:`mapbox-edit-control__template-name`,children:e.name})]},e.id)})})]})]})},Fe=({menuState:e,onClose:t,portalContainer:n,menuRef:r})=>{let i=(0,c.useRef)(null);(0,c.useEffect)(()=>(r&&(r.current=i.current),()=>{r&&(r.current=null)}));let a=(0,c.useCallback)(e=>{i.current&&!i.current.contains(e.target)&&t()},[t]),o=(0,c.useCallback)(e=>{e.key===`Escape`&&t()},[t]);(0,c.useEffect)(()=>{let e=setTimeout(()=>{document.addEventListener(`click`,a,!0),document.addEventListener(`contextmenu`,a,!0)},0);return document.addEventListener(`keydown`,o),()=>{clearTimeout(e),document.removeEventListener(`click`,a,!0),document.removeEventListener(`contextmenu`,a,!0),document.removeEventListener(`keydown`,o)}},[a,o]);let s={...e.position};if(i.current){let e=i.current.getBoundingClientRect();s.x+e.width>window.innerWidth&&(s.x=window.innerWidth-e.width-10),s.y+e.height>window.innerHeight&&(s.y=window.innerHeight-e.height-10)}let l=(0,p.jsx)(`div`,{ref:i,className:`context-menu`,style:{position:`fixed`,left:`${s.x}px`,top:`${s.y}px`,pointerEvents:`all`},children:e.items.map(e=>(0,p.jsxs)(`div`,{className:`context-menu__item ${e.danger?`context-menu__item--danger`:``}`,onClick:()=>{e.onClick(),t()},children:[e.icon&&(0,p.jsx)(`span`,{className:`context-menu__item-icon`,children:e.icon}),(0,p.jsx)(`span`,{className:`context-menu__item-label`,children:e.label})]},e.key))});return(0,f.createPortal)(l,n)};function Ie(e,t,n){return{content:e.content??n??null,trigger:e.trigger??t?.trigger??b.trigger,position:e.position??t?.position??b.position,offset:e.offset??t?.offset??b.offset,showCloseButton:e.showCloseButton??t?.showCloseButton??b.showCloseButton,animation:e.animation??t?.animation??b.animation,className:e.className??``,style:e.style??{},closeOnClickOutside:e.closeOnClickOutside??t?.closeOnClickOutside??b.closeOnClickOutside,closeOnEscape:e.closeOnEscape??t?.closeOnEscape??b.closeOnEscape,hoverDelay:e.hoverDelay??t?.hoverDelay??b.hoverDelay,maxWidth:e.maxWidth??t?.maxWidth??b.maxWidth,zIndex:e.zIndex??t?.zIndex??b.zIndex}}function Le(e,t,n,r,i){let a,o;if(e.type===`polygon`)o=e.center??Re(e.coordinates);else if(e.type===`polyline`)o=e.center??ze(e.coordinates);else if(e.type===`rectangle`)if(e.center)o=e.center;else{let[[t,n],[r,i]]=e.bounds;o=[(t+r)/2,(n+i)/2]}else o=e.center;let s=n.project(o);a={x:s.x,y:s.y};let c=Be(i,t);return N(a,t.position,t.offset,c)}function Re(e){if(!e||e.length===0)return[0,0];let t=[...e];(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1])&&t.push(e[0]);let n=(0,u.polygon)([t]);return(0,u.centroid)(n).geometry.coordinates}function ze(e){if(!e||e.length===0)return[0,0];let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];return[t/e.length,n/e.length]}function Be(e,t){if(e){let t=e.getBoundingClientRect();return{width:t.width||320,height:t.height||200}}return{width:typeof t.maxWidth==`number`?t.maxWidth:320,height:200}}function N(e,t,n,r){let i={width:window.innerWidth,height:window.innerHeight},a=(()=>{switch(t){case`top`:return[`top`,`bottom`,`right`,`left`,`center`];case`bottom`:return[`bottom`,`top`,`right`,`left`,`center`];case`left`:return[`left`,`right`,`top`,`bottom`,`center`];case`right`:return[`right`,`left`,`top`,`bottom`,`center`];case`center`:default:return[`center`,`top`,`bottom`,`left`,`right`]}})(),o={top:()=>({x:e.x-r.width/2+n[0],y:e.y-r.height-20+n[1]}),bottom:()=>({x:e.x-r.width/2+n[0],y:e.y+20+n[1]}),left:()=>({x:e.x-r.width-20+n[0],y:e.y-r.height/2+n[1]}),right:()=>({x:e.x+20+n[0],y:e.y-r.height/2+n[1]}),center:()=>({x:e.x-r.width/2+n[0],y:e.y-r.height/2+n[1]})},s=e=>e.x>=10&&e.y>=10&&e.x+r.width+10<=i.width&&e.y+r.height+10<=i.height;for(let e of a){let t=o[e]();if(s(t))return{position:t,actualPosition:e}}let c=o[t]();return{position:P(c,r),actualPosition:t}}function P(e,t){let n={width:window.innerWidth,height:window.innerHeight},r={...e};return r.x+t.width+10>n.width&&(r.x=n.width-t.width-10),r.x<10&&(r.x=10),r.y+t.height+10>n.height&&(r.y=n.height-t.height-10),r.y<10&&(r.y=10),r}var Ve=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769394652565'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6483'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='128'%20height='128'%3e%3cpath%20d='M841.385637%20288.639098a36.479886%2036.479886%200%200%201%2072.74644%207.679976l6.613312%20629.544699A109.866323%20109.866323%200%200%201%20810.665733%201023.9968H222.507571a109.652991%20109.652991%200%200%201-109.012992-98.133027l-3.626656-629.544699a36.479886%2036.479886%200%200%201%2072.74644-7.679976L186.241018%20917.330467a36.479886%2036.479886%200%200%200%2036.266553%2032.639898H810.665733A36.479886%2036.479886%200%200%200%20847.99895%20917.330467z%20m-219.732646%20113.706311a36.479886%2036.479886%200%200%201%2036.693218%2036.479886v255.9992a36.693219%2036.693219%200%201%201-73.173104%200v-255.9992a36.479886%2036.479886%200%200%201%2036.479886-36.479886z%20m-219.305982%200a36.479886%2036.479886%200%200%201%2036.479886%2036.479886v255.9992a36.693219%2036.693219%200%201%201-73.173104%200v-255.9992a36.479886%2036.479886%200%200%201%2036.693218-36.479886z%20m-36.693218-255.9992h292.692418V91.519714a18.346609%2018.346609%200%200%200-18.346609-18.346609H384.0004a18.346609%2018.346609%200%200%200-18.346609%2018.346609z%20m-73.173105%200V73.173105A73.173105%2073.173105%200%200%201%20365.653791%200h292.692418a73.386437%2073.386437%200%200%201%2073.173105%2073.173105v73.173104h255.9992a36.693219%2036.693219%200%200%201%200%2073.173105H36.481486a36.693219%2036.693219%200%200%201%200-73.173105z'%20fill='%23EB6865'%20p-id='6484'%3e%3c/path%3e%3c/svg%3e`;const F=(0,c.forwardRef)((e,t)=>{let{center:n=[116.4074,39.9042],zoom:r=12,pitch:i=0,bearing:a=0,style:o=`mapbox://styles/mapbox/dark-v11`,maxBounds:s,mode:u=`display`,editConfig:d={},pickerConfig:f={},onPick:m,interactive:h={},layers:g=[],entities:_=[],selectedIds:v=[],nameConfig:y,selectNameConfig:b,showCoordinates:x=!0,showScale:S=!0,showResetView:ee=!0,showRoadHighlight:C=!1,popupDefaults:w,renderPopup:T,onMapLoad:te,onEntityClick:ne,onPopupOpen:E,onPopupClose:re,className:ie=``,containerStyle:oe}=e,D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(new Map),A=(0,c.useRef)(new Map),he=(0,c.useRef)(new Set),[j,ye]=(0,c.useState)(null),xe=(0,c.useRef)(null),Se=(0,c.useRef)(null),we=(0,c.useRef)(null),[Te,Ee]=(0,c.useState)(null),De=(0,c.useRef)(null),ke=(0,c.useRef)(null),[Ae,je]=(0,c.useState)(null),[M,Me]=(0,c.useState)(u),[Ne,Re]=(0,c.useState)(null),ze=(0,c.useRef)(null),[Be,N]=(0,c.useState)(null),[P,F]=(0,c.useState)(null),[He,Ue]=(0,c.useState)(null),I=(0,c.useRef)(!1),L=(0,c.useRef)(null),R=(0,c.useRef)(null),z=(0,c.useRef)(null),B=(0,c.useRef)(null),V=(0,c.useRef)(null),H=(0,c.useRef)([]),U=(0,c.useRef)(null),W=(0,c.useRef)(null),G=(0,c.useRef)(null),K=(0,c.useRef)([]),q=(0,c.useRef)(null);(0,c.useEffect)(()=>{Me(u)},[u]);let We=(0,c.useCallback)(e=>{let t=k.current.get(e),n=A.current.get(e);if(t&&n){if(n.type===`radar`&&t instanceof ae){let r={...n,isAnimating:!0};A.current.set(e,r),t.startAnimation()}else if(n.type===`circle`&&t instanceof pe){let r={...n,isAnimating:!0};A.current.set(e,r),t.startAnimation()}}},[]),Ge=(0,c.useCallback)(e=>{let t=k.current.get(e),n=A.current.get(e);if(t&&n){if(n.type===`radar`&&t instanceof ae){let r={...n,isAnimating:!1};A.current.set(e,r),t.stopAnimation()}else if(n.type===`circle`&&t instanceof pe){let r={...n,isAnimating:!1};A.current.set(e,r),t.stopAnimation()}}},[]),Ke=(0,c.useCallback)(e=>{let t=A.current.get(e);t&&(t.type===`radar`||t.type===`circle`)&&(t.type,t.isAnimating?Ge(e):We(e))},[We,Ge]),qe=(0,c.useCallback)(e=>{if(e===void 0){let e=!1;for(let[,t]of k.current)if(t instanceof le){let n=t.getShowTrajectory();if(n===`all`||typeof n==`number`&&n>0){e=!0;break}}let t=e?0:`all`;for(let[,e]of k.current)e instanceof le&&e.setShowTrajectory(t)}else{let t=new Set(e.map(String));for(let[e,n]of k.current)n instanceof le&&n.setShowTrajectory(t.has(String(e))?`all`:0)}},[]),Je=(0,c.useCallback)((e,t,n)=>{let r=_.find(t=>String(t.id)===String(e));if(!r?.popup||!O.current)return;let i=r.popup.content??T?.(r);if(!i)return;let a=Ie(r.popup,w,i),{position:o,actualPosition:s}=Le(r,a,O.current,n);ye({entityId:e,position:o,config:a,openedBy:t,actualPosition:s}),E?.(e)},[_,w,T,E]),Ye=(0,c.useCallback)(e=>{j?.entityId===e&&(ye(null),re?.(e))},[j,re]),Xe=(0,c.useCallback)(()=>{ye(e=>(e&&re?.(e.entityId),null))},[re]),Ze=(0,c.useCallback)(e=>j?.entityId===e,[j]),Qe=(0,c.useCallback)((e,t,n)=>{let r=O.current;r&&r.flyTo({center:e,zoom:t??r.getZoom(),...n})},[]),$e=(0,c.useCallback)((e,t,n)=>{let r=O.current;if(!r||e.length===0)return;let i=[];for(let t of e){let e=k.current.get(t);e&&i.push(e.getBounds())}if(i.length===0)return;let a=1/0,o=-1/0,s=1/0,c=-1/0;for(let[[e,t],[n,r]]of i)a=Math.min(a,e),o=Math.max(o,n),s=Math.min(s,t),c=Math.max(c,r);let l=(a+o)/2,u=(s+c)/2,d=a===o&&s===c;if(i.length===1||d){let e={center:[l,u],zoom:t??r.getZoom()};n?.duration!==void 0&&(e.duration=n.duration),n?.pitch!==void 0&&(e.pitch=n.pitch),n?.bearing!==void 0&&(e.bearing=n.bearing),n?.essential!==void 0&&(e.essential=n.essential),r.flyTo(e);return}let f=[[a,s],[o,c]],p={padding:n?.padding??50,duration:n?.duration??1e3,bearing:n?.bearing??r.getBearing(),pitch:n?.pitch??r.getPitch()};t!==void 0&&(p.maxZoom=t),n?.essential!==void 0&&(p.essential=n.essential),r.fitBounds(f,p)},[]),et=(0,c.useCallback)(e=>{let t=O.current;if(!t||!t.getContainer())return;let{showMarker:n=!0,markerColor:r=`#3388ff`}=f;if(!n){ze.current&&=(ze.current.remove(),null);return}if(ze.current)ze.current.setLngLat(e);else{let n=document.createElement(`div`);n.className=`mapbox-picker-marker`;let i=document.createElement(`div`);i.className=`marker-inner`,i.style.background=r,n.appendChild(i),ze.current=new l.default.Marker({element:n,anchor:`bottom`}).setLngLat(e).addTo(t)}},[f]),tt=(0,c.useCallback)(()=>{ze.current&&=(ze.current.remove(),null)},[]),nt=(0,c.useCallback)(()=>`marker-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,[]),rt=(0,c.useCallback)(e=>{let t=O.current;if(D.current)if(q.current&&=(q.current.remove(),null),e&&t){t.getCanvas().style.cursor=`none`;let n=document.createElement(`div`);n.className=`mapbox-custom-cursor`;let r=e.size||e.width||32;n.style.cssText=`
51
+ `;b.current||=new l.default.Popup({closeButton:!1,closeOnClick:!1,offset:15,className:`road-highlight-popup`}),b.current.setLngLat(r).setHTML(g).addTo(e),e.getCanvas().style.cursor=`pointer`}else b.current&&b.current.remove(),e.getCanvas().style.cursor=``},[e,f,ee]);(0,c.useEffect)(()=>{if(!(!e||!g))return e.on(`mousemove`,C),()=>{e.off(`mousemove`,C),b.current&&b.current.remove(),e.getCanvas().style.cursor=``}},[e,g,C]);let w=(e,t)=>{h(n=>t?[...n,e]:n.filter(t=>t!==e))},T=e=>{h(e?x.map(e=>e.class):[])},te=f.length>0;return(0,p.jsxs)(`div`,{className:`mapbox-road-highlight-control ${o}`,style:s,children:[(0,p.jsxs)(`button`,{ref:y,className:`mapbox-control-btn mapbox-road-highlight-control__btn ${te?`mapbox-road-highlight-control__btn--active`:``}`,onClick:()=>d(!u),title:`路网高亮${f.length>0?` (已选 ${f.length})`:``}`,children:[(0,p.jsx)(`img`,{src:we,alt:`road`,className:`mapbox-road-highlight-control__btn-icon`}),(0,p.jsxs)(`span`,{children:[`路网`,f.length>0?` (${f.length})`:``]})]}),u&&(0,p.jsxs)(`div`,{ref:v,className:`mapbox-road-highlight-control__panel`,children:[(0,p.jsxs)(`div`,{className:`mapbox-road-highlight-control__panel-header`,children:[(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__panel-title`,children:`道路类型`}),(0,p.jsx)(m.Checkbox,{checked:f.length===x.length,indeterminate:f.length>0&&f.length<x.length,onChange:T,style:{"--color-text-1":`#fff`,"--color-border-2":`rgba(255, 255, 255, 0.3)`},children:(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__type-label`,children:`全选`})})]}),(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__scroll`,children:(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__type-list`,children:x.map(e=>(0,p.jsxs)(`div`,{className:`mapbox-road-highlight-control__type-item`,onClick:()=>w(e.class,!f.includes(e.class)),children:[(0,p.jsx)(m.Checkbox,{checked:f.includes(e.class),onChange:t=>w(e.class,t),onClick:e=>e.stopPropagation(),style:{"--color-text-1":`#fff`,"--color-border-2":`rgba(255, 255, 255, 0.3)`,marginRight:0,flexShrink:0}}),(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__color-indicator`,style:{backgroundColor:e.color}}),(0,p.jsx)(`span`,{className:`mapbox-road-highlight-control__type-label`,children:e.label})]},e.class))})}),(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__tip`,children:`💡 选中道路类型后立即显示高亮`}),!g&&(0,p.jsx)(`div`,{className:`mapbox-road-highlight-control__warning`,children:`⚠️ 正在初始化图层...`})]})]})}var Oe=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769397418113'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10253'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='128'%20height='128'%3e%3cpath%20d='M755.4048%20217.2928A348.3648%20348.3648%200%200%200%20512%20119.3472a348.3136%20348.3136%200%200%200-243.3536%2097.8944%20328.4992%20328.4992%200%200%200-100.864%20236.3392c0%2049.408%2011.7248%2095.744%2032%20137.728a378.0096%20378.0096%200%200%200%2091.136%20118.4256l203.5712%20179.456%2017.5104%2015.4624%2017.5104-15.4624%20203.4176-179.3536a378.6752%20378.6752%200%200%200%2091.2384-118.4768c20.2752-41.984%2032.0512-88.32%2032.0512-137.7792a328.448%20328.448%200%200%200-100.8128-236.288z%20m24.1152%20353.3824a329.216%20329.216%200%200%201-79.872%20103.0656l-188.0064%20164.6592-187.1872-164.7616a329.0624%20329.0624%200%200%201-79.7696-103.0144%20267.0592%20267.0592%200%200%201-27.136-117.0944c0-78.7968%2032.9728-150.1184%2086.272-201.728a298.3936%20298.3936%200%200%201%20208.2816-83.5584c81.3056%200%20154.9824%2031.9488%20208.2304%2083.6096a279.9104%20279.9104%200%200%201%2086.272%20201.728%20266.496%20266.496%200%200%201-27.0848%20117.0944z%20m-164.1472-212.1728l0.0512-0.0512a146.9952%20146.9952%200%200%200-104.2432-43.2128c-40.6528%200-77.568%2016.5376-104.2432%2043.2128l0.0512%200.0512a147.3536%20147.3536%200%200%200-0.0512%20208.6912%20147.0464%20147.0464%200%200%200%20208.4864%200%20147.5072%20147.5072%200%200%200-0.0512-208.6912z%20m-34.1504%20174.2336a97.536%2097.536%200%200%201-69.2736%2028.7232%2097.6384%2097.6384%200%200%201-69.3248-28.7232%2097.792%2097.792%200%200%201-0.1536-138.4448h0.1024a97.9456%2097.9456%200%200%201%20138.5984%200h0.1536c17.664%2017.6128%2028.5696%2042.1376%2028.5696%2069.2224a97.1776%2097.1776%200%200%201-28.672%2069.2224z'%20fill='%23ffffff'%20p-id='10254'%3e%3c/path%3e%3c/svg%3e`,ke=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='160'%20y='240'%20width='704'%20height='544'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,Ae=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3ccircle%20cx='512'%20cy='512'%20r='384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,N=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolygon%20points='512,128%20864,384%20736,800%20288,800%20160,384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'/%3e%3c/svg%3e`,je=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='192'%20y='192'%20width='640'%20height='640'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,Me=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolyline%20points='160,768%20384,256%20640,576%20864,192'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c/svg%3e`;const Ne=({markerTemplates:e,selectedTemplate:t,onTemplateSelect:n,drawMode:r,onDrawModeChange:i,showRectangleTool:a=!1,showCircleTool:o=!1,showPolygonTool:s=!1,showSquareTool:l=!1,showPolylineTool:u=!1})=>{let[d,f]=(0,c.useState)(!1),m=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&f(!1)};if(d)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]);let h=e=>{t?.id===e.id?(n(null),i(null)):(n(e),i(`marker`)),f(!1)},g=()=>{r===`rectangle`?i(null):(n(null),i(`rectangle`))},_=()=>{r===`circle`?i(null):(n(null),i(`circle`))},v=()=>{r===`polygon`?i(null):(n(null),i(`polygon`))},y=()=>{r===`square`?i(null):(n(null),i(`square`))},b=()=>{r===`polyline`?i(null):(n(null),i(`polyline`))},x=()=>{(r===`rectangle`||r===`circle`||r===`polygon`||r===`square`||r===`polyline`)&&i(null),f(!d)},S=e=>e.size?{width:e.size,height:e.size}:{width:e.width||32,height:e.height||32},ee=d||t,C=r===`rectangle`,w=r===`circle`,T=r===`polygon`,te=r===`square`,ne=r===`polyline`;return(0,p.jsxs)(`div`,{ref:m,className:`mapbox-edit-control`,children:[(0,p.jsxs)(`div`,{className:`mapbox-edit-control__btn-group`,children:[(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${ee?`mapbox-control-btn--active`:``}`,onClick:x,title:`Marker`,children:[t?(0,p.jsx)(`img`,{src:t.icon,alt:t.name,className:`mapbox-edit-control__btn-icon`}):(0,p.jsx)(`img`,{src:Oe,alt:`marker`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:t?t.name:`Marker`})]}),l&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${te?`mapbox-control-btn--active`:``}`,onClick:y,title:`绘制正方形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='192'%20y='192'%20width='640'%20height='640'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,alt:`square`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`正方形`})]}),a&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${C?`mapbox-control-btn--active`:``}`,onClick:g,title:`绘制矩形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3crect%20x='160'%20y='240'%20width='704'%20height='544'%20rx='32'%20ry='32'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,alt:`rectangle`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`矩形`})]}),o&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${w?`mapbox-control-btn--active`:``}`,onClick:_,title:`绘制圆形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3ccircle%20cx='512'%20cy='512'%20r='384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'/%3e%3c/svg%3e`,alt:`circle`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`圆形`})]}),s&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${T?`mapbox-control-btn--active`:``}`,onClick:v,title:`绘制多边形`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolygon%20points='512,128%20864,384%20736,800%20288,800%20160,384'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'/%3e%3c/svg%3e`,alt:`polygon`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`多边形`})]}),u&&(0,p.jsxs)(`button`,{className:`mapbox-control-btn ${ne?`mapbox-control-btn--active`:``}`,onClick:b,title:`绘制折线`,children:[(0,p.jsx)(`img`,{src:`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='128'%20height='128'%3e%3cpolyline%20points='160,768%20384,256%20640,576%20864,192'%20fill='none'%20stroke='%23ffffff'%20stroke-width='64'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c/svg%3e`,alt:`polyline`,className:`mapbox-edit-control__btn-icon mapbox-edit-control__btn-icon--lg`}),(0,p.jsx)(`span`,{children:`折线`})]})]}),d&&(0,p.jsxs)(`div`,{className:`mapbox-edit-control__panel`,children:[(0,p.jsx)(`div`,{className:`mapbox-edit-control__panel-header`,children:`选择 Marker`}),(0,p.jsx)(`div`,{className:`mapbox-edit-control__template-list`,children:e.map(e=>{let n=S(e),r=t?.id===e.id;return(0,p.jsxs)(`div`,{className:`mapbox-edit-control__template-item ${r?`mapbox-edit-control__template-item--selected`:``}`,onClick:()=>h(e),title:e.name,children:[(0,p.jsx)(`img`,{src:e.icon,alt:e.name,className:`mapbox-edit-control__template-icon`,style:{width:Math.min(n.width,24),height:Math.min(n.height,24)}}),(0,p.jsx)(`span`,{className:`mapbox-edit-control__template-name`,children:e.name})]},e.id)})})]})]})},Pe=({menuState:e,onClose:t,portalContainer:n,menuRef:r})=>{let i=(0,c.useRef)(null);(0,c.useEffect)(()=>(r&&(r.current=i.current),()=>{r&&(r.current=null)}));let a=(0,c.useCallback)(e=>{i.current&&!i.current.contains(e.target)&&t()},[t]),o=(0,c.useCallback)(e=>{e.key===`Escape`&&t()},[t]);(0,c.useEffect)(()=>{let e=setTimeout(()=>{document.addEventListener(`click`,a,!0),document.addEventListener(`contextmenu`,a,!0)},0);return document.addEventListener(`keydown`,o),()=>{clearTimeout(e),document.removeEventListener(`click`,a,!0),document.removeEventListener(`contextmenu`,a,!0),document.removeEventListener(`keydown`,o)}},[a,o]);let s={...e.position};if(i.current){let e=i.current.getBoundingClientRect();s.x+e.width>window.innerWidth&&(s.x=window.innerWidth-e.width-10),s.y+e.height>window.innerHeight&&(s.y=window.innerHeight-e.height-10)}let l=(0,p.jsx)(`div`,{ref:i,className:`context-menu`,style:{position:`fixed`,left:`${s.x}px`,top:`${s.y}px`,pointerEvents:`all`},children:e.items.map(e=>(0,p.jsxs)(`div`,{className:`context-menu__item ${e.danger?`context-menu__item--danger`:``}`,onClick:()=>{e.onClick(),t()},children:[e.icon&&(0,p.jsx)(`span`,{className:`context-menu__item-icon`,children:e.icon}),(0,p.jsx)(`span`,{className:`context-menu__item-label`,children:e.label})]},e.key))});return(0,f.createPortal)(l,n)};function Fe(e,t,n){return{content:e.content??n??null,trigger:e.trigger??t?.trigger??b.trigger,position:e.position??t?.position??b.position,offset:e.offset??t?.offset??b.offset,showCloseButton:e.showCloseButton??t?.showCloseButton??b.showCloseButton,animation:e.animation??t?.animation??b.animation,className:e.className??``,style:e.style??{},closeOnClickOutside:e.closeOnClickOutside??t?.closeOnClickOutside??b.closeOnClickOutside,closeOnEscape:e.closeOnEscape??t?.closeOnEscape??b.closeOnEscape,hoverDelay:e.hoverDelay??t?.hoverDelay??b.hoverDelay,maxWidth:e.maxWidth??t?.maxWidth??b.maxWidth,zIndex:e.zIndex??t?.zIndex??b.zIndex}}function Ie(e,t,n,r,i){let a,o;if(e.type===`polygon`)o=e.center??Le(e.coordinates);else if(e.type===`polyline`)o=e.center??Re(e.coordinates);else if(e.type===`rectangle`)if(e.center)o=e.center;else{let[[t,n],[r,i]]=e.bounds;o=[(t+r)/2,(n+i)/2]}else o=e.center;let s=n.project(o);a={x:s.x,y:s.y};let c=ze(i,t);return P(a,t.position,t.offset,c)}function Le(e){if(!e||e.length===0)return[0,0];let t=[...e];(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1])&&t.push(e[0]);let n=(0,u.polygon)([t]);return(0,u.centroid)(n).geometry.coordinates}function Re(e){if(!e||e.length===0)return[0,0];let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];return[t/e.length,n/e.length]}function ze(e,t){if(e){let t=e.getBoundingClientRect();return{width:t.width||320,height:t.height||200}}return{width:typeof t.maxWidth==`number`?t.maxWidth:320,height:200}}function P(e,t,n,r){let i={width:window.innerWidth,height:window.innerHeight},a=(()=>{switch(t){case`top`:return[`top`,`bottom`,`right`,`left`,`center`];case`bottom`:return[`bottom`,`top`,`right`,`left`,`center`];case`left`:return[`left`,`right`,`top`,`bottom`,`center`];case`right`:return[`right`,`left`,`top`,`bottom`,`center`];case`center`:default:return[`center`,`top`,`bottom`,`left`,`right`]}})(),o={top:()=>({x:e.x-r.width/2+n[0],y:e.y-r.height-20+n[1]}),bottom:()=>({x:e.x-r.width/2+n[0],y:e.y+20+n[1]}),left:()=>({x:e.x-r.width-20+n[0],y:e.y-r.height/2+n[1]}),right:()=>({x:e.x+20+n[0],y:e.y-r.height/2+n[1]}),center:()=>({x:e.x-r.width/2+n[0],y:e.y-r.height/2+n[1]})},s=e=>e.x>=10&&e.y>=10&&e.x+r.width+10<=i.width&&e.y+r.height+10<=i.height;for(let e of a){let t=o[e]();if(s(t))return{position:t,actualPosition:e}}let c=o[t]();return{position:F(c,r),actualPosition:t}}function F(e,t){let n={width:window.innerWidth,height:window.innerHeight},r={...e};return r.x+t.width+10>n.width&&(r.x=n.width-t.width-10),r.x<10&&(r.x=10),r.y+t.height+10>n.height&&(r.y=n.height-t.height-10),r.y<10&&(r.y=10),r}var Be=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1769394652565'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6483'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='128'%20height='128'%3e%3cpath%20d='M841.385637%20288.639098a36.479886%2036.479886%200%200%201%2072.74644%207.679976l6.613312%20629.544699A109.866323%20109.866323%200%200%201%20810.665733%201023.9968H222.507571a109.652991%20109.652991%200%200%201-109.012992-98.133027l-3.626656-629.544699a36.479886%2036.479886%200%200%201%2072.74644-7.679976L186.241018%20917.330467a36.479886%2036.479886%200%200%200%2036.266553%2032.639898H810.665733A36.479886%2036.479886%200%200%200%20847.99895%20917.330467z%20m-219.732646%20113.706311a36.479886%2036.479886%200%200%201%2036.693218%2036.479886v255.9992a36.693219%2036.693219%200%201%201-73.173104%200v-255.9992a36.479886%2036.479886%200%200%201%2036.479886-36.479886z%20m-219.305982%200a36.479886%2036.479886%200%200%201%2036.479886%2036.479886v255.9992a36.693219%2036.693219%200%201%201-73.173104%200v-255.9992a36.479886%2036.479886%200%200%201%2036.693218-36.479886z%20m-36.693218-255.9992h292.692418V91.519714a18.346609%2018.346609%200%200%200-18.346609-18.346609H384.0004a18.346609%2018.346609%200%200%200-18.346609%2018.346609z%20m-73.173105%200V73.173105A73.173105%2073.173105%200%200%201%20365.653791%200h292.692418a73.386437%2073.386437%200%200%201%2073.173105%2073.173105v73.173104h255.9992a36.693219%2036.693219%200%200%201%200%2073.173105H36.481486a36.693219%2036.693219%200%200%201%200-73.173105z'%20fill='%23EB6865'%20p-id='6484'%3e%3c/path%3e%3c/svg%3e`;const I=(0,c.forwardRef)((e,t)=>{let{center:n=[116.4074,39.9042],zoom:r=12,pitch:i=0,bearing:a=0,style:o=`mapbox://styles/mapbox/dark-v11`,maxBounds:s,mode:u=`display`,editConfig:d={},pickerConfig:f={},onPick:m,interactive:h={},layers:g=[],entities:_=[],selectedIds:v=[],nameConfig:y,selectNameConfig:b,showCoordinates:x=!0,showScale:S=!0,showResetView:ee=!0,showRoadHighlight:C=!1,popupDefaults:w,renderPopup:T,onMapLoad:te,onEntityClick:ne,onPopupOpen:E,onPopupClose:re,className:ie=``,containerStyle:oe}=e,D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(new Map),A=(0,c.useRef)(new Map),he=(0,c.useRef)(new Set),[j,ye]=(0,c.useState)(null),xe=(0,c.useRef)(null),Se=(0,c.useRef)(null),we=(0,c.useRef)(null),[M,Te]=(0,c.useState)(null),Ee=(0,c.useRef)(null),Oe=(0,c.useRef)(null),[ke,Ae]=(0,c.useState)(null),[N,je]=(0,c.useState)(u),[Me,Le]=(0,c.useState)(null),Re=(0,c.useRef)(null),[ze,P]=(0,c.useState)(null),[F,I]=(0,c.useState)(null),[Ve,He]=(0,c.useState)(null),L=(0,c.useRef)(!1),R=(0,c.useRef)(null),z=(0,c.useRef)(null),B=(0,c.useRef)(null),V=(0,c.useRef)(null),H=(0,c.useRef)(null),U=(0,c.useRef)([]),W=(0,c.useRef)(null),G=(0,c.useRef)(null),K=(0,c.useRef)(null),q=(0,c.useRef)([]),J=(0,c.useRef)(null);(0,c.useEffect)(()=>{je(u)},[u]);let Ue=(0,c.useCallback)(e=>{let t=k.current.get(e),n=A.current.get(e);if(t&&n){if(n.type===`radar`&&t instanceof ae){let r={...n,isAnimating:!0};A.current.set(e,r),t.startAnimation()}else if(n.type===`circle`&&t instanceof pe){let r={...n,isAnimating:!0};A.current.set(e,r),t.startAnimation()}}},[]),We=(0,c.useCallback)(e=>{let t=k.current.get(e),n=A.current.get(e);if(t&&n){if(n.type===`radar`&&t instanceof ae){let r={...n,isAnimating:!1};A.current.set(e,r),t.stopAnimation()}else if(n.type===`circle`&&t instanceof pe){let r={...n,isAnimating:!1};A.current.set(e,r),t.stopAnimation()}}},[]),Ge=(0,c.useCallback)(e=>{let t=A.current.get(e);t&&(t.type===`radar`||t.type===`circle`)&&(t.type,t.isAnimating?We(e):Ue(e))},[Ue,We]),Ke=(0,c.useCallback)(e=>{if(e===void 0){let e=!1;for(let[,t]of k.current)if(t instanceof le){let n=t.getShowTrajectory();if(n===`all`||typeof n==`number`&&n>0){e=!0;break}}let t=e?0:`all`;for(let[,e]of k.current)e instanceof le&&e.setShowTrajectory(t)}else{let t=new Set(e.map(String));for(let[e,n]of k.current)n instanceof le&&n.setShowTrajectory(t.has(String(e))?`all`:0)}},[]),qe=(0,c.useCallback)((e,t,n)=>{let r=_.find(t=>String(t.id)===String(e));if(!r?.popup||!O.current)return;let i=r.popup.content??T?.(r);if(!i)return;let a=Fe(r.popup,w,i),{position:o,actualPosition:s}=Ie(r,a,O.current,n);ye({entityId:e,position:o,config:a,openedBy:t,actualPosition:s}),E?.(e)},[_,w,T,E]),Je=(0,c.useCallback)(e=>{j?.entityId===e&&(ye(null),re?.(e))},[j,re]),Ye=(0,c.useCallback)(()=>{ye(e=>(e&&re?.(e.entityId),null))},[re]),Xe=(0,c.useCallback)(e=>j?.entityId===e,[j]),Ze=(0,c.useCallback)((e,t,n)=>{let r=O.current;r&&r.flyTo({center:e,zoom:t??r.getZoom(),...n})},[]),Qe=(0,c.useCallback)((e,t,n)=>{let r=O.current;if(!r||e.length===0)return;let i=[];for(let t of e){let e=k.current.get(t);e&&i.push(e.getBounds())}if(i.length===0)return;let a=1/0,o=-1/0,s=1/0,c=-1/0;for(let[[e,t],[n,r]]of i)a=Math.min(a,e),o=Math.max(o,n),s=Math.min(s,t),c=Math.max(c,r);let l=(a+o)/2,u=(s+c)/2,d=a===o&&s===c;if(i.length===1||d){let e={center:[l,u],zoom:t??r.getZoom()};n?.duration!==void 0&&(e.duration=n.duration),n?.pitch!==void 0&&(e.pitch=n.pitch),n?.bearing!==void 0&&(e.bearing=n.bearing),n?.essential!==void 0&&(e.essential=n.essential),r.flyTo(e);return}let f=[[a,s],[o,c]],p={padding:n?.padding??50,duration:n?.duration??1e3,bearing:n?.bearing??r.getBearing(),pitch:n?.pitch??r.getPitch()};t!==void 0&&(p.maxZoom=t),n?.essential!==void 0&&(p.essential=n.essential),r.fitBounds(f,p)},[]),$e=(0,c.useCallback)(e=>{let t=O.current;if(!t||!t.getContainer())return;let{showMarker:n=!0,markerColor:r=`#3388ff`}=f;if(!n){Re.current&&=(Re.current.remove(),null);return}if(Re.current)Re.current.setLngLat(e);else{let n=document.createElement(`div`);n.className=`mapbox-picker-marker`;let i=document.createElement(`div`);i.className=`marker-inner`,i.style.background=r,n.appendChild(i),Re.current=new l.default.Marker({element:n,anchor:`bottom`}).setLngLat(e).addTo(t)}},[f]),et=(0,c.useCallback)(()=>{Re.current&&=(Re.current.remove(),null)},[]),tt=(0,c.useCallback)(()=>`marker-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,[]),nt=(0,c.useCallback)(e=>{let t=O.current;if(D.current)if(J.current&&=(J.current.remove(),null),e&&t){t.getCanvas().style.cursor=`none`;let n=document.createElement(`div`);n.className=`mapbox-custom-cursor`;let r=e.size||e.width||32;n.style.cssText=`
52
52
  position: fixed;
53
53
  pointer-events: none;
54
54
  z-index: 9999;
55
55
  transform: translate(-50%, -50%);
56
56
  opacity: 0.8;
57
- `;let i=document.createElement(`img`);i.src=e.icon,i.style.width=`${r}px`,i.style.height=`${e.size||e.height||r}px`,i.style.objectFit=`contain`,n.appendChild(i),document.body.appendChild(n),q.current=n;let a=e=>{q.current&&(q.current.style.left=`${e.clientX}px`,q.current.style.top=`${e.clientY}px`)};document.addEventListener(`mousemove`,a),n.dataset.cleanup=`true`,n._cleanup=()=>{document.removeEventListener(`mousemove`,a)}}else t&&(t.getCanvas().style.cursor=``)},[]),J=(0,c.useCallback)(()=>{if(q.current){let e=q.current._cleanup;e&&e(),q.current.remove(),q.current=null}let e=O.current;e&&(e.getCanvas().style.cursor=``)},[]),it=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`rect-preview-source`)||(e.addSource(`rect-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`rect-preview-fill`,type:`fill`,source:`rect-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`rect-preview-line`,type:`line`,source:`rect-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}})))},[]),at=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`rect-preview-source`);if(!r)return;let[i,a]=e,[o,s]=t,c=[[Math.min(i,o),Math.max(a,s)],[Math.max(i,o),Math.max(a,s)],[Math.max(i,o),Math.min(a,s)],[Math.min(i,o),Math.min(a,s)],[Math.min(i,o),Math.max(a,s)]];r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[c]},properties:{}});let l=L.current,u=l?.strokeColor??`#3388ff`,d=l?.strokeWidth??2,f=l?.fillColor??`#3388ff`,p=l?.fillOpacity??.1;n.getLayer(`rect-preview-line`)&&(n.setPaintProperty(`rect-preview-line`,`line-color`,u),n.setPaintProperty(`rect-preview-line`,`line-width`,d)),n.getLayer(`rect-preview-fill`)&&(n.setPaintProperty(`rect-preview-fill`,`fill-color`,f),n.setPaintProperty(`rect-preview-fill`,`fill-opacity`,p))},[]),ot=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`rect-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]})},[]),Y=(0,c.useCallback)(()=>{Ue(null),ot()},[ot]),st=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`circle-preview-source`)||(e.addSource(`circle-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`circle-preview-fill`,type:`fill`,source:`circle-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`circle-preview-line`,type:`line`,source:`circle-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}})))},[]),ct=(0,c.useCallback)((e,t,n=64)=>{let[r,i]=e,a=[],o=t/6371e3,s=i*Math.PI/180;for(let e=0;e<=n;e++){let t=e/n*2*Math.PI,c=o*Math.cos(t),l=o*Math.sin(t)/Math.cos(s),u=i+c*180/Math.PI,d=r+l*180/Math.PI;a.push([d,u])}return a},[]),lt=(0,c.useCallback)((e,t)=>{let[n,r]=e,[i,a]=t,o=(a-r)*Math.PI/180,s=(i-n)*Math.PI/180,c=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))},[]),ut=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`circle-preview-source`);if(!r)return;let i=lt(e,t),a=ct(e,i);r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[a]},properties:{}});let o=z.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2,l=o?.fillColor??`#3388ff`,u=o?.fillOpacity??.1;n.getLayer(`circle-preview-line`)&&(n.setPaintProperty(`circle-preview-line`,`line-color`,s),n.setPaintProperty(`circle-preview-line`,`line-width`,c)),n.getLayer(`circle-preview-fill`)&&(n.setPaintProperty(`circle-preview-fill`,`fill-color`,l),n.setPaintProperty(`circle-preview-fill`,`fill-opacity`,u))},[lt,ct]),dt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`circle-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]})},[]),X=(0,c.useCallback)(()=>{B.current=null,dt()},[dt]),ft=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`polygon-preview-source`)||(e.addSource(`polygon-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polygon-preview-fill`,type:`fill`,source:`polygon-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`polygon-preview-line`,type:`line`,source:`polygon-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}}),e.addSource(`polygon-vertices-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polygon-vertices`,type:`circle`,source:`polygon-vertices-source`,paint:{"circle-radius":5,"circle-color":`#3388ff`,"circle-stroke-color":`#ffffff`,"circle-stroke-width":2}})))},[]),pt=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`polygon-preview-source`),i=n.getSource(`polygon-vertices-source`);if(!r||!i)return;let a=[...e,t];if(a.length>=3){let e=[...a,a[0]];r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[e]},properties:{}})}else a.length===2?r.setData({type:`Feature`,geometry:{type:`LineString`,coordinates:a},properties:{}}):r.setData({type:`FeatureCollection`,features:[]});i.setData({type:`FeatureCollection`,features:e.map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{}}))});let o=V.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2,l=o?.fillColor??`#3388ff`,u=o?.fillOpacity??.1;n.getLayer(`polygon-preview-line`)&&(n.setPaintProperty(`polygon-preview-line`,`line-color`,s),n.setPaintProperty(`polygon-preview-line`,`line-width`,c)),n.getLayer(`polygon-preview-fill`)&&(n.setPaintProperty(`polygon-preview-fill`,`fill-color`,l),n.setPaintProperty(`polygon-preview-fill`,`fill-opacity`,u)),n.getLayer(`polygon-vertices`)&&n.setPaintProperty(`polygon-vertices`,`circle-color`,s)},[]),mt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`polygon-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]});let n=e.getSource(`polygon-vertices-source`);n&&n.setData({type:`FeatureCollection`,features:[]})},[]),ht=(0,c.useCallback)(()=>{H.current=[],mt()},[mt]),gt=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`square-preview-source`)||(e.addSource(`square-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`square-preview-fill`,type:`fill`,source:`square-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`square-preview-line`,type:`line`,source:`square-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}})))},[]),_t=(0,c.useCallback)((e,t)=>{let[n,r]=e,i=t/2/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r+o],[n+s,r+o],[n+s,r-o],[n-s,r-o],[n-s,r+o]]},[]),vt=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`square-preview-source`);if(!r)return;let i=lt(e,t)*2,a=_t(e,i);r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[a]},properties:{}});let o=U.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2,l=o?.fillColor??`#3388ff`,u=o?.fillOpacity??.1;n.getLayer(`square-preview-line`)&&(n.setPaintProperty(`square-preview-line`,`line-color`,s),n.setPaintProperty(`square-preview-line`,`line-width`,c)),n.getLayer(`square-preview-fill`)&&(n.setPaintProperty(`square-preview-fill`,`fill-color`,l),n.setPaintProperty(`square-preview-fill`,`fill-opacity`,u))},[lt,_t]),yt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`square-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]})},[]),bt=(0,c.useCallback)(()=>{W.current=null,yt()},[yt]),xt=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`polyline-preview-source`)||(e.addSource(`polyline-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polyline-preview-line`,type:`line`,source:`polyline-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}}),e.addSource(`polyline-vertices-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polyline-vertices`,type:`circle`,source:`polyline-vertices-source`,paint:{"circle-radius":5,"circle-color":`#3388ff`,"circle-stroke-color":`#ffffff`,"circle-stroke-width":2}})))},[]),St=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`polyline-preview-source`),i=n.getSource(`polyline-vertices-source`);if(!r||!i)return;let a=[...e,t];a.length>=2?r.setData({type:`Feature`,geometry:{type:`LineString`,coordinates:a},properties:{}}):r.setData({type:`FeatureCollection`,features:[]}),i.setData({type:`FeatureCollection`,features:e.map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{}}))});let o=G.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2;n.getLayer(`polyline-preview-line`)&&(n.setPaintProperty(`polyline-preview-line`,`line-color`,s),n.setPaintProperty(`polyline-preview-line`,`line-width`,c)),n.getLayer(`polyline-vertices`)&&n.setPaintProperty(`polyline-vertices`,`circle-color`,s)},[]),Ct=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`polyline-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]});let n=e.getSource(`polyline-vertices-source`);n&&n.setData({type:`FeatureCollection`,features:[]})},[]),Z=(0,c.useCallback)(()=>{K.current=[],Ct()},[Ct]),wt=(0,c.useCallback)(e=>{N(e),rt(e),e?(F(`marker`),Y(),X(),ht(),bt(),Z()):F(null)},[rt,Y,X,ht,bt,Z]),Tt=(0,c.useCallback)(e=>{if(F(e),e===`rectangle`){N(null),J(),X(),ht(),bt(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`circle`){N(null),J(),Y(),ht(),bt(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`polygon`){N(null),J(),Y(),X(),bt(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`square`){N(null),J(),Y(),X(),ht(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`polyline`){N(null),J(),Y(),X(),ht(),bt();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else e===`marker`?(Y(),X(),ht(),bt(),Z()):(N(null),J(),Y(),X(),ht(),bt(),Z())},[J,Y,X,ht,bt,Z]),Et=(0,c.useCallback)(e=>{e!==`picker`&&(tt(),Re(null)),e!==`edit`&&(N(null),F(null),Y(),Z(),J()),Me(e)},[tt,J,Y,Z]),Dt=(0,c.useCallback)(()=>M,[M]),Ot=(0,c.useCallback)(()=>Ne,[Ne]),kt=(0,c.useCallback)(()=>{tt(),Re(null)},[tt]);(0,c.useEffect)(()=>{if(!O.current||M!==`picker`)return;let e=f.value;if(e){let t=[e.lng,e.lat];Re(e),et(t)}},[f.value,M,et]);let At=e=>`mode`in e,jt=(0,c.useCallback)(e=>{if(Me(`edit`),tt(),Re(null),I.current=!0,At(e)){if(e.mode===`marker`)e.markerStyle?(R.current=e.markerStyle,L.current=null,z.current=null,V.current=null,U.current=null,G.current=null,N(null),F(`marker`),e.markerStyle.src&&e.markerStyle.width?rt({id:`custom`,name:e.markerStyle.name||`Marker`,icon:e.markerStyle.src,width:e.markerStyle.width}):J()):e.template&&(R.current=null,L.current=null,z.current=null,V.current=null,U.current=null,G.current=null,N(e.template),F(`marker`),rt(e.template));else if(e.mode===`rectangle`){L.current=e.rectangleStyle||null,R.current=null,z.current=null,V.current=null,U.current=null,G.current=null,N(null),F(`rectangle`),J();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`circle`){z.current=e.circleStyle||null,L.current=null,R.current=null,V.current=null,U.current=null,G.current=null,N(null),F(`circle`),J();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`polygon`){V.current=e.polygonStyle||null,L.current=null,R.current=null,z.current=null,U.current=null,G.current=null,N(null),F(`polygon`),J();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`square`){U.current=e.squareStyle||null,L.current=null,R.current=null,z.current=null,V.current=null,G.current=null,N(null),F(`square`),J();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`polyline`){G.current=e.polylineStyle||null,L.current=null,R.current=null,z.current=null,V.current=null,U.current=null,N(null),F(`polyline`),J();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}}else N(e),F(`marker`),rt(e),L.current=null,R.current=null,z.current=null,V.current=null,U.current=null,G.current=null},[tt,rt,J]);(0,c.useImperativeHandle)(t,()=>({startAnimation:We,stopAnimation:Ge,toggleAnimation:Ke,getMap:()=>O.current,openPopup:e=>Je(e,`programmatic`),closePopup:Ye,closeAllPopups:Xe,isPopupOpen:Ze,toggleUnitTrajectory:qe,flyTo:Qe,flyToEntities:$e,getMode:Dt,setMode:Et,getPickedLocation:Ot,clearPickedLocation:kt,startDrawing:jt}),[We,Ge,Ke,Je,Ye,Xe,Ze,qe,Qe,$e,Dt,Et,Ot,kt,jt]);let Mt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=new Set(_.map(e=>e.id)),n=new Set(k.current.keys());for(let e of n)t.has(e)||(k.current.get(e)?.destroy(),k.current.delete(e));let r=new Set(v.map(String));for(let t of _){let n=k.current.get(t.id);if(n)if(t.type===`radar`&&n instanceof ae)n.update(t);else if(t.type===`image`&&n instanceof se)n.update(t);else if(t.type===`marker`&&n instanceof ce)n.update(t);else if(t.type===`unit`&&n instanceof le)n.update(t);else if(t.type===`polygon`&&n instanceof ue)n.update(t);else if(t.type===`circle`)if(t.fillType===`radial-gradient`)if(n instanceof pe)n.update(t);else{n.destroy();let i=new pe(e,t,y,b);k.current.set(t.id,i),i.setSelected(r.has(String(t.id)))}else if(n instanceof fe)n.update(t);else{n.destroy();let i=new fe(e,t,y,b);k.current.set(t.id,i),i.setSelected(r.has(String(t.id)))}else (t.type===`square`&&n instanceof me||t.type===`rectangle`&&n instanceof ge||t.type===`polyline`&&n instanceof de)&&n.update(t);else{let n=null;t.type===`radar`?n=new ae(e,t,y,b):t.type===`image`?n=new se(e,t,y,b):t.type===`marker`?n=new ce(e,t,y,b):t.type===`unit`?n=new le(e,t,y,b):t.type===`polygon`?n=new ue(e,t,y,b):t.type===`circle`?n=t.fillType===`radial-gradient`?new pe(e,t,y,b):new fe(e,t,y,b):t.type===`square`?n=new me(e,t,y,b):t.type===`rectangle`?n=new ge(e,t,y,b):t.type===`polyline`&&(n=new de(e,t,y,b)),n&&(k.current.set(t.id,n),n.setSelected(r.has(String(t.id))))}}},[_,v]),Nt=(0,c.useCallback)(()=>{for(let e of k.current.values())e.destroy();k.current.clear()},[]),Pt=(0,c.useCallback)(e=>{let t=e.getStyle();if(!t?.layers)return;let n=[`polygon-`,`polyline-`,`circle-`,`square-`,`rectangle-`,`radar-`,`image-`,`unit-`,`marker-`];for(let e of t.layers)if(n.some(t=>e.id.startsWith(t)))return e.id},[]),Ft=(0,c.useCallback)((e,t)=>{let n=`base-layer-source-${t.id}`,r=`base-layer-${t.id}`;e.addSource(n,{type:`raster`,tiles:[t.url],tileSize:t.tileSize??256,minzoom:t.minzoom??0,maxzoom:t.maxzoom??22,scheme:t.scheme??`xyz`,bounds:t.bounds,attribution:t.attribution});let i=Pt(e);e.addLayer({id:r,type:`raster`,source:n,paint:{"raster-opacity":t.opacity??1},layout:{visibility:t.visible===!1?`none`:`visible`}},i)},[Pt]),It=(0,c.useCallback)(async(e,t)=>{try{let n=await(await fetch(t.url)).json(),r=`base-layer-source-${t.id}`,i=`base-layer-${t.id}`;if(!he.current.has(t.id))return;let a=n.format===`pbf`||n.vector_layers,o=Pt(e);a?(e.addSource(r,{type:`vector`,tiles:n.tiles,minzoom:n.minzoom??0,maxzoom:n.maxzoom??22,bounds:n.bounds,attribution:n.attribution}),console.warn(`TileJSON "${t.id}" 是矢量瓦片,建议使用 type: 'style' 加载完整样式`)):(e.addSource(r,{type:`raster`,tiles:n.tiles,tileSize:t.tileSize??n.tileSize??256,minzoom:n.minzoom??0,maxzoom:n.maxzoom??22,bounds:n.bounds,attribution:n.attribution}),e.addLayer({id:i,type:`raster`,source:r,paint:{"raster-opacity":t.opacity??1},layout:{visibility:t.visible===!1?`none`:`visible`}},o))}catch(e){console.error(`Failed to load TileJSON from ${t.url}:`,e)}},[Pt]),Lt=(0,c.useCallback)(async(e,t)=>{try{let n=await(await fetch(t.url)).json();if(!he.current.has(t.id))return;if(n.sources)for(let[r,i]of Object.entries(n.sources)){let n=`base-layer-source-${t.id}-${r}`;e.getSource(n)||e.addSource(n,i)}let r=Pt(e);if(n.layers)for(let i of n.layers){let n=`base-layer-${t.id}-${i.id}`;if(e.getLayer(n))continue;let a={...i,id:n,source:i.source?`base-layer-source-${t.id}-${i.source}`:void 0};i.type===`raster`&&t.opacity!==void 0&&(a.paint={...a.paint,"raster-opacity":t.opacity}),t.visible===!1&&(a.layout={...a.layout,visibility:`none`}),e.addLayer(a,r)}n.glyphs&&console.warn(`Style JSON 包含 glyphs 配置,但无法动态添加。建议通过 Mapbox 组件的 style prop 设置。`)}catch(e){console.error(`Failed to load Style JSON from ${t.url}:`,e)}},[Pt]),Rt=(0,c.useCallback)((e,t)=>{let n=e.getStyle();if(!n)return;let r=`base-layer-${t}`,i=n.layers?.filter(e=>e.id.startsWith(r))??[];for(let t of i)e.getLayer(t.id)&&e.removeLayer(t.id);let a=`base-layer-source-${t}`,o=n.sources??{};for(let t of Object.keys(o))t.startsWith(a)&&e.getSource(t)&&e.removeSource(t)},[]),zt=(0,c.useCallback)(e=>{let t=O.current;if(!t)return;let n=new Set(e.map(e=>e.id)),r=he.current;for(let e of r)n.has(e)||(Rt(t,e),r.delete(e));for(let n of e)if(r.has(n.id)){let e=`base-layer-${n.id}`;t.getLayer(e)&&(n.opacity!==void 0&&t.setPaintProperty(e,`raster-opacity`,n.opacity),t.setLayoutProperty(e,`visibility`,n.visible===!1?`none`:`visible`))}else switch(r.add(n.id),n.type){case`raster`:Ft(t,n);break;case`tilejson`:It(t,n);break;case`style`:Lt(t,n);break;default:{let e=n;e.url&&Ft(t,{...e,type:`raster`})}}},[Ft,It,Lt,Rt]),Bt=(0,c.useCallback)(e=>{let t=e;for(;t;){let e=t.getAttribute?.(`data-entity-id`);if(e)return e;t=t.parentElement}return null},[]),Vt=(0,c.useCallback)(e=>{let t=[e.lngLat.lng,e.lngLat.lat],n={x:e.point.x,y:e.point.y},r=Yt.current;if(r===`picker`){let e={lng:t[0],lat:t[1]};Re(e),et(t),Xt.current?.(e);return}if(r===`edit`){let e=Qt.current;if(e===`rectangle`){let e=$t.current;if(!e)Ue(t);else{let n=L.current,r={...n,id:n?.id??nt(),type:`rectangle`,bounds:[e,t]};ot();let i=O.current;if(i&&!k.current.has(r.id)){let e=new ge(i,r,y,b);k.current.set(r.id,e)}Q.current.onRectangleAdd?.(r),Ue(null),L.current=null,I.current&&(I.current=!1,F(null),i&&(i.getCanvas().style.cursor=``))}return}if(e===`circle`){let e=B.current;if(!e)B.current={center:t};else{let n=lt(e.center,t),r=z.current,i={...r,id:r?.id??nt(),type:`circle`,center:e.center,radius:n};dt();let a=O.current;if(a&&!k.current.has(i.id)){let e=new fe(a,i,y,b);k.current.set(i.id,e)}Q.current.onCircleAdd?.(i),B.current=null,z.current=null,I.current&&(I.current=!1,F(null),a&&(a.getCanvas().style.cursor=``))}return}if(e===`polygon`){let e=H.current;if(e.length>=3){let n=e[0];if(lt(n,t)<20){let t=V.current,n={...t,id:t?.id??nt(),type:`polygon`,coordinates:[...e]};mt();let r=O.current;if(r&&!k.current.has(n.id)){let e=new ue(r,n,y,b);k.current.set(n.id,e)}Q.current.onPolygonAdd?.(n),H.current=[],V.current=null,I.current&&(I.current=!1,F(null),r&&(r.getCanvas().style.cursor=``));return}}H.current=[...e,t];return}if(e===`square`){let e=W.current;if(!e)W.current={center:t};else{let n=lt(e.center,t)*2,r=U.current,i={...r,id:r?.id??nt(),type:`square`,center:e.center,length:n};yt();let a=O.current;if(a&&!k.current.has(i.id)){let e=new me(a,i,y,b);k.current.set(i.id,e)}Q.current.onSquareAdd?.(i),W.current=null,U.current=null,I.current&&(I.current=!1,F(null),a&&(a.getCanvas().style.cursor=``))}return}if(e===`polyline`){K.current=[...K.current,t];return}let n=R.current;if(n&&n.src&&n.width){let e={...n,id:n.id??nt(),type:`marker`,center:t,src:n.src,width:n.width};Q.current.onMarkerAdd?.(e),N(null),F(null),J(),R.current=null,I.current=!1;return}let r=Zt.current;if(r){let e={id:nt(),type:`marker`,name:r.name,center:t,src:r.icon,width:r.size||r.width||32};r.customData!==void 0&&(e.customData=r.customData),Q.current.onMarkerAdd?.(e),N(null),F(null),J(),I.current=!1;return}}let i=Kt.current,a=qt.current,o=Jt.current,s=Bt(e.originalEvent.target);if(s){let e=i.find(e=>String(e.id)===s);if(e){if(a?.(e),e.popup){let t=e.popup.content??T?.(e);t&&Ie(e.popup,w,t).trigger===`click`&&o(s,`click`,n)}return}}for(let[t,r]of k.current){let s=r.getLabelLayerId();if(s&&O.current?.getLayer(s)&&O.current.queryRenderedFeatures(e.point,{layers:[s]}).length>0){let e=i.find(e=>e.id===t);if(e){if(a?.(e),e.popup){let r=e.popup.content??T?.(e);r&&Ie(e.popup,w,r).trigger===`click`&&o(t,`click`,n)}return}}}for(let[e,r]of k.current)if(r.isPointInEntity(t)){let t=i.find(t=>t.id===e);if(t){if(a?.(t),t.popup){let r=t.popup.content??T?.(t);r&&Ie(t.popup,w,r).trigger===`click`&&o(e,`click`,n)}return}}},[w,T,Bt]),Ht=(0,c.useCallback)(e=>{let t=[e.lngLat.lng,e.lngLat.lat],n=Qt.current,r=$t.current;n===`rectangle`&&r&&at(r,t);let i=B.current;n===`circle`&&i&&ut(i.center,t);let a=H.current;n===`polygon`&&a.length>0&&pt(a,t);let o=W.current;n===`square`&&o&&vt(o.center,t);let s=K.current;n===`polyline`&&s.length>0&&St(s,t);let c=Kt.current,l=Jt.current;for(let[e,n]of k.current)if(n.isPointInEntity(t)){let t=c.find(t=>t.id===e);if(!t?.popup)continue;let n=t.popup.content??T?.(t);if(!n)continue;let r=Ie(t.popup,w,n);if(r.trigger===`hover`){we.current&&clearTimeout(we.current),we.current=window.setTimeout(()=>{l(e,`hover`)},r.hoverDelay);return}}if(we.current&&=(clearTimeout(we.current),null),j?.openedBy===`hover`){let e=k.current.get(j.entityId);e&&!e.isPointInEntity(t)&&Ye(j.entityId)}},[w,T,j,Ye,at,ut,pt,vt,St]),Ut=(0,c.useCallback)(e=>{if(e.preventDefault(),Yt.current!==`edit`)return;if(Zt.current){N(null),F(null),J();return}let t=Qt.current;if(t===`rectangle`){if($t.current)Ue(null),ot();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`circle`){if(B.current)B.current=null,dt();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`polygon`){let e=H.current;if(e.length>=3){let t=V.current,n={...t,id:t?.id??nt(),type:`polygon`,coordinates:[...e]};mt();let r=O.current;if(r&&!k.current.has(n.id)){let e=new ue(r,n,y,b);k.current.set(n.id,e)}Q.current.onPolygonAdd?.(n),H.current=[],V.current=null,I.current&&(I.current=!1,F(null),r&&(r.getCanvas().style.cursor=``))}else if(e.length>0)H.current=[],mt();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`square`){if(W.current)W.current=null,yt();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`polyline`){let e=K.current;if(e.length>=2){let t=G.current,n={...t,id:t?.id??nt(),type:`polyline`,coordinates:[...e]};Ct();let r=O.current;if(r&&!k.current.has(n.id)){let e=new de(r,n,y,b);k.current.set(n.id,e)}Q.current.onPolylineAdd?.(n),K.current=[],G.current=null,I.current&&(I.current=!1,F(null),r&&(r.getCanvas().style.cursor=``))}else if(e.length>0)K.current=[],Ct();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}let n=[e.lngLat.lng,e.lngLat.lat],r={x:e.point.x,y:e.point.y},i=Kt.current,a=Bt(e.originalEvent.target);if(a){let e=i.find(e=>String(e.id)===a);if(e){Wt(e,r,n);return}}for(let[t,a]of k.current){let o=a.getLabelLayerId();if(o&&O.current?.getLayer(o)&&O.current.queryRenderedFeatures(e.point,{layers:[o]}).length>0){let e=i.find(e=>e.id===t);if(e){Wt(e,r,n);return}}}for(let[e,t]of k.current)if(t.isPointInEntity(n)){let t=i.find(t=>t.id===e);if(t){Wt(t,r,n);return}}},[Bt,J,ot,dt,mt,yt,Ct]),Wt=(0,c.useCallback)((e,t,n)=>{let r=D.current?.getBoundingClientRect(),i=r?{x:t.x+r.left,y:t.y+r.top}:t;Ee({position:i,lngLat:n,items:[{key:`delete`,label:`删除`,icon:(0,p.jsx)(`img`,{src:Ve,alt:`delete`,style:{width:`18px`,flexShrink:0}}),danger:!0,onClick:()=>{Q.current.onEntityDelete?.(e)}}]})},[]),Gt=(0,c.useCallback)(()=>{Ee(null)},[]);(0,c.useEffect)(()=>{let e=document.createElement(`div`);return e.id=`mapbox-popup-container-${Date.now()}`,e.style.cssText=`
57
+ `;let i=document.createElement(`img`);i.src=e.icon,i.style.width=`${r}px`,i.style.height=`${e.size||e.height||r}px`,i.style.objectFit=`contain`,n.appendChild(i),document.body.appendChild(n),J.current=n;let a=e=>{J.current&&(J.current.style.left=`${e.clientX}px`,J.current.style.top=`${e.clientY}px`)};document.addEventListener(`mousemove`,a),n.dataset.cleanup=`true`,n._cleanup=()=>{document.removeEventListener(`mousemove`,a)}}else t&&(t.getCanvas().style.cursor=``)},[]),Y=(0,c.useCallback)(()=>{if(J.current){let e=J.current._cleanup;e&&e(),J.current.remove(),J.current=null}let e=O.current;e&&(e.getCanvas().style.cursor=``)},[]),rt=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`rect-preview-source`)||(e.addSource(`rect-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`rect-preview-fill`,type:`fill`,source:`rect-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`rect-preview-line`,type:`line`,source:`rect-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}})))},[]),it=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`rect-preview-source`);if(!r)return;let[i,a]=e,[o,s]=t,c=[[Math.min(i,o),Math.max(a,s)],[Math.max(i,o),Math.max(a,s)],[Math.max(i,o),Math.min(a,s)],[Math.min(i,o),Math.min(a,s)],[Math.min(i,o),Math.max(a,s)]];r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[c]},properties:{}});let l=R.current,u=l?.strokeColor??`#3388ff`,d=l?.strokeWidth??2,f=l?.fillColor??`#3388ff`,p=l?.fillOpacity??.1;n.getLayer(`rect-preview-line`)&&(n.setPaintProperty(`rect-preview-line`,`line-color`,u),n.setPaintProperty(`rect-preview-line`,`line-width`,d)),n.getLayer(`rect-preview-fill`)&&(n.setPaintProperty(`rect-preview-fill`,`fill-color`,f),n.setPaintProperty(`rect-preview-fill`,`fill-opacity`,p))},[]),at=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`rect-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]})},[]),X=(0,c.useCallback)(()=>{He(null),at()},[at]),ot=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`circle-preview-source`)||(e.addSource(`circle-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`circle-preview-fill`,type:`fill`,source:`circle-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`circle-preview-line`,type:`line`,source:`circle-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}})))},[]),st=(0,c.useCallback)((e,t,n=64)=>{let[r,i]=e,a=[],o=t/6371e3,s=i*Math.PI/180;for(let e=0;e<=n;e++){let t=e/n*2*Math.PI,c=o*Math.cos(t),l=o*Math.sin(t)/Math.cos(s),u=i+c*180/Math.PI,d=r+l*180/Math.PI;a.push([d,u])}return a},[]),ct=(0,c.useCallback)((e,t)=>{let[n,r]=e,[i,a]=t,o=(a-r)*Math.PI/180,s=(i-n)*Math.PI/180,c=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))},[]),lt=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`circle-preview-source`);if(!r)return;let i=ct(e,t),a=st(e,i);r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[a]},properties:{}});let o=B.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2,l=o?.fillColor??`#3388ff`,u=o?.fillOpacity??.1;n.getLayer(`circle-preview-line`)&&(n.setPaintProperty(`circle-preview-line`,`line-color`,s),n.setPaintProperty(`circle-preview-line`,`line-width`,c)),n.getLayer(`circle-preview-fill`)&&(n.setPaintProperty(`circle-preview-fill`,`fill-color`,l),n.setPaintProperty(`circle-preview-fill`,`fill-opacity`,u))},[ct,st]),ut=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`circle-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]})},[]),dt=(0,c.useCallback)(()=>{V.current=null,ut()},[ut]),ft=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`polygon-preview-source`)||(e.addSource(`polygon-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polygon-preview-fill`,type:`fill`,source:`polygon-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`polygon-preview-line`,type:`line`,source:`polygon-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}}),e.addSource(`polygon-vertices-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polygon-vertices`,type:`circle`,source:`polygon-vertices-source`,paint:{"circle-radius":5,"circle-color":`#3388ff`,"circle-stroke-color":`#ffffff`,"circle-stroke-width":2}})))},[]),pt=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`polygon-preview-source`),i=n.getSource(`polygon-vertices-source`);if(!r||!i)return;let a=[...e,t];if(a.length>=3){let e=[...a,a[0]];r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[e]},properties:{}})}else a.length===2?r.setData({type:`Feature`,geometry:{type:`LineString`,coordinates:a},properties:{}}):r.setData({type:`FeatureCollection`,features:[]});i.setData({type:`FeatureCollection`,features:e.map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{}}))});let o=H.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2,l=o?.fillColor??`#3388ff`,u=o?.fillOpacity??.1;n.getLayer(`polygon-preview-line`)&&(n.setPaintProperty(`polygon-preview-line`,`line-color`,s),n.setPaintProperty(`polygon-preview-line`,`line-width`,c)),n.getLayer(`polygon-preview-fill`)&&(n.setPaintProperty(`polygon-preview-fill`,`fill-color`,l),n.setPaintProperty(`polygon-preview-fill`,`fill-opacity`,u)),n.getLayer(`polygon-vertices`)&&n.setPaintProperty(`polygon-vertices`,`circle-color`,s)},[]),mt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`polygon-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]});let n=e.getSource(`polygon-vertices-source`);n&&n.setData({type:`FeatureCollection`,features:[]})},[]),ht=(0,c.useCallback)(()=>{U.current=[],mt()},[mt]),gt=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`square-preview-source`)||(e.addSource(`square-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`square-preview-fill`,type:`fill`,source:`square-preview-source`,paint:{"fill-color":`#3388ff`,"fill-opacity":.1}}),e.addLayer({id:`square-preview-line`,type:`line`,source:`square-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}})))},[]),_t=(0,c.useCallback)((e,t)=>{let[n,r]=e,i=t/2/6371e3,a=r*Math.PI/180,o=i*180/Math.PI,s=i*180/Math.PI/Math.cos(a);return[[n-s,r+o],[n+s,r+o],[n+s,r-o],[n-s,r-o],[n-s,r+o]]},[]),vt=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`square-preview-source`);if(!r)return;let i=ct(e,t)*2,a=_t(e,i);r.setData({type:`Feature`,geometry:{type:`Polygon`,coordinates:[a]},properties:{}});let o=W.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2,l=o?.fillColor??`#3388ff`,u=o?.fillOpacity??.1;n.getLayer(`square-preview-line`)&&(n.setPaintProperty(`square-preview-line`,`line-color`,s),n.setPaintProperty(`square-preview-line`,`line-width`,c)),n.getLayer(`square-preview-fill`)&&(n.setPaintProperty(`square-preview-fill`,`fill-color`,l),n.setPaintProperty(`square-preview-fill`,`fill-opacity`,u))},[ct,_t]),yt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`square-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]})},[]),bt=(0,c.useCallback)(()=>{G.current=null,yt()},[yt]),xt=(0,c.useCallback)(()=>{let e=O.current;e&&(e.getSource(`polyline-preview-source`)||(e.addSource(`polyline-preview-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polyline-preview-line`,type:`line`,source:`polyline-preview-source`,paint:{"line-color":`#3388ff`,"line-width":2,"line-dasharray":[4,4]}}),e.addSource(`polyline-vertices-source`,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),e.addLayer({id:`polyline-vertices`,type:`circle`,source:`polyline-vertices-source`,paint:{"circle-radius":5,"circle-color":`#3388ff`,"circle-stroke-color":`#ffffff`,"circle-stroke-width":2}})))},[]),St=(0,c.useCallback)((e,t)=>{let n=O.current;if(!n)return;let r=n.getSource(`polyline-preview-source`),i=n.getSource(`polyline-vertices-source`);if(!r||!i)return;let a=[...e,t];a.length>=2?r.setData({type:`Feature`,geometry:{type:`LineString`,coordinates:a},properties:{}}):r.setData({type:`FeatureCollection`,features:[]}),i.setData({type:`FeatureCollection`,features:e.map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:e},properties:{}}))});let o=K.current,s=o?.strokeColor??`#3388ff`,c=o?.strokeWidth??2;n.getLayer(`polyline-preview-line`)&&(n.setPaintProperty(`polyline-preview-line`,`line-color`,s),n.setPaintProperty(`polyline-preview-line`,`line-width`,c)),n.getLayer(`polyline-vertices`)&&n.setPaintProperty(`polyline-vertices`,`circle-color`,s)},[]),Ct=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=e.getSource(`polyline-preview-source`);t&&t.setData({type:`FeatureCollection`,features:[]});let n=e.getSource(`polyline-vertices-source`);n&&n.setData({type:`FeatureCollection`,features:[]})},[]),Z=(0,c.useCallback)(()=>{q.current=[],Ct()},[Ct]),wt=(0,c.useCallback)(e=>{P(e),nt(e),e?(I(`marker`),X(),dt(),ht(),bt(),Z()):I(null)},[nt,X,dt,ht,bt,Z]),Tt=(0,c.useCallback)(e=>{if(I(e),e===`rectangle`){P(null),Y(),dt(),ht(),bt(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`circle`){P(null),Y(),X(),ht(),bt(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`polygon`){P(null),Y(),X(),dt(),bt(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`square`){P(null),Y(),X(),dt(),ht(),Z();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else if(e===`polyline`){P(null),Y(),X(),dt(),ht(),bt();let e=O.current;e&&(e.getCanvas().style.cursor=`crosshair`)}else e===`marker`?(X(),dt(),ht(),bt(),Z()):(P(null),Y(),X(),dt(),ht(),bt(),Z())},[Y,X,dt,ht,bt,Z]),Et=(0,c.useCallback)(e=>{e!==`picker`&&(et(),Le(null)),e!==`edit`&&(P(null),I(null),X(),Z(),Y()),je(e)},[et,Y,X,Z]),Dt=(0,c.useCallback)(()=>N,[N]),Ot=(0,c.useCallback)(()=>Me,[Me]),kt=(0,c.useCallback)(()=>{et(),Le(null)},[et]);(0,c.useEffect)(()=>{if(!ke||N!==`picker`)return;let e=f.value;if(e){let t=[e.lng,e.lat];Le(e),$e(t)}},[f.value,N,$e,ke]);let At=e=>`mode`in e,jt=(0,c.useCallback)(e=>{if(je(`edit`),et(),Le(null),L.current=!0,At(e)){if(e.mode===`marker`)e.markerStyle?(z.current=e.markerStyle,R.current=null,B.current=null,H.current=null,W.current=null,K.current=null,P(null),I(`marker`),e.markerStyle.src&&e.markerStyle.width?nt({id:`custom`,name:e.markerStyle.name||`Marker`,icon:e.markerStyle.src,width:e.markerStyle.width}):Y()):e.template&&(z.current=null,R.current=null,B.current=null,H.current=null,W.current=null,K.current=null,P(e.template),I(`marker`),nt(e.template));else if(e.mode===`rectangle`){R.current=e.rectangleStyle||null,z.current=null,B.current=null,H.current=null,W.current=null,K.current=null,P(null),I(`rectangle`),Y();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`circle`){B.current=e.circleStyle||null,R.current=null,z.current=null,H.current=null,W.current=null,K.current=null,P(null),I(`circle`),Y();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`polygon`){H.current=e.polygonStyle||null,R.current=null,z.current=null,B.current=null,W.current=null,K.current=null,P(null),I(`polygon`),Y();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`square`){W.current=e.squareStyle||null,R.current=null,z.current=null,B.current=null,H.current=null,K.current=null,P(null),I(`square`),Y();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}else if(e.mode===`polyline`){K.current=e.polylineStyle||null,R.current=null,z.current=null,B.current=null,H.current=null,W.current=null,P(null),I(`polyline`),Y();let t=O.current;t&&(t.getCanvas().style.cursor=`crosshair`)}}else P(e),I(`marker`),nt(e),R.current=null,z.current=null,B.current=null,H.current=null,W.current=null,K.current=null},[et,nt,Y]);(0,c.useImperativeHandle)(t,()=>({startAnimation:Ue,stopAnimation:We,toggleAnimation:Ge,getMap:()=>O.current,openPopup:e=>qe(e,`programmatic`),closePopup:Je,closeAllPopups:Ye,isPopupOpen:Xe,toggleUnitTrajectory:Ke,flyTo:Ze,flyToEntities:Qe,getMode:Dt,setMode:Et,getPickedLocation:Ot,clearPickedLocation:kt,startDrawing:jt}),[Ue,We,Ge,qe,Je,Ye,Xe,Ke,Ze,Qe,Dt,Et,Ot,kt,jt]);let Mt=(0,c.useCallback)(()=>{let e=O.current;if(!e)return;let t=new Set(_.map(e=>e.id)),n=new Set(k.current.keys());for(let e of n)t.has(e)||(k.current.get(e)?.destroy(),k.current.delete(e));let r=new Set(v.map(String));for(let t of _){let n=k.current.get(t.id);if(n)if(t.type===`radar`&&n instanceof ae)n.update(t);else if(t.type===`image`&&n instanceof se)n.update(t);else if(t.type===`marker`&&n instanceof ce)n.update(t);else if(t.type===`unit`&&n instanceof le)n.update(t);else if(t.type===`polygon`&&n instanceof ue)n.update(t);else if(t.type===`circle`)if(t.fillType===`radial-gradient`)if(n instanceof pe)n.update(t);else{n.destroy();let i=new pe(e,t,y,b);k.current.set(t.id,i),i.setSelected(r.has(String(t.id)))}else if(n instanceof fe)n.update(t);else{n.destroy();let i=new fe(e,t,y,b);k.current.set(t.id,i),i.setSelected(r.has(String(t.id)))}else (t.type===`square`&&n instanceof me||t.type===`rectangle`&&n instanceof ge||t.type===`polyline`&&n instanceof de)&&n.update(t);else{let n=null;t.type===`radar`?n=new ae(e,t,y,b):t.type===`image`?n=new se(e,t,y,b):t.type===`marker`?n=new ce(e,t,y,b):t.type===`unit`?n=new le(e,t,y,b):t.type===`polygon`?n=new ue(e,t,y,b):t.type===`circle`?n=t.fillType===`radial-gradient`?new pe(e,t,y,b):new fe(e,t,y,b):t.type===`square`?n=new me(e,t,y,b):t.type===`rectangle`?n=new ge(e,t,y,b):t.type===`polyline`&&(n=new de(e,t,y,b)),n&&(k.current.set(t.id,n),n.setSelected(r.has(String(t.id))))}}},[_,v,y,b]),Nt=(0,c.useCallback)(()=>{for(let e of k.current.values())e.destroy();k.current.clear()},[]),Pt=(0,c.useCallback)(e=>{let t=e.getStyle();if(!t?.layers)return;let n=[`polygon-`,`polyline-`,`circle-`,`square-`,`rectangle-`,`radar-`,`image-`,`unit-`,`marker-`];for(let e of t.layers)if(n.some(t=>e.id.startsWith(t)))return e.id},[]),Ft=(0,c.useCallback)((e,t)=>{let n=`base-layer-source-${t.id}`,r=`base-layer-${t.id}`;e.addSource(n,{type:`raster`,tiles:[t.url],tileSize:t.tileSize??256,minzoom:t.minzoom??0,maxzoom:t.maxzoom??22,scheme:t.scheme??`xyz`,bounds:t.bounds,attribution:t.attribution});let i=Pt(e);e.addLayer({id:r,type:`raster`,source:n,paint:{"raster-opacity":t.opacity??1},layout:{visibility:t.visible===!1?`none`:`visible`}},i)},[Pt]),It=(0,c.useCallback)(async(e,t)=>{try{let n=await(await fetch(t.url)).json(),r=`base-layer-source-${t.id}`,i=`base-layer-${t.id}`;if(!he.current.has(t.id))return;let a=n.format===`pbf`||n.vector_layers,o=Pt(e);a?(e.addSource(r,{type:`vector`,tiles:n.tiles,minzoom:n.minzoom??0,maxzoom:n.maxzoom??22,bounds:n.bounds,attribution:n.attribution}),console.warn(`TileJSON "${t.id}" 是矢量瓦片,建议使用 type: 'style' 加载完整样式`)):(e.addSource(r,{type:`raster`,tiles:n.tiles,tileSize:t.tileSize??n.tileSize??256,minzoom:n.minzoom??0,maxzoom:n.maxzoom??22,bounds:n.bounds,attribution:n.attribution}),e.addLayer({id:i,type:`raster`,source:r,paint:{"raster-opacity":t.opacity??1},layout:{visibility:t.visible===!1?`none`:`visible`}},o))}catch(e){console.error(`Failed to load TileJSON from ${t.url}:`,e)}},[Pt]),Lt=(0,c.useCallback)(async(e,t)=>{try{let n=await(await fetch(t.url)).json();if(!he.current.has(t.id))return;if(n.sources)for(let[r,i]of Object.entries(n.sources)){let n=`base-layer-source-${t.id}-${r}`;e.getSource(n)||e.addSource(n,i)}let r=Pt(e);if(n.layers)for(let i of n.layers){let n=`base-layer-${t.id}-${i.id}`;if(e.getLayer(n))continue;let a={...i,id:n,source:i.source?`base-layer-source-${t.id}-${i.source}`:void 0};i.type===`raster`&&t.opacity!==void 0&&(a.paint={...a.paint,"raster-opacity":t.opacity}),t.visible===!1&&(a.layout={...a.layout,visibility:`none`}),e.addLayer(a,r)}n.glyphs&&console.warn(`Style JSON 包含 glyphs 配置,但无法动态添加。建议通过 Mapbox 组件的 style prop 设置。`)}catch(e){console.error(`Failed to load Style JSON from ${t.url}:`,e)}},[Pt]),Rt=(0,c.useCallback)((e,t)=>{let n=e.getStyle();if(!n)return;let r=`base-layer-${t}`,i=n.layers?.filter(e=>e.id.startsWith(r))??[];for(let t of i)e.getLayer(t.id)&&e.removeLayer(t.id);let a=`base-layer-source-${t}`,o=n.sources??{};for(let t of Object.keys(o))t.startsWith(a)&&e.getSource(t)&&e.removeSource(t)},[]),zt=(0,c.useCallback)(e=>{let t=O.current;if(!t)return;let n=new Set(e.map(e=>e.id)),r=he.current;for(let e of r)n.has(e)||(Rt(t,e),r.delete(e));for(let n of e)if(r.has(n.id)){let e=`base-layer-${n.id}`;t.getLayer(e)&&(n.opacity!==void 0&&t.setPaintProperty(e,`raster-opacity`,n.opacity),t.setLayoutProperty(e,`visibility`,n.visible===!1?`none`:`visible`))}else switch(r.add(n.id),n.type){case`raster`:Ft(t,n);break;case`tilejson`:It(t,n);break;case`style`:Lt(t,n);break;default:{let e=n;e.url&&Ft(t,{...e,type:`raster`})}}},[Ft,It,Lt,Rt]),Bt=(0,c.useCallback)(e=>{let t=e;for(;t;){let e=t.getAttribute?.(`data-entity-id`);if(e)return e;t=t.parentElement}return null},[]),Vt=(0,c.useCallback)(e=>{let t=[e.lngLat.lng,e.lngLat.lat],n={x:e.point.x,y:e.point.y},r=Yt.current;if(r===`picker`){let e={lng:t[0],lat:t[1]};Le(e),$e(t),Xt.current?.(e);return}if(r===`edit`){let e=Qt.current;if(e===`rectangle`){let e=$t.current;if(!e)He(t);else{let n=R.current,r={...n,id:n?.id??tt(),type:`rectangle`,bounds:[e,t]};at();let i=O.current;if(i&&!k.current.has(r.id)){let e=new ge(i,r,y,b);k.current.set(r.id,e)}Q.current.onRectangleAdd?.(r),He(null),R.current=null,L.current&&(L.current=!1,I(null),i&&(i.getCanvas().style.cursor=``))}return}if(e===`circle`){let e=V.current;if(!e)V.current={center:t};else{let n=ct(e.center,t),r=B.current,i={...r,id:r?.id??tt(),type:`circle`,center:e.center,radius:n};ut();let a=O.current;if(a&&!k.current.has(i.id)){let e=new fe(a,i,y,b);k.current.set(i.id,e)}Q.current.onCircleAdd?.(i),V.current=null,B.current=null,L.current&&(L.current=!1,I(null),a&&(a.getCanvas().style.cursor=``))}return}if(e===`polygon`){let e=U.current;if(e.length>=3){let n=e[0];if(ct(n,t)<20){let t=H.current,n={...t,id:t?.id??tt(),type:`polygon`,coordinates:[...e]};mt();let r=O.current;if(r&&!k.current.has(n.id)){let e=new ue(r,n,y,b);k.current.set(n.id,e)}Q.current.onPolygonAdd?.(n),U.current=[],H.current=null,L.current&&(L.current=!1,I(null),r&&(r.getCanvas().style.cursor=``));return}}U.current=[...e,t];return}if(e===`square`){let e=G.current;if(!e)G.current={center:t};else{let n=ct(e.center,t)*2,r=W.current,i={...r,id:r?.id??tt(),type:`square`,center:e.center,length:n};yt();let a=O.current;if(a&&!k.current.has(i.id)){let e=new me(a,i,y,b);k.current.set(i.id,e)}Q.current.onSquareAdd?.(i),G.current=null,W.current=null,L.current&&(L.current=!1,I(null),a&&(a.getCanvas().style.cursor=``))}return}if(e===`polyline`){q.current=[...q.current,t];return}let n=z.current;if(n&&n.src&&n.width){let e={...n,id:n.id??tt(),type:`marker`,center:t,src:n.src,width:n.width};Q.current.onMarkerAdd?.(e),P(null),I(null),Y(),z.current=null,L.current=!1;return}let r=Zt.current;if(r){let e={id:tt(),type:`marker`,name:r.name,center:t,src:r.icon,width:r.size||r.width||32};r.customData!==void 0&&(e.customData=r.customData),Q.current.onMarkerAdd?.(e),P(null),I(null),Y(),L.current=!1;return}}let i=Kt.current,a=qt.current,o=Jt.current,s=Bt(e.originalEvent.target);if(s){let e=i.find(e=>String(e.id)===s);if(e){if(a?.(e),e.popup){let t=e.popup.content??T?.(e);t&&Fe(e.popup,w,t).trigger===`click`&&o(s,`click`,n)}return}}for(let[t,r]of k.current){let s=r.getLabelLayerId();if(s&&O.current?.getLayer(s)&&O.current.queryRenderedFeatures(e.point,{layers:[s]}).length>0){let e=i.find(e=>e.id===t);if(e){if(a?.(e),e.popup){let r=e.popup.content??T?.(e);r&&Fe(e.popup,w,r).trigger===`click`&&o(t,`click`,n)}return}}}for(let[e,r]of k.current)if(r.isPointInEntity(t)){let t=i.find(t=>t.id===e);if(t){if(a?.(t),t.popup){let r=t.popup.content??T?.(t);r&&Fe(t.popup,w,r).trigger===`click`&&o(e,`click`,n)}return}}},[w,T,Bt]),Ht=(0,c.useCallback)(e=>{let t=[e.lngLat.lng,e.lngLat.lat],n=Qt.current,r=$t.current;n===`rectangle`&&r&&it(r,t);let i=V.current;n===`circle`&&i&&lt(i.center,t);let a=U.current;n===`polygon`&&a.length>0&&pt(a,t);let o=G.current;n===`square`&&o&&vt(o.center,t);let s=q.current;n===`polyline`&&s.length>0&&St(s,t);let c=Kt.current,l=Jt.current;for(let[e,n]of k.current)if(n.isPointInEntity(t)){let t=c.find(t=>t.id===e);if(!t?.popup)continue;let n=t.popup.content??T?.(t);if(!n)continue;let r=Fe(t.popup,w,n);if(r.trigger===`hover`){we.current&&clearTimeout(we.current),we.current=window.setTimeout(()=>{l(e,`hover`)},r.hoverDelay);return}}if(we.current&&=(clearTimeout(we.current),null),j?.openedBy===`hover`){let e=k.current.get(j.entityId);e&&!e.isPointInEntity(t)&&Je(j.entityId)}},[w,T,j,Je,it,lt,pt,vt,St]),Ut=(0,c.useCallback)(e=>{if(e.preventDefault(),Yt.current!==`edit`)return;if(Zt.current){P(null),I(null),Y();return}let t=Qt.current;if(t===`rectangle`){if($t.current)He(null),at();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`circle`){if(V.current)V.current=null,ut();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`polygon`){let e=U.current;if(e.length>=3){let t=H.current,n={...t,id:t?.id??tt(),type:`polygon`,coordinates:[...e]};mt();let r=O.current;if(r&&!k.current.has(n.id)){let e=new ue(r,n,y,b);k.current.set(n.id,e)}Q.current.onPolygonAdd?.(n),U.current=[],H.current=null,L.current&&(L.current=!1,I(null),r&&(r.getCanvas().style.cursor=``))}else if(e.length>0)U.current=[],mt();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`square`){if(G.current)G.current=null,yt();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}if(t===`polyline`){let e=q.current;if(e.length>=2){let t=K.current,n={...t,id:t?.id??tt(),type:`polyline`,coordinates:[...e]};Ct();let r=O.current;if(r&&!k.current.has(n.id)){let e=new de(r,n,y,b);k.current.set(n.id,e)}Q.current.onPolylineAdd?.(n),q.current=[],K.current=null,L.current&&(L.current=!1,I(null),r&&(r.getCanvas().style.cursor=``))}else if(e.length>0)q.current=[],Ct();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}return}let n=[e.lngLat.lng,e.lngLat.lat],r={x:e.point.x,y:e.point.y},i=Kt.current,a=Bt(e.originalEvent.target);if(a){let e=i.find(e=>String(e.id)===a);if(e){Wt(e,r,n);return}}for(let[t,a]of k.current){let o=a.getLabelLayerId();if(o&&O.current?.getLayer(o)&&O.current.queryRenderedFeatures(e.point,{layers:[o]}).length>0){let e=i.find(e=>e.id===t);if(e){Wt(e,r,n);return}}}for(let[e,t]of k.current)if(t.isPointInEntity(n)){let t=i.find(t=>t.id===e);if(t){Wt(t,r,n);return}}},[Bt,Y,at,ut,mt,yt,Ct]),Wt=(0,c.useCallback)((e,t,n)=>{let r=D.current?.getBoundingClientRect(),i=r?{x:t.x+r.left,y:t.y+r.top}:t;Te({position:i,lngLat:n,items:[{key:`delete`,label:`删除`,icon:(0,p.jsx)(`img`,{src:Be,alt:`delete`,style:{width:`18px`,flexShrink:0}}),danger:!0,onClick:()=>{Q.current.onEntityDelete?.(e)}}]})},[]),Gt=(0,c.useCallback)(()=>{Te(null)},[]);(0,c.useEffect)(()=>{let e=document.createElement(`div`);return e.id=`mapbox-popup-container-${Date.now()}`,e.style.cssText=`
58
58
  position: fixed;
59
59
  top: 0;
60
60
  left: 0;
@@ -70,4 +70,4 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
70
70
  pointer-events: none;
71
71
  height: 100%;
72
72
  z-index: ${(w?.zIndex??1e3)+100};
73
- `,document.body.appendChild(e),De.current=e,()=>{document.body.contains(e)&&document.body.removeChild(e)}},[w?.zIndex]);let Kt=(0,c.useRef)(_);Kt.current=_;let qt=(0,c.useRef)(ne);qt.current=ne;let Jt=(0,c.useRef)(Je);Jt.current=Je;let Yt=(0,c.useRef)(M);Yt.current=M;let Xt=(0,c.useRef)(m);Xt.current=m;let Zt=(0,c.useRef)(Be);Zt.current=Be;let Qt=(0,c.useRef)(P);Qt.current=P;let $t=(0,c.useRef)(He);$t.current=He;let Q=(0,c.useRef)(d);Q.current=d,(0,c.useEffect)(()=>{let e=e=>{if(e.key===`Escape`&&M===`edit`){if(Be&&(N(null),F(null),J()),P===`rectangle`)if(He)Ue(null),ot();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(P===`circle`)if(B.current)B.current=null,dt();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(P===`polygon`)if(H.current.length>0)H.current=[],mt();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(P===`square`)if(W.current)W.current=null,yt();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(P===`polyline`)if(K.current.length>0)K.current=[],Ct();else{F(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[M,Be,P,He,J,ot,dt,mt,yt,Ct]),(0,c.useEffect)(()=>{let e=O.current;if(!e||!j)return;let t=j.entityId,n=j.config,r=()=>{let r=Kt.current.find(e=>e.id===t);if(!r){Xe();return}let{position:i}=Le(r,n,e,void 0,Se.current);Se.current&&(Se.current.style.left=`${i.x}px`,Se.current.style.top=`${i.y}px`)},i=setTimeout(()=>{r()},50);return e.on(`move`,r),e.on(`zoom`,r),e.on(`rotate`,r),e.on(`pitch`,r),()=>{clearTimeout(i),e.off(`move`,r),e.off(`zoom`,r),e.off(`rotate`,r),e.off(`pitch`,r)}},[j?.entityId,Xe]),(0,c.useEffect)(()=>{let e=O.current,t=D.current;if(!e||!Te||!t)return;let n=Te.lngLat,r=()=>{let r=e.project(n),i=t.clientWidth,a=t.clientHeight;if(r.x<0||r.x>i||r.y<0||r.y>a){Gt();return}let o=t.getBoundingClientRect(),s=r.x+o.left,c=r.y+o.top;ke.current&&(ke.current.style.left=`${s}px`,ke.current.style.top=`${c}px`)};return e.on(`move`,r),e.on(`zoom`,r),e.on(`rotate`,r),e.on(`pitch`,r),()=>{e.off(`move`,r),e.off(`zoom`,r),e.off(`rotate`,r),e.off(`pitch`,r)}},[Te?.lngLat,Gt]),(0,c.useEffect)(()=>{if(!D.current)return;let e={version:8,sources:{},layers:[]},{dragPan:t=!0,scrollZoom:c=!0,doubleClickZoom:u=!0,touchZoomRotate:d=!0,keyboard:f=!0,dragRotate:p=!0,pitchWithRotate:m=!0,touchPitch:v=!0,boxZoom:y=!0}=h,b=new l.default.Map({container:D.current,style:o||e,center:n,zoom:r,pitch:i,bearing:a,maxBounds:s,dragPan:t,scrollZoom:c,doubleClickZoom:u,touchZoomRotate:d,keyboard:f,dragRotate:p,pitchWithRotate:m,touchPitch:v,boxZoom:y,transformRequest:(e,t)=>{if(t===`Glyphs`){let t=e.match(/\/fonts\/([^/]+)\/(\d+-\d+)\.pbf/);if(t){let e=decodeURIComponent(t[1]),n=t[2],r=e.split(`,`)[0].trim();return{url:`/gis-fonts/${encodeURIComponent(r)}/${n}.pbf`}}}return{url:e}}});return O.current=b,b.on(`load`,()=>{A.current.clear(),_.forEach(e=>{A.current.set(e.id,e)}),zt(g),Mt(),it(),st(),ft(),gt(),xt(),je(b),te?.(b)}),b.on(`click`,Vt),b.on(`mousemove`,Ht),b.on(`contextmenu`,Ut),()=>{b.off(`click`,Vt),b.off(`mousemove`,Ht),b.off(`contextmenu`,Ut),Nt(),tt(),J(),Y(),Z(),b.remove(),O.current=null}},[]),(0,c.useEffect)(()=>{if(O.current){if(!O.current.isStyleLoaded()){O.current.once(`load`,()=>{A.current.clear(),_.forEach(e=>{A.current.set(e.id,e)}),Mt()});return}A.current.clear(),_.forEach(e=>{A.current.set(e.id,e)}),Mt()}},[_,Mt]),(0,c.useEffect)(()=>{if(O.current){if(!O.current.isStyleLoaded()){O.current.once(`load`,()=>{zt(g)});return}zt(g)}},[g,zt]);let en=(0,c.useRef)(void 0),tn=(0,c.useRef)(!0),nn=(0,c.useRef)(g);nn.current=g;let rn=(0,c.useRef)(zt);rn.current=zt;let an=(0,c.useRef)(Nt);an.current=Nt;let on=(0,c.useRef)(Mt);on.current=Mt;let sn=(0,c.useRef)(it);sn.current=it;let cn=(0,c.useRef)(st);cn.current=st;let ln=(0,c.useRef)(ft);ln.current=ft;let un=(0,c.useRef)(gt);un.current=gt;let dn=(0,c.useRef)(xt);dn.current=xt,(0,c.useEffect)(()=>{let e=O.current;if(!e)return;let t=o||{version:8,sources:{},layers:[]};if(tn.current){tn.current=!1,en.current=o;return}en.current!==o&&(en.current=o,e.setStyle(t),e.once(`style.load`,()=>{he.current.clear(),rn.current(nn.current),an.current(),on.current(),sn.current(),cn.current(),ln.current(),un.current(),dn.current()}))},[o]),(0,c.useEffect)(()=>{let e=new Set(v.map(String));for(let[t,n]of k.current)n.setSelected(e.has(String(t)))},[v]);let fn=(0,c.useRef)({});(0,c.useEffect)(()=>{let e=O.current;if(!e)return;let t=fn.current,o=n&&(t.center?.[0]!==n[0]||t.center?.[1]!==n[1]),s=t.zoom!==r,c=t.pitch!==i,l=t.bearing!==a;if(!o&&!s&&!c&&!l)return;fn.current={center:n,zoom:r,pitch:i,bearing:a};let u=()=>{e.jumpTo({center:n,zoom:r,pitch:i,bearing:a})};e.isStyleLoaded()?u():e.once(`load`,u)},[n,r,i,a]);let pn=(()=>x===!1?null:x===!0?{enabled:!0}:x)(),mn=(()=>S===!1?null:S===!0?{enabled:!0}:S)(),hn=(()=>ee===!1?null:ee===!0?{enabled:!0}:ee)(),$=(()=>{if(C===!1)return null;let e,t;if(g&&g.length>0){let n=g.find(e=>e.hasRoadNetwork===!0)||g[0];e=n.id,t=n.roadNetworkSourceLayer||`road`}return C===!0?{enabled:!0,source:e,sourceLayer:t}:{...C,source:C.source||e,sourceLayer:C.sourceLayer||t}})();return(0,p.jsxs)(`div`,{className:`comp-mapbox ${M===`picker`?`comp-mapbox--picker-mode`:``} ${ie}`,style:oe,children:[(0,p.jsx)(`div`,{ref:D,className:`comp-mapbox__map`}),M===`picker`&&f.showCrosshair===!0&&(0,p.jsxs)(`div`,{className:`comp-mapbox__crosshair`,children:[(0,p.jsx)(`div`,{className:`comp-mapbox__crosshair-h`,style:f.crosshairColor?{backgroundColor:f.crosshairColor}:void 0}),(0,p.jsx)(`div`,{className:`comp-mapbox__crosshair-v`,style:f.crosshairColor?{backgroundColor:f.crosshairColor}:void 0})]}),M===`edit`&&d.showEditTools!==!1&&(d.markerTemplates&&d.markerTemplates.length>0||d.showRectangleTool||d.showCircleTool||d.showPolygonTool||d.showSquareTool||d.showPolylineTool)||$&&$.enabled!==!1?(0,p.jsxs)(`div`,{className:`comp-mapbox__edit-controls`,children:[M===`edit`&&d.showEditTools!==!1&&(d.markerTemplates&&d.markerTemplates.length>0||d.showRectangleTool||d.showCircleTool||d.showPolygonTool||d.showSquareTool||d.showPolylineTool)&&(0,p.jsx)(Pe,{markerTemplates:d.markerTemplates||[],selectedTemplate:Be,onTemplateSelect:wt,drawMode:P,onDrawModeChange:Tt,showRectangleTool:d.showRectangleTool,showCircleTool:d.showCircleTool,showPolygonTool:d.showPolygonTool,showSquareTool:d.showSquareTool,showPolylineTool:d.showPolylineTool}),$&&$.enabled!==!1&&(0,p.jsx)(Oe,{map:Ae,highlightWidth:$.highlightWidth,defaultRoadTypes:$.defaultRoadTypes,defaultMinWidth:$.defaultMinWidth,source:$.source,sourceLayer:$.sourceLayer,className:$.className,style:$.style})]}):null,(pn?.enabled!==!1||mn?.enabled!==!1||hn?.enabled!==!1)&&(0,p.jsxs)(`div`,{className:`comp-mapbox__controls`,children:[pn&&pn.enabled!==!1&&(0,p.jsx)(ve,{map:Ae,precision:pn.precision,className:pn.className,style:pn.style}),mn&&mn.enabled!==!1&&(0,p.jsx)(be,{map:Ae,maxWidth:mn.maxWidth,unit:mn.unit,className:mn.className,style:mn.style}),hn&&hn.enabled!==!1&&(0,p.jsx)(Ce,{map:Ae,initialCenter:n,initialZoom:r,initialPitch:i,initialBearing:a,duration:hn.duration,className:hn.className,style:hn.style})]}),j&&xe.current&&(0,p.jsx)(_e,{popupState:j,onClose:()=>Ye(j.entityId),portalContainer:xe.current,popupRef:Se}),Te&&De.current&&(0,p.jsx)(Fe,{menuState:Te,onClose:Gt,portalContainer:De.current,menuRef:ke})]})});F.displayName=`Mapbox`,exports.BaseCanvasRenderer=re,exports.COLOR_SCHEMES=v,exports.CanvasCircleRenderer=pe,exports.CanvasImageRenderer=se,exports.CanvasRadarRenderer=ae,exports.CircleRenderer=fe,exports.ContextMenu=Fe,exports.CoordinateDisplay=ve,exports.DEFAULT_NAME_CONFIG=h,exports.DEFAULT_SELECT_NAME_CONFIG=g,exports.EditControl=Pe,exports.EntityPopup=_e,exports.Mapbox=F,exports.MarkerRenderer=ce,exports.POPUP_DEFAULTS=b,exports.PolygonRenderer=ue,exports.PolylineRenderer=de,exports.RADAR_DEFAULTS=y,exports.ROAD_TYPE_OPTIONS=x,exports.RectangleRenderer=ge,exports.ResetViewControl=Ce,exports.RoadHighlightControl=Oe,exports.ScaleControl=be,exports.SquareRenderer=me,exports.UnitRenderer=le,exports.bearing=C,exports.calculatePopupPosition=Le,exports.confidenceToOpacity=E,exports.destinationPoint=S,exports.distance=ee,exports.mergePopupConfig=Ie,exports.resolveNameConfig=_;
73
+ `,document.body.appendChild(e),Ee.current=e,()=>{document.body.contains(e)&&document.body.removeChild(e)}},[w?.zIndex]);let Kt=(0,c.useRef)(_);Kt.current=_;let qt=(0,c.useRef)(ne);qt.current=ne;let Jt=(0,c.useRef)(qe);Jt.current=qe;let Yt=(0,c.useRef)(N);Yt.current=N;let Xt=(0,c.useRef)(m);Xt.current=m;let Zt=(0,c.useRef)(ze);Zt.current=ze;let Qt=(0,c.useRef)(F);Qt.current=F;let $t=(0,c.useRef)(Ve);$t.current=Ve;let Q=(0,c.useRef)(d);Q.current=d,(0,c.useEffect)(()=>{let e=e=>{if(e.key===`Escape`&&N===`edit`){if(ze&&(P(null),I(null),Y()),F===`rectangle`)if(Ve)He(null),at();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(F===`circle`)if(V.current)V.current=null,ut();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(F===`polygon`)if(U.current.length>0)U.current=[],mt();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(F===`square`)if(G.current)G.current=null,yt();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}if(F===`polyline`)if(q.current.length>0)q.current=[],Ct();else{I(null);let e=O.current;e&&(e.getCanvas().style.cursor=``)}}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[N,ze,F,Ve,Y,at,ut,mt,yt,Ct]),(0,c.useEffect)(()=>{let e=O.current;if(!e||!j)return;let t=j.entityId,n=j.config,r=()=>{let r=Kt.current.find(e=>e.id===t);if(!r){Ye();return}let{position:i}=Ie(r,n,e,void 0,Se.current);Se.current&&(Se.current.style.left=`${i.x}px`,Se.current.style.top=`${i.y}px`)},i=setTimeout(()=>{r()},50);return e.on(`move`,r),e.on(`zoom`,r),e.on(`rotate`,r),e.on(`pitch`,r),()=>{clearTimeout(i),e.off(`move`,r),e.off(`zoom`,r),e.off(`rotate`,r),e.off(`pitch`,r)}},[j?.entityId,Ye]),(0,c.useEffect)(()=>{let e=O.current,t=D.current;if(!e||!M||!t)return;let n=M.lngLat,r=()=>{let r=e.project(n),i=t.clientWidth,a=t.clientHeight;if(r.x<0||r.x>i||r.y<0||r.y>a){Gt();return}let o=t.getBoundingClientRect(),s=r.x+o.left,c=r.y+o.top;Oe.current&&(Oe.current.style.left=`${s}px`,Oe.current.style.top=`${c}px`)};return e.on(`move`,r),e.on(`zoom`,r),e.on(`rotate`,r),e.on(`pitch`,r),()=>{e.off(`move`,r),e.off(`zoom`,r),e.off(`rotate`,r),e.off(`pitch`,r)}},[M?.lngLat,Gt]),(0,c.useEffect)(()=>{if(!D.current)return;let e={version:8,sources:{},layers:[]},{dragPan:t=!0,scrollZoom:c=!0,doubleClickZoom:u=!0,touchZoomRotate:d=!0,keyboard:f=!0,dragRotate:p=!0,pitchWithRotate:m=!0,touchPitch:v=!0,boxZoom:y=!0}=h,b=new l.default.Map({container:D.current,style:o||e,center:n,zoom:r,pitch:i,bearing:a,maxBounds:s,dragPan:t,scrollZoom:c,doubleClickZoom:u,touchZoomRotate:d,keyboard:f,dragRotate:p,pitchWithRotate:m,touchPitch:v,boxZoom:y,transformRequest:(e,t)=>{if(t===`Glyphs`){let t=e.match(/\/fonts\/([^/]+)\/(\d+-\d+)\.pbf/);if(t){let e=decodeURIComponent(t[1]),n=t[2],r=e.split(`,`)[0].trim();return{url:`/gis-fonts/${encodeURIComponent(r)}/${n}.pbf`}}}return{url:e}}});return O.current=b,b.on(`load`,()=>{A.current.clear(),_.forEach(e=>{A.current.set(e.id,e)}),zt(g),Mt(),rt(),ot(),ft(),gt(),xt(),Ae(b),te?.(b)}),b.on(`click`,Vt),b.on(`mousemove`,Ht),b.on(`contextmenu`,Ut),()=>{b.off(`click`,Vt),b.off(`mousemove`,Ht),b.off(`contextmenu`,Ut),Nt(),et(),Y(),X(),Z(),b.remove(),O.current=null}},[]),(0,c.useEffect)(()=>{if(O.current){if(!O.current.isStyleLoaded()){O.current.once(`load`,()=>{A.current.clear(),_.forEach(e=>{A.current.set(e.id,e)}),Mt()});return}A.current.clear(),_.forEach(e=>{A.current.set(e.id,e)}),Mt()}},[_,Mt]),(0,c.useEffect)(()=>{!O.current||!O.current.isStyleLoaded()||(Nt(),Mt())},[y,b,Nt,Mt]),(0,c.useEffect)(()=>{if(O.current){if(!O.current.isStyleLoaded()){O.current.once(`load`,()=>{zt(g)});return}zt(g)}},[g,zt]);let en=(0,c.useRef)(void 0),tn=(0,c.useRef)(!0),nn=(0,c.useRef)(g);nn.current=g;let rn=(0,c.useRef)(zt);rn.current=zt;let an=(0,c.useRef)(Nt);an.current=Nt;let on=(0,c.useRef)(Mt);on.current=Mt;let sn=(0,c.useRef)(rt);sn.current=rt;let cn=(0,c.useRef)(ot);cn.current=ot;let ln=(0,c.useRef)(ft);ln.current=ft;let un=(0,c.useRef)(gt);un.current=gt;let dn=(0,c.useRef)(xt);dn.current=xt,(0,c.useEffect)(()=>{let e=O.current;if(!e)return;let t=o||{version:8,sources:{},layers:[]};if(tn.current){tn.current=!1,en.current=o;return}en.current!==o&&(en.current=o,e.setStyle(t),e.once(`style.load`,()=>{he.current.clear(),rn.current(nn.current),an.current(),on.current(),sn.current(),cn.current(),ln.current(),un.current(),dn.current()}))},[o]),(0,c.useEffect)(()=>{let e=new Set(v.map(String));for(let[t,n]of k.current)n.setSelected(e.has(String(t)))},[v]);let fn=(0,c.useRef)({});(0,c.useEffect)(()=>{let e=O.current;if(!e)return;let t=fn.current,o=n&&(t.center?.[0]!==n[0]||t.center?.[1]!==n[1]),s=t.zoom!==r,c=t.pitch!==i,l=t.bearing!==a;if(!o&&!s&&!c&&!l)return;fn.current={center:n,zoom:r,pitch:i,bearing:a};let u=()=>{e.jumpTo({center:n,zoom:r,pitch:i,bearing:a})};e.isStyleLoaded()?u():e.once(`load`,u)},[n,r,i,a]);let pn=(()=>x===!1?null:x===!0?{enabled:!0}:x)(),mn=(()=>S===!1?null:S===!0?{enabled:!0}:S)(),hn=(()=>ee===!1?null:ee===!0?{enabled:!0}:ee)(),$=(()=>{if(C===!1)return null;let e,t;if(g&&g.length>0){let n=g.find(e=>e.hasRoadNetwork===!0)||g[0];e=n.id,t=n.roadNetworkSourceLayer||`road`}return C===!0?{enabled:!0,source:e,sourceLayer:t}:{...C,source:C.source||e,sourceLayer:C.sourceLayer||t}})();return(0,p.jsxs)(`div`,{className:`comp-mapbox ${N===`picker`?`comp-mapbox--picker-mode`:``} ${ie}`,style:oe,children:[(0,p.jsx)(`div`,{ref:D,className:`comp-mapbox__map`}),N===`picker`&&f.showCrosshair===!0&&(0,p.jsxs)(`div`,{className:`comp-mapbox__crosshair`,children:[(0,p.jsx)(`div`,{className:`comp-mapbox__crosshair-h`,style:f.crosshairColor?{backgroundColor:f.crosshairColor}:void 0}),(0,p.jsx)(`div`,{className:`comp-mapbox__crosshair-v`,style:f.crosshairColor?{backgroundColor:f.crosshairColor}:void 0})]}),N===`edit`&&d.showEditTools!==!1&&(d.markerTemplates&&d.markerTemplates.length>0||d.showRectangleTool||d.showCircleTool||d.showPolygonTool||d.showSquareTool||d.showPolylineTool)||$&&$.enabled!==!1?(0,p.jsxs)(`div`,{className:`comp-mapbox__edit-controls`,children:[N===`edit`&&d.showEditTools!==!1&&(d.markerTemplates&&d.markerTemplates.length>0||d.showRectangleTool||d.showCircleTool||d.showPolygonTool||d.showSquareTool||d.showPolylineTool)&&(0,p.jsx)(Ne,{markerTemplates:d.markerTemplates||[],selectedTemplate:ze,onTemplateSelect:wt,drawMode:F,onDrawModeChange:Tt,showRectangleTool:d.showRectangleTool,showCircleTool:d.showCircleTool,showPolygonTool:d.showPolygonTool,showSquareTool:d.showSquareTool,showPolylineTool:d.showPolylineTool}),$&&$.enabled!==!1&&(0,p.jsx)(De,{map:ke,highlightWidth:$.highlightWidth,defaultRoadTypes:$.defaultRoadTypes,defaultMinWidth:$.defaultMinWidth,source:$.source,sourceLayer:$.sourceLayer,className:$.className,style:$.style})]}):null,(pn?.enabled!==!1||mn?.enabled!==!1||hn?.enabled!==!1)&&(0,p.jsxs)(`div`,{className:`comp-mapbox__controls`,children:[pn&&pn.enabled!==!1&&(0,p.jsx)(ve,{map:ke,precision:pn.precision,className:pn.className,style:pn.style}),mn&&mn.enabled!==!1&&(0,p.jsx)(be,{map:ke,maxWidth:mn.maxWidth,unit:mn.unit,className:mn.className,style:mn.style}),hn&&hn.enabled!==!1&&(0,p.jsx)(Ce,{map:ke,initialCenter:n,initialZoom:r,initialPitch:i,initialBearing:a,duration:hn.duration,className:hn.className,style:hn.style})]}),j&&xe.current&&(0,p.jsx)(_e,{popupState:j,onClose:()=>Je(j.entityId),portalContainer:xe.current,popupRef:Se}),M&&Ee.current&&(0,p.jsx)(Pe,{menuState:M,onClose:Gt,portalContainer:Ee.current,menuRef:Oe})]})});I.displayName=`Mapbox`,exports.BaseCanvasRenderer=re,exports.COLOR_SCHEMES=v,exports.CanvasCircleRenderer=pe,exports.CanvasImageRenderer=se,exports.CanvasRadarRenderer=ae,exports.CircleRenderer=fe,exports.ContextMenu=Pe,exports.CoordinateDisplay=ve,exports.DEFAULT_NAME_CONFIG=h,exports.DEFAULT_SELECT_NAME_CONFIG=g,exports.EditControl=Ne,exports.EntityPopup=_e,exports.Mapbox=I,exports.MarkerRenderer=ce,exports.POPUP_DEFAULTS=b,exports.PolygonRenderer=ue,exports.PolylineRenderer=de,exports.RADAR_DEFAULTS=y,exports.ROAD_TYPE_OPTIONS=x,exports.RectangleRenderer=ge,exports.ResetViewControl=Ce,exports.RoadHighlightControl=De,exports.ScaleControl=be,exports.SquareRenderer=me,exports.UnitRenderer=le,exports.bearing=C,exports.calculatePopupPosition=Ie,exports.confidenceToOpacity=E,exports.destinationPoint=S,exports.distance=ee,exports.mergePopupConfig=Fe,exports.resolveNameConfig=_;
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .comp-mapbox{--mapbox-primary-color:#38f;--mapbox-selected-color:#fc0;--mapbox-selected-glow-color:#f60;--mapbox-text-color:#fff;--mapbox-text-secondary-color:#fff9;--mapbox-text-dark-color:#333;--mapbox-danger-color:#e53935;--mapbox-control-bg:#00000080;--mapbox-control-bg-hover:#ffffff1a;--mapbox-control-border-color:#ffffff4d;--mapbox-control-border-color-hover:#ffffff80;--mapbox-control-active-bg:#3388ff4d;--mapbox-control-active-border:#38fc;--mapbox-popup-bg:#fff;--mapbox-popup-shadow:0 4px 12px #00000026;--mapbox-popup-close-bg:#0000000d;--mapbox-popup-close-bg-hover:#0000001a;--mapbox-context-menu-bg:#fff;--mapbox-context-menu-shadow:0 2px 12px #00000026,0 0 1px #0000001a;--mapbox-context-menu-hover-bg:#0000000d;--mapbox-context-menu-danger-hover-bg:#e5393514;--mapbox-trajectory-color:#0f8;--mapbox-marker-label-color:#fff;--mapbox-marker-label-shadow:0 0 2px #000c,0 0 2px #000c;--mapbox-marker-label-selected-shadow:0 0 4px #f60,0 0 4px #f60;--mapbox-road-highlight-active-bg:#f603;--mapbox-road-highlight-active-border:#ff660080;--mapbox-control-radius:4px;--mapbox-control-gap:24px;--mapbox-control-padding-x:16px;--mapbox-control-padding-y:6px;--mapbox-control-btn-padding-x:12px;--mapbox-control-btn-padding-y:4px;--mapbox-font-size:12px;--mapbox-font-size-sm:11px;--mapbox-font-family:Arial,sans-serif;--mapbox-popup-radius:8px;--mapbox-context-menu-radius:6px;--mapbox-picker-marker-size:24px;--mapbox-transition-duration:.2s;--mapbox-control-z-index:10;--mapbox-popup-z-index:1000;--mapbox-context-menu-z-index:1100;width:100%;height:100%;position:relative;overflow:hidden}.comp-mapbox__map{width:100%;height:100%;position:absolute;top:0;left:0}.comp-mapbox__map .mapboxgl-ctrl-logo,.comp-mapbox__map .mapboxgl-ctrl-attrib{display:none!important}.comp-mapbox--picker-mode .mapboxgl-canvas-container.mapboxgl-interactive{cursor:crosshair!important}.comp-mapbox__controls{align-items:center;gap:var(--mapbox-control-gap);background-color:var(--mapbox-control-bg);padding:var(--mapbox-control-padding-y)var(--mapbox-control-padding-x);border-radius:var(--mapbox-control-radius);z-index:var(--mapbox-control-z-index);font-family:monospace;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.comp-mapbox__edit-controls{background-color:var(--mapbox-control-bg);padding:var(--mapbox-control-padding-y)var(--mapbox-control-padding-x);border-radius:var(--mapbox-control-radius);z-index:var(--mapbox-control-z-index);align-items:center;gap:12px;display:flex;position:absolute;bottom:52px;left:50%;transform:translate(-50%)}.comp-mapbox__crosshair{pointer-events:none;z-index:5;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.comp-mapbox__crosshair-h,.comp-mapbox__crosshair-v{background-color:var(--mapbox-primary-color);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.comp-mapbox__crosshair-h{width:20px;height:2px}.comp-mapbox__crosshair-v{width:2px;height:20px}.mapbox-picker-marker .marker-inner{width:var(--mapbox-picker-marker-size);height:var(--mapbox-picker-marker-size);cursor:crosshair;border:2px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 6px #0000004d}.mapbox-marker-container{pointer-events:auto;cursor:pointer;flex-direction:column;align-items:center;display:flex}.mapbox-marker-label{color:var(--mapbox-marker-label-color);text-shadow:var(--mapbox-marker-label-shadow);white-space:nowrap;pointer-events:auto;cursor:pointer;margin-top:4px;font-size:14px;font-weight:700}.mapbox-marker-label--selected{color:var(--mapbox-selected-color);text-shadow:var(--mapbox-marker-label-selected-shadow)}.mapbox-marker-placeholder{opacity:0;white-space:nowrap;pointer-events:none;margin-bottom:4px;font-size:14px;font-weight:700}.mapbox-unit-status{pointer-events:none;margin-bottom:4px;position:absolute;bottom:90%;left:50%;transform:translate(-50%)}.mapbox-control-btn{padding:var(--mapbox-control-btn-padding-y)var(--mapbox-control-btn-padding-x);font-size:var(--mapbox-font-size);font-family:var(--mapbox-font-family);color:var(--mapbox-text-color);border:1px solid var(--mapbox-control-border-color);border-radius:var(--mapbox-control-radius);cursor:pointer;transition:all var(--mapbox-transition-duration);pointer-events:auto;background-color:#0000;flex-shrink:0;justify-content:center;align-items:center;gap:4px;display:flex}.mapbox-control-btn:hover{background-color:var(--mapbox-control-bg-hover);border-color:var(--mapbox-control-border-color-hover)}.mapbox-control-btn--active,.mapbox-control-btn--active:hover{background-color:var(--mapbox-control-active-bg);border-color:var(--mapbox-control-active-border)}.mapbox-control-btn__icon{flex-shrink:0;width:14px;height:14px}.mapbox-control-btn__icon--lg{width:18px;height:18px}.mapbox-control-btn__icon--xl{width:22px;height:22px}.mapboxgl-map{-webkit-tap-highlight-color:#0000;font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;overflow:hidden}.mapboxgl-canvas{position:absolute;top:0;left:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;z-index:2;position:absolute}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top{top:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-right{top:50%;right:0;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{top:50%;left:0;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px buttontext}}.mapboxgl-ctrl-group button{background-color:initial;box-sizing:border-box;cursor:pointer;border:0;outline:none;width:29px;height:29px;padding:0;display:block;overflow:hidden}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;width:100%;height:100%;display:block}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:initial}.mapboxgl-ctrl-group button+button{border-top:1px solid buttontext}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-buildings-toggle .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M3.3335 11.6666C3.3335 12.5871 4.07969 13.3333 5.00016 13.3333C5.92064 13.3333 6.66683 12.5871 6.66683 11.6666L6.66683 6.66659L11.6668 6.66659C12.5873 6.66659 13.3335 5.92039 13.3335 4.99992C13.3335 4.07944 12.5873 3.33325 11.6668 3.33325H3.3335V11.6666Z' fill='currentColor'/%3E%3Cpath d='M26.6668 11.6666C26.6668 12.5871 25.9206 13.3333 25.0002 13.3333C24.0797 13.3333 23.3335 12.5871 23.3335 11.6666L23.3335 6.66659L18.3335 6.66659C17.413 6.66659 16.6668 5.92039 16.6668 4.99992C16.6668 4.07944 17.413 3.33325 18.3335 3.33325H26.6668L26.6668 11.6666Z' fill='currentColor'/%3E%3Cpath d='M13.3335 24.9999C13.3335 25.9204 12.5873 26.6666 11.6668 26.6666H3.3335V18.3333C3.3335 17.4128 4.07969 16.6666 5.00016 16.6666C5.92064 16.6666 6.66683 17.4128 6.66683 18.3333V23.3333H11.6668C12.5873 23.3333 13.3335 24.0794 13.3335 24.9999Z' fill='currentColor'/%3E%3Cpath d='M18.3335 26.6666C17.413 26.6666 16.6668 25.9204 16.6668 24.9999C16.6668 24.0794 17.413 23.3333 18.3335 23.3333H23.3335V18.3333C23.3335 17.4128 24.0797 16.6666 25.0002 16.6666C25.9206 16.6666 26.6668 17.4128 26.6668 18.3333V26.6666H18.3335Z' fill='currentColor'/%3E%3C/svg%3E");background-size:26px 26px}.mapboxgl-ctrl button.mapboxgl-ctrl-buildings-toggle.mapboxgl-ctrl-level-button-selected .mapboxgl-ctrl-icon{filter:invert()brightness()}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:2s linear infinite mapboxgl-spin}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{cursor:pointer;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;width:88px;height:23px;margin:0 0 -4px -4px;display:block;overflow:hidden}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:initial;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{box-sizing:initial;background-color:#fff;border-radius:12px;min-height:20px;margin:10px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{visibility:visible;padding:2px 28px 2px 8px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{box-sizing:border-box;cursor:pointer;background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;outline:none;width:24px;height:24px;display:none;position:absolute;top:0;right:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{margin-left:2px;font-weight:700}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{box-sizing:border-box;color:#333;white-space:nowrap;background-color:#ffffffbf;border:2px solid #333;border-top:#333;padding:0 5px;font-size:10px}.mapboxgl-popup{pointer-events:none;will-change:transform;display:flex;position:absolute;top:0;left:0}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{z-index:1;border:10px solid #0000;width:0;height:0}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;align-self:center}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;border-left:none;align-self:flex-start}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;border-right:none;align-self:flex-end}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;align-self:center}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;border-left:none;align-self:flex-start}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;border-right:none;align-self:flex-end}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{border-left:none;border-right-color:#fff;align-self:center}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{border-left-color:#fff;border-right:none;align-self:center}.mapboxgl-popup-close-button{background-color:initial;cursor:pointer;border:0;border-radius:0 3px 0 0;position:absolute;top:0;right:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{pointer-events:auto;background:#fff;border-radius:3px;padding:10px 10px 15px;position:relative;box-shadow:0 1px 2px #0000001a}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{opacity:1;will-change:transform;transition:opacity .2s;position:absolute;top:0;left:0}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;width:15px;height:15px}.mapboxgl-user-location-dot:before{content:"";animation:2s infinite mapboxgl-user-location-dot-pulse;position:absolute}.mapboxgl-user-location-dot:after{box-sizing:border-box;content:"";border:2px solid #fff;border-radius:50%;width:19px;height:19px;position:absolute;top:-2px;left:-2px;box-shadow:0 0 3px #00000059}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{width:0;height:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{content:"";border-bottom:7.5px solid #4aa1eb;position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid #0000;transform:translateY(-28px)skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid #0000;transform:translate(7.5px,-28px)skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;width:1px;height:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{opacity:.5;background:#fff;border:2px dotted #202020;width:0;height:0;position:absolute;top:0;left:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{color:#fff;opacity:0;pointer-events:none;text-align:center;background:#000000b3;justify-content:center;align-items:center;width:100%;height:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;transition:opacity .75s ease-in-out 1s;display:flex;position:absolute;top:0;left:0}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-ctrl-separator{background-color:#e0e0e0;height:1px}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button{color:#333;width:50px;height:50px;font-size:18px;font-weight:700}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button:first-child{border-top-left-radius:8px;border-top-right-radius:8px}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button:last-child{border-bottom-right-radius:8px;border-bottom-left-radius:8px}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button:hover{background-color:#f5f5f5}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button-selected{color:#fff;background-color:#4a5568}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button-selected:hover{background-color:#2d3748}.entity-popup{background:#fff;border-radius:8px;position:relative;box-shadow:0 4px 12px #00000026}.entity-popup__close{cursor:pointer;color:#666;background:#0000000d;border:none;border-radius:4px;width:24px;height:24px;font-size:20px;line-height:1;transition:all .2s;position:absolute;top:8px;right:8px}.entity-popup__close:hover{color:#333;background:#0000001a}.entity-popup__content{padding:16px}.entity-popup--entering.animation-fade{animation:.2s ease-out forwards popup-fade-in}.entity-popup--entering.animation-scale{animation:.2s cubic-bezier(.34,1.56,.64,1) forwards popup-scale-in}.entity-popup--entering.animation-fade-scale{animation:.25s ease-out forwards popup-fade-scale-in}.entity-popup--exiting.animation-fade{animation:.15s ease-in forwards popup-fade-out}.entity-popup--exiting.animation-scale{animation:.15s ease-in forwards popup-scale-out}.entity-popup--exiting.animation-fade-scale{animation:.2s ease-in forwards popup-fade-scale-out}@keyframes popup-fade-in{0%{opacity:0}to{opacity:1}}@keyframes popup-fade-out{0%{opacity:1}to{opacity:0}}@keyframes popup-scale-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes popup-scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes popup-fade-scale-in{0%{opacity:0;transform:scale(.9)translateY(-5px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes popup-fade-scale-out{0%{opacity:1;transform:scale(1)translateY(0)}to{opacity:0;transform:scale(.95)translateY(-3px)}}.mapbox-coordinate-display{font-size:var(--mapbox-font-size);font-family:var(--mapbox-font-family);color:var(--mapbox-text-color);pointer-events:none;align-items:center;gap:8px;min-width:240px;display:flex}.mapbox-coordinate-display__icon{flex-shrink:0;width:14px;height:14px}.mapbox-coordinate-display__content{gap:16px;display:flex}.mapbox-coordinate-display__item{min-width:110px}.mapbox-scale-control{pointer-events:none;justify-content:space-between;align-items:center;gap:8px;min-width:180px;display:flex}.mapbox-scale-control__bar-wrapper{align-items:center;gap:8px;display:flex}.mapbox-scale-control__icon{flex-shrink:0;width:18px}.mapbox-scale-control__bar{background-color:var(--mapbox-text-color);height:2px;position:relative}.mapbox-scale-control__tick{background-color:var(--mapbox-text-color);width:2px;height:10px;position:absolute;top:-4px}.mapbox-scale-control__tick--left{left:0}.mapbox-scale-control__tick--right{right:0}.mapbox-scale-control__label{font-size:var(--mapbox-font-size);font-family:var(--mapbox-font-family);color:var(--mapbox-text-color);white-space:nowrap;min-width:40px}.mapbox-reset-view-control__icon{width:14px;height:14px}.mapbox-road-highlight-control{pointer-events:auto;flex-direction:column;display:flex;position:relative}.mapbox-road-highlight-control__btn{min-width:100px}.mapbox-road-highlight-control__btn--active,.mapbox-road-highlight-control__btn--active:hover{background-color:var(--mapbox-road-highlight-active-bg);border-color:var(--mapbox-road-highlight-active-border)}.mapbox-road-highlight-control__btn-icon{flex-shrink:0;width:22px}.mapbox-road-highlight-control__panel{border:1px solid var(--mapbox-control-border-color);border-radius:var(--mapbox-control-radius);color:var(--mapbox-text-color);font-size:var(--mapbox-font-size);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:#000000e6;min-width:220px;margin-bottom:8px;padding:12px;position:absolute;bottom:100%;left:0;box-shadow:0 4px 12px #00000080}.mapbox-road-highlight-control__panel-header{border-bottom:1px solid #fff3;justify-content:space-between;align-items:center;margin-bottom:12px;padding-bottom:8px;display:flex}.mapbox-road-highlight-control__panel-title{font-size:13px;font-weight:700}.mapbox-road-highlight-control__scroll{max-height:240px;margin-bottom:12px;padding-right:4px;overflow-y:auto}.mapbox-road-highlight-control__scroll::-webkit-scrollbar{width:6px}.mapbox-road-highlight-control__scroll::-webkit-scrollbar-track{background:#ffffff0d;border-radius:3px}.mapbox-road-highlight-control__scroll::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}.mapbox-road-highlight-control__scroll::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.mapbox-road-highlight-control__type-list{flex-direction:column;gap:4px;display:flex}.mapbox-road-highlight-control__type-item{transition:background-color var(--mapbox-transition-duration);cursor:pointer;border-radius:3px;align-items:center;gap:8px;min-height:28px;padding:6px 8px;display:flex}.mapbox-road-highlight-control__type-item:hover{background-color:var(--mapbox-control-bg-hover)}.mapbox-road-highlight-control__color-indicator{vertical-align:middle;border-radius:2px;flex-shrink:0;width:14px;height:14px;display:inline-block;box-shadow:0 0 0 1px #fff3}.mapbox-road-highlight-control__type-label{font-size:var(--mapbox-font-size);color:var(--mapbox-text-color);vertical-align:middle}.mapbox-road-highlight-control__tip{font-size:var(--mapbox-font-size-sm);color:#64b5f6;background-color:#2196f326;border-radius:3px;padding:8px;line-height:1.4}.mapbox-road-highlight-control__warning{font-size:var(--mapbox-font-size-sm);color:#ffc107;background-color:#ffc10733;border-radius:3px;margin-top:8px;padding:6px}.mapbox-road-highlight-control .arco-checkbox{padding:0;line-height:1}.mapbox-road-highlight-control .arco-checkbox-icon{width:14px;height:14px}.road-highlight-popup .mapboxgl-popup-content{background:#fffffff2;border-radius:6px;padding:10px 12px;box-shadow:0 2px 10px #0003}.road-highlight-popup .mapboxgl-popup-tip{border-top-color:#fffffff2}.road-highlight-popup__content{min-width:160px;font-size:12px;line-height:1.6}.road-highlight-popup__title{color:#333;border-bottom:1px solid #eee;margin-bottom:8px;padding-bottom:6px;font-size:13px;font-weight:700}.road-highlight-popup__info{color:#666}.road-highlight-popup__row{justify-content:space-between;margin-bottom:4px;display:flex}.road-highlight-popup__value{color:#333}.mapbox-edit-control{position:relative}.mapbox-edit-control .mapbox-edit-control__btn-group{-moz-column-gap:12px;align-items:center;column-gap:12px;display:flex}.mapbox-edit-control__btn-icon{-o-object-fit:contain;object-fit:contain;width:14px;height:14px}.mapbox-edit-control__btn-icon--lg{width:18px;height:18px}.mapbox-edit-control__panel{border-radius:var(--mapbox-context-menu-radius);z-index:100;background-color:#000000d9;min-width:160px;position:absolute;bottom:calc(100% + 8px);left:50%;overflow:hidden;transform:translate(-50%);box-shadow:0 4px 12px #0000004d}.mapbox-edit-control__panel-header{font-size:var(--mapbox-font-size-sm);color:var(--mapbox-text-secondary-color);border-bottom:1px solid #ffffff1a;padding:8px 12px}.mapbox-edit-control__template-list{padding:8px}.mapbox-edit-control__template-item{border-radius:var(--mapbox-control-radius);cursor:pointer;background-color:#0000;border:1px solid #0000;align-items:center;gap:8px;padding:6px 8px;transition:all .15s;display:flex}.mapbox-edit-control__template-item:hover{background-color:var(--mapbox-control-bg-hover)}.mapbox-edit-control__template-item--selected{background-color:var(--mapbox-control-active-bg);border-color:#3388ff80}.mapbox-edit-control__template-item--selected:hover{background-color:var(--mapbox-control-active-bg)}.mapbox-edit-control__template-icon{-o-object-fit:contain;object-fit:contain;width:24px;height:24px}.mapbox-edit-control__template-name{font-size:var(--mapbox-font-size);color:var(--mapbox-text-color)}.context-menu{z-index:10000;background:#fff;border-radius:6px;min-width:120px;padding:4px 0;animation:.15s ease-out context-menu-fade-in;box-shadow:0 2px 12px #00000026,0 0 1px #0000001a}.context-menu__item{cursor:pointer;color:#333;align-items:center;padding:8px 12px;font-size:14px;transition:background-color .15s;display:flex}.context-menu__item:hover{background-color:#0000000d}.context-menu__item--danger{color:#e53935}.context-menu__item--danger:hover{background-color:#e5393514}.context-menu__item-icon{align-items:center;margin-right:8px;font-size:16px;display:flex}.context-menu__item-label{flex:1}@keyframes context-menu-fade-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
1
+ .comp-mapbox{--mapbox-primary-color:#38f;--mapbox-selected-color:#fc0;--mapbox-selected-glow-color:#f60;--mapbox-text-color:#fff;--mapbox-text-secondary-color:#fff9;--mapbox-text-dark-color:#333;--mapbox-danger-color:#e53935;--mapbox-control-bg:#00000080;--mapbox-control-bg-hover:#ffffff1a;--mapbox-control-border-color:#ffffff4d;--mapbox-control-border-color-hover:#ffffff80;--mapbox-control-active-bg:#3388ff4d;--mapbox-control-active-border:#38fc;--mapbox-popup-bg:#fff;--mapbox-popup-shadow:0 4px 12px #00000026;--mapbox-popup-close-bg:#0000000d;--mapbox-popup-close-bg-hover:#0000001a;--mapbox-context-menu-bg:#fff;--mapbox-context-menu-shadow:0 2px 12px #00000026,0 0 1px #0000001a;--mapbox-context-menu-hover-bg:#0000000d;--mapbox-context-menu-danger-hover-bg:#e5393514;--mapbox-trajectory-color:#0f8;--mapbox-marker-label-color:#fff;--mapbox-marker-label-shadow:0 0 2px #000c,0 0 2px #000c,0 0 1px #000c,0 0 1px #000c;--mapbox-marker-label-selected-shadow:0 0 4px #f60,0 0 4px #f60,0 0 2px #f60,0 0 2px #f60;--mapbox-road-highlight-active-bg:#f603;--mapbox-road-highlight-active-border:#ff660080;--mapbox-control-radius:4px;--mapbox-control-gap:24px;--mapbox-control-padding-x:16px;--mapbox-control-padding-y:6px;--mapbox-control-btn-padding-x:12px;--mapbox-control-btn-padding-y:4px;--mapbox-font-size:12px;--mapbox-font-size-sm:11px;--mapbox-font-family:Arial,sans-serif;--mapbox-popup-radius:8px;--mapbox-context-menu-radius:6px;--mapbox-picker-marker-size:24px;--mapbox-transition-duration:.2s;--mapbox-control-z-index:10;--mapbox-popup-z-index:1000;--mapbox-context-menu-z-index:1100;width:100%;height:100%;position:relative;overflow:hidden}.comp-mapbox__map{width:100%;height:100%;position:absolute;top:0;left:0}.comp-mapbox__map .mapboxgl-ctrl-logo,.comp-mapbox__map .mapboxgl-ctrl-attrib{display:none!important}.comp-mapbox--picker-mode .mapboxgl-canvas-container.mapboxgl-interactive{cursor:crosshair!important}.comp-mapbox__controls{align-items:center;gap:var(--mapbox-control-gap);background-color:var(--mapbox-control-bg);padding:var(--mapbox-control-padding-y)var(--mapbox-control-padding-x);border-radius:var(--mapbox-control-radius);z-index:var(--mapbox-control-z-index);font-family:monospace;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.comp-mapbox__edit-controls{background-color:var(--mapbox-control-bg);padding:var(--mapbox-control-padding-y)var(--mapbox-control-padding-x);border-radius:var(--mapbox-control-radius);z-index:var(--mapbox-control-z-index);align-items:center;gap:12px;display:flex;position:absolute;bottom:52px;left:50%;transform:translate(-50%)}.comp-mapbox__crosshair{pointer-events:none;z-index:5;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.comp-mapbox__crosshair-h,.comp-mapbox__crosshair-v{background-color:var(--mapbox-primary-color);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.comp-mapbox__crosshair-h{width:20px;height:2px}.comp-mapbox__crosshair-v{width:2px;height:20px}.mapbox-picker-marker .marker-inner{width:var(--mapbox-picker-marker-size);height:var(--mapbox-picker-marker-size);cursor:crosshair;border:2px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 6px #0000004d}.mapbox-marker-container{pointer-events:auto;cursor:pointer;flex-direction:column;align-items:center;display:flex}.mapbox-marker-label{color:var(--mapbox-marker-label-color);text-shadow:none;-webkit-text-stroke:1.5px #000c;paint-order:stroke fill;white-space:nowrap;pointer-events:auto;cursor:pointer;margin-top:4px;font-size:14px;font-weight:700}.mapbox-marker-label--selected{color:var(--mapbox-selected-color);-webkit-text-stroke:3px #f60}.mapbox-marker-placeholder{opacity:0;white-space:nowrap;pointer-events:none;margin-bottom:4px;font-size:14px;font-weight:700}.mapbox-unit-status{pointer-events:none;margin-bottom:4px;position:absolute;bottom:90%;left:50%;transform:translate(-50%)}.mapbox-control-btn{padding:var(--mapbox-control-btn-padding-y)var(--mapbox-control-btn-padding-x);font-size:var(--mapbox-font-size);font-family:var(--mapbox-font-family);color:var(--mapbox-text-color);border:1px solid var(--mapbox-control-border-color);border-radius:var(--mapbox-control-radius);cursor:pointer;transition:all var(--mapbox-transition-duration);pointer-events:auto;background-color:#0000;flex-shrink:0;justify-content:center;align-items:center;gap:4px;display:flex}.mapbox-control-btn:hover{background-color:var(--mapbox-control-bg-hover);border-color:var(--mapbox-control-border-color-hover)}.mapbox-control-btn--active,.mapbox-control-btn--active:hover{background-color:var(--mapbox-control-active-bg);border-color:var(--mapbox-control-active-border)}.mapbox-control-btn__icon{flex-shrink:0;width:14px;height:14px}.mapbox-control-btn__icon--lg{width:18px;height:18px}.mapbox-control-btn__icon--xl{width:22px;height:22px}.mapboxgl-map{-webkit-tap-highlight-color:#0000;font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;overflow:hidden}.mapboxgl-canvas{position:absolute;top:0;left:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;z-index:2;position:absolute}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top{top:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-right{top:50%;right:0;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{top:50%;left:0;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px buttontext}}.mapboxgl-ctrl-group button{background-color:initial;box-sizing:border-box;cursor:pointer;border:0;outline:none;width:29px;height:29px;padding:0;display:block;overflow:hidden}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;width:100%;height:100%;display:block}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:initial}.mapboxgl-ctrl-group button+button{border-top:1px solid buttontext}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-buildings-toggle .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M3.3335 11.6666C3.3335 12.5871 4.07969 13.3333 5.00016 13.3333C5.92064 13.3333 6.66683 12.5871 6.66683 11.6666L6.66683 6.66659L11.6668 6.66659C12.5873 6.66659 13.3335 5.92039 13.3335 4.99992C13.3335 4.07944 12.5873 3.33325 11.6668 3.33325H3.3335V11.6666Z' fill='currentColor'/%3E%3Cpath d='M26.6668 11.6666C26.6668 12.5871 25.9206 13.3333 25.0002 13.3333C24.0797 13.3333 23.3335 12.5871 23.3335 11.6666L23.3335 6.66659L18.3335 6.66659C17.413 6.66659 16.6668 5.92039 16.6668 4.99992C16.6668 4.07944 17.413 3.33325 18.3335 3.33325H26.6668L26.6668 11.6666Z' fill='currentColor'/%3E%3Cpath d='M13.3335 24.9999C13.3335 25.9204 12.5873 26.6666 11.6668 26.6666H3.3335V18.3333C3.3335 17.4128 4.07969 16.6666 5.00016 16.6666C5.92064 16.6666 6.66683 17.4128 6.66683 18.3333V23.3333H11.6668C12.5873 23.3333 13.3335 24.0794 13.3335 24.9999Z' fill='currentColor'/%3E%3Cpath d='M18.3335 26.6666C17.413 26.6666 16.6668 25.9204 16.6668 24.9999C16.6668 24.0794 17.413 23.3333 18.3335 23.3333H23.3335V18.3333C23.3335 17.4128 24.0797 16.6666 25.0002 16.6666C25.9206 16.6666 26.6668 17.4128 26.6668 18.3333V26.6666H18.3335Z' fill='currentColor'/%3E%3C/svg%3E");background-size:26px 26px}.mapboxgl-ctrl button.mapboxgl-ctrl-buildings-toggle.mapboxgl-ctrl-level-button-selected .mapboxgl-ctrl-icon{filter:invert()brightness()}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:2s linear infinite mapboxgl-spin}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{cursor:pointer;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;width:88px;height:23px;margin:0 0 -4px -4px;display:block;overflow:hidden}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:initial;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{box-sizing:initial;background-color:#fff;border-radius:12px;min-height:20px;margin:10px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{visibility:visible;padding:2px 28px 2px 8px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{box-sizing:border-box;cursor:pointer;background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;outline:none;width:24px;height:24px;display:none;position:absolute;top:0;right:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{margin-left:2px;font-weight:700}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{box-sizing:border-box;color:#333;white-space:nowrap;background-color:#ffffffbf;border:2px solid #333;border-top:#333;padding:0 5px;font-size:10px}.mapboxgl-popup{pointer-events:none;will-change:transform;display:flex;position:absolute;top:0;left:0}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{z-index:1;border:10px solid #0000;width:0;height:0}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;align-self:center}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;border-left:none;align-self:flex-start}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{border-top:none;border-bottom-color:#fff;border-right:none;align-self:flex-end}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;align-self:center}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;border-left:none;align-self:flex-start}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{border-top-color:#fff;border-bottom:none;border-right:none;align-self:flex-end}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{border-left:none;border-right-color:#fff;align-self:center}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{border-left-color:#fff;border-right:none;align-self:center}.mapboxgl-popup-close-button{background-color:initial;cursor:pointer;border:0;border-radius:0 3px 0 0;position:absolute;top:0;right:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{pointer-events:auto;background:#fff;border-radius:3px;padding:10px 10px 15px;position:relative;box-shadow:0 1px 2px #0000001a}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{opacity:1;will-change:transform;transition:opacity .2s;position:absolute;top:0;left:0}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;width:15px;height:15px}.mapboxgl-user-location-dot:before{content:"";animation:2s infinite mapboxgl-user-location-dot-pulse;position:absolute}.mapboxgl-user-location-dot:after{box-sizing:border-box;content:"";border:2px solid #fff;border-radius:50%;width:19px;height:19px;position:absolute;top:-2px;left:-2px;box-shadow:0 0 3px #00000059}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{width:0;height:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{content:"";border-bottom:7.5px solid #4aa1eb;position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid #0000;transform:translateY(-28px)skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid #0000;transform:translate(7.5px,-28px)skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;width:1px;height:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{opacity:.5;background:#fff;border:2px dotted #202020;width:0;height:0;position:absolute;top:0;left:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{color:#fff;opacity:0;pointer-events:none;text-align:center;background:#000000b3;justify-content:center;align-items:center;width:100%;height:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;transition:opacity .75s ease-in-out 1s;display:flex;position:absolute;top:0;left:0}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-ctrl-separator{background-color:#e0e0e0;height:1px}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button{color:#333;width:50px;height:50px;font-size:18px;font-weight:700}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button:first-child{border-top-left-radius:8px;border-top-right-radius:8px}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button:last-child{border-bottom-right-radius:8px;border-bottom-left-radius:8px}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button:hover{background-color:#f5f5f5}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button-selected{color:#fff;background-color:#4a5568}.mapboxgl-ctrl button.mapboxgl-ctrl-level-button-selected:hover{background-color:#2d3748}.entity-popup{background:#fff;border-radius:8px;position:relative;box-shadow:0 4px 12px #00000026}.entity-popup__close{cursor:pointer;color:#666;background:#0000000d;border:none;border-radius:4px;width:24px;height:24px;font-size:20px;line-height:1;transition:all .2s;position:absolute;top:8px;right:8px}.entity-popup__close:hover{color:#333;background:#0000001a}.entity-popup__content{padding:16px}.entity-popup--entering.animation-fade{animation:.2s ease-out forwards popup-fade-in}.entity-popup--entering.animation-scale{animation:.2s cubic-bezier(.34,1.56,.64,1) forwards popup-scale-in}.entity-popup--entering.animation-fade-scale{animation:.25s ease-out forwards popup-fade-scale-in}.entity-popup--exiting.animation-fade{animation:.15s ease-in forwards popup-fade-out}.entity-popup--exiting.animation-scale{animation:.15s ease-in forwards popup-scale-out}.entity-popup--exiting.animation-fade-scale{animation:.2s ease-in forwards popup-fade-scale-out}@keyframes popup-fade-in{0%{opacity:0}to{opacity:1}}@keyframes popup-fade-out{0%{opacity:1}to{opacity:0}}@keyframes popup-scale-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes popup-scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes popup-fade-scale-in{0%{opacity:0;transform:scale(.9)translateY(-5px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes popup-fade-scale-out{0%{opacity:1;transform:scale(1)translateY(0)}to{opacity:0;transform:scale(.95)translateY(-3px)}}.mapbox-coordinate-display{font-size:var(--mapbox-font-size);font-family:var(--mapbox-font-family);color:var(--mapbox-text-color);pointer-events:none;align-items:center;gap:8px;min-width:240px;display:flex}.mapbox-coordinate-display__icon{flex-shrink:0;width:14px;height:14px}.mapbox-coordinate-display__content{gap:16px;display:flex}.mapbox-coordinate-display__item{min-width:110px}.mapbox-scale-control{pointer-events:none;justify-content:space-between;align-items:center;gap:8px;min-width:180px;display:flex}.mapbox-scale-control__bar-wrapper{align-items:center;gap:8px;display:flex}.mapbox-scale-control__icon{flex-shrink:0;width:18px}.mapbox-scale-control__bar{background-color:var(--mapbox-text-color);height:2px;position:relative}.mapbox-scale-control__tick{background-color:var(--mapbox-text-color);width:2px;height:10px;position:absolute;top:-4px}.mapbox-scale-control__tick--left{left:0}.mapbox-scale-control__tick--right{right:0}.mapbox-scale-control__label{font-size:var(--mapbox-font-size);font-family:var(--mapbox-font-family);color:var(--mapbox-text-color);white-space:nowrap;min-width:40px}.mapbox-reset-view-control__icon{width:14px;height:14px}.mapbox-road-highlight-control{pointer-events:auto;flex-direction:column;display:flex;position:relative}.mapbox-road-highlight-control__btn{min-width:100px}.mapbox-road-highlight-control__btn--active,.mapbox-road-highlight-control__btn--active:hover{background-color:var(--mapbox-road-highlight-active-bg);border-color:var(--mapbox-road-highlight-active-border)}.mapbox-road-highlight-control__btn-icon{flex-shrink:0;width:22px}.mapbox-road-highlight-control__panel{border:1px solid var(--mapbox-control-border-color);border-radius:var(--mapbox-control-radius);color:var(--mapbox-text-color);font-size:var(--mapbox-font-size);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:#000000e6;min-width:220px;margin-bottom:8px;padding:12px;position:absolute;bottom:100%;left:0;box-shadow:0 4px 12px #00000080}.mapbox-road-highlight-control__panel-header{border-bottom:1px solid #fff3;justify-content:space-between;align-items:center;margin-bottom:12px;padding-bottom:8px;display:flex}.mapbox-road-highlight-control__panel-title{font-size:13px;font-weight:700}.mapbox-road-highlight-control__scroll{max-height:240px;margin-bottom:12px;padding-right:4px;overflow-y:auto}.mapbox-road-highlight-control__scroll::-webkit-scrollbar{width:6px}.mapbox-road-highlight-control__scroll::-webkit-scrollbar-track{background:#ffffff0d;border-radius:3px}.mapbox-road-highlight-control__scroll::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}.mapbox-road-highlight-control__scroll::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.mapbox-road-highlight-control__type-list{flex-direction:column;gap:4px;display:flex}.mapbox-road-highlight-control__type-item{transition:background-color var(--mapbox-transition-duration);cursor:pointer;border-radius:3px;align-items:center;gap:8px;min-height:28px;padding:6px 8px;display:flex}.mapbox-road-highlight-control__type-item:hover{background-color:var(--mapbox-control-bg-hover)}.mapbox-road-highlight-control__color-indicator{vertical-align:middle;border-radius:2px;flex-shrink:0;width:14px;height:14px;display:inline-block;box-shadow:0 0 0 1px #fff3}.mapbox-road-highlight-control__type-label{font-size:var(--mapbox-font-size);color:var(--mapbox-text-color);vertical-align:middle}.mapbox-road-highlight-control__tip{font-size:var(--mapbox-font-size-sm);color:#64b5f6;background-color:#2196f326;border-radius:3px;padding:8px;line-height:1.4}.mapbox-road-highlight-control__warning{font-size:var(--mapbox-font-size-sm);color:#ffc107;background-color:#ffc10733;border-radius:3px;margin-top:8px;padding:6px}.mapbox-road-highlight-control .arco-checkbox{padding:0;line-height:1}.mapbox-road-highlight-control .arco-checkbox-icon{width:14px;height:14px}.road-highlight-popup .mapboxgl-popup-content{background:#fffffff2;border-radius:6px;padding:10px 12px;box-shadow:0 2px 10px #0003}.road-highlight-popup .mapboxgl-popup-tip{border-top-color:#fffffff2}.road-highlight-popup__content{min-width:160px;font-size:12px;line-height:1.6}.road-highlight-popup__title{color:#333;border-bottom:1px solid #eee;margin-bottom:8px;padding-bottom:6px;font-size:13px;font-weight:700}.road-highlight-popup__info{color:#666}.road-highlight-popup__row{justify-content:space-between;margin-bottom:4px;display:flex}.road-highlight-popup__value{color:#333}.mapbox-edit-control{position:relative}.mapbox-edit-control .mapbox-edit-control__btn-group{-moz-column-gap:12px;align-items:center;column-gap:12px;display:flex}.mapbox-edit-control__btn-icon{-o-object-fit:contain;object-fit:contain;width:14px;height:14px}.mapbox-edit-control__btn-icon--lg{width:18px;height:18px}.mapbox-edit-control__panel{border-radius:var(--mapbox-context-menu-radius);z-index:100;background-color:#000000d9;min-width:160px;position:absolute;bottom:calc(100% + 8px);left:50%;overflow:hidden;transform:translate(-50%);box-shadow:0 4px 12px #0000004d}.mapbox-edit-control__panel-header{font-size:var(--mapbox-font-size-sm);color:var(--mapbox-text-secondary-color);border-bottom:1px solid #ffffff1a;padding:8px 12px}.mapbox-edit-control__template-list{padding:8px}.mapbox-edit-control__template-item{border-radius:var(--mapbox-control-radius);cursor:pointer;background-color:#0000;border:1px solid #0000;align-items:center;gap:8px;padding:6px 8px;transition:all .15s;display:flex}.mapbox-edit-control__template-item:hover{background-color:var(--mapbox-control-bg-hover)}.mapbox-edit-control__template-item--selected{background-color:var(--mapbox-control-active-bg);border-color:#3388ff80}.mapbox-edit-control__template-item--selected:hover{background-color:var(--mapbox-control-active-bg)}.mapbox-edit-control__template-icon{-o-object-fit:contain;object-fit:contain;width:24px;height:24px}.mapbox-edit-control__template-name{font-size:var(--mapbox-font-size);color:var(--mapbox-text-color)}.context-menu{z-index:10000;background:#fff;border-radius:6px;min-width:120px;padding:4px 0;animation:.15s ease-out context-menu-fade-in;box-shadow:0 2px 12px #00000026,0 0 1px #0000001a}.context-menu__item{cursor:pointer;color:#333;align-items:center;padding:8px 12px;font-size:14px;transition:background-color .15s;display:flex}.context-menu__item:hover{background-color:#0000000d}.context-menu__item--danger{color:#e53935}.context-menu__item--danger:hover{background-color:#e5393514}.context-menu__item-icon{align-items:center;margin-right:8px;font-size:16px;display:flex}.context-menu__item-label{flex:1}@keyframes context-menu-fade-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
2
2
  /*$vite$:1*/
package/dist/index.mjs CHANGED
@@ -529,7 +529,9 @@ var CanvasImageRenderer = class extends BaseCanvasRenderer {
529
529
  updateLabelStyle() {
530
530
  if (!this.labelElement) return;
531
531
  let { confidence: e } = this.entity, t = confidenceToOpacity(e), n = this.isSelected ? this.selectNameStyle : this.nameStyle;
532
- this.labelElement.className = this.isSelected ? "mapbox-marker-label mapbox-marker-label--selected" : "mapbox-marker-label", this.labelElement.style.opacity = `${t}`, this.labelElement.style.color = n.fillColor, this.labelElement.style.textShadow = `0 0 ${n.strokeWidth}px ${n.strokeColor}, 0 0 ${n.strokeWidth}px ${n.strokeColor}`;
532
+ this.labelElement.className = this.isSelected ? "mapbox-marker-label mapbox-marker-label--selected" : "mapbox-marker-label", this.labelElement.style.opacity = `${t}`, this.labelElement.style.color = n.fillColor;
533
+ let r = n.strokeWidth, i = n.strokeColor;
534
+ this.labelElement.style.webkitTextStroke = `${r * 1.5}px ${i}`, this.labelElement.style.paintOrder = "stroke fill", this.labelElement.style.textShadow = "none";
533
535
  }
534
536
  getEntityId() {
535
537
  return this.entity.id;
@@ -3293,7 +3295,7 @@ const Mapbox = forwardRef((e, s) => {
3293
3295
  ct(), Ke(null);
3294
3296
  }, [ct]);
3295
3297
  useEffect(() => {
3296
- if (!E.current || A !== "picker") return;
3298
+ if (!He || A !== "picker") return;
3297
3299
  let e = v.value;
3298
3300
  if (e) {
3299
3301
  let t = [e.lng, e.lat];
@@ -3302,7 +3304,8 @@ const Mapbox = forwardRef((e, s) => {
3302
3304
  }, [
3303
3305
  v.value,
3304
3306
  A,
3305
- st
3307
+ st,
3308
+ He
3306
3309
  ]);
3307
3310
  let Ft = (e) => "mode" in e, It = useCallback((e) => {
3308
3311
  if (We("edit"), ct(), Ke(null), P.current = !0, Ft(e)) {
@@ -3404,7 +3407,12 @@ const Mapbox = forwardRef((e, s) => {
3404
3407
  t.type === "radar" ? n = new CanvasRadarRenderer(e, t, C, w) : t.type === "image" ? n = new CanvasImageRenderer(e, t, C, w) : t.type === "marker" ? n = new MarkerRenderer(e, t, C, w) : t.type === "unit" ? n = new UnitRenderer(e, t, C, w) : t.type === "polygon" ? n = new PolygonRenderer(e, t, C, w) : t.type === "circle" ? n = t.fillType === "radial-gradient" ? new CanvasCircleRenderer(e, t, C, w) : new CircleRenderer(e, t, C, w) : t.type === "square" ? n = new SquareRenderer(e, t, C, w) : t.type === "rectangle" ? n = new RectangleRenderer(e, t, C, w) : t.type === "polyline" && (n = new PolylineRenderer(e, t, C, w)), n && (D.current.set(t.id, n), n.setSelected(r.has(String(t.id))));
3405
3408
  }
3406
3409
  }
3407
- }, [x, S]), Rt = useCallback(() => {
3410
+ }, [
3411
+ x,
3412
+ S,
3413
+ C,
3414
+ w
3415
+ ]), Rt = useCallback(() => {
3408
3416
  for (let e of D.current.values()) e.destroy();
3409
3417
  D.current.clear();
3410
3418
  }, []), zt = useCallback((e) => {
@@ -4083,6 +4091,13 @@ const Mapbox = forwardRef((e, s) => {
4083
4091
  }), Lt();
4084
4092
  }
4085
4093
  }, [x, Lt]), useEffect(() => {
4094
+ !E.current || !E.current.isStyleLoaded() || (Rt(), Lt());
4095
+ }, [
4096
+ C,
4097
+ w,
4098
+ Rt,
4099
+ Lt
4100
+ ]), useEffect(() => {
4086
4101
  if (E.current) {
4087
4102
  if (!E.current.isStyleLoaded()) {
4088
4103
  E.current.once("load", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bbl-mapbox-react",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "React Mapbox 地图组件库,支持雷达、图像、标记、轨迹等多种 GIS 实体渲染",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",