@geotrekce/geotrek-rando-widget 0.0.1 → 0.0.4

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.
Files changed (87) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
  2. package/dist/cjs/{grw-app_7.cjs.entry.js → grw-app_11.cjs.entry.js} +513 -89
  3. package/dist/cjs/{index-31255e29.js → index-c2c4531d.js} +82 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/assets/departure-arrival.svg +1 -1
  6. package/dist/collection/collection-manifest.json +4 -0
  7. package/dist/collection/components/grw-app/grw-app.css +127 -39
  8. package/dist/collection/components/grw-app/grw-app.js +375 -18
  9. package/dist/collection/components/grw-filter/grw-filter.css +29 -0
  10. package/dist/collection/components/grw-filter/grw-filter.js +132 -0
  11. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +30 -0
  12. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
  13. package/dist/collection/components/grw-map/grw-map.css +117 -0
  14. package/dist/collection/components/grw-map/grw-map.js +409 -40
  15. package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +30 -0
  16. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
  17. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +16 -0
  18. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +38 -0
  19. package/dist/collection/components/grw-trek-card/grw-trek-card.css +67 -30
  20. package/dist/collection/components/grw-trek-card/grw-trek-card.js +112 -33
  21. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +36 -1
  22. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +122 -33
  23. package/dist/collection/components/grw-treks-list/grw-treks-list.css +17 -12
  24. package/dist/collection/components/grw-treks-list/grw-treks-list.js +70 -6
  25. package/dist/collection/store/grw-trek-provider.js +50 -8
  26. package/dist/collection/store/grw-treks-provider.js +166 -11
  27. package/dist/collection/store/store.js +6 -0
  28. package/dist/collection/stories/App.js +39 -3
  29. package/dist/collection/stories/App.stories.js +30 -5
  30. package/dist/collection/stories/TrekCard.js +9 -3
  31. package/dist/collection/stories/TrekCard.stories.js +5 -2
  32. package/dist/collection/stories/TrekDetail.js +10 -3
  33. package/dist/collection/stories/TrekDetail.stories.js +6 -2
  34. package/dist/collection/stories/TrekMap.js +15 -6
  35. package/dist/collection/stories/TrekMap.stories.js +21 -6
  36. package/dist/collection/stories/TreksList.js +17 -3
  37. package/dist/collection/stories/TreksList.stories.js +13 -2
  38. package/dist/collection/stories/TreksMap.js +12 -3
  39. package/dist/collection/stories/TreksMap.stories.js +18 -3
  40. package/dist/collection/utils/utils.js +2 -2
  41. package/dist/components/grw-app.js +79 -9
  42. package/dist/components/grw-filter.d.ts +11 -0
  43. package/dist/components/grw-filter.js +6 -0
  44. package/dist/components/grw-filter2.js +95 -0
  45. package/dist/components/grw-information-desk-detail.d.ts +11 -0
  46. package/dist/components/grw-information-desk-detail.js +6 -0
  47. package/dist/components/grw-information-desk-detail2.js +34 -0
  48. package/dist/components/grw-map2.js +260 -43
  49. package/dist/components/grw-poi-detail.d.ts +11 -0
  50. package/dist/components/grw-poi-detail.js +6 -0
  51. package/dist/components/grw-poi-detail2.js +32 -0
  52. package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
  53. package/dist/components/grw-sensitive-area-detail.js +6 -0
  54. package/dist/components/grw-sensitive-area-detail2.js +32 -0
  55. package/dist/components/grw-trek-card2.js +33 -10
  56. package/dist/components/grw-trek-detail2.js +47 -9
  57. package/dist/components/grw-trek-provider2.js +32 -9
  58. package/dist/components/grw-treks-list2.js +15 -6
  59. package/dist/components/grw-treks-provider2.js +37 -13
  60. package/dist/components/length.js +2 -2
  61. package/dist/components/store.js +6 -0
  62. package/dist/esm/geotrek-rando-widget.js +2 -2
  63. package/dist/esm/{grw-app_7.entry.js → grw-app_11.entry.js} +510 -90
  64. package/dist/esm/{index-b36f38f5.js → index-fe16e7b6.js} +82 -1
  65. package/dist/esm/loader.js +2 -2
  66. package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
  67. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  68. package/dist/geotrek-rando-widget/p-8c206aec.js +2 -0
  69. package/dist/geotrek-rando-widget/p-ed8706fb.entry.js +1 -0
  70. package/dist/types/components/grw-app/grw-app.d.ts +27 -2
  71. package/dist/types/components/grw-filter/grw-filter.d.ts +9 -0
  72. package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
  73. package/dist/types/components/grw-map/grw-map.d.ts +19 -2
  74. package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
  75. package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
  76. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +6 -2
  77. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +3 -0
  78. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +3 -0
  79. package/dist/types/components.d.ts +158 -1
  80. package/dist/types/store/grw-trek-provider.d.ts +1 -0
  81. package/dist/types/store/grw-treks-provider.d.ts +8 -0
  82. package/dist/types/store/store.d.ts +13 -1
  83. package/dist/types/types/types.d.ts +69 -3
  84. package/package.json +5 -7
  85. package/readme.md +19 -1
  86. package/dist/geotrek-rando-widget/p-f721481d.js +0 -2
  87. package/dist/geotrek-rando-widget/p-fe788eaa.entry.js +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-31255e29.js');
5
+ const index = require('./index-c2c4531d.js');
6
6
 
7
7
  const appendToMap = (map, propName, value) => {
8
8
  const items = map.get(propName);
@@ -191,43 +191,161 @@ const createStore = (defaultState, shouldUpdate) => {
191
191
  const { state, onChange } = createStore({
192
192
  api: '',
193
193
  treks: [],
194
+ currentTreks: [],
194
195
  difficulties: [],
195
196
  routes: [],
196
197
  practices: [],
198
+ themes: [],
199
+ durations: [],
200
+ currentSensitiveAreas: null,
201
+ currentPois: null,
197
202
  currentTrek: null,
203
+ currentInformationDesks: null,
198
204
  });
199
205
 
200
206
  const arrowBackImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="244 400 100 256 244 112" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/><line x1="120" y1="256" x2="412" y2="256" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/></svg>`;
201
207
 
202
- const grwAppCss = ".header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .title{color:#ffffff;font-size:24px;margin-left:24px}.header-container .arrow-back-icon{width:48px;height:auto;margin-left:24px}.header-container .arrow-back-icon svg{cursor:pointer;width:48px;height:auto}.loader-container{position:absolute;display:flex;justify-content:center;align-items:center;width:100vw;height:100%}.loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.content-container{display:flex;height:calc(100vh - 64px)}.app-treks-list-container,.app-trek-detail-container{width:100vw;height:100%}.app-map-container{position:absolute;width:100vw;height:calc(100vh - 64px)}.map-visibility-button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:absolute;bottom:24px;width:100%;z-index:400;user-select:none}.map-visibility-button div{background-color:var(--color-primary);color:#ffffff;padding:12px;border-radius:24px;width:120px;text-align:center}@media (min-width: 664px){.map-visibility-button{display:none}.header-container .title{font-size:32px}.loader-container{position:relative;width:50vw}.app-treks-list-container,.app-trek-detail-container{width:50vw;height:100%}.app-map-container{position:relative;width:50vw;height:100%}}";
208
+ const grwAppCss = ".app-container{position:relative;height:100%;max-height:100vh;font-family:\"Roboto\"}.header-container,.large-view-header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .arrow-back-icon,.large-view-header-container .arrow-back-icon{width:48px;height:auto;margin-left:24px}.header-container .arrow-back-icon svg,.large-view-header-container .arrow-back-icon svg{cursor:pointer;width:48px;height:auto}.header-container .handle-filters-button,.large-view-header-container .handle-filters-button{user-select:none;cursor:pointer;color:var(--color-primary);background-color:#ffffff;margin-left:36px;border-radius:8px;padding:8px}.header-container .attribution-container,.large-view-header-container .attribution-container{position:absolute;right:24px}.header-container .attribution-container a,.large-view-header-container .attribution-container a{color:#ffffff;text-decoration:none}.options-container{height:calc(100% - 64px);position:absolute;width:100%;z-index:1100;top:64px}.filters-container{position:absolute;width:100%;background-color:#ffffff;padding:36px 0px;z-index:1100}.filters-container .close-filters-button{cursor:pointer;font-weight:bold;position:absolute;top:12px;right:12px;padding:12px;border-radius:12px;color:var(--color-primary);border:1px var(--color-primary) solid}.filters-container .close-filters-button:hover{background-color:var(--color-primary);color:#ffffff}.filters-container .filter-margin-top{margin-top:24px}.filters-container .current-treks-length{margin:0px 0px 32px 8px;color:var(--color-primary);font-size:24px;font-weight:bold}.back-filters-container{background-color:rgba(0, 0, 0, 0.5);width:100%;height:calc(100% - 64px);position:absolute;z-index:1099;top:64px}.loader-container,.large-view-loader-container{display:flex;justify-content:center;align-items:center;height:100%}.loader-container .loader,.large-view-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.content-container{position:relative;display:flex;height:calc(100% - 64px)}.app-treks-list-container,.app-trek-detail-container,.large-view-app-treks-list-container,.large-view-app-trek-detail-container{height:100%}.app-map-container,.large-view-app-map-container{width:100%;height:100%}.map-visibility-button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:absolute;bottom:24px;width:100%;z-index:400;user-select:none}.map-visibility-button div{background-color:var(--color-primary);color:#ffffff;padding:12px;border-radius:24px;width:120px;text-align:center}.header-container .title{font-size:24px}.loader-container{position:absolute;width:100%}.app-treks-list-container,.app-trek-detail-container{width:100%}.app-map-container{position:relative;width:100%;position:absolute}.large-view-header-container .title{font-size:32px}.large-view-loader-container{position:relative;width:50%}.large-view-app-treks-list-container,.large-view-app-trek-detail-container{width:50%}.large-view-app-map-container{position:relative;width:50%}";
203
209
 
204
210
  const GrwApp = class {
205
211
  constructor(hostRef) {
206
212
  index.registerInstance(this, hostRef);
213
+ this.showTrek = false;
214
+ this.showMap = false;
215
+ this.showFilters = false;
216
+ this.isLargeView = false;
217
+ this.language = 'fr';
207
218
  this.appName = 'Geotrek Rando Widget';
208
219
  this.colorPrimary = '#6b0030';
209
- this.colorPrimaryTint = '#d2b2c0';
220
+ this.colorPrimaryShade = '#4a0021';
221
+ this.colorPrimaryTint = '#974c6e';
222
+ this.colorTrekLine = '#6b0030';
223
+ this.colorDepartureIcon = '#006b3b';
224
+ this.colorArrivalIcon = '#85003b';
225
+ this.colorSensitiveArea = '#4974a5';
226
+ this.colorPoiIcon = '#974c6e';
227
+ this.largeViewSize = 1024;
210
228
  }
211
229
  onTrekCardPress(event) {
212
230
  this.currentTrekId = event.detail;
213
231
  this.showTrek = !this.showTrek;
214
232
  }
215
- onWindowResize(event) {
216
- this.showMap = !(event.composedPath()[0].innerWidth < 664);
233
+ onWindowResize() {
234
+ this.handleView();
235
+ }
236
+ watchPropHandler() {
237
+ window.dispatchEvent(new window.Event('resize'));
238
+ }
239
+ componentDidLoad() {
240
+ this.handleView();
217
241
  }
218
242
  onTrekDetailsClose() {
219
243
  this.currentTrekId = null;
220
244
  this.showTrek = !this.showTrek;
221
245
  }
222
- componentWillLoad() {
223
- this.showMap = !(window.innerWidth < 664);
246
+ handleView() {
247
+ this.isLargeView = this.element.getBoundingClientRect().width >= this.largeViewSize;
248
+ this.showMap = this.isLargeView;
249
+ }
250
+ handleFilters() {
251
+ this.showFilters = !this.showFilters;
224
252
  }
225
253
  render() {
226
- return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, index.h("grw-treks-provider", { api: this.api, portals: this.portals }, index.h("div", { class: "header-container" }, this.showTrek ? index.h("div", { onClick: () => this.onTrekDetailsClose(), class: "arrow-back-icon", innerHTML: arrowBackImage }) : index.h("div", { class: "title" }, this.appName)), index.h("div", { class: "content-container" }, index.h("div", { class: "app-treks-list-container", style: { visibility: this.showTrek ? 'hidden' : 'visible', position: this.showTrek ? 'absolute' : 'relative' } }, index.h("grw-treks-list", null)), this.showTrek && !state.currentTrek && (index.h("div", { class: "loader-container" }, index.h("span", { class: "loader" }))), this.showTrek && this.currentTrekId && (index.h("grw-trek-provider", { api: state.api, "trek-id": this.currentTrekId }, state.currentTrek && (index.h("div", { class: "app-trek-detail-container" }, index.h("grw-trek-detail", null))))), index.h("div", { class: "app-map-container", style: { visibility: this.showMap ? 'visible' : 'hidden' } }, index.h("grw-map", null))), index.h("div", { class: "map-visibility-button" }, index.h("div", { onClick: () => (this.showMap = !this.showMap) }, this.showMap ? (this.showTrek ? 'Voir la fiche' : 'Voir la liste') : 'Voir la carte')))));
254
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint, '--color-primary-shade': this.colorPrimaryShade } }, index.h("grw-treks-provider", { api: this.api, language: this.language, "in-bbox": this.inBbox, cities: this.cities, districts: this.districts, structures: this.structures, themes: this.themes, portals: this.portals, routes: this.routes, practices: this.practices }), this.showTrek && this.currentTrekId && index.h("grw-trek-provider", { api: state.api, language: this.language, "trek-id": this.currentTrekId }), index.h("div", { class: "app-container" }, index.h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' }, this.showTrek ? (index.h("div", { onClick: () => this.onTrekDetailsClose(), class: "arrow-back-icon", innerHTML: arrowBackImage })) : (index.h("div", { onClick: () => this.handleFilters(), class: "handle-filters-button" }, "FILTRER")), !this.showTrek && this.showFilters && (index.h("div", { class: "options-container" }, index.h("div", { class: "filters-container" }, index.h("div", { class: "current-treks-length" }, `${state.currentTreks.length} résultat${state.currentTreks.length > 1 ? 's' : ''}`), index.h("div", { onClick: () => this.handleFilters(), class: "close-filters-button" }, "X"), index.h("div", null, index.h("grw-filter", { filterName: "Pratique", filterType: "practices", filterNameProperty: "name" })), index.h("div", { class: "filter-margin-top" }, index.h("grw-filter", { filterName: "Difficult\u00E9", filterType: "difficulties", filterNameProperty: "label" })), index.h("div", { class: "filter-margin-top" }, index.h("grw-filter", { filterName: "Dur\u00E9e", filterType: "durations", filterNameProperty: "name" }))), index.h("div", { onClick: () => this.handleFilters(), class: "back-filters-container" }))), index.h("div", { class: "attribution-container" }, index.h("a", { target: "_blank", href: "https://geotrek.fr" }, "GEOTREK"))), index.h("div", { class: "content-container" }, index.h("div", { class: this.isLargeView ? 'large-view-app-treks-list-container' : 'app-treks-list-container', style: { display: this.showTrek ? 'none' : 'flex', position: this.showTrek ? 'absolute' : 'relative' } }, index.h("grw-treks-list", { "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })), this.showTrek && !state.currentTrek && (index.h("div", { class: this.isLargeView ? 'large-view-loader-container' : 'loader-container' }, index.h("span", { class: "loader" }))), state.currentTrek && (index.h("div", { class: this.isLargeView ? 'large-view-app-trek-detail-container' : 'app-trek-detail-container' }, index.h("grw-trek-detail", { "color-primary": this.colorPrimary, "color-primary-shade": this.colorPrimaryShade, "color-primary-tint": this.colorPrimaryTint }))), index.h("grw-map", { class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: this.showMap ? 'visible' : 'hidden' }, "url-layer": this.urlLayer, center: this.center, zoom: this.zoom, attribution: this.attribution, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint, "color-trek-line": this.colorTrekLine, "color-departure-icon": this.colorDepartureIcon, "color-arrival-icon": this.colorArrivalIcon, "color-sensitive-area": this.colorSensitiveArea, "color-poi-icon": this.colorPoiIcon })), index.h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } }, index.h("div", { onClick: () => (this.showMap = !this.showMap) }, this.showMap ? (this.showTrek ? 'Voir la fiche' : 'Voir la liste') : 'Voir la carte')))));
227
255
  }
256
+ get element() { return index.getElement(this); }
257
+ static get watchers() { return {
258
+ "isLargeView": ["watchPropHandler"]
259
+ }; }
228
260
  };
229
261
  GrwApp.style = grwAppCss;
230
262
 
263
+ const grwFilterCss = ".filter-name{margin-left:8px;color:var(--color-primary);font-size:24px;font-weight:bold}.filter-button-container{display:flex;flex-direction:row;flex-wrap:wrap}.filter-button-container .filter-button,.filter-button-container .selected-filter-button{user-select:none;cursor:pointer;border:1px var(--color-primary) solid;border-radius:8px;margin:8px 0px 0px 8px;padding:8px}.filter-button-container .filter-button{color:var(--color-primary);background-color:#ffffff}.filter-button-container .selected-filter-button{color:#ffffff;background-color:var(--color-primary)}";
264
+
265
+ const GrwFilter = class {
266
+ constructor(hostRef) {
267
+ index.registerInstance(this, hostRef);
268
+ this.filters = [
269
+ { property: 'practices', trekProperty: 'practice', type: 'include' },
270
+ { property: 'difficulties', trekProperty: 'difficulty', type: 'include' },
271
+ { property: 'durations', trekProperty: 'duration', type: 'interval' },
272
+ ];
273
+ }
274
+ handleFilter(_event, filterToHandle) {
275
+ const filterFromState = [...state[this.filterType]];
276
+ filterFromState.find(currentFilter => currentFilter.id === filterToHandle.id).selected = !filterFromState.find(currentFilter => currentFilter.id === filterToHandle.id)
277
+ .selected;
278
+ state[this.filterType] = filterFromState;
279
+ let isUsingFilter = false;
280
+ let filtersTreks = [];
281
+ for (const filter of this.filters) {
282
+ const currentFiltersId = state[filter.property].filter(currentFilter => currentFilter.selected).map(currentFilter => currentFilter.id);
283
+ if (currentFiltersId.length > 0) {
284
+ if (filtersTreks.length > 0) {
285
+ if (filter.type === 'include') {
286
+ filtersTreks = [...filtersTreks.filter(trek => currentFiltersId.includes(trek[filter.trekProperty]))];
287
+ }
288
+ else if (filter.type === 'interval') {
289
+ let minValue;
290
+ let maxValue;
291
+ for (const currentFilterId of currentFiltersId) {
292
+ const currentFilter = state[filter.property].find(property => property.id === currentFilterId);
293
+ if (isNaN(minValue) || currentFilter.minValue < minValue) {
294
+ minValue = currentFilter.minValue;
295
+ }
296
+ if (isNaN(maxValue) || currentFilter.maxValue > maxValue) {
297
+ maxValue = currentFilter.maxValue;
298
+ }
299
+ }
300
+ filtersTreks = [...filtersTreks.filter(trek => trek[filter.trekProperty] >= minValue && trek[filter.trekProperty] <= maxValue)];
301
+ }
302
+ }
303
+ else {
304
+ if (!isUsingFilter) {
305
+ isUsingFilter = true;
306
+ }
307
+ if (filter.type === 'include') {
308
+ filtersTreks = [...state.treks.filter(trek => currentFiltersId.includes(trek[filter.trekProperty]))];
309
+ }
310
+ else if (filter.type === 'interval') {
311
+ let minValue;
312
+ let maxValue;
313
+ for (const currentFilterId of currentFiltersId) {
314
+ const currentFilter = state[filter.property].find(property => property.id === currentFilterId);
315
+ if (isNaN(minValue) || currentFilter.minValue < minValue) {
316
+ minValue = currentFilter.minValue;
317
+ }
318
+ if (isNaN(maxValue) || currentFilter.maxValue > maxValue) {
319
+ maxValue = currentFilter.maxValue;
320
+ }
321
+ }
322
+ filtersTreks = [...state.treks.filter(trek => trek[filter.trekProperty] >= minValue && trek[filter.trekProperty] <= maxValue)];
323
+ }
324
+ }
325
+ }
326
+ }
327
+ state.currentTreks = isUsingFilter ? filtersTreks : state.treks;
328
+ }
329
+ render() {
330
+ return (index.h(index.Host, null, index.h("div", { class: "filter-name" }, this.filterName), index.h("div", { class: "filter-button-container" }, state[this.filterType].map(currentFilter => (index.h("div", { onClick: event => this.handleFilter(event, currentFilter), class: currentFilter.selected ? 'selected-filter-button' : 'filter-button' }, currentFilter[this.filterNameProperty]))))));
331
+ }
332
+ };
333
+ GrwFilter.style = grwFilterCss;
334
+
335
+ const grwInformationDeskDetailCss = ":host{display:flex;flex-direction:column;padding:0px 8px 8px 8px}.information-desk-img{width:180px}.information-desk-img img{width:180px;border-radius:8px}.information-desk-right-container{display:flex;flex-direction:column;padding:8px}.information-desk-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:0px 0px 8px 0px}.information-desk-description{font-size:16px}";
336
+
337
+ const GrwInformationDeskDetail = class {
338
+ constructor(hostRef) {
339
+ index.registerInstance(this, hostRef);
340
+ }
341
+ render() {
342
+ return (index.h(index.Host, null, this.informationDesk.photo_url && (index.h("div", { class: "information-desk-img" }, index.h("img", { src: this.informationDesk.photo_url, loading: "lazy" }))), index.h("div", { class: "information-desk-right-container" }, this.informationDesk.name && index.h("div", { class: "information-desk-name" }, this.informationDesk.name), this.informationDesk.description && index.h("div", { class: "information-desk-description", innerHTML: this.informationDesk.description }), this.informationDesk.postal_code ||
343
+ this.informationDesk.municipality ||
344
+ (this.informationDesk.street && (index.h("div", null, this.informationDesk.postal_code, ` ${this.informationDesk.municipality}`, ` ${this.informationDesk.street}`))), this.informationDesk.phone && (index.h("div", null, index.h("a", { href: `tel:${this.informationDesk.phone}` }, this.informationDesk.phone))), this.informationDesk.email && (index.h("div", null, index.h("a", { href: `mailto:${this.informationDesk.email}` }, this.informationDesk.email))), this.informationDesk.website && (index.h("div", null, index.h("a", { href: `${this.informationDesk.website}` }, this.informationDesk.website))))));
345
+ }
346
+ };
347
+ GrwInformationDeskDetail.style = grwInformationDeskDetailCss;
348
+
231
349
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
232
350
 
233
351
  function createCommonjsModule(fn, basedir, module) {
@@ -14367,32 +14485,49 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
14367
14485
  //# sourceMappingURL=leaflet-src.js.map
14368
14486
  });
14369
14487
 
14370
- const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill:none;stroke:currentColor;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`;
14488
+ const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill:#ffffff;stroke:currentColor;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`;
14371
14489
 
14372
- const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{display:block;height:100%}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%}";
14490
+ const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{font-family:\"Roboto\";display:block;height:100%;max-height:100vh}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%;display:flex;justify-content:center;align-items:center}.trek-marker img{width:36px !important}.map-loader-container{position:absolute;z-index:500;width:100%;height:100%;background:rgba(255, 255, 255, 0.5);display:flex;justify-content:center;align-items:center}.map-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.leaflet-popup-content{width:144px;margin:0}.trek-departure-popup{position:relative;display:flex;flex-direction:column;width:100px;height:auto;padding:24px}.trek-departure-popup img{border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-departure-popup .trek-name{color:var(--color-primary);font-weight:bold;font-size:12px}.trek-departure-popup .trek-name-margin-top{margin-top:12px}.poi-tooltip .poi-name,.poi-tooltip .information-desks-name,.information-desks-tooltip .poi-name,.information-desks-tooltip .information-desks-name{color:var(--color-primary);font-weight:bold;font-size:12px}.sensitiveAreasCheckboxContainer{display:flex;justify-content:center;align-items:center;background-color:#ffffff;padding:8px;border-radius:8px;user-select:none}.sensitiveAreasCheckboxContainer input,.sensitiveAreasCheckboxContainer label{cursor:pointer}.sensitiveAreasCheckboxContainer input{margin:0}.sensitiveAreasCheckboxContainer label{padding-left:8px}.poi-icon,.information-desks-icon{background-color:var(--color-poi-icon);border-radius:50%;display:flex;justify-content:center;align-items:center}.poi-icon img,.information-desks-icon img{width:36px !important}.parking-icon{background-color:#0000ff;border-radius:50%;display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:#ffffff}";
14373
14491
 
14374
14492
  const GrwMap = class {
14375
14493
  constructor(hostRef) {
14376
14494
  index.registerInstance(this, hostRef);
14495
+ this.trekCardPress = index.createEvent(this, "trekCardPress", 7);
14496
+ this.mapIsReady = false;
14497
+ this.center = '1, 1';
14498
+ this.zoom = 10;
14499
+ this.colorPrimary = '#6b0030';
14500
+ this.colorPrimaryTint = '#974c6e';
14377
14501
  this.colorTrekLine = '#6b0030';
14378
14502
  this.colorDepartureIcon = '#006b3b';
14379
14503
  this.colorArrivalIcon = '#85003b';
14504
+ this.colorSensitiveArea = ' #4974a5';
14505
+ this.colorPoiIcon = '#974c6e';
14380
14506
  }
14381
14507
  componentDidLoad() {
14382
14508
  this.map = leafletSrc.map(this.element, {
14383
- center: [1, 1],
14384
- zoom: 10,
14509
+ center: this.center.split(',').map(Number),
14510
+ zoom: this.zoom,
14385
14511
  });
14386
- leafletSrc.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
14512
+ leafletSrc.control.scale().addTo(this.map);
14513
+ leafletSrc.tileLayer(this.urlLayer, {
14387
14514
  maxZoom: 19,
14388
- attribution: '© OpenStreetMap',
14515
+ attribution: this.attribution,
14389
14516
  }).addTo(this.map);
14390
14517
  if (state.currentTrek) {
14391
14518
  this.addTrek();
14392
14519
  }
14393
- else {
14520
+ else if (state.currentTrek) {
14394
14521
  this.addTreks();
14395
14522
  }
14523
+ onChange('currentTreks', () => {
14524
+ if (state.currentTrek) {
14525
+ this.addTrek();
14526
+ }
14527
+ else if (state.currentTreks) {
14528
+ this.addTreks();
14529
+ }
14530
+ });
14396
14531
  onChange('currentTrek', () => {
14397
14532
  if (state.currentTrek) {
14398
14533
  this.removeTreks();
@@ -14405,71 +14540,107 @@ const GrwMap = class {
14405
14540
  });
14406
14541
  }
14407
14542
  addTreks() {
14408
- const treksDepartureCoordinates = [];
14543
+ var _a;
14544
+ const trekscurrentDepartureCoordinates = [];
14409
14545
  const treksFeatureCollection = {
14410
14546
  type: 'FeatureCollection',
14411
14547
  features: [],
14412
14548
  };
14413
- for (const trek of state.treks) {
14414
- treksDepartureCoordinates.push(trek.departure_geom);
14549
+ for (const trek of state.currentTreks) {
14550
+ trekscurrentDepartureCoordinates.push(trek.departure_geom);
14415
14551
  treksFeatureCollection.features.push({
14416
14552
  type: 'Feature',
14417
- properties: {},
14418
14553
  geometry: { type: 'Point', coordinates: trek.departure_geom },
14554
+ properties: {
14555
+ id: trek.id,
14556
+ name: trek.name,
14557
+ practice: (_a = state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram,
14558
+ imgSrc: trek.attachments && trek.attachments.length > 0 && trek.attachments[0].thumbnail,
14559
+ },
14419
14560
  });
14420
14561
  }
14421
- if (treksDepartureCoordinates.length > 0) {
14422
- const bounds = leafletSrc.latLngBounds(treksDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14423
- this.map.fitBounds(bounds);
14562
+ if (trekscurrentDepartureCoordinates.length > 0) {
14563
+ const bounds = leafletSrc.latLngBounds(trekscurrentDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14564
+ this.currentBounds = bounds;
14565
+ this.map.fitBounds(this.currentBounds);
14424
14566
  }
14425
- this.treksLayer = leafletSrc.geoJSON(treksFeatureCollection, {
14426
- pointToLayer: (_geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14427
- icon: leafletSrc.divIcon({
14428
- className: 'trek-marker',
14429
- iconSize: 48,
14430
- iconAnchor: [0, 48],
14567
+ if (!this.treksLayer) {
14568
+ this.treksLayer = leafletSrc.geoJSON(treksFeatureCollection, {
14569
+ pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14570
+ icon: leafletSrc.divIcon({
14571
+ html: geoJsonPoint.properties.practice && `<img src=${geoJsonPoint.properties.practice} />`,
14572
+ className: 'trek-marker',
14573
+ iconSize: 48,
14574
+ }),
14575
+ autoPanOnFocus: false,
14431
14576
  }),
14432
- autoPanOnFocus: false,
14433
- }),
14434
- }).addTo(this.map);
14577
+ onEachFeature: (geoJsonPoint, layer) => {
14578
+ layer.once('click', () => {
14579
+ const trekDeparturePopup = leafletSrc.DomUtil.create('div');
14580
+ trekDeparturePopup.className = 'trek-departure-popup';
14581
+ trekDeparturePopup.onclick = () => this.trekCardPress.emit(geoJsonPoint.properties.id);
14582
+ const trekName = leafletSrc.DomUtil.create('div');
14583
+ trekName.innerHTML = geoJsonPoint.properties.name;
14584
+ trekName.className = 'trek-name';
14585
+ if (geoJsonPoint.properties.imgSrc) {
14586
+ trekName.className += ' trek-name-margin-top';
14587
+ const trekImg = leafletSrc.DomUtil.create('img');
14588
+ trekImg.src = geoJsonPoint.properties.imgSrc;
14589
+ trekDeparturePopup.appendChild(trekImg);
14590
+ }
14591
+ trekDeparturePopup.appendChild(trekName);
14592
+ layer.bindPopup(trekDeparturePopup, { interactive: true, autoPan: false, closeButton: false }).openPopup();
14593
+ });
14594
+ },
14595
+ }).addTo(this.map);
14596
+ }
14597
+ else {
14598
+ this.treksLayer.clearLayers();
14599
+ this.treksLayer.addData(treksFeatureCollection);
14600
+ }
14601
+ !this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
14435
14602
  }
14436
14603
  removeTreks() {
14437
- this.map.removeLayer(this.treksLayer);
14438
- this.treksLayer = null;
14604
+ if (this.treksLayer) {
14605
+ this.map.removeLayer(this.treksLayer);
14606
+ this.treksLayer = null;
14607
+ }
14439
14608
  }
14440
14609
  addTrek() {
14441
- const trekFeature = {
14610
+ const currentTrekFeature = {
14442
14611
  type: 'Feature',
14443
14612
  geometry: state.currentTrek.geometry,
14444
14613
  properties: {},
14445
14614
  };
14446
- this.trekLayer = leafletSrc.geoJSON(trekFeature, {
14615
+ this.currentTrekLayer = leafletSrc.geoJSON(currentTrekFeature, {
14447
14616
  style: () => ({
14448
14617
  color: this.colorTrekLine,
14449
14618
  }),
14619
+ interactive: false,
14450
14620
  }).addTo(this.map);
14451
14621
  const bounds = leafletSrc.latLngBounds(state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14452
- this.map.fitBounds(bounds);
14453
- const departureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
14454
- const arrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
14455
- const departureArrivalFeatureCollection = {
14622
+ this.currentBounds = bounds;
14623
+ this.map.fitBounds(this.currentBounds);
14624
+ const currentDepartureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
14625
+ const currentArrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
14626
+ const currentDepartureArrivalFeatureCollection = {
14456
14627
  type: 'FeatureCollection',
14457
14628
  features: [
14458
14629
  {
14459
14630
  type: 'Feature',
14460
14631
  properties: { type: 'departure' },
14461
- geometry: { type: 'Point', coordinates: departureCoordinates },
14632
+ geometry: { type: 'Point', coordinates: currentDepartureCoordinates },
14462
14633
  },
14463
14634
  ],
14464
14635
  };
14465
- if (departureCoordinates[0] !== arrivalCoordinates[0] || departureCoordinates[1] !== arrivalCoordinates[1]) {
14466
- departureArrivalFeatureCollection.features.push({
14636
+ if (currentDepartureCoordinates[0] !== currentArrivalCoordinates[0] || currentDepartureCoordinates[1] !== currentArrivalCoordinates[1]) {
14637
+ currentDepartureArrivalFeatureCollection.features.push({
14467
14638
  type: 'Feature',
14468
14639
  properties: { type: 'arrival' },
14469
- geometry: { type: 'Point', coordinates: arrivalCoordinates },
14640
+ geometry: { type: 'Point', coordinates: currentArrivalCoordinates },
14470
14641
  });
14471
14642
  }
14472
- this.departureArrivalLayer = leafletSrc.geoJSON(departureArrivalFeatureCollection, {
14643
+ this.currentDepartureArrivalLayer = leafletSrc.geoJSON(currentDepartureArrivalFeatureCollection, {
14473
14644
  pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14474
14645
  icon: leafletSrc.divIcon({
14475
14646
  html: departureArrivalImage,
@@ -14478,22 +14649,201 @@ const GrwMap = class {
14478
14649
  iconAnchor: [0, 48],
14479
14650
  }),
14480
14651
  autoPanOnFocus: false,
14652
+ interactive: false,
14481
14653
  }),
14482
14654
  }).addTo(this.map);
14655
+ if (state.currentTrek.parking_location) {
14656
+ const currentParking = {
14657
+ type: 'Feature',
14658
+ properties: {},
14659
+ geometry: { type: 'Point', coordinates: state.currentTrek.parking_location },
14660
+ };
14661
+ this.currentParkingLayer = leafletSrc.geoJSON(currentParking, {
14662
+ pointToLayer: (_geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14663
+ icon: leafletSrc.divIcon({
14664
+ html: '<div>P</div>',
14665
+ className: 'parking-icon',
14666
+ iconSize: 48,
14667
+ iconAnchor: [0, 48],
14668
+ }),
14669
+ autoPanOnFocus: false,
14670
+ interactive: false,
14671
+ }),
14672
+ }).addTo(this.map);
14673
+ }
14674
+ if (state.currentSensitiveAreas && state.currentSensitiveAreas.length > 0) {
14675
+ const currentSensitiveAreasFeatureCollection = {
14676
+ type: 'FeatureCollection',
14677
+ features: [],
14678
+ };
14679
+ for (const sensitiveArea of state.currentSensitiveAreas) {
14680
+ currentSensitiveAreasFeatureCollection.features.push({
14681
+ type: 'Feature',
14682
+ properties: {},
14683
+ geometry: sensitiveArea.geometry,
14684
+ });
14685
+ }
14686
+ this.currentSensitiveAreasLayer = leafletSrc.geoJSON(currentSensitiveAreasFeatureCollection, { style: () => ({ color: this.colorSensitiveArea }) }).addTo(this.map);
14687
+ leafletSrc.Control.SensitiveAreasCheckboxContainer = leafletSrc.Control.extend({
14688
+ onAdd: () => {
14689
+ const sensitiveAreasCheckboxContainer = leafletSrc.DomUtil.create('div');
14690
+ sensitiveAreasCheckboxContainer.className = 'sensitiveAreasCheckboxContainer';
14691
+ const sensitiveAreasCheckbox = leafletSrc.DomUtil.create('input');
14692
+ sensitiveAreasCheckbox.setAttribute('id', 'sensitiveAreasCheckbox');
14693
+ sensitiveAreasCheckbox.setAttribute('type', 'checkbox');
14694
+ sensitiveAreasCheckbox.setAttribute('checked', 'true');
14695
+ sensitiveAreasCheckbox.onclick = value => value.composedPath()[0].checked ? this.map.addLayer(this.currentSensitiveAreasLayer) : this.map.removeLayer(this.currentSensitiveAreasLayer);
14696
+ const sensitiveAreasLabel = leafletSrc.DomUtil.create('label');
14697
+ sensitiveAreasLabel.setAttribute('for', 'sensitiveAreasCheckbox');
14698
+ sensitiveAreasLabel.innerHTML =
14699
+ currentSensitiveAreasFeatureCollection.features.length > 1 || currentSensitiveAreasFeatureCollection.features[0].geometry.type === 'MultiPolygon'
14700
+ ? 'Afficher les zones sensibles'
14701
+ : 'Afficher la zone sensible';
14702
+ sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasCheckbox);
14703
+ sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasLabel);
14704
+ return sensitiveAreasCheckboxContainer;
14705
+ },
14706
+ });
14707
+ leafletSrc.control.sensitiveAreasCheckboxContainer = () => {
14708
+ return new leafletSrc.Control.SensitiveAreasCheckboxContainer();
14709
+ };
14710
+ this.sensitiveAreasControl = leafletSrc.control.sensitiveAreasCheckboxContainer({ position: 'topright' }).addTo(this.map);
14711
+ }
14712
+ if (state.currentPois && state.currentPois.length > 0) {
14713
+ const currentPoisFeatureCollection = {
14714
+ type: 'FeatureCollection',
14715
+ features: [],
14716
+ };
14717
+ for (const currentPoi of state.currentPois) {
14718
+ currentPoisFeatureCollection.features.push({
14719
+ type: 'Feature',
14720
+ properties: { name: currentPoi.name, type_pictogram: currentPoi.type_pictogram },
14721
+ geometry: currentPoi.geometry,
14722
+ });
14723
+ }
14724
+ this.currentPoisLayer = leafletSrc.geoJSON(currentPoisFeatureCollection, {
14725
+ pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14726
+ icon: leafletSrc.divIcon({
14727
+ html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
14728
+ className: 'poi-icon',
14729
+ iconSize: 48,
14730
+ }),
14731
+ autoPanOnFocus: false,
14732
+ }),
14733
+ onEachFeature: (geoJsonPoint, layer) => {
14734
+ layer.once('mouseover', () => {
14735
+ const poiTooltip = leafletSrc.DomUtil.create('div');
14736
+ poiTooltip.className = 'poi-tooltip';
14737
+ const poiName = leafletSrc.DomUtil.create('div');
14738
+ poiName.innerHTML = geoJsonPoint.properties.name;
14739
+ poiName.className = 'poi-name';
14740
+ poiTooltip.appendChild(poiName);
14741
+ layer.bindTooltip(poiTooltip).openTooltip();
14742
+ });
14743
+ },
14744
+ }).addTo(this.map);
14745
+ }
14746
+ if (state.currentInformationDesks && state.currentInformationDesks.length > 0) {
14747
+ const currentInformationDesksFeatureCollection = {
14748
+ type: 'FeatureCollection',
14749
+ features: [],
14750
+ };
14751
+ for (const currentInformationDesk of state.currentInformationDesks) {
14752
+ currentInformationDesksFeatureCollection.features.push({
14753
+ type: 'Feature',
14754
+ properties: { name: currentInformationDesk.name, type_pictogram: currentInformationDesk.type.pictogram },
14755
+ geometry: { type: 'Point', coordinates: [Number(currentInformationDesk.longitude), Number(currentInformationDesk.latitude)] },
14756
+ });
14757
+ }
14758
+ this.currentInformationDesksLayer = leafletSrc.geoJSON(currentInformationDesksFeatureCollection, {
14759
+ pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14760
+ icon: leafletSrc.divIcon({
14761
+ html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
14762
+ className: 'information-desks-icon',
14763
+ iconSize: 48,
14764
+ }),
14765
+ autoPanOnFocus: false,
14766
+ }),
14767
+ onEachFeature: (geoJsonPoint, layer) => {
14768
+ layer.once('mouseover', () => {
14769
+ const informationDesksTooltip = leafletSrc.DomUtil.create('div');
14770
+ informationDesksTooltip.className = 'information-desks-tooltip';
14771
+ const informationDesksName = leafletSrc.DomUtil.create('div');
14772
+ informationDesksName.innerHTML = geoJsonPoint.properties.name;
14773
+ informationDesksName.className = 'information-desks-name';
14774
+ informationDesksTooltip.appendChild(informationDesksName);
14775
+ layer.bindTooltip(informationDesksTooltip).openTooltip();
14776
+ });
14777
+ },
14778
+ }).addTo(this.map);
14779
+ }
14780
+ !this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
14483
14781
  }
14484
14782
  removeTrek() {
14485
- this.map.removeLayer(this.trekLayer);
14486
- this.map.removeLayer(this.departureArrivalLayer);
14487
- this.trekLayer = null;
14488
- this.departureArrivalLayer = null;
14783
+ if (this.currentTrekLayer) {
14784
+ this.map.removeLayer(this.currentTrekLayer);
14785
+ this.currentTrekLayer = null;
14786
+ }
14787
+ if (this.currentDepartureArrivalLayer) {
14788
+ this.map.removeLayer(this.currentDepartureArrivalLayer);
14789
+ this.currentDepartureArrivalLayer = null;
14790
+ }
14791
+ if (this.currentParkingLayer) {
14792
+ this.map.removeLayer(this.currentParkingLayer);
14793
+ this.currentParkingLayer = null;
14794
+ }
14795
+ if (this.currentSensitiveAreasLayer) {
14796
+ this.map.removeLayer(this.currentSensitiveAreasLayer);
14797
+ this.currentSensitiveAreasLayer = null;
14798
+ this.map.removeControl(this.sensitiveAreasControl);
14799
+ this.sensitiveAreasControl = null;
14800
+ }
14801
+ if (this.currentPoisLayer) {
14802
+ this.map.removeLayer(this.currentPoisLayer);
14803
+ this.currentPoisLayer = null;
14804
+ }
14805
+ if (this.currentInformationDesksLayer) {
14806
+ this.map.removeLayer(this.currentInformationDesksLayer);
14807
+ this.currentInformationDesksLayer = null;
14808
+ }
14489
14809
  }
14490
14810
  render() {
14491
- return index.h(index.Host, { style: { '--color-departure-icon': this.colorDepartureIcon, '--color-arrival-icon': this.colorArrivalIcon } });
14811
+ return (index.h(index.Host, { style: {
14812
+ '--color-primary': this.colorPrimary,
14813
+ '--color-primary-tint': this.colorPrimaryTint,
14814
+ '--color-departure-icon': this.colorDepartureIcon,
14815
+ '--color-arrival-icon': this.colorArrivalIcon,
14816
+ '--color-poi-icon': this.colorPoiIcon,
14817
+ } }, !this.mapIsReady && (index.h("div", { class: "map-loader-container" }, index.h("span", { class: "loader" })))));
14492
14818
  }
14493
14819
  get element() { return index.getElement(this); }
14494
14820
  };
14495
14821
  GrwMap.style = grwMapCss;
14496
14822
 
14823
+ const grwPoiDetailCss = ":host{display:flex;flex-direction:column;padding:0px 8px 8px 8px}.poi-img{width:180px}.poi-img img{width:180px;border-radius:8px}.poi-right-container{display:flex;flex-direction:column;padding:8px}.poi-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:0px 0px 8px 0px}.poi-description{font-size:16px}";
14824
+
14825
+ const GrwPoiDetail = class {
14826
+ constructor(hostRef) {
14827
+ index.registerInstance(this, hostRef);
14828
+ }
14829
+ render() {
14830
+ return (index.h(index.Host, null, this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].thumbnail && (index.h("div", { class: "poi-img" }, index.h("img", { src: this.poi.attachments[0].thumbnail, loading: "lazy" }))), index.h("div", { class: "poi-right-container" }, index.h("div", { class: "poi-name" }, this.poi.name), index.h("div", { class: "poi-description", innerHTML: this.poi.description }))));
14831
+ }
14832
+ };
14833
+ GrwPoiDetail.style = grwPoiDetailCss;
14834
+
14835
+ const grwSensitiveAreaDetailCss = ":host{display:flex;flex-direction:column;padding:0px 8px 8px 8px}.sensitive-area-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:0px 0px 8px 0px}.sensitive-area-description{font-size:16px}";
14836
+
14837
+ const GrwSensitiveAreaDetail = class {
14838
+ constructor(hostRef) {
14839
+ index.registerInstance(this, hostRef);
14840
+ }
14841
+ render() {
14842
+ return (index.h(index.Host, null, index.h("div", { class: "sensitive-area-name" }, this.sensitiveArea.name), index.h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description })));
14843
+ }
14844
+ };
14845
+ GrwSensitiveAreaDetail.style = grwSensitiveAreaDetailCss;
14846
+
14497
14847
  function formatDuration(duration) {
14498
14848
  let formattedDuration;
14499
14849
  if (duration < 24) {
@@ -14508,10 +14858,10 @@ function formatDuration(duration) {
14508
14858
  return formattedDuration;
14509
14859
  }
14510
14860
  function formatLength(length) {
14511
- return `${Math.round(length / 1000)} km`;
14861
+ return `${Math.round(length / 1000)}km`;
14512
14862
  }
14513
14863
  function formatAscent(ascent) {
14514
- return `${ascent} m`;
14864
+ return `${ascent}m`;
14515
14865
  }
14516
14866
 
14517
14867
  const ascentImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="352 144 464 144 464 256" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M48,368,169.37,246.63a32,32,0,0,1,45.26,0l50.74,50.74a32,32,0,0,0,45.26,0L448,160" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
@@ -14520,47 +14870,75 @@ const durationImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" heigh
14520
14870
 
14521
14871
  const lengthImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="304 96 416 96 416 208" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="405.77" y1="106.2" x2="111.98" y2="400.02" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="208 416 96 416 96 304" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
14522
14872
 
14523
- const grwTrekCardCss = ".trek-card-container{width:350px;height:auto;border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image{width:100%;height:auto}.trek-card-container .sub-container{padding:12px}.trek-card-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:12px}.trek-card-container .sub-container .description{max-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px}.trek-card-container .sub-container .description p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.trek-card-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-card-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}";
14873
+ const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
14524
14874
 
14525
14875
  const GrwTrekCard = class {
14526
14876
  constructor(hostRef) {
14527
14877
  index.registerInstance(this, hostRef);
14528
14878
  this.trekCardPress = index.createEvent(this, "trekCardPress", 7);
14879
+ this.colorPrimary = '#6b0030';
14880
+ this.colorPrimaryTint = '#974c6e';
14881
+ this.isLargeView = false;
14529
14882
  }
14530
14883
  componentWillLoad() {
14531
14884
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
14532
- this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14533
- this.route = state.routes.find(route => route.id === this.currentTrek.route);
14534
- this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14885
+ if (this.currentTrek) {
14886
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14887
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
14888
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14889
+ this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
14890
+ }
14891
+ onChange('currentTrek', () => {
14892
+ this.currentTrek = this.trek ? this.trek : state.currentTrek;
14893
+ if (this.currentTrek) {
14894
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14895
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
14896
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14897
+ this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
14898
+ }
14899
+ });
14535
14900
  }
14536
14901
  render() {
14537
14902
  var _a, _b, _c, _d, _e, _f, _g, _h;
14538
- return (index.h(index.Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id) }, index.h("div", { class: "trek-card-container" }, this.currentTrek.attachments[0] && index.h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" }), index.h("div", { class: "sub-container" }, index.h("div", { class: "name" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.name), index.h("div", { class: "description", innerHTML: (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.description_teaser }), index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
14539
- _d.label), index.h("div", { class: "icon-label duration" }, index.h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration)), index.h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && index.h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
14540
- _f.route)), index.h("div", { class: "row" }, index.h("div", { class: "icon-label length" }, index.h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), index.h("div", { class: "icon-label ascent" }, index.h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent)), index.h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && index.h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
14541
- _h.name)))))));
14903
+ return (index.h(index.Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { 'width': this.isLargeView ? '100%' : 'auto', '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (index.h("div", { class: this.isLargeView ? 'trek-card-large-view-container' : 'trek-card-container' }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (index.h("img", { class: "image", src: `${this.currentTrek.attachments[0].thumbnail}`, loading: "lazy" })), index.h("div", { class: "sub-container" }, index.h("div", { class: "departure" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.departure), index.h("div", { class: "name" }, (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.name), index.h("div", { class: "themes-container" }, this.themes.map(theme => (index.h("div", { class: "theme" }, theme.label)))), index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
14904
+ _d.label), index.h("div", { class: "icon-label duration" }, index.h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration))), index.h("div", { class: "row" }, index.h("div", { class: "icon-label length" }, index.h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), index.h("div", { class: "icon-label ascent" }, index.h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent))), index.h("div", { class: "row" }, index.h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && index.h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
14905
+ _f.route), index.h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && index.h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
14906
+ _h.name))))))));
14542
14907
  }
14543
14908
  };
14544
14909
  GrwTrekCard.style = grwTrekCardCss;
14545
14910
 
14546
- const grwTrekDetailCss = ".trek-detail-container{display:flex;flex-direction:column;max-height:calc(100vh - 64px);overflow-y:auto}.trek-detail-container .name{color:var(--color-primary);font-size:48px;font-weight:bold;padding:24px}.trek-detail-container .image{align-self:center;width:100%;max-width:700px;height:auto;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-detail-container .sub-container{padding:24px}.trek-detail-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-detail-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-detail-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:24px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-detail-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 8px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label img,.trek-detail-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-detail-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-detail-container .description{padding:0px 24px 24px 24px}";
14911
+ const grwTrekDetailCss = ".trek-detail-container{font-family:\"Roboto\";display:flex;flex-direction:column;height:100%;overflow-y:auto}.trek-detail-container .name{color:var(--color-primary);font-size:48px;font-weight:bold;padding:24px}.trek-detail-container .image{border-radius:8px;align-self:center;width:100%;max-width:700px;height:auto;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-detail-container .sub-container{padding:24px}.trek-detail-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-detail-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-detail-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:24px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-detail-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 8px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label img,.trek-detail-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-detail-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-detail-container .downloads-container{padding:0px 24px 24px 24px;display:flex;flex-direction:column;justify-content:center;align-items:center}.trek-detail-container .downloads-container .download-title{color:var(--color-primary);font-size:18px;margin-bottom:18px}.trek-detail-container .downloads-container .links-container a{background-color:var(--color-primary);padding:8px;color:#ffffff;text-decoration:none;border-radius:8px}.trek-detail-container .downloads-container .links-container a:nth-child(2){margin:0px 12px}.trek-detail-container .downloads-container .links-container a:hover{background-color:var(--color-primary-shade)}.trek-detail-container .description{padding:0px 24px 24px 24px}.trek-detail-container .pois-title,.trek-detail-container .sensitive-areas-title,.trek-detail-container .information-desks-title{color:var(--color-primary);font-size:36px;font-weight:bold;padding:16px}";
14547
14912
 
14548
14913
  const GrwTrekDetail = class {
14549
14914
  constructor(hostRef) {
14550
14915
  index.registerInstance(this, hostRef);
14916
+ this.colorPrimary = '#6b0030';
14917
+ this.colorPrimaryShade = '#4a0021';
14918
+ this.colorPrimaryTint = '#974c6e';
14551
14919
  }
14552
14920
  componentWillLoad() {
14553
14921
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
14554
- this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14555
- this.route = state.routes.find(route => route.id === this.currentTrek.route);
14556
- this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14922
+ if (this.currentTrek) {
14923
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14924
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
14925
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14926
+ }
14927
+ onChange('currentTrek', () => {
14928
+ this.currentTrek = this.trek ? this.trek : state.currentTrek;
14929
+ if (this.currentTrek) {
14930
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14931
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
14932
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14933
+ }
14934
+ });
14557
14935
  }
14558
14936
  render() {
14559
14937
  var _a, _b, _c, _d, _e, _f, _g;
14560
- return (index.h(index.Host, null, index.h("div", { class: "trek-detail-container" }, index.h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments[0] && index.h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" }), index.h("div", { class: "sub-container" }, index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
14938
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-shade': this.colorPrimaryShade, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (index.h("div", { class: "trek-detail-container" }, index.h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (index.h("img", { class: "image", src: this.currentTrek.attachments[0].thumbnail, loading: "lazy" })), index.h("div", { class: "sub-container" }, index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
14561
14939
  _b.label), index.h("div", { class: "icon-label duration" }, index.h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)), index.h("div", { class: "icon-label route" }, ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && index.h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
14562
14940
  _e.route)), index.h("div", { class: "row" }, index.h("div", { class: "icon-label length" }, index.h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), index.h("div", { class: "icon-label ascent" }, index.h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent)), index.h("div", { class: "icon-label practice" }, ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && index.h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
14563
- _g.name)))), index.h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser }))));
14941
+ _g.name)))), index.h("div", { class: "downloads-container" }, index.h("div", { class: "download-title" }, "T\u00E9l\u00E9chargements"), index.h("div", { class: "links-container" }, index.h("a", { href: `${this.currentTrek.gpx}` }, "GPX"), index.h("a", { href: `${this.currentTrek.kml}` }, "KML"), index.h("a", { href: `${this.currentTrek.pdf}` }, "PDF"))), index.h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser }), state.currentSensitiveAreas && state.currentSensitiveAreas.length > 0 && (index.h("div", { class: "sensitive-areas-container" }, index.h("div", { class: "sensitive-areas-title" }, "Zones sensibles"), state.currentSensitiveAreas.map(sensitiveArea => (index.h("grw-sensitive-area-detail", { sensitiveArea: sensitiveArea }))))), state.currentInformationDesks && state.currentInformationDesks.length > 0 && (index.h("div", { class: "information-desks-container" }, index.h("div", { class: "information-desks-title" }, "Lieux de renseignement"), state.currentInformationDesks.map(informationDesk => (index.h("grw-information-desk-detail", { informationDesk: informationDesk }))))), state.currentPois && state.currentPois.length > 0 && (index.h("div", { class: "pois-container" }, index.h("div", { class: "pois-title" }, "Points d'int\u00E9r\u00EAts"), state.currentPois.map(poi => (index.h("grw-poi-detail", { poi: poi })))))))));
14564
14942
  }
14565
14943
  };
14566
14944
  GrwTrekDetail.style = grwTrekDetailCss;
@@ -14568,21 +14946,42 @@ GrwTrekDetail.style = grwTrekDetailCss;
14568
14946
  const GrwTrekProvider = class {
14569
14947
  constructor(hostRef) {
14570
14948
  index.registerInstance(this, hostRef);
14949
+ this.language = 'fr';
14571
14950
  }
14572
14951
  componentWillLoad() {
14573
14952
  state.api = this.api;
14953
+ const requests = [];
14954
+ requests.push(!state.difficulties ? fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`) : new Response('null'));
14955
+ requests.push(!state.routes ? fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`) : new Response('null'));
14956
+ requests.push(!state.practices ? fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`) : new Response('null'));
14957
+ requests.push(!state.themes ? fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`) : new Response('null'));
14574
14958
  return Promise.all([
14575
- fetch(`${this.api}trek/${this.trekId}/?language=fr&fields=id,name,attachments,description,description_teaser,difficulty,duration,ascent,length_2d,practice,route,geometry`),
14576
- fetch(`${this.api}trek_difficulty/?language=fr`),
14577
- fetch(`${this.api}trek_route/?language=fr`),
14578
- fetch(`${this.api}trek_practice/?language=fr`),
14959
+ ...requests,
14960
+ fetch(`${this.api}sensitivearea/?language=${this.language}&trek=${this.trekId}&fields=id,geometry,name,description`).catch(() => new Response('null')),
14961
+ fetch(`${this.api}poi/?language=${this.language}&trek=${this.trekId}&published=true&fields=id,name,description,attachments,type,type_label,type_pictogram,url,published,geometry&page_size=999`),
14962
+ fetch(`${this.api}informationdesk/?language=${this.language}&near_trek=${this.trekId}&fields=id,name,description,type,phone,email,website,municipality,postal_code,street,photo_url,latitude,longitude&page_size=999`),
14963
+ fetch(`${this.api}trek/${this.trekId}/?language=${this.language}&published=true&fields=id,name,attachments,description,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,geometry,gpx,kml,pdf,parking_location,departure`),
14579
14964
  ])
14580
14965
  .then(responses => Promise.all(responses.map(response => response.json())))
14581
- .then(([trek, difficulties, routes, practices]) => {
14966
+ .then(([difficulties, routes, practices, themes, sensitiveAreas, pois, informationDesks, trek]) => {
14967
+ if (difficulties) {
14968
+ state.difficulties = difficulties.results;
14969
+ }
14970
+ if (routes) {
14971
+ state.routes = routes.results;
14972
+ }
14973
+ if (practices) {
14974
+ state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
14975
+ }
14976
+ if (themes) {
14977
+ state.themes = themes.results;
14978
+ }
14979
+ if (sensitiveAreas) {
14980
+ state.currentSensitiveAreas = sensitiveAreas.results;
14981
+ }
14982
+ state.currentPois = pois.results;
14983
+ state.currentInformationDesks = informationDesks.results;
14582
14984
  state.currentTrek = trek;
14583
- state.difficulties = difficulties.results;
14584
- state.routes = routes.results;
14585
- state.practices = practices.results;
14586
14985
  });
14587
14986
  }
14588
14987
  disconnectedCallback() {
@@ -14593,23 +14992,29 @@ const GrwTrekProvider = class {
14593
14992
  }
14594
14993
  };
14595
14994
 
14596
- const grwTreksListCss = ":host{display:flex;flex-wrap:wrap;justify-content:center;max-height:calc(100vh - 64px);overflow-y:auto}@media (min-width: 664px){:host{justify-content:space-between}}@media (min-width: 996px){:host{justify-content:flex-start}}grw-trek-card{margin:6px}";
14995
+ const grwTreksListCss = ":host{font-family:\"Roboto\";width:100%;height:100%;max-height:100vh;overflow-y:auto}.current-treks-length{width:100%;text-align:center;padding:32px 0px;color:var(--color-primary);font-size:24px;font-weight:bold}.current-treks-container{display:flex;flex-wrap:wrap;justify-content:space-around}grw-trek-card{margin:6px}";
14597
14996
 
14598
14997
  const GrwTreksList = class {
14599
14998
  constructor(hostRef) {
14600
14999
  index.registerInstance(this, hostRef);
14601
15000
  this.treksToDisplay = [];
15001
+ this.colorPrimary = '#6b0030';
15002
+ this.colorPrimaryTint = '#974c6e';
15003
+ this.isLargeView = false;
14602
15004
  this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
14603
15005
  this.step = 10;
14604
15006
  }
14605
15007
  componentWillLoad() {
14606
- this.treksToDisplay = state.treks.slice(0, this.step);
14607
- this.element.addEventListener('scroll', this.handleInfiniteScrollBind);
15008
+ onChange('currentTreks', () => {
15009
+ this.element.addEventListener('scroll', this.handleInfiniteScrollBind);
15010
+ this.element.scroll({ top: 0 });
15011
+ this.treksToDisplay = [...state.currentTreks.slice(0, this.step)];
15012
+ });
14608
15013
  }
14609
15014
  handleInfiniteScroll(event) {
14610
15015
  if (event.composedPath()[0].scrollTop + event.composedPath()[0].scrollHeight / 2 >= event.composedPath()[0].scrollHeight) {
14611
15016
  if (this.treksToDisplay.length < state.treks.length) {
14612
- this.treksToDisplay = state.treks.slice(0, this.treksToDisplay.length + this.step >= state.treks.length ? state.treks.length : this.treksToDisplay.length + this.step);
15017
+ this.treksToDisplay = state.currentTreks.slice(0, this.treksToDisplay.length + this.step >= state.currentTreks.length ? state.currentTreks.length : this.treksToDisplay.length + this.step);
14613
15018
  }
14614
15019
  else {
14615
15020
  this.element.removeEventListener('scroll', this.handleInfiniteScrollBind);
@@ -14617,7 +15022,7 @@ const GrwTreksList = class {
14617
15022
  }
14618
15023
  }
14619
15024
  render() {
14620
- return (index.h(index.Host, { class: "treks-list-container" }, this.treksToDisplay.map(trek => (index.h("grw-trek-card", { trek: trek })))));
15025
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, index.h("div", { class: "current-treks-length" }, `${state.currentTreks.length} résultat${state.currentTreks.length > 1 ? 's' : ''}`), index.h("div", { class: "current-treks-container" }, this.treksToDisplay.map(trek => (index.h("grw-trek-card", { key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint }))))));
14621
15026
  }
14622
15027
  get element() { return index.getElement(this); }
14623
15028
  };
@@ -14626,26 +15031,41 @@ GrwTreksList.style = grwTreksListCss;
14626
15031
  const GrwTreksProvider = class {
14627
15032
  constructor(hostRef) {
14628
15033
  index.registerInstance(this, hostRef);
15034
+ this.language = 'fr';
14629
15035
  }
14630
15036
  componentWillLoad() {
14631
15037
  state.api = this.api;
14632
- let treksRequest = `${this.api}trek/?language=fr`;
14633
- if (this.portals) {
14634
- treksRequest += `&portals=${this.portals}`;
14635
- }
14636
- treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,route,departure_geom&page_size=999`;
15038
+ let treksRequest = `${this.api}trek/?language=${this.language}`;
15039
+ this.inBbox && (treksRequest += `&in_bbox=${this.inBbox}`);
15040
+ this.cities && (treksRequest += `&cities=${this.cities}`);
15041
+ this.districts && (treksRequest += `&districts=${this.districts}`);
15042
+ this.structures && (treksRequest += `&structures=${this.structures}`);
15043
+ this.themes && (treksRequest += `&themes=${this.themes}`);
15044
+ this.portals && (treksRequest += `&portals=${this.portals}`);
15045
+ this.routes && (treksRequest += `&routes=${this.routes}`);
15046
+ this.practices && (treksRequest += `&practices=${this.practices}`);
15047
+ treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_geom&page_size=999`;
14637
15048
  return Promise.all([
15049
+ fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`),
15050
+ fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`),
15051
+ fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`),
15052
+ fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`),
14638
15053
  fetch(treksRequest),
14639
- fetch(`${this.api}trek_difficulty/?language=fr`),
14640
- fetch(`${this.api}trek_route/?language=fr`),
14641
- fetch(`${this.api}trek_practice/?language=fr`),
14642
15054
  ])
14643
15055
  .then(responses => Promise.all(responses.map(response => response.json())))
14644
- .then(([treks, difficulties, routes, practices]) => {
14645
- state.treks = treks.results;
15056
+ .then(([difficulties, routes, practices, themes, treks]) => {
14646
15057
  state.difficulties = difficulties.results;
14647
15058
  state.routes = routes.results;
14648
- state.practices = practices.results;
15059
+ state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
15060
+ state.themes = themes.results;
15061
+ state.durations = [
15062
+ { id: 1, name: '0 - 1h', minValue: 0, maxValue: 1, selected: false },
15063
+ { id: 2, name: '1 - 2h', minValue: 1, maxValue: 2, selected: false },
15064
+ { id: 3, name: '2 - 5h', minValue: 2, maxValue: 5, selected: false },
15065
+ { id: 4, name: '5 - 10h', minValue: 5, maxValue: 10, selected: false },
15066
+ ];
15067
+ state.treks = treks.results;
15068
+ state.currentTreks = treks.results;
14649
15069
  });
14650
15070
  }
14651
15071
  render() {
@@ -14654,7 +15074,11 @@ const GrwTreksProvider = class {
14654
15074
  };
14655
15075
 
14656
15076
  exports.grw_app = GrwApp;
15077
+ exports.grw_filter = GrwFilter;
15078
+ exports.grw_information_desk_detail = GrwInformationDeskDetail;
14657
15079
  exports.grw_map = GrwMap;
15080
+ exports.grw_poi_detail = GrwPoiDetail;
15081
+ exports.grw_sensitive_area_detail = GrwSensitiveAreaDetail;
14658
15082
  exports.grw_trek_card = GrwTrekCard;
14659
15083
  exports.grw_trek_detail = GrwTrekDetail;
14660
15084
  exports.grw_trek_provider = GrwTrekProvider;