@x-humanoid-cloud/bic-map 0.0.4 → 0.0.6

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.
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("maplibre-gl"),require("@turf/turf"),require("three")):"function"==typeof define&&define.amd?define(["maplibre-gl","@turf/turf","three"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).BicMapPlugin=e(t.maplibregl,t.turf,t.THREE)}(this,(function(t,e,o){"use strict";function r(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const o in t)if("default"!==o){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,r.get?r:{enumerable:!0,get:()=>t[o]})}return e.default=t,Object.freeze(e)}const n=r(e),i=r(o),a=6378137,s=5e3,l=39.9042,c=116.4074,u=.01,d=0,h=1,p=(t,e,o,r)=>{const n=(o-t)*Math.PI/180,i=(r-e)*Math.PI/180,s=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t*Math.PI/180)*Math.cos(o*Math.PI/180)*Math.sin(i/2)*Math.sin(i/2),l=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return a*l},g={getDistance:p,validateDistance:(t,e,o,r)=>{const n=p(t,e,o,r);if(n>s)throw new Error(`距离 ${n}米 超过最大允许距离 5000米`)},getMapCorners:t=>{const{startX:e,startY:o,xGridCount:r,yGridCount:n,resolution:i}=t;return{bottomLeft:{x:e,y:o},bottomRight:{x:e+r*i,y:o},topLeft:{x:e,y:o+n*i},topRight:{x:e+r*i,y:o+n*i}}},cartesianToGPS:t=>{const{x:e,y:o,originLatitude:r=l,originLongitude:n=c,scale:i=u,bearing:s=d,zoomFactor:g=h}=t,f=i*g,m=e*f,y=o*f,b=(y*Math.cos(s)-m*Math.sin(s))/a,v=(m*Math.cos(s)+y*Math.sin(s))/(a*Math.cos(r*Math.PI/180)),w=r+180*b/Math.PI,_=n+180*v/Math.PI;try{p(r,n,w,_)}catch(x){}return{latitude:Number(w.toFixed(12)),longitude:Number(_.toFixed(12))}},GPSToCartesian:t=>{const{latitude:e,longitude:o,originLatitude:r=l,originLongitude:n=c,scale:i=u,bearing:s=d,zoomFactor:g=h}=t;try{p(r,n,e,o)}catch(x){}const f=(e-r)*Math.PI/180,m=(o-n)*Math.PI/180,y=f*a,b=m*a*Math.cos(r*Math.PI/180),v=i*g,w=(b*Math.cos(-s)-y*Math.sin(-s))/v,_=(b*Math.sin(-s)+y*Math.cos(-s))/v;return{x:Number(w.toFixed(6)),y:Number(_.toFixed(6))}}},f=t=>t.startsWith("file://")||t.startsWith("/android_asset/")||t.startsWith("/var/")||t.startsWith("cdvfile://")||"undefined"!=typeof window&&window.cordova&&!t.startsWith("http"),m=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,y=t=>{const e=t.startsWith("http")||t.startsWith("//")?t:new URL(t,window.location.href).href;return new Promise(((t,o)=>{const r=new Image;if(f(e)){let n=e;if(m()&&e.startsWith("file://")){const t=(t=>{if(!m()||!t.startsWith("file://"))return t;const e=t.match(/file:\/\/.*?\/www\/(.+)$/);if(e)return e[1];return t})(e);t!==e&&(n=t)}r.onload=function(){t(r)},r.onerror=function(i){if(m()&&n!==e)return r.onload=function(){t(r)},r.onerror=function(t){o(new Error("本地图片加载失败"))},void(r.src=e);o(new Error("本地图片加载失败"))},r.src=n}else((t,e={})=>f(t)?Promise.reject(new Error("本地文件不应使用fetch方法,请使用直接加载方式")):fetch(t,e))(e,{method:"GET",mode:"cors",credentials:"omit",headers:{Accept:"image/*"},cache:"no-cache"}).then((t=>{if(!t.ok)throw new Error(`服务器响应错误: ${t.status} ${t.statusText}`);return t.blob()})).then((e=>{const n=URL.createObjectURL(e);r.onload=function(){URL.revokeObjectURL(n),t(r)},r.onerror=function(t){URL.revokeObjectURL(n),o(new Error("网络图片元素加载失败"))},r.src=n})).catch((n=>{r.crossOrigin="anonymous",r.onload=function(){t(r)},r.onerror=function(t){o(new Error("所有图片加载方法均失败"))};const i=(new Date).getTime(),a=e.includes("?")?`${e}&t=${i}`:`${e}?t=${i}`;r.src=a}))}))},b=t=>{const e=t.startsWith("http")||t.startsWith("//")?t:new URL(t,window.location.href).href;return new Promise(((t,o)=>{const r=document.querySelectorAll("script");for(const i of r)if(i.src===e)return void t();const n=document.createElement("script");n.src=e,n.async=!0,n.onload=()=>{t()},n.onerror=t=>{o(new Error(`加载脚本失败: ${e}`))},document.head.appendChild(n)}))},v=t=>{const e=t.startsWith("http")||t.startsWith("//")?t:new URL(t,window.location.href).href;return new Promise(((t,o)=>{const r=document.querySelectorAll('link[rel="stylesheet"]');for(const i of r)if(i.href===e)return void t();const n=document.createElement("link");n.rel="stylesheet",n.href=e,n.onload=()=>{t()},n.onerror=t=>{o(new Error(`加载CSS失败: ${e}`))},document.head.appendChild(n)}))},w=async({scripts:t=[],stylesheets:e=[]})=>{const o=Array.isArray(t)?(t=>Promise.all(t.map((t=>b(t)))))(t):t?[b(t)]:[],r=Array.isArray(e)?(t=>Promise.all(t.map((t=>v(t)))))(e):e?[v(e)]:[];return Promise.all([...o,...r])};const _="canvas-map-layer",x="rectangle-layer",C="rectangle-outline-layer",E="polygon-layer",I="polygon-outline-layer",L="rectangle-draw-fill-layer",S="rectangle-draw-line-layer",M="polygon-draw-fill-layer",P="polygon-draw-line-layer",k="polygon-draw-points-layer",R="polyline-draw-fill-layer",D="polyline-draw-line-layer",T="polyline-draw-points-layer",A=[_,x,C,E,I,"batch-poi-layer","robot-markers-layer",L,S,"circle-draw-fill-layer","circle-draw-line-layer",M,P,k,R,D,T,"point-cloud-layer"];function z(t,e){if(!t||!e||!e.id)throw new Error("Invalid map or layer configuration");const o=t.getStyle().layers||[],r=A.indexOf(e.id);if(-1===r)return t.addLayer(e);let n=null;for(let i=r+1;i<A.length;i++){const t=A[i];if(o.find((e=>e.id===t))){n=t;break}}return t.addLayer(e,n)}function O(e,o=[],r={}){if(!t||!e)throw new Error("地图未初始化。");const{svgPath:n="/bicMap/assets/img/robo.png",size:i=30,onClick:a=null,GPSToCartesian:s=null}=r;let l=void 0===r.showLabels||r.showLabels;const c="robot-icon",u="robot-markers-source",d="robot-markers-layer";let h={type:"FeatureCollection",features:[]},p=[];const g=t=>t.map(((t,e)=>({type:"Feature",geometry:{type:"Point",coordinates:t.lngLat},properties:{id:t.id||`robot-${e}`,rotation:t.rotation||0,name:t.name||`机器人${e+1}`}}))),f=()=>{o.forEach(((t,e)=>{m(t,e)}))},m=(t,o)=>{const r=(t=>{var e;const o=document.createElement("div");o.className="bic-robot-label",o.style.position="absolute",o.style.pointerEvents="none",o.style.display="block",o.style.textAlign="center",o.style.marginTop="-45px",o.style.transform="translateX(-50%)",o.style.zIndex=2;const r=document.createElement("div");r.className="bic-robot-bubble-container",r.style.position="relative",r.style.padding="0",r.style.marginBottom="7px",r.style.display="inline-block";const n=document.createElement("table");n.className="bic-robot-bg-container",n.style.borderCollapse="collapse",n.style.borderRadius="6px",n.style.overflow="hidden",n.style.border="1px solid #86B3FF",n.style.minWidth="120px",n.style.boxShadow="0 1px 3px rgba(0, 102, 255, 0.2)",n.style.width="100%",n.style.backgroundColor="#0066FF",n.style.borderBottomLeftRadius="6px",n.style.borderBottomRightRadius="6px";const i=document.createElement("tr"),a=document.createElement("tr"),l=document.createElement("td");l.style.backgroundColor="#FFFFFF",l.style.padding="3px 0",l.style.height="18px",l.style.textAlign="center",l.style.verticalAlign="middle",l.style.borderBottomLeftRadius="6px",l.style.borderBottomRightRadius="6px";const c="function"==typeof s?s(t.lngLat[0],t.lngLat[1]):{x:t.lngLat[0].toFixed(4),y:t.lngLat[1].toFixed(4)},u=(null==(e=t.rotation)?void 0:e.toFixed(1))||"0.0";l.innerHTML=`<span style="padding: 0px 10px;color:#0066FF;font-size:10px;font-weight:normal;font-family:Harmony Regular,sans-serif;line-height:1;white-space:nowrap;letter-spacing:-0.2px;">${c.x},${c.y},${u}°</span>`;const d=document.createElement("td");d.style.backgroundColor="#0066FF",d.style.padding="3px 0",d.style.height="20px",d.style.textAlign="center",d.style.verticalAlign="middle",d.style.borderBottomLeftRadius="6px",d.style.borderBottomRightRadius="6px";const h=t.name||"未命名机器人",p=h.length>10?h.substring(0,10)+"...":h;return d.innerHTML=`<span style="color:#FFFFFF;font-size:12px;font-weight:bold;font-family:Harmony Regular,sans-serif;line-height:1;white-space:nowrap;">${p}</span>`,i.appendChild(l),a.appendChild(d),n.appendChild(i),n.appendChild(a),r.appendChild(n),o.appendChild(r),o})(t);r.id=`bic-robot-label-${o}`,r.style.position="absolute",r.style.zIndex=2;e.getContainer().appendChild(r),p.push({element:r,robotIndex:o}),b(r,t.lngLat)},b=(t,o)=>{const r=e.project(o);t.style.left=`${r.x}px`,t.style.top=r.y-38+"px"},v=()=>{l&&p.forEach((t=>{const e=o[t.robotIndex];e&&b(t.element,e.lngLat)}))},w=()=>{p.forEach((t=>{t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element)})),p=[]};h.features=g(o),(async()=>{await new Promise((t=>{e.hasImage(c)?t():y(n).then((o=>{e.addImage(c,o),t()})).catch((o=>{const r=document.createElement("canvas");r.width=i,r.height=i;const n=r.getContext("2d");n.fillStyle="#0066FF",n.beginPath(),n.arc(i/2,i/2,i/2-2,0,2*Math.PI),n.fill(),n.strokeStyle="#BBD6FF",n.lineWidth=2,n.stroke(),e.addImage(c,r),t()}))})),e.getSource(u)?e.getSource(u).setData(h):(e.addSource(u,{type:"geojson",data:h}),e.addLayer({id:d,type:"symbol",source:u,layout:{"icon-image":c,"icon-size":i/48,"icon-rotate":["get","rotation"],"icon-rotation-alignment":"map","icon-allow-overlap":!0,"icon-ignore-placement":!0}}),e.on("move",v)),w(),l&&o.length>0&&f(),a&&"function"==typeof a&&(e.on("click",d,(t=>{t.originalEvent.stopPropagation();const r=e.queryRenderedFeatures(t.point,{layers:[d]});if(r.length>0){const t=r[0],e=t.properties.id,n=o.findIndex((t=>t.id&&t.id===e||!t.id&&e.startsWith("robot-")));if(-1!==n){const r=o[n];a({lngLat:t.geometry.coordinates,rotation:t.properties.rotation,name:t.properties.name,id:e,index:n,originalRobot:r})}}})),e.on("mouseenter",d,(()=>{e.getCanvas().style.cursor="pointer"})),e.on("mouseleave",d,(()=>{e.getCanvas().style.cursor=""})))})();return{updateRobots:(t=[])=>{o=t,h.features=g(o),e.getSource(u)&&e.getSource(u).setData(h),w(),l&&o.length>0&&f()},addRobot:t=>{const r=o.length;return o.push(t),h.features=g(o),e.getSource(u)&&e.getSource(u).setData(h),l&&m(t,r),r},updateRobot:(t,r)=>{let n=-1;if("number"==typeof t?n=t:"string"==typeof t&&(n=o.findIndex((e=>e.id===t))),n>=0&&n<o.length){const t=o[n];if(o[n]={...t,...r},h.features=g(o),e.getSource(u)&&e.getSource(u).setData(h),l){const t=p.find((t=>t.robotIndex===n));if(t&&t.element){t.element.parentNode&&t.element.parentNode.removeChild(t.element);const e=p.indexOf(t);-1!==e&&(p.splice(e,1),m(o[n],n))}}return!0}return!1},removeRobot:t=>{let r=-1;if("number"==typeof t?r=t:"string"==typeof t&&(r=o.findIndex((e=>e.id===t))),r>=0&&r<o.length){if(o.splice(r,1),h.features=g(o),e.getSource(u)&&e.getSource(u).setData(h),l){const t=p.find((t=>t.robotIndex===r));if(t&&t.element){t.element.parentNode&&t.element.parentNode.removeChild(t.element);const e=p.indexOf(t);-1!==e&&p.splice(e,1)}p.forEach((t=>{t.robotIndex>r&&t.robotIndex--}))}return!0}return!1},clearRobots:()=>{o=[],h.features=[],e.getSource(u)&&e.getSource(u).setData(h),w()},getRobots:()=>[...o],toggleLabels:t=>{const e=void 0===t?!l:t;return e!==l&&(e?0===p.length?f():p.forEach((t=>{t.element&&(t.element.style.display="block")})):p.forEach((t=>{t.element&&(t.element.style.display="none")})),l=e),l},setVisible:t=>{const o=t?"visible":"none";e.getLayer(d)&&e.setLayoutProperty(d,"visibility",o),t?p.forEach((t=>{t.element&&(t.element.style.display="block")})):p.forEach((t=>{t.element&&(t.element.style.display="none")}))},remove:()=>{e.getLayer(d)&&(e.off("click",d),e.off("mouseenter",d),e.off("mouseleave",d),e.off("move",v),e.removeLayer(d)),e.getSource(u)&&e.removeSource(u),w(),e.hasImage(c)&&e.removeImage(c)}}}function F(e,o=[],r={}){const{svgPath:n="/bicMap/assets/img/robo.png",size:i=30,onClick:a=null}=r;let s=[...o];const l=[];let c=[],u=i,d=!1;const h=()=>{const t=document.createElement("div");t.className="bic-robot-dom-marker",t.style.width=`${u}px`,t.style.height=`${u}px`,a&&(t.style.cursor="pointer");const e=document.createElement("img");return e.src=n,e.style.display="block",e.style.width="100%",e.style.height="100%",e.style.objectFit="contain",e.style.pointerEvents="none",e.onerror=function(){const t=u,e=document.createElement("canvas");e.width=t,e.height=t;const o=e.getContext("2d");o.fillStyle="#0066FF",o.beginPath(),o.arc(t/2,t/2,t/2-2,0,2*Math.PI),o.fill(),o.strokeStyle="#BBD6FF",o.lineWidth=2,o.stroke(),this.src=e.toDataURL()},t.appendChild(e),t},p=(o,r)=>{let n,i=!1;if(l.length>0)n=l.pop(),n.addTo(e);else{i=!0;const r=h();n=new t.Marker({element:r,pitchAlignment:"map",rotationAlignment:"map"}).setLngLat(o.lngLat).addTo(e)}n.setLngLat(o.lngLat);const s=n.getElement().querySelector("img");s&&(s.style.transform=`rotate(${o.rotation||0}deg)`);const u={lngLat:o.lngLat,rotation:o.rotation,name:o.name,id:o.id||`robot-${r}`,index:r,originalRobot:o};return n.getElement()._robotClickData=u,i&&a&&n.getElement().addEventListener("click",(function(t){t.stopPropagation(),a(this._robotClickData)})),c.push({marker:n,robotIndex:r,robotId:o.id}),n},g=t=>{t.remove(),l.push(t)};return(()=>{const t=new Image;t.onload=()=>{d||(u=Math.round(t.naturalWidth*i/48),s.forEach(((t,e)=>{p(t,e)})))},t.onerror=()=>{d||s.forEach(((t,e)=>{p(t,e)}))},t.src=n})(),{updateRobots:(t=[])=>{c.forEach((t=>g(t.marker))),c=[],s=[...t],s.forEach(((t,e)=>{p(t,e)}))},addRobot:t=>{const e=s.length;return s.push(t),p(t,e),e},updateRobot:(t,e)=>{let o=-1;if("number"==typeof t?o=t:"string"==typeof t&&(o=s.findIndex((e=>e.id===t))),o>=0&&o<s.length){s[o]={...s[o],...e};const t=c.find((t=>t.robotIndex===o));if(t){t.marker.setLngLat(s[o].lngLat);const e=t.marker.getElement().querySelector("img");e&&(e.style.transform=`rotate(${s[o].rotation||0}deg)`),t.marker.getElement()._robotClickData={lngLat:s[o].lngLat,rotation:s[o].rotation,name:s[o].name,id:s[o].id||`robot-${o}`,index:o,originalRobot:s[o]}}return!0}return!1},removeRobot:t=>{let e=-1;if("number"==typeof t?e=t:"string"==typeof t&&(e=s.findIndex((e=>e.id===t))),e>=0&&e<s.length){s.splice(e,1);const t=c.findIndex((t=>t.robotIndex===e));if(-1!==t){const e=c[t];g(e.marker),c.splice(t,1)}return c.forEach((t=>{t.robotIndex>e&&t.robotIndex--})),!0}return!1},clearRobots:()=>{s=[],c.forEach((t=>g(t.marker))),c=[]},getRobots:()=>[...s],toggleLabels:()=>!0,setVisible:t=>{c.forEach((({marker:e})=>{e.getElement().style.display=t?"":"none"}))},remove:()=>{d=!0,c.forEach((t=>t.marker.remove())),c=[],l.forEach((t=>t.remove())),l.length=0}}}function N(e,o=[],r={}){if(!t||!e)throw new Error("地图未初始化。");const{imagePath:n="/bicMap/assets/img/pos.png",size:i=24,showLabels:a=!1,labelIconPath:s="/bicMap/assets/img/poi-sig.png",selectable:l=!0,selectedStyle:c={color:"#ffba40",fillColor:"#ffba40",fillOpacity:1,baseRadius:.2,maxRadius:.6,strokeWidth:3,opacity:0,animationDuration:2e3},avoidLabelCollision:u=!0,labelPadding:d=4,onClick:h=null,onSelectionChange:p=null}=r;let g=l;const f={...c};f.maxRadius<=f.baseRadius&&(f.maxRadius=f.baseRadius+.5);f.baseRadius,f.maxRadius;const m=f;let b=a||!1,v=new Set;let w=new Map;const _=()=>{const t=[];v.forEach((e=>{if(e<o.length){const r=o[e];t.push({type:"Feature",id:`ripple-${e}`,geometry:{type:"Point",coordinates:r.lngLat},properties:{index:e,scale:m.baseRadius,strokeOpacity:m.opacity,fillOpacity:m.fillOpacity}})}}));const r=e.getSource(S);r&&r.setData({type:"FeatureCollection",features:t})},x=t=>{const o=`ripple-${t}`;if(w.has(o))return;const r=`${L}-ripple`;let n=0;const a=Math.round(m.animationDuration/1e3*60),s=()=>{if(!w.has(o)||!v.has(t))return;const l=n/a,c=m.maxRadius-m.baseRadius,u=m.baseRadius+l*c,d=Math.max(0,m.opacity*(1-l));let h=0;if(m.fillColor){const t=Math.max(0,(l-.3)/.7);h=Math.max(.1,m.fillOpacity*(1-t*t))}e.getLayer(r)&&(e.setPaintProperty(r,"circle-radius",["case",["==",["get","index"],t],Math.max(2,i*u),Math.max(2,i*m.baseRadius)]),e.setPaintProperty(r,"circle-stroke-opacity",["case",["==",["get","index"],t],Math.min(1,d+.2),Math.min(1,m.opacity+.2)]),m.fillColor&&(e.setPaintProperty(r,"circle-color",m.fillColor),e.setPaintProperty(r,"circle-opacity",["case",["==",["get","index"],t],h,m.fillOpacity]))),n++,n>=a&&(n=0),w.has(o)&&requestAnimationFrame(s)};w.set(o,!0),s()},C=t=>{const e=`ripple-${t}`;w.delete(e)},E="poi-icon",I="batch-poi-selection-source",L="batch-poi-selection-layer",S=`${I}-ripple`;let M={type:"FeatureCollection",features:[]},P=[];const k=t=>t.map(((t,e)=>({type:"Feature",id:`${t.id}`,geometry:{type:"Point",coordinates:t.lngLat},properties:{id:`${t.id}`,rotation:t.rotation||0,name:t.name||`点位${e+1}`}}))),R=t=>{if(t<0||t>=o.length)return!1;const r=v.has(t),n=Array.from(v);if(w.clear(),n.forEach((t=>{const r=o[t];r&&r.id&&e.setFeatureState({source:I,id:r.id},{selected:!1}),C(t)})),v.clear(),!r){v.add(t);const r=o[t];r&&r.id&&e.setFeatureState({source:I,id:r.id},{selected:!0}),x(t)}return _(),b&&(P.forEach((t=>{const e=v.has(t.pointIndex);T(t.pointIndex,e)})),H()),p&&"function"==typeof p&&p({index:t,selected:!r,point:o[t],selectedIndices:Array.from(v),previousSelected:n}),!r},D=()=>{M.features=k(o),e.getSource(I)&&(e.getSource(I).setData(M),v.forEach((t=>{const r=o[t];r&&r.id&&e.setFeatureState({source:I,id:r.id},{selected:!0})}))),H()},T=(t,e)=>{const o=P.find((e=>e.pointIndex===t));if(!o||!o.element)return;const r=o.element,n=r.querySelector(".bic-poi-icon-container"),i=r.querySelector(".bic-poi-text-container");e?(n&&(n.style.backgroundColor=m.color),i&&(i.style.borderColor=m.color)):(n&&(n.style.backgroundColor="#1CD5A4"),i&&(i.style.borderColor="#1CD5A4"))},A=()=>{o.forEach(((t,e)=>{z(t,e)})),H()},z=(t,o)=>{const r=((t,e)=>{const o=v.has(e),r=document.createElement("div");r.className="bic-poi-label",r.style.position="absolute",r.style.pointerEvents="none",r.style.display=b?"flex":"none",r.style.alignItems="center",r.style.justifyContent="flex-start",r.style.marginTop="0px",r.style.zIndex=o?2:1;const n=document.createElement("div");n.className="bic-poi-icon-container",n.style.width="20px",n.style.height="20px",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center",n.style.backgroundColor="#1CD5A4",n.style.borderRadius="5px",n.style.marginRight="3px",n.style.transition="all 0.3s ease";const i=document.createElement("img");i.src=s,i.style.width="20px",i.style.height="20px",i.style.objectFit="contain";const a=document.createElement("div");a.className="bic-poi-text-container",a.style.padding="2px 5px",a.style.backgroundColor="white",a.style.border="2px solid #1CD5A4",a.style.borderRadius="5px",a.style.whiteSpace="nowrap",a.style.maxWidth="200px",a.style.minHeight="20px",a.style.boxSizing="border-box",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center",a.style.transition="all 0.3s ease";const l=document.createElement("span");return l.innerText=t.name||"未命名点位",l.style.color="#1CD5A4",l.style.fontSize="13px",l.style.fontWeight="bold",l.style.fontFamily="Harmony Regular, sans-serif",l.style.lineHeight="1",l.style.display="block",l.style.transition="color 0.3s ease",n.appendChild(i),a.appendChild(l),r.appendChild(n),r.appendChild(a),r})(t,o);r.id=`bic-poi-label-${o}`,r.style.position="absolute";e.getContainer().appendChild(r),P.push({element:r,pointIndex:o}),O(r,t.lngLat)},O=(t,o)=>{const r=e.project(o);t.style.left=r.x-10+"px",t.style.top=r.y-35+"px"},F=()=>{b&&(P.forEach((t=>{const e=o[t.pointIndex];e&&O(t.element,e.lngLat)})),H())},N=new WeakMap,G=t=>{const e=parseFloat(t.style.left)||0,o=parseFloat(t.style.top)||0,{width:r,height:n}=(t=>{const e=N.get(t);if(e&&e.width>0&&e.height>0)return e;const o={width:t.offsetWidth,height:t.offsetHeight};return o.width>0&&o.height>0&&N.set(t,o),o})(t);return{left:e,top:o,right:e+r,bottom:o+n,width:r,height:n}},j=(t,e,o=0)=>!(t.right+o<e.left||e.right+o<t.left||t.bottom+o<e.top||e.bottom+o<t.top);let $=0;const H=()=>{b&&(u?$||($=requestAnimationFrame((()=>{$=0,B()}))):P.forEach((t=>{t.element&&(t.element.style.visibility="visible")})))},B=()=>{if(!b||0===P.length)return;const t=(()=>{const t=e.getCanvas();return{left:0,top:0,right:t.clientWidth,bottom:t.clientHeight}})(),r=[];P.forEach((e=>{if(!o[e.pointIndex]||!e.element)return;const n=G(e.element);0!==n.width&&0!==n.height&&(((t,e)=>!(t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom))(n,t)?r.push({element:e.element,pointIndex:e.pointIndex,isSelected:v.has(e.pointIndex),rect:n}):e.element.style.visibility="hidden")})),r.sort(((t,e)=>t.isSelected!==e.isSelected?t.isSelected?-1:1:t.pointIndex-e.pointIndex));const n=[];for(const e of r){let t=!1;for(let o=0;o<n.length;o++)if(j(e.rect,n[o].rect,d)){t=!0;break}t?e.element.style.visibility="hidden":(e.element.style.visibility="visible",n.push(e))}},W=()=>{P.forEach((t=>{t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element)})),P=[]},V=t=>{w.clear();Array.from(v).forEach((t=>{const r=o[t];r&&r.id&&e.setFeatureState({source:I,id:r.id},{selected:!1})})),v.clear();const r=t.filter((t=>t>=0&&t<o.length));if(r.length>0){const t=r[0];v.add(t);const n=o[t];n&&n.id&&e.setFeatureState({source:I,id:n.id},{selected:!0}),x(t)}D(),_(),b&&(P.forEach((t=>{T(t.pointIndex,v.has(t.pointIndex))})),H())},U=()=>{w.clear(),v.clear(),D(),_(),b&&(P.forEach((t=>{T(t.pointIndex,!1)})),H())};return M.features=k(o),(async()=>{if(await new Promise((t=>{e.hasImage(E)?t():y(n).then((o=>{e.addImage(E,o),t()})).catch((o=>{const r=document.createElement("canvas");r.width=i,r.height=i;const n=r.getContext("2d");n.fillStyle="#4285F4",n.beginPath(),n.arc(i/2,i/2,i/2-2,0,2*Math.PI),n.fill(),n.strokeStyle="#FFF",n.lineWidth=2,n.stroke(),e.addImage(E,r),t()}))})),(()=>{const t="bic-poi-selection-styles";if(document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.innerHTML=`\n .bic-poi-label-selected {\n transform: scale(1.05);\n transition: transform 0.3s ease;\n }\n \n .bic-poi-label-selected .bic-poi-icon-container {\n background-color: ${m.color} !important;\n box-shadow: 0 0 8px ${m.color}99;\n }\n \n .bic-poi-label-selected .bic-poi-text-container {\n border-color: ${m.color} !important;\n box-shadow: 0 0 5px ${m.color}4D;\n }\n `,document.head.appendChild(e)})(),e.getSource(I))e.getSource(I).setData(M);else{e.addSource(I,{type:"geojson",data:M}),e.addLayer({id:L,type:"symbol",source:I,layout:{"icon-image":E,"icon-size":i/48,"icon-rotate":["get","rotation"],"icon-rotation-alignment":"map","icon-allow-overlap":!0,"icon-ignore-placement":!0}}),e.addSource(S,{type:"geojson",data:{type:"FeatureCollection",features:[]}});const t={"circle-radius":Math.max(2,i*m.baseRadius),"circle-stroke-width":m.strokeWidth,"circle-stroke-color":m.color,"circle-stroke-opacity":Math.min(1,m.opacity+.2)};m.fillColor?(t["circle-color"]=m.fillColor,t["circle-opacity"]=m.fillOpacity):(t["circle-color"]="transparent",t["circle-opacity"]=0),e.addLayer({id:`${L}-ripple`,type:"circle",source:S,paint:t},L),e.on("move",F)}W(),b&&A(),(g||h&&"function"==typeof h)&&(e.on("click",L,(t=>{t.originalEvent.stopPropagation();const r=e.queryRenderedFeatures(t.point,{layers:[L]});if(r.length>0){const t=r[0],e=t.properties.id,n=o.findIndex((t=>String(t.id)===String(e)));if(-1!==n){const r=o[n];g&&R(n),h&&"function"==typeof h&&h({lngLat:t.geometry.coordinates,rotation:t.properties.rotation,name:t.properties.name,index:n,id:e,originalPoint:r,selected:v.has(n)})}}})),e.on("mouseenter",L,(()=>{e.getCanvas().style.cursor="pointer"})),e.on("mouseleave",L,(()=>{e.getCanvas().style.cursor=""})))})(),{updateMarkers:(t=[])=>{o=t,v=new Set([...v].filter((t=>t<o.length))),D(),b&&(W(),A())},addMarker:t=>{const e=o.length;return o.push(t),D(),b&&z(t,e),e},updateMarker:(t,e)=>{if(t>=0&&t<o.length){const r=o[t];if(o[t]={...r,...e},D(),b){const e=P.find((e=>e.pointIndex===t));if(e&&e.element){e.element.parentNode&&e.element.parentNode.removeChild(e.element);const r=P.indexOf(e);-1!==r&&(z(o[t],t),P.splice(r,1))}}return!0}return!1},removeMarker:t=>{if(t>=0&&t<o.length){o.splice(t,1),v.delete(t);const e=new Set;if(v.forEach((o=>{o>t?e.add(o-1):o<t&&e.add(o)})),v=e,D(),b){const e=P.find((e=>e.pointIndex===t));if(e&&e.element){e.element.parentNode&&e.element.parentNode.removeChild(e.element);const t=P.indexOf(e);-1!==t&&P.splice(t,1)}P.forEach((e=>{e.pointIndex>t&&e.pointIndex--}))}return!0}return!1},clearMarkers:()=>{o=[],v.clear(),D(),W()},getMarkers:()=>[...o],getSelectedMarkers:()=>Array.from(v).map((t=>({index:t,point:o[t]}))),getSelectedMarker:()=>{if(0===v.size)return null;const t=Array.from(v)[0];return{index:t,point:o[t]}},getMarkerById:t=>{if(!t)return null;const e=o.findIndex((e=>String(e.id)===String(t)));return-1===e?null:{index:e,point:o[e],selected:v.has(e)}},toggleSelection:R,setSelection:V,clearSelection:U,selectAll:()=>{0!==o.length&&V([0])},selectById:t=>{if(!t)return!1;const r=o.findIndex((e=>String(e.id)===String(t)));if(-1===r)return!1;if(!v.has(r)){const n=Array.from(v);return w.clear(),n.forEach((t=>{const r=o[t];r&&r.id&&e.setFeatureState({source:I,id:r.id},{selected:!1}),C(t)})),v.clear(),v.add(r),e.setFeatureState({source:I,id:t},{selected:!0}),x(r),_(),b&&(P.forEach((t=>{const e=v.has(t.pointIndex);T(t.pointIndex,e)})),H()),!0}return!1},toggleLabels:t=>{let e;return e=void 0===t?!b:t,e&&!b?A():!e&&b&&W(),b=e,e},setSelectable:t=>{const e=g;return g=!!t,!g&&e?U():g&&!e&&b&&(W(),A()),g},isSelectable:()=>g,remove:()=>{w.clear(),$&&(cancelAnimationFrame($),$=0),e.getLayer(L)&&(e.off("click",L),e.off("mouseenter",L),e.off("mouseleave",L),e.off("move",F),e.removeLayer(L));const t=`${L}-ripple`;e.getLayer(t)&&e.removeLayer(t),e.getSource(S)&&e.removeSource(S),e.getSource(I)&&e.removeSource(I),W(),e.hasImage(E)&&e.removeImage(E);const o=document.getElementById("bic-poi-selection-styles");o&&o.remove()}}}const G={pointSize:6,pointColor:"#ff3b3b",pointOpacity:.9,useColorMap:!1,colorMap:[[0,"#2b7bff"],[.5,"#19d3a2"],[1,"#ff5a5a"]],zRange:[0,5],heightScale:1,heightOffset:0,sizeAttenuation:!1,visible:!0,debug:!1},j="point-cloud-3d-layer";function $(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255]:[1,0,0]}function H(t,e,o){const r=Math.max(0,Math.min(1,(t-e[0])/(e[1]-e[0]||1)));for(let n=0;n<o.length-1;n++){const[t,e]=o[n],[i,a]=o[n+1];if(r>=t&&r<=i){const o=(r-t)/(i-t||1),n=$(e),s=$(a);return[n[0]+(s[0]-n[0])*o,n[1]+(s[1]-n[1])*o,n[2]+(s[2]-n[2])*o]}}return $(o[o.length-1][1])}const B={createPointCloud:(t,e=[],o={})=>{if(!t)return null;const r={pointSize:5,pointColor:"#ff0000",pointOpacity:.8,minPointSize:1,maxPointSize:10,is3D:!0,useColorMap:!1,colorMap:[[0,"#0000ff"],[.5,"#00ff00"],[1,"#ff0000"]],zRange:[0,100],visible:!0,heightScale:100,heightOffset:0,...o};let n=e;const i="point-cloud-source",a="point-cloud-layer",s=t=>{const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255]:[1,0,0]},l=t=>({type:"FeatureCollection",features:t.map(((t,e)=>{const o=t.length>2&&void 0!==t[2],n=o?t[2]:0,i=r.is3D&&o?n*r.heightScale+r.heightOffset:0;let a=r.pointColor;r.useColorMap&&o&&(a=((t,e,o)=>{const r=Math.max(0,Math.min(1,(t-e[0])/(e[1]-e[0])));for(let n=0;n<o.length-1;n++){const[t,e]=o[n],[i,a]=o[n+1];if(r>=t&&r<=i){const o=(r-t)/(i-t),n=parseInt(e.slice(1,3),16),s=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16),c=parseInt(a.slice(1,3),16),u=parseInt(a.slice(3,5),16),d=parseInt(a.slice(5,7),16),h=Math.floor(n+(c-n)*o),p=Math.floor(s+(u-s)*o),g=Math.floor(l+(d-l)*o);return`#${h.toString(16).padStart(2,"0")}${p.toString(16).padStart(2,"0")}${g.toString(16).padStart(2,"0")}`}}return o[o.length-1][1]})(n,r.zRange,r.colorMap));return{type:"Feature",properties:{height:i,color:s(a),pointSize:r.pointSize,opacity:r.pointOpacity,id:e},geometry:{type:"Point",coordinates:[t[0],t[1],i]}}}))}),c=()=>{if(!r.visible)return void(t.getLayer(a)&&t.setLayoutProperty(a,"visibility","none"));const e=l(n);if(t.getSource(i)?t.getSource(i).setData(e):t.addSource(i,{type:"geojson",data:e,buffer:0,tolerance:0,cluster:!1,maxzoom:24}),t.getLayer(a))t.setLayoutProperty(a,"visibility","visible"),t.setPaintProperty(a,"circle-radius",["get","pointSize"]),t.setPaintProperty(a,"circle-opacity",["get","opacity"]),t.setPaintProperty(a,"circle-pitch-alignment",r.is3D?"map":"viewport"),t.setPaintProperty(a,"circle-pitch-scale",r.is3D?"map":"viewport");else{const e={id:a,type:"circle",source:i,paint:{"circle-radius":["get","pointSize"],"circle-color":["rgb",["*",["at",0,["get","color"]],255],["*",["at",1,["get","color"]],255],["*",["at",2,["get","color"]],255]],"circle-opacity":["get","opacity"],"circle-translate":[0,0],"circle-translate-anchor":"map","circle-pitch-alignment":r.is3D?"map":"viewport","circle-pitch-scale":r.is3D?"map":"viewport"},layout:{visibility:"visible"}};z(t,e)}r.is3D&&t.getPitch()<30&&t.easeTo({pitch:60,duration:1e3})};return t.loaded()?c():t.on("load",c),{update:(t,e={})=>{n=t||n,Object.keys(e).length>0&&Object.assign(r,e),c()},show:()=>{r.visible=!0,t.getLayer(a)?t.setLayoutProperty(a,"visibility","visible"):c()},hide:()=>{r.visible=!1,t.getLayer(a)&&t.setLayoutProperty(a,"visibility","none")},remove:()=>{t.getLayer(a)&&t.removeLayer(a),t.getSource(i)&&t.removeSource(i)},getOptions:()=>({...r}),getPoints:()=>[...n],updatePoint:(e,o)=>{if(e<0||e>=n.length||!t.getSource(i))return;const a=t.getSource(i)._data;if(!a||!a.features||e>=a.features.length)return;const l=a.features[e];o.color&&(l.properties.color=s(o.color)),"visible"in o&&(l.properties.opacity=o.visible?r.pointOpacity:0),o.size&&(l.properties.pointSize=o.size),"height"in o&&r.is3D&&(l.properties.height=o.height,l.geometry.coordinates[2]=o.height),t.getSource(i).setData(a)},set3D:e=>{r.is3D=e,t.getLayer(a)&&(t.setPaintProperty(a,"circle-pitch-alignment",e?"map":"viewport"),t.setPaintProperty(a,"circle-pitch-scale",e?"map":"viewport"),c())}}},createPointCloud3D:function(e,o=[],r={}){if(!e)return null;if(!t||!t.MercatorCoordinate)return null;if(!i||!i.Scene)return null;const n={...G,...r};let a=Array.isArray(o)?o:[],s=null,l=1;const c=()=>{const o=a.length>0?{lng:a[0][0],lat:a[0][1]}:e.getCenter();s=t.MercatorCoordinate.fromLngLat(o,0),l=s.meterInMercatorCoordinateUnits()},u=new i.Scene,d=new i.Camera;let h=null,p=null,g=null,f=null,m=!1;const y=new i.Matrix4,b=new i.Matrix4,v=new i.Vector3,w=()=>{s||c();const e=a.length,o=new Float32Array(3*e),r=new Float32Array(3*e),u=$(n.pointColor),d=1/l;for(let i=0;i<e;i++){const e=a[i],l=e.length>2&&void 0!==e[2]?e[2]:0,c=l*n.heightScale+n.heightOffset,h=t.MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]},c),p=n.useColorMap?H(l,n.zRange,n.colorMap):u,g=3*i;o[g]=(h.x-s.x)*d,o[g+1]=-(h.y-s.y)*d,o[g+2]=(h.z-s.z)*d,r[g]=p[0],r[g+1]=p[1],r[g+2]=p[2]}p&&p.dispose(),p=new i.BufferGeometry,p.setAttribute("position",new i.BufferAttribute(o,3)),p.setAttribute("color",new i.BufferAttribute(r,3)),p.computeBoundingSphere()},_=()=>{g?(g.uniforms.uSize.value=n.pointSize,g.uniforms.uOpacity.value=n.pointOpacity):g=new i.ShaderMaterial({uniforms:{uSize:{value:n.pointSize},uOpacity:{value:n.pointOpacity}},vertexShader:"\n attribute vec3 color;\n uniform float uSize;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = uSize;\n }\n ",fragmentShader:"\n precision mediump float;\n uniform float uOpacity;\n varying vec3 vColor;\n void main() {\n vec2 c = gl_PointCoord - vec2(0.5);\n float d = length(c);\n if (d > 0.5) discard;\n float a = (1.0 - smoothstep(0.42, 0.5, d)) * uOpacity;\n gl_FragColor = vec4(vColor, a);\n }\n ",transparent:!0,depthTest:!0,depthWrite:!0})},x={id:j,type:"custom",renderingMode:"3d",onAdd(t,e){this._map=t;try{h=new i.WebGLRenderer({canvas:t.getCanvas(),context:e,antialias:!0})}catch(o){return}h.autoClear=!1,w(),_(),f=new i.Points(p,g),f.frustumCulled=!1,f.matrixAutoUpdate=!1,f.matrix.identity(),f.matrixWorld.identity(),u.add(f),n.debug},render(t,e){var o,r;if(!h||!f||!s)return;let i=null,a="none";if(Array.isArray(e)||e instanceof Float32Array)i=e,a="legacy-matrix-arg";else if(e&&"object"==typeof e){const t=e.defaultProjectionData;(null==t?void 0:t.mainMatrix)&&16===t.mainMatrix.length?(i=t.mainMatrix,a="defaultProjectionData.mainMatrix"):16===(null==(o=e.projectionMatrix)?void 0:o.length)?(i=e.projectionMatrix,a="projectionMatrix"):16===(null==(r=e.modelViewProjectionMatrix)?void 0:r.length)&&(i=e.modelViewProjectionMatrix,a="modelViewProjectionMatrix")}if(!i||16!==i.length)return;const c=l;v.set(c,-c,c),b.makeTranslation(s.x,s.y,s.z).scale(v),y.fromArray(i),d.projectionMatrix.multiplyMatrices(y,b),d.projectionMatrixInverse.copy(d.projectionMatrix).invert(),d.matrixWorld.identity(),d.matrixWorldInverse.identity(),n.debug&&!m&&(m=!0),h.resetState(),h.render(u,d)},onRemove(t,e){f&&u.remove(f),p&&p.dispose(),g&&g.dispose(),f=null,p=null,g=null,h=null}},C=()=>{e.getLayer(j)||(e.addLayer(x),n.visible||e.setLayoutProperty(j,"visibility","none"),e.triggerRepaint())};return"function"!=typeof e.isStyleLoaded||e.isStyleLoaded()?C():e.once("styledata",C),{update(t,o={}){const r=Array.isArray(t);r&&(a=t),Object.assign(n,o),r&&c(),e.getLayer(j)?(f&&(w(),_(),f.geometry=p,f.material=g),e.triggerRepaint()):C()},show(){n.visible=!0,e.getLayer(j)&&e.setLayoutProperty(j,"visibility","visible"),e.triggerRepaint()},hide(){n.visible=!1,e.getLayer(j)&&e.setLayoutProperty(j,"visibility","none")},remove(){e.getLayer(j)&&e.removeLayer(j)},getPoints:()=>[...a],getOptions:()=>({...n})}}},W=(t,e=[],o={})=>{if(!t)return null;const r={...{fillColor:"#3388ff",fillOpacity:.4,outlineColor:"#3388ff",outlineWidth:2,outlineOpacity:.8,highlightColor:"#ff6600",highlightOpacity:.6,sourceId:`rectangle-source-${Date.now()}`,layerId:x,outlineLayerId:C,filled:!0},...o},n=[],i=(t,e)=>{const{coordinates:o,...n}=t;if(!o||2!==o.length)return null;const[i,a]=o,s=[[i[0],i[1]],[a[0],i[1]],[a[0],a[1]],[i[0],a[1]],[i[0],i[1]]];return{type:"Feature",id:e,properties:{id:e,filled:void 0!==t.filled?t.filled:r.filled,...n},geometry:{type:"Polygon",coordinates:[s]}}},a=e=>{if(!t.getSource(r.sourceId))return;n.length=0;const o=e.map(((t,e)=>{const o=t.id||`rectangle-${e}`;return n.push(o),i(t,o)})).filter(Boolean);t.getSource(r.sourceId).setData({type:"FeatureCollection",features:o})},s=(e,o)=>{if(!t.getSource(r.sourceId))return;const n=t.getSource(r.sourceId)._data,a=n.features.findIndex((t=>t.id===e));if(-1!==a){if(o.coordinates){const t=i({...n.features[a].properties,coordinates:o.coordinates},e);t&&(n.features[a]=t)}else Object.assign(n.features[a].properties,o);t.getSource(r.sourceId).setData(n)}},l=e=>{e&&n.includes(e)&&t.setFeatureState({source:r.sourceId,id:e},{hover:!1})},c=e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data;o.features.forEach((t=>{t.properties.filled=e})),t.getSource(r.sourceId).setData(o),r.filled=e},u=(t,e)=>{s(t,{filled:e})};return t.addSource(r.sourceId,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(t,{id:r.layerId,type:"fill",source:r.sourceId,paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],r.highlightColor,["coalesce",["get","fillColor"],r.fillColor]],"fill-opacity":["case",["all",["boolean",["feature-state","hover"],!1],["coalesce",["get","filled"],r.filled]],r.highlightOpacity,["case",["coalesce",["get","filled"],r.filled],["coalesce",["get","fillOpacity"],r.fillOpacity],0]]}}),z(t,{id:r.outlineLayerId,type:"line",source:r.sourceId,paint:{"line-color":["coalesce",["get","outlineColor"],r.outlineColor],"line-width":["coalesce",["get","outlineWidth"],r.outlineWidth],"line-opacity":["coalesce",["get","outlineOpacity"],r.outlineOpacity]}}),e.length>0&&a(e),{addRectangle:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data,a=e.id||`rectangle-${n.length}`;n.push(a);const s=i(e,a);return s&&(o.features.push(s),t.getSource(r.sourceId).setData(o)),a},updateRectangle:s,removeRectangle:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data,i=o.features.findIndex((t=>t.id===e));if(-1!==i){o.features.splice(i,1),t.getSource(r.sourceId).setData(o);const a=n.indexOf(e);-1!==a&&n.splice(a,1)}},setData:a,highlightRectangle:e=>{e&&n.includes(e)&&t.setFeatureState({source:r.sourceId,id:e},{hover:!0})},unhighlightRectangle:l,clearHighlights:()=>{n.forEach((t=>{l(t)}))},show:()=>{t.getLayer(r.layerId)&&t.setLayoutProperty(r.layerId,"visibility","visible"),t.getLayer(r.outlineLayerId)&&t.setLayoutProperty(r.outlineLayerId,"visibility","visible")},hide:()=>{t.getLayer(r.layerId)&&t.setLayoutProperty(r.layerId,"visibility","none"),t.getLayer(r.outlineLayerId)&&t.setLayoutProperty(r.outlineLayerId,"visibility","none")},remove:()=>{t.getSource(r.sourceId)&&(t.getLayer(r.outlineLayerId)&&t.removeLayer(r.outlineLayerId),t.getLayer(r.layerId)&&t.removeLayer(r.layerId),t.getSource(r.sourceId)&&t.removeSource(r.sourceId),n.length=0)},getRectangleIds:()=>[...n],getRectangleData:e=>{if(!t.getSource(r.sourceId))return null;return t.getSource(r.sourceId)._data.features.find((t=>t.id===e))},getAllRectangles:()=>t.getSource(r.sourceId)?t.getSource(r.sourceId)._data.features:[],setAllFilled:c,setRectangleFilled:u,toggleAllFilled:()=>{c(!r.filled)},toggleRectangleFilled:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data.features.find((t=>t.id===e));if(o){const t=void 0!==o.properties.filled?o.properties.filled:r.filled;u(e,!t)}},options:r}},V=(t,e=[],o={})=>{if(!t)return null;const r={...{fillColor:"#3388ff",fillOpacity:.4,outlineColor:"#3388ff",outlineWidth:2,outlineOpacity:.8,highlightColor:"#ff6600",highlightOpacity:.6,sourceId:`polygon-source-${Date.now()}`,layerId:E,outlineLayerId:I,filled:!0},...o},n=[],i=(t,e)=>{const{points:o,...n}=t;if(!o||!Array.isArray(o)||o.length<3)return null;const i=[...o],a=i[0],s=i[i.length-1];return a[0]===s[0]&&a[1]===s[1]||i.push([...a]),{type:"Feature",id:e,properties:{id:e,filled:void 0!==t.filled?t.filled:r.filled,...n},geometry:{type:"Polygon",coordinates:[i]}}},a=e=>{if(!t.getSource(r.sourceId))return;n.length=0;const o=e.map(((t,e)=>{const o=t.id||`polygon-${e}`;return n.push(o),i(t,o)})).filter(Boolean);t.getSource(r.sourceId).setData({type:"FeatureCollection",features:o})},s=(e,o)=>{if(!t.getSource(r.sourceId))return;const n=t.getSource(r.sourceId)._data,a=n.features.findIndex((t=>t.id===e));if(-1!==a){if(o.points){const t=i({...n.features[a].properties,points:o.points},e);t&&(n.features[a]=t)}else Object.assign(n.features[a].properties,o);t.getSource(r.sourceId).setData(n)}},l=e=>{e&&n.includes(e)&&t.setFeatureState({source:r.sourceId,id:e},{hover:!0})},c=e=>{e&&n.includes(e)&&t.setFeatureState({source:r.sourceId,id:e},{hover:!1})},u=e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data;o.features.forEach((t=>{t.properties.filled=e})),t.getSource(r.sourceId).setData(o),r.filled=e},d=(t,e)=>{s(t,{filled:e})},h=e=>{if(!t.getSource(r.sourceId))return null;return t.getSource(r.sourceId)._data.features.find((t=>t.id===e))};let p,g,f,m,y,b,v=!1,w=null,_=[],x=`polygon-edit-source-${Date.now()}`,C=`polygon-edit-layer-${Date.now()}`,L=`polygon-edit-points-source-${Date.now()}`,S=`polygon-edit-points-layer-${Date.now()}`,M=!1,P=-1,k=null,R=null,D=null;const T=()=>{D&&"function"==typeof D&&w&&D({polygonId:w,points:[..._],finalPoints:[..._]}),v=!1,w=null,_=[],M=!1,P=-1,k=null,R=null,D=null,N(),O()},A=()=>{if(!v||0===_.length)return;const e={type:"Feature",geometry:{type:"Polygon",coordinates:[[..._,_[0]]]}},o=t.getSource(x);o&&o.setData({type:"FeatureCollection",features:[e]});const r=_.map(((t,e)=>({type:"Feature",geometry:{type:"Point",coordinates:t},properties:{index:e}}))),n=t.getSource(L);n&&n.setData({type:"FeatureCollection",features:r})},O=()=>{t.getSource(x)&&t.getSource(x).setData({type:"FeatureCollection",features:[]}),t.getSource(L)&&t.getSource(L).setData({type:"FeatureCollection",features:[]})},F=()=>{m=e=>{e.features&&e.features.length>0&&e.features[0].source===L&&(M=!0,P=e.features[0].properties.index,t.getCanvas().style.cursor="grabbing",e.preventDefault())},y=t=>{if(M&&P>=0){const e=[t.lngLat.lng,t.lngLat.lat];_[P]=e,A(),R&&"function"==typeof R&&R({polygonId:w,points:[..._],changedPointIndex:P,changedPoint:e}),t.preventDefault()}},b=e=>{M&&(M=!1,P=-1,t.getCanvas().style.cursor="",w&&s(w,{points:_}),e.preventDefault())},t.on("mousedown",S,m),t.on("mousemove",y),t.on("mouseup",b)},N=()=>{m&&t.off("mousedown",S,m),y&&t.off("mousemove",y),b&&t.off("mouseup",b)};return t.addSource(r.sourceId,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(t,{id:r.layerId,type:"fill",source:r.sourceId,paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],r.highlightColor,["coalesce",["get","fillColor"],r.fillColor]],"fill-opacity":["case",["all",["boolean",["feature-state","hover"],!1],["coalesce",["get","filled"],r.filled]],r.highlightOpacity,["case",["coalesce",["get","filled"],r.filled],["coalesce",["get","fillOpacity"],r.fillOpacity],0]]}}),z(t,{id:r.outlineLayerId,type:"line",source:r.sourceId,paint:{"line-color":["coalesce",["get","outlineColor"],r.outlineColor],"line-width":["coalesce",["get","outlineWidth"],r.outlineWidth],"line-opacity":["coalesce",["get","outlineOpacity"],r.outlineOpacity]}}),e.length>0&&a(e),p=e=>{if(e.features&&e.features.length>0){const o=e.features[0].id;l(o),t.getCanvas().style.cursor="pointer"}},g=e=>{if(e.features&&e.features.length>0){const o=e.features[0].id;c(o),t.getCanvas().style.cursor=""}},f=e=>{if(e.features&&e.features.length>0){const o=e.features[0];t.fire("polygonclick",{polygonId:o.id,feature:o,lngLat:e.lngLat})}},t.on("mouseenter",r.layerId,p),t.on("mouseleave",r.layerId,g),t.on("click",r.layerId,f),{addPolygon:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data,a=e.id||`polygon-${n.length}`;n.push(a);const s=i(e,a);return s&&(o.features.push(s),t.getSource(r.sourceId).setData(o)),a},updatePolygon:s,removePolygon:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data,i=o.features.findIndex((t=>t.id===e));if(-1!==i){o.features.splice(i,1),t.getSource(r.sourceId).setData(o);const a=n.indexOf(e);-1!==a&&n.splice(a,1)}},setData:a,highlightPolygon:l,unhighlightPolygon:c,clearHighlights:()=>{n.forEach((t=>{c(t)}))},show:()=>{t.getLayer(r.layerId)&&t.setLayoutProperty(r.layerId,"visibility","visible"),t.getLayer(r.outlineLayerId)&&t.setLayoutProperty(r.outlineLayerId,"visibility","visible")},hide:()=>{t.getLayer(r.layerId)&&t.setLayoutProperty(r.layerId,"visibility","none"),t.getLayer(r.outlineLayerId)&&t.setLayoutProperty(r.outlineLayerId,"visibility","none")},remove:()=>{v&&T(),t.getLayer(S)&&t.removeLayer(S),t.getLayer(C)&&t.removeLayer(C),t.getSource(L)&&t.removeSource(L),t.getSource(x)&&t.removeSource(x),t.getSource(r.sourceId)&&(t.getLayer(r.outlineLayerId)&&t.removeLayer(r.outlineLayerId),t.getLayer(r.layerId)&&t.removeLayer(r.layerId),t.getSource(r.sourceId)&&t.removeSource(r.sourceId),n.length=0)},getPolygonIds:()=>[...n],getPolygonData:h,getAllPolygons:()=>t.getSource(r.sourceId)?t.getSource(r.sourceId)._data.features:[],setAllFilled:u,setPolygonFilled:d,toggleAllFilled:()=>{u(!r.filled)},togglePolygonFilled:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data.features.find((t=>t.id===e));if(o){const t=void 0!==o.properties.filled?o.properties.filled:r.filled;d(e,!t)}},removeEventListeners:()=>{p&&t.off("mouseenter",r.layerId,p),g&&t.off("mouseleave",r.layerId,g),f&&t.off("click",r.layerId,f),N()},enterEditMode:(e,o={})=>{if(!n.includes(e))return!1;v=!0,w=e,k=o.onEditStart||null,R=o.onEditUpdate||null,D=o.onEditEnd||null;const i=h(e);if(!i)return!1;const a=i.geometry.coordinates[0];return _=a.slice(0,-1),t.getSource(x)||(t.addSource(x,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(t,{id:C,type:"fill",source:x,paint:{"fill-color":r.highlightColor,"fill-opacity":.3,"fill-outline-color":r.highlightColor}})),t.getSource(L)||(t.addSource(L,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(t,{id:S,type:"circle",source:L,paint:{"circle-radius":8,"circle-color":"#ff0000","circle-stroke-width":2,"circle-stroke-color":"#ffffff"}})),A(),F(),k&&"function"==typeof k&&k({polygonId:e,points:[..._],feature:i}),!0},exitEditMode:T,isEditMode:()=>v,getSelectedPolygonId:()=>w,getEditPoints:()=>v?[..._]:null,getEditData:()=>v&&w?{polygonId:w,points:[..._],isDragging:M,dragPointIndex:P}:null,options:r}};function U(t,e,o){const r=function(t,e){return 156543.03392*Math.cos(t*Math.PI/180)/Math.pow(2,e)}(o,"function"==typeof t.getZoom?t.getZoom():0);return!Number.isFinite(r)||r<=0?0:e/r}const q=(t,e=[],o={})=>{if(!t)throw new Error("地图实例不能为空");const r={...{sourceId:`polylines-source-${Date.now()}`,layerId:`polylines-layer-${Date.now()}`,defaultColor:"#3388ff",defaultWidth:3,defaultOpacity:.8,lineGapWidth:0,lineJoin:"round",lineCap:"round",showArrow:!1,arrowSize:1,arrowSpacing:50,arrowImagePath:"/bicMap/assets/img/arrow.png"},...o},n=e=>{const o={solid:[],dashed:[],dotted:[],dashdot:[]},n=[];return e.forEach((e=>{if(!e.path||e.path.length<2)return;const i=e.dashType||"solid";o[i]||(o[i]=[]),o[i].push({type:"Feature",properties:{id:e.id||`polyline-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,color:e.color||r.defaultColor,width:e.width||r.defaultWidth,opacity:void 0!==e.opacity?e.opacity:r.defaultOpacity,name:e.name||"",data:e.data||{}},geometry:{type:"LineString",coordinates:e.path}});if(void 0!==e.showArrow?e.showArrow:r.showArrow){const o=e.arrowSpacing||r.arrowSpacing,i=((e,o,r,n)=>{if(!e||e.length<2)return[];const i=[];for(let a=0;a<e.length-1;a++){const s=e[a],l=e[a+1],c=t.project(s),u=t.project(l),d=u.x-c.x,h=u.y-c.y,p=Math.sqrt(d*d+h*h),g=180*Math.atan2(h,d)/Math.PI,f=Math.max(1,Math.floor(p/n));for(let t=1;t<f;t++){const e=t/f,n=s[0]+(l[0]-s[0])*e,a=s[1]+(l[1]-s[1])*e;i.push({type:"Feature",properties:{color:o,opacity:r,angle:g},geometry:{type:"Point",coordinates:[n,a]}})}}return i})(e.path,e.color||r.defaultColor,void 0!==e.opacity?e.opacity:r.defaultOpacity,o);n.push(...i)}})),{groupedLines:o,arrowSymbols:n}},i={solid:[],dashed:[4,4],dotted:[1,3],dashdot:[4,2,1,2]},a={},s={},l=`${r.sourceId}-arrows-symbol`,c=`${r.layerId}-arrows-symbol`,u=e=>{t.getSource(l)?t.getSource(l).setData({type:"FeatureCollection",features:e}):t.addSource(l,{type:"geojson",data:{type:"FeatureCollection",features:e}}),t.hasImage("arrow-icon")||y(r.arrowImagePath).then((e=>{t.hasImage("arrow-icon")||t.addImage("arrow-icon",e)})).catch((e=>{const o=document.createElement("canvas");o.width=20,o.height=20;const r=o.getContext("2d");r.beginPath(),r.moveTo(4,10),r.lineTo(16,10),r.lineTo(12,6),r.moveTo(16,10),r.lineTo(12,14),r.strokeStyle="#0066FF",r.lineWidth=2,r.stroke(),t.hasImage("arrow-icon")||t.addImage("arrow-icon",o)})),!t.getLayer(c)&&e.length>0&&t.addLayer({id:c,type:"symbol",source:l,layout:{"icon-image":"arrow-icon","icon-size":r.arrowSize,"icon-rotate":["get","angle"],"icon-allow-overlap":!0},paint:{}})};return(e=>{const{groupedLines:o,arrowSymbols:n}=e;Object.entries(i).forEach((([e,n])=>{const i=`${r.sourceId}-${e}`,l=`${r.layerId}-${e}`;if(t.getSource(i)?t.getSource(i).setData({type:"FeatureCollection",features:o[e]||[]}):t.addSource(i,{type:"geojson",data:{type:"FeatureCollection",features:o[e]||[]}}),!t.getLayer(l)){const o={id:l,type:"line",source:i,layout:{"line-join":r.lineJoin,"line-cap":r.lineCap},paint:{"line-color":["get","color"],"line-width":["get","width"],"line-opacity":["get","opacity"],"line-gap-width":r.lineGapWidth}};"solid"!==e&&n.length>0&&(o.paint["line-dasharray"]=n),t.addLayer(o),(e=>{r.onClick&&(t.on("click",e,(t=>{t.features&&t.features.length>0&&r.onClick(t.features[0],t)})),t.on("mouseenter",e,(()=>{t.getCanvas().style.cursor="pointer"})),t.on("mouseleave",e,(()=>{t.getCanvas().style.cursor=""})))})(l)}a[e]=i,s[e]=l})),u(n)})(n(e)),{update:e=>{const o=n(e);Object.entries(i).forEach((([e])=>{const r=a[e];t.getSource(r)&&t.getSource(r).setData({type:"FeatureCollection",features:o.groupedLines[e]||[]})})),t.getSource(l)&&t.getSource(l).setData({type:"FeatureCollection",features:o.arrowSymbols}),o.arrowSymbols.length>0&&!t.getLayer(c)&&t.addLayer({id:c,type:"symbol",source:l,layout:{"icon-image":"arrow-icon","icon-size":r.arrowSize,"icon-rotate":["get","angle"],"icon-allow-overlap":!0},paint:{}})},updateArrowSize:e=>{t.getLayer(c)&&t.setLayoutProperty(c,"icon-size",e)},updatePolylineArrowSize:(e,o)=>{Object.entries(a).forEach((([r,n])=>{if(t.getSource(n)){if(t.getSource(n)._data.features.find((t=>t.properties.id===e))&&t.getSource(l)){const r=t.getSource(l)._data;r.features.filter((t=>t.properties.lineId===e)).forEach((t=>{t.properties.arrowSize=o})),t.getSource(l).setData(r)}}}))},addPolyline:e=>{const o=e.dashType||"solid",i=a[o];if(!t.getSource(i))return null;const s=t.getSource(i)._data,u=n([e]),d=u.groupedLines[o][0];if(d){if(s.features.push(d),t.getSource(i).setData(s),u.arrowSymbols.length>0){const e=t.getSource(l)._data;e.features.push(...u.arrowSymbols),t.getSource(l).setData(e),t.getLayer(c)||t.addLayer({id:c,type:"symbol",source:l,layout:{"icon-image":"arrow-icon","icon-size":r.arrowSize,"icon-rotate":["get","angle"],"icon-allow-overlap":!0},paint:{}})}return d.properties.id}return null},updatePolyline:(e,o)=>{const r=o.dashType||"solid";let i=null,s=-1;if(Object.entries(a).forEach((([o,r])=>{if(t.getSource(r)){const n=t.getSource(r)._data,a=n.features.findIndex((t=>t.properties.id===e));-1!==a&&(i={dashType:o,sourceId:r,data:n},s=a)}})),i&&-1!==s){const e=i.data;e.features.splice(s,1),t.getSource(i.sourceId).setData(e);const c=n([o]),u=c.groupedLines[r][0];if(u){const e=a[r],o=t.getSource(e)._data;if(o.features.push(u),t.getSource(e).setData(o),t.getSource(l)){const e=t.getSource(l)._data;c.arrowSymbols.length>0&&e.features.push(...c.arrowSymbols),t.getSource(l).setData(e)}}}},removePolyline:e=>{Object.values(a).forEach((o=>{if(t.getSource(o)){const r=t.getSource(o)._data,n=r.features.findIndex((t=>t.properties.id===e));-1!==n&&(r.features.splice(n,1),t.getSource(o).setData(r))}}))},clear:()=>{Object.values(a).forEach((e=>{t.getSource(e)&&t.getSource(e).setData({type:"FeatureCollection",features:[]})})),t.getSource(l)&&t.getSource(l).setData({type:"FeatureCollection",features:[]})},remove:()=>{Object.values(s).forEach((e=>{t.getLayer(e)&&t.removeLayer(e)})),Object.values(a).forEach((e=>{t.getSource(e)&&t.removeSource(e)})),t.getLayer(c)&&t.removeLayer(c),t.getSource(l)&&t.removeSource(l)}}},Y=(t,e)=>{const o=e[0]-t[0],r=e[1]-t[1],n=Math.sqrt(o*o+r*r);return 0===n?[0,0]:[-r/n,o/n]},X=(t,e=[],o={})=>{if(!t)throw new Error("地图实例不能为空");const r={...{sourceId:`widelines-source-${Date.now()}`,fillLayerId:`widelines-fill-layer-${Date.now()}`,outlineLayerId:`widelines-outline-layer-${Date.now()}`,defaultColor:"#3388ff",defaultWidth:10,defaultOpacity:.8,defaultOutlineColor:"#2266cc",defaultOutlineWidth:2,showOutline:!0,editPointColor:"#2266cc",editPointRadius:6,editPointStrokeColor:"#ffffff",editPointStrokeWidth:2},...o},n=t=>{const e=[];return t.forEach((t=>{if(!t.path||t.path.length<2)return;const o=void 0!==t.width?t.width:r.defaultWidth,n=((t,e)=>{if(!t||t.length<2)return[];const o=e/2,r=[],n=[];for(let i=0;i<t.length;i++){const e=t[i];let a;if(0===i)a=Y(e,t[i+1]);else if(i===t.length-1)a=Y(t[i-1],e);else{const o=Y(t[i-1],e),r=Y(e,t[i+1]),n=(o[0]+r[0])/2,s=(o[1]+r[1])/2,l=Math.sqrt(n*n+s*s);a=0===l?o:[n/l,s/l]}const s=o/111e3;r.push([e[0]+a[0]*s,e[1]+a[1]*s]),n.push([e[0]-a[0]*s,e[1]-a[1]*s])}return[...r,...n.reverse(),r[0]]})(t.path,o);0!==n.length&&e.push({type:"Feature",properties:{id:t.id||`wideline-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,color:t.color||r.defaultColor,opacity:void 0!==t.opacity?t.opacity:r.defaultOpacity,outlineColor:t.outlineColor||r.defaultOutlineColor,outlineWidth:void 0!==t.outlineWidth?t.outlineWidth:r.defaultOutlineWidth,width:o,name:t.name||"",data:t.data||{},originalPath:t.path},geometry:{type:"Polygon",coordinates:[n]}})})),{type:"FeatureCollection",features:e}},i=n(e);var a;t.getSource(r.sourceId)?t.getSource(r.sourceId).setData(i):t.addSource(r.sourceId,{type:"geojson",data:i}),t.getLayer(r.fillLayerId)||(t.addLayer({id:r.fillLayerId,type:"fill",source:r.sourceId,paint:{"fill-color":["get","color"],"fill-opacity":["get","opacity"]}}),a=r.fillLayerId,r.onClick&&(t.on("click",a,(t=>{t.features&&t.features.length>0&&r.onClick(t.features[0],t)})),t.on("mouseenter",a,(()=>{t.getCanvas().style.cursor="pointer"})),t.on("mouseleave",a,(()=>{t.getCanvas().style.cursor=""})))),r.showOutline&&!t.getLayer(r.outlineLayerId)&&t.addLayer({id:r.outlineLayerId,type:"line",source:r.sourceId,paint:{"line-color":["get","outlineColor"],"line-width":["get","outlineWidth"],"line-opacity":["get","opacity"]}});let s=!1,l=null,c=[],u=null,d=null,h=null,p=null,g=null,f=!1,m=-1,y=null,b=null,v=null,w=null,_=null;const x=()=>{if(!u||!t.getSource(u))return;const e=c.map(((t,e)=>({type:"Feature",properties:{index:e},geometry:{type:"Point",coordinates:t}})));t.getSource(u).setData({type:"FeatureCollection",features:e})};return w=`${r.sourceId}-highlight`,_=`${r.fillLayerId}-highlight`,t.getSource(w)||t.addSource(w,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),t.getLayer(_)||t.addLayer({id:_,type:"fill",source:w,paint:{"fill-color":"#ffeb3b","fill-opacity":.3}}),u=`${r.sourceId}-edit-points`,d=`${r.sourceId}-edit-points-layer`,t.getSource(u)||t.addSource(u,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),t.getLayer(d)||t.addLayer({id:d,type:"circle",source:u,paint:{"circle-color":r.editPointColor,"circle-radius":r.editPointRadius,"circle-stroke-color":r.editPointStrokeColor,"circle-stroke-width":r.editPointStrokeWidth}}),{setEditPointStyle:(e={})=>{if(!d||!t.getLayer(d))return;const o={editPointColor:e.color??r.editPointColor,editPointRadius:e.radius??r.editPointRadius,editPointStrokeColor:e.strokeColor??r.editPointStrokeColor,editPointStrokeWidth:e.strokeWidth??r.editPointStrokeWidth};r.editPointColor=o.editPointColor,r.editPointRadius=o.editPointRadius,r.editPointStrokeColor=o.editPointStrokeColor,r.editPointStrokeWidth=o.editPointStrokeWidth,t.setPaintProperty(d,"circle-color",r.editPointColor),t.setPaintProperty(d,"circle-radius",r.editPointRadius),t.setPaintProperty(d,"circle-stroke-color",r.editPointStrokeColor),t.setPaintProperty(d,"circle-stroke-width",r.editPointStrokeWidth)},update:e=>{const o=n(e);t.getSource(r.sourceId)&&t.getSource(r.sourceId).setData(o)},addWideLine:e=>{if(!t.getSource(r.sourceId))return null;const o=t.getSource(r.sourceId)._data,i=n([e]).features[0];return i?(o.features.push(i),t.getSource(r.sourceId).setData(o),i.properties.id):null},updateWideLine:(e,o)=>{if(!t.getSource(r.sourceId))return;const i=t.getSource(r.sourceId)._data,a=i.features.findIndex((t=>t.properties.id===e));if(-1!==a){const s=n([o]).features[0];s&&(s.properties.id=e,i.features[a]=s,t.getSource(r.sourceId).setData(i))}},removeWideLine:e=>{if(!t.getSource(r.sourceId))return;const o=t.getSource(r.sourceId)._data,n=o.features.findIndex((t=>t.properties.id===e));-1!==n&&(o.features.splice(n,1),t.getSource(r.sourceId).setData(o))},clear:()=>{t.getSource(r.sourceId)&&t.getSource(r.sourceId).setData({type:"FeatureCollection",features:[]})},show:()=>{t.getLayer(r.fillLayerId)&&t.setLayoutProperty(r.fillLayerId,"visibility","visible"),t.getLayer(r.outlineLayerId)&&t.setLayoutProperty(r.outlineLayerId,"visibility","visible")},hide:()=>{t.getLayer(r.fillLayerId)&&t.setLayoutProperty(r.fillLayerId,"visibility","none"),t.getLayer(r.outlineLayerId)&&t.setLayoutProperty(r.outlineLayerId,"visibility","none")},highlightWideLine:e=>{if(!w||!t.getSource(w))return;const o=t.getSource(r.sourceId)._data.features.find((t=>t.properties.id===e));o&&t.getSource(w).setData({type:"FeatureCollection",features:[o]})},clearHighlights:()=>{w&&t.getSource(w)&&t.getSource(w).setData({type:"FeatureCollection",features:[]})},enterEditMode:(e,o={})=>{if(s)return!1;const n=t.getSource(r.sourceId)._data.features.find((t=>t.properties.id===e));if(!n)return!1;const i=n.properties.originalPath||[];return l=e,c=[...i],s=!0,y=o.onEditStart,b=o.onEditUpdate,v=o.onEditEnd,x(),h=e=>{e.features&&e.features.length>0&&e.features[0].source===u&&(f=!0,m=e.features[0].properties.index,t.getCanvas().style.cursor="grabbing",e.preventDefault())},p=t=>{if(f&&m>=0){const e=[t.lngLat.lng,t.lngLat.lat];c[m]=e,x(),b&&"function"==typeof b&&b({widelineId:l,points:[...c],changedPointIndex:m,changedPoint:e,isDragging:!0,dragPointIndex:m}),t.preventDefault()}},g=e=>{f&&(f=!1,m=-1,t.getCanvas().style.cursor="",v&&"function"==typeof v&&v({widelineId:l,points:[...c],isDragging:!1,dragPointIndex:-1}),e.preventDefault())},t.on("mousedown",d,h),t.on("mousemove",p),t.on("mouseup",g),y&&"function"==typeof y&&y({widelineId:e,points:[...c],isDragging:!1,dragPointIndex:-1}),!0},exitEditMode:()=>{s&&(s=!1,l=null,c=[],u&&t.getSource(u)&&t.getSource(u).setData({type:"FeatureCollection",features:[]}),h&&t.off("mousedown",d,h),p&&t.off("mousemove",p),g&&t.off("mouseup",g),y=null,b=null,v=null)},isEditMode:()=>s,getSelectedWidelineId:()=>l,getEditPoints:()=>[...c],getEditData:()=>({widelineId:l,points:[...c],isDragging:f,dragPointIndex:m}),getWideLineData:e=>t.getSource(r.sourceId)._data.features.find((t=>t.properties.id===e)),getAllWideLines:()=>t.getSource(r.sourceId)._data.features,getWideLineIds:()=>t.getSource(r.sourceId)._data.features.map((t=>t.properties.id)),remove:()=>{s&&exitEditMode(),t.getLayer(r.fillLayerId)&&t.removeLayer(r.fillLayerId),t.getLayer(r.outlineLayerId)&&t.removeLayer(r.outlineLayerId),t.getSource(r.sourceId)&&t.removeSource(r.sourceId),t.getLayer(_)&&t.removeLayer(_),t.getSource(w)&&t.removeSource(w),t.getLayer(d)&&t.removeLayer(d),t.getSource(u)&&t.removeSource(u)}}};function Z(t,e,o={}){const{screenOffset:r=[0,0],className:n=""}=o;let i=r[0],a=r[1];const s=e.getContainer(),l=document.createElement("div");l.style.cssText="position:absolute;left:0;top:0;pointer-events:none;display:none;",n&&(l.className=n),s.appendChild(l);let c=null,u=!1,d=!1;function h(){if(!u||!c||d)return;const t=e.project(c),o=Math.round(t.x+i),r=Math.round(t.y+a);l.style.transform=`translate(calc(${o}px - 50%), calc(${r}px - 100%))`}function p(){if(d)throw new Error("[labelBubble] 实例已销毁,请重新创建。")}return e.on("render",h),{show(t,e){p(),c=t,function(t){void 0!==t&&("string"==typeof t?l.innerHTML=t:t instanceof HTMLElement&&(l.innerHTML="",l.appendChild(t)))}(e),u=!0,l.style.display="",h()},hide(){d||(u=!1,l.style.display="none")},setLngLat(t){p(),c=t,h()},setHTML(t){p(),l.innerHTML=t},setElement(t){p(),l.innerHTML="",l.appendChild(t)},getElement:()=>l,setScreenOffset(t){p(),i=t[0],a=t[1],h()},remove(){d||(d=!0,e.off("render",h),l.remove(),c=null)}}}function K(t,e={}){if(!t)throw new Error("地图未初始化。");const{sourceId:o=`circle-radius-draw-source-${Date.now()}`,fillLayerId:r=`circle-radius-draw-fill-${Date.now()}`,outlineLayerId:i=`circle-radius-draw-outline-${Date.now()}`,fillColor:a="#088",fillOpacity:s=.2,lineColor:l="#044",lineWidth:c=2,enableTouch:u=!0,onDrawStart:d=null,onDrawComplete:h=null}=e,p={enabled:!1,isPointerDown:!1,center:null,radiusM:0};let g=!1;const f=(e,o)=>{const r=((t,e)=>156543.03392*Math.cos(t*Math.PI/180)/Math.pow(2,e))(o,"function"==typeof t.getZoom?t.getZoom():0);return!Number.isFinite(r)||r<=0?0:e/r},m=(t,e)=>{if(null==n?void 0:n.distance)try{return n.distance(n.point(t),n.point(e),{units:"meters"})}catch(c){}const o=t=>t*Math.PI/180,r=o(t[1]),i=o(e[1]),a=i-r,s=o(e[0]-t[0]),l=Math.sin(a/2)**2+Math.cos(r)*Math.cos(i)*Math.sin(s/2)**2;return 12742017.6*Math.asin(Math.min(1,Math.sqrt(l)))},y={type:"FeatureCollection",features:[]},b=e=>{const r=t.getSource(o);(null==r?void 0:r.setData)&&r.setData({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"Point",coordinates:e}}]})},v=(e,o)=>{const n=f(e,o),a=Number.isFinite(n)?Math.max(0,n):0;t.getLayer(r)&&t.setPaintProperty(r,"circle-radius",a),t.getLayer(i)&&t.setPaintProperty(i,"circle-radius",a)},w=e=>{const o=e?s:0,n=e?1:0;t.getLayer(r)&&t.setPaintProperty(r,"circle-opacity",o),t.getLayer(i)&&t.setPaintProperty(i,"circle-stroke-opacity",n)},_=()=>{var e;const r=t.getSource(o);null==(e=null==r?void 0:r.setData)||e.call(r,y),p.center=null,p.radiusM=0,v(0,0),w(!1)},x=e=>{if(!e)return null;const o=t.getContainer().getBoundingClientRect();return[e.clientX-o.left,e.clientY-o.top]},C=e=>{var o,r;const n=(null==(o=null==e?void 0:e.touches)?void 0:o[0])||(null==(r=null==e?void 0:e.changedTouches)?void 0:r[0]);if(!n)return null;const i=t.getContainer().getBoundingClientRect();return[n.clientX-i.left,n.clientY-i.top]},E=e=>{if(!e)return null;const o=t.unproject(e);return o&&"number"==typeof o.lng&&"number"==typeof o.lat?[o.lng,o.lat]:null},I=()=>{t.dragPan&&"function"==typeof t.dragPan.isEnabled&&t.dragPan.isEnabled()&&(t.dragPan.disable(),g=!0)},L=()=>{g&&t.dragPan&&(t.dragPan.enable(),g=!1)},S=t=>{if(!p.enabled)return;if(0!==(null==t?void 0:t.button))return;t.preventDefault(),t.stopPropagation(),I();const e=E(x(t));e&&(p.isPointerDown=!0,p.center=e,p.radiusM=0,b(e),v(0,e[1]),w(!1),d&&"function"==typeof d&&d({center:e}))},M=t=>{if(!p.enabled||!p.isPointerDown)return;if(t.preventDefault(),!p.center)return;const e=E(x(t));if(!e)return;const o=m(p.center,e);p.radiusM=Number.isFinite(o)?Math.max(0,o):0,v(p.radiusM,p.center[1]),p.radiusM>0&&w(!0)},P=()=>{if(!p.enabled||!p.isPointerDown)return;if(p.isPointerDown=!1,L(),!p.center||p.radiusM<=0)return void _();const t={center:p.center,radiusM:p.radiusM},e={center:p.center,radius:p.radiusM,area:Math.PI*p.radiusM*p.radiusM,perimeter:2*Math.PI*p.radiusM};_(),h&&"function"==typeof h&&h(t,e)},k=()=>{!p.center||p.radiusM<=0||v(p.radiusM,p.center[1])},R=t=>{if(!p.enabled||!u)return;if(t.touches&&1!==t.touches.length)return;t.preventDefault(),t.stopPropagation(),I();const e=E(C(t));e&&(p.isPointerDown=!0,p.center=e,p.radiusM=0,b(e),v(0,e[1]),w(!1),d&&"function"==typeof d&&d({center:e}))},D=t=>{if(!p.enabled||!u||!p.isPointerDown)return;if(t.touches&&1!==t.touches.length)return;if(t.preventDefault(),!p.center)return;const e=E(C(t));if(!e)return;const o=m(p.center,e);p.radiusM=Number.isFinite(o)?Math.max(0,o):0,v(p.radiusM,p.center[1]),p.radiusM>0&&w(!0)},T=t=>{if(!p.enabled||!u||!p.isPointerDown)return;if(t.preventDefault(),p.isPointerDown=!1,L(),!p.center||p.radiusM<=0)return void _();const e={center:p.center,radiusM:p.radiusM},o={center:p.center,radius:p.radiusM,area:Math.PI*p.radiusM*p.radiusM,perimeter:2*Math.PI*p.radiusM};_(),h&&"function"==typeof h&&h(e,o)};(()=>{t.getSource(o)||t.addSource(o,{type:"geojson",data:y}),t.getLayer(r)||t.addLayer({id:r,type:"circle",source:o,paint:{"circle-color":a,"circle-opacity":0,"circle-radius":0}}),t.getLayer(i)||t.addLayer({id:i,type:"circle",source:o,paint:{"circle-color":"rgba(0,0,0,0)","circle-opacity":0,"circle-radius":0,"circle-stroke-color":l,"circle-stroke-width":c,"circle-stroke-opacity":0}});try{t.setPaintProperty(r,"circle-radius-transition",{duration:0,delay:0}),t.setPaintProperty(r,"circle-opacity-transition",{duration:0,delay:0}),t.setPaintProperty(i,"circle-radius-transition",{duration:0,delay:0}),t.setPaintProperty(i,"circle-stroke-opacity-transition",{duration:0,delay:0})}catch(e){}})();const A={enable(){p.enabled||(p.enabled=!0,t.getCanvas().style.cursor="crosshair",(()=>{t.on("zoom",k);const e=t.getCanvas();e.addEventListener("mousedown",S,{capture:!0}),window.addEventListener("mousemove",M,{passive:!1}),window.addEventListener("mouseup",P,{passive:!0}),u&&(e.addEventListener("touchstart",R,{passive:!1,capture:!0}),e.addEventListener("touchmove",D,{passive:!1}),e.addEventListener("touchend",T,{passive:!1}),e.addEventListener("touchcancel",T,{passive:!1}))})())},disable(){p.enabled&&(p.enabled=!1,p.isPointerDown=!1,(()=>{t.off("zoom",k);const e=t.getCanvas();e.removeEventListener("mousedown",S,{capture:!0}),window.removeEventListener("mousemove",M,{passive:!1}),window.removeEventListener("mouseup",P,{passive:!0}),e.removeEventListener("touchstart",R,{capture:!0}),e.removeEventListener("touchmove",D),e.removeEventListener("touchend",T),e.removeEventListener("touchcancel",T)})(),_(),L(),t.getCanvas().style.cursor="")},clearDrawing(){_(),L()}};return A.enable(),A}const J=new class{constructor(){this.maplibregl=null,this.turf=null,this.THREE=null,this.mapUtils=null,this.isLoaded=!1,this.resourcePaths={assetsUrl:"/bicMap/assets",fontsUrl:"/bicMap/assets/ttf",cssUrl:"/bicMap/bicMap.css",jsUrl:"/bicMap/bicMap.min.js"}}async init(e={}){if(this.isLoaded)return Promise.resolve();try{const{cssUrl:o="/bicMap/bicMap.css",jsUrl:r="/bicMap/bicMap.min.js",assetsUrl:a="/bicMap/assets",fontsUrl:s="/bicMap/assets/ttf"}=e;return this.resourcePaths={cssUrl:o,jsUrl:r,assetsUrl:a,fontsUrl:s},this.injectBaseStyles(),this.injectFontStyles(),o&&"/bicMap/bicMap.css"!==o&&await v(o),r&&"/bicMap/bicMap.min.js"!==r&&await b(r),this.maplibregl=t,this.turf=n,this.THREE=i,this.mapUtils=g,this.exposeGlobals(),this.isLoaded=!0,Promise.resolve()}catch(o){return Promise.reject(o)}}exposeGlobals(){"undefined"!=typeof window&&(window.maplibregl||(window.maplibregl=t),window.turf||(window.turf=n),window.THREE||(window.THREE={...i}),window.MapUtils||(window.MapUtils=g),window.cartesianToGPS||(window.cartesianToGPS=g.cartesianToGPS),window.GPSToCartesian||(window.GPSToCartesian=g.GPSToCartesian),window.getMapCorners||(window.getMapCorners=g.getMapCorners),window.getDistance||(window.getDistance=g.getDistance),window.validateDistance||(window.validateDistance=g.validateDistance))}injectBaseStyles(){const t="bic-maplibre-base-styles";if("undefined"==typeof document||document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.textContent=".maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' 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\")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%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%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%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%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%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%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%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 cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E\")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%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;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%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){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%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\")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:#0006;color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}",document.head.appendChild(e)}injectFontStyles(){const t="bic-dynamic-fonts";if("undefined"==typeof document||document.getElementById(t))return;const e=`\n @font-face {\n font-family: 'HarmonyOS Sans SC';\n src: url('${this.resourcePaths.fontsUrl}/HARMONYOS_SANS_SC_REGULAR.TTF') format('truetype');\n font-weight: 400;\n font-style: normal;\n font-display: swap;\n }\n\n @font-face {\n font-family: 'HarmonyOS Sans SC';\n src: url('${this.resourcePaths.fontsUrl}/HARMONYOS_SANS_SC_MEDIUM.TTF') format('truetype');\n font-weight: 500;\n font-style: normal;\n font-display: swap;\n }\n\n @font-face {\n font-family: 'HarmonyOS Sans SC';\n src: url('${this.resourcePaths.fontsUrl}/HARMONYOS_SANS_SC_BOLD.TTF') format('truetype');\n font-weight: 700;\n font-style: normal;\n font-display: swap;\n }\n\n @font-face {\n font-family: 'Harmony Bold';\n src: url('${this.resourcePaths.fontsUrl}/HARMONYOS_SANS_SC_BOLD.TTF') format('truetype');\n font-weight: bold;\n font-style: normal;\n font-display: swap;\n }\n\n @font-face {\n font-family: 'Harmony Regular';\n src: url('${this.resourcePaths.fontsUrl}/HARMONYOS_SANS_SC_REGULAR.TTF') format('truetype');\n font-weight: normal;\n font-style: normal;\n font-display: swap;\n }\n\n @font-face {\n font-family: 'Harmony Medium';\n src: url('${this.resourcePaths.fontsUrl}/HARMONYOS_SANS_SC_MEDIUM.TTF') format('truetype');\n font-weight: 500;\n font-style: normal;\n font-display: swap;\n }\n `,o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)}getAssetPath(t){if(!t)return this.resourcePaths.assetsUrl;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"))return t;if(t.startsWith("/bicMap/assets"))return t.replace("/bicMap/assets",this.resourcePaths.assetsUrl);const e=t.startsWith("/")?t:"/"+t;return this.resourcePaths.assetsUrl+e}getCursorStyle(t,e=10,o=10,r="auto"){return`url('${this.getAssetPath(t)}') ${e} ${o}, ${r}`}getFontPath(t){if(!t)return this.resourcePaths.fontsUrl;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"))return t;if(t.startsWith("/bicMap/assets/ttf"))return t.replace("/bicMap/assets/ttf",this.resourcePaths.fontsUrl);const e=t.startsWith("/")?t:"/"+t;return this.resourcePaths.fontsUrl+e}createMap(t){if(!this.isLoaded)throw new Error("BicMap未初始化。请先调用init()。");return function(t,e){if(!t)throw new Error("maplibregl未初始化。");const{container:o,center:r=[0,0],zoom:n=.1,pitch:i=0,bearing:a=0,maxPitch:s=60,antialias:l=!1,backgroundColor:c="#808080"}=e;if(!o)throw new Error("缺少容器ID");const u={version:8,name:"BlankMap",glyphs:"/bicMap/glyphs/{fontstack}/{range}.pbf",sources:{},minzoom:0,maxzoom:24,layers:[{id:"background",type:"background",paint:{"background-color":c}}]};return new t.Map({container:o,style:u,center:r,zoom:n,pitch:i,bearing:a,maxPitch:s,antialias:l,maxZoom:23.99,minZoom:0})}(this.maplibregl,t)}addGeoJSONSource(t,e,o){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return addGeoJSONSource(t,e,o)}addFillLayer(t,e,o,r={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return addFillLayer(t,e,o,r)}addLineLayer(t,e,o,r={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return addLineLayer(t,e,o,r)}addZoomControl(t,e="bottom-right"){if(!this.isLoaded||!t)throw new Error("地图未初始化。");!function(t,e,o="bottom-right"){if(!t||!e)throw new Error("地图未初始化。");e.addControl(new class{onAdd(t){return this._map=t,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._container.style.display="flex",this._container.style.flexDirection="column",this._zoomInButton=document.createElement("button"),this._zoomInButton.className="maplibregl-ctrl-zoom-in",this._zoomInButton.type="button",this._zoomInButton.innerHTML='<span class="maplibregl-ctrl-icon" aria-hidden="true" title="放大"></span>',this._zoomInButton.onclick=()=>{this._map.zoomIn()},this._zoomOutButton=document.createElement("button"),this._zoomOutButton.className="maplibregl-ctrl-zoom-out",this._zoomOutButton.type="button",this._zoomOutButton.innerHTML='<span class="maplibregl-ctrl-icon" aria-hidden="true" title="缩小"></span>',this._zoomOutButton.onclick=()=>{this._map.zoomOut()},this._container.appendChild(this._zoomInButton),this._container.appendChild(this._zoomOutButton),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}},o)}(this.maplibregl,t,e)}async loadSlamMap(t,e){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return async function(t,e){if(!t)throw new Error("地图未初始化。");const{startX:o,startY:r,xGridCount:n,yGridCount:i,resolution:a,imagePath:s,canvasId:l="canvasMap",fitBounds:c=!0,padding:u={top:30,bottom:30,left:30,right:30},zoomFactor:d=2}=e;let h=document.getElementById(l);h||(h=document.createElement("canvas"),h.id=l,h.style.display="none",document.body.appendChild(h));try{const e=g.getMapCorners({startX:o,startY:r,xGridCount:n,yGridCount:i,resolution:a}),f=e.topLeft,m=e.topRight,b=e.bottomRight,v=e.bottomLeft,w=h.getContext("2d");let x;h.width=n,h.height=i;try{x=await y(s),w.drawImage(x,0,0,n,i)}catch(p){w.fillStyle="#808080",w.fillRect(0,0,n,i),w.strokeStyle="#cccccc",w.lineWidth=.2;const t=10;for(let e=0;e<=n;e+=t)w.beginPath(),w.moveTo(e,0),w.lineTo(e,i),w.stroke();for(let e=0;e<=i;e+=t)w.beginPath(),w.moveTo(0,e),w.lineTo(n,e),w.stroke();w.fillStyle="red",w.font="12px Arial",w.textAlign="center",w.fillText("地图图片加载失败",n/2,i/2-10),w.fillText(s.substring(0,40)+"...",n/2,i/2+10)}const C=t=>{const e=g.cartesianToGPS({x:t[0],y:t[1],scale:a,zoomFactor:d});return[e.longitude,e.latitude]},E=C([f.x,f.y]),I=C([m.x,m.y]),L=C([b.x,b.y]),S=C([v.x,v.y]);let M=t.getSource("scanCanvasSource");M?M.setCoordinates([E,I,L,S]):(t.addSource("scanCanvasSource",{type:"canvas",canvas:l,animate:!0,coordinates:[E,I,L,S]}),z(t,{id:_,type:"raster",source:"scanCanvasSource",minzoom:0,maxzoom:24}));const P=C([v.x,v.y]),k=C([m.x,m.y]),R=t.cameraForBounds([P,k],{padding:u}),D=Object.assign({pitch:0,bearing:0},R);return c&&t.jumpTo(D),{corners:e,cameraBound:D,coordinates:[E,I,L,S]}}catch(p){throw p}}(t,e)}addDirectionalMarker(e,o,r={}){if(!this.isLoaded||!e)throw new Error("地图未初始化。");return r.imagePath?r.imagePath.startsWith("/bicMap/assets")&&(r.imagePath=this.getAssetPath(r.imagePath)):r.imagePath=this.getAssetPath("/svg/pos.svg"),function(e,o,r={}){if(!t||!e)throw new Error("地图未初始化。");const{imagePath:n="/bicMap/assets/svg/pos.svg",size:i=30,initialRotation:a=0,draggable:s=!0,rotationControl:l=!0,initialEditMode:c=!1,highlightStyle:u={},onChange:d=null}=r,{backgroundColor:h="rgba(76, 175, 80, 0.15)",borderColor:p="#4CAF50",shadowColor:g="rgba(76, 175, 80, 0.6)"}=u,f=Math.round(1.27*i),m=document.createElement("div");m.className="bic-directional-marker",m.style.width=`${i}px`,m.style.height=`${i}px`,m.style.cursor=c?"move":"pointer",m.style.position="absolute",m.style.transition="filter 0.2s ease-in-out",m.style.zIndex=1;const y=document.createElement("div");y.className="bic-marker-highlight",y.style.position="absolute",y.style.top="50%",y.style.left="50%",y.style.width=`${f}px`,y.style.height=`${f}px`,y.style.transform="translate(-50%, -50%)",y.style.borderRadius="50%",y.style.backgroundColor=h,y.style.border=`2px solid ${p}`,y.style.boxShadow=`0 0 5px ${g}`,y.style.display="none",y.style.zIndex=1,y.style.pointerEvents="none",m.appendChild(y);const b=document.createElement("div");b.style.width="100%",b.style.height="100%",b.style.position="relative",b.style.zIndex=1,b.style.transition="transform 0.2s ease-in-out",m.appendChild(b);const v=document.createElement("img");v.src=n,v.style.width="100%",v.style.height="100%",v.style.transition="transform 0.2s ease",v.style.transform=`rotate(${-a}deg)`,b.appendChild(v);const w=new t.Marker({element:m,draggable:!1,anchor:"center",rotationAlignment:"map"}).setLngLat(o).addTo(e);let _=a,x=null;if(l){const t=document.createElement("style");t.innerHTML=`\n .bic-rotation-control {\n position: absolute;\n top: -50px;\n left: 50%;\n transform: translateX(-50%);\n width: 130px;\n height: 45px;\n background-color: rgba(255, 255, 255, 0.8);\n border-radius: 5px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 10px;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);\n z-index: 9999;\n }\n .bic-rotation-slider {\n width: 80px;\n height: 10px;\n background-color: #e0e0e0;\n border-radius: 5px;\n position: relative;\n }\n .bic-rotation-handle {\n width: 5px;\n height: 16px;\n background-color: #4CAF50;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n cursor: pointer;\n box-shadow: 0 1px 3px rgba(0,0,0,0.3);\n }\n .bic-rotation-labels {\n display: flex;\n width: 85px;\n justify-content: space-between;\n font-size: 10px;\n color: #666;\n position: absolute;\n bottom: 10px;\n left:-3px;\n }\n .bic-marker-highlight {\n box-shadow: 0 0 8px ${g};\n }\n /* 调试边框样式 - 只在开发时使用 \n .bic-directional-marker {\n outline: 1px dashed red;\n }\n .bic-marker-highlight {\n outline: 1px dashed blue;\n }\n */\n `,document.head.appendChild(t),x=document.createElement("div"),x.className="bic-rotation-control",x.style.display="none";const e=document.createElement("span");e.textContent=`${Math.round(a)}°`;const o=document.createElement("div");o.style.position="relative",o.style.width="80px";const r=document.createElement("div");r.className="bic-rotation-slider";const n=document.createElement("div");n.className="bic-rotation-handle";const i=a/360*100;n.style.left=`${i}%`;const s=document.createElement("div");s.className="bic-rotation-labels",s.innerHTML="<span>0°</span><span>360°</span>",r.appendChild(n),o.appendChild(r),o.appendChild(s),x.appendChild(e),x.appendChild(o),m.appendChild(x);let l=!1;const c=t=>{const o=r.getBoundingClientRect(),i=o.width;let a=(t-o.left)/i*100;a=Math.max(0,Math.min(100,a)),n.style.left=`${a}%`,_=a/100*360,e.textContent=`${Math.round(_)}°`,v.style.transform=`rotate(${-_}deg)`,d&&"function"==typeof d&&d({lngLat:w.getLngLat(),rotation:_})};n.addEventListener("mousedown",(t=>{l=!0,t.preventDefault(),t.stopPropagation()})),r.addEventListener("mousedown",(t=>{l=!0,c(t.clientX),t.preventDefault(),t.stopPropagation()})),document.addEventListener("mousemove",(t=>{l&&c(t.clientX)})),document.addEventListener("mouseup",(()=>{l=!1}))}let C=!1;const E=()=>{C=!C,x&&(x.style.display=C?"flex":"none"),y&&(y.style.display=C?"block":"none"),w.setDraggable(C),C?(b.style.transform="scale(1.05)",m.style.filter=`drop-shadow(0 0 5px ${g})`,m.style.zIndex=3,m.style.cursor="move"):(b.style.transform="scale(1)",m.style.filter="none",m.style.zIndex=1,m.style.cursor="pointer")};return m.addEventListener("dblclick",(t=>{E(),t.preventDefault(),t.stopPropagation()})),s&&w.on("dragend",(()=>{d&&"function"==typeof d&&d({lngLat:w.getLngLat(),rotation:_})})),c&&E(),{marker:w,getPosition:()=>w.getLngLat(),setPosition:t=>w.setLngLat(t),getRotation:()=>_,setRotation:t=>{if(_=(t%360+360)%360,v.style.transform=`rotate(${-_}deg)`,x){x.querySelector("span").textContent=`${Math.round(_)}°`;const t=x.querySelector(".bic-rotation-handle");t&&(t.style.left=_/360*100+"%")}d&&"function"==typeof d&&d({lngLat:w.getLngLat(),rotation:_})},toggleEditMode:E,enableEditMode:()=>{C||E()},disableEditMode:()=>{C&&E()},remove:()=>w.remove(),isInEditMode:()=>C}}(e,o,r)}addBatchPOIMarkers(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return o.imagePath?o.imagePath.startsWith("/bicMap/assets")&&(o.imagePath=this.getAssetPath(o.imagePath)):o.imagePath=this.getAssetPath("/img/pos.png"),o.labelIconPath?o.labelIconPath.startsWith("/bicMap/assets")&&(o.labelIconPath=this.getAssetPath(o.labelIconPath)):o.labelIconPath=this.getAssetPath("/img/poi-sig.png"),N(t,e,o)}addRobotMarkers(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return o.svgPath?o.svgPath.startsWith("/bicMap/assets")&&(o.svgPath=this.getAssetPath(o.svgPath)):o.svgPath=this.getAssetPath("/img/robo.png"),O(t,e,o)}createPointCloud(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return B.createPointCloud(t,e,o)}createPointCloud3D(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return B.createPointCloud3D(t,e,o)}createRectangles(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return W(t,e,o)}createPolygons(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return V(t,e,o)}createCircles(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return function(t,e=[],o={}){if(!t)return null;const r={fillColor:"#3388ff",fillOpacity:.4,outlineColor:"#3388ff",outlineWidth:2,sourceId:`circle-source-${Date.now()}`,fillLayerId:`circle-fill-${Date.now()}`,outlineLayerId:`circle-outline-${Date.now()}`,...o},n={items:[]},i={type:"FeatureCollection",features:[]};function a(e,o){const r=e.center,n=e.radiusM;return{type:"Feature",id:o,properties:{id:o,radiusM:n,radiusPx:U(t,n,r[1]),fillColor:e.fillColor,fillOpacity:e.fillOpacity,outlineColor:e.outlineColor,outlineWidth:e.outlineWidth},geometry:{type:"Point",coordinates:r}}}function s(){const e=t.getSource(r.sourceId);(null==e?void 0:e.setData)&&e.setData({type:"FeatureCollection",features:n.items.map((t=>a(t,t.id)))})}function l(){const e=t.getSource(r.sourceId);(null==e?void 0:e.setData)&&e.setData({type:"FeatureCollection",features:n.items.map((e=>{const o=a(e,e.id);return o.properties.radiusPx=U(t,e.radiusM,e.center[1]),o}))})}t.getSource(r.sourceId)||t.addSource(r.sourceId,{type:"geojson",data:i}),t.getLayer(r.fillLayerId)||t.addLayer({id:r.fillLayerId,type:"circle",source:r.sourceId,paint:{"circle-color":["coalesce",["get","fillColor"],r.fillColor],"circle-opacity":["coalesce",["get","fillOpacity"],r.fillOpacity],"circle-radius":["coalesce",["get","radiusPx"],0]}}),t.getLayer(r.outlineLayerId)||t.addLayer({id:r.outlineLayerId,type:"circle",source:r.sourceId,paint:{"circle-color":"rgba(0,0,0,0)","circle-opacity":0,"circle-radius":["coalesce",["get","radiusPx"],0],"circle-stroke-color":["coalesce",["get","outlineColor"],r.outlineColor],"circle-stroke-width":["coalesce",["get","outlineWidth"],r.outlineWidth],"circle-stroke-opacity":1}});try{t.setPaintProperty(r.fillLayerId,"circle-radius-transition",{duration:0,delay:0}),t.setPaintProperty(r.outlineLayerId,"circle-radius-transition",{duration:0,delay:0})}catch(c){}return t.on("zoom",l),e.forEach((t=>{n.items.push({id:`circle-${Date.now()}-${Math.random().toString(16).slice(2)}`,center:t.center,radiusM:t.radiusM,fillColor:t.fillColor,fillOpacity:t.fillOpacity,outlineColor:t.outlineColor,outlineWidth:t.outlineWidth})})),s(),{addCircle(t){(null==t?void 0:t.center)&&"number"==typeof(null==t?void 0:t.radiusM)&&(n.items.push({id:`circle-${Date.now()}-${Math.random().toString(16).slice(2)}`,center:t.center,radiusM:t.radiusM,fillColor:t.fillColor,fillOpacity:t.fillOpacity,outlineColor:t.outlineColor,outlineWidth:t.outlineWidth}),s())},clear(){var e;n.items.length=0;const o=t.getSource(r.sourceId);null==(e=null==o?void 0:o.setData)||e.call(o,i)},remove(){t.off("zoom",l),t.getLayer(r.fillLayerId)&&t.removeLayer(r.fillLayerId),t.getLayer(r.outlineLayerId)&&t.removeLayer(r.outlineLayerId),t.getSource(r.sourceId)&&t.removeSource(r.sourceId)}}}(t,e,o)}createPolylines(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return o.arrowImagePath?o.arrowImagePath.startsWith("/bicMap/assets")&&(o.arrowImagePath=this.getAssetPath(o.arrowImagePath)):o.arrowImagePath=this.getAssetPath("/img/arrow.png"),q(t,e,o)}createWideLines(t,e=[],o={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return X(t,e,o)}enableRectangleDrawing(t,e={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return function(t,e,o={}){if(!e||!t)throw new Error("地图或Turf库未初始化。");const{fillColor:r="#088",fillOpacity:n=.5,lineColor:i="#044",lineWidth:a=2,onDrawComplete:s=null,enableTouch:l=!0}=o;let c=!1,u=null,d=null,h=null,p=0,g=!1;const f="rectangle-draw-source",m=L,y=S;e.getSource(f)||(e.addSource(f,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(e,{id:m,type:"fill",source:f,paint:{"fill-color":r,"fill-opacity":n,"fill-outline-color":i}}),z(e,{id:y,type:"line",source:f,paint:{"line-color":i,"line-width":a,"line-opacity":1}}));const b=(e,o)=>{const r=Math.min(e[0],o[0]),n=Math.max(e[0],o[0]),i=Math.min(e[1],o[1]),a=Math.max(e[1],o[1]),s=[[[r,i],[n,i],[n,a],[r,a],[r,i]]];return t.polygon(s)},v=t=>{if(!u)return;h=b(u,t);const o=e.getSource(f);o&&o.setData({type:"FeatureCollection",features:[h]})},w=t=>{const o=e.getContainer().getBoundingClientRect(),r=t.clientX-o.left,n=t.clientY-o.top;return e.unproject([r,n])},_=t=>{if(l)if(t.preventDefault(),p=t.touches.length,1===p){const o=t.touches[0],r=w(o);c=!0,u=[r.lng,r.lat],g||(e.dragPan.disable(),g=!0)}else p>=2&&(c&&(c=!1,u=null),g&&(e.dragPan.enable(),g=!1))},x=t=>{if(l&&(t.preventDefault(),p=t.touches.length,1===p&&c)){const e=t.touches[0],o=w(e),r=[o.lng,o.lat];v(r)}},C=t=>{if(!l)return;t.preventDefault();let o=null;if(t.changedTouches&&t.changedTouches.length>0&&(o=t.changedTouches[0]),p=t.touches.length,0===p){if(c&&u&&o){const t=w(o),r=[t.lng,t.lat],n=Math.abs(u[0]-r[0]),i=Math.abs(u[1]-r[1]),a=e.getSource(f),l=a&&a._data&&a._data.features&&a._data.features.length>0;if(n>1e-6||i>1e-6||l){d=b(u,r);const t=d.geometry.coordinates[0],e={northWest:t[0],northEast:t[1],southEast:t[2],southWest:t[3]};s&&"function"==typeof s&&s(d,e)}}c=!1,u=null,g&&(e.dragPan.enable(),g=!1)}else p>=2&&c&&(c=!1,u=null,e.getSource(f)&&e.getSource(f).setData({type:"FeatureCollection",features:[]}))},E=t=>{0===t.originalEvent.button&&(c=!0,u=[t.lngLat.lng,t.lngLat.lat],e.getCanvas().style.cursor="crosshair",t.preventDefault())},I=t=>{if(!c)return;const e=[t.lngLat.lng,t.lngLat.lat];v(e)},M=t=>{if(!c)return;const o=[t.lngLat.lng,t.lngLat.lat];if(u[0]!==o[0]&&u[1]!==o[1]){d=b(u,o);const t=d.geometry.coordinates[0],e={northWest:t[0],northEast:t[1],southEast:t[2],southWest:t[3]};s&&"function"==typeof s&&s(d,e)}c=!1,u=null,e.getCanvas().style.cursor=""},P=()=>{if(e.on("mousedown",E),e.on("mousemove",I),e.on("mouseup",M),l){const t=e.getCanvas();t.addEventListener("touchstart",_,{passive:!1}),t.addEventListener("touchmove",x,{passive:!1}),t.addEventListener("touchend",C,{passive:!1}),t.addEventListener("touchcancel",C,{passive:!1})}e.getCanvas().style.cursor="crosshair"};return P(),{enable:P,disable:()=>{if(e.off("mousedown",E),e.off("mousemove",I),e.off("mouseup",M),l){const t=e.getCanvas();t.removeEventListener("touchstart",_),t.removeEventListener("touchmove",x),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",C)}g&&(e.dragPan.enable(),g=!1),c=!1,u=null,p=0,e.getCanvas().style.cursor="",e.getSource(f)&&e.getSource(f).setData({type:"FeatureCollection",features:[]})},getDrawing:()=>d,clearDrawing:()=>{d=null,e.getSource(f)&&e.getSource(f).setData({type:"FeatureCollection",features:[]})}}}(this.turf,t,e)}enableCircleDrawing(t,e={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return K(t,e)}enablePolygonDrawing(t,e={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return function(t,e,o={}){if(!e||!t)throw new Error("地图或Turf库未初始化。");const{fillColor:r="#088",fillOpacity:n=.5,lineColor:i="#044",lineWidth:a=2,pointColor:s="#ff0000",pointRadius:l=5,onDrawComplete:c=null,enableTouch:u=!0,minPoints:d=3}=o;let h=!1,p=[],g=null,f=null,m=0,y=null;const b="polygon-draw-source",v="polygon-draw-points-source",w=M,_=P,x=k;e.getSource(b)||(e.addSource(b,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(e,{id:w,type:"fill",source:b,paint:{"fill-color":r,"fill-opacity":n,"fill-outline-color":i}}),z(e,{id:_,type:"line",source:b,paint:{"line-color":i,"line-width":a,"line-opacity":1}})),e.getSource(v)||(e.addSource(v,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(e,{id:x,type:"circle",source:v,paint:{"circle-radius":l,"circle-color":s,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}));const C=()=>{const t=p.map((t=>({type:"Feature",geometry:{type:"Point",coordinates:t}}))),o=e.getSource(v);o&&o.setData({type:"FeatureCollection",features:t})},E=(o=null)=>{if(p.length<2)return;let r=[...p];if(o&&r.push(o),r.length>=2){if(r.length<3)g={type:"Feature",geometry:{type:"LineString",coordinates:r}};else{const e=[...r,r[0]];g=t.polygon([e])}const o=e.getSource(b);o&&o.setData({type:"FeatureCollection",features:[g]})}},I=t=>{if(p.length<d)return!1;const o=p[0];Math.sqrt(Math.pow(t[0]-o[0],2)+Math.pow(t[1]-o[1],2));const r=e.project(o),n=e.project(t);return Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2))<15},L=()=>{if(p.length<d)return!1;const e=[...p,p[0]];f=t.polygon([e]);const o={area:t.area(f)/1e6,perimeter:t.length(t.polygonToLine(f),{units:"kilometers"}),center:t.center(f).geometry.coordinates,points:p,pointCount:p.length};return c&&"function"==typeof c&&c(f,o),h=!1,p=[],!0},S=t=>{if(0!==t.originalEvent.button)return;const e=[t.lngLat.lng,t.lngLat.lat];I(e)?L()&&(C(),E()):(p.push(e),h=!0,C(),E(),t.preventDefault())},R=t=>{if(!h||0===p.length)return;const e=[t.lngLat.lng,t.lngLat.lat];E(e)},D=t=>{!h||p.length<d||(t.preventDefault(),L()&&(C(),E()))},T=t=>{const o=e.getContainer().getBoundingClientRect(),r=t.clientX-o.left,n=t.clientY-o.top;return e.unproject([r,n])},A=t=>{if(!u)return;if(1!==t.touches.length)return;t.preventDefault();const e=t.touches[0],o=T(e),r=[o.lng,o.lat],n=Date.now();if(n-m<300&&y&&Math.sqrt(Math.pow(r[0]-y[0],2)+Math.pow(r[1]-y[1],2))<1e-4)return p.length>=d&&L()&&(C(),E()),m=0,void(y=null);I(r)?L()&&(C(),E()):(p.push(r),h=!0,C(),E(),m=n,y=r)},O=t=>{if(!u)return;if(1!==t.touches.length)return;if(!h||0===p.length)return;t.preventDefault();const e=t.touches[0],o=T(e),r=[o.lng,o.lat];E(r)},F=t=>{"Escape"===t.key?(p=[],h=!1,C(),e.getSource(b)&&e.getSource(b).setData({type:"FeatureCollection",features:[]})):"Enter"===t.key&&p.length>=d&&L()&&(C(),E())},N=()=>{if(e.on("click",S),e.on("mousemove",R),e.on("dblclick",D),u){const t=e.getCanvas();t.addEventListener("touchstart",A,{passive:!1}),t.addEventListener("touchmove",O,{passive:!1})}document.addEventListener("keydown",F),e.getCanvas().style.cursor="crosshair"};return N(),{enable:N,disable:()=>{if(e.off("click",S),e.off("mousemove",R),e.off("dblclick",D),u){const t=e.getCanvas();t.removeEventListener("touchstart",A),t.removeEventListener("touchmove",O)}document.removeEventListener("keydown",F),h=!1,p=[],m=0,y=null,e.getCanvas().style.cursor="",e.getSource(b)&&e.getSource(b).setData({type:"FeatureCollection",features:[]}),e.getSource(v)&&e.getSource(v).setData({type:"FeatureCollection",features:[]})},getDrawing:()=>f,getPoints:()=>p,clearDrawing:()=>{f=null,p=[],h=!1,C(),e.getSource(b)&&e.getSource(b).setData({type:"FeatureCollection",features:[]}),e.getSource(v)&&e.getSource(v).setData({type:"FeatureCollection",features:[]})},finishDrawing:()=>p.length>=d&&L()}}(this.turf,t,e)}enablePolylineDrawing(t,e={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return function(t,e,o={}){if(!e||!t)throw new Error("地图或Turf库未初始化。");const{fillColor:r="#3388ff",fillOpacity:n=.8,lineColor:i="#2266cc",lineWidth:a=2,pointColor:s="#ff0000",pointRadius:l=5,defaultWidth:c=20,onDrawComplete:u=null,enableTouch:d=!0,minPoints:h=2}=o;let p=!1,g=[],f=c,m=null,y=0,b=null;const v="polyline-draw-source",w="polyline-draw-points-source",_=R,x=D,C=T,E=(t,e)=>{const o=e[0]-t[0],r=e[1]-t[1],n=Math.sqrt(o*o+r*r);return 0===n?[0,0]:[-r/n,o/n]},I=(t,e)=>{if(!t||t.length<2)return[];const o=e/2,r=[],n=[];for(let i=0;i<t.length;i++){const e=t[i];let a;if(0===i)a=E(e,t[i+1]);else if(i===t.length-1)a=E(t[i-1],e);else{const o=E(t[i-1],e),r=E(e,t[i+1]),n=(o[0]+r[0])/2,s=(o[1]+r[1])/2,l=Math.sqrt(n*n+s*s);a=0===l?o:[n/l,s/l]}const s=o/111e3;r.push([e[0]+a[0]*s,e[1]+a[1]*s]),n.push([e[0]-a[0]*s,e[1]-a[1]*s])}return[...r,...n.reverse(),r[0]]};e.getSource(v)||(e.addSource(v,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(e,{id:_,type:"fill",source:v,paint:{"fill-color":r,"fill-opacity":n,"fill-outline-color":i}}),z(e,{id:x,type:"line",source:v,paint:{"line-color":i,"line-width":a,"line-opacity":1}})),e.getSource(w)||(e.addSource(w,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),z(e,{id:C,type:"circle",source:w,paint:{"circle-radius":l,"circle-color":s,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}));const L=()=>{const t=g.map((t=>({type:"Feature",geometry:{type:"Point",coordinates:t}}))),o=e.getSource(w);o&&o.setData({type:"FeatureCollection",features:t})},S=(t=null)=>{if(g.length<1)return;let o=[...g];if(t&&o.push(t),o.length>=2){const t=I(o,f);if(t.length>0){const o={type:"Feature",geometry:{type:"Polygon",coordinates:[t]},properties:{width:f}},r=e.getSource(v);r&&r.setData({type:"FeatureCollection",features:[o]})}}else if(1===o.length){const t=e.getSource(v);t&&t.setData({type:"FeatureCollection",features:[]})}},M=()=>{if(g.length<h)return!1;const e=t.lineString(g),o=t.length(e,{units:"kilometers"}),r=I(g,f);let n=0;if(r.length>0){const e=t.polygon([r]);n=t.area(e)/1e6}const i={path:g,width:f,length:o,area:n,pointCount:g.length};return m=i,u&&"function"==typeof u&&u(i),p=!1,g=[],!0},P=t=>{if(0!==t.originalEvent.button)return;const e=[t.lngLat.lng,t.lngLat.lat];g.push(e),p=!0,L(),S(),t.preventDefault()},k=t=>{if(!p||0===g.length)return;const e=[t.lngLat.lng,t.lngLat.lat];S(e)},A=t=>{!p||g.length<h||(t.preventDefault(),M()&&(L(),S()))},O=t=>{const o=e.getContainer().getBoundingClientRect(),r=t.clientX-o.left,n=t.clientY-o.top;return e.unproject([r,n])},F=t=>{if(!d)return;if(1!==t.touches.length)return;t.preventDefault();const e=t.touches[0],o=O(e),r=[o.lng,o.lat],n=Date.now();if(n-y<300&&b&&Math.sqrt(Math.pow(r[0]-b[0],2)+Math.pow(r[1]-b[1],2))<1e-4)return g.length>=h&&M()&&(L(),S()),y=0,void(b=null);g.push(r),p=!0,L(),S(),y=n,b=r},N=t=>{if(!d)return;if(1!==t.touches.length)return;if(!p||0===g.length)return;t.preventDefault();const e=t.touches[0],o=O(e),r=[o.lng,o.lat];S(r)},G=t=>{"Escape"===t.key?(g=[],p=!1,L(),e.getSource(v)&&e.getSource(v).setData({type:"FeatureCollection",features:[]})):"Enter"===t.key&&g.length>=h&&M()&&(L(),S())},j=()=>{if(e.on("click",P),e.on("mousemove",k),e.on("dblclick",A),d){const t=e.getCanvas();t.addEventListener("touchstart",F,{passive:!1}),t.addEventListener("touchmove",N,{passive:!1})}document.addEventListener("keydown",G),e.getCanvas().style.cursor="crosshair"};return j(),{enable:j,disable:()=>{if(e.off("click",P),e.off("mousemove",k),e.off("dblclick",A),d){const t=e.getCanvas();t.removeEventListener("touchstart",F),t.removeEventListener("touchmove",N)}document.removeEventListener("keydown",G),p=!1,g=[],y=0,b=null,e.getCanvas().style.cursor="",e.getSource(v)&&e.getSource(v).setData({type:"FeatureCollection",features:[]}),e.getSource(w)&&e.getSource(w).setData({type:"FeatureCollection",features:[]})},getDrawing:()=>m,getPoints:()=>g,setWidth:t=>{f=t,S()},getWidth:()=>f,clearDrawing:()=>{m=null,g=[],p=!1,L(),e.getSource(v)&&e.getSource(v).setData({type:"FeatureCollection",features:[]}),e.getSource(w)&&e.getSource(w).setData({type:"FeatureCollection",features:[]})},finishDrawing:()=>g.length>=h&&M()}}(this.turf,t,e)}createLabelBubble(t,e={}){if(!this.isLoaded||!t)throw new Error("地图未初始化。");return Z(this.maplibregl,t,e)}static loadResources(t){return w(t)}static loadCSS(t){return v(t)}static loadScript(t){return b(t)}},Q={IDLE:"idle",MOVING:"moving",ROTATING:"rotating",ARRIVED:"arrived",DWELLING:"dwelling",WAITING:"waiting",CHARGING:"charging",DOCKING:"docking",ERROR:"error",RECOVERING:"recovering",RETURNING:"returning",MANUAL:"manual",PAUSED:"paused"},tt={[Q.IDLE]:new Set([Q.MOVING,Q.ROTATING,Q.WAITING,Q.CHARGING,Q.DOCKING,Q.ERROR,Q.MANUAL]),[Q.MOVING]:new Set([Q.ARRIVED,Q.ROTATING,Q.WAITING,Q.IDLE,Q.RETURNING,Q.PAUSED,Q.ERROR]),[Q.ROTATING]:new Set([Q.MOVING,Q.IDLE,Q.ERROR]),[Q.ARRIVED]:new Set([Q.IDLE,Q.MOVING,Q.DWELLING,Q.WAITING,Q.CHARGING,Q.DOCKING,Q.ERROR,Q.PAUSED]),[Q.DWELLING]:new Set([Q.MOVING,Q.IDLE,Q.ERROR,Q.PAUSED]),[Q.WAITING]:new Set([Q.MOVING,Q.IDLE,Q.ERROR,Q.PAUSED]),[Q.CHARGING]:new Set([Q.IDLE,Q.MOVING,Q.ERROR,Q.PAUSED]),[Q.DOCKING]:new Set([Q.CHARGING,Q.IDLE,Q.MOVING,Q.ERROR,Q.PAUSED]),[Q.ERROR]:new Set([Q.RECOVERING,Q.IDLE,Q.MANUAL]),[Q.RECOVERING]:new Set([Q.MOVING,Q.ERROR,Q.IDLE]),[Q.RETURNING]:new Set([Q.DOCKING,Q.CHARGING,Q.IDLE,Q.ERROR,Q.PAUSED]),[Q.MANUAL]:new Set([Q.IDLE,Q.MOVING,Q.ERROR,Q.RECOVERING]),[Q.PAUSED]:new Set([Q.MOVING,Q.DWELLING,Q.WAITING,Q.IDLE])};function et(t,e){const o=tt[t];return!!o&&o.has(e)}const ot={PATROL:"patrol",POI:"poi",WAIT_ELEVATOR:"wait_elevator",WAIT_TRAFFIC:"wait_traffic",WAIT_DOOR:"wait_door",WAIT_SIGNAL:"wait_signal",CHARGING:"charging",DOCK:"dock",FLOOR_TRANSITION:"floor_transition",SERVICE:"service",HOLD:"hold",HANDOVER:"handover"};class rt{constructor(){this._handlers=new Map}register(t,e){this._handlers.set(t,e)}get(t){return this._handlers.get(t)}has(t){return this._handlers.has(t)}unregister(t){this._handlers.delete(t)}}class nt{constructor(){this._met=!1}evaluate(t){throw new Error("Subclass must implement evaluate()")}reset(){this._met=!1}isMet(){return this._met}}class it extends nt{constructor(t){super(),this._targetMs=t,this._started=!1}evaluate(t){this._started||(this._startTime=t.elapsed,this._started=!0);const e=this._targetMs-(t.elapsed-this._startTime);return this._met=e<=0,{met:this._met,remaining:Math.max(0,e)}}reset(){super.reset(),this._started=!1}}class at extends nt{constructor(t,e={}){super(),this._signalName=t,this._timeout=e.timeout||0,this._signalData=null,this._received=!1}evaluate(t){return t.signals&&t.signals[this._signalName]&&(this._received=!0,this._signalData=t.signals[this._signalName]),this._met=this._received,{met:this._met}}getSignalData(){return this._signalData}reset(){super.reset(),this._received=!1,this._signalData=null}}class st extends nt{constructor(t,e){super(),this._robotId=t,this._minDistance=e}evaluate(t){const e=t.robotStates&&t.robotStates[this._robotId];if(!e||!t.currentPosition)return{met:!1};const o=t.currentPosition.x-e.position.x,r=t.currentPosition.y-e.position.y,n=Math.sqrt(o*o+r*r);return this._met=n>=this._minDistance,{met:this._met,remaining:Math.max(0,this._minDistance-n)}}}class lt extends nt{constructor(t,e,o={}){super(),this._resourceType=t,this._resourceId=e,this._shared=o.shared||!1}evaluate(t){const e=t.resourceManager;if(!e)return{met:!1};const o=e.getStatus(this._resourceType,this._resourceId);return this._met="free"===o||this._shared&&"shared"===o,{met:this._met}}}class ct extends nt{constructor(...t){super(),this._conditions=t}evaluate(t){for(const e of this._conditions){if(!e.evaluate(t).met)return this._met=!1,{met:!1}}return this._met=!0,{met:!0}}reset(){super.reset();for(const t of this._conditions)t.reset()}}class ut extends nt{constructor(...t){super(),this._conditions=t}evaluate(t){for(const e of this._conditions){if(e.evaluate(t).met)return this._met=!0,{met:!0}}return this._met=!1,{met:!1}}reset(){super.reset();for(const t of this._conditions)t.reset()}}class dt extends nt{constructor(t){super(),this._condition=t}evaluate(t){const e=this._condition.evaluate(t);return this._met=!e.met,{met:this._met}}reset(){super.reset(),this._condition.reset()}}class ht extends nt{constructor(t,e={}){super(),this._type=t,this._targetValue=e.value,this._operator=e.operator||"eq"}evaluate(t){const e=t.sensors;if(!e||!(this._type in e))return{met:!1};const o=e[this._type],r=this._targetValue;switch(this._operator){case"eq":this._met=o===r;break;case"neq":this._met=o!==r;break;case"gt":this._met=o>r;break;case"gte":this._met=o>=r;break;case"lt":this._met=o<r;break;case"lte":this._met=o<=r;break;default:this._met=!1}return{met:this._met}}}class pt extends nt{constructor(t,e="free"){super(),this._zoneId=t,this._state=e}evaluate(t){const e=t.zones;return e?(this._met=e[this._zoneId]===this._state,{met:this._met}):{met:!1}}}class gt extends nt{constructor(t,e={}){super(),this._floor=t,this._direction=e.direction||null,this._elevatorId=e.elevatorId||null,this._requireDoorsOpen=!1!==e.requireDoorsOpen}evaluate(t){const e=t.elevators;if(!e)return{met:!1};const o=this._elevatorId?e[this._elevatorId]?[[this._elevatorId,e[this._elevatorId]]]:[]:Object.entries(e);for(const[,r]of o){const t=r.floor===this._floor,e=!this._direction||r.direction===this._direction,o=!this._requireDoorsOpen||!0===r.doorsOpen;if(t&&e&&o)return this._met=!0,{met:!0}}return this._met=!1,{met:!1}}}class ft extends nt{constructor(t,e={}){super(),this._color=t,this._lightId=e.lightId||null}evaluate(t){const e=t.trafficLights;return e?this._lightId?(this._met=e[this._lightId]===this._color,{met:this._met}):(this._met=Object.values(e).some((t=>t===this._color)),{met:this._met}):{met:!1}}}const mt={"guide-indoor":{type:"guide",capabilities:["patrol","announce","follow-human"],kinematics:{maxSpeed:1,acceleration:.5,rotationSpeed:90},battery:{capacity:100,drainMove:.0017,drainIdle:1e-4,drainWait:3e-4,drainRotate:8e-4},display:{markerType:"robot-guide",model3D:"guide-bot.glb",icon:"robot-guide"},sensors:["lidar","depth-camera","mic"]},"patrol-outdoor":{type:"patrol",capabilities:["patrol","surveillance","alarm"],kinematics:{maxSpeed:2.5,acceleration:1,rotationSpeed:60},battery:{capacity:200,drainMove:.003,drainIdle:2e-4,drainWait:5e-4,drainRotate:.001},display:{markerType:"robot-patrol",model3D:"patrol-bot.glb",icon:"robot-patrol"},sensors:["360-camera","thermal","gas-detector"],weatherResistant:!0},"delivery-indoor":{type:"delivery",capabilities:["transport","dock","call-elevator"],kinematics:{maxSpeed:1.5,acceleration:.8,rotationSpeed:120},battery:{capacity:150,drainMove:.002,drainIdle:15e-5,drainWait:4e-4,drainRotate:9e-4},display:{markerType:"robot-delivery",model3D:"delivery-bot.glb",icon:"robot-delivery"},sensors:["lidar","depth-camera"],cargo:{maxLoad:50,compartments:3}}};function yt(t,e={}){const o=mt[t];if(!o)throw new Error(`Unknown robot profile type: "${t}". Available types: ${Object.keys(mt).join(", ")}`);return bt(o,e)}function bt(t,e){const o={...t};for(const r of Object.keys(e))null===e[r]||"object"!=typeof e[r]||Array.isArray(e[r])||"object"!=typeof t[r]||Array.isArray(t[r])?o[r]=e[r]:o[r]=bt(t[r],e[r]);return o}class vt{constructor(){this._handlers=new Map}on(t,e){return this._handlers.has(t)||this._handlers.set(t,new Set),this._handlers.get(t).add(e),()=>this.off(t,e)}off(t,e){const o=this._handlers.get(t);o&&(o.delete(e),0===o.size&&this._handlers.delete(t))}once(t,e){const o=(...r)=>{this.off(t,o),e(...r)};return this.on(t,o)}emit(t,e){const o=this._handlers.get(t);if(o)for(const r of o)r(e,t)}waitFor(t,e){return new Promise((o=>{let r=null;const n=this.once(t,(t=>{r&&clearTimeout(r),o(t)}));e&&e>0&&(r=setTimeout((()=>{n(),o(null)}),e))}))}clear(){this._handlers.clear()}listenerCount(t){const e=this._handlers.get(t);return e?e.size:0}}class wt{constructor(t,e,o){this.resourceType=t,this.resourceId=e,this.robotId=o,this.acquiredAt=Date.now(),this._released=!1}isReleased(){return this._released}}const _t="free",xt="busy",Ct="shared";class Et{constructor(){this._resources=new Map}_makeKey(t,e){return`${t}:${e}`}registerResource(t,e){const o=this._makeKey(t,e);this._resources.has(o)||this._resources.set(o,{status:_t,robotId:null,queue:[]})}acquire(t,e,o,r={}){const n=this._makeKey(t,e);this.registerResource(t,e);const i=this._resources.get(n);return i.status===_t?(i.status=r.shared?Ct:xt,i.robotId=o,Promise.resolve(new wt(t,e,o))):r.shared&&i.status===Ct?Promise.resolve(new wt(t,e,o)):new Promise((t=>{i.queue.push({robotId:o,resolve:t,shared:!!r.shared})}))}release(t){if(t.isReleased())return;const e=this._makeKey(t.resourceType,t.resourceId),o=this._resources.get(e);if(o)if(t._released=!0,o.queue.length>0){const e=o.queue.shift();o.robotId=e.robotId,o.status=e.shared?Ct:xt,e.resolve(new wt(t.resourceType,t.resourceId,e.robotId))}else o.status=_t,o.robotId=null}getStatus(t,e){const o=this._makeKey(t,e),r=this._resources.get(o);return r?{status:r.status,robotId:r.robotId,queueLength:r.queue.length}:{status:_t,robotId:null,queueLength:0}}}const It={PENDING:"pending",IDLE:"idle",RUNNING:"running",COMPLETED:"completed",FAILED:"failed",CANCELLED:"cancelled"};class Lt{constructor(t={}){this.config=t,this._status=It.PENDING}start(t){this._status=It.RUNNING}update(t,e){return this._status}cancel(t){this._status=It.CANCELLED}getStatus(){return this._status}isCompleted(){return this._status===It.COMPLETED}reset(){this._status=It.PENDING}}class St extends Lt{constructor(t={}){super(t),this.target=t.target||[0,0],this.kinematics=t.kinematics||{maxSpeed:1,acceleration:.5,rotationSpeed:90},this.tolerance=t.tolerance||.5,this.batteryConfig=t.batteryConfig||{drainMove:.0017,drainRotate:8e-4},this.onArriveCallback=t.onArrive||null,this._started=!1}start(t){super.start(t),this._started=!0}update(t,e){if(this._status===It.COMPLETED||this._status===It.FAILED)return this._status;this._started||this.start(e);const o=t/1e3,r=this.target[0],n=this.target[1],i=e.position,a=e.heading,s=r-i.x,l=n-i.y,c=Math.sqrt(s*s+l*l);if(c<this.tolerance)return i.x=r,i.y=n,this._status=It.COMPLETED,e.phase=Q.ARRIVED,"function"==typeof this.onArriveCallback&&this.onArriveCallback(e),It.COMPLETED;const u=(180*Math.atan2(s,l)/Math.PI+360)%360,d=this.kinematics.rotationSpeed*o,h=(u-a+540)%360-180,p=Math.abs(h);if(p>1)return e.phase=Q.ROTATING,e.heading=p<=d?u:(a+Math.sign(h)*d+360)%360,void 0!==e.battery&&(e.battery=Math.max(0,e.battery-this.batteryConfig.drainRotate*t)),It.RUNNING;e.phase=Q.MOVING,e.heading=u;const g=Math.min(this.kinematics.maxSpeed*o,c),f=e.heading*Math.PI/180;return i.x+=Math.sin(f)*g,i.y+=Math.cos(f)*g,void 0!==e.battery&&(e.battery=Math.max(0,e.battery-this.batteryConfig.drainMove*t)),It.RUNNING}cancel(){this._started=!1,super.cancel()}reset(){super.reset(),this._started=!1}}class Mt extends Lt{constructor({condition:t,timeout:e=3e4}={}){super({condition:t,timeout:e}),this._condition=t,this._timeout=e,this._elapsed=0}start(t){super.start(t),this._elapsed=0,this._condition&&"function"==typeof this._condition.reset&&this._condition.reset(),t.phase=Q.WAITING}update(t,e){if(this._status!==It.RUNNING)return this._status;if(this._elapsed+=t,this._timeout>0&&this._elapsed>=this._timeout)return this._status=It.FAILED,this._status;const o={...e,elapsed:this._elapsed};return this._condition.evaluate(o).met&&(this._status=It.COMPLETED),this._status}cancel(t){super.cancel(t)}reset(){super.reset(),this._elapsed=0,this._condition&&"function"==typeof this._condition.reset&&this._condition.reset()}}class Pt extends Lt{constructor({action:t,params:e}={}){super({action:t,params:e}),this._action=t,this._params=e,this._resolved=!1,this._failed=!1,this._launched=!1}start(t){super.start(t),this._resolved=!1,this._failed=!1,this._launched=!1}update(t,e){return this._status!==It.RUNNING?this._status:(this._launched||(this._launched=!0,Promise.resolve().then((()=>this._action(e,this._params))).then((()=>{this._resolved=!0})).catch((()=>{this._failed=!0}))),this._failed?(this._status=It.FAILED,this._status):this._resolved?(this._status=It.COMPLETED,this._status):It.RUNNING)}reset(){super.reset(),this._resolved=!1,this._failed=!1,this._launched=!1}}class kt{constructor(t,e,o={}){this._id=t,this._profile="string"==typeof e?yt(e):e,this._phase=o.phase||Q.IDLE,this._position=o.position||{x:0,y:0},this._heading=o.heading||0,this._battery=void 0!==o.battery?o.battery:this._profile.battery.capacity,this._floor=o.floor||"1F",this._taskStatus=It.IDLE,this._currentTask=null,this._taskPromise=null,this._taskResolve=null,this._taskReject=null,this._phaseChangeHandlers=new Set,this._errorHandlers=new Set,this._signalHandlers=new Map,this._context={position:this._position,heading:this._heading,battery:this._battery,phase:this._phase,elapsed:0,signals:{},robotStates:{},eventBus:null,resourceManager:null,sensors:{},zones:{},elevators:{},trafficLights:{}}}getId(){return this._id}getProfile(){return this._profile}getPhase(){return this._phase}getPosition(){return{...this._position}}getHeading(){return this._heading}getBattery(){return this._battery}getFloor(){return this._floor}getTaskStatus(){return this._taskStatus}setPosition(t,e){this._position.x=t,this._position.y=e}setHeading(t){this._heading=t}setEventBus(t){this._context.eventBus=t}setResourceManager(t){this._context.resourceManager=t}updateEnv(t={}){t.sensors&&Object.assign(this._context.sensors,t.sensors),t.zones&&Object.assign(this._context.zones,t.zones),t.elevators&&Object.assign(this._context.elevators,t.elevators),t.trafficLights&&Object.assign(this._context.trafficLights,t.trafficLights)}_transitionTo(t){if(!et(this._phase,t))return!1;const e=this._phase;return this._phase=t,this._context.phase=t,this._notifyPhaseChange(e,t),!0}moveTo(t,e={}){const o=new St({target:t,tolerance:e.tolerance||.5,kinematics:this._profile.kinematics,batteryConfig:this._profile.battery,onArrive:e.onArrive});return this._executeTask(o)}waitFor(t,e={}){const o=new Mt({condition:t,timeout:void 0!==e.timeout?e.timeout:3e4});return this._executeTask(o)}performAction(t,e){const o=new Pt({action:t,params:e});return this._executeTask(o)}execute(t){return this._executeTask(t)}_executeTask(t){return this._currentTask&&this._currentTask.cancel(),this._currentTask=t,this._taskPromise=new Promise(((t,e)=>{this._taskResolve=t,this._taskReject=e})),t.start(this._context),this._taskStatus=It.RUNNING,this._taskPromise}tick(t){if(!this._currentTask||this._taskStatus!==It.RUNNING)return this._taskStatus;this._context.elapsed+=t,this._context.position=this._position,this._context.heading=this._heading,this._context.battery=this._battery,this._context.phase=this._phase;const e=this._currentTask.update(t,this._context);return this._phase=this._context.phase,this._heading=this._context.heading,this._battery=this._context.battery,e===It.COMPLETED?(this._taskStatus=It.COMPLETED,this._currentTask=null,this._taskResolve&&(this._taskResolve(),this._taskResolve=null,this._taskReject=null)):e===It.FAILED?(this._taskStatus=It.FAILED,this._currentTask=null,this._taskReject&&(this._taskReject(new Error("Task failed")),this._taskResolve=null,this._taskReject=null)):e===It.CANCELLED&&(this._taskStatus=It.CANCELLED,this._currentTask=null,this._taskReject&&(this._taskReject(new Error("Task cancelled")),this._taskResolve=null,this._taskReject=null)),this._taskStatus}cancelCurrentTask(){this._currentTask&&(this._currentTask.cancel(),this._currentTask=null),this._taskStatus=It.CANCELLED,this._taskReject&&(this._taskReject(new Error("Task cancelled")),this._taskResolve=null,this._taskReject=null),this._transitionTo(Q.IDLE)}emergencyStop(){this.cancelCurrentTask(),this._transitionTo(Q.MANUAL)}resume(){this._phase!==Q.PAUSED&&this._phase!==Q.MANUAL||this._transitionTo(Q.IDLE)}emitSignal(t,e){const o=this._signalHandlers.get(t);if(o)for(const r of o)r(e,t)}onSignal(t,e){this._signalHandlers.has(t)||this._signalHandlers.set(t,new Set),this._signalHandlers.get(t).add(e)}onPhaseChange(t){return this._phaseChangeHandlers.add(t),()=>this._phaseChangeHandlers.delete(t)}onError(t){return this._errorHandlers.add(t),()=>this._errorHandlers.delete(t)}_notifyPhaseChange(t,e){for(const o of this._phaseChangeHandlers)o(this._id,t,e)}_notifyError(t){for(const e of this._errorHandlers)e(this._id,t)}}const Rt={MODE_2D:"2d",MODE_3D:"3d",BOTH:"both"};const Dt={idle:{color:"#64748B",label:"待机"},running:{color:"#0066FF",label:"执行中"},charging:{color:"#F7A800",label:"充电"},error:{color:"#FF3B30",label:"故障"},returning:{color:"#06B6D4",label:"召回中"}};function Tt(t,e){const{showStatus:o,showBattery:r,GPSToCartesian:n}=e,i=Dt[t.status]??Dt.idle,a=i.color,s=document.createElement("div");s.className="bic-robot-label bic-robot-status-label",s.style.cssText=["position:absolute","pointer-events:none","display:block","text-align:center","margin-top:-50px","transform:translateX(-50%)","z-index:2"].join(";");const l=document.createElement("div");l.style.cssText="position:relative;padding:0;margin-bottom:7px;display:inline-block;";const c=document.createElement("table");c.style.cssText=["border-collapse:collapse","border-radius:6px","overflow:hidden",`border:1px solid ${a}`,"min-width:120px",`box-shadow:0 1px 4px ${a}33`,"width:100%",`background-color:${a}`].join(";");const u=document.createElement("tr"),d=document.createElement("td");d.style.cssText=["background-color:#FFFFFF","padding:3px 8px","height:18px","text-align:center","vertical-align:middle"].join(";");let h="";if(n){const e=n(t.lngLat[0],t.lngLat[1]),o=(t.rotation??0).toFixed(1);h=`${e.x},${e.y},${o}°`}else h=t.task?t.task.length>14?t.task.slice(0,14)+"…":t.task:`${t.lngLat[0].toFixed(4)}, ${t.lngLat[1].toFixed(4)}`;d.innerHTML=`<span style="color:${a};font-size:10px;font-family:Harmony Regular,sans-serif;line-height:1;white-space:nowrap;letter-spacing:-0.2px;">${h}</span>`,u.appendChild(d),c.appendChild(u);const p=document.createElement("tr"),g=document.createElement("td");g.style.cssText=[`background-color:${a}`,"padding:3px 6px","height:20px","display:flex","align-items:center","justify-content:center","gap:5px"].join(";");const f=t.name||"未命名机器人";let m=`<span style="color:#fff;font-size:12px;font-weight:bold;font-family:Harmony Regular,sans-serif;line-height:1;white-space:nowrap;">${f.length>8?f.slice(0,8)+"…":f}</span>`;return o&&t.status&&"idle"!==t.status&&(m+=`<span style="display:inline-flex;align-items:center;"><span style="width:6px;height:6px;border-radius:50%;background:#fff;margin-right:2px;"></span><span style="color:#fff;font-size:9px;line-height:1;white-space:nowrap;">${i.label}</span></span>`),r&&null!=t.battery&&(m+=`<span style="display:flex;align-items:center;">${function(t){const e=function(t){return t>=60?"#1CD5A4":t>=20?"#F7A800":"#FF3B30"}(t),o=Math.round(t/100*4);let r="";for(let n=0;n<4;n++)r+=`<rect x="${2+4*n}" y="2" width="3" height="8" rx="0.5" fill="${n<o?e:"rgba(255,255,255,0.25)"}"/>`;return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="12" viewBox="0 0 20 12"><rect x="0" y="1" width="17" height="10" rx="1.5" stroke="${e}" stroke-width="1" fill="none"/><rect x="17" y="4" width="2" height="4" rx="0.5" fill="${e}"/>`+r+"</svg>"}(t.battery)}</span>`),g.innerHTML=m,p.appendChild(g),c.appendChild(p),l.appendChild(c),s.appendChild(l),s}function At({startX:t,startY:e,width:o,height:r,scale:n,zoomFactor:i=2}){function a(n,i){return{x:t+n*o,y:e+i*r}}function s(t,e){const o=window.MapUtils.cartesianToGPS({x:t,y:e,scale:n,zoomFactor:i});return[o.longitude,o.latitude]}return{fracToCart:a,cartToGPS:s,fracToGPS:function(t,e){const o=a(t,e);return s(o.x,o.y)}}}function zt(t,e,o){let r=!1;const n=o.length;for(let i=0,a=n-1;i<n;a=i++){const[n,s]=o[i],[l,c]=o[a];s>e!=c>e&&t<(l-n)*(e-s)/(c-s)+n&&(r=!r)}return r}function Ot(t,e,o,r,n,i,a,s){const l=o-t,c=r-e,u=a-n,d=s-i,h=l*d-c*u;if(Math.abs(h)<1e-10)return!1;const p=((n-t)*d-(i-e)*u)/h,g=((n-t)*c-(i-e)*l)/h;return p>=0&&p<=1&&g>=0&&g<=1}function Ft(t,e,o,r,n){const i=n.length;for(let a=0,s=i-1;a<i;s=a++){const[i,l]=n[a],[c,u]=n[s];if(Ot(t,e,o,r,i,l,c,u))return!0}return zt((t+o)/2,(e+r)/2,n)}const Nt=[[-1,-1],[0,-1],[1,-1],[-1,0],[1,0],[-1,1],[0,1],[1,1]],Gt=.5,jt=2.8,$t=.8,Ht=2,Bt=3,Wt=.05,Vt=.05,Ut=0,qt=.05;class Yt{constructor(t={}){const{widthMeters:e,heightMeters:o,...r}=t;if(null==e||null==o)throw new Error("Pathfinder: widthMeters and heightMeters are required");this.widthMeters=e,this.heightMeters=o,this.gridSize=r.gridSize??Gt,this.turnPenalty=r.turnPenalty??jt,this.diagonalPenalty=r.diagonalPenalty??$t,this.smoothClearance=r.smoothClearance??Ht,this.dilatePasses=r.dilatePasses??Bt,this.marginLeft=r.marginLeft??Wt,this.marginRight=r.marginRight??Vt,this.marginTop=r.marginTop??Ut,this.marginBottom=r.marginBottom??qt,this.cols=Math.ceil(this.widthMeters/this.gridSize),this.rows=Math.ceil(this.heightMeters/this.gridSize),this.cellCount=this.cols*this.rows,this._obstacleGrid=null,this._forbiddenZones=null}setObstacles(t){this._obstacleGrid=this._buildObstacleGrid(t||[]),this._forbiddenZones=t||null}findPath(t,e){const[o,r]=t,[n,i]=e,a=this._obstacleGrid;if(!a)return null;const s=Math.min(this.cols-1,Math.max(0,Math.round(o*this.cols))),l=Math.min(this.rows-1,Math.max(0,Math.round(r*this.rows))),c=Math.min(this.cols-1,Math.max(0,Math.round(n*this.cols))),u=Math.min(this.rows-1,Math.max(0,Math.round(i*this.rows))),d=this._nearestWalkableCell({col:s,row:l},a),h=this._nearestWalkableCell({col:c,row:u},a);if(!d||!h)return null;if(d.col===h.col&&d.row===h.row)return[[o,r]];const p=this._aStar(a,d.col,d.row,h.col,h.row);if(!p)return null;return this._compactPath(p,a).map((t=>[t.col/this.cols,t.row/this.rows]))}_buildObstacleGrid(t){const e=[];for(let r=0;r<this.rows;r++)e[r]=new Array(this.cols).fill(!0);for(const r of t){const t=r.polygon;if(!t||t.length<3)continue;let o=1/0,n=1/0,i=-1/0,a=-1/0;for(const[e,r]of t)e<o&&(o=e),r<n&&(n=r),e>i&&(i=e),r>a&&(a=r);const s=Math.max(0,Math.floor(o*this.cols)),l=Math.min(this.cols-1,Math.ceil(i*this.cols)),c=Math.max(0,Math.floor(n*this.rows)),u=Math.min(this.rows-1,Math.ceil(a*this.rows));for(let r=c;r<=u;r++)for(let o=s;o<=l;o++){zt(o/this.cols,r/this.rows,t)&&(e[r][o]=!1)}}let o=e.map((t=>[...t]));for(let r=0;r<this.dilatePasses;r++){const t=o.map((t=>[...t]));for(let e=0;e<this.rows;e++)for(let r=0;r<this.cols;r++)o[e][r]||(e>0&&(t[e-1][r]=!1),e<this.rows-1&&(t[e+1][r]=!1),r>0&&(t[e][r-1]=!1),r<this.cols-1&&(t[e][r+1]=!1));o=t}for(let r=0;r<this.rows;r++)for(let t=0;t<this.cols;t++){const e=t/this.cols,n=r/this.rows;(e<this.marginLeft||e>1-this.marginRight||n>1-this.marginBottom||n<this.marginTop)&&(o[r][t]=!1)}return o}_cellDistance(t,e,o,r){return Math.hypot(o-t,r-e)}_cellIndex(t,e){return e*this.cols+t}_indexToCell(t){return{col:t%this.cols,row:Math.floor(t/this.cols)}}_isCellInBounds(t,e){return t>=0&&t<this.cols&&e>=0&&e<this.rows}_reconstructPath(t,e){const o=[];let r=e;for(;-1!==r;)o.push(this._indexToCell(r)),r=t[r];return o.reverse()}_popBestCell(t,e,o){let r=0,n=o[t[0]];for(let a=1;a<t.length;a++)o[t[a]]<n&&(n=o[t[a]],r=a);const i=t[r];return t.splice(r,1),e.delete(i),i}_nearestWalkableCell(t,e){var o;if(null==(o=e[t.row])?void 0:o[t.col])return t;const r=[t],n=new Set([`${t.col},${t.row}`]);let i=0;for(;i<r.length;){const t=r[i++];for(const[o,i]of Nt){const a=t.col+o,s=t.row+i;if(!this._isCellInBounds(a,s))continue;const l=`${a},${s}`;if(!n.has(l)){if(e[s][a])return{col:a,row:s};n.add(l),r.push({col:a,row:s})}}}return null}_aStar(t,e,o,r,n){if(e===r&&o===n)return[{col:e,row:o}];if(!t[o][e]||!t[n][r])return null;const i=new Float64Array(this.cellCount).fill(1e30),a=new Float64Array(this.cellCount).fill(1e30),s=new Int32Array(this.cellCount).fill(-1),l=new Int8Array(this.cellCount).fill(-1),c=this._cellIndex(e,o);i[c]=0,a[c]=this._cellDistance(e,o,r,n);const u=[c],d=new Set([c]);for(;u.length;){const e=this._popBestCell(u,d,a),o=this._indexToCell(e);if(o.col===r&&o.row===n)return this._reconstructPath(s,e);for(let c=0;c<Nt.length;c++){const[h,p]=Nt[c],g=o.col+h,f=o.row+p;if(!this._isCellInBounds(g,f))continue;if(!t[f][g])continue;if(!(0===h||0===p||t[o.row][g]&&t[f][o.col]))continue;const m=this._cellIndex(g,f),y=Math.hypot(h,p),b=-1===l[e]||l[e]===c?0:this.turnPenalty,v=0!==h&&0!==p?this.diagonalPenalty:0,w=i[e]+y+b+v;w>=i[m]||(s[m]=e,l[m]=c,i[m]=w,a[m]=w+this._cellDistance(g,f,r,n),d.has(m)||(u.push(m),d.add(m)))}}return null}_hasClearance(t,e,o,r){for(let n=-r;n<=r;n++)for(let i=-r;i<=r;i++){const r=t+i,a=e+n;if(!this._isCellInBounds(r,a)||!o[a][r])return!1}return!0}_hasLineOfSight(t,e,o){let r=t.col,n=t.row;const i=e.col,a=e.row,s=Math.abs(i-r),l=Math.abs(a-n),c=r<i?1:-1,u=n<a?1:-1;let d=s-l;for(;;){if(!this._isCellInBounds(r,n)||!o[n][r])return!1;if(this.smoothClearance>0&&!this._hasClearance(r,n,o,this.smoothClearance))return!1;if(r===i&&n===a)break;const t=2*d;t>-l&&(d-=l,r+=c),t<s&&(d+=s,n+=u)}if(this._forbiddenZones){const o=t.col/this.cols,r=t.row/this.rows,n=e.col/this.cols,i=e.row/this.rows;for(const t of this._forbiddenZones)if(t.polygon&&t.polygon.length>=3&&Ft(o,r,n,i,t.polygon))return!1}return!0}_compactPath(t,e){if(t.length<3)return t;const o=[t[0]];let r=0;for(;r<t.length-1;){let n=r+1;for(let o=t.length-1;o>r+1;o--)if(this._hasLineOfSight(t[r],t[o],e)){n=o;break}o.push(t[n]),r=n}return o}}function Xt(t,e,o,r,n,i){const a=n-o,s=i-r,l=a*a+s*s;if(0===l)return[o,r];let c=((t-o)*a+(e-r)*s)/l;return c=Math.max(0,Math.min(1,c)),[o+c*a,r+c*s]}function Zt(t,e,o){if(!o)return!1;for(const r of o)if(zt(t,e,r.polygon))return!0;return!1}function Kt(t,e,o,r=.01){const n=o.find((o=>zt(t,e,o.polygon)))||null;if(!n)return[t,e];const i=n.polygon;let a=1/0,s=[t,e];for(let w=0,_=i.length-1;w<i.length;_=w++){const[o,r]=i[_],[n,l]=i[w],[c,u]=Xt(t,e,o,r,n,l),d=t-c,h=e-u,p=d*d+h*h;p<a&&(a=p,s=[c,u])}const[l,c]=s;let u=t-l,d=e-c;const h=Math.sqrt(u*u+d*d);if(h>0)return u/=h,d/=h,[l-u*r,c-d*r];let p=0,g=0;for(const[w,_]of i)p+=w,g+=_;const f=p/i.length,m=g/i.length,y=t-f,b=e-m,v=Math.sqrt(y*y+b*b);return v>0?(u=y/v,d=b/v):(u=1,d=0),[l+u*r,c+d*r]}function Jt(t,e,o,r,n,i=.01){const a=n.find((o=>zt(t,e,o.polygon)))||null;if(!a)return[t,e];const s=a.polygon;let l=1/0,c=null;for(const[v,w]of s){const t=v-o,e=w-r,n=t*t+e*e;n<l&&(l=n,c=[v,w])}let u=0,d=0;for(const[v,w]of s)u+=v,d+=w;const h=u/s.length,p=d/s.length,[g,f]=c,m=h-g,y=p-f,b=Math.sqrt(m*m+y*y);return[g+m/b*i,f+y/b*i]}function Qt({poiXFrac:t,poiYFrac:e,prevXFrac:o,prevYFrac:r,forbiddenZones:n,meterToFrac:i=.01}){const a=n.find((o=>zt(t,e,o.polygon)))||null;if(!a)return[t,e];const s=[],l=new Set;for(const y of a.polygon){const t=`${y[0]},${y[1]}`;l.has(t)||(l.add(t),s.push(y))}const c=s.map((t=>{const e=t[0]-o,n=t[1]-r;return{vertex:t,distanceSq:e*e+n*n}}));c.sort(((t,e)=>t.distanceSq-e.distanceSq));const u=c[0].vertex,d=c[1].vertex,h=(u[0]+d[0])/2,p=(u[1]+d[1])/2,g=h-s.reduce(((t,e)=>t+e[0]),0)/s.length,f=p-s.reduce(((t,e)=>t+e[1]),0)/s.length,m=Math.sqrt(g*g+f*f);return 0===m?[h,p]:[h+g/m*i,p+f/m*i]}let te=null,ee=0;let oe=null;function re(t,e){return Zt(t[0],t[1],e)?Kt(t[0],t[1],e):t}function ne(t,e,o){return Zt(t[0],t[1],o)?e?Qt({poiXFrac:t[0],poiYFrac:t[1],prevXFrac:e[0],prevYFrac:e[1],forbiddenZones:o,meterToFrac:ee}):Jt(t[0],t[1],(null==e?void 0:e[0])||.5,(null==e?void 0:e[1])||.5,o):t}function ie(t,e,o,r,n){for(const i of n){const n=i.polygon;if(n&&!(n.length<3))for(let i=0,a=n.length-1;i<n.length;a=i++){const[s,l]=n[i],[c,u]=n[a];if(ae(t,e,o,r,s,l,c,u))return!0}}return!1}function ae(t,e,o,r,n,i,a,s){const l=o-t,c=r-e,u=a-n,d=s-i,h=l*d-c*u;if(Math.abs(h)<1e-10)return!1;const p=((n-t)*d-(i-e)*u)/h,g=((n-t)*c-(i-e)*l)/h;return p>=0&&p<=1&&g>=0&&g<=1}class se{constructor(t){this.nodes=t.nodes,this.edges=t.edges,this.nodeIndex=function(t){const e={};for(const o of t)e[o.id]=o.coordinates;return e}(t.nodes),this.adjacency=function(t,e,o){const r={};for(const n of t)r[n.id]=[];for(const n of e)o[n.from]&&o[n.to]&&(r[n.from].push({to:n.to,edgeId:n.id,weight:n.weight}),r[n.to].push({to:n.from,edgeId:n.id,weight:n.weight}));return r}(t.nodes,t.edges,this.nodeIndex)}findPath(t,e,o={}){const r=o.excludeNodeIds??[],n=r instanceof Set?r:new Set(r),i=this.nodeIndex[e];if(!i)return null;if(!this.adjacency[t])return null;const a=t=>{const e=this.nodeIndex[t];if(!e)return 0;const o=e[0]-i[0],r=e[1]-i[1];return Math.sqrt(o*o+r*r)},s={},l={},c={},u=new Set,d=[];for(const h of Object.keys(this.adjacency))s[h]=1/0,l[h]=1/0,c[h]=null;for(s[t]=0,l[t]=a(t),d.push({nodeId:t,fScore:l[t]}),u.add(t);d.length>0;){d.sort(((t,e)=>t.fScore-e.fScore));const{nodeId:t}=d.shift();if(u.delete(t),t===e){const t=[];let o=e;for(;null!==o;)t.unshift(o),o=c[o];return t.length>1?t:null}for(const e of this.adjacency[t]||[]){if(n.has(e.to))continue;const o=s[t]+e.weight;o>=s[e.to]||(c[e.to]=t,s[e.to]=o,l[e.to]=o+a(e.to),u.has(e.to)||(d.push({nodeId:e.to,fScore:l[e.to]}),u.add(e.to)))}}return null}findNearestNode(t,e){let o=null,r=1/0;for(const n of this.nodes){const[i,a]=n.coordinates,s=i-t,l=a-e,c=s*s+l*l;c<r&&(r=c,o={id:n.id,coordinates:n.coordinates,distance:Math.sqrt(c)})}return o}planCircuit(t,e,o={}){const{excludeNodeIds:r=[],algorithm:n="auto"}=o;if(r instanceof Set||new Set(r),0===e.length)return null;const i=this._analyzeSubgraph(e),{oddCount:a,components:s}=i;if("chinesePostman"===n||"auto"===n&&a<=24){const o=this.planChinesePostmanCircuit(t,e,{excludeNodeIds:r});if(o)return o}if(s&&s.length>1){const o=this._planByComponent(t,e,s,{excludeNodeIds:r});if(o)return o}const l=this.planGreedyCircuit(t,e,{excludeNodeIds:r});return l||this._planEdgeByEdge(t,e,{excludeNodeIds:r})}planChinesePostmanCircuit(t,e,o={}){const r=o.excludeNodeIds??[],n=r instanceof Set?r:new Set(r),i=this.edges.filter((t=>e.includes(t.id)&&!n.has(t.from)&&!n.has(t.to))),a=new Set;for(const v of i)a.add(v.from),a.add(v.to);const s=Array.from(a);if(0===s.length||0===i.length)return null;const l={};for(const v of s)l[v]=0;for(const v of i)l[v.from]++,l[v.to]++;const c=s.filter((t=>l[t]%2!=0));if(0===c.length)return this._findEulerianCircuit(i,t);const u={};for(const v of s)u[v]=new Set;for(const v of i)u[v.from].add(v.to),u[v.to].add(v.from);const d=new Set,h=[];for(const v of s){if(d.has(v))continue;const t=[],e=[v];for(d.add(v);e.length>0;){const o=e.shift();t.push(o);for(const t of u[o])d.has(t)||(d.add(t),e.push(t))}const o=i.filter((e=>t.includes(e.from)&&t.includes(e.to))).length;h.push({nodeIds:t,edgeCount:o})}h.length;const p={};for(const v of c)for(let t=0;t<h.length;t++)if(h[t].nodeIds.includes(v)){p[v]=t;break}const g=[];for(let v=0;v<h.length;v++){const t=c.filter((t=>p[t]===v));t.length>0&&g.push(t)}const f={},m={};for(const v of c)f[v]={},m[v]={};const y=[];for(const v of g){if(v.length<2)continue;for(const e of v)f[e][e]=0;for(let e=0;e<v.length;e++)for(let t=e+1;t<v.length;t++){const o=this.findPath(v[e],v[t],{excludeNodeIds:r});if(o){let r=0;for(let t=0;t<o.length-1;t++){const e=(this.adjacency[o[t]]||[]).find((e=>e.to===o[t+1]));e&&(r+=e.weight)}f[v[e]][v[t]]=r,f[v[t]][v[e]]=r,m[v[e]][v[t]]=o,m[v[t]][v[e]]=[...o].reverse()}else f[v[e]][v[t]]=1/0,f[v[t]][v[e]]=1/0}const t=this._minWeightPerfectMatching(v,f);t&&t.length>0&&y.push(...t)}if(0===y.length)return null;const b=[...i];for(const[v,w]of y){const t=m[v][w];if(t&&!(t.length<2))for(let e=0;e<t.length-1;e++){const o=t[e],r=t[e+1];if(i.some((t=>t.from===o&&t.to===r||t.from===r&&t.to===o)))b.push({id:`cpp_dup_${o}_${r}_${b.length}`,from:o,to:r,weight:0});else{const t=(this.adjacency[o]||[]).find((t=>t.to===r));t&&b.push({id:`cpp_virtual_${o}_${r}_${b.length}`,from:o,to:r,weight:t.weight})}}}return this._findEulerianCircuit(b,t)}planGreedyCircuit(t,e,o={}){const r=o.excludeNodeIds??[],n=r instanceof Set?r:new Set(r),i=new Set(e),a=new Set,s=[t];let l=t;for(;a.size<i.size;){let t=null,e=1/0,o=null,c=null;for(const r of this.adjacency[l]||[])i.has(r.edgeId)&&!a.has(r.edgeId)&&r.weight<e&&(e=r.weight,t=r,c=l);if(!t)for(const[s,u]of Object.entries(this.adjacency))if(!n.has(s))for(const n of u){if(!i.has(n.edgeId)||a.has(n.edgeId))continue;const u=this.findPath(l,s,{excludeNodeIds:r});if(!u)continue;let d=0;for(let t=0;t<u.length-1;t++){const e=(this.adjacency[u[t]]||[]).find((e=>e.to===u[t+1]));e&&(d+=e.weight)}const h=d+n.weight;h<e&&(e=h,t=n,o=u,c=s)}if(!t)break;o&&o.length>1?s.push(...o.slice(1)):c&&c!==l&&s.push(c),s.push(t.to),a.add(t.edgeId),l=t.to}if(s[s.length-1]!==t){const e=this.findPath(l,t,{excludeNodeIds:r});e&&s.push(...e.slice(1))}return s}_analyzeSubgraph(t){const e=this.edges.filter((e=>t.includes(e.id))),o={};for(const l of e)o[l.from]=(o[l.from]||0)+1,o[l.to]=(o[l.to]||0)+1;const r=Object.keys(o),n=r.filter((t=>o[t]%2!=0)).length,i={};for(const l of r)i[l]=new Set;for(const l of e)i[l.from].add(l.to),i[l.to].add(l.from);const a=new Set,s=[];for(const l of r){if(a.has(l))continue;const t=[],o=[l];for(a.add(l);o.length>0;){const e=o.shift();t.push(e);for(const t of i[e])a.has(t)||(a.add(t),o.push(t))}const r=e.filter((e=>t.includes(e.from)&&t.includes(e.to))).length;s.push({nodeIds:t,edgeCount:r})}return{nodeIds:r,oddCount:n,edgeCount:e.length,components:s}}_minWeightPerfectMatching(t,e){const o=t.length;if(0===o)return[];if(o%2!=0)return[];if(o>16)return this._greedyMatching(t,e);const r=1<<o,n=new Float64Array(r).fill(1/0);n[0]=0;const i=new Int32Array(r).fill(-1);for(let l=0;l<r;l++){if(n[l]===1/0)continue;let r=-1;for(let t=0;t<o;t++)if(!(l&1<<t)){r=t;break}if(-1!==r)for(let a=r+1;a<o;a++){if(l&1<<a)continue;const s=l|1<<r|1<<a,c=e[t[r]][t[a]];if(c===1/0)continue;const u=n[l]+c;u<n[s]&&(n[s]=u,i[s]=r*o+a)}}const a=[];let s=r-1;for(;s;){const e=i[s];if(-1===e)break;const r=Math.floor(e/o),n=e%o;a.push([t[r],t[n]]),s&=~(1<<r),s&=~(1<<n)}return a}_greedyMatching(t,e){const o=t.length,r=new Array(o).fill(!1),n=[];for(let i=0;i<o;i++){if(r[i])continue;let a=-1,s=1/0;for(let n=i+1;n<o;n++){if(r[n])continue;const o=e[t[i]][t[n]];o<s&&(s=o,a=n)}-1!==a&&(n.push([t[i],t[a]]),r[i]=!0,r[a]=!0)}return n}_findEulerianCircuit(t,e){if(0===t.length)return null;const o={};for(const a of t){const t=[a.from,a.to].sort().join("↔");o[t]=(o[t]||0)+1}const r={};for(const a of t)r[a.from]||(r[a.from]=new Set),r[a.to]||(r[a.to]=new Set),r[a.from].add(a.to),r[a.to].add(a.from);const n=[e],i=[];for(;n.length>0;){const t=n[n.length-1],e=r[t];let a=null;if(e)for(const r of e){const e=[t,r].sort().join("↔");if((o[e]||0)>0){a=r,o[e]--;break}}null!==a?n.push(a):i.push(n.pop())}return i.length>1?i:null}_planByComponent(t,e,o,r={}){const{excludeNodeIds:n=[]}=r,i=new Set(e),a=o.map((t=>{const e=new Set;for(const o of this.edges)i.has(o.id)&&t.nodeIds.includes(o.from)&&t.nodeIds.includes(o.to)&&e.add(o.id);return Array.from(e)})),s=[];let l=t;for(let c=0;c<a.length;c++){const t=a[c];if(0===t.length)continue;let e=null,r=1/0,i=null;for(const a of o[c].nodeIds){if(n.includes(a))continue;const t=this.findPath(l,a,{excludeNodeIds:n});if(!t)continue;let o=0;for(let e=0;e<t.length-1;e++){const r=(this.adjacency[t[e]]||[]).find((o=>o.to===t[e+1]));r&&(o+=r.weight)}o<r&&(r=o,e=a,i=t)}if(!e)continue;const u=this.planGreedyCircuit(e,t,{excludeNodeIds:n});u&&(i&&i.length>1&&s.push(...i.slice(0,-1)),s.push(...u),l=u[u.length-1])}if(0===s.length)return null;if(s[0]!==t&&s.unshift(t),s[s.length-1]!==t){const e=this.findPath(s[s.length-1],t,{excludeNodeIds:n});e&&s.push(...e.slice(1))}return s}_planEdgeByEdge(t,e,o={}){const r=o.excludeNodeIds??[],n=r instanceof Set?r:new Set(r),i=new Set(e),a=new Set,s=[t];let l=t;for(;a.size<i.size;){let t=null,e=1/0,o=null,c=null;for(const[s,u]of Object.entries(this.adjacency))if(!n.has(s))for(const n of u){if(!i.has(n.edgeId)||a.has(n.edgeId))continue;const u=this.findPath(l,s,{excludeNodeIds:r});if(!u)continue;let d=0;for(let t=0;t<u.length-1;t++){const e=(this.adjacency[u[t]]||[]).find((e=>e.to===u[t+1]));e&&(d+=e.weight)}const h=d+n.weight;h<e&&(e=h,t=n,o=u,c=n.to)}if(!t)break;o&&o.length>1&&s.push(...o.slice(1)),s.push(c),a.add(t.edgeId),l=c}if(s[s.length-1]!==t){const e=this.findPath(l,t,{excludeNodeIds:r});e&&s.push(...e.slice(1))}return s}}function le(t){const{collisionCheck:e,onSegmentInvalid:o,deviationCheck:r}=t;return function(t){if(!t||t.length<2)return t;const n=[t[0]];for(let i=1;i<t.length;i++){const a=n[n.length-1],s=t[i];let l=!0;e&&(l=!e(a[0],a[1],s[0],s[1]));let c=!0;if(r&&(c=r(s,t[i])),l&&c)n.push(s);else if(!l&&o){const e=o(a,s,i,{fullPath:t});if(e&&e.length>1)for(let t=1;t<e.length;t++)n.push(e[t]);else n.push(s)}else n.push(s)}return n}}function ce(t,e,o,r,n){let i=1/0,a=[t,e];for(const s of o.edges){const o=r[s.from],l=r[s.to];if(!o||!l)continue;const[c,u]=n(o[0],o[1]),[d,h]=n(l[0],l[1]),p=d-c,g=h-u,f=p*p+g*g;if(0===f)continue;let m=((t-c)*p+(e-u)*g)/f;m=Math.max(0,Math.min(1,m));const y=c+m*p,b=u+m*g,v=(y-t)*(y-t)+(b-e)*(b-e);v<i&&(i=v,a=[y,b])}return a}const ue=85e3,de=24;function he(t,e,o){for(const r of o)if(zt(t,e,r))return Kt(t,e,[{polygon:r}]);return null}const pe=Object.freeze(Object.defineProperty({__proto__:null,GraphPathfinder:se,Pathfinder:Yt,buildGraphCoveragePath:function(t,e){const{geoUtils:o,graph:r,buildingPolygons:n,excludeNodeIds:i=[],onRerouteLog:a=null}=e;function s(t,e){const[r,n]=o.fracToGPS(0,0),[i,a]=o.fracToGPS(1,1);return[(t-r)/(i-r),(e-n)/(a-n)]}const l=(t,e)=>o.fracToCart(t,e),c=(t,e)=>o.cartToGPS(t,e),u=new se(r),d=[];for(const p of t){const[t,e]=u.nodeIndex[p],[o,i]=s(t,e);let a=o,c=i;const h=he(a,c,n);if(h){a=h[0],c=h[1];const t=ce(a,c,r,u.nodeIndex,s);a=t[0],c=t[1]}const g=l(a,c);d.push([g.x,g.y])}let h=0;return{coords:le({collisionCheck:(t,e,o,r)=>{const[i,a]=c(t,e),[l,u]=c(o,r),[d,h]=s(i,a),[p,g]=s(l,u);for(const s of n)if(Ft(d,h,p,g,s))return!0;return!1},onSegmentInvalid:(t,e,o)=>{const d=c(t[0],t[1]),p=c(e[0],e[1]),g=u.findNearestNode(d[0],d[1]),f=u.findNearestNode(p[0],p[1]);if(g&&f&&g.id!==f.id){const e=u.findPath(g.id,f.id,{excludeNodeIds:i});if(e&&e.length>1){const o=e.slice(1).map((t=>{const[e,o]=u.nodeIndex[t],[i,a]=s(e,o);let c=i,d=a;const h=he(c,d,n);if(h){c=h[0],d=h[1];const t=ce(c,d,r,u.nodeIndex,s);c=t[0],d=t[1]}const p=l(c,d);return[p.x,p.y]}));return h++,a&&a({from:g.id,to:f.id,altLength:o.length}),[t,...o]}}return null}})(d),reRouteCount:h}},buildGraphPointToPointPath:function(t,e){const{geoUtils:o,graph:r,excludeNodeIds:n=[],weightScale:i=ue}=e,a=(t,e)=>o.fracToCart(t,e);if(!t||t.length<2)return null;function s(t,e){const[r,n]=o.fracToGPS(0,0),[i,a]=o.fracToGPS(1,1);return[(t-r)/(i-r),(e-n)/(a-n)]}const l=new se(r).nodeIndex,c=[...r.nodes],u=[...r.edges];let d=0;function h(t){let e=null;for(const i of r.edges){const o=l[i.from],r=l[i.to];if(!o||!r)continue;const n=r[0]-o[0],a=r[1]-o[1],s=n*n+a*a;if(0===s)continue;let c=((t[0]-o[0])*n+(t[1]-o[1])*a)/s;c=Math.max(0,Math.min(1,c));const u=o[0]+c*n,d=o[1]+c*a,h=Math.hypot(u-t[0],d-t[1]);(!e||h<e.dist)&&(e={dist:h,edge:i,t:c,px:u,py:d})}if(!e)return null;if(e.t<=1e-7)return e.edge.from;if(e.t>=1-1e-7)return e.edge.to;const o=e.edge.from,n=e.edge.to,a=l[o],s=l[n],h=`__snap_${d++}__`;return c.push({id:h,type:"snap",coordinates:[e.px,e.py]}),u.push({id:`${h}-a`,from:h,to:o,weight:Math.round(Math.hypot(e.px-a[0],e.py-a[1])*i)}),u.push({id:`${h}-b`,from:h,to:n,weight:Math.round(Math.hypot(e.px-s[0],e.py-s[1])*i)}),h}function p(t){if("string"==typeof t)return l[t]||null;if(t.nodeId)return l[t.nodeId]||null;if(t.gps)return t.gps;if(t.cart){const[n,i]=(e=t.cart.x,r=t.cart.y,o.cartToGPS(e,r));return[n,i]}var e,r;return null}const g=[];for(const v of t){const t=p(v);if(!t)return null;let e;if(e="string"==typeof v?v:v.nodeId?v.nodeId:h(t),!e)return null;g.push(e)}const f=new se({nodes:c,edges:u}),m=[];for(let v=0;v<g.length-1;v++){const t=g[v],e=g[v+1];if(t===e){0===m.length&&m.push(t);continue}const o=f.findPath(t,e,{excludeNodeIds:n});if(!o||o.length<2)return null;for(let r=m.length>0&&o[0]===m[m.length-1]?1:0;r<o.length;r++)m.push(o[r])}if(m.length<2)return{coords:[],reRouteCount:0};const y=f.nodeIndex,b=[];for(const v of m){const[t,e]=y[v],[o,r]=s(t,e),n=a(o,r);b.push([n.x,n.y])}return{coords:b,reRouteCount:0}},buildPathfindingRoute:function(t,e){if(!t||t.length<2)return{coords:[],poiIndices:[]};!function(t){if(!te)throw new Error("Pathfinder 未初始化,请先调用 initPathfinder(widthMeters, heightMeters)");const e=t?t.map((t=>t.id)).sort().join(","):"default";oe!==e&&(te.setObstacles(t||[]),oe=e)}(e);const o=[];for(let i=0;i<t.length;i++){const r=t[i],n=t[(i+1)%t.length];o.push({start:re(r,e),end:ne(n,r,e)})}const r=function(t,e){if(!t||0===t.length)return{coords:[],segmentIndices:[]};const o=[],r=[];let n=null;for(const{start:i,end:a}of t){const t=e(i,a);if(t&&t.length>=2)for(let e=n&&t[0][0]===n[0]&&t[0][1]===n[1]?1:0;e<t.length;e++)o.push(t[e]);else o.push(a);r.push(o.length-1),n=o[o.length-1]}return{coords:o,segmentIndices:r}}(o,((t,e)=>te.findPath(t,e))),n=r.segmentIndices.slice(0,-1);return{coords:function(t,e,o){if(!t||t.length<2||!e||0===e.length)return t;const r=[t[0]];for(let n=1;n<t.length;n++){const i=r[r.length-1],a=t[n];if(ie(i[0],i[1],a[0],a[1],e)){const t=o(i,[(i[0]+a[0])/2,(i[1]+a[1])/2]);if(t&&t.length>=2)for(let e=1;e<t.length;e++)r.push(t[e]);else r.push(a)}else r.push(a)}return r}(r.coords,e,((t,e)=>te.findPath(t,e))),poiIndices:n}},buildRoute:function(t,e){if(!t||0===t.length)return{coords:[],segmentIndices:[]};const o=[],r=[];let n=null;for(const{start:i,end:a}of t){const t=e(i,a);if(t&&t.length>=2){for(let e=n&&t[0][0]===n[0]&&t[0][1]===n[1]?1:0;e<t.length;e++)o.push(t[e])}else o.push(a);r.push(o.length-1),n=o[o.length-1]}return{coords:o,segmentIndices:r}},cartDist:function(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)},cartHeading:function(t,e){return(Math.atan2(e.x-t.x,e.y-t.y)*(180/Math.PI)+360)%360},createGeoUtils:At,createPathValidator:le,findAnnouncementPoint:Qt,findForbiddenZoneCornerTarget:Jt,findNearestBoundaryPoint:Kt,iconRot:function(t){return(t-90+360)%360},initPathfinder:function(t,e){te=new Yt({widthMeters:t,heightMeters:e}),ee=1/t},isPointInForbiddenZone:Zt,lerpAngle:function(t,e,o){return(t+((e-t+540)%360-180)*o+360)%360},lineSegmentIntersectsPolygon:Ft,pointInPolygon:zt,projectToNearestGraphEdge:ce,removeEdgesThroughBuildings:function(t,e={}){const{buildingPolygons:o=[],geoUtils:r,sampleSteps:n=de}=e;if(!o.length||!r)return t;const i=new se(t).nodeIndex;function a(t,e){const[o,n]=r.fracToGPS(0,0),[i,a]=r.fracToGPS(1,1);return[(t-o)/(i-o),(e-n)/(a-n)]}const s=t.edges.filter((t=>{const e=i[t.from],r=i[t.to];return!(!e||!r)&&!function(t,e){const[r,i]=a(t[0],t[1]),[s,l]=a(e[0],e[1]);for(const a of o)for(let t=1;t<n;t++){const e=t/n;if(zt(r+(s-r)*e,i+(l-i)*e,a))return!0}return!1}(e,r)}));return{...t,edges:s}},routeIdsToCoords:function(t,e){if(!(null==t?void 0:t.length))return[];const o=new Map(e.map((t=>[t.id,t])));return t.map((t=>{const e=o.get(t);return e?[e.xFrac,e.yFrac]:[.5,.5]}))},segmentsIntersect:Ot,validateCollision:he,validatePathSegments:function(t,e){if(!t||t.length<2)return t;const{validator:o,repairFn:r}=e,n=[t[0]];for(let i=1;i<t.length;i++){const e=n[n.length-1],a=t[i];if(o(e,a))n.push(a);else{const o=r(e,a,i,{fullPath:t});if(o&&o.length>1)for(let t=1;t<o.length;t++)n.push(o[t]);else n.push(a)}}return n}},Symbol.toStringTag,{value:"Module"}));let ge=null;function fe(t,e,o={}){const{layerId:r="robot-3d-layer",beforeLayerId:n,movementThreshold:i=.1,idleDebounceMs:a=500,headingOffset3D:s=0}=o,l=window.THREE,c=window.maplibregl;if(!l||!c||!c.MercatorCoordinate)return null;ge||(ge=window.THREE&&window.THREE.GLTFLoader?Promise.resolve(window.THREE.GLTFLoader):new Promise(((t,e)=>{const o=document.createElement("script");o.src="https://unpkg.com/three@0.147.0/examples/js/loaders/GLTFLoader.js",o.onload=()=>{window.THREE&&window.THREE.GLTFLoader?t(window.THREE.GLTFLoader):e(new Error("GLTFLoader 加载后仍未找到"))},o.onerror=()=>e(new Error("GLTFLoader CDN 加载失败")),document.head.appendChild(o)})));let u=null,d=null,h=null,p=null,g=null,f=null,m=1;const y=new Map;let b=0;const v=new l.Matrix4,w=new l.Matrix4,_=new l.Vector3,x={id:r,type:"custom",renderingMode:"3d",onAdd(t,o){d=new l.Scene,h=new l.Camera;try{u=new l.WebGLRenderer({canvas:t.getCanvas(),context:o,antialias:!0})}catch(s){return}u.autoClear=!1;const r=new l.AmbientLight(16777215,.8);d.add(r);const n=new l.DirectionalLight(16777215,1.5);n.position.set(2,3,1).normalize(),d.add(n);const i=new l.DirectionalLight(16777215,.6);i.position.set(-1,.5,-1).normalize(),d.add(i);const a=new l.DirectionalLight(16777215,.3);a.position.set(0,1,0).normalize(),d.add(a),ge.then((o=>{(new o).load(e.url,(e=>{g=e.scene,p=e,f||(f=c.MercatorCoordinate.fromLngLat(t.getCenter(),0),m=f.meterInMercatorCoordinateUnits());for(const[t,o]of y)o.group||E(t,o)}),void 0,(t=>{}))}))},render(t,e){var o,r;if(!u||!d||!f)return;let n=null;if(Array.isArray(e)||e instanceof Float32Array)n=e;else if(e&&"object"==typeof e){const t=e.defaultProjectionData;(null==t?void 0:t.mainMatrix)&&16===t.mainMatrix.length?n=t.mainMatrix:16===(null==(o=e.projectionMatrix)?void 0:o.length)?n=e.projectionMatrix:16===(null==(r=e.modelViewProjectionMatrix)?void 0:r.length)&&(n=e.modelViewProjectionMatrix)}if(!n||16!==n.length)return;const i=performance.now(),s=b?(i-b)/1e3:.016;b=i;for(const c of y.values())c.group&&(c.mixer&&c.mixer.update(s),"manual"!==c.animState&&c.lastMoveTime&&i-c.lastMoveTime>a&&"idle"!==c.currentAnim&&I(c,"idle"));const l=m;_.set(l,-l,l),w.makeTranslation(f.x,f.y,f.z).scale(_),v.fromArray(n),h.projectionMatrix.multiplyMatrices(v,w),h.projectionMatrixInverse.copy(h.projectionMatrix).invert(),h.matrixWorld.identity(),h.matrixWorldInverse.identity(),u.resetState(),u.clearDepth(),u.render(d,h)},onRemove(){for(const t of y.values())t.mixer&&t.mixer.stopAllAction(),t.group&&(t.group.traverse((t=>{t.isMesh&&(t.geometry&&t.geometry.dispose(),Array.isArray(t.material)?t.material.forEach((t=>{t.map&&t.map.dispose(),t.dispose()})):t.material&&(t.material.map&&t.material.map.dispose(),t.material.dispose()))})),null==d||d.remove(t.group));y.clear(),g=null,p=null,u=null}};function C(t){const e=c.MercatorCoordinate.fromLngLat({lng:t[0],lat:t[1]},0),o=1/m;return{x:(e.x-f.x)*o,y:-(e.y-f.y)*o,z:(e.z-f.z)*o}}function E(t,o,r){if(!g)return;const n=g.clone(!0);!function(t){const e=new Map;t.traverse((t=>{t.isBone&&e.set(t.name,t)})),t.traverse((t=>{if(t.isSkinnedMesh){const o=t.skeleton,r=o.bones.map((t=>e.get(t.name)||t)),n=o.boneInverses.map((t=>t.clone())),i=new l.Skeleton(r,n);t.bind(i,t.bindMatrix.clone())}}))}(n);const i=new l.Group;i.add(n);const a=(e.scale??1)*(e.metersScale??1);i.scale.set(a,a,a);const c=C(o.lngLat);i.position.set(c.x,c.y,c.z);const u=e.rotateX??0,h=e.rotateY??0,f=e.rotateZ??0;n.rotation.set(u,h,f);const m=(-o.heading+s)*Math.PI/180;i.rotation.set(0,0,m);const y=new l.AnimationMixer(n),b={};if(p&&p.animations)for(const[s,d]of Object.entries(e.animations??{})){const t=l.AnimationClip.findByName(p.animations,d);if(t){const e=y.clipAction(t);e.loop=l.LoopRepeat,b[s]=e}}d.add(i),o.group=i,o.modelNode=n,o.mixer=y,o.actions=b,o.currentAnim=null,o.prevLngLat=null,o.lastMoveTime=null,o.animState="auto";I(o,e.defaultAnimation??"idle")}function I(t,e){var o,r;if(t.currentAnim===e)return;!function(t,e,o=.3){e&&(t&&t!==e&&t.fadeOut(o),e.reset().fadeIn(o).play())}(null==(o=t.actions)?void 0:o[t.currentAnim],null==(r=t.actions)?void 0:r[e],.3),t.currentAnim=e}function L(t){if(!t.prevLngLat)return void(t.prevLngLat=t.lngLat);const e=function(t,e){const o=(e[1]-t[1])*Math.PI/180,r=(e[0]-t[0])*Math.PI/180,n=Math.sin(o/2)**2+Math.cos(t[1]*Math.PI/180)*Math.cos(e[1]*Math.PI/180)*Math.sin(r/2)**2;return 12742017.6*Math.atan2(Math.sqrt(n),Math.sqrt(1-n))}(t.prevLngLat,t.lngLat);t.prevLngLat=t.lngLat;let o=e>i?"walk":"idle";"idle"===o&&null!==t.prevHeading&&Math.abs(t.heading-t.prevHeading)>5&&(o="walk"),t.prevHeading=t.heading,I(t,o),e>i&&(t.lastMoveTime=performance.now())}function S(t){const e=y.get(t);e&&(e.group&&(e.mixer&&e.mixer.stopAllAction(),null==d||d.remove(e.group),e.group=null),y.delete(t))}return n&&t.getLayer(n)?t.addLayer(x,n):t.addLayer(x),{addRobot:function({id:t,lngLat:e,heading:o=0}){if(y.has(t))return;const r={lngLat:e,heading:o,group:null,modelNode:null,mixer:null,actions:{},currentAnim:null,prevLngLat:null,prevHeading:null,lastMoveTime:null,animState:"auto"};y.set(t,r),g&&E(0,r)},updateRobot:function(t,e){const o=y.get(t);if(!o)return;const r=null!=e.lngLat,n=null!=e.heading;r&&(o.lngLat=e.lngLat),n&&(o.heading=e.heading),o.group&&(r||n)&&function(t){if(!t.group||!f)return;const e=C(t.lngLat);t.group.position.set(e.x,e.y,e.z);const o=(-t.heading+s)*Math.PI/180;t.group.rotation.set(0,0,o)}(o),r&&"auto"===o.animState&&L(o)},setAnimation:function(t,e){const o=y.get(t);o&&(o.animState="manual",I(o,e))},removeRobot:S,destroy:function(){for(const t of y.keys())S(t);t.getLayer(r)&&t.removeLayer(r),u=null,d=null}}}const me=Object.freeze(Object.defineProperty({__proto__:null,ActionTask:Pt,AnnounceTask:class extends Lt{constructor({message:t,channel:e="announce",meta:o}={}){super({message:t,channel:e,meta:o}),this._message=t,this._channel=e,this._meta=o,this._emitted=!1}start(t){super.start(t),this._emitted=!1}update(t,e){return this._status!==It.RUNNING||this._emitted||(this._emitted=!0,e.eventBus&&"function"==typeof e.eventBus.emit&&e.eventBus.emit(this._channel,{message:this._message,meta:this._meta}),this._status=It.COMPLETED),this._status}reset(){super.reset(),this._emitted=!1}},ChargeTask:class extends Lt{constructor({stationId:t,minCharge:e=100,chargeRate:o=.02}={}){super({stationId:t,minCharge:e,chargeRate:o}),this._stationId=t,this._minCharge=e,this._chargeRate=o}start(t){super.start(t),t.phase=Q.CHARGING}update(t,e){return this._status!==It.RUNNING?this._status:(e.phase=Q.CHARGING,void 0===e.battery?(this._status=It.COMPLETED,this._status):(e.battery=Math.min(this._minCharge,(e.battery||0)+this._chargeRate*t),e.battery>=this._minCharge?(this._status=It.COMPLETED,this._status):It.RUNNING))}},Conditional:class extends Lt{constructor({condition:t,then:e,else:o}={}){super({condition:t,then:e,else:o}),this._condition=t,this._thenTask=e,this._elseTask=o||null,this._activeTask=null}start(t){super.start(t);const e=this._condition(t);this._activeTask=e?this._thenTask:this._elseTask,this._activeTask?this._activeTask.start(t):this._status=It.COMPLETED}update(t,e){if(this._status!==It.RUNNING)return this._status;if(!this._activeTask)return this._status=It.COMPLETED,this._status;const o=this._activeTask.update(t,e);return o===It.COMPLETED?this._status=It.COMPLETED:o!==It.FAILED&&o!==It.CANCELLED||(this._status=It.FAILED),this._status}cancel(t){this._activeTask&&this._activeTask.cancel(t),super.cancel(t)}reset(){super.reset(),this._activeTask=null,this._thenTask&&this._thenTask.reset(),this._elseTask&&this._elseTask.reset()}},DisplayManager:class{constructor(t={}){this._mode=t.mode||Rt.MODE_2D,this._renderer2d=t.renderer2d||null,this._renderer3d=t.renderer3d||null,this._robots=[]}setMode(t){const e="2d"===this._mode||"both"===this._mode,o="3d"===this._mode||"both"===this._mode;this._mode=t;const r="2d"===t||"both"===t,n="3d"===t||"both"===t;this._renderer2d&&(e&&!r&&this._renderer2d.clearRobots(),!e&&r&&this._renderer2d.updateRobots([...this._robots])),this._renderer3d&&(o&&!n&&this._renderer3d.clearRobots(),!o&&n&&this._renderer3d.updateRobots([...this._robots]))}getMode(){return this._mode}setRenderer2d(t){this._renderer2d=t}setRenderer3d(t){this._renderer3d=t}_r2d(){return"2d"===this._mode||"both"===this._mode?this._renderer2d:null}_r3d(){return"3d"===this._mode||"both"===this._mode?this._renderer3d:null}_findIdx(t){return"number"==typeof t?t:this._robots.findIndex((e=>e.id===t))}addRobot(t){var e,o;return this._robots.push(t),null==(e=this._r2d())||e.addRobot(t),null==(o=this._r3d())||o.addRobot(t),this._robots.length-1}updateRobot(t,e){var o,r;const n=this._findIdx(t);return!(n<0||n>=this._robots.length)&&(this._robots[n]={...this._robots[n],...e},null==(o=this._r2d())||o.updateRobot(t,e),null==(r=this._r3d())||r.updateRobot(t,e),!0)}updateRobots(t=[]){var e,o;this._robots=[...t],null==(e=this._r2d())||e.updateRobots(t),null==(o=this._r3d())||o.updateRobots(t)}removeRobot(t){var e,o;const r=this._findIdx(t);return!(r<0||r>=this._robots.length)&&(null==(e=this._r2d())||e.removeRobot(t),null==(o=this._r3d())||o.removeRobot(t),this._robots.splice(r,1),!0)}clearRobots(){var t,e;this._robots=[],null==(t=this._r2d())||t.clearRobots(),null==(e=this._r3d())||e.clearRobots()}getRobots(){return[...this._robots]}toggleLabels(t){var e,o;null==(e=this._r2d())||e.toggleLabels(t),null==(o=this._r3d())||o.toggleLabels(t)}remove(){var t,e;null==(t=this._renderer2d)||t.remove(),null==(e=this._renderer3d)||e.remove(),this._robots=[]}},DisplayMode:Rt,DockTask:class extends Lt{constructor({stationId:t,duration:e=3e3}={}){super({stationId:t,duration:e}),this._stationId=t,this._duration=e,this._elapsed=0}start(t){super.start(t),this._elapsed=0,t.phase=Q.DOCKING}update(t,e){return this._status!==It.RUNNING||(e.phase=Q.DOCKING,this._elapsed+=t,this._elapsed>=this._duration&&(this._status=It.COMPLETED)),this._status}reset(){super.reset(),this._elapsed=0}},EventBus:vt,Loop:class extends Lt{constructor({task:t,times:e=-1}={}){super({task:t,times:e}),this._task=t,this._times=e,this._iteration=0}start(t){super.start(t),this._iteration=0,0!==this._times?this._task.start(t):this._status=It.COMPLETED}update(t,e){if(this._status!==It.RUNNING)return this._status;const o=this._task.update(t,e);if(o===It.FAILED||o===It.CANCELLED)return this._status=It.FAILED,this._status;if(o===It.COMPLETED){if(this._iteration++,-1!==this._times&&this._iteration>=this._times)return this._status=It.COMPLETED,this._status;this._task.reset(),this._task.start(e)}return It.RUNNING}cancel(t){this._task.cancel(t),super.cancel(t)}reset(){super.reset(),this._iteration=0,this._task.reset()}getIteration(){return this._iteration}},MoveTask:St,PHASE_TRANSITIONS:tt,Parallel:class extends Lt{constructor(t=[],e={}){super({tasks:t,...e}),this._tasks=t,this._failFast=!1!==e.failFast}start(t){super.start(t);for(const e of this._tasks)e.start(t)}update(t,e){if(this._status!==It.RUNNING)return this._status;let o=!0;for(const r of this._tasks){const n=r.getStatus();if(n===It.COMPLETED)continue;if(n===It.FAILED||n===It.CANCELLED){if(this._failFast)return this._cancelAll(e),this._status=It.FAILED,this._status;continue}const i=r.update(t,e);if((i===It.FAILED||i===It.CANCELLED)&&this._failFast)return this._cancelAll(e),this._status=It.FAILED,this._status;i!==It.COMPLETED&&(o=!1)}return o&&(this._status=It.COMPLETED),this._status}cancel(t){this._cancelAll(t),super.cancel(t)}reset(){super.reset();for(const t of this._tasks)t.reset()}_cancelAll(t){for(const e of this._tasks){const o=e.getStatus();o!==It.RUNNING&&o!==It.PENDING||e.cancel(t)}}},ROBOT_PROFILE_TYPES:{GUIDE_INDOOR:"guide-indoor",PATROL_OUTDOOR:"patrol-outdoor",DELIVERY_INDOOR:"delivery-indoor"},ROBOT_STATUS:{IDLE:"idle",RUNNING:"running",CHARGING:"charging",ERROR:"error",RETURNING:"returning"},Race:class extends Lt{constructor(t=[]){super({tasks:t}),this._tasks=t}start(t){super.start(t);for(const e of this._tasks)e.start(t)}update(t,e){if(this._status!==It.RUNNING)return this._status;let o=!0;for(const r of this._tasks){const t=r.getStatus();if(t===It.COMPLETED)return this._cancelOthers(r,e),this._status=It.COMPLETED,this._status;t!==It.FAILED&&t!==It.CANCELLED&&(o=!1)}for(const r of this._tasks){const o=r.getStatus();if(o===It.RUNNING||o===It.PENDING){if(r.update(t,e)===It.COMPLETED)return this._cancelOthers(r,e),this._status=It.COMPLETED,this._status}}return o=this._tasks.every((t=>{const e=t.getStatus();return e===It.FAILED||e===It.CANCELLED})),o&&(this._status=It.FAILED),this._status}cancel(t){for(const e of this._tasks){const o=e.getStatus();o!==It.RUNNING&&o!==It.PENDING||e.cancel(t)}super.cancel(t)}reset(){super.reset();for(const t of this._tasks)t.reset()}_cancelOthers(t,e){for(const o of this._tasks){if(o===t)continue;const r=o.getStatus();r!==It.RUNNING&&r!==It.PENDING||o.cancel(e)}}},ResourceLock:wt,ResourceManager:Et,ResourceType:{ELEVATOR:"elevator",CHARGER:"charger",PATH_SEGMENT:"path_segment",GATE:"gate",ZONE:"zone"},Retry:class extends Lt{constructor({task:t,maxRetries:e=3}={}){super({task:t,maxRetries:e}),this._task=t,this._maxRetries=e,this._attempts=0}start(t){super.start(t),this._attempts=0,this._task.start(t)}update(t,e){if(this._status!==It.RUNNING)return this._status;const o=this._task.update(t,e);if(o===It.COMPLETED)return this._status=It.COMPLETED,this._status;if(o===It.FAILED||o===It.CANCELLED){if(this._attempts++,this._attempts>this._maxRetries)return this._status=It.FAILED,this._status;this._task.reset(),this._task.start(e)}return It.RUNNING}cancel(t){this._task.cancel(t),super.cancel(t)}reset(){super.reset(),this._attempts=0,this._task.reset()}getAttempts(){return this._attempts}},RobotController:kt,RobotEngine:class{constructor(t={}){this._config=t,this._robots=new Map,this._eventBus=new vt,this._resourceManager=new Et,this._waypointRegistry=new rt,this._running=!1,this._paused=!1,this._lastTickTime=0,this._maxDeltaTime=t.maxDeltaTime||100,this._animationFrameId=null}start(){this._running||(this._running=!0,this._paused=!1,this._lastTickTime=performance.now(),this._tickLoop())}stop(){this._running=!1,this._paused=!1,this._animationFrameId&&(cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null)}pause(){this._paused=!0}resume(){this._running&&(this._paused=!1,this._lastTickTime=performance.now())}isRunning(){return this._running}isPaused(){return this._paused}_tickLoop(){if(!this._running)return;const t=performance.now(),e=Math.min(t-this._lastTickTime,this._maxDeltaTime);this._lastTickTime=t,this._paused||this.tick(e),this._animationFrameId=requestAnimationFrame((()=>this._tickLoop()))}tick(t){this._buildTickContext();for(const[o,r]of this._robots)try{r.tick(t)}catch(e){}}_buildTickContext(){const t={};for(const[e,o]of this._robots)t[e]={position:o.getPosition(),heading:o.getHeading(),phase:o.getPhase(),battery:o.getBattery()};return{robotStates:t,timestamp:Date.now()}}addRobot(t,e,o={}){if(this._robots.has(t))throw new Error(`Robot "${t}" already exists`);const r=new kt(t,e,o);return r.setEventBus(this._eventBus),r.setResourceManager(this._resourceManager),this._robots.set(t,r),r}removeRobot(t){const e=this._robots.get(t);e&&(e.cancelCurrentTask(),this._robots.delete(t))}getRobot(t){return this._robots.get(t)}getRobots(){return new Map(this._robots)}getRobotIds(){return Array.from(this._robots.keys())}assignMission(t,e){const o=this._robots.get(t);if(!o)throw new Error(`Robot "${t}" not found`);o.execute(e)}cancelMission(t){const e=this._robots.get(t);e&&e.cancelCurrentTask()}getMissionStatus(t){const e=this._robots.get(t);return e?e.getTaskStatus():"unknown"}emitSignal(t,e){this._eventBus.emit(t,e)}onSignal(t,e){return this._eventBus.on(t,e)}getEventBus(){return this._eventBus}getResourceManager(){return this._resourceManager}registerWaypointType(t,e){this._waypointRegistry.register(t,e)}getWaypointRegistry(){return this._waypointRegistry}registerConditionType(t,e){this._conditionFactories||(this._conditionFactories=new Map),this._conditionFactories.set(t,e)}getConditionFactory(t){var e;return null==(e=this._conditionFactories)?void 0:e.get(t)}registerActionType(t,e){this._actionHandlers||(this._actionHandlers=new Map),this._actionHandlers.set(t,e)}getActionHandler(t){var e;return null==(e=this._actionHandlers)?void 0:e.get(t)}},RobotPhase:Q,SensorTask:class extends Lt{constructor({sensor:t,action:e}={}){super({sensor:t,action:e}),this._sensor=t,this._action=e,this._launched=!1,this._resolved=!1,this._failed=!1}start(t){super.start(t),this._launched=!1,this._resolved=!1,this._failed=!1}update(t,e){if(this._status!==It.RUNNING)return this._status;if(!this._launched){this._launched=!0;try{const t=this._action(e,this._sensor);t&&"function"==typeof t.then?t.then((()=>{this._resolved=!0})).catch((()=>{this._failed=!0})):this._resolved=!0}catch{this._failed=!0}}return this._failed?(this._status=It.FAILED,this._status):this._resolved?(this._status=It.COMPLETED,this._status):It.RUNNING}reset(){super.reset(),this._launched=!1,this._resolved=!1,this._failed=!1}},Sequence:class extends Lt{constructor(t=[]){super({tasks:t}),this._tasks=t,this._currentIndex=0}start(t){super.start(t),this._currentIndex=0,0!==this._tasks.length?this._tasks[0].start(t):this._status=It.COMPLETED}update(t,e){if(this._status!==It.RUNNING)return this._status;if(0===this._tasks.length)return this._status=It.COMPLETED,this._status;const o=this._tasks[this._currentIndex].update(t,e);if(o===It.FAILED||o===It.CANCELLED)return this._status=It.FAILED,this._status;if(o===It.COMPLETED){if(this._currentIndex++,this._currentIndex>=this._tasks.length)return this._status=It.COMPLETED,this._status;this._tasks[this._currentIndex].start(e)}return It.RUNNING}cancel(t){this._currentIndex<this._tasks.length&&this._tasks[this._currentIndex].cancel(t),super.cancel(t)}reset(){super.reset(),this._currentIndex=0;for(const t of this._tasks)t.reset()}getCurrentIndex(){return this._currentIndex}},SignalTask:class extends Lt{constructor({signal:t,data:e}={}){super({signal:t,data:e}),this._signal=t,this._data=e,this._emitted=!1}start(t){super.start(t),this._emitted=!1}update(t,e){return this._status!==It.RUNNING||this._emitted||(this._emitted=!0,e.eventBus&&"function"==typeof e.eventBus.emit&&e.eventBus.emit(this._signal,this._data),this._status=It.COMPLETED),this._status}reset(){super.reset(),this._emitted=!1}},Task:Lt,TaskStatus:It,WaitCondition:class{static duration(t){return new it(t)}static signal(t,e={}){return new at(t,e)}static distance(t,e){return new st(t,e)}static resource(t,e,o={}){return new lt(t,e,o)}static all(...t){return new ct(...t)}static race(...t){return new ut(...t)}static not(t){return new dt(t)}static sensor(t,e={}){return new ht(t,e)}static occupancy(t,e="free"){return new pt(t,e)}static elevator(t,e={}){return new gt(t,e)}static trafficLight(t,e={}){return new ft(t,e)}},WaitTask:Mt,Waypoint:class{constructor(t){this.id=t.id,this.type=t.type||ot.PATROL,this.position=t.position||{xFrac:0,yFrac:0},this.floor=t.floor||"1F",this.meta=t.meta||{},this.onApproach=t.onApproach||null,this.onArrive=t.onArrive||null,this.onDepart=t.onDepart||null,this.onWaitStart=t.onWaitStart||null,this.onWaitEnd=t.onWaitEnd||null,this.onTimeout=t.onTimeout||null,this.waitCondition=t.waitCondition||null,this.waitTimeout=t.waitTimeout||3e4}async callHook(t,e,o){const r=this[t];if("function"==typeof r)return r(e,o)}},WaypointType:ot,WaypointTypeRegistry:rt,addStatusRobotMarkers:function(t,e=[],o={}){const{showLabels:r=!0,showStatus:n=!0,showBattery:i=!0,sync:a=!1,GPSToCartesian:s=null,...l}=o,c=(a?F:O)(t,e,{...l,showLabels:!1,GPSToCartesian:s});let u=[...e],d=[],h=r;const p={showStatus:n,showBattery:i,GPSToCartesian:s},g=(e,o)=>{const r=t.project(o);e.style.left=`${Math.round(r.x)}px`,e.style.top=`${Math.round(r.y-50)}px`},f=()=>{h&&d.forEach((({el:t,robotIndex:e})=>{const o=u[e];o&&g(t,o.lngLat)}))};t.on("move",f);const m=()=>{d.forEach((({el:t})=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)})),d=[]},y=(e,o)=>{const r=Tt(e,p);r.id=`bic-robot-status-label-${o}`,t.getContainer().appendChild(r),d.push({el:r,robotIndex:o}),g(r,e.lngLat)},b=()=>{m(),h&&u.forEach(((t,e)=>y(t,e)))};return h&&b(),{updateRobots:(t=[])=>{u=[...t],c.updateRobots(t),b()},updateRobot:(t,e)=>{var o;const r="number"==typeof t?t:u.findIndex((e=>e.id===t));if(r<0||r>=u.length)return!1;if(u[r]={...u[r],...e},c.updateRobot(t,e),h){const t=d.find((t=>t.robotIndex===r));Object.keys(e).every((t=>"lngLat"===t||"rotation"===t))&&(null==t?void 0:t.el)?g(t.el,u[r].lngLat):(null==t?void 0:t.el)&&(null==(o=t.el.parentNode)||o.removeChild(t.el),d.splice(d.indexOf(t),1),y(u[r],r))}return!0},addRobot:t=>{const e=u.length;return u.push(t),c.addRobot(t),h&&y(t,e),e},removeRobot:t=>{var e;const o="number"==typeof t?t:u.findIndex((e=>e.id===t));if(o<0||o>=u.length)return!1;u.splice(o,1),c.removeRobot(t);const r=d.find((t=>t.robotIndex===o));return(null==r?void 0:r.el)&&(null==(e=r.el.parentNode)||e.removeChild(r.el),d.splice(d.indexOf(r),1)),d.forEach((t=>{t.robotIndex>o&&t.robotIndex--})),!0},clearRobots:()=>{u=[],c.clearRobots(),m()},getRobots:()=>[...u],toggleLabels:t=>(h=void 0!==t?t:!h,h?b():m(),h),setVisible:t=>{var e;null==(e=c.setVisible)||e.call(c,t),t?h&&b():m()},remove:()=>{t.off("move",f),m(),c.remove()}}},canTransition:et,createRobot3DLayer:fe,createRobot3DStatusLayer:function(t,e,o={}){const r=fe(t,e,o);let n=[];function i(t){return{id:t.id,lngLat:t.lngLat,heading:t.rotation??t.heading??0}}function a(t,e){e&&r.setAnimation(t,"running"===e?"walk":"idle")}function s(t){return"number"==typeof t?t:n.findIndex((e=>e.id===t))}return{addRobot:t=>(n.push(t),r.addRobot(i(t)),a(t.id,t.status),n.length-1),updateRobot:(t,e)=>{const o=s(t);if(o<0||o>=n.length)return!1;n[o]={...n[o],...e};const i=function(t){const e={};return null!=t.lngLat&&(e.lngLat=t.lngLat),null!=t.rotation&&(e.heading=t.rotation),null!=t.heading&&(e.heading=t.heading),e}(e);return Object.keys(i).length>0&&r.updateRobot(n[o].id,i),null!=e.status&&a(n[o].id,e.status),!0},updateRobots:(t=[])=>{for(const e of n)r.removeRobot(e.id);n=[...t];for(const e of n)r.addRobot(i(e)),a(e.id,e.status)},removeRobot:t=>{const e=s(t);return!(e<0||e>=n.length)&&(r.removeRobot(n[e].id),n.splice(e,1),!0)},clearRobots:()=>{for(const t of n)r.removeRobot(t.id);n=[]},getRobots:()=>[...n],toggleLabels:()=>{},remove:()=>r.destroy()}},createRobotFOV:function(t,e={}){if(!t)throw new Error("地图未初始化。");const o=e.mapConfig;if(!o||"object"!=typeof o)throw new Error("缺少 mapConfig 配置,请传入 { startX, startY, width, height, scale }");const{startX:r,startY:n,width:i,height:a,scale:s}=o,{cartToGPS:l}=At({startX:r,startY:n,width:i,height:a,scale:s}),c={id:"default",enabled:!0,angle:60,radiusMeters:3,fillColor:"#1677ff",innerOpacity:.45,outerOpacity:.02,bands:6,segments:20,...e},u=`bic-fov-source-${c.id}`,d=`bic-fov-fill-${c.id}`;let h=c.enabled;return(()=>{if(t.getSource(u))return;t.addSource(u,{type:"geojson",data:{type:"FeatureCollection",features:[]}});const e=c.beforeLayerId||"robot-markers-layer",o=t.getLayer(e)?e:void 0;t.addLayer({id:d,type:"fill",source:u,paint:{"fill-color":c.fillColor,"fill-opacity":["get","opacity"],"fill-antialias":!0},layout:{visibility:h?"visible":"none"}},o)})(),{update:(e,o)=>{const r=t.getSource(u);r&&r.setData(((t,e)=>{const o=(e+360)%360,r=c.radiusMeters,n=c.angle/2,i=c.segments,a=Math.max(2,c.bands),s=[];for(let u=0;u<a;u++){const e=r*(u/a),d=r*((u+1)/a),h=(u+.5)/a,p=c.innerOpacity+(c.outerOpacity-c.innerOpacity)*h,g=[];for(let r=0;r<=i;r++){const e=(o-n+c.angle*r/i)*Math.PI/180,a=t.x+d*Math.sin(e),s=t.y+d*Math.cos(e),u=l(a,s);g.push([u[0],u[1]])}for(let r=i;r>=0;r--){const a=(o-n+c.angle*r/i)*Math.PI/180,s=t.x+e*Math.sin(a),u=t.y+e*Math.cos(a),d=l(s,u);g.push([d[0],d[1]])}g.push(g[0]),s.push({type:"Feature",geometry:{type:"Polygon",coordinates:[g]},properties:{opacity:p}})}return{type:"FeatureCollection",features:s}})(e,o))},show:()=>{h=!0,t.getLayer(d)&&t.setLayoutProperty(d,"visibility","visible")},hide:()=>{h=!1,t.getLayer(d)&&t.setLayoutProperty(d,"visibility","none")},setConfig:(e={})=>{Object.assign(c,e),t.getLayer(d)&&e.fillColor&&t.setPaintProperty(d,"fill-color",c.fillColor)},remove:()=>{t.getLayer(d)&&t.removeLayer(d),t.getSource(u)&&t.removeSource(u)}}},createRobotProfile:yt,getAvailableProfileTypes:function(){return Object.keys(mt)},hasCapability:function(t,e){return t.capabilities&&t.capabilities.includes(e)},isActive:function(t){return t!==Q.IDLE&&t!==Q.ERROR&&t!==Q.MANUAL&&t!==Q.PAUSED},isTerminal:function(t){return t===Q.IDLE||t===Q.ERROR||t===Q.MANUAL||t===Q.PAUSED}},Symbol.toStringTag,{value:"Module"}));const ye={FORBIDDEN:"forbidden",SPEED_LIMIT:"speed_limit",SERVICE_AREA:"service_area",CHARGING:"charging",ELEVATOR:"elevator",WAITING:"waiting",ACTIVITY_AREA:"activity_area"},be={[ye.FORBIDDEN]:{fillColor:"#E53935",fillOpacity:.18,outlineColor:"#E53935",outlineWidth:2,outlineDash:[4,3],label:"禁行区"},[ye.SPEED_LIMIT]:{fillColor:"#FB8C00",fillOpacity:.15,outlineColor:"#FB8C00",outlineWidth:2,outlineDash:[6,3],label:"限速区"},[ye.SERVICE_AREA]:{fillColor:"#00897B",fillOpacity:.12,outlineColor:"#00897B",outlineWidth:1.5,outlineDash:null,label:"服务范围"},[ye.CHARGING]:{fillColor:"#43A047",fillOpacity:.2,outlineColor:"#43A047",outlineWidth:2,outlineDash:null,label:"充电区"},[ye.ELEVATOR]:{fillColor:"#1E88E5",fillOpacity:.15,outlineColor:"#1E88E5",outlineWidth:2,outlineDash:[3,3],label:"电梯区"},[ye.WAITING]:{fillColor:"#78909C",fillOpacity:.12,outlineColor:"#78909C",outlineWidth:1.5,outlineDash:[5,3],label:"等候区"},[ye.ACTIVITY_AREA]:{fillColor:"#FFFFFF",fillOpacity:.15,outlineColor:"#43A047",outlineWidth:2,outlineDash:[8,4],label:"活动区域"}};const ve=["click","mouseenter","mouseleave","mousemove"];function we(t,e){const o=function(){const t=new Map;function e(e,r){return t.has(e)||t.set(e,new Set),t.get(e).add(r),()=>o(e,r)}function o(e,o){var r;null==(r=t.get(e))||r.delete(o)}return{on:e,off:o,once:function(t,r){const n=e=>{r(e),o(t,n)};return e(t,n)},emit:function(e,o){var r;null==(r=t.get(e))||r.forEach((t=>t(o)))},destroy:function(){t.clear()}}}(),r=new Map,n=[],i=new Map,a={};return ve.forEach((s=>{const l=t=>{var e,a,l,c;const u=(null==(e=t.features)?void 0:e[0])??null,d={feature:u,lngLat:t.lngLat,originalEvent:t};if(null!=u){null==(l=null==(a=r.get(String(u.id)))?void 0:a.get(s))||l.forEach((t=>t(d)));const t=u.properties??{};n.forEach((({match:e,event:o,handler:r})=>{o===s&&Object.entries(e).every((([e,o])=>t[e]===o))&&r(d)})),null==(c=i.get(s))||c.forEach((t=>t(d)))}o.emit(s,d)};t.on(s,e,l),a[s]=l})),t.on("mouseenter",e,(()=>{t.getCanvas().style.cursor="pointer"})),t.on("mouseleave",e,(()=>{t.getCanvas().style.cursor=""})),{on:o.on,off:o.off,once:o.once,onFeature:function(t,e,o){if(void 0===o){const[o,r]=[t,e];return i.has(o)||i.set(o,new Set),i.get(o).add(r),()=>{var t;return null==(t=i.get(o))?void 0:t.delete(r)}}const[a,s,l]=[t,e,o];if("object"==typeof a&&null!==a){const t={match:a,event:s,handler:l};return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}const c=String(a);r.has(c)||r.set(c,new Map);const u=r.get(c);return u.has(s)||u.set(s,new Set),u.get(s).add(l),()=>{var t,e;return null==(e=null==(t=r.get(c))?void 0:t.get(s))?void 0:e.delete(l)}},offFeature:function(t,e,o){var a,s,l;if(void 0===o)null==(a=i.get(t))||a.delete(e);else if("object"==typeof t&&null!==t){const r=n.findIndex((r=>r.match===t&&r.event===e&&r.handler===o));-1!==r&&n.splice(r,1)}else null==(l=null==(s=r.get(String(t)))?void 0:s.get(e))||l.delete(o)},destroy:function(){ve.forEach((o=>{a[o]&&t.off(o,e,a[o])})),o.destroy(),r.clear(),n.length=0,i.clear()}}}const _e={defaultHeight:20,defaultColor:"#90caf9",opacity:.85,heightScale:1,showOutline:!1,outlineColor:"#42a5f5",visible:!0};let xe=0;const Ce=Object.freeze(Object.defineProperty({__proto__:null,ZONE_STYLE_PRESETS:be,ZONE_TYPE:ye,createBuildings:function(t,e,o={}){const r=++xe,n="bic-buildings-source-"+r,i="bic-buildings-layer-"+r,a="bic-buildings-outline-"+r,s=Object.assign({},_e,o);var l,c;t.addSource(n,{type:"geojson",data:e}),t.addLayer({id:i,type:"fill-extrusion",source:n,paint:(l=s.heightScale,c=s.opacity,{"fill-extrusion-color":["coalesce",["get","color"],s.defaultColor],"fill-extrusion-height":["*",["coalesce",["get","height"],s.defaultHeight],l],"fill-extrusion-base":["coalesce",["get","base_height"],0],"fill-extrusion-opacity":c})}),s.showOutline&&t.addLayer({id:a,type:"line",source:n,paint:{"line-color":s.outlineColor,"line-width":.8,"line-opacity":.6}});const u=we(t,i);return{show:function(){if(!s.visible)return t.setLayoutProperty(i,"visibility","visible"),s.showOutline&&t.getLayer(a)&&t.setLayoutProperty(a,"visibility","visible"),s.visible=!0,this},hide:function(){if(s.visible)return t.setLayoutProperty(i,"visibility","none"),s.showOutline&&t.getLayer(a)&&t.setLayoutProperty(a,"visibility","none"),s.visible=!1,this},remove:function(){return u.destroy(),t.getLayer(a)&&t.removeLayer(a),t.getLayer(i)&&t.removeLayer(i),t.getSource(n)&&t.removeSource(n),this},update:function(e,o={}){return e&&t.getSource(n).setData(e),Object.assign(s,o),t.setPaintProperty(i,"fill-extrusion-color",["coalesce",["get","color"],s.defaultColor]),t.setPaintProperty(i,"fill-extrusion-height",["*",["coalesce",["get","height"],s.defaultHeight],s.heightScale]),t.setPaintProperty(i,"fill-extrusion-opacity",s.opacity),s.showOutline&&t.getLayer(a)&&t.setPaintProperty(a,"line-color",s.outlineColor),this},setHeightScale:function(e){return s.heightScale=e,t.setPaintProperty(i,"fill-extrusion-height",["*",["coalesce",["get","height"],s.defaultHeight],s.heightScale]),this},setOpacity:function(e){return s.opacity=e,t.setPaintProperty(i,"fill-extrusion-opacity",s.opacity),this},on:u.on,off:u.off,once:u.once,onFeature:u.onFeature,offFeature:u.offFeature}},createFloorManager:function(t,e={}){var o;if(!t)throw new Error("地图未初始化。");if(!window.MapUtils)throw new Error("MapUtils 不可用,请确保已加载 bicMap 运行时。");const{floors:r=[],defaultFloor:n=null,onFloorChange:i=null,zoomFactor:a=2}=e;if(!r.length)throw new Error("floors 配置不能为空。");let s=null;const l=t=>`floor-slam-source-${t}`,c=t=>`floor-slam-layer-${t}`,u=t=>`floor-slam-canvas-${t}`,d=new Map,h=new Map,p=e=>{const o=c(e);t.getLayer(o)&&t.setLayoutProperty(o,"visibility","none");(h.get(e)??[]).forEach((e=>{t.getLayer(e)&&t.setLayoutProperty(e,"visibility","none")}))},g=async e=>{const o=r.find((t=>t.id===e));o&&s!==e&&(s&&p(s),await(async e=>{const{id:o,slamImagePath:r,slamOptions:n={}}=e,{startX:i=0,startY:s=0,xGridCount:p=512,yGridCount:g=512,resolution:f=.05,fitBounds:m=!0,padding:b={top:30,bottom:30,left:30,right:30}}=n,v=l(o),w=c(o),_=u(o);if(t.getSource(v))return t.setLayoutProperty(w,"visibility","visible"),(h.get(o)??[]).forEach((e=>{t.getLayer(e)&&t.setLayoutProperty(e,"visibility","visible")})),{cameraBound:d.get(o),coordinates:null};const x=window.MapUtils.getMapCorners({startX:i,startY:s,xGridCount:p,yGridCount:g,resolution:f}),C=t=>{const e=window.MapUtils.cartesianToGPS({x:t[0],y:t[1],scale:f,zoomFactor:a});return[e.longitude,e.latitude]},E=C([x.topLeft.x,x.topLeft.y]),I=C([x.topRight.x,x.topRight.y]),L=C([x.bottomRight.x,x.bottomRight.y]),S=C([x.bottomLeft.x,x.bottomLeft.y]),M=[E,I,L,S];let P=document.getElementById(_);P||(P=document.createElement("canvas"),P.id=_,P.style.display="none",document.body.appendChild(P)),P.width=p,P.height=g;const k=P.getContext("2d");try{const t=await y(r);k.drawImage(t,0,0,p,g)}catch(T){k.fillStyle="#ffffff",k.fillRect(0,0,p,g)}t.addSource(v,{type:"canvas",canvas:_,animate:!0,coordinates:M}),t.addLayer({id:w,type:"raster",source:v,minzoom:0,maxzoom:24,layout:{visibility:"visible"}});const R=t.cameraForBounds([S,I],{padding:b}),D=Object.assign({pitch:0,bearing:0},R);return d.set(o,D),m&&t.jumpTo(D),{cameraBound:D,coordinates:M}})(o),s=e,null==i||i(e,o))},f=n??(null==(o=r[0])?void 0:o.id);return f&&g(f),{switchTo:g,getActiveFloor:()=>s?{id:s,config:r.find((t=>t.id===s))??null}:null,getFloors:()=>r.map((t=>({id:t.id,label:t.label,active:t.id===s}))),hideFloor:p,bindLayers3D:(t,e=[])=>{h.set(t,e)},remove:()=>{r.forEach((({id:e})=>{const o=c(e),r=l(e),n=u(e);t.getLayer(o)&&t.removeLayer(o),t.getSource(r)&&t.removeSource(r);const i=document.getElementById(n);i&&i.remove()})),d.clear(),h.clear(),s=null}}},createLayerEvents:we,createSemanticZones:function(t,e=[],o={}){if(!t)throw new Error("地图未初始化。");const{showLabels:r=!0,labelFontSize:n=12,labelColor:i="#37474F",onClick:a=null}=o,s="bic-semantic-zones-fill-source",l="bic-semantic-zones-fill-layer",c="bic-semantic-zones-outline-source",u="bic-semantic-zones-outline-layer";let d=[...e];const h=()=>({type:"FeatureCollection",features:d.map(((t,e)=>{const o={...be[t.type]??be[ye.SERVICE_AREA],...t.style??{}},r=[...t.points];return r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0]),{type:"Feature",id:t.id??`zone-${e}`,geometry:{type:"Polygon",coordinates:[r]},properties:{id:t.id??`zone-${e}`,type:t.type,fillColor:o.fillColor,fillOpacity:o.fillOpacity,outlineColor:o.outlineColor,outlineWidth:o.outlineWidth}}}))}),p=()=>({type:"FeatureCollection",features:d.map(((t,e)=>{const o={...be[t.type]??be[ye.SERVICE_AREA],...t.style??{}},r=[...t.points];return r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0]),{type:"Feature",id:`outline-${t.id??e}`,geometry:{type:"LineString",coordinates:r},properties:{type:t.type,outlineColor:o.outlineColor,outlineWidth:o.outlineWidth,outlineDash:o.outlineDash?o.outlineDash.join(","):""}}}))});let g=[];const f=()=>{const e=window.maplibregl;e&&r&&(g.forEach((t=>t.remove())),g=[],d.forEach((o=>{const r=be[o.type]??be[ye.SERVICE_AREA],a=o.name??r.label,s=o.type===ye.SPEED_LIMIT&&o.speedLimit?`${a} ${o.speedLimit}km/h`:a,l=document.createElement("div");l.textContent=s,l.style.cssText=[`color:${i}`,`font-size:${n}px`,"font-weight:600","font-family:system-ui,PingFang SC,Microsoft YaHei,sans-serif","text-shadow:0 1px 3px rgba(0,0,0,0.6)","white-space:nowrap","pointer-events:none","user-select:none","letter-spacing:0.03em"].join(";");const c=(t=>{const e=t.length;return[t.reduce(((t,e)=>t+e[0]),0)/e,t.reduce(((t,e)=>t+e[1]),0)/e]})(o.points),u=new e.Marker({element:l,anchor:"center"}).setLngLat(c).addTo(t);g.push(u)})))},m=()=>{t.getSource(s)&&t.getSource(s).setData(h()),t.getSource(c)&&t.getSource(c).setData(p()),f()};return t.getSource(s)||(t.addSource(s,{type:"geojson",data:h()}),t.addLayer({id:l,type:"fill",source:s,paint:{"fill-color":["get","fillColor"],"fill-opacity":["case",["==",["get","type"],"speed_limit"],0,["get","fillOpacity"]]}})),t.getSource(c)||(t.addSource(c,{type:"geojson",data:p()}),t.addLayer({id:u,type:"line",source:c,paint:{"line-color":["get","outlineColor"],"line-width":["case",["==",["get","type"],"speed_limit"],0,["get","outlineWidth"]],"line-dasharray":[3,2]}})),f(),a&&(t.on("click",l,(e=>{e.originalEvent.stopPropagation();const o=t.queryRenderedFeatures(e.point,{layers:[l]})[0];if(!o)return;const r=d.find((t=>String(t.id)===String(o.properties.id)||d.indexOf(t)===Number(String(o.id).replace("zone-",""))));a({feature:o,zone:r,lngLat:e.lngLat})})),t.on("mouseenter",l,(()=>{t.getCanvas().style.cursor="pointer"})),t.on("mouseleave",l,(()=>{t.getCanvas().style.cursor=""}))),{addZone:t=>{d.push(t),m()},removeZone:t=>{d=d.filter((e=>e.id!==t)),m()},update:(t=[])=>{d=[...t],m()},show:()=>{[l,u].forEach((e=>{t.getLayer(e)&&t.setLayoutProperty(e,"visibility","visible")})),g.forEach((t=>{const e=t.getElement();e&&(e.style.display="")}))},hide:()=>{[l,u].forEach((e=>{t.getLayer(e)&&t.setLayoutProperty(e,"visibility","none")})),g.forEach((t=>{const e=t.getElement();e&&(e.style.display="none")}))},getZones:()=>[...d],remove:()=>{[l,u].forEach((e=>{t.getLayer(e)&&(t.off("click",e),t.off("mouseenter",e),t.off("mouseleave",e),t.removeLayer(e))})),[s,c].forEach((e=>{t.getSource(e)&&t.removeSource(e)})),g.forEach((t=>t.remove())),g=[],d=[]}}}},Symbol.toStringTag,{value:"Module"})),Ee={ELEVATOR_CALL:"elevator_call",ELEVATOR_ARRIVED:"elevator_arrived",ELEVATOR_OPEN:"elevator_open",ELEVATOR_CLOSE:"elevator_close",DOOR_OPEN:"door_open",DOOR_CLOSE:"door_close",DELIVERY_ARRIVED:"delivery_arrived",CUSTOM:"custom",WARNING:"warning",ERROR:"error"},Ie={[Ee.ELEVATOR_CALL]:{icon:"🛗",color:"#0066FF",label:"呼梯中"},[Ee.ELEVATOR_ARRIVED]:{icon:"✅",color:"#1CD5A4",label:"电梯已到"},[Ee.ELEVATOR_OPEN]:{icon:"🚪",color:"#34C759",label:"梯门已开"},[Ee.ELEVATOR_CLOSE]:{icon:"🚪",color:"#8E8E93",label:"梯门关闭"},[Ee.DOOR_OPEN]:{icon:"🔓",color:"#34C759",label:"门已开启"},[Ee.DOOR_CLOSE]:{icon:"🔒",color:"#8E8E93",label:"门已关闭"},[Ee.DELIVERY_ARRIVED]:{icon:"📦",color:"#F7A800",label:"配送到达"},[Ee.WARNING]:{icon:"⚠️",color:"#F7A800",label:"警告"},[Ee.ERROR]:{icon:"❌",color:"#FF3B30",label:"错误"},[Ee.CUSTOM]:{icon:"ℹ️",color:"#0066FF",label:"消息"}};const Le=Object.freeze(Object.defineProperty({__proto__:null,IOT_EVENT_TYPE:Ee,createIoTBubbles:function(t,e={}){if(!t)throw new Error("地图未初始化。");const{defaultDuration:o=4e3,maxBubbles:r=20,showIcon:n=!0}=e,i=new Map,a="bic-iot-bubble-styles";if(!document.getElementById(a)){const t=document.createElement("style");t.id=a,t.textContent="\n .bic-iot-bubble {\n position: absolute;\n pointer-events: none;\n transform: translateX(-50%) translateY(-100%);\n z-index: 10;\n animation: bic-iot-fadein 0.2s ease-out;\n }\n @keyframes bic-iot-fadein {\n from { opacity: 0; transform: translateX(-50%) translateY(-110%); }\n to { opacity: 1; transform: translateX(-50%) translateY(-100%); }\n }\n .bic-iot-bubble.bic-iot-fadeout {\n animation: bic-iot-fadeout 0.3s ease-in forwards;\n }\n @keyframes bic-iot-fadeout {\n from { opacity: 1; }\n to { opacity: 0; transform: translateX(-50%) translateY(-115%); }\n }\n .bic-iot-bubble-card {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border-radius: 8px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n white-space: nowrap;\n font-family: 'Harmony Regular', sans-serif;\n font-size: 12px;\n color: #fff;\n margin-bottom: 6px;\n }\n .bic-iot-bubble-arrow {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n margin: 0 auto;\n }\n ",document.head.appendChild(t)}const s=(e,o,r)=>{const n=t.project(r);o.style.left=`${n.x}px`,o.style.top=`${n.y}px`},l=new Map,c=e=>{const{id:a,lngLat:c,type:d=Ee.CUSTOM,message:h,deviceName:p,icon:g,color:f,label:m,duration:y}=e;if(!a||!c)return;if(i.has(a)&&u(a,!1),i.size>=r){const t=i.keys().next().value;u(t,!1)}const b=((t,e,o,r)=>{const i=Ie[t]??Ie[Ee.CUSTOM],a=(null==r?void 0:r.icon)??i.icon,s=(null==r?void 0:r.color)??i.color,l=(null==r?void 0:r.label)??i.label,c=document.createElement("div");c.className="bic-iot-bubble";const u=document.createElement("div");if(u.className="bic-iot-bubble-card",u.style.backgroundColor=s,n){const t=document.createElement("span");t.style.fontSize="14px",t.textContent=a,u.appendChild(t)}const d=document.createElement("div");d.innerHTML=`<div style="font-weight:bold;line-height:1.2;">${o||l}</div>`+(e?`<div style="font-size:10px;opacity:0.9;margin-top:1px;">${e}</div>`:""),u.appendChild(d);const h=document.createElement("div");return h.className="bic-iot-bubble-arrow",h.style.borderTop=`6px solid ${s}`,c.appendChild(u),c.appendChild(h),c})(d,h,p,d===Ee.CUSTOM&&(g||f||m)?{icon:g,color:f,label:m}:void 0);t.getContainer().appendChild(b),s(0,b,c);const v=()=>s(0,b,c);t.on("move",v),l.set(a,v);const w=void 0!==y?y:o;let _=null;w>0&&(_=setTimeout((()=>u(a,!0)),w)),i.set(a,{el:b,timer:_,lngLat:c})},u=(e,o=!0)=>{const r=i.get(e);if(!r)return;clearTimeout(r.timer);const n=l.get(e);n&&(t.off("move",n),l.delete(e)),o?(r.el.classList.add("bic-iot-fadeout"),r.el.addEventListener("animationend",(()=>r.el.remove()),{once:!0})):r.el.remove(),i.delete(e)},d=()=>{[...i.keys()].forEach((t=>u(t,!1)))};return{emit:c,update:t=>{c(t)},dismiss:t=>u(t,!0),clear:d,remove:()=>{d();const t=document.getElementById(a);t&&t.remove()}}}},Symbol.toStringTag,{value:"Module"}));return Object.assign(J,me,pe,Ce,Le),J.robot=me,J.navigation=pe,J.mapFeatures=Ce,J.overlay=Le,J.install=t=>{t.config.globalProperties.$bicMap=J},J}));