{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../sfcc_common/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./cartridges/app_project/cartridge/client/default/js/storeLocator.js","webpack:///./cartridges/app_project/cartridge/client/default/js/storeLocator/storeLocator.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;ACZa;;AAEb,qBAAqB,mBAAO,CAAC,oGAAW;;AAExC;AACA,iBAAiB,mBAAO,CAAC,sHAA6B;;;;AAItD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,mDAAmD,gBAAgB;AACnE;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;;AAGT;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,mDAAmD,gBAAgB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA,iD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA,yD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;;AChID;AACa;;AAEb;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,0DAA0D;AAC1D;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,+B;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA,+B;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,yB;AACA;AACA;AACA,iD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA","file":"js/storeLocator.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/app_project/cartridge/client/default/js/storeLocator.js\");\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","'use strict';\n\nvar processInclude = require('BASE/util');\n\n$(document).ready(function() {\n processInclude(require('./storeLocator/storeLocator'));\n\n\n\n async function fetchPlace(query) {\n try {\n var url = $('#StoreLocator_geocode').val() + '?query=' + query;\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n const data = await response.json();\n var places = data.data.elementi;\n\n const countries = places.map(country => ({\n name: country.geoname_desc,\n id: country.geoname_id \n }));\n\n \n return countries;\n } catch (error) {\n console.error('Error fetching countries:', error);\n return [];\n }\n }\n\nasync function fetchCofanetto(query) {\n try {\n var url = $('#GetSuggestionsStorelocator').val() + '?query=' + query;\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n const data = await response.json();\n var cofanetti = data.transforedProducts;\n const countries = cofanetti.map(cofanetto => ({\n name: cofanetto.name,\n id: cofanetto.id\n }));\n\n \n return countries;\n } catch (error) {\n console.error('Error fetching countries:', error);\n return [];\n }\n }\n\n\n accessibleAutocomplete.enhanceSelectElement({\n selectElement: document.querySelector('#location-picker'),\n placeholder: 'Digita il nome di una località...',\n defaultValue: '',\n minLength: 3,\n autoselect: false,\n displayMenu: 'overlay',\n confirmOnBlur: false,\n tStatusNoResults: () => 'Nessun risultato trovato',\n tNoResults: () => 'Nessun risultato trovato', \n source: async (query, populateResults) => {\n const results = await fetchPlace(query);\n populateResults(results.map(item => item.name));\n },\n \n onConfirm: async (selectedName) => {\n if (!selectedName) return;\n\n const nameInput = document.getElementById('selected-name');\n const valueInput = document.getElementById('selected-value');\n var selected = selectedName.split('(')[0];\n \n const results = await fetchPlace(selected); \n const selectedCountry = results.find(country => country.name === selectedName);\n\n if (selectedCountry) {\n nameInput.value = selectedCountry.name;\n valueInput.value = selectedCountry.id;\n document.getElementById(\"location-picker__listbox\").innerHTML = \"\";\n }\n }\n })\n\n accessibleAutocomplete.enhanceSelectElement({\n selectElement: document.querySelector('#confanetto-picker'),\n placeholder: 'Ricerca (parole chiave, ecc.)',\n defaultValue: '',\n minLength: 3,\n autoselect: false,\n displayMenu: 'overlay',\n confirmOnBlur: false,\n tStatusNoResults: () => 'Nessun risultato trovato',\n tNoResults: () => 'Nessun risultato trovato', \n source: async (query, populateResults) => {\n const results = await fetchCofanetto(query);\n populateResults(results.map(item => item.name));\n },\n \n onConfirm: async (selectedName) => {\n if (!selectedName) return;\n\n const nameInput = document.getElementById('cofanetto-selected-name');\n const valueInput = document.getElementById('cofanetto-selected-value');\n const results = await fetchCofanetto(selectedName); \n const selectedCountry = results.find(country => country.name === selectedName);\n\n if (selectedCountry) {\n nameInput.value = selectedCountry.name;\n valueInput.value = selectedCountry.value;\n valueInput.value = selectedCountry.id;\n }\n }\n })\n});\n","/* globals google */\n'use strict';\n\n/**\n * appends params to a url\n * @param {string} url - Original url\n * @param {Object} params - Parameters to append\n * @returns {string} result url with appended parameters\n */\nfunction appendToUrl(url, params) {\n var newUrl = url;\n newUrl +=\n (newUrl.indexOf('?') !== -1 ? '&' : '?') +\n Object.keys(params)\n .map(function(key) {\n return key + '=' + encodeURIComponent(params[key]);\n })\n .join('&');\n\n return newUrl;\n}\n\n/**\n * Uses google maps api to render a map\n */\nfunction maps() {\n var map;\n var infowindow = new google.maps.InfoWindow();\n\n // Init Rome in the center of the viewport\n var latlng = new google.maps.LatLng(41.902782, 12.496366);\n var mapOptions = {\n scrollwheel: false,\n zoom: 4,\n center: latlng,\n maxZoom: 18\n };\n\n map = new google.maps.Map($('.map-canvas')[0], mapOptions);\n var mapdiv = $('.map-canvas').attr('data-locations');\n\n mapdiv = JSON.parse(mapdiv);\n\n var bounds = new google.maps.LatLngBounds();\n\n // Customized google map marker icon with svg format\n var markerImg = {\n path:\n 'M13.5,30.1460153 L16.8554555,25.5 L20.0024287,25.5 C23.039087,25.5 25.5,' +\n '23.0388955 25.5,20.0024287 L25.5,5.99757128 C25.5,2.96091298 23.0388955,0.5 ' +\n '20.0024287,0.5 L5.99757128,0.5 C2.96091298,0.5 0.5,2.96110446 0.5,5.99757128 ' +\n 'L0.5,20.0024287 C0.5,23.039087 2.96110446,25.5 5.99757128,25.5 L10.1445445,' +\n '25.5 L13.5,30.1460153 Z',\n fillColor: '#bc260b',\n fillOpacity: 1,\n scale: 1.1,\n strokeColor: 'white',\n strokeWeight: 1,\n anchor: new google.maps.Point(13, 30),\n labelOrigin: new google.maps.Point(12, 12)\n };\n\n Object.keys(mapdiv).forEach(function(key) {\n var item = mapdiv[key];\n var lable = parseInt(key, 10) + 1;\n var storeLocation = new google.maps.LatLng(item.latitude, item.longitude);\n var flag = false;\n if (item.infoWindowHtml && item.infoWindowHtml.includes('gold-button-storelocator')) {\n flag = true;\n item.infoWindowHtml = item.infoWindowHtml.replace(\n /