PageSourceSearch

https://www.truyensenco.be/themes/custom/uiflow/dist/js/chunks/store-locator.chunk.f152fa2721b660697627.js

js truyensenco.be collected 2026-10-04 18:18:40 UTC 18,903 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["store-locator"],{
vendor: 196 bytes, line 1
1"../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":(v,p,n)=>{n.d(p,{A:()=>d});function d(c,l){(l==null||l>c.length)&&(l=c.length);for(var h=0,f=Array(l);h<l;h++)f[h]=c[h];return f}},
vendor: 220 bytes, line 1
1"../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js":(v,p,n)=>{n.d(p,{A:()=>c});var d=n("../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function c(l){if(Array.isArray(l))return(0,d.A)(l)}},
vendor: 198 bytes, line 1
1"../node_modules/@babel/runtime/helpers/esm/iterableToArray.js":(v,p,n)=>{n.d(p,{A:()=>d});function d(c){if(typeof Symbol<"u"&&c[Symbol.iterator]!=null||c["@@iterator"]!=null)return Array.from(c)}},
vendor: 263 bytes, lines 1-2
1"../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js":(v,p,n)=>{n.d(p,{A:()=>d});function d(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}},
vendor: 456 bytes, line 2
2"../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":(v,p,n)=>{n.d(p,{A:()=>f});var d=n("../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js"),c=n("../node_modules/@babel/runtime/helpers/esm/iterableToArray.js"),l=n("../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"),h=n("../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js");function f(k){return(0,d.A)(k)||(0,c.A)(k)||(0,l.A)(k)||(0,h.A)()}},
vendor: 462 bytes, line 2
2"../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":(v,p,n)=>{n.d(p,{A:()=>c});var d=n("../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function c(l,h){if(l){if(typeof l=="string")return(0,d.A)(l,h);var f={}.toString.call(l).slice(8,-1);return f==="Object"&&l.constructor&&(f=l.constructor.name),f==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?(0,d.A)(l,h):void 0}}},
2"./lib/components/store-locator/index.js":(v,p,n)=>{var d=n("../node_modules/@babel/runtime/helpers/esm/typeof.js"),c=n("../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),l=n("../node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),h=n("../node_modules/@babel/runtime/helpers/esm/createClass.js"),f=n("../node_modules/core-js/modules/es6.array.map.js"),k=n("../node_modules/core-js/modules/es6.function.name.js"),M=n("../node_modules/core-js/modules/es6.regexp.replace.js"),C=n("../node_modules/core-js/modules/es6.regexp.split.js"),j=n("../node_modules/core-js/modules/es6.array.slice.js"),I=n("../node_modules/core-js/modules/es6.string.includes.js"),T=n("../node_modules/core-js/modules/es7.array.includes.js"),E=n("../node_modules/core-js/modules/es6.number.constructor.js"),P=n("../node_modules/core-js/modules/es6.object.keys.js"),x=n("../node_modules/whatwg-fetch/fetch.js"),b=n("../node_modules/@google/markerclustererplus/dist/markerclustererplus.esm.js"),L=function(){function g(a,e,t){(0,l.A)(this,g),this.map=a,this.config=e,this.markers=t,this.marker=new window.google.maps.Marker(this.getMarkerSettings()),this.config.nodeId?this.infoWindow=new window.google.maps.InfoWindow({content:'<div class="info-window"><div class="info-window__content">Loading...</div></div>',maxWidth:260,pixelOffset:new window.google.maps.Size(180,150)}):this.infoWindowDefined&&(this.infoWindow=new window.google.maps.InfoWindow({content:this.config.infoWindow,maxWidth:260,pixelOffset:new window.google.maps.Size(180,150)})),this.marker.addListener("click",this.openInfoWindow.bind(this),!1)}return(0,h.A)(g,[{key:"openInfoWindow",value:function(){var e=this;if(this.config.nodeId){var t="";window.drupalSettings&&window.drupalSettings.path&&window.drupalSettings.path.pathPrefix&&(t=window.drupalSettings.path.pathPrefix),window.fetch("//".concat(window.location.hostname,"/").concat(t,"api/store/map/info/").concat(this.config.nodeId),{credentials:"same-origin"}).then(function(o){return o.text()}).then(function(o){var s=document.createElement("DIV");s.innerHTML=JSON.parse(o).render;var r=document.createElement("A");r.classList.add("info-window__route-link"),r.setAttribute("target","_blank"),r.href="https://www.google.com/maps?saddr=My+Location&daddr=".concat(e.config.coordinates.lat,",").concat(e.config.coordinates.lng);var i=s.querySelector(".js-map-info");i.querySelector(".info-window__content").appendChild(r),e.infoWindow.setContent(i)})}this.infoWindowDefined!==!1&&(this.infoWindow.open(this.map,this.marker),this.markers.forEach(function(o){o!==e&&o.closeInfoWindow()}))}},{key:"handleInfoLink",value:function(){var e=this;if(this.config.nodeId){var t="";window.drupalSettings&&window.drupalSettings.path&&window.drupalSettings.path.pathPrefix&&(t=window.drupalSettings.path.pathPrefix),window.fetch("//".concat(window.location.hostname,"/").concat(t,"api/store/map/info/").concat(this.config.nodeId,"/extract"),{credentials:"same-origin"}).then(function(o){return o.text()}).then(function(o){var s=document.createElement("template");s.innerHTML=JSON.parse(o).render;var r=null;s.content?r=s.content.querySelector(".js-chosen-store"):r=s.querySelector(".js-chosen-store");var i=document.querySelector(".chosen-store"),m=document.querySelector(".js-map-wrapper"),u=document.querySelector('input[name="selected-store"]');u.value=e.config.nodeId,i.innerHTML="",i.appendChild(r),i.classList.remove("js-hide"),m.classList.remove("js-show");var y=document.querySelector(".js-change-store");y.addEventListener("click",function(){i.classList.add("js-hide"),m.classList.add("js-show")})})}}},{key:"closeInfoWindow",value:function(){this.infoWindowDefined!==!1&&this.infoWindow.close()}},{key:"infoWindowDefined",get:function(){var e=!1;return this.config.infoWindow&&(e=!0),e}},{key:"getMarkerSettings",value:function(){var e={};return e.position={lat:this.config.coordinates.lat,lng:this.config.coordinates.lng},e.map=this.map,typeof this.config.title=="string"&&(e.title=this.config.title),typeof this.config.icon<"u"&&(e.icon=this.config.icon),typeof this.config.icon.type<"u"&&this.config.icon.type==="official store"&&(e.zIndex=1),e}}]),g}(),_=(0,h.A)(function g(){(0,l.A)(this,g),this.GMAP_API_KEY="AIzaSyCh4UFj_pYxu8MLpE7ZN1GX65yyFk1lNNY",this.iconImages={current:"/themes/custom/uiflow/dist/img/static/current-marker.png",store:"/themes/custom/uiflow/dist/img/static/store-marker.png",clustering:"/themes/custom/uiflow/dist/assets/img/static/cluster"},this.iconSizes={current:{w:22,h:30},store:{w:80,h:77},clustering:{w:80,h:80}},this.clusterMarkerStyle={fontFamily:"Arial",fontStyle:"normal",fontWeight:"bold",textColor:"white",textSize:24},this.mapStyle=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}]}
2),A=function(){function g(a){var e=this;if((0,l.A)(this,g),!!a){this.elMapContainer=a,this.zoom=10,this.elements={elForm:this.elMapContainer.querySelector(".rc-store-locator-form"),elAutocomplete:this.elMapContainer.querySelector('input[name="location"]'),elLat:this.elMapContainer.querySelector('input[name="lat"]'),elLong:this.elMapContainer.querySelector('input[name="long"]'),elCountry:this.elMapContainer.querySelector('select[name="country"]'),elMap:null,elMapMainContainer:document.querySelector(".js-map__maincontainer"),elResults:document.querySelector(".js-map-results"),elStoreCards:document.querySelectorAll(".js-store-card")},this.selectors={cardList:".js-store-card-list",map:".js-map"},this.elements.elMap=this.elMapContainer.querySelector(this.selectors.map),this.hasMultipleCountries=!1,this.country="BE",this.hasMarkerClustering=!1,this.instMarkerClusterer=null,this.isLoading=!1,this.markers=[],this.storesJson=null,this.options=null,this.browserLocation=null,this.processStoresJson(this.elements.elMap),this.addLocatorIcon();var t=document.querySelector('input[name="selected-store"]');if(t&&t.value){var o=document.querySelector(".js-change-store");o.addEventListener("click",function(){var s=document.querySelector(".chosen-store");s.classList.add("js-hide"),e.elements.elMapMainContainer.classList.add("js-show")})}else this.elements.elMapMainContainer.classList.add("js-show");if(this.hasMultipleCountries===!1&&this.country==="")throw Error("Store locator is set to hasMultipleCountries false, and needs a country code (this.country)");this.askGeoLocation(),this.map=new window.google.maps.Map(this.elements.elMap,{zoom:this.zoom,center:{lat:51.012769,lng:3.642747},disableDefaultUI:!0,styles:new _().mapStyle,maxZoom:18}),this.initEvents(),this.drawMarkers()}}return(0,h.A)(g,[{key:"addLocatorIcon",value:function(){var e=this,t=document.createElement("DIV"),o=this.elements.elForm.querySelector(".js-form-item-location");t.classList.add("locator-icon"),o.appendChild(t),t.addEventListener("click",function(){e.askGeoLocation()})}},{key:"askGeoLocation",value:function(){this.elements.elAutocomplete.value="";var e={};navigator.geolocation.getCurrentPosition(this.locationSuccess.bind(this),this.locationError.bind(this),e),this.togglePreloader(!0)}},{key:"initEvents",value:function(){var e=this;this.elements.elAutocomplete.setAttribute("onkeypress","return event.keyCode!=13"),this.autocomplete=new window.google.maps.places.Autocomplete(this.elements.elAutocomplete,this.options),window.google.maps.event.clearInstanceListeners(this.autocomplete),window.google.maps.event.addListener(this.autocomplete,"place_changed",this.handleAutoComplete.bind(this)),this.hasMultipleCountries?this.elements.elCountry.addEventListener("change",function(){e.resetStores()}):this.elements.elCountry&&(this.elements.elCountry.parentNode.style.display="none")}},{key:"loadNewStoresPage",value:function(){var e=this;this.isLoading=!0,this.togglePreloader(!0);var t=this.elements.elForm.action;t.indexOf("?")===-1&&(t+="?x"),(0,c.A)(this.elements.elForm.querySelectorAll("input")).forEach(function(o){switch(o.type){case"hidden":case"text":default:t+="&".concat(encodeURIComponent(o.name)),t+="=".concat(encodeURIComponent(o.value));break}}),this.hasMultipleCountries&&t.indexOf("country")===-1&&(this.country||(this.country=this.elements.elCountry.options[this.elements.elCountry.selectedIndex].value),t+="&country=".concat(this.country)),window.fetch(t,{credentials:"same-origin"}).then(function(o){return o.text()}).then(function(o){var s=new DOMParser;return s.parseFromString(o,"text/html")}).then(function(o){e.handleData(o)})}},{key:"handleData",value:function(e){var t=this;this.elements.elMapMainContainer.classList.add("js-unblur"),this.processStoresJson(e.querySelector(this.selectors.map)),this.drawMarkers();var o=document.querySelector(this.selectors.cardList);o.innerHTML=e.querySelector(this.selectors.cardList).innerHTML;var s=o.querySelectorAll(".js-store-card-distance");this.elements.elStoreCards=o.querySelectorAll(".js-store-card"),(0,c.A)(s).forEach(function(r){var i=r.getAttribute("data-store-id");
2(0,c.A)(t.storesJson).forEach(function(m){if(i===m.nid){var u=r.innerHTML.replace("%DISTANCE%",parseFloat(m.distance).toFixed(2));r.innerHTML=u,r.classList.add("js-visible")}})}),this.elements.elResults.classList.add("js-show"),this.isLoading=!1,this.togglePreloader(!1)}},{key:"locationSuccess",value:function(e){this.browserLocation=e.coords,this.handleAddressSelect()}},{key:"locationError",value:function(e){throw this.togglePreloader(!1),Error("Geolocation error: ".concat(e))}},{key:"resetStores",value:function(){this.elements.elResults&&this.elements.elResults.classList.remove("js-show"),this.elements.elMapMainContainer.classList.remove("js-unblur"),this.hasMultipleCountries&&(this.country=this.elements.elCountry.options[this.elements.elCountry.selectedIndex].value),this.options.componentRestrictions.country=this.country,this.autocomplete.setComponentRestrictions({country:this.country});var e=this.elements.elForm.action;if(e.indexOf("?")===-1)e+="?country=".concat(this.country);else{var t=e.split("?")[0];e="".concat(t,"?country=").concat(this.country)}this.elements.elForm.action=e,this.elements.elAutocomplete.value="",window.google.maps.event.clearInstanceListeners(this.autocomplete),window.google.maps.event.addListener(this.autocomplete,"place_changed",this.handleAutoComplete.bind(this))}},{key:"processStoresJson",value:function(e){var t=window.drupalSettings.maps.maxMarkers;e&&(this.storesJson=JSON.parse(e.dataset.stores),this.storesJson=this.storesJson.slice(0,t)),this.hasMultipleCountries&&(this.country=this.elements.elCountry.options[this.elements.elCountry.selectedIndex].value),this.options={componentRestrictions:{country:this.country}}}},{key:"handleAutoComplete",value:function(){this.browserLocation=null,this.handleAddressSelect()}},{key:"handleAddressSelect",value:function(){var e=this;if(this.browserLocation){this.elements.elLat.value=this.browserLocation.latitude,this.elements.elLong.value=this.browserLocation.longitude;var t=new _().GMAP_API_KEY,o="https://maps.googleapis.com/maps/api/geocode/json?latlng=".concat(this.browserLocation.latitude,",").concat(this.browserLocation.longitude,"&key=").concat(t,"&result_type=locality").concat(g.getLanguage());window.fetch(o,{credentials:"same-origin"}).then(function(s){return s.json()}).then(function(s){if(s&&s.results&&s.results[0]&&s.results[0].formatted_address){var r=s.results[0].address_components;if(r&&r[0]){if(e.hasMultipleCountries){var i=r[r.length-1];if(i.types.includes("country")){var m=i.short_name.toLowerCase(),u=i.long_name.toLowerCase();e.country===u||e.country===m?e.elements.elAutocomplete.value=s.results[0].address_components[0].long_name:(0,c.A)(e.elements.elCountry.options).forEach(function(y){y.value.toLowerCase()===m&&(e.elements.elCountry.value=m,e.resetStores(),e.elements.elAutocomplete.value=s.results[0].address_components[0].long_name)})}else e.elements.elAutocomplete.value=s.results[0].address_components[0].long_name}}else e.elements.elAutocomplete.value=s.results[0].formatted_address}e.loadNewStoresPage()})}else{if(!this.autocomplete.getPlace().geometry)return;this.elements.elLat.value=this.autocomplete.getPlace().geometry.location.lat(),this.elements.elLong.value=this.autocomplete.getPlace().geometry.location.lng(),window.dataLayer&&window.dataLayer.push({event:"search_location",name:this.autocomplete.getPlace().name,formatted_address:this.autocomplete.getPlace().formatted_address}),this.loadNewStoresPage()}}},{key:"togglePreloader",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;e?this.elements.elAutocomplete.parentNode.classList.add("js-spinning"):this.elements.elAutocomplete.parentNode.classList.remove("js-spinning")}},{key:"drawMarkers",value:function(){for(var e=this,t=null;this.markers.length>0;)t=this.markers.pop(),t.marker.setMap(null);if(this.storesJson.forEach(function(r){var i=e.createMarker({coordinates:{lat:Number(r.lat),lng:Number(r.long)},title:r.title,nodeId:r.nid,infoWindow:!0,iconName:"store"});e.markers.push(i),r.marker=i}),this.browserLocation){var o=this.createMarker({coordinates:{lat:this.browserLocation.latitude,lng:this.browserLocation.longitude}
2,iconName:"current"});this.markers.push(o)}else if(this.autocomplete.getPlace()){var s=this.createMarker({coordinates:{lat:this.autocomplete.getPlace().geometry.location.lat(),lng:this.autocomplete.getPlace().geometry.location.lng()},iconName:"current"});this.markers.push(s)}this.fitBounds(this.markers),this.clusterMarkers()}},{key:"createMarker",value:function(e){var t=e.coordinates,o=e.title,s=e.infoWindow,r=e.iconName,i=e.nodeId,m=new _,u=m.iconSizes,y=null,w=m.iconImages.store;return this.elements.elResults.dataset&&this.elements.elResults.dataset.storeIcon&&(w=this.elements.elResults.dataset.storeIcon),r==="current"?y={url:m.iconImages.current,size:new window.google.maps.Size(u.current.w,u.current.h),origin:new window.google.maps.Point(0,0),anchor:new window.google.maps.Point(u.current.w/2,u.current.h)}:y={url:w,size:new window.google.maps.Size(u.store.w,u.store.h),origin:new window.google.maps.Point(0,0),anchor:new window.google.maps.Point(u.store.w/2,u.store.h)},new L(this.map,{coordinates:t,title:o,infoWindow:s,nodeId:i,icon:y},this.markers)}},{key:"fitBounds",value:function(e){var t=new window.google.maps.LatLngBounds;e.forEach(function(o){t.extend(o.marker.getPosition())}),this.map.fitBounds(t)}},{key:"clusterMarkers",value:function(){if(!!this.hasMarkerClustering){this.instMarkerClusterer&&this.instMarkerClusterer.clearMarkers();var e=[];(0,c.A)(this.markers).forEach(function(y){e.push(y.marker)});var t=new _,o={imagePath:t.iconImages.clustering};this.instMarkerClusterer=new b.A(this.map,e,o);for(var s=t.iconSizes.clustering,r=t.clusterMarkerStyle,i=this.instMarkerClusterer.getStyles(),m=function(w){Object.keys(r).forEach(function(S){i[w][S]=r[S]}),i[w].width=s.w,i[w].height=s.h,i[w].textLineHeight=s.h,i[w].backgroundPosition="0 0",i[w].textDecoration="none"},u=0;u<i.length;u+=1)m(u)}}}],[{key:"getLanguage",value:function(){var e="";return window.drupalSettings&&window.drupalSettings.path&&window.drupalSettings.path.currentLanguage&&(e="&language=".concat(window.drupalSettings.path.currentLanguage.split("-")[0])),e}},{key:"init",value:function(e){var t=this,o=(0,c.A)(document.querySelectorAll(e)),s=new _().GMAP_API_KEY;if(o.length!==0&&!(typeof window.initMaps<"u"))if(window.initMaps=function(){return o.forEach(function(i){return new t(i)})},(0,d.A)(window.google)==="object"&&(0,d.A)(window.google.maps)==="object")window.initMaps();else{var r=document.createElement("script");r.type="text/javascript",r.src="https://maps.googleapis.com/maps/api/js?key=".concat(s,"&libraries=places,geometry&callback=initMaps").concat(g.getLanguage()),document.body.appendChild(r)}}}]),g}();A.init(".js-map__maincontainer")}
2}]);

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.