window.loadBlockerApi=window.loadBlockerApi||new function(){var o=[],i=null;this.showSpinner=function(n){n=n||"noId",-1==$.inArray(n,o)&&o.push(n),i=i||bootbox.dialog({message:"<i class='far fa-spinner fa-spin fa-3x fa-fw'></i><span class='sr-only'>"+resources.Loading+"</span>",closeButton:!1,className:"loadingModal",show:!0})},this.hideSpinner=function(e){e=e||"noId",0==(o=jQuery.grep(o,function(n){return n!=e})).length&&i&&(i.modal("hide"),i=null)},this.manualRemove=function(n){n=document.querySelector(n);n.style.visibility="hidden",n.nextElementSibling.remove(),n.remove(),i=null}};
var AjaxCache=function(){var e={},u=new Hashtable,i=(e.Remove=function(e){u.remove(e)},e.Get=function(n,e,t,a){var r,c=$.Deferred(),o=(r=n,(o=u.get(r))?(new Date).getTime()<o.cacheTTL?o.data:(u.remove(r),null):null);return!a&&o?c=o:(r=c,u.put(n,new i(r,e)),$.ajax(t).done(function(e){c.resolve(e),$(document).trigger("layerIconsUpdated",[n,e])}).fail(c.reject)),c.promise()},function(e,n){var t={};return t.data=e,t.cacheTTL=(new Date).getTime()+6e4*n,t});return e};
!function(y,k){let v,L,w,T,B,S,x,P,z,I,D,r,O=y(".locationBtn"),A="off",E,R,F,Z="map-canvas",o=!1;function G(e,o){var t,a='"'+e+'":';for(t of o.split(","))if(t.trim().startsWith(a))return"true"===t.trim().substring(a.length).replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"");return null}let V=!0,_=function(){E=!E,Cookies.set("mapClrMode",E?"dark":"light"),MapComp.toggleMapMode({isDarkMode:E,displayPois:A}),j()};function U(){B=MapComp.ControlPosition([resources.MapTypePos]),S=MapComp.MapTypeControlStyle([resources.MapTypeStyle]),x=MapComp.ControlPosition([resources.MapControlPos]),P=MapComp.ControlPosition([resources.MapControlPos]),D=MapComp.ControlPosition([resources.TruckerModeMapControlPos]),z=MapComp.ControlPosition([resources.MapControlPos]),I=MapComp.ControlPosition([resources.MapControlPos]),MapComp.ControlPosition([resources.MapControlPos]),V="true"===resources.UseGoogleMapZoom}function N(){B=MapComp.ControlPosition([resources.MobileFirstMapTypePos]),x=MapComp.ControlPosition([resources.MobileFirstMapControlPos]),P=MapComp.ControlPosition([resources.MobileFirstMapControlPos]),D=MapComp.ControlPosition([resources.TruckerModeMobileFirstMapControlPos])}function W(e,o,t){var a=0<y("#embedmap").length;Modernizr.mq("(min-width: 993px)")||a?U():(e||o||t?N():(B=MapComp.ControlPosition([resources.MobileMapTypePos]),x=MapComp.ControlPosition([resources.MobileMapTypePos]),P=MapComp.ControlPosition([resources.MobileMapControlPos]),D=MapComp.ControlPosition([resources.TruckerModeMobileMapControlPos])),S=MapComp.MapTypeControlStyle([resources.MapTypeStyle]),z=MapComp.ControlPosition([resources.MobileMapControlPos]),V=!0)}let $;function q(){var e=y("body").hasClass("mobileFirst")&&0<!y(".ersLogo").length;isWta=0<y("#wtaMap").length,"True"==resources.EnableLocationSearchBar&&t(),Modernizr.mq("(max-width: 992px)")&&e&&!isWta&&(t(),y(".myCamerasContainer").appendTo(".myCamerasGroup"),y("footer").hide())}function H(e,o){var[e,t]=MapComp.setupZoomButtons({controlDiv:e,text:{ZoomInMap:resources.ZoomInMap,ZoomOutMap:resources.ZoomOutMap}});MapComp.setZoomEvents({zoomInButton:e,zoomOutButton:t})}function Q(e,o,t){MapComp.isLibre?t?MapComp.map.jumpTo({center:e.reverse(),zoom:o}):MapComp.methods.zoom.flyTo(o,e.reverse()):(t=new google.maps.LatLng(e[0],e[1]),v.panTo(t),o&&v.setZoom(o))}function i(e){return e=n(e),MapComp.mapPoint(e)}let t=function(){if(!o){o=!0;let a=document.getElementById("mapLocation");var e={componentRestrictions:{country:resources.AutocompleteCountryCode.split(",")},fields:["address_component,adr_address,alt_id,formatted_address,geometry,icon,id,name,place_id,plus_code,scope,type,url,utc_offset,vicinity"]};if(a)if(MapComp.isGoogle){let t=new google.maps.places.Autocomplete(a,e);t.bindTo("bounds",v),r=new google.maps.Marker({map:v}),google.maps.event.addDomListener(a,"keydown",function(e){var o;e.cancelBubble=!0,13!==e.keyCode&&9!==e.keyCode||0<y(".pac-item-selected").length||e.hasRanOnce||((o=new Event("keydown")).keyCode=40,o.hasRanOnce=!0,google.maps.event.trigger(e.target,"keydown",o))}),google.maps.event.addListener(t,"place_changed",function(e){r.setVisible(!1),a.className="";var o=t.getPlace();o.geometry?(o.geometry.viewport?v.fitBounds(o.geometry.viewport):(v.setCenter(o.geometry.location),v.setZoom(17)),r.setPosition(o.geometry.location),r.setVisible(!0),y(".mobileLocationBar .clearLocateBtn").show()):bootbox.dialog({title:resources.InvalidLocation,message:"<div class='alert alert-info'><i class='far fa-exclamation-circle'></i>"+resources.SelectValidLocationList+"</div>",className:"mapLocationMsg"})})}else MapComp.setupSearchBar(a,e.componentRestrictions.country)}},j=function(){MapComp.setDarkLabelsState({darkLabelsLayerType:F,isDarkMode:E})},K=function(e){var o=y(".topBanner .socialIcons"),t=y(".TruckerInfoLegendSection ul[id$='-children']");e?("undefined"!=typeof ga&&ga("send","event","TruckerMode","Show"),y(".truckerModeIndicator").show(),0<o.length&&o.addClass("down"),y(".mapLegend > .TruckerInfoLegendSection").is(":first")||a(!0,"TruckerInfoLegendSection"),0<t.length&&(t.show(),t.find("input[type='checkbox']").show())):(y(".truckerModeIndicator").hide(),0<o.length&&o.removeClass("down"),a(!1,"TruckerInfoLegendSection"),e=!1,0<t.length&&(t.hide(),t.find("input[type='checkbox']").hide())),y(".TruckerInfoLegendSection label input[type='checkbox']").prop("checked",e),w&&y.each(y(".TruckerInfoLegendSection label input[type='checkbox']"),function(e,o){w.layerToggled(y(o).attr("data-layerid"),!1)})},a=function(e,o){var t=0<y("."+o+" .collapse.in").length;e?(document.querySelector(".groupHeaderSection").before(document.querySelector("."+o)),t||y("."+o+" .toggleButton").trigger("click")):(y("."+o).insertBefore(".markerClusterLegend"),t&&y("."+o+" .toggleButton").trigger("click"))},J=function(e){var o,t,a=e.attr("data-icon");return a?(o=e.attr("data-iconsize"),t=e.attr("data-iconanchor"),e=e.attr("data-iconorigin"),a={url:a},o&&(a.size=function(e){let o=n(e);return MapComp.mapSize(o)}(o)),t&&(a.anchor=i(t)),e&&(a.origin=i(e)),a):null},n=function(e){var o=[],t=e.split(",");for(let e=0;e<t.length;e++)o[e]=+t[e];return o};y(".setToRegion").on("click",function(){var e=y(this).val().split(",");v.panTo(new google.maps.LatLng(e[0],e[1])),v.setZoom(parseInt(e[2]))});y("#layerSelection button").on("click",function(){var e=y(this).find("i");!0===e.hasClass("fa-minus-circle")?(e.removeClass("fa-minus-circle"),e.addClass("fa-plus-circle")):(e.addClass("fa-minus-circle"),e.removeClass("fa-plus-circle"))}),y(document).on("MapResize",function(){"object"==typeof google&&"object"==typeof google.maps&&google.maps.event.trigger(v,"resize")}),y(".myRouteBtn").on("click",function(e,o){Modernizr.mq("(min-width: 993px)")&&!O.is(":visible")&&O.show(),y(".sideBarGroup, #sideBar").show(),null==o&&y("#RoutesTab > a").trigger("click"),y(".mapPage .sideBarColContainer").show(),y(".mobileLocationBar").hide(),o&&o.skipPtBSetup||(y("#endLocationText").val(""),y("#endLocationText").focusout(),0<(o=y("#mapLocation").val()).length&&y("#endLocationText").val(o),y("#endLocationText").focusout(),y("#startLocationText").focus())}),y(".UIControls .directions").on("click",function(e,o){y(".mobileFirst .mobileSetting").hide(),y(".showSideBar").hide();var t=y("#mapLocation").val();0<t.length&&y("#endLocationText").val(t),y(".sideBarGroup").show(),y("#sideBar").show(),null==o&&y("#RoutesTab > a").trigger("click"),y("#startLocationText").focus(),y(".mapPage .sideBarColContainer").show(),y(".mobileLocationBar").hide(),y("#routingResults").is(":visible")&&y(document).trigger("checkEventOnRoutePlanner")}),y(".UIControls .openInfoTab").on("click",function(){y(".mobileFirst .mobileSetting").hide(),y(".sideBarGroup").show(),y("#sideBar").show(),y(".showSideBar").hide(),y(".mobileLocationBar").hide(),y(".mapPage .sideBarColContainer").show(),y("#AlertsTab > a").trigger("click")}),y(".clearLocateBtn").on("click",function(){y(this).hide(),y("#mapLocation").val(""),r&&r.setVisible(!1),MapComp.isLibre&&MapComp.clearLocationMarker()}),y(".closeSettings").on("click",function(){y(".mobileFirst .mobileSetting").hide(),y("#layerSelection").hide()}),y(".myCamerasContainer .fa-times, .myCam").on("click",function(){var e;""===resources.MobileCamBtnLink?(e=y(".myCamerasGroup")).is(":visible")?e.hide():(k.DisplayMyCameras(),e.show()):k.location.href=k.location.origin+resources.MobileCamBtnLink}),y("#setCurrentLocation").click(function(e){return k.GetUserGeolocation(function(e){var o;r&&r.setVisible(!1),y(document).trigger("removeMyLocationMarker"),MapComp.isGoogle?(o=e,(new google.maps.Geocoder).geocode({location:o},function(e,o){"OK"===o?e[0]&&(v.setZoom(17),y("#mapLocation").val(e[0].formatted_address),v.setCenter(e[0].geometry.location),r.setPosition(e[0].geometry.location),r.setVisible(!0),y(".mobileLocationBar .clearLocateBtn").show()):bootbox.alert(resources.CouldNotFindCurrentLocation)})):MapComp.setUserLocation({latLng:e})}),e.preventDefault(),!1}),y(".navbar-toggle").on("click",function(){y(".myCamerasGroup").is(":visible")&&y(".UIControls .myCam").trigger("click")}),y(document).on("ChangeCursorToWait",function(){v.setOptions({draggableCursor:"wait"})}),y(document).on("ChangeCursorToDefault",function(){v.setOptions({draggableCursor:""})}),y(document).on("hideLocationMarker",function(){MapComp.isGoogle?r&&r.setVisible(!1):MapComp.clearLocationMarker()}),k.$mapping={init:function(c,a){$=new AppResize;let p=0<y(".ersLogo").length,d=0<y("#wtaMap").length;var e=URI().hasQuery("mode","trucker");y(document).trigger("adjustHeightTriggered");let u="True"==resources.MobileFirst,r=(W(u,p,d),c.DisplayPOIs&&(A="on"),c.DefaultZoom=function(e){let o="";var t=Cookies.get("map");return t&&(t=JSON.parse(t),o=t.prevMapType),MapComp.isLibre&&"google"==o&&e--,e}(c.DefaultZoom),resources.MaxZoom=parseInt(resources.MaxZoom),resources.MinZoom=parseInt(resources.MinZoom),{clustererModel:c.ClustererModel,mapTypeControlOptions:{style:S,position:B},center:MapComp.latLng(c.MapCenter.Latitude,c.MapCenter.Longitude),zoom:c.DefaultZoom,maxZoom:resources.MaxZoom,minZoom:resources.MinZoom,mapTypeId:c.MapTypeId,scaleControl:!0,zoomControl:V,zoomControlOptions:{position:x},fullscreenControl:!1,streetViewControlOptions:{position:x},gestureHandling:"greedy",disableDefaultUI:!c.DisplayControls,styles:Cookies.get("mapClrMode")?MapComp.mapModeStyles[Cookies.get("mapClrMode")](A):MapComp.mapModeStyles.light(A),displayPois:c.DisplayPOIs?"on":"off"});URI().hasQuery("maponly","true")&&(r.disableDefaultUI=!0,y(".legend-container").hide());W,u,p,d;MapComp.callback.mapDoneLoading=()=>{"undefined"!=typeof specialEvent&&specialEvent.method.setLegend(),w=new AppHelper(v,c,function(){let n={iconDetails:{},apiUrls:{},tooltipBaseUrls:{},tooltipRegular:{},tooltipSize:{},feed:{},tile:{},icon:{},filterData:{}},e=y("#layerSelection"),o=y("input[type='checkbox'][data-icon], [data-polyline]",e),t=y("input[type='checkbox'][data-feedurl]",e),a=y("input[type='checkbox'][data-tileurlformat]",e);if(o.each(function(e,o){let t=y(o);let a=t.attr("data-layerId");let r=t.attr("data-hasFilter");n.filterData[a]={layerId:a,hasFilter:r};n.apiUrls[a]=t.attr("data-jsonurl");n.tooltipBaseUrls[a]=t.attr("data-tooltipbaseurl");n.tooltipRegular[a]=t.attr("data-tooltipregular");n.tooltipSize[a]=t.attr("data-tooltipsize")!=null?t.attr("data-tooltipsize"):null;n.icon[a]={minZoom:t.attr("data-minzoom"),maxZoom:t.attr("data-maxzoom")};let i=J(t);if(i)n.iconDetails[a]=i}),t.each(function(e,o){let t=y(o);let a=t.attr("data-layerId");n.feed[a]={url:t.attr("data-feedurl"),tooltipsize:t.attr("data-tooltipsize")!=null?t.attr("data-tooltipsize"):null,clickable:t.attr("data-clickable").toLowerCase()==="true",styleOptions:t.attr("data-styleOptions"),infoWindowTemplate:t.attr("data-infoWindowTemplate"),suppressInfoWindow:t.attr("data-suppressinfowindow").toLowerCase()==="true",type:t.attr("data-type"),cacheTime:t.attr("data-cachetime")}}),a.each(function(e,o){let t=y(o);let a=t.attr("data-layerId");n.tile[a]={urlFormat:t.attr("data-tileurlformat"),minZoom:t.attr("data-minzoom"),maxZoom:t.attr("data-maxzoom"),tooltipUrlFormat:t.attr("data-tooltipurlformat"),highwayFill:t.attr("data-highwayfill"),highwayStroke:t.attr("data-highwaystroke"),animationFrames:t.attr("data-animationframes"),startingFrame:t.attr("data-startingframe"),startPlaying:t.attr("data-startPlaying")=="True",opacity:t.attr("data-opacity"),zlevel:t.attr("data-zlevel"),cache:t.attr("data-cache")=="True"}}),typeof specialEvent!=="undefined")n.tooltipSize=specialEvent.method.setTooltipWidth(n.tooltipSize);return n}()),"undefined"!=typeof specialEvent&&specialEvent.method.getAppHelper(w),L={center:Q,map:v,layerSelectorClosed:w.layerSelectorClosed,tileManager:w.tileManager,appHelper:w},w.appCookie.SetMap({zoom:r.zoom,mapType:MapComp.isLibre?"libre":"google"}),k.SetUserRegion=function(e,o){var t;e&&(t=[e[0],e[1]],L.center(t,parseInt(e[2]),o))},Modernizr.mq("(min-width: 993px)")&&"true"===resources.MapLegendDisplayByDefault&&y(".legend-toggle").trigger("click"),UserCameras=new CameraLocater(L),y(document).trigger("appInitComplete",[L,c]),a&&a(L);var e,o=y(".layerSelection .toggleButton");for(let e=0;e<o.length+2;e++){var t=".panel-collapse."+e;0<y(t).length&&!y(t).hasClass("in")&&y(t+" input[type=checkbox]").is(":checked")&&(y(t).addClass("in"),y(t).parent().find(".fa-plus-circle").removeClass("fa-plus-circle").addClass("fa-minus-circle"))}""!=resources.StateOutline&&(e=MapComp.decodePolyline(resources.StateOutline),MapComp.isGoogle?new google.maps.Polyline({path:e,strokeColor:"#00000",strokeOpacity:1,strokeWeight:1,map:v}):MapComp.addStateOutline({polyline:e,isDarkMode:E}))},MapComp.callback.maptypeid_changed=function(e){"hybrid"===v.getMapTypeId()||"satellite"===v.getMapTypeId()?(v.setOptions({styles:MapComp.mapModeStyles.light(A,!0)}),-1<(o=v.overlayMapTypes.getArray().indexOf(F))&&v.overlayMapTypes.removeAt(o),E=!1,Cookies.set("mapClrMode",E?"dark":"light")):(v.setOptions({styles:E?MapComp.mapModeStyles.dark(A):MapComp.mapModeStyles.light(A)}),j());var o=v.overlayMapTypes.getArray(),o=-1!=o.indexOf(l)?o.indexOf(l):o.indexOf(s),t="hybrid"==v.getMapTypeId()?s:l;-1!=o?"satellite"===v.getMapTypeId()?v.overlayMapTypes.removeAt(o):v.overlayMapTypes.setAt(o,t):v.overlayMapTypes.push(t)},E=!(!Cookies.get("mapClrMode")||"dark"!==Cookies.get("mapClrMode"));var i={...r,idTag:Z,bounds:[[c.RoutingModel.MapBottomLeftBounds.Longitude,c.RoutingModel.MapBottomLeftBounds.Latitude],[c.RoutingModel.MapTopRightBounds.Longitude,c.RoutingModel.MapTopRightBounds.Latitude]],mapDoneLoading:MapComp.callback.mapDoneLoading,maptypeid_changed:MapComp.callback.maptypeid_changed,isDarkMode:E},i=(v=MapComp.mountMap(i),MapComp.mapModeStyles.lightLabelsLayer(A)),t=MapComp.mapModeStyles.darkLabelsLayer(A),n=MapComp.mapModeStyles.satelliteLabels(A);let s=MapComp.StyledMapType(n),l=MapComp.StyledMapType(i,{name:"labels"});if(F=MapComp.StyledMapType(t,{name:"darkLabels"}),MapComp.addOverlayMapTypes({labelsLayerType:l}),MapComp.isGoogle&&j(),MapComp.isLibre)MapComp.setupShields(),MapComp.createControlsBox({mapContainerId:"map-canvas"}),c.DisplayControls&&MapComp.setupZoomButtons({text:{ZoomInMap:resources.ZoomInMap,ZoomOutMap:resources.ZoomOutMap}}),MapComp.setupThemeModeBtn({toggleMapMode:_,text:{ToggleDarkLightMap:resources.ToggleDarkLightMap}}),"true"===resources.EnableSaveMapView&&MapComp.setupSaveMapViewCtrl({text:{SaveMapView:resources.SaveMapView,GoToMapView:resources.GoToMapView},saveMapViewSuccessFeedback:()=>{y(".map-feedback-msg span").html(resources.SaveMapViewSuccess),y(".map-feedback-msg").show().delay(3e3).fadeOut()},goToMapViewErrorFeedback:()=>{y(".map-feedback-msg span").html(resources.GoToMapViewError),y(".map-feedback-msg").show().delay(3e3).fadeOut()}}),"True"===resources.EnableTruckerMode&&MapComp.setupTruckerModeBtn({showTruckerModeIndicator:K,text:{TruckerMode:resources.TruckerMode}});else{if(!V&&c.DisplayControls&&(n=document.createElement("div"),H(n,v),n.index=1,MapComp.MountZoomControl({zoomPos:x,zoomControlDiv:n,mapContainerId:Z})),"number"==typeof I?(i=document.createElement("div"),t=i,v,MapComp.setupThemeModeBtn({controlDiv:t,toggleMapMode:_,text:{ToggleDarkLightMap:resources.ToggleDarkLightMap}}),v.controls[I].push(i)):(n=document.createElement("div"),mobileToggleMapModeControl(n,v),v.controls[x].push(n),MapComp.EventAddDomListener(n,"click",_)),"true"===resources.EnableSaveMapView&&(t=document.createElement("div"),SaveMapViewControl(t,v),t.index=1,v.controls[x].push(t)),c.DisplayControls){i=document.createElement("div");{var n=i;var m=v;n.className="locateMeContainer customMapCtrl";let e=document.createElement("button"),o=(e.className="locateMeBtn btn btn-default",e.setAttribute("id","locateMeBtn"),e.setAttribute("type","button"),e.setAttribute("title",resources.CurrentLocation),e.setAttribute("aria-label",resources.CurrentLocation),document.createElement("i"));o.className="fas fa-crosshairs",o.setAttribute("aria-hidden","true"),o.setAttribute("title",resources.CurrentLocation),e.appendChild(o),n.appendChild(e),e.addEventListener("click",function(){if(k.GetUserGeolocation==undefined){let e=new UserGeolocation(null,null,null,null,null)}k.GetUserGeolocation(function(e){m.panTo(e);y(document).trigger("removeMyLocationMarker");T=new google.maps.Marker({position:e,map:m,title:resources.CurrentLocation,icon:{url:"Content/images/locationDot.png",size:new google.maps.Size(24,24)}});let o=m.getZoom();m.setZoom(12<o?o:12)})}),y(document).on("removeMyLocationMarker",function(){if(T)T.setMap(null)})}v.controls[P].push(i)}if("true"===resources.EnableToggleFullScreenMapBtn){var t=document.createElement("div");{n=t;v;n.className="toggleFullScreenMapContainer customMapCtrl";let e=document.createElement("button"),o=(e.className="toggleFullScreenMapBtn btn btn-default",e.setAttribute("id","toggleFullScreenMapBtn"),e.setAttribute("type","button"),e.setAttribute("title",resources.ToggleFullscreen),e.setAttribute("aria-label",resources.ToggleFullscreen),document.createElement("i"));o.className="far fa-arrows-alt",o.setAttribute("aria-hidden","true"),o.setAttribute("title",resources.ToggleFullscreen),e.appendChild(o),n.appendChild(e),e.addEventListener("click",function(){if(Modernizr.mq("(min-width: 993px)")){y(".navbar, .scrollRow, footer").toggle();y(document).trigger("fullScreenMapMode")}})}v.controls[z].push(t)}if("True"!==resources.EnableTruckerMode||p)Cookies.remove("_truckerMode");else{i=document.createElement("div");e&&Cookies.set("_truckerMode",!0);{n=i;v;n.className="truckerModeContainer customMapCtrl";let e=document.createElement("button"),o=(e.className=Cookies.get("_truckerMode")?"truckerModeBtn btn btn-default active":"truckerModeBtn btn btn-default",e.setAttribute("id","truckerModeBtn"),e.setAttribute("type","button"),e.setAttribute("title",resources.TruckerMode),e.setAttribute("aria-label",resources.TruckerMode),e.setAttribute("tabindex",0),document.createElement("i")),t=(o.className="far fa-truck-moving",o.setAttribute("aria-label","true"),document.createElement("span"));t.innerHTML=resources.TruckerMode,o.setAttribute("aria-hidden","true"),o.setAttribute("title",resources.TruckerMode),e.appendChild(o),e.appendChild(t),n.appendChild(e),e.addEventListener("click",function(){let e=y(".truckerModeBtn").hasClass("active");if(e){Cookies.remove("_truckerMode");K(false)}else{Cookies.set("_truckerMode",true);K(true)}y(".truckerModeBtn").toggleClass("active")})}v.controls[D].push(i)}}"True"==resources.EnableNearby511Kml&&!p&!d&&(t={clickable:!0,suppressInfoWindows:!0,preserveViewport:!0,map:v},e=Cookies.get("_culture"),n=MapComp.setNearbyKml({culture:e,url:URI(resources.Nearby511Kml).addSearch("t",roundDate(moment(),5).unix()).addSearch("lang",e).toString(),kmlOptions:t}),MapComp.isGoogle)&&n.addListener("click",function(e){w.showInfoWindow(e.featureData.description,null,!0,e.latLng,"Nearby511",!0,!1,MapComp.mapSize(0,-32))});function g(e,o){(e||o)&&(y(".mobileSetting").show(),y(".legend-toggle").show(),y(".bootbox").is(":visible")||y("#layerSelection").hide())}function M(){return{mapTypeControlOptions:{style:S,position:B},zoomControlOptions:{position:x},streetViewControlOptions:{position:x}}}i=navigator.userAgent.toLowerCase();const C=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(i);function o(){if("Android"!==getMobileOs()){if(p=0<y(".ersLogo").length,d=0<y("#wtaMap").length,y(k).outerWidth()<993?(0<y(".draggableWindowContainer").length&&y(document).trigger("closeDraggableWindow"),!u||p||d?g(d,p):(y("body").addClass("mobileFirst"),y(".mobileSetting").hide(),y("#layerSelection").hide(),y(".closeSideBar").is(":visible")&&y(".closeSideBar").trigger("click"),y(".showSideBar").is(":visible")?y(".mobileLocationBar").hide():y(".mobileLocationBar").is(":visible")||y(".mobileLocationBar").show(),y(".myCamerasContainer").appendTo(".myCamerasGroup")),C||y("footer").hide(),q()):(0<y("body.mobileFirst").length&&(y("body").removeClass("mobileFirst"),"True"!=resources.EnableLocationSearchBar?(y(".showSideBar").is(":visible")||y(".showSideBar").trigger("click"),y(".mobileLocationBar").is(":visible")&&y(".mobileLocationBar").hide()):"true"===resources.OpenDesktopRoutePlannerDefault.toLowerCase()||"#:MyRoutes"==k.location.hash.substr(0)||-1!==k.location.hash.indexOf("#route")?y(".myRouteBtn").trigger("click",[!0]):(O.hide(),y("#sideBar").hide())),y(".mobileSetting").show(),(e=y(".myCamerasGroup")).is(":visible")&&e.hide(),null!=e.html()&&0<e.html().trim().length&&y(".myCamerasGroup .myCamerasContainer").appendTo(".myCamerasRoutePlanner"),y("footer").is(":visible")||p||y("footer").show()),MapComp.isLibre)return;var e=B,o=P,t=D;if(W(u,p,d),e!=B){y(".zoomControlContainer").length<1&&!V&&c.DisplayControls&&(e=document.createElement("div"),H(e,v),e.index=1,MapComp.MountZoomControl({zoomPos:x,zoomControlDiv:e,mapContainerId:Z}));var a,r=v.controls[o].getArray();for(a in r)if("locateMeContainer"==y(r[a]).attr("class")){var i=v.controls[o].getAt(a);v.controls[o].removeAt(a),v.controls[P].push(i);break}var n,s=v.controls[t].getArray();for(n in s)if("truckerModeContainer"==y(s[n]).attr("class")){var l=v.controls[t].getAt(n);v.controls[t].removeAt(n),v.controls[D].push(l);break}e=M();e.zoomControl=V,v.setOptions(e)}}MapComp.isGoogle&&($.checkRightBtmCtrls(),$.checkTopCenterCtrls(v,U,N,M)),clearTimeout(k.resizedFinished),k.resizedFinished=setTimeout(function(){y("#routingResults").is(":visible")&&y(document).trigger("checkEventOnRoutePlanner",["windowResize"])},250)}if(o(),MapComp.EventAddDomListener(k,"resize",o),MapComp.isGoogle){let t=v.getStreetView(),a=y("#backToMapView");MapComp.EventAddDomListener(t,"visible_changed",function(){var e=y(".mobileLocationBar").is(":visible")?y(".mobileLocationBar, .myRouteBtn"):null;let o=p?y(".locationBar, #ERS_LocationBar_Info"):e;null==o&&(o=y(".showSideBar").is(":visible")?y(".showSideBar, .locationBtn"):y(".sideBarColContainer, .locationBtn")),t.getVisible()?(t.setOptions({enableCloseButton:!1,fullscreenControl:!1}),a.show(),o.hide(),y(".showSideBar").addClass("streetViewTop"),y(".mobileFirst.sideBarGroup.showSideBar").addClass("streetViewTop")):(a.hide(),o.show(),y(".showSideBar").removeClass("streetViewTop")),y(a).on("click",function(){t.setVisible(!1)}),Modernizr.mq("(min-width: 993px)")&&(e=y(".locationBtn.shiftLeft")).is(":visible")&&y(".sideBarColContainer").is(":visible")&&e.removeClass("shiftLeft")})}let h=!1,b=!1,f;e=y("#avoidTollsCheckBox"),e&&(null!=(f=Cookies.get("map"))&&(h=G("AvoidTolls",f)),e.attr("checked",h)),t=y("#avoidFerriesCheckBox"),t&&(null!=(f=Cookies.get("map"))&&(b=G("AvoidFerries",f)),t.attr("checked",b)),Modernizr.mq("(max-width: 992px)")?u&&"#:MyRoutes"==k.location.hash.substr(0)&&y(".UIControls .directions").click():"true"===resources.OpenDesktopRoutePlannerDefault.toLowerCase()||"#:MyRoutes"==k.location.hash.substr(0)||-1!==k.location.hash.indexOf("#route")?y(".myRouteBtn").trigger("click",[!0]):(O.hide(),y("#sideBar").hide()),n=getMobileOs();"unknown"!=n&&(y(".printRoute").hide(),"iOS"==n&&y(".twitter.newsContent").addClass("isIos"),"Android"==n)&&y("#ersRegion-Combobox .bs-searchbox, #mobileErsRegion-Combobox .bs-searchbox").hide(),q(),g(d,p),"True"==(R=resources.EnableTruckerMode)&&(Cookies.get("_truckerMode")?K(!0):K(!1)),0<y("#routeOptions-toggle input[type='checkbox']:checked").length&&0==y("#routeOptions-toggle.in").length&&y("#routeOptions").click(),y(".clearAll").click(function(){y(".mapLegend input[type=checkbox]:checked").not(".mapLegend ul input[type=checkbox]").not("#LegendTopCheckbox").trigger("click")})},map:function(){return v}}}($,window),$(window).on("load",function(){$("body").hasClass("mobileFirst")&&0<!$(".ersLogo").length&&$(".featureModal").on("shown.bs.modal",function(){$(".bootbox").is(":visible")&&$(".featureModal").modal("hide")})}),$(document).on("show.bs.modal",".modal",function(){const e=1040+10*$(".modal:visible").length;$(this).css("z-index",e),setTimeout(()=>$(".modal-backdrop").not(".modal-stack").css("z-index",e-1).addClass("modal-stack"))});
var AppCookie=function(e,o){var t={},i={selectedLayers:null,prevZoom:null,prevLatLng:null,mapView:null,prevMapType:null};let n="map";"undefined"!=typeof specialEvent&&(n=window.location.pathname.replaceAll("/","").toLowerCase());function a(){var e=JSON.stringify(i);Cookies.set(n,e,{expires:365,path:"/"})}return getCookie=function(){var e=Cookies.get(n);return i=e?JSON.parse(e):i},t.getCookie=getCookie,t.SetLayer=function(o,e){e&&-1==i.selectedLayers.indexOf(o)?i.selectedLayers.push(o):e||(i.selectedLayers=$.grep(i.selectedLayers,function(e){return e!=o})),a()},t.SetMap=function({latitude:e,longitude:o,zoom:t,mapType:n}){e&&o&&(i.prevLatLng=[e,o]),t&&(i.prevZoom=t),i.mapView=moment.utc(),n&&(i.prevMapType=n),a()},t.RestoreCheckboxes=function(t,e){$(i.selectedLayers).each(function(e,o){t(o)}),e&&e()},$("#avoidTollsCheckBox").on("change",function(){var e=$("#avoidTollsCheckBox").is(":checked");i.AvoidTolls=e,a()}),$("#avoidFerriesCheckBox").on("change",function(){var e=$("#avoidFerriesCheckBox").is(":checked");i.AvoidFerries=e,a()}),function(){i=this.getCookie(),null===(i="undefined"!=typeof specialEvent?specialEvent.method.setCookieSelectedLayers(i):i).selectedLayers&&(i.selectedLayers=[]),"undefined"==typeof specialEvent&&(i.selectedLayers=e.SelectedLayers)}(),t};
var AppEventBinding=function(r){var c=768,e=($(document).on("appInitComplete",()=>{var e=new URL(window.location),e=new URLSearchParams(e.search);e.has("hiderouteplanner")&&"true"===e.get("hiderouteplanner")?$(".hideSideBar").click():e.has("hiderouteplanner")&&"true"!==e.get("hiderouteplanner")&&$(".showSideBar").click(),e.has("hidelegend")&&"true"===e.get("hidelegend")?$("#layerSelection").hide():e.has("hidelegend")&&"true"!==e.get("hidelegend")&&$("#layerSelection").show()}),function(){var e=$("#layerSelection");$("input[type='checkbox']",e).bind("click.layerSelectorCheckboxes_desktopMode",function(){r.layerToggled($(this).attr("data-layerid"),!1)})}),t=function(){var e=$("#layerSelection");$("input[type='checkbox']",e).on("change.layerSelectorCheckboxes_mobileMode",function(){r.layerToggled($(this).attr("data-layerid"),!1)})},o=function(e,t){var o,a=0<$(".ersLogo").length,a=0<$(".mobileFirst").length&&!a,i=0<$(".wtaPage").length,l=$(window).outerWidth(),n=$("#layerSelection");"none"==n.css("display")?((c="768"!==resources.ScreenWidthERSLegend?parseInt(resources.ScreenWidthERSLegend):c)<l?(n.attr("class","layerSelection"),$("#legend-container").append(n.detach()),$(".mobileSetting").show()):a?($(".mobileFirst .mobileSetting").show(),n.attr("class","layerSelection"),$("#legend-container").append(n.detach()),i?$(".mobileSetting").addClass("show"):(l=$(".legend-container").outerHeight()+20,adjustLegendHeight(l))):(n.attr("class","layerSelectionModal"),o=n.detach(),bootbox.mapPageDialog({message:" ",animate:!1,closeButton:!1,buttons:{main:{label:resources.OK,className:"btn-info",container:".map-container",callback:function(){t.trigger("click"),$("#legend-container").append(o),r.layerSelectorClosed(!0)}}}}),bootbox.setDialogToJqueryObj(o.show())),"block"==$(".mapFiltersContainer").css("display")&&$(".layerSelection").addClass("expand"),n.show(),e.preventDefault()):(e.preventDefault(),n.hide(),a&&0===$("#embedmap").length&&window.innerWidth<992&&$(".mobileFirst .mobileSetting").hide(),i&&$(".mobileSetting").removeClass("show"))},a=$(".locationBtn");let l=(e,t)=>{e=Array.from(e.querySelectorAll("label>input"));t?e.forEach((e,t)=>{(!e.checked&&0===t||0<t&&e.checked)&&e.click()}):e.forEach(e=>{e.checked&&e.click()})};$(".hideSideBar").click(function(){$(".mapPage .sideBarColContainer").hide(),$(".guideIcon").hide(),$(".mapColContainer").toggleClass("full"),0<a.length&&a.addClass("shiftLeft"),$(".showSideBar").show(100),r.resizeMap()}),$(".showSideBar").click(function(){$(".showSideBar").hide(100),0<a.length&&a.removeClass("shiftLeft"),$(".mapPage .sideBarColContainer").show(),$(".guideIcon").show(),$(".mapColContainer").toggleClass("full"),r.resizeMap()}),$(".closeSideBar, .locationBtn").on("click",function(){$(document).trigger("clearUserRouteTrigger"),0<a.length&&(a.hide(),a.removeClass("shiftLeft")),$(".showSideBar").hide(),$(".mapPage .sideBarColContainer").hide(),$(".mapColContainer").toggleClass("full"),$(".mobileLocationBar, .myRouteBtn").show(),$("#mapLocation").val("").focus(),r.resizeMap()});var i=$(".legend-toggle"),n=$(".settingToggle"),n=($(window).outerWidth()>c?e():t(),$(i).on("click",function(e){o(e,i)}),$(n).on("click",function(e){o(e,null)}),n=$("#layerSelection"),$("input[type='checkbox'][data-layerid]",n).bind("click.layerSelectorCheckboxes_cookie",function(){r.appCookie.SetLayer($(this).attr("data-layerid"),$(this).is(":checked"))}),MapComp.updateMapCookie({setMapZoomAndCenterCookie:e=>{r.appCookie.SetMap({latitude:e.lat,longitude:e.lng,zoom:e.zoom,mapType:e.mapType})},map:r.map}),document.querySelector("#layerSelection").querySelectorAll("input[type='checkbox'][data-icon],input[type='checkbox'][data-feedurl],input[type='checkbox'][data-tileurlformat]").forEach(function(e){var t=e.dataset.layerid;let i=document.querySelector("ul#"+t+"-children");i&&e.addEventListener("change",function(){var e=this.checked,t=this.dataset.dontselectchildlayers;if(null!=t&&"true"===t.toLowerCase())l(i,e);else for(var o of i.children){o=o.querySelector("label>input");(e&&!o.checked||!e&&o.checked)&&o.click()}var a,t=i.querySelectorAll("li>label>input");i.hidden=!0;for(a of t)e?"True"==a.dataset.visible&&(a.hidden=!1,i.hidden=!1):a.hidden=!0})}),$("#embedmap")),e=$("#accessServicesMap");0<!n.length&&0<!e.length?r.appCookie.RestoreCheckboxes(function(e){var t=document.querySelector("#layerSelection").querySelector("input[type='checkbox'][data-layerid='"+e+"']:not(:disabled)");t&&(t.checked=!0,t.dispatchEvent(new Event("change"))),0<$("ul#"+e+"-children").children(":visible").length&&$("ul#"+e+"-children").toggle(!0)},function(){r.layerSelectorClosed(!0)}):r.layerSelectorClosed(!0)};
let AppHelper=function(u,e,o){let E=o.iconDetails,F=o.apiUrls,s=o.tooltipBaseUrls,H=o.tooltipRegular,m=o.tooltipSize,f=o.feed,V=o.tile,d=o.icon,c=new Hashtable,t,n,r,i=!1,B=e=>{i=e},p,g,y,h,C,N=(MapComp.isGoogle&&(C=new google.maps.InfoWindow({maxWidth:365})),'<div id="infoWindowLoading">'+resources.Loading+"</div>"),M,w={},j,a,v={},k,l;function G(e){$("input[type='checkbox'][data-layerid]","#layerSelection").each(function(e,o){U($(o).attr("data-layerid"),!0)}),Y(e,!0)}function U(a,r){let e=$("#layerSelection");function o(e,o,t){if(e=$(e),c.containsKey(a)||c.put(a,!1),e.is(":checked")){if(0==c.get(a)){if(c.put(a,!0),o(),e.attr("data-conflicts")){var n=e.attr("data-conflicts").split(",");for(let e=0;e<n.length;e++)$("input[type='checkbox'][data-layerid='"+n[e]+"']:checked",$("#layerSelection")).click()}r||"undefined"==typeof ga||ga("send","event","MapLayer",a),$(document).trigger("mapLayerToggle",[a,!0])}}else 1==c.get(a)&&(c.put(a,!1),t(),$(document).trigger("mapLayerToggle",[a,!1]))}var t;let n=$('input[type="checkbox"][data-layerid="'+a+'"]',e),i="true"===n[0].dataset.hasmapicons,l="true"===n[0].dataset.polylinetooltip;0<n.length&&(t=n[0].parentNode.parentNode.parentNode,n[0].checked)&&t.classList.contains("TopLegendSection")&&"none"===t.style.display&&(t.style.display="block",document.getElementById("LegendTopCheckbox").checked=!0),n.is('[data-polyline="true"]')?o(n[0],function(){y.AddPolylineLayer(a,[],$(n[0]).data("polylineopacity"),$(n[0]).data("polylineweight"),$(n[0]).data("polylinezindex"),0,20,function(i,e,o){I(a,o,e).done(function(e){if(MapComp.isLibre)MapComp.addMarkersOrLines({data:e,layerId:a,polylineTooltip:l});else if(MapComp.isGoogle){var o,t=[],n=e.item2;for(o in n)if(n[o].polyline){let e=null;if(n[o].polyline.symbolJSON&&(e=JSON.parse(n[o].polyline.symbolJSON)),n[o].polyline.paths)for(var r=0;r<n[o].polyline.paths.length;r++)t.push({id:n[o].itemId,lineColor:n[o].polyline.color,decodedPoints:google.maps.geometry.encoding.decodePath(n[o].polyline.paths[r]),icons:e});else t.push({id:n[o].itemId,lineColor:n[o].polyline.color,decodedPoints:google.maps.geometry.encoding.decodePath(n[o].polyline.path),icons:e})}i(t,l)}})},v[a],!!n.is("[data-icon]")),$(document).on("layerRefreshed-polylineManager."+a,function(e,o){o==a&&($(document).off("layerRefreshed-polylineManager."+a),i)&&(p.AddIconLayer(a,[],I,function(r,i){let a=J(r,i);return i.polyline&&a.addListener("marker-clustered",function(e){var o,t=y.GetPolylines(r);for(o in t){var n=t[o];if(n.sourceData.id==i.itemId){a.clustered?(n.gMapLine.setMap(null),n.gMapLine.canDraw=!1):(n.gMapLine.setMap(u),n.gMapLine.canDraw=!0);break}}}),a},v[a],d[a]),p.RefreshLayer(a).done(p.Redraw))}),y.RefreshLayer(a),$("#legend-icon-"+a,e).toggle(!0)},function(){y.RemovePolylineLayer(a),p.RemoveIconLayer(a),r||p.Redraw(),$(document).off("layerRefreshed-polylineManager."+a),$("#legend-icon-"+a,e).toggle(!1),a==k&&W()}):i?o(n[0],function(){p.AddIconLayer(a,[],I,J,v[a],d[a]),r||p.RefreshLayer(a).done(p.Redraw),$("#legend-icon-"+a,e).toggle(!0)},function(){0==T.indexOf(a)&&(T=""),p.RemoveIconLayer(a),$("#legend-icon-"+a,e).toggle(!1),r||p.Redraw(),a==k&&W()}):n.is("[data-feedurl]")?o(n[0],function(){h.AddLayer(a,f[a]),$("#legend-feed-"+a,e).toggle(!0)},function(){a==k&&(x()||CTVars.tooltipOpen)&&W(),h.RemoveLayer(a),$("#legend-feed-"+a,e).toggle(!1)}):n.is("[data-tileurlformat]")&&o(n[0],function(){g.AddTileLayer(a,V[a]),$("#legend-tile-"+a,e).toggle(!0)},function(){g.RemoveTileLayer(a),a==k&&(x()||CTVars.tooltipOpen)&&W(),$("#legend-tile-"+a,e).toggle(!1)})}function _(e,o){return o.icon.json?JSON.parse(o.icon.json):o.icon?{url:(o=o.icon).url,size:new google.maps.Size(o.size[0],o.size[1]),anchor:new google.maps.Point(o.anchor[0],o.anchor[1]),origin:new google.maps.Point(o.origin[0],o.origin[1]),scaledSize:new google.maps.Size(o.size[0],o.size[1])}:E[e]}let I=function(e,o,t){var n={type:"GET",url:F[e],dataType:"json",timeout:3e4,tryCount:0,retryLimit:3,error:function(e,o,t){"timeout"==o&&(this.tryCount++,this.tryCount<=this.retryLimit)&&$.ajax(this)}};return null!=t&&(n.type="POST",n.data=JSON.stringify(t.getFilter()),n.contentType="application/json",n.url+="?time="+$.now()),r.Get(e,.5,n,o)},J=function(r,i){var e=new google.maps.LatLng(i.location[0],i.location[1]);let a=new google.maps.Marker({clickable:i.icon.isClickable,position:e,title:i.title,zIndex:i.zindex,preventClustering:i.icon.preventClustering});var o,t,n,l,e=_(r,i);return e&&a.setIcon(e),google.maps.event.addListener(a,"spider_format",function(e){var o,t=_(r,i),n=e==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIED?t.url:e==OverlappingMarkerSpiderfier.markerStatus.SPIDERFIABLE?null==(n=t.url)?null:(o=(n=n.split("/")).splice(n.length-1,1)[0],n.join("/")+"/plus/"+o):e==OverlappingMarkerSpiderfier.markerStatus.UNSPIDERFIABLE?t.url:null;t&&(t.url=n,a.setIcon(t))}),""!=s[r]&&(t=a,n=i,l=r,google.maps.event.addListener(t,"spider_click",function(e){let o=!0;"true"===resources.TooltipDisplayOnHover&&(b?o=!1:(b=!0,setTimeout(()=>{b=!1},500))),o&&(O(l,n.itemId,t),$(document).trigger("marker-click",[w,l,n.itemId,t]))}),"true"===resources.TooltipDisplayOnHover)&&(o=a,google.maps.event.addListener(o,"mouseover",function(e){L=setTimeout(function(){google.maps.event.trigger(o,"click")},500)}),google.maps.event.addListener(o,"mouseout",function(){L&&clearTimeout(L)})),a},b=!1,L,S=null,T="",O=function(o,e,t,n,r){let i=o+e;var a,l;x()&&i===T||($(document).trigger("closeDraggableWindow"),x()&&W(),T=i,"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),K(),$(document).trigger("cameraImagesClearIntervals"),a=Cookies.get("_culture")?Cookies.get("_culture"):"",a=URI.expand(s[o],{layerId:o,id:e,lang:a}).toString(),l=$(window).width()<768,isRegular="true"==H[o]&&!l,D(N,t,!0,n,o,!1,void 0,r||void 0),$(document).trigger("ShowInfoWindow",[w,o,e,t,n]),$.ajax({url:a,success:function(e){T==i&&D(e,t,!1,n,o,!isRegular,void 0,r||void 0)}}))},R=new CenterTooltip(u),q=(R.startTriggers(),window.centerTooltip=R,$(document).on("info-content-trigger",(e,o,t,n)=>{o===resources.MessageSignsLayerId&&q(),void 0!==t&&(-1==t.indexOf("cctvImage")&&-1==t.indexOf("cctvCameraCarousel")||$(document).trigger("cameraImagesInitialized",[T]),-1!=t.indexOf("data-convert-from-utc"))&&$(document).trigger("update-time-to-locale");o=$("#detourCollapse"),o[0]&&arrowDirection.setTooltip(o[0]),t=document.querySelector(".map-tooltip .slick-track"),o=document.querySelector(".map-tooltip .singleCamTd");t&&$(document).trigger("setup-fullscreen-img-modal",[t,"multiCam"]),o&&$(document).trigger("setup-fullscreen-img-modal",[o,"singleCam"]),applyDetourArrowIcon(),R.run(n)}),$(document).on("center-tooltip",()=>{R.run()}),$(document).on("update-time-to-locale",function(){$("[data-type='time']").each(function(e,o){var o=$(o),t=o.html(),t=moment.utc(t).local().format("M/D/YYYY h:mm A");o.html(t)})}),function(){clearInterval(S),1<$(".msgContent div").length&&(S=setInterval(function(){var o=$(".msgContent").children(),t=o.length;let n=!1;for(let e=0;e<t;e++)if($(o[e]).hasClass("hide")){if(1==n){$(o[e]).toggleClass("hide"),n=!1;break}}else $(o[e]).toggleClass("hide"),n=!0;1==n&&$(o[0]).toggleClass("hide")},2500))}),K=function(){clearInterval(S),S=null},Y=(MapComp.isGoogle&&google.maps.event.addListener(C,"closeclick",function(){W(),R.tooltipClosed()}),$(document).on("layer-changed",function(e,o){"MyCameras"==o&&r.Remove(o),p.RefreshLayer(o,!0).done(p.Redraw),y.RefreshLayer(o,!0)}),function(e,o){e||loadBlockerApi.showSpinner("refreshMapData");let t=0;$(document).on("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper",function(){2==++t&&(loadBlockerApi.hideSpinner("refreshMapData"),$(document).unbind("markerClustererRepainted.appHelper layersRefreshed-polylineManager.appHelper"))}),$(document).on("layersRefreshed-iconManager.appHelper",function(){p.Redraw(),$(document).unbind("layersRefreshed-iconManager.appHelper")}),p.RefreshLayers(),y.RefreshLayers(),o||g.RefreshLayers(),h.Refresh(f)}),Z=function(e){e||loadBlockerApi.showSpinner("repaintMap");let o=0;$(document).on("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper",function(){2==++o&&(loadBlockerApi.hideSpinner("repaintMap"),$(document).unbind("mapChangedFinished-polylineManager.appHelper markerClustererRepainted.appHelper"))}),p.MapChanged(),p.Redraw(),y.MapChanged()};let Q=function(){return!bootbox.isOpen()&&!i},x=function(){return!!C.getMap()};const X=new DOMParser;MapComp.callback.showTooltipContent=(e,o,t)=>{e=X.parseFromString(e,"text/html");CTVars.tooltipOpen&&R.closeTooltip(),CTVars.tooltipContainer=e.getElementsByTagName("body")[0].firstChild,document.getElementById("map-canvas").appendChild(CTVars.tooltipContainer),R.tooltipOpened(o,CTVars.tooltipContainer,t),MapComp.startMonitoringMapMoves()};function D(t,n,r,i,a,l,s,d){if(R.tooltipOpened(),l&&(l=!0,document.querySelector(".closeDraggableWindow"))&&""!==t&&$(document).trigger("closeDraggableWindow"),(k=a)&&""!==t){var c="iOS"==getMobileOs();let e=m[a]&&0<m[a].length?parseInt(m[a]):365;var p,g,c=992<$(window).width()&&!c;let o=C;if(f[a]&&f[a].tooltipsize&&(e=parseInt(f[a].tooltipsize),d=30),l&&c?(C.close(),p=CreateDraggableInfoWindow(M,d),g=null!=n?n:new google.maps.Marker({position:i}),(M=new p(u,g,a,t,e,function(){t&&""!=t&&$(document).trigger("info-content-trigger",[a,t])},d)).position=g.position,M.content=t,o=M):(google.maps.event.addListenerOnce(C,"domready",function(){t&&(r?R.run(o):$(document).trigger("info-content-trigger",[a,t,o]))}),C.setContent(t)),bootbox.setDialogContent(t),$(document).trigger("info-content-trigger",[a,t]),o.maxWidth=e,r)c?(n||s?l?(C.close(),o.position=null!=i?i:n.position):C.setOptions({position:i,pixelOffset:{height:0}}):(d=d||{height:-32},C.setOptions({position:i,pixelOffset:d})),n&&n.latLngs?(C.setOptions({position:new google.maps.LatLng(n.defaultPosition.lat(),n.defaultPosition.lng())}),C.open(u)):l||($(document).trigger("closeDraggableWindow"),C.open(u,n)),a===resources.MessageSignsLayerId&&$(document).trigger("MsgSignMapTooltipTriggered")):bootbox.isOpen()||bootbox.mapPageDialog({message:t,animate:!1,buttons:{main:{label:resources.OK,className:"btn-info"}}});else if(x()){let e=$(".map-tooltip table img:not(.agencyLogo)"),o=T;e.length?e.on("load",function(){o==T&&(C.open(u,n),e.off("load"))}):C.open(u,n)}else l||t&&""!=t&&$(document).trigger("info-content-trigger",[a,t])}}let P=null,W=(MapComp.callback.setMapTooltip=o=>{k=o.layer,CTVars.markerPoint=o.latLng;var e=Cookies.get("_culture")?Cookies.get("_culture"):"en",e=URI.expand(s[o.layer],{layerId:o.layer,id:o.id,lang:e}).toString(),t="iOS"==getMobileOs();let n=992<$(window).width()&&!t,r;n?(r=m[o.layer]&&0<m[o.layer].length?parseInt(m[o.layer]):365,t=MapComp.setFinalTooltipContent(`<div style="text-align: center;">${resources.Loading}</div>`,400),MapComp.callback.showTooltipContent(t,o.location),R.run()):(bootbox.closeMapPageDialog(),bootbox.setDialogContent(`<div style="text-align: center;">${resources.Loading}</div>`)),P=$.ajax({url:e,beforeSend:function(){null!=P&&P.abort()},success:function(e){n?(e=MapComp.setFinalTooltipContent(e,r),MapComp.callback.showTooltipContent(e,o.location)):bootbox.isOpen()||bootbox.mapPageDialog({message:e,animate:!1,buttons:{main:{label:resources.OK,className:"btn-info"}}}),$(document).trigger("info-content-trigger",[o.layer,e]),$(document).trigger("ShowInfoWindow",[o.ShowInfoWindow,o.layer,o.id])}}),$(document).trigger("marker-click",[void 0,o.layer,o.id])},function(){MapComp.isLibre&&(R.closeTooltipClick(),MapComp.removeEventShapes()),"True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),$(document).trigger("closeDraggableWindow"),MapComp.isGoogle&&C.close(),T="",$(document).trigger("info-window-close"),R.tooltipClosed()});$(document).on("callCloseInfoWindow",W);w.map=u,w.resizeMap=function(){MapComp.isGoogle&&google.maps.event.trigger(u,"resize")},w.isLayerIdChecked=function(e){return $('input[type="checkbox"][data-layerId="'+e+'"]').is(":checked")},w.layerSelectorClosed=G,w.layerToggled=U,w.showInfoWindow=D,w.showInfoWindowForItem=O,w.closeInfoWindow=W,w.clearInfoWindowId=function(){T=""},w.centerTooltip=R;var ee=o.filterData;for(A in ee){var z,A=ee[A];"True"==A.hasFilter&&"undefined"!=typeof FilterDataTableParams&&((z=new FilterDataTableParams(1,0,25,!0,null)).search=new FilterDataTableSearchParam,z.search.objValue=null,z.search.regex=!1,z.search.searchOnColumn=!1,z.search.value=null,z.order[0]=new FilterDataTableOrderParam,z.order[0].column=0,z.order[0].dir="asc",(z=new ColumnFilters("map-filter-div",A.layerId,"List/UniqueColumnValuesForErsEvents/{typeId}",z)).initListColumnFilters(),v[A.layerId]=z)}MapComp.isGoogle&&(l=new OverlappingMarkerSpiderfier(u,{markersWontMove:!1,markersWontHide:!1,keepSpiderfied:!0,nearbyDistance:10}),n={maxZoom:e.ClustererModel.MaximumZoom,minimumClusterSize:e.ClustererModel.MinimumClusterSize,gridSize:e.ClustererModel.GridSize,title:resources.AClusterOfIcons,imagePath:"/Content/images/markerClustererPlus/m"},(t=new MarkerClusterer(u,[],n,l)).setCalculator(function(e,o){let t=0;e=e.length.toString();let n=e;for(;0!==n;)n=parseInt(n/10,10),t++;return 3==t&&(t=2),resources.MarkererIndexOveride&&(t=resources.MarkererIndexOveride),{text:e,index:t=Math.min(t,o),title:""}})),r=new AjaxCache,p=new IconManager(u,t),w.iconManager=p,g=new TileManager(u,w),w.tileManager=g,y=new PolylineManager(u,w.showInfoWindowForItem),$(document).trigger("polylineManagerReady-appHelper",[y,O]),h=new KmlManager(u,w),w.kmlManager=h,a=new AppCookie(e,function(){let e=$("input[type='checkbox'][data-layerid]",$("#layerSelection"));return $.makeArray(e.map(function(){return $(this).attr("data-layerid")}))}()),j=new AppEventBinding((w.appCookie=a,w.layerSelectorClosed=G,w));{let o={timer:null,refreshData:!1},e=function(e){e&&(o.refreshData=e),clearTimeout(o.timer),o.timer=setTimeout(function(){(o.refreshData?Y:Z)(!0),o.timer=null,o.refreshData=!1},300)};setInterval(function(){Q()&&e(!0)},61e3),MapComp.setMapEvents({closeInfoWindow:W,delayRefresh:e,setMapBeingDragged:B,noPanOffEarth:noPanOffEarth,map:u})}return $(document).trigger("appHelperInitComplete"),w};
window.resizeVars={isEmbedded:void 0,initalLoadOnMobile:!1,state:{mobile:!1,desktop:!1},initialStackDone:!1};class AppResize{constructor(){resizeVars.isEmbedded=0<$("#embedmap").length,"RIGHT_BOTTOM"===resources.MapControlPos&&$("#legend-container").addClass("legendMovedLeft"),window.innerWidth<=992?(resizeVars.initalLoadOnMobile=!0,"RIGHT_BOTTOM"===resources.MapControlPos&&this.stackMapControlsOnMobile()):"RIGHT_BOTTOM"===resources.MapControlPos&&(this.stackMapControlsOnDesktop(),this.checkRightBtmCtrls())}tryAgain(e,t){setTimeout(()=>{++e<10?t.call(this,e):console.warn("Could not find element to resize")},200)}checkRightBtmCtrls(){"RIGHT_BOTTOM"===resources.MapControlPos&&(992<window.innerWidth&&!resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&this.setBtmRtCtrlsOnDesktop(),window.innerWidth<=992&&resizeVars.initalLoadOnMobile&&!resizeVars.state.mobile&&this.setBtmRtCtrlsOnMobile(),992<window.innerWidth&&resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&this.reuseBtmRtMobileControlsOnDesktop(),resizeVars.isEmbedded)&&(this.fixEmbeddedCtrlStack(),this.addEmbeddedCtrlClass())}checkTopCenterCtrls(e,t,s,o){"TOP_CENTER"===resources.MapControlPos&&(992<window.innerWidth&&resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&(t(),e.setOptions(o()),this.reuseMobileControlsOnDesktop()),window.innerWidth<=992&&resizeVars.initalLoadOnMobile&&!resizeVars.state.mobile&&(resizeVars.isEmbedded?this.addEmbeddedCtrlClass():(s(),e.setOptions(o()),this.reuseMobileControlsOnMobile())),window.innerWidth<=992&&!resizeVars.initalLoadOnMobile&&!resizeVars.state.mobile&&(s(),e.setOptions(o()),this.reuseDesktopControlsOnMobile()),992<window.innerWidth)&&!resizeVars.initalLoadOnMobile&&!resizeVars.state.desktop&&(t(),e.setOptions(o()),resizeVars.state.desktop=!0,resizeVars.state.mobile=!1)}stackMapControlsOnMobile(t=0){setTimeout(()=>{var e;resizeVars.initialStackDone||(0<(e=$(".gm-svpc")).length?(resizeVars.isEmbedded?this.stackEmbeddedControls():($(".saveMapViewControlContainer").addClass("stackSaveCtrls"),$(".darkModeControlContainer").addClass("stackDarkModeCtrl"),e.addClass("stackPegman2")),this.stackFullScreenMapBtn(),resizeVars.initialStackDone=!0):this.tryAgain(t,this.stackMapControlsOnMobile))},200)}stackMapControlsOnDesktop(t=0){setTimeout(()=>{var e;resizeVars.initialStackDone||(0<(e=$(".zoomControlContainer")).length?(resizeVars.isEmbedded?this.stackEmbeddedControls():(e.addClass("stackZoomCtrl"),$(".saveMapViewControlContainer").addClass("stackSaveCtrls")),$(".toggleDarkLMapContainer").addClass("stackDarkToggle"),this.stackFullScreenMapBtn(),resizeVars.initialStackDone=!0):this.tryAgain(t,this.stackMapControlsOnDesktop))},200)}stackFullScreenMapBtn(){var e;"true"===resources.EnableToggleFullScreenMapBtn&&(e=$(".toggleFullScreenMapContainer"),window.innerWidth<=992&&resizeVars.initalLoadOnMobile?(e.addClass("stackFullScreenToggleMobile"),stackFullScreenToggle()):resizeVars.initalLoadOnMobile||(resizeVars.isEmbedded?e.hide():e.addClass("stackFullScreenToggleDesktop")))}stackEmbeddedControls(){var e=document.querySelector("#embedmap").getBoundingClientRect().width,t=$(".zoomControlContainer");e<800?t.hide():t.addClass("embeddedZoomCtrl"),$(".saveMapViewControlContainer").addClass("embeddedStackSaveCtrls")}reuseMobileControlsOnDesktop(o=0){setTimeout(()=>{var e,t,s;resizeVars.state.desktop||((e=document.getElementsByClassName("gm-bundled-control")[0])?(e.classList.add("reuseMobileControls"),t=document.querySelector(".darkModeControlContainer"),e.appendChild(t),(s=document.querySelector(".saveMapViewControlContainer"))?e.appendChild(s):t.classList.add("darkModeNoSave"),"true"===resources.EnableToggleFullScreenMapBtn&&e.appendChild(document.querySelector(".toggleFullScreenMapContainer")),resizeVars.state.mobile=!1,resizeVars.state.desktop=!0):this.tryAgain(o,this.reuseMobileControlsOnDesktop))},200)}fixEmbeddedCtrlStack(t=0){setTimeout(()=>{var e;document.querySelector(".gm-svpc")?((e=$("#toggleDarkLMapContainer")).removeClass("stackDarkToggle"),e.hide(),$(".gm-svpc").hide(),$(".zoomControlContainer").hide(),(e=$(".gm-svpc")).show(),e.addClass("embeddedPeg"),(e=document.querySelector(".saveMapViewControlContainer"))&&e.classList.add("embeddedStackSaveCtrls")):this.tryAgain(t,this.fixEmbeddedCtrlStack)},200)}addEmbeddedCtrlClass(t=0){setTimeout(()=>{var e=document.querySelector(".gm-svpc");e?(e.classList.add("embeddedCtrl"),(e=document.querySelector(".saveMapViewControl"))&&e.classList.add("embeddedCtrl"),document.querySelector(".gmnoprint").classList.add("embeddedCtrl")):this.tryAgain(t,this.addEmbeddedCtrlClass)},200)}stackFullScreenToggle(t=0){setTimeout(()=>{var e=document.querySelector(".darkModeControlContainer");e?e.parentElement.appendChild(document.querySelector(".stackFullScreenToggleMobile")):this.tryAgain(t,this.stackFullScreenToggle)},200)}setBtmRtCtrlsOnMobile(t=0){setTimeout(()=>{var e;resizeVars.state.mobile||((e=document.querySelector(".darkModeControlContainer"))?(e.classList.add("stackDarkModeMobile"),resizeVars.state.mobile=!0,resizeVars.state.desktop=!1):this.tryAgain(t,this.setBtmRtCtrlsOnMobile))},200)}reuseBtmRtMobileControlsOnDesktop(s=0){setTimeout(()=>{var e,t;resizeVars.state.desktop||((e=document.querySelector(".saveMapViewControlContainer"))?(e.classList.add("reuseSaveMapViewControlOnDesk"),"true"===resources.EnableToggleFullScreenMapBtn&&((t=document.querySelector(".toggleFullScreenMapContainer")).classList.add("reuseFullScreenControlOnDesk"),e.parentElement.appendChild(t)),resizeVars.state.desktop=!0,resizeVars.state.mobile=!1):this.tryAgain(s,this.reuseBtmRtMobileControlsOnDesktop))},200)}setBtmRtCtrlsOnDesktop(t=0){setTimeout(()=>{var e;resizeVars.state.desktop||(e=document.querySelector(".gm-svpc"),!resizeVars.isEmbedded&&e?(e.classList.add("stackPegman1"),resizeVars.state.desktop=!0,resizeVars.state.mobile=!1):this.tryAgain(t,this.setBtmRtCtrlsOnDesktop))},200)}reuseDesktopControlsOnMobile(t=0){setTimeout(()=>{var e;resizeVars.state.mobile||((e=document.querySelector(".gm-svpc"))?(e.classList.add("pegmanForMobile"),(e=document.querySelector(".gm-bundled-control-on-bottom").parentElement).classList.add("reuseDektopCtrls"),e.appendChild(document.querySelector(".zoomControlContainer")),e.appendChild(document.querySelector(".toggleDarkLMapContainer")),document.querySelector(".saveMapViewControlContainer")&&e.appendChild(document.querySelector(".saveMapViewControlContainer")),document.querySelector(".ersMode")&&"block"===document.querySelector("#layerSelection").style.display&&$(".legend-toggle").trigger("click"),resizeVars.state.desktop=!1,resizeVars.state.mobile=!0):this.tryAgain(t,this.reuseDesktopControlsOnMobile))},200)}reuseMobileControlsOnMobile(s=0){setTimeout(()=>{var e,t;resizeVars.state.mobile||((e=document.querySelector(".gm-bundled-control-on-bottom"))?(e=e.parentElement,(t=document.querySelector(".saveMapViewControlContainer"))&&e.appendChild(t),e.appendChild(document.querySelector(".darkModeControlContainer")),resizeVars.state.desktop=!1,resizeVars.state.mobile=!0):this.tryAgain(s,this.reuseMobileControlsOnMobile))},200)}}
var setupSlickCarousel=function(t){t.each(function(){this.dataset.lazy=this.dataset.lazy+"?t="+roundDateToDuration(moment().startOf("second"),moment.duration(1),"floor").unix()});var a,e=$(t).closest(".cctvCameraCarousel");return $(e).hasClass("slick-initialized")?Modernizr.mq("(max-width: 992px)")&&0<(a=$(".bootbox-body .map-tooltip").outerWidth()-10)&&($(".bootbox-body .slick-initialized, .bootbox-body .slick-slide").css("width",a+"px"),$(e).slick("setPosition")):($(e).slick({dots:!0,arrows:!0,autoplay:!0,lazyLoad:"ondemand",autoplaySpeed:1e4,accessibility:!0,infinite:!1}),$(e).on("beforeChange",function(t,a,e,i){a=$(a.$slides.get(i)),i=$("img",a);"true"==i.attr("data-needsrefresh")&&i[0].hasAttribute("src")&&(i.attr("src",URI(i.attr("src")).hash((new Date).getTime())),i.attr("data-needsrefresh","false"))})),$(t).removeClass("carouselCctvImage"),$(e)},setUpImageSlide=function(t,a){0<t.$slides.length&&((a=(t=$("img",$(t.$slides.get(a)))).data("title"))?($("#myCameraTitle").text(a),a=t.data("id"),$("#myCameraLocation").show(),$("#myCameraLocation").attr("href","#camera-"+a)):$("#myCameraLocation").hide(),t.attr("data-lazy",URI(t.data("url")).hash((new Date).getTime())),0<(a=t.data("refresh-rate")))&&setInterval(function(t){t=$("#"+t);t.attr("src",URI(t.data("url")).hash((new Date).getTime()))},a,t.attr("id"))};
"use strict";var UserCameras=null,LatLng=function(){},CameraLocater=function(){function e(e){var i=this;this.avoidZoom=!1,this.appPublicApi=e,this.map=this.appPublicApi.map,this.centerTooltip=e.appHelper.centerTooltip,$(document).on("hashChanged-urlHash",function(e,t){var a,o=urlHash.hash();o&&0==o.toLowerCase().lastIndexOf("camera-",0)?(a=decodeURIComponent(i.getUrlHashAsId()))&&i.zoomToCamera(a,"Camera","Cameras"):o&&-1<o.indexOf("-")&&(MapComp.isLibre&&CTVars.tooltipOpen&&i.centerTooltip.closeTooltipClick(),i.zoomToObject(i.getUrlHashAsId(),o.split("-")[0]))})}return e.prototype.zoomToObject=function(o,i,l){var n=this,e=(void 0===l&&(l=!0),$("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection")));e.is(":checked")||"True"===e.attr("data-ischild")&&(e=null==(e=null==(e=document.querySelector('[data-layerId="'+i+'"]').parentElement.parentElement.parentElement)?void 0:e.id)?void 0:e.split("-")[0],(e=$("input[type='checkbox'][data-layerid=\""+e+'"]',$("#layerSelection"))).click(),"True"!==e.attr("data-dontselectchildlayers"))||$("input[type='checkbox'][data-layerid=\""+i+'"]',$("#layerSelection")).click(),MapComp.isLibre&&bootbox.closeMapPageDialog(),this.appPublicApi.appHelper.iconManager.RefreshLayer(i,!0),$(document).on("layerIconsUpdated",function(e,t,a){t==i&&(o=decodeURIComponent(o),1==(a=a.item2.filter(function(e){return e.itemId==o})).length?(l&&!n.avoidZoom?MapComp.layerIconsUpdated({this:n,layer:t,id:a[0].itemId,lng:a[0].location[0],lat:a[0].location[1],title:o}):(n.avoidZoom=!0,setTimeout(function(){n.avoidZoom=!1},500)),$(document).off("layerIconsUpdated")):0==a.length&&$(document).trigger("closeDraggableWindow"))})},e.prototype.zoomToCamera=function(t,a,o){var i=this;$.ajax("/"+a+"/GetLatLng?id="+t,{type:"POST"}).done(function(e){e&&e.latitude&&e.longitude&&(MapComp.zoomToCameraLocation({this:i,layer:o,hash:null===urlHash||void 0===urlHash?void 0:urlHash.hash,controller:a,lat:e.latitude,lng:e.longitude,id:t}),$("input[type='checkbox'][data-layerid=\""+o+'"]',$("#layerSelection")).is(":checked")||($("input[type='checkbox'][data-layerid=\""+o+'"]',$("#layerSelection")).click(),i.appPublicApi.appHelper.layerToggled(o,!1)))})},e.prototype.getUrlHashAsId=function(){var e=urlHash.hash();return e=e.substring(e.indexOf("-")+1)},e.prototype.setUrlHashAsObjectId=function(e,t){t=(t="{0}-{1}".replace("{0}",t||"")).replace("{1}",e||"");urlHash.hash(t)},e}();
$(function(){var o=[];function d(e,i,t,o,d,n,a,l){let s=e+"-video",r=document.getElementById(d),c=r.getAttribute("data-videourl");e=r.getAttribute("data-videoauth");let u=r.getAttribute("data-streamtype");d=r.getAttribute("data-camera-id");"true"!==e&&c&&""!=c?m(r,i,t,o,s,c,u,n,a,l):$.ajax("/Camera/GetVideoUrl?imageId="+d,{type:"GET",cache:!1}).done(function(e){"object"==typeof e?$.ajax(resources.CameraVideoUrl,{type:"POST",cache:!1,data:JSON.stringify(e),contentType:"application/json"}).done(function(e){m(r,i,t,o,s,c+e,u,n,a,l)}):m(r,i,t,o,s,e,u,n,a,l)})}function m(i,e,t,o,d,n,a,l,s,r){n='<video id="'+d+'" class="video-js vjs-default-skin" preload="auto" autoplay data-setup=\'{ "controls": true }\'>\t<source src="'+n+'" type="'+a+'" /> \n\t\t<p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>\n</video>';videojs.addLanguage("en",{"No compatible source was found for this media.":window.resources.IE8ErrorMessage}),i.appendChild(jQuery.parseHTML(n)[0]);let c,u=videojs(document.getElementById(d),{width:s,height:r});$(i).children("div.video-js").css({width:s+"px",height:r+"px"}),function e(){if(null!=u&&null==document.getElementById(d)){try{u.dispose()}catch(e){}u=null}null!=u&&setTimeout(function(){e()},5e3)}(),this.errorFunction=function(){videoElement=document.getElementById(d);var e=videojs(videoElement);4==!e.error().code&&(e.dispose(),e="<img src='"+resources.CctvVideoCustomErrorImage+"' style='display:block;width:100%'>",i.appendChild(jQuery.parseHTML(e)[0]))},resources.CctvVideoCustomErrorImage&&u.on("error",errorFunction),c=document.getElementById(e);let m=$(l)[0],h=$(l).next()[0];p()&&((a=$(".child div[id='"+i.id+"']")).length<2&&$(a).html($(i).children()),c=$(".child img[id='"+e+"']")[0],m=$(".child button[id='"+t+"']")[0],h=$(".child button[id='"+o+"']")[0]),c.style.display="none",m.style.display="none",h.style.display="inline",$(l).parent().prevUntil("video-js").children().css({width:s+"px"});{n=u.el_;let e=0;n.addEventListener("mouseout",function(){0<window.scrollY&&(e=window.scrollY),0===window.scrollY&&window.scrollTo(0,e)}),n.addEventListener("mouseover",function(){0<window.scrollY&&(e=window.scrollY)})}u.on("fullscreenchange",()=>{u.isFullscreen_||$(document).trigger("exitFullScreenVideo")})}function n(e,i,t,o,d,n){e=document.getElementById(e+"-video");let a=document.getElementById(i),l=$(n).prev()[0],s=$(n)[0];p()&&(a=$(".child img[id='"+i+"']")[0],l=$(".child button[id='"+t+"']")[0],s=$(".child button[id='"+o+"']")[0]),null!=e&&videojs(e).dispose();for(var r=document.getElementById(d);r.firstChild;)r.removeChild(r.firstChild);a.style.display="block",l.style.display="inline",s.style.display="none"}function a(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!1).slick("slickPause")}function l(e){e=$(e+".slick-initialized");void 0!==e&&0<e.length&&e.slick("slickSetOption","autoplay",!0).slick("slickPlay")}function p(){return 0<$(".child .cctvImage").length}$(document).on("click",".showVideo",function(t){if(!(t.detail&&1<t.detail)&&"undefined"!=typeof videojs){a(".cctvCameraCarousel");t=$(this).parent().parent().find(".cctvImage");let e=t.width();t=t.height();let i=$(this).data("camera-id");null==e&&(e=parseInt(resources.CamTooltipMaxWidth)),d(i,i+"img","showVideo-"+i,"hideVideo-"+i,i+"-videoContainer",this,e,t),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[i]),o[i]=setTimeout(function(){var e;e=i,l(".cctvCameraCarousel"),document.getElementById(e+"-video")&&n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",$(document).find("[id='hideVideo-"+e+"']"))},parseInt(resources.VideoTimeoutInMilliseconds)))}}),$(document).on("click",".hideVideo",function(){var e;"undefined"!=typeof videojs&&(l(".cctvCameraCarousel"),e=$(this).data("camera-id"),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[e]),o[e]=null),n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",this))}),$(document).on("click",".showMyVideo",function(e){if(!(e.detail&&1<e.detail)&&"undefined"!=typeof videojs){a(".cameraCarousel");var e=$(this).parent().parent().find(".myCamImg"),t=e.width(),e=e.height();let i=$(this).data("camera-id");d(i+"my","carouselId-"+i,"showMyVideo-"+i,"hideMyVideo-"+i,i+"-myVideoContainer",this,t,e),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[i]),o[i]=setTimeout(function(){var e;e=i,l(".cameraCarousel"),document.getElementById(e+"-video")&&n(e,e+"img","showVideo-"+e,"hideVideo-"+e,e+"-videoContainer",$(document).find("[id='hideVideo-"+e+"']"))},parseInt(resources.VideoTimeoutInMilliseconds)))}}),$(document).on("click",".hideMyVideo",function(){var e;"undefined"!=typeof videojs&&(l(".cameraCarousel"),e=$(this).data("camera-id"),"True"==resources.EnableVideoTimeout&&(clearTimeout(o[e]),o[e]=null),n(e+"my","carouselId-"+e,"showMyVideo-"+e,"hideMyVideo-"+e,e+"-myVideoContainer",this))}),$(document).on("CallRemoveVideo",function(){var e=$(".map-tooltip video");0<e.length&&$(e).each(function(){var e=$(this).parent().attr("id");videojs(document.getElementById(e)).dispose()})})});
window.CTVars={isErs:void 0,map:void 0,mapBounds:void 0,mapBottom:void 0,mapTop:void 0,tooltip:void 0,infoWindowObj:void 0,firstImage:void 0,imagesAlreadyLoaded:[],draggedMap:!1,contentHeightAdjusted:!1,externalPanListener:void 0,externalPanDone:!0,tooltipOpen:!1,firstMove:void 0,panByNotBusy:!0,widthAdjusted:void 0,widthHasIncreased:void 0,maxTooltipWidth:450,tooltipContainer:void 0,tooltipInitialPosition:{top:0,left:0},tooltipPos:{x:0,y:0},markerPoint:[],closeBtn:void 0};class CenterTooltip{constructor(t){CTVars.map=t,CTVars.isErs=0<$(".ersMode").length,MapComp.callback.closeTooltip=()=>{this.closeTooltip()}}startTriggers(){MapComp.isGoogle&&CTVars.map.addListener("dragend",()=>{CTVars.draggedMap=!0})}adjustTooltipScroll(){centerTooltip.scrollTooltipMoreInfoIntoView(),centerTooltip.panBy();var t,e,o=document.getElementById("draggableBorder");CTVars.widthHasIncreased&&o&&(t=o.querySelector(".row .event"),e=CTVars.mapBottom-CTVars.mapTop,t)&&t.scrollHeight!==o.scrollHeight+20&&t.scrollHeight<e&&(o.style.height=t.scrollHeight+20+"px"),MapComp.updateTooltipOffsetWithLine(o)}externalPanCheck(){CTVars.externalPanDone=!1,MapComp.isLibre&&MapComp.map.on("idle",MapComp.moveDone),MapComp.isGoogle&&(CTVars.externalPanListener=CTVars.map.addListener("idle",this.externalPanEvent.bind(this)))}externalPanEvent(){CTVars.externalPanListener&&CTVars.externalPanListener.instance&&(google.maps.event.removeListener(CTVars.externalPanListener),CTVars.externalPanListener=void 0,CTVars.externalPanDone=!0)}run(t){CTVars.panByNotBusy&&CTVars.externalPanDone&&CTVars.tooltipOpen?(this.resetRun(t),this.doFirstMove()):CTVars.tooltipOpen&&setTimeout(()=>{this.run()},100)}resetRun(t){CTVars.draggedMap=!1,CTVars.panByNotBusy=!0,CTVars.firstMove=!0,CTVars.widthHasIncreased=!1,CTVars.firstImage=void 0,CTVars.contentHeightAdjusted=!1,CTVars.firstImage&&CTVars.firstImage.removeEventListener("load",this.imageLoadedEvent.bind(this)),CTVars.tooltip=void 0,CTVars.infoWindowObj=t}tooltipClosed(){CTVars.tooltipOpen=!1}tooltipOpened(t,e,o){CTVars.tooltipOpen=!0,MapComp.isLibre&&e&&t&&(this.styleTooltip(t,e,o?.yOffset),MapComp.setupTooltipDrag({tooltip:e}),this.setupCloseTooltipBtn())}styleTooltip(t,e,o){e.style.visibility="visible",e.style.top=t.y-35+(o||0)+"px",e.style.left=t.x+"px",e.style.left=t.x+"px",e.style.bottom="unset"}setupCloseTooltipBtn(){CTVars.closeBtn=CTVars.tooltipContainer.querySelector(".closeDraggableWindow"),CTVars.closeBtn.addEventListener("click",this.closeTooltipClick.bind(this))}closeTooltipClick(){this.closeTooltip(),CTVars.closeBtn?.removeEventListener("click",this.closeTooltipClick.bind(this))}closeTooltip(){CTVars.tooltipContainer&&CTVars.tooltipContainer.parentNode&&CTVars.tooltipContainer.parentNode.removeChild(CTVars.tooltipContainer),MapComp.disableTooltipDrag(),MapComp.deleteTooltipLine(),MapComp.stopMonitoringMapMoves(),MapComp.removeEventShapes(),CTVars.tooltipOpen=!1,MapComp.data.moveToshowTooltip.tooltipYoffset=0}doFirstMove(){this.setupImageLoadEvent(),this.setupTabEvent(),this.setTooltipScrolling(),this.panBy()}setTooltipScrolling(){CTVars.tooltip.dom&&CTVars.tooltip.isDraggable&&(CTVars.tooltip.dom.addEventListener("mouseover",()=>{CTVars.tooltip.dom.focus(),MapComp.isLibre||CTVars.map.set("scrollwheel",!1)}),CTVars.tooltip.dom.addEventListener("mouseout",()=>{MapComp.isLibre||CTVars.map.set("scrollwheel",!0)}))}imageLoadedEvent(){CTVars.firstImage&&(CTVars.firstImage.id&&-1===CTVars.imagesAlreadyLoaded.indexOf(CTVars.firstImage.id)&&CTVars.imagesAlreadyLoaded.push(CTVars.firstImage.id),CTVars.firstImage.removeEventListener("load",this.imageLoadedEvent.bind(this))),this.tryToPanBy()}panByEvent(){CTVars.panByListener&&CTVars.panByListener.instance&&(google.maps.event.removeListener(CTVars.panByListener),CTVars.panByListener=void 0,CTVars.panByNotBusy=!0,CTVars.firstMove)&&(CTVars.firstMove=!1,this.panBy())}tryToPanBy(){CTVars.panByNotBusy?this.panBy():setTimeout(()=>{this.tryToPanBy()},50)}panBy(){var t,e;this.setTooltip(),CTVars.tooltip.dom&&CTVars.tooltip.measures&&!CTVars.tooltip.insideBootbox&&CTVars.panByNotBusy&&(this.setMapBounds(),this.adjustTooltipSize(),this.setTooltip(),t=this.yTooltipMove(),e=this.xTooltipMove(),MapComp.isLibre&&MapComp.centerTooltip({panBy:[e,t],markerPoint:CTVars.markerPoint}),0!==e||0!==t?(CTVars.panByNotBusy=!1,MapComp.isGoogle&&(CTVars.panByListener=CTVars.map.addListener("idle",this.panByEvent.bind(this)),CTVars.map.panBy(e,t),this.adjustTooltipTop())):CTVars.firstMove&&!MapComp.isLibre&&(CTVars.firstMove=!1,this.panBy()))}adjustTooltipSize(){var e=document.getElementById("draggableBorder");if(e){var t=Math.round(e.scrollHeight);Math.round(e.getBoundingClientRect().height);if(t<CTVars.mapBottom-CTVars.mapTop?(e.style.height="unset",e.style.maxHeight="unset",e.style.overflowY="hidden",document.querySelector(".closeDraggableWindow").style.right="3px"):(e.style.height=CTVars.mapBottom-CTVars.mapTop+"px",e.style.maxHeight="unset",e.style.overflowY="auto",document.querySelector(".closeDraggableWindow").style.right="11px",CTVars.tooltip.hasSingleImg||CTVars.tooltip.hasSlickSlider||this.adjustTooltipWidth(),CTVars.tooltip.weatherForecast&&(t=document.querySelector(".draggableWindow"),o=CTVars.tooltip.dom.querySelector(".largeScreen table"),t)&&o&&(s=o.getBoundingClientRect().width,o.style.width=s+"px",t.style.width=s+55+"px")),CTVars.widthHasIncreased){let t=e.querySelector(".row .event");var o=(t=(t=null===t?e.querySelector(".map-tooltip"):t)||e.querySelector(".draggable-tooltip")).getBoundingClientRect().height;t&&t.scrollHeight!==e.scrollHeight+10&&o<CTVars.mapBottom-CTVars.mapTop&&!CTVars.contentHeightAdjusted&&(e.style.height=t.scrollHeight+10+"px",CTVars.contentHeightAdjusted=!0,setTimeout(()=>{this.tryToPanBy()}))}this.trimExcessTabHeight(e),CTVars.tooltip.hasInfoToggle&&$(document).on("tooltip-info-toggled",this.adjustTooltipScroll)}else CTVars.tooltip.hasSingleImg||CTVars.tooltip.hasSlickSlider||!MapComp.isGoogle||(t=document.querySelector(".gm-style-iw-d"))&&t.scrollHeight>t.clientHeight&&CTVars.infoWindowObj&&CTVars.infoWindowObj.maxWidth!==this.maxTooltipWidth&&(CTVars.widthAdjusted=CTVars.map.addListener("idle",this.googlewidthAdjustedEvent.bind(this)),CTVars.infoWindowObj.maxWidth=this.maxTooltipWidth);var s=document.querySelector(".draggableWindowContainer");s&&(s.style.visibility="visible")}trimExcessTabHeight(t){var e;0<CTVars.tooltip.dom.querySelectorAll(".nav-tabs a").length&&(e=CTVars.tooltip.dom.querySelector(".map-tooltip").getBoundingClientRect().height)<CTVars.mapBottom-CTVars.mapTop&&(t.style.height=e+15+"px")}googlewidthAdjustedEvent(){CTVars.widthAdjusted&&CTVars.widthAdjusted.instance&&(google.maps.event.removeListener(CTVars.widthAdjusted),CTVars.widthAdjusted=void 0,CTVars.draggedMap)&&this.panBy()}adjustTooltipWidth(){var t=document.querySelector(".draggableWindowContainer");t.getBoundingClientRect().width<this.maxTooltipWidth&&(t.style.width=this.maxTooltipWidth+"px",CTVars.widthHasIncreased=!0,(t=document.getElementById("draggableBorder")).scrollHeight===t.clientHeight)&&(document.querySelector(".closeDraggableWindow").style.right="3px")}setupImageLoadEvent(){var t,e;this.setTooltip(),CTVars.tooltip.dom&&CTVars.tooltip.measures&&(CTVars.tooltip.hasSlickSlider||CTVars.tooltip.hasSingleImg||CTVars.tooltip.weatherForecast)&&(CTVars.tooltip.dom.querySelector(".slick-slide")&&(CTVars.firstImage=CTVars.tooltip.dom.querySelector(".slick-slide").getElementsByTagName("img")[0]),t=CTVars.tooltip.dom.querySelector(".cctvCameraCarousel "),CTVars.firstImage||(CTVars.firstImage=CTVars.tooltip.dom.querySelector(".cctvImage")),CTVars.firstImage||(e=CTVars.tooltip.dom.querySelector(".largeScreen").getElementsByTagName("img"),CTVars.firstImage=e[e.length-1]),CTVars.firstImage&&-1===CTVars.imagesAlreadyLoaded.indexOf(CTVars.firstImage.id)||t)&&(MapComp.isGoogle&&CTVars.firstImage.addEventListener("load",this.imageLoadedEvent.bind(this)),MapComp.isLibre)&&CTVars.firstImage.addEventListener("load",this.imageLoadedEvent.bind(this),{once:!0})}setMapBounds(){CTVars.mapBounds=document.getElementById("map-canvas").getBoundingClientRect(),CTVars.mapBottom=CTVars.mapBounds.bottom-100,CTVars.mapTop=CTVars.mapBounds.top+60+(CTVars.isErs?25:0)}setTooltip(){let t=document.querySelector(".draggableWindow"),e=!0,o=!1,s=!1,a={},i=!1,r=!1,l=!1;var n=document.querySelector(".bootbox");let p=!1;n&&n.querySelector(".map-tooltip")&&(p=!0),t||(t=(t=document.querySelector(".map-tooltip"))&&t.parentElement.parentElement,e=!1),t||(t=document.querySelector(".gm-style-iw"),e=!1),t&&(t.querySelector(".slick-slider")&&(o=!0),e?(n=document.querySelector("#draggableBorder")).scrollHeight>n.clientHeight&&(s=!0):t.scrollHeight>t.clientHeight&&(s=!0),t.querySelector(".cctvImage")&&(i=!0),a=t.getBoundingClientRect(),t.querySelector(".weatherForecast")&&(r=!0),t.querySelector("#toggleDetourText")||t.querySelector(".tooltip-comments"))&&(l=!0),CTVars.tooltip={dom:t,isDraggable:e,hasSlickSlider:o,hasScroll:s,measures:a,insideBootbox:p,hasSingleImg:i,weatherForecast:r,hasInfoToggle:l}}setupTabEvent(){var t;CTVars.tooltip&&CTVars.tooltip.dom&&(t=CTVars.tooltip.dom.querySelectorAll(".nav-tabs a"))&&$(t).on("shown.bs.tab",()=>{this.panBy()})}yTooltipMove(){let t=0;var e;return CTVars.firstMove&&!MapComp.isLibre||(CTVars.mapTop>CTVars.tooltip.measures.top?(t=CTVars.tooltip.measures.top-CTVars.mapTop,MapComp.data.tooltipLine?.lineDrawn&&(t+=MapComp.methods.tooltipLine.getHeight()),e=CTVars.mapBottom-CTVars.mapTop,-1*t>e&&(t=-1*e)):CTVars.mapBottom<CTVars.tooltip.measures.bottom&&(t=CTVars.tooltip.measures.bottom-CTVars.mapBottom+(CTVars.tooltip.isDraggable?0:10),e=CTVars.tooltip.measures.top-t,CTVars.mapTop>e)&&(t=0,CTVars.tooltip.hasScroll||CTVars.tooltip.isDraggable||(e=CTVars.tooltip.dom.parentElement.parentElement.getBoundingClientRect(),t=e.top-CTVars.mapTop))),t}xTooltipMove(){let t=0;var e=CTVars.tooltip.isDraggable;let o=!1,s;0<$(".col-md-12.mapColContainer").length?(a=$("#sideBarColContainer"))&&a.is(":visible")?(o=!0,s=a[0].getBoundingClientRect(),CTVars.tooltip.measures.left<s.right&&(t=-1*(s.right-CTVars.tooltip.measures.left+(e?10:20)))):CTVars.tooltip.measures.left<0&&(t=CTVars.tooltip.measures.left-CTVars.mapBounds.left+(e?-10:-25)):CTVars.tooltip.measures.left<CTVars.mapBounds.left&&(t=CTVars.tooltip.measures.left-CTVars.mapBounds.left+(e?-10:-25));var a=$("#layerSelection"),i=a&&a.is(":visible");let r;return i?(r=a[0].getBoundingClientRect(),CTVars.tooltip.measures.right>r.left&&(t=-1*(r.left-CTVars.tooltip.measures.right-(e?10:25)))):CTVars.tooltip.measures.right>CTVars.mapBounds.right&&(t=CTVars.tooltip.measures.right-CTVars.mapBounds.right-(e?-10:-25)+("TOP_CENTER"===resources.MapControlPos?0:50)),t=i&&o&&(a=s.x+s.width,e=r.x,!CTVars.firstMove)&&e-a<CTVars.tooltip.measures.width?0:t}scrollTooltipMoreInfoIntoView(){let t=document.getElementById("toggleDetourText");t=t||document.getElementById("toggleComment");var e,o=document.getElementById("draggableBorder");let s=o?!0:!1;this.setMapBounds(),s&&((e=document.getElementById("detourCollapse"))&&(e.classList.contains("in")?o.scrollHeight<CTVars.mapBottom-CTVars.mapTop?(o.style.height=o.scrollHeight+"px",o.style.maxHeight="unset"):(o.style.height=CTVars.mapBottom-CTVars.mapTop+"px",o.style.maxHeight="unset",e=t.getBoundingClientRect().top-o.getBoundingClientRect().top,o.scroll({top:e,left:0,behavior:"smooth"})):(o.removeAttribute("style"),this.adjustTooltipSize())),e=document.getElementById("lastUserComment"))&&("none"!==e.style.display?(e=e.getBoundingClientRect().bottom-o.getBoundingClientRect().top,o.scroll({top:e,left:0,behavior:"smooth"})):(o.removeAttribute("style"),this.adjustTooltipSize()))}clickInsideTooltip(t,e){if(!CTVars.tooltip||!CTVars.tooltipOpen)return!1;this.setTooltip();var o=CTVars.tooltip.measures,t=t>o.x&&t<o.x+o.width,e=e>o.y&&e<o.y+o.height;return t&&e}adjustTooltipTop(){var t,e=document.getElementById("draggableBorder");e&&e.scrollHeight>e.clientHeight&&0<document.getElementsByClassName("ersMode").length&&!e.querySelector("#draggableHeader")&&((t=document.createElement("div")).className="tooltipWhiteStrip",t.id="draggableHeader",e.prepend(t))}}
var ContextMenu=function(o,e){var a=this;this.onTouchStart=function(e){a.touchTimer||(a.touchTimer=setTimeout(function(){return a.onRightClick(e)},600))},this.onTouchEnd=function(e){a.touchTimer&&(clearTimeout(a.touchTimer),a.touchTimer=null,e.domEvent.preventDefault())},this.onDragStart=function(){a.touchTimer&&(clearTimeout(a.touchTimer),a.touchTimer=null)},this.onRightClick=function(e){var t,o,n;a.touchTimer=null,a.contextMenu.hide(),MapComp.isLibre&&(centerTooltip.closeTooltip(),n=e.lngLat,t=e.point.x,o=e.point.y),MapComp.isGoogle&&(t=e.pixel.x,o=e.pixel.y,n=e.latLng),a.helper.populateMenu(a.contextMenu,t,o,n,a.displayMenu),$(document).trigger("closeDraggableWindow")},this.displayMenu=function(e,t,o,n){a.contextMenu.empty(),a.contextMenu.append(e),a.contextMenu.append('<li class="divider"><a href="#resetMarkers" class="list-group-item"><i class="far fa-redo"></i>'+resources.StartOver+'</a></li><li><a href="#zoomIn" class="list-group-item"><i class="far fa-plus"></i>'+resources.ZoomIn+'</a></li><li><a href="#zoomOut" class="list-group-item"><i class="far fa-minus"></i>'+resources.ZoomOut+'</a></li><li><a href="#centerMap" class="list-group-item"><i class="far fa-compress-alt"></i>'+resources.CenterHere+"</a></li>"),a.setUpMenuEventHandlers(n);e=MapComp.isGoogle?$(a.map.getDiv()):$(".maplibregl-map");t>e.width()-a.contextMenu.width()&&(t-=a.contextMenu.width()),o>e.height()-a.contextMenu.height()&&(o-=a.contextMenu.height()),a.contextMenu.css({top:o,left:t}).fadeIn(300)},this.AddWaypointToContextMenu=function(e){a.helper.AddWaypointToContextMenu(e)},this.setUpMenuEventHandlers=function(n){a.contextMenu.find("a").click(function(e){e.preventDefault(),t=("FONT"===e.target.tagName?e.target.parentElement.parentElement.getAttribute("href"):$(e.target).attr("href")).substr(1);var t,o=a.possiblyParseInt(t);if(null!=o)a.helper.doAction(a.contextMenu,e,o);else switch(a.contextMenu.fadeOut(75),t){case"resetMarkers":a.helper.resetMarkers(a.contextMenu);break;case"zoomIn":MapComp.isGoogle&&(a.map.setZoom(a.map.getZoom()+1),a.map.panTo(n)),MapComp.isLibre&&MapComp.zoomInToLocation({location:n});break;case"zoomOut":MapComp.isGoogle&&(a.map.setZoom(a.map.getZoom()-1),a.map.panTo(n)),MapComp.isLibre&&MapComp.zoomOutToLocation({location:n});break;case"centerMap":MapComp.isGoogle&&a.map.panTo(n),MapComp.isLibre&&MapComp.centerMapToLocation({location:n})}}),a.helper.setupEventHandlers(a.contextMenu)},this.possiblyParseInt=function(e){try{var t=parseInt(e);return isNaN(t)?null:t}catch(e){return null}},this.helper=e,this.contextMenu=$(document.createElement("ul")).attr("id","contextMenu"),this.contextMenu.bind("contextmenu",function(){return!1}),MapComp.isLibre&&(document.querySelector("#map-canvas").appendChild(this.contextMenu[0]),MapComp.callback.openContextMenu=function(e){a.onRightClick(e)},MapComp.callback.closeContextMenu=function(e){a.contextMenu.hide()},MapComp.setContextMenuListeners({closeContextMenu:MapComp.callback.closeContextMenu,openContextMenu:MapComp.callback.openContextMenu})),MapComp.isGoogle&&(this.map=o,$(o.getDiv()).append(this.contextMenu),$.each("mousedown dragstart zoom_changed maptypeid_changed".split(" "),function(e,t){google.maps.event.addListener(o,t,function(){a.contextMenu.hide()})}),google.maps.event.addListener(o,"contextmenu",this.onRightClick),google.maps.event.addListener(o,"dragstart",this.onDragStart),google.maps.event.addDomListener(o,"mousedown",this.onTouchStart),google.maps.event.addDomListener(o,"mouseup",this.onTouchEnd))};
var CreateDraggableInfoWindow=function(l,t){var g,s,r,c,d,u=0;$(document).on("closeDraggableWindow",function(){d.set("scrollwheel",!0),d.gestureHandling="greedy","True"==resources.CctvEnableVideo&&$(document).trigger("CallRemoveVideo"),l&&null!=l.container&&l.onRemove(),$(document).trigger("info-window-close"),$(document).off("closeDraggableWindow"),$(document).off("tooltip-info-toggled")});function o(t,e,o,n,a){google.maps.event.addDomListener(e,n,function(e){null==(e.changedTouches?e.changedTouches.item(t.touchTracker):null)&&"touchcancel"==e.type||google.maps.event.trigger(o,a,e)})}function n(i,e,r,t){return google.maps.event.addDomListener(e,t,function(e){var t,o,n,a=e.changedTouches?e.changedTouches.item(i.touchTracker):null;null==a&&"touchmove"==e.type||(null!=a&&0==$(document.elementFromPoint(a.pageX,a.pageY)).parents(".draggableWindow").length&&google.maps.event.trigger(r,"touchend",e),e.preventDefault(),t=(o=i.get("origin")).changedTouches?o.changedTouches.item(i.touchTracker):null,n="touchmove"==e.type?t.clientX-a.clientX:o.clientX-e.clientX,t="touchmove"==e.type?t.clientY-a.clientY:o.clientY-e.clientY,a=i.getProjection().fromLatLngToDivPixel(i.get("position")),o=i.getProjection().fromDivPixelToLatLng(new google.maps.Point(a.x-n,a.y-t)),i.set("origin",e),i.set("position",o),i.draw(),n=i,(a=g)&&l&&(n=n.getProjection().fromDivPixelToLatLng(new google.maps.Point(c.x-u,c.y-40)),a=[a.getPosition(),n],s.setPath(a)))})}function a(t,o,e){google.maps.event.addDomListener(o,e,function(e){-1!=e.target.className.indexOf("closeDraggableWindow")?($(document).trigger("callCloseInfoWindow"),document.getElementsByTagName("body")[0].style.userSelect="unset"):(e.stopPropagation(),"draggableBorder"!==e.target.getAttribute("id")&&"draggableHeader"!=e.target.getAttribute("id")||(document.getElementsByTagName("body")[0].style.userSelect="none",t.set("origin",e),e.changedTouches&&(t.touchTracker=e.changedTouches[0].identifier),t.moveHandler=n(t,t.get("map").getDiv(),o,"mousemove"),t.moveTouchHandler=n(t,t.get("map").getDiv(),o,"touchmove")))}),google.maps.event.addDomListener(d,"click",function(e){CTVars.tooltipOpen&&e.stop()})}function i(t,e,o){google.maps.event.addDomListener(e,o,function(e){document.getElementsByTagName("body")[0].style.userSelect="unset",null==(e.changedTouches?e.changedTouches.item(t.touchTracker):null)&&"touchend"==e.type||(t.touchTracker=null,google.maps.event.removeListener(t.moveHandler),google.maps.event.removeListener(t.moveTouchHandler))})}let e=["customMapCtrl","gm-svpc","gmnoprint"];function m(o){e.forEach(e=>{Array.from(document.getElementsByClassName(e)).forEach(e=>{var t;t=o,e.addEventListener("mouseover",()=>{google.maps.event.removeListener(t.moveHandler),google.maps.event.removeListener(t.moveTouchHandler),document.getElementsByTagName("body")[0].style.userSelect="unset"})})})}function p(e,t,o){"function"==typeof draw&&(this.draw=draw),this.setValues({position:t,container:null,content:o,map:e})}return(p.prototype=new google.maps.OverlayView).onAdd=function(){var e=document.createElement("div"),t=(that=this,$(e).ready(r),this.get("content"));if(void 0!==t.nodeName)e.appendChild(t);else{if("string"!=typeof t)return;e.innerHTML=t}e.style.position="absolute";var t=t.indexOf("infoWindowLoading");google.maps.OverlayView.preventMapHitsAndGesturesFrom(e),-1==t&&(o(that,this.get("map").getDiv(),e,"touchcancel","touchend"),o(that,this.get("map").getDiv(),e,"mouseleave","mouseup"),a(that,e,"touchstart"),a(that,e,"mousedown"),a(that,e,"contextmenu"),m(that),that,t="mouseenter",google.maps.event.addDomListener(e,t,function(e){d.gestureHandling="none"}),that,t="mouseleave",google.maps.event.addDomListener(e,t,function(e){d.gestureHandling="greedy"})),i(that,e,"touchend"),i(that,e,"mouseup"),this.set("container",e),this.getPanes().floatPane.appendChild(e),c=that.getProjection().fromLatLngToDivPixel(that.get("position")),latLng=that.getProjection().fromDivPixelToLatLng(new google.maps.Point(c.x,c.y))},p.prototype.draw=function(){c=this.getProjection().fromLatLngToDivPixel(this.get("position"));var e=this.get("container");e&&(e.style.left=c.x+"px",e.style.top=c.y+(t&&"number"==typeof t?t:0)+"px")},p.prototype.onRemove=function(){var e=this.get("container");e&&e.parentNode&&(e.parentNode.removeChild(e),this.set("container",null)),$(document).trigger("closeGoogleWindow"),s&&s.setMap(null)},function(e,t,o,n,a,i){g=t,d=e,r=i,-1===n.indexOf("infoWindowLoading")&&(n=n.replace('map-tooltip"','map-tooltip draggable-tooltip"')),t='<div class="draggableWindowContainer" style="width: '+a+'px;"><div class="draggableWindow">'+(n=(n="<div id='draggableBorder' class='tooltipPadding'>".concat(n)).concat("</div>"))+'<button class="fal fa-times closeDraggableWindow" aria-label="Close"></button></div></div>',l=new p(e,g.getPosition(),t),s=new google.maps.Polyline({strokeColor:"#999",strokeOpacity:1,strokeWeight:2,map:e}),$("#contextMenu").hide()}};
var Hashtable=function(h){var c,y,l="function",e="string";return"undefined"==typeof encodeURIComponent||Array.prototype.splice===h||Object.prototype.hasOwnProperty===h?null:(c=t("key"),y=t("value"),g.prototype={getEqualityFunction:function(t){return typeof t.equals==l?n:r},getEntryForKey:u(1),getEntryAndIndexForKey:u(2),removeEntryForKey:function(t){t=this.getEntryAndIndexForKey(t);return t?(this.entries.splice(t[0],1),t[1]):null},addEntry:function(t,n){this.entries.push([t,n])},keys:o(0),values:o(1),getEntries:function(t){for(var n=t.length,e=0,r=this.entries,i=r.length;e<i;++e)t[n+e]=r[e].slice(0)},containsKey:u(0),containsValue:function(t){for(var n=this.entries,e=n.length;e--;)if(t===n[e][1])return!0;return!1}},(s.prototype={each:function(t){for(var n,e=this.entries(),r=e.length;r--;)t((n=e[r])[0],n[1])},equals:function(t){var n,e,r,i=this.size();if(i!=t.size())return!1;for(n=this.keys();i--;)if(e=n[i],null===(r=t.get(e))||r!==this.get(e))return!1;return!0},putAll:function(t,n){for(var e,r,i,u=t.entries(),o=u.length,s=typeof n==l;o--;)e=(r=u[o])[0],r=r[1],s&&(i=this.get(e))&&(r=n(e,i,r)),this.put(e,r)},clone:function(){var t=new s(this.properties);return t.putAll(this),t}}).toQueryString=function(){for(var t,n=this.entries(),e=n.length,r=[];e--;)t=n[e],r[e]=encodeURIComponent(i(t[0]))+"="+encodeURIComponent(i(t[1]));return r.join("&")},s);function i(t){return typeof t==e?t:""+t}function p(t){var n;return typeof t==e?t:typeof t.hashCode==l?typeof(n=t.hashCode())==e?n:p(n):i(t)}function n(t,n){return t.equals(n)}function r(t,n){return typeof n.equals==l?n.equals(t):t===n}function t(n){return function(t){if(null===t)throw new Error("null is not a valid "+n);if(t===h)throw new Error(n+" must not be undefined")}}function g(t,n,e,r){this[0]=t,this.entries=[],this.addEntry(n,e),null!==r&&(this.getEqualityFunction=function(){return r})}function u(i){return function(t){for(var n,e=this.entries.length,r=this.getEqualityFunction(t);e--;)if(r(t,(n=this.entries[e])[0]))switch(i){case 0:return!0;case 1:return n;case 2:return[e,n[1]]}return!1}}function o(u){return function(t){for(var n=t.length,e=0,r=this.entries,i=r.length;e<i;++e)t[n+e]=r[e][u]}}function v(t,n){t=t[n];return t&&t instanceof g?t:null}function s(){var o=[],s={},l={replaceDuplicateKey:!0,hashCode:p,equals:null},t=arguments[0],n=arguments[1];if(n!==h)l.hashCode=t,l.equals=n;else if(t!==h){var e,r=l,i=t;for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e])}function u(e){return function(){for(var t=[],n=o.length;n--;)o[n][e](t);return t}}var f=l.hashCode,a=l.equals;this.properties=l,this.put=function(t,n){c(t),y(n);var e,r=f(t),i=null,u=v(s,r);return u?(e=u.getEntryForKey(t))?(l.replaceDuplicateKey&&(e[0]=t),i=e[1],e[1]=n):u.addEntry(t,n):(u=new g(r,t,n,a),o.push(u),s[r]=u),i},this.get=function(t){c(t);var n=f(t),n=v(s,n);if(n){n=n.getEntryForKey(t);if(n)return n[1]}return null},this.containsKey=function(t){c(t);var n=f(t),n=v(s,n);return!!n&&n.containsKey(t)},this.containsValue=function(t){y(t);for(var n=o.length;n--;)if(o[n].containsValue(t))return!0;return!1},this.clear=function(){o.length=0,s={}},this.isEmpty=function(){return!o.length};this.keys=u("keys"),this.values=u("values"),this.entries=u("getEntries"),this.remove=function(t){c(t);var n=f(t),e=null,r=v(s,n);return r&&null!==(e=r.removeEntryForKey(t))&&0==r.entries.length&&(t=function(t,n){for(var e=t.length;e--;)if(n===t[e][0])return e;return null}(o,n),o.splice(t,1),delete s[n]),e},this.size=function(){for(var t=0,n=o.length;n--;)t+=o[n].entries.length;return t}}}();
let IconManager=function(t,s){var e={};let c=[],u=new MapFctns,d=(e.AddIconLayer=function(e,r,n,o,a,i){if(-1!=d(e))throw"layerid is already active.";n=new IconLayer(e,r,n,o,a,i);c.push(n),MapComp.isGoogle&&n.MapChanged(t,u,s),$(document).trigger("layerAdded-iconManager",[e,r])},e.RemoveIconLayer=function(e){MapComp.isLibre&&MapComp.removeMarkersOrLines({layer:e});e=d(e);-1!=e&&(c[e].Delete(s),c.splice(e,1))},e.GetIconLayer=function(e){e=d(e);if(-1!=e)return c[e]},e.RefreshLayers=function(){let e=c.length,r=0;if(e)for(var n in c)c[n].RefreshLayer(t,u,s).done(function(){++r==e&&$(document).trigger("layersRefreshed-iconManager")});else $(document).trigger("layersRefreshed-iconManager")},e.RefreshLayer=function(e,r){var e=d(e);return-1!=e?c[e].RefreshLayer(t,u,s,r):((e=jQuery.Deferred()).resolve(),e.promise())},e.MapChanged=function(){for(var e in c)c[e].MapChanged(t,u,s);$(document).trigger("mapChangedFinished-iconManager")},e.Redraw=function(){MapComp.isGoogle&&(s.repaint(),$(document).trigger("markerClustererRepainted"))},function(e){for(var r in c)if(c[r].layerId===e)return r;return-1});return e},IconLayer=function(y,e,i,M,t,r){var n={};n.layerId=y;let h=new Hashtable,s=!1,v=e.item2,C=e.item1,I=0,k=22,o=(r&&(r.minZoom&&(I=r.minZoom),r.maxZoom)&&(k=r.maxZoom),n.RefreshLayer=function(r,n,o,e){let a=jQuery.Deferred();return i(y,e,t).done(function(e){s||(MapComp.isGoogle&&(v=e.item2,C=e.item1,c(r,n,o)),MapComp.isLibre&&MapComp.addMarkersOrLines({data:e,layerId:y}))}).always(function(e){$(document).trigger("layerRefreshed-iconManager."+y,[y,e]),a.resolve()}),a.promise()},n.MapChanged=function(e,r,n){c(e,r,n)},n.Delete=function(e){s=!0,o(e),$(document).trigger("layerDeleted-iconManager",[y])},n.GetIcons=function(){var e,r=[];for(e of h.keys()){var n=h.get(e);r.push(n.gmapsMarker)}return r},function(e){if(!MapComp.isLibre){var r,n=h.keys(),o=new Array;for(r of n){var a=h.get(r);1==a.status&&(o.push(a.gmapsMarker),a.status=0)}e.removeMarkers(o,!0)}}),c=function(e,r,n){var o,a=new Array,i=new Array,t={},s={},c=r.GetMapBoundsObject(e),u=e.getZoom();for(o in v){v[o]=(d=v[o],m=C,d.merged||(m.url&&!d.icon.url&&(d.icon.url=m.url),!m.json||d.icon.json&&"{"==d.icon.json[0]||(d.icon.json=m.json.replace("{jsondata}",d.icon.json)),d.zindex=m.zindex,void 0===d.icon.anchor&&(d.icon.anchor=m.anchor),void 0===d.icon.origin&&(d.icon.origin=m.origin),void 0===d.icon.size&&(d.icon.size=m.size),d.merged=!0),d);var d,m=y+"-"+v[o].type+"-"+v[o].itemId+"-"+v[o].icon.url+"-"+v[o].location[0]+"-"+v[o].location[1];t[m]=1,u<I||u>k||!L(v[o],c,r)||(s[m]=1,h.get(m))||(d=new IconItem(v[o],M(y,v[o])),h.put(m,d))}var g,f=h.keys();for(g in f){var l=f[g],p=h.get(l);0==p.status?t[l]?s[l]&&(p.status=1,a.push(p.gmapsMarker)):h.remove(l):t[l]?s[l]||(p.status=0,i.push(p.gmapsMarker)):(i.push(p.gmapsMarker),h.remove(l))}n.removeMarkers(i,!0),n.addMarkers(a,!0),0<h.values().length&&$(document).trigger("layerRefreshed-iconsAdded."+y,[y,a])},L=function(e,r,n){return n.CoordinateIsContained(e.location[0],e.location[1],r)};return n},IconItem=function(e,r){var n={};return n.icon=e,n.gmapsMarker=r,n.status=0,n};
var KmlManager=function(map,appHelper){var publicItem={},layers=new Hashtable;return publicItem.AddLayer=function(layerId,config){var kmlOptions,url,cacheTime,kmlLayer,layer;layers.get(layerId)||("Kml"==config.type?MapComp.isLibre?MapComp.addKmlLayer({layerId:layerId,config:config}):(kmlOptions={clickable:config.clickable,suppressInfoWindows:!0,preserveViewport:!0,map:map},config.url&&(url=URI(config.url),cacheTime=5,0<config.cacheTime&&(cacheTime=config.cacheTime/60),url.addSearch("t",roundDateToDuration(moment(),moment.duration(cacheTime,"minutes"),"floor").unix()),url.addSearch("lang",Cookies.get("_culture")).toString(),kmlLayer=new google.maps.KmlLayer(url.toString(),kmlOptions),config.suppressInfoWindow||kmlLayer.addListener("click",function(l){if(!l.domEvent||!appHelper.centerTooltip.clickInsideTooltip(l.domEvent.x,l.domEvent.y)){let e=l.featureData.description;var a="<div>"===e.slice(0,5)&&"</div>"===e.slice(e.length-6,e.length);e="<div class='map-tooltip'>"+(e=a?e.slice(0,4)+" class='kmlTooltip'"+e.slice(4,e.length):e)+"</div>",appHelper.showInfoWindow(e,null,!0,l.latLng,layerId,!0,!1,l.pixelOffset)}}),layers.put(layerId,kmlLayer))):"GeoJson"==config.type&&(MapComp.isLibre?console.log("TODO: add map libre GeoJson layer"):(layer=new google.maps.Data,layer.loadGeoJson(config.url),config.styleOptions&&layer.setStyle(JSON.parse(config.styleOptions)),layer.setMap(map),layers.put(layerId,layer),config.suppressInfoWindow||layer.addListener("click",function(event){appHelper.showInfoWindow(eval("`"+config.infoWindowTemplate+"`"),null,!0,event.latLng,null,!0,!0)}))))},publicItem.RemoveLayer=function(e){MapComp.isLibre?MapComp.removeKmlLayer({layerId:e}):layers.get(e)&&(layers.get(e).setMap(null),layers.remove(e))},publicItem.GetLayer=function(e){return layers.get(e)},publicItem.Refresh=function(e){for(var l=[...layers.keys()],a=0;a<l.length;a++)publicItem.RemoveLayer(l[a]);for(a=0;a<l.length;a++)publicItem.AddLayer(l[a],e[l[a]])},publicItem};
let MapFctns=function(){if(MapFctns.instance)return MapFctns.instance;var e={};function f(e){var e=e.split(","),o=[];if(MapComp.isGoogle)for(var t of e){t=t.trim().split(" "),t=new google.maps.LatLng(t[1],t[0]);o.push(t)}else for(var n of e){n=n.trim().split(" ");o.push([parseFloat(n[0]),parseFloat(n[1])])}return o}e.CoordinateIsContained=function(e,o,t){return t.contains(new google.maps.LatLng(e,o))},e.GetMapBoundsObject=function(e){return e.getBounds()},e.GetMapSwLatLng=function(e){return e.getBounds().getSouthWest()},e.GetMapSpanLatLng=function(e){return e.getBounds().toSpan()},e.GetPolygonFromWKT=function(t){if(""!=t){var n=[];let e=!1;-1!==t.indexOf("MULTIPOLYGON")&&(e=!0,t=t.substring(t.indexOf("(")+1,t.length-1));var r=/\)\)(\s?,\s?)\(\(/g,s=/\(([^()]+)\)/g,i=[];let o;if(e){let e=0;for(;o=r.exec(t);){var a=[],l=t.substring(e,o.index+2);for(e=o.index+2;o=s.exec(l);)a.push(f(o[1]));i.push(a)}for(rings=[],polygonWKT=t.substring(e);o=s.exec(polygonWKT);)rings.push(f(o[1]))}else for(rings=[];o=s.exec(t);)rings.push(f(o[1]));if(i.push(rings),MapComp.isGoogle)for(const u of i){var g=new google.maps.Polygon({paths:u,strokeColor:resources.EventPolygonStrokeColor,strokeOpacity:resources.EventPolygonStrokeOpacity,strokeWeight:resources.EventPolygonStrokeWeight,fillColor:resources.EventPolygonFillColor,fillOpacity:resources.EventPolygonFillOpacity});n.push(g)}else for(const c of i){var p={paths:c,strokeColor:resources.EventPolygonStrokeColor,strokeOpacity:parseFloat(resources.EventPolygonStrokeOpacity),strokeWeight:parseFloat(resources.EventPolygonStrokeWeight),fillColor:resources.EventPolygonFillColor,fillOpacity:parseFloat(resources.EventPolygonFillOpacity)};n.push(p)}return n}},e.getPolygonBounds=function(e){var o,t=new google.maps.LatLngBounds;for(o of e){var n=o.getPaths();for(let e=0;e<n.getLength();e++){var r=n.getAt(e);for(let e=0;e<r.getLength();e++){var s=r.getAt(e);t.extend(s)}}}return t},e.fitMapToRoute=function(l,o){if(MapComp.isLibre)MapComp.fitMapToBound(o);else{let a=new google.maps.LatLngBounds,e=google.maps.event.addListenerOnce(l,"bounds_changed",function(e){var o=a.getNorthEast(),t=a.getSouthWest();let n=t.lng(),r=o.lng();var s=l.getZoom(),s=360/Math.pow(2,s)/256,i=$("#sideBarColContainer"),i=(i&&i.is(":visible")&&Modernizr.mq("(min-width: 993px)")&&(n-=s*i.outerWidth(!0)),$("#layerSelection"));i&&i.is(":visible")&&Modernizr.mq("(min-width: 993px)")&&(r+=s*i.outerWidth(!0)),g(l,o.lat(),n,t.lat(),r)});a=t(l,o,a),setTimeout(function(){google.maps.event.removeListener(e)},3e3)}};let t=function(e,o,t){for(var n of o)t.extend(new google.maps.LatLng(n.point.latitude,n.point.longitude));return e.fitBounds(t),e.panBy(0,0),t},g=function(e,o,t,n,r){var s=new google.maps.LatLngBounds;s.extend(new google.maps.LatLng(o,t)),s.extend(new google.maps.LatLng(n,r)),e.fitBounds(s),e.panBy(0,0)};return MapFctns.instance=e};
var SaveMapViewControl=function(e,t){e.className="saveMapViewControlContainer customMapCtrl";var a=document.createElement("div"),e=(a.className="saveMapViewControl",e.appendChild(a),document.createElement("i")),o=(e.className="far fa-save",e.setAttribute("title",resources.SaveMapView),e.setAttribute("aria-label",resources.SaveMapView),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),a.appendChild(e),document.createElement("i"));o.className="far fa-map-marked",o.setAttribute("title",resources.GoToMapView),o.setAttribute("aria-label",resources.GoToMapView),o.setAttribute("role","button"),o.setAttribute("tabindex","0"),a.appendChild(o),google.maps.event.addDomListener(e,"click",function(){saveMapViewInfo(t)}),google.maps.event.addDomListener(e,"keydown",function(e){"Enter"!==e.code&&"Space"!==e.code||saveMapViewInfo(t)}),google.maps.event.addDomListener(o,"click",function(){setMapViewInfo(t)}),google.maps.event.addDomListener(o,"keydown",function(e){"Enter"!==e.code&&"Space"!==e.code||setMapViewInfo(t)})},saveMapViewInfo=function(e){e={lat:e.getCenter().lat(),lng:e.getCenter().lng(),zoom:e.getZoom()};Cookies.set("_saveMapView",JSON.stringify(e),{expires:365,path:"/"}),$(".map-feedback-msg span").html(resources.SaveMapViewSuccess),$(".map-feedback-msg").show().delay(3e3).fadeOut()},setMapViewInfo=function(e){var t,a;null!=Cookies.get("_saveMapView")?(t=JSON.parse(Cookies.get("_saveMapView")),a=new google.maps.LatLng(t.lat,t.lng),e.panTo(a),t.zoom&&e.setZoom(t.zoom)):($(".map-feedback-msg span").html(resources.GoToMapViewError),$(".map-feedback-msg").show().delay(3e3).fadeOut())},mobileToggleMapModeControl=function(e,t){e.className="darkModeControlContainer customMapCtrl";var a=document.createElement("div"),e=(a.className="darkModeControl",e.appendChild(a),document.createElement("i"));e.className="fas fa-adjust",e.setAttribute("title",resources.ToggleDarkLightMap),e.setAttribute("aria-label",resources.ToggleDarkLightMap),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),a.appendChild(e)};
function MarkerClusterer(t,e,r,s){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=t,this.oms_=s,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var s=r||{},i=(this.gridSize_=s.gridSize||60,this.minClusterSize_=s.minimumClusterSize||2,this.maxZoom_=s.maxZoom||null,this.styles_=s.styles||[],this.imagePath_=s.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=s.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,null!=s.zoomOnClick&&(this.zoomOnClick_=s.zoomOnClick),this.averageCenter_=!1,null!=s.averageCenter&&(this.averageCenter_=s.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom(),this);google.maps.event.addListener(this.map_,"zoom_changed",function(){var t=i.map_.getZoom();i.prevZoom_!=t&&(i.prevZoom_=t,i.resetViewport())}),e&&e.length&&this.addMarkers(e,!1)}function Cluster(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,t.getStyles(),t.getGridSize())}function ClusterIcon(t,e,r){t.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.styles_=e,this.padding_=r||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m",MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",MarkerClusterer.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var t,e=0;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var t,e=this.getMarkers(),r=new google.maps.LatLngBounds,s=0;t=e[s];s++)r.extend(t.getPosition());this.map_.fitBounds(r),this.map_.panBy(0,0)},MarkerClusterer.prototype.setStyles=function(t){this.styles_=t},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.setMaxZoom=function(t){this.maxZoom_=t},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.calculator_=function(t,e){for(var r=0,t=t.length,s=t;0!==s;)s=parseInt(s/10,10),r++;return{text:t,index:r=Math.min(r,e)}},MarkerClusterer.prototype.setCalculator=function(t){this.calculator_=t},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(t,e){for(var r,s=0;r=t[s];s++)r.preventClustering||this.oms_.addMarker(r),this.pushMarkerTo_(r);e||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(t){var e;t.isAdded=!1,t.draggable&&(e=this,google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})),this.markers_.push(t)},MarkerClusterer.prototype.addMarker=function(t,e){t.preventClustering||this.oms_.addMarker(t),this.pushMarkerTo_(t),e||this.redraw()},MarkerClusterer.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r,s=0;r=this.markers_[s];s++)if(r==t){e=s;break}return-1!=e&&(t.setMap(null),t.clustered=!0,google.maps.event.trigger(t,"marker-clustered",!0),this.markers_.splice(e,1),!0)},MarkerClusterer.prototype.removeMarker=function(t,e){this.oms_.removeMarker(t);t=this.removeMarker_(t);return!(e||!t||(this.resetViewport(),this.redraw(),0))},MarkerClusterer.prototype.removeMarkers=function(t,e){for(var r=!1,s=0;i=t[s];s++){this.oms_.removeMarker(i);var i=this.removeMarker_(i),r=r||i}if(!e&&r)return this.resetViewport(),this.redraw(),!0},MarkerClusterer.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(t){this.map_=t},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(t){this.gridSize_=t},MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},MarkerClusterer.prototype.getExtendedBounds=function(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),s=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),r=e.fromLatLngToDivPixel(r),s=(r.x+=this.gridSize_,r.y-=this.gridSize_,e.fromLatLngToDivPixel(s)),r=(s.x-=this.gridSize_,s.y+=this.gridSize_,e.fromDivPixelToLatLng(r)),e=e.fromDivPixelToLatLng(s);return t.extend(r),t.extend(e),t},MarkerClusterer.prototype.isMarkerInBounds_=function(t,e){return!!t.getPosition&&e.contains(t.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},MarkerClusterer.prototype.resetViewport=function(t){for(var e,r=0;e=this.clusters_[r];r++)e.remove();for(var s,r=0;s=this.markers_[r];r++)s.isAdded=!1,t&&s.setMap(null);this.clusters_=[]},MarkerClusterer.prototype.repaint=function(){var r=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var t,e=0;t=r[e];e++)t.remove()},0)},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.distanceBetweenPoints_=function(t,e){var r,s;return t&&e?(s=(e.lat()-t.lat())*Math.PI/180,r=(e.lng()-t.lng())*Math.PI/180,s=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2),6371*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))):0},MarkerClusterer.prototype.addToClosestCluster_=function(t){for(var e,r=4e4,s=null,i=(t.getPosition(),0);e=this.clusters_[i];i++){var o=e.getCenter();o&&(o=this.distanceBetweenPoints_(o,t.getPosition()))<r&&(r=o,s=e)}s&&s.isMarkerInClusterBounds(t)?s.addMarker(t):((e=new Cluster(this)).addMarker(t),this.clusters_.push(e))},MarkerClusterer.prototype.createClusters_=function(){if(this.ready_)for(var t,e=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),r=this.getExtendedBounds(e),s=0;t=this.markers_[s];s++)!t.isAdded&&this.isMarkerInBounds_(t,r)&&this.addToClosestCluster_(t)},Cluster.prototype.isMarkerAlreadyAdded=function(t){if(this.markers_.indexOf)return-1!=this.markers_.indexOf(t);for(var e,r=0;e=this.markers_[r];r++)if(e==t)return!0;return!1},Cluster.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded(t))return!1;this.center_?this.averageCenter_&&(r=this.markers_.length+1,e=(this.center_.lat()*(r-1)+t.getPosition().lat())/r,r=(this.center_.lng()*(r-1)+t.getPosition().lng())/r,this.center_=new google.maps.LatLng(e,r),this.calculateBounds_()):(this.center_=t.getPosition(),this.calculateBounds_()),t.isAdded=!0,t.preventClustering||this.markers_.push(t);var e,r,s=this.markers_.length;if((s<this.minClusterSize_||t.preventClustering)&&(t.getMap()!=this.map_&&t.setMap(this.map_),t.clustered=!1,google.maps.event.trigger(t,"marker-clustered",!1)),s==this.minClusterSize_)for(var i=0;i<s;i++)this.markers_[i].setMap(null),this.markers_[i].clustered=!0,google.maps.event.trigger(this.markers_[i],"marker-clustered",!0);return s>=this.minClusterSize_&&!t.preventClustering&&(t.setMap(null),t.clustered=!0,google.maps.event.trigger(t,"marker-clustered",!0)),this.updateIcon(),!0},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var t,e=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),s=0;t=r[s];s++)e.extend(t.getPosition());return e},Cluster.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},Cluster.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&e<t)for(var r,s=0;r=this.markers_[s];s++)r.map!==this.map_&&(r.setMap(this.map_),r.clustered=!1,google.maps.event.trigger(r,"marker-clustered",!1));else this.markers_.length<this.minClusterSize_?this.clusterIcon_.hide():(e=this.markerClusterer_.getStyles().length,t=this.markerClusterer_.getCalculator()(this.markers_,e),this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(t),this.clusterIcon_.show())},ClusterIcon.prototype.triggerClusterClick=function(t){var e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e,"clusterclick",this.cluster_,t),e.isZoomOnClick()&&(this.map_.fitBounds(this.cluster_.getBounds()),this.map_.panBy(0,0))},ClusterIcon.prototype.onAdd=function(){var t;this.div_=document.createElement("DIV"),this.visible_&&(t=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text);this.getPanes().overlayMouseTarget.appendChild(this.div_);var e=this;google.maps.event.addDomListener(this.div_,"click",function(t){t.stopPropagation(),e.triggerClusterClick(t)})},ClusterIcon.prototype.getPosFromLatLng_=function(t){t=this.getProjection().fromLatLngToDivPixel(t);return"object"==typeof this.iconAnchor_&&2===this.iconAnchor_.length?(t.x-=this.iconAnchor_[0],t.y-=this.iconAnchor_[1]):(t.x-=parseInt(this.width_/2,10),t.y-=parseInt(this.height_/2,10)),t},ClusterIcon.prototype.draw=function(){var t;this.visible_&&(t=this.getPosFromLatLng_(this.center_),this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px")},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){var t;this.div_&&(t=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(t),this.div_.style.display=""),this.visible_=!0},ClusterIcon.prototype.remove=function(){this.setMap(null)},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.setSums=function(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()},ClusterIcon.prototype.useStyle=function(){var t=Math.max(0,this.sums_.index-1),t=Math.min(this.styles_.length-1,t),t=this.styles_[t];this.url_=t.url,this.height_=t.height,this.width_=t.width,this.textColor_=t.textColor,this.anchor_=t.anchor,this.textSize_=t.textSize,this.backgroundPosition_=t.backgroundPosition,this.iconAnchor_=t.iconAnchor},ClusterIcon.prototype.setCenter=function(t){this.center_=t},ClusterIcon.prototype.createCss=function(t){var e=[],r=(e.push("background-image:url("+this.url_+");"),this.backgroundPosition_||"0 0"),r=(e.push("background-position:"+r+";"),"object"==typeof this.anchor_?("number"==typeof this.anchor_[0]&&0<this.anchor_[0]&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):"number"==typeof this.anchor_[0]&&this.anchor_[0]<0&&-this.anchor_[0]<this.height_?e.push("height:"+this.height_+"px; line-height:"+(this.height_+this.anchor_[0])+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),"number"==typeof this.anchor_[1]&&0<this.anchor_[1]&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;"),this.textColor_||"black"),s=this.textSize_||11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+r+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")};
function getMobileOs(){var n=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(n)?"Windows Phone":/android/i.test(n)?"Android":["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document?"iOS":"unknown"}
var noPanOffEarth=function(g){var o=new google.maps.LatLngBounds(new google.maps.LatLng(-75.05113,-180),new google.maps.LatLng(75.05113,180));google.maps.event.addListener(g,"center_changed",function(){var n,a,e,t;t=g.getCenter(),t=new google.maps.LatLng(t.lat(),t.lng(),!1),o.contains(t)||(n=t.lng(),t=t.lat(),(a=o.getNorthEast().lat())<(t=t<(e=o.getSouthWest().lat())?e:t)&&(t=a),g.panTo(new google.maps.LatLng(t,n)))})};
!function(){var t,s,e,o,f={}.hasOwnProperty,g=[].slice;this.OverlappingMarkerSpiderfier=function(){function t(t,e){var r,i,n,s,o;for(r in this.map=t,null==e&&(e={}),null==this.constructor.N&&(this.constructor.N=!0,c=google.maps,u=c.event,a=c.MapTypeId,l.keepSpiderfied=!1,l.ignoreMapClick=!1,l.markersWontHide=!1,l.markersWontMove=!1,l.basicFormatEvents=!1,l.nearbyDistance=20,l.circleSpiralSwitchover=9,l.circleFootSeparation=23,l.circleStartAngle=h/12,l.spiralFootSeparation=26,l.spiralLengthStart=11,l.spiralLengthFactor=4,l.spiderfiedZIndex=c.Marker.MAX_ZINDEX+2e4,l.highlightedLegZIndex=c.Marker.MAX_ZINDEX+1e4,l.usualLegZIndex=c.Marker.MAX_ZINDEX+1,l.legWeight=1.5,l.legColors={usual:{},highlighted:{}},t=l.legColors.usual,i=l.legColors.highlighted,t[a.HYBRID]=t[a.SATELLITE]="#fff",i[a.HYBRID]=i[a.SATELLITE]="#f00",t[a.TERRAIN]=t[a.ROADMAP]="#444",i[a.TERRAIN]=i[a.ROADMAP]="#f00",this.constructor.j=function(t){return this.setMap(t)},this.constructor.j.prototype=new c.OverlayView,this.constructor.j.prototype.draw=function(){}),e)f.call(e,r)&&(i=e[r],this[r]=i);this.g=new this.constructor.j(this.map),this.C(),this.c={},this.B=this.l=null,this.addListener("click",function(t,e){return u.trigger(t,"spider_click",e)}),this.addListener("format",function(t,e){return u.trigger(t,"spider_format",e)}),this.ignoreMapClick||u.addListener(this.map,"click",(n=this,function(){return n.unspiderfy()})),u.addListener(this.map,"maptypeid_changed",(s=this,function(){return s.unspiderfy()})),u.addListener(this.map,"zoom_changed",(o=this,function(){if(o.unspiderfy(),!o.basicFormatEvents)return o.h()}))}for(var u,c,a,h,l=t.prototype,e=[t,l],r=0,i=e.length;r<i;r++)e[r].VERSION="1.0.3";return h=2*Math.PI,c=u=a=null,t.markerStatus={SPIDERFIED:"SPIDERFIED",SPIDERFIABLE:"SPIDERFIABLE",UNSPIDERFIABLE:"UNSPIDERFIABLE",UNSPIDERFIED:"UNSPIDERFIED"},l.C=function(){this.a=[],this.s=[]},l.addMarker=function(t,e){return t.setMap(this.map),this.trackMarker(t,e)},l.trackMarker=function(e,t){var r,i,n,s;return null==e._oms&&(e._oms=!0,r=[u.addListener(e,"click",(i=this,function(t){return i.V(e,t)}))],this.markersWontHide||r.push(u.addListener(e,"visible_changed",(n=this,function(){return n.D(e,!1)}))),this.markersWontMove||r.push(u.addListener(e,"position_changed",(s=this,function(){return s.D(e,!0)}))),null!=t&&r.push(u.addListener(e,"spider_click",t)),this.s.push(r),this.a.push(e),this.basicFormatEvents?this.trigger("format",e,this.constructor.markerStatus.UNSPIDERFIED):(this.trigger("format",e,this.constructor.markerStatus.UNSPIDERFIABLE),this.h())),this},l.D=function(t,e){if(!this.J&&!this.K)return null==t._omsData||!e&&t.getVisible()||this.unspiderfy(e?t:null),this.h()},l.getMarkers=function(){return this.a.slice(0)},l.removeMarker=function(t){return this.forgetMarker(t),t.setMap(null)},l.forgetMarker=function(t){var e,r,i,n,s;if(null!=t._omsData&&this.unspiderfy(),!((e=this.A(this.a,t))<0)){for(r=0,i=(s=this.s.splice(e,1)[0]).length;r<i;r++)n=s[r],u.removeListener(n);delete t._oms,this.a.splice(e,1),this.h()}return this},l.removeAllMarkers=l.clearMarkers=function(){var t,e,r=this.getMarkers();for(this.forgetAllMarkers(),t=0,e=r.length;t<e;t++)r[t].setMap(null);return this},l.forgetAllMarkers=function(){var t,e,r,i,n,s,o,a;for(this.unspiderfy(),t=e=0,r=(a=this.a).length;e<r;t=++e){for(s=a[t],o=0,t=(n=this.s[t]).length;o<t;o++)i=n[o],u.removeListener(i);delete s._oms}return this.C(),this},l.addListener=function(t,e){var r;return(null!=(r=this.c)[t]?r[t]:r[t]=[]).push(e),this},l.removeListener=function(t,e){e=this.A(this.c[t],e);return e<0||this.c[t].splice(e,1),this},l.clearListeners=function(t){return this.c[t]=[],this},l.trigger=function(){for(var t,e=arguments[0],r=2<=arguments.length?g.call(arguments,1):[],i=[],n=0,s=(e=null!=(t=this.c[e])?t:[]).length;n<s;n++)t=e[n],i.push(t.apply(null,r));return i},l.L=function(t,e){for(var r,i=this.circleFootSeparation*(2+t)/h,n=h/t,s=[],o=r=0;0<=t?r<t:t<r;o=0<=t?++r:--r)o=this.circleStartAngle+o*n,s.push(new c.Point(e.x+i*Math.cos(o),e.y+i*Math.sin(o)));return s},l.M=function(t,e){for(var r,i=this.spiralLengthStart,n=0,s=[],o=r=0;0<=t?r<t:t<r;o=0<=t?++r:--r)n+=this.spiralFootSeparation/i+5e-4*o,o=new c.Point(e.x+i*Math.cos(n),e.y+i*Math.sin(n)),i+=h*this.spiralLengthFactor/n,s.push(o);return s},l.V=function(t,e){var r,i,n,s,o,a,h,l,u;if((a=null!=t._omsData)&&this.keepSpiderfied||this.unspiderfy(),a||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",t,e);for(a=[],h=[],l=(r=this.nearbyDistance)*r,o=this.f(t.position),r=0,i=(u=this.a).length;r<i;r++)null!=(n=u[r]).map&&n.getVisible()&&(s=this.f(n.position),this.i(s,o)<l?a.push({R:n,G:s}):h.push(n));return 1===a.length?this.trigger("click",t,e):this.W(a,h)},l.markersNearMarker=function(t,e){var r,i,n,s,o,a,h,l;if(null==e&&(e=!1),null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";for(a=(r=this.nearbyDistance)*r,s=this.f(t.position),o=[],r=0,i=(h=this.a).length;r<i&&!((n=h[r])!==t&&null!=n.map&&n.getVisible()&&(l=this.f(null!=(l=null!=(l=n._omsData)?l.v:void 0)?l:n.position),this.i(l,s)<a)&&(o.push(n),e));r++);return o},l.F=function(){var t,e,r,i,n,s,o,a,h,l,u,c;if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";for(h=this.nearbyDistance,h*=h,c=[],l=0,e=(n=this.a).length;l<e;l++)i=n[l],c.push({H:this.f(null!=(t=null!=(r=i._omsData)?r.v:void 0)?t:i.position),b:!1});for(t=r=0,i=(l=this.a).length;r<i;t=++r)if(null!=(e=l[t]).getMap()&&e.getVisible()&&!(s=c[t]).b)for(e=a=0,n=(u=this.a).length;a<n;e=++a)if(o=u[e],e!==t&&null!=o.getMap()&&o.getVisible()&&(o=c[e],!(e<t)||o.b)&&this.i(s.H,o.H)<h){s.b=o.b=!0;break}return c},l.markersNearAnyOtherMarker=function(){for(var t,e,r=this.F(),i=this.a,n=[],s=t=0,o=i.length;t<o;s=++t)e=i[s],r[s].b&&n.push(e);return n},l.setImmediate=function(t){return window.setTimeout(t,0)},l.h=function(){if(!this.basicFormatEvents&&null==this.l)return this.l=this.setImmediate((t=this,function(){return(t.l=null)!=t.g.getProjection()?t.w():null!=t.B?void 0:t.B=u.addListenerOnce(t.map,"idle",function(){return t.w()})}));var t},l.w=function(){var t,e,r,i,n,s,o;if(this.basicFormatEvents){for(n=[],e=0,r=markers.length;e<r;e++)t=null!=(i=markers[e])._omsData?"SPIDERFIED":"UNSPIDERFIED",n.push(this.trigger("format",i,this.constructor.markerStatus[t]));return n}for(n=this.F(),o=[],t=r=0,e=(s=this.a).length;r<e;t=++r)t=null!=(i=s[t])._omsData?"SPIDERFIED":n[t].b?"SPIDERFIABLE":"UNSPIDERFIABLE",o.push(this.trigger("format",i,this.constructor.markerStatus[t]));return o},l.P=function(t){return{m:function(){return t._omsData.o.setOptions({strokeColor:r.legColors.highlighted[r.map.mapTypeId],zIndex:r.highlightedLegZIndex})},u:(e=r=this,function(){return t._omsData.o.setOptions({strokeColor:e.legColors.usual[e.map.mapTypeId],zIndex:e.usualLegZIndex})})};var e,r},l.W=function(i,t){var e,n,s,o,a,h,l,r;return this.J=!0,r=i.length,e=this.T(function(){for(var t=[],e=0,r=i.length;e<r;e++)h=i[e],t.push(h.G);return t}()),o=r>=this.circleSpiralSwitchover?this.M(r,e).reverse():this.L(r,e),e=function(){for(var t=[],e=0,r=o.length;e<r;e++)s=o[e],n=this.U(s),l=this.S(i,function(e){return function(t){return e.i(t.G,s)}}(this)),l=l.R,a=new c.Polyline({map:this.map,path:[l.position,n],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight,zIndex:this.usualLegZIndex}),l._omsData={v:l.getPosition(),X:l.getZIndex(),o:a},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(a=this.P(l),l._omsData.O={m:u.addListener(l,"mouseover",a.m),u:u.addListener(l,"mouseout",a.u)}),this.trigger("format",l,this.constructor.markerStatus.SPIDERFIED),l.setPosition(n),l.setZIndex(Math.round(this.spiderfiedZIndex+s.y)),t.push(l);return t}.call(this),delete this.J,this.I=!0,this.trigger("spiderfy",e,t)},l.unspiderfy=function(t){var e,r,i,n,s,o,a;if(null==t&&(t=null),null!=this.I){for(this.K=!0,a=[],s=[],e=0,r=(o=this.a).length;e<r;e++)(null!=(n=o[e])._omsData?(n._omsData.o.setMap(null),n!==t&&n.setPosition(n._omsData.v),n.setZIndex(n._omsData.X),null!=(i=n._omsData.O)&&(u.removeListener(i.m),u.removeListener(i.u)),delete n._omsData,n!==t&&(i=this.basicFormatEvents?"UNSPIDERFIED":"SPIDERFIABLE",this.trigger("format",n,this.constructor.markerStatus[i])),a):s).push(n);delete this.K,delete this.I,this.trigger("unspiderfy",a,s)}return this},l.i=function(t,e){var r=t.x-e.x,t=t.y-e.y;return r*r+t*t},l.T=function(t){for(var e,r,i,n=r=i=0,s=t.length;n<s;n++)r+=(e=t[n]).x,i+=e.y;return t=t.length,new c.Point(r/t,i/t)},l.f=function(t){return this.g.getProjection().fromLatLngToDivPixel(t)},l.U=function(t){return this.g.getProjection().fromDivPixelToLatLng(t)},l.S=function(t,e){for(var r,i,n,s,o=s=0,a=t.length;s<a;o=++s)n=e(t[o]),(null==r||n<i)&&(i=n,r=o);return t.splice(r,1)[0]},l.A=function(t,e){var r,i,n;if(null!=t.indexOf)return t.indexOf(e);for(r=i=0,n=t.length;i<n;r=++i)if(t[r]===e)return r;return-1},t}(),s=/(\?.*(&|&amp;)|\?)spiderfier_callback=(\w+)/,null!=(t=null==(t=document.currentScript)?function(){for(var t,e=document.getElementsByTagName("script"),r=[],i=0,n=e.length;i<n;i++)null!=(t=(o=e[i]).getAttribute("src"))&&t.match(s)&&r.push(o);return r}()[0]:t)&&(t=null!=(e=t.getAttribute("src"))&&null!=(e=e.match(s))?e[3]:void 0)&&"function"==typeof window[t]&&window[t](),"function"==typeof window.spiderfier_callback&&window.spiderfier_callback()}.call(this);
var PolylineManager=function(u,y){var e={},d=[],c=new MapFctns,g=(e.AddPolylineLayer=function(e,n,r,a,i,o,l,t,f,s){if(-1!=g(e))throw"layerid is already active.";e=new PolylineLayer(e,n,r,a,i,o,l,t,f,s,y);d.push(e),e.MapChanged(u,c)},e.GetPolylines=function(e){for(var n=0;n<d.length;n++)if(d[n].layerId==e)return d[n].layerPolyLines()},e.RemovePolylineLayer=function(e){e=g(e);-1!=e&&(d[e].Delete(),d.splice(e,1))},e.RefreshLayers=function(e){var n=0,r=0;if(d.length)for(var a in $(document).on("layerRefreshed-polylineManager.internal",function(){++r==n&&($(document).trigger("layersRefreshed-polylineManager"),$(document).unbind("layerRefreshed-polylineManager.internal"))}),n=d.length,d)d[a].RefreshLayer(u,c,e);else $(document).trigger("layersRefreshed-polylineManager")},e.RefreshLayer=function(e,n){for(var r in d){r=d[r];if(r.layerId==e)return void r.RefreshLayer(u,c,n)}},e.MapChanged=function(){if(MapComp.isGoogle)for(var e in d)d[e].MapChanged(u,c);$(document).trigger("mapChangedFinished-polylineManager")},function(e){for(var n in d)if(d[n].layerId===e)return n;return-1});return e},PolylineLayer=function(o,l,t,f,s,u,y,n,i,e,d){var c={},g=!1,p=null;function h(e){for(var n in oldPolylines=p,p=[],l){var r,a={strokeColor:l[n].lineColor,strokeOpacity:null==l[n].icons?t:0,strokeWeight:f,zIndex:s,map:null,path:l[n].decodedPoints,icons:l[n].icons},i=new google.maps.Polyline(a);for(r in e&&google.maps.event.addListener(i,"click",function(n){return e=>{d(o,n,null,e.latLng,20)}}(l[n].id)),i.canDraw=!0,oldPolylines)l[n].id==oldPolylines[r].sourceData.id&&(i.canDraw=oldPolylines[r].gMapLine.canDraw);p.push({gMapLine:i,sourceData:l[n]})}$(document).trigger("polylineLayer-polylinesBuilt",[o,p])}c.layerId=o,h(),c.layerPolyLines=function(){return p},c.RefreshLayer=function(r,a,e){n(function(e,n){g||(l=e,M(),h(n),c.MapChanged(r,a)),$(document).trigger("layerRefreshed-polylineManager",[o])},i,e)},c.MapChanged=function(e,n){if(!MapComp.isLibre){var r=e.getZoom();if(y<r||r<u)for(var a in p)p[a].gMapLine.setMap(null);else{var i=n.GetMapBoundsObject(e);for(a in p){var o,l=p[a].gMapLine,t=!1,f=l.getPath().getArray();for(o in f){var s=f[o];if(n.CoordinateIsContained(s.lat(),s.lng(),i)){t=!0;break}}l.setMap(t&&l.canDraw?e:null)}}}},c.Delete=function(){g=!0,M()};var M=function(){for(var e in p)p[e].gMapLine.setMap(null)};return c};
var cctvIntervalIds=[],cctvPictures=[],activeSliders=[],cctvRefreshInterval=2e3;$(function(){function r(){for(var e=0;e<cctvIntervalIds.length;e++)clearInterval(cctvIntervalIds[e]);if(cctvIntervalIds=[],document.getElementById("map-canvas")){for(e=0;e<activeSliders.length;e++)void 0!==activeSliders[e]&&activeSliders[e].slick("unslick");activeSliders=[]}}$(document).on("cameraImagesInitialized",function(e,t){r(),$(".carouselCctvImage").each(function(e){activeSliders.push(setupSlickCarousel($(this)))}),$(".cctvImage").one("load",function(){var e=$(this).prev(),e=(e.hasClass("agencyLogo")&&e.show(),$("button.showVideo")),t=0<$(".camTooltip").length||0<$(".myCamTooltip").length;e&&0<e.length&&"True"==resources.StartVideoOnDisplay&&t&&e[0].click()}).each(function(){this.complete&&$(this).trigger("load")}),$(".cctvCameraCarousel").hasClass("setVisibility")&&$(".cctvCameraCarousel").removeClass("setVisibility");var a={},s=[];$(".cctvImage").each(function(){var e=$(this).attr("data-refresh-rate");e&&!a[e]&&0<e&&(s.push(e),a[e]=!0)});for(var c=0;c<s.length;c++)cctvIntervalIds.push(setInterval(function(e){$('.cctvImage[data-refresh-rate="'+e+'"]').each(function(){0!=$(this).parents(".slick-slide").length&&!$(this).parents(".slick-slide").hasClass("slick-active")||null==$(this).attr("src")||$(this).attr("src",URI($(this).attr("src")).search("t="+roundDateToDuration(moment().startOf("second"),moment.duration(parseInt(e)),"floor").unix())),0<$(this).parents(".slick-slide").length&&!$(this).parents(".slick-slide").hasClass("slick-active")&&$(this).attr("data-needsrefresh","true")})},s[c],s[c]));{let e=document.querySelector(".map-tooltip");(e=(e=(e=(e=e||document.querySelector("#cctvTable tbody"))||document.querySelector("#myCctvTable tbody"))||document.querySelector("#eventTable tbody"))||document.querySelector(".list-page tbody"))&&$(document).trigger("setup-fullscreen-img-modal",[e,t])}}),$(document).on("cameraImagesClearIntervals",function(){r()})});
var TileManager=function(s,y){var e,t,i={},a=((new Date).getTime(),null),m={},g=null,h=null,n=(i.AddTileLayer=function(a,r){if(MapComp.isLibre)MapComp.AddTileLayer({layerId:a,...r});else{if(0<p(a).length)throw"layerid is already active.";var e,n=new TileLayer(a,r.urlFormat,r.tooltipUrlFormat,r.animationFrames,r.cache),t=new TileOverlayMapType({name:a,getTileUrl:function(e,t,i,a){var n=s.getZoom();return n>r.maxZoom||n<r.minZoom?null:e.getTileUrl(t.x,t.y,i,a)},tileSize:new google.maps.Size(256,256),isPng:!0,opacity:r.opacity,startingFrame:r.startingFrame,startPlaying:r.startPlaying},n,r.animationFrames);if(r.tooltipUrlFormat&&(e=google.maps.event.addListener(s,"click",function(e){var t,i;e.domEvent&&y.centerTooltip.clickInsideTooltip(e.domEvent.x,e.domEvent.y)||(t=e.latLng.lat(),i=e.latLng.lng(),(e=s.getZoom())<=r.maxZoom&&e>=r.minZoom&&$.ajax(n.getTooltipUrl(t,i,e)).done(function(e){y.showInfoWindow(e,null,!0,new google.maps.LatLng(t,i),a,!0,!0),y.centerTooltip.run()}))}),m[a]=e),""!=r.highwayFill||""!=r.highwayStroke){var i=s.get("styles")||[],l=!1,o=!1;if(0!=i.length)for(style in i)if("road.highway"==i[style].featureType&&"geometry.fill"==i[style].elementType){for(styler in i[style].stylers)void 0!==i[style].stylers[styler].color&&(g=i[style].stylers[styler].color,i[style].stylers[styler].color=r.highwayFill,l=!0);l||(i[style].stylers.push({color:r.highwayFill}),l=!0)}else if("road.highway"==i[style].featureType&&"geometry.stroke"==i[style].elementType){for(styler in i[style].stylers)void 0!==i[style].stylers[styler].color&&(h=i[style].stylers[styler].color,i[style].stylers[styler].color=r.highwayStroke,o=!0);o||(tyles[style].stylers.push({color:r.highwayStroke}),o=!0)}l||i.push({featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:r.highwayFill}]}),o||i.push({featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:r.highwayStroke}]}),s.setOptions({styles:i})}0<=r.zlevel?s.overlayMapTypes.insertAt(0,t):s.overlayMapTypes.push(t)}},i.RemoveTileLayer=function(e){if(MapComp.isLibre)MapComp.RemoveTileLayer({layerId:e});else{var t=p(e);if(0<=t.length)for(var i=0;i<t.length;i++)s.overlayMapTypes.getArray()[t[0]].clearAnimationTimer(),s.overlayMapTypes.removeAt(t[0]);var a=s.get("styles");for(style in a)if("road.highway"==a[style].featureType&&"geometry.fill"==a[style].elementType)for(styler in a[style].stylers)a[style].stylers[styler].color&&(a[style].stylers[styler].color=g);else if("road.highway"==a[style].featureType&&"geometry.stroke"==a[style].elementType)for(styler in a[style].stylers)a[style].stylers[styler].color&&(a[style].stylers[styler].color=h);s.setOptions({styles:a}),m[e]&&(google.maps.event.removeListener(m[e]),m[e]=null)}},i.RefreshLayers=function(){e=(new Date).getTime(),(null==a||a<e)&&n()},function(){if(MapComp.isLibre)MapComp.refreshTiles();else for(var e=s.overlayMapTypes.getArray(),t=0;t<e.length;t++){var i=e[t];i.isTileOverlayMapType&&null===i.animationTimer&&i.refreshTiles(!1)}}),p=function(e){for(var t=s.overlayMapTypes.getArray(),i=[],a=0;a<t.length;a++)t[a].name==e&&t[a].isTileOverlayMapType&&i.push(a);return i};return MapComp.isLibre||(t=function(){a=(new Date).getTime()},google.maps.event.addListener(s,"bounds_changed",t),google.maps.event.addListener(s,"zoom_changed",t)),i},TileLayer=function(e,t,i,a,n){var r={},l=t,o=i,s=a;return r.layerId=e,r.getTileUrl=function(e,t,i,a){e=URI.expand(l,{x:e,y:t,z:i});return 0<s?e.addSearch("frame",a):n?e.addSearch("t",moment().startOf("minute").unix()):e.addSearch("tmTime",moment().unix()),e.toString()},r.getTooltipUrl=function(e,t,i){return URI.expand(o,{lat:e,lng:t,z:i}).toString()},r},TileOverlayMapType=function(e,t,i){var o={};if(this.isTileOverlayMapType=!0,this.name=e.name,this.getTileUrl=e.getTileUrl,this.tileSize=e.tileSize,this.isPng=e.isPng,this.tileLayer=t,this.animationCounter=e.startingFrame,this.animationFrames=i,this.opacity=e.opacity,this.startPlaying=e.startPlaying,this.animationTimer=null,this.isAnimating=!1,this.getTile=function(e,t,i){var a,n=this.getTileUrl(this.tileLayer,e,t,this.animationCounter),r="x_"+e.x+"_y_"+e.y+"_zoom_"+t,l=i.createElement("div");return l.style.backgroundPosition="center center",l.style.backgroundRepeat="no-repeat",l.style.height=this.tileSize.height+"px",l.style.width=this.tileSize.width+"px",l.style.opacity=this.opacity,l.tileId=r,l.coord=e,l.zoom=t,l.timestamp=new Date,o[r]=l,n&&((a=new Image).onload=function(){l.style.backgroundImage="url("+n+")",a.onload=null,a=null},a.src=n,0<this.animationFrames)&&(l.img=a),l},this.refreshTiles=function(e){if(0!=e&&0<this.animationFrames){var t=!0;for(const[r,n]of Object.entries(o))if(void 0===n.img||!n.img.complete){t=!1;break}if(this.isAnimating||!t)return;this.animationCounter=(this.animationCounter+1)%this.animationFrames,this.isAnimating=!0}for(var i in o){var a,n=o[i],i=this.getTileUrl(this.tileLayer,n.coord,n.zoom,this.animationCounter);i&&((a=new Image).onload=function(e,t,i){return function(){t.style.backgroundImage="url("+i+")",e.onload=null,e=null}}(a,n,i),a.src=i,0<this.animationFrames)&&(n.img=a)}this.isAnimating=!1},this.getOpacity=function(){return this.opacity},this.releaseTile=function(e){o[e.tileId]&&e.timestamp==o[e.tileId].timestamp&&delete o[e.tileId]},this.clearAnimationTimer=function(){null!=this.animationTimer&&(window.clearInterval(this.animationTimer),this.animationTimer=null,$(document).off("animation-toggle-"+this.name))},0<this.animationFrames){var a=this;const n=parseInt(window.resources.WeatherRadarFramesAnimation);this.startPlaying?a.animationTimer=window.setInterval(function(){a.refreshTiles(),$(document).trigger("animation-update-"+a.name,[a.animationCounter])},n):$(document).trigger("timerbox-update-"+a.name,[a.animationCounter]),$(document).on("animation-toggle-"+a.name,function(e,t){"pause"==t&&a.animationTimer?(window.clearInterval(a.animationTimer),a.animationTimer=null):"play"==t&&(a.animationTimer=window.setInterval(function(){a.refreshTiles(),$(document).trigger("animation-update-"+a.name,[a.animationCounter])},n))})}};
"use strict";var UrlHash=function(){var e=this;this.hashEvent="hashchange.urlHash",this.hashChangeHandler=function(){$(document).trigger("hashChanged-urlHash",[e.hash()])},this.whileWeSetHashHandler=function(){$(window).off(e.hashEvent),$(window).on(e.hashEvent,e.hashChangeHandler)},this.setWhileWeSetHashHandler=function(){$(window).off(e.hashEvent),$(window).on(e.hashEvent,e.whileWeSetHashHandler)},this.clearHash=function(){e.setWhileWeSetHashHandler(),window.location.hash="route"},this.hash=function(h,a){var n=window.location.hash.substr(1);return h&&n!=h&&(e.setWhileWeSetHashHandler(),a?window.location.replace(h):window.location.hash=h),n},$._data(window,"events").hashchange||$(window).on(this.hashEvent,this.hashChangeHandler)},urlHash=new UrlHash;
let UserGeolocation=function(n,i,o,a,l){function t(t){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition?navigator.geolocation.getCurrentPosition(function(o){o=MapComp.latLng(o.coords.latitude,o.coords.longitude);t(o)}):t(null)}let c={};return c.AttemptToSetLocationWithUsersGeolocation=function(e,o){c.GetUserGeolocation(function(o){var t;o&&(MapComp.isGoogle?(t=n.GetCustomSimplePlace("",null,o.lat(),o.lng(),!1),i.SetLocationByGeo(e,t),a.panTo(o)):(t=n.GetCustomSimplePlace("",null,o[1],o[0],!1),i.SetLocationByGeo(e,t),MapComp.clearLocationMarker(),MapComp.methods.zoom.flyTo(17,o,3)))})},c.AttemptToSetWaypointWithUsersGeolocation=function(e){c.GetUserGeolocation(function(o){var t;o&&(MapComp.isGoogle?(t=n.GetCustomSimplePlace("",null,o.lat(),o.lng(),!1),i.SetLocationByGeo(null,t,!0,e),a.panTo(o)):(t=n.GetCustomSimplePlace("",null,o[1],o[0],!1),i.SetLocationByGeo(null,t,!0,e),MapComp.methods.zoom.flyTo(17,o,3)))})},window.SetUserRegion=function(o,t){var e;o&&(e=[o[0],o[1]],l.center(e,parseInt(o[2]),t))},window.GetUserGeolocation=function(o){t(o)},c.GetUserGeolocation=function(o){t(o)},c};
let WaypointManager=function(m,r,o,g){let h={},f=[{selector:"#startLocationText"},{selector:"#endLocationText"}];function l(t,n){let o=0,a=1/0;for(let e=0;e<n.length;e++)-1==n[e].types.indexOf("route")&&-1==n[e].types.indexOf("street_address")||(t.point,i=n[e].geometry.location,r=void 0,r=i.lat(),i=i.lng(),(r=Math.sqrt(Math.pow(t.point.latitude+90-(r+90),2)+Math.pow(t.point.longitude+180-(i+180),2)))<a&&(a=r,o=e));var i,r;return o}function s(e){e.name=e.point.latitude+", "+e.point.longitude}async function i(a,i){(new google.maps.Geocoder).geocode({location:new google.maps.LatLng(a.point.latitude,a.point.longitude)},(e,t)=>{var n,o;"OK"===t&&e[0]?(t=l(a,e),n=a,e=e,t=t,o=r.GetAddressDetails(e[t].address_components),n.streetNumber=o.streetNumber,n.streetName=o.streetName,n.postalCode=o.postalCode,n.state=o.state,n.name=e[t].formatted_address):s(a),i(a)})}async function a(e,t,n,o){function a(){n?h.setWaypoint(t,o,!0):h.setLocation(e,t,!0)}t.name?a():MapComp.isLibre?(t=await MapComp.updateSimplePlace(t),a()):await i(t,e=>{t=e,a()})}function c(a,e){let n=0==a,i=a==f.length-1,r=h;var l=f[a].marker,s=i?"B":"W",s=n?"A":s,[c,p]=MapComp.latLngVals(e),c=t(((new Date).getTime()+1e9*(c+p)).toString());let u,d={width:25,height:35};if(n?u="/Content/Images/Green-A.png":i?(u="/Content/Images/Red-B-New.png",$(document).trigger("hideLocationMarker")):(u=MapComp.isLibre?"/Content/Images/waypoint.png":{path:google.maps.SymbolPath.CIRCLE,scale:4,fillColor:"#ffffff",fillOpacity:1},d={width:15,height:15,imageFit:"contain"}),l)MapComp.isLibre?MapComp.updateRouteMarker({marker:l,latLng:e,iconUrl:u}):(l.setPosition(e),l.setMap(m),l.setIcon(u));else{p=async e=>{h.clearLoationsWithoutPoints();var[e,t]=MapComp.latLngVals(e.latLng),e={point:{latitude:e,longitude:t}};await r.getNameForSimplePlace(e,function(e){var t=f[n?0:f.length-1].marker!==o;h.setLocation(t?i:n,e,!0),f[0].point&&f[f.length-1].point&&"True"!==resources.AutoGenerateDriveRoute&&(0<$("#transitRouteResults").children().length&&0<$("#routeTabContent").children().length||0<$("#transitRouteResults").children().length?g.calculateRoute():"True"!==resources.AutoGenerateDriveRoute&&g.calculateRoute("drive"))}),MapComp.isLibre&&(MapComp.data.routeMarkers.clickedRouteMarker=!1)},l=async e=>{loadBlockerApi.showSpinner("getNearestLocations"),h.clearLoationsWithoutPoints();let t=a;for(let e=1;e<f.length;++e)if(f[e].marker===o){t=e;break}var[e,n]=MapComp.latLngVals(e.latLng),e={point:{latitude:e,longitude:n}};await r.getNameForSimplePlace(e,function(e){y(t,e,!0),g.calculateRoute(),loadBlockerApi.hideSpinner("getNearestLocations")}),MapComp.isLibre&&(MapComp.data.routeMarkers.clickedRouteMarker=!1)};let t=function(){h.ClearWaypoint(a,o,!0),g.redrawWaypoints(!1)},o=MapComp.createRouteMarker({map:m,hash:c,index:a,zIndex:-98,draggable:!0,id:c,icon:u,position:e,letter:s,isWaypoint:!(n||i),title:n||i?"":resources.ClickToRemove,dragEnd:n||i?p:l,clickWaypoint:n||i?void 0:t,...d});f[a].marker=o,f[a].hash=c,MapComp.isLibre||(n||i?google.maps.event.addListener(o,"dragend",p):(google.maps.event.addListener(o,"dragend",l),o.addListener("click",e=>t({...e}))))}}function e(e){e.hash=null,e.marker=null,e.poiId=null,e.point=null,e.simplePlace=null,e.text=null}h.setMarker=c,h.getNameForSimplePlace=async function(e,t){MapComp.isLibre?t(e=await MapComp.updateSimplePlace(e)):await i(e,t)};let y=function(e,t,n){var o=0===e,a=e===f.length-1,i=0===(i=e)?"A":i===f.length-1?"B":"W",o=(t.letter=i,t.point&&c(e,MapComp.latLng(t.point.latitude,t.point.longitude)),n&&(i=a,n=e,a=t,$(o?"#startLocationText":i?"#endLocationText":"#waypointText-"+n).val(a.nameDirection||a.name)),f[e].point=t,0<$("body.mobileFirst").length);Modernizr.mq("(max-width: 992px)")&&o&&f[0].point&&f[f.length-1].point&&$(".mobileLocationBar .directions").trigger("click")},t=function(t){let n=0;for(let e=0;e<t.length;e++)n=~~((n<<5)-n+t.charCodeAt(e));return n};h.ClearWaypoint=function(e,t,n){if("lookupGMarker"===t&&(t=f[e].marker),h.getLocationsTextFromUI(),!(0===e||e===f.length-1)||t&&null!==t.hash){e=function(e,t){if(t&&null!==t.hash)for(let e=0;e<f.length;e++)if(f[e].hash===t.hash)return e;return e}(e,t);if(null!==e){f.splice(e,1),h.updateTransitBtnState(),g.redrawWaypoints();for(let e=1;e<f.length-1;e++)f[e].selector="#waypointText-"+e;t&&(MapComp.clearRouteMarkers({marker:t}),n)&&g.calculateRoute()}}},h.updateTransitBtnState=function(){f.length<3?($("#generateTransitRouteBtn").prop("disabled",!1),$("#generateDriveTransitRouteBtn").prop("disabled",!1),$("#generateWalkOnlyRouteBtn").prop("disabled",!1),$("#generateBicycleOnlyRouteBtn").prop("disabled",!1)):($("#generateTransitRouteBtn").prop("disabled",!0),$("#generateDriveTransitRouteBtn").prop("disabled",!0),$("#generateWalkOnlyRouteBtn").prop("disabled",!0),$("#generateBicycleOnlyRouteBtn").prop("disabled",!0))};return h.clearAll=function(){h.clearMarkers(),f=[f[0],f[f.length-1]],e(f[0]),e(f[1]),$("#startLocationText").val(""),$("#endLocationText").val(""),$("#waypoints").html(""),o.AddWaypointToContextMenu(!1),h.updateTransitBtnState()},h.clearMarkers=function(){MapComp.isLibre?MapComp.removeAllMarkers():f.forEach(function(e){MapComp.clearRouteMarkers(e)})},h.removeWaypoints=function(){h.clearMarkers(),f=[f[0],f[f.length-1]],h.updateTransitBtnState()},h.getLocationArray=function(){h.getLocationsTextFromUI();var e=f.map(e=>r.GetLocationDetails(e));return Promise.all(e).then(e=>e)},h.enterkeyHandler=function(e){13==e.which&&document.activeElement!=document.getElementById("mapLocation")&&document.activeElement!=document.getElementById("Passwordmodal")&&($("#RoutesTab").hasClass("active")||$("#RoutesTab > a").click(),$("#generateRouteBtn").click())},h.setLocation=function(e,t,n){y(e?0:f.length-1,t,n),f[0].point&&f[f.length-1].point?(o.AddWaypointToContextMenu(!0),"True"===resources.AutoGenerateDriveRoute&&g.calculateRoute()):o.AddWaypointToContextMenu(!1),$(document).trigger("removeMyLocationMarker"),$(document).off("keypress",null,h.enterkeyHandler),$(document).on("keypress",null,h.enterkeyHandler)},h.setWaypoint=function(e,t,n,o,a){var i,r;h.updateTransitBtnState(),i=e,r=t,n=n,o=o,MapComp.isGoogle&&(i.letter="W"),o?(f[r].marker&&MapComp.clearRouteMarkers(f[r]),f[r]={point:i,text:i.name,selector:"#waypointText-"+r}):h.addWaypoint(r,i),n&&$("#waypointText-"+r).val(i.nameDirection||i.name),"True"!==resources.AutoGenerateDriveRoute||a||g.calculateRoute(),e.point&&c(t,MapComp.latLng(e.point.latitude,e.point.longitude))},h.SetLocationByGeo=a,h.setDetails=function(){for(let e=0;e<f.length;++e)f[e].point&&y(e,f[e].point,!0)},h.setStartEndPoint=function(e,t){h.clearAll(),y(0,e,!0),y(f.length-1,t,!0)},h.setAllLocations=function(t){h.setStartEndPoint(t[0],t[t.length-1]);for(let e=1;e<t.length-1;++e)h.setWaypoint(t[e],e,null,null,!0);for(let e=0;e<t.length;++e)f[e].text||(f[e].text=t[e].nameDirection||t[e].name)},h.swapStartEnd=function(){f.reverse(),h.resetSelectors()},h.resetSelectors=function(){f[0].selector="#startLocationText";for(let e=1;e<f.length;e++)f[e].selector="#waypointText-"+e;f[f.length-1].selector="#endLocationText"},h.getLocations=function(){return f},h.adjustMarker=function(e,t,n){t=MapComp.latLng(t,n);c(e,t)},h.addWaypoint=function(e,t){var n={selector:"#waypointText-"+e};t&&(n.point=t,n.text=t.name),f.splice(e,0,n),h.updateTransitBtnState(),h.resetSelectors()},h.getLocationsTextFromUI=function(){f.forEach(e=>{var t=$(e.selector).val();e.text=null!=t?t:e.text})},h.clearLoationsWithoutPoints=function(){var t=[f[0]];for(let e=1;e<f.length-1;e++)f[e].point&&t.push(f[e]);t.push(f[f.length-1]),f=t,h.resetSelectors()},$(document).on("locationSelected-contextMenu",function(e,t,n){var o;"waypoint"==t?(o=f.length-1,g.AddWaypointToPlanner("",!0),a(null,n,!0,o)):a(0==t.indexOf("from"),n)}),$(document).on("locationSelected-autocomplete",function(e,t){var n=f.findIndex(e=>e.selector===t.selector);n<0||(t.selector.startsWith("#waypoint")?h.setWaypoint(t.point,n,!1,!0):null!=t.marker&&null!=t.marker.map&&h.setLocation(0===n,t.point,!0))}),h};
var CitizenReporter=function(){this.addReport=function(t,o){$.ajax("/wta/wtaoptions",{data:{id:t,modalType:"CitizenReport"}}).done(function(e){e=bootbox.dialog({title:o,message:e,closeButton:!1,className:"wtaContentModel crStatus",buttons:{save:{label:resources.Save,className:"btn-primary bootboxSave",callback:function(){var e=[];$(".wtaOptionsParent select",this).each(function(){$.each($.makeArray($(this).val()),function(){e.push({Id:this})})}),$.ajax("/wta/addCitizenReport",{type:"POST",data:{data:{id:t,statuses:e}}}).done(function(e){bootbox.alert(resources.CitizenReporterReportSubmited,null)}).fail(function(){bootbox.alert(resources.CitizenReporterReportFailed,null)})}},cancel:{label:resources.Cancel,className:"btn-primary"}}});$(".selectpicker",e).selectpicker({noneSelectedText:resources.NoneSelected,selectedTextFormat:"count > 3"})}).fail(function(){bootbox.alert(resources.ErrorLoadingWtaContent,null)})}},citizenReporter=new CitizenReporter;
!function(r){var d;r.fn.printThis=function(e){d=r.extend({},r.fn.printThis.defaults,e);var t,n,i=this instanceof jQuery?this:r(this),e="printThis-"+(new Date).getTime(),a=(window.location.hostname!==document.domain&&navigator.userAgent.match(/msie/i)?(t='javascript:document.write("<head><script>document.domain=\\"'+document.domain+'\\";<\/script></head><body></body>")',(n=document.createElement("iframe")).name="printIframe",n.id=e,n.className="MSIE",document.body.appendChild(n),n.src=t):r("<iframe id='"+e+"' name='printIframe' />").appendTo("body"),r("#"+e));d.debug||a.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"}),setTimeout(function(){var e,o=a.contents(),n=o.find("head"),t=o.find("body");n.append('<base href="'+document.location.protocol+"//"+document.location.host+'">'),d.importCSS&&r("link[rel=stylesheet]").each(function(){var e,t=r(this).attr("href");t&&(e=r(this).attr("media")||"all",n.append("<link type='text/css' rel='stylesheet' href='"+t+"' media='"+e+"'>"))}),d.importStyle&&r("style").each(function(){r(this).clone().appendTo(n)}),d.pageTitle&&n.append("<title>"+d.pageTitle+"</title>"),d.loadCSS&&(r.isArray(d.loadCSS)?jQuery.each(d.loadCSS,function(e,t){n.append("<link type='text/css' rel='stylesheet' href='"+this+"'>")}):n.append("<link type='text/css' rel='stylesheet' href='"+d.loadCSS+"'>")),d.header&&t.append(d.header),d.printContainer?t.append(i.outer()):i.each(function(){t.append(r(this).html())}),d.formValues&&((e=i.find("input")).length&&e.each(function(){var e=r(this),t=r(this).attr("name"),n=e.is(":checkbox")||e.is(":radio"),i=o.find('input[name="'+t+'"]'),a=e.val();n?e.is(":checked")&&(e.is(":checkbox")?i.attr("checked","checked"):e.is(":radio")&&o.find('input[name="'+t+'"][value='+a+"]").attr("checked","checked")):i.val(a)}),(e=i.find("select")).length&&e.each(function(){var e=r(this),t=r(this).attr("name"),e=e.val();o.find('select[name="'+t+'"]').val(e)}),(e=i.find("textarea")).length)&&e.each(function(){var e=r(this),t=r(this).attr("name"),e=e.val();o.find('textarea[name="'+t+'"]').val(e)}),d.removeInline&&(r.isFunction(r.removeAttr)?o.find("body *").removeAttr("style"):o.find("body *").attr("style","")),setTimeout(function(){a.hasClass("MSIE")?(window.frames.printIframe.focus(),n.append("<script>  window.print(); <\/script>")):(a[0].contentWindow.focus(),a[0].contentWindow.print()),d.debug||setTimeout(function(){a.remove()},1e3)},d.printDelay)},333)},r.fn.printThis.defaults={debug:!1,importCSS:!0,importStyle:!1,printContainer:!0,loadCSS:"",pageTitle:"",removeInline:!1,printDelay:333,header:null,formValues:!0},jQuery.fn.outer=function(){return r(r("<div></div>").html(this.clone())).html()}}(jQuery);
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){var t,s=window.Slick||{};(s=(t=0,function s(e,o){var n,l=this;l.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" type="button">Previous</button>',nextArrow:'<button class="slick-next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,s){return i('<button type="button" />').text(s+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},l.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(l,l.initials),l.activeBreakpoint=null,l.animType=null,l.animProp=null,l.breakpoints=[],l.breakpointSettings=[],l.cssTransitions=!1,l.focussed=!1,l.interrupted=!1,l.hidden="hidden",l.paused=!0,l.positionProp=null,l.respondTo=null,l.rowCount=1,l.shouldClick=!0,l.$slider=i(e),l.$slidesCache=null,l.transformType=null,l.transitionType=null,l.visibilityChange="visibilitychange",l.windowWidth=0,l.windowTimer=null,n=i(e).data("slick")||{},l.options=i.extend({},l.defaults,o,n),l.currentSlide=l.options.initialSlide,l.originalSettings=l.options,void 0!==document.mozHidden?(l.hidden="mozHidden",l.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(l.hidden="webkitHidden",l.visibilityChange="webkitvisibilitychange"),l.autoPlay=i.proxy(l.autoPlay,l),l.autoPlayClear=i.proxy(l.autoPlayClear,l),l.autoPlayIterator=i.proxy(l.autoPlayIterator,l),l.changeSlide=i.proxy(l.changeSlide,l),l.clickHandler=i.proxy(l.clickHandler,l),l.selectHandler=i.proxy(l.selectHandler,l),l.setPosition=i.proxy(l.setPosition,l),l.swipeHandler=i.proxy(l.swipeHandler,l),l.dragHandler=i.proxy(l.dragHandler,l),l.keyHandler=i.proxy(l.keyHandler,l),l.instanceUid=t++,l.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,l.registerBreakpoints(),l.init(!0)})).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},s.prototype.addSlide=s.prototype.slickAdd=function(t,s,e){var o=this;if("boolean"==typeof s)e=s,s=null;else if(s<0||s>=o.slideCount)return!1;o.unload(),"number"==typeof s?0===s&&0===o.$slides.length?i(t).appendTo(o.$slideTrack):e?i(t).insertBefore(o.$slides.eq(s)):i(t).insertAfter(o.$slides.eq(s)):!0===e?i(t).prependTo(o.$slideTrack):i(t).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each(function(t,s){i(s).attr("data-slick-index",t)}),o.$slidesCache=o.$slides,o.reinit()},s.prototype.animateHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.animate({height:i},this.options.speed)}},s.prototype.animateSlide=function(t,s){var e={},o=this;o.animateHeight(),!0===o.options.rtl&&!1===o.options.vertical&&(t=-t),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:t},o.options.speed,o.options.easing,s):o.$slideTrack.animate({top:t},o.options.speed,o.options.easing,s):!1===o.cssTransitions?(!0===o.options.rtl&&(o.currentLeft=-o.currentLeft),i({animStart:o.currentLeft}).animate({animStart:t},{duration:o.options.speed,easing:o.options.easing,step:function(i){i=Math.ceil(i),!1===o.options.vertical?(e[o.animType]="translate("+i+"px, 0px)",o.$slideTrack.css(e)):(e[o.animType]="translate(0px,"+i+"px)",o.$slideTrack.css(e))},complete:function(){s&&s.call()}})):(o.applyTransition(),t=Math.ceil(t),!1===o.options.vertical?e[o.animType]="translate3d("+t+"px, 0px, 0px)":e[o.animType]="translate3d(0px,"+t+"px, 0px)",o.$slideTrack.css(e),s&&setTimeout(function(){o.disableTransition(),s.call()},o.options.speed))},s.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=i(t).not(this.$slider)),t},s.prototype.asNavFor=function(t){var s=this.getNavTarget();null!==s&&"object"==typeof s&&s.each(function(){var s=i(this).slick("getSlick");s.unslicked||s.slideHandler(t,!0)})},s.prototype.applyTransition=function(i){var t=this,s={};!1===t.options.fade?s[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:s[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(s):t.$slides.eq(i).css(s)},s.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},s.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},s.prototype.autoPlayIterator=function(){var i=this,t=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(t=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(t))},s.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=i(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=i(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},s.prototype.buildDots=function(){var t,s,e=this;if(!0===e.options.dots&&e.slideCount>e.options.slidesToShow){for(e.$slider.addClass("slick-dotted"),s=i("<ul />").addClass(e.options.dotsClass),t=0;t<=e.getDotCount();t+=1)s.append(i("<li />").append(e.options.customPaging.call(this,e,t)));e.$dots=s.appendTo(e.options.appendDots),e.$dots.find("li").first().addClass("slick-active")}},s.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each(function(t,s){i(s).attr("data-slick-index",t).data("originalStyling",i(s).attr("style")||"")}),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?i('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),(!0===t.options.centerMode||!0===t.options.swipeToSlide)&&(t.options.slidesToScroll=1),i("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},s.prototype.buildRows=function(){var i,t,s,e,o,n,l;if(e=document.createDocumentFragment(),n=this.$slider.children(),this.options.rows>0){for(i=0,l=this.options.slidesPerRow*this.options.rows,o=Math.ceil(n.length/l);i<o;i++){var r=document.createElement("div");for(t=0;t<this.options.rows;t++){var d=document.createElement("div");for(s=0;s<this.options.slidesPerRow;s++){var a=i*l+(t*this.options.slidesPerRow+s);n.get(a)&&d.appendChild(n.get(a))}r.appendChild(d)}e.appendChild(r)}this.$slider.empty().append(e),this.$slider.children().children().children().css({width:100/this.options.slidesPerRow+"%",display:"inline-block"})}},s.prototype.checkResponsive=function(t,s){var e,o,n,l=this,r=!1,d=l.$slider.width(),a=window.innerWidth||i(window).width();if("window"===l.respondTo?n=a:"slider"===l.respondTo?n=d:"min"===l.respondTo&&(n=Math.min(a,d)),l.options.responsive&&l.options.responsive.length&&null!==l.options.responsive){for(e in o=null,l.breakpoints)l.breakpoints.hasOwnProperty(e)&&(!1===l.originalSettings.mobileFirst?n<l.breakpoints[e]&&(o=l.breakpoints[e]):n>l.breakpoints[e]&&(o=l.breakpoints[e]));null!==o?null!==l.activeBreakpoint?(o!==l.activeBreakpoint||s)&&(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):null!==l.activeBreakpoint&&(l.activeBreakpoint=null,l.options=l.originalSettings,!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t),r=o),t||!1===r||l.$slider.trigger("breakpoint",[l,r])}},s.prototype.changeSlide=function(t,s){var e,o,n,l=i(t.currentTarget);switch(l.is("a")&&t.preventDefault(),l.is("li")||(l=l.closest("li")),e=(n=this.slideCount%this.options.slidesToScroll!=0)?0:(this.slideCount-this.currentSlide)%this.options.slidesToScroll,t.data.message){case"previous":o=0===e?this.options.slidesToScroll:this.options.slidesToShow-e,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide-o,!1,s);break;case"next":o=0===e?this.options.slidesToScroll:e,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide+o,!1,s);break;case"index":var r=0===t.data.index?0:t.data.index||l.index()*this.options.slidesToScroll;this.slideHandler(this.checkNavigable(r),!1,s),l.children().trigger("focus");break;default:return}},s.prototype.checkNavigable=function(i){var t,s;if(t=this.getNavigableIndexes(),s=0,i>t[t.length-1])i=t[t.length-1];else for(var e in t){if(i<t[e]){i=s;break}s=t[e]}return i},s.prototype.cleanUpEvents=function(){this.options.dots&&null!==this.$dots&&(i("li",this.$dots).off("click.slick",this.changeSlide).off("mouseenter.slick",i.proxy(this.interrupt,this,!0)).off("mouseleave.slick",i.proxy(this.interrupt,this,!1)),!0===this.options.accessibility&&this.$dots.off("keydown.slick",this.keyHandler)),this.$slider.off("focus.slick blur.slick"),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow&&this.$prevArrow.off("click.slick",this.changeSlide),this.$nextArrow&&this.$nextArrow.off("click.slick",this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow&&this.$prevArrow.off("keydown.slick",this.keyHandler),this.$nextArrow&&this.$nextArrow.off("keydown.slick",this.keyHandler))),this.$list.off("touchstart.slick mousedown.slick",this.swipeHandler),this.$list.off("touchmove.slick mousemove.slick",this.swipeHandler),this.$list.off("touchend.slick mouseup.slick",this.swipeHandler),this.$list.off("touchcancel.slick mouseleave.slick",this.swipeHandler),this.$list.off("click.slick",this.clickHandler),i(document).off(this.visibilityChange,this.visibility),this.cleanUpSlideEvents(),!0===this.options.accessibility&&this.$list.off("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().off("click.slick",this.selectHandler),i(window).off("orientationchange.slick.slick-"+this.instanceUid,this.orientationChange),i(window).off("resize.slick.slick-"+this.instanceUid,this.resize),i("[draggable!=true]",this.$slideTrack).off("dragstart",this.preventDefault),i(window).off("load.slick.slick-"+this.instanceUid,this.setPosition)},s.prototype.cleanUpSlideEvents=function(){this.$list.off("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.off("mouseleave.slick",i.proxy(this.interrupt,this,!1))},s.prototype.cleanUpRows=function(){var i;this.options.rows>0&&((i=this.$slides.children().children()).removeAttr("style"),this.$slider.empty().append(i))},s.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},s.prototype.destroy=function(t){var s=this;s.autoPlayClear(),s.touchObject={},s.cleanUpEvents(),i(".slick-cloned",s.$slider).detach(),s.$dots&&s.$dots.remove(),s.$prevArrow&&s.$prevArrow.length&&(s.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),s.htmlExpr.test(s.options.prevArrow)&&s.$prevArrow.remove()),s.$nextArrow&&s.$nextArrow.length&&(s.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),s.htmlExpr.test(s.options.nextArrow)&&s.$nextArrow.remove()),s.$slides&&(s.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.detach(),s.$list.detach(),s.$slider.append(s.$slides)),s.cleanUpRows(),s.$slider.removeClass("slick-slider"),s.$slider.removeClass("slick-initialized"),s.$slider.removeClass("slick-dotted"),s.unslicked=!0,t||s.$slider.trigger("destroy",[s])},s.prototype.disableTransition=function(i){var t=this,s={};s[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(s):t.$slides.eq(i).css(s)},s.prototype.fadeSlide=function(i,t){var s=this;!1===s.cssTransitions?(s.$slides.eq(i).css({zIndex:s.options.zIndex}),s.$slides.eq(i).animate({opacity:1},s.options.speed,s.options.easing,t)):(s.applyTransition(i),s.$slides.eq(i).css({opacity:1,zIndex:s.options.zIndex}),t&&setTimeout(function(){s.disableTransition(i),t.call()},s.options.speed))},s.prototype.fadeSlideOut=function(i){!1===this.cssTransitions?this.$slides.eq(i).animate({opacity:0,zIndex:this.options.zIndex-2},this.options.speed,this.options.easing):(this.applyTransition(i),this.$slides.eq(i).css({opacity:0,zIndex:this.options.zIndex-2}))},s.prototype.filterSlides=s.prototype.slickFilter=function(i){var t=this;null!==i&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(i).appendTo(t.$slideTrack),t.reinit())},s.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(s){var e=i(this);setTimeout(function(){t.options.pauseOnFocus&&e.is(":focus")&&(t.focussed=!0,t.autoPlay())},0)}).on("blur.slick","*",function(s){i(this),t.options.pauseOnFocus&&(t.focussed=!1,t.autoPlay())})},s.prototype.getCurrent=s.prototype.slickCurrentSlide=function(){return this.currentSlide},s.prototype.getDotCount=function(){var i=0,t=0,s=0;if(!0===this.options.infinite){if(this.slideCount<=this.options.slidesToShow)++s;else for(;i<this.slideCount;)++s,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow}else if(!0===this.options.centerMode)s=this.slideCount;else if(this.options.asNavFor)for(;i<this.slideCount;)++s,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;else s=1+Math.ceil((this.slideCount-this.options.slidesToShow)/this.options.slidesToScroll);return s-1},s.prototype.getLeft=function(i){var t,s,e,o,n=this,l=0;return n.slideOffset=0,s=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=-(n.slideWidth*n.options.slidesToShow*1),o=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?o=-1.5:1===n.options.slidesToShow&&(o=-2)),l=s*n.options.slidesToShow*o),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=-((n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*1),l=-((n.options.slidesToShow-(i-n.slideCount))*s*1)):(n.slideOffset=-(n.slideCount%n.options.slidesToScroll*n.slideWidth*1),l=-(n.slideCount%n.options.slidesToScroll*s*1)))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,l=(i+n.options.slidesToShow-n.slideCount)*s),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,l=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),t=!1===n.options.vertical?-(i*n.slideWidth*1)+n.slideOffset:-(i*s*1)+l,!0===n.options.variableWidth&&(e=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),t=!0===n.options.rtl?e[0]?-((n.$slideTrack.width()-e[0].offsetLeft-e.width())*1):0:e[0]?-1*e[0].offsetLeft:0,!0===n.options.centerMode&&(e=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),t=!0===n.options.rtl?e[0]?-((n.$slideTrack.width()-e[0].offsetLeft-e.width())*1):0:e[0]?-1*e[0].offsetLeft:0,t+=(n.$list.width()-e.outerWidth())/2)),t},s.prototype.getOption=s.prototype.slickGetOption=function(i){return this.options[i]},s.prototype.getNavigableIndexes=function(){var i,t=0,s=0,e=[];for(!1===this.options.infinite?i=this.slideCount:(t=-1*this.options.slidesToScroll,s=-1*this.options.slidesToScroll,i=2*this.slideCount);t<i;)e.push(t),t=s+this.options.slidesToScroll,s+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;return e},s.prototype.getSlick=function(){return this},s.prototype.getSlideCount=function(){var t,s,e,o,n=this;return(o=!0===n.options.centerMode?Math.floor(n.$list.width()/2):0,e=-1*n.swipeLeft+o,!0===n.options.swipeToSlide)?(n.$slideTrack.find(".slick-slide").each(function(t,o){var l,r,d;if(l=i(o).outerWidth(),r=o.offsetLeft,!0!==n.options.centerMode&&(r+=l/2),e<(d=r+l))return s=o,!1}),t=Math.abs(i(s).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},s.prototype.goTo=s.prototype.slickGoTo=function(i,t){this.changeSlide({data:{message:"index",index:parseInt(i)}},t)},s.prototype.init=function(t){var s=this;i(s.$slider).hasClass("slick-initialized")||(i(s.$slider).addClass("slick-initialized"),s.buildRows(),s.buildOut(),s.setProps(),s.startLoad(),s.loadSlider(),s.initializeEvents(),s.updateArrows(),s.updateDots(),s.checkResponsive(!0),s.focusHandler()),t&&s.$slider.trigger("init",[s]),!0===s.options.accessibility&&s.initADA(),s.options.autoplay&&(s.paused=!1,s.autoPlay())},s.prototype.initADA=function(){var t=this,s=Math.ceil(t.slideCount/t.options.slidesToShow),e=t.getNavigableIndexes().filter(function(i){return i>=0&&i<t.slideCount});t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(s){var o=e.indexOf(s);if(i(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+s,tabindex:-1}),-1!==o){var n="slick-slide-control"+t.instanceUid+o;i("#"+n).length&&i(this).attr({"aria-describedby":n})}}),t.$dots.attr("role","tablist").find("li").each(function(o){var n=e[o];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+o,"aria-controls":"slick-slide"+t.instanceUid+n,"aria-label":o+1+" of "+s,"aria-selected":null,tabindex:"-1"})}).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var o=t.currentSlide,n=o+t.options.slidesToShow;o<n;o++)t.options.focusOnChange?t.$slides.eq(o).attr({tabindex:"0"}):t.$slides.eq(o).removeAttr("tabindex");t.activateADA()},s.prototype.initArrowEvents=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},this.changeSlide),this.$nextArrow.off("click.slick").on("click.slick",{message:"next"},this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow.on("keydown.slick",this.keyHandler),this.$nextArrow.on("keydown.slick",this.keyHandler)))},s.prototype.initDotEvents=function(){!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&(i("li",this.$dots).on("click.slick",{message:"index"},this.changeSlide),!0===this.options.accessibility&&this.$dots.on("keydown.slick",this.keyHandler)),!0===this.options.dots&&!0===this.options.pauseOnDotsHover&&this.slideCount>this.options.slidesToShow&&i("li",this.$dots).on("mouseenter.slick",i.proxy(this.interrupt,this,!0)).on("mouseleave.slick",i.proxy(this.interrupt,this,!1))},s.prototype.initSlideEvents=function(){this.options.pauseOnHover&&(this.$list.on("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.on("mouseleave.slick",i.proxy(this.interrupt,this,!1)))},s.prototype.initializeEvents=function(){this.initArrowEvents(),this.initDotEvents(),this.initSlideEvents(),this.$list.on("touchstart.slick mousedown.slick",{action:"start"},this.swipeHandler),this.$list.on("touchmove.slick mousemove.slick",{action:"move"},this.swipeHandler),this.$list.on("touchend.slick mouseup.slick",{action:"end"},this.swipeHandler),this.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},this.swipeHandler),this.$list.on("click.slick",this.clickHandler),i(document).on(this.visibilityChange,i.proxy(this.visibility,this)),!0===this.options.accessibility&&this.$list.on("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().on("click.slick",this.selectHandler),i(window).on("orientationchange.slick.slick-"+this.instanceUid,i.proxy(this.orientationChange,this)),i(window).on("resize.slick.slick-"+this.instanceUid,i.proxy(this.resize,this)),i("[draggable!=true]",this.$slideTrack).on("dragstart",this.preventDefault),i(window).on("load.slick.slick-"+this.instanceUid,this.setPosition),i(this.setPosition)},s.prototype.initUI=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.show(),this.$nextArrow.show()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.show()},s.prototype.keyHandler=function(i){i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===this.options.accessibility?this.changeSlide({data:{message:!0===this.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===this.options.accessibility&&this.changeSlide({data:{message:!0===this.options.rtl?"previous":"next"}}))},s.prototype.lazyLoad=function(){var t,s,e,o,n=this;function l(t){i("img[data-lazy]",t).each(function(){var t=i(this),s=i(this).attr("data-lazy"),e=i(this).attr("data-srcset"),o=i(this).attr("data-srcloaded"),l=i(this).attr("data-sizes")||n.$slider.attr("data-sizes");o||(t.attr("data-srcloaded","true"),t.animate({opacity:0},100,function(){e&&(t.attr("srcset",e),l&&t.attr("sizes",l)),t.attr("src",s).animate({opacity:1},200,function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,t,s])}))})}if(!0===n.options.centerMode?!0===n.options.infinite?o=(e=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(e=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),o=2+(n.options.slidesToShow/2+1)+n.currentSlide):(o=Math.ceil((e=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide)+n.options.slidesToShow),!0===n.options.fade&&(e>0&&e--,o<=n.slideCount&&o++)),t=n.$slider.find(".slick-slide").slice(e,o),"anticipated"===n.options.lazyLoad)for(var r=e-1,d=o,a=n.$slider.find(".slick-slide"),c=0;c<n.options.slidesToScroll;c++)r<0&&(r=n.slideCount-1),t=(t=t.add(a.eq(r))).add(a.eq(d)),r--,d++;l(t),n.slideCount<=n.options.slidesToShow?l(s=n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?l(s=n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&l(s=n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},s.prototype.loadSlider=function(){this.setPosition(),this.$slideTrack.css({opacity:1}),this.$slider.removeClass("slick-loading"),this.initUI(),"progressive"===this.options.lazyLoad&&this.progressiveLazyLoad()},s.prototype.next=s.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},s.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},s.prototype.pause=s.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},s.prototype.play=s.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},s.prototype.postSlide=function(t){var s=this;!s.unslicked&&(s.$slider.trigger("afterChange",[s,t]),s.animating=!1,s.slideCount>s.options.slidesToShow&&s.setPosition(),s.swipeLeft=null,s.options.autoplay&&s.autoPlay(),!0===s.options.accessibility&&(s.initADA(),s.options.focusOnChange))&&i(s.$slides.get(s.currentSlide)).attr("tabindex",0).focus()},s.prototype.prev=s.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},s.prototype.preventDefault=function(i){i.preventDefault()},s.prototype.progressiveLazyLoad=function(t){t=t||1;var s,e,o,n,l,r=this,d=i("img[data-lazy]",r.$slider);d.length?(e=(s=d.first()).attr("data-lazy"),o=s.attr("data-srcset"),n=s.attr("data-sizes")||r.$slider.attr("data-sizes"),(l=document.createElement("img")).onload=function(){o&&(s.attr("srcset",o),n&&s.attr("sizes",n)),s.attr("src",e).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===r.options.adaptiveHeight&&r.setPosition(),r.$slider.trigger("lazyLoaded",[r,s,e]),r.progressiveLazyLoad()},l.onerror=function(){t<3?setTimeout(function(){r.progressiveLazyLoad(t+1)},500):(s.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,s,e]),r.progressiveLazyLoad())},l.src=e):r.$slider.trigger("allImagesLoaded",[r])},s.prototype.refresh=function(t){var s,e,o=this;e=o.slideCount-o.options.slidesToShow,!o.options.infinite&&o.currentSlide>e&&(o.currentSlide=e),o.slideCount<=o.options.slidesToShow&&(o.currentSlide=0),s=o.currentSlide,o.destroy(!0),i.extend(o,o.initials,{currentSlide:s}),o.init(),t||o.changeSlide({data:{message:"index",index:s}},!1)},s.prototype.registerBreakpoints=function(){var t,s,e,o=this,n=o.options.responsive||null;if("array"===i.type(n)&&n.length){for(t in o.respondTo=o.options.respondTo||"window",n)if(e=o.breakpoints.length-1,n.hasOwnProperty(t)){for(s=n[t].breakpoint;e>=0;)o.breakpoints[e]&&o.breakpoints[e]===s&&o.breakpoints.splice(e,1),e--;o.breakpoints.push(s),o.breakpointSettings[s]=n[t].settings}o.breakpoints.sort(function(i,t){return o.options.mobileFirst?i-t:t-i})}},s.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&i(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},s.prototype.resize=function(){var t=this;i(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=i(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()},50))},s.prototype.removeSlide=s.prototype.slickRemove=function(i,t,s){var e=this;if(i="boolean"==typeof i?!0===(t=i)?0:e.slideCount-1:!0===t?--i:i,e.slideCount<1||i<0||i>e.slideCount-1)return!1;e.unload(),!0===s?e.$slideTrack.children().remove():e.$slideTrack.children(this.options.slide).eq(i).remove(),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slidesCache=e.$slides,e.reinit()},s.prototype.setCSS=function(i){var t,s,e=this,o={};!0===e.options.rtl&&(i=-i),t="left"==e.positionProp?Math.ceil(i)+"px":"0px",s="top"==e.positionProp?Math.ceil(i)+"px":"0px",o[e.positionProp]=i,!1===e.transformsEnabled?e.$slideTrack.css(o):(o={},!1===e.cssTransitions?(o[e.animType]="translate("+t+", "+s+")",e.$slideTrack.css(o)):(o[e.animType]="translate3d("+t+", "+s+", 0px)",e.$slideTrack.css(o)))},s.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var t=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-t)},s.prototype.setFade=function(){var t,s=this;s.$slides.each(function(e,o){t=-(s.slideWidth*e*1),!0===s.options.rtl?i(o).css({position:"relative",right:t,top:0,zIndex:s.options.zIndex-2,opacity:0}):i(o).css({position:"relative",left:t,top:0,zIndex:s.options.zIndex-2,opacity:0})}),s.$slides.eq(s.currentSlide).css({zIndex:s.options.zIndex-1,opacity:1})},s.prototype.setHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.css("height",i)}},s.prototype.setOption=s.prototype.slickSetOption=function(){var t,s,e,o,n,l=this,r=!1;if("object"===i.type(arguments[0])?(e=arguments[0],r=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(e=arguments[0],o=arguments[1],r=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)l.options[e]=o;else if("multiple"===n)i.each(e,function(i,t){l.options[i]=t});else if("responsive"===n)for(s in o)if("array"!==i.type(l.options.responsive))l.options.responsive=[o[s]];else{for(t=l.options.responsive.length-1;t>=0;)l.options.responsive[t].breakpoint===o[s].breakpoint&&l.options.responsive.splice(t,1),t--;l.options.responsive.push(o[s])}r&&(l.unload(),l.reinit())},s.prototype.setPosition=function(){this.setDimensions(),this.setHeight(),!1===this.options.fade?this.setCSS(this.getLeft(this.currentSlide)):this.setFade(),this.$slider.trigger("setPosition",[this])},s.prototype.setProps=function(){var i=this,t=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),(void 0!==t.WebkitTransition||void 0!==t.MozTransition||void 0!==t.msTransition)&&!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==t.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(i.animType=!1)),void 0!==t.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===t.msTransform&&(i.animType=!1)),void 0!==t.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},s.prototype.setSlideClasses=function(i){var t,s,e,o;if(s=this.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),this.$slides.eq(i).addClass("slick-current"),!0===this.options.centerMode){var n=this.options.slidesToShow%2==0?1:0;t=Math.floor(this.options.slidesToShow/2),!0===this.options.infinite&&(i>=t&&i<=this.slideCount-1-t?this.$slides.slice(i-t+n,i+t+1).addClass("slick-active").attr("aria-hidden","false"):(e=this.options.slidesToShow+i,s.slice(e-t+1+n,e+t+2).addClass("slick-active").attr("aria-hidden","false")),0===i?s.eq(s.length-1-this.options.slidesToShow).addClass("slick-center"):i===this.slideCount-1&&s.eq(this.options.slidesToShow).addClass("slick-center")),this.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=this.slideCount-this.options.slidesToShow?this.$slides.slice(i,i+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):s.length<=this.options.slidesToShow?s.addClass("slick-active").attr("aria-hidden","false"):(o=this.slideCount%this.options.slidesToShow,e=!0===this.options.infinite?this.options.slidesToShow+i:i,this.options.slidesToShow==this.options.slidesToScroll&&this.slideCount-i<this.options.slidesToShow?s.slice(e-(this.options.slidesToShow-o),e+o).addClass("slick-active").attr("aria-hidden","false"):s.slice(e,e+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));("ondemand"===this.options.lazyLoad||"anticipated"===this.options.lazyLoad)&&this.lazyLoad()},s.prototype.setupInfinite=function(){var t,s,e,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(s=null,o.slideCount>o.options.slidesToShow)){for(e=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,t=o.slideCount;t>o.slideCount-e;t-=1)s=t-1,i(o.$slides[s]).clone(!0).attr("id","").attr("data-slick-index",s-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(t=0;t<e+o.slideCount;t+=1)s=t,i(o.$slides[s]).clone(!0).attr("id","").attr("data-slick-index",s+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},s.prototype.interrupt=function(i){var t=this;i||t.autoPlay(),t.interrupted=i},s.prototype.selectHandler=function(t){var s=parseInt((i(t.target).is(".slick-slide")?i(t.target):i(t.target).parents(".slick-slide")).attr("data-slick-index"));if(s||(s=0),this.slideCount<=this.options.slidesToShow){this.slideHandler(s,!1,!0);return}this.slideHandler(s)},s.prototype.slideHandler=function(i,t,s){var e,o,n,l,r,d=null,a=this;if(t=t||!1,(!0!==a.animating||!0!==a.options.waitForAnimate)&&(!0!==a.options.fade||a.currentSlide!==i)){if(!1===t&&a.asNavFor(i),e=i,d=a.getLeft(e),l=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?l:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)||!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll)){!1===a.options.fade&&(e=a.currentSlide,!0!==s&&a.slideCount>a.options.slidesToShow?a.animateSlide(l,function(){a.postSlide(e)}):a.postSlide(e));return}if(a.options.autoplay&&clearInterval(a.autoPlayTimer),o=e<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+e:e>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:e-a.slideCount:e,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,o]),n=a.currentSlide,a.currentSlide=o,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(r=(r=a.getNavTarget()).slick("getSlick")).slideCount<=r.options.slidesToShow&&r.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade){!0!==s?(a.fadeSlideOut(n),a.fadeSlide(o,function(){a.postSlide(o)})):a.postSlide(o),a.animateHeight();return}!0!==s&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(o)}):a.postSlide(o)}},s.prototype.startLoad=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.hide(),this.$nextArrow.hide()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.hide(),this.$slider.addClass("slick-loading")},s.prototype.swipeDirection=function(){var i,t,s,e;return(i=this.touchObject.startX-this.touchObject.curX,(e=Math.round(180*(s=Math.atan2(t=this.touchObject.startY-this.touchObject.curY,i))/Math.PI))<0&&(e=360-Math.abs(e)),e<=45&&e>=0||e<=360&&e>=315)?!1===this.options.rtl?"left":"right":e>=135&&e<=225?!1===this.options.rtl?"right":"left":!0===this.options.verticalSwiping?e>=35&&e<=135?"down":"up":"vertical"},s.prototype.swipeEnd=function(i){var t,s,e=this;if(e.dragging=!1,e.swiping=!1,e.scrolling)return e.scrolling=!1,!1;if(e.interrupted=!1,e.shouldClick=!(e.touchObject.swipeLength>10),void 0===e.touchObject.curX)return!1;if(!0===e.touchObject.edgeHit&&e.$slider.trigger("edge",[e,e.swipeDirection()]),e.touchObject.swipeLength>=e.touchObject.minSwipe){switch(s=e.swipeDirection()){case"left":case"down":t=e.options.swipeToSlide?e.checkNavigable(e.currentSlide+e.getSlideCount()):e.currentSlide+e.getSlideCount(),e.currentDirection=0;break;case"right":case"up":t=e.options.swipeToSlide?e.checkNavigable(e.currentSlide-e.getSlideCount()):e.currentSlide-e.getSlideCount(),e.currentDirection=1}"vertical"!=s&&(e.slideHandler(t),e.touchObject={},e.$slider.trigger("swipe",[e,s]))}else e.touchObject.startX!==e.touchObject.curX&&(e.slideHandler(e.currentSlide),e.touchObject={})},s.prototype.swipeHandler=function(i){var t=this;if(!1!==t.options.swipe&&(!("ontouchend"in document)||!1!==t.options.swipe)){if(!1!==t.options.draggable||-1===i.type.indexOf("mouse"))switch(t.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),i.data.action){case"start":t.swipeStart(i);break;case"move":t.swipeMove(i);break;case"end":t.swipeEnd(i)}}},s.prototype.swipeMove=function(i){var t,s,e,o,n,l,r=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!!r.dragging&&!r.scrolling&&(!n||1===n.length)&&((t=r.getLeft(r.currentSlide),r.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,r.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curX-r.touchObject.startX,2))),l=Math.round(Math.sqrt(Math.pow(r.touchObject.curY-r.touchObject.startY,2))),r.options.verticalSwiping||r.swiping||!(l>4))?(!0===r.options.verticalSwiping&&(r.touchObject.swipeLength=l),s=r.swipeDirection(),void 0!==i.originalEvent&&r.touchObject.swipeLength>4&&(r.swiping=!0,i.preventDefault()),o=(!1===r.options.rtl?1:-1)*(r.touchObject.curX>r.touchObject.startX?1:-1),!0===r.options.verticalSwiping&&(o=r.touchObject.curY>r.touchObject.startY?1:-1),e=r.touchObject.swipeLength,r.touchObject.edgeHit=!1,!1===r.options.infinite&&(0===r.currentSlide&&"right"===s||r.currentSlide>=r.getDotCount()&&"left"===s)&&(e=r.touchObject.swipeLength*r.options.edgeFriction,r.touchObject.edgeHit=!0),!1===r.options.vertical?r.swipeLeft=t+e*o:r.swipeLeft=t+e*(r.$list.height()/r.listWidth)*o,!0===r.options.verticalSwiping&&(r.swipeLeft=t+e*o),!0!==r.options.fade&&!1!==r.options.touchMove&&(!0===r.animating?(r.swipeLeft=null,!1):void r.setCSS(r.swipeLeft))):(r.scrolling=!0,!1))},s.prototype.swipeStart=function(i){var t,s=this;if(s.interrupted=!0,1!==s.touchObject.fingerCount||s.slideCount<=s.options.slidesToShow)return s.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(t=i.originalEvent.touches[0]),s.touchObject.startX=s.touchObject.curX=void 0!==t?t.pageX:i.clientX,s.touchObject.startY=s.touchObject.curY=void 0!==t?t.pageY:i.clientY,s.dragging=!0},s.prototype.unfilterSlides=s.prototype.slickUnfilter=function(){null!==this.$slidesCache&&(this.unload(),this.$slideTrack.children(this.options.slide).detach(),this.$slidesCache.appendTo(this.$slideTrack),this.reinit())},s.prototype.unload=function(){i(".slick-cloned",this.$slider).remove(),this.$dots&&this.$dots.remove(),this.$prevArrow&&this.htmlExpr.test(this.options.prevArrow)&&this.$prevArrow.remove(),this.$nextArrow&&this.htmlExpr.test(this.options.nextArrow)&&this.$nextArrow.remove(),this.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},s.prototype.unslick=function(i){this.$slider.trigger("unslick",[this,i]),this.destroy()},s.prototype.updateArrows=function(){var i;i=Math.floor(this.options.slidesToShow/2),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&!this.options.infinite&&(this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===this.currentSlide?(this.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-this.options.slidesToShow&&!1===this.options.centerMode?(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-1&&!0===this.options.centerMode&&(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},s.prototype.updateDots=function(){null!==this.$dots&&(this.$dots.find("li").removeClass("slick-active").end(),this.$dots.find("li").eq(Math.floor(this.currentSlide/this.options.slidesToScroll)).addClass("slick-active"))},s.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,e=this,o=arguments[0],n=Array.prototype.slice.call(arguments,1),l=e.length;for(i=0;i<l;i++)if("object"==typeof o||void 0===o?e[i].slick=new s(e[i],o):t=e[i].slick[o].apply(e[i].slick,n),void 0!==t)return t;return e}});
!function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)}(this,function(o,e,u,r){function d(t,e){var r=1<=arguments.length;if(!(this instanceof d))return r?2<=arguments.length?new d(t,e):new d(t):new d;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}function s(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function i(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function h(t){return"Array"===i(t)}function a(t,e){var r={};if("RegExp"===i(e))r=null;else if(h(e))for(var n=0,s=e.length;n<s;n++)r[e[n]]=!0;else r[e]=!0;for(n=0,s=t.length;n<s;n++)(r&&void 0!==r[t[n]]||!r&&e.test(t[n]))&&(t.splice(n,1),s--,n--);return t}function p(t,e){if(h(e)){for(var r=0,n=e.length;r<n;r++)if(!p(t,e[r]))return!1;return!0}var s=i(e),r=0;for(n=t.length;r<n;r++)if("RegExp"===s){if("string"==typeof t[r]&&t[r].match(e))return!0}else if(t[r]===e)return!0;return!1}function c(t,e){if(!h(t)||!h(e)||t.length!==e.length)return!1;t.sort(),e.sort();for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0}function l(t){return t.replace(/^\/+|\/+$/g,"")}function n(t){return escape(t)}function f(t){return encodeURIComponent(t).replace(/[!'()*]/g,n).replace(/\*/g,"%2A")}function t(r){return function(t,e){return void 0===t?this._parts[r]||"":(this._parts[r]=t||null,this.build(!e),this)}}function m(r,n){return function(t,e){return void 0===t?this._parts[r]||"":(null!==t&&(t+="").charAt(0)===n&&(t=t.substring(1)),this._parts[r]=t,this.build(!e),this)}}function g(r,n){return function(e){try{return d[n](e+"").replace(d.characters[r][n].expression,function(t){return d.characters[r][n].map[t]})}catch(t){return e}}}var _,y=r&&r.URI,v=(d.version="1.19.7",d.prototype),b=Object.prototype.hasOwnProperty,w=(d._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:d.preventInvalidHostname,duplicateQueryParameters:d.duplicateQueryParameters,escapeQuerySpace:d.escapeQuerySpace}},d.preventInvalidHostname=!1,d.duplicateQueryParameters=!1,d.escapeQuerySpace=!0,d.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,d.idn_expression=/[^a-z0-9\._-]/i,d.punycode_expression=/(xn--)/i,d.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,d.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,d.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/gi,d.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},d.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},d.hostProtocols=["http","https"],d.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,d.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},d.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return d.domAttributes[e]}},d.encode=f,d.decode=decodeURIComponent,d.iso8859=function(){d.encode=escape,d.decode=unescape},d.unicode=function(){d.encode=f,d.decode=decodeURIComponent},d.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},d.encodeQuery=function(t,e){t=d.encode(t+"");return(e=void 0===e?d.escapeQuerySpace:e)?t.replace(/%20/g,"+"):t},d.decodeQuery=function(e,t){e+="",void 0===t&&(t=d.escapeQuerySpace);try{return d.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}},{encode:"encode",decode:"decode"});for(_ in w)d[_+"PathSegment"]=g("pathname",w[_]),d[_+"UrnPathSegment"]=g("urnpath",w[_]);d.decodePath=(w=function(s,a,i){return function(t){for(var e=i?function(t){return d[a](d[i](t))}:d[a],r=0,n=(t=(t+"").split(s)).length;r<n;r++)t[r]=e(t[r]);return t.join(s)}})("/","decodePathSegment"),d.decodeUrnPath=w(":","decodeUrnPathSegment"),d.recodePath=w("/","encodePathSegment","decode"),d.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),d.encodeReserved=g("reserved","encode"),d.parse=function(t,e){e=e||{preventInvalidHostname:d.preventInvalidHostname};var r=t.indexOf("#");return-1<r&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),-1<(r=t.indexOf("?"))&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=t.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=d.parseAuthority(t,e)):-1<(r=t.indexOf(":"))&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(d.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=d.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},d.parseHost=function(t,e){var r,n,s=(t=(t=t||"").replace(/\\/g,"/")).indexOf("/");return-1===s&&(s=t.length),"["===t.charAt(0)?(r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,s)||null,"/"===e.port&&(e.port=null)):(n=t.indexOf(":"),r=t.indexOf("/"),-1!==(n=t.indexOf(":",n+1))&&(-1===r||n<r)?(e.hostname=t.substring(0,s)||null,e.port=null):(r=t.substring(0,s).split(":"),e.hostname=r[0]||null,e.port=r[1]||null)),e.hostname&&"/"!==t.substring(s).charAt(0)&&(s++,t="/"+t),e.preventInvalidHostname&&d.ensureValidHostname(e.hostname,e.protocol),e.port&&d.ensureValidPort(e.port),t.substring(s)||"/"},d.parseAuthority=function(t,e){return t=d.parseUserinfo(t,e),d.parseHost(t,e)},d.parseUserinfo=function(t,e){var r=t,n=(t=-1!==t.indexOf("\\")?t.replace(/\\/g,"/"):t).indexOf("/"),s=t.lastIndexOf("@",-1<n?n:t.length-1);return-1<s&&(-1===n||s<n)?(n=t.substring(0,s).split(":"),e.username=n[0]?d.decode(n[0]):null,n.shift(),e.password=n[0]?d.decode(n.join(":")):null,t=r.substring(s+1)):(e.username=null,e.password=null),t},d.parseQuery=function(t,e){if(!t)return{};if(!(t=t.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,s={},a=t.split("&"),i=a.length,o=0;o<i;o++)r=a[o].split("="),n=d.decodeQuery(r.shift(),e),r=r.length?d.decodeQuery(r.join("="),e):null,"__proto__"!==n&&(b.call(s,n)?("string"!=typeof s[n]&&null!==s[n]||(s[n]=[s[n]]),s[n].push(r)):s[n]=r);return s},d.build=function(t){var e="",r=!1;return t.protocol&&(e+=t.protocol+":"),t.urn||!e&&!t.hostname||(e+="//",r=!0),e+=d.buildAuthority(t)||"","string"==typeof t.path&&("/"!==t.path.charAt(0)&&r&&(e+="/"),e+=t.path),"string"==typeof t.query&&t.query&&(e+="?"+t.query),"string"==typeof t.fragment&&t.fragment&&(e+="#"+t.fragment),e},d.buildHost=function(t){var e="";return t.hostname?(e=d.ip6_expression.test(t.hostname)?e+("["+t.hostname)+"]":e+t.hostname,t.port&&(e+=":"+t.port),e):""},d.buildAuthority=function(t){return d.buildUserinfo(t)+d.buildHost(t)},d.buildUserinfo=function(t){var e="";return t.username&&(e+=d.encode(t.username)),t.password&&(e+=":"+d.encode(t.password)),e&&(e+="@"),e},d.buildQuery=function(t,e,r){var n,s="";for(n in t)if("__proto__"!==n&&b.call(t,n))if(h(t[n]))for(var a={},i=0,o=t[n].length;i<o;i++)void 0!==t[n][i]&&void 0===a[t[n][i]+""]&&(s+="&"+d.buildQueryParameter(n,t[n][i],r),!0!==e)&&(a[t[n][i]+""]=!0);else void 0!==t[n]&&(s+="&"+d.buildQueryParameter(n,t[n],r));return s.substring(1)},d.buildQueryParameter=function(t,e,r){return d.encodeQuery(t,r)+(null!==e?"="+d.encodeQuery(e,r):"")},d.addQuery=function(t,e,r){if("object"==typeof e)for(var n in e)b.call(e,n)&&d.addQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");void 0===t[e]?t[e]=r:("string"==typeof t[e]&&(t[e]=[t[e]]),h(r)||(r=[r]),t[e]=(t[e]||[]).concat(r))}},d.setQuery=function(t,e,r){if("object"==typeof e)for(var n in e)b.call(e,n)&&d.setQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");t[e]=void 0===r?null:r}},d.removeQuery=function(t,e,r){if(h(e))for(r=0,n=e.length;r<n;r++)t[e[r]]=void 0;else if("RegExp"===i(e))for(var n in t)e.test(n)&&(t[n]=void 0);else if("object"==typeof e)for(n in e)b.call(e,n)&&d.removeQuery(t,n,e[n]);else{if("string"!=typeof e)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===i(r)?!h(t[e])&&r.test(t[e])?t[e]=void 0:t[e]=a(t[e],r):t[e]!==String(r)||h(r)&&1!==r.length?h(t[e])&&(t[e]=a(t[e],r)):t[e]=void 0:t[e]=void 0}},d.hasQuery=function(t,e,r,n){switch(i(e)){case"String":break;case"RegExp":for(var s in t)if(b.call(t,s)&&e.test(s)&&(void 0===r||d.hasQuery(t,s,r)))return!0;return!1;case"Object":for(var a in e)if(b.call(e,a)&&!d.hasQuery(t,a,e[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(i(r)){case"Undefined":return e in t;case"Boolean":return r===(t=!(h(t[e])?!t[e].length:!t[e]));case"Function":return!!r(t[e],e,t);case"Array":return!!h(t[e])&&(n?p:c)(t[e],r);case"RegExp":return h(t[e])?!!n&&p(t[e],r):!(!t[e]||!t[e].match(r));case"Number":r=String(r);case"String":return h(t[e])?!!n&&p(t[e],r):t[e]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},d.joinPaths=function(){for(var t=[],e=[],r=0,n=0;n<arguments.length;n++){var s=new d(arguments[n]);t.push(s);for(var s=s.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&e.push(s[a]),s[a]&&r++}return e.length&&r?(e=new d("").segment(e),""!==t[0].path()&&"/"!==t[0].path().slice(0,1)||e.path("/"+e.path()),e.normalize()):new d("")},d.commonPath=function(t,e){for(var r=Math.min(t.length,e.length),n=0;n<r;n++)if(t.charAt(n)!==e.charAt(n)){n--;break}return n<1?t.charAt(0)===e.charAt(0)&&"/"===t.charAt(0)?"/":"":("/"===t.charAt(n)&&"/"===e.charAt(n)||(n=t.substring(0,n).lastIndexOf("/")),t.substring(0,n+1))},d.withinString=function(t,e,r){var n=(r=r||{}).start||d.findUri.start,s=r.end||d.findUri.end,a=r.trim||d.findUri.trim,i=r.parens||d.findUri.parens,o=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var h=n.exec(t);if(!h)break;var u=h.index;if(r.ignoreHtml){var p=t.slice(Math.max(u-3,0),u);if(p&&o.test(p))continue}for(var c=u+t.slice(u).search(s),p=t.slice(u,c),c=-1;;){var l=i.exec(p);if(!l)break;c=Math.max(c,l.index+l[0].length)}(p=-1<c?p.slice(0,c)+p.slice(c).replace(a,""):p.replace(a,"")).length<=h[0].length||r.ignore&&r.ignore.test(p)||(void 0===(h=e(p,u,c=u+p.length,t))?n.lastIndex=c:(h=String(h),t=t.slice(0,u)+h+t.slice(c),n.lastIndex=u+h.length))}return n.lastIndex=0,t},d.ensureValidHostname=function(t,e){var r=!!t,n=!1;if((n=e?p(d.hostProtocols,e):n)&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+e);if(t&&t.match(d.invalid_hostname_characters)){if(!o)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(o.toASCII(t).match(d.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},d.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&0<e&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},d.noConflict=function(t){return t?(t={URI:this.noConflict()},r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t):(r.URI===this&&(r.URI=y),this)},v.build=function(t){return!0===t?this._deferred_build=!0:void 0!==t&&!this._deferred_build||(this._string=d.build(this._parts),this._deferred_build=!1),this},v.clone=function(){return new d(this)},v.valueOf=v.toString=function(){return this.build(!1)._string},v.protocol=t("protocol"),v.username=t("username"),v.password=t("password"),v.hostname=t("hostname"),v.port=t("port"),v.query=m("query","?"),v.fragment=m("fragment","#"),v.search=function(t,e){t=this.query(t,e);return"string"==typeof t&&t.length?"?"+t:t},v.hash=function(t,e){t=this.fragment(t,e);return"string"==typeof t&&t.length?"#"+t:t},v.pathname=function(t,e){var r;return void 0===t||!0===t?(r=this._parts.path||(this._parts.hostname?"/":""),t?(this._parts.urn?d.decodeUrnPath:d.decodePath)(r):r):(this._parts.path=this._parts.urn?t?d.recodeUrnPath(t):"":t?d.recodePath(t):"/",this.build(!e),this)},v.path=v.pathname,v.href=function(t,e){if(void 0===t)return this.toString();this._string="",this._parts=d._parts();var r=t instanceof d,n="object"==typeof t&&(t.hostname||t.path||t.pathname);if(t.nodeName&&(t=t[n=d.getDomAttribute(t)]||"",n=!1),"string"==typeof(t=!r&&n&&void 0!==t.pathname?t.toString():t)||t instanceof String)this._parts=d.parse(String(t),this._parts);else{if(!r&&!n)throw new TypeError("invalid input");for(var s in r=r?t._parts:t)"query"!==s&&b.call(this._parts,s)&&(this._parts[s]=r[s]);r.query&&this.query(r.query,!1)}return this.build(!e),this},v.is=function(t){var e=!1,r=!1,n=!1,s=!1,a=!1,i=!1,o=!1,h=!this._parts.urn;switch(this._parts.hostname&&(h=!1,r=d.ip4_expression.test(this._parts.hostname),n=d.ip6_expression.test(this._parts.hostname),a=(s=!(e=r||n))&&u&&u.has(this._parts.hostname),i=s&&d.idn_expression.test(this._parts.hostname),o=s&&d.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return h;case"absolute":return!h;case"domain":case"name":return s;case"sld":return a;case"ip":return e;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return n;case"idn":return i;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return o}return null};var x=v.protocol,A=v.port,Q=v.hostname,I=(v.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(d.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,t,e)},v.scheme=v.protocol,v.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(t=0===t?null:t)&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),d.ensureValidPort(t)),A.call(this,t,e))},v.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==d.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&d.ensureValidHostname(t,this._parts.protocol)}return Q.call(this,t,e)},v.origin=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t?(r=this.protocol(),this.authority()?(r?r+"://":"")+this.authority():""):(r=d(t),this.protocol(r.protocol()).authority(r.authority()).build(!e),this)},v.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?d.buildHost(this._parts):"";if("/"!==d.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},v.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?d.buildAuthority(this._parts):"";if("/"!==d.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},v.userinfo=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t?(r=d.buildUserinfo(this._parts))&&r.substring(0,r.length-1):("@"!==t[t.length-1]&&(t+="@"),d.parseUserinfo(t,this._parts),this.build(!e),this)},v.resource=function(t,e){return void 0===t?this.path()+this.search()+this.hash():(t=d.parse(t),this._parts.path=t.path,this._parts.query=t.query,this._parts.fragment=t.fragment,this.build(!e),this)},v.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if(void 0===t)return this._parts.hostname&&!this.is("IP")&&(r=this._parts.hostname.length-this.domain().length-1,this._parts.hostname.substring(0,r))||"";if(r=this._parts.hostname.length-this.domain().length,r=this._parts.hostname.substring(0,r),r=new RegExp("^"+s(r)),t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&d.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},v.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.match(/\./g))&&r.length<2?this._parts.hostname:(r=this._parts.hostname.length-this.tld(e).length-1,r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||"");if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return d.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP")?this._parts.hostname=t:(r=new RegExp(s(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(r,t)),this.build(!e),this},v.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t)return!this._parts.hostname||this.is("IP")?"":(r=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(r+1),!0!==e&&u&&u.list[r.toLowerCase()]&&u.get(this._parts.hostname)||r);if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!u||!u.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]')}else if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");return r=new RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},v.directory=function(t,e){var r;return this._parts.urn?void 0===t?"":this:void 0===t||!0===t?this._parts.path||this._parts.hostname?"/"===this._parts.path?"/":(r=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,r)||(this._parts.hostname?"/":""),t?d.decodePath(r):r):"":(r=this._parts.path.length-this.filename().length,r=this._parts.path.substring(0,r),r=new RegExp("^"+s(r)),this.is("relative")||"/"!==(t=t||"/").charAt(0)&&(t="/"+t),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=d.recodePath(t),this._parts.path=this._parts.path.replace(r,t),this.build(!e),this)},v.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r;if("string"!=typeof t)return this._parts.path&&"/"!==this._parts.path?(r=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(r+1),t?d.decodePathSegment(r):r):"";r=!1,(t="/"===t.charAt(0)?t.substring(1):t).match(/\.?\//)&&(r=!0);var n=new RegExp(s(this.filename())+"$");return t=d.recodePath(t),this._parts.path=this._parts.path.replace(n,t),r?this.normalizePath(e):this.build(!e),this},v.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;var r,n;if(void 0===t||!0===t)return!this._parts.path||"/"===this._parts.path||-1===(n=(r=this.filename()).lastIndexOf("."))?"":(r=r.substring(n+1),r=/^[a-z0-9%]+$/i.test(r)?r:"",t?d.decodePathSegment(r):r);if("."===t.charAt(0)&&(t=t.substring(1)),r=this.suffix())n=t?new RegExp(s(r)+"$"):new RegExp(s("."+r)+"$");else{if(!t)return this;this._parts.path+="."+d.recodePath(t)}return n&&(t=d.recodePath(t),this._parts.path=this._parts.path.replace(n,t)),this.build(!e),this},v.segment=function(t,e,r){var n=this._parts.urn?":":"/",s="/"===(a=this.path()).substring(0,1),a=a.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw Error('Bad segment "'+t+'", must be 0-based integer');if(s&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(h(e)){a=[],t=0;for(var i=e.length;t<i;t++)(e[t].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(l(e[t])))}else!e&&"string"!=typeof e||(e=l(e),""===a[a.length-1]?a[a.length-1]=e:a.push(e));else e?a[t]=l(e):a.splice(t,1);return s&&a.unshift(""),this.path(a.join(n),r)},v.segmentCoded=function(t,e,r){if("number"!=typeof t&&(r=e,e=t,t=void 0),void 0===e){if(h(t=this.segment(t,e,r)))for(var n=0,s=t.length;n<s;n++)t[n]=d.decode(t[n]);else t=void 0!==t?d.decode(t):void 0;return t}if(h(e))for(n=0,s=e.length;n<s;n++)e[n]=d.encode(e[n]);else e="string"==typeof e||e instanceof String?d.encode(e):e;return this.segment(t,e,r)},v.query);return v.query=function(t,e){var r,n;return!0===t?d.parseQuery(this._parts.query,this._parts.escapeQuerySpace):"function"==typeof t?(r=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=t.call(this,r),this._parts.query=d.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):void 0!==t&&"string"!=typeof t?(this._parts.query=d.buildQuery(t,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):I.call(this,t,e)},v.setQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof t||t instanceof String)n[t]=void 0!==e?e:null;else{if("object"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var s in t)b.call(t,s)&&(n[s]=t[s])}return this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.addQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.addQuery(n,t,void 0===e?null:e),this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.removeQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.removeQuery(n,t,e),this._parts.query=d.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!(r="string"!=typeof t?e:r)),this},v.hasQuery=function(t,e,r){var n=d.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return d.hasQuery(n,t,e,r)},v.setSearch=v.setQuery,v.addSearch=v.addQuery,v.removeSearch=v.removeQuery,v.hasSearch=v.hasQuery,v.normalize=function(){return(this._parts.urn?this.normalizeProtocol(!1):this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1)).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},v.normalizeProtocol=function(t){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!t)),this},v.normalizeHostname=function(t){return this._parts.hostname&&(this.is("IDN")&&o?this._parts.hostname=o.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!t)),this},v.normalizePort=function(t){return"string"==typeof this._parts.protocol&&this._parts.port===d.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!t)),this},v.normalizePath=function(t){if(r=this._parts.path)if(this._parts.urn)this._parts.path=d.recodeUrnPath(this._parts.path),this.build(!t);else if("/"!==this._parts.path){var e,r,n="";for("/"!==(r=d.recodePath(r)).charAt(0)&&(e=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(n=(n=r.substring(1).match(/^(\.\.\/)+/)||"")&&n[0]);;){var s,a=r.search(/\/\.\.(\/|$)/);if(-1===a)break;0===a?r=r.substring(3):(-1===(s=r.substring(0,a).lastIndexOf("/"))&&(s=a),r=r.substring(0,s)+r.substring(a+3))}e&&this.is("relative")&&(r=n+r.substring(1)),this._parts.path=r,this.build(!t)}return this},v.normalizePathname=v.normalizePath,v.normalizeQuery=function(t){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(d.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!t)),this},v.normalizeFragment=function(t){return this._parts.fragment||(this._parts.fragment=null,this.build(!t)),this},v.normalizeSearch=v.normalizeQuery,v.normalizeHash=v.normalizeFragment,v.iso8859=function(){var t=d.encode,e=d.decode;d.encode=escape,d.decode=decodeURIComponent;try{this.normalize()}finally{d.encode=t,d.decode=e}return this},v.unicode=function(){var t=d.encode,e=d.decode;d.encode=f,d.decode=unescape;try{this.normalize()}finally{d.encode=t,d.decode=e}return this},v.readable=function(){var t=this.clone(),e=(t.username("").password("").normalize(),"");if(t._parts.protocol&&(e+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&o?(e+=o.toUnicode(t._parts.hostname),t._parts.port&&(e+=":"+t._parts.port)):e+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(e+="/"),e+=t.path(!0),t._parts.query){for(var r="",n=0,s=t._parts.query.split("&"),a=s.length;n<a;n++){var i=(s[n]||"").split("=");r+="&"+d.decodeQuery(i[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==i[1]&&(r+="="+d.decodeQuery(i[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}e+="?"+r.substring(1)}return e+d.decodeQuery(t.hash(),!0)},v.absoluteTo=function(t){var e,r,n=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");if(t instanceof d||(t=new d(t)),!n._parts.protocol&&(n._parts.protocol=t._parts.protocol,!this._parts.hostname)){for(e=0;r=s[e];e++)n._parts[r]=t._parts[r];n._parts.path?(".."===n._parts.path.substring(-2)&&(n._parts.path+="/"),"/"!==n.path().charAt(0)&&(s=(s=t.directory())||(0===t.path().indexOf("/")?"/":""),n._parts.path=(s?s+"/":"")+n._parts.path,n.normalizePath())):(n._parts.path=t._parts.path,n._parts.query||(n._parts.query=t._parts.query)),n.build()}return n},v.relativeTo=function(t){var e=this.clone().normalize();if(e._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");t=new d(t).normalize();var r=e._parts,n=t._parts,s=e.path();if(t=t.path(),"/"!==s.charAt(0))throw Error("URI is already relative");if("/"!==t.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");return r.protocol===n.protocol&&(r.protocol=null),r.username===n.username&&r.password===n.password&&null===r.protocol&&null===r.username&&null===r.password&&r.hostname===n.hostname&&r.port===n.port&&(r.hostname=null,r.port=null,s===t?r.path="":(s=d.commonPath(s,t))&&(n=n.path.substring(s.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),r.path=n+r.path.substring(s.length)||"./")),e.build()},v.equals=function(t){var e,r=this.clone(),n=new d(t);if(t={},r.normalize(),n.normalize(),r.toString()!==n.toString()){var s=r.query(),a=n.query();if(r.query(""),n.query(""),r.toString()!==n.toString()||s.length!==a.length)return!1;for(e in r=d.parseQuery(s,this._parts.escapeQuerySpace),a=d.parseQuery(a,this._parts.escapeQuerySpace),r)if(b.call(r,e)){if(h(r[e])){if(!c(r[e],a[e]))return!1}else if(r[e]!==a[e])return!1;t[e]=!0}for(e in a)if(b.call(a,e)&&!t[e])return!1}return!0},v.preventInvalidHostname=function(t){return this._parts.preventInvalidHostname=!!t,this},v.duplicateQueryParameters=function(t){return this._parts.duplicateQueryParameters=!!t,this},v.escapeQuerySpace=function(t){return this._parts.escapeQuerySpace=!!t,this},d}),function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("./URI")):"function"==typeof define&&define.amd?define(["./URI"],e):t.URITemplate=e(t.URI,t)}(this,function(d,t){function f(t){return f._cache[t]||(this instanceof f?(this.expression=t,f._cache[t]=this):new f(t))}function a(t){this.data=t,this.cache={}}var e=t&&t.URITemplate,s=Object.prototype.hasOwnProperty,r=f.prototype,m={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};return f._cache={},f.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,f.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/,f.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,f.LITERAL_PATTERN=/[<>{}"`^| \\]/,f.expand=function(t,e,r){for(var n,s=m[t.operator],a=s.named?"Named":"Unnamed",i=(t=t.variables,[]),o=0;n=t[o];o++){var h=e.get(n.name);if(0===h.type&&r&&r.strict)throw Error('Missing expansion value for variable "'+n.name+'"');if(h.val.length){if(1<h.type&&n.maxlength)throw Error('Invalid expression: Prefix modifier not applicable to variable "'+n.name+'"');i.push(f["expand"+a](h,s,n.explode,n.explode&&s.separator||",",n.maxlength,n.name))}else h.type&&i.push("")}return i.length?s.prefix+i.join(s.separator):""},f.expandNamed=function(t,e,r,n,s,a){for(var i,o="",h=e.encode,u=(e=e.empty_name_separator,!t[h].length),p=2===t.type?"":d[h](a),c=0,l=t.val.length;c<l;c++)s?(i=d[h](t.val[c][1].substring(0,s)),2===t.type&&(p=d[h](t.val[c][0].substring(0,s)))):u?(i=d[h](t.val[c][1]),2===t.type?(p=d[h](t.val[c][0]),t[h].push([p,i])):t[h].push([void 0,i])):(i=t[h][c][1],2===t.type&&(p=t[h][c][0])),o&&(o+=n),r?o+=p+(e||i?"=":"")+i:(c||(o+=d[h](a)+(e||i?"=":"")),2===t.type&&(o+=p+","),o+=i);return o},f.expandUnnamed=function(t,e,r,n,s){for(var a,i="",o=e.encode,h=(e=e.empty_name_separator,!t[o].length),u=0,p=t.val.length;u<p;u++)s?a=d[o](t.val[u][1].substring(0,s)):h?(a=d[o](t.val[u][1]),t[o].push([2===t.type?d[o](t.val[u][0]):void 0,a])):a=t[o][u][1],i&&(i+=n),2===t.type&&(i+=s?d[o](t.val[u][0].substring(0,s)):t[o][u][0],i=r?i+(e||a?"=":""):i+","),i+=a;return i},f.noConflict=function(){return t.URITemplate===f&&(t.URITemplate=e),f},r.expand=function(t,e){var r="";this.parts&&this.parts.length||this.parse(),t instanceof a||(t=new a(t));for(var n=0,s=this.parts.length;n<s;n++)r+="string"==typeof this.parts[n]?this.parts[n]:f.expand(this.parts[n],t,e);return r},r.parse=function(){function t(t){if(t.match(a))throw Error('Invalid Literal "'+t+'"');return t}var e=this.expression,r=f.EXPRESSION_PATTERN,n=f.VARIABLE_PATTERN,s=f.VARIABLE_NAME_PATTERN,a=f.LITERAL_PATTERN,i=[],o=0;for(r.lastIndex=0;;){var h=r.exec(e);if(null===h){i.push(t(e.substring(o)));break}if(i.push(t(e.substring(o,h.index))),o=h.index+h[0].length,!m[h[1]])throw Error('Unknown Operator "'+h[1]+'" in "'+h[0]+'"');if(!h[3])throw Error('Unclosed Expression "'+h[0]+'"');for(var u=h[2].split(","),p=0,c=u.length;p<c;p++){var l=u[p].match(n);if(null===l)throw Error('Invalid Variable "'+u[p]+'" in "'+h[0]+'"');if(l[1].match(s))throw Error('Invalid Variable Name "'+l[1]+'" in "'+h[0]+'"');u[p]={name:l[1],explode:!!l[3],maxlength:l[4]&&parseInt(l[4],10)}}if(!u.length)throw Error('Expression Missing Variable(s) "'+h[0]+'"');i.push({expression:h[0],operator:h[1],variables:u})}return i.length||i.push(t(e)),this.parts=i,this},a.prototype.get=function(t){var e=this.data,r={type:0,val:[],encode:[],encodeReserved:[]};if(void 0!==this.cache[t])return this.cache[t];if(this.cache[t]=r,null!=(e="[object Function]"===String(Object.prototype.toString.call(e))?e(t):"[object Function]"===String(Object.prototype.toString.call(e[t]))?e[t](t):e[t]))if("[object Array]"===String(Object.prototype.toString.call(e))){var n=0;for(t=e.length;n<t;n++)void 0!==e[n]&&null!==e[n]&&r.val.push([void 0,String(e[n])]);r.val.length&&(r.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(e))){for(n in e)s.call(e,n)&&void 0!==e[n]&&null!==e[n]&&r.val.push([n,String(e[n])]);r.val.length&&(r.type=2)}else r.type=1,r.val.push([void 0,String(e)]);return r},d.expand=function(t,e){t=new f(t).expand(e);return new d(t)},f}),function(t,e){"object"==typeof module&&module.exports?module.exports=e(require("jquery"),require("./URI")):"function"==typeof define&&define.amd?define(["jquery","./URI"],e):e(t.jQuery,t.URI)}(this,function(n,a){function s(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function i(t){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return a.domAttributes[e]}function o(t,e){var r;return!(!i(t)||!e||!(e=e.match(p))||!e[5]&&":"!==e[2]&&!u[e[2]])&&(t=n(t).uri(),e[5]?t.is(e[5]):":"===e[2]?(r=e[1].toLowerCase()+":",!!u[r]&&u[r](t,e[4])):(r=e[1].toLowerCase(),!!h[r]&&u[e[2]](t[r](),e[4],r)))}function r(t,e){return n(t).uri().href(e).toString()}var h={},u={"=":function(t,e){return t===e},"^=":function(t,e){return!!(t+"").match(new RegExp("^"+s(e),"i"))},"$=":function(t,e){return!!(t+"").match(new RegExp(s(e)+"$","i"))},"*=":function(t,e,r){return"directory"===r&&(t+="/"),!!(t+"").match(new RegExp(s(e),"i"))},"equals:":function(t,e){return t.equals(e)},"is:":function(t,e){return t.is(e)}},p=(n.each("origin authority directory domain filename fragment hash host hostname href password path pathname port protocol query resource scheme search subdomain suffix tld username".split(" "),function(t,e){var r;h[e]=!0,n.attrHooks["uri:"+e]=(r=e,{get:function(t){return n(t).uri()[r]()},set:function(t,e){return n(t).uri()[r](e),e}})}),n.each(["src","href","action","uri","cite"],function(t,e){n.attrHooks[e]={set:r}}),n.attrHooks.uri.get=function(t){return n(t).uri()},n.fn.uri=function(t){var e=this.first(),r=e.get(0),n=i(r);if(!n)throw Error('Element "'+r.nodeName+'" does not have either property: href, src, action, cite');if(void 0!==t){var s=e.data("uri");if(s)return s.href(t);t instanceof a||(t=a(t||""))}else{if(t=e.data("uri"))return t;t=a(e.attr(n)||"")}return t._dom_element=r,t._dom_attribute=n,t.normalize(),e.data("uri",t),t},a.prototype.build=function(t){return this._dom_element?(this._string=a.build(this._parts),this._deferred_build=!1,this._dom_element.setAttribute(this._dom_attribute,this._string),this._dom_element[this._dom_attribute]=this._string):!0===t?this._deferred_build=!0:void 0!==t&&!this._deferred_build||(this._string=a.build(this._parts),this._deferred_build=!1),this},/^([a-zA-Z]+)\s*([\^\$*]?=|:)\s*(['"]?)(.+)\3|^\s*([a-zA-Z0-9]+)\s*$/),t=n.expr.createPseudo?n.expr.createPseudo(function(e){return function(t){return o(t,e)}}):function(t,e,r){return o(t,r[3])};return n.expr[":"].uri=t,n});
$(".quickSaveForRouteAlert").on("click",function(){var e=$("#subscriberRouteName").attr("data-subscriberRouteId"),o=$("#quickRouteNotificationModal #subscriberRouteName").text(),i=0<$(".mapPage").length;$.ajax("/My511/SaveQuickRouteAlert",{data:{routeId:e,routeName:o},type:"POST"}).done(function(){i?AlertHelper.addAlertText(AlertType.Success,window.resources.AlertSavedSuccessfully+" "+window.resources.ViewLinkOnAlertSavedSuccessfully,7e3):window.location.href="/my511"}).fail(function(){AlertHelper.addAlertText(AlertType.Error,window.resources.AlertFailedToSave,7e3)})}),$("#hideSimplifyRouteNotification").on("change",function(){$(this).is(":checked")?Cookies.set("_hideSimplifyRouteNotificationModal",!0):Cookies.remove("_hideSimplifyRouteNotificationModal")}),$("#hideRouteNotification").on("change",function(){$(this).is(":checked")?Cookies.set("_hideRouteNotificationModal",!0):Cookies.remove("_hideRouteNotificationModal")});
