@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
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-66d58516.js');
6
- const store = require('./store-d301af22.js');
5
+ const index = require('./index-e5425fef.js');
6
+ const store = require('./store-a9172740.js');
7
7
  const length = require('./length-d315d156.js');
8
8
 
9
9
  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)}";
@@ -95,14 +95,14 @@ function commonjsRequire () {
95
95
 
96
96
  var leafletSrc = createCommonjsModule(function (module, exports) {
97
97
  /* @preserve
98
- * Leaflet 1.8.0, a JS library for interactive maps. https://leafletjs.com
98
+ * Leaflet 1.9.2, a JS library for interactive maps. https://leafletjs.com
99
99
  * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
100
100
  */
101
101
 
102
102
  (function (global, factory) {
103
103
  factory(exports) ;
104
104
  })(commonjsGlobal, (function (exports) {
105
- var version = "1.8.0";
105
+ var version = "1.9.2";
106
106
 
107
107
  /*
108
108
  * @namespace Util
@@ -598,35 +598,30 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
598
598
  },
599
599
 
600
600
  // attach listener (without syntactic sugar now)
601
- _on: function (type, fn, context) {
601
+ _on: function (type, fn, context, _once) {
602
602
  if (typeof fn !== 'function') {
603
603
  console.warn('wrong listener type: ' + typeof fn);
604
604
  return;
605
605
  }
606
- this._events = this._events || {};
607
606
 
608
- /* get/init listeners for type */
609
- var typeListeners = this._events[type];
610
- if (!typeListeners) {
611
- typeListeners = [];
612
- this._events[type] = typeListeners;
607
+ // check if fn already there
608
+ if (this._listens(type, fn, context) !== false) {
609
+ return;
613
610
  }
614
611
 
615
612
  if (context === this) {
616
613
  // Less memory footprint.
617
614
  context = undefined;
618
615
  }
619
- var newListener = {fn: fn, ctx: context},
620
- listeners = typeListeners;
621
616
 
622
- // check if fn already there
623
- for (var i = 0, len = listeners.length; i < len; i++) {
624
- if (listeners[i].fn === fn && listeners[i].ctx === context) {
625
- return;
626
- }
617
+ var newListener = {fn: fn, ctx: context};
618
+ if (_once) {
619
+ newListener.once = true;
627
620
  }
628
621
 
629
- listeners.push(newListener);
622
+ this._events = this._events || {};
623
+ this._events[type] = this._events[type] || [];
624
+ this._events[type].push(newListener);
630
625
  },
631
626
 
632
627
  _off: function (type, fn, context) {
@@ -634,10 +629,11 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
634
629
  i,
635
630
  len;
636
631
 
637
- if (!this._events) { return; }
632
+ if (!this._events) {
633
+ return;
634
+ }
638
635
 
639
636
  listeners = this._events[type];
640
-
641
637
  if (!listeners) {
642
638
  return;
643
639
  }
@@ -655,32 +651,24 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
655
651
  return;
656
652
  }
657
653
 
658
- if (context === this) {
659
- context = undefined;
660
- }
661
-
662
654
  if (typeof fn !== 'function') {
663
655
  console.warn('wrong listener type: ' + typeof fn);
664
656
  return;
665
657
  }
658
+
666
659
  // find fn and remove it
667
- for (i = 0, len = listeners.length; i < len; i++) {
668
- var l = listeners[i];
669
- if (l.ctx !== context) { continue; }
670
- if (l.fn === fn) {
671
- if (this._firingCount) {
672
- // set the removed listener to noop so that's not called if remove happens in fire
673
- l.fn = falseFn;
674
-
675
- /* copy array in case events are being fired */
676
- this._events[type] = listeners = listeners.slice();
677
- }
678
- listeners.splice(i, 1);
660
+ var index = this._listens(type, fn, context);
661
+ if (index !== false) {
662
+ var listener = listeners[index];
663
+ if (this._firingCount) {
664
+ // set the removed listener to noop so that's not called if remove happens in fire
665
+ listener.fn = falseFn;
679
666
 
680
- return;
667
+ /* copy array in case events are being fired */
668
+ this._events[type] = listeners = listeners.slice();
681
669
  }
670
+ listeners.splice(index, 1);
682
671
  }
683
- console.warn('listener not found');
684
672
  },
685
673
 
686
674
  // @method fire(type: String, data?: Object, propagate?: Boolean): this
@@ -698,12 +686,16 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
698
686
 
699
687
  if (this._events) {
700
688
  var listeners = this._events[type];
701
-
702
689
  if (listeners) {
703
690
  this._firingCount = (this._firingCount + 1) || 1;
704
691
  for (var i = 0, len = listeners.length; i < len; i++) {
705
692
  var l = listeners[i];
706
- l.fn.call(l.ctx || this, event);
693
+ // off overwrites l.fn, so we need to copy fn to a var
694
+ var fn = l.fn;
695
+ if (l.once) {
696
+ this.off(type, fn, l.ctx);
697
+ }
698
+ fn.call(l.ctx || this, event);
707
699
  }
708
700
 
709
701
  this._firingCount--;
@@ -719,45 +711,85 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
719
711
  },
720
712
 
721
713
  // @method listens(type: String, propagate?: Boolean): Boolean
714
+ // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean
722
715
  // Returns `true` if a particular event type has any listeners attached to it.
723
716
  // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
724
- listens: function (type, propagate) {
717
+ listens: function (type, fn, context, propagate) {
725
718
  if (typeof type !== 'string') {
726
719
  console.warn('"string" type argument expected');
727
720
  }
721
+
722
+ // we don't overwrite the input `fn` value, because we need to use it for propagation
723
+ var _fn = fn;
724
+ if (typeof fn !== 'function') {
725
+ propagate = !!fn;
726
+ _fn = undefined;
727
+ context = undefined;
728
+ }
729
+
728
730
  var listeners = this._events && this._events[type];
729
- if (listeners && listeners.length) { return true; }
731
+ if (listeners && listeners.length) {
732
+ if (this._listens(type, _fn, context) !== false) {
733
+ return true;
734
+ }
735
+ }
730
736
 
731
737
  if (propagate) {
732
738
  // also check parents for listeners if event propagates
733
739
  for (var id in this._eventParents) {
734
- if (this._eventParents[id].listens(type, propagate)) { return true; }
740
+ if (this._eventParents[id].listens(type, fn, context, propagate)) { return true; }
735
741
  }
736
742
  }
737
743
  return false;
738
744
  },
739
745
 
746
+ // returns the index (number) or false
747
+ _listens: function (type, fn, context) {
748
+ if (!this._events) {
749
+ return false;
750
+ }
751
+
752
+ var listeners = this._events[type] || [];
753
+ if (!fn) {
754
+ return !!listeners.length;
755
+ }
756
+
757
+ if (context === this) {
758
+ // Less memory footprint.
759
+ context = undefined;
760
+ }
761
+
762
+ for (var i = 0, len = listeners.length; i < len; i++) {
763
+ if (listeners[i].fn === fn && listeners[i].ctx === context) {
764
+ return i;
765
+ }
766
+ }
767
+ return false;
768
+
769
+ },
770
+
740
771
  // @method once(…): this
741
772
  // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.
742
773
  once: function (types, fn, context) {
743
774
 
775
+ // types can be a map of types/handlers
744
776
  if (typeof types === 'object') {
745
777
  for (var type in types) {
746
- this.once(type, types[type], fn);
778
+ // we don't process space-separated events here for performance;
779
+ // it's a hot path since Layer uses the on(obj) syntax
780
+ this._on(type, types[type], fn, true);
747
781
  }
748
- return this;
749
- }
750
782
 
751
- var handler = bind(function () {
752
- this
753
- .off(types, fn, context)
754
- .off(types, handler, context);
755
- }, this);
783
+ } else {
784
+ // types can be a string of space-separated words
785
+ types = splitWords(types);
786
+
787
+ for (var i = 0, len = types.length; i < len; i++) {
788
+ this._on(types[i], fn, context, true);
789
+ }
790
+ }
756
791
 
757
- // add a listener that's executed once and removed after that
758
- return this
759
- .on(types, fn, context)
760
- .on(types, handler, context);
792
+ return this;
761
793
  },
762
794
 
763
795
  // @method addEventParent(obj: Evented): this
@@ -1073,21 +1105,36 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1073
1105
  Bounds.prototype = {
1074
1106
  // @method extend(point: Point): this
1075
1107
  // Extends the bounds to contain the given point.
1076
- extend: function (point) { // (Point)
1077
- point = toPoint(point);
1108
+
1109
+ // @alternative
1110
+ // @method extend(otherBounds: Bounds): this
1111
+ // Extend the bounds to contain the given bounds
1112
+ extend: function (obj) {
1113
+ var min2, max2;
1114
+ if (!obj) { return this; }
1115
+
1116
+ if (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) {
1117
+ min2 = max2 = toPoint(obj);
1118
+ } else {
1119
+ obj = toBounds(obj);
1120
+ min2 = obj.min;
1121
+ max2 = obj.max;
1122
+
1123
+ if (!min2 || !max2) { return this; }
1124
+ }
1078
1125
 
1079
1126
  // @property min: Point
1080
1127
  // The top left corner of the rectangle.
1081
1128
  // @property max: Point
1082
1129
  // The bottom right corner of the rectangle.
1083
1130
  if (!this.min && !this.max) {
1084
- this.min = point.clone();
1085
- this.max = point.clone();
1131
+ this.min = min2.clone();
1132
+ this.max = max2.clone();
1086
1133
  } else {
1087
- this.min.x = Math.min(point.x, this.min.x);
1088
- this.max.x = Math.max(point.x, this.max.x);
1089
- this.min.y = Math.min(point.y, this.min.y);
1090
- this.max.y = Math.max(point.y, this.max.y);
1134
+ this.min.x = Math.min(min2.x, this.min.x);
1135
+ this.max.x = Math.max(max2.x, this.max.x);
1136
+ this.min.y = Math.min(min2.y, this.min.y);
1137
+ this.max.y = Math.max(max2.y, this.max.y);
1091
1138
  }
1092
1139
  return this;
1093
1140
  },
@@ -1095,7 +1142,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1095
1142
  // @method getCenter(round?: Boolean): Point
1096
1143
  // Returns the center point of the bounds.
1097
1144
  getCenter: function (round) {
1098
- return new Point(
1145
+ return toPoint(
1099
1146
  (this.min.x + this.max.x) / 2,
1100
1147
  (this.min.y + this.max.y) / 2, round);
1101
1148
  },
@@ -1103,13 +1150,13 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1103
1150
  // @method getBottomLeft(): Point
1104
1151
  // Returns the bottom-left point of the bounds.
1105
1152
  getBottomLeft: function () {
1106
- return new Point(this.min.x, this.max.y);
1153
+ return toPoint(this.min.x, this.max.y);
1107
1154
  },
1108
1155
 
1109
1156
  // @method getTopRight(): Point
1110
1157
  // Returns the top-right point of the bounds.
1111
1158
  getTopRight: function () { // -> Point
1112
- return new Point(this.max.x, this.min.y);
1159
+ return toPoint(this.max.x, this.min.y);
1113
1160
  },
1114
1161
 
1115
1162
  // @method getTopLeft(): Point
@@ -1189,9 +1236,40 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
1189
1236
  return xOverlaps && yOverlaps;
1190
1237
  },
1191
1238
 
1239
+ // @method isValid(): Boolean
1240
+ // Returns `true` if the bounds are properly initialized.
1192
1241
  isValid: function () {
1193
1242
  return !!(this.min && this.max);
1194
- }
1243
+ },
1244
+
1245
+
1246
+ // @method pad(bufferRatio: Number): Bounds
1247
+ // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
1248
+ // For example, a ratio of 0.5 extends the bounds by 50% in each direction.
1249
+ // Negative values will retract the bounds.
1250
+ pad: function (bufferRatio) {
1251
+ var min = this.min,
1252
+ max = this.max,
1253
+ heightBuffer = Math.abs(min.x - max.x) * bufferRatio,
1254
+ widthBuffer = Math.abs(min.y - max.y) * bufferRatio;
1255
+
1256
+
1257
+ return toBounds(
1258
+ toPoint(min.x - heightBuffer, min.y - widthBuffer),
1259
+ toPoint(max.x + heightBuffer, max.y + widthBuffer));
1260
+ },
1261
+
1262
+
1263
+ // @method equals(otherBounds: Bounds): Boolean
1264
+ // Returns `true` if the rectangle is equivalent to the given bounds.
1265
+ equals: function (bounds) {
1266
+ if (!bounds) { return false; }
1267
+
1268
+ bounds = toBounds(bounds);
1269
+
1270
+ return this.min.equals(bounds.getTopLeft()) &&
1271
+ this.max.equals(bounds.getBottomRight());
1272
+ },
1195
1273
  };
1196
1274
 
1197
1275
 
@@ -2099,6 +2177,13 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2099
2177
  }
2100
2178
  }());
2101
2179
 
2180
+
2181
+ // @property mac: Boolean; `true` when the browser is running in a Mac platform
2182
+ var mac = navigator.platform.indexOf('Mac') === 0;
2183
+
2184
+ // @property mac: Boolean; `true` when the browser is running in a Linux platform
2185
+ var linux = navigator.platform.indexOf('Linux') === 0;
2186
+
2102
2187
  function userAgentContains(str) {
2103
2188
  return navigator.userAgent.toLowerCase().indexOf(str) >= 0;
2104
2189
  }
@@ -2137,7 +2222,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2137
2222
  canvas: canvas$1,
2138
2223
  svg: svg$1,
2139
2224
  vml: vml,
2140
- inlineSvg: inlineSvg
2225
+ inlineSvg: inlineSvg,
2226
+ mac: mac,
2227
+ linux: linux
2141
2228
  };
2142
2229
 
2143
2230
  /*
@@ -2280,6 +2367,25 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2280
2367
  return;
2281
2368
  }
2282
2369
 
2370
+ // When clicking on an <input>, the browser generates a click on its
2371
+ // <label> (and vice versa) triggering two clicks in quick succession.
2372
+ // This ignores clicks on elements which are a label with a 'for'
2373
+ // attribute (or children of such a label), but not children of
2374
+ // a <input>.
2375
+ var path = getPropagationPath(e);
2376
+ if (path.some(function (el) {
2377
+ return el instanceof HTMLLabelElement && el.attributes.for;
2378
+ }) &&
2379
+ !path.some(function (el) {
2380
+ return (
2381
+ el instanceof HTMLInputElement ||
2382
+ el instanceof HTMLSelectElement
2383
+ );
2384
+ })
2385
+ ) {
2386
+ return;
2387
+ }
2388
+
2283
2389
  var now = Date.now();
2284
2390
  if (now - last <= delay) {
2285
2391
  detail++;
@@ -2901,6 +3007,26 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2901
3007
  return this;
2902
3008
  }
2903
3009
 
3010
+ // @function getPropagationPath(ev: DOMEvent): Array
3011
+ // Compatibility polyfill for [`Event.composedPath()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath).
3012
+ // Returns an array containing the `HTMLElement`s that the given DOM event
3013
+ // should propagate to (if not stopped).
3014
+ function getPropagationPath(ev) {
3015
+ if (ev.composedPath) {
3016
+ return ev.composedPath();
3017
+ }
3018
+
3019
+ var path = [];
3020
+ var el = ev.target;
3021
+
3022
+ while (el) {
3023
+ path.push(el);
3024
+ el = el.parentNode;
3025
+ }
3026
+ return path;
3027
+ }
3028
+
3029
+
2904
3030
  // @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point
2905
3031
  // Gets normalized mouse position from a DOM event relative to the
2906
3032
  // `container` (border excluded) or to the whole page if not specified.
@@ -2920,12 +3046,15 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2920
3046
  );
2921
3047
  }
2922
3048
 
2923
- // Chrome on Win scrolls double the pixels as in other platforms (see #4538),
2924
- // and Firefox scrolls device pixels, not CSS pixels
2925
- var wheelPxFactor =
2926
- (Browser.win && Browser.chrome) ? 2 * window.devicePixelRatio :
2927
- Browser.gecko ? window.devicePixelRatio : 1;
2928
3049
 
3050
+ // except , Safari and
3051
+ // We need double the scroll pixels (see #7403 and #4538) for all Browsers
3052
+ // except OSX (Mac) -> 3x, Chrome running on Linux 1x
3053
+
3054
+ var wheelPxFactor =
3055
+ (Browser.linux && Browser.chrome) ? window.devicePixelRatio :
3056
+ Browser.mac ? window.devicePixelRatio * 3 :
3057
+ window.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1;
2929
3058
  // @function getWheelDelta(ev: DOMEvent): Number
2930
3059
  // Gets normalized wheel delta from a wheel DOM event, in vertical
2931
3060
  // pixels scrolled (negative if scrolling down).
@@ -2969,6 +3098,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2969
3098
  disableClickPropagation: disableClickPropagation,
2970
3099
  preventDefault: preventDefault,
2971
3100
  stop: stop,
3101
+ getPropagationPath: getPropagationPath,
2972
3102
  getMousePosition: getMousePosition,
2973
3103
  getWheelDelta: getWheelDelta,
2974
3104
  isExternalTarget: isExternalTarget,
@@ -2984,8 +3114,21 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
2984
3114
  *
2985
3115
  * @example
2986
3116
  * ```js
2987
- * var fx = new L.PosAnimation();
2988
- * fx.run(el, [300, 500], 0.5);
3117
+ * var myPositionMarker = L.marker([48.864716, 2.294694]).addTo(map);
3118
+ *
3119
+ * myPositionMarker.on("click", function() {
3120
+ * var pos = map.latLngToLayerPoint(myPositionMarker.getLatLng());
3121
+ * pos.y -= 25;
3122
+ * var fx = new L.PosAnimation();
3123
+ *
3124
+ * fx.once('end',function() {
3125
+ * pos.y += 25;
3126
+ * fx.run(myPositionMarker._icon, pos, 0.8);
3127
+ * });
3128
+ *
3129
+ * fx.run(myPositionMarker._icon, pos, 0.3);
3130
+ * });
3131
+ *
2989
3132
  * ```
2990
3133
  *
2991
3134
  * @constructor L.PosAnimation()
@@ -3265,7 +3408,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
3265
3408
  }
3266
3409
 
3267
3410
  // animation didn't start, just reset the map view
3268
- this._resetView(center, zoom);
3411
+ this._resetView(center, zoom, options.pan && options.pan.noMoveStart);
3269
3412
 
3270
3413
  return this;
3271
3414
  },
@@ -3508,11 +3651,13 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
3508
3651
  setMaxBounds: function (bounds) {
3509
3652
  bounds = toLatLngBounds(bounds);
3510
3653
 
3654
+ if (this.listens('moveend', this._panInsideMaxBounds)) {
3655
+ this.off('moveend', this._panInsideMaxBounds);
3656
+ }
3657
+
3511
3658
  if (!bounds.isValid()) {
3512
3659
  this.options.maxBounds = null;
3513
- return this.off('moveend', this._panInsideMaxBounds);
3514
- } else if (this.options.maxBounds) {
3515
- this.off('moveend', this._panInsideMaxBounds);
3660
+ return this;
3516
3661
  }
3517
3662
 
3518
3663
  this.options.maxBounds = bounds;
@@ -3882,7 +4027,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
3882
4027
  this._checkIfLoaded();
3883
4028
 
3884
4029
  if (this._lastCenter && !this._moved()) {
3885
- return this._lastCenter;
4030
+ return this._lastCenter.clone();
3886
4031
  }
3887
4032
  return this.layerPointToLatLng(this._getCenterLayerPoint());
3888
4033
  },
@@ -4231,7 +4376,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
4231
4376
  // private methods that modify map state
4232
4377
 
4233
4378
  // @section Map state change events
4234
- _resetView: function (center, zoom) {
4379
+ _resetView: function (center, zoom, noMoveStart) {
4235
4380
  setPosition(this._mapPane, new Point(0, 0));
4236
4381
 
4237
4382
  var loading = !this._loaded;
@@ -4242,7 +4387,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
4242
4387
 
4243
4388
  var zoomChanged = this._zoom !== zoom;
4244
4389
  this
4245
- ._moveStart(zoomChanged, false)
4390
+ ._moveStart(zoomChanged, noMoveStart)
4246
4391
  ._move(center, zoom)
4247
4392
  ._moveEnd(zoomChanged);
4248
4393
 
@@ -4439,7 +4584,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
4439
4584
  },
4440
4585
 
4441
4586
  _isClickDisabled: function (el) {
4442
- while (el !== this._container) {
4587
+ while (el && el !== this._container) {
4443
4588
  if (el['_leaflet_disable_click']) { return true; }
4444
4589
  el = el.parentNode;
4445
4590
  }
@@ -5665,7 +5810,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
5665
5810
  return new Scale(options);
5666
5811
  };
5667
5812
 
5668
- 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>';
5813
+ 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>';
5669
5814
 
5670
5815
 
5671
5816
  /*
@@ -5734,7 +5879,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
5734
5879
  },
5735
5880
 
5736
5881
  // @method addAttribution(text: String): this
5737
- // Adds an attribution text (e.g. `'Vector data &copy; Mapbox'`).
5882
+ // Adds an attribution text (e.g. `'&copy; OpenStreetMap contributors'`).
5738
5883
  addAttribution: function (text) {
5739
5884
  if (!text) { return this; }
5740
5885
 
@@ -6324,6 +6469,55 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
6324
6469
  function _flat(latlngs) {
6325
6470
  console.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');
6326
6471
  return isFlat(latlngs);
6472
+ }
6473
+
6474
+ /* @function polylineCenter(latlngs: LatLng[], crs: CRS): LatLng
6475
+ * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polyline.
6476
+ */
6477
+ function polylineCenter(latlngs, crs) {
6478
+ var i, halfDist, segDist, dist, p1, p2, ratio, center;
6479
+
6480
+ if (!latlngs || latlngs.length === 0) {
6481
+ throw new Error('latlngs not passed');
6482
+ }
6483
+
6484
+ if (!isFlat(latlngs)) {
6485
+ console.warn('latlngs are not flat! Only the first ring will be used');
6486
+ latlngs = latlngs[0];
6487
+ }
6488
+
6489
+ var points = [];
6490
+ for (var j in latlngs) {
6491
+ points.push(crs.project(toLatLng(latlngs[j])));
6492
+ }
6493
+
6494
+ var len = points.length;
6495
+
6496
+ for (i = 0, halfDist = 0; i < len - 1; i++) {
6497
+ halfDist += points[i].distanceTo(points[i + 1]) / 2;
6498
+ }
6499
+
6500
+ // The line is so small in the current view that all points are on the same pixel.
6501
+ if (halfDist === 0) {
6502
+ center = points[0];
6503
+ } else {
6504
+ for (i = 0, dist = 0; i < len - 1; i++) {
6505
+ p1 = points[i];
6506
+ p2 = points[i + 1];
6507
+ segDist = p1.distanceTo(p2);
6508
+ dist += segDist;
6509
+
6510
+ if (dist > halfDist) {
6511
+ ratio = (dist - halfDist) / segDist;
6512
+ center = [
6513
+ p2.x - ratio * (p2.x - p1.x),
6514
+ p2.y - ratio * (p2.y - p1.y)
6515
+ ];
6516
+ break;
6517
+ }
6518
+ }
6519
+ }
6520
+ return crs.unproject(toPoint(center));
6327
6521
  }
6328
6522
 
6329
6523
  var LineUtil = {
@@ -6336,7 +6530,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
6336
6530
  _getBitCode: _getBitCode,
6337
6531
  _sqClosestPointOnSegment: _sqClosestPointOnSegment,
6338
6532
  isFlat: isFlat,
6339
- _flat: _flat
6533
+ _flat: _flat,
6534
+ polylineCenter: polylineCenter
6340
6535
  };
6341
6536
 
6342
6537
  /*
@@ -6391,11 +6586,55 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
6391
6586
  }
6392
6587
 
6393
6588
  return points;
6589
+ }
6590
+
6591
+ /* @function polygonCenter(latlngs: LatLng[] crs: CRS): LatLng
6592
+ * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polygon.
6593
+ */
6594
+ function polygonCenter(latlngs, crs) {
6595
+ var i, j, p1, p2, f, area, x, y, center;
6596
+
6597
+ if (!latlngs || latlngs.length === 0) {
6598
+ throw new Error('latlngs not passed');
6599
+ }
6600
+
6601
+ if (!isFlat(latlngs)) {
6602
+ console.warn('latlngs are not flat! Only the first ring will be used');
6603
+ latlngs = latlngs[0];
6604
+ }
6605
+
6606
+ var points = [];
6607
+ for (var k in latlngs) {
6608
+ points.push(crs.project(toLatLng(latlngs[k])));
6609
+ }
6610
+
6611
+ var len = points.length;
6612
+ area = x = y = 0;
6613
+
6614
+ // polygon centroid algorithm;
6615
+ for (i = 0, j = len - 1; i < len; j = i++) {
6616
+ p1 = points[i];
6617
+ p2 = points[j];
6618
+
6619
+ f = p1.y * p2.x - p2.y * p1.x;
6620
+ x += (p1.x + p2.x) * f;
6621
+ y += (p1.y + p2.y) * f;
6622
+ area += f * 3;
6623
+ }
6624
+
6625
+ if (area === 0) {
6626
+ // Polygon is so small that all points are on same pixel.
6627
+ center = points[0];
6628
+ } else {
6629
+ center = [x / area, y / area];
6630
+ }
6631
+ return crs.unproject(toPoint(center));
6394
6632
  }
6395
6633
 
6396
6634
  var PolyUtil = {
6397
6635
  __proto__: null,
6398
- clipPolygon: clipPolygon
6636
+ clipPolygon: clipPolygon,
6637
+ polygonCenter: polygonCenter
6399
6638
  };
6400
6639
 
6401
6640
  /*
@@ -8354,38 +8593,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
8354
8593
  if (!this._map) {
8355
8594
  throw new Error('Must add layer to map before using getCenter()');
8356
8595
  }
8357
-
8358
- var i, halfDist, segDist, dist, p1, p2, ratio,
8359
- points = this._rings[0],
8360
- len = points.length;
8361
-
8362
- if (!len) { return null; }
8363
-
8364
- // polyline centroid algorithm; only uses the first ring if there are multiple
8365
-
8366
- for (i = 0, halfDist = 0; i < len - 1; i++) {
8367
- halfDist += points[i].distanceTo(points[i + 1]) / 2;
8368
- }
8369
-
8370
- // The line is so small in the current view that all points are on the same pixel.
8371
- if (halfDist === 0) {
8372
- return this._map.layerPointToLatLng(points[0]);
8373
- }
8374
-
8375
- for (i = 0, dist = 0; i < len - 1; i++) {
8376
- p1 = points[i];
8377
- p2 = points[i + 1];
8378
- segDist = p1.distanceTo(p2);
8379
- dist += segDist;
8380
-
8381
- if (dist > halfDist) {
8382
- ratio = (dist - halfDist) / segDist;
8383
- return this._map.layerPointToLatLng([
8384
- p2.x - ratio * (p2.x - p1.x),
8385
- p2.y - ratio * (p2.y - p1.y)
8386
- ]);
8387
- }
8388
- }
8596
+ return polylineCenter(this._defaultShape(), this._map.options.crs);
8389
8597
  },
8390
8598
 
8391
8599
  // @method getBounds(): LatLngBounds
@@ -8627,39 +8835,14 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
8627
8835
  return !this._latlngs.length || !this._latlngs[0].length;
8628
8836
  },
8629
8837
 
8838
+ // @method getCenter(): LatLng
8839
+ // Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon.
8630
8840
  getCenter: function () {
8631
8841
  // throws error when not yet added to map as this center calculation requires projected coordinates
8632
8842
  if (!this._map) {
8633
8843
  throw new Error('Must add layer to map before using getCenter()');
8634
8844
  }
8635
-
8636
- var i, j, p1, p2, f, area, x, y, center,
8637
- points = this._rings[0],
8638
- len = points.length;
8639
-
8640
- if (!len) { return null; }
8641
-
8642
- // polygon centroid algorithm; only uses the first ring if there are multiple
8643
-
8644
- area = x = y = 0;
8645
-
8646
- for (i = 0, j = len - 1; i < len; j = i++) {
8647
- p1 = points[i];
8648
- p2 = points[j];
8649
-
8650
- f = p1.y * p2.x - p2.y * p1.x;
8651
- x += (p1.x + p2.x) * f;
8652
- y += (p1.y + p2.y) * f;
8653
- area += f * 3;
8654
- }
8655
-
8656
- if (area === 0) {
8657
- // Polygon is so small that all points are on same pixel.
8658
- center = points[0];
8659
- } else {
8660
- center = [x / area, y / area];
8661
- }
8662
- return this._map.layerPointToLatLng(center);
8845
+ return polygonCenter(this._defaultShape(), this._map.options.crs);
8663
8846
  },
8664
8847
 
8665
8848
  _convertLatLngs: function (latlngs) {
@@ -8944,14 +9127,24 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
8944
9127
 
8945
9128
  case 'GeometryCollection':
8946
9129
  for (i = 0, len = geometry.geometries.length; i < len; i++) {
8947
- var layer = geometryToLayer({
9130
+ var geoLayer = geometryToLayer({
8948
9131
  geometry: geometry.geometries[i],
8949
9132
  type: 'Feature',
8950
9133
  properties: geojson.properties
8951
9134
  }, options);
8952
9135
 
8953
- if (layer) {
8954
- layers.push(layer);
9136
+ if (geoLayer) {
9137
+ layers.push(geoLayer);
9138
+ }
9139
+ }
9140
+ return new FeatureGroup(layers);
9141
+
9142
+ case 'FeatureCollection':
9143
+ for (i = 0, len = geometry.features.length; i < len; i++) {
9144
+ var featureLayer = geometryToLayer(geometry.features[i], options);
9145
+
9146
+ if (featureLayer) {
9147
+ layers.push(featureLayer);
8955
9148
  }
8956
9149
  }
8957
9150
  return new FeatureGroup(layers);
@@ -9010,8 +9203,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9010
9203
  var coords = [];
9011
9204
 
9012
9205
  for (var i = 0, len = latlngs.length; i < len; i++) {
9206
+ // Check for flat arrays required to ensure unbalanced arrays are correctly converted in recursion
9013
9207
  coords.push(levelsDeep ?
9014
- latLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) :
9208
+ latLngsToCoords(latlngs[i], isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) :
9015
9209
  latLngToCoords(latlngs[i], precision));
9016
9210
  }
9017
9211
 
@@ -9620,13 +9814,25 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9620
9814
 
9621
9815
  // @option pane: String = undefined
9622
9816
  // `Map pane` where the overlay will be added.
9623
- pane: undefined
9817
+ pane: undefined,
9818
+
9819
+ // @option content: String|HTMLElement|Function = ''
9820
+ // Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be
9821
+ // passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay.
9822
+ content: ''
9624
9823
  },
9625
9824
 
9626
9825
  initialize: function (options, source) {
9627
- setOptions(this, options);
9628
-
9629
- this._source = source;
9826
+ if (options && (options instanceof L.LatLng || isArray(options))) {
9827
+ this._latlng = toLatLng(options);
9828
+ setOptions(this, source);
9829
+ } else {
9830
+ setOptions(this, options);
9831
+ this._source = source;
9832
+ }
9833
+ if (this.options.content) {
9834
+ this._content = this.options.content;
9835
+ }
9630
9836
  },
9631
9837
 
9632
9838
  // @method openOn(map: Map): this
@@ -9938,7 +10144,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9938
10144
  * marker.bindPopup(popupContent).openPopup();
9939
10145
  * ```
9940
10146
  * Path overlays like polylines also have a `bindPopup` method.
9941
- * Here's a more complicated way to open a popup on a map:
10147
+ *
10148
+ * A popup can be also standalone:
9942
10149
  *
9943
10150
  * ```js
9944
10151
  * var popup = L.popup()
@@ -9946,6 +10153,11 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9946
10153
  * .setContent('<p>Hello world!<br />This is a nice popup.</p>')
9947
10154
  * .openOn(map);
9948
10155
  * ```
10156
+ * or
10157
+ * ```js
10158
+ * var popup = L.popup(latlng, {content: '<p>Hello world!<br />This is a nice popup.</p>')
10159
+ * .openOn(map);
10160
+ * ```
9949
10161
  */
9950
10162
 
9951
10163
 
@@ -9974,6 +10186,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
9974
10186
  // @option maxHeight: Number = null
9975
10187
  // If set, creates a scrollable container of the given height
9976
10188
  // inside a popup if its content exceeds it.
10189
+ // The scrollable container can be styled using the
10190
+ // `leaflet-popup-scrolled` CSS class selector.
9977
10191
  maxHeight: null,
9978
10192
 
9979
10193
  // @option autoPan: Boolean = true
@@ -10119,7 +10333,10 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10119
10333
  closeButton.href = '#close';
10120
10334
  closeButton.innerHTML = '<span aria-hidden="true">&#215;</span>';
10121
10335
 
10122
- on(closeButton, 'click', this.close, this);
10336
+ on(closeButton, 'click', function (ev) {
10337
+ preventDefault(ev);
10338
+ this.close();
10339
+ }, this);
10123
10340
  }
10124
10341
  },
10125
10342
 
@@ -10213,6 +10430,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10213
10430
  // @namespace Popup
10214
10431
  // @factory L.popup(options?: Popup options, source?: Layer)
10215
10432
  // 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.
10433
+ // @alternative
10434
+ // @factory L.popup(latlng: LatLng, options?: Popup options)
10435
+ // Instantiates a `Popup` object given `latlng` where the popup will open and an optional `options` object that describes its appearance and location.
10216
10436
  var popup = function (options, source) {
10217
10437
  return new Popup(options, source);
10218
10438
  };
@@ -10310,7 +10530,8 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10310
10530
  // @method openPopup(latlng?: LatLng): this
10311
10531
  // Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.
10312
10532
  openPopup: function (latlng) {
10313
- if (this._popup && this._popup._prepareOpen(latlng)) {
10533
+ if (this._popup && this._popup._prepareOpen(latlng || this._latlng)) {
10534
+
10314
10535
  // open the popup on the map
10315
10536
  this._popup.openOn(this._map);
10316
10537
  }
@@ -10396,10 +10617,28 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10396
10617
  * Used to display small texts on top of map layers.
10397
10618
  *
10398
10619
  * @example
10620
+ * If you want to just bind a tooltip to marker:
10399
10621
  *
10400
10622
  * ```js
10401
10623
  * marker.bindTooltip("my tooltip text").openTooltip();
10402
10624
  * ```
10625
+ * Path overlays like polylines also have a `bindTooltip` method.
10626
+ *
10627
+ * A tooltip can be also standalone:
10628
+ *
10629
+ * ```js
10630
+ * var tooltip = L.tooltip()
10631
+ * .setLatLng(latlng)
10632
+ * .setContent('Hello world!<br />This is a nice tooltip.')
10633
+ * .addTo(map);
10634
+ * ```
10635
+ * or
10636
+ * ```js
10637
+ * var tooltip = L.tooltip(latlng, {content: 'Hello world!<br />This is a nice tooltip.'})
10638
+ * .addTo(map);
10639
+ * ```
10640
+ *
10641
+ *
10403
10642
  * Note about tooltip offset. Leaflet takes two options in consideration
10404
10643
  * for computing tooltip offsetting:
10405
10644
  * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.
@@ -10500,6 +10739,9 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10500
10739
  className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');
10501
10740
 
10502
10741
  this._contentNode = this._container = create$1('div', className);
10742
+
10743
+ this._container.setAttribute('role', 'tooltip');
10744
+ this._container.setAttribute('id', 'leaflet-tooltip-' + stamp(this));
10503
10745
  },
10504
10746
 
10505
10747
  _updateLayout: function () {},
@@ -10580,7 +10822,10 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10580
10822
 
10581
10823
  // @namespace Tooltip
10582
10824
  // @factory L.tooltip(options?: Tooltip options, source?: Layer)
10583
- // 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.
10825
+ // 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.
10826
+ // @alternative
10827
+ // @factory L.tooltip(latlng: LatLng, options?: Tooltip options)
10828
+ // Instantiates a `Tooltip` object given `latlng` where the tooltip will open and an optional `options` object that describes its appearance and location.
10584
10829
  var tooltip = function (options, source) {
10585
10830
  return new Tooltip(options, source);
10586
10831
  };
@@ -10668,6 +10913,11 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10668
10913
  events.mouseover = this._openTooltip;
10669
10914
  events.mouseout = this.closeTooltip;
10670
10915
  events.click = this._openTooltip;
10916
+ if (this._map) {
10917
+ this._addFocusListeners();
10918
+ } else {
10919
+ events.add = this._addFocusListeners;
10920
+ }
10671
10921
  } else {
10672
10922
  events.add = this._openTooltip;
10673
10923
  }
@@ -10684,6 +10934,12 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10684
10934
  if (this._tooltip && this._tooltip._prepareOpen(latlng)) {
10685
10935
  // open the tooltip on the map
10686
10936
  this._tooltip.openOn(this._map);
10937
+
10938
+ if (this.getElement) {
10939
+ this._setAriaDescribedByOnLayer(this);
10940
+ } else if (this.eachLayer) {
10941
+ this.eachLayer(this._setAriaDescribedByOnLayer, this);
10942
+ }
10687
10943
  }
10688
10944
  return this;
10689
10945
  },
@@ -10726,6 +10982,33 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
10726
10982
  return this._tooltip;
10727
10983
  },
10728
10984
 
10985
+ _addFocusListeners: function () {
10986
+ if (this.getElement) {
10987
+ this._addFocusListenersOnLayer(this);
10988
+ } else if (this.eachLayer) {
10989
+ this.eachLayer(this._addFocusListenersOnLayer, this);
10990
+ }
10991
+ },
10992
+
10993
+ _addFocusListenersOnLayer: function (layer) {
10994
+ var el = layer.getElement();
10995
+ if (el) {
10996
+ on(el, 'focus', function () {
10997
+ this._tooltip._source = layer;
10998
+ this.openTooltip();
10999
+ }, this);
11000
+ on(el, 'blur', this.closeTooltip, this);
11001
+ }
11002
+ },
11003
+
11004
+ _setAriaDescribedByOnLayer: function (layer) {
11005
+ var el = layer.getElement();
11006
+ if (el) {
11007
+ el.setAttribute('aria-describedby', this._tooltip._container.id);
11008
+ }
11009
+ },
11010
+
11011
+
10729
11012
  _openTooltip: function (e) {
10730
11013
  if (!this._tooltip || !this._map || (this._map.dragging && this._map.dragging.moving())) {
10731
11014
  return;
@@ -11741,7 +12024,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
11741
12024
  * @example
11742
12025
  *
11743
12026
  * ```js
11744
- * 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);
12027
+ * 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);
11745
12028
  * ```
11746
12029
  *
11747
12030
  * @section URL template
@@ -11828,13 +12111,19 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
11828
12111
 
11829
12112
  if (!options.zoomReverse) {
11830
12113
  options.zoomOffset++;
11831
- options.maxZoom--;
12114
+ options.maxZoom = Math.max(options.minZoom, options.maxZoom - 1);
11832
12115
  } else {
11833
12116
  options.zoomOffset--;
11834
- options.minZoom++;
12117
+ options.minZoom = Math.min(options.maxZoom, options.minZoom + 1);
11835
12118
  }
11836
12119
 
11837
12120
  options.minZoom = Math.max(0, options.minZoom);
12121
+ } else if (!options.zoomReverse) {
12122
+ // make sure maxZoom is gte minZoom
12123
+ options.maxZoom = Math.max(options.minZoom, options.maxZoom);
12124
+ } else {
12125
+ // make sure minZoom is lte maxZoom
12126
+ options.minZoom = Math.min(options.maxZoom, options.minZoom);
11838
12127
  }
11839
12128
 
11840
12129
  if (typeof options.subdomains === 'string') {
@@ -11881,18 +12170,12 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
11881
12170
  tile.referrerPolicy = this.options.referrerPolicy;
11882
12171
  }
11883
12172
 
11884
- /*
11885
- Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons
11886
- https://www.w3.org/TR/WCAG20-TECHS/H67
11887
- */
12173
+ // The alt attribute is set to the empty string,
12174
+ // allowing screen readers to ignore the decorative image tiles.
12175
+ // https://www.w3.org/WAI/tutorials/images/decorative/
12176
+ // https://www.w3.org/TR/html-aria/#el-img-empty-alt
11888
12177
  tile.alt = '';
11889
12178
 
11890
- /*
11891
- Set role="presentation" to force screen readers to ignore this
11892
- https://www.w3.org/TR/wai-aria/roles#textalternativecomputation
11893
- */
11894
- tile.setAttribute('role', 'presentation');
11895
-
11896
12179
  tile.src = this.getTileUrl(coords);
11897
12180
 
11898
12181
  return tile;
@@ -14085,7 +14368,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
14085
14368
 
14086
14369
  cancelAnimFrame(this._animRequest);
14087
14370
 
14088
- var moveFn = bind(map._move, map, this._center, this._zoom, {pinch: true, round: false});
14371
+ var moveFn = bind(map._move, map, this._center, this._zoom, {pinch: true, round: false}, undefined);
14089
14372
  this._animRequest = requestAnimFrame(moveFn, this, true);
14090
14373
 
14091
14374
  preventDefault(e);
@@ -14218,7 +14501,7 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
14218
14501
 
14219
14502
  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>`;
14220
14503
 
14221
- 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}";
14504
+ 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}";
14222
14505
 
14223
14506
  const GrwMap = class {
14224
14507
  constructor(hostRef) {
@@ -14234,9 +14517,10 @@ const GrwMap = class {
14234
14517
  this.colorArrivalIcon = '#85003b';
14235
14518
  this.colorSensitiveArea = ' #4974a5';
14236
14519
  this.colorPoiIcon = '#974c6e';
14520
+ this.resetStoreOnDisconnected = true;
14237
14521
  this.handleTreksWithinBoundsBind = this.handleTreksWithinBounds.bind(this);
14238
14522
  }
14239
- connectedCallback() {
14523
+ componentDidLoad() {
14240
14524
  this.map = leafletSrc.map(this.element, {
14241
14525
  center: this.center.split(',').map(Number),
14242
14526
  zoom: this.zoom,
@@ -14357,7 +14641,8 @@ const GrwMap = class {
14357
14641
  }
14358
14642
  }
14359
14643
  handleTreksWithinBounds() {
14360
- if (!store.state.currentMapTreksBounds || store.state.currentMapTreksBounds.toBBoxString() !== this.map.getBounds().toBBoxString()) {
14644
+ if ((store.state.currentTreks && !store.state.currentMapTreksBounds) ||
14645
+ (store.state.currentTreks && store.state.currentMapTreksBounds && store.state.currentMapTreksBounds.toBBoxString() !== this.map.getBounds().toBBoxString())) {
14361
14646
  store.state.treksWithinBounds = store.state.currentTreks.filter(trek => this.map.getBounds().contains(leafletSrc.latLng(trek.departure_geom[1], trek.departure_geom[0])));
14362
14647
  }
14363
14648
  }
@@ -14605,6 +14890,11 @@ const GrwMap = class {
14605
14890
  this.currentPointsReferenceLayer = null;
14606
14891
  }
14607
14892
  }
14893
+ disconnectedCallback() {
14894
+ if (this.resetStoreOnDisconnected) {
14895
+ store.reset();
14896
+ }
14897
+ }
14608
14898
  render() {
14609
14899
  return (index.h(index.Host, { style: {
14610
14900
  '--color-primary': this.colorPrimary,
@@ -14626,6 +14916,7 @@ const GrwTrekDetail = class {
14626
14916
  this.colorPrimary = '#6b0030';
14627
14917
  this.colorPrimaryShade = '#4a0021';
14628
14918
  this.colorPrimaryTint = '#974c6e';
14919
+ this.resetStoreOnDisconnected = true;
14629
14920
  }
14630
14921
  connectedCallback() {
14631
14922
  this.currentTrek = this.trek ? this.trek : store.state.currentTrek;
@@ -14657,6 +14948,11 @@ const GrwTrekDetail = class {
14657
14948
  }
14658
14949
  });
14659
14950
  }
14951
+ disconnectedCallback() {
14952
+ if (this.resetStoreOnDisconnected) {
14953
+ store.reset();
14954
+ }
14955
+ }
14660
14956
  render() {
14661
14957
  var _a, _b, _c, _d, _e, _f, _g;
14662
14958
  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].url && (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 :
@@ -14691,6 +14987,7 @@ const GrwTrekProvider = class {
14691
14987
  requests.push(!store.state.routes ? fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`, { signal: this.signal }) : new Response('null'));
14692
14988
  requests.push(!store.state.practices ? fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`, { signal: this.signal }) : new Response('null'));
14693
14989
  requests.push(!store.state.themes ? fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }) : new Response('null'));
14990
+ requests.push(!store.state.cities ? fetch(`${this.api}city/?language=${this.language}&fields=id,name&published=true`, { signal: this.signal }) : new Response('null'));
14694
14991
  Promise.all([
14695
14992
  ...requests,
14696
14993
  fetch(`${this.api}sensitivearea/?language=${this.language}&published=true&trek=${this.trekId}&fields=id,geometry,name,description,contact,info_url,period,practices`, {
@@ -14705,10 +15002,10 @@ const GrwTrekProvider = class {
14705
15002
  }),
14706
15003
  fetch(`${this.api}poi_type/?language=${this.language}&fields=id,pictogram`, { signal: this.signal }),
14707
15004
  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 }),
14708
- 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 }),
15005
+ 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 }),
14709
15006
  ])
14710
15007
  .then(responses => Promise.all(responses.map(response => response.json())))
14711
- .then(([difficulties, routes, practices, themes, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, poiTypes, informationDesks, trek]) => {
15008
+ .then(([difficulties, routes, practices, themes, cities, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, poiTypes, informationDesks, trek]) => {
14712
15009
  store.state.trekNetworkError = false;
14713
15010
  if (difficulties) {
14714
15011
  store.state.difficulties = difficulties.results;
@@ -14722,6 +15019,9 @@ const GrwTrekProvider = class {
14722
15019
  if (themes) {
14723
15020
  store.state.themes = themes.results;
14724
15021
  }
15022
+ if (cities) {
15023
+ store.state.cities = cities.results;
15024
+ }
14725
15025
  if (sensitiveAreas) {
14726
15026
  store.state.currentSensitiveAreas = sensitiveAreas.results;
14727
15027
  }
@@ -14759,6 +15059,7 @@ const GrwTreksList = class {
14759
15059
  this.colorPrimary = '#6b0030';
14760
15060
  this.colorPrimaryTint = '#974c6e';
14761
15061
  this.isLargeView = false;
15062
+ this.resetStoreOnDisconnected = true;
14762
15063
  this.step = 10;
14763
15064
  this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
14764
15065
  this.shouldAddInfiniteScrollEvent = true;
@@ -14806,10 +15107,13 @@ const GrwTreksList = class {
14806
15107
  }
14807
15108
  }
14808
15109
  disconnectedCallback() {
15110
+ if (this.resetStoreOnDisconnected) {
15111
+ store.reset();
15112
+ }
14809
15113
  this.handleInfiniteScrollEvent(false);
14810
15114
  }
14811
15115
  render() {
14812
- return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, 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 })))));
15116
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (index.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 })))));
14813
15117
  }
14814
15118
  get element() { return index.getElement(this); }
14815
15119
  };
@@ -14833,30 +15137,32 @@ const GrwTreksProvider = class {
14833
15137
  this.portals && (treksRequest += `&portals=${this.portals}`);
14834
15138
  this.routes && (treksRequest += `&routes=${this.routes}`);
14835
15139
  this.practices && (treksRequest += `&practices=${this.practices}`);
14836
- treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_geom&page_size=999`;
15140
+ treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_city,departure_geom&page_size=999`;
14837
15141
  Promise.all([
14838
15142
  fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }),
14839
15143
  fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`, { signal: this.signal }),
14840
15144
  fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`, { signal: this.signal }),
14841
15145
  fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }),
15146
+ fetch(`${this.api}city/?language=${this.language}&fields=id,name&published=true`, { signal: this.signal }),
14842
15147
  fetch(treksRequest, { signal: this.signal }),
14843
15148
  ])
14844
15149
  .then(responses => Promise.all(responses.map(response => response.json())))
14845
- .then(([difficulties, routes, practices, themes, treks]) => {
15150
+ .then(([difficulties, routes, practices, themes, cities, treks]) => {
14846
15151
  store.state.treksNetworkError = false;
14847
15152
  store.state.difficulties = difficulties.results;
14848
15153
  store.state.routes = routes.results;
14849
15154
  store.state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
14850
15155
  store.state.themes = themes.results;
15156
+ store.state.cities = cities.results;
14851
15157
  store.state.durations = [
14852
15158
  { id: 1, name: '0 - 1h', minValue: 0, maxValue: 1, selected: false },
14853
15159
  { id: 2, name: '1 - 2h', minValue: 1, maxValue: 2, selected: false },
14854
15160
  { id: 3, name: '2 - 5h', minValue: 2, maxValue: 5, selected: false },
14855
15161
  { id: 4, name: '5 - 10h', minValue: 5, maxValue: 10, selected: false },
14856
15162
  ];
14857
- store.state.treks = treks.results;
14858
15163
  store.state.currentTreks = treks.results;
14859
15164
  store.state.treksWithinBounds = treks.results;
15165
+ store.state.treks = treks.results;
14860
15166
  })
14861
15167
  .catch(() => (store.state.treksNetworkError = true));
14862
15168
  }