PageSourceSearch

https://www.holcim.com.sv/sites/elsalvador/files/js/js_ZrmAZB-KRRJ…A_a9Y0uyKUjLUENTnJovqqvtL32TbbxK3D_ILzxHUoA

js holcim.com.sv collected 2026-10-08 12:39:22 UTC 140,570 bytes, 127 lines download raw bytes

1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
2StimulusApp.register('geomap',class extends Stimulus.Controller{static get targets(){return ["wrapper","map","select"];}connect(){console.log('geomap connected');this.Initleaflet();jQuery(this.selectTarget).on('change',this.categoryChanged.bind(this));}categoryChanged(){this.geoJSONLayer.remove();this.addDataToMap(this.getMarkers(),this.map);}Initleaflet(){this.baseLayer=L.tileLayer(jQuery(this.wrapperTarget).data('map'),{attribution:''});this.map=L.map(this.mapTarget,{scrollWheelZoom:false,center:[36.572,11.442],zoom:3.16,maxZoom:5,minZoom:3,zoomControl:false});var limit=100;var top_right=this.map.project(this.map.getBounds().getNorthEast(),this.map.getZoom());top_right['x']=top_right['x']+limit;top_right['y']=top_right['y']-limit;var bottom_left=this.map.project(this.map.getBounds().getSouthWest(),this.map.getZoom());bottom_left['x']=bottom_left['x']-limit;bottom_left['y']=bottom_left['y']+limit;var corner1=this.map.unproject(top_right);var corner2=this.map.unproject(bottom_left);var bounds=L.latLngBounds(corner1,corner2);this.map.setMaxBounds(bounds);L.control.zoom({position:'bottomright'}).addTo(this.map);this.map.addLayer(this.baseLayer);this.addDataToMap(this.getMarkers(),this.map);}getMarkers(){var markers=jQuery(this.wrapperTarget).data('markers');return markers;}filterMarkers(feature){var tid=jQuery(this.selectTarget).val();return feature.properties.Tid==tid;}addDataToMap(data,map){this.geoJSONLayer=L.geoJson(data,{filter:this.filterMarkers.bind(this),onEachFeature:function(feature,marker){var locationText='<div class="locationText">'+feature.properties.Location+'</div>';var addressText='<div class="addressText">'+feature.properties.Address+'</div>';var img='<div class="img"><img src="'+feature.properties.ImageUrl+'"/></div>';marker.bindPopup(locationText+addressText+img,{maxWidth:200,minWidth:200});marker.on('click',function(){var offset=100;var xy=map.project(this.getLatLng(),map.getZoom());xy['y']=xy['y']-offset;var latlng=map.unproject(xy);map.panTo(latlng,{animate:true,duration:2});});}});this.geoJSONLayer.addTo(this.map);}});;
3StimulusApp.register('geomap_edifixio',class extends Stimulus.Controller{static get targets(){return ["wrapper","map","markers","filters","searchIcon","input","select","autocomplete","listWrapper"];}connect(){console.log('geomap edifixio connected');this.path_prefix=jQuery(this.wrapperTarget).data('path_prefix');this.disableClusteringAtZoom=16;this.maxZoom=16;this.minZoom=0;this.latInit=jQuery(this.wrapperTarget).data('initial_lat')?jQuery(this.wrapperTarget).data('initial_lat'):'auto';this.lonInit=jQuery(this.wrapperTarget).data('initial_lon')?jQuery(this.wrapperTarget).data('initial_lon'):'auto';this.distanceValue=jQuery(this.wrapperTarget).data('initial_distance')?jQuery(this.wrapperTarget).data('initial_distance'):'miles';this.zoomInit=jQuery(this.wrapperTarget).data('initial_zoom')??5;this.addressformat=jQuery(this.wrapperTarget).data('cc')?jQuery(this.wrapperTarget).data('cc'):'';this.detail=jQuery(this.wrapperTarget).data('detail')?jQuery(this.wrapperTarget).data('detail'):'';this.directionLink=jQuery(this.wrapperTarget).data('direction_link');if(navigator.geolocation)navigator.geolocation.getCurrentPosition(this.handleLocation.bind(this,true),this.handleLocationError.bind(this,true));const activityQuery=this.getFilterValue('activity');const addressQuery=this.getFilterValue('address');if(activityQuery||addressQuery){if(activityQuery!=null)this.locationFinderActivityQuery=activityQuery;if(addressQuery!=null)this.getNewInitalPosition(decodeURIComponent(addressQuery)).then((coords)=>{if(coords){this.latInit=coords.lat;this.lonInit=coords.lon;this.zoomInit=9;this.locationFinderAddressQuery=coords.address;}else console.log("Failed to get coordinates from address");}).finally(()=>{this.showListWrapper();this.Initleaflet();this.getMarkers();if(addressQuery){paramsObj.q=this.locationFinderAddressQuery;jQuery(this.inputTarget).val(this.locationFinderAddressQuery);}});this.clearQueryParams();}if(!addressQuery){this.showListWrapper();this.Initleaflet();this.getMarkers();}let cc=jQuery(this.wrapperTarget).data('cc');let excludedWordsRaw=jQuery(this.wrapperTarget).data('excluded');this.excludedWords=[];if(excludedWordsRaw)this.excludedWords=excludedWordsRaw.split(',').map((w)=>
3w.trim().toLowerCase()).filter(Boolean);let paramsObj={'accept-language':drupalSettings.path.currentLanguage,'addressdetails':1};if(cc)paramsObj.countrycodes=cc;this.searchProvider=new GeoSearch.OpenStreetMapProvider({params:paramsObj});jQuery(this.searchIconTarget).on('click',this.autocompleteHandler.bind(this));jQuery(this.inputTarget).on('propertychange input',this.autocomplete.bind(this));jQuery(this.applyFiltersTarget).on('click',this.applyFilters.bind(this));jQuery(this.selectTarget).on('change',this.applyFiltersAsSelect.bind(this));jQuery(this.inputTarget).on('keydown',this.onInputKeydown.bind(this));this.onClickOutside=this.handleClickOutside.bind(this);document.addEventListener('click',this.onClickOutside);}isExcludedResult(result){if(!this.excludedWords.length)return false;let haystack=result.label.toLowerCase();if(result.raw&&result.raw.address)haystack+=' '+JSON.stringify(result.raw.address).toLowerCase();return this.excludedWords.some((word)=>haystack.includes(word));}onInputKeydown(e){if(e.key==='Enter'){e.preventDefault();const firstResult=jQuery(this.autocompleteTarget).find('li').first();if(firstResult.length)firstResult.trigger('click');}}handleClickOutside(e){const $target=jQuery(e.target);const isInsideInput=$target.closest(this.inputTarget).length;const isInsideAutocomplete=$target.closest(this.autocompleteTarget).length;if(!isInsideInput&&!isInsideAutocomplete)jQuery(this.autocompleteTarget).empty();}disconnect(){document.removeEventListener('click',this.onClickOutside);}extractISOCode(address){const isoCode=address['ISO3166-2-lvl4'];if(isoCode){const parts=isoCode.split('-');return parts.length>1?parts[1]:'';}return '';}async getNewInitalPosition(address){const url=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(address)}&format=json&addressdetails=1`;try{const response=await fetch(url);const data=await response.json();if(data.length>0){const {lat,lon,display_name}=data[0];return {lat,lon,address:display_name};}else throw new Error("Address not found");}catch(error){console.error('Error:',error);return null;}}formatAddress(result){const address=result.raw.address;var cc=result.raw.address.country_code;if(cc==='au'||cc==='nz'){const street=address.road||address.street||'';const city=address.city||address.city_district||address.town||address.village||'';const postcode=address.postcode||'';const isoLevel4Code=this.extractISOCode(address);const addressParts=[];if(street)addressParts.push(street);if(city)addressParts.push(city);if(isoLevel4Code)addressParts.push(isoLevel4Code);if(postcode)addressParts.push(postcode);return addressParts.join(', ');}else return result.label;}applyFilters(){this.map.setZoom(this.zoomInit);var aux=jQuery(this.filtersTarget).find('.filter_wrapper.active .activity');if(aux.length)this.activities=aux.toArray().map(function(item){return jQuery(item).html();});else this.activities=null;this.showList();this.showListWrapper();this.addDataToMap(this.markers,this.map);}applyFiltersAsSelect(){this.map.setZoom(this.zoomInit);var aux=jQuery(this.selectTarget).val();if(aux.length)this.activities=aux;else this.activities=null;this.showList();this.showListWrapper();this.addDataToMap(this.markers,this.map);}autocomplete(){clearTimeout(this.debounceAutocomplete);var that=this;this.debounceAutocomplete=setTimeout(()=>{that.autocompleteHandler();},300);}async autocompleteHandler(){var input=this.inputTarget;if(input.value.length<3){jQuery(this.autocompleteTarget).empty();return;}if(!input.value){jQuery(this.autocompleteTarget).empty();return;}jQuery(this.autocompleteTarget).html('<div class="loading">'+Drupal.t('Searching…')+'</div>');try{let osmResults=await this.searchProvider.search({query:input.value});osmResults=osmResults.filter((r)=>!this.isExcludedResult(r)).map((r)=>({type:'osm',label:this.formatAddress(r),x:r.x,y:r.y,raw:r}));let localResults=this.searchLocalMarkers(input.value);let results=[...localResults,...osmResults];const seen=new Set();results=results.filter((r)=>{const key=r.label;if(seen.has(key))return false;seen.add(key);return true;});if(!results.length){jQuery(this.autocompleteTarget).html('');return;}let output='<ul>';for(let i=0;i<results.length;i++){let r=results[i];let icon=r.type==='local'?'📍':'🌍';output+=`
4        <li 
5          class="${r.type}-result"
6          data-lat="${r.y}" 
7          data-lon="${r.x}"
8          data-type="${r.type}"
9        >
10          ${icon} ${r.label}
11        </li>`;}output+='</ul>';jQuery(this.autocompleteTarget).html(output);jQuery(this.autocompleteTarget).find('li').on('click',this.gotoPosition.bind(this));}catch(e){console.error('Autocomplete error',e);jQuery(this.autocompleteTarget).html('');}}searchLocalMarkers(query){if(!this.markers||!this.markers.features)return [];query=query.toLowerCase();return this.markers.features.filter((feature)=>{const props=feature.properties;const haystack=[props.location_name,props.locality,props.administrative_area,props.country].filter(
11Boolean).join(' ').toLowerCase();return haystack.includes(query);}).slice(0,5).map((feature)=>{return {type:'local',label:feature.properties.location_name+' - '+(feature.properties.locality||''),x:feature.geometry.coordinates[0],y:feature.geometry.coordinates[1],feature};});}gotoPosition(e){var li=e.currentTarget;var lat=jQuery(li).data('lat');var lon=jQuery(li).data('lon');var type=jQuery(li).data('type');var position={coords:{latitude:lat,longitude:lon}};this.handleLocation(false,position,11);jQuery(this.autocompleteTarget).html('');if(this.addressformat=="")this.map.setZoom(6);else this.map.setZoom(10);if(type==='local'){let that=this;setTimeout(()=>{for(let key in that.mapMarkers){let marker=that.mapMarkers[key];let mLatLng=marker.getLatLng();if(Math.abs(mLatLng.lat-lat)<0.0001&&Math.abs(mLatLng.lng-lon)<0.0001){marker.openPopup();document.querySelectorAll('.highlight').forEach((el)=>{el.classList.remove('highlight');});const el=document.querySelector(`.marker_wrapper[data-id="${key}"]`);if(el)el.classList.add('highlight');break;}}},400);}}showListWrapper(){jQuery(this.filtersWrapperTarget).hide();jQuery(this.listWrapperTarget).show();}Initleaflet(){this.markers=null;const baseLayerAttribution='<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a> <a href="https://www.openstreetmap.org/about">contributors</a>';this.baseLayer=L.tileLayer(jQuery(this.wrapperTarget).data('map'),{attribution:baseLayerAttribution});const osmLayerAttribution='© OpenStreetMap';this.osm=L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png',{maxZoom:19});const mapboxAttribution='Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>';const mapboxUrl='https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw';this.streets=L.tileLayer(mapboxUrl,{id:'mapbox/streets-v11',tileSize:512,zoomOffset:-1});this.satellite=L.tileLayer(mapboxUrl,{id:'mapbox/satellite-v9',tileSize:512,zoomOffset:-1});this.map=L.map(this.mapTarget,{scrollWheelZoom:false,gestureHandling:true,maxZoom:this.maxZoom,minZoom:this.minZoom,zoomControl:false});this.map.attributionControl.setPrefix(false);this.centerMapInitial();var baseMaps={"Continents":this.baseLayer,"OpenStreetMap":this.osm,"Mapbox Streets":this.streets,"Satellite":this.satellite};L.easyButton('fa-crosshairs',(function(btn,map){this.centerMapInitial();}).bind(this),'Reset').addTo(this.map);L.control.zoom({position:'topleft'}).addTo(this.map);this.map.addLayer(this.baseLayer);}async getMarkers(){if(this.markers)return this.markers;var result=null;try{result=await this.handleFetchMarkers();}catch{console.log('handleFetchMarkers error.');}if(result){this.markers=result.data.markers;this.markers.features=this.markers.features.filter(function(item){let lat=item.geometry.coordinates[1];let lon=item.geometry.coordinates[0];if(parseFloat(lat)<-90||parseFloat(lat)>90){console.log('LEAFLET ERROR: Lat out of bounds, ignoring line:');console.log(item);return false;}if(parseFloat(lon)<-180||parseFloat(lon)>180){console.log('LEAFLET ERROR: Lon out of bounds, ignoring line:');console.log(item);return false;}try{let latlon=L.latLng(lat,lon);return true;}catch(e){console.log('LEAFLET ERROR: LatLng incorrect, ignoring line:');console.log(item);return false;}});if(this.markers.features.length==0)console.log('LEAFLET ERROR: markers are empty');this.addDataToMap(this.markers,this.map);this.centerMapInitial();this.showList();this.addEventHandlers();this.showFiltersAsSelect();}return this.markers;}centerMapInitial(){if(this.latInit!='auto'&&this.lonInit!='auto')this.map.setView([this.latInit,this.lonInit],this.zoomInit);if(this.latInit=='auto'&&this.lonInit=='auto'){if(!this.clusterGroup)return;try{this.map.setView(this.clusterGroup.getBounds().getCenter(),this.zoomInit);}catch(e){}}}addEventHandlers(){this.map.on('zoomend',this.zoomEvent.bind(this));this.map.on('moveend',this.moveEvent.bind(this));}zoomEvent(){if(this.map.getZoom()>=8){this.map.removeLayer(this.baseLayer);this.map.addLayer(this.osm);}else{this.map.removeLayer(this.osm);this.map.addLayer(this.baseLayer);}this.showList();}moveEvent(){this.showList();}clearList(){jQuery(this.markersTarget).empty();}showFiltersAsSelect(){var features=this.markers.features;var aux={};for(var i=0;i<features.length;i++){var feature=features[i];if(!feature.geometry.coordinates[0]||!feature.geometry.coordinates[1])continue;if(!feature.properties.activity)continue;var activity=feature.properties.activity;var explode=activity.split(',');for(var ii=0;ii<explode.length;ii++){explode[ii]=explode[ii].replace(/^\s*/,"").replace(/\s*$/,"");aux[explode[ii]]=1;}}var keys=Object.keys(aux);for(var i=0;i<keys.length;i++){var activity=keys[i];var html='<option></option>';var $filter=jQuery(html);$filter.html(activity);if(this.locationFinderActivityQuery==activity)$filter.attr("selected","selected");jQuery(this.selectTarget).append($filter);}jQuery(this.selectTarget).show();if(keys.length<=1)jQuery(this.selectTarget).hide();if(keys.length>1){if(this.selectTarget.tomselect)return;new TomSelect(this.selectTarget,{plugins:{remove_button:{title:'Remove'}},placeholder:Drupal.t("Select a Category"),hideSelected:true,closeAfterSelect:false});}this.locationFinderActivityQuery=null;}showList(){this.clearList();var features=this.markers.features;for(var i=0;i<features.length;i++){var feature=features[i];if(!feature.geometry.coordinates[0]||!feature.geometry.coordinates[1])continue;var latlng=L.latLng(feature.geometry.coordinates[1],feature.geometry.coordinates[0]);var visible=this.map.getBounds().contains(latlng);if(!visible)continue;if(this.activities&&this.activities.length){var activity=feature.properties.activity;var explode=activity.split(',');for(var ii=0;ii<explode.length;ii++)explode[ii]=explode[ii].replace(/^\s*/,"").replace(/\s*$/,"");var check=this.activities.filter(function(item){return explode.includes(item);});if(!check.length)continue;}else{if(this.locationFinderActivityQuery!=undefined){var activity=feature.properties.activity;var explode=activity.split(',');for(var ii=0;ii<explode.length;ii++)explode[ii]=explode[ii].replace(/^\s*/,"").replace(/\s*$/,"");if(!explode.includes(this.locationFinderActivityQuery.trim()))continue;}}var store_id=feature.properties.store_code;var html='';if(this.addressformat=='gb'||this.addressformat=='us'||this.addressformat=='au'||this.addressformat=='nz'||this.addressformat=='ca')html='\
12        <div class="marker_wrapper" data-id="'+store_id+'">\
13        <div class="columns_wrapper">\
14          <div class="first_col">\
15          <div class="icon">\
16            <img class="normal" src="/themes/custom/corporate/components/geomap/images/default_icon.svg"/>\
17              <img class="hover" src="/themes/custom/corporate/components/geomap/images/default_icon_white.svg"/>\
18          </div>\
19          </div>\
20          <div class="second_col">\
21          <div class="location_name">Concrete (large load)</div>\
22          <div class="activity">activity</div>\
23          <div class="info_wrapper">\
24            <div class="address_wrapper">\
25            <div class="copy_paste"></div>\
26            <div class="addr1">New Whaf</div>\
27            <div class="addr2">Brighton Road</div>\
28            <div class="addr3">Brighton Road</div>\
29            <div class="sublocality"></div>\
30            <div class="administrative_area"></div>\
31            <div class="locality">Shoreham-By-Sea</div>\
32            <div class="postal_code">BN43 6RE</div>\
33            <div class="country">France</div>\
34            <a class="website" target="_blank" href="">https://blablabla.com</a>\
35            <a class="phone" href="">1273446900</a>\
36            <a class="phone phone2" href="">1273446900</a>\
37            <div class="distance" title="'+Drupal.t('Distance from you to this place.')+'">182.99 miles</div>\
38            </div>\
39          </div>\
40          <div class="more_info_wrapper">\
41            <a class="more_info" href="">'+Drupal.t('See more information about this site.')+'</a>\
42          </div>\
43          <div class="direction_wrapper google">\
44            <a class="direction_info google" target="_blank" href="">'+Drupal.t('Get direction to this place.')+'</a>\
45          </div>\
46          <div class="direction_wrapper waze">\
47            <a class="direction_info waze" target="_blank" href="">'+Drupal.t('Get direction to this place.')+'</a>\
48          </div>\
49          </div>\
50        </div>';else html='\
51        <div class="marker_wrapper" data-id="'+store_id+'">\
52        <div class="columns_wrapper">\
53          <div class="first_col">\
54          <div class="icon">\
55            <img class="normal" src="/themes/custom/corporate/components/geomap/images/default_icon.svg"/>\
56              <img class="hover" src="/themes/custom/corporate/components/geomap/images/default_icon_white.svg"/>\
57          </div>\
58          </div>\
59          <div class="second_col">\
60          <div class="location_name">Concrete (large load)</div>\
61          <div class="activity">activity</div>\
62          <div class="info_wrapper">\
63            <div class="address_wrapper">\
64            <div class="copy_paste"></div>\
65            <div class="addr1">New Whaf</div>\
66            <div class="addr2">Brighton Road</div>\
67            <div class="addr3">Brighton Road</div>\
68            <div class="sublocality"></div>\
69            <div class="administrative_area"></div>\
70            <div class="zipaddress">\
71              <span class="postal_code">BN43 6RE</span>\
72              <span class="locality">Shoreham-By-Sea</span>\
73            </div>\
74            <div class="country">France</div>\
75            <a class="website" target="_blank" href="">https://blablabla.com</a>\
76            <a class="phone" href="">1273446900</a>\
77            <a class="phone phone2" href="">1273446900</a>\
78            <div class="distance" title="'+Drupal.t('Distance from you to this place.')+'">182.99 miles</div>\
79            </div>\
80          </div>\
81          <div class="more_info_wrapper">\
82            <a class="more_info" href="">'+Drupal.t('See more information about this site.')+'</a>\
83          </div>\
84          <div class="direction_wrapper google">\
85            <a class="direction_info google" target="_blank" href="">'+Drupal.t('Get direction to this place.')+'</a>\
86          </div>\
87          <div class="direction_wrapper waze">\
88            <a class="direction_info waze" target="_blank" href="">'+Drupal.t('Get direction to this place.')+'</a>\
89          </div>\
90          </div>\
91        </div>';var $marker=jQuery(html);jQuery('.icon > .normal',$marker).attr('src',feature.properties.icon);jQuery('.icon > .hover',$marker).attr('src',feature.properties.icon_hover);jQuery('.location_name',$marker).html(feature.properties.location_name);jQuery('.activity',$marker).html(feature.properties.activity);jQuery('.addr1',$marker).html(feature.properties.addr1);jQuery('.addr2',$marker).html(feature.properties.addr2);jQuery('.addr3',$marker).html(feature.properties.addr3);if(feature.properties.sublocality)jQuery('.locality',$marker).html(feature.properties.sublocality+', '+feature.properties.locality);else jQuery('.locality',$marker).html(feature.properties.locality);jQuery('.administrative_area',$marker).html(feature.properties.administrative_area);jQuery('.country',$marker).html(feature.properties.country);if(feature.properties.geographical_area)jQuery('.postal_code',$marker).html(feature.properties.geographical_area+' '+feature.properties.postal_code);else jQuery('.postal_code',$marker).html(feature.properties.postal_code);jQuery('.website',$marker).html(feature.properties.website);jQuery('.website',$marker).attr('href',feature.properties.website);jQuery('.phone',$marker).html(feature.properties.phone);jQuery('.phone',$marker).attr('href','tel:'+feature.properties.phone);jQuery('.phone2',$marker).html(feature.properties.additional_phone);jQuery('.phone2',$marker).attr('href','tel:'+feature.properties.additional);if(!jQuery('.administrative_area',$marker).html().trim())jQuery('.administrative_area',$marker).css('display','none');if(!jQuery('.country',$marker).html().trim())jQuery('.country',$marker).css('display','none');if(!jQuery('.website',$marker).html().trim())jQuery('.website',$marker).css('display','none');if(!jQuery('.phone',$marker).html().trim())jQuery('.phone',$marker).css('display','none');if(!jQuery('.phone2',$marker).html().trim())jQuery('.phone2',$marker).css('display','none');if(feature.properties.alias)jQuery('.more_info',$marker).attr('href',this.path_prefix+''+feature.properties.alias);else jQuery('.more_info',$marker).attr('href',this.path_prefix+'/'+jQuery(this.wrapperTarget).data('mapid')+'/'+feature.properties.store_code);if(this.detail!='')jQuery('.more_info_wrapper',$marker).remove();var distance=this.calculateDistance(feature.geometry.coordinates[1],feature.geometry.coordinates[0]);jQuery('.distance',$marker).html(distance);var urlDirectionGoogle=this.getDirectionGoogle(feature.geometry.coordinates[1],feature.geometry.coordinates[0]);var urlDirectionWaze=this.getDirectionWaze(feature.geometry.coordinates[1],feature.geometry.coordinates[0]);if(urlDirectionGoogle!=''&&urlDirectionWaze!=''&&this.directionLink=='use_google_map_and_waze'){jQuery('.direction_info.google',$marker).attr('href',urlDirectionGoogle);jQuery('.direction_info.waze',$marker).attr('href',urlDirectionWaze);}else if(urlDirectionGoogle!=''&&this.directionLink=='use_google_map'){jQuery('.direction_info.google',$marker).attr('href',urlDirectionGoogle);jQuery('.direction_wrapper.waze',$marker).remove();}else if(urlDirectionWaze!=''&&this.directionLink=='use_waze'){jQuery('.direction_wrapper.google',$marker).remove();jQuery('.direction_info.waze',$marker).attr('href',urlDirectionWaze);}else{jQuery('.direction_wrapper.google',$marker).remove();jQuery('.direction_wrapper.waze',$marker).remove();}$marker.data('store_code',feature.properties.store_code);$marker.data('lat',feature.geometry.coordinates[1]);$marker.data('lon',feature.geometry.coordinates[0]);jQuery(this.markersTarget).append($marker);}this.sortMarkers(this.markersTarget);jQuery(this.markersTarget).find('.marker_wrapper').off('click').on('click',this.markerClicked.bind(this));jQuery(this.markersTarget).find('.copy_paste').off('click').on('click',this.copyAddress.bind(this));}async copyAddress(e){e.stopPropagation();const wrapper=e.currentTarget.closest('.address_wrapper');const address=[wrapper.querySelector('.addr1')?.textContent.trim(),wrapper.querySelector('.addr2')?.textContent.trim(),wrapper.querySelector('.addr3')?.textContent.trim(),wrapper.querySelector('.locality')?.textContent.trim(),wrapper.querySelector('.administrative_area')?.textContent.trim(),wrapper.querySelector('.postal_code')?.textContent.trim(),wrapper.querySelector('.country')?.textContent.trim()].filter(
91Boolean).join(', ');try{await navigator.clipboard.writeText(address);e.currentTarget.classList.add('copied');setTimeout(()=>{e.currentTarget.classList.remove('copied');},5000);}catch(err){console.error('Erreur copie',err);}}parseDistance(text){return parseFloat(text.replace(/[^\d.]/g,''));}sortMarkers(markersTarget){var markers=Array.from(markersTarget.querySelectorAll('.marker_wrapper'));var self=this;markers.sort(function(a,b){var distanceA=self.parseDistance(a.querySelector('.distance').textContent);var distanceB=self.parseDistance(b.querySelector('.distance').textContent);return distanceA-distanceB;});var container=markersTarget;container.innerHTML='';markers.forEach(function(marker){container.appendChild(marker);});}markerClicked(e){if(jQuery(e.target).hasClass('more_info'))return true;var $marker=jQuery(e.currentTarget);var store_code=$marker.data('store_code');var latlng=L.latLng($marker.data('lat'),$marker.data('lon'));this.map.flyTo(latlng,this.disableClusteringAtZoom,{animate:false});var that=this;setTimeout(()=>{that.mapMarkers[store_code].openPopup();},500);}calculateDistance(lat,lon){if(lat&&lon&&this.currentLocation){var lat2=this.currentLocation.coords.latitude;var lon2=this.currentLocation.coords.longitude;const R=6371e3;const φ1=lat*Math.PI/180;const φ2=lat2*Math.PI/180;const Δφ=(lat2-lat)*Math.PI/180;const Δλ=(lon2-lon)*Math.PI/180;const a=Math.sin(Δφ/2)*Math.sin(Δφ/2)+Math.cos(φ1)*Math.cos(φ2)*Math.sin(Δλ/2)*Math.sin(Δλ/2);const c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));const d=R*c;const km=(d/1000).toFixed(1);const toMiles=0.6214;const miles=(km*toMiles).toFixed(1);if(this.distanceValue=='km')return km+' km';else return miles+' miles';}return '';}getDirectionGoogle(lat,lon){if(lat&&lon)return `https://www.google.com/maps/dir/?api=1&destination=${lat},${lon}`;return '';}getDirectionWaze(lat,lon){if(lat&&lon)return `https://waze.com/ul?ll=${lat},${lon}&navigate=yes`;return '';}getCurrentLocation(){const locationOptions={maximumAge:10000,timeout:5000,enableHighAccuracy:true};if("geolocation" in navigator)navigator.geolocation.getCurrentPosition(this.handleLocation.bind(this,false),this.handleLocationError.bind(this,false),locationOptions);else alert("Géolocalisation indisponible");}handleLocation(initial,position,zoom=16){if(initial){this.currentLocation=position;return;}var latlng=new L.LatLng(position.coords.latitude,position.coords.longitude);this.map.flyTo(latlng,zoom,{animate:false});var that=this;jQuery.get('https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat='+position.coords.latitude+'&lon='+position.coords.longitude,function(data){var street=data.address.road+', '+data.address.postcode+', '+data.address.city+', '+data.address.country;console.log(street);jQuery(that.inputTarget).val(street);});this.currentLocation=position;}handleLocationError(initial,msg){if(initial)console.log('Error lors de la géolocalisation initial : '+msg);else alert("Erreur lors de la géolocalisation : "+msg);}handleFetchMarkers(){let urlParams=new URLSearchParams(window.location.search);let activity=urlParams.get('activity');let country=urlParams.get('country');let geographical_area=urlParams.get('geographical_area');return axios.post('/api/geomap/get_markers',{blockid:jQuery(this.wrapperTarget).data('blockid'),activity,country,geographical_area});}filterMarkers(feature){if(!feature.geometry.coordinates[0]||!feature.geometry.coordinates[1])return false;if(this.activities&&this.activities.length){var activity=feature.properties.activity;var check=this.activities.filter(function(item){return item==activity;});if(check.length)return true;else return false;}else if(this.locationFinderActivityQuery!=undefined){var activity=feature.properties.activity;var activities=activity.split(',');var check=activities.some((act)=>act.trim()===this.locationFinderActivityQuery);if(check)return true;else return false;}else return true;}addDataToMap(data,map){if(this.geoJSONLayer)this.geoJSONLayer.remove();if(this.clusterGroup)this.clusterGroup.remove();this.mapMarkers={};var that=this;this.geoJSONLayer=L.geoJson(data,{filter:this.filterMarkers.bind(this),pointToLayer:function(feature,latlng){let myIcon=L.icon({iconUrl:feature.properties.icon_circled,iconSize:[30,30],iconAnchor:[15,0],popupAnchor:[0,0]});return L.marker(latlng,{icon:myIcon});}
91,onEachFeature:function(feature,marker){var locationText='<div class="locationText">'+feature.properties.location_name+'</div>';if(feature.properties.website&&feature.properties.website!=null)locationText='<div class="locationText"><a class="website" target="_blank" href="'+feature.properties.website+'">'+feature.properties.location_name+'</a></div>';marker.bindPopup(locationText,{minWidth:200});marker.on('click',function(){var offset=100;var xy=that.map.project(this.getLatLng(),that.map.getZoom());xy['y']=xy['y']-offset;var latlng=that.map.unproject(xy);that.map.panTo(latlng,{animate:true,duration:2});const highlightedElements=document.querySelectorAll('.highlight');highlightedElements.forEach((element)=>{element.classList.remove('highlight');});var id=feature.properties.store_code;const element=document.querySelector('.marker_wrapper[data-id="'+id+'"]');if(element)element.classList.add('highlight');});that.mapMarkers[feature.properties.store_code]=marker;}});this.clusterGroup=L.markerClusterGroup({spiderfyOnMaxZoom:true,showCoverageOnHover:false,zoomToBoundsOnClick:true,disableClusteringAtZoom:this.disableClusteringAtZoom});this.clusterGroup.addLayer(this.geoJSONLayer);this.clusterGroup.addTo(this.map);}getFilterValue(name){const url=window.location.href;name=name.replace(/[\[\]]/g,'\\$&');const regex=new RegExp('[?&]'+name+'(=([^&#]*)|&|#|$)');const results=regex.exec(url);if(!results)return null;if(!results[2])return '';return decodeURIComponent(results[2].replace(/\+/g,' '));}clearQueryParams(){const url=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:url},'',url);}});;
92StimulusApp.register('geomap_edifixio_detailed',class extends Stimulus.Controller{static get targets(){return ["wrapper","map"];}connect(){console.log('geomap edifixio detailed connected');var page_title=jQuery(this.wrapperTarget).data('page_title');if(page_title)jQuery('h1.page-title').html(page_title);this.maxZoom=16;this.minZoom=3;this.zoomInit=3.16;this.Initleaflet();this.map.on('zoomend',this.zoomEvent.bind(this));this.clickOnMarker();}clickOnMarker(){var store_code=jQuery(this.wrapperTarget).data('store_code');var marker=this.mapMarkers[store_code];this.map.flyTo(marker.getLatLng(),14,{animate:false});setTimeout(()=>{marker.openPopup();},500);}Initleaflet(){this.markers=jQuery(this.wrapperTarget).data('markers');const baseLayerAttribution='Imagery © <a href="https://www.mapbox.com/">Mapbox</a>';this.baseLayer=L.tileLayer(jQuery(this.wrapperTarget).data('map'),{});const osmLayerAttribution='© OpenStreetMap';this.osm=L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png',{maxZoom:19});const mapboxAttribution='Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>';const mapboxUrl='https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw';this.streets=L.tileLayer(mapboxUrl,{id:'mapbox/streets-v11',tileSize:512,zoomOffset:-1});this.satellite=L.tileLayer(mapboxUrl,{id:'mapbox/satellite-v9',tileSize:512,zoomOffset:-1});this.map=L.map(this.mapTarget,{scrollWheelZoom:true,center:[36.572,11.442],zoom:this.zoomInit,maxZoom:this.maxZoom,minZoom:this.minZoom,zoomControl:false});this.map.attributionControl.setPrefix(false);var baseMaps={"Continents":this.baseLayer,"OpenStreetMap":this.osm,"Mapbox Streets":this.streets,"Satellite":this.satellite};L.easyButton('fa-crosshairs',(function(btn,map){this.clickOnMarker();}).bind(this),'Reset').addTo(this.map);L.control.zoom({position:'topleft'}).addTo(this.map);this.map.addLayer(this.baseLayer);this.addDataToMap(this.markers,this.map);}addDataToMap(data,map){if(this.geoJSONLayer)this.geoJSONLayer.remove();this.mapMarkers={};var that=this;this.geoJSONLayer=L.geoJson(data,{pointToLayer:function(feature,latlng){let myIcon=L.icon({iconUrl:feature.properties.icon_circled,iconSize:[30,30],iconAnchor:[15,0],popupAnchor:[0,0]});return L.marker(latlng,{icon:myIcon});}
92,onEachFeature:function(feature,marker){var locationText='<div class="locationText">'+feature.properties.location_name+'</div>';marker.bindPopup(locationText,{maxWidth:200,minWidth:200});marker.on('click',function(){var offset=100;var xy=that.map.project(this.getLatLng(),that.map.getZoom());xy['y']=xy['y']-offset;var latlng=that.map.unproject(xy);that.map.panTo(latlng,{animate:true,duration:2});});that.mapMarkers[feature.properties.store_code]=marker;}});this.geoJSONLayer.addTo(this.map);}zoomEvent(){if(this.map.getZoom()>=8){this.map.removeLayer(this.baseLayer);this.map.addLayer(this.osm);}else{this.map.removeLayer(this.osm);this.map.addLayer(this.baseLayer);}}});;
93StimulusApp.register('variables',class extends Stimulus.Controller{static get targets(){return ["body"];}connect(){console.log('variables connected');this.setVariables();jQuery(window).on('resize',this.setVariables.bind(this));}setVariables(){var page_width=jQuery('body').width();document.documentElement.style.setProperty('--js-page-width',page_width+'px');var viewport_height=window.innerHeight*0.01;document.documentElement.style.setProperty('--js-viewport-height',viewport_height+'px');jQuery('html').css('scroll-padding-top',jQuery('header').height()+40+'px');}});;
94StimulusApp.register('header',class extends Stimulus.Controller{static get targets(){return ["wrapper","level1"];}initialize(){console.log('header connected ');this.closeTimeout=1000;if(this.hasLevel1Target&&this.hasWrapperTarget){jQuery(this.level1Target).find('> li a').on('click',this.clickLevel1.bind(this));if(jQuery(this.wrapperTarget).hasClass('open_menu_on_hover')){this.tobeClosed=false;jQuery(this.level1Target).find('> li').on('mouseenter',this.hoverLevel1.bind(this));jQuery(this.level1Target).find('> li').on('mouseleave',this.closeLevel1.bind(this));jQuery(this.wrapperTarget).on('cancel-close-event',this.cancelCloseEvent.bind(this));jQuery(this.wrapperTarget).on('force-close-event',this.forceCloseEvent.bind(this));}}}clickLevel1(event){jQuery(event.currentTarget).addClass('opened');}hoverLevel1(event){this.tobeClosed=false;var $anchor=jQuery(event.currentTarget).find('a');var href=$anchor.attr('href');if(href[0]=='#'){var id=href.substr(1);if(!jQuery('nav#'+id+'.mm-menu_opened').length)$anchor.get(0).click();}else{this.tobeClosed=true;this.sendCloseEvent();}}closeLevel1(event){this.tobeClosed=true;setTimeout(this.sendCloseEvent.bind(this),this.closeTimeout);}cancelCloseEvent(event){this.tobeClosed=false;}forceCloseEvent(event){this.closeLevel1();}sendCloseEvent(){if(!this.tobeClosed)return;const event=new CustomEvent('force-mmenu-close',{bubbles:true,cancelable:true,detail:null});jQuery('nav.mm-menu').each(function(i,element){element.dispatchEvent(event);});this.tobeClosed=false;}});;
95StimulusApp.register('header-search',class extends Stimulus.Controller{static get targets(){return ["wrapper"];}connect(){console.log('header search connected');}onClick(){jQuery('body').toggleClass('show-search');return false;}});;
96StimulusApp.register('language-switcher',class extends Stimulus.Controller{static get targets(){return ["button","list"];}connect(){console.log('language switcher connected');jQuery(this.buttonTarget).on('click',this.toggle.bind(this));document.addEventListener('click',(event)=>{const clickedElement=document.querySelector('.holcim_language_switcher_wrapper .clicked');if(clickedElement&&!clickedElement.contains(event.target))jQuery(clickedElement).toggleClass('clicked');});document.addEventListener('keydown',(event)=>{if(event.key==='Escape'){const clickedElement=document.querySelector('.holcim_language_switcher_wrapper .clicked');if(clickedElement)jQuery(clickedElement).toggleClass('clicked');}});}toggle(event){event.stopPropagation();jQuery(this.listTarget).toggleClass('clicked');}});;
97/* @license MIT https://mmenujs.com/ */
98!function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
98),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var i={hooks:{},extensions:[],wrappers:[],navbar:{add:!0,sticky:!0,title:"Menu",titleLink:"parent"},onClick:{close:null,preventDefault:null,setSelected:!0},slidingSubmenus:!0},s={classNames:{inset:"Inset",nolistview:"NoListview",nopanel:"NoPanel",panel:"Panel",selected:"Selected",vertical:"Vertical"},language:null,openingInterval:25,panelNodetype:["ul","ol","div"],transitionDuration:400};function a(e,t){for(var n in"object"!=o(e)&&(e={}),"object"!=o(t)&&(t={}),t)t.hasOwnProperty(n)&&(void 0===e[n]?e[n]=t[n]:"object"==o(e[n])&&a(e[n],t[n]));return e}function o(e){return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function r(e,t,n){if("function"==typeof t){var i=t.call(e);if(void 0!==i)return i}return null!==t&&"function"!=typeof t&&void 0!==t||void 0===n?t:n}function c(e,t,n){var i=!1,s=function(n){void 0!==n&&n.target!==e||(i||(e.removeEventListener("transitionend",s),e.removeEventListener("webkitTransitionEnd",s),t.call(e)),i=!0)};e.addEventListener("transitionend",s),e.addEventListener("webkitTransitionEnd",s),setTimeout(s,1.1*n)}function m(){return"mm-"+l++}var l=0;function d(e){return"mm-"==e.slice(0,3)?e.slice(3):e}var p={};function u(e,t){void 0===p[t]&&(p[t]={}),a(p[t],e)}var f={Menu:"منو"},h={Menu:"Menü"},v={Menu:"Меню"},b={Menu:"Menu"};function g(e){var t=e.split("."),n=document.createElement(t.shift());return t.forEach((function(e){n.classList.add(e)})),n}function _(e,t){return Array.prototype.slice.call(e.querySelectorAll(t))}function y(e,t){var n=Array.prototype.slice.call(e.children);return t?n.filter((function(e){return e.matches(t)})):n}function L(e,t){for(var n=[],i=e.parentElement;i;)n.push(i),i=i.parentElement;return t?n.filter((function(e){return e.matches(t)})):n}function w(e){return e.filter((function(e){return!e.matches(".mm-hidden")}))}function E(e){var t=[];return w(e).forEach((function(e){t.push.apply(t,y(e,"a.mm-listitem__text"))})),t.filter((function(e){return!e.matches(".mm-btn_next")}))}function x(e,t,n){e.matches("."+t)&&(e.classList.remove(t),e.classList.add(n))}var P={};function k(e,t,n){"number"==typeof e&&(e="(min-width: "+e+"px)"),P[e]=P[e]||[],P[e].push({yes:t,no:n})}function S(e,t){for(var n=t.matches?"yes":"no",i=0;i<P[e].length;i++)P[e][i][n]()}u({Menu:"Menu"},"nl"),u(f,"fa"),u(h,"de"),u(v,"ru"),u(b,"pt_br");var M=function(){function e(t,n,i){return this.opts=a(n,e.options),this.conf=a(i,e.configs),this._api=["bind","initPanel","initListview","openPanel","closePanel","closeAllPanels","setSelected"],this.node={},this.vars={},this.hook={},this.clck=[],this.node.menu="string"==typeof t?document.querySelector(t):t,"function"==typeof this._deprecatedWarnings&&this._deprecatedWarnings(),this._initWrappers(),this._initAddons(),this._initExtensions(),this._initHooks(),this._initAPI(),this._initMenu(),this._initPanels(),this._initOpened(),this._initAnchors(),function(){var e=function(e){var t=window.matchMedia(e);S(e,t),t.onchange=function(n){S(e,t)}};for(var t in P)e(t)}(),this}return e.prototype.openPanel=function(e,t){var n=this;if(this.trigger("openPanel:before",[e]),e&&(e.matches(".mm-panel")||(e=e.closest(".mm-panel")),e)){if("boolean"!=typeof t&&(t=!0),e.parentElement.matches(".mm-listitem_vertical")){L(e,".mm-listitem_vertical").forEach((function(e){e.classList.add("mm-listitem_opened"),y(e,".mm-panel").forEach((function(e){e.classList.remove("mm-hidden")}))}));var i=L(e,".mm-panel").filter((function(e){return!e.parentElement.matches(".mm-listitem_vertical")}));
98this.trigger("openPanel:start",[e]),i.length&&this.openPanel(i[0]),this.trigger("openPanel:finish",[e])}else{if(e.matches(".mm-panel_opened"))return;var s=y(this.node.pnls,".mm-panel"),a=y(this.node.pnls,".mm-panel_opened")[0];s.filter((function(t){return t!==e})).forEach((function(e){e.classList.remove("mm-panel_opened-parent")}));for(var o=e.mmParent;o;)(o=o.closest(".mm-panel"))&&(o.parentElement.matches(".mm-listitem_vertical")||o.classList.add("mm-panel_opened-parent"),o=o.mmParent);s.forEach((function(e){e.classList.remove("mm-panel_highest")})),s.filter((function(e){return e!==a})).filter((function(t){return t!==e})).forEach((function(e){e.classList.add("mm-hidden")})),e.classList.remove("mm-hidden");var r=function(){a&&a.classList.remove("mm-panel_opened"),e.classList.add("mm-panel_opened"),e.matches(".mm-panel_opened-parent")?(a&&a.classList.add("mm-panel_highest"),e.classList.remove("mm-panel_opened-parent")):(a&&a.classList.add("mm-panel_opened-parent"),e.classList.add("mm-panel_highest")),n.trigger("openPanel:start",[e])},m=function(){a&&(a.classList.remove("mm-panel_highest"),a.classList.add("mm-hidden")),e.classList.remove("mm-panel_highest"),n.trigger("openPanel:finish",[e])};t&&!e.matches(".mm-panel_noanimation")?setTimeout((function(){c(e,(function(){m()}),n.conf.transitionDuration),r()}),this.conf.openingInterval):(r(),m())}this.trigger("openPanel:after",[e])}},e.prototype.closePanel=function(e){this.trigger("closePanel:before",[e]);var t=e.parentElement;t.matches(".mm-listitem_vertical")&&(t.classList.remove("mm-listitem_opened"),e.classList.add("mm-hidden"),this.trigger("closePanel",[e])),this.trigger("closePanel:after",[e])},e.prototype.closeAllPanels=function(e){this.trigger("closeAllPanels:before"),this.node.pnls.querySelectorAll(".mm-listitem").forEach((function(e){e.classList.remove("mm-listitem_selected"),e.classList.remove("mm-listitem_opened")}));var t=y(this.node.pnls,".mm-panel"),n=e||t[0];y(this.node.pnls,".mm-panel").forEach((function(e){e!==n&&(e.classList.remove("mm-panel_opened"),e.classList.remove("mm-panel_opened-parent"),e.classList.remove("mm-panel_highest"),e.classList.add("mm-hidden"))})),this.openPanel(n,!1),this.trigger("closeAllPanels:after")},e.prototype.togglePanel=function(e){var t=e.parentElement;t.matches(".mm-listitem_vertical")&&this[t.matches(".mm-listitem_opened")?"closePanel":"openPanel"](e)},e.prototype.setSelected=function(e){this.trigger("setSelected:before",[e]),_(this.node.menu,".mm-listitem_selected").forEach((function(e){e.classList.remove("mm-listitem_selected")})),e.classList.add("mm-listitem_selected"),this.trigger("setSelected:after",[e])},e.prototype.bind=function(e,t){this.hook[e]=this.hook[e]||[],this.hook[e].push(t)},e.prototype.trigger=function(e,t){if(this.hook[e])for(var n=0,i=this.hook[e].length;n<i;n++)this.hook[e][n].apply(this,t)},e.prototype._initAPI=function(){var e=this,t=this;this.API={},this._api.forEach((function(n){e.API[n]=function(){var e=t[n].apply(t,arguments);return void 0===e?t.API:e}})),this.node.menu.mmApi=this.API},e.prototype._initHooks=function(){for(var e in this.opts.hooks)this.bind(e,this.opts.hooks[e])},e.prototype._initWrappers=function(){this.trigger("initWrappers:before");for(var t=0;t<this.opts.wrappers.length;t++){var n=e.wrappers[this.opts.wrappers[t]];"function"==typeof n&&n.call(this)}this.trigger("initWrappers:after")},e.prototype._initAddons=function(){for(var t in this.trigger("initAddons:before"),e.addons)e.addons[t].call(this);this.trigger("initAddons:after")},e.prototype._initExtensions=function(){var e=this;this.trigger("initExtensions:before"),"array"==o(this.opts.extensions)&&(this.opts.extensions={all:this.opts.extensions}
98),Object.keys(this.opts.extensions).forEach((function(t){var n=e.opts.extensions[t].map((function(e){return"mm-menu_"+e}));n.length&&k(t,(function(){n.forEach((function(t){e.node.menu.classList.add(t)}))}),(function(){n.forEach((function(t){e.node.menu.classList.remove(t)}))}))})),this.trigger("initExtensions:after")},e.prototype._initMenu=function(){var e=this;this.trigger("initMenu:before"),this.node.wrpr=this.node.wrpr||this.node.menu.parentElement,this.node.wrpr.classList.add("mm-wrapper"),this.node.menu.id=this.node.menu.id||m();var t=g("div.mm-panels");y(this.node.menu).forEach((function(n){e.conf.panelNodetype.indexOf(n.nodeName.toLowerCase())>-1&&t.append(n)})),this.node.menu.append(t),this.node.pnls=t,this.node.menu.classList.add("mm-menu"),this.trigger("initMenu:after")},e.prototype._initPanels=function(){var e=this;this.trigger("initPanels:before"),this.clck.push((function(t,n){if(n.inMenu){var i=t.getAttribute("href");if(i&&i.length>1&&"#"==i.slice(0,1))try{var s=_(e.node.menu,i)[0];if(s&&s.matches(".mm-panel"))return t.parentElement.matches(".mm-listitem_vertical")?e.togglePanel(s):e.openPanel
98(s),!0}catch(e){}}})),y(this.node.pnls).forEach((function(t){e.initPanel(t)})),this.trigger("initPanels:after")},e.prototype.initPanel=function(e){var t=this,n=this.conf.panelNodetype.join(", ");if(e.matches(n)&&(e.matches(".mm-panel")||(e=this._initPanel(e)),e)){var i=[];i.push.apply(i,y(e,"."+this.conf.classNames.panel)),y(e,".mm-listview").forEach((function(e){y(e,".mm-listitem").forEach((function(e){i.push.apply(i,y(e,n))}))})),i.forEach((function(e){t.initPanel(e)}))}},e.prototype._initPanel=function(e){var t=this;if(this.trigger("initPanel:before",[e]),x(e,this.conf.classNames.panel,"mm-panel"),x(e,this.conf.classNames.nopanel,"mm-nopanel"),x(e,this.conf.classNames.inset,"mm-listview_inset"),e.matches(".mm-listview_inset")&&e.classList.add("mm-nopanel"),e.matches(".mm-nopanel"))return null;var n=e.id||m(),i=e.matches("."+this.conf.classNames.vertical)||!this.opts.slidingSubmenus;if(e.classList.remove(this.conf.classNames.vertical),e.matches("ul, ol")){e.removeAttribute("id");var s=g("div");e.before(s),s.append(e),e=s}e.id=n,e.classList.add("mm-panel"),e.classList.add("mm-hidden");var a=[e.parentElement].filter((function(e){return e.matches("li")}
98))[0];if(i?a&&a.classList.add("mm-listitem_vertical"):this.node.pnls.append(e),a&&(a.mmChild=e,e.mmParent=a,a&&a.matches(".mm-listitem")&&!y(a,".mm-btn").length)){var o=y(a,".mm-listitem__text")[0];if(o){var r=g("a.mm-btn.mm-btn_next.mm-listitem__btn");r.setAttribute("href","#"+e.id),o.matches("span")?(r.classList.add("mm-listitem__text"),r.innerHTML=o.innerHTML,a.insertBefore(r,o.nextElementSibling),o.remove()):a.insertBefore(r,y(a,".mm-panel")[0])}}return this._initNavbar(e),y(e,"ul, ol").forEach((function(e){t.initListview(e)})),this.trigger("initPanel:after",[e]),e},e.prototype._initNavbar=function(e){if(this.trigger("initNavbar:before",[e]),!y(e,".mm-navbar").length){var t=null,n=null;if(e.getAttribute("data-mm-parent")?n=_(this.node.pnls,e.getAttribute("data-mm-parent"))[0]:(t=e.mmParent)&&(n=t.closest(".mm-panel")),!t||!t.matches(".mm-listitem_vertical")){var i=g("div.mm-navbar");if(this.opts.navbar.add?this.opts.navbar.sticky&&i.classList.add("mm-navbar_sticky"):i.classList.add("mm-hidden"),n){var s=g("a.mm-btn.mm-btn_prev.mm-navbar__btn");s.setAttribute("href","#"+n.id),i.append(s)}var a=null;t?a=y(t,".mm-listitem__text")[0]:n&&(a=_(n,'a[href="#'+e.id+'"]')[0]);var o=g("a.mm-navbar__title"),r=g("span");switch(o.append(r),r.innerHTML=e.getAttribute("data-mm-title")||(a?a.textContent:"")||this.i18n(this.opts.navbar.title)||this.i18n("Menu"),this.opts.navbar.titleLink){case"anchor":a&&o.setAttribute("href",a.getAttribute("href"));break;case"parent":n&&o.setAttribute("href","#"+n.id)}i.append(o),e.prepend(i),this.trigger("initNavbar:after",[e])}}},e.prototype.initListview=function(e){var t=this;this.trigger("initListview:before",[e]),x(e,this.conf.classNames.nolistview,"mm-nolistview"),e.matches(".mm-nolistview")||(e.classList.add("mm-listview"),y(e).forEach((function(e){e.classList.add("mm-listitem"),x(e,t.conf.classNames.selected,"mm-listitem_selected"),y(e,"a, span").forEach((function(e){e.matches(".mm-btn")||e.classList.add("mm-listitem__text")}))}))),this.trigger("initListview:after",[e])},e.prototype._initOpened=function(){this.trigger("initOpened:before");var e=this.node.pnls.querySelectorAll(".mm-listitem_selected"),t=null;e.forEach((function(e){t=e,e.classList.remove("mm-listitem_selected")})),t&&t.classList.add("mm-listitem_selected");var n=t?t.closest(".mm-panel"):y(this.node.pnls,".mm-panel")[0];this.openPanel(n,!1),this.trigger("initOpened:after")},e.prototype._initAnchors=function(){var e=this;this.trigger("initAnchors:before"),document.addEventListener("click",(function(t){var n=t.target.closest("a[href]");if(n){for(var i={inMenu:n.closest(".mm-menu")===e.node.menu,inListview:n.matches(".mm-listitem > a"),toExternal:n.matches('[rel="external"]')||n.matches('[target="_blank"]')},s={close:null,setSelected:null,preventDefault:"#"==n.getAttribute("href").slice(0,1)},c=0;c<e.clck.length;c++){var m=e.clck[c].call(e,n,i);if(m){if("boolean"==typeof m)return void t.preventDefault();"object"==o(m)&&(s=a(m,s))}}i.inMenu&&i.inListview&&!i.toExternal&&(r(n,e.opts.onClick.setSelected,s.setSelected)&&e.setSelected(n.parentElement),r(n,e.opts.onClick.preventDefault,s.preventDefault)&&t.preventDefault(),r(n,e.opts.onClick.close,s.close)&&e.opts.offCanvas&&"function"==typeof e.close&&e.close())}}),!0),this.trigger("initAnchors:after")},e.prototype.i18n=function(e){return function(e,t){return"string"==typeof t&&void 0!==p[t]&&p[t][e]||e}(e,this.conf.language)},e.options=i,e.configs=s,e.addons={},e.wrappers={},e.node={},e.vars={},e}(),A={blockUI:!0,moveBackground:!0};var T={clone:!1,menu:{insertMethod:"prepend",insertSelector:"body"},page:{nodetype:"div",selector:null,noSelector:[]}};function C(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function N(e,t,n){var i=t.split(".");e[t="mmEvent"+C(i[0])+C(i[1])]=e[t]||[],e[t].push(n),e.addEventListener(i[0],n)}function H(e,t){var n=t.split(".");t="mmEvent"+C(n[0])+C(n[1]),(e[t]||[]).forEach((function(t){e.removeEventListener(n[0],t)}))}M.options.offCanvas=A,M.configs.offCanvas=T;M.prototype.open=function(){var e=this;this.trigger("open:before"),this.vars.opened||(this._openSetup(),setTimeout((function(){e._openStart()}),this.conf.openingInterval),this.trigger("open:after"))},M.prototype._openSetup=function(){var e=this,t=this.opts.offCanvas;this.closeAllOthers(),function(e,t,n){var i=t.split(".");
98(e[t="mmEvent"+C(i[0])+C(i[1])]||[]).forEach((function(e){e(n||{})}))}(window,"resize.page",{force:!0});var n=["mm-wrapper_opened"];t.blockUI&&n.push("mm-wrapper_blocking"),"modal"==t.blockUI&&n.push("mm-wrapper_modal"),t.moveBackground&&n.push("mm-wrapper_background"),n.forEach((function(t){e.node.wrpr.classList.add(t)})),setTimeout((function(){e.vars.opened=!0}),this.conf.openingInterval),this.node.menu.classList.add("mm-menu_opened")},M.prototype._openStart=function(){var e=this;c(M.node.page,(function(){e.trigger("open:finish")}),this.conf.transitionDuration),this.trigger("open:start"),this.node.wrpr.classList.add("mm-wrapper_opening")},M.prototype.close=function(){var e=this;this.trigger("close:before"),this.vars.opened&&(c(M.node.page,(function(){e.node.menu.classList.remove("mm-menu_opened");["mm-wrapper_opened","mm-wrapper_blocking","mm-wrapper_modal","mm-wrapper_background"].forEach((function(t){e.node.wrpr.classList.remove(t)})),e.vars.opened=!1,e.trigger("close:finish")}),this.conf.transitionDuration),this.trigger("close:start"),this.node.wrpr.classList.remove("mm-wrapper_opening"),this.trigger("close:after"))},M.prototype.closeAllOthers=function(){var e=this;_(document.body,".mm-menu_offcanvas").forEach((function(t){if(t!==e.node.menu){var n=t.mmApi;n&&n.close&&n.close()}}))},M.prototype.setPage=function(e){this.trigger("setPage:before",[e]);var t=this.conf.offCanvas;if(!e){var n="string"==typeof t.page.selector?_(document.body,t.page.selector):y(document.body,t.page.nodetype);if(n=n.filter((function(e){return!e.matches(".mm-menu, .mm-wrapper__blocker")})),t.page.noSelector.length&&(n=n.filter((function(e){return!e.matches(t.page.noSelector.join(", "))}))),n.length>1){var i=g("div");n[0].before(i),n.forEach((function(e){i.append(e)})),n=[i]}e=n[0]}e.classList.add("mm-page"),e.classList.add("mm-slideout"),e.id=e.id||m(),M.node.page=e,this.trigger("setPage:after",[e])};var j=function(){var e=this;H(document.body,"keydown.tabguard"),N(document.body,"keydown.tabguard",(function(t){9==t.keyCode&&e.node.wrpr.matches(".mm-wrapper_opened")&&t.preventDefault()}))},D=function(){var e=this;this.trigger("initBlocker:before");var t=this.opts.offCanvas,n=this.conf.offCanvas;if(t.blockUI){if(!M.node.blck){var i=g("div.mm-wrapper__blocker.mm-slideout");i.innerHTML="<a></a>",document.querySelector(n.menu.insertSelector).append(i),M.node.blck=i}var s=function(t){t.preventDefault(),t.stopPropagation(),e.node.wrpr.matches(".mm-wrapper_modal")||e.close()};M.node.blck.addEventListener("mousedown",s),M.node.blck.addEventListener("touchstart",s),M.node.blck.addEventListener("touchmove",s),this.trigger("initBlocker:after")}},O={aria:!0,text:!0};var I={text:{closeMenu:"Close menu",closeSubmenu:"Close submenu",openSubmenu:"Open submenu",toggleSubmenu:"Toggle submenu"}},q={"Close menu":"بستن منو","Close submenu":"بستن زیرمنو","Open submenu":"بازکردن زیرمنو","Toggle submenu":"سوییچ زیرمنو"},B={"Close menu":"Menü schließen","Close submenu":"Untermenü schließen","Open submenu":"Untermenü öffnen","Toggle submenu":"Untermenü wechseln"},z={"Close menu":"Закрыть меню","Close submenu":"Закрыть подменю","Open submenu":"Открыть подменю","Toggle submenu":"Переключить подменю"},R={"Close menu":"Fechar menu","Close submenu":"Fechar submenu","Open submenu":"Abrir submenu","Toggle submenu":"Alternar submenu"};u({"Close menu":"Menu sluiten","Close submenu":"Submenu sluiten","Open submenu":"Submenu openen","Toggle submenu":"Submenu wisselen"},"nl"),u(q,"fa"),u(B,"de"),u(z,"ru"),u(R,"pt_br"),M.options.screenReader=O,M.configs.screenReader=I;var U;U=function(e,t,n){e[t]=n,n?e.setAttribute(t,n.toString()):e.removeAttribute(t)},M.sr_aria=function(e,t,n){U(e,"aria-"+t,n)},M.sr_role=function(e,t){U(e,"role",t)},M.sr_text=function(e){return'<span class="mm-sronly">'+e+"</span>"};var W={fix:!0};var F="ontouchstart"in window||!!navigator.msMaxTouchPoints||!1;M.options.scrollBugFix=W;var Y={height:"default"};M.options.autoHeight=Y;var X={close:!1,open:!1};M.options.backButton=X;var V={add:!1,visible:{min:1,max:3}};M.options.columns=V;var Z={add:!1,addTo:"panels",count:!1};
98M.options.counters=Z,M.configs.classNames.counters={counter:"Counter"};var G={add:!1,addTo:"panels"};M.options.dividers=G,M.configs.classNames.divider="Divider";var K={open:!1,node:null};var Q="ontouchstart"in window||!!navigator.msMaxTouchPoints||!1,J={top:0,right:0,bottom:0,left:0},$={start:15,swipe:15},ee={x:["Right","Left"],y:["Down","Up"]},te=0,ne=1,ie=2,se=function(e,t){return"string"==typeof e&&"%"==e.slice(-1)&&(e=t*((e=parseInt(e.slice(0,-1),10))/100)),e},ae=function(){function e(e,t,n){this.surface=e,this.area=a(t,J),this.treshold=a(n,$),this.surface.mmHasDragEvents||(this.surface.addEventListener(Q?"touchstart":"mousedown",this.start.bind(this)),this.surface.addEventListener(Q?"touchend":"mouseup",this.stop.bind(this)),this.surface.addEventListener(Q?"touchleave":"mouseleave",this.stop.bind(this)),this.surface.addEventListener(Q?"touchmove":"mousemove",this.move.bind(this))),this.surface.mmHasDragEvents=!0}return e.prototype.start=function(e){this.currentPosition={x:e.touches?e.touches[0].pageX:e.pageX||0,y:e.touches?e.touches[0].pageY:e.pageY||0};var t=this.surface.clientWidth,n=this.surface.clientHeight,i=se(this.area.top,n);if(!("number"==typeof i&&this.currentPosition.y<i)){var s=se(this.area.right,t);if(!("number"==typeof s&&(s=t-s,this.currentPosition.x>s))){var a=se(this.area.bottom,n);if(!("number"==typeof a&&(a=n-a,this.currentPosition.y>a))){var o=se(this.area.left,t);"number"==typeof o&&this.currentPosition.x<o||(this.startPosition={x:this.currentPosition.x,y:this.currentPosition.y},this.state=ne)}}}},e.prototype.stop=function(e){if(this.state==ie){var t=this._dragDirection(),n=this._eventDetail(t);if(this._dispatchEvents("drag*End",n),Math.abs(this.movement[this.axis])>this.treshold.swipe){var i=this._swipeDirection();n.direction=i,this._dispatchEvents("swipe*",n)}}this.state=te},e.prototype.move=function(e){switch(this.state){case ne:case ie:var t={x:e.changedTouches?e.touches[0].pageX:e.pageX||0,y:e.changedTouches?e.touches[0].pageY:e.pageY||0};this.movement={x:t.x-this.currentPosition.x,y:t.y-this.currentPosition.y},this.distance={x:t.x-this.startPosition.x,y:t.y-this.startPosition.y},this.currentPosition={x:t.x,y:t.y},this.axis=Math.abs(this.distance.x)>Math.abs(this.distance.y)?"x":"y";var n=this._dragDirection(),i=this._eventDetail(n);this.state==ne&&Math.abs(this.distance[this.axis])>this.treshold.start&&(this._dispatchEvents("drag*Start",i),this.state=ie),this.state==ie&&this._dispatchEvents("drag*Move",i)}},e.prototype._eventDetail=function(e){var t=this.distance.x,n=this.distance.y;return"x"==this.axis&&(t-=t>0?this.treshold.start:0-this.treshold.start),"y"==this.axis&&(n-=n>0?this.treshold.start:0-this.treshold.start),{axis:this.axis,direction:e,movementX:this.movement.x,movementY:this.movement.y,distanceX:t,distanceY:n}},e.prototype._dispatchEvents=function(e,t){var n=new CustomEvent(e.replace("*",""),{detail:t});this.surface.dispatchEvent(n);var i=new CustomEvent(e.replace("*",this.axis.toUpperCase()),{detail:t});this.surface.dispatchEvent(i);var s=new CustomEvent(e.replace("*",t.direction),{detail:t});this.surface.dispatchEvent(s)},e.prototype._dragDirection=function(){return ee[this.axis][this.distance[this.axis]>0?0:1]},e.prototype._swipeDirection=function(){return ee[this.axis][this.movement[this.axis]>0?0:1]},e}(),oe=null,re=null,ce=0,me=function(e){var t=this,n={},i=!1,s=function(){var e=Object.keys(t.opts.extensions);e.length?(k(e.join(", "),(function(){}),(function(){n=le(n,[],t.node.menu)})),e.forEach((function(e){k(e,(function(){n=le(n,t.opts.extensions[e],t.node.menu)}),(function(){}))}))):n=le(n,[],t.node.menu)};re&&(H(re,"dragStart"),H(re,"dragMove"),H(re,"dragEnd")),oe=new ae(re=e),s(),s=function(){},re&&(N(re,"dragStart",(function(e){e.detail.direction==n.direction&&(i=!0,t.node.wrpr.classList.add("mm-wrapper_dragging"),t._openSetup(),t.trigger("open:start"),ce=t.node.menu["x"==n.axis?"clientWidth":"clientHeight"])})),N(re,"dragMove",(function(e){if(e.detail.axis==n.axis&&i){var t=e.detail["distance"+n.axis.toUpperCase()];switch(n.position){case"right":case"bottom":t=Math.min(Math.max(t,-ce),0);break;default:t=Math.max(Math.min(t,ce),0)}if("front"==n.zposition)switch(n.position){case"right":case"bottom":t+=ce;break;default:t-=ce}
98n.slideOutNodes.forEach((function(e){e.style.transform="translate"+n.axis.toUpperCase()+"("+t+"px)"}))}})),N(re,"dragEnd",(function(e){if(e.detail.axis==n.axis&&i){i=!1,t.node.wrpr.classList.remove("mm-wrapper_dragging"),n.slideOutNodes.forEach((function(e){e.style.transform=""}));var s=Math.abs(e.detail["distance"+n.axis.toUpperCase()])>=.75*ce;if(!s){var a=e.detail["movement"+n.axis.toUpperCase()];switch(n.position){case"right":case"bottom":s=a<=0;break;default:s=a>=0}}s?t._openStart():t.close()}})))},le=function(e,t,n){switch(e.position="left",e.zposition="back",["right","top","bottom"].forEach((function(n){t.indexOf("position-"+n)>-1&&(e.position=n)})),["front","top","bottom"].forEach((function(n){t.indexOf("position-"+n)>-1&&(e.zposition="front")})),oe.area={top:"bottom"==e.position?"75%":0,right:"left"==e.position?"75%":0,bottom:"top"==e.position?"75%":0,left:"right"==e.position?"75%":0},e.position){case"top":case"bottom":e.axis="y";break;default:e.axis="x"}switch(e.position){case"top":e.direction="Down";break;case"right":e.direction="Left";break;case"bottom":e.direction="Up";break;default:e.direction="Right"}switch(e.zposition){case"front":e.slideOutNodes=[n];break;default:e.slideOutNodes=_(document.body,".mm-slideout")}return e};M.options.drag=K;var de={drop:!1,fitViewport:!0,event:"click",position:{},tip:!0};var pe={offset:{button:{x:-5,y:5},viewport:{x:20,y:20}},height:{max:880},width:{max:440}};M.options.dropdown=de,M.configs.dropdown=pe;
98var ue={insertMethod:"append",insertSelector:"body"};M.configs.fixedElements=ue,M.configs.classNames.fixedElements={fixed:"Fixed"};var fe={use:!1,top:[],bottom:[],position:"left",type:"default"};M.options.iconbar=fe;var he={add:!1,blockPanel:!0,hideDivider:!1,hideNavbar:!0,visible:3};M.options.iconPanels=he;var ve={enable:!1,enhance:!1};M.options.keyboardNavigation=ve;var be=function(e){var t=this;H(document.body,"keydown.tabguard"),H(document.body,"focusin.tabguard"),N(document.body,"focusin.tabguard",(function(e){if(t.node.wrpr.matches(".mm-wrapper_opened")){var n=e.target;if(n.matches(".mm-tabend")){var i=void 0;n.parentElement.matches(".mm-menu")&&M.node.blck&&(i=M.node.blck),n.parentElement.matches(".mm-wrapper__blocker")&&(i=_(document.body,".mm-menu_offcanvas.mm-menu_opened")[0]),i||(i=n.parentElement),i&&y(i,".mm-tabstart")[0].focus()}}})),H(document.body,"keydown.navigate"),N(document.body,"keydown.navigate",(function(t){var n=t.target,i=n.closest(".mm-menu");if(i){i.mmApi;if(!n.matches("input, textarea"))switch(t.keyCode){case 13:(n.matches(".mm-toggle")||n.matches(".mm-check"))&&n.dispatchEvent(new Event("click"));break;case 32:case 37:case 38:case 39:case 40:t.preventDefault()}if(e)if(n.matches("input"))switch(t.keyCode){case 27:n.value=""}else{var s=i.mmApi;switch(t.keyCode){case 8:var a=_(i,".mm-panel_opened")[0].mmParent;a&&s.openPanel(a.closest(".mm-panel"));break;case 27:i.matches(".mm-menu_offcanvas")&&s.close()}}}}))},ge={load:!1};M.options.lazySubmenus=ge;var _e=[];var ye={breadcrumbs:{separator:"/",removeFirst:!1}};function Le(){var e=this,t=this.opts.navbars;if(void 0!==t){t instanceof Array||(t=[t]);var n={};t.length&&(t.forEach((function(t){if(!(t=function(e){return"boolean"==typeof e&&e&&(e={}),"object"!=typeof e&&(e={}),void 0===e.content&&(e.content=["prev","title"]),e.content instanceof Array||(e.content=[e.content]),void 0===e.use&&(e.use=!0),"boolean"==typeof e.use&&e.use&&(e.use=!0),e}(t)).use)return!1;var i=g("div.mm-navbar"),s=t.position;"bottom"!==s&&(s="top"),n[s]||(n[s]=g("div.mm-navbars_"+s)),n[s].append(i);for(var a=0,o=t.content.length;a<o;a++){var r,c=t.content[a];if("string"==typeof c)if("function"==typeof(r=Le.navbarContents[c]))r.call(e,i);else{var m=g("span");m.innerHTML=c;var l=y(m);1==l.length&&(m=l[0]),i.append(m)}else i.append(c)}"string"==typeof t.type&&("function"==typeof(r=Le.navbarTypes[t.type])&&r.call(e,i));"boolean"!=typeof t.use&&k(t.use,(function(){i.classList.remove("mm-hidden"),M.sr_aria(i,"hidden",!1)}),(function(){i.classList.add("mm-hidden"),M.sr_aria(i,"hidden",!0)}))})),this.bind("initMenu:after",(function(){for(var t in n)e.node.menu["bottom"==t?"append":"prepend"](n[t])})))}}M.options.navbars=_e,M.configs.navbars=ye,M.configs.classNames.navbars={panelPrev:"Prev",panelTitle:"Title"},Le.navbarContents={breadcrumbs:function(e){var t=this,n=g("div.mm-navbar__breadcrumbs");e.append(n),this.bind("initNavbar:after",(function(e){if(!e.querySelector(".mm-navbar__breadcrumbs")){y(e,".mm-navbar")[0].classList.add("mm-hidden");for(var n=[],i=g("span.mm-navbar__breadcrumbs"),s=e,a=!0;s;){if(!(s=s.closest(".mm-panel")).parentElement.matches(".mm-listitem_vertical")){var o=_(s,".mm-navbar__title span")[0];if(o){var r=o.textContent;r.length&&n.unshift(a?"<span>"+r+"</span>":'<a href="#'+s.id+'">'+r+"</a>")}a=!1}s=s.mmParent}t.conf.navbars.breadcrumbs.removeFirst&&n.shift(),i.innerHTML=n.join('<span class="mm-separator">'+t.conf.navbars.breadcrumbs.separator+"</span>"),y(e,".mm-navbar")[0].append(i)}})),this.bind("openPanel:start",(function(e){var t=e.querySelector(".mm-navbar__breadcrumbs");n.innerHTML=t?t.innerHTML:""})),this.bind("initNavbar:after:sr-aria",(function(e){_(e,".mm-breadcrumbs a").forEach((function(e){M.sr_aria(e,"owns",e.getAttribute("href").slice(1))}))}))},close:function(e){var t=this,n=g("a.mm-btn.mm-btn_close.mm-navbar__btn");e.append(n),this.bind("setPage:after",(function(e){n.setAttribute("href","#"+e.id)})),this.bind("setPage:after:sr-text",(function(){n.innerHTML=M.sr_text(t.i18n(t.conf.screenReader.text.closeMenu))}))},prev:function(e){var t,n,i,s=this,a=g("a.mm-btn.mm-btn_prev.mm-navbar__btn");e.append(a),this.bind("initNavbar:after",(function(e){y(e,".mm-navbar")[0].classList.add("mm-hidden")})),this.bind("openPanel:start",(function(e){e.parentElement.matches(".mm-listitem_vertical")||((t=e.querySelector("."+s.conf.classNames.navbars.panelPrev))||(t=e.querySelector(".mm-navbar__btn.mm-btn_prev")),n=t?t.getAttribute("href"):"",i=t?t.innerHTML:"",n?a.setAttribute("href",n):a.removeAttribute("href"),a.classList[n||i?"remove":"add"]("mm-hidden"),a.innerHTML=i)})),this.bind("initNavbar:after:sr-aria",(function(e){M.sr_aria(e.querySelector(".mm-navbar"),"hidden",!0)})),this.bind("openPanel:start:sr-aria",(function(e){M.sr_aria(a,"hidden",a.matches(".mm-hidden")),M.sr_aria(a,"owns",(a.getAttribute("href")||"").slice(1))}))},searchfield:function(e){"object"!=o(this.opts.searchfield)&&(this.opts.searchfield={});var t=g("div.mm-navbar__searchfield");e.append(t),this.opts.searchfield.add=!0,this.opts.searchfield.addTo=[t]},title:function(e){var t,n,i,s,a=this,o=g("a.mm-navbar__title"),r=g("span");o.append(r),e.append(o),this.bind("openPanel:start",(function(e){e.parentElement.matches(".mm-listitem_vertical")||((i=e.querySelector("."+a.conf.classNames.navbars.panelTitle))||(i=e.querySelector(".mm-navbar__title span")),(t=i&&i.closest("a")?i.closest("a").getAttribute("href"):"")?o.setAttribute("href",t):o.removeAttribute("href"),n=i?i.innerHTML:"",r.innerHTML=n)})),this.bind("openPanel:start:sr-aria",(function(e){if(a.opts.screenReader.text){if(!s)y(a.node.menu,".mm-navbars_top, .mm-navbars_bottom").forEach((function(e){var t=e.querySelector(".mm-btn_prev");t&&(s=t)}));if(s){var t=!0;"parent"==a.opts.navbar.titleLink&&(t=!s.matches(".mm-hidden")),M.sr_aria(o,"hidden",t)}}}))}},Le.navbarTypes={tabs:function(e){var t=this;e.classList.add("mm-navbar_tabs"),e.parentElement.classList.add("mm-navbars_has-tabs");var n=y(e,"a");e.addEventListener("click",(function(e){var n=e.target;if(n.matches("a"))if(n.matches(".mm-navbar__tab_selected"))e.stopImmediatePropagation();
98else try{t.openPanel(t.node.menu.querySelector(n.getAttribute("href")),!1),e.stopImmediatePropagation()}catch(e){}})),this.bind("openPanel:start",(function e(t){n.forEach((function(e){e.classList.remove("mm-navbar__tab_selected")}));var i=n.filter((function(e){return e.matches('[href="#'+t.id+'"]')}))[0];if(i)i.classList.add("mm-navbar__tab_selected");else{var s=t.mmParent;s&&e.call(this,s.closest(".mm-panel"))}}))}};var we={scroll:!1,update:!1};var Ee={scrollOffset:0,updateOffset:50};M.options.pageScroll=we,M.configs.pageScroll=Ee;var xe={add:!1,addTo:"panels",cancel:!1,noResults:"No results found.",placeholder:"Search",panel:{add:!1,dividers:!0,fx:"none",id:null,splash:null,title:"Search"},search:!0,showTextItems:!1,showSubPanels:!0};var Pe={clear:!1,form:!1,input:!1,submit:!1},ke={Search:"جستجو","No results found.":"نتیجه‌ای یافت نشد.",cancel:"انصراف"},Se={Search:"Suche","No results found.":"Keine Ergebnisse gefunden.",cancel:"beenden"},Me={Search:"Найти","No results found.":"Ничего не найдено.",cancel:"отменить"},Ae={Search:"Buscar","No results found.":"Nenhum resultado encontrado.",cancel:"cancelar"},Te=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),s=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,r=a.length;o<r;o++,s++)i[s]=a[o];return i};u({Search:"Zoeken","No results found.":"Geen resultaten gevonden.",cancel:"annuleren"},"nl"),u(ke,"fa"),u(Se,"de"),u(Me,"ru"),u(Ae,"pt_br"),M.options.searchfield=xe,M.configs.searchfield=Pe;var Ce=function(){var e=this.opts.searchfield,t=(this.conf.searchfield,y(this.node.pnls,".mm-panel_search")[0]);if(t)return t;t=g("div.mm-panel.mm-panel_search.mm-hidden"),e.panel.id&&(t.id=e.panel.id),e.panel.title&&t.setAttribute("data-mm-title",e.panel.title);var n=g("ul");switch(t.append(n),this.node.pnls.append(t),this.initListview(n),this._initNavbar(t),e.panel.fx){case!1:break;case"none":t.classList.add("mm-panel_noanimation");break;default:t.classList.add("mm-panel_fx-"+e.panel.fx)}if(e.panel.splash){var i=g("div.mm-panel__content");i.innerHTML=e.panel.splash,t.append(i)}return t.classList.add("mm-panel"),t.classList.add("mm-hidden"),this.node.pnls.append(t),t},Ne=function(e){var t=this.opts.searchfield,n=this.conf.searchfield;if(e.parentElement.matches(".mm-listitem_vertical"))return null;if(a=_(e,".mm-searchfield")[0])return a;function i(e,t){if(t)for(var n in t)e.setAttribute(n,t[n])}var s,a=g((n.form?"form":"div")+".mm-searchfield"),o=g("div.mm-searchfield__input"),r=g("input");(r.type="text",r.autocomplete="off",r.placeholder=this.i18n(t.placeholder),o.append(r),a.append(o),e.prepend(a),i(r,n.input),n.clear)&&((s=g("a.mm-btn.mm-btn_close.mm-searchfield__btn")).setAttribute("href","#"),o.append(s));(i(a,n.form),n.form&&n.submit&&!n.clear)&&((s=g("a.mm-btn.mm-btn_next.mm-searchfield__btn")).setAttribute("href","#"),o.append(s));t.cancel&&((s=g("a.mm-searchfield__cancel")).setAttribute("href","#"),s.textContent=this.i18n("cancel"),a.append(s));return a},He=function(e){var t=this,n=this.opts.searchfield,i=(this.conf.searchfield,{});e.closest(".mm-panel_search")?(i.panels=_(this.node.pnls,".mm-panel"),i.noresults=[e.closest(".mm-panel")]):e.closest(".mm-panel")?(i.panels=[e.closest(".mm-panel")],i.noresults=i.panels):(i.panels=_(this.node.pnls,".mm-panel"),i.noresults=[this.node.menu]),i.panels=i.panels.filter((function(e){return!e.matches(".mm-panel_search")})),i.panels=i.panels.filter((function(e){return!e.parentElement.matches(".mm-listitem_vertical")})),i.listitems=[],i.dividers=[],i.panels.forEach((function(e){var t,n;(t=i.listitems).push.apply(t,_(e,".mm-listitem")),(n=i.dividers).push.apply(n,_(e,".mm-divider"))}));var s=y(this.node.pnls,".mm-panel_search")[0],a=_(e,"input")[0],o=_(e,".mm-searchfield__cancel")[0];a.mmSearchfield=i,n.panel.add&&n.panel.splash&&(H(a,"focus.splash"),N(a,"focus.splash",(function(e){t.openPanel
98(s)}))),n.cancel&&(H(a,"focus.cancel"),N(a,"focus.cancel",(function(e){o.classList.add("mm-searchfield__cancel-active")})),H(o,"click.splash"),N(o,"click.splash",(function(e){if(e.preventDefault(),o.classList.remove("mm-searchfield__cancel-active"),s.matches(".mm-panel_opened")){var n=y(t.node.pnls,".mm-panel_opened-parent");n.length&&t.openPanel(n[n.length-1])}}))),n.panel.add&&"panel"==n.addTo&&this.bind("openPanel:finish",(function(e){e===s&&a.focus()})),H(a,"input.search"),N(a,"input.search",(function(e){switch(e.keyCode){case 9:case 16:case 17:case 18:case 37:case 38:case 39:case 40:break;default:t.search(a)}})),this.search(a)},je=function(e){if(e){var t=this.opts.searchfield;this.conf.searchfield;if(e.closest(".mm-panel")||(e=y(this.node.pnls,".mm-panel")[0]),!y(e,".mm-panel__noresultsmsg").length){var n=g("div.mm-panel__noresultsmsg.mm-hidden");n.innerHTML=this.i18n(t.noResults),e.append(n)}}};M.prototype.search=function(e,t){var n,i=this,s=this.opts.searchfield;this.conf.searchfield;t=(t=t||""+e.value).toLowerCase().trim();var a=e.mmSearchfield,o=_(e.closest(".mm-searchfield"),".mm-btn"),r=y(this.node.pnls,".mm-panel_search")[0],c=a.panels,m=a.noresults,l=a.listitems,d=a.dividers;if(l.forEach((function(e){e.classList.remove("mm-listitem_nosubitems"),e.classList.remove("mm-listitem_onlysubitems"),e.classList.remove("mm-hidden")})),r&&(y(r,".mm-listview")[0].innerHTML=""),c.forEach((function(e){e.scrollTop=0})),t.length){d.forEach((function(e){e.classList.add("mm-hidden")})),l.forEach((function(e){var n,i=y(e,".mm-listitem__text")[0],a=!1;i&&(n=i,Array.prototype.slice.call(n.childNodes).filter((function(e){return 3==e.nodeType})).map((function(e){return e.textContent})).join(" ")).toLowerCase().indexOf(t)>-1&&(i.matches(".mm-listitem__btn")?s.showSubPanels&&(a=!0):(i.matches("a")||s.showTextItems)&&(a=!0)),a||e.classList.add("mm-hidden")}));var p=l.filter((function(e){return!e.matches(".mm-hidden")})).length;if(s.panel.add){var u=[];c.forEach((function(e){var t=w(_(e,".mm-listitem"));if((t=t.filter((function(e){return!e.matches(".mm-hidden")}))).length){if(s.panel.dividers){var n=g("li.mm-divider"),i=_(e,".mm-navbar__title")[0];i&&(n.innerHTML=i.innerHTML,u.push(n))}t.forEach((function(e){u.push(e.cloneNode(!0))}))}})),u.forEach((function(e){e.querySelectorAll(".mm-toggle, .mm-check").forEach((function(e){e.remove()}))})),(n=y(r,".mm-listview")[0]).append.apply(n,u),this.openPanel(r)}else s.showSubPanels&&c.forEach((function(e){w(_(e,".mm-listitem")).forEach((function(e){var t=e.mmChild;t&&_(t,".mm-listitem").forEach((function(e){e.classList.remove("mm-hidden")}))}))})),Te(c).reverse().forEach((function(t,n){var s=t.mmParent;s&&(w(_(t,".mm-listitem")).length?(s.matches(".mm-hidden")&&s.classList.remove("mm-hidden"),s.classList.add("mm-listitem_onlysubitems")):e.closest(".mm-panel")||((t.matches(".mm-panel_opened")||t.matches(".mm-panel_opened-parent"))&&setTimeout((function(){i.openPanel(s.closest(".mm-panel"))}),(n+1)*(1.5*i.conf.openingInterval)),s.classList.add("mm-listitem_nosubitems")))})),c.forEach((function(e){w(_(e,".mm-listitem")).forEach((function(e){L(e,".mm-listitem_vertical").forEach((function(e){e.matches(".mm-hidden")&&(e.classList.remove("mm-hidden"),e.classList.add("mm-listitem_onlysubitems"))}))}))})),c.forEach((function(e){w(_(e,".mm-listitem")).forEach((function(e){var t=function(e,t){for(var n=[],i=e.previousElementSibling;i;)t&&!i.matches(t)||n.push(i),i=i.previousElementSibling;return n}(e,".mm-divider")[0];t&&t.classList.remove("mm-hidden")}))}));o.forEach((function(e){return e.classList.remove("mm-hidden")})),m.forEach((function(e){_(e,".mm-panel__noresultsmsg").forEach((function(e){return e.classList[p?"add":"remove"]("mm-hidden")}))})),s.panel.add&&(s.panel.splash&&_(r,".mm-panel__content").forEach((function(e){return e.classList.add("mm-hidden")})),l.forEach((function(e){return e.classList.remove("mm-hidden")})),d.forEach((function(e){return e.classList.remove("mm-hidden")})))}else if(l.forEach((function(e){return e.classList.remove("mm-hidden")})),d.forEach((function(e){return e.classList.remove("mm-hidden")})),o.forEach((function(e){return e.classList.add("mm-hidden")})),m.forEach((function(e){_(e,".mm-panel__noresultsmsg").forEach((function(e){return e.classList.add("mm-hidden")}))}
98)),s.panel.add)if(s.panel.splash)_(r,".mm-panel__content").forEach((function(e){return e.classList.remove("mm-hidden")}));else if(!e.closest(".mm-panel_search")){var f=y(this.node.pnls,".mm-panel_opened-parent");this.openPanel(f.slice(-1)[0])}this.trigger("updateListview")};var De={add:!1,addTo:"panels"};M.options.sectionIndexer=De;var Oe={current:!0,hover:!1,parent:!1};M.options.setSelected=Oe;var Ie={collapsed:{use:!1,blockMenu:!0,hideDivider:!1,hideNavbar:!0},expanded:{use:!1,initial:"open"}};M.options.sidebar=Ie;M.configs.classNames.toggles={toggle:"Toggle",check:"Check"};
99M.addons={offcanvas:function(){var e=this;if(this.opts.offCanvas){var t=function(e){return"object"!=typeof e&&(e={}),e}(this.opts.offCanvas);this.opts.offCanvas=a(t,M.options.offCanvas);var n=this.conf.offCanvas;this._api.push("open","close","setPage"),this.vars.opened=!1,this.bind("initMenu:before",(function(){n.clone&&(e.node.menu=e.node.menu.cloneNode(!0),e.node.menu.id&&(e.node.menu.id="mm-"+e.node.menu.id),_(e.node.menu,"[id]").forEach((function(e){e.id="mm-"+e.id}))),e.node.wrpr=document.body,document.querySelector(n.menu.insertSelector)[n.menu.insertMethod](e.node.menu)})),this.bind("initMenu:after",(function(){D.call(e),e.setPage(M.node.page),j.call(e),e.node.menu.classList.add("mm-menu_offcanvas");var t=window.location.hash;if(t){var n=d(e.node.menu.id);n&&n==t.slice(1)&&setTimeout((function(){e.open()}),1e3)}})),this.bind("setPage:after",(function(e){M.node.blck&&y(M.node.blck,"a").forEach((function(t){t.setAttribute("href","#"+e.id)}))})),this.bind("open:start:sr-aria",(function(){M.sr_aria(e.node.menu,"hidden",!1)})),this.bind("close:finish:sr-aria",(function(){M.sr_aria(e.node.menu,"hidden",!0)})),this.bind("initMenu:after:sr-aria",(function(){M.sr_aria(e.node.menu,"hidden",!0)})),this.bind("initBlocker:after:sr-text",(function(){y(M.node.blck,"a").forEach((function(t){t.innerHTML=M.sr_text(e.i18n(e.conf.screenReader.text.closeMenu))}))})),this.clck.push((function(t,n){var i=d(e.node.menu.id);if(i&&t.matches('[href="#'+i+'"]')){if(n.inMenu)return e.open(),!0;var s=t.closest(".mm-menu");if(s){var a=s.mmApi;if(a&&a.close)return a.close(),c(s,(function(){e.open()}),e.conf.transitionDuration),!0}return e.open(),!0}if((i=M.node.page.id)&&t.matches('[href="#'+i+'"]'))return e.close(),!0}))}},screenReader:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={aria:e,text:e}),"object"!=typeof e&&(e={}),e}(this.opts.screenReader);this.opts.screenReader=a(t,M.options.screenReader);var n=this.conf.screenReader;t.aria&&(this.bind("initAddons:after",(function(){e.bind("initMenu:after",(function(){this.trigger("initMenu:after:sr-aria",[].slice.call(arguments))})),e.bind("initNavbar:after",(function(){this.trigger("initNavbar:after:sr-aria",[].slice.call(arguments))})),e.bind("openPanel:start",(function(){this.trigger("openPanel:start:sr-aria",[].slice.call(arguments))})),e.bind("close:start",(function(){this.trigger("close:start:sr-aria",[].slice.call(arguments))})),e.bind("close:finish",(function(){this.trigger("close:finish:sr-aria",[].slice.call(arguments))})),e.bind("open:start",(function(){this.trigger("open:start:sr-aria",[].slice.call(arguments))})),e.bind("initOpened:after",(function(){this.trigger("initOpened:after:sr-aria",[].slice.call(arguments))}))})),this.bind("updateListview",(function(){e.node.pnls.querySelectorAll(".mm-listitem").forEach((function(e){M.sr_aria(e,"hidden",e.matches(".mm-hidden"))}))})),this.bind("openPanel:start",(function(t){var n=_(e.node.pnls,".mm-panel").filter((function(e){return e!==t})).filter((function(e){return!e.parentElement.matches(".mm-panel")})),i=[t];_(t,".mm-listitem_vertical .mm-listitem_opened").forEach((function(e){i.push.apply(i,y(e,".mm-panel"))})),n.forEach((function(e){M.sr_aria(e,"hidden",!0)})),i.forEach((function(e){M.sr_aria(e,"hidden",!1)}))})),this.bind("closePanel",(function(e){M.sr_aria(e,"hidden",!0)})),this.bind("initNavbar:after",(function(e){var t=y(e,".mm-navbar")[0],n=t.matches(".mm-hidden");M.sr_aria(t,"hidden",n)})),t.text&&"parent"==this.opts.navbar.titleLink&&this.bind("initNavbar:after",(function(e){var t=y(e,".mm-navbar")[0],n=!!t.querySelector(".mm-btn_prev");M.sr_aria(_(t,".mm-navbar__title")[0],"hidden",n)}
99))),t.text&&(this.bind("initAddons:after",(function(){e.bind("setPage:after",(function(){this.trigger("setPage:after:sr-text",[].slice.call(arguments))})),e.bind("initBlocker:after",(function(){this.trigger("initBlocker:after:sr-text",[].slice.call(arguments))}))})),this.bind("initNavbar:after",(function(t){var i=y(t,".mm-navbar")[0];if(i){var s=y(i,".mm-btn_prev")[0];s&&(s.innerHTML=M.sr_text(e.i18n(n.text.closeSubmenu)))}})),this.bind("initListview:after",(function(t){var i=t.closest(".mm-panel").mmParent;if(i){var s=y(i,".mm-btn_next")[0];if(s){var a=e.i18n(n.text[s.parentElement.matches(".mm-listitem_vertical")?"toggleSubmenu":"openSubmenu"]);s.innerHTML+=M.sr_text(a)}}})))},scrollBugFix:function(){var e=this;if(F&&this.opts.offCanvas&&this.opts.offCanvas.blockUI){var t=function(e){return"boolean"==typeof e&&(e={fix:e}),"object"!=typeof e&&(e={}),e}(this.opts.scrollBugFix);if(this.opts.scrollBugFix=a(t,M.options.scrollBugFix),t.fix){var n,i,s=(n=this.node.menu,i="",n.addEventListener("touchmove",(function(e){i="",e.movementY>0?i="down":e.movementY<0&&(i="up")})),{get:function(){return i}});this.node.menu.addEventListener("scroll",o,{passive:!1}),this.node.menu.addEventListener("touchmove",(function(e){var t=e.target.closest(".mm-panel, .mm-iconbar__top, .mm-iconbar__bottom");t&&t.closest(".mm-listitem_vertical")&&(t=L(t,".mm-panel").pop()),t?(t.scrollHeight===t.offsetHeight||0==t.scrollTop&&"down"==s.get()||t.scrollHeight==t.scrollTop+t.offsetHeight&&"up"==s.get())&&o(e):o(e)}),{passive:!1}),this.bind("open:start",(function(){var t=y(e.node.pnls,".mm-panel_opened")[0];t&&(t.scrollTop=0)})),window.addEventListener("orientationchange",(function(t){var n=y(e.node.pnls,".mm-panel_opened")[0];n&&(n.scrollTop=0,n.style["-webkit-overflow-scrolling"]="auto",n.style["-webkit-overflow-scrolling"]="touch")}))}}function o(e){e.preventDefault(),e.stopPropagation()}},autoHeight:function(){var e=this,t=function(e){return"boolean"==typeof e&&e&&(e={height:"auto"}),"string"==typeof e&&(e={height:e}),"object"!=typeof e&&(e={}),e}(this.opts.autoHeight);if(this.opts.autoHeight=a(t,M.options.autoHeight),"auto"==t.height||"highest"==t.height){var n,i=(n=function(e){return e.parentElement.matches(".mm-listitem_vertical")&&(e=L(e,".mm-panel").filter((function(e){return!e.parentElement.matches(".mm-listitem_vertical")}))[0]),e},function(){if(!e.opts.offCanvas||e.vars.opened){var i,s,a=0,o=e.node.menu.offsetHeight-e.node.pnls.offsetHeight;e.node.menu.classList.add("mm-menu_autoheight-measuring"),"auto"==t.height?((s=y(e.node.pnls,".mm-panel_opened")[0])&&(s=n(s)),s||(s=y(e.node.pnls,".mm-panel")[0]),a=s.scrollHeight):"highest"==t.height&&(i=0,y(e.node.pnls,".mm-panel").forEach((function(e){e=n(e),i=Math.max(i,e.scrollHeight)})),a=i),e.node.menu.style.height=a+o+"px",e.node.menu.classList.remove("mm-menu_autoheight-measuring")}});this.bind("initMenu:after",(function(){e.node.menu.classList.add("mm-menu_autoheight")})),this.opts.offCanvas&&this.bind("open:start",i),"highest"==t.height&&this.bind("initPanels:after",i),"auto"==t.height&&(this.bind("updateListview",i),this.bind("openPanel:start",i))}},backButton:function(){var e=this;if(this.opts.offCanvas){var t=function(e){return"boolean"==typeof e&&(e={close:e}),"object"!=typeof e&&(e={}),e}(this.opts.backButton);this.opts.backButton=a(t,M.options.backButton);var n="#"+this.node.menu.id;if(t.close){var i=[],s=function(){i=[n],y(e.node.pnls,".mm-panel_opened, .mm-panel_opened-parent").forEach((function(e){i.push("#"+e.id)}))};this.bind("open:finish",(function(){history.pushState(null,document.title,n)})),this.bind("open:finish",s),this.bind("openPanel:finish",s),this.bind("close:finish",(function(){i=[],history.back(),history.pushState(null,document.title,location.pathname+location.search)})),window.addEventListener("popstate",(function(t){if(e.vars.opened&&i.length){var s=(i=i.slice(0,-1))[i.length-1];
99s==n?e.close():(e.openPanel(e.node.menu.querySelector(s)),history.pushState(null,document.title,n))}}))}t.open&&window.addEventListener("popstate",(function(t){e.vars.opened||location.hash!=n||e.open()}))}},columns:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={add:e}),"number"==typeof e&&(e={add:!0,visible:e}),"object"!=typeof e&&(e={}),"number"==typeof e.visible&&(e.visible={min:e.visible,max:e.visible}),e}(this.opts.columns);if(this.opts.columns=a(t,M.options.columns),t.add){t.visible.min=Math.max(1,Math.min(6,t.visible.min)),t.visible.max=Math.max(t.visible.min,Math.min(6,t.visible.max));for(var n=[],i=[],s=["mm-panel_opened","mm-panel_opened-parent","mm-panel_highest"],o=0;o<=t.visible.max;o++)n.push("mm-menu_columns-"+o),i.push("mm-panel_columns-"+o);s.push.apply(s,i),this.bind("openPanel:before",(function(t){var n;if(t&&(n=t.mmParent),n&&!n.classList.contains("mm-listitem_vertical")&&(n=n.closest(".mm-panel"))){var i=n.className;if(i.length&&(i=i.split("mm-panel_columns-")[1]))for(var a=parseInt(i.split(" ")[0],10)+1;a>0;){if(!(t=y(e.node.pnls,".mm-panel_columns-"+a)[0])){a=-1;break}a++,t.classList.add("mm-hidden"),s.forEach((function(e){t.classList.remove(e)}))}}})),this.bind("openPanel:start",(function(s){if(s){var a=s.mmParent;if(a&&a.classList.contains("mm-listitem_vertical"))return}var o=y(e.node.pnls,".mm-panel_opened-parent").length;s.matches(".mm-panel_opened-parent")||o++,o=Math.min(t.visible.max,Math.max(t.visible.min,o)),n.forEach((function(t){e.node.menu.classList.remove(t)})),e.node.menu.classList.add("mm-menu_columns-"+o);var r=[];y(e.node.pnls,".mm-panel").forEach((function(e){i.forEach((function(t){e.classList.remove(t)})),e.matches(".mm-panel_opened-parent")&&r.push(e)})),r.push(s),r.slice(-t.visible.max).forEach((function(e,t){e.classList.add("mm-panel_columns-"+t)}))}))}},counters:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={add:e,addTo:"panels",count:e}),"object"!=typeof e&&(e={}),"panels"==e.addTo&&(e.addTo=".mm-listview"),e}(this.opts.counters);if(this.opts.counters=a(t,M.options.counters),this.bind("initListview:after",(function(t){var n=e.conf.classNames.counters.counter;_(t,"."+n).forEach((function(e){x(e,n,"mm-counter")}))})),t.add&&this.bind("initListview:after",(function(e){if(e.matches(t.addTo)){var n=e.closest(".mm-panel").mmParent;if(n&&!_(n,".mm-counter").length){var i=y(n,".mm-btn")[0];i&&i.prepend(g("span.mm-counter"))}}})),t.count){var n=function(t){(t?[t.closest(".mm-panel")]:y(e.node.pnls,".mm-panel")).forEac
99h((function(e){var t=e.mmParent;if(t){var n=_(t,".mm-counter")[0];if(n){var i=[];y(e,".mm-listview").forEach((function(e){i.push.apply(i,y(e))})),n.innerHTML=w(i).length.toString()}}}))};this.bind("initListview:after",n),this.bind("updateListview",n)}},dividers:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={add:e}),"object"!=typeof e&&(e={}),"panels"==e.addTo&&(e.addTo=".mm-listview"),e}(this.opts.dividers);this.opts.dividers=a(t,M.options.dividers),this.bind("initListview:after",(function(t){y(t).forEach((function(t){x(t,e.conf.classNames.divider,"mm-divider"),t.matches(".mm-divider")&&t.classList.remove("mm-listitem")}))})),t.add&&this.bind("initListview:after",(function(e){if(e.matches(t.addTo)){_(e,".mm-divider").forEach((function(e){e.remove()}));var n="";w(y(e)).forEach((function(t){var i=y(t,".mm-listitem__text")[0].textContent.trim().toLowerCase()[0];if(i.length&&i!=n){n=i;var s=g("li.mm-divider");s.textContent=i,e.insertBefore(s,t)}}))}}))},drag:function(){var e=this;if(this.opts.offCanvas){var t=function(e){return"boolean"==typeof e&&(e={open:e}),"object"!=typeof e&&(e={}),e}(this.opts.drag);this.opts.drag=a(t,M.options.drag),t.open&&this.bind("setPage:after",(function(n){me.call(e,t.node||n)}))}},dropdown:function(){var e=this;if(this.opts.offCanvas){var t=function(e){return"boolean"==typeof e&&e&&(e={drop:e}),"object"!=typeof e&&(e={}),"string"==typeof e.position&&(e.position={of:e.position}),e}(this.opts.dropdown);this.opts.dropdown=a(t,M.options.dropdown);var n=this.conf.dropdown;if(t.drop){var i;this.bind("initMenu:after",(function(){e.node.menu.classList.add("mm-menu_dropdown");var n="",s=d(e.node.menu.id);s&&(n='[href="#'+s+'"]'),i=_(document.body,n)[0];var a=t.event.split(" ");1==a.length&&(a[1]=a[0]),"hover"==a[0]&&i.addEventListener("mouseenter",(function(){e.open()}),{passive:!0}),"hover"==a[1]&&e.node.menu.addEventListener("mouseleave",(function(){e.close()}),{passive:!0})})),this.bind("open:start",(function(){e.node.menu.mmStyle=e.node.menu.getAttribute("style"),e.node.wrpr.classList.add("mm-wrapper_dropdown")})),this.bind("close:finish",(function(){e.node.menu.setAttribute("style",e.node.menu.mmStyle),e.node.wrpr.classList.remove("mm-wrapper_dropdown")}));var s=function(e,s){var a,o,r,c=s[0],m=s[1],l="x"==e?"offsetWidth":"offsetHeight",d="x"==e?"left":"top",p="x"==e?"right":"bottom",u="x"==e?"width":"height",f="x"==e?"innerWidth":"innerHeight",h="x"==e?"maxWidth":"maxHeight",v=null,b=(a=d,i.getBoundingClientRect()[a]+document.body["left"===a?"scrollLeft":"scrollTop"]),g=b+i[l],_=window[f],y=n.offset.button[e]+n.offset.viewport[e];if(t.position[e])switch(t.position[e]){case"left":case"bottom":v="after";break;case"right":case"top":v="before"}return null===v&&(v=b+(g-b)/2<_/2?"after":"before"),"after"==v?(r=_-((o="x"==e?b:g)+y),c[d]=o+n.offset.button[e]+"px",c[p]="auto",t.tip&&m.push("mm-menu_tip-"+("x"==e?"left":"top"))):(r=(o="x"==e?g:b)-y,c[p]="calc( 100% - "+(o-n.offset.button[e])+"px )",c[d]="auto",t.tip&&m.push("mm-menu_tip-"+("x"==e?"right":"bottom"))),t.fitViewport&&(c[h]=Math.min(n[u].max,r)+"px"),[c,m]};this.bind("open:start",o),window.addEventListener("resize",(function(t){o.call(e)}),{passive:!0}),this.opts.offCanvas.blockUI||window.addEventListener("scroll",(function(t){o.call(e)}),{passive:!0})}}function o(){var e=this;if(this.vars.opened){this.node.menu.setAttribute("style",this.node.menu.mmStyle);var n=[{},[]];for(var i in n=s.call(this,"y",n),(n=s.call(this,"x",n))[0])this.node.menu.style[i]=n[0][i];if(t.tip){["mm-menu_tip-left","mm-menu_tip-right","mm-menu_tip-top","mm-menu_tip-bottom"].forEach((function(t){e.node.menu.classList.remove(t)})),n[1].forEach((function(t){e.node.menu.classList.add(t)}))}}}},fixedElements:function(){var e=this;if(this.opts.offCanvas){var t,n,i=this.conf.fixedElements;this.bind("setPage:after",(function(s){t=e.conf.classNames.fixedElements.fixed,n=_(document,i.insertSelector)[0],_(s,"."+t).forEach((function(e){x(e,t,"mm-slideout"),n[i.insertMethod](e)}))}))}},iconbar:function(){var e,t=this,n=function(e){return"array"==o(e)&&(e={use:!0,top:e}),"object"!=o(e)&&(e={}),void 0===e.use&&(e.use=!0),"boolean"==typeof e.use&&e.use&&(e.use=!0),e}(this.opts.iconbar);if((this.opts.iconbar=a(n,M.options.iconbar),n.use)&&(["top","bottom"].forEach((function(t,i){var s=n[t];"array"!=o(s)&&(s=[s]);for(var a=g("div.mm-iconbar__"+t),r=0,c=s.length;r<c;r++)"string"==typeof s[r]?a.innerHTML+=s[r]:a.append(s[r]);a.children.length&&(e||(e=g("div.mm-iconbar")),e.append(a))})),e)){this.bind("initMenu:after",(function(){t.node.menu.prepend(e)}));var i="mm-menu_iconbar-"+n.position,s=function(){t.node.menu.classList.add(i),M.sr_aria(e,"hidden",!1)};if("boolean"==typeof n.use?this.bind("initMenu:after",s):k(n.use,s,(function(){t.node.menu.classList.remove(i),M.sr_aria(e,"hidden",!0)})),"tabs"==n.type){e.classList.add("mm-iconbar_tabs"),e.addEventListener("click",(function(e){var n=e.target;if(n.matches("a"))if(n.matches(".mm-iconbar__tab_selected"))e.stopImmediatePropagation();else try{var i=t.node.menu.querySelector(n.getAttribute("href"))[0];i&&i.matches(".mm-panel")&&(e.preventDefault(),e.stopImmediatePropagation(),t.openPanel
99(i,!1))}catch(e){}}));var r=function(t){_(e,"a").forEach((function(e){e.classList.remove("mm-iconbar__tab_selected")}));var n=_(e,'[href="#'+t.id+'"]')[0];if(n)n.classList.add("mm-iconbar__tab_selected");else{var i=t.mmParent;i&&r(i.closest(".mm-panel"))}};this.bind("openPanel:start",r)}}},iconPanels:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={add:e}),"number"!=typeof e&&"string"!=typeof e||(e={add:!0,visible:e}),"object"!=typeof e&&(e={}),e}(this.opts.iconPanels);this.opts.iconPanels=a(t,M.options.iconPanels);var n=!1;if("first"==t.visible&&(n=!0,t.visible=1),t.visible=Math.min(3,Math.max(1,t.visible)),t.visible++,t.add){this.bind("initMenu:after",(function(){var n=["mm-menu_iconpanel"];t.hideNavbar&&n.push("mm-menu_hidenavbar"),t.hideDivider&&n.push("mm-menu_hidedivider"),n.forEach((function(t){e.node.menu.classList.add(t)}))}));var i=[];if(!n)for(var s=0;s<=t.visible;s++)i.push("mm-panel_iconpanel-"+s);this.bind("openPanel:start",(function(s){var a=y(e.node.pnls,".mm-panel");if(!(s=s||a[0]).parentElement.matches(".mm-listitem_vertical"))if(n)a.forEach((function(e,t){e.classList[0==t?"add":"remove"]("mm-panel_iconpanel-first")}));else{a.forEach((function(e){i.forEach((function(t){e.classList.remove(t)}))})),a=a.filter((function(e){return e.matches(".mm-panel_opened-parent")}));var o=!1;a.forEach((function(e){s===e&&(o=!0)})),o||a.push(s),a.forEach((function(e){e.classList.remove("mm-hidden")})),(a=a.slice(-t.visible)).forEach((function(e,t){e.classList.add("mm-panel_iconpanel-"+t)}))}})),this.bind("initPanel:after",(function(e){if(t.blockPanel&&!e.parentElement.matches(".mm-listitem_vertical")&&!y(e,".mm-panel__blocker")[0]){var n=g("a.mm-panel__blocker");n.setAttribute("href","#"+e.closest(".mm-panel").id),e.prepend(n)}}))}},keyboardNavigation:function(){var e=this;if(!F){var t=function(e){return"boolean"!=typeof e&&"string"!=typeof e||(e={enable:e}),"object"!=typeof e&&(e={}),e}(this.opts.keyboardNavigation);if(this.opts.keyboardNavigation=a(t,M.options.keyboardNavigation),t.enable){var n=g("button.mm-tabstart.mm-sronly"),i=g("button.mm-tabend.mm-sronly"),s=g("button.mm-tabend.mm-sronly");this.bind("initMenu:after",(function(){t.enhance&&e.node.menu.classList.add("mm-menu_keyboardfocus"),be.call(e,t.enhance)})),this.bind("initOpened:before",(function(){e.node.menu.prepend(n),e.node.menu.append(i),y(e.node.menu,".mm-navbars-top, .mm-navbars-bottom").forEach((function(e){e.querySelectorAll(".mm-navbar__title").forEach((function(e){e.setAttribute("tabindex","-1")}))}))})),this.bind("initBlocker:after",(function(){M.node.blck.append(s),y(M.node.blck,"a")[0].classList.add("mm-tabstart")}));var o="input, select, textarea, button, label, a[href]",r=function(n){n=n||y(e.node.pnls,".mm-panel_opened")[0];var i=null,s=document.activeElement.closest(".mm-navbar");if(!s||s.closest(".mm-menu")!=e.node.menu){if("default"==t.enable&&((i=_(n,".mm-listview a[href]:not(.mm-hidden)")[0])||(i=_(n,o+":not(.mm-hidden)")[0]),!i)){var a=[];y(e.node.menu,".mm-navbars_top, .mm-navbars_bottom").forEach((function(e){a.push.apply(a,_(e,o+":not(.mm-hidden)"))})),i=a[0]}i||(i=y(e.node.menu,".mm-tabstart")[0]),i&&i.focus()}};this.bind("open:finish",r),this.bind("openPanel:finish",r),this.bind("initOpened:after:sr-aria",(function(){[e.node.menu,M.node.blck].forEach((function(e){y(e,".mm-tabstart, .mm-tabend").forEach((function(e){M.sr_aria(e,"hidden",!0),M.sr_role(e,"presentation")}))}))}))}}},lazySubmenus:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={load:e}),"object"!=typeof e&&(e={}),e}(this.opts.lazySubmenus);this.opts.lazySubmenus=a(t,M.options.lazySubmenus),t.load&&(this.bind("initPanels:before",(function(){var t=[];_(e.node.pnls,"li").forEach((function(n){t.push.apply(t,y(n,e.conf.panelNodetype.join(", ")))})),t.filter((function(e){return!e.matches(".mm-listview_inset")})).filter((function(e){return!e.matches(".mm-nolistview")})).filter((function(e){return!e.matches(".mm-nopanel")})).forEach((function(e){["mm-panel_lazysubmenu","mm-nolistview","mm-nopanel"].forEach((function(t){e.classList.add(t)}))}))})),this.bind("initPanels:before",(function(){var t=[];
99_(e.node.pnls,"."+e.conf.classNames.selected).forEach((function(e){t.push.apply(t,L(e,".mm-panel_lazysubmenu"))})),t.length&&t.forEach((function(e){console.log(e);["mm-panel_lazysubmenu","mm-nolistview","mm-nopanel"].forEach((function(t){e.classList.remove(t)}))}))})),this.bind("openPanel:before",(function(t){var n=_(t,".mm-panel_lazysubmenu").filter((function(e){return!e.matches(".mm-panel_lazysubmenu .mm-panel_lazysubmenu")}));t.matches(".mm-panel_lazysubmenu")&&n.unshift(t),n.forEach((function(t){["mm-panel_lazysubmenu","mm-nolistview","mm-nopanel"].forEach((function(e){t.classList.remove(e)})),e.initPanel(t)}))})))},navbars:Le,pageScroll:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={scroll:e}),"object"!=typeof e&&(e={}),e}(this.opts.pageScroll);this.opts.pageScroll=a(t,M.options.pageScroll);var n,i=this.conf.pageScroll;function s(){n&&window.scrollTo({top:n.getBoundingClientRect().top+document.scrollingElement.scrollTop-i.scrollOffset,behavior:"smooth"}),n=null}function o(e){try{return"#"!=e&&"#"==e.slice(0,1)?M.node.page.querySelector(e):null}catch(e){return null}}if(t.scroll&&this.bind("close:finish",(function(){s()})),this.opts.offCanvas&&t.scroll&&this.clck.push((function(t,i){if(n=null,i.inMenu){var a=t.getAttribute("href");if(n=o(a))return e.node.menu.matches(".mm-menu_sidebar-expanded")&&e.node.wrpr.matches(".mm-wrapper_sidebar-expanded")?void s():{close:!0}}})),t.update){var r=[];this.bind("initListview:after",(function(e){E(y(e,".mm-listitem")).forEach((function(e){var t=o(e.getAttribute("href"));t&&r.unshift(t)}))}));var c=-1;window.addEventListener("scroll",(function(t){for(var n=window.scrollY,s=0;s<r.length;s++)if(r[s].offsetTop<n+i.updateOffset){if(c!==s){c=s;var a=E(_(y(e.node.pnls,".mm-panel_opened")[0],".mm-listitem"));(a=a.filter((function(e){return e.matches('[href="#'+r[s].id+'"]')}))).length&&e.setSelected(a[0].parentElement)}break}}))}},searchfield:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={add:e}),"object"!=typeof e&&(e={}),"boolean"==typeof e.panel&&(e.panel={add:e.panel}),"object"!=typeof e.panel&&(e.panel={}),"panel"==e.addTo&&(e.panel.add=!0),e.panel.add&&(e.showSubPanels=!1,e.panel.splash&&(e.cancel=!0)),e}(this.opts.searchfield);this.opts.searchfield=a(t,M.options.searchfield);this.conf.searchfield;t.add&&(this.bind("close:start",(function(){_(e.node.menu,".mm-searchfield").forEach((function(e){e.blur()}))})),this.bind("initPanel:after",(function(n){var i=null;t.panel.add&&(i=Ce.call(e));var s=null;switch(t.addTo){case"panels":s=[n];break;case"panel":s=[i];break;default:"string"==typeof t.addTo?s=_(e.node.menu,t.addTo):"array"==o(t.addTo)&&(s=t.addTo)}s.forEach((function(n){n=Ne.call(e,n),t.search&&n&&He.call(e,n)})),t.noResults&&je.call(e,t.panel.add?i:n)})),this.clck.push((function(t,n){if(n.inMenu&&t.matches(".mm-searchfield__btn")){if(t.matches(".mm-btn_close")){var i=_(s=t.closest(".mm-searchfield"),"input")[0];return i.value="",e.search(i),!0}var s;if(t.matches(".mm-btn_next"))return(s=t.closest("form"))&&s.submit(),!0}})))},sectionIndexer:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={add:e}),"object"!=typeof e&&(e={}),e}(this.opts.sectionIndexer);this.opts.sectionIndexer=a(t,M.options.sectionIndexer),t.add&&this.bind("initPanels:after",(function(){if(!e.node.indx){var t="";"abcdefghijklmnopqrstuvwxyz".split("").forEach((function(e){t+='<a href="#">'+e+"</a>"}));var n=g("div.mm-sectionindexer");n.innerHTML=t,e.node.pnls.prepend(n),e.node.indx=n,e.node.indx.addEventListener("click",(function(e){e.target.matches("a")&&e.preventDefault()}));var i=function(t){if(t.target.matches("a")){var n=t.target.textContent,i=y(e.node.pnls,".mm-panel_opened")[0],s=-1,a=i.scrollTop;i.scrollTop=0,_(i,".mm-divider").filter((function(e){return!e.matches(".mm-hidden")})).forEach((function(e){s<0&&n==e.textContent.trim().slice(0,1).toLowerCase()&&(s=e.offsetTop)})),i.scrollTop=s>-1?s:a}};F?(e.node.indx.addEventListener("touchstart",i),e.node.indx.addEventListener("touchmove",i)):e.node.indx.addEventListener("mouseover",i)}e.bind("openPanel:start",(function(t){var n=_(t,".mm-divider").filter((function(e){return!e.matches(".mm-hidden")})).length;e.node.indx.classList[n?"add":"remove"]("mm-sectionindexer_active")}))}))},setSelected:function(){var e=this,t=function(e){return"boolean"==typeof e&&(e={hover:e,parent:e}),"object"!=typeof e&&(e={}),e}(this.opts.setSelected);if(this.opts.setSelected=a(t,M.options.setSelected),"detect"==t.current){var n=function(t){t=t.split("?")[0].split("#")[0];var i=e.node.menu.querySelector('a[href="'+t+'"], a[href="'+t+'/"]');if(i)e.setSelected(i.parentElement);else{var s=t.split("/").slice(0,-1);s.length&&n(s.join("/"))}};this.bind("initMenu:after",(function(){n.call(e,window.location.href)}))}else t.current||this.bind("initListview:after",(function(e){y(e,".mm-listitem_selected").forEach((function(e){e.classList.remove("mm-listitem_selected")}))}));t.hover&&this.bind("initMenu:after",(function(){e.node.menu.classList.add("mm-menu_selected-hover")})),t.parent&&(this.bind("openPanel:finish",(function(t){_(e.node.pnls,".mm-listitem_selected-parent").forEach((function(e){e.classList.remove("mm-listitem_selected-parent")}));for(var n=t.mmParent;n;)n.matches(".mm-listitem_vertical")||n.classList.add("mm-listitem_selected-parent"),n=(n=n.closest(".mm-panel")).mmParent})),this.bind("initMenu:after",(function(){e.node.menu.classList.add("mm-menu_selected-parent")})))},sidebar:function(){var e=this;if(this.opts.offCanvas){var t=function(e){return("string"==typeof e||"boolean"==typeof e&&e||"number"==typeof e)&&(e={expanded:e}),"object"!=typeof e&&(e={}),"boolean"==typeof e.collapsed&&e.collapsed&&(e.collapsed={use:!0}),"string"!=typeof e.collapsed&&"number"!=typeof e.collapsed||(e.collapsed={use:e.collapsed}),"object"!=typeof e.collapsed&&(e.collapsed={}),"boolean"==typeof e.expanded&&e.expanded&&(e.expanded={use:!0}),"string"!=typeof e.expanded&&"number"!=typeof e.expanded||(e.expanded={use:e.expanded}),"object"!=typeof e.expanded&&(e.expanded={}),e}(this.opts.sidebar);if(this.opts.sidebar=a(t,M.options.sidebar),t.collapsed.use){this.bind("initMenu:after",(function(){if(e.node.menu.classList.add("mm-menu_sidebar-collapsed"),t.collapsed.blockMenu&&e.opts.offCanvas&&!y(e.node.menu,".mm-menu__blocker")[0]){var n=g("a.mm-menu__blocker");n.setAttribute("href","#"+e.node.menu.id),e.node.menu.prepend(n)}t.collapsed.hideNavbar&&e.node.menu.classList.add("mm-menu_hidenavbar"),t.collapsed.hideDivider&&e.node.menu.classList.add("mm-menu_hidedivi
99der")}));var n=function(){e.node.wrpr.classList.add("mm-wrapper_sidebar-collapsed")},i=function(){e.node.wrpr.classList.remove("mm-wrapper_sidebar-collapsed")};"boolean"==typeof t.collapsed.use?this.bind("initMenu:after",n):k(t.collapsed.use,n,i)}if(t.expanded.use){this.bind("initMenu:after",(function(){e.node.menu.classList.add("mm-menu_sidebar-expanded")}));n=function(){e.node.wrpr.classList.add("mm-wrapper_sidebar-expanded"),e.node.wrpr.matches(".mm-wrapper_sidebar-closed")||e.open()},i=function(){e.node.wrpr.classList.remove("mm-wrapper_sidebar-expanded"),e.close()};"boolean"==typeof t.expanded.use?this.bind("initMenu:after",n):k(t.expanded.use,n,i),this.bind("close:start",(function(){e.node.wrpr.matches(".mm-wrapper_sidebar-expanded")&&(e.node.wrpr.classList.add("mm-wrapper_sidebar-closed"),"remember"==t.expanded.initial&&window.localStorage.setItem("mmenuExpandedState","closed"))})),this.bind("open:start",(function(){e.node.wrpr.matches(".mm-wrapper_sidebar-expanded")&&(e.node.wrpr.classList.remove("mm-wrapper_sidebar-closed"),"remember"==t.expanded.initial&&window.localStorage.setItem("mmenuExpandedState","open"))}));var s=t.expanded.initial;if("remember"==t.expanded.initial){var o=window.localStorage.getItem("mmenuExpandedState");switch(o){case"open":case"closed":s=o}}"closed"==s&&this.bind("initMenu:after",(function(){e.node.wrpr.classList.add("mm-wrapper_sidebar-closed")})),this.clck.push((function(n,i){if(i.inMenu&&i.inListview&&e.node.wrpr.matches(".mm-wrapper_sidebar-expanded"))return{close:"closed"==t.expanded.initial}}))}}},toggles:function(){var e=this;this.bind("initPanel:after",(function(t){_(t,"input").forEach((function(t){x(t,e.conf.classNames.toggles.toggle,"mm-toggle"),x(t,e.conf.classNames.toggles.check,"mm-check")}))}))}},M.wrappers={angular:function(){this.opts.onClick={close:!0,preventDefault:!1,setSelected:!0}},bootstrap:function(){var e=this;if(this.node.menu.matches(".navbar-collapse")){this.conf.offCanvas&&(this.conf.offCanvas.clone=!1);var t=g("nav"),n=g("div");t.append(n),y(this.node.menu).forEach((function(t){switch(!0){case t.matches(".navbar-nav"):n.append(function(e){var t=g("ul");return _(e,".nav-item").forEach((function(e){var n=g("li");if(e.matches(".active")&&n.classList.add("Selected"),!e.matches(".nav-link")){var i=y(e,".dropdown-menu")[0];i&&n.append(o(i)),e=y(e,".nav-link")[0]}n.prepend(a(e)),t.append(n)})),t}(t));break;case t.matches(".dropdown-menu"):n.append(o(t));break;case t.matches(".form-inline"):e.conf.searchfield.form={action:t.getAttribute("action")||null,method:t.getAttribute("method")||null},e.conf.searchfield.input={name:t.querySelector("input").getAttribute("name")||null},e.conf.searchfield.clear=!1,e.conf.searchfield.submit=!0;break;default:n.append(t.cloneNode(!0))}})),this.bind("initMenu:before",(function(){document.body.prepend(t),e.node.menu=t}));var i=this.node.menu.parentElement;if(i){var s=i.querySelector(".navbar-toggler");s&&(s.removeAttribute("data-target"),s.removeAttribute("aria-controls"),s.outerHTML=s.outerHTML,(s=i.querySelector(".navbar-toggler")).addEventListener("click",(function(t){t.preventDefault(),t.stopImmediatePropagation(),e[e.vars.opened?"close":"open"]()})))}}function a(e){for(var t=g(e.matches("a")?"a":"span"),n=["href","title","target"],i=0;i<n.length;i++)e.getAttribute(n[i])&&t.setAttribute(n[i],e.getAttribute(n[i]));return t.innerHTML=e.innerHTML,_(t,".sr-only").forEach((function(e){e.remove()})),t}function o(e){var t=g("ul");return y(e).forEach((function(e){var n=g("li");e.matches(".dropdown-divider")?n.classList.add("Divider"):e.matches(".dropdown-item")&&n.append(a(e)),t.append(n)})),t}},olark:function(){this.conf.offCanvas.page.noSelector.push("#olark")},turbolinks:function(){var e;document.addEventListener("turbolinks:before-visit",(function(t){e=document.querySelector(".mm-wrapper").className.split(" ").filter((function(e){return/mm-/.test(e)}))})),document.addEventListener("turbolinks:load",(function(t){void 0!==e&&(document.querySelector(".mm-wrapper").className=e)}))},wordpress:function(){this.conf.classNames.selected="current-menu-item";var e=document.getElementById("wpadminbar");
99e&&(e.style.position="fixed",e.classList.add("mm-slideout"))}};var qe;t.default=M;window&&(window.Mmenu=M),(qe=window.jQuery||window.Zepto||null)&&(qe.fn.mmenu=function(e,t){var n=qe();return this.each((function(i,s){if(!s.mmApi){var a=new M(s,e,t),o=qe(a.node.menu);o.data("mmenu",a.API),n=n.add(o)}})),n})}]);
100;
101!function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var o=0;o<this.length;o++)e.call(t,this[o],o,this)}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=t.length;--o>=0&&t.item(o)!==this;);return o>-1}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.hasOwnProperty("prepend")||Object.defineProperty(e,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var o=e instanceof Node;t.appendChild(o?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}})})),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var o=e instanceof Node;t.appendChild(o?e:document.createTextNode(String(e)))})),this.appendChild(t)}})})),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(e){e.hasOwnProperty("before")||Object.defineProperty(e,"before",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var o=e instanceof Node;t.appendChild(o?e:document.createTextNode(String(e)))})),this.parentNode.insertBefore(t,this)}})})),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}))}]);;
102/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
103StimulusApp.register('megamenu',class extends Stimulus.Controller{static get targets(){return ["wrapper","level0","submenu",'information_panel','button'];}connect(){console.log('megamenu connected');if(this.hasInitialized)return;this.isDisconnected=false;this.initialize();}initialize(){this.sessionToken=(this.sessionToken||0)+1;this.isDisconnected=false;this.mediaQueryListenersInit();this.toggleTimeout=null;this.openOn=jQuery(this.wrapperTarget).hasClass('open_menu_on_hover')?'mouseenter':'click';this.closeOn=jQuery(this.wrapperTarget).hasClass('open_menu_on_hover')?'mouseleave':'click';const maxLevels=jQuery(this.wrapperTarget).data('max-levels');this.handleDocumentKeydown=this.handleDocumentKeydown.bind(this);this.handleDocumentMousedown=this.handleDocumentMousedown.bind(this);this.boundViewportChange=this.viewportChange.bind(this);this.boundWrapperToggleOn=this.wrapperToggleOn.bind(this);this.boundWrapperToggleOff=this.wrapperToggleOff.bind(this);this.boundOnLevel0=this.onLevel0.bind(this);this.boundOffLevel0=this.offLevel0.bind(this);this.boundForceClose=this.forceClose.bind(this);this.boundItemOnHover=this.ItemOnHover.bind(this);this.boundItemOffHover=this.ItemOffHover.bind(this);this.boundEmptyItemOnHover=this.emptyItemOnHover.bind(this);this.boundSwitchFocus=this.switchFocus.bind(this);this.isDisconnected=false;this.hoverTimeouts=[];this.movedMenuNodes=[];document.body.classList.add('megamenu');
103if(this.hasSubmenuTarget){const page=document.querySelector('#page');const megamenuWrapper=document.createElement('div');megamenuWrapper.className='megamenu-wrapper';const megamenuSubmenus=document.createElement('div');megamenuSubmenus.className='megamenu-submenus';const container=document.createElement('div');container.className='container';for(let index=1;index<=3;index++){const levelContainer=document.createElement('div');levelContainer.className=`menu-submenu-${index}-container menu-submenu-container`;levelContainer.setAttribute('tabindex','-1');container.appendChild(levelContainer);}const overlay=document.createElement('div');overlay.className='megamenu-overlay';megamenuSubmenus.appendChild(container);this.megamenuSubmenuWrapper=megamenuSubmenus;megamenuWrapper.appendChild(megamenuSubmenus);megamenuWrapper.appendChild(overlay);this.megamenuWrapper=megamenuWrapper;this.wrapperTarget.appendChild(this.megamenuWrapper);jQuery(this.megamenuSubmenuWrapper).on(this.openOn,this.boundWrapperToggleOn);jQuery(this.megamenuSubmenuWrapper).on('mouseleave',this.boundWrapperToggleOff);for(const submenu of this.submenuTargets){this.movedMenuNodes.push({node:submenu,parentNode:submenu.parentNode,nextSibling:submenu.nextSibling});const menuId=jQuery(submenu).data('menu-level');const targetContainer=page.querySelector(`.menu-submenu-${menuId}-container`);if(targetContainer){targetContainer.appendChild(submenu);const menuNodes=submenu.querySelectorAll('.menu-submenu-nav li');menuNodes.forEach((menuLiEle)=>{if(jQuery(menuLiEle).hasClass('hasLevels')){jQuery(menuLiEle).on(this.openOn+' focusin',this.boundItemOnHover);const method=this.closeOn==='click'?'off':'on';jQuery(menuLiEle)[method](this.closeOn+' blur',this.boundItemOffHover);}else jQuery(menuLiEle).on('mouseenter focusin',this.boundEmptyItemOnHover);jQuery(menuLiEle).on('keydown',this.boundSwitchFocus);});}}if(this.hasInformation_panelTarget){for(const panel of this.information_panelTargets){this.movedMenuNodes.push({node:panel,parentNode:panel.parentNode,nextSibling:panel.nextSibling});const targetContainer=page.querySelector('.menu-submenu-3-container');if(targetContainer)targetContainer.appendChild(panel);}}const megamenuWrapperElement=document.querySelector('.megamenu-wrapper');if(megamenuWrapperElement)page.appendChild(megamenuWrapperElement);}for(const entry of this.level0Targets)if(jQuery(entry).hasClass('hasLevels')){jQuery(entry).on(this.openOn+' focusin',this.boundOnLevel0);const method=this.closeOn==='click'?'off':'on';jQuery(entry)[method](this.closeOn,this.boundOffLevel0);}else jQuery(entry).on('mouseenter',this.boundForceClose);if(this.hasButtonTarget){for(const button of this.buttonTargets)jQuery(button).on('click',this.boundOnLevel0);}if(maxLevels==3)this.observeMenu();jQuery(window).on('resize',this.boundViewportChange);jQuery(window).on('scroll',this.boundViewportChange);document.addEventListener('keydown',this.handleDocumentKeydown);document.addEventListener('mousedown',this.handleDocumentMousedown);this.swipers=[];this.hasInitialized=true;}handleDocumentKeydown(e){if(e.code==='Escape')this.forceClose();else{if(e.code==='Tab'||e.code==='ArrowDown'||e.code==='ArrowUp'||e.code==='ArrowLeft'||e.code==='ArrowRight')document.body.classList.add('keyboard-navigation');}}handleDocumentMousedown(){document.body.classList.remove('keyboard-navigation');}clearSubmenu(currentMenuItem){const container=currentMenuItem.closest('.menu-submenu-container');const nextContainer=container.next();jQuery(nextContainer).find('.menu-open').removeClass('menu-open');}ItemOnHover(e){if(this.openOn==='click'){e.preventDefault();e.stopPropagation();}const currentMenuItem=jQuery(e.currentTarget);this.clearSubmenu(currentMenuItem);const targetedSubmenu=e.currentTarget.dataset.menuId;const targetedSubmenuId=`#menu-submenu-${targetedSubmenu}`;const nestedSubmenu=this.megamenuWrapper.querySelectorAll(targetedSubmenuId);const submenuContainer=jQuery(nestedSubmenu).closest('.menu-submenu-container');if(currentMenuItem.closest('ul').hasClass('menu-level-2'))this.clearPanels();this.showPanel(targetedSubmenu);this.clearHover(currentMenuItem);currentMenuItem.addClass('hover');this.scheduleMenuTimeout(()=>{if(nestedSubmenu.length>0){jQuery(nestedSubmenu).addClass('menu-open');jQuery(submenuContainer).addClass('showBorder');nestedSubmenu.forEach((submenu)=>submenu.setAttribute('aria-expanded','true'));this.createSlider(nestedSubmenu);}},50);}ItemOffHover(e){const currentMenuItem=jQuery(e.currentTarget);const targetedSubmenu=e.currentTarget.dataset.menuId;const targetedSubmenuId=`#menu-submenu-${targetedSubmenu}`;const nestedSubmenu=this.megamenuWrapper.querySelector(targetedSubmenuId);const submenuContainer=jQuery(nestedSubmenu).closest('.menu-submenu-container');if(nestedSubmenu)if(!nestedSubmenu.matches(':hover')&&e.type!=='blur')this.scheduleMenuTimeout(()=>{currentMenuItem.removeClass('hover');jQuery(nestedSubmenu).removeClass('menu-open');jQuery(submenuContainer).removeClass('showBorder');nestedSubmenu.setAttribute('aria-expanded','false');},50);}emptyItemOnHover(e){const currentMenuItem=jQuery(e.currentTarget);let currentItemActiveSibling;if(currentMenuItem.parent('.swiper-slide').length>0)currentItemActiveSibling=currentMenuItem.closest('.swiper-wrapper').find('li.hover');else currentItemActiveSibling=currentMenuItem.siblings().filter('.hover');if(currentMenuItem.closest('ul').hasClass('menu-level-2')||currentMenuItem.closest('ul').hasClass('menu-level-3')&&currentMenuItem.data('panel-id')||currentMenuItem.parent('.menu-level-3').data('parentPanel-id'))this.clearPanels();if(!currentMenuItem.hasClass('hasLevels')&&(currentMenuItem.parent('.menu-level-3').length===0||currentMenuItem.data('panel-id'))){const targetedPanel=e.currentTarget.dataset.menuId;this.showPanel(targetedPanel);}else{if(!currentMenuItem.hasClass('hasLevels')&&(currentMenuItem.parent('.menu-level-3').length===1&&currentMenuItem.parent('.menu-level-3').data('parentPanel-id'))){const targetedPanel=currentMenuItem.parent('.menu-level-3').data('parentPanel-id');this.showPanel(targetedPanel);}}const container=currentMenuItem.closest('.menu-submenu-container');const nextContainer=container.next();jQuery(nextContainer).find('.menu-open').removeClass('menu-open');jQuery(nextContainer).find('.menu-submenu-container').removeClass('showBorder');if(currentItemActiveSibling.length>0){const currentItemActiveSiblingId=currentItemActiveSibling.data('menuId');const currentItemActiveSiblingSubmenu=this.megamenuWrapper.querySelectorAll(`#menu-submenu-${currentItemActiveSiblingId}`);currentItemActiveSibling.removeClass('hover');jQuery(currentItemActiveSiblingSubmenu).removeClass('menu-open');const currentItemActiveSiblingSubmenuContainer=jQuery(currentItemActiveSiblingSubmenu).closest('.menu-submenu-container');jQuery(currentItemActiveSiblingSubmenuContainer).removeClass('showBorder');}}viewportChange(){this.menuPosition();}onLevel0(e){if(this.openOn==='click'){e.preventDefault();e.stopPropagation();}this.clear();clearTimeout(this.toggleTimeout);const currentMenuItem=jQuery(e.currentTarget);const submenuId=currentMenuItem.data('submenu-id');const submenu=document.querySelector(`#page #menu-submenu-${submenuId}`);this.showPanel(`0-${currentMenuItem.index()}`);if(submenu){this.menuPosition();submenu.setAttribute('aria-expanded','true');currentMenuItem.find('a').addClass('active');jQuery(submenu).addClass('menu-open');jQuery(this.megamenuWrapper).addClass('menu-open');jQuery('body').addClass('megamenu-opened');this.createSlider(submenu);this.refreshSliderViewports(submenu);
103if(document.body.classList.contains('keyboard-navigation')){const firstSubmenuItem=this.findFirstFocusableMenuItem(submenu);if(firstSubmenuItem){firstSubmenuItem.focus();e.preventDefault();}}}}clear(){const submenus=this.megamenuWrapper.querySelectorAll('.menu-submenu');jQuery(submenus).removeClass('menu-open');const submenusContainers=this.megamenuWrapper.querySelectorAll('.menu-submenu-container');jQuery(submenusContainers).removeClass('showBorder');submenus.forEach((submenu)=>submenu.setAttribute('aria-expanded','false'));this.deactivateLevel0();const panel=document.querySelector('.megamenu_information_panel.panel_visible');if(panel)jQuery(panel).removeClass('panel_visible');this.resetSliderViewports();}clearHover(el){let currentItemActiveSibling;if(jQuery(el).parent('.swiper-slide').length>0)currentItemActiveSibling=jQuery(el).closest('.swiper-wrapper').find('li.hover');else currentItemActiveSibling=jQuery(el).siblings().filter('.hover');if(currentItemActiveSibling)currentItemActiveSibling.removeClass('hover');}offLevel0(e){this.toggleTimeout=this.scheduleMenuTimeout(()=>{const currentMenuItem=jQuery(e.currentTarget);const submenuId=currentMenuItem.data('submenu-id');const submenu=document.querySelector(`#page #menu-submenu-${submenuId}`);if(submenu){this.menuPosition();submenu.setAttribute('aria-expanded','false');jQuery(submenu).removeClass('menu-open');jQuery(this.megamenuWrapper).removeClass('menu-open');currentMenuItem.find('a').removeClass('active');}},50);}scheduleMenuTimeout(callback,delay){this.clearMenuTimeouts();const sessionToken=this.sessionToken;const timeoutId=setTimeout(()=>{this.hoverTimeouts=this.hoverTimeouts.filter((pendingTimeoutId)=>pendingTimeoutId!==timeoutId);if(!this.isDisconnected&&sessionToken===this.sessionToken)callback();},delay);this.hoverTimeouts.push(timeoutId);return timeoutId;}clearMenuTimeouts(){this.hoverTimeouts.forEach((timeoutId)=>clearTimeout(timeoutId));this.hoverTimeouts=[];this.toggleTimeout=null;}wrapperToggleOn(){clearTimeout(this.toggleTimeout);jQuery(this.megamenuWrapper).addClass('menu-open');jQuery('body').addClass('megamenu-opened');}wrapperToggleOff(){jQuery(this.megamenuWrapper).removeClass('menu-open');jQuery('body').removeClass('megamenu-opened');this.deactivateLevel0();}forceClose(){jQuery(this.megamenuWrapper).removeClass('menu-open');jQuery('body').removeClass('megamenu-opened');const subMenus=this.megamenuWrapper?this.megamenuWrapper.querySelectorAll('.menu-submenu'):[];subMenus.forEach((el)=>{if(el.classList.contains('menu-open')){el.classList.remove('menu-open');el.setAttribute('aria-expanded','false');}});this.deactivateLevel0();this.resetSliderViewports();}deactivateLevel0(){const level0=this.wrapperTarget.querySelectorAll('.level0 li a');jQuery(level0).removeClass('active');}showPanel(id){const container=document.querySelector('.menu-submenu-3-container');if(container){const panel=jQuery(container).find(`.megamenu_information_panel[data-panel-id="${id}"]`);if(panel.length>0)panel.addClass('panel_visible');else{const visiblePanel=document.querySelector('.megamenu_information_panel.panel_visible');if(visiblePanel)jQuery(visiblePanel).removeClass('panel_visible');}}}clearPanels(){const container=document.querySelector('.menu-submenu-3-container');if(container){const panels=container.querySelectorAll('.megamenu_information_panel');panels.forEach((panel)=>{if(panel.classList.contains('panel_visible'))panel.classList.remove('panel_visible');});}}menuPosition(){const container=document.querySelector('.megamenu-wrapper');const header=document.querySelector('.holcim_header.desktop');if(container&&header){const scrollTop=window.scrollY||document.documentElement.scrollTop;container.style.top=`${scrollTop+header.offsetHeight}px`;}}observeMenu(){const level2Container=document.querySelector('.menu-submenu-2-container');const level3Container=document.querySelector('.menu-submenu-3-container');if(!level2Container||!level3Container)return;function checkMenuOpenClass(){const hasMenuOpenClass=level2Container.querySelector('.menu-submenu.menu-open')!==null;const level3MenuOpen=level3Container.querySelector('.menu-submenu.menu-open');if(!hasMenuOpenClass&&level3MenuOpen)level3MenuOpen.classList.remove('menu-open');}this.menuObserver=new MutationObserver(checkMenuOpenClass);this.menuObserver.observe(level2Container,{childList:true,subtree:true,attributes:true,attributeFilter:['class']});}createSlider(submenu){const $listviews=jQuery(submenu).find('ul.menu-panel:not(.with-slider)');const navId=(Math.random()+1).toString(36).substring(2);$listviews.each((index,listview)=>{const $listview=jQuery(listview);if($listview.height()>=this.maxPanelHeight){$listview.addClass('with-slider');const $listitems=$listview.find('li');const $swiperWrapper=jQuery('<div class="swiper-wrapper"></div>');$listitems.each((index,listitem)=>{const $listitem=jQuery(listitem);
103$listitem.addClass('inside-swiper');const $swiperSlide=jQuery('<div class="swiper-slide"></div>');$swiperSlide.append($listitem);$swiperWrapper.append($swiperSlide);});const $swiper=jQuery('<div class="swiper"></div>');$swiper.append($swiperWrapper);$listview.append(`<div id="swiper-nav-prev-${navId}" class="button up button-prev"></div>`);$listview.append($swiper);$listview.append(`<div id="swiper-nav-next-${navId}" class="button down button-next"></div>`);if(!window.Swiper){console.log("mmenu: loading swiperjs library on the fly.");jQuery('<link>').appendTo('head').attr({type:'text/css',rel:'stylesheet',href:'/libraries/swiperjs/7.0.8/swiper-bundle.min.css'});const sessionToken=this.sessionToken;jQuery.getScript("/libraries/swiperjs/7.0.8/swiper-bundle.min.js",this.createSliderCallback.bind(this,$listview,navId,sessionToken));}else this.createSliderCallback($listview,navId,this.sessionToken);}});}createSliderCallback($listview,navId,sessionToken){if(this.isDisconnected||sessionToken!==this.sessionToken||!this.megamenuWrapper||!this.megamenuWrapper.isConnected)return;const swiperObject=new Swiper($listview.find('.swiper').get(0),{slidesPerView:'auto',slidesPerGroup:5,direction:"vertical",loop:false,navigation:{nextEl:'#swiper-nav-next-'+navId,prevEl:'#swiper-nav-prev-'+navId}});swiperObject.on('slideChange',()=>this.syncSliderViewport(swiperObject));swiperObject.on('navigationNext',()=>this.syncSliderViewport(swiperObject));swiperObject.on('navigationPrev',()=>this.syncSliderViewport(swiperObject));swiperObject.on('reachBeginning',()=>this.syncSliderViewport(swiperObject));swiperObject.on('reachEnd',()=>this.syncSliderViewport(swiperObject));swiperObject.on('toEdge',()=>this.syncSliderViewport(swiperObject));swiperObject.on('fromEdge',()=>this.syncSliderViewport(swiperObject));this.syncSliderViewport(swiperObject);this.swipers.push(swiperObject);}syncSliderViewport(swiperObject){if(!swiperObject||!swiperObject.el)return;const $listview=jQuery(swiperObject.el).closest('ul.menu-panel');const $menuSubmenuNav=$listview.closest('.menu-submenu-nav');const shouldExpandViewport=!swiperObject.isBeginning&&!swiperObject.isEnd;if(shouldExpandViewport){$listview.css('max-height','100%');$menuSubmenuNav.css('margin-top','0');}else{$listview.css('max-height','');$menuSubmenuNav.css('margin-top','');}}refreshSliderViewports(rootElement){const scope=rootElement||this.megamenuWrapper;if(!scope)return;scope.querySelectorAll('ul.menu-panel.with-slider .swiper').forEach((swiperElement)=>{if(swiperElement.swiper)this.syncSliderViewport(swiperElement.swiper);});}resetSliderViewports(){if(!this.megamenuWrapper)return;const sliderListviews=this.megamenuWrapper.querySelectorAll('ul.menu-panel.with-slider');sliderListviews.forEach((listview)=>{const menuSubmenuNav=listview.closest('.menu-submenu-nav');listview.style.removeProperty('max-height');if(menuSubmenuNav)menuSubmenuNav.style.removeProperty('margin-top');});}prevSlide(swiperObject){swiperObject.slidePrev();}nextSlide(swiperObject){swiperObject.slideNext();}switchFocus(event){const currentTarget=jQuery(event.currentTarget);const targetedSubmenu=event.currentTarget.dataset.menuId;const hasSlider=currentTarget.parent().hasClass('swiper-slide');if(event.key==='ArrowRight'){event.preventDefault();const firstSubmenuItem=targetedSubmenu?this.findFirstFocusableMenuItem(this.megamenuWrapper.querySelectorAll(`#menu-submenu-${targetedSubmenu}`)):this.findFirstFocusableMenuItem(currentTarget.closest('ul.menu-panel'));if(firstSubmenuItem.length)firstSubmenuItem.focus();}else if(event.key==='ArrowLeft'){event.preventDefault();const parentMenuItem=this.findParentMenuItemForCurrentSubmenu(currentTarget);if(parentMenuItem)this.focusMenuItem(parentMenuItem).focus();}else if(event.key==='ArrowDown'){event.preventDefault();if(hasSlider)this.focusMenuItem(currentTarget.parent().next()).focus();else this.focusMenuItem(currentTarget.next()).focus();}else{if(event.key==='ArrowUp'){event.preventDefault();if(hasSlider)this.focusMenuItem(currentTarget.parent().prev()).focus();else this.focusMenuItem(currentTarget.prev()).focus();}}}findFirstFocusableMenuItem(submenuNodes){const $submenuNodes=jQuery(submenuNodes);const $realItems=$submenuNodes.find('li:not(.parent-menu-link)');const $focusableItem=$realItems.filter('[tabindex="0"]').first();if($focusableItem.length)return $focusableItem;const $focusableChild=$realItems.find('a[tabindex="0"], button[tabindex="0"], .open_submenu').filter(':visible').first();if($focusableChild.length)return $focusableChild;return $realItems.first();}focusMenuItem(menuItem){const $menuItem=jQuery(menuItem);if(!$menuItem.length)return $menuItem;if($menuItem.is('[tabindex="0"]'))return $menuItem;const $interactiveChild=$menuItem.find('a[tabindex="0"], button[tabindex="0"], .open_submenu').filter(':visible').first();if($interactiveChild.length)return $interactiveChild;return $menuItem;}findParentMenuItemForCurrentSubmenu(currentTarget){const currentSubmenu=currentTarget.closest('.menu-submenu');if(!currentSubmenu.length)return null;const currentSubmenuId=currentSubmenu.attr('id');if(!currentSubmenuId)return null;const submenuKey=currentSubmenuId.replace('menu-submenu-','');if(submenuKey.split('-').length===2)return this.wrapperTarget.querySelector(`li[data-submenu-id="${submenuKey}"]`);return this.megamenuWrapper.querySelector(`li[data-menu-id="${submenuKey}"]`);}mediaQueryListenersInit(){this.mediaQueryListeners=[];for(var label in window.drupalSettings.jsBp){var mql=window.matchMedia(window.drupalSettings.jsBp[label]);const handler=this.mediaQueryChangeHandler.bind(this,label);this.mediaQueryListeners.push({mql,handler});mql.addEventListener('change',handler);this.mediaQueryChangeHandler(label,mql);}}mediaQueryChangeHandler(label,mql){if(mql.matches)switch(label){case 'corporate.extra':this.maxPanelHeight=460;break;case 'corporate.large':this.maxPanelHeight=404;break;case 'corporate.medium':case 'corporate.small':break;}}disconnect(){this.isDisconnected=true;this.hasInitialized=false;this.clearMenuTimeouts();this.forceClose();document.body.classList.remove('megamenu');document.body.classList.remove('keyboard-navigation');if(this.menuObserver)this.menuObserver.disconnect();
103if(this.mediaQueryListeners)this.mediaQueryListeners.forEach(({mql,handler})=>{mql.removeEventListener('change',handler);});jQuery(window).off('resize',this.boundViewportChange);jQuery(window).off('scroll',this.boundViewportChange);document.removeEventListener('keydown',this.handleDocumentKeydown);document.removeEventListener('mousedown',this.handleDocumentMousedown);if(this.submenuTargets){for(const submenu of this.submenuTargets){const menuNodes=submenu.querySelectorAll('.menu-submenu-nav li');menuNodes.forEach((menuLiEle)=>{jQuery(menuLiEle).off(this.openOn+' focusin',this.boundItemOnHover);jQuery(menuLiEle).off(this.closeOn+' blur',this.boundItemOffHover);jQuery(menuLiEle).off('mouseenter focusin',this.boundEmptyItemOnHover);jQuery(menuLiEle).off('keydown',this.boundSwitchFocus);});}}if(this.level0Targets){for(const entry of this.level0Targets){jQuery(entry).off(this.openOn+' focusin',this.boundOnLevel0);jQuery(entry).off(this.closeOn,this.boundOffLevel0);jQuery(entry).off('mouseenter',this.boundForceClose);}}if(this.buttonTargets){for(const button of this.buttonTargets)jQuery(button).off('click',this.boundOnLevel0);}if(this.megamenuSubmenuWrapper){jQuery(this.megamenuSubmenuWrapper).off(this.openOn,this.boundWrapperToggleOn);jQuery(this.megamenuSubmenuWrapper).off('mouseleave',this.boundWrapperToggleOff);}if(this.swipers)this.swipers.forEach((swiperObject)=>{if(swiperObject&&typeof swiperObject.destroy==='function')swiperObject.destroy(true,true);});this.resetSliderViewports();if(this.submenuTargets){for(const submenu of this.submenuTargets)jQuery(submenu).find('ul.menu-panel.with-slider').each((index,listview)=>{const $listview=jQuery(listview);const $slides=$listview.find('.swiper-slide');$slides.each((slideIndex,slide)=>{const $slide=jQuery(slide);const $listitem=$slide.find('li.inside-swiper');if($listitem.length){$listitem.removeClass('inside-swiper');$listview.append($listitem);}});$listview.find('.up, .down, .swiper').remove();$listview.removeClass('with-slider');});}if(this.movedMenuNodes){for(const movedMenuNode of this.movedMenuNodes.slice().reverse())if(movedMenuNode.parentNode)if(movedMenuNode.nextSibling&&movedMenuNode.nextSibling.parentNode===movedMenuNode.parentNode)movedMenuNode.parentNode.insertBefore(movedMenuNode.node,movedMenuNode.nextSibling);else movedMenuNode.parentNode.appendChild(movedMenuNode.node);}if(this.megamenuWrapper&&this.megamenuWrapper.parentNode)this.megamenuWrapper.parentNode.removeChild(this.megamenuWrapper);}});;
104StimulusApp.register('mmenu-mobile',class extends Stimulus.Controller{static get targets(){return ["wrapper"];}initialize(){console.log('mmenu-mobile connected ');this.mediaQueryListenersInit();this.mmenu_mobile=new Mmenu(this.wrapperTarget,{extensions:["border-none"],offCanvas:true,offCanvas:{blockUI:false},"navbars":[{"position":"bottom","content":["<div class='mm-navbar-wrapper'></div>"]}],"extensions":["border-full",'listview-huge']},{offCanvas:{menu:{insertMethod:'append',insertSelector:'#page'},page:{selector:'#page'}}});this.api=this.mmenu_mobile.API;jQuery('#page.mm-page').on('click',this.closeMenu.bind(this));jQuery(this.wrapperTarget).on('click',this.preventClose.bind(this));this.api.bind('open:finish',this.openFinish.bind(this));var $holcim_language_switcher=jQuery('.holcim_header.desktop .holcim_language_switcher').clone();var $endorsement_logo=jQuery('.holcim_header.desktop .endorsement_logo_wrapper .img_not_sticky img').clone();var $infoPanels=document.querySelectorAll('.holcim_header.mobile #mobile-information-pannel-wrapper .megamenu_information_panel');if($infoPanels.length>0)this.distributePanels($infoPanels);$holcim_language_switcher.appendTo('.mm-navbar-wrapper');$endorsement_logo.appendTo('.mm-navbar-wrapper');}openFinish(){var $panel=jQuery(this.wrapperTarget).find('.mm-panel');var $buttons=$panel.find('.mm-btn_next');for(var i=0;i<$buttons.length;i++){var $button=jQuery($buttons[i]);var $page_link=$button.parent().find('> a.mm-listitem__text');if($page_link.length)$page_link.attr('href',$button.attr('href'));}var $panel=jQuery(this.wrapperTarget).find('.mm-panel');var $buttons=$panel.find('.mm-btn_prev');for(var i=0;i<$buttons.length;i++){var $button=jQuery($buttons[i]);var $page_link=$button.parent().find('> a.mm-navbar__title');if($page_link.length){var id=$button.attr('href');if($button.closest('.mm-panels').find('div'+id).find('ul.level1').length)var label=Drupal.t('Main menu');else var label=$button.closest('.mm-panels').find('div'+id).find('.mm-listitem:first-child > a.mm-listitem__text').html();$page_link.html('<span>'+label+'</span>');}}}closeMenu(){this.api.closeAllPanels();this.api.close();}preventClose(event){event.stopPropagation();}
104distributePanels(panels){panels.forEach((panel)=>{let panelId=panel.dataset.listref;let appendtarget=jQuery('#'+panelId);jQuery(panel).appendTo(appendtarget);});}mediaQueryListenersInit(){for(var label in window.drupalSettings.jsBp){var mql=window.matchMedia(window.drupalSettings.jsBp[label]);mql.addListener(this.mediaQueryChangeHandler.bind(this,label));this.mediaQueryChangeHandler(label,mql);}}mediaQueryChangeHandler(label,mql){if(mql.matches)switch(label){case 'corporate.large':case 'corporate.extra':if(this.api)this.closeMenu();break;}}});;
105StimulusApp.register('quicksearch',class extends Stimulus.Controller{static get targets(){return ["wrapper","keywords","close"];}connect(){console.log('quicksearch connected');this.enabled=this.wrapperTarget.dataset.quicksearchEnabled==='1';this.timeout=null;this.abortController=null;this.lastQuery=null;if(this.enabled)this.keywordsTarget.addEventListener('input',this.onInput.bind(this));this.wrapperTarget.addEventListener('keypress',this.keyPressed.bind(this));this.closeTarget.addEventListener('click',this.closePanel.bind(this));}closePanel(){document.body.classList.toggle('show-search');return false;}triggerMainSearch(){const keywords=this.keywordsTarget.value;const search_url=this.wrapperTarget.dataset.searchUrl;window.location.href=search_url+'?search_api_fulltext='+keywords;}onInput(e){if(!this.enabled)return;const value=e.target.value;if(value.length<2){this.clearResults();return;}clearTimeout(this.timeout);this.timeout=setTimeout(()=>{this.fetchResults(value);},300);}fetchResults(query){const url=this.wrapperTarget.dataset.quicksearchUrl;if(query===this.lastQuery)return;this.lastQuery=query;if(this.abortController)this.abortController.abort();this.abortController=new AbortController();fetch(url+'?q='+encodeURIComponent(query),{signal:this.abortController.signal}).then((response)=>response.json()).then((data)=>{this.renderResults(data);}).catch((err)=>{if(err.name==='AbortError')return;console.error('Quicksearch error',err);});}renderResults(results){const container=this.wrapperTarget.querySelector('.search_results');if(!results.length){this.clearResults();return;}this.renderSkeleton(results.length);results.forEach((item,index)=>{const image=item.itemImage.url??'';const imageAlt=item.itemImage.alt??'';const description=item.itemDescription??'';const secondaryImage=item.searchSecondaryImage.url??'';const secondaryImageAlt=item.searchSecondaryImage.alt??'';const html=`
106        <div class="search-item-result">
107          ${image?`<div class="item-image"><img src="${image}" alt="${imageAlt}" loading="lazy"/></div>`:''}
108          ${secondaryImage?`<div class="item-secondary-image"><img src="${secondaryImage}" alt="${secondaryImageAlt}" loading="lazy" /></div>`:''}
109          <div class="content">
110            ${!item.hideTitle?`<div class="item-title">${item.title}</div>`:''}
111            ${description?`<div class="item-desc">${description}</div>`:''}
112            <div class="item-link">
113              <a href="${item.url}">${item.itemLinkLabel}</a>
114              <span class="icon"></span>
115            </div>            
116          </div>
117        </div>
118      `;container.insertAdjacentHTML('beforeend',html);container.querySelectorAll('.item-image img').forEach((img)=>{img.onerror=()=>{img.onerror=null;img.src='modules/custom/quicksearch/images/fallback.svg';};});if(index===0){const skeleton=this.wrapperTarget.querySelector('.skeleton-wrapper');skeleton.remove();}const element=container.children[index];setTimeout(()=>{element.classList.add('visible');},index*50);});const resultsContainer=this.wrapperTarget.querySelector('.search_results');resultsContainer.classList.toggle('spread',results.length===4);setTimeout(()=>{this.updateResultsState(true);},30);}renderSkeleton(count){const container=this.element.querySelector('.search_results');let skeleton='<div class="skeleton-wrapper">';for(let i=0;i<count;i++)skeleton+=`
119        <div class="search-item-result skeleton">
120          <div class="item-image"></div>
121          <div class="item-secondary-image"></div>
122          <div class="content">
123            <div class="item-desc"></div>
124          </div>
125        </div>
126      `;skeleton+='</div>';container.innerHTML=skeleton;}updateResultsState(hasResults){if(hasResults){this.wrapperTarget.classList.remove('no-results');this.wrapperTarget.classList.add('has-results');}else{this.wrapperTarget.classList.remove('has-results');this.wrapperTarget.classList.add('no-results');}}clearResults(){this.updateResultsState(false);const container=this.element.querySelector('.search_results');container.innerHTML='';}keyPressed(e){if(e.which===13)this.triggerMainSearch();}});;
127StimulusApp.register('richtext',class extends Stimulus.Controller{static get targets(){return ["wrapper","description"];}connect(){console.log('richtext connected');this.enableShowMore();let gradientUnderline=this.wrapperTarget.querySelectorAll('u.gradientUnderline');if(gradientUnderline.length>0)this.addGradientUnderline(gradientUnderline);}enableShowMore(){var $toggle=jQuery(this.descriptionTarget).find('.showmore > .toggle');
127if($toggle.length)$toggle.on('click',this.toggleShowMore.bind(this));}toggleShowMore(e){var $data=jQuery(this.descriptionTarget).find('.showmore > .data');$data.toggleClass('show');}addGradientUnderline(gradientUnderline){gradientUnderline.forEach((element)=>{const span=document.createElement('span');span.setAttribute('class','gradient_underline');element.append(span);const spanHeight=span.offsetHeight;const extraWidth=spanHeight+'px';span.style.left=-1*(spanHeight/2)+'px';span.style.width=`calc(100% + ${extraWidth})`;});}});;

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.