@road-labs/map-sdk 0.0.19-rc.0 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ Check the top-level render call using <`+M+">.")}return I}}function Zn(d,I){{if(
|
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,tn,Ye,mo,Ye),Xn[Ye+tn]=!0}}return d===r?lo(Ce):co(Ce),Ce}}function uo(d,I,M){return Qn(d,I,M,!0)}function fo(d,I,M){return Qn(d,I,M,!1)}var po=fo,ho=uo;lt.Fragment=r,lt.jsx=po,lt.jsxs=ho})()),lt}var nr;function Eo(){return nr||(nr=1,process.env.NODE_ENV==="production"?Et.exports=_o():Et.exports=Co()),Et.exports}var a=Eo(),et={},rr;function yo(){if(rr)return et;rr=1;var e=it;if(process.env.NODE_ENV==="production")et.createRoot=e.createRoot,et.hydrateRoot=e.hydrateRoot;else{var n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;et.createRoot=function(i,r){n.usingClientEntryPoint=!0;try{return e.createRoot(i,r)}finally{n.usingClientEntryPoint=!1}},et.hydrateRoot=function(i,r,o){n.usingClientEntryPoint=!0;try{return e.hydrateRoot(i,r,o)}finally{n.usingClientEntryPoint=!1}}}return et}var To=yo();const xo="app-module_container",bo="app-module_loader",ir={container:xo,loader:bo};function Io(e){const[n,i]=m.useState(!1),r=m.useMemo(()=>new IntersectionObserver(([o])=>{o.isIntersecting&&(i(!0),r.disconnect())}),[e]);return m.useEffect(()=>{if(e.current)return r.observe(e.current),()=>r.disconnect()},[e.current]),n}function wo(e){const n=e;return["nl","nl-be","nl-nl"].includes(n)?"nl":["en","en-us","en-eg","en-au","en-gb","en-ca","en-nz","en-ie","en-za","en-jm","en-bz","en-tt"].includes(n)?"en":["de","de-ch","de-at","de-lu","de-li","de-de"].includes(n)?"de":["fr","fr-be","fr-ca","fr-fr","fr-lu","fr-ch"].includes(n)?"fr":["it","it-ch","it-it"].includes(n)?"it":["es","es-ar","es-bo","es-cl","es-co","es-cr","es-do","es-ec","es-sv","es-gt","es-hn","es-mx","es-ni","es-pa","es-py","es-pe","es-pr","es-es","es-uy","es-ve"].includes(n)?"es":"en"}const No={"search.placeholder":"Enter a location...","cdrPrice.flatFee":"additional fee {{total}} / session","tariffPriceComponent.dynamicTariffHeader":"Dynamic Tariff - {{date}}","tariffPriceComponent.flat":"{{total}} / session","tariffPriceComponent.time":"{{total}} / hour","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / hour idle fee","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. wait time before idle fee","tariffPriceComponent.noTariff":"No tariff available","tariffPriceComponent.baseTariff":"Base Tariff","tariffPriceComponent.active":"Active now","filters.header":"Filters","filters.dcChargers":"Fast Chargers","filters.efluxChargers":"E-Flux Chargers","filters.noAdditionalFee":"Without additional fee per session","filters.available":"Available","filters.charging":"Charging","filters.notAvailable":"Not Available","filters.chargingPower":"Charging Power [kW]","filters.connectorType":"Connector Type","filters.apply":"Apply Filters","filters.clearAll":"Clear All Filters","filters.onlyShow":"Only Show","filters.statusHeading":"Status","evse.statusAvailable":"Available","evse.statusCharging":"Charging","evse.statusUnavailable":"Unavailable","evse.statusRemoved":"Removed","evse.statusPlanned":"Planned","evse.statusReserved":"Reserved","evse.statusInoperative":"Inoperative","evse.statusOutOfOrder":"Out of Order","evse.statusError":"Error","evse.statusUnknown":"Unknown","locationType.onStreet":"On Street","locationType.parkingGarage":"Parking Garage","locationType.undergroundGarage":"Underground Garage","locationType.parkingLot":"Parking Lot","locationType.other":"Other","locationType.unknown":"Unknown","tariffPriceComponent.viewTariff":"View Tariff notes","tariffNote.subHeader":"Tariff notes","tariffNote.eFluxScheduledTariffNote":"A scheduled tariff overrides base tariff prices for specific time period.","tariffNote.dynamicScheduledTariffNote":"Dynamic price is adjusted automatically based on energy market price (1 hour interval).","tariffNote.scheduledTariffNote":"A scheduled tariff overrides base tariff prices for specific time period.","tariffNote.baseTariffNote":"Tariffs shown here have been sent to E-Flux by roaming partner. Accuracy may vary depending on provider.","evse.pricing":"Pricing","dynamicTariffs.subHeader":"Hourly Prices","location.viewAllHourlyPrices":"View All Hourly Prices","backButton.backTo":"Back To"},Oo={"search.placeholder":"Voer een locatie in...","cdrPrice.flatFee":"Extra vergoeding {{total}} / sessie","tariffPriceComponent.dynamicTariffHeader":"Dynamisch Tarief - {{date}}","tariffPriceComponent.flat":"{{total}} / sessie","tariffPriceComponent.time":"{{total}} / uur","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / uur blokkeertarief","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. wachttijd voor blokkeertarief","tariffPriceComponent.noTariff":"Geen beschikbaar tarief","tariffPriceComponent.baseTariff":"Basistarief","tariffPriceComponent.active":"Nu actief","filters.header":"Filters","filters.dcChargers":"DC-laders","filters.efluxChargers":"E-Flux-laders","filters.noAdditionalFee":"Zonder extra kosten per sessie","filters.available":"Beschikbaar","filters.charging":"Laden","filters.notAvailable":"Niet beschikbaar","filters.chargingPower":"Laadvermogen [kW]","filters.connectorType":"Aansluitingstype","filters.apply":"Filters toepassen","filters.clearAll":"Alle filters wissen","filters.onlyShow":"Alleen tonen","filters.statusHeading":"Status","evse.statusAvailable":"Beschikbaar","evse.statusCharging":"Laden","evse.statusUnavailable":"Niet beschikbaar","evse.statusError":"Fout","evse.statusRemoved":"Verwijderd","evse.statusPlanned":"Gepland","evse.statusReserved":"Gereserveerd","evse.statusInoperative":"Inoperative","evse.statusOutOfOrder":"Uit van orde","evse.statusUnknown":"Onbekend","locationType.onStreet":"Op straat","locationType.parkingGarage":"Parkeergarage","locationType.undergroundGarage":"Ondergrondse garage","locationType.parkingLot":"Parkeerterrein","locationType.other":"Anders","locationType.unknown":"Onbekend","tariffPriceComponent.viewTariff":"Tariefnotitie bekijken","tariffNote.subHeader":"Tariefnotities","tariffNote.eFluxScheduledTariffNote":"Een gepland tarief overschrijft de basis tariefprijzen voor een specifieke periode.","tariffNote.dynamicScheduledTariffNote":"De dynamische prijs wordt automatisch aangepast op basis van de energiemarktprijs (interval van 1 uur).","tariffNote.scheduledTariffNote":"Een gepland tarief overschrijft de basis tariefprijzen voor een specifieke periode.","tariffNote.baseTariffNote":"De hier getoonde tarieven zijn door de roamingpartner aan E-Flux verstrekt. De nauwkeurigheid kan variëren afhankelijk van de aanbieder.","evse.pricing":"Tarieven","dynamicTariffs.subHeader":"Uurtarieven","location.viewAllHourlyPrices":"Bekijk Alle Uurprijzen","backButton.backTo":"Terug Naar"},So={"search.placeholder":"Geben Sie einen Ort ein...","cdrPrice.flatFee":"Zusätzliche Gebühr {{total}} / Sitzung","tariffPriceComponent.dynamicTariffHeader":"Dynamischer Tarif - {{date}}","tariffPriceComponent.flat":"{{total}} / Sitzung","tariffPriceComponent.time":"{{total}} / Stunde","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / Stunde Blockiergebühr","tariffPriceComponent.parkingTimeWait":"{{minutes}} Min. Wartezeit vor der Blockiergebühr","tariffPriceComponent.noTariff":"Kein Tarif verfügbar","tariffPriceComponent.baseTariff":"Grundtarif","tariffPriceComponent.active":"Aktuell aktiv","filters.header":"Filter","filters.dcChargers":"Gleichstrom-Ladegeräte","filters.efluxChargers":"E-Flux-Ladegeräte","filters.noAdditionalFee":"Ohne zusätzliche Gebühr pro Sitzung","filters.available":"Verfügbar","filters.charging":"Lädt","filters.notAvailable":"Nicht verfügbar","filters.chargingPower":"Ladeleistung [kW]","filters.connectorType":"Steckertyp","filters.apply":"Filter anwenden","filters.clearAll":"Alle Filter löschen","filters.onlyShow":"Nur anzeigen","filters.statusHeading":"Status","evse.statusAvailable":"Verfügbar","evse.statusCharging":"Lädt","evse.statusUnavailable":"Nicht verfügbar","evse.statusRemoved":"Entfernt","evse.statusPlanned":"Geplant","evse.statusReserved":"Reserviert","evse.statusInoperative":"Inoperative","evse.statusOutOfOrder":"Ausgeschaltet","evse.statusError":"Fehler","evse.statusUnknown":"Unbekannt","evse.pricing":"Preisbildung","locationType.onStreet":"Straße","locationType.parkingGarage":"Parkhaus","locationType.undergroundGarage":"Tiefgarage","locationType.parkingLot":"Parkplatz","locationType.other":"Andere","locationType.unknown":"Unbekannt","tariffPriceComponent.viewTariff":"Tarif anzeigen","tariffNote.subHeader":"Tarifhinweise","tariffNote.eFluxScheduledTariffNote":"Ein geplanter Tarif überschreibt die Basistarifpreise für einen bestimmten Zeitraum.","tariffNote.dynamicScheduledTariffNote":"Der dynamische Preis wird automatisch basierend auf dem Energiepreis auf dem Markt angepasst (im Intervall von 1 Stunde).","tariffNote.scheduledTariffNote":"Ein geplanter Tarif überschreibt die Basistarifpreise für einen bestimmten Zeitraum.","tariffNote.baseTariffNote":"Die hier angezeigten Tarife wurden von einem Roaming-Partner an E-Flux gesendet. Die Genauigkeit kann je nach Anbieter variieren.","dynamicTariffs.subHeader":"Stundentarife","location.viewAllHourlyPrices":"Alle Stundenpreise anzeigen","backButton.backTo":"Zurück zu"},Ro={"search.placeholder":"Entrez un lieu...","cdrPrice.flatFee":"Frais supplémentaires {{total}} / session","tariffPriceComponent.dynamicTariffHeader":"Tarif Dynamique - {{date}}","tariffPriceComponent.flat":"{{total}} / session","tariffPriceComponent.time":"{{total}} / heure","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / frais d'occupation par heure","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. avant frais d'occupation","tariffPriceComponent.noTariff":"Aucun tarif disponible","tariffPriceComponent.baseTariff":"Tarif de base","tariffPriceComponent.active":"Actuellement actif","filters.header":"Filtres","filters.dcChargers":"Chargeurs à courant continu","filters.efluxChargers":"Chargeurs E-Flux","filters.noAdditionalFee":"Sans frais supplémentaires par séance","filters.available":"Disponible","filters.charging":"En charge","filters.notAvailable":"Indisponible","filters.chargingPower":"Puissance de charge [kW]","filters.connectorType":"Type de connecteur","filters.apply":"Appliquer les filtres","filters.clearAll":"Effacer tous les filtres","filters.onlyShow":"Afficher uniquement","filters.statusHeading":"Statut","evse.statusAvailable":"Disponible","evse.statusCharging":"En charge","evse.statusUnavailable":"Indisponible","evse.statusRemoved":"Supprimé","evse.statusPlanned":"Planifié","evse.statusReserved":"Réservé","evse.statusInoperative":"Hors service","evse.statusOutOfOrder":"En panne","evse.statusError":"Erreur","evse.statusUnknown":"Inconnu","evse.pricing":"Tarification","locationType.onStreet":"Dans la rue","locationType.parkingGarage":"Parking couvert","locationType.undergroundGarage":"Parking souterrain","locationType.parkingLot":"Parking","locationType.other":"Autre","locationType.unknown":"Inconnu","tariffPriceComponent.viewTariff":"Voir le tarif","tariffNote.subHeader":"Notes tarifaires","tariffNote.eFluxScheduledTariffNote":"Un tarif programmé remplace les prix de base du tarif pour une période spécifique.","tariffNote.dynamicScheduledTariffNote":"Le prix dynamique est ajusté automatiquement en fonction du prix du marché de l'énergie (intervalle d'une heure).","tariffNote.scheduledTariffNote":"Un tarif programmé remplace les prix de base du tarif pour une période spécifique.","tariffNote.baseTariffNote":"Les tarifs affichés ici ont été transmis à E-Flux par le partenaire d'itinérance. La précision peut varier en fonction du fournisseur.","dynamicTariffs.subHeader":"Tarifs horaires","location.viewAllHourlyPrices":"Voir tous les tarifs horaires","backButton.backTo":"Retour à"},Do={"search.placeholder":"Inserisci una posizione...","cdrPrice.flatFee":"Costo aggiuntivo {{total}} / sessione","tariffPriceComponent.dynamicTariffHeader":"Tariffa dinamica - {{date}}","tariffPriceComponent.flat":"{{total}} / sessione","tariffPriceComponent.time":"{{total}} / ora","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / ora tariffa di inattività","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. tempo di attesa prima della tariffa di inattività","tariffPriceComponent.noTariff":"Nessuna tariffa disponibile","tariffPriceComponent.baseTariff":"Tariffa base","tariffPriceComponent.active":"Attivo ora","filters.header":"Filtri","filters.dcChargers":"Caricabatterie DC","filters.efluxChargers":"Caricabatterie E-Flux","filters.noAdditionalFee":"Senza costi aggiuntivi per sessione","filters.available":"Disponibile","filters.charging":"In carica","filters.notAvailable":"Non disponibile","filters.chargingPower":"Potenza di ricarica [kW]","filters.connectorType":"Tipo di connettore","filters.apply":"Applica filtri","filters.clearAll":"Cancella tutti i filtri","filters.onlyShow":"Mostra solo","filters.statusHeading":"Stato","evse.statusAvailable":"Disponibile","evse.statusCharging":"In carica","evse.statusUnavailable":"Non disponibile","evse.statusRemoved":"Rimossa","evse.statusPlanned":"Pianificata","evse.statusReserved":"Réservé","evse.statusInoperative":"Inoperativo","evse.statusOutOfOrder":"Fuori servizio","evse.statusError":"Errore","evse.statusUnknown":"Sconosciuto","locationType.onStreet":"In strada","locationType.parkingGarage":"Garage per il parcheggio","locationType.undergroundGarage":"Garage sotterraneo","locationType.parkingLot":"Parcheggio","locationType.other":"Altro","locationType.unknown":"Sconosciuto","tariffPriceComponent.viewTariff":"Visualizza note tariffarie","tariffNote.subHeader":"Note tariffarie","tariffNote.eFluxScheduledTariffNote":"Una tariffa programmata sostituisce i prezzi della tariffa base per un periodo di tempo specifico.","tariffNote.dynamicScheduledTariffNote":"Il prezzo dinamico si regola automaticamente in base al prezzo del mercato dell'energia (intervallo di 1 ora).","tariffNote.scheduledTariffNote":"Una tariffa programmata sostituisce i prezzi della tariffa base per un periodo di tempo specifico.","tariffNote.baseTariffNote":"Le tariffe mostrate qui sono state inviate a E-Flux dal partner di roaming. L'accuratezza può variare a seconda del fornitore.","evse.pricing":"Prezzi","dynamicTariffs.subHeader":"Prezzi orari","location.viewAllHourlyPrices":"Visualizza tutti i prezzi orari","backButton.backTo":"Torna a"},Po={"search.placeholder":"Ingrese una ubicación...","cdrPrice.flatFee":"Tarifa adicional {{total}} / sesión","tariffPriceComponent.dynamicTariffHeader":"Tarifa Dinámica - {{date}}","tariffPriceComponent.flat":"{{total}} / sesión","tariffPriceComponent.time":"{{total}} / hora","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / hora tarifa de inactividad","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. tiempo de espera antes de la tarifa de inactividad","tariffPriceComponent.noTariff":"Tarifa no disponible","tariffPriceComponent.baseTariff":"Tarifa Base","tariffPriceComponent.active":"Activo ahora","filters.header":"Filtros","filters.dcChargers":"Cargadores DC","filters.efluxChargers":"Cargadores E-Flux","filters.noAdditionalFee":"Sin tarifa adicional por sesión","filters.available":"Disponible","filters.charging":"Cargando","filters.notAvailable":"No Disponible","filters.chargingPower":"Potencia de Carga [kW]","filters.connectorType":"Tipo de Conector","filters.apply":"Aplicar Filtros","filters.clearAll":"Limpiar Todos los Filtros","filters.onlyShow":"Mostrar Solo","evse.statusRemoved":"Eliminado","evse.statusPlanned":"Planificado","evse.statusReserved":"Reservado","evse.statusInoperative":"Fuera de servicio","evse.statusOutOfOrder":"Averiado","filters.statusHeading":"Estado","evse.statusAvailable":"Disponible","evse.statusCharging":"Cargando","evse.statusUnavailable":"No Disponible","evse.statusError":"Error","evse.statusUnknown":"Desconocido","locationType.onStreet":"En la calle","locationType.parkingGarage":"Garaje para Estacionar","locationType.undergroundGarage":"Garaje Subterráneo","locationType.parkingLot":"Estacionamiento","locationType.other":"Otro","locationType.unknown":"Desconocido","tariffPriceComponent.viewTariff":"Ver notas de tarifas","tariffNote.subHeader":"Notas de Tarifas","tariffNote.eFluxScheduledTariffNote":"Una tarifa programada anula los precios de la tarifa base para un período de tiempo específico.","tariffNote.dynamicScheduledTariffNote":"El precio dinámico se ajusta automáticamente según el precio del mercado de la energía (intervalo de 1 hora).","tariffNote.scheduledTariffNote":"Una tarifa programada anula los precios de la tarifa base para un período de tiempo específico.","tariffNote.baseTariffNote":"Las tarifas mostradas aquí han sido enviadas a E-Flux por el socio de roaming. La precisión puede variar según el proveedor.","evse.pricing":"Precios","dynamicTariffs.subHeader":"Precios por Hora","location.viewAllHourlyPrices":"Ver Todos los Precios por Hora","backButton.backTo":"Volver a"},Ao={en:No,nl:Oo,de:So,fr:Ro,it:Do,es:Po};async function Yt(e,n){try{const i=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...n.version&&{version:n.version},...n.authorization&&n.version==="v2"&&{Authorization:`Bearer ${n.authorization}`}},...n});switch(i.status){case 200:return i.json();case 400:throw new Error("Bad request");case 404:throw new Error("Not Found");case 500:throw new Error("Server Error");case 503:throw new Error("Timeout!");default:throw new Error(`Unexpected status: ${i.status}`)}}catch(i){if(i instanceof DOMException)return null;throw i}}async function Mo(e,n,i,r,{precision:o,bbox:t,...s}){return Yt(`${e}/1/map/search`,{method:"POST",version:n,authorization:i,body:JSON.stringify({gridPrecision:o,bbox:t,...r?.length>0&&{locationIds:r},...s,...s?.operatorOnly?{operator:[s.operatorOnly]}:{}})})}async function ko(e,n,i,{origin:r,ids:o}){return Yt(`${e}/1/map/tariff`,{method:"POST",version:n,authorization:i,body:JSON.stringify({connection_id:r.connectionId,country_code:r.countryCode,party_id:r.partyId,tariff_ids:o})})}async function jo(e,n,i,{ids:r,status:o}){return Yt(`${e}/1/map/locations`,{method:"POST",version:n,authorization:i,body:JSON.stringify({ids:r,...n==="v2"?{status:o}:{}})})}async function Lo(e,n,i){return(await Yt(`${e}/1/map/config`,{version:n,authorization:i}))?.data}const En=m.createContext({isReady:!1,setPlace:()=>{},t:e=>`Translate ${e}`,language:"en"}),Vo=({children:e,...n})=>{const[i,r]=m.useState(n.options),[o,t]=m.useState({preferredOperators:n.options.preferredOperators,showOperatorOnly:n.options.showOperatorOnly,showNoAdditionalFeeFilter:n.options.showNoAdditionalFeeFilter,showPublishingModeFilter:n.options.showPublishingModeFilter}),[s,c]=m.useState(),[l,u]=m.useState(),[f,p]=m.useState(n.options.position),[h,x]=m.useState({}),[w,N]=m.useState([n.options.locationId].filter(Boolean)),[E,k]=m.useState([]),[C,y]=m.useState({type:"success"}),[T,g]=m.useState(!1),P=window.location.search.includes("debug=true");P&&console.log("map-context options",n.options);const J=m.useMemo(()=>wo(n.options.language||"en"),[n.options.language]),F=m.useMemo(()=>(A,v)=>Ao[J][A].replace(/\{\{(\w+)\}\}/g,(b,H)=>v[H]),[J]),Q=n.options?.apiRoot||"https://api.road.io";let B=n.options.version,W=n.options.authorization;const te=window.location.search.split("map_key=")[1];te&&(W=te,B="v2");const D=Mo.bind(null,Q,B,W,n.options.limitToLocationIds||[]),R=jo.bind(null,Q,B,W),re=ko.bind(null,Q,B,W);async function ne({ids:A,status:v}){y({type:"loading"});try{const{data:b}=await R({ids:A,...B==="v2"?{status:v}:{}});return k(b.filter(H=>H?.evses?.length)),y({type:"success"}),b}catch(b){y({type:"error",error:b})}}m.useEffect(()=>{n.options.locationId&&ne({ids:[n.options.locationId],status:h.status}).then(A=>{if(A?.length){const v=A[0];v.geoLocation?.coordinates&&p({lng:v.geoLocation?.coordinates[0],lat:v.geoLocation?.coordinates[1]})}})},[n.options.locationId]),m.useEffect(()=>{Lo(Q,B,W).then(A=>{P&&console.log("retrieved remote config",A),t({...A,...o}),r({googleApiKey:A.googleMapsApiKey,...i,...A}),!i.locationId&&!i?.position?.lat&&A.ipLatitude?(P&&console.debug("setting position from ip latitude and longitude"),p({lat:A.ipLatitude,lng:A.ipLongitude})):i.locationId||(P&&console.debug("setting position from options position"),p(i?.position?.lat?i.position:{lat:52.3676,lng:4.9041}))}).catch(A=>c(A))},[]),m.useEffect(()=>{w?.length&&ne({ids:w,status:h.status})},[w]),m.useEffect(()=>{const{theming:A,shadowRoot:v}=n.options;if(v){const b=v.querySelectorAll("#road-map-styles")[0]||document.createElement("style");b.setAttribute("type","text/css"),b.setAttribute("id","road-map-styles"),b.innerHTML=`
|
|
30
|
+
<%s key={someKey} {...props} />`,tn,Ye,mo,Ye),Xn[Ye+tn]=!0}}return d===r?lo(Ce):co(Ce),Ce}}function uo(d,I,M){return Qn(d,I,M,!0)}function fo(d,I,M){return Qn(d,I,M,!1)}var po=fo,ho=uo;lt.Fragment=r,lt.jsx=po,lt.jsxs=ho})()),lt}var nr;function Eo(){return nr||(nr=1,process.env.NODE_ENV==="production"?Et.exports=_o():Et.exports=Co()),Et.exports}var a=Eo(),et={},rr;function yo(){if(rr)return et;rr=1;var e=it;if(process.env.NODE_ENV==="production")et.createRoot=e.createRoot,et.hydrateRoot=e.hydrateRoot;else{var n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;et.createRoot=function(i,r){n.usingClientEntryPoint=!0;try{return e.createRoot(i,r)}finally{n.usingClientEntryPoint=!1}},et.hydrateRoot=function(i,r,o){n.usingClientEntryPoint=!0;try{return e.hydrateRoot(i,r,o)}finally{n.usingClientEntryPoint=!1}}}return et}var To=yo();const xo="app-module_container",bo="app-module_loader",ir={container:xo,loader:bo};function Io(e){const[n,i]=m.useState(!1),r=m.useMemo(()=>new IntersectionObserver(([o])=>{o.isIntersecting&&(i(!0),r.disconnect())}),[e]);return m.useEffect(()=>{if(e.current)return r.observe(e.current),()=>r.disconnect()},[e.current]),n}function wo(e){const n=e;return["nl","nl-be","nl-nl"].includes(n)?"nl":["en","en-us","en-eg","en-au","en-gb","en-ca","en-nz","en-ie","en-za","en-jm","en-bz","en-tt"].includes(n)?"en":["de","de-ch","de-at","de-lu","de-li","de-de"].includes(n)?"de":["fr","fr-be","fr-ca","fr-fr","fr-lu","fr-ch"].includes(n)?"fr":["it","it-ch","it-it"].includes(n)?"it":["es","es-ar","es-bo","es-cl","es-co","es-cr","es-do","es-ec","es-sv","es-gt","es-hn","es-mx","es-ni","es-pa","es-py","es-pe","es-pr","es-es","es-uy","es-ve"].includes(n)?"es":"en"}const No={"search.placeholder":"Enter a location...","cdrPrice.flatFee":"additional fee {{total}} / session","tariffPriceComponent.dynamicTariffHeader":"Dynamic Tariff - {{date}}","tariffPriceComponent.flat":"{{total}} / session","tariffPriceComponent.time":"{{total}} / hour","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / hour idle fee","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. wait time before idle fee","tariffPriceComponent.noTariff":"No tariff available","tariffPriceComponent.baseTariff":"Base Tariff","tariffPriceComponent.active":"Active now","filters.header":"Filters","filters.dcChargers":"Fast Chargers","filters.efluxChargers":"E-Flux Chargers","filters.noAdditionalFee":"Without additional fee per session","filters.available":"Available","filters.charging":"Charging","filters.notAvailable":"Not Available","filters.chargingPower":"Charging Power [kW]","filters.connectorType":"Connector Type","filters.apply":"Apply Filters","filters.clearAll":"Clear All Filters","filters.onlyShow":"Only Show","filters.statusHeading":"Status","evse.statusAvailable":"Available","evse.statusCharging":"Charging","evse.statusUnavailable":"Unavailable","evse.statusRemoved":"Removed","evse.statusPlanned":"Planned","evse.statusReserved":"Reserved","evse.statusInoperative":"Inoperative","evse.statusOutOfOrder":"Out of Order","evse.statusError":"Error","evse.statusUnknown":"Unknown","locationType.onStreet":"On Street","locationType.parkingGarage":"Parking Garage","locationType.undergroundGarage":"Underground Garage","locationType.parkingLot":"Parking Lot","locationType.other":"Other","locationType.unknown":"Unknown","tariffPriceComponent.viewTariff":"View Tariff notes","tariffNote.subHeader":"Tariff notes","tariffNote.eFluxScheduledTariffNote":"A scheduled tariff overrides base tariff prices for specific time period.","tariffNote.dynamicScheduledTariffNote":"Dynamic price is adjusted automatically based on energy market price (1 hour interval).","tariffNote.scheduledTariffNote":"A scheduled tariff overrides base tariff prices for specific time period.","tariffNote.baseTariffNote":"Tariffs shown here have been sent to E-Flux by roaming partner. Accuracy may vary depending on provider.","evse.pricing":"Pricing","dynamicTariffs.subHeader":"Hourly Prices","location.viewAllHourlyPrices":"View All Hourly Prices","backButton.backTo":"Back To"},Oo={"search.placeholder":"Voer een locatie in...","cdrPrice.flatFee":"Extra vergoeding {{total}} / sessie","tariffPriceComponent.dynamicTariffHeader":"Dynamisch Tarief - {{date}}","tariffPriceComponent.flat":"{{total}} / sessie","tariffPriceComponent.time":"{{total}} / uur","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / uur blokkeertarief","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. wachttijd voor blokkeertarief","tariffPriceComponent.noTariff":"Geen beschikbaar tarief","tariffPriceComponent.baseTariff":"Basistarief","tariffPriceComponent.active":"Nu actief","filters.header":"Filters","filters.dcChargers":"DC-laders","filters.efluxChargers":"E-Flux-laders","filters.noAdditionalFee":"Zonder extra kosten per sessie","filters.available":"Beschikbaar","filters.charging":"Laden","filters.notAvailable":"Niet beschikbaar","filters.chargingPower":"Laadvermogen [kW]","filters.connectorType":"Aansluitingstype","filters.apply":"Filters toepassen","filters.clearAll":"Alle filters wissen","filters.onlyShow":"Alleen tonen","filters.statusHeading":"Status","evse.statusAvailable":"Beschikbaar","evse.statusCharging":"Laden","evse.statusUnavailable":"Niet beschikbaar","evse.statusError":"Fout","evse.statusRemoved":"Verwijderd","evse.statusPlanned":"Gepland","evse.statusReserved":"Gereserveerd","evse.statusInoperative":"Inoperative","evse.statusOutOfOrder":"Uit van orde","evse.statusUnknown":"Onbekend","locationType.onStreet":"Op straat","locationType.parkingGarage":"Parkeergarage","locationType.undergroundGarage":"Ondergrondse garage","locationType.parkingLot":"Parkeerterrein","locationType.other":"Anders","locationType.unknown":"Onbekend","tariffPriceComponent.viewTariff":"Tariefnotitie bekijken","tariffNote.subHeader":"Tariefnotities","tariffNote.eFluxScheduledTariffNote":"Een gepland tarief overschrijft de basis tariefprijzen voor een specifieke periode.","tariffNote.dynamicScheduledTariffNote":"De dynamische prijs wordt automatisch aangepast op basis van de energiemarktprijs (interval van 1 uur).","tariffNote.scheduledTariffNote":"Een gepland tarief overschrijft de basis tariefprijzen voor een specifieke periode.","tariffNote.baseTariffNote":"De hier getoonde tarieven zijn door de roamingpartner aan E-Flux verstrekt. De nauwkeurigheid kan variëren afhankelijk van de aanbieder.","evse.pricing":"Tarieven","dynamicTariffs.subHeader":"Uurtarieven","location.viewAllHourlyPrices":"Bekijk Alle Uurprijzen","backButton.backTo":"Terug Naar"},So={"search.placeholder":"Geben Sie einen Ort ein...","cdrPrice.flatFee":"Zusätzliche Gebühr {{total}} / Sitzung","tariffPriceComponent.dynamicTariffHeader":"Dynamischer Tarif - {{date}}","tariffPriceComponent.flat":"{{total}} / Sitzung","tariffPriceComponent.time":"{{total}} / Stunde","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / Stunde Blockiergebühr","tariffPriceComponent.parkingTimeWait":"{{minutes}} Min. Wartezeit vor der Blockiergebühr","tariffPriceComponent.noTariff":"Kein Tarif verfügbar","tariffPriceComponent.baseTariff":"Grundtarif","tariffPriceComponent.active":"Aktuell aktiv","filters.header":"Filter","filters.dcChargers":"Gleichstrom-Ladegeräte","filters.efluxChargers":"E-Flux-Ladegeräte","filters.noAdditionalFee":"Ohne zusätzliche Gebühr pro Sitzung","filters.available":"Verfügbar","filters.charging":"Lädt","filters.notAvailable":"Nicht verfügbar","filters.chargingPower":"Ladeleistung [kW]","filters.connectorType":"Steckertyp","filters.apply":"Filter anwenden","filters.clearAll":"Alle Filter löschen","filters.onlyShow":"Nur anzeigen","filters.statusHeading":"Status","evse.statusAvailable":"Verfügbar","evse.statusCharging":"Lädt","evse.statusUnavailable":"Nicht verfügbar","evse.statusRemoved":"Entfernt","evse.statusPlanned":"Geplant","evse.statusReserved":"Reserviert","evse.statusInoperative":"Inoperative","evse.statusOutOfOrder":"Ausgeschaltet","evse.statusError":"Fehler","evse.statusUnknown":"Unbekannt","evse.pricing":"Preisbildung","locationType.onStreet":"Straße","locationType.parkingGarage":"Parkhaus","locationType.undergroundGarage":"Tiefgarage","locationType.parkingLot":"Parkplatz","locationType.other":"Andere","locationType.unknown":"Unbekannt","tariffPriceComponent.viewTariff":"Tarif anzeigen","tariffNote.subHeader":"Tarifhinweise","tariffNote.eFluxScheduledTariffNote":"Ein geplanter Tarif überschreibt die Basistarifpreise für einen bestimmten Zeitraum.","tariffNote.dynamicScheduledTariffNote":"Der dynamische Preis wird automatisch basierend auf dem Energiepreis auf dem Markt angepasst (im Intervall von 1 Stunde).","tariffNote.scheduledTariffNote":"Ein geplanter Tarif überschreibt die Basistarifpreise für einen bestimmten Zeitraum.","tariffNote.baseTariffNote":"Die hier angezeigten Tarife wurden von einem Roaming-Partner an E-Flux gesendet. Die Genauigkeit kann je nach Anbieter variieren.","dynamicTariffs.subHeader":"Stundentarife","location.viewAllHourlyPrices":"Alle Stundenpreise anzeigen","backButton.backTo":"Zurück zu"},Ro={"search.placeholder":"Entrez un lieu...","cdrPrice.flatFee":"Frais supplémentaires {{total}} / session","tariffPriceComponent.dynamicTariffHeader":"Tarif Dynamique - {{date}}","tariffPriceComponent.flat":"{{total}} / session","tariffPriceComponent.time":"{{total}} / heure","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / frais d'occupation par heure","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. avant frais d'occupation","tariffPriceComponent.noTariff":"Aucun tarif disponible","tariffPriceComponent.baseTariff":"Tarif de base","tariffPriceComponent.active":"Actuellement actif","filters.header":"Filtres","filters.dcChargers":"Chargeurs à courant continu","filters.efluxChargers":"Chargeurs E-Flux","filters.noAdditionalFee":"Sans frais supplémentaires par séance","filters.available":"Disponible","filters.charging":"En charge","filters.notAvailable":"Indisponible","filters.chargingPower":"Puissance de charge [kW]","filters.connectorType":"Type de connecteur","filters.apply":"Appliquer les filtres","filters.clearAll":"Effacer tous les filtres","filters.onlyShow":"Afficher uniquement","filters.statusHeading":"Statut","evse.statusAvailable":"Disponible","evse.statusCharging":"En charge","evse.statusUnavailable":"Indisponible","evse.statusRemoved":"Supprimé","evse.statusPlanned":"Planifié","evse.statusReserved":"Réservé","evse.statusInoperative":"Hors service","evse.statusOutOfOrder":"En panne","evse.statusError":"Erreur","evse.statusUnknown":"Inconnu","evse.pricing":"Tarification","locationType.onStreet":"Dans la rue","locationType.parkingGarage":"Parking couvert","locationType.undergroundGarage":"Parking souterrain","locationType.parkingLot":"Parking","locationType.other":"Autre","locationType.unknown":"Inconnu","tariffPriceComponent.viewTariff":"Voir le tarif","tariffNote.subHeader":"Notes tarifaires","tariffNote.eFluxScheduledTariffNote":"Un tarif programmé remplace les prix de base du tarif pour une période spécifique.","tariffNote.dynamicScheduledTariffNote":"Le prix dynamique est ajusté automatiquement en fonction du prix du marché de l'énergie (intervalle d'une heure).","tariffNote.scheduledTariffNote":"Un tarif programmé remplace les prix de base du tarif pour une période spécifique.","tariffNote.baseTariffNote":"Les tarifs affichés ici ont été transmis à E-Flux par le partenaire d'itinérance. La précision peut varier en fonction du fournisseur.","dynamicTariffs.subHeader":"Tarifs horaires","location.viewAllHourlyPrices":"Voir tous les tarifs horaires","backButton.backTo":"Retour à"},Do={"search.placeholder":"Inserisci una posizione...","cdrPrice.flatFee":"Costo aggiuntivo {{total}} / sessione","tariffPriceComponent.dynamicTariffHeader":"Tariffa dinamica - {{date}}","tariffPriceComponent.flat":"{{total}} / sessione","tariffPriceComponent.time":"{{total}} / ora","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / ora tariffa di inattività","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. tempo di attesa prima della tariffa di inattività","tariffPriceComponent.noTariff":"Nessuna tariffa disponibile","tariffPriceComponent.baseTariff":"Tariffa base","tariffPriceComponent.active":"Attivo ora","filters.header":"Filtri","filters.dcChargers":"Caricabatterie DC","filters.efluxChargers":"Caricabatterie E-Flux","filters.noAdditionalFee":"Senza costi aggiuntivi per sessione","filters.available":"Disponibile","filters.charging":"In carica","filters.notAvailable":"Non disponibile","filters.chargingPower":"Potenza di ricarica [kW]","filters.connectorType":"Tipo di connettore","filters.apply":"Applica filtri","filters.clearAll":"Cancella tutti i filtri","filters.onlyShow":"Mostra solo","filters.statusHeading":"Stato","evse.statusAvailable":"Disponibile","evse.statusCharging":"In carica","evse.statusUnavailable":"Non disponibile","evse.statusRemoved":"Rimossa","evse.statusPlanned":"Pianificata","evse.statusReserved":"Réservé","evse.statusInoperative":"Inoperativo","evse.statusOutOfOrder":"Fuori servizio","evse.statusError":"Errore","evse.statusUnknown":"Sconosciuto","locationType.onStreet":"In strada","locationType.parkingGarage":"Garage per il parcheggio","locationType.undergroundGarage":"Garage sotterraneo","locationType.parkingLot":"Parcheggio","locationType.other":"Altro","locationType.unknown":"Sconosciuto","tariffPriceComponent.viewTariff":"Visualizza note tariffarie","tariffNote.subHeader":"Note tariffarie","tariffNote.eFluxScheduledTariffNote":"Una tariffa programmata sostituisce i prezzi della tariffa base per un periodo di tempo specifico.","tariffNote.dynamicScheduledTariffNote":"Il prezzo dinamico si regola automaticamente in base al prezzo del mercato dell'energia (intervallo di 1 ora).","tariffNote.scheduledTariffNote":"Una tariffa programmata sostituisce i prezzi della tariffa base per un periodo di tempo specifico.","tariffNote.baseTariffNote":"Le tariffe mostrate qui sono state inviate a E-Flux dal partner di roaming. L'accuratezza può variare a seconda del fornitore.","evse.pricing":"Prezzi","dynamicTariffs.subHeader":"Prezzi orari","location.viewAllHourlyPrices":"Visualizza tutti i prezzi orari","backButton.backTo":"Torna a"},Po={"search.placeholder":"Ingrese una ubicación...","cdrPrice.flatFee":"Tarifa adicional {{total}} / sesión","tariffPriceComponent.dynamicTariffHeader":"Tarifa Dinámica - {{date}}","tariffPriceComponent.flat":"{{total}} / sesión","tariffPriceComponent.time":"{{total}} / hora","tariffPriceComponent.energy":"{{total}} / kWh","tariffPriceComponent.parkingTime":"{{total}} / hora tarifa de inactividad","tariffPriceComponent.parkingTimeWait":"{{minutes}} min. tiempo de espera antes de la tarifa de inactividad","tariffPriceComponent.noTariff":"Tarifa no disponible","tariffPriceComponent.baseTariff":"Tarifa Base","tariffPriceComponent.active":"Activo ahora","filters.header":"Filtros","filters.dcChargers":"Cargadores DC","filters.efluxChargers":"Cargadores E-Flux","filters.noAdditionalFee":"Sin tarifa adicional por sesión","filters.available":"Disponible","filters.charging":"Cargando","filters.notAvailable":"No Disponible","filters.chargingPower":"Potencia de Carga [kW]","filters.connectorType":"Tipo de Conector","filters.apply":"Aplicar Filtros","filters.clearAll":"Limpiar Todos los Filtros","filters.onlyShow":"Mostrar Solo","evse.statusRemoved":"Eliminado","evse.statusPlanned":"Planificado","evse.statusReserved":"Reservado","evse.statusInoperative":"Fuera de servicio","evse.statusOutOfOrder":"Averiado","filters.statusHeading":"Estado","evse.statusAvailable":"Disponible","evse.statusCharging":"Cargando","evse.statusUnavailable":"No Disponible","evse.statusError":"Error","evse.statusUnknown":"Desconocido","locationType.onStreet":"En la calle","locationType.parkingGarage":"Garaje para Estacionar","locationType.undergroundGarage":"Garaje Subterráneo","locationType.parkingLot":"Estacionamiento","locationType.other":"Otro","locationType.unknown":"Desconocido","tariffPriceComponent.viewTariff":"Ver notas de tarifas","tariffNote.subHeader":"Notas de Tarifas","tariffNote.eFluxScheduledTariffNote":"Una tarifa programada anula los precios de la tarifa base para un período de tiempo específico.","tariffNote.dynamicScheduledTariffNote":"El precio dinámico se ajusta automáticamente según el precio del mercado de la energía (intervalo de 1 hora).","tariffNote.scheduledTariffNote":"Una tarifa programada anula los precios de la tarifa base para un período de tiempo específico.","tariffNote.baseTariffNote":"Las tarifas mostradas aquí han sido enviadas a E-Flux por el socio de roaming. La precisión puede variar según el proveedor.","evse.pricing":"Precios","dynamicTariffs.subHeader":"Precios por Hora","location.viewAllHourlyPrices":"Ver Todos los Precios por Hora","backButton.backTo":"Volver a"},Ao={en:No,nl:Oo,de:So,fr:Ro,it:Do,es:Po};async function Yt(e,n){try{const i=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...n.version&&{version:n.version},...n.authorization&&n.version==="v2"&&{Authorization:`Bearer ${n.authorization}`}},...n});switch(i.status){case 200:return i.json();case 400:throw new Error("Bad request");case 404:throw new Error("Not Found");case 500:throw new Error("Server Error");case 503:throw new Error("Timeout!");default:throw new Error(`Unexpected status: ${i.status}`)}}catch(i){if(i instanceof DOMException)return null;throw i}}async function Mo(e,n,i,r,{precision:o,bbox:t,...s}){return Yt(`${e}/1/map/search`,{method:"POST",version:n,authorization:i,body:JSON.stringify({gridPrecision:o,bbox:t,...r?.length>0&&{locationIds:r},...s,...s?.operatorOnly?{operator:[s.operatorOnly]}:{}})})}async function ko(e,n,i,{origin:r,ids:o}){return Yt(`${e}/1/map/tariff`,{method:"POST",version:n,authorization:i,body:JSON.stringify({connection_id:r.connectionId,country_code:r.countryCode,party_id:r.partyId,tariff_ids:o})})}async function jo(e,n,i,{ids:r,status:o}){return Yt(`${e}/1/map/locations`,{method:"POST",version:n,authorization:i,body:JSON.stringify({ids:r,...n==="v2"?{status:o}:{}})})}async function Lo(e,n,i){return(await Yt(`${e}/1/map/config`,{version:n,authorization:i}))?.data}const En=m.createContext({isReady:!1,setPlace:()=>{},t:e=>`Translate ${e}`,language:"en"}),Vo=({children:e,...n})=>{const[i,r]=m.useState(n.options),[o,t]=m.useState({preferredOperators:n.options.preferredOperators,showOperatorOnly:n.options.showOperatorOnly,showNoAdditionalFeeFilter:n.options.showNoAdditionalFeeFilter,showPublishingModeFilter:n.options.showPublishingModeFilter}),[s,c]=m.useState(),[l,u]=m.useState(),[f,p]=m.useState(n.options.position),[h,x]=m.useState({}),[w,N]=m.useState([n.options.locationId].filter(Boolean)),[E,k]=m.useState([]),[C,y]=m.useState({type:"success"}),[T,g]=m.useState(!1),P=window.location.search.includes("debug=true");P&&console.log("map-context options",n.options);const J=m.useMemo(()=>wo(n.options.language||"en"),[n.options.language]),F=m.useMemo(()=>(A,v)=>Ao[J][A].replace(/\{\{(\w+)\}\}/g,(b,H)=>v[H]),[J]),Q=(()=>{if(n.options.apiRoot&&n.options.apiRoot.includes(".dev"))return n.options.apiRoot;switch(n.options.version){case"v2":return"https://roaming.road.io/v2/map-search";default:return"https://api.road.io"}})();let B=n.options.version,W=n.options.authorization;const te=window.location.search.split("map_key=")[1];te&&(W=te,B="v2");const D=Mo.bind(null,Q,B,W,n.options.limitToLocationIds||[]),R=jo.bind(null,Q,B,W),re=ko.bind(null,Q,B,W);async function ne({ids:A,status:v}){y({type:"loading"});try{const{data:b}=await R({ids:A,...B==="v2"?{status:v}:{}});return k(b.filter(H=>H?.evses?.length)),y({type:"success"}),b}catch(b){y({type:"error",error:b})}}m.useEffect(()=>{n.options.locationId&&ne({ids:[n.options.locationId],status:h.status}).then(A=>{if(A?.length){const v=A[0];v.geoLocation?.coordinates&&p({lng:v.geoLocation?.coordinates[0],lat:v.geoLocation?.coordinates[1]})}})},[n.options.locationId]),m.useEffect(()=>{Lo(Q,B,W).then(A=>{P&&console.log("retrieved remote config",A),t({...A,...o}),r({googleApiKey:A.googleMapsApiKey,...i,...A}),!i.locationId&&!i?.position?.lat&&A.ipLatitude?(P&&console.debug("setting position from ip latitude and longitude"),p({lat:A.ipLatitude,lng:A.ipLongitude})):i.locationId||(P&&console.debug("setting position from options position"),p(i?.position?.lat?i.position:{lat:52.3676,lng:4.9041}))}).catch(A=>c(A))},[]),m.useEffect(()=>{w?.length&&ne({ids:w,status:h.status})},[w]),m.useEffect(()=>{const{theming:A,shadowRoot:v}=n.options;if(v){const b=v.querySelectorAll("#road-map-styles")[0]||document.createElement("style");b.setAttribute("type","text/css"),b.setAttribute("id","road-map-styles"),b.innerHTML=`
|
|
31
31
|
:host {
|
|
32
32
|
--roadmap-brand-color: ${A?.brandColor||"#6102d3"};
|
|
33
33
|
--roadmap-background-color: ${A?.backgroundColor||"#ffffff"};
|