PageSourceSearch

https://safie.link/app/chunk-C-irTdy6.js

js safie.link collected 2026-10-03 23:57:08 UTC 22,043 bytes, 9 lines download raw bytes

1import {DevicePopupComponent as Ze}from'./chunk-25dD80hM.js';import {t as te$1}from'./chunk-D56_fBbb.js';import {h as hr}from'./chunk-71qX7tam.js';import {en as dI,al as K,dm as t,M as M$1,as as Fe,bt as cs,bI as L$1}from'./main-LEFCVYTE.js';import'./chunk-BvJy1pVU.js';import'./chunk-C6czb8TU.js';function J(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t];}var v=class n{constructor(){J(n,google.maps.OverlayView);}};var W=class extends v{constructor(e){super(),this.injector=e,this._cachedClusteredDeviceIds=[],this._subscription=new K,this._mapDeviceStore=this.injector.get(te$1),this._subscription.add(this._mapDeviceStore.clusteredDeviceIds$.subscribe(t=>{this._cachedClusteredDeviceIds=t??[];}));}set device(e){this._device=e,this.draw();}dispose(){var e;(e=this._subscription)==null||e.unsubscribe(),this._subscription=null,super.setMap(null);}onAdd(){this.div=document.createElement("div"),this.div.style.position="absolute";let e=document.createElement("div");e.classList.add("focus-effect"),this.div.appendChild(e);let t=document.createElement("div");t.classList.add("focus"),this.div.appendChild(t),this.getPanes().overlayLayer.appendChild(this.div);}draw(){if(this.div==null)return;if(!this._device||this._device.location==null||this._cachedClusteredDeviceIds.includes(this._device.deviceId)){this.div.style.display="none";return}this.div.style.display="";let e=this.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(this._device.location.lat,this._device.location.lon));this.div.style.left=`${e.x}px`,this.div.style.top=`${e.y}px`;}onRemove(){this.div&&(this.div.parentNode.removeChild(this.div),delete this.div);}};var le="block",ce="none",he="absolute",q=class extends v{constructor({labelAnchor:e=new google.maps.Point(0,0),position:t,map:s}){super(),this.createElements(),this.anchor=e,t instanceof google.maps.LatLng?this.position=t:this.position=new google.maps.LatLng(t),s&&this.setMap(s);}set content(e){this.labelDiv.innerHTML="",this.labelDiv.appendChild(e);}set visible(e){e?this.labelDiv.style.display=le:this.labelDiv.style.display=ce;}onAdd(){this.getPanes().overlayMouseTarget.appendChild(this.labelDiv);}draw(){let e=this.getProjection().fromLatLngToDivPixel(this.position),t=Math.round(e.x+this.anchor.x),s=Math.round(e.y+this.anchor.y);this.labelDiv.style.left=`${t}px`,this.labelDiv.style.top=`${s}px`;let i=this.zIndex||Math.ceil(e.y);this.labelDiv.style.zIndex=String(i);}onRemove(){this.labelDiv.parentNode.removeChild(this.labelDiv);}createElements(){this.labelDiv=document.createElement("div"),this.labelDiv.style.position=he;}};var X=class extends v{constructor(e,t){super(),this.injector=e,this._devices=[],this._imageElemMap=new Map,this._theme=t,this._mapDeviceStore=this.injector.get(te$1);}set devices(e){e?this._devices=e.filter(t=>{var s,i,o;return ((s=t.location)==null?void 0:s.lat)!=null&&((i=t.location)==null?void 0:i.lon)!=null&&((o=t.location)==null?void 0:o.azimuth)!=null}):this._devices=[],this.buildImageDiv(),this.draw();}set theme(e){this._theme=e;}get theme(){return this._theme}dispose(){super.setMap(null);}onAdd(){this._containerElem=document.createElement("div"),this.getPanes().overlayLayer.appendChild(this._containerElem);}draw(){if(this._containerElem==null||this._devices==null)return;this._devices.length!==this._imageElemMap.size&&this.buildImageDiv();let e=this._mapDeviceStore.getState().clusteredDeviceIds;for(let t of this._devices){let s=this._imageElemMap.get(t.deviceId);if(e.includes(t.deviceId))s.style.display="none";else if(t.location!=null){let i=this.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(t.location.lat,t.location.lon));s.style.left=`${i.x}px`,s.style.top=`${i.y}px`,s.style.transform=`rotate(${t.location.azimuth}deg)`,s.style.display="";}else s.style.display="none";}}onRemove(){this._containerElem&&(this._containerElem.parentNode.removeChild(this._containerElem),this._containerElem=null),this._imageElemMap.clear();}buildImageDiv(){if(this._containerElem==null)return;let e=[];for(let l of this._imageElemMap.keys())this._devices.some(r=>r.deviceId===l)||e.push(l);for(let l of e)this._containerElem.removeChild(this._imageElemMap.get(l)),this._imageElemMap.delete(l);let s=this.getMap().getMapTypeId()==="satellite"?"satellite":"map",i=s==="map"?`-${this.theme}`:"",o=50,c=60;for(let l of this._devices)if(!this._imageElemMap.has(l.deviceId)){let r=document.createElement("img");r.src=`assets/images/map-v1/range-${s}${i}.png`,r.style.width=`${o}px`,r.style.height=`${c}px`,r.style.position="absolute",r.style["margin-left"]=`-${o/2}px`,r.style["margin-top"]=`-${c}px`,r.style.display="none",r.style["transform-origin"]="50% 100%",this._containerElem.appendChild(r),this._imageElemMap.set(l.deviceId,r);}}};var N=L$1(hr());function w(n,e,t,s,i,o){if(i-s<=t)return;let c=s+i>>1;Q(n,e,c,s,i,o%2),w(n,e,t,s,c-1,o+1),w(n,e,t,c+1,i,o+1);}function Q(n,e,t,s,i,o){for(;i>s;){if(i-s>600){let h=i-s+1,a=t-s+1,u=Math.log(h),p=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*p*(h-p)/h)*(a-h/2<0?-1:1),d=Math.max(s,Math.floor(t-a*p/h+m)),g=Math.min(i,Math.floor(t+(h-a)*p/h+m));Q(n,e,t,d,g,o);}let c=e[2*t+o],l=s,r=i;for(x(n,e,s,t),e[2*i+o]>c&&x(n,e,s,i);l<r;){for(x(n,e,l,r),l++,r--;e[2*l+o]<c;)l++;for(;e[2*r+o]>c;)r--;}
1e[2*s+o]===c?x(n,e,s,r):(r++,x(n,e,r,i)),r<=t&&(s=r+1),t<=r&&(i=r-1);}}function x(n,e,t,s){$(n,t,s),$(e,2*t,2*s),$(e,2*t+1,2*s+1);}function $(n,e,t){let s=n[e];n[e]=n[t],n[t]=s;}function z(n,e,t,s,i,o,c){let l=[0,n.length-1,0],r=[],h,a;for(;l.length;){let u=l.pop(),p=l.pop(),m=l.pop();if(p-m<=c){for(let f=m;f<=p;f++)h=e[2*f],a=e[2*f+1],h>=t&&h<=i&&a>=s&&a<=o&&r.push(n[f]);continue}let d=Math.floor((m+p)/2);h=e[2*d],a=e[2*d+1],h>=t&&h<=i&&a>=s&&a<=o&&r.push(n[d]);let g=(u+1)%2;(u===0?t<=h:s<=a)&&(l.push(m),l.push(d-1),l.push(g)),(u===0?i>=h:o>=a)&&(l.push(d+1),l.push(p),l.push(g));}return r}function B(n,e,t,s,i,o){let c=[0,n.length-1,0],l=[],r=i*i;for(;c.length;){let h=c.pop(),a=c.pop(),u=c.pop();if(a-u<=o){for(let f=u;f<=a;f++)Y(e[2*f],e[2*f+1],t,s)<=r&&l.push(n[f]);continue}let p=Math.floor((u+a)/2),m=e[2*p],d=e[2*p+1];Y(m,d,t,s)<=r&&l.push(n[p]);let g=(h+1)%2;(h===0?t-i<=m:s-i<=d)&&(c.push(u),c.push(p-1),c.push(g)),(h===0?t+i>=m:s+i>=d)&&(c.push(p+1),c.push(a),c.push(g));}return l}function Y(n,e,t,s){let i=n-t,o=e-s;return i*i+o*o}var ue=n=>n[0],pe=n=>n[1],y=class{constructor(e,t=ue,s=pe,i=64,o=Float64Array){this.nodeSize=i,this.points=e;let c=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new c(e.length),r=this.coords=new o(e.length*2);for(let h=0;h<e.length;h++)l[h]=h,r[2*h]=t(e[h]),r[2*h+1]=s(e[h]);w(l,r,i,0,l.length-1,0);}range(e,t,s,i){return z(this.ids,this.coords,e,t,s,i,this.nodeSize)}within(e,t,s){return B(this.ids,this.coords,e,t,s,this.nodeSize)}};var de={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:false,generateId:false,reduce:null,map:n=>n},E=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),C=class{constructor(e){this.options=k(Object.create(de),e),this.trees=new Array(this.options.maxZoom+1);}load(e){let{log:t,minZoom:s,maxZoom:i,nodeSize:o}=this.options;t&&console.time("total time");let c=`prepare ${e.length} points`;t&&console.time(c),this.points=e;let l=[];for(let r=0;r<e.length;r++)e[r].geometry&&l.push(fe(e[r],r));this.trees[i+1]=new y(l,te,se,o,Float32Array),t&&console.timeEnd(c);for(let r=i;r>=s;r--){let h=+Date.now();l=this._cluster(l,r),this.trees[r]=new y(l,te,se,o,Float32Array),t&&console.log("z%d: %d clusters in %dms",r,l.length,+Date.now()-h);}return t&&console.timeEnd("total time"),this}getClusters(e,t){let s=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,c=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)s=-180,o=180;else if(s>o){let a=this.getClusters([s,i,180,c],t),u=this.getClusters([-180,i,o,c],t);return a.concat(u)}let l=this.trees[this._limitZoom(t)],r=l.range(L(s),D(c),L(o),D(i)),h=[];for(let a of r){let u=l.points[a];h.push(u.numPoints?ee(u):this.points[u.index]);}return h}getChildren(e){let t=this._getOriginId(e),s=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(i);let c=o.points[t];if(!c)throw new Error(i);let l=this.options.radius/(this.options.extent*Math.pow(2,s-1)),r=o.within(c.x,c.y,l),h=[];for(let a of r){let u=o.points[a];u.parentId===e&&h.push(u.numPoints?ee(u):this.points[u.index]);}if(h.length===0)throw new Error(i);return h}getLeaves(e,t,s){t=t||10,s=s||0;let i=[];return this._appendLeaves(i,e,t,s,0),i}getTile(e,t,s){let i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:c,radius:l}=this.options,r=l/c,h=(s-r)/o,a=(s+1+r)/o,u={features:[]};return this._addTileFeatures(i.range((t-r)/o,h,(t+1+r)/o,a),i.points,t,s,o,u),t===0&&this._addTileFeatures(i.range(1-r/o,h,1,a),i.points,o,s,o,u),t===o-1&&this._addTileFeatures(i.range(0,h,r/o,a),i.points,-1,s,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let s=this.getChildren(e);if(t++,s.length!==1)break;e=s[0].properties.cluster_id;}return t}_appendLeaves(e,t,s,i,o){let c=this.getChildren(t);for(let l of c){let r=l.properties;if(r&&r.cluster?o+r.point_count<=i?o+=r.point_count:o=this._appendLeaves(e,r.cluster_id,s,i,o):o<i?o++:e.push(l),e.length===s)break}return o}_addTileFeatures(e,t,s,i,o,c){for(let l of e){let r=t[l],h=r.numPoints,a,u,p;if(h)a=ie(r),u=r.x,p=r.y;else {let g=this.points[r.index];a=g.properties,u=L(g.geometry.coordinates[0]),p=D(g.geometry.coordinates[1]);}let m={type:1,geometry:[[Math.round(this.options.extent*(u*o-s)),Math.round(this.options.extent*(p*o-i))]],tags:a},d;h?d=r.id:this.options.generateId?d=r.index:this.points[r.index].id&&(d=this.points[r.index].id),d!==void 0&&(m.id=d),c.features.push(m);}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let s=[],{radius:i,extent:o,reduce:c,minPoints:l}=this.options,r=i/(o*Math.pow(2,t));for(let h=0;h<e.length;h++){let a=e[h];if(a.zoom<=t)continue;a.zoom=t;let u=this.trees[t+1],p=u.within(a.x,a.y,r),m=a.numPoints||1,d=m;for(let g of p){let f=u.points[g];f.zoom>t&&(d+=f.numPoints||1);}if(d>m&&d>=l){let g=a.x*m,f=a.y*m,P=c&&m>1?this._map(a,true):null,O=(h<<5)+(t+1)+this.points.length;for(let ne of p){let _=u.points[ne];if(_.zoom<=t)continue;_.zoom=t;let A=_.numPoints||1;g+=_.x*A,f+=_.y*A,_.parentId=O,c&&(P||(P=this._map(a,true)),c(P,this._map(_)));}a.parentId=O,s.push(me(g/d,f/d,O,d,P));}else if(s.push(a),d>1)for(let g of p){let f=u.points[g];f.zoom<=t||(f.zoom=t,s.push(f));}}return s}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return (e-this.points.length)%32}_map(e,t){if(e.numPoints)return t?k({},e.properties):e.properties;let s=this.points[e.index].properties,i=this.options.map(s);return t&&i===s?k({},i):i}};function me(n,e,t,s,i){return {x:E(n),y:E(e),zoom:1/0,id:t,parentId:-1,numPoints:s,properties:i}}function fe(n,e){let[t,s]=n.geometry.coordinates;return {x:E(L(t)),y:E(D(s)),zoom:1/0,index:e,parentId:-1}}function ee(n){return {type:"Feature",id:n.id,properties:ie(n),geometry:{type:"Point",coordinates:[ge(n.x),ve(n.y)]}}}function ie(n){let e=n.numPoints,t=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return k(k({},n.properties),{cluster:true,cluster_id:n.id,point_count:e,point_count_abbreviated:t})}function L(n){return n/360+.5}function D(n){let e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function ge(n){return (n-.5)*360}function ve(n){let e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function k(n,e){for(let t in e)n[t]=e[t];return n}function te(n){return n.x}function se(n){return n.y}function _e(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)e.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(t[s[i]]=n[s[i]]);return t}var b=class{constructor({markers:e,position:t}){this.markers=e,t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t));}get bounds(){if(!(this.markers.length===0&&!this._position))return this.markers.reduce((e,t)=>
1e.extend(t.getPosition()),new google.maps.LatLngBounds(this._position,this._position))}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>e.getVisible()).length}push(e){this.markers.push(e);}delete(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0;}};var j=class{constructor({maxZoom:e=16}){this.maxZoom=e;}noop({markers:e}){return Me(e)}};var Me=n=>n.map(t=>new b({position:t.getPosition(),markers:[t]}));var S=class extends j{constructor(e){var{maxZoom:t,radius:s=60}=e,i=_e(e,["maxZoom","radius"]);super({maxZoom:t}),this.superCluster=new C(Object.assign({maxZoom:this.maxZoom,radius:s},i)),this.state={zoom:null};}calculate(e){let t=false;if(!(0, N.default)(e.markers,this.markers)){t=true,this.markers=[...e.markers];let i=this.markers.map(o=>({type:"Feature",geometry:{type:"Point",coordinates:[o.getPosition().lng(),o.getPosition().lat()]},properties:{marker:o}}));this.superCluster.load(i);}let s={zoom:e.map.getZoom()};return t||this.state.zoom>this.maxZoom&&s.zoom>this.maxZoom||(t=t||!(0, N.default)(this.state,s)),this.state=s,t&&(this.cluster
1s=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(this.transformCluster.bind(this))}transformCluster({geometry:{coordinates:[e,t]},properties:s}){if(s.cluster)return new b({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map(i=>i.properties.marker),position:new google.maps.LatLng({lat:t,lng:e})});{let i=s.marker;return new b({markers:[i],position:i.getPosition()})}}},T=class{constructor(e,t){this.markers={sum:e.length};let s=t.map(o=>o.count),i=s.reduce((o,c)=>o+c,0);this.clusters={count:t.length,markers:{mean:i/t.length,sum:i,min:Math.min(...s),max:Math.max(...s)}};}},Z=class{render({count:e,position:t},s){let i=e>Math.max(10,s.clusters.markers.mean)?"#ff0000":"#0000ff",o=window.btoa(`
2  <svg fill="${i}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
3    <circle cx="120" cy="120" opacity=".6" r="70" />
4    <circle cx="120" cy="120" opacity=".3" r="90" />
5    <circle cx="120" cy="120" opacity=".2" r="110" />
6  </svg>`);return new google.maps.Marker({position:t,icon:{url:`data:image/svg+xml;base64,${o}`,scaledSize:new google.maps.Size(45,45)},label:{text:String(e),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:`Cluster of ${e} markers`,zIndex:Number(google.maps.Marker.MAX_ZINDEX)+e})}};var R=class{set showPopup(e){this._showPopup!==e&&(this._showPopup=e,this._showPopup&&this._visible?this.buildPopup():this.destroyPopup());}get showPopup(){return this._showPopup}constructor(e,t$1,s){this.map=e,this.injector=t$1,this.theme=s,this._visible=true,this._showPopup=true,this._uuid=t.newGuid(),this._subscription=new K;}set device(e){this._device=e,this._device&&this.visible&&(this.marker==null&&this.buildMarker(),this.updateMarker(),this.showPopup&&this._popup==null&&this.buildPopup());}get device(){return this._device}set visible(e){this._visible!==e&&(this._visible=e,this._visible?(this.showPopup&&this.buildPopup(),this.marker&&(this.marker.setMap(this.map),this.updateMarker())):this.marker&&(this.marker.setMap(null),this.destroyPopup()));}get visible(){return this._visible}dispose(){var e;this.marker&&(google.maps.event.clearInstanceListeners(this.marker),this.marker.setMap(null),this.marker=null),(e=this._observer)==null||e.disconnect(),this._observer=null,this.destroyPopup();}focus(){this.marker&&this.marker.setZIndex(999);}unfocus(){this.marker&&this.marker.setZIndex(null);}buildMarker(){this.marker=new google.maps.Marker({clickable:true,draggable:false,map:this.map,title:this._uuid});let e=this.injector.get(te$1);this.marker.addListener("click",()=>{e.selectDevice(null),e.selectDevice(this.device.deviceId);}),this.marker.addListener("mouseover",t=>{this._showPopup||this.buildPopup();}),this.marker.addListener("mouseout",()=>{this._showPopup||this.destroyPopup();});}buildPopup(){return M$1(this,null,function*(){this.destroyPopup(),this.marker!=null&&(this._subscription=Fe(this.getElement()).subscribe(e=>{this._element=e;let s=this.injector.get(cs).createComponent(Ze,{injector:this.injector});s.location.nativeElement.parentNode.removeChild(s.location.nativeElement),s.instance.device=this._device,s.changeDetectorRef.detectChanges(),this._element.appendChild(s.location.nativeElement),this._popup=s;}));})}destroyPopup(){var e;this._popup&&(this._popup.location.nativeElement.parentElement&&this._popup.location.nativeElement.remove(),this._popup.destroy(),this._popup=null),(e=this._subscription)==null||e.unsubscribe();}getElement(){var t;if(this.marker==null)return;this.marker.setTitle(this._uuid);let e=this.map.getDiv().querySelector(`[title="${this._uuid}"],[aria-label="${this._uuid}"]`);return e?(this.marker.setTitle(null),e.classList.add("device"),Promise.resolve(e)):((t=this._observer)==null||t.disconnect(),this._observer=null,new Promise(s=>{this._observer=new MutationObserver(i=>{let o=this.map.getDiv().querySelector(`[title="${this._uuid}"],[aria-label="${this._uuid}"]`);o&&(this.marker.setTitle(null),o.classList.add("device"),s(o),this._observer.disconnect());}),this._observer.observe(this.map.getDiv(),{attributes:false,childList:true,characterData:false,subtree:true});}))}
6updateMarker(){if(this._device==null)return;let e={lat:this._device.location.lat,lng:this._device.location.lon};this.marker.setPosition(e),this._popup&&(this._popup.instance.device=this._device);let t=this.map.getMapTypeId()==="satellite"?"satellite":"map",s="";this._device.capabilities.includes("gps")&&this._device.capabilities.includes("wearable")?s=this._device.location.outdated?`assets/images/map-v1/pin-pocket-2-gray-${t}.png`:`assets/images/map-v1/pin-pocket-2-${t}-${this.theme}.png`:s=this._device.location.outdated?`assets/images/map-v1/pin-video-gray-${t}.png`:`assets/images/map-v1/pin-video-${t}-${this.theme}.png`;let i={url:s,scaledSize:new google.maps.Size(32,40)};this.marker.setIcon(i),this.marker._deviceId=this._device.deviceId;}},oe=class extends v{constructor(e,t){super(),this.injector=e,this._initialized=false,this._selectedDeviceId=null,this._showPopup=true,this._clusterMarkers=[],this._theme=t;}get initialized(){return this._initialized}set showPopup(e){this._showPopup!==e&&(this._showPopup=e,this._deviceMarkerMap.forEac
6h(t=>{t.showPopup=this._showPopup;}));}get showPopup(){return this._showPopup}set theme(e){this._theme=e;}get theme(){return this._theme}dispose(){this._deviceMarkerMap.forEach((e,t)=>{e.dispose();}),this.clusteringMarkers([]);}setMap(e){this._map=e,this._deviceMarkerMap=new Map,this._mapDeviceStore=this.injector.get(te$1);}setDevices(e){if(e==null||e.length===0){this._deviceMarkerMap.forEach((s,i)=>{s.dispose();}),this._deviceMarkerMap=new Map,this._clusterMarkers.length>0&&this.clusteringMarkers([]),this._initialized=false;return}let t=[];for(let s of this._deviceMarkerMap.keys())e.some(i=>i.deviceId===s)||t.push(s);for(let s of t)this._deviceMarkerMap.get(s).dispose(),this._deviceMarkerMap.delete(s);for(let s of e){let i=this._deviceMarkerMap.get(s.deviceId);s.location?(i||(i=new R(this._map,this.injector,this.theme),i.showPopup=this._showPopup,this._deviceMarkerMap.set(s.deviceId,i)),i.device=s):i&&(i.dispose(),this._deviceMarkerMap.delete(s.deviceId));}this._initialized=true;}selectDevice(e){if(this._selectedDeviceId){let t=this._deviceMarkerMap.get(this._selectedDeviceId);t==null||t.unfocus(),this._selectedDeviceId=null;}if(e){let t=this._deviceMarkerMap.get(e);t==null||t.focus(),this._selectedDeviceId=e;}}setMapExtent(e){let t=[],s=[];if(e){let i=e.expand(2);
6i.valid?this._deviceMarkerMap.forEach((o,c)=>{let l=o.device.location;l&&i.contains(l.lon,l.lat)?(t.push(o.device.deviceId),s.push(o)):o.visible=false;}):this._deviceMarkerMap.forEach((o,c)=>{o.visible=false;}),this.clusteringMarkers(s);}this._mapDeviceStore.setDeviceVisibility(t);}clusteringMarkers(e){let t=e.map(a=>a.marker),s=new Date().getTime(),i=new S({maxZoom:15}),{clusters:o}=i.calculate({markers:t,map:this._map,mapCanvasProjection:this.getProjection()});o=o.filter(a=>a.count>1);let c=[];for(let a of o)for(let u of a.markers){let p=this._deviceMarkerMap.get(u._deviceId);c.push(p.device.deviceId);}for(let a of e)a.visible=!c.includes(a.device.deviceId);if(Math.round(this._map.getZoom())>15){this._clusterMarkers.filter(a=>a.updatedOn!==s).forEach(a=>a.marker.setMap(null)),this._clusterMarkers=this._clusterMarkers.filter(a=>a.updatedOn===s),this._mapDeviceStore.setClusteredDeviceIds([]);return}let l=new Z,r=new T(t,o),h=this._map.getMapTypeId();for(let a of o){let u=this._clusterMarkers.find(p=>p.marker.getPosition().equals(a.position));if(u)u.updatedOn=s;else {let p=l.render(a,r);p.setLabel({text:String(a.markers.length),color:"#fff",fontSize:"0.8125rem",fontWeight:"bold"});let m=dI("st-bg-surface-accent-primary"),d=window.btoa(`
7        <svg fill="${m}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
8        ${h==="satellite"?'<circle cx="32" cy="32" opacity="1" r="31" stroke="white" stroke-width="2"/>':'<circle cx="32" cy="32" opacity="1" r="32"/>'}
9        </svg>`);p.setIcon({url:`data:image/svg+xml;base64,${d}`,scaledSize:new google.maps.Size(32,32)}),p.setMap(this._map),this._clusterMarkers.push({marker:p,updatedOn:s}),p.addListener("click",()=>{this._map.fitBounds(a.bounds,100);});}}this._clusterMarkers.filter(a=>a.updatedOn!==s).forEach(a=>a.marker.setMap(null)),this._clusterMarkers=this._clusterMarkers.filter(a=>a.updatedOn===s),this._mapDeviceStore.setClusteredDeviceIds(c);}};var chunkDXXZPQ2V=/*#__PURE__*/Object.freeze({__proto__:null,AzimuthOverlay:X,DeviceOverlay:oe,FocusOverlay:W,PopupContainer:q});export{S,T,W,X,Z,chunkDXXZPQ2V as c,oe as o,q,v};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.