PageSourceSearch

https://www.opencms.org/export/system/modules/alkacon.mercury.them…?ver=435efd8212a89e1dae47

js opencms.org collected 2026-10-02 04:20:50 UTC 33,233 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkmercury_template=self.webpackChunkmercury_template||[]).push([[461],{9:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{init:function(){return init},initGoogleMaps:function(){return initGoogleMaps},showGeoJson:function(){return showGeoJson},showMarkers:function(){return showMarkers}});var tinycolor2__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(140),_googlemaps_markerclusterer__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(499),jQ,DEBUG,m_maps={},m_mapData=[],m_mapDataMap={},m_mapStyle=[],m_svgIcons=[],m_apiKey,m_googleGeocoder=null,m_googleApiLoaded=!1;function prepareExternalSVGs(e=[],t=[]){try{e.filter(e=>e&&e.name&&!t.some(t=>t.name===e.name)).forEach(e=>{let r=e.icon||"",o=r.match(/viewBox="([^"]+)"/),n=o?o[1]:"0 0 24 24";const s=r.replace(/<svg[^>]*>/,"").replace("</svg>","").replace(/stroke="[^"]*"/g,"").replace(/fill="[^"]*"/g,"").replace(/<([a-z]+)([^>]*)>/g,'<$1 fill="currentColor"$2>');t.push({name:e.name,group:e.group,box:e.box,svg:s,viewBox:n})})}catch(e){console.error("Error preparing external SVGs:",e)}}function getPuempel(e,t=null){e=String(e);var r=String((0,tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A)(e).darken(20));if(null!=t){const o=m_svgIcons.find(e=>e.name===t);let n=null;if(o&&o.box){const t=!1;n='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="34" viewBox="0 0 28 34" style="color:'+tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A.mostReadable(e,["#ffffff","#000000"]).toHexString()+';"><rect x="1" y="1" width="26" height="26" rx="5" ry="5" fill="'+e+(t?'" stroke="'+r+'" stroke-width="1"/>':'"/>')+'<polygon points="10,27 14,34 18,27" fill="'+e+(t?'" stroke="'+r+'" stroke-width="1"/>':'"/>')+(t?'<line x1="10.5" y1="26.8" x2="17.5" y2="26.8"" stroke="'+e+'" stroke-width="1.4"/>':"")+'<svg x="3" y="3" width="22" height="22" viewBox="'+o.viewBox+'" preserveAspectRatio="xMidYMid meet">'+o.svg+"</svg></svg>"}else o&&(n='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="'+o.viewBox+'" preserveAspectRatio="xMidYMid meet" style="color:'+e+';">'+o.svg+"</svg>");if(null!=n)return{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(n),scaledSize:new google.maps.Size(28,34),anchor:new google.maps.Point(14,34)}}return{path:"M0-37.06c-5.53 0-10 4.15-10 9.26 0 7.4 8 9.26 10 27.8 2-18.54 10-20.4 10-27.8 0-5.1-4.47-9.26-10-9.26zm.08 7a2.9 2.9 0 0 1 2.9 2.9 2.9 2.9 0 0 1-2.9 2.9 2.9 2.9 0 0 1-2.9-2.9 2.9 2.9 0 0 1 2.9-2.9z",scale:1,fillOpacity:1,fillColor:e,strokeColor:r,strokeWeight:1}}function getCenterPointGraphic(){const e=Mercury.getThemeJSON("map-center","#000000"),t=(0,tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A)(e).darken(20);return{path:"M2,8a6,6 0 1,0 12,0a6,6 0 1,0 -12,0",scale:1,fillColor:e.toString(),fillOpacity:1,strokeWeight:1,strokeColor:t.toString(),strokeOpacity:1}}function getClusterGraphic(e,t){return e=e||Mercury.getThemeJSON("map-cluster","#999999"),{render:function({count:r,position:o},n){const s=(0,tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A)(e),a=(0,tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A)(e).darken(20),i=s.isLight()?(0,tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A)(e).darken(70):(0,tinycolor2__WEBPACK_IMPORTED_MODULE_0__.A)(e).lighten(70),l=window.btoa(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" stroke="${a}" stroke-width="2" fill="${e}"/></svg>`);return new google.maps.Marker({title:t,position:o,icon:{url:`data:image/svg+xml;base64,${l}`,scaledSize:new google.maps.Size(60,60)},label:{text:String(r),color:i.toString(),fontSize:"14px",fontWeight:"normal"},zIndex:Number(google.maps.Marker.MAX_ZINDEX)+r})}}}function showInfo(e,t){DEBUG&&console.info("GoogleMap showInfo() called with map id: "+e+" info id: "+t);for(var r=m_maps[e],o=r.infoWindows,n=0;n<o.length;n++)n!=t?o[n].close():("true"==o[n].geocode&&(DEBUG&&console.info("showInfo() geocode lookup for "+e),getGeocode(o[n]),o[n].geocode="false"),o[n].open(r,o[n].marker))}function hideAllInfo(e){DEBUG&&console.info("GoogleMap hideAllInfo() called with map id: "+e);for(var t=m_maps[e].infoWindows,r=0;r<t.length;r++)t[r].close()}function setInfo(e,t,r){DEBUG&&console.info("GoogleMap setInfo() geocode lookup returned status "+t);var o="";t==google.maps.GeocoderStatus.OK?e[0]&&(o=formatGeocode(e[0])):console.warn("GoogleMap GeoCoder returned error status '"+t+"' for coordinates "+r.marker.position);var n=r.getContent();n=n.replace("\x3c!-- replace-with-geoadr --\x3e",o),r.setContent(n)}function formatGeocode(e){for(var t="",r="",o="",n="",s=!1,a=0;a<e.address_components.length;a++){var i=String(e.address_components[a].types);""==t&&-1!=i.indexOf("route")&&(t=e.address_components[a].long_name,s=!0),-1!=i.indexOf("street_number")&&(r=e.address_components[a].long_name,s=!0),-1!=i.indexOf("postal_code")&&(o=e.address_components[a].long_name,s=!0),""==n&&-1!=i.indexOf("locality")&&(n=e.address_components[a].long_name,s=!0)}return 1==s?t+" "+r+"<br/>"+o+" "+n:e.formatted_address}function getGeocode(e){null==m_googleGeocoder&&(m_googleGeocoder=new google.maps.Geocoder),m_googleGeocoder.geocode({latLng:e.marker.position},function(t,r){setInfo(t,r,e)}
1)}function loadGoogleApi(){if(!m_googleApiLoaded){var e=Mercury.getInfo("locale"),t="";null!=m_apiKey&&(t="&key="+m_apiKey);var r="";Mercury.isOnlineProject()||(r="&libraries=places"),DEBUG&&console.info("GoogleMap API key: "+(""==t?"(undefined)":t));let o=jQ.loadScript("https://maps.google.com/maps/api/js?callback=GoogleMap.initGoogleMaps&loading=async&language="+e+r+t,{},DEBUG);return m_googleApiLoaded=!0,o}initGoogleMaps()}function showMarkers(e,t){DEBUG&&console.info("GoogleMap showMapMarkers() called with map id: "+e);const r=m_maps[e],o=m_mapData.find(t=>t.id===e);if(r)if(o.markerCluster)hideAllInfo(e),showSingleMap(o,t);else{var n=r.markers,s=decodeURIComponent(t);hideAllInfo(e);for(var a=0;a<n.length;a++)n[a].group==s||"showall"==s?n[a].setVisible(!0):n[a].setVisible(!1)}}function showSingleMap(mapData,filterByGroup){var mapId=mapData.id;DEBUG&&console.info("GoogleMap initializing map: "+mapId);var mapOptions={zoom:parseInt(mapData.zoom),styles:m_mapStyle,scrollwheel:!1,mapTypeId:eval("google.maps.MapTypeId."+mapData.type),streetViewControl:!1,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,mapTypeIds:new Array(google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.HYBRID,google.maps.MapTypeId.TERRAIN)},center:new google.maps.LatLng(mapData.centerLat,mapData.centerLng),maxZoom:18},$typeParent=jQ("#"+mapData.id).closest("*[class*='type-map']");$typeParent.addClass("visible");var map=new google.maps.Map(document.getElementById(mapId),mapOptions);google.maps.event.addListener(map,"click",function(e){this.setOptions({scrollwheel:!0})});var markers=[],infoWindows=[],groups={},groupsFound=0;if(void 0!==mapData.markers){let e=0;for(var p=0;p<mapData.markers.length;p++){var point=mapData.markers[p],group=point.group;if("centerpoint"===group)DEBUG&&console.info("GoogleMap new center point added."),groups[group]=getCenterPointGraphic();else if(void 0===groups[group]){let e=Mercury.getThemeJSON("map-color["+groupsFound+++"]","#ffffff"),t=null,r=e;if(Array.isArray(mapData.markerConfig)){const o=mapData.markerConfig.find(e=>e.group===group);o&&(t=o.name?o.name:null,r=o.color?o.color:e)}DEBUG&&console.info("GoogleMap new marker group added: "+group+" with color: "+r+(null==t?"":" icon: "+t)),groups[group]=getPuempel(r,t)}if(!mapData.markerCluster||void 0===filterByGroup||"showall"==filterByGroup||decodeURIComponent(filterByGroup)==group){var marker=new google.maps.Marker({position:new google.maps.LatLng(point.lat,point.lng),map:map,title:point.title,group:group,icon:groups[group],info:point.info,index:e,mapId:mapId,geocode:point.geocode});markers.push(marker);var infoWindow=new google.maps.InfoWindow({content:marker.info,marker:marker,geocode:point.geocode,index:e});infoWindows.push(infoWindow),DEBUG&&console.info("GoogleMap attaching Event lister: "+p+" to map id "+mapId),marker.addListener("click",function(){showInfo(this.mapId,this.index)}),e++}}}mapData.markerCluster&&new _googlemaps_markerclusterer__WEBPACK_IMPORTED_MODULE_1__.w1({markers:markers,map:map,renderer:getClusterGraphic(void 0,mapData.markerTitle)});var map={id:mapId,map:map,markers:markers,infoWindows:infoWindows};m_maps[mapId]=map}function showGeoJson(e,t,r,o,n){let s;o=o||0,DEBUG&&console.info("Google update markers for map with id: "+e);try{s=m_maps[e].map}catch(e){}if(!s)return;const a=m_mapDataMap[m_maps[e].id],i={lat:null,lng:null},l={lat:null,lng:null};let c,u=function(e){let t=e[1],r=e[0];(null===i.lat||i.lat<t)&&(i.lat=t),(null===i.lng||i.lng<r)&&(i.lng=r),(null===l.lat||l.lat>t)&&(l.lat=t),(null===l.lng||l.lng>r)&&(l.lng=r)};for(let t of m_mapData)t.id===e&&t.markers&&t.markers.length>0&&(c=t);c&&u([s.getCenter().lng(),s.getCenter().lat()]);let p=function(t,o){const i=t.features||[],l=[],c=o||!n?void 0:Mercury.getThemeJSON("map-center","#000000");for(let t=0;t<i.length;t++){const n=i[t],p=n.geometry.coordinates,m=n.properties.coords;o||u(p);let h=c||Mercury.getThemeJSON("map-color[0]","#ffffff"),g=Array.isArray(a.markerConfig)&&1===a.markerConfig.length?a.markerConfig[0].name:null;const f=new google.maps.Marker({title:a.markerTitle,position:new google.maps.LatLng(p[1],p[0]),map:s,icon:getPuempel(h,g),zIndex:t});l.push(f);const d=new google.maps.InfoWindow({marker:f,zIndex:t});f.addListener("click",function(){m_maps[e].infoWindow&&m_maps[e].infoWindow.close();fetch(r+"&coordinates="+m).then(e=>e.text()).then(e=>{d.setContent(e),d.open(s,f)}),m_maps[e].infoWindow=d})}new _googlemaps_markerclusterer__WEBPACK_IMPORTED_MODULE_1__.w1({markers:l,map:s,renderer:getClusterGraphic(c,a.markerTitle)})};if(n&&p(n,!0),p(t),i.lat){const e=new google.maps.LatLngBounds;e.extend(i),e.extend(l),s.fitBounds(e)}}function initGoogleMaps(){DEBUG&&console.info("GoogleMap initGoogleMaps() called with data for "+m_mapData.length+" maps!");for(var e=0;e<m_mapData.length;e++)m_mapData[e].showPlaceholder||showSingleMap(m_mapData[e])}function showMap(e){DEBUG&&console.log("GoogleMap show map with id: "+e.currentTarget.id);for(var t=e.currentTarget,r=0;r<m_mapData.length;r++)m_mapData[r].id==t.id&&(m_mapData[r].showPlaceholder=!1,showSingleMap(m_mapData[r]));window.dispatchEvent(new CustomEvent("map-placeholder-click",{detail:GoogleMap}))}function init(e,t){jQ=e,DEBUG=t,m_apiKey=Mercury.getInfo("googleApiKey"),DEBUG&&(console.info("GoogleMap.init()"),null!=m_apiKey?console.info("GoogleMap API key is: "+Mercury.getInfo("googleApiKey")):console.info("GoogleMap API key not set - Google maps not activated"));var r=jQ(".map-google .mapwindow");if(DEBUG&&console.info("GoogleMap.init() .map-google elements found: "+r.length),r.length>0&&null!=m_apiKey){if(PrivacyPolicy.cookiesAcceptedExternal())return m_mapStyle=Mercury.getThemeJSON("map-style",[]),r.each(function(){var e=jQ(this);if(void 0!==e.data("map")){var t=e.data("map");"string"==typeof t&&(t=JSON.parse(t)),t.id=e.attr("id"),t.showPlaceholder=Mercury.initPlaceholder(e,showMap),prepareExternalSVGs(t.markerConfig,m_svgIcons),DEBUG&&console.info("GoogleMap found with id: "+t.id),m_mapData.push(t),m_mapDataMap[t.id]=t,t.showPlaceholder||e.removeClass("placeholder")}}),loadGoogleApi();
1DEBUG&&console.info("External cookies not accepted by the user - Google maps are disabled!")}}},499:function(e,t,r){r.d(t,{w1:function(){return ce}});const{getOwnPropertyNames:o,getOwnPropertySymbols:n}=Object,{hasOwnProperty:s}=Object.prototype;function a(e,t){return function(r,o,n){return e(r,o,n)&&t(r,o,n)}}function i(e){return function(t,r,o){if(!t||!r||"object"!=typeof t||"object"!=typeof r)return e(t,r,o);const{cache:n}=o,s=n.get(t),a=n.get(r);if(s&&a)return s===r&&a===t;n.set(t,r),n.set(r,t);const i=e(t,r,o);return n.delete(t),n.delete(r),i}}function l(e){return o(e).concat(n(e))}const c=Object.hasOwn||((e,t)=>s.call(e,t));function u(e,t){return e===t||!e&&!t&&e!=e&&t!=t}const{getOwnPropertyDescriptor:p,keys:m}=Object;function h(e,t){return e.byteLength===t.byteLength&&x(new Uint8Array(e),new Uint8Array(t))}function g(e,t,r){let o=e.length;if(t.length!==o)return!1;for(;o-- >0;)if(!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function f(e,t){return e.byteLength===t.byteLength&&x(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function d(e,t){return u(e.getTime(),t.getTime())}function _(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function y(e,t){return e===t}function w(e,t,r){const o=e.size;if(o!==t.size)return!1;if(!o)return!0;const n=new Array(o),s=e.entries();let a,i,l=0;for(;(a=s.next())&&!a.done;){const o=t.entries();let s=!1,c=0;for(;(i=o.next())&&!i.done;){if(n[c]){c++;continue}const o=a.value,u=i.value;if(r.equals(o[0],u[0],l,c,e,t,r)&&r.equals(o[1],u[1],o[0],u[0],e,t,r)){s=n[c]=!0;break}c++}if(!s)return!1;l++}return!0}const k=u;function M(e,t,r){const o=m(e);let n=o.length;if(m(t).length!==n)return!1;for(;n-- >0;)if(!C(e,t,r,o[n]))return!1;return!0}function E(e,t,r){const o=l(e);let n,s,a,i=o.length;if(l(t).length!==i)return!1;for(;i-- >0;){if(n=o[i],!C(e,t,r,n))return!1;if(s=p(e,n),a=p(t,n),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable))return!1}return!0}function v(e,t){return u(e.valueOf(),t.valueOf())}function b(e,t){return e.source===t.source&&e.flags===t.flags}function A(e,t,r){const o=e.size;if(o!==t.size)return!1;if(!o)return!0;const n=new Array(o),s=e.values();let a,i;for(;(a=s.next())&&!a.done;){const o=t.values();let s=!1,l=0;for(;(i=o.next())&&!i.done;){if(!n[l]&&r.equals(a.value,i.value,a.value,i.value,e,t,r)){s=n[l]=!0;break}l++}if(!s)return!1}return!0}function x(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function I(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function C(e,t,r,o){return!("_owner"!==o&&"__o"!==o&&"__v"!==o||!e.$$typeof&&!t.$$typeof)||c(t,o)&&r.equals(e[o],t[o],o,o,e,t,r)}const D={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},O=Object.prototype.toString;function G({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:o,areErrorsEqual:n,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:h,unknownTagComparators:g}){return function(f,d,_){if(f===d)return!0;if(null==f||null==d)return!1;const y=typeof f;if(y!==typeof d)return!1;if("object"!==y)return"number"===y?i(f,d,_):"function"===y&&s(f,d,_);const w=f.constructor;if(w!==d.constructor)return!1;if(w===Object)return l(f,d,_);if(Array.isArray(f))return t(f,d,_);if(w===Date)return o(f,d,_);if(w===RegExp)return u(f,d,_);if(w===Map)return a(f,d,_);if(w===Set)return p(f,d,_);const k=O.call(f);if("[object Date]"===k)return o(f,d,_);if("[object RegExp]"===k)return u(f,d,_);if("[object Map]"===k)return a(f,d,_);if("[object Set]"===k)return p(f,d,_);if("[object Object]"===k)return"function"!=typeof f.then&&"function"!=typeof d.then&&l(f,d,_);if("[object URL]"===k)return h(f,d,_);if("[object Error]"===k)return n(f,d,_);if("[object Arguments]"===k)return l(f,d,_);if(D[k])return m(f,d,_);if("[object ArrayBuffer]"===k)return e(f,d,_);if("[object DataView]"===k)return r(f,d,_);if("[object Boolean]"===k||"[object Number]"===k||"[object String]"===k)return c(f,d,_);if(g){let e=g[k];if(!e){const t=null!=(M=f)?M[Symbol.toStringTag]:void 0;t&&(e=g[t])}if(e)return e(f,d,_)}var M;return!1}}const P=L();L({strict:!0}),L({circular:!0}),L({circular:!0,strict:!0}),L({createInternalComparator:()=>u}),L({strict:!0,createInternalComparator:()=>u}),L({circular:!0,createInternalComparator:()=>u}),L({circular:!0,createInternalComparator:()=>u,strict:!0});function L(e={}){const{circular:t=!1,createInternalComparator:r,createState:o,strict:n=!1}=e,s=function({circular:e,createCustomConfig:t,strict:r}){let o={areArrayBuffersEqual:h,areArraysEqual:r?E:g,areDataViewsEqual:f,areDatesEqual:d,areErrorsEqual:_,areFunctionsEqual:y,areMapsEqual:r?a(w,E):w,areNumbersEqual:k,areObjectsEqual:r?E:M,arePrimitiveWrappersEqual:v,areRegExpsEqual:b,areSetsEqual:r?a(A,E):A,areTypedArraysEqual:r?a(x,E):x,areUrlsEqual:I,unknownTagComparators:void 0};if(t&&(o=Object.assign({},o,t(o))),e){const e=i(o.areArraysEqual),t=i(o.areMapsEqual),r=i(o.areObjectsEqual),n=i(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:r,areSetsEqual:n})}return o}(e),l=G(s);var c;return function({circular:e,comparator:t,createState:r,equals:o,str
vendor: 4,297 bytes, line 1
1ict:n}){if(r)return function(s,a){const{cache:i=(e?new WeakMap:void 0),meta:l}=r();return t(s,a,{cache:i,equals:o,meta:l,strict:n})};if(e)return function(e,r){return t(e,r,{cache:new WeakMap,equals:o,meta:void 0,strict:n})};const s={cache:void 0,equals:o,meta:void 0,strict:n};return function(e,r){return t(e,r,s)}}({circular:t,comparator:l,createState:o,equals:r?r(l):(c=l,function(e,t,r,o,n,s,a){return c(e,t,a)}),strict:n})}const U=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],S=new Uint32Array(96);class T{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const o=r>>4;if(1!==o)throw new Error(`Got v${o} data when expected v1.`);const n=U[15&r];if(!n)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new T(a,s,n,void 0,e)}constructor(e,t=64,r=Float64Array,o=ArrayBuffer,n){if(isNaN(e)||e<0)throw new Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const s=U.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,i=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-i%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${r}.`);if(n)this.data=n,this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+i+l,2*e),this._pos=2*e,this._finished=!0;else{const n=this.data=new o(8+a+i+l);this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+i+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(n,0,2).set([219,16+s]),new Uint16Array(n,2,1)[0]=t,new Uint32Array(n,4,1)[0]=e}}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return B(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:s,nodeSize:a}=this;S[0]=0,S[1]=n.length-1,S[2]=0;let i=3;const l=[];for(;i>0;){const c=S[--i],u=S[--i],p=S[--i];if(u-p<=a){for(let a=p;a<=u;a++){const i=s[2*a],c=s[2*a+1];i>=e&&i<=r&&c>=t&&c<=o&&l.push(n[a])}continue}const m=p+u>>1,h=s[2*m],g=s[2*m+1];h>=e&&h<=r&&g>=t&&g<=o&&l.push(n[m]),(0===c?e<=h:t<=g)&&(S[i++]=p,S[i++]=m-1,S[i++]=1-c),(0===c?r>=h:o>=g)&&(S[i++]=m+1,S[i++]=u,S[i++]=1-c)}return l}within(e,t,r){const o=[];return this.withinInto(e,t,r,o),o}withinInto(e,t,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:s,nodeSize:a}=this;S[0]=0,S[1]=n.length-1,S[2]=0;let i=3,l=0;const c=r*r;for(;i>0;){const u=S[--i],p=S[--i],m=S[--i];if(p-m<=a){for(let r=m;r<=p;r++)z(s[2*r],s[2*r+1],e,t)<=c&&(o[l++]=n[r]);continue}const h=m+p>>1,g=s[2*h],f=s[2*h+1];z(g,f,e,t)<=c&&(o[l++]=n[h]),(0===u?e-r<=g:t-r<=f)&&(S[i++]=m,S[i++]=h-1,S[i++]=1-u),(0===u?e+r>=g:t+r>=f)&&(S[i++]=h+1,S[i++]=p,S[i++]=1-u)}return l}}function B(e,t,r,o,n,s){if(n-o<=r)return;const a=o+n>>1;j(e,t,a,o,n,s),B(e,t,r,o,a-1,1-s),B(e,t,r,a+1,n,1-s)}function j(e,t,r,o,n,s){for(;n>o;){if(n-o>600){const a=n-o+1,i=r-o+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(i-a/2<0?-1:1);j(e,t,r,Math.max(o,Math.floor(r-i*c/a+u)),Math.min(n,Math.floor(r+(a-i)*c/a+u)),s)}const a=t[2*r+s];let i=o,l=n;for(q(e,t,o,r),t[2*n+s]>a&&q(e,t,o,n);i<l;){for(q(e,t,i,l),i++,l--;t[2*i+s]<a;)i++;for(;t[2*l+s]>a;)l--}t[2*o+s]===a?q(e,t,o,l):(l++,q(e,t,l,n)),l<=r&&(o=l+1),r<=l&&(n=l-1)}}function q(e,t,r,o){R(e,r,o),R(t,2*r,2*o),R(t,2*r+1,2*o+1)}function R(e,t,r){const o=e[t];e[t]=e[r],e[r]=o}function z(e,t,r,o){const n=e-r,s=t-o;return n*n+s*s}const N={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},W=Math.fround||(Z=new Float32Array(1),e=>(Z[0]=+e,Z[0]));var Z;class K{constructor(e){this.options=Object.assign(Object.create(N),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}
vendor: 4,515 bytes, line 1
1load(e){const{log:t,minZoom:r,maxZoom:o}=this.options;t&&console.time("total time");const n=`prepare ${e.length} points`;t&&console.time(n),this.points=e;const s=[];for(let t=0;t<e.length;t++){const r=e[t];if(!r.geometry)continue;const[o,n]=r.geometry.coordinates,a=W(V(o)),i=W(J(n));s.push(a,i,1/0,t,-1,1),this.options.reduce&&s.push(0)}let a=this.trees[o+1]=this._createTree(s);t&&console.timeEnd(n);for(let e=o;e>=r;e--){const r=+Date.now();a=this.trees[e]=this._createTree(this._cluster(a,e)),t&&console.log("z%d: %d clusters in %dms",e,a.numItems,+Date.now()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let n=180===e[2]?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){const e=this.getClusters([r,o,180,s],t),a=this.getClusters([-180,o,n,s],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],i=a.range(V(r),J(s),V(n),J(o)),l=a.data,c=[];for(const e of i){const t=this.stride*e;c.push(l[t+5]>1?F(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),o="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(o);const s=n.data;if(t*this.stride>=s.length)throw new Error(o);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),i=s[t*this.stride],l=s[t*this.stride+1],c=n.within(i,l,a),u=[];for(const t of c){const r=t*this.stride;s[r+4]===e&&u.push(s[r+5]>1?F(s,r,this.clusterProps):this.points[s[r+3]])}if(0===u.length)throw new Error(o);return u}getLeaves(e,t,r){t=t||10,r=r||0;const o=[];return this._appendLeaves(o,e,t,r,0),o}getTile(e,t,r){const o=this.trees[this._limitZoom(e)],n=Math.pow(2,e),{extent:s,radius:a}=this.options,i=a/s,l=(r-i)/n,c=(r+1+i)/n,u={features:[]};return this._addTileFeatures(o.range((t-i)/n,l,(t+1+i)/n,c),o.data,t,r,n,u),0===t&&this._addTileFeatures(o.range(1-i/n,l,1,c),o.data,n,r,n,u),t===n-1&&this._addTileFeatures(o.range(0,l,i/n,c),o.data,-1,r,n,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,o,n){const s=this.getChildren(t);for(const t of s){const s=t.properties;if(s&&s.cluster?n+s.point_count<=o?n+=s.point_count:n=this._appendLeaves(e,s.cluster_id,r,o,n):n<o?n++:e.push(t),e.length===r)break}return n}_createTree(e){const t=new T(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,o,n,s){for(const a of e){const e=a*this.stride,i=t[e+5]>1;let l,c,u;if(i)l=$(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const r=this.points[t[e+3]];l=r.properties;const[o,n]=r.geometry.coordinates;c=V(o),u=J(n)}const p={type:1,geometry:[[Math.round(this.options.extent*(c*n-r)),Math.round(this.options.extent*(u*n-o))]],tags:l};let m;m=i||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==m&&(p.id=m),s.features.push(p)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:o,reduce:n,minPoints:s}=this.options,a=r/(o*Math.pow(2,t)),i=e.data,l=[],c=this.stride;for(let r=0;r<i.length;r+=c){if(i[r+2]<=t)continue;i[r+2]=t;const o=i[r],u=i[r+1],p=e.within(i[r],i[r+1],a),m=i[r+5];let h=m;for(const e of p){const r=e*c;i[r+2]>t&&(h+=i[r+5])}if(h>m&&h>=s){let e,s=o*m,a=u*m,g=-1;const f=(r/c<<5)+(t+1)+this.points.length;for(const o of p){const l=o*c;if(i[l+2]<=t)continue;i[l+2]=t;const u=i[l+5];s+=i[l]*u,a+=i[l+1]*u,i[l+4]=f,n&&(e||(e=this._map(i,r,!0),g=this.clusterProps.length,this.clusterProps.push(e)),n(e,this._map(i,l)))}i[r+4]=f,l.push(s/h,a/h,1/0,f,-1,h),n&&l.push(g)}else{for(let e=0;e<c;e++)l.push(i[r+e]);if(h>1)for(const e of p){const r=e*c;if(!(i[r+2]<=t)){i[r+2]=t;for(let e=0;e<c;e++)l.push(i[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){const o=this.clusterProps[e[t+6]];return r?Object.assign({},o):o}const o=this.points[e[t+3]].properties,n=this.options.map(o);return r&&n===o?Object.assign({},n):n}}function F(e,t,r){return{type:"Feature",id:e[t+3],properties:$(e,t,r),geometry:{type:"Point",coordinates:[(o=e[t],360*(o-.5)),Q(e[t+1])]}};var o}function $(e,t,r){const o=e[t+5],n=o>=1e4?`${Math.round(o/1e3)}
1k`:o>=1e3?Math.round(o/100)/10+"k":o,s=e[t+6],a=-1===s?{}:Object.assign({},r[s]);return Object.assign(a,{cluster:!0,cluster_id:e[t+3],point_count:o,point_count_abbreviated:n})}function V(e){return e/360+.5}function J(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Q(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function Y(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;class X{static isAdvancedMarkerAvailable(e){return google.maps.marker&&!0===e.getMapCapabilities().isAdvancedMarkersAvailable}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)||e.getVisible()}}class H{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(0===this.markers.length&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(X.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>X.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(X.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function ee(e,t="assertion failed"){if(null==e)throw Error(t)}class te{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return re(e)}}const re=e=>e.map(e=>new H({position:X.getPosition(e),markers:[e]}));class oe extends te{constructor(e){var{maxZoom:t,radius:r=60}=e,o=Y(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new K(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(e){let t=!1,r=e.map.getZoom();ee(r),r=Math.round(r);const o={zoom:r};if(!P(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const r=this.markers.map(e=>{const t=X.getPosition(e);return{type:"Feature",geometry:{type:"Point",coordinates:[t.lng(),t.lat()]},properties:{marker:e}}});this.superCluster.load(r)}return t||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(t=!P(this.state,o)),this.state=o,0===e.markers.length?(this.cluster
vendor: 4,283 bytes, lines 1-2
1s=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return ee(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(e=>this.transformCluster(e))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new H({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(e=>e.properties.marker),position:{lat:t,lng:e}});const o=r.marker;return new H({markers:[o],position:X.getPosition(o)})}}class ne{constructor(e,t){this.markers={sum:e.length};const r=t.map(e=>e.count),o=r.reduce((e,t)=>e+t,0);this.clusters={count:t.length,markers:{mean:o/t.length,sum:o,min:Math.min(...r),max:Math.max(...r)}}}}class se{render({count:e,position:t},r,o){const n=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<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>\n</svg>`,s=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(X.isAdvancedMarkerAvailable(o)){const e=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement;e.setAttribute("transform","translate(0 25)");const r={map:o,position:t,zIndex:a,title:s,content:e};return new google.maps.marker.AdvancedMarkerElement(r)}const i={position:t,zIndex:a,title:s,icon:{url:`data:image/svg+xml;base64,${btoa(n)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(i)}}class ae{constructor(){!function(e,t){for(let r in t.prototype)e.prototype[r]=t.prototype[r]}(ae,google.maps.OverlayView)}}var ie;!function(e){e.CLUSTERING_BEGIN="clusteringbegin",e.CLUSTERING_END="clusteringend",e.CLUSTER_CLICK="click",e.GMP_CLICK="gmp-click"}(ie||(ie={}));const le=(e,t,r)=>{t.bounds&&r.fitBounds(t.bounds)};class ce extends ae{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:o=new oe(r),renderer:n=new se,onClusterClick:s=le}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=o,this.renderer=n,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(e=>{this.addMarker(e,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return-1!==r&&(X.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(e=>{r=this.removeMarker(e,!0)||r}),r&&!t&&this.render(),r}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,ie.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||null==r){const e=new Set;for(const r of t)1==r.markers.length&&e.add(r.markers[0]);const r=[];for(const t of this.clusters)null!=t.marker&&(1==t.markers.length?e.has(t.marker)||X.setMap(t.marker,null):r.push(t.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>r.forEach(e=>X.setMap(e,null)))}google.maps.event.trigger(this,ie.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();ee(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=>X.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new ne(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,t),r.markers.forEach(e=>X.setMap(e,null)),this.onClusterClick){const e=X.isAdvancedMarker(r.marker)?ie.GMP_CLICK:ie.CLUSTER_CLICK;r.marker.addListener(e,e=>{google.maps.event.trigger(this,ie.CLUSTER_CLICK,r),this.onClusterClick(e,r,t)})}X.setMap(r.marker,t)})}}}}]);
2//# sourceMappingURL=mercury-map-google.js.map?ver=435efd8212a89e1dae47

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.