function sanitize(n){return n.replace(/<script[^>]*?>.*?<\/script>/gi,"").replace(/<style[^>]*?>.*?<\/style>/gi,"").replace(/<![\s\S]*?--[ \t\n\r]*>/gi,"").replace(/\son[a-zA-Z]*=/gi,"").replace("javascript:","")}function closeModalForSession(){var n=$("#weatherAlertBarDiv").data("close-bar-url");$.ajax({url:n,datatype:"json",contenttype:"application/json",type:"GET",context:this,cache:!1,error:function(){}})}function makeWeatherUrl(n,t){return $(".weather-widget").data("weatherurl")+n+","+t}function makeWeatherLocationUrl(n){return $(".weather-widget").data("weatherlocationurl").replace("{zip}",n)}function getWeatherIcon(n){var i="weather-icon weather-snow",t="weather-icon weather-rain",u="weather-icon weather-sprinkles",f="weather-icon weather-thunderstorms",o="weather-icon weather-mostly-cloudy",r="weather-icon weather-fog",e="weather-icon weather-partly-cloudy",s="weather-icon weather-sunny",h={"13":i,"14":i,"15":i,"16":i,"25":i,"42":i,"6":t,"9":t,"11":t,"12":t,"17":t,"18":t,"40":t,"5":u,"7":u,"8":u,"10":u,"1":f,"4":f,"38":f,"47":f,"19":r,"20":r,"21":r,"22":r,"24":r,"26":o,"27":o,"28":o,"29":e,"30":e,"33":e,"34":e,"31":s,"32":s},n=h[n]!=null?h[n]:"";return n}var weather=function(){function t(n,t){document.cookie=n+"="+t+"; path=/"}function r(n,t){var i=Number(n.location.latitude.toFixed(2)),r=Number(n.location.longitude.toFixed(2)),u=makeWeatherUrl(i,r);$.ajax({url:u,dataType:"json",success:function(i){var r=h(n,i);e(r.sessionAlertVisible.toLowerCase()=="true"?r.sessionAlert:"");t&&t(r)}})}function u(n){c(n);typeof loadWeatherData=="function"&&loadWeatherData(n)}function h(n,t){var o="",s="",r="",h="",c="",l="",u="",e="",a="",v="false",y="",p="",w="",b="",i;return n!=null&&n.location!=null&&(o=n.location.city,s=n.location.adminDistrictCode,r=n.location.postalCode,h=n.location.latitude!=null?n.location.latitude.toFixed(2).toString():"",c=n.location.longitude!=null?n.location.longitude.toFixed(2).toString():""),t!=null&&((r==""||r==null||typeof r=="undefined")&&(r=t.sessionZip?t.sessionZip:""),t.v2obs!=null&&t.v2obs.observation!=null&&(observationObj=t.v2obs.observation,l=observationObj.temp!=null?observationObj.temp:"",u=observationObj.wx_icon!=null?observationObj.wx_icon.toString():"",y=observationObj.feels_like!=null?observationObj.feels_like.toString():"",p=observationObj.wdir_cardinal!=null?observationObj.wdir_cardinal.toString():"",w=observationObj.rh!=null?observationObj.rh.toString():"",b=observationObj.wspd!=null?observationObj.wspd.toString():""),t.v3alertsHeadlines!=null&&(i=t.v3alertsHeadlines.alerts.length>0?t.v3alertsHeadlines.alerts[0]:null,e=i!=null&&i.phenomena!=null?i.phenomena:"",a=i!=null&&i.description!=null?i.description:"",v=f(e).toString())),{sessionZip:r,sessionCity:o,sessionState:s,sessionTemp:l,sessionIcon:getWeatherIcon(u),sessionRawIcon:u,sessionAlert:e,sessionAlertDescription:a,sessionAlertVisible:v,sessionLatitude:h,sessionLongitude:c,sessionHumidityRate:w,sessionWindDirection:p,sessionWindValue:b,sessionFeelsLikeValue:y}}function f(n){var u;if(n=="")return!1;var i=$("#alertBarSevereWeather"),t=i.data("alertslist"),s=!1;if(Array.isArray(t)&&t.length>1){for(var r=-1,f=!1,h="",e="",o="",c="";++r<t.length&&!f;)typeof t[r]!="undefined"&&n==t[r].PhenomenaCode&&(h=t[r].Title,e=t[r].AlertMessage,o=t[r].CTALink,c=t[r].CTAText,f=!0);if(f&&e!=""&&o!=""&&(u=i.find(".severe-weather-alert-text"),typeof u!="undefined"&&u!=null)){var l=i.find(".severe-weather-alert-timestamp"),a=l.data("timestamp-prefix"),v=i.find(".severe-weather-alert-title");i.data("more-destination",o);v.text(h);u.text(e);l.text(a+" "+moment().format("h:mm A M/D/YY"));i.find("a.ce-outage-alert__link").text(c);i.removeClass("d-none");i.addClass("visible");s=!0}}return s}function c(n){var i=$("#__WeatherAjaxAntiForgeryForm"),r=$('input[name="__RequestVerificationToken"]',i).val(),u=$(".weather-widget").data("setweathersession");$.ajax({type:"POST",url:u,cache:!1,data:{__RequestVerificationToken:r,model:n},dataType:"json",success:function(n){n.success&&typeof n.County!="undefined"&&n.County!=""&&t("County",n.County)}})}function e(n){var t=typeof n!="undefined"&&n!="",i=$("#weatherAlertBarDiv .wp_header-alert:not(.d-none)").length>0||t,r=$(".breaking-news-banner").length>0;i&&!r&&($("#mainCarousel").addClass("alert-open"),t?($("#weatherAlertBarDiv .wp_header-alert.wp_outage-alert").addClass("d-none"),$("#weatherAlertBarDiv #alertBarSevereWeather").removeClass("d-none"),$(".breaking-news-banner.row").length>0||($("div.fixed-nav").addClass("severe-weather"),$(".msp_master.wp_noc-outage-center").addClass("severe-weather")),$("#weatherAlertBarDiv").removeClass("d-none")):($("#weatherAlertBarDiv #alertBarSevereWeather").addClass("d-none"),$("#weatherAlertBarDiv").removeClass("d-none"),$("div.fixed-nav").removeClass("severe-weather")),$(".message:visible").length>0?($(".wp-header-container").addClass("alert-open"),$(".wp-header-container").hasClass("fixed-nav")&&($(".msp_master-homepage.clearfix").addClass("fixed-alert"),$(".msp_master").addClass("fixed-alert"),$(".wp_mobile-landing-page").addClass("fixed-alert"))):($(".wp-header-container").removeClass("alert-open").addClass("alert-closed"),$(".msp_master").addClass("alert-closed"),$("#mainCarousel").removeClass("alert-open"),$(".wp-header-container").hasClass("fixed-nav")&&($(".msp_master-homepage.clearfix").removeClass("fixed-alert"),$(".msp_master").removeClass("fixed-alert"),$(".wp_mobile-landing-page").removeClass("fixed-alert"))),window.setTimeout(function(){updateScrollPosition()},500))}function l(){$(".ce-outage-alert__container #closeModalForSession").click(function(){return closeModalForSession(),!1});$(".message").length>0&&$('[data-close="message"]').on("click",function(n){n.preventDefault();$(this).closest(".wp-header-container").find(".message").removeClass("in");$(".wp_header-alert").slideUp()});$(".ce-outage-alert__close").on("click",function(){$(this).closest(".ce-outage-alert__container").removeClass("ce-outage-alert__container--open");$(".wp-header-container").removeClass("alert-open").addClass("alert-closed");$(".wp-header-container").siblings(".msp_master").addClass("alert-closed");$("#mainCarousel").length>0&&$("#mainCarousel").removeClass("alert-open");$("div.fixed-nav").removeClass("severe-weather")});$("#alertBarSevereWeather .ce-outage-alert__link").click(function(){var n=$("#alertBarSevereWeather").data("more-destination");return PushEventGaTagParms("Alert Interaction","Read More","Weather Notice"),typeof n!="undefined"&&n!=null&&n!=""&&(window.location.href=n),!1})}var n,o=function(i){n={sessionZip:i.weatherzip,sessionCity:i.weathercity,sessionState:i.weatherstate,sessionCounty:i.weathercounty,sessionTemp:i.weathertemp,sessionIcon:i.weathericon,sessionRawIcon:i.sessionrawicon,sessionAlert:i.sessionalert,sessionAlertDescription:i.sessionalertdescription,sessionAlertVisible:i.alertvisible,sessionLatitude:i.weatherlatitude,sessionLongitude:i.weatherlongitude};objectCookie.getCookie("County")!=n.sessionCounty&&t("County",n.sessionCounty);l()},s=function(){var o=$(".wp_noc-outage-block .wp_noc-weather"),s=!n.sessionCity||!n.sessionState||!n.sessionLatitude||!n.sessionLongitude,h=!n.sessionTemp||!n.sessionIcon,c,t;s||h?(s?i(n.sessionZip,u):h&&(c={location:{city:n.sessionCity,adminDistrictCode:n.sessionState,postalCode:n.sessionZip,latitude:parseFloat(n.sessionLatitude),longitude:parseFloat(n.sessionLongitude)}},r(c,u)),o.length>0&&(t=$(".wp_noc-outage-block .wp_noc-weather").data("first-account-zip"),t?updateWeatherOutageSituationWithZipCode(t):updateWeatherOutageSituationWithZipCode(n.sessionZip))):(f(n.sessionAlertVisible.toLowerCase()=="true"?n.sessionAlert:""),e(n.sessionAlertVisible.toLowerCase()=="true"?n.sessionAlert:""),o.length>0&&(t=o.data("first-account-zip"),t||(t=n.sessionZip),n.sessionZip===t?loadWeatherData(n):updateWeatherOutageSituationWithZipCode(t)))},i=function(n,t){var i=makeWeatherLocationUrl(n);$.ajax({url:i,dataType:"json",success:function(n){r(n,t)}})};return{initialize:o,loadWeather:s,getWeatherFromZip:i}}();jQuery(document).ready(function(){var n=$(".weather-widget").data();weather.initialize(n);weather.loadWeather()})