1/* Source and licensing information for the line(s) below can be found at https://www.nace.net/modules/contrib/leaflet/js/leaflet.drupal.js. */ 2(function($, Drupal, drupalSettings) { 3 4 Drupal.behaviors.leaflet = { 5 attach: function(context, settings) { 6 7 $.each(settings.leaflet, function(m, data) { 8 $('#' + data.mapid, context).each(function() { 9 let $container = $(this); 10 let mapid = data.mapid; 11 12 // If the attached context contains any leaflet maps, make sure we have a Drupal.leaflet_widget object. 13 if ($container.data('leaflet') === undefined) { 14 $container.data('leaflet', new Drupal.Leaflet(L.DomUtil.get(mapid), mapid, data.map)); 15 if (data.features.length > 0) { 16 17 // Initialize the Drupal.Leaflet.[data.mapid] object, 18 // for possible external interaction. 19 Drupal.Leaflet[mapid].markers = {}; 20 Drupal.Leaflet[mapid].features = {}; 21 22 // Add Leaflet Map Features. 23 $container.data('leaflet').add_features(mapid, data.features, true); 24 } 25 26 // Add the leaflet map to our settings object to make it accessible. 27 // @NOTE: This is used by the Leaflet Widget module. 28 data.lMap = $container.data('leaflet').lMap; 29 30 // Set map position features. 31 $container.data('leaflet').fitbounds(mapid); 32 } 33 34 else { 35 // If we already had a map instance, add new features. 36 // @TODO Does this work? Needs testing. 37 if (data.features !== undefined) { 38 $container.data('leaflet').add_features(mapid, data.features); 39 } 40 } 41 // After having initialized the Leaflet Map and added features, 42 // allow other modules to get access to it via trigger. 43 // NOTE: don't change this trigger arguments print, for back porting 44 // compatibility. 45 $(document).trigger('leafletMapInit', [data.map, data.lMap, mapid]); 46 // (Keep also the pre-existing event for back port compatibility) 47 $(document).trigger('leaflet.map', [data.map, data.lMap, mapid]); 48 }); 49 }); 50 } 51 }; 52 53 // Once the Leaflet Map is loaded with its features. 54 $(document).on('leaflet.map', function(e, settings, lMap, mapid) { 55 56 // Executes once per mapid. 57 once('leaflet_map_event_' + mapid, 'html').forEach(function() { 58 // Set the start center and the start zoom, and initialize the reset_map control. 59 if (!Drupal.Leaflet[mapid].start_center && !Drupal.Leaflet[mapid].start_zoom) { 60 Drupal.Leaflet[mapid].start_center = Drupal.Leaflet[mapid].lMap.getCenter(); 61 Drupal.Leaflet[mapid].start_zoom = Drupal.Leaflet[mapid].lMap.getZoom(); 62 } 63 64 // Add the Map Reset Control if requested. 65 if (settings.settings.reset_map && settings.settings.reset_map.control && !Drupal.Leaflet[mapid].reset_control) { 66 // Create the DIV to hold the control and call the mapResetControl() 67 // constructor passing in this DIV. 68 let mapResetControlDiv = document.createElement('div'); 69 Drupal.Leaflet[mapid].reset_control = Drupal.Leaflet.prototype.map_reset_control(mapResetControlDiv, mapid).addTo(Drupal.Leaflet[mapid].lMap); 70 } 71 72 // Add the Map Geocoder Control if requested. 73 if (Drupal.Leaflet.prototype.map_geocoder_control) { 74 let mapGeocoderControlDiv = document.createElement('div'); 75 Drupal.Leaflet[mapid].geocoder_control = Drupal.Leaflet.prototype.map_geocoder_control(mapGeocoderControlDiv, mapid).addTo(Drupal.Leaflet[mapid].lMap); 76 let geocoder_settings = drupalSettings.leaflet[mapid].map.settings.geocoder.settings; 77 Drupal.Leaflet.prototype.map_geocoder_control.autocomplete(mapid, geocoder_settings); 78 } 79 80 // Attach leaflet ajax popup listeners. 81 Drupal.Leaflet[mapid].lMap.on('popupopen', function(e) { 82 let element = e.popup._contentNode; 83 let content = $('[data-leaflet-ajax-popup]', element); 84 if (content.length) { 85 let url = content.data('leaflet-ajax-popup'); 86 Drupal.ajax({url: url}).execute().done(function () { 87 88 // Copy the html we received via AJAX to the popup, so we won't 89 // have to make another AJAX call (#see 3258780). 90 e.popup.setContent(element.innerHTML); 91 92 //Call update() so Leaflet refreshes the map, panning it if 93 // necessary to bring the full popup into view (#see 3258780). 94 e.popup.update(); 95 96 // Attach drupal behaviors on new content. 97 Drupal.attachBehaviors(element, drupalSettings); 98 }); 99 } 100 }); 101 }); 102 }); 103 104 Drupal.Leaflet = function(container, mapid, map_definition) { 105 this.container = container; 106 this.mapid = mapid; 107 this.map_definition = map_definition; 108 this.settings = this.map_definition.settings; 109 this.bounds = []; 110 this.base_layers = {}; 111 this.overlays = {}; 112 this.lMap = null; 113 this.start_center = null; 114 this.start_zoom = null; 115 this.layer_control = null; 116 this.initialise(mapid); 117 }; 118 119 Drupal.Leaflet.prototype.initialise = function(mapid) { 120 let self = this; 121 // Instantiate a new Leaflet map. 122 self.lMap = new L.Map(self.mapid, self.settings); 123 124 // Set the public map object, to make it accessible from outside. 125 Drupal.Leaflet[mapid] = {}; 126 // Define immediately the l.Map property, to make sub-methods mapid specific. 127 Drupal.Leaflet[mapid].lMap = self.lMap; 128 129 // Add map layers (base and overlay layers). 130 let i = 0; 131 for (let key in self.map_definition.layers) { 132 let layer = self.map_definition.layers[key]; 133 // Distinguish between "base" and "overlay" layers. 134 // Default to "base" in case "layer_type" has not been defined in hook_leaflet_map_info(). 135 layer.layer_type = (typeof layer.layer_type === 'undefined') ? 'base' : layer.layer_type; 136 137 switch (layer.layer_type) { 138 case 'overlay': 139 let overlay_layer = self.create_layer(layer, key); 140 let layer_hidden = (typeof layer.layer_hidden === "undefined") ? false : layer.layer_hidden; 141 self.add_overlay(key, overlay_layer, layer_hidden, mapid); 142 break; 143 144 default: 145 self.add_base_layer(key, layer, i, mapid); 146 // Only the first base layer needs to be added to the map - all the 147 // others are accessed via the layer switcher. 148 if (i === 0) { 149 i++; 150 } 151 break; 152 } 153 i++; 154 } 155 156 // Set initial view, fallback to displaying the whole world. 157 if (self.settings.center && self.settings.zoom) {
158 self.lMap.setView(new L.LatLng(self.settings.center.lat, self.settings.center.lon), self.settings.zoom); 159 } 160 else { 161 self.lMap.fitWorld(); 162 } 163 164 // Add Fullscreen Control, if requested. 165 if (self.settings.fullscreen && self.settings.fullscreen.control) { 166 L.control.fullscreen( 167 JSON.parse(self.settings.fullscreen.options) 168 ).addTo(self.lMap); 169 } 170 171 }; 172 173 Drupal.Leaflet.prototype.initialise_layer_control = function(mapid) { 174 let self = this; 175 let count_layers = function(obj) { 176 // Browser compatibility: Chrome, IE 9+, FF 4+, or Safari 5+. 177 // @see http://kangax.github.com/es5-compat-table/ 178 return Object.keys(obj).length; 179 }; 180 181 // Only add a layer switcher if it is enabled in settings, and we have 182 // at least two base layers or at least one overlay. 183 if (Drupal.Leaflet[mapid].layer_control == null && self.settings.layerControl && (count_layers(self.base_layers) > 1 || count_layers(self.overlays) > 0)) { 184 // Instantiate layer control, using settings.layerControl as settings. 185 Drupal.Leaflet[mapid].layer_control = new L.Control.Layers(self.base_layers, self.overlays, self.settings.layerControlOptions); 186 self.lMap.addControl(Drupal.Leaflet[mapid].layer_control); 187 } 188 }; 189 190 Drupal.Leaflet.prototype.add_base_layer = function(key, definition, i, mapid) { 191 let self = this; 192 let map_layer = self.create_layer(definition, key); 193 self.base_layers[key] = map_layer; 194 // Only the first base layer needs to be added to the map - all the others are accessed via the layer switcher. 195 if (i === 0) { 196 self.lMap.addLayer(map_layer); 197 } 198 if (Drupal.Leaflet[mapid].layer_control == null) { 199 self.initialise_layer_control(mapid); 200 } 201 else { 202 // If we already have a layer control, add the new base layer to it. 203 Drupal.Leaflet[mapid].layer_control.addBaseLayer(map_layer, key); 204 } 205 Drupal.Leaflet[mapid].base_layers = self.base_layers; 206 }; 207
208 Drupal.Leaflet.prototype.add_overlay = function(label, layer, layer_hidden, mapid) { 209 let self = this; 210 self.overlays[label] = layer; 211 if (!layer_hidden) { 212 Drupal.Leaflet[mapid].lMap.addLayer(layer); 213 } 214 215 if (Drupal.Leaflet[mapid].layer_control == null) { 216 self.initialise_layer_control(mapid); 217 } 218 else { 219 // If we already have a layer control, add the new overlay to it. 220 Drupal.Leaflet[mapid].layer_control.addOverlay(layer, label); 221 } 222 Drupal.Leaflet[mapid].overlays = self.overlays; 223 224 }; 225 226 Drupal.Leaflet.prototype.add_features = function(mapid, features, initial) { 227 let self = this; 228 for (let i = 0; i < features.length; i++) { 229 let feature = features[i]; 230 let lFeature; 231 232 // dealing with a layer group 233 if (feature.group) { 234 let lGroup = self.create_feature_group(); 235 for (let groupKey in feature.features) { 236 let groupFeature = feature.features[groupKey]; 237 lFeature = self.create_feature(groupFeature); 238 if (lFeature !== undefined) { 239 if (lFeature.setStyle) { 240 feature.path = feature.path ? (feature.path instanceof Object ? feature.path : JSON.parse(feature.path)) : {}; 241 lFeature.setStyle(feature.path); 242 } 243 if (groupFeature.popup) { 244 lFeature.bindPopup(groupFeature.popup); 245 } 246 lGroup.addLayer(lFeature); 247 } 248 } 249 250 // Add the group to the layer switcher. 251 self.add_overlay(feature.label, lGroup, false, mapid); 252 } 253 else { 254 lFeature = self.create_feature(feature); 255 if (lFeature !== undefined) { 256 if (lFeature.setStyle) { 257 feature.path = feature.path ? (feature.path instanceof Object ? feature.path : JSON.parse(feature.path)) : {}; 258 lFeature.setStyle(feature.path); 259 } 260 self.lMap.addLayer(lFeature); 261 262 if (feature.popup) { 263 lFeature.bindPopup(feature.popup); 264 } 265 } 266 } 267 268 // Allow others to do something with the feature that was just added to the map. 269 $(document).trigger('leaflet.feature', [lFeature, feature, self]); 270 } 271 272 // Allow plugins to do things after features have been added. 273 $(document).trigger('leaflet.features', [initial || false, self]) 274 }; 275 276 Drupal.Leaflet.prototype.create_feature_group = function() { 277 return new L.LayerGroup(); 278 }; 279 280 Drupal.Leaflet.prototype.create_feature = function(feature) { 281 let self = this; 282 let lFeature; 283 switch (feature.type) { 284 case 'point': 285 lFeature = self.create_point(feature); 286 break; 287 288 case 'linestring': 289 lFeature = self.create_linestring(feature); 290 break; 291 292 case 'polygon': 293 lFeature = self.create_polygon(feature); 294 break; 295 296 case 'multipolygon': 297 lFeature = self.create_multipolygon(feature); 298 break; 299 300 case 'multipolyline': 301 lFeature = self.create_multipoly(feature); 302 break; 303 304 case 'json': 305 lFeature = self.create_json(feature.json, feature.events); 306 break; 307 308 case 'multipoint': 309 case 'geometrycollection': 310 lFeature = self.create_collection(feature); 311 break; 312 313 default: 314 return; // Crash and burn. 315 } 316 317 let options = {}; 318 if (feature.options) { 319 for (let option in feature.options) { 320 if (feature.options.hasOwnProperty(option)) { 321 options[option] = feature.options[option]; 322 } 323 } 324 lFeature.setStyle(options); 325 } 326 327 if (feature.entity_id) { 328 329 // Generate the markers object index based on entity id (and geofield 330 // cardinality), and add the marker to the markers object. 331 let entity_id = feature.entity_id; 332 if (self.map_definition.geofield_cardinality && self.map_definition.geofield_cardinality !== 1) { 333 let i = 0; 334 while (Drupal.Leaflet[self.mapid].markers[entity_id + '-' + i]) { 335 i++; 336 } 337 Drupal.Leaflet[self.mapid].markers[entity_id + '-' + i] = lFeature; 338 Drupal.Leaflet[self.mapid].features[entity_id + '-' + i] = feature; 339 } 340 else { 341 Drupal.Leaflet[self.mapid].markers[entity_id] = lFeature; 342 Drupal.Leaflet[self.mapid].features[entity_id] = feature; 343 } 344 } 345 return lFeature; 346 }; 347 348 Drupal.Leaflet.prototype.create_layer = function(layer, key) { 349 let self = this; 350 let map_layer = new L.TileLayer(layer.urlTemplate); 351 if (layer.type === 'wms') { 352 map_layer = new L.tileLayer.wms(layer.urlTemplate, layer.options); 353 } 354 map_layer._leaflet_id = key; 355 356 if (layer.options) { 357 for (let option in layer.options) { 358 map_layer.options[option] = layer.options[option]; 359 } 360 } 361 362 // Layers served from TileStream need this correction in the y coordinates. 363 // TODO: Need to explore this more and find a more elegant solution. 364 if (layer.type === 'tilestream') { 365 map_layer.getTileUrl = function(tilePoint) { 366 self._adjustTilePoint(tilePoint); 367 let zoom = self._getZoomForUrl(); 368 return L.Util.template(self._url, L.Util.extend({ 369 s: self._getSubdomain(tilePoint), 370 z: zoom, 371 x: tilePoint.x, 372 y: Math.pow(2, zoom) - tilePoint.y - 1 373 }, self.options)); 374 } 375 } 376 return map_layer; 377 }; 378 379 Drupal.Leaflet.prototype.create_icon = function(options) { 380 let icon_options = { 381 iconUrl: options.iconUrl, 382 }; 383 384 // Override applicable marker defaults. 385 if (options.iconSize) { 386 icon_options.iconSize = new L.Point(parseInt(options.iconSize.x), parseInt(options.iconSize.y)); 387 } 388 if (options.iconAnchor && options.iconAnchor.x && options.iconAnchor.y) { 389 icon_options.iconAnchor = new L.Point(parseInt(options.iconAnchor.x), parseInt(options.iconAnchor.y)); 390 } 391 if (options.popupAnchor && options.popupAnchor.x && options.popupAnchor.y) { 392 icon_options.popupAnchor = new L.Point(parseInt(options.popupAnchor.x), parseInt(options.popupAnchor.y)); 393 } 394 if (options.shadowUrl) { 395 icon_options.shadowUrl = options.shadowUrl; 396 } 397 if (options.iconRetinaUrl) { 398 icon_options.iconRetinaUrl = options.iconRetinaUrl; 399 } 400 if (options.shadowSize && options.shadowSize.x && options.shadowSize.y) { 401 icon_options.shadowSize = new L.Point(parseInt(options.shadowSize.x), parseInt(options.shadowSize.y)); 402 } 403 if (options.shadowAnchor && options.shadowAnchor.x && options.shadowAnchor.y) { 404 icon_options.shadowAnchor = new L.Point(parseInt(options.shadowAnchor.x), parseInt(options.shadowAnchor.y)); 405 } 406 if (options.className) { 407 icon_options.className = options.className; 408 } 409 410 return new L.Icon(icon_options); 411 }; 412 413 Drupal.Leaflet.prototype.create_divicon = function (options) { 414 let html_class = options.html_class || ''; 415 let icon = new L.DivIcon({html: options.html, className: html_class}); 416 417 // override applicable marker defaults 418 if (options.iconSize) { 419 icon.options.iconSize = new L.Point(parseInt(options.iconSize.x, 10), parseInt(options.iconSize.y, 10)); 420 } 421 if (options.iconAnchor && options.iconAnchor.x && options.iconAnchor.y) { 422 icon.options.iconAnchor = new L.Point(parseInt(options.iconAnchor.x), parseInt(options.iconAnchor.y)); 423 } 424 if (options.popupAnchor && !isNaN(options.popupAnchor.x) && !isNaN(options.popupAnchor.y)) { 425 icon.options.popupAnchor = new L.Point(parseInt(options.popupAnchor.x), parseInt(options.popupAnchor.y)); 426 } 427 428 return icon; 429 }; 430 431 Drupal.Leaflet.prototype.create_point = function(marker) { 432 let self = this; 433 let latLng = new L.LatLng(marker.lat, marker.lon); 434 self.bounds.push(latLng); 435 let lMarker; 436 let marker_title = marker.label ? marker.label.replace(/<[^>]*>/g, '').trim() : ''; 437 let options = { 438 title: marker_title, 439 className: marker.className || '', 440 alt: marker_title, 441 }; 442 443 lMarker = new L.Marker(latLng, options); 444 445 if (marker.icon) { 446 if (marker.icon.iconType && marker.icon.iconType === 'html' && marker.icon.html) { 447 let icon = self.create_divicon(marker.icon); 448 lMarker.setIcon(icon); 449 } 450 else if (marker.icon.iconType && marker.icon.iconType === 'circle_marker') { 451 try { 452 options = marker.icon.options ? JSON.parse(marker.icon.options) : {}; 453 options.radius = options.radius ? parseInt(options['radiu
453s']) : 10; 454 } 455 catch (e) { 456 options = {}; 457 } 458 lMarker = new L.CircleMarker(latLng, options); 459 } 460 else if (marker.icon.iconUrl) { 461 marker.icon.iconSize = marker.icon.iconSize || {}; 462 marker.icon.iconSize.x = marker.icon.iconSize.x || this.naturalWidth; 463 marker.icon.iconSize.y = marker.icon.iconSize.y || this.naturalHeight; 464 if (marker.icon.shadowUrl) { 465 marker.icon.shadowSize = marker.icon.shadowSize || {}; 466 marker.icon.shadowSize.x = marker.icon.shadowSize.x || this.naturalWidth; 467 marker.icon.shadowSize.y = marker.icon.shadowSize.y || this.naturalHeight; 468 } 469 let icon = self.create_icon(marker.icon); 470 lMarker.setIcon(icon); 471 } 472 } 473 474 return lMarker; 475 }; 476 477 Drupal.Leaflet.prototype.create_linestring = function(polyline) { 478 let self = this; 479 let latlngs = []; 480 for (let i = 0; i < polyline.points.length; i++) { 481 let latlng = new L.LatLng(polyline.points[i].lat, polyline.points[i].lon); 482 latlngs.push(latlng); 483 self.bounds.push(latlng); 484 } 485 return new L.Polyline(latlngs); 486 }; 487 488 Drupal.Leaflet.prototype.create_collection = function(collection) { 489 let self = this; 490 let layers = new L.featureGroup(); 491 for (let x = 0; x < collection.component.length; x++) { 492 layers.addLayer(self.create_feature(collection.component[x])); 493 } 494 return layers; 495 }; 496 497 Drupal.Leaflet.prototype.create_polygon = function(polygon) { 498 let self = this; 499 let latlngs = []; 500 for (let i = 0; i < polygon.points.length; i++) { 501 let latlng = new L.LatLng(polygon.points[i].lat, polygon.points[i].lon); 502 latlngs.push(latlng); 503 self.bounds.push(latlng); 504 } 505 return new L.Polygon(latlngs); 506 }; 507 508 Drupal.Leaflet.prototype.create_multipolygon = function(multipolygon) { 509 let self = this; 510 let polygons = []; 511 for (let x = 0; x < multipolygon.component.length; x++) { 512 let latlngs = []; 513 let polygon = multipolygon.component[x]; 514 for (let i = 0; i < polygon.points.length; i++) { 515 let latlng = new L.LatLng(polygon.points[i].lat, polygon.points[i].lon); 516 latlngs.push(latlng); 517 self.bounds.push(latlng); 518 } 519 polygons.push(latlngs); 520 } 521 return new L.Polygon(polygons); 522 }; 523 524 Drupal.Leaflet.prototype.create_multipoly = function(multipoly) { 525 let self = this; 526 let polygons = []; 527 for (let x = 0; x < multipoly.component.length; x++) { 528 let latlngs = []; 529 let polygon = multipoly.component[x]; 530 for (let i = 0; i < polygon.points.length; i++) { 531 let latlng = new L.LatLng(polygon.points[i].lat, polygon.points[i].lon); 532 latlngs.push(latlng); 533 self.bounds.push(latlng); 534 } 535 polygons.push(latlngs); 536 } 537 if (multipoly.multipolyline) { 538 return new L.polyline(polygons); 539 } 540 else { 541 return new L.polygon(polygons); 542 } 543 }; 544 545 Drupal.Leaflet.prototype.create_json = function(json, events) { 546 let lJSON = new L.GeoJSON(); 547 548 lJSON.options.onEachFeature = function(feature, layer) { 549 for (let layer_id in layer._layers) { 550 for (let i in layer._layers[layer_id]._latlngs) { 551 Drupal.Leaflet.bounds.push(layer._layers[layer_id]._latlngs[i]); 552 } 553 } 554 if (feature.properties.style) { 555 layer.setStyle(feature.properties.style); 556 } 557 if (feature.properties.leaflet_id) { 558 layer._leaflet_id = feature.properties.leaflet_id; 559 } 560 if (feature.properties.popup) { 561 layer.bindPopup(feature.properties.popup); 562 } 563 for (e in events) { 564 layerParam = {}; 565 layerParam[e] = eval(events[e]); 566 layer.on(layerParam); 567 } 568 }; 569 570 lJSON.addData(json); 571 return lJSON; 572 }; 573 574 // Set Map initial map position and Zoom. Different scenarios: 575 // 1) Force the initial map center and zoom to values provided by input settings 576 // 2) Fit multiple features onto map using Leaflet's fitBounds method 577 // 3) Fit a single polygon onto map using Leaflet's fitBounds method 578 // 4) Display a single marker using the specified zoom 579 // 5) Adjust the initial zoom using zoomFiner, if specified 580 // 6) Cater for a map with no features (use input settings for Zoom and Center, if supplied) 581 // 582 // @NOTE: This method used by Leaflet Markecluster module (don't remove/rename) 583 Drupal.Leaflet.prototype.fitbounds = function(mapid) { 584 let self = this; 585 let start_zoom = self.settings.zoom ? self.settings.zoom : 12; 586 // Note: self.settings.center might not be defined in case of Leaflet widget and Automatically locate user current position. 587 let start_center = self.settings.center ? new L.LatLng(self.settings.center.lat, self.settings.center.lon) : new L.LatLng(0,0); 588 589 // Check whether the Zoom and Center are to be forced to use the input settings 590 if (self.settings.map_position_force) { 591 // Set the Zoom and Center to values provided by the input settings
592 Drupal.Leaflet[mapid].lMap.setView(start_center, start_zoom); 593 } else { 594 if (self.bounds.length === 0) { 595 // No features - set the Zoom and Center to values provided by the input settings, if specified 596 Drupal.Leaflet[mapid].lMap.setView(start_center, start_zoom); 597 } else { 598 // Set the Zoom and Center by using the Leaflet fitBounds function 599 let bounds = new L.LatLngBounds(self.bounds); 600 Drupal.Leaflet[mapid].lMap.fitBounds(bounds); 601 start_center = bounds.getCenter(); 602 start_zoom = Drupal.Leaflet[mapid].lMap.getBoundsZoom(bounds); 603 604 if (self.bounds.length === 1) { 605 // Single marker - set zoom to input settings 606 Drupal.Leaflet[mapid].lMap.setZoom(self.settings.zoom); 607 start_zoom = self.settings.zoom; 608 } 609 } 610 611 // In case of map initial position not forced, and zooFiner not null/neutral, 612 // adapt the Map Zoom and the Start Zoom accordingly. 613 if (self.settings.hasOwnProperty('zoomFiner') && parseInt(self.settings.zoomFiner)) { 614 start_zoom += parseFloat(self.settings.zoomFiner); 615 Drupal.Leaflet[mapid].lMap.setView(start_center, start_zoom); 616 } 617 618 // Set the map start zoom and center. 619 Drupal.Leaflet[mapid].start_zoom = start_zoom; 620 Drupal.Leaflet[mapid].start_center = start_center; 621 } 622 623 }; 624 625 Drupal.Leaflet.prototype.map_reset = function(mapid) { 626 Drupal.Leaflet[mapid].lMap.setView(Drupal.Leaflet[mapid].start_center, Drupal.Leaflet[mapid].start_zoom); 627 }; 628 629 Drupal.Leaflet.prototype.map_reset_control = function(controlDiv, mapid) { 630 let self = this; 631 let reset_map_control_settings = drupalSettings.leaflet[mapid].map.settings.reset_map; 632 let control = new L.Control({position: reset_map_control_settings.position}); 633 control.onAdd = function() { 634 // Set CSS for the control border. 635 let controlUI = L.DomUtil.create('div','resetzoom'); 636 controlUI.style.backgroundColor = '#fff'; 637 controlUI.style.border = '2px solid #fff'; 638 controlUI.style.borderRadius = '3px'; 639 controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)'; 640 controlUI.style.cursor = 'pointer'; 641 controlUI.style.margin = '6px'; 642 controlUI.style.textAlign = 'center'; 643 controlUI.title = Drupal.t('Click to reset the map to its initial state'); 644 controlUI.id = 'leaflet-map--' + mapid + '--reset-control'; 645 controlUI.disabled = true; 646 controlDiv.appendChild(controlUI); 647 648 // Set CSS for the control interior. 649 let controlText = document.createElement('div'); 650 controlText.style.color = 'rgb(25,25,25)'; 651 controlText.style.fontSize = '1.1em'; 652 controlText.style.lineHeight = '28px'; 653 controlText.style.paddingLeft = '5px'; 654 controlText.style.paddingRight = '5px'; 655 controlText.innerHTML = Drupal.t('Reset Map'); 656 controlUI.appendChild(controlText); 657 658 L.DomEvent 659 .disableClickPropagation(controlUI) 660 .addListener(controlUI, 'click', function() { 661 self.map_reset(mapid); 662 },controlUI); 663 return controlUI; 664 }; 665 return control; 666 }; 667 668})(jQuery, Drupal, drupalSettings); 669 670/* Source and licensing information for the above line(s) can be found at https://www.nace.net/modules/contrib/leaflet/js/leaflet.drupal.js. */; 671/* Source and licensing information for the line(s) below can be found at https://www.nace.net/libraries/drupal-superfish/superfish.js. */ 672(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> »</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl()},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){if($$.children('.sf-clicked').length==0){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1)over.call(o.$path)}},o.delay)},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone())};return this.each(function(){var s=this.serial=sf.o.length,o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels);var p=o.$path;for(var l=0;l<p.length;l++)p.eq(l).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($(this).children('a:first-child, span.nolink:first-child'))}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a, span.nolink',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li)}).blur(function(){out.call($li)})});o.onInit.call(this)}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows)menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '))})};
672var sf=$.fn.superfish;sf.o=[];sf.op={};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'fast',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).children('ul').addClass('sf-hidden');o.onHide.call($ul);return this},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).children('ul.sf-hidden').hide().removeClass('sf-hidden');o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){o.onShow.call($ul)});return this}})})(jQuery) 673/* Source and licensing information for the above line(s) can be found at https://www.nace.net/libraries/drupal-superfish/superfish.js. */; 674/* Source and licensing information for the line(s) below can be found at https://www.nace.net/libraries/drupal-superfish/jquery.hoverIntent.minified.js. */ 675/*! 676 * hoverIntent v1.10.1 // 2019.10.05 // jQuery v1.7.0+ 677 * http://briancherne.github.io/jquery-hoverIntent/ 678 * 679 * You may use hoverIntent under the terms of the MIT license. Basically that 680 * means you are free to use hoverIntent as long as this header is left intact. 681 * Copyright 2007-2019 Brian Cherne 682 */ 683!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";function track(ev){cX=ev.pageX,cY=ev.pageY}var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});function handleHover(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg)},cfg.interval)}else{if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){!function(ev,$el,s,out){var data=$el.data("hoverIntent");data&&delete data[s.id],out.apply($el[0],[ev])}(ev,$el,state,cfg.out)},cfg.timeout)}}return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}}); 684/* Source and licensing information for the above line(s) can be found at https://www.nace.net/libraries/drupal-superfish/jquery.hoverIntent.minified.js. */; 685/* Source and licensing information for the line(s) below can be found at https://www.nace.net/libraries/drupal-superfish/sftouchscreen.js. */ 686(function($){$.fn.sftouchscreen=function(options){options=$.extend({mode:'inactive',breakpoint:768,breakpointUnit:'px',useragent:'',behaviour:2,disableHover:false},options) 687function activate(menu){var eventHandler=(('ontouchstart'in window)||(window.DocumentTouch&&document instanceof DocumentTouch))?['click touchstart','mouseup touchend']:['click','mouseup'];menu.find('li:has(ul)').children('a,span.nolink').each(function(){var item=$(this),parent=item.closest('li');if(options.disableHover)parent.off('mouseenter mouseleave');if(options.behaviour==2)if(parent.children('a.menuparent,span.nolink.menuparent').length>0&&parent.children('ul').children('.sf-clone-parent').length==0){var cloneLink=parent.children('a.menuparent').clone(),cloneLink=$('<li class="sf-clone-parent" />').html(cloneLink);cloneLink.find('.sf-sub-indicator').remove(),parent.children('ul').addClass('sf-has-clone-parent').prepend(clone
687Link)};item.on(eventHandler[0],function(event){if(item.hasClass('sf-clicked')){if(options.behaviour==0){url=item.attr('href');if(typeof url!='undefined')window.location=url}else if(options.behaviour==1||options.behaviour==2){event.preventDefault();item.removeClass('sf-clicked');parent.hideSuperfishUl().find('a,span.nolink').removeClass('sf-clicked')}}else{event.preventDefault();item.addClass('sf-clicked');parent.showSuperfishUl().siblings('li:has(ul)').hideSuperfishUl().find('.sf-clicked').removeClass('sf-clicked')}})});$(document).on(eventHandler[1],function(event){if(menu.not(event.target)&&menu.has(event.target).length===0){menu.find('.sf-clicked').removeClass('sf-clicked');menu.find('li:has(ul)').hideSuperfishUl()}})};for(var b=0;b<this.length;b++){var menu=$(this).eq(b),mode=options.mode;if(mode=='always_active'){activate(menu)}else if(mode=='window_width'){var breakpoint=(options.breakpointUnit=='em')?(options.breakpoint*parseFloat($('body').css('font-size'))):options.breakpoint,windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,timer;if((typeof Modernizr==='undefined'||typeof Modernizr.mq!=='function')&&windowWidth<breakpoint){activate(menu)}else if(typeof Modernizr!=='undefined'&&typeof Modernizr.mq==='function'&&Modernizr.mq('(max-width:'+(breakpoint-1)+'px)'))activate(menu);$(window).resize(function(){clearTimeout(timer);timer=setTimeout(function(){var windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if((typeof Modernizr==='undefined'||typeof Modernizr.mq!=='function')&&windowWidth<breakpoint){activate(menu)}else if(typeof Modernizr!=='undefined'&&typeof Modernizr.mq==='function'&&Modernizr.mq('(max-width:'+(breakpoint-1)+'px)'))activate(menu)},50)})}else if(mode=='useragent_custom'){if(options.useragent!=''){var ua=RegExp(options.useragent,'i');if(navigator.userAgent.match(ua))activate(menu)}}else if(mode=='useragent_predefined'&&navigator.userAgent.match(/(android|bb\d+|meego)|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i))activate(menu)};return this}})(jQuery) 688/* Source and licensing information for the above line(s) can be found at https://www.nace.net/libraries/drupal-superfish/sftouchscreen.js. */; 689/* Source and licensing information for the line(s) below can be found at https://www.nace.net/libraries/drupal-superfish/sfsmallscreen.js. */ 690(function($){$.fn.sfsmallscreen=function(options){options=$.extend({mode:'inactive',type:'accordion',breakpoint:768,breakpointUnit:'px',useragent:'',title:'',addSelected:false,menuClasses:false,hyperlinkClasses:false,excludeClass_menu:'',excludeClass_hyperlink:'',includeClass_menu:'',includeClass_hyperlink:'',accordionButton:1,expandText:'Expand',collapseText:'Collapse'},options) 691function refine(menu){var refined=menu.clone(),rm=refined.find('span.sf-sub-indicator'),rh=refined.find('.sf-smallscreen-remove'),mm=refined.find('ul.sf-multicolumn');for(var a=0;a<rh.length;a++)rh.eq(a).replaceWith(rh.eq(a).html());if(options.accordionButton==2||options.type=='select')for(var b=0;b<rm.length;b++)rm.eq(b).remove();if(mm.length>0){mm.removeClass('sf-multicolumn');var ol=refined.find('div.sf-multicolumn-column > ol');for(var o=0;o<ol.length;o++)ol.eq(o).replaceWith('<ul>'+ol.eq(o).html()+'</ul>');var elements=['div.sf-multicolumn-column','.sf-multicolumn-wrapper > ol','li.sf-multicolumn-wrapper'];for(var i=0;i<elements.length;i++){obj=refined.find(elements[i]);for(var t=0;t<obj.length;t++)obj.eq(t).replaceWith(obj.eq(t).html())};refined.find('.sf-multicolumn-column').removeClass('sf-multicolumn-column')};refined.add(refined.find('*')).css({width:''});return refined} 692function toSelect(menu,level){var items='',childLI=$(menu).children('li');for(var a=0;a<childLI.length;a++){var list=childLI.eq(a),parent=list.children('a, span');for(var b=0;b<parent.length;b++){var item=parent.eq(b),path=(item.is('a')&&!!item.attr('href'))?item.attr('href'):'',itemClone=item.clone(),classes=(options.hyperlinkClasses)?((options.excludeClass_hyperlink&&itemClone.hasClass(options.excludeClass_hyperlink))?itemClone.removeClass(options.excludeClass_hyperlink).attr('class'):itemClone.attr('class')):'',classes=(options.includeClass_hyperlink&&!itemClone.hasClass(options.includeClass_hyperlink))?((options.hyperlinkClasses)?itemClone.addClass(options.includeClass_hyperlink).attr('class'):options.includeClass_hyperlink):classe
692s;if(options.addSelected&&item.hasClass('active'))classes+=' active';classes=classes?' class="'+classes+'"':'';disable=(path=='')||(path=='#')?' disabled="disabled"':'',subIndicator=1<level?Array(level).join('-')+' ':'';items+='<option value="'+path+'"'+classes+disable+'>'+subIndicator+$.trim(item.text())+'</option>',childUL=list.find('> ul');for(var u=0;u<childUL.length;u++)items+=toSelect(childUL.eq(u),level+1)}};return items} 693function convert(menu){var menuID=menu.attr('id'),refinedMenu=refine(menu);if(options.type=='accordion'){var toggleID=menuID+'-toggle',accordionID=menuID+'-accordion';if($('#'+accordionID).length==0){var styleClass=menu.attr('class').split(' ').filter(function(item){return item.indexOf('sf-style-')>-1?item:''}),accordion=$(refinedMenu).attr('id',accordionID);accordion.removeClass('sf-horizontal sf-vertical sf-navbar sf-shadow sf-js-enabled');accordion.addClass('sf-accordion sf-hidden');accordion.find('li').each(function(){$(this).removeAttr('style').removeClass('sfHover').attr('id',$(this).attr('id')+'-accordion')});accordion.children('ul').removeAttr('style').not('.sf-hidden').addClass('sf-hidden');var toggle='<div class="sf-accordion-toggle '+styleClass+'"><a href="#" id="'+toggleID+'"><span>'+options.title+'</span></a></div>';if(options.accordionButton==2){accordion.addClass('sf-accordion-with-buttons');var parent=accordion.find('li.menuparent');for(var i=0;i<parent.length;i++)parent.eq(i).prepend('<a href="#" class="sf-accordion-button">'+options.expandText+'</a>')};menu.before(toggle).before(accordion).hide();var accordionElement=$('#'+accordionID),buttonElement=(options.accordionButton<2)?'a.menuparent,span.nolink.menuparent':'a.sf-accordion-button',button=accordionElement.find(buttonElement);$('#'+toggleID).on('click',function(e){e.preventDefault();$(this).toggleClass('sf-expanded');if(accordionElement.hasClass('sf-expanded')){accordionElement.add(accordionElement.find('li.sf-expanded')).removeClass('sf-expanded').end().children('ul').hide().end().hide().addClass('sf-hidden').show();if(options.accordionButton==2)accordionElement.find('a.sf-accordion-button').text(options.expandText)}else accordionElement.addClass('sf-expanded').hide().removeClass('sf-hidden').show()});button.on('click',function(e){if($(this).closest('li').children('ul').length>0){e.preventDefault();var parent=$(this).closest('li');if(options.accordionButton==1&&parent.children('a.menuparent,span.nolink.menuparent').length>0&&parent.children('ul').children('li.sf-clone-parent').length==0){var cloneLink=parent.children('a.menuparent').clone();cloneLink.removeClass('menuparent sf-with-ul').children('.sf-sub-indicator').remove();cloneLink=$('<li class="sf-clone-parent" />').html(cloneLink);parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink)};if(parent.hasClass('sf-expanded')){parent.children('ul').slideUp('fast',function(){$(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show()});if(options.accordionButton==2&&parent.children('.sf-accordion-button').length>0)parent.children('.sf-accordion-button').text(options.expandText)}else parent.children('ul').hide().removeClass('sf-hidden').slideDown('fast').end().addClass('sf-expanded').children('a.sf-accordion-button').text(options.collapseText).end().siblings('li.sf-expanded').children('ul').slideUp('fast',function(){$(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show()}).parent().children('a.sf-accordion-button').text(options.expandText)}})}}else{var menuClone=menu.clone(),classes=(options.menuClasses)?((options.excludeClass_menu&&menuClone.hasClass(options.excludeClass_menu))?menuClone.removeClass(options.excludeClass_menu).attr('class'):menuClone.attr('class')):'',classes=(options.includeClass_menu&&!menuClone.hasClass(options.includeClass_menu))?((options.menuClasses)?menuClone.addClass(options.includeClass_menu).attr('class'):options.includeClass_menu):classes,classes=classes?' class="'+classes+'"':'';if($('#'+menuID+'-select').length==0){var newMenu=toSelect(refinedMenu,1),selectList=$('<select'+classes+' id="'+menuID+'-select"/>').html('<option>'+options.title+'</option>'+newMenu).change(function(){if($('option:selected',this).index())window.location=selectList.val()});if(options.addSelected)selectList.find('.active').attr('selected',!0);menu.before(selectList).hide()}}} 694function turnBack(menu){var id='#'+menu.attr('id');$(id+'-'+options.type).remove();if(options.type=='accordion')$(id+'-toggle').parent('div').remove();$(id).css('display','')};for(var s=0;s<this.length;s++){var menu=$(this).eq(s),mode=options.mode;if(menu.children('li').length==0);else if(mode=='always_active'){convert(menu)}else if(mode=='window_width'){var breakpoint=(options.breakpointUnit=='em')?(options.breakpoint*parseFloat($('body').css('font-size'))):options.breakpoint,windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,timer;if((typeof Modernizr==='undefined'||typeof Modernizr.mq!=='function')&&windowWidth<breakpoint){convert(menu)}else if(typeof Modernizr!=='undefined'&&typeof Modernizr.mq==='function'&&Modernizr.mq('(max-width:'+(breakpoint-1)+'px)'))convert(menu);$(window).resize(function(){clearTimeout(timer);timer=setTimeout(function(){var windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if((typeof Modernizr==='undefined'||typeof Modernizr.mq!=='function')&&windowWidth<breakpoint){convert(menu)}else if(typeof Modernizr!=='undefined'&&typeof Modernizr.mq==='function'&&Modernizr.mq('(max-width:'+(breakpoint-1)+'px)')){convert(menu)}else turnBack(menu)},50)})}else if(mode=='useragent_custom'){if(options.useragent!=''){var ua=RegExp(options.useragent,'i');if(navigator.userAgent.match(ua))convert(menu)}}else if(mode=='useragent_predefined'&&navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i))convert(menu)};return this}})(jQuery) 695/* Source and licensing information for the above line(s) can be found at https://www.nace.net/libraries/drupal-superfish/sfsmallscreen.js. */; 696/* Source and licensing information for the line(s) below can be found at https://www.nace.net/libraries/drupal-superfish/supposition.js. */ 697(function($){$.fn.supposition=function(){var $w=$(window),_offset=function(dir){return window[dir=='y'?'pageYOffset':'pageXOffset']||document.documentElement&&document.documentElement[dir=='y'?'scrollTop':'scrollLeft']||document.body[dir=='y'?'scrollTop':'scrollLeft']},onHide=function(){this.css({bottom:''})},onBeforeShow=function(){this.each(function(){var $u=$(this);$u.css('display','block');var $mul=$u.closest('.sf-menu'),level=$u.parents('ul').length,menuWidth=$u.width(),menuParentWidth=$u.closest('li').outerWidth(true),menuParentLeft=$u.closest('li').offset().left,totalRight=$w.width()+_offset('x'),menuRight=$u.offset().left+menuWidth,exactMenuWidth=(menuRight>(menuParentWidth+menuParentLeft))?menuWidth-(menuRight-(menuParentWidth+menuParentLeft)):menuWidth;if($u.parents('.sf-js-enabled').hasClass('rtl')){if(menuParentLeft<exactMenuWidth){if(($mul.hasClass('sf-horizontal')&&level==1)||($mul.hasClass('sf-navbar')&&level==2)){$u.css({left:0,right:'auto'})}else $u.css({left:menuParentWidth+'px',right:'auto'});$u.parent().addClass('sf-supposition-active')}}else if(menuRight>totalRight&&menuParentLeft>menuWidth){if(($mul.hasClass('sf-horizontal')&&level==1)||($mul.hasClass('sf-navbar')&&level==2)){$u.css({right:0,left:'auto'})}else $u.css({right:menuParentWidth+'px',left:'auto'});$u.parent().addClass('sf-supposition-active')};var windowHeight=$w.height(),offsetTop=$u.offset().top,menuParentShadow=($mul.hasClass('sf-shadow')&&$u.css('padding-bottom').length>0)?parseInt($u.css('padding-bottom').slice(0,-2)):0,menuParentHeight=($mul.hasClass('sf-vertical'))?'-'+menuParentShadow:$u.parent().outerHeight(true)-menuParentShadow,menuHeight=$u.height(),baseline=windowHeight+_offset('y'),expandUp=((offsetTop+menuHeight>baseline)&&(offsetTop>
697menuHeight));if(expandUp)$u.css({bottom:menuParentHeight+'px',top:'auto'});$u.css('display','none')})};return this.each(function(){var o=$.fn.superfish.o[this.serial],_onBeforeShow=o.onBeforeShow,_onHide=o.onHide;$.extend($.fn.superfish.o[this.serial],{onBeforeShow:function(){onBeforeShow.call(this);_onBeforeShow.call(this)},onHide:function(){onHide.call(this);_onHide.call(this)}})})}})(jQuery) 698/* Source and licensing information for the above line(s) can be found at https://www.nace.net/libraries/drupal-superfish/supposition.js. */; 699/* Source and licensing information for the line(s) below can be found at https://www.nace.net/libraries/drupal-superfish/supersubs.js. */ 700(function($){$.fn.supersubs=function(options){var opts=$.extend({},$.fn.supersubs.defaults,options);for(var a=0;a<this.length;a++){var $$=$(this).eq(a),o=$.meta?$.extend({},opts,$$.data()):opts;if($$.hasClass('sf-navbar'))$$=$$.children('li').children('ul');var $ULs=$$.find('ul');if($ULs.length){var fontsize=$('<li id="menu-fontsize">—</li>'),size=fontsize.attr('style','padding:0;position:absolute;top:-99999em;width:auto;').appendTo($$)[0].clientWidth;fontsize.remove();for(var b=0;b<$ULs.length;b++){var $ul=$ULs.eq(b);if(o.multicolumn&&$ul.hasClass('sf-multicolumn')&&$ul.find('.sf-multicolumn-column').length>0){var $column=$ul.find('div.sf-multicolumn-column > ol'),mwWidth=0;for(var d=0;d<$column.length;d++){resize($column.eq(d));var colWidth=Math.ceil($column.width());$column.css({width:colWidth}).parents('.sf-multicolumn-column').css({width:colWidth});mwWidth+=colWidth};$ul.add($ul.find('li.sf-multicolumn-wrapper, li.sf-multicolumn-wrapper > ol')).css({width:mwWidth})}else resize($ul)}}} 701function resize($ul){var $LIs=$ul.children(),$As=$LIs.children('a');$LIs.css('white-space','nowrap');$ul.add($LIs).add($As).css({float:'none',width:'auto'});var emWidth=$ul.get(0).clientWidth/size;emWidth+=o.extraWidth;if(emWidth>o.maxWidth){emWidth=o.maxWidth}else if(emWidth<o.minWidth)emWidth=o.minWidth;emWidth+='em';$ul.css({width:emWidth});$LIs.add($As).css({float:'',width:'',whiteSpace:''});for(var c=0;c<$LIs.length;c++){var $childUl=$LIs.eq(c).children('ul'),offsetDirection=$childUl.css('left')!==undefined?'left':'right';$childUl.css(offsetDirection,'100%')}};return this};$.fn.supersubs.defaults={multicolumn:true,minWidth:12,maxWidth:27,extraWidth:1}})(jQuery) 702/* Source and licensing information for the above line(s) can be found at https://www.nace.net/libraries/drupal-superfish/supersubs.js. */; 703/* Source and licensing information for the line(s) below can be found at https://www.nace.net/modules/contrib/superfish/js/superfish.js. */ 704(function($,Drupal,drupalSettings){'use strict';Drupal.behaviors.superfish={attach:function(context,drupalSettings){$.each(drupalSettings.superfish||{},function(index,options){var $menu=$('ul#'+options.id,context);if(options.plugins||false)if(options.plugins.supersubs||false)$menu.supersubs(options.plugins.supersubs);$menu.superfish(options.sf);if(options.plugins||false){if(options.plugins.touchscreen||false)$menu.sftouchscreen(options.plugins.touchscreen);if(options.plugins.smallscreen||false)$menu.sfsmallscreen(options.plugins.smallscreen);if(options.plugins.supposition||false)$menu.supposition()}})}}})(jQuery,Drupal,drupalSettings) 705/* Source and licensing information for the above line(s) can be found at https://www.nace.net/modules/contrib/superfish/js/superfish.js. */; 706/* Source and licensing information for the line(s) below can be found at https://www.nace.net/modules/contrib/slick/js/slick.load.min.js. */ 707!function(p,k,m,n){"use strict";var v="slick",y="unslick",C=v+"--initialized",b=".slick__slider",w=".slick__arrow",z=".b-lazy:not(.b-loaded)",_=".media__icon--close",P="is-playing",$="is-paused",x=k.blazy||{};function s(e){var i,l=p("> "+b,e).length?p("> "+b,e):p(e),a=p("> "+w,e),n=l.data(v)?p.extend({},m.slick,l.data(v)):p.extend({},m.slick),s=!("array"!==p.type(n.responsive)||!n.responsive.length)&&n.responsive,t=n.appendDots,o="blazy"===n.lazyLoad&&x,d=l.find(".media--player").length,c=l.hasClass(y);if(c||(n.appendDots=t===w?a:t||p(l)),s)for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&s[i].settings!==y&&(s[i].settings=p.extend({},m.slick,g(n),s[i].settings));function r(i){l.find(z).length&&((i=l.find(i?".slide:not(.slick-cloned) "+z:".slick-active "+z)).length||(i=l.find(".slick-cloned "+z)),i.length&&x.init.load(i))}function u(){d&&f(),o&&r(!1)}function f(){l.removeClass($);var i=l.find("."+P);i.length&&i.removeClass(P).find(_).click()}function h(){l.addClass($).slick("slickPause")}function g(e){return c?{}:{slide:e.slide,lazyLoad:e.lazyLoad,dotsClass:e.dotsClass,rtl:e.rtl,prevArrow:p(".slick-prev",a),nextArrow:p(".slick-next",a),appendArrows:a,customPaging:function(i,n){var s=i.$slides.eq(n).find("[data-thumb]")||null,t='<img alt="'+k.t(s.find("img").attr("alt"))+'" src="'+s.data("thumb")+'">',t=s.length&&0<e.dotsClass.indexOf("thumbnail")?'<div class="slick-dots__thumbnail">'+t+"</div>":"",n=i.defaults.customPaging(i,n);return t?n.add(t):n}}}l.data(v,n),(n=l.data(v)).randomize&&!l.hasClass("slick-initiliazed")&&l.children().sort(function(){return.5-Math.random()}).each(function(){l.append(this)}),c||l.on("init.sl",function(i,n){t===w&&p(n.$dots).insertAfter(n.$prevArrow);n=l.find(".slick-cloned.slick-active "+z);o&&n.length&&x.init.load(n)}),o?l.on("beforeChange.sl",function(){r(!0)}):p(".media",l).closest(".slide__content").addClass("is-loading"),l.on("setPosition.sl",function(i,n){var s,t;t=(s=n).slideCount<=s.options.slidesToShow,n=t||!1===s.options.arrows,l.attr("id")===s.$slider.attr("id")&&(s.options.centerPadding&&"0"!==s.options.centerPadding||s.$list.css("padding",""),t&&(s.$slideTrack.width()<=s.$slider.width()||p(e).hasClass("slick--thumbnail"))&&s.$slideTrack.css({left:"",transform:""}),(s=l.find(".b-loaded ~ .b-loader")).length&&s.remove(),a[n?"addClass":"removeClass"]("visually-hidden"))}),l.slick(g(n)),l.parent().on("click.sl",".slick-down",function(i){i.preventDefault();i=p(this);p("html, body").stop().animate({scrollTop:p(i.data("target")).offset().top-(i.data("offset")||0)},800,"easeOutQuad"in p.easing&&n.easing?n.easing:"swing")}),n.mouseWheel&&l.on("mousewheel.sl",function(i,n){return i.preventDefault(),l.slick(n<0?"slickNext":"slickPrev")}),o||l.on("lazyLoaded lazyLoadError",function(i,n,s){var t;t=(s=p(t=s)).closest(".slide")||s.closest("."+y),s.parentsUntil(t).removeClass(function(i,n){return(n.match(/(\S+)loading/g)||[]).join(" ")})}),l.on("afterChange.sl",u),d&&(l.on("click.sl",_,f),l.on("click.sl",".media__icon--play",h)),c&&l.slick(y),p(e).addClass(C)}k.behaviors.slick={attach:function(i){i=(i=(i="length"in(i=i||document)?i[0]:i)instanceof HTMLDocument?i:document).querySelectorAll(".slick:not(.slick--initialized)");i.length&&n.once(n.forEach(i,s))}}}(jQuery,Drupal,drupalSettings,dBlazy); 708 709/* Source and licensing information for the above line(s) can be found at https://www.nace.net/modules/contrib/slick/js/slick.load.min.js. */;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.