PageSourceSearch

https://mercedes-benz-archive.com/mars/js/core/pages/7585.8e6ca9f0392316a505a8.bundle.js

js mercedes-benz-archive.com collected 2026-10-02 11:49:40 UTC 32,848 bytes, 1 lines download raw bytes

1(self.webpackChunkmds_webpack=self.webpackChunkmds_webpack||[]).push([[7585],{
1"../src/docroot/shared/js/core/modules/googleMaps.js":(t,e,a)=>{var r;t=a.nmd(t),r=function(t,e,r){let o=a("../src/docroot/shared/bower_components/flight/lib/component.js"),n=window.mds.getConfig(),i=(a("../src/docroot/shared/js/core/modules/jquery-private.js"),a("../src/docroot/shared/js/core/utils/utils.js")),s=a("../src/docroot/shared/js/core/utils/logger.js").factory(r),p=(a("../src/docroot/shared/js/core/utils/toast.js"),a("../src/docroot/shared/js/core/services/sharedRestServices.js").mapService),d=a("../src/docroot/shared/js/core/utils/mapsUtils.js");return o((function(){this.attributes({googleMapsUrl:"https://maps.googleapis.com/maps/api/js?key=",googleMapContainerSelector:"#googleMapsContainer",gpsPropertyWrapperSelector:".uiGpsPointWrapper",gpsPropertyHolderSelector:".uiGpsPointInput",gpsOpenMapBtnSelector:".uiGpsPointBtn",searchMapInputSelector:".uiGoogleMapsSearchInput",searchMapBtnSelector:".uiGoogleMapsSearchButton",homeLocationBtnSelector:".uiGoogleHomeLocationButton",updatePropertyBtnSelector:".uiUpdateGpsPointProperty",batchUpdateCheckboxSelector:".panel-batch-update input[type='checkbox']",formGroupEditSelector:".form-group-edit-container",formGroupSelector:".form-group-edit",dataGpsPoint:"gpsPoint",dataGpsPointEditable:"gpsPointEditable"}),this.data={$gpsPointPropertyWrapper:null,editable:!1,map:null,marker:null,defaultZoom:12,mapsOptions:{},lastSearchedLocation:{},lastSearchCountryIsoCode:"",languagesToFetchForCurrentMandator:[],propertyNames:Object.freeze(d.getGPSPropertiesNames()),isMediaManager:!1,isMediaManagerUpload:!1,documentNode:document,googleApiKey:void 0},this.showGoogleMapDialog=function(t){var e,a,r=$(t.target);r.hasClass(this.attr.gpsOpenMapBtnSelector.slice(1))||(r=r.closest(this.attr.gpsOpenMapBtnSelector));let o=!1;if(r.data(this.attr.dataGpsPointEditable)?(this.data.$gpsPointPropertyWrapper=r.closest(this.attr.gpsPropertyWrapperSelector),this.data.editable=!0):this.data.isMediaManager&&(this.data.$gpsPointPropertyWrapper=r.parent(),o=d.isMediaManagerReadOnlyField(this.data.$gpsPointPropertyWrapper),this.data.editable=!o),r[0].dataset.gpsPoint)e=r[0].dataset.gpsPoint;else if(this.data.isMediaManager){let t=o?"div":"input";e=d.getGPSPointFromReadOnlyField(this.data.$gpsPointPropertyWrapper,t)}if(a=d.getLatLongFromString(e))this._searchCoordinates(a);else{let t=d.getGPSPropertyFirstInputByWrapperSelector("."+this.data.propertyNames.cityInputProperty);t&&t.value.length?(this.select("searchMapInputSelector").val(t.value),this.performSearch()):this._showMapWithMarker(a)}this.$node.modal("show"),this.select("searchMapInputSelector").val(""),this.select("updatePropertyBtnSelector").toggleClass("hidden",!this.data.editable)},this._showMapWithMarker=function(t){t||(t=this.data.mapsOptions.center),this.data.map?t&&(this.data.map.setCenter(t),this.data.map.setZoom(this.data.defaultZoom),this.data.marker.setPosition(t)):(this.data.mapsOptions.center=t,this.data.map=new google.maps.Map(this.select("googleMapContainerSelector")[0],this.data.mapsOptions),this.data.marker=new google.maps.Marker({map:this.data.map,position:t,draggable:!0,animation:google.maps.Animation.DROP}),google.maps.event.addListener(this.data.marker,"dragend",function(){this._searchCoordinates(this.data.marker.getPosition())}.bind(this)),google.maps.event.addListener(this.data.map,"dblclick",function(t){this._searchCoordinates(t.latLng)}.bind(this)))},this.searchInputKeyPressHandle=function(t){d.isEnterKeyPressEvent(t)&&this.performSearch()},this.performSearch=function(){d.performSearch(this.$node[0],this.attr.searchMapInputSelector,this._searchAddress.bind(this),this._searchCoordinates.bind(this))},this._searchAddress=function(t){this._mapSearch(t)},this._searchCoordinates=function(t){this._mapSearch(t,"location")},this._mapSearch=function(t,e="address"){this.fetchMultipleLanguages(t,e).then((t=>{if(!t)return void s.error("invalid search");let e;this.data.lastSearchedLocation=t;const a=i.getGUILanguage(),r=this.data.languagesToFetchForCurrentMandator[0];e=t[a]?t[a]:t[r],e?(this._showMapWithMarker(e.geometry.location),e.formatted_address&&this.select("searchMapInputSelector").val(e.formatted_address)):s.error("No results found for any language")})).catch((t=>{s.error("Error:",t)}))},this.fetchMultipleLanguages=async function(t,e="address"){const a="address"===e,r={},o=this.data.languagesToFetchForCurrentMandator.map((e=>new Promise(((o,n)=>{let i={language:e};a?i.address=t:i.location=t,(new google.maps.Geocoder).geocode(i,(function(t,a){a===google.maps.GeocoderStatus.OK&&t&&0!==t.length?(r[e]=t[0],o()):(s.error("Geocode failed for language: "+e),n(new Error(`Geocode failed for language: ${e}`)))}))}))));try{await Promise.all(o)}catch(t){return s.error("Error fetching multiple languages:",t),null}return r},this.setHomeLocation=function(){d.getHomeLocation(this._getCoordinatesFromPosition.bind(this))},this._getCoordinatesFromPosition=function(t){var e={lat:t.coords.latitude,lng:t.coords.longitude};this._searchCoordinates(e)},this.updateGPSProperties=function(){this.data.editable&&(this.updateOpenMapButton(),this.updatePropertiesOfTypeText(),d.updateMapInfoJsonProperty(this.data.$gpsPointPropertyWrapper,this.data.lastSearchedLocation,this.data.isMediaManager),this.data.lastSearchCountryIsoCode.length&&(this.data.isMediaManager?d.updateMediaManagerCountrySelectListProperty(this.data.lastSearchCountryIsoCode,"."+this.data.propertyNames.countrySelectProperty,this.data.$gpsPointPropertyWrapper):d.updateCountrySelectListProperty(this.data.lastSearchCountryIsoCode,"."+this.data.propertyNames.countrySelectProperty)),this.$node.modal("hide"))},this.updateOpenMapButton=function(){if(!this.data.marker||!this.data.$gpsPointPropertyWrapper||!this.data.$gpsPointPropertyWrapper.length)return void s.error("marker is not defined");let t=this.data.marker.getPosition(),e=t.lat()+" "+t.lng();d.updateInputValueInsideWrapper(this.data.$gpsPointPropertyWrapper[0],this.attr.gpsPropertyHolderSelector,e),d.updateOpenMapButtonAttribute(this.data.$gpsPointPropertyWrapper[0],this.attr.gpsOpenMapBtnSelector,this.attr.dataGpsPoint,"data-gps-point",e)},this.updatePropertiesOfTypeText=function(){let t=$("."+this.data.propertyNames.cityInputProperty),e=$("."+this.data.propertyNames.countyInputProperty);if(t.length||(t=$(d.getInputWrapperIdContains(this.data.propertyNames.cityInputProperty,this.attr.formGroupSelector))),e.length||(e=$(d.getInputWrapperIdContains(this.data.propertyNames.countyInputProperty,this.attr.formGroupSelector))),this.data.isMediaManager){let t=n?.common?.langGUI??"en",e=this.getLocationDataFromLocationJSON(t);d.updateMediaManagerPropertiesOfTypeText(this.data.$gpsPointPropertyWrapper,e)}else{if(i.isInKO()){let a=this.data.$gpsPointPropertyWrapper.closest(this.attr.formGroupEditSelector);a.length&&(t=a.find("."+this.data.propertyNames.cityInputProperty),e=a.find("."+this.data.propertyNames.countyInputProperty))}this.data.languagesToFetchForCurrentMandator.forEach((a=>{const r=this.getLocationDataFromLocationJSON(a);r&&!i.isEmptyObject(r)&&d.updateCityAndCountyProperties(t,e,r,a)}))}},this.getLocationDataFromLocationJSON=function(t=-1){if(-1!==t&&!this.data.lastSearchedLocation[t])return;let e=t;if(-1===t&&(e=Object.keys(this.data.lastSearchedLocation)[0]),!this.data.lastSearchedLocation[e])return;let a=this.data.lastSearchedLocation[e].address_components,r={};return a.forEach((t=>
1{t.types.forEach((e=>{switch(e){case"country":r.country=t.long_name,r.countryCode=t.short_name,this.data.lastSearchCountryIsoCode=r.countryCode;break;case"administrative_area_level_2":r.city||(r.city=t.long_name);break;case"administrative_area_level_1":r.county=t.long_name;break;case"locality":r.city=t.long_name}}))})),r},this._initGoogleMapData=function(t){this.data.mapsOptions={zoom:12,center:d.getDefaultGeoLocationStartPoint(),mapTypeId:google.maps.MapTypeId.ROADMAP},this.on(this.data.documentNode,"click",{gpsOpenMapBtnSelector:this.showGoogleMapDialog}),this.on("click",{searchMapBtnSelector:this.performSearch,homeLocationBtnSelector:this.setHomeLocation,updatePropertyBtnSelector:this.updateGPSProperties}),this.select("searchMapInputSelector").on("keypress",this.searchInputKeyPressHandle.bind(this)),t.removeClass("disabled")},this.includeGoogleAPIScriptOnPage=function(t){if(this.isGoogleAPIScriptLoaded()||!this.data.googleApiKey||"function"!=typeof t)return;let e=document.createElement("script");e.src=this.attr.googleMapsUrl+this.data.googleApiKey,e.defer=!0,e.onload=t,document.head.appendChild(e)},this.isGoogleAPIScriptLoaded=function(){return"undefined"!=typeof google&&void 0!==google.maps},this.onInstanceCompleteUpdateViaAjax=function(t){this.updateLanguagesToFetchForMandator();let e=!this.data.languagesToFetchForCurrentMandator.length;d.toggleGPSButtonState(e)},this.updateLanguagesToFetchForMandator=function(){let t=d.getSelectedMandatorId();t>0&&(this.data.languagesToFetchForCurrentMandator=d.getLanguagesToFetchForCurrentMandator(t))},this.onBatchUpdateCheckboxChange=function(t){d.toggleOpenMapButtonOnBatchUpdateCheckboxChange(t)},this.after("initialize",(function(t,e){if(!d.isShouldUseGoogleMaps())return void s.error("Google Maps is currently not configured");if(i.isEmptyObject(this.data.propertyNames))return void s.error("GPS properties not found on page");this.data.isMediaManager=e&&e.hasOwnProperty("isMediaManager")&&i.stringToBoolean(e.isMediaManager),this.data.isMediaManagerUpload=e&&e.hasOwnProperty("isMediaManagerUpload")&&i.stringToBoolean(e.isMediaManagerUpload),this.data.languagesToFetchForCurrentMandator=d.getLanguagesToFetch(this.data.isMediaManager),this.data.languagesToFetchForCurrentMandator.length||d.disableGPSButton(),e&&e.hasOwnProperty("documentNode")&&(this.data.documentNode=e.documentNode);let a=$(this.data.documentNode).find(this.attr.gpsOpenMapBtnSelector);0!==a.length?(i.isInBatchUpdate()&&(a.addClass("hidden"),$(this.data.documentNode).find(this.attr.batchUpdateCheckboxSelector).on("change",this.onBatchUpdateCheckboxChange.bind(this))),a.addClass("disabled"),this.isGoogleAPIScriptLoaded()?this._initGoogleMapData(a):p.getGoogleApiKey(function(t){t?.googleApiKey?(this.data.googleApiKey=t.googleApiKey,this.includeGoogleAPIScriptOnPage(this._initGoogleMapData.bind(this,a))):s.error("Unable to retrieve the google API key from config.")}.bind(this)),this.on(this.data.documentNode,"uiInstanceCompleteUpdateViaAjax",this.onInstanceCompleteUpdateViaAjax)):s.log("No open map button found on page")}))}))}.call(e,a,e,t),void 0===r||(t.exports=r)},
1"../src/docroot/shared/js/core/modules/openStreetMaps.js":(t,e,a)=>{var r;t=a.nmd(t),r=function(t,e,r){let o=a("../src/docroot/shared/bower_components/flight/lib/component.js"),n=a("../src/docroot/shared/js/core/utils/utils.js"),i=window.mds.getConfig(),s=a("./node_modules/leaflet/dist/leaflet-src.js"),p=a("../src/docroot/shared/js/core/utils/mapsUtils.js"),d=a("../src/docroot/shared/js/core/utils/logger.js").factory(r);return o((function(){this.attributes({gpsPropertyWrapperSelector:".uiGpsPointWrapper",gpsOpenMapBtnSelector:".uiGpsPointBtn",gpsPropertyHolderSelector:".uiGpsPointInput",searchMapInputSelector:".uiOpenStreetMapsSearchInput",searchMapBtnSelector:".uiOpenStreetMapsSearchButton",updatePropertyBtnSelector:".uiUpdateGpsPointProperty",homeLocationBtnSelector:".uiOpenStreetMapsHomeLocationButton",batchUpdateCheckboxSelector:".panel-batch-update input[type='checkbox']",formGroupEditSelector:".form-group-edit-container",formGroupSelector:".form-group-edit",showNearbyImagesBtnSelector:".uiShowNearbyImagesButton",dataGpsPoint:"gpsPoint",dataInstanceOid:"oid",dataGpsPointEditable:"gpsPointEditable"}),this.data={gpsPointPropertyWrapper:null,editable:!1,map:null,marker:null,DEFAULT_MAP_OPTIONS:{zoom:12,center:{lat:48.208811,lng:16.372505}},lastSearchedLocation:{},languagesToFetchForCurrentMandator:[],NOMINATIM_URL:"https://nominatim.openstreetmap.org",propertyNames:Object.freeze(p.getGPSPropertiesNames()),isMediaManager:!1,isMediaManagerUpload:!1,documentNode:document,isShowSearchForNearbyImagesBtn:!n.stringToBoolean(i?.portal?.inEditMode)&&!n.stringToBoolean(i?.portal?.inBatchUpdate),currentInstanceOid:-1},this.showOpenStreetMapDialog=function(t){let e,a,r=t.target;r.classList.contains(this.attr.gpsOpenMapBtnSelector.slice(1))||(r=r.closest(this.attr.gpsOpenMapBtnSelector));let o=!1;if(r.dataset[this.attr.dataGpsPointEditable]?(this.data.gpsPointPropertyWrapper=r.closest(this.attr.gpsPropertyWrapperSelector),this.data.editable=!0):this.data.isMediaManager&&(this.data.gpsPointPropertyWrapper=r.parentElement,o=p.isMediaManagerReadOnlyField(this.data.gpsPointPropertyWrapper),this.data.editable=!o),r.dataset[this.attr.dataGpsPoint])e=r.dataset[this.attr.dataGpsPoint];else if(this.data.isMediaManager){let t=o?"div":"input";e=p.getGPSPointFromReadOnlyField(this.data.gpsPointPropertyWrapper,t)}if(r.dataset[this.attr.dataInstanceOid])try{this.data.currentInstanceOid=parseInt(r.dataset[this.attr.dataInstanceOid])}catch(t){}if(this.showMap(),a=p.getLatLongFromString(e),a)this.searchCoordinatesFromJson(a),this.data.isShowSearchForNearbyImagesBtn&&this.updateShowNearbyImagesBtn(a.lat,a.lng);else{let t=p.getGPSPropertyFirstInputByWrapperSelector("."+this.data.propertyNames.cityInputProperty);t&&t.value.length&&(this.setNewAddressInSearchInput(t.value),this.performSearch())}this.$node.modal("show"),this.setNewAddressInSearchInput(""),this.toggleUpdateButtonVisibility()},this.showMap=function(){this.initializeMap(),p.openStreetMaps.setMapViewBasedOnCoordinates(this.data.map,this.data.DEFAULT_MAP_OPTIONS.center.lat,this.data.DEFAULT_MAP_OPTIONS.center.lng,this.data.DEFAULT_MAP_OPTIONS.zoom,this.data.marker)},this.initializeMap=function(){if(this.data.map)return;const t=[this.data.DEFAULT_MAP_OPTIONS.center.lat,this.data.DEFAULT_MAP_OPTIONS.center.lng],e=s.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a class="uiOpenStreetMapLink" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'});this.data.map=p.openStreetMaps.initializeMap(s,{center:t,zoom:this.data.DEFAULT_MAP_OPTIONS.zoom,minZoom:3,layers:[e]});const a=p.openStreetMaps.createMarkerIcon(s);this.data.marker=s.marker(t,{icon:a,draggable:!0}).addTo(this.data.map),this.data.marker.on("dragend",function(){const t=this.data.marker.getLatLng();this.searchCoordinatesFromJson({lat:t.lat,lng:t.lng})}.bind(this)),setTimeout(function(){p.setTargetBlankOnOpenStreetMapsLink(".uiOpenStreetMapLink")}.bind(this))},this.performSearch=function(){p.performSearch(this.$node[0],this.attr.searchMapInputSelector,this.searchAddress.bind(this),this.searchCoordinatesFromJson.bind(this))},this.searchAddress=function(t){p.openStreetMaps.searchAddress(t,this.mapSearch.bind(this))},this.mapSearch=function(t){t&&this.fetchMultipleLanguages(t).then((t=>{if(!t)return void d.error("invalid search");let e;this.data.lastSearchedLocation=t;const a=n.getGUILanguage();if(t[a]?(e=t[a][0],e||(e=t[a])):e=t[this.data.languagesToFetchForCurrentMandator[0]],e.constructor===Array&&(e=e[0]),!p.openStreetMaps.validateLocationObject(e))return void d.error("invalid search");const r=e.lat,o=e.lon;p.openStreetMaps.setMapViewBasedOnCoordinates(this.data.map,r,o,this.data.DEFAULT_MAP_OPTIONS.zoom,this.data.marker),this.setNewAddressInSearchInput(e.display_name)}
1)).catch((t=>{d.error("Error:",t)}))},this.fetchMultipleLanguages=async function(t){const e={},a=this.data.languagesToFetchForCurrentMandator.map((a=>fetch(t,{headers:{"Accept-Language":a}}).then((t=>t.json())).then((t=>{e[a]=t})).catch((t=>{d.error("Error:",t),e[a]=null}))));return await Promise.all(a),e},this.searchCoordinatesFromJson=function(t){p.openStreetMaps.searchCoordinatesFromJson(t,this.mapSearch.bind(this))},this.searchCoordinatesFromGeolocationApiCallback=function(t){p.openStreetMaps.searchCoordinatesFromGeolocationApiCallback(t,this.mapSearch.bind(this))},this.updateGPSProperties=function(){if(!this.data.editable)return;this.updateOpenMapButton(),this.updatePropertiesOfTypeText(),p.updateMapInfoJsonProperty(this.data.gpsPointPropertyWrapper,this.data.lastSearchedLocation,this.data.isMediaManager);let t=this.getLocationDataFromJSONGivenPropertyAndLanguage("country_code");this.data.isMediaManager?p.updateMediaManagerCountrySelectListProperty(t,"."+this.data.propertyNames.countrySelectProperty,this.data.gpsPointPropertyWrapper):p.updateCountrySelectListProperty(t,"."+this.data.propertyNames.countrySelectProperty),this.$node.modal("hide")},this.updateOpenMapButton=function(){if(!this.data.marker||!this.data.gpsPointPropertyWrapper)return void d.error("marker is not defined");let t=this.data.marker.getLatLng(),e=t.lat+" "+t.lng;p.updateInputValueInsideWrapper(this.data.gpsPointPropertyWrapper,this.attr.gpsPropertyHolderSelector,e),p.updateOpenMapButtonAttribute(this.data.gpsPointPropertyWrapper,this.attr.gpsOpenMapBtnSelector,this.attr.dataGpsPoint,"data-gps-point",e)},this.updatePropertiesOfTypeText=function(){let t=document.querySelector("."+this.data.propertyNames.cityInputProperty),e=document.querySelector("."+this.data.propertyNames.countyInputProperty);if(t||(t=p.getInputWrapperIdContains(this.data.propertyNames.cityInputProperty,this.attr.formGroupSelector)),e||(e=p.getInputWrapperIdContains(this.data.propertyNames.countyInputProperty,this.attr.formGroupSelector)),this.data.isMediaManager){let t=i?.common?.langGUI??"en",e=this.getLocationDataFromLocationJSON(t);p.updateMediaManagerPropertiesOfTypeText(this.data.gpsPointPropertyWrapper,e)}else{if(n.isInKO()){let a=this.data.gpsPointPropertyWrapper.closest(this.attr.formGroupEditSelector);a&&(t=a.querySelector("."+this.data.propertyNames.cityInputProperty),e=a.querySelector("."+this.data.propertyNames.countyInputProperty))}this.data.languagesToFetchForCurrentMandator.forEach((a=>{const r=this.getLocationDataFromLocationJSON(a);r&&!n.isEmptyObject(r)&&p.updateCityAndCountyProperties($(t),$(e),r,a)}))}},this.getLocationDataFromLocationJSON=function(t){let e={};return e.city=this.getLocationDataFromJSONGivenPropertyAndLanguage("city",t)||this.getLocationDataFromJSONGivenPropertyAndLanguage("town",t)||this.getLocationDataFromJSONGivenPropertyAndLanguage("village",t)||this.getLocationDataFromJSONGivenPropertyAndLanguage("municipality",t),e.county=this.getLocationDataFromJSONGivenPropertyAndLanguage("county",t)||this.getLocationDataFromJSONGivenPropertyAndLanguage("state_district",t)||this.getLocationDataFromJSONGivenPropertyAndLanguage("state",t)||e.city,e.countryIsoCode=this.getLocationDataFromJSONGivenPropertyAndLanguage("country_code"),e},this.getLocationDataFromJSONGivenPropertyAndLanguage=function(t,e=-1){if(-1!==e&&!this.data.lastSearchedLocation[e])return;let a,r=e;-1===e&&(r=Object.keys(this.data.lastSearchedLocation)[0]);let o=this.data.lastSearchedLocation[r];if(a=n.isDataTypeArray(o)?o[0].address:o.address,!a)return;let i=a[t];if(!i&&n.isDataTypeArray(o))for(const e of o)if(e.address&&e.address[t]){i=e.address[t];break}return i},this.searchInputKeyPressHandle=function(t){p.isEnterKeyPressEvent(t)&&this.performSearch()},this.setHomeLocation=function(t){p.getHomeLocation(this.searchCoordinatesFromGeolocationApiCallback.bind(this))},this.setNewAddressInSearchInput=function(t){let e=this.$node[0].querySelector(this.attr.searchMapInputSelector);e&&(e.value=t)},this.toggleUpdateButtonVisibility=function(){let t=this.$node[0].querySelector(this.attr.updatePropertyBtnSelector);t&&t.classList.toggle("hidden",!this.data.editable)},this.onInstanceCompleteUpdateViaAjax=function(t){this.updateLanguagesToFetchForMandator();let e=!this.data.languagesToFetchForCurrentMandator.length;p.toggleGPSButtonState(e)},this.updateLanguagesToFetchForMandator=function(){let t=p.getSelectedMandatorId();t>0&&(this.data.languagesToFetchForCurrentMandator=p.getLanguagesToFetchForCurrentMandator(t))},this.onBatchUpdateCheckboxChange=function(t){p.toggleOpenMapButtonOnBatchUpdateCheckboxChange(t)}
1,this.updateShowNearbyImagesBtn=function(t,e){if(!this.data.isShowSearchForNearbyImagesBtn)return;const a=this.select("showNearbyImagesBtnSelector");a.length&&(a.removeClass("hidden"),a.attr("href",function(a,r){let o=-1;if(this.data.currentInstanceOid>0)o=this.data.currentInstanceOid;else if(i?.portal?.oid)try{o=parseInt(i.portal.oid)}catch(t){}const n=new URL(r,window.location.origin);return n.searchParams.set("lat",t),n.searchParams.set("long",e),o>0&&n.searchParams.set("oid",o),n.toString()}.bind(this)))},this.after("initialize",(function(t,e){if(!p.isShouldUseOpenStreetMaps())return void d.error("OpenStreetMap is currently not configured");if(n.isEmptyObject(this.data.propertyNames))return void d.error("GPS properties not found on page");this.data.isMediaManager=e&&e.hasOwnProperty("isMediaManager")&&n.stringToBoolean(e.isMediaManager),this.data.isMediaManagerUpload=e&&e.hasOwnProperty("isMediaManagerUpload")&&n.stringToBoolean(e.isMediaManagerUpload),this.data.languagesToFetchForCurrentMandator=p.getLanguagesToFetch(this.data.isMediaManager),this.data.languagesToFetchForCurrentMandator.length||p.disableGPSButton(),e&&e.hasOwnProperty("documentNode")&&(this.data.documentNode=e.documentNode);let a=$(this.data.documentNode).find(this.attr.gpsOpenMapBtnSelector);a.length?(this.data.DEFAULT_MAP_OPTIONS.center=p.getDefaultGeoLocationStartPoint(),n.isInBatchUpdate()&&(a.addClass("hidden"),$(this.data.documentNode).find(this.attr.batchUpdateCheckboxSelector).on("change",this.onBatchUpdateCheckboxChange.bind(this))),p.openStreetMaps.importLeafletCss(),this.on(this.data.documentNode,"click",{gpsOpenMapBtnSelector:this.showOpenStreetMapDialog}),this.select("searchMapInputSelector").on("keypress",this.searchInputKeyPressHandle.bind(this)),this.on("click",{searchMapBtnSelector:this.performSearch,homeLocationBtnSelector:this.setHomeLocation,updatePropertyBtnSelector:this.updateGPSProperties}),this.on(this.data.documentNode,"uiInstanceCompleteUpdateViaAjax",this.onInstanceCompleteUpdateViaAjax),this.$node.on("show.bs.modal",function(){setTimeout(function(){p.openStreetMaps.forceMapResizing(this.data.map)}.bind(this),300)}.bind(this))):d.log("No open map button found on page")}))}))}.call(e,a,e,t),void 0===r||(t.exports=r)},
1"../src/docroot/shared/js/core/utils/mapsUtils.js":(t,e,a)=>{var r;t=a.nmd(t),r=function(t,e,r){let o=a("../src/docroot/shared/js/core/utils/logger.js").factory(r),n=a("../src/docroot/shared/js/core/utils/utils.js"),i=window.mds.getConfig();return{getLatLongFromString:function(t){let e,a;return t?(a=(t=t.trim()).split(" "),2!==a.length&&(a=t.split(",")),2!==a.length?null:(a[0]=a[0].trim(),a[0]=a[0].replace(",",""),a[1]=a[1].trim(),a[1]=a[1].replace(",",""),isNaN(a[0])||isNaN(a[1])?(o.log("invalid point parameters for string [%o]",t),null):(e={lat:parseFloat(a[0]),lng:parseFloat(a[1])},e))):null},getHomeLocation:function(t,e=function(){}){try{navigator.geolocation.getCurrentPosition(t,e)}catch(t){o.log("Couldn't get home location, [ex - %o]",t),e&&e(t)}},openStreetMaps:{NOMINATIM_URL:"https://nominatim.openstreetmap.org",importLeafletCss:function(){a.e(3480).then((function(){var t=[a("./node_modules/leaflet/dist/leaflet.css")];(function(t){n.addCss(t)}).apply(null,t)})).catch(a.oe)},reverseGeocoding:function(t,e,a){if(!t||!e)return void o.error("No lat or long provided");if(!a)return void o.error("No callback provided");a(this.NOMINATIM_URL+`/reverse?format=json&lat=${t}&lon=${e}&addressdetails=1`)},validateLocationObject:function(t){return t&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lng")||t.hasOwnProperty("lon"))},searchCoordinatesFromJson:function(t,e){this.validateLocationObject(t)&&e?this.reverseGeocoding(t.lat,t.lng,e):o.error("Invalid JSON location object")},searchCoordinatesFromGeolocationApiCallback:function(t,e){t?.coords?e?this.reverseGeocoding(t.coords.latitude,t.coords.longitude,e):o.error("No callback provided"):o.error("Invalid JSON position object")},createMarkerIcon:function(t){const e=n.isMobile?20:30;return t.divIcon({html:`<div class="custom-div-marker-inner-container" style="\n                        width: ${e}px;\n                        height: ${e}px;\n                    "></div>`,className:"custom-div-marker-outer-container",iconSize:[e,e],iconAnchor:[e/2,e],popupAnchor:[0,-e]})},searchAddress:function(t,e){if(!t)return void o.error("No address provided");if(!e)return void o.error("No callback provided");e(this.NOMINATIM_URL+`/search?format=json&q=${encodeURIComponent(t)}&addressdetails=1`)},setMapViewBasedOnCoordinates:function(t,e,a,r=12,n=null){if(!this.validateMapObject(t))return;if(!e||!a)return void o.error("No coordinates provided");const i=[e,a];n&&n.setLatLng(i).update(),t.flyTo(i,r)},getCenter:function(t){if(this.validateMapObject(t))return t.getCenter()},validateMapObject:function(t){return!(void 0===t||!t)||(o.error("No map object provided"),!1)},getBounds:function(t){if(this.validateMapObject(t))return t.getBounds()},forceMapResizing:function(t){this.validateMapObject(t)&&t.invalidateSize()},initializeMap:function(t,e){if(this.validateMapObject(t))return t.map("map",e)}},performSearch:function(t,e,a,r){if(!(t&&e&&a&&r))return void o.error("Invalid parameter");let n=t.querySelector(e);if(!n)return;let i=n.value;if(!i)return void o.error("Empty field, don't perform search");let s=this.getLatLongFromString(i);s?r(s):a(i)},isShouldUseGoogleMaps:function(){return n.stringToBoolean(i.mapsServices.isShouldUseGoogleMaps)},isShouldUseOpenStreetMaps:function(){return i&&i.mapsServices&&n.stringToBoolean(i.mapsServices.isShouldUseOpenStreetMaps)},getGPSPropertyFirstInputByWrapperSelector:function(t){let e,a=document.querySelector(t);if(a){let t=a.querySelector("div");t&&(e=t.querySelector("input"))}return e},getDocumentOfConFrame:function(){return n.getDocumentOfFrame("#conframe")},getMediaManagerBatchUpdateMandatorSelect:function(){let t=this.getDocumentOfConFrame();if(!t)return;let e=t.querySelector('[data-property-name="MANDATOR_CID"]');return e?e.querySelector("select"):void 0},getGPSPointFromReadOnlyField:function(t,e){if(!$(t).length)return;let a=$(this.getElementInsideWrapperHelper(t,e));if(!a.length)return;let r=a.is("input")?a.val():a.text().trim(),o=this.getLatLongFromString(r);return o&&!n.isEmptyObject(o)?o.lat+" "+o.lng:void 0},getBatchUpdateSelectedMandatorId:function(){let t=this.getElementInsideWrapperHelper(document.querySelector("[data-property-name='MANDATOR_CID']"),"select");if(n.isInMediaManagerBatchUpdate()){this.getDocumentOfConFrame()&&
1(t=this.getMediaManagerBatchUpdateMandatorSelect())}return t?t.value:-1},getLanguagesToFetchForCurrentMandator:function(t=-1){let e=[n.getGUILanguage()];if(!this.validateAppConfigObject("languagesToFetchForEachMandator"))return e;if(-1===t){let e=$(".MANDATOR_CID");e.length&&e.find("select").length?t=e.find("select").val():i&&i.upload&&i.upload.mandatorId&&(t=i.upload.mandatorId)}if(-1===parseInt(t))return e;let a=JSON.parse(i.mapsServices.languagesToFetchForEachMandator);return a[t]?a[t]:[]},getLanguagesToFetchForBatchUpdate:function(){const t=new Set;return $("div[class*='item_lang']").not(".hidden").each((function(){$(this).attr("class").split(/\s+/).forEach((function(e){if(e.startsWith("item_lang_")){const a=e.replace("item_lang_","");t.add(a)}}))})),Array.from(t)},getLanguagesToFetch:function(t){if(!t&&n.isInBatchUpdate())return this.getLanguagesToFetchForBatchUpdate();let e=this.getLanguagesToFetchForCurrentMandator();if(t&&!e.length){let t=n.getMediamanagerInstanceMandatorId();e=this.getLanguagesToFetchForCurrentMandator(t)}return e},getCountryIsoCodeToSelectListId:function(){return this.validateAppConfigObject("countryIsoCodeToSelectListId")?JSON.parse(i.mapsServices.countryIsoCodeToSelectListId):""},validateAppConfigObject:function(t){return i&&i.mapsServices&&i.mapsServices[t]},getElementInsideWrapperHelper:function(t,e){let a=$(t);if(a.length)return a.find(e)[0]},getInputWrapperIdContains:function(t,e){let a=$(`[id*=${t}]`);if(a.length)return a.closest(e)[0]},updateInputValueInsideWrapper:function(t,e,a){let r=this.getElementInsideWrapperHelper(t,e);r&&(a=a||"",r.value=a)},updateCityAndCountyProperties:function(t,e,a,r){let o=`.lang_${r} input`,i=this.getGPSPropertiesNames();n.isInBatchUpdate()&&(t=$(`#${i.cityInputProperty}_INPUT_${r}`),e=$(`#${i.countyInputProperty}_INPUT_${r}`),o="input",this.updateBatchUpdateLanguageSpan(t,r,a.city),this.updateBatchUpdateLanguageSpan(e,r,a.county)),this.updateInputValueInsideWrapper(t[0],o,a.city),this.updateInputValueInsideWrapper(e[0],o,a.county)},updateBatchUpdateLanguageSpan:function(t,e,a){let r=t.closest(`.item_lang_${e}`);if(!r.length)return;let o=r.find(".langInput .labelFlag");o.length&&o.text(a)},updateBatchUpdateCountrySelectReadValue:function(t){let e=$(t).find(":selected").text(),a=$(t).closest(".property-value").find(".read");a.length&&a.text(e)},updateOpenMapButtonAttribute:function(t,e,a,r,o){let n=t.querySelector(e);n&&(n.dataset[a]=o,n.setAttribute(r,o))},updateCountrySelectListProperty:function(t,e,a=void 0){let r=this.getCountryIsoCodeToSelectListId();if(!r||n.isEmptyObject(r))return;
1if(a||(n.isInBatchUpdate()&&(e=$(`[data-property-name=${this.getGPSPropertiesNames().countrySelectProperty}]`)),a=this.getElementInsideWrapperHelper(e,"select")),!a){let t=this.getInputWrapperIdContains(this.getGPSPropertiesNames().countrySelectProperty,".form-group");a=this.getElementInsideWrapperHelper(t,"select")}if(!a)return;a instanceof jQuery&&(a=a[0]);let o=r[t.toLowerCase()];o&&(a.value=o,$(a).trigger("chosen:updated"),n.isInBatchUpdate()&&this.updateBatchUpdateCountrySelectReadValue(a))},updateMapInfoJsonProperty:function(t,e,a=!1){let r=this.getGPSPropertiesNames().mapInfoJSONProperty,o="."+r,i=$(t),s=$(o);if(n.isInKO()){let t=i.closest(".form-group-edit-container");t.length&&(s=t.find(o))}else if(n.isInBatchUpdate()&&!s.length){s=$(`[data-property-name=${r}]`);let t=s.closest(".property-value").find("div.read");t.length&&t.text(JSON.stringify(e))}if(!s.length&&a){let t=$(this.getDocumentOfConFrame());t.length&&(s=t.find(`input[id*='${this.getGPSPropertiesNames().mapInfoJSONProperty}'`).parent())}this.updateInputValueInsideWrapper(s,"input",JSON.stringify(e))},updateMediaManagerCountrySelectListProperty:function(t,e,a){let r,o=this.getMediaManagerGroupMapInfoWrapper(a),n=`select[id*='${this.getGPSPropertiesNames().countrySelectProperty}']:not([type='hidden'])`;if(o.length)r=o.find(n);else{let t=$(this.getDocumentOfConFrame());t.length&&(r=t.find(n))}r.length&&r&&this.updateCountrySelectListProperty(t,e,r)},getMediaManagerGroupMapInfoWrapper:function(t){return $(t).closest("div[id*='GR_MAP_INFO']").parent()},getGPSPropertiesNames:function(){return{latLongProperty:"GMI_LAT_LONG",cityInputProperty:"GMI_CITY",countyInputProperty:"GMI_COUNTY",countrySelectProperty:"GMI_COUNTRY",mapInfoJSONProperty:"GMI_MAP_INFO_JSON",mapGroup:"GR_MAP_INFO"}},getSelectedMandatorId:function(){if(this.isBatchUpdate())return this.getBatchUpdateSelectedMandatorId();let t=n.isInKO()&&!n.isInUploadPage()?document.querySelector(".attr_mandator_cid"):document.querySelector(".MANDATOR_CID");if(t){let e=t.querySelector("select");if(e)return e.value}return-1},isBatchUpdate:function(){return n.isInBatchUpdate()||n.isInMediaManagerBatchUpdate()},isEnterKeyPressEvent:function(t){return t&&t.key&&"enter"===t.key.toLowerCase()},isMediaManagerReadOnlyField:function(t){if(!t)return!0;let e=$(t);if(e.hasClass("readonlyfield"))return!0;let a=e.closest("tr");return a.length&&a.find(".readonlyfield").length},toggleOpenMapButtonOnBatchUpdateCheckboxChange:function(t){let e=t.currentTarget.checked,a=$(t.currentTarget).closest(".property");if(a){let t=a.find(".uiGpsPointBtn");t&&t.toggleClass("hidden",!e)}},updateMediaManagerPropertiesOfTypeText:function(t,e){if(!e)return;let a=this.getMediaManagerGroupMapInfoWrapper(t),r=a;a.length||(r=$(t).closest("body"));let o=r.find(`input[id*='${this.getGPSPropertiesNames().cityInputProperty}']`),n=r.find(`input[id*='${this.getGPSPropertiesNames().countyInputProperty}']`);o&&o.val(e.city),n&&n.val(e.county)},toggleGPSButtonState:function(t){t?this.disableGPSButton():this.enableGPSButton()},disableGPSButton:function(){let t=$(".uiGpsPointBtn");t.addClass("disabled"),t.attr("disabled",!0)},enableGPSButton:function(){let t=$(".uiGpsPointBtn");t.removeClass("disabled"),t.removeAttr("disabled")},setTargetBlankOnOpenStreetMapsLink:function(t=".uiOpenStreetMapLink"){const e=$(t);e.length>0&&e.closest(".leaflet-control-attribution").find("a").attr("target","_blank")},getDefaultGeoLocationStartPoint:function(){let t={lat:48.208811,lng:16.372505};const e=i?.mapsServices?.defaultStartPoint;if(e){const a=this.getLatLongFromString(e);try{t.lat=parseFloat(a.lat),t.lng=parseFloat(a.lng)}catch(e){return t}}return t}}}.call(e,a,e,t),void 0===r||(t.exports=r)}
1}]);

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.