@geotrekce/geotrek-rando-widget 0.0.13 → 0.0.15

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 (105) hide show
  1. package/dist/cjs/css-shim-1269258a.js +6 -0
  2. package/dist/cjs/{dom-d5e52c7e.js → dom-36862b77.js} +1 -1
  3. package/dist/cjs/geotrek-rando-widget.cjs.js +4 -4
  4. package/dist/cjs/grw-app.cjs.entry.js +5 -4
  5. package/dist/cjs/grw-filter_6.cjs.entry.js +489 -183
  6. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +2 -2
  7. package/dist/cjs/grw-trek-card.cjs.entry.js +15 -7
  8. package/dist/cjs/{index-66d58516.js → index-e5425fef.js} +437 -266
  9. package/dist/cjs/loader.cjs.js +4 -4
  10. package/dist/cjs/{shadow-css-cf936b02.js → shadow-css-346c0795.js} +1 -1
  11. package/dist/cjs/{store-d301af22.js → store-a9172740.js} +4 -2
  12. package/dist/collection/collection-manifest.json +2 -2
  13. package/dist/collection/components/grw-app/grw-app.css +4 -0
  14. package/dist/collection/components/grw-app/grw-app.js +432 -450
  15. package/dist/collection/components/grw-filter/grw-filter.js +65 -61
  16. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +35 -44
  17. package/dist/collection/components/grw-map/grw-map.css +5 -4
  18. package/dist/collection/components/grw-map/grw-map.js +251 -217
  19. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +33 -32
  20. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +42 -47
  21. package/dist/collection/components/grw-trek-card/grw-trek-card.js +142 -129
  22. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +135 -208
  23. package/dist/collection/components/grw-treks-list/grw-treks-list.js +95 -65
  24. package/dist/collection/store/grw-trek-provider.js +61 -55
  25. package/dist/collection/store/grw-treks-provider.js +181 -177
  26. package/dist/collection/store/store.js +3 -2
  27. package/dist/components/grw-app.js +4 -3
  28. package/dist/components/grw-map2.js +467 -176
  29. package/dist/components/grw-trek-card2.js +17 -7
  30. package/dist/components/grw-trek-detail2.js +10 -3
  31. package/dist/components/grw-trek-provider2.js +6 -2
  32. package/dist/components/grw-treks-list2.js +7 -2
  33. package/dist/components/grw-treks-provider2.js +5 -3
  34. package/dist/components/store.js +3 -2
  35. package/dist/esm/css-shim-88cc621b.js +4 -0
  36. package/dist/esm/{dom-9794f747.js → dom-665d6011.js} +1 -1
  37. package/dist/esm/geotrek-rando-widget.js +4 -4
  38. package/dist/esm/grw-app.entry.js +5 -4
  39. package/dist/esm/grw-filter_6.entry.js +489 -183
  40. package/dist/esm/grw-information-desk-detail_3.entry.js +2 -2
  41. package/dist/esm/grw-trek-card.entry.js +15 -7
  42. package/dist/esm/{index-899307bb.js → index-185d186f.js} +437 -266
  43. package/dist/esm/loader.js +4 -4
  44. package/dist/esm/polyfills/css-shim.js +1 -1
  45. package/dist/esm/{shadow-css-4cd4480f.js → shadow-css-b18e99d7.js} +1 -1
  46. package/dist/esm/{store-70461a28.js → store-38e90440.js} +4 -3
  47. package/dist/esm-es5/css-shim-88cc621b.js +1 -0
  48. package/dist/esm-es5/{dom-9794f747.js → dom-665d6011.js} +0 -0
  49. package/dist/esm-es5/geotrek-rando-widget.js +1 -1
  50. package/dist/esm-es5/grw-app.entry.js +1 -1
  51. package/dist/esm-es5/grw-filter_6.entry.js +3 -3
  52. package/dist/esm-es5/grw-information-desk-detail_3.entry.js +1 -1
  53. package/dist/esm-es5/grw-trek-card.entry.js +1 -1
  54. package/dist/esm-es5/index-185d186f.js +2 -0
  55. package/dist/esm-es5/loader.js +1 -1
  56. package/dist/esm-es5/{shadow-css-4cd4480f.js → shadow-css-b18e99d7.js} +0 -0
  57. package/dist/esm-es5/{store-70461a28.js → store-38e90440.js} +1 -1
  58. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  59. package/dist/geotrek-rando-widget/geotrek-rando-widget.js +2 -2
  60. package/dist/geotrek-rando-widget/p-144c62f8.system.entry.js +1 -0
  61. package/dist/geotrek-rando-widget/p-23a696ea.system.entry.js +6 -0
  62. package/dist/geotrek-rando-widget/p-412fe797.system.js +1 -0
  63. package/dist/geotrek-rando-widget/p-4b12d113.js +1 -0
  64. package/dist/geotrek-rando-widget/p-54bf2ec8.js +2 -0
  65. package/dist/geotrek-rando-widget/{p-d1582cff.js → p-62b28500.js} +0 -0
  66. package/dist/geotrek-rando-widget/{p-2bd0278f.system.entry.js → p-6484dee6.system.entry.js} +1 -1
  67. package/dist/geotrek-rando-widget/{p-c8c96517.system.js → p-6a050b2c.system.js} +0 -0
  68. package/dist/geotrek-rando-widget/{p-b1530d9c.system.js → p-88092d06.system.js} +0 -0
  69. package/dist/geotrek-rando-widget/{p-533fc2bb.entry.js → p-911224bd.entry.js} +1 -1
  70. package/dist/geotrek-rando-widget/p-b44ba765.entry.js +1 -0
  71. package/dist/geotrek-rando-widget/p-bd5f732d.entry.js +1 -0
  72. package/dist/geotrek-rando-widget/p-d2dd6057.js +1 -0
  73. package/dist/geotrek-rando-widget/p-d6fffac2.entry.js +1 -0
  74. package/dist/geotrek-rando-widget/p-dd8d9020.system.js +2 -0
  75. package/dist/geotrek-rando-widget/p-e2652fee.system.js +1 -0
  76. package/dist/geotrek-rando-widget/p-e763374d.system.entry.js +1 -0
  77. package/dist/geotrek-rando-widget/{p-4eaf20b7.js → p-f26ed61d.js} +0 -0
  78. package/dist/geotrek-rando-widget/{p-82ca029f.system.js → p-f7cc8285.system.js} +1 -1
  79. package/dist/types/components/grw-map/grw-map.d.ts +3 -1
  80. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +4 -1
  81. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +3 -1
  82. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
  83. package/dist/types/components.d.ts +8 -0
  84. package/dist/types/stencil-public-runtime.d.ts +15 -4
  85. package/dist/types/store/store.d.ts +5 -3
  86. package/dist/types/types/types.d.ts +6 -0
  87. package/loader/package.json +1 -0
  88. package/package.json +12 -12
  89. package/readme.md +4 -6
  90. package/dist/cjs/css-shim-6f592941.js +0 -6
  91. package/dist/esm/css-shim-2d0a698c.js +0 -4
  92. package/dist/esm-es5/css-shim-2d0a698c.js +0 -1
  93. package/dist/esm-es5/index-899307bb.js +0 -2
  94. package/dist/geotrek-rando-widget/p-067c02c4.system.js +0 -1
  95. package/dist/geotrek-rando-widget/p-0c5b047c.js +0 -1
  96. package/dist/geotrek-rando-widget/p-18038011.js +0 -1
  97. package/dist/geotrek-rando-widget/p-2712caa8.system.entry.js +0 -6
  98. package/dist/geotrek-rando-widget/p-32d97a4f.system.js +0 -1
  99. package/dist/geotrek-rando-widget/p-3ed52659.entry.js +0 -1
  100. package/dist/geotrek-rando-widget/p-4690907e.js +0 -2
  101. package/dist/geotrek-rando-widget/p-48d5dde7.entry.js +0 -1
  102. package/dist/geotrek-rando-widget/p-8f9914f4.system.js +0 -2
  103. package/dist/geotrek-rando-widget/p-e1431f36.system.entry.js +0 -1
  104. package/dist/geotrek-rando-widget/p-e38f4ff4.system.entry.js +0 -1
  105. package/dist/geotrek-rando-widget/p-f5d98aae.entry.js +0 -1
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host, e as createEvent, g as getElement } from './index-899307bb.js';
2
- import { s as state, o as onChange } from './store-70461a28.js';
1
+ import { r as registerInstance, h, H as Host, e as createEvent, g as getElement } from './index-185d186f.js';
2
+ import { s as state, o as onChange, r as reset } from './store-38e90440.js';
3
3
  import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length-d82189db.js';
4
4
 
5
5
  const grwFilterCss = ".filter-name{margin-left:8px;color:var(--color-primary);font-size:24px;font-weight:bold}.filter-button-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.filter-button-container .filter-button,.filter-button-container .selected-filter-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;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)}";
@@ -91,14 +91,14 @@ function commonjsRequire () {
91
91
 
92
92
  var leafletSrc = createCommonjsModule(function (module, exports) {
93
93
  /* @preserve
94
- * Leaflet 1.8.0, a JS library for interactive maps. https://leafletjs.com
94
+ * Leaflet 1.9.2, a JS library for interactive maps. https://leafletjs.com
95
95
  * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
96
96
  */
97
97
 
98
98
  (function (global, factory) {
99
99
  factory(exports) ;
100
100
  })(commonjsGlobal, (function (exports) {
101
- var version = "1.8.0";
101
+ var version = "1.9.2";
102
102
 
103
103
  /*
104
104
  * @namespace Util
@@ -594,35 +594,30 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
594
594
  },
595
595
 
596
596
  // attach listener (without syntactic sugar now)
597
- _on: function (type, fn, context) {
597
+ _on: function (type, fn, context, _once) {
598
598
  if (typeof fn !== 'function') {
599
599
  console.warn('wrong listener type: ' + typeof fn);
600
600
  return;
601
601
  }
602
- this._events = this._events || {};
603
602
 
604
- /* get/init listeners for type */
605
- var typeListeners = this._events[type];
606
- if (!typeListeners) {
607
- typeListeners = [];
608
- this._events[type] = typeListeners;
603
+ // check if fn already there
604
+ if (this._listens(type, fn, context) !== false) {
605
+ return;
609
606
  }
610
607
 
611
608
  if (context === this) {
612
609
  // Less memory footprint.
613
610
  context = undefined;
614
611
  }
615
- var newListener = {fn: fn, ctx: context},
616
- listeners = typeListeners;
617
612
 
618
- // check if fn already there
619
- for (var i = 0, len = listeners.length; i < len; i++) {
620
- if (listeners[i].fn === fn && listeners[i].ctx === context) {
621
- return;
622
- }
613
+ var newListener = {fn: fn, ctx: context};
614
+ if (_once) {
615
+ newListener.once = true;
623
616
  }
624
617
 
625
- listeners.push(newListener);
618
+ this._events = this._events || {};
619
+ this._events[type] = this._events[type] || [];
620
+ this._events[type].push(newListener);
626
621
  },
627
622
 
628
623
  _off: function (type, fn, context) {
@@ -630,10 +625,11 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
630
625
  i,
631
626
  len;
632
627
 
633
- if (!this._events) { return; }
628
+ if (!this._events) {
629
+ return;
630
+ }
634
631
 
635
632
  listeners = this._events[type];
636
-
637
633
  if (!listeners) {
638
634
  return;
639
635
  }
@@ -651,32 +647,24 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
651
647
  return;
652
648
  }
653
649
 
654
- if (context === this) {
655
- context = undefined;
656
- }
657
-
658
650
  if (typeof fn !== 'function') {
659
651
  console.warn('wrong listener type: ' + typeof fn);
660
652
  return;
661
653
  }
654
+
662
655
  // find fn and remove it
663
- for (i = 0, len = listeners.length; i < len; i++) {
664
- var l = listeners[i];
665
- if (l.ctx !== context) { continue; }
666
- if (l.fn === fn) {
667
- if (this._firingCount) {
668
- // set the removed listener to noop so that's not called if remove happens in fire
669
- l.fn = falseFn;
670
-
671
- /* copy array in case events are being fired */
672
- this._events[type] = listeners = listeners.slice();
673
- }
674
- listeners.splice(i, 1);
656
+ var index = this._listens(type, fn, context);
657
+ if (index !== false) {
658
+ var listener = listeners[index];
659
+ if (this._firingCount) {
660
+ // set the removed listener to noop so that's not called if remove happens in fire
661
+ listener.fn = falseFn;
675
662
 
676
- return;
663
+ /* copy array in case events are being fired */
664
+ this._events[type] = listeners = listeners.slice();
677
665
  }
666
+ listeners.splice(index, 1);
678
667
  }
679
- console.warn('listener not found');
680
668
  },
681
669
 
682
670
  // @method fire(type: String, data?: Object, propagate?: Boolean): this
@@ -694,12 +682,16 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
694
682
 
695
683
  if (this._events) {
696
684
  var listeners = this._events[type];
697
-
698
685
  if (listeners) {
699
686
  this._firingCount = (this._firingCount + 1) || 1;
700
687
  for (var i = 0, len = listeners.length; i < len; i++) {
701
688
  var l = listeners[i];
702
- l.fn.call(l.ctx || this, event);
689
+ // off overwrites l.fn, so we need to copy fn to a var
690
+ var fn = l.fn;
691
+ if (l.once) {
692
+ this.off(type, fn, l.ctx);
693
+ }
694
+ fn.call(l.ctx || this, event);
703
695
  }
704
696
 
705
697
  this._firingCount--;
@@ -715,45 +707,85 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
715
707
  },
716
708
 
717
709
  // @method listens(type: String, propagate?: Boolean): Boolean
710
+ // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean
718
711
  // Returns `true` if a particular event type has any listeners attached to it.
719
712
  // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
720
- listens: function (type, propagate) {
713
+ listens: function (type, fn, context, propagate) {
721
714
  if (typeof type !== 'string') {
722
715
  console.warn('"string" type argument expected');
723
716
  }
717
+
718
+ // we don't overwrite the input `fn` value, because we need to use it for propagation
719
+ var _fn = fn;
720
+ if (typeof fn !== 'function') {
721
+ propagate = !!fn;
722
+ _fn = undefined;
723
+ context = undefined;
724
+ }
725
+
724
726
  var listeners = this._events && this._events[type];
725
- if (listeners && listeners.length) { return true; }
727
+ if (listeners && listeners.length) {
728
+ if (this._listens(type, _fn, context) !== false) {
729
+ return true;
730
+ }
731
+ }
726
732
 
727
733
  if (propagate) {
728
734
  // also check parents for listeners if event propagates
729
735
  for (var id in this._eventParents) {
730
- if (this._eventParents[id].listens(type, propagate)) { return true; }
736
+ if (this._eventParents[id].listens(type, fn, context, propagate)) { return true; }
731
737
  }
732
738
  }
733
739
  return false;
734
740
  },
735
741
 
742
+ // returns the index (number) or false
743
+ _listens: function (type, fn, context) {
744
+ if (!this._events) {
745
+ return false;
746
+ }
747
+
748
+ var listeners = this._events[type] || [];
749
+ if (!fn) {
750
+ return !!listeners.length;
751
+ }
752
+
753
+ if (context === this) {
754
+ // Less memory footprint.
755
+ context = undefined;
756
+ }
757
+
758
+ for (var i = 0, len = listeners.length; i < len; i++) {
759
+ if (listeners[i].fn === fn && listeners[i].ctx === context) {
760
+ return i;
761
+ }
762
+ }
763
+ return false;
764
+
765
+ },
766
+
736
767
  // @method once(…): this
737
768
  // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.
738
769
  once: function (types, fn, context) {
739
770
 
771
+ // types can be a map of types/handlers
740
772
  if (typeof types === 'object') {
741
773
  for (var type in types) {
742
- this.once(type, types[type], fn);
774
+ // we don't process space-separated events here for performance;
775
+ // it's a hot path since Layer uses the on(obj) syntax
776
+ this._on(type, types[type], fn, true);
743
777
  }
744
- return this;
745
- }
746
778
 
747
- var handler = bind(function () {
748
- this
749
- .off(types, fn, context)
750
- .off(types, handler, context);
751
- }, this);
779
+ } else {
780
+ // types can be a string of space-separated words
781
+ types = splitWords(types);
782
+
783
+ for (var i = 0, len = types.length; i < len; i++) {
784
+ this._on(types[i], fn, context, true);
785
+ }
786
+ }
752
787
 
753
- // add a listener that's executed once and removed after that
754
- return this
755
- .on(types, fn, context)
756
- .on(types, handler, context);
788
+ return this;
757
789
  },
758
790
 
759
791
  // @method addEventParent(obj: Evented): this
@@ -1069,21 +1101,36 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1069
1101
  Bounds.prototype = {
1070
1102
  // @method extend(point: Point): this
1071
1103
  // Extends the bounds to contain the given point.
1072
- extend: function (point) { // (Point)
1073
- point = toPoint(point);
1104
+
1105
+ // @alternative
1106
+ // @method extend(otherBounds: Bounds): this
1107
+ // Extend the bounds to contain the given bounds
1108
+ extend: function (obj) {
1109
+ var min2, max2;
1110
+ if (!obj) { return this; }
1111
+
1112
+ if (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) {
1113
+ min2 = max2 = toPoint(obj);
1114
+ } else {
1115
+ obj = toBounds(obj);
1116
+ min2 = obj.min;
1117
+ max2 = obj.max;
1118
+
1119
+ if (!min2 || !max2) { return this; }
1120
+ }
1074
1121
 
1075
1122
  // @property min: Point
1076
1123
  // The top left corner of the rectangle.
1077
1124
  // @property max: Point
1078
1125
  // The bottom right corner of the rectangle.
1079
1126
  if (!this.min && !this.max) {
1080
- this.min = point.clone();
1081
- this.max = point.clone();
1127
+ this.min = min2.clone();
1128
+ this.max = max2.clone();
1082
1129
  } else {
1083
- this.min.x = Math.min(point.x, this.min.x);
1084
- this.max.x = Math.max(point.x, this.max.x);
1085
- this.min.y = Math.min(point.y, this.min.y);
1086
- this.max.y = Math.max(point.y, this.max.y);
1130
+ this.min.x = Math.min(min2.x, this.min.x);
1131
+ this.max.x = Math.max(max2.x, this.max.x);
1132
+ this.min.y = Math.min(min2.y, this.min.y);
1133
+ this.max.y = Math.max(max2.y, this.max.y);
1087
1134
  }
1088
1135
  return this;
1089
1136
  },
@@ -1091,7 +1138,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1091
1138
  // @method getCenter(round?: Boolean): Point
1092
1139
  // Returns the center point of the bounds.
1093
1140
  getCenter: function (round) {
1094
- return new Point(
1141
+ return toPoint(
1095
1142
  (this.min.x + this.max.x) / 2,
1096
1143
  (this.min.y + this.max.y) / 2, round);
1097
1144
  },
@@ -1099,13 +1146,13 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1099
1146
  // @method getBottomLeft(): Point
1100
1147
  // Returns the bottom-left point of the bounds.
1101
1148
  getBottomLeft: function () {
1102
- return new Point(this.min.x, this.max.y);
1149
+ return toPoint(this.min.x, this.max.y);
1103
1150
  },
1104
1151
 
1105
1152
  // @method getTopRight(): Point
1106
1153
  // Returns the top-right point of the bounds.
1107
1154
  getTopRight: function () { // -> Point
1108
- return new Point(this.max.x, this.min.y);
1155
+ return toPoint(this.max.x, this.min.y);
1109
1156
  },
1110
1157
 
1111
1158
  // @method getTopLeft(): Point
@@ -1185,9 +1232,40 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1185
1232
  return xOverlaps && yOverlaps;
1186
1233
  },
1187
1234
 
1235
+ // @method isValid(): Boolean
1236
+ // Returns `true` if the bounds are properly initialized.
1188
1237
  isValid: function () {
1189
1238
  return !!(this.min && this.max);
1190
- }
1239
+ },
1240
+
1241
+
1242
+ // @method pad(bufferRatio: Number): Bounds
1243
+ // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
1244
+ // For example, a ratio of 0.5 extends the bounds by 50% in each direction.
1245
+ // Negative values will retract the bounds.
1246
+ pad: function (bufferRatio) {
1247
+ var min = this.min,
1248
+ max = this.max,
1249
+ heightBuffer = Math.abs(min.x - max.x) * bufferRatio,
1250
+ widthBuffer = Math.abs(min.y - max.y) * bufferRatio;
1251
+
1252
+
1253
+ return toBounds(
1254
+ toPoint(min.x - heightBuffer, min.y - widthBuffer),
1255
+ toPoint(max.x + heightBuffer, max.y + widthBuffer));
1256
+ },
1257
+
1258
+
1259
+ // @method equals(otherBounds: Bounds): Boolean
1260
+ // Returns `true` if the rectangle is equivalent to the given bounds.
1261
+ equals: function (bounds) {
1262
+ if (!bounds) { return false; }
1263
+
1264
+ bounds = toBounds(bounds);
1265
+
1266
+ return this.min.equals(bounds.getTopLeft()) &&
1267
+ this.max.equals(bounds.getBottomRight());
1268
+ },
1191
1269
  };
1192
1270
 
1193
1271
 
@@ -2095,6 +2173,13 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2095
2173
  }
2096
2174
  }());
2097
2175
 
2176
+
2177
+ // @property mac: Boolean; `true` when the browser is running in a Mac platform
2178
+ var mac = navigator.platform.indexOf('Mac') === 0;
2179
+
2180
+ // @property mac: Boolean; `true` when the browser is running in a Linux platform
2181
+ var linux = navigator.platform.indexOf('Linux') === 0;
2182
+
2098
2183
  function userAgentContains(str) {
2099
2184
  return navigator.userAgent.toLowerCase().indexOf(str) >= 0;
2100
2185
  }
@@ -2133,7 +2218,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2133
2218
  canvas: canvas$1,
2134
2219
  svg: svg$1,
2135
2220
  vml: vml,
2136
- inlineSvg: inlineSvg
2221
+ inlineSvg: inlineSvg,
2222
+ mac: mac,
2223
+ linux: linux
2137
2224
  };
2138
2225
 
2139
2226
  /*
@@ -2276,6 +2363,25 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2276
2363
  return;
2277
2364
  }
2278
2365
 
2366
+ // When clicking on an <input>, the browser generates a click on its
2367
+ // <label> (and vice versa) triggering two clicks in quick succession.
2368
+ // This ignores clicks on elements which are a label with a 'for'
2369
+ // attribute (or children of such a label), but not children of
2370
+ // a <input>.
2371
+ var path = getPropagationPath(e);
2372
+ if (path.some(function (el) {
2373
+ return el instanceof HTMLLabelElement && el.attributes.for;
2374
+ }) &&
2375
+ !path.some(function (el) {
2376
+ return (
2377
+ el instanceof HTMLInputElement ||
2378
+ el instanceof HTMLSelectElement
2379
+ );
2380
+ })
2381
+ ) {
2382
+ return;
2383
+ }
2384
+
2279
2385
  var now = Date.now();
2280
2386
  if (now - last <= delay) {
2281
2387
  detail++;
@@ -2897,6 +3003,26 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2897
3003
  return this;
2898
3004
  }
2899
3005
 
3006
+ // @function getPropagationPath(ev: DOMEvent): Array
3007
+ // Compatibility polyfill for [`Event.composedPath()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath).
3008
+ // Returns an array containing the `HTMLElement`s that the given DOM event
3009
+ // should propagate to (if not stopped).
3010
+ function getPropagationPath(ev) {
3011
+ if (ev.composedPath) {
3012
+ return ev.composedPath();
3013
+ }
3014
+
3015
+ var path = [];
3016
+ var el = ev.target;
3017
+
3018
+ while (el) {
3019
+ path.push(el);
3020
+ el = el.parentNode;
3021
+ }
3022
+ return path;
3023
+ }
3024
+
3025
+
2900
3026
  // @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point
2901
3027
  // Gets normalized mouse position from a DOM event relative to the
2902
3028
  // `container` (border excluded) or to the whole page if not specified.
@@ -2916,12 +3042,15 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2916
3042
  );
2917
3043
  }
2918
3044
 
2919
- // Chrome on Win scrolls double the pixels as in other platforms (see #4538),
2920
- // and Firefox scrolls device pixels, not CSS pixels
2921
- var wheelPxFactor =
2922
- (Browser.win && Browser.chrome) ? 2 * window.devicePixelRatio :
2923
- Browser.gecko ? window.devicePixelRatio : 1;
2924
3045
 
3046
+ // except , Safari and
3047
+ // We need double the scroll pixels (see #7403 and #4538) for all Browsers
3048
+ // except OSX (Mac) -> 3x, Chrome running on Linux 1x
3049
+
3050
+ var wheelPxFactor =
3051
+ (Browser.linux && Browser.chrome) ? window.devicePixelRatio :
3052
+ Browser.mac ? window.devicePixelRatio * 3 :
3053
+ window.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1;
2925
3054
  // @function getWheelDelta(ev: DOMEvent): Number
2926
3055
  // Gets normalized wheel delta from a wheel DOM event, in vertical
2927
3056
  // pixels scrolled (negative if scrolling down).
@@ -2965,6 +3094,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2965
3094
  disableClickPropagation: disableClickPropagation,
2966
3095
  preventDefault: preventDefault,
2967
3096
  stop: stop,
3097
+ getPropagationPath: getPropagationPath,
2968
3098
  getMousePosition: getMousePosition,
2969
3099
  getWheelDelta: getWheelDelta,
2970
3100
  isExternalTarget: isExternalTarget,
@@ -2980,8 +3110,21 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2980
3110
  *
2981
3111
  * @example
2982
3112
  * ```js
2983
- * var fx = new L.PosAnimation();
2984
- * fx.run(el, [300, 500], 0.5);
3113
+ * var myPositionMarker = L.marker([48.864716, 2.294694]).addTo(map);
3114
+ *
3115
+ * myPositionMarker.on("click", function() {
3116
+ * var pos = map.latLngToLayerPoint(myPositionMarker.getLatLng());
3117
+ * pos.y -= 25;
3118
+ * var fx = new L.PosAnimation();
3119
+ *
3120
+ * fx.once('end',function() {
3121
+ * pos.y += 25;
3122
+ * fx.run(myPositionMarker._icon, pos, 0.8);
3123
+ * });
3124
+ *
3125
+ * fx.run(myPositionMarker._icon, pos, 0.3);
3126
+ * });
3127
+ *
2985
3128
  * ```
2986
3129
  *
2987
3130
  * @constructor L.PosAnimation()
@@ -3261,7 +3404,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
3261
3404
  }
3262
3405
 
3263
3406
  // animation didn't start, just reset the map view
3264
- this._resetView(center, zoom);
3407
+ this._resetView(center, zoom, options.pan && options.pan.noMoveStart);
3265
3408
 
3266
3409
  return this;
3267
3410
  },
@@ -3504,11 +3647,13 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
3504
3647
  setMaxBounds: function (bounds) {
3505
3648
  bounds = toLatLngBounds(bounds);
3506
3649
 
3650
+ if (this.listens('moveend', this._panInsideMaxBounds)) {
3651
+ this.off('moveend', this._panInsideMaxBounds);
3652
+ }
3653
+
3507
3654
  if (!bounds.isValid()) {
3508
3655
  this.options.maxBounds = null;
3509
- return this.off('moveend', this._panInsideMaxBounds);
3510
- } else if (this.options.maxBounds) {
3511
- this.off('moveend', this._panInsideMaxBounds);
3656
+ return this;
3512
3657
  }
3513
3658
 
3514
3659
  this.options.maxBounds = bounds;
@@ -3878,7 +4023,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
3878
4023
  this._checkIfLoaded();
3879
4024
 
3880
4025
  if (this._lastCenter && !this._moved()) {
3881
- return this._lastCenter;
4026
+ return this._lastCenter.clone();
3882
4027
  }
3883
4028
  return this.layerPointToLatLng(this._getCenterLayerPoint());
3884
4029
  },
@@ -4227,7 +4372,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
4227
4372
  // private methods that modify map state
4228
4373
 
4229
4374
  // @section Map state change events
4230
- _resetView: function (center, zoom) {
4375
+ _resetView: function (center, zoom, noMoveStart) {
4231
4376
  setPosition(this._mapPane, new Point(0, 0));
4232
4377
 
4233
4378
  var loading = !this._loaded;
@@ -4238,7 +4383,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
4238
4383
 
4239
4384
  var zoomChanged = this._zoom !== zoom;
4240
4385
  this
4241
- ._moveStart(zoomChanged, false)
4386
+ ._moveStart(zoomChanged, noMoveStart)
4242
4387
  ._move(center, zoom)
4243
4388
  ._moveEnd(zoomChanged);
4244
4389
 
@@ -4435,7 +4580,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
4435
4580
  },
4436
4581
 
4437
4582
  _isClickDisabled: function (el) {
4438
- while (el !== this._container) {
4583
+ while (el && el !== this._container) {
4439
4584
  if (el['_leaflet_disable_click']) { return true; }
4440
4585
  el = el.parentNode;
4441
4586
  }
@@ -5661,7 +5806,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
5661
5806
  return new Scale(options);
5662
5807
  };
5663
5808
 
5664
- var ukrainianFlag = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>';
5809
+ var ukrainianFlag = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>';
5665
5810
 
5666
5811
 
5667
5812
  /*
@@ -5730,7 +5875,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
5730
5875
  },
5731
5876
 
5732
5877
  // @method addAttribution(text: String): this
5733
- // Adds an attribution text (e.g. `'Vector data &copy; Mapbox'`).
5878
+ // Adds an attribution text (e.g. `'&copy; OpenStreetMap contributors'`).
5734
5879
  addAttribution: function (text) {
5735
5880
  if (!text) { return this; }
5736
5881
 
@@ -6320,6 +6465,55 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
6320
6465
  function _flat(latlngs) {
6321
6466
  console.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');
6322
6467
  return isFlat(latlngs);
6468
+ }
6469
+
6470
+ /* @function polylineCenter(latlngs: LatLng[], crs: CRS): LatLng
6471
+ * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polyline.
6472
+ */
6473
+ function polylineCenter(latlngs, crs) {
6474
+ var i, halfDist, segDist, dist, p1, p2, ratio, center;
6475
+
6476
+ if (!latlngs || latlngs.length === 0) {
6477
+ throw new Error('latlngs not passed');
6478
+ }
6479
+
6480
+ if (!isFlat(latlngs)) {
6481
+ console.warn('latlngs are not flat! Only the first ring will be used');
6482
+ latlngs = latlngs[0];
6483
+ }
6484
+
6485
+ var points = [];
6486
+ for (var j in latlngs) {
6487
+ points.push(crs.project(toLatLng(latlngs[j])));
6488
+ }
6489
+
6490
+ var len = points.length;
6491
+
6492
+ for (i = 0, halfDist = 0; i < len - 1; i++) {
6493
+ halfDist += points[i].distanceTo(points[i + 1]) / 2;
6494
+ }
6495
+
6496
+ // The line is so small in the current view that all points are on the same pixel.
6497
+ if (halfDist === 0) {
6498
+ center = points[0];
6499
+ } else {
6500
+ for (i = 0, dist = 0; i < len - 1; i++) {
6501
+ p1 = points[i];
6502
+ p2 = points[i + 1];
6503
+ segDist = p1.distanceTo(p2);
6504
+ dist += segDist;
6505
+
6506
+ if (dist > halfDist) {
6507
+ ratio = (dist - halfDist) / segDist;
6508
+ center = [
6509
+ p2.x - ratio * (p2.x - p1.x),
6510
+ p2.y - ratio * (p2.y - p1.y)
6511
+ ];
6512
+ break;
6513
+ }
6514
+ }
6515
+ }
6516
+ return crs.unproject(toPoint(center));
6323
6517
  }
6324
6518
 
6325
6519
  var LineUtil = {
@@ -6332,7 +6526,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
6332
6526
  _getBitCode: _getBitCode,
6333
6527
  _sqClosestPointOnSegment: _sqClosestPointOnSegment,
6334
6528
  isFlat: isFlat,
6335
- _flat: _flat
6529
+ _flat: _flat,
6530
+ polylineCenter: polylineCenter
6336
6531
  };
6337
6532
 
6338
6533
  /*
@@ -6387,11 +6582,55 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
6387
6582
  }
6388
6583
 
6389
6584
  return points;
6585
+ }
6586
+
6587
+ /* @function polygonCenter(latlngs: LatLng[] crs: CRS): LatLng
6588
+ * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polygon.
6589
+ */
6590
+ function polygonCenter(latlngs, crs) {
6591
+ var i, j, p1, p2, f, area, x, y, center;
6592
+
6593
+ if (!latlngs || latlngs.length === 0) {
6594
+ throw new Error('latlngs not passed');
6595
+ }
6596
+
6597
+ if (!isFlat(latlngs)) {
6598
+ console.warn('latlngs are not flat! Only the first ring will be used');
6599
+ latlngs = latlngs[0];
6600
+ }
6601
+
6602
+ var points = [];
6603
+ for (var k in latlngs) {
6604
+ points.push(crs.project(toLatLng(latlngs[k])));
6605
+ }
6606
+
6607
+ var len = points.length;
6608
+ area = x = y = 0;
6609
+
6610
+ // polygon centroid algorithm;
6611
+ for (i = 0, j = len - 1; i < len; j = i++) {
6612
+ p1 = points[i];
6613
+ p2 = points[j];
6614
+
6615
+ f = p1.y * p2.x - p2.y * p1.x;
6616
+ x += (p1.x + p2.x) * f;
6617
+ y += (p1.y + p2.y) * f;
6618
+ area += f * 3;
6619
+ }
6620
+
6621
+ if (area === 0) {
6622
+ // Polygon is so small that all points are on same pixel.
6623
+ center = points[0];
6624
+ } else {
6625
+ center = [x / area, y / area];
6626
+ }
6627
+ return crs.unproject(toPoint(center));
6390
6628
  }
6391
6629
 
6392
6630
  var PolyUtil = {
6393
6631
  __proto__: null,
6394
- clipPolygon: clipPolygon
6632
+ clipPolygon: clipPolygon,
6633
+ polygonCenter: polygonCenter
6395
6634
  };
6396
6635
 
6397
6636
  /*
@@ -8350,38 +8589,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
8350
8589
  if (!this._map) {
8351
8590
  throw new Error('Must add layer to map before using getCenter()');
8352
8591
  }
8353
-
8354
- var i, halfDist, segDist, dist, p1, p2, ratio,
8355
- points = this._rings[0],
8356
- len = points.length;
8357
-
8358
- if (!len) { return null; }
8359
-
8360
- // polyline centroid algorithm; only uses the first ring if there are multiple
8361
-
8362
- for (i = 0, halfDist = 0; i < len - 1; i++) {
8363
- halfDist += points[i].distanceTo(points[i + 1]) / 2;
8364
- }
8365
-
8366
- // The line is so small in the current view that all points are on the same pixel.
8367
- if (halfDist === 0) {
8368
- return this._map.layerPointToLatLng(points[0]);
8369
- }
8370
-
8371
- for (i = 0, dist = 0; i < len - 1; i++) {
8372
- p1 = points[i];
8373
- p2 = points[i + 1];
8374
- segDist = p1.distanceTo(p2);
8375
- dist += segDist;
8376
-
8377
- if (dist > halfDist) {
8378
- ratio = (dist - halfDist) / segDist;
8379
- return this._map.layerPointToLatLng([
8380
- p2.x - ratio * (p2.x - p1.x),
8381
- p2.y - ratio * (p2.y - p1.y)
8382
- ]);
8383
- }
8384
- }
8592
+ return polylineCenter(this._defaultShape(), this._map.options.crs);
8385
8593
  },
8386
8594
 
8387
8595
  // @method getBounds(): LatLngBounds
@@ -8623,39 +8831,14 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
8623
8831
  return !this._latlngs.length || !this._latlngs[0].length;
8624
8832
  },
8625
8833
 
8834
+ // @method getCenter(): LatLng
8835
+ // Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon.
8626
8836
  getCenter: function () {
8627
8837
  // throws error when not yet added to map as this center calculation requires projected coordinates
8628
8838
  if (!this._map) {
8629
8839
  throw new Error('Must add layer to map before using getCenter()');
8630
8840
  }
8631
-
8632
- var i, j, p1, p2, f, area, x, y, center,
8633
- points = this._rings[0],
8634
- len = points.length;
8635
-
8636
- if (!len) { return null; }
8637
-
8638
- // polygon centroid algorithm; only uses the first ring if there are multiple
8639
-
8640
- area = x = y = 0;
8641
-
8642
- for (i = 0, j = len - 1; i < len; j = i++) {
8643
- p1 = points[i];
8644
- p2 = points[j];
8645
-
8646
- f = p1.y * p2.x - p2.y * p1.x;
8647
- x += (p1.x + p2.x) * f;
8648
- y += (p1.y + p2.y) * f;
8649
- area += f * 3;
8650
- }
8651
-
8652
- if (area === 0) {
8653
- // Polygon is so small that all points are on same pixel.
8654
- center = points[0];
8655
- } else {
8656
- center = [x / area, y / area];
8657
- }
8658
- return this._map.layerPointToLatLng(center);
8841
+ return polygonCenter(this._defaultShape(), this._map.options.crs);
8659
8842
  },
8660
8843
 
8661
8844
  _convertLatLngs: function (latlngs) {
@@ -8940,14 +9123,24 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
8940
9123
 
8941
9124
  case 'GeometryCollection':
8942
9125
  for (i = 0, len = geometry.geometries.length; i < len; i++) {
8943
- var layer = geometryToLayer({
9126
+ var geoLayer = geometryToLayer({
8944
9127
  geometry: geometry.geometries[i],
8945
9128
  type: 'Feature',
8946
9129
  properties: geojson.properties
8947
9130
  }, options);
8948
9131
 
8949
- if (layer) {
8950
- layers.push(layer);
9132
+ if (geoLayer) {
9133
+ layers.push(geoLayer);
9134
+ }
9135
+ }
9136
+ return new FeatureGroup(layers);
9137
+
9138
+ case 'FeatureCollection':
9139
+ for (i = 0, len = geometry.features.length; i < len; i++) {
9140
+ var featureLayer = geometryToLayer(geometry.features[i], options);
9141
+
9142
+ if (featureLayer) {
9143
+ layers.push(featureLayer);
8951
9144
  }
8952
9145
  }
8953
9146
  return new FeatureGroup(layers);
@@ -9006,8 +9199,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9006
9199
  var coords = [];
9007
9200
 
9008
9201
  for (var i = 0, len = latlngs.length; i < len; i++) {
9202
+ // Check for flat arrays required to ensure unbalanced arrays are correctly converted in recursion
9009
9203
  coords.push(levelsDeep ?
9010
- latLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) :
9204
+ latLngsToCoords(latlngs[i], isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) :
9011
9205
  latLngToCoords(latlngs[i], precision));
9012
9206
  }
9013
9207
 
@@ -9616,13 +9810,25 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9616
9810
 
9617
9811
  // @option pane: String = undefined
9618
9812
  // `Map pane` where the overlay will be added.
9619
- pane: undefined
9813
+ pane: undefined,
9814
+
9815
+ // @option content: String|HTMLElement|Function = ''
9816
+ // Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be
9817
+ // passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay.
9818
+ content: ''
9620
9819
  },
9621
9820
 
9622
9821
  initialize: function (options, source) {
9623
- setOptions(this, options);
9624
-
9625
- this._source = source;
9822
+ if (options && (options instanceof L.LatLng || isArray(options))) {
9823
+ this._latlng = toLatLng(options);
9824
+ setOptions(this, source);
9825
+ } else {
9826
+ setOptions(this, options);
9827
+ this._source = source;
9828
+ }
9829
+ if (this.options.content) {
9830
+ this._content = this.options.content;
9831
+ }
9626
9832
  },
9627
9833
 
9628
9834
  // @method openOn(map: Map): this
@@ -9934,7 +10140,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9934
10140
  * marker.bindPopup(popupContent).openPopup();
9935
10141
  * ```
9936
10142
  * Path overlays like polylines also have a `bindPopup` method.
9937
- * Here's a more complicated way to open a popup on a map:
10143
+ *
10144
+ * A popup can be also standalone:
9938
10145
  *
9939
10146
  * ```js
9940
10147
  * var popup = L.popup()
@@ -9942,6 +10149,11 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9942
10149
  * .setContent('<p>Hello world!<br />This is a nice popup.</p>')
9943
10150
  * .openOn(map);
9944
10151
  * ```
10152
+ * or
10153
+ * ```js
10154
+ * var popup = L.popup(latlng, {content: '<p>Hello world!<br />This is a nice popup.</p>')
10155
+ * .openOn(map);
10156
+ * ```
9945
10157
  */
9946
10158
 
9947
10159
 
@@ -9970,6 +10182,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9970
10182
  // @option maxHeight: Number = null
9971
10183
  // If set, creates a scrollable container of the given height
9972
10184
  // inside a popup if its content exceeds it.
10185
+ // The scrollable container can be styled using the
10186
+ // `leaflet-popup-scrolled` CSS class selector.
9973
10187
  maxHeight: null,
9974
10188
 
9975
10189
  // @option autoPan: Boolean = true
@@ -10115,7 +10329,10 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10115
10329
  closeButton.href = '#close';
10116
10330
  closeButton.innerHTML = '<span aria-hidden="true">&#215;</span>';
10117
10331
 
10118
- on(closeButton, 'click', this.close, this);
10332
+ on(closeButton, 'click', function (ev) {
10333
+ preventDefault(ev);
10334
+ this.close();
10335
+ }, this);
10119
10336
  }
10120
10337
  },
10121
10338
 
@@ -10209,6 +10426,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10209
10426
  // @namespace Popup
10210
10427
  // @factory L.popup(options?: Popup options, source?: Layer)
10211
10428
  // Instantiates a `Popup` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the popup with a reference to the Layer to which it refers.
10429
+ // @alternative
10430
+ // @factory L.popup(latlng: LatLng, options?: Popup options)
10431
+ // Instantiates a `Popup` object given `latlng` where the popup will open and an optional `options` object that describes its appearance and location.
10212
10432
  var popup = function (options, source) {
10213
10433
  return new Popup(options, source);
10214
10434
  };
@@ -10306,7 +10526,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10306
10526
  // @method openPopup(latlng?: LatLng): this
10307
10527
  // Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.
10308
10528
  openPopup: function (latlng) {
10309
- if (this._popup && this._popup._prepareOpen(latlng)) {
10529
+ if (this._popup && this._popup._prepareOpen(latlng || this._latlng)) {
10530
+
10310
10531
  // open the popup on the map
10311
10532
  this._popup.openOn(this._map);
10312
10533
  }
@@ -10392,10 +10613,28 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10392
10613
  * Used to display small texts on top of map layers.
10393
10614
  *
10394
10615
  * @example
10616
+ * If you want to just bind a tooltip to marker:
10395
10617
  *
10396
10618
  * ```js
10397
10619
  * marker.bindTooltip("my tooltip text").openTooltip();
10398
10620
  * ```
10621
+ * Path overlays like polylines also have a `bindTooltip` method.
10622
+ *
10623
+ * A tooltip can be also standalone:
10624
+ *
10625
+ * ```js
10626
+ * var tooltip = L.tooltip()
10627
+ * .setLatLng(latlng)
10628
+ * .setContent('Hello world!<br />This is a nice tooltip.')
10629
+ * .addTo(map);
10630
+ * ```
10631
+ * or
10632
+ * ```js
10633
+ * var tooltip = L.tooltip(latlng, {content: 'Hello world!<br />This is a nice tooltip.'})
10634
+ * .addTo(map);
10635
+ * ```
10636
+ *
10637
+ *
10399
10638
  * Note about tooltip offset. Leaflet takes two options in consideration
10400
10639
  * for computing tooltip offsetting:
10401
10640
  * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
@@ -10496,6 +10735,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10496
10735
  className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');
10497
10736
 
10498
10737
  this._contentNode = this._container = create$1('div', className);
10738
+
10739
+ this._container.setAttribute('role', 'tooltip');
10740
+ this._container.setAttribute('id', 'leaflet-tooltip-' + stamp(this));
10499
10741
  },
10500
10742
 
10501
10743
  _updateLayout: function () {},
@@ -10576,7 +10818,10 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10576
10818
 
10577
10819
  // @namespace Tooltip
10578
10820
  // @factory L.tooltip(options?: Tooltip options, source?: Layer)
10579
- // Instantiates a Tooltip object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers.
10821
+ // Instantiates a `Tooltip` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers.
10822
+ // @alternative
10823
+ // @factory L.tooltip(latlng: LatLng, options?: Tooltip options)
10824
+ // Instantiates a `Tooltip` object given `latlng` where the tooltip will open and an optional `options` object that describes its appearance and location.
10580
10825
  var tooltip = function (options, source) {
10581
10826
  return new Tooltip(options, source);
10582
10827
  };
@@ -10664,6 +10909,11 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10664
10909
  events.mouseover = this._openTooltip;
10665
10910
  events.mouseout = this.closeTooltip;
10666
10911
  events.click = this._openTooltip;
10912
+ if (this._map) {
10913
+ this._addFocusListeners();
10914
+ } else {
10915
+ events.add = this._addFocusListeners;
10916
+ }
10667
10917
  } else {
10668
10918
  events.add = this._openTooltip;
10669
10919
  }
@@ -10680,6 +10930,12 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10680
10930
  if (this._tooltip && this._tooltip._prepareOpen(latlng)) {
10681
10931
  // open the tooltip on the map
10682
10932
  this._tooltip.openOn(this._map);
10933
+
10934
+ if (this.getElement) {
10935
+ this._setAriaDescribedByOnLayer(this);
10936
+ } else if (this.eachLayer) {
10937
+ this.eachLayer(this._setAriaDescribedByOnLayer, this);
10938
+ }
10683
10939
  }
10684
10940
  return this;
10685
10941
  },
@@ -10722,6 +10978,33 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10722
10978
  return this._tooltip;
10723
10979
  },
10724
10980
 
10981
+ _addFocusListeners: function () {
10982
+ if (this.getElement) {
10983
+ this._addFocusListenersOnLayer(this);
10984
+ } else if (this.eachLayer) {
10985
+ this.eachLayer(this._addFocusListenersOnLayer, this);
10986
+ }
10987
+ },
10988
+
10989
+ _addFocusListenersOnLayer: function (layer) {
10990
+ var el = layer.getElement();
10991
+ if (el) {
10992
+ on(el, 'focus', function () {
10993
+ this._tooltip._source = layer;
10994
+ this.openTooltip();
10995
+ }, this);
10996
+ on(el, 'blur', this.closeTooltip, this);
10997
+ }
10998
+ },
10999
+
11000
+ _setAriaDescribedByOnLayer: function (layer) {
11001
+ var el = layer.getElement();
11002
+ if (el) {
11003
+ el.setAttribute('aria-describedby', this._tooltip._container.id);
11004
+ }
11005
+ },
11006
+
11007
+
10725
11008
  _openTooltip: function (e) {
10726
11009
  if (!this._tooltip || !this._map || (this._map.dragging && this._map.dragging.moving())) {
10727
11010
  return;
@@ -11737,7 +12020,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
11737
12020
  * @example
11738
12021
  *
11739
12022
  * ```js
11740
- * L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
12023
+ * L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
11741
12024
  * ```
11742
12025
  *
11743
12026
  * @section URL template
@@ -11824,13 +12107,19 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
11824
12107
 
11825
12108
  if (!options.zoomReverse) {
11826
12109
  options.zoomOffset++;
11827
- options.maxZoom--;
12110
+ options.maxZoom = Math.max(options.minZoom, options.maxZoom - 1);
11828
12111
  } else {
11829
12112
  options.zoomOffset--;
11830
- options.minZoom++;
12113
+ options.minZoom = Math.min(options.maxZoom, options.minZoom + 1);
11831
12114
  }
11832
12115
 
11833
12116
  options.minZoom = Math.max(0, options.minZoom);
12117
+ } else if (!options.zoomReverse) {
12118
+ // make sure maxZoom is gte minZoom
12119
+ options.maxZoom = Math.max(options.minZoom, options.maxZoom);
12120
+ } else {
12121
+ // make sure minZoom is lte maxZoom
12122
+ options.minZoom = Math.min(options.maxZoom, options.minZoom);
11834
12123
  }
11835
12124
 
11836
12125
  if (typeof options.subdomains === 'string') {
@@ -11877,18 +12166,12 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
11877
12166
  tile.referrerPolicy = this.options.referrerPolicy;
11878
12167
  }
11879
12168
 
11880
- /*
11881
- Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons
11882
- https://www.w3.org/TR/WCAG20-TECHS/H67
11883
- */
12169
+ // The alt attribute is set to the empty string,
12170
+ // allowing screen readers to ignore the decorative image tiles.
12171
+ // https://www.w3.org/WAI/tutorials/images/decorative/
12172
+ // https://www.w3.org/TR/html-aria/#el-img-empty-alt
11884
12173
  tile.alt = '';
11885
12174
 
11886
- /*
11887
- Set role="presentation" to force screen readers to ignore this
11888
- https://www.w3.org/TR/wai-aria/roles#textalternativecomputation
11889
- */
11890
- tile.setAttribute('role', 'presentation');
11891
-
11892
12175
  tile.src = this.getTileUrl(coords);
11893
12176
 
11894
12177
  return tile;
@@ -14081,7 +14364,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
14081
14364
 
14082
14365
  cancelAnimFrame(this._animRequest);
14083
14366
 
14084
- var moveFn = bind(map._move, map, this._center, this._zoom, {pinch: true, round: false});
14367
+ var moveFn = bind(map._move, map, this._center, this._zoom, {pinch: true, round: false}, undefined);
14085
14368
  this._animRequest = requestAnimFrame(moveFn, this, true);
14086
14369
 
14087
14370
  preventDefault(e);
@@ -14214,7 +14497,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
14214
14497
 
14215
14498
  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>`;
14216
14499
 
14217
- 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;-ms-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.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{-webkit-filter:inherit;filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;-webkit-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:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1), -webkit-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{-webkit-box-shadow:0 1px 5px rgba(0,0,0,0.65);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{-webkit-box-shadow:0 1px 5px rgba(0,0,0,0.4);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;-webkit-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{-webkit-box-shadow:none;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;-webkit-box-shadow:0 3px 14px rgba(0,0,0,0.4);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;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.4);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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align: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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align: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;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-animation:rotation 1s linear infinite;animation:rotation 1s linear infinite}@-webkit-keyframes rotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.leaflet-popup-content{width:144px;margin:0}.trek-departure-popup{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100px;height:auto;padding:24px}.trek-departure-popup img{border-radius:8px;-webkit-box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);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,.poi-tooltip .sensitive-area-name,.information-desks-tooltip .poi-name,.information-desks-tooltip .information-desks-name,.information-desks-tooltip .sensitive-area-name,.sensitive-area-tooltip .poi-name,.sensitive-area-tooltip .information-desks-name,.sensitive-area-tooltip .sensitive-area-name{color:var(--color-primary);font-weight:bold;font-size:12px}.sensitiveAreasCheckboxContainer{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background-color:#ffffff;padding:8px;border-radius:8px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.poi-icon img,.information-desks-icon img{width:36px !important}.parking-icon{background-color:#0000ff;border-radius:50%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:48px;height:48px;font-size:24px;color:#ffffff}.point-reference-icon{background-color:#ff0000;border:1px solid #ffffff;border-radius:50%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:24px;height:24px;font-size:18px;color:#ffffff}";
14500
+ 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;-ms-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.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{-webkit-filter:inherit;filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;-webkit-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:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1), -webkit-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{-webkit-box-shadow:0 1px 5px rgba(0,0,0,0.65);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{-webkit-box-shadow:0 1px 5px rgba(0,0,0,0.4);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-attribution-flag{display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em}.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;-webkit-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{-webkit-box-shadow:none;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;-webkit-box-shadow:0 3px 14px rgba(0,0,0,0.4);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}.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;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.4);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;print-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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align: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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align: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;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-animation:rotation 1s linear infinite;animation:rotation 1s linear infinite}@-webkit-keyframes rotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.leaflet-popup-content{width:144px;margin:0}.trek-departure-popup{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100px;height:auto;padding:24px}.trek-departure-popup img{border-radius:8px;-webkit-box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);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,.poi-tooltip .sensitive-area-name,.information-desks-tooltip .poi-name,.information-desks-tooltip .information-desks-name,.information-desks-tooltip .sensitive-area-name,.sensitive-area-tooltip .poi-name,.sensitive-area-tooltip .information-desks-name,.sensitive-area-tooltip .sensitive-area-name{color:var(--color-primary);font-weight:bold;font-size:12px}.sensitiveAreasCheckboxContainer{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background-color:#ffffff;padding:8px;border-radius:8px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.poi-icon img,.information-desks-icon img{width:36px !important}.parking-icon{background-color:#0000ff;border-radius:50%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:48px;height:48px;font-size:24px;color:#ffffff}.point-reference-icon{background-color:#ff0000;border:1px solid #ffffff;border-radius:50%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:24px;height:24px;font-size:18px;color:#ffffff}";
14218
14501
 
14219
14502
  const GrwMap = class {
14220
14503
  constructor(hostRef) {
@@ -14230,9 +14513,10 @@ const GrwMap = class {
14230
14513
  this.colorArrivalIcon = '#85003b';
14231
14514
  this.colorSensitiveArea = ' #4974a5';
14232
14515
  this.colorPoiIcon = '#974c6e';
14516
+ this.resetStoreOnDisconnected = true;
14233
14517
  this.handleTreksWithinBoundsBind = this.handleTreksWithinBounds.bind(this);
14234
14518
  }
14235
- connectedCallback() {
14519
+ componentDidLoad() {
14236
14520
  this.map = leafletSrc.map(this.element, {
14237
14521
  center: this.center.split(',').map(Number),
14238
14522
  zoom: this.zoom,
@@ -14353,7 +14637,8 @@ const GrwMap = class {
14353
14637
  }
14354
14638
  }
14355
14639
  handleTreksWithinBounds() {
14356
- if (!state.currentMapTreksBounds || state.currentMapTreksBounds.toBBoxString() !== this.map.getBounds().toBBoxString()) {
14640
+ if ((state.currentTreks && !state.currentMapTreksBounds) ||
14641
+ (state.currentTreks && state.currentMapTreksBounds && state.currentMapTreksBounds.toBBoxString() !== this.map.getBounds().toBBoxString())) {
14357
14642
  state.treksWithinBounds = state.currentTreks.filter(trek => this.map.getBounds().contains(leafletSrc.latLng(trek.departure_geom[1], trek.departure_geom[0])));
14358
14643
  }
14359
14644
  }
@@ -14601,6 +14886,11 @@ const GrwMap = class {
14601
14886
  this.currentPointsReferenceLayer = null;
14602
14887
  }
14603
14888
  }
14889
+ disconnectedCallback() {
14890
+ if (this.resetStoreOnDisconnected) {
14891
+ reset();
14892
+ }
14893
+ }
14604
14894
  render() {
14605
14895
  return (h(Host, { style: {
14606
14896
  '--color-primary': this.colorPrimary,
@@ -14622,6 +14912,7 @@ const GrwTrekDetail = class {
14622
14912
  this.colorPrimary = '#6b0030';
14623
14913
  this.colorPrimaryShade = '#4a0021';
14624
14914
  this.colorPrimaryTint = '#974c6e';
14915
+ this.resetStoreOnDisconnected = true;
14625
14916
  }
14626
14917
  connectedCallback() {
14627
14918
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
@@ -14653,6 +14944,11 @@ const GrwTrekDetail = class {
14653
14944
  }
14654
14945
  });
14655
14946
  }
14947
+ disconnectedCallback() {
14948
+ if (this.resetStoreOnDisconnected) {
14949
+ reset();
14950
+ }
14951
+ }
14656
14952
  render() {
14657
14953
  var _a, _b, _c, _d, _e, _f, _g;
14658
14954
  return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-shade': this.colorPrimaryShade, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-detail-container" }, h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
@@ -14687,6 +14983,7 @@ const GrwTrekProvider = class {
14687
14983
  requests.push(!state.routes ? fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`, { signal: this.signal }) : new Response('null'));
14688
14984
  requests.push(!state.practices ? fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`, { signal: this.signal }) : new Response('null'));
14689
14985
  requests.push(!state.themes ? fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }) : new Response('null'));
14986
+ requests.push(!state.cities ? fetch(`${this.api}city/?language=${this.language}&fields=id,name&published=true`, { signal: this.signal }) : new Response('null'));
14690
14987
  Promise.all([
14691
14988
  ...requests,
14692
14989
  fetch(`${this.api}sensitivearea/?language=${this.language}&published=true&trek=${this.trekId}&fields=id,geometry,name,description,contact,info_url,period,practices`, {
@@ -14701,10 +14998,10 @@ const GrwTrekProvider = class {
14701
14998
  }),
14702
14999
  fetch(`${this.api}poi_type/?language=${this.language}&fields=id,pictogram`, { signal: this.signal }),
14703
15000
  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`, { signal: this.signal }),
14704
- 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,arrival,altimetric_profile,ambiance,access,public_transport,advice,advised_parking,gear,labels,source,points_reference,disabled_infrastructure,accessibility_level,accessibility_slope,accessibility_width,accessibility_signage,accessibility_covering,accessibility_exposure,accessibility_advice,accessibilities`, { signal: this.signal }),
15001
+ 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,departure_city,arrival,altimetric_profile,ambiance,access,public_transport,advice,advised_parking,gear,labels,source,points_reference,disabled_infrastructure,accessibility_level,accessibility_slope,accessibility_width,accessibility_signage,accessibility_covering,accessibility_exposure,accessibility_advice,accessibilities`, { signal: this.signal }),
14705
15002
  ])
14706
15003
  .then(responses => Promise.all(responses.map(response => response.json())))
14707
- .then(([difficulties, routes, practices, themes, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, poiTypes, informationDesks, trek]) => {
15004
+ .then(([difficulties, routes, practices, themes, cities, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, poiTypes, informationDesks, trek]) => {
14708
15005
  state.trekNetworkError = false;
14709
15006
  if (difficulties) {
14710
15007
  state.difficulties = difficulties.results;
@@ -14718,6 +15015,9 @@ const GrwTrekProvider = class {
14718
15015
  if (themes) {
14719
15016
  state.themes = themes.results;
14720
15017
  }
15018
+ if (cities) {
15019
+ state.cities = cities.results;
15020
+ }
14721
15021
  if (sensitiveAreas) {
14722
15022
  state.currentSensitiveAreas = sensitiveAreas.results;
14723
15023
  }
@@ -14755,6 +15055,7 @@ const GrwTreksList = class {
14755
15055
  this.colorPrimary = '#6b0030';
14756
15056
  this.colorPrimaryTint = '#974c6e';
14757
15057
  this.isLargeView = false;
15058
+ this.resetStoreOnDisconnected = true;
14758
15059
  this.step = 10;
14759
15060
  this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
14760
15061
  this.shouldAddInfiniteScrollEvent = true;
@@ -14802,10 +15103,13 @@ const GrwTreksList = class {
14802
15103
  }
14803
15104
  }
14804
15105
  disconnectedCallback() {
15106
+ if (this.resetStoreOnDisconnected) {
15107
+ reset();
15108
+ }
14805
15109
  this.handleInfiniteScrollEvent(false);
14806
15110
  }
14807
15111
  render() {
14808
- return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
15112
+ return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { "reset-store-on-disconnected": "false", key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
14809
15113
  }
14810
15114
  get element() { return getElement(this); }
14811
15115
  };
@@ -14829,30 +15133,32 @@ const GrwTreksProvider = class {
14829
15133
  this.portals && (treksRequest += `&portals=${this.portals}`);
14830
15134
  this.routes && (treksRequest += `&routes=${this.routes}`);
14831
15135
  this.practices && (treksRequest += `&practices=${this.practices}`);
14832
- treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_geom&page_size=999`;
15136
+ treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_city,departure_geom&page_size=999`;
14833
15137
  Promise.all([
14834
15138
  fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }),
14835
15139
  fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`, { signal: this.signal }),
14836
15140
  fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`, { signal: this.signal }),
14837
15141
  fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }),
15142
+ fetch(`${this.api}city/?language=${this.language}&fields=id,name&published=true`, { signal: this.signal }),
14838
15143
  fetch(treksRequest, { signal: this.signal }),
14839
15144
  ])
14840
15145
  .then(responses => Promise.all(responses.map(response => response.json())))
14841
- .then(([difficulties, routes, practices, themes, treks]) => {
15146
+ .then(([difficulties, routes, practices, themes, cities, treks]) => {
14842
15147
  state.treksNetworkError = false;
14843
15148
  state.difficulties = difficulties.results;
14844
15149
  state.routes = routes.results;
14845
15150
  state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
14846
15151
  state.themes = themes.results;
15152
+ state.cities = cities.results;
14847
15153
  state.durations = [
14848
15154
  { id: 1, name: '0 - 1h', minValue: 0, maxValue: 1, selected: false },
14849
15155
  { id: 2, name: '1 - 2h', minValue: 1, maxValue: 2, selected: false },
14850
15156
  { id: 3, name: '2 - 5h', minValue: 2, maxValue: 5, selected: false },
14851
15157
  { id: 4, name: '5 - 10h', minValue: 5, maxValue: 10, selected: false },
14852
15158
  ];
14853
- state.treks = treks.results;
14854
15159
  state.currentTreks = treks.results;
14855
15160
  state.treksWithinBounds = treks.results;
15161
+ state.treks = treks.results;
14856
15162
  })
14857
15163
  .catch(() => (state.treksNetworkError = true));
14858
15164
  }