vue3-google-map 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +873 -709
- package/dist/index.umd.js +4 -4
- package/dist/types/components/DebouncedMarkerClusterer.d.ts +20 -0
- package/dist/types/components/MarkerCluster.d.ts +12 -2
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ All the map components are available on the `Vue3GoogleMap` global variable.
|
|
|
58
58
|
|
|
59
59
|
### Your First Map
|
|
60
60
|
|
|
61
|
-
To construct a map using `vue3-google-map` you'll need to use the base `GoogleMap` component which receives your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key), styles (e.g. setting width and height), and any [MapOptions](https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions) to configure your map ([see this](https://github.com/inocan-group/vue3-google-map/blob/develop/src/components/GoogleMap.vue#
|
|
61
|
+
To construct a map using `vue3-google-map` you'll need to use the base `GoogleMap` component which receives your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key), styles (e.g. setting width and height), and any [MapOptions](https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions) to configure your map ([see this](https://github.com/inocan-group/vue3-google-map/blob/develop/src/components/GoogleMap.vue#L41-L245) for all the supported `MapOptions`).
|
|
62
62
|
Other map features can be added to your map by passing map subcomponents ([Marker](#marker), [Polyline](#polyline), [Polygon](#polygon), [Rectangle](#rectangle), [Circle](#circle), [InfoWindow](#info-window), [CustomMarker](#custom-marker), [CustomControl](#custom-control), or [MarkerCluster](#marker-cluster)) to the default slot of the `GoogleMap` component.
|
|
63
63
|
|
|
64
64
|
The [the following events](https://developers.google.com/maps/documentation/javascript/reference/map#Map-Events) will be emitted by the `GoogleMap` component and can be listened to by using `@event_name`.
|
|
@@ -719,6 +719,30 @@ const locations = [
|
|
|
719
719
|
|
|
720
720
|
You can listen for [the following events](https://googlemaps.github.io/js-markerclusterer/enums/MarkerClustererEvents.html) on the `MarkerCluster` component.
|
|
721
721
|
|
|
722
|
+
#### Performance Optimization
|
|
723
|
+
|
|
724
|
+
MarkerCluster uses debounced rendering to improve performance when adding or removing markers. Instead of rendering after every marker operation, it batches multiple operations together and renders once after a short delay.
|
|
725
|
+
|
|
726
|
+
The `renderDebounceDelay` prop controls the debounce delay in milliseconds (default: `10`). For immediate rendering, access the underlying clusterer via a template ref and call `render()`:
|
|
727
|
+
|
|
728
|
+
```vue
|
|
729
|
+
<script setup>
|
|
730
|
+
import { ref } from 'vue'
|
|
731
|
+
|
|
732
|
+
const clusterRef = ref()
|
|
733
|
+
|
|
734
|
+
function forceRender() {
|
|
735
|
+
clusterRef.value?.markerCluster?.render()
|
|
736
|
+
}
|
|
737
|
+
</script>
|
|
738
|
+
|
|
739
|
+
<template>
|
|
740
|
+
<MarkerCluster ref="clusterRef">
|
|
741
|
+
<!-- markers -->
|
|
742
|
+
</MarkerCluster>
|
|
743
|
+
</template>
|
|
744
|
+
```
|
|
745
|
+
|
|
722
746
|
### Heatmap Layer
|
|
723
747
|
|
|
724
748
|
> [!WARNING]
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-c63ff230]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-
|
|
2
|
-
"use strict";var Ue=Object.defineProperty;var Ze=(r,e,t)=>e in r?Ue(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Q=(r,e,t)=>(Ze(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),T=Symbol("map"),L=Symbol("api"),se=Symbol("marker"),ae=Symbol("markerCluster"),Y=Symbol("CustomMarker"),ie=Symbol("mapTilesLoaded"),I=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Ve(r,e){r.src=e}const Ge=r=>{var e,t,n,o="The Google Maps JavaScript API",s="google",i="importLibrary",u="__ib__",a=document,p=window,f=p[s]||(p[s]={}),c=f.maps||(f.maps={}),m=new Set,g=new URLSearchParams,h=()=>e||(e=new Promise(async(d,v)=>{var y;await(t=a.createElement("script")),g.set("libraries",[...m]+"");for(n in r)g.set(n.replace(/[A-Z]/g,w=>"_"+w[0].toLowerCase()),r[n]);g.set("callback",s+".maps."+u),Ve(t,"https://maps.googleapis.com/maps/api/js?"+g),c[u]=d,t.onerror=()=>e=v(Error(o+" could not load.")),t.nonce=((y=a.querySelector("script[nonce]"))==null?void 0:y.nonce)||"",a.head.append(t)}));c[i]?console.warn(o+" only loads once. Ignoring:",r):c[i]=(d,...v)=>m.add(d)&&h().then(()=>c[i](d,...v))},Fe=r=>`The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(r)}) will be ignored.`,ze=r=>`The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(r)}) will be ignored.`,We="No options were set before calling importLibrary. Make sure to configure the loader using setOptions().",He="There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.",le=process.env.NODE_ENV!=="production"?r=>{console.warn(`[@googlemaps/js-api-loader] ${r}`)}:()=>{},Ke=process.env.NODE_ENV!=="production"?r=>{console.info(`[@googlemaps/js-api-loader] ${r}`)}:()=>{};let ne=!1;function Ye(r){if(ne){le(Fe(r));return}Xe(r),ne=!0}async function Je(r){var e,t;if(ne||le(We),!((t=(e=window==null?void 0:window.google)==null?void 0:e.maps)!=null&&t.importLibrary))throw new Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(r)}function Xe(r){var t,n;const e=!!((n=(t=window.google)==null?void 0:t.maps)!=null&&n.importLibrary);e?Ke(ze(r)):process.env.NODE_ENV!=="production"&&document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]')&&le(He),e||Ge(r)}function Qe(r){return class extends r.OverlayView{constructor(n){super();Q(this,"element");Q(this,"opts");const{element:o,...s}=n;this.element=o,this.opts=s,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof r.LatLng?this.opts.position:new r.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const n=this.element;return n.style.display!=="none"&&n.style.visibility!=="hidden"&&(n.style.opacity===""||Number(n.style.opacity)>.01)}onAdd(){if(!this.element)return;const n=this.getPanes();n&&n.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const n=this.getProjection(),o=n==null?void 0:n.fromLatLngToDivPixel(this.getPosition());if(o){this.element.style.position="absolute";let s,i;switch(this.opts.anchorPoint){case"TOP_CENTER":s="-50%",i="-100%";break;case"BOTTOM_CENTER":s="-50%",i="0";break;case"LEFT_CENTER":s="-100%",i="-50%";break;case"RIGHT_CENTER":s="0",i="-50%";break;case"TOP_LEFT":s="-100%",i="-100%";break;case"TOP_RIGHT":s="0",i="-100%";break;case"BOTTOM_LEFT":s="-100%",i="0";break;case"BOTTOM_RIGHT":s="0",i="0";break;default:s="-50%",i="-50%"}const u=o.x+(this.opts.offsetX||0)+"px",a=o.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${s}) translateX(${u}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(n){const{element:o,...s}=n;this.element=o,this.opts=s,this.draw()}}}let de=!1;const fe=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],et=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},colorScheme:{type:String,required:!1},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1}},emits:fe,setup(r,{emit:e}){const t=l.ref(),n=l.ref(!1),o=l.ref(),s=l.ref(),i=l.ref(!1);l.provide(T,o),l.provide(L,s),l.provide(ie,i);const u=()=>{const c={...r};Object.keys(c).forEach(d=>{c[d]===void 0&&delete c[d]});const g=d=>{var v;return d?{position:(v=s.value)==null?void 0:v.ControlPosition[d]}:{}},h={scaleControlOptions:r.scaleControlStyle?{style:r.scaleControlStyle}:{},panControlOptions:g(r.panControlPosition),zoomControlOptions:g(r.zoomControlPosition),rotateControlOptions:g(r.rotateControlPosition),streetViewControlOptions:g(r.streetViewControlPosition),fullscreenControlOptions:g(r.fullscreenControlPosition),cameraControlOptions:g(r.cameraControlPosition),disableDefaultUI:r.disableDefaultUi};return{...c,...h}},a=l.watch([s,o],([c,m])=>{const g=c,h=m;g&&h&&(g.event.addListenerOnce(h,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),p=()=>{const{apiKey:c,region:m,version:g,language:h,libraries:d}=r;Ye({key:c,region:m,v:g,language:h,libraries:d})},f=c=>{const m=c?c.maps:google.maps;s.value=l.markRaw(m),o.value=l.markRaw(new m.Map(t.value,u()));const g=Qe(s.value);s.value[Y]=g,fe.forEach(d=>{var v;(v=o.value)==null||v.addListener(d,y=>e(d,y))}),n.value=!0;const h=Object.keys(r).filter(d=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom"].includes(d)).map(d=>l.toRef(r,d));l.watch([()=>r.center,()=>r.zoom,...h],([d,v],[y,w])=>{var k,S,N;const{center:_,zoom:P,...C}=u();(k=o.value)==null||k.setOptions(C),v!==void 0&&v!==w&&((S=o.value)==null||S.setZoom(v));const M=!y||d.lng!==y.lng||d.lat!==y.lat;d&&M&&((N=o.value)==null||N.panTo(d))})};return l.onMounted(()=>{if(r.apiPromise&&r.apiPromise instanceof Promise)r.apiPromise.then(f);else{de||(p(),de=!0);const c=r.libraries&&r.libraries.length>0?r.libraries:["maps","marker"];Promise.all(c.map(m=>Je(m))).then(()=>f())}}),l.onBeforeUnmount(()=>{var c;i.value=!1,o.value&&((c=s.value)==null||c.event.clearInstanceListeners(o.value))}),{mapRef:t,ready:n,map:o,api:s,mapTilesLoaded:i}}});const G=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},tt={ref:"mapRef",class:"mapdiv"};function rt(r,e,t,n,o,s){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",tt,null,512),l.renderSlot(r.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:r.ready,map:r.map,api:r.api,mapTilesLoaded:r.mapTilesLoaded})),void 0,!0)])}const nt=G(et,[["render",rt],["__scopeId","data-v-c63ff230"]]);function ot(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var st=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!r(e[o],t[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!r(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const Z=ot(st),me=["click","drag","dragend","dragstart","gmp-click"],at=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:me,setup(r,{emit:e,expose:t,slots:n}){const o=l.ref(),s=l.computed(()=>{var g;return(g=n.content)==null?void 0:g.call(n).some(h=>h.type!==l.Comment)}),i=l.toRef(r,"options"),u=l.toRef(r,"pinOptions"),a=l.ref(),p=l.inject(T,l.ref()),f=l.inject(L,l.ref()),c=l.inject(ae,l.ref()),m=l.computed(()=>!!(c.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([p,i,u,o],async(g,[h,d,v,y])=>{var k,S,N;const w=!Z(i.value,d)||!Z(u.value,v),_=o.value!==y,P=w||_||p.value!==h;if(!p.value||!f.value||!P||s.value&&!o.value)return;const{AdvancedMarkerElement:C,PinElement:M}=f.value.marker;if(a.value){const{map:J,content:F,...X}=i.value;Object.assign(a.value,{content:s.value?o.value:u.value?new M(u.value).element:F,...X}),m.value&&((k=c.value)==null||k.removeMarker(a.value),(S=c.value)==null||S.addMarker(a.value))}else s.value?i.value.content=o.value:u.value&&(i.value.content=new M(u.value).element),a.value=l.markRaw(new C(i.value)),m.value?(N=c.value)==null||N.addMarker(a.value):a.value.map=p.value,me.forEach(J=>{var F;(F=a.value)==null||F.addListener(J,X=>e(J,X))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,h;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(h=c.value)==null||h.removeMarker(a.value):a.value.map=null)}),l.provide(se,a),t({marker:a}),{hasCustomSlotContent:s,markerRef:o}}});const it={key:0,class:"advanced-marker-wrapper"};function lt(r,e,t,n,o,s){return l.openBlock(),l.createElementBlock(l.Fragment,null,[r.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",it,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},r.$attrs),[l.renderSlot(r.$slots,"content")],16)])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default")],64)}const ut=G(at,[["render",lt]]),he=r=>r==="Marker",ge=r=>r===Y,B=(r,e,t,n)=>{const o=l.ref(),s=l.inject(T,l.ref()),i=l.inject(L,l.ref()),u=l.inject(ae,l.ref()),a=l.computed(()=>!!(u.value&&i.value&&(o.value instanceof i.value.Marker||o.value instanceof i.value[Y])));return l.watch([s,t],(p,[f,c])=>{var g,h,d;const m=!Z(t.value,c)||s.value!==f;if(!(!s.value||!i.value||!m))if(o.value)o.value.setOptions(t.value),a.value&&((g=u.value)==null||g.removeMarker(o.value),(h=u.value)==null||h.addMarker(o.value));else{if(he(r))o.value=l.markRaw(new i.value[r](t.value));else if(ge(r)){const v=t.value;v.element&&(o.value=l.markRaw(new i.value[r](v)))}else o.value=l.markRaw(new i.value[r]({...t.value,map:s.value}));o.value&&(a.value?(d=u.value)==null||d.addMarker(o.value):(he(r)||ge(r))&&o.value.setMap(s.value)),e.forEach(v=>{var y;(y=o.value)==null||y.addListener(v,w=>n(v,w))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var p,f;o.value&&((p=i.value)==null||p.event.clearInstanceListeners(o.value),a.value?(f=u.value)==null||f.removeMarker(o.value):o.value.setMap(null))}),o},ve=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],ct=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:ve,setup(r,{emit:e,expose:t,slots:n}){const o=l.toRef(r,"options"),s=B("Marker",ve,o,e);return l.provide(se,s),t({marker:s}),()=>{var i;return(i=n.default)==null?void 0:i.call(n)}}}),pt=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:I,setup(r,{emit:e}){const t=l.toRef(r,"options");return{polyline:B("Polyline",I,t,e)}},render:()=>null}),dt=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:I,setup(r,{emit:e}){const t=l.toRef(r,"options");return{polygon:B("Polygon",I,t,e)}},render:()=>null}),ye=I.concat(["bounds_changed"]),ft=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ye,setup(r,{emit:e}){const t=l.toRef(r,"options");return{rectangle:B("Rectangle",ye,t,e)}},render:()=>null}),we=I.concat(["center_changed","radius_changed"]),mt=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:we,setup(r,{emit:e}){const t=l.toRef(r,"options");return{circle:B("Circle",we,t,e)}},render:()=>null}),ht=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(r,{emit:e}){const t=l.ref(null),n=l.inject(T,l.ref()),o=l.inject(L,l.ref()),s=l.inject(ie,l.ref(!1)),i=l.watch([s,o,t],([p,f,c])=>{f&&p&&c&&(u(r.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),u=p=>{if(n.value&&o.value&&t.value){const f=o.value.ControlPosition[p];t.value.index=r.index,n.value.controls[f].push(t.value)}},a=p=>{if(n.value&&o.value){let f=null;const c=o.value.ControlPosition[p];n.value.controls[c].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&n.value.controls[c].removeAt(f)}};return l.onBeforeUnmount(()=>a(r.position)),l.watch(()=>r.position,(p,f)=>{a(f),u(p)}),l.watch(()=>r.index,p=>{t.value&&(t.value.index=p)}),{controlRef:t}}});const gt={ref:"controlRef",class:"custom-control-wrapper"};function vt(r,e,t,n,o,s){return l.openBlock(),l.createElementBlock("div",gt,[l.renderSlot(r.$slots,"default",{},void 0,!0)],512)}const yt=G(ht,[["render",vt],["__scopeId","data-v-ab9120cd"]]),_e=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],wt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[..._e,"update:modelValue"],setup(r,{slots:e,emit:t,expose:n}){const o=l.ref(),s=l.ref(),i=l.inject(T,l.ref()),u=l.inject(L,l.ref()),a=l.inject(se,l.ref());let p,f=r.modelValue;const c=l.computed(()=>{var d;return(d=e.default)==null?void 0:d.call(e).some(v=>v.type!==l.Comment)}),m=d=>{f=d,t("update:modelValue",d)},g=d=>{o.value&&(o.value.open({map:i.value,anchor:a.value,...d}),m(!0))},h=()=>{o.value&&(o.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>r.options],([d,v],[y,w])=>{var P;const _=!Z(v,w)||i.value!==y;i.value&&u.value&&_&&(o.value?(o.value.setOptions({...v,content:c.value?s.value:v.content}),a.value||g()):(o.value=l.markRaw(new u.value.InfoWindow({...v,content:c.value?s.value:v.content})),a.value&&(p=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),_e.forEach(C=>{var M;(M=o.value)==null||M.addListener(C,k=>t(C,k))}),(P=o.value)==null||P.addListener("closeclick",()=>m(!1))))},{immediate:!0,flush:"post"}),l.watch(()=>r.modelValue,d=>{d!==f&&(d?g():h())})}),l.onBeforeUnmount(()=>{var d;p&&p.remove(),o.value&&((d=u.value)==null||d.event.clearInstanceListeners(o.value),h())}),n({infoWindow:o,open:g,close:h}),{infoWindow:o,infoWindowRef:s,hasSlotContent:c,open:g,close:h}}});const _t={key:0,class:"info-window-wrapper"};function Et(r,e,t,n,o,s){return r.hasSlotContent?(l.openBlock(),l.createElementBlock("div",_t,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},r.$attrs),[l.renderSlot(r.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const kt=G(wt,[["render",Et],["__scopeId","data-v-135889a7"]]);var Ct=Object.getOwnPropertyNames,Mt=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty;function Ee(r,e){return function(n,o,s){return r(n,o,s)&&e(n,o,s)}}function z(r){return function(t,n,o){if(!t||!n||typeof t!="object"||typeof n!="object")return r(t,n,o);var s=o.cache,i=s.get(t),u=s.get(n);if(i&&u)return i===n&&u===t;s.set(t,n),s.set(n,t);var a=r(t,n,o);return s.delete(t),s.delete(n),a}}function ke(r){return Ct(r).concat(Mt(r))}var Pt=Object.hasOwn||function(r,e){return Ot.call(r,e)};function j(r,e){return r===e||!r&&!e&&r!==r&&e!==e}var St="__v",bt="__o",At="_owner",Ce=Object.getOwnPropertyDescriptor,Me=Object.keys;function qt(r,e,t){var n=r.length;if(e.length!==n)return!1;for(;n-- >0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}function Tt(r,e){return j(r.getTime(),e.getTime())}function Lt(r,e){return r.name===e.name&&r.message===e.message&&r.cause===e.cause&&r.stack===e.stack}function xt(r,e){return r===e}function Oe(r,e,t){var n=r.size;if(n!==e.size)return!1;if(!n)return!0;for(var o=new Array(n),s=r.entries(),i,u,a=0;(i=s.next())&&!i.done;){for(var p=e.entries(),f=!1,c=0;(u=p.next())&&!u.done;){if(o[c]){c++;continue}var m=i.value,g=u.value;if(t.equals(m[0],g[0],a,c,r,e,t)&&t.equals(m[1],g[1],m[0],g[0],r,e,t)){f=o[c]=!0;break}c++}if(!f)return!1;a++}return!0}var Rt=j;function jt(r,e,t){var n=Me(r),o=n.length;if(Me(e).length!==o)return!1;for(;o-- >0;)if(!Re(r,e,t,n[o]))return!1;return!0}function $(r,e,t){var n=ke(r),o=n.length;if(ke(e).length!==o)return!1;for(var s,i,u;o-- >0;)if(s=n[o],!Re(r,e,t,s)||(i=Ce(r,s),u=Ce(e,s),(i||u)&&(!i||!u||i.configurable!==u.configurable||i.enumerable!==u.enumerable||i.writable!==u.writable)))return!1;return!0}function It(r,e){return j(r.valueOf(),e.valueOf())}function Bt(r,e){return r.source===e.source&&r.flags===e.flags}function Pe(r,e,t){var n=r.size;if(n!==e.size)return!1;if(!n)return!0;for(var o=new Array(n),s=r.values(),i,u;(i=s.next())&&!i.done;){for(var a=e.values(),p=!1,f=0;(u=a.next())&&!u.done;){if(!o[f]&&t.equals(i.value,u.value,i.value,u.value,r,e,t)){p=o[f]=!0;break}f++}if(!p)return!1}return!0}function Nt(r,e){var t=r.length;if(e.length!==t)return!1;for(;t-- >0;)if(r[t]!==e[t])return!1;return!0}function $t(r,e){return r.hostname===e.hostname&&r.pathname===e.pathname&&r.protocol===e.protocol&&r.port===e.port&&r.hash===e.hash&&r.username===e.username&&r.password===e.password}function Re(r,e,t,n){return(n===At||n===bt||n===St)&&(r.$$typeof||e.$$typeof)?!0:Pt(e,n)&&t.equals(r[n],e[n],n,n,r,e,t)}var Dt="[object Arguments]",Ut="[object Boolean]",Zt="[object Date]",Vt="[object Error]",Gt="[object Map]",Ft="[object Number]",zt="[object Object]",Wt="[object RegExp]",Ht="[object Set]",Kt="[object String]",Yt="[object URL]",Jt=Array.isArray,Se=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,be=Object.assign,Xt=Object.prototype.toString.call.bind(Object.prototype.toString);function Qt(r){var e=r.areArraysEqual,t=r.areDatesEqual,n=r.areErrorsEqual,o=r.areFunctionsEqual,s=r.areMapsEqual,i=r.areNumbersEqual,u=r.areObjectsEqual,a=r.arePrimitiveWrappersEqual,p=r.areRegExpsEqual,f=r.areSetsEqual,c=r.areTypedArraysEqual,m=r.areUrlsEqual;return function(h,d,v){if(h===d)return!0;if(h==null||d==null)return!1;var y=typeof h;if(y!==typeof d)return!1;if(y!=="object")return y==="number"?i(h,d,v):y==="function"?o(h,d,v):!1;var w=h.constructor;if(w!==d.constructor)return!1;if(w===Object)return u(h,d,v);if(Jt(h))return e(h,d,v);if(Se!=null&&Se(h))return c(h,d,v);if(w===Date)return t(h,d,v);if(w===RegExp)return p(h,d,v);if(w===Map)return s(h,d,v);if(w===Set)return f(h,d,v);var _=Xt(h);return _===Zt?t(h,d,v):_===Wt?p(h,d,v):_===Gt?s(h,d,v):_===Ht?f(h,d,v):_===zt?typeof h.then!="function"&&typeof d.then!="function"&&u(h,d,v):_===Yt?m(h,d,v):_===Vt?n(h,d,v):_===Dt?u(h,d,v):_===Ut||_===Ft||_===Kt?a(h,d,v):!1}}function er(r){var e=r.circular,t=r.createCustomConfig,n=r.strict,o={areArraysEqual:n?$:qt,areDatesEqual:Tt,areErrorsEqual:Lt,areFunctionsEqual:xt,areMapsEqual:n?Ee(Oe,$):Oe,areNumbersEqual:Rt,areObjectsEqual:n?$:jt,arePrimitiveWrappersEqual:It,areRegExpsEqual:Bt,areSetsEqual:n?Ee(Pe,$):Pe,areTypedArraysEqual:n?$:Nt,areUrlsEqual:$t};if(t&&(o=be({},o,t(o))),e){var s=z(o.areArraysEqual),i=z(o.areMapsEqual),u=z(o.areObjectsEqual),a=z(o.areSetsEqual);o=be({},o,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:u,areSetsEqual:a})}return o}function tr(r){return function(e,t,n,o,s,i,u){return r(e,t,u)}}function rr(r){var e=r.circular,t=r.comparator,n=r.createState,o=r.equals,s=r.strict;if(n)return function(a,p){var f=n(),c=f.cache,m=c===void 0?e?new WeakMap:void 0:c,g=f.meta;return t(a,p,{cache:m,equals:o,meta:g,strict:s})};if(e)return function(a,p){return t(a,p,{cache:new WeakMap,equals:o,meta:void 0,strict:s})};var i={cache:void 0,equals:o,meta:void 0,strict:s};return function(a,p){return t(a,p,i)}}var K=x();x({strict:!0});x({circular:!0});x({circular:!0,strict:!0});x({createInternalComparator:function(){return j}});x({strict:!0,createInternalComparator:function(){return j}});x({circular:!0,createInternalComparator:function(){return j}});x({circular:!0,createInternalComparator:function(){return j},strict:!0});function x(r){r===void 0&&(r={});var e=r.circular,t=e===void 0?!1:e,n=r.createInternalComparator,o=r.createState,s=r.strict,i=s===void 0?!1:s,u=er(r),a=Qt(u),p=n?n(a):tr(a);return rr({circular:t,comparator:a,createState:o,equals:p,strict:i})}const Ae=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ee=1,D=8;class ue{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,n]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=n>>4;if(o!==ee)throw new Error(`Got v${o} data when expected v${ee}.`);const s=Ae[n&15];if(!s)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new ue(u,i,s,e)}constructor(e,t=64,n=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const s=Ae.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-u%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${n}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,D,e),this.coords=new this.ArrayType(this.data,D+u+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(D+i+u+a),this.ids=new this.IndexArrayType(this.data,D,e),this.coords=new this.ArrayType(this.data,D+u+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ee<<4)+s]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return oe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:u}=this,a=[0,s.length-1,0],p=[];for(;a.length;){const f=a.pop()||0,c=a.pop()||0,m=a.pop()||0;if(c-m<=u){for(let v=m;v<=c;v++){const y=i[2*v],w=i[2*v+1];y>=e&&y<=n&&w>=t&&w<=o&&p.push(s[v])}continue}const g=m+c>>1,h=i[2*g],d=i[2*g+1];h>=e&&h<=n&&d>=t&&d<=o&&p.push(s[g]),(f===0?e<=h:t<=d)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?n>=h:o>=d)&&(a.push(g+1),a.push(c),a.push(1-f))}return p}within(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:i}=this,u=[0,o.length-1,0],a=[],p=n*n;for(;u.length;){const f=u.pop()||0,c=u.pop()||0,m=u.pop()||0;if(c-m<=i){for(let v=m;v<=c;v++)qe(s[2*v],s[2*v+1],e,t)<=p&&a.push(o[v]);continue}const g=m+c>>1,h=s[2*g],d=s[2*g+1];qe(h,d,e,t)<=p&&a.push(o[g]),(f===0?e-n<=h:t-n<=d)&&(u.push(m),u.push(g-1),u.push(1-f)),(f===0?e+n>=h:t+n>=d)&&(u.push(g+1),u.push(c),u.push(1-f))}return a}}function oe(r,e,t,n,o,s){if(o-n<=t)return;const i=n+o>>1;je(r,e,i,n,o,s),oe(r,e,t,n,i-1,1-s),oe(r,e,t,i+1,o,1-s)}function je(r,e,t,n,o,s){for(;o>n;){if(o-n>600){const p=o-n+1,f=t-n+1,c=Math.log(p),m=.5*Math.exp(2*c/3),g=.5*Math.sqrt(c*m*(p-m)/p)*(f-p/2<0?-1:1),h=Math.max(n,Math.floor(t-f*m/p+g)),d=Math.min(o,Math.floor(t+(p-f)*m/p+g));je(r,e,t,h,d,s)}const i=e[2*t+s];let u=n,a=o;for(U(r,e,n,t),e[2*o+s]>i&&U(r,e,n,o);u<a;){for(U(r,e,u,a),u++,a--;e[2*u+s]<i;)u++;for(;e[2*a+s]>i;)a--}e[2*n+s]===i?U(r,e,n,a):(a++,U(r,e,a,o)),a<=t&&(n=a+1),t<=a&&(o=a-1)}}function U(r,e,t,n){te(r,t,n),te(e,2*t,2*n),te(e,2*t+1,2*n+1)}function te(r,e,t){const n=r[e];r[e]=r[t],r[t]=n}function qe(r,e,t,n){const o=r-t,s=e-n;return o*o+s*s}const nr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:r=>r},Te=Math.fround||(r=>e=>(r[0]=+e,r[0]))(new Float32Array(1)),R=2,A=3,re=4,b=5,Ie=6;class Be{constructor(e){this.options=Object.assign(Object.create(nr),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:n,maxZoom:o}=this.options;t&&console.time("total time");const s=`prepare ${e.length} points`;t&&console.time(s),this.points=e;const i=[];for(let a=0;a<e.length;a++){const p=e[a];if(!p.geometry)continue;const[f,c]=p.geometry.coordinates,m=Te(W(f)),g=Te(H(c));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let u=this.trees[o+1]=this._createTree(i);t&&console.timeEnd(s);for(let a=o;a>=n;a--){const p=+Date.now();u=this.trees[a]=this._createTree(this._cluster(u,a)),t&&console.log("z%d: %d clusters in %dms",a,u.numItems,+Date.now()-p)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let s=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,s=180;else if(n>s){const c=this.getClusters([n,o,180,i],t),m=this.getClusters([-180,o,s,i],t);return c.concat(m)}const u=this.trees[this._limitZoom(t)],a=u.range(W(n),H(i),W(s),H(o)),p=u.data,f=[];for(const c of a){const m=this.stride*c;f.push(p[m+b]>1?Le(p,m,this.clusterProps):this.points[p[m+A]])}return f}getChildren(e){const t=this._getOriginId(e),n=this._getOriginZoom(e),o="No cluster with the specified id.",s=this.trees[n];if(!s)throw new Error(o);const i=s.data;if(t*this.stride>=i.length)throw new Error(o);const u=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=i[t*this.stride],p=i[t*this.stride+1],f=s.within(a,p,u),c=[];for(const m of f){const g=m*this.stride;i[g+re]===e&&c.push(i[g+b]>1?Le(i,g,this.clusterProps):this.points[i[g+A]])}if(c.length===0)throw new Error(o);return c}getLeaves(e,t,n){t=t||10,n=n||0;const o=[];return this._appendLeaves(o,e,t,n,0),o}getTile(e,t,n){const o=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:i,radius:u}=this.options,a=u/i,p=(n-a)/s,f=(n+1+a)/s,c={features:[]};return this._addTileFeatures(o.range((t-a)/s,p,(t+1+a)/s,f),o.data,t,n,s,c),t===0&&this._addTileFeatures(o.range(1-a/s,p,1,f),o.data,s,n,s,c),t===s-1&&this._addTileFeatures(o.range(0,p,a/s,f),o.data,-1,n,s,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,o,s){const i=this.getChildren(t);for(const u of i){const a=u.properties;if(a&&a.cluster?s+a.point_count<=o?s+=a.point_count:s=this._appendLeaves(e,a.cluster_id,n,o,s):s<o?s++:e.push(u),e.length===n)break}return s}_createTree(e){const t=new ue(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,o,s,i){for(const u of e){const a=u*this.stride,p=t[a+b]>1;let f,c,m;if(p)f=Ne(t,a,this.clusterProps),c=t[a],m=t[a+1];else{const d=this.points[t[a+A]];f=d.properties;const[v,y]=d.geometry.coordinates;c=W(v),m=H(y)}const g={type:1,geometry:[[Math.round(this.options.extent*(c*s-n)),Math.round(this.options.extent*(m*s-o))]],tags:f};let h;p||this.options.generateId?h=t[a+A]:h=this.points[t[a+A]].id,h!==void 0&&(g.id=h),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:n,extent:o,reduce:s,minPoints:i}=this.options,u=n/(o*Math.pow(2,t)),a=e.data,p=[],f=this.stride;for(let c=0;c<a.length;c+=f){if(a[c+R]<=t)continue;a[c+R]=t;const m=a[c],g=a[c+1],h=e.within(a[c],a[c+1],u),d=a[c+b];let v=d;for(const y of h){const w=y*f;a[w+R]>t&&(v+=a[w+b])}if(v>d&&v>=i){let y=m*d,w=g*d,_,P=-1;const C=((c/f|0)<<5)+(t+1)+this.points.length;for(const M of h){const k=M*f;if(a[k+R]<=t)continue;a[k+R]=t;const S=a[k+b];y+=a[k]*S,w+=a[k+1]*S,a[k+re]=C,s&&(_||(_=this._map(a,c,!0),P=this.clusterProps.length,this.clusterProps.push(_)),s(_,this._map(a,k)))}a[c+re]=C,p.push(y/v,w/v,1/0,C,-1,v),s&&p.push(P)}else{for(let y=0;y<f;y++)p.push(a[c+y]);if(v>1)for(const y of h){const w=y*f;if(!(a[w+R]<=t)){a[w+R]=t;for(let _=0;_<f;_++)p.push(a[w+_])}}}}return p}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+b]>1){const i=this.clusterProps[e[t+Ie]];return n?Object.assign({},i):i}const o=this.points[e[t+A]].properties,s=this.options.map(o);return n&&s===o?Object.assign({},s):s}}function Le(r,e,t){return{type:"Feature",id:r[e+A],properties:Ne(r,e,t),geometry:{type:"Point",coordinates:[or(r[e]),sr(r[e+1])]}}}function Ne(r,e,t){const n=r[e+b],o=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,s=r[e+Ie],i=s===-1?{}:Object.assign({},t[s]);return Object.assign(i,{cluster:!0,cluster_id:r[e+A],point_count:n,point_count_abbreviated:o})}function W(r){return r/360+.5}function H(r){const e=Math.sin(r*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function or(r){return(r-.5)*360}function sr(r){const e=(180-r*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ce(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]]);return t}class E{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class V{constructor({markers:e,position:t}){this.markers=[],e&&(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;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(E.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>E.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(E.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function O(r,e="assertion failed"){if(r==null)throw Error(e)}const ar=(r,e,t,n)=>{const o=r.getBounds();O(o);const s=$e(o,e,n);return t.filter(i=>s.contains(E.getPosition(i)))},$e=(r,e,t)=>{const{northEast:n,southWest:o}=lr(r,e),s=ur({northEast:n,southWest:o},t);return cr(s,e)},ir=(r,e,t)=>{const n=$e(r,e,t),o=n.getNorthEast(),s=n.getSouthWest();return[s.lng(),s.lat(),o.lng(),o.lat()]},lr=(r,e)=>{const t=e.fromLatLngToDivPixel(r.getNorthEast()),n=e.fromLatLngToDivPixel(r.getSouthWest());return O(t),O(n),{northEast:t,southWest:n}},ur=({northEast:r,southWest:e},t)=>(r.x+=t,r.y-=t,e.x-=t,e.y+=t,{northEast:r,southWest:e}),cr=({northEast:r,southWest:e},t)=>{const n=t.fromDivPixelToLatLng(e),o=t.fromDivPixelToLatLng(r);return new google.maps.LatLngBounds(n,o)};class De{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return dr(e)}}class pr extends De{constructor(e){var{viewportPadding:t=60}=e,n=ce(e,["viewportPadding"]);super(n),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:n}){const o=t.getZoom();return O(o),o>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:ar(t,n,e,this.viewportPadding),map:t,mapCanvasProjection:n})}}}const dr=r=>r.map(t=>new V({position:E.getPosition(t),markers:[t]}));class fr extends De{constructor(e){var{maxZoom:t,radius:n=60}=e,o=ce(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new Be(Object.assign({maxZoom:this.maxZoom,radius:n},o))}calculate(e){let t=!1,n=e.map.getZoom();O(n),n=Math.round(n);const o={zoom:n};if(!K(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const s=this.markers.map(i=>{const u=E.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[u.lng(),u.lat()]},properties:{marker:i}}});this.superCluster.load(s)}return t||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(t=!K(this.state,o)),this.state=o,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return O(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,t]},properties:n}){if(n.cluster)return new V({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:t,lng:e}});const o=n.marker;return new V({markers:[o],position:E.getPosition(o)})}}class mr extends pr{constructor(e){var{maxZoom:t,radius:n=60,viewportPadding:o=60}=e,s=ce(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:o}),this.markers=[],this.clusters=[],this.superCluster=new Be(Object.assign({maxZoom:this.maxZoom,radius:n},s)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let n=!K(this.state,t);if(!K(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const o=this.markers.map(s=>{const i=E.getPosition(s);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:s}}});this.superCluster.load(o)}return n&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:n}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,t]},properties:n}){if(n.cluster)return new V({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:t,lng:e}});const o=n.marker;return new V({markers:[o],position:E.getPosition(o)})}getViewportState(e){const t=e.map.getZoom(),n=e.map.getBounds();return O(t),O(n),{zoom:Math.round(t),view:ir(n,e.mapCanvasProjection,this.viewportPadding)}}}class hr{constructor(e,t){this.markers={sum:e.length};const n=t.map(s=>s.count),o=n.reduce((s,i)=>s+i,0);this.clusters={count:t.length,markers:{mean:o/t.length,sum:o,min:Math.min(...n),max:Math.max(...n)}}}}class gr{render({count:e,position:t},n,o){const i=`<svg fill="${e>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-c63ff230]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-d182c1f9]{display:none}.mapdiv .info-window-wrapper[data-v-d182c1f9]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
|
|
2
|
+
"use strict";var Xe=Object.defineProperty;var Ye=(t,e,r)=>e in t?Xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var W=(t,e,r)=>(Ye(t,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),L=Symbol("map"),x=Symbol("api"),ue=Symbol("marker"),ce=Symbol("markerCluster"),Q=Symbol("CustomMarker"),de=Symbol("mapTilesLoaded"),N=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Je(t,e){t.src=e}const Qe=t=>{var e,r,n,o="The Google Maps JavaScript API",s="google",i="importLibrary",u="__ib__",a=document,d=window,p=d[s]||(d[s]={}),c=p.maps||(p.maps={}),m=new Set,h=new URLSearchParams,g=()=>e||(e=new Promise(async(f,v)=>{var y;await(r=a.createElement("script")),h.set("libraries",[...m]+"");for(n in t)h.set(n.replace(/[A-Z]/g,w=>"_"+w[0].toLowerCase()),t[n]);h.set("callback",s+".maps."+u),Je(r,"https://maps.googleapis.com/maps/api/js?"+h),c[u]=f,r.onerror=()=>e=v(Error(o+" could not load.")),r.nonce=((y=a.querySelector("script[nonce]"))==null?void 0:y.nonce)||"",a.head.append(r)}));c[i]?console.warn(o+" only loads once. Ignoring:",t):c[i]=(f,...v)=>m.add(f)&&g().then(()=>c[i](f,...v))},et=t=>`The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(t)}) will be ignored.`,tt=t=>`The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(t)}) will be ignored.`,rt="No options were set before calling importLibrary. Make sure to configure the loader using setOptions().",nt="There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.",fe=process.env.NODE_ENV!=="production"?t=>{console.warn(`[@googlemaps/js-api-loader] ${t}`)}:()=>{},ot=process.env.NODE_ENV!=="production"?t=>{console.info(`[@googlemaps/js-api-loader] ${t}`)}:()=>{};let ae=!1;function st(t){if(ae){fe(et(t));return}it(t),ae=!0}async function at(t){var e,r;if(ae||fe(rt),!((r=(e=window==null?void 0:window.google)==null?void 0:e.maps)!=null&&r.importLibrary))throw new Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(t)}function it(t){var r,n;const e=!!((n=(r=window.google)==null?void 0:r.maps)!=null&&n.importLibrary);e?ot(tt(t)):process.env.NODE_ENV!=="production"&&document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]')&&fe(nt),e||Qe(t)}function lt(t){return class extends t.OverlayView{constructor(n){super();W(this,"element");W(this,"opts");const{element:o,...s}=n;this.element=o,this.opts=s,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof t.LatLng?this.opts.position:new t.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const n=this.element;return n.style.display!=="none"&&n.style.visibility!=="hidden"&&(n.style.opacity===""||Number(n.style.opacity)>.01)}onAdd(){if(!this.element)return;const n=this.getPanes();n&&n.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const n=this.getProjection(),o=n==null?void 0:n.fromLatLngToDivPixel(this.getPosition());if(o){this.element.style.position="absolute";let s,i;switch(this.opts.anchorPoint){case"TOP_CENTER":s="-50%",i="-100%";break;case"BOTTOM_CENTER":s="-50%",i="0";break;case"LEFT_CENTER":s="-100%",i="-50%";break;case"RIGHT_CENTER":s="0",i="-50%";break;case"TOP_LEFT":s="-100%",i="-100%";break;case"TOP_RIGHT":s="0",i="-100%";break;case"BOTTOM_LEFT":s="-100%",i="0";break;case"BOTTOM_RIGHT":s="0",i="0";break;default:s="-50%",i="-50%"}const u=o.x+(this.opts.offsetX||0)+"px",a=o.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${s}) translateX(${u}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(n){const{element:o,...s}=n;this.element=o,this.opts=s,this.draw()}}}let ge=!1;const ve=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],ut=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},colorScheme:{type:String,required:!1},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1}},emits:ve,setup(t,{emit:e}){const r=l.ref(),n=l.ref(!1),o=l.ref(),s=l.ref(),i=l.ref(!1);l.provide(L,o),l.provide(x,s),l.provide(de,i);const u=()=>{const c={...t};Object.keys(c).forEach(f=>{c[f]===void 0&&delete c[f]});const h=f=>{var v;return f?{position:(v=s.value)==null?void 0:v.ControlPosition[f]}:{}},g={scaleControlOptions:t.scaleControlStyle?{style:t.scaleControlStyle}:{},panControlOptions:h(t.panControlPosition),zoomControlOptions:h(t.zoomControlPosition),rotateControlOptions:h(t.rotateControlPosition),streetViewControlOptions:h(t.streetViewControlPosition),fullscreenControlOptions:h(t.fullscreenControlPosition),cameraControlOptions:h(t.cameraControlPosition),disableDefaultUI:t.disableDefaultUi};return{...c,...g}},a=l.watch([s,o],([c,m])=>{const h=c,g=m;h&&g&&(h.event.addListenerOnce(g,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{const{apiKey:c,region:m,version:h,language:g,libraries:f}=t;st({key:c,region:m,v:h,language:g,libraries:f})},p=c=>{const m=c?c.maps:google.maps;s.value=l.markRaw(m),o.value=l.markRaw(new m.Map(r.value,u()));const h=lt(s.value);s.value[Q]=h,ve.forEach(f=>{var v;(v=o.value)==null||v.addListener(f,y=>e(f,y))}),n.value=!0;const g=Object.keys(t).filter(f=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom"].includes(f)).map(f=>l.toRef(t,f));l.watch([()=>t.center,()=>t.zoom,...g],([f,v],[y,w])=>{var _,M,T;const{center:k,zoom:O,...b}=u();(_=o.value)==null||_.setOptions(b),v!==void 0&&v!==w&&((M=o.value)==null||M.setZoom(v));const E=!y||f.lng!==y.lng||f.lat!==y.lat;f&&E&&((T=o.value)==null||T.panTo(f))})};return l.onMounted(()=>{if(t.apiPromise&&t.apiPromise instanceof Promise)t.apiPromise.then(p);else{ge||(d(),ge=!0);const c=t.libraries&&t.libraries.length>0?t.libraries:["maps","marker"];Promise.all(c.map(m=>at(m))).then(()=>p())}}),l.onBeforeUnmount(()=>{var c;i.value=!1,o.value&&((c=s.value)==null||c.event.clearInstanceListeners(o.value))}),{mapRef:r,ready:n,map:o,api:s,mapTilesLoaded:i}}});const F=(t,e)=>{const r=t.__vccOpts||t;for(const[n,o]of e)r[n]=o;return r},ct={ref:"mapRef",class:"mapdiv"};function dt(t,e,r,n,o,s){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",ct,null,512),l.renderSlot(t.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:t.ready,map:t.map,api:t.api,mapTilesLoaded:t.mapTilesLoaded})),void 0,!0)])}const ft=F(ut,[["render",dt],["__scopeId","data-v-c63ff230"]]);function pt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mt=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r};const V=pt(mt),ye=["click","drag","dragend","dragstart","gmp-click"],ht=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ye,setup(t,{emit:e,expose:r,slots:n}){const o=l.ref(),s=l.computed(()=>{var h;return(h=n.content)==null?void 0:h.call(n).some(g=>g.type!==l.Comment)}),i=l.toRef(t,"options"),u=l.toRef(t,"pinOptions"),a=l.ref(),d=l.inject(L,l.ref()),p=l.inject(x,l.ref()),c=l.inject(ce,l.ref()),m=l.computed(()=>!!(c.value&&p.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,u,o],async(h,[g,f,v,y])=>{var _,M,T;const w=!V(i.value,f)||!V(u.value,v),k=o.value!==y,O=w||k||d.value!==g;if(!d.value||!p.value||!O||s.value&&!o.value)return;const{AdvancedMarkerElement:b,PinElement:E}=p.value.marker;if(a.value){const{map:ee,content:z,...te}=i.value;Object.assign(a.value,{content:s.value?o.value:u.value?new E(u.value).element:z,...te}),m.value&&((_=c.value)==null||_.removeMarker(a.value),(M=c.value)==null||M.addMarker(a.value))}else s.value?i.value.content=o.value:u.value&&(i.value.content=new E(u.value).element),a.value=l.markRaw(new b(i.value)),m.value?(T=c.value)==null||T.addMarker(a.value):a.value.map=d.value,ye.forEach(ee=>{var z;(z=a.value)==null||z.addListener(ee,te=>e(ee,te))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var h,g;a.value&&((h=p.value)==null||h.event.clearInstanceListeners(a.value),m.value?(g=c.value)==null||g.removeMarker(a.value):a.value.map=null)}),l.provide(ue,a),r({marker:a}),{hasCustomSlotContent:s,markerRef:o}}});const gt={key:0,class:"advanced-marker-wrapper"};function vt(t,e,r,n,o,s){return l.openBlock(),l.createElementBlock(l.Fragment,null,[t.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",gt,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},t.$attrs),[l.renderSlot(t.$slots,"content")],16)])):l.createCommentVNode("",!0),l.renderSlot(t.$slots,"default")],64)}const yt=F(ht,[["render",vt]]),we=t=>t==="Marker",Ee=t=>t===Q,B=(t,e,r,n)=>{const o=l.ref(),s=l.inject(L,l.ref()),i=l.inject(x,l.ref()),u=l.inject(ce,l.ref()),a=l.computed(()=>!!(u.value&&i.value&&(o.value instanceof i.value.Marker||o.value instanceof i.value[Q])));return l.watch([s,r],(d,[p,c])=>{var h,g,f;const m=!V(r.value,c)||s.value!==p;if(!(!s.value||!i.value||!m))if(o.value)o.value.setOptions(r.value),a.value&&((h=u.value)==null||h.removeMarker(o.value),(g=u.value)==null||g.addMarker(o.value));else{if(we(t))o.value=l.markRaw(new i.value[t](r.value));else if(Ee(t)){const v=r.value;v.element&&(o.value=l.markRaw(new i.value[t](v)))}else o.value=l.markRaw(new i.value[t]({...r.value,map:s.value}));o.value&&(a.value?(f=u.value)==null||f.addMarker(o.value):(we(t)||Ee(t))&&o.value.setMap(s.value)),e.forEach(v=>{var y;(y=o.value)==null||y.addListener(v,w=>n(v,w))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,p;o.value&&((d=i.value)==null||d.event.clearInstanceListeners(o.value),a.value?(p=u.value)==null||p.removeMarker(o.value):o.value.setMap(null))}),o},ke=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],wt=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:ke,setup(t,{emit:e,expose:r,slots:n}){const o=l.toRef(t,"options"),s=B("Marker",ke,o,e);return l.provide(ue,s),r({marker:s}),()=>{var i;return(i=n.default)==null?void 0:i.call(n)}}}),Et=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:N,setup(t,{emit:e}){const r=l.toRef(t,"options");return{polyline:B("Polyline",N,r,e)}},render:()=>null}),kt=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:N,setup(t,{emit:e}){const r=l.toRef(t,"options");return{polygon:B("Polygon",N,r,e)}},render:()=>null}),_e=N.concat(["bounds_changed"]),_t=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:_e,setup(t,{emit:e}){const r=l.toRef(t,"options");return{rectangle:B("Rectangle",_e,r,e)}},render:()=>null}),Ce=N.concat(["center_changed","radius_changed"]),Ct=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:Ce,setup(t,{emit:e}){const r=l.toRef(t,"options");return{circle:B("Circle",Ce,r,e)}},render:()=>null}),bt=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(t,{emit:e}){const r=l.ref(null),n=l.inject(L,l.ref()),o=l.inject(x,l.ref()),s=l.inject(de,l.ref(!1)),i=l.watch([s,o,r],([d,p,c])=>{p&&d&&c&&(u(t.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),u=d=>{if(n.value&&o.value&&r.value){const p=o.value.ControlPosition[d];r.value.index=t.index,n.value.controls[p].push(r.value)}},a=d=>{if(n.value&&o.value){let p=null;const c=o.value.ControlPosition[d];n.value.controls[c].forEach((m,h)=>{m===r.value&&(p=h)}),p!==null&&n.value.controls[c].removeAt(p)}};return l.onBeforeUnmount(()=>a(t.position)),l.watch(()=>t.position,(d,p)=>{a(p),u(d)}),l.watch(()=>t.index,d=>{r.value&&(r.value.index=d)}),{controlRef:r}}});const Mt={ref:"controlRef",class:"custom-control-wrapper"};function Ot(t,e,r,n,o,s){return l.openBlock(),l.createElementBlock("div",Mt,[l.renderSlot(t.$slots,"default",{},void 0,!0)],512)}const St=F(bt,[["render",Ot],["__scopeId","data-v-ab9120cd"]]),be=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],Tt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...be,"update:modelValue"],setup(t,{slots:e,emit:r,expose:n}){const o=l.ref(),s=l.ref(),i=l.inject(L,l.ref()),u=l.inject(x,l.ref()),a=l.inject(ue,l.ref());let d,p=t.modelValue;const c=l.computed(()=>{var f;return(f=e.default)==null?void 0:f.call(e).some(v=>v.type!==l.Comment)}),m=f=>{p=f,r("update:modelValue",f)},h=f=>{o.value&&(o.value.open({map:i.value,anchor:a.value,...f}),m(!0))},g=()=>{o.value&&(o.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>t.options],([f,v],[y,w])=>{var O;const k=!V(v,w)||i.value!==y;i.value&&u.value&&k&&(o.value?(o.value.setOptions({...v,content:c.value?s.value:v.content}),a.value||h()):(o.value=l.markRaw(new u.value.InfoWindow({...v,content:c.value?s.value:v.content})),a.value&&(d=a.value.addListener("click",()=>h())),(!a.value||p)&&h(),be.forEach(b=>{var E;(E=o.value)==null||E.addListener(b,_=>r(b,_))}),(O=o.value)==null||O.addListener("closeclick",()=>m(!1))))},{immediate:!0,flush:"post"}),l.watch(a,(f,v)=>{!o.value||f===v||(d&&(d.remove(),d=void 0),f&&(d=f.addListener("click",()=>h())))},{flush:"post"}),l.watch(()=>t.modelValue,f=>{f!==p&&(f?h():g())})}),l.onBeforeUnmount(()=>{var f;d&&d.remove(),o.value&&((f=u.value)==null||f.event.clearInstanceListeners(o.value),g())}),n({infoWindow:o,open:h,close:g}),{infoWindow:o,infoWindowRef:s,hasSlotContent:c,open:h,close:g}}});const Pt={key:0,class:"info-window-wrapper"};function At(t,e,r,n,o,s){return t.hasSlotContent?(l.openBlock(),l.createElementBlock("div",Pt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},t.$attrs),[l.renderSlot(t.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const qt=F(Tt,[["render",At],["__scopeId","data-v-d182c1f9"]]);var Lt=Object.getOwnPropertyNames,xt=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty;function Me(t,e){return function(n,o,s){return t(n,o,s)&&e(n,o,s)}}function H(t){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,o);var s=o.cache,i=s.get(r),u=s.get(n);if(i&&u)return i===n&&u===r;s.set(r,n),s.set(n,r);var a=t(r,n,o);return s.delete(r),s.delete(n),a}}function Oe(t){return Lt(t).concat(xt(t))}var Rt=Object.hasOwn||function(t,e){return jt.call(t,e)};function I(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var It="__v",Nt="__o",Bt="_owner",Se=Object.getOwnPropertyDescriptor,Te=Object.keys;function $t(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function Dt(t,e){return I(t.getTime(),e.getTime())}function Ut(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Zt(t,e){return t===e}function Pe(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var o=new Array(n),s=t.entries(),i,u,a=0;(i=s.next())&&!i.done;){for(var d=e.entries(),p=!1,c=0;(u=d.next())&&!u.done;){if(o[c]){c++;continue}var m=i.value,h=u.value;if(r.equals(m[0],h[0],a,c,t,e,r)&&r.equals(m[1],h[1],m[0],h[0],t,e,r)){p=o[c]=!0;break}c++}if(!p)return!1;a++}return!0}var Vt=I;function Gt(t,e,r){var n=Te(t),o=n.length;if(Te(e).length!==o)return!1;for(;o-- >0;)if(!Ue(t,e,r,n[o]))return!1;return!0}function $(t,e,r){var n=Oe(t),o=n.length;if(Oe(e).length!==o)return!1;for(var s,i,u;o-- >0;)if(s=n[o],!Ue(t,e,r,s)||(i=Se(t,s),u=Se(e,s),(i||u)&&(!i||!u||i.configurable!==u.configurable||i.enumerable!==u.enumerable||i.writable!==u.writable)))return!1;return!0}function Ft(t,e){return I(t.valueOf(),e.valueOf())}function zt(t,e){return t.source===e.source&&t.flags===e.flags}function Ae(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var o=new Array(n),s=t.values(),i,u;(i=s.next())&&!i.done;){for(var a=e.values(),d=!1,p=0;(u=a.next())&&!u.done;){if(!o[p]&&r.equals(i.value,u.value,i.value,u.value,t,e,r)){d=o[p]=!0;break}p++}if(!d)return!1}return!0}function Wt(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function Ht(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function Ue(t,e,r,n){return(n===Bt||n===Nt||n===It)&&(t.$$typeof||e.$$typeof)?!0:Rt(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var Kt="[object Arguments]",Xt="[object Boolean]",Yt="[object Date]",Jt="[object Error]",Qt="[object Map]",er="[object Number]",tr="[object Object]",rr="[object RegExp]",nr="[object Set]",or="[object String]",sr="[object URL]",ar=Array.isArray,qe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Le=Object.assign,ir=Object.prototype.toString.call.bind(Object.prototype.toString);function lr(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areErrorsEqual,o=t.areFunctionsEqual,s=t.areMapsEqual,i=t.areNumbersEqual,u=t.areObjectsEqual,a=t.arePrimitiveWrappersEqual,d=t.areRegExpsEqual,p=t.areSetsEqual,c=t.areTypedArraysEqual,m=t.areUrlsEqual;return function(g,f,v){if(g===f)return!0;if(g==null||f==null)return!1;var y=typeof g;if(y!==typeof f)return!1;if(y!=="object")return y==="number"?i(g,f,v):y==="function"?o(g,f,v):!1;var w=g.constructor;if(w!==f.constructor)return!1;if(w===Object)return u(g,f,v);if(ar(g))return e(g,f,v);if(qe!=null&&qe(g))return c(g,f,v);if(w===Date)return r(g,f,v);if(w===RegExp)return d(g,f,v);if(w===Map)return s(g,f,v);if(w===Set)return p(g,f,v);var k=ir(g);return k===Yt?r(g,f,v):k===rr?d(g,f,v):k===Qt?s(g,f,v):k===nr?p(g,f,v):k===tr?typeof g.then!="function"&&typeof f.then!="function"&&u(g,f,v):k===sr?m(g,f,v):k===Jt?n(g,f,v):k===Kt?u(g,f,v):k===Xt||k===er||k===or?a(g,f,v):!1}}function ur(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,o={areArraysEqual:n?$:$t,areDatesEqual:Dt,areErrorsEqual:Ut,areFunctionsEqual:Zt,areMapsEqual:n?Me(Pe,$):Pe,areNumbersEqual:Vt,areObjectsEqual:n?$:Gt,arePrimitiveWrappersEqual:Ft,areRegExpsEqual:zt,areSetsEqual:n?Me(Ae,$):Ae,areTypedArraysEqual:n?$:Wt,areUrlsEqual:Ht};if(r&&(o=Le({},o,r(o))),e){var s=H(o.areArraysEqual),i=H(o.areMapsEqual),u=H(o.areObjectsEqual),a=H(o.areSetsEqual);o=Le({},o,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:u,areSetsEqual:a})}return o}function cr(t){return function(e,r,n,o,s,i,u){return t(e,r,u)}}function dr(t){var e=t.circular,r=t.comparator,n=t.createState,o=t.equals,s=t.strict;if(n)return function(a,d){var p=n(),c=p.cache,m=c===void 0?e?new WeakMap:void 0:c,h=p.meta;return r(a,d,{cache:m,equals:o,meta:h,strict:s})};if(e)return function(a,d){return r(a,d,{cache:new WeakMap,equals:o,meta:void 0,strict:s})};var i={cache:void 0,equals:o,meta:void 0,strict:s};return function(a,d){return r(a,d,i)}}var Y=j();j({strict:!0});j({circular:!0});j({circular:!0,strict:!0});j({createInternalComparator:function(){return I}});j({strict:!0,createInternalComparator:function(){return I}});j({circular:!0,createInternalComparator:function(){return I}});j({circular:!0,createInternalComparator:function(){return I},strict:!0});function j(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,o=t.createState,s=t.strict,i=s===void 0?!1:s,u=ur(t),a=lr(u),d=n?n(a):cr(a);return dr({circular:r,comparator:a,createState:o,equals:d,strict:i})}const xe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],re=1,D=8;class pe{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=n>>4;if(o!==re)throw new Error(`Got v${o} data when expected v${re}.`);const s=xe[n&15];if(!s)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new pe(u,i,s,e)}constructor(e,r=64,n=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const s=xe.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-u%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${n}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,D,e),this.coords=new this.ArrayType(this.data,D+u+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(D+i+u+a),this.ids=new this.IndexArrayType(this.data,D,e),this.coords=new this.ArrayType(this.data,D+u+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(re<<4)+s]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=r,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return ie(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,n,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:u}=this,a=[0,s.length-1,0],d=[];for(;a.length;){const p=a.pop()||0,c=a.pop()||0,m=a.pop()||0;if(c-m<=u){for(let v=m;v<=c;v++){const y=i[2*v],w=i[2*v+1];y>=e&&y<=n&&w>=r&&w<=o&&d.push(s[v])}continue}const h=m+c>>1,g=i[2*h],f=i[2*h+1];g>=e&&g<=n&&f>=r&&f<=o&&d.push(s[h]),(p===0?e<=g:r<=f)&&(a.push(m),a.push(h-1),a.push(1-p)),(p===0?n>=g:o>=f)&&(a.push(h+1),a.push(c),a.push(1-p))}return d}within(e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:i}=this,u=[0,o.length-1,0],a=[],d=n*n;for(;u.length;){const p=u.pop()||0,c=u.pop()||0,m=u.pop()||0;if(c-m<=i){for(let v=m;v<=c;v++)je(s[2*v],s[2*v+1],e,r)<=d&&a.push(o[v]);continue}const h=m+c>>1,g=s[2*h],f=s[2*h+1];je(g,f,e,r)<=d&&a.push(o[h]),(p===0?e-n<=g:r-n<=f)&&(u.push(m),u.push(h-1),u.push(1-p)),(p===0?e+n>=g:r+n>=f)&&(u.push(h+1),u.push(c),u.push(1-p))}return a}}function ie(t,e,r,n,o,s){if(o-n<=r)return;const i=n+o>>1;Ze(t,e,i,n,o,s),ie(t,e,r,n,i-1,1-s),ie(t,e,r,i+1,o,1-s)}function Ze(t,e,r,n,o,s){for(;o>n;){if(o-n>600){const d=o-n+1,p=r-n+1,c=Math.log(d),m=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*m*(d-m)/d)*(p-d/2<0?-1:1),g=Math.max(n,Math.floor(r-p*m/d+h)),f=Math.min(o,Math.floor(r+(d-p)*m/d+h));Ze(t,e,r,g,f,s)}const i=e[2*r+s];let u=n,a=o;for(U(t,e,n,r),e[2*o+s]>i&&U(t,e,n,o);u<a;){for(U(t,e,u,a),u++,a--;e[2*u+s]<i;)u++;for(;e[2*a+s]>i;)a--}e[2*n+s]===i?U(t,e,n,a):(a++,U(t,e,a,o)),a<=r&&(n=a+1),r<=a&&(o=a-1)}}function U(t,e,r,n){ne(t,r,n),ne(e,2*r,2*n),ne(e,2*r+1,2*n+1)}function ne(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function je(t,e,r,n){const o=t-r,s=e-n;return o*o+s*s}const fr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Re=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),R=2,A=3,oe=4,P=5,Ve=6;class Ge{constructor(e){this.options=Object.assign(Object.create(fr),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:r,minZoom:n,maxZoom:o}=this.options;r&&console.time("total time");const s=`prepare ${e.length} points`;r&&console.time(s),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[p,c]=d.geometry.coordinates,m=Re(K(p)),h=Re(X(c));i.push(m,h,1/0,a,-1,1),this.options.reduce&&i.push(0)}let u=this.trees[o+1]=this._createTree(i);r&&console.timeEnd(s);for(let a=o;a>=n;a--){const d=+Date.now();u=this.trees[a]=this._createTree(this._cluster(u,a)),r&&console.log("z%d: %d clusters in %dms",a,u.numItems,+Date.now()-d)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let n=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let s=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,s=180;else if(n>s){const c=this.getClusters([n,o,180,i],r),m=this.getClusters([-180,o,s,i],r);return c.concat(m)}const u=this.trees[this._limitZoom(r)],a=u.range(K(n),X(i),K(s),X(o)),d=u.data,p=[];for(const c of a){const m=this.stride*c;p.push(d[m+P]>1?Ie(d,m,this.clusterProps):this.points[d[m+A]])}return p}getChildren(e){const r=this._getOriginId(e),n=this._getOriginZoom(e),o="No cluster with the specified id.",s=this.trees[n];if(!s)throw new Error(o);const i=s.data;if(r*this.stride>=i.length)throw new Error(o);const u=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=i[r*this.stride],d=i[r*this.stride+1],p=s.within(a,d,u),c=[];for(const m of p){const h=m*this.stride;i[h+oe]===e&&c.push(i[h+P]>1?Ie(i,h,this.clusterProps):this.points[i[h+A]])}if(c.length===0)throw new Error(o);return c}getLeaves(e,r,n){r=r||10,n=n||0;const o=[];return this._appendLeaves(o,e,r,n,0),o}getTile(e,r,n){const o=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:i,radius:u}=this.options,a=u/i,d=(n-a)/s,p=(n+1+a)/s,c={features:[]};return this._addTileFeatures(o.range((r-a)/s,d,(r+1+a)/s,p),o.data,r,n,s,c),r===0&&this._addTileFeatures(o.range(1-a/s,d,1,p),o.data,s,n,s,c),r===s-1&&this._addTileFeatures(o.range(0,d,a/s,p),o.data,-1,n,s,c),c.features.length?c:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){const n=this.getChildren(e);if(r++,n.length!==1)break;e=n[0].properties.cluster_id}return r}_appendLeaves(e,r,n,o,s){const i=this.getChildren(r);for(const u of i){const a=u.properties;if(a&&a.cluster?s+a.point_count<=o?s+=a.point_count:s=this._appendLeaves(e,a.cluster_id,n,o,s):s<o?s++:e.push(u),e.length===n)break}return s}_createTree(e){const r=new pe(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)r.add(e[n],e[n+1]);return r.finish(),r.data=e,r}_addTileFeatures(e,r,n,o,s,i){for(const u of e){const a=u*this.stride,d=r[a+P]>1;let p,c,m;if(d)p=Fe(r,a,this.clusterProps),c=r[a],m=r[a+1];else{const f=this.points[r[a+A]];p=f.properties;const[v,y]=f.geometry.coordinates;c=K(v),m=X(y)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*s-n)),Math.round(this.options.extent*(m*s-o))]],tags:p};let g;d||this.options.generateId?g=r[a+A]:g=this.points[r[a+A]].id,g!==void 0&&(h.id=g),i.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){const{radius:n,extent:o,reduce:s,minPoints:i}=this.options,u=n/(o*Math.pow(2,r)),a=e.data,d=[],p=this.stride;for(let c=0;c<a.length;c+=p){if(a[c+R]<=r)continue;a[c+R]=r;const m=a[c],h=a[c+1],g=e.within(a[c],a[c+1],u),f=a[c+P];let v=f;for(const y of g){const w=y*p;a[w+R]>r&&(v+=a[w+P])}if(v>f&&v>=i){let y=m*f,w=h*f,k,O=-1;const b=((c/p|0)<<5)+(r+1)+this.points.length;for(const E of g){const _=E*p;if(a[_+R]<=r)continue;a[_+R]=r;const M=a[_+P];y+=a[_]*M,w+=a[_+1]*M,a[_+oe]=b,s&&(k||(k=this._map(a,c,!0),O=this.clusterProps.length,this.clusterProps.push(k)),s(k,this._map(a,_)))}a[c+oe]=b,d.push(y/v,w/v,1/0,b,-1,v),s&&d.push(O)}else{for(let y=0;y<p;y++)d.push(a[c+y]);if(v>1)for(const y of g){const w=y*p;if(!(a[w+R]<=r)){a[w+R]=r;for(let k=0;k<p;k++)d.push(a[w+k])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,n){if(e[r+P]>1){const i=this.clusterProps[e[r+Ve]];return n?Object.assign({},i):i}const o=this.points[e[r+A]].properties,s=this.options.map(o);return n&&s===o?Object.assign({},s):s}}function Ie(t,e,r){return{type:"Feature",id:t[e+A],properties:Fe(t,e,r),geometry:{type:"Point",coordinates:[pr(t[e]),mr(t[e+1])]}}}function Fe(t,e,r){const n=t[e+P],o=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,s=t[e+Ve],i=s===-1?{}:Object.assign({},r[s]);return Object.assign(i,{cluster:!0,cluster_id:t[e+A],point_count:n,point_count_abbreviated:o})}function K(t){return t/360+.5}function X(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function pr(t){return(t-.5)*360}function mr(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function me(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r}class C{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,r){this.isAdvancedMarker(e)?e.map=r:e.setMap(r)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class G{constructor({markers:e,position:r}){this.markers=[],e&&(this.markers=e),r&&(r instanceof google.maps.LatLng?this._position=r:this._position=new google.maps.LatLng(r))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const r of this.markers)e.extend(C.getPosition(r));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>C.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(C.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function S(t,e="assertion failed"){if(t==null)throw Error(e)}const hr=(t,e,r,n)=>{const o=t.getBounds();S(o);const s=ze(o,e,n);return r.filter(i=>s.contains(C.getPosition(i)))},ze=(t,e,r)=>{const{northEast:n,southWest:o}=vr(t,e),s=yr({northEast:n,southWest:o},r);return wr(s,e)},gr=(t,e,r)=>{const n=ze(t,e,r),o=n.getNorthEast(),s=n.getSouthWest();return[s.lng(),s.lat(),o.lng(),o.lat()]},vr=(t,e)=>{const r=e.fromLatLngToDivPixel(t.getNorthEast()),n=e.fromLatLngToDivPixel(t.getSouthWest());return S(r),S(n),{northEast:r,southWest:n}},yr=({northEast:t,southWest:e},r)=>(t.x+=r,t.y-=r,e.x-=r,e.y+=r,{northEast:t,southWest:e}),wr=({northEast:t,southWest:e},r)=>{const n=r.fromDivPixelToLatLng(e),o=r.fromDivPixelToLatLng(t);return new google.maps.LatLngBounds(n,o)};class We{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return kr(e)}}class Er extends We{constructor(e){var{viewportPadding:r=60}=e,n=me(e,["viewportPadding"]);super(n),this.viewportPadding=60,this.viewportPadding=r}calculate({markers:e,map:r,mapCanvasProjection:n}){const o=r.getZoom();return S(o),o>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:hr(r,n,e,this.viewportPadding),map:r,mapCanvasProjection:n})}}}const kr=t=>t.map(r=>new G({position:C.getPosition(r),markers:[r]}));class _r extends We{constructor(e){var{maxZoom:r,radius:n=60}=e,o=me(e,["maxZoom","radius"]);super({maxZoom:r}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new Ge(Object.assign({maxZoom:this.maxZoom,radius:n},o))}calculate(e){let r=!1,n=e.map.getZoom();S(n),n=Math.round(n);const o={zoom:n};if(!Y(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(i=>{const u=C.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[u.lng(),u.lat()]},properties:{marker:i}}});this.superCluster.load(s)}return r||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(r=!Y(this.state,o)),this.state=o,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:r}):(r&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:r})}cluster({map:e}){const r=e.getZoom();return S(r),this.superCluster.getClusters([-180,-90,180,90],Math.round(r)).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,r]},properties:n}){if(n.cluster)return new G({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:r,lng:e}});const o=n.marker;return new G({markers:[o],position:C.getPosition(o)})}}class Cr extends Er{constructor(e){var{maxZoom:r,radius:n=60,viewportPadding:o=60}=e,s=me(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:r,viewportPadding:o}),this.markers=[],this.clusters=[],this.superCluster=new Ge(Object.assign({maxZoom:this.maxZoom,radius:n},s)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const r=this.getViewportState(e);let n=!Y(this.state,r);if(!Y(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const o=this.markers.map(s=>{const i=C.getPosition(s);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:s}}});this.superCluster.load(o)}return n&&(this.clusters=this.cluster(e),this.state=r),{clusters:this.clusters,changed:n}}cluster(e){const r=this.getViewportState(e);return this.superCluster.getClusters(r.view,r.zoom).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,r]},properties:n}){if(n.cluster)return new G({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:r,lng:e}});const o=n.marker;return new G({markers:[o],position:C.getPosition(o)})}getViewportState(e){const r=e.map.getZoom(),n=e.map.getBounds();return S(r),S(n),{zoom:Math.round(r),view:gr(n,e.mapCanvasProjection,this.viewportPadding)}}}class br{constructor(e,r){this.markers={sum:e.length};const n=r.map(s=>s.count),o=n.reduce((s,i)=>s+i,0);this.clusters={count:r.length,markers:{mean:o/r.length,sum:o,min:Math.min(...n),max:Math.max(...n)}}}}class Mr{render({count:e,position:r},n,o){const i=`<svg fill="${e>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
3
3
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
4
4
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
5
5
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
6
6
|
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
7
|
-
</svg>`,u=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(
|
|
7
|
+
</svg>`,u=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(C.isAdvancedMarkerAvailable(o)){const c=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;c.setAttribute("transform","translate(0 25)");const m={map:o,position:r,zIndex:a,title:u,content:c};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:r,zIndex:a,title:u,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function Or(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}class he{constructor(){Or(he,google.maps.OverlayView)}}var q;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"})(q||(q={}));const Sr=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)};class Tr extends he{constructor({map:e,markers:r=[],algorithmOptions:n={},algorithm:o=new _r(n),renderer:s=new Mr,onClusterClick:i=Sr}){super(),this.map=null,this.idleListener=null,this.markers=[...r],this.clusters=[],this.algorithm=o,this.renderer=s,this.onClusterClick=i,e&&this.setMap(e)}addMarker(e,r){this.markers.includes(e)||(this.markers.push(e),r||this.render())}addMarkers(e,r){e.forEach(n=>{this.addMarker(n,!0)}),r||this.render()}removeMarker(e,r){const n=this.markers.indexOf(e);return n===-1?!1:(C.setMap(e,null),this.markers.splice(n,1),r||this.render(),!0)}removeMarkers(e,r){let n=!1;return e.forEach(o=>{n=this.removeMarker(o,!0)||n}),n&&!r&&this.render(),n}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,q.CLUSTERING_BEGIN,this);const{clusters:r,changed:n}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(n||n==null){const o=new Set;for(const i of r)i.markers.length==1&&o.add(i.markers[0]);const s=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?o.has(i.marker)||C.setMap(i.marker,null):s.push(i.marker));this.clusters=r,this.renderClusters(),requestAnimationFrame(()=>s.forEach(i=>C.setMap(i,null)))}google.maps.event.trigger(this,q.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();S(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>C.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new br(this.markers,this.clusters),r=this.getMap();this.clusters.forEach(n=>{if(n.markers.length===1)n.marker=n.markers[0];else if(n.marker=this.renderer.render(n,e,r),n.markers.forEach(o=>C.setMap(o,null)),this.onClusterClick){const o=C.isAdvancedMarker(n.marker)?q.GMP_CLICK:q.CLUSTER_CLICK;n.marker.addListener(o,s=>{google.maps.event.trigger(this,q.CLUSTER_CLICK,n),this.onClusterClick(s,n,r)})}C.setMap(n.marker,r)})}}function le(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Pr=typeof global=="object"&&global&&global.Object===Object&&global;const Ar=Pr;var qr=typeof self=="object"&&self&&self.Object===Object&&self,Lr=Ar||qr||Function("return this")();const He=Lr;var xr=function(){return He.Date.now()};const se=xr;var jr=/\s/;function Rr(t){for(var e=t.length;e--&&jr.test(t.charAt(e)););return e}var Ir=/^\s+/;function Nr(t){return t&&t.slice(0,Rr(t)+1).replace(Ir,"")}var Br=He.Symbol;const J=Br;var Ke=Object.prototype,$r=Ke.hasOwnProperty,Dr=Ke.toString,Z=J?J.toStringTag:void 0;function Ur(t){var e=$r.call(t,Z),r=t[Z];try{t[Z]=void 0;var n=!0}catch{}var o=Dr.call(t);return n&&(e?t[Z]=r:delete t[Z]),o}var Zr=Object.prototype,Vr=Zr.toString;function Gr(t){return Vr.call(t)}var Fr="[object Null]",zr="[object Undefined]",Ne=J?J.toStringTag:void 0;function Wr(t){return t==null?t===void 0?zr:Fr:Ne&&Ne in Object(t)?Ur(t):Gr(t)}function Hr(t){return t!=null&&typeof t=="object"}var Kr="[object Symbol]";function Xr(t){return typeof t=="symbol"||Hr(t)&&Wr(t)==Kr}var Be=0/0,Yr=/^[-+]0x[0-9a-f]+$/i,Jr=/^0b[01]+$/i,Qr=/^0o[0-7]+$/i,en=parseInt;function $e(t){if(typeof t=="number")return t;if(Xr(t))return Be;if(le(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=le(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Nr(t);var r=Jr.test(t);return r||Qr.test(t)?en(t.slice(2),r?2:8):Yr.test(t)?Be:+t}var tn="Expected a function",rn=Math.max,nn=Math.min;function on(t,e,r){var n,o,s,i,u,a,d=0,p=!1,c=!1,m=!0;if(typeof t!="function")throw new TypeError(tn);e=$e(e)||0,le(r)&&(p=!!r.leading,c="maxWait"in r,s=c?rn($e(r.maxWait)||0,e):s,m="trailing"in r?!!r.trailing:m);function h(E){var _=n,M=o;return n=o=void 0,d=E,i=t.apply(M,_),i}function g(E){return d=E,u=setTimeout(y,e),p?h(E):i}function f(E){var _=E-a,M=E-d,T=e-_;return c?nn(T,s-M):T}function v(E){var _=E-a,M=E-d;return a===void 0||_>=e||_<0||c&&M>=s}function y(){var E=se();if(v(E))return w(E);u=setTimeout(y,f(E))}function w(E){return u=void 0,m&&n?h(E):(n=o=void 0,i)}function k(){u!==void 0&&clearTimeout(u),d=0,n=a=o=u=void 0}function O(){return u===void 0?i:w(se())}function b(){var E=se(),_=v(E);if(n=arguments,o=this,a=E,_){if(u===void 0)return g(a);if(c)return clearTimeout(u),u=setTimeout(y,e),h(a)}return u===void 0&&(u=setTimeout(y,e)),i}return b.cancel=k,b.flush=O,b}class sn extends Tr{constructor(r,n=10){super(r);W(this,"debouncedRender");this.debouncedRender=on(()=>{super.render()},n,{leading:!0,trailing:!0})}addMarker(r,n){super.addMarker(r,!0),n||this.debouncedRender()}removeMarker(r,n){const o=super.removeMarker(r,!0);return n||this.debouncedRender(),o}addMarkers(r,n){super.addMarkers(r,!0),n||this.debouncedRender()}removeMarkers(r,n){const o=super.removeMarkers(r,!0);return n||this.debouncedRender(),o}clearMarkers(r){super.clearMarkers(!0),r||this.debouncedRender()}render(){this.debouncedRender.cancel(),super.render()}destroy(){this.debouncedRender.cancel()}}const De=Object.values(q),an=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})},renderDebounceDelay:{type:Number,default:10}},emits:De,setup(t,{emit:e,expose:r,slots:n}){const o=l.ref(),s=l.inject(L,l.ref()),i=l.inject(x,l.ref());return l.provide(ce,o),l.watch(s,()=>{s.value&&(o.value=l.markRaw(new sn({map:s.value,algorithm:new Cr(t.options.algorithmOptions??{}),...t.options},t.renderDebounceDelay)),De.forEach(u=>{var a;(a=o.value)==null||a.addListener(u,d=>e(u,d))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var u;o.value&&((u=i.value)==null||u.event.clearInstanceListeners(o.value),o.value.clearMarkers(!0),o.value.setMap(null),o.value.destroy())}),r({markerCluster:o}),()=>{var u;return(u=n.default)==null?void 0:u.call(n)}}}),ln=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(t,{slots:e,emit:r,expose:n}){const o=l.ref(),s=l.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(d=>d.type!==l.Comment)}),i=l.computed(()=>({...t.options,element:o.value})),u=B(Q,[],i,r);return n({customMarker:u}),{customMarkerRef:o,customMarker:u,hasSlotContent:s}}});const un={key:0,class:"custom-marker-wrapper"};function cn(t,e,r,n,o,s){return t.hasSlotContent?(l.openBlock(),l.createElementBlock("div",un,[l.createElementVNode("div",l.mergeProps({ref:"customMarkerRef",style:{cursor:t.$attrs.onClick?"pointer":void 0}},t.$attrs),[l.renderSlot(t.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("",!0)}const dn=F(ln,[["render",cn],["__scopeId","data-v-2d2d343a"]]),fn=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(t){const e=l.ref(),r=l.inject(L,l.ref()),n=l.inject(x,l.ref());return l.watch([r,()=>t.options],([o,s],[i,u])=>{const a=!V(s,u)||r.value!==i;if(r.value&&n.value&&a){let d;if(s.data&&!(s.data instanceof n.value.MVCArray)){const p=n.value.LatLng,c=s.data.map(m=>m instanceof p||"location"in m&&(m.location instanceof p||m.location===null)?m:"location"in m?{...m,location:new p(m.location)}:new p(m));d={...s,data:c}}else d=s;e.value?e.value.setOptions(d):e.value=l.markRaw(new n.value.visualization.HeatmapLayer({...d,map:r.value}))}},{immediate:!0}),l.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});exports.AdvancedMarker=yt;exports.Circle=Ct;exports.CustomControl=St;exports.CustomMarker=dn;exports.GoogleMap=ft;exports.HeatmapLayer=fn;exports.InfoWindow=qt;exports.Marker=wt;exports.MarkerCluster=an;exports.Polygon=kt;exports.Polyline=Et;exports.Rectangle=_t;exports.apiSymbol=x;exports.mapSymbol=L;exports.mapTilesLoadedSymbol=de;
|