(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,253276,e=>{"use strict";var t=e.i(699173),i=e.i(592121);e.s(["default",0,function({candidate:e,failedMessage:s="Authentication failed. Please try again.",protectMessage:a="Remove your adblocker.",fetch:r,refresh:l,getCustomAccountInfo:o}){let[n,c]=(0,i.useState)(""),[d,A]=(0,i.useState)(!1),[u,m]=(0,i.useState)(!1),[g,h]=(0,i.useState)(!1),p=(0,i.useRef)([]);(0,i.useEffect)(()=>{e.id!==p.current[0]&&(p.current=[e.id],e.transactIDs&&p.current.push(...e.transactIDs))},[e.id,e.transactIDs]);let f=(0,i.useCallback)(()=>{try{r("/?adm_get_token=1").then(e=>{e.ok&&l()}).catch(()=>{c(s)})}catch{c(s)}},[r,s,l]),x=(0,i.useMemo)(()=>"u">typeof window?window:{admiral:{}},[]);return(0,i.useEffect)(()=>{typeof window>"u"||(x.admiral=x.admiral||function(...e){(x.admiral.q=x.admiral.q||[]).push(e)},x.admiral("after","measure.detected",function(t){if("abr"==e.requirement)t.adblocking?(c(a),A(!0)):h(!0);else if("account"==e.requirement||"benefits"==e.requirement){let t=!!o;x.admiral("after","visitor.latest",function(i){var s;if("account"===e.requirement)(t?o().registered:i.status.registered)||u||(c(a),A(!0));else if("benefits"===e.requirement){let i=[];if(t)i=o().benefits;else{let e=document.cookie.split(";");e&&(i=(null==(s=e.find(e=>e.startsWith("admbenefits=")))?void 0:s.split(","))??[])}if(i){let t=e.benefits??[];if(0==t.length)return void h(!0);let s=!1;for(let e of t)i.includes(e)&&(s=!0);s?h(!0):(c(a),A(!0))}else c(a),A(!0)}})}}))},[]),(0,i.useEffect)(()=>{g&&(h(!1),f())},[g,f]),(0,i.useEffect)(()=>{u||!d||(m(!0),x.admiral("targeting","force",{candidateIDs:p.current}))},[u,d,p,x]),(0,t.jsxs)("div",{children:[n||null," "]})}])},590238,e=>{"use strict";var t=e.i(537989);e.i(609717);var i=e.i(950771),s=e.i(695203),a=e.i(604323),r=e.i(797770),l=e.i(513539),o=e.i(991511);e.s(["AnalyticsBoundary",0,e=>((0,o.useRehydrateAtoms)([[t.pageIdAtom,e.pageId],[i.pageLocaleAtom,e.pageLocale],[s.deviceClassAtom,e.deviceClass],[a.metricsArticleDataAtom,e.metricsArticleData],[r.adsMetricsUnitAndZoneAtom,e.adsMetricsUnitAndZone??"non_monetized"],[l.layoutStateAtom,e.layoutState??null],[l.activeEventAtom,e.activeEvent??null]]),null)])},404893,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["googleLoginInitilizedAtom",0,t])},61284,e=>{"use strict";e.s(["PROMO_CHECKOUT_URL",0,"/subscribe/checkout?products=e251f39b-afd7-4ad9-9c87-5e2a8ed63fbb&promoCode=5OFF&tpcc=mktg-5OFF-reg"])},576816,703123,e=>{"use strict";var t=e.i(592121),i=e.i(959194),s=e.i(947118),a=e.i(737801);e.s(["useSignupComplete",0,(e={})=>{let r=(0,s.useIsInitialized)(),l=(0,a.useEventAttributes)(),[o,n]=(0,t.useState)(!1),c=(0,t.useRef)(!1),d=(0,t.useMemo)(()=>{let t={...l,formVariant:e.formVariant,sensitiveDataAuthorization:e.sensitiveDataAuthorization,deviceTimeZone:e.deviceTimeZone,sourcePage:e.sourcePage,sourceModule:e.sourceModule,sourceElement:e.sourceElement,sourcePosition:e.sourcePosition,mParticleGranted:e.mParticleGranted??!0};return void 0!==e.url&&(t.url=e.url),void 0===t.formVariant&&delete t.formVariant,void 0===t.sensitiveDataAuthorization&&delete t.sensitiveDataAuthorization,void 0===t.deviceTimeZone&&delete t.deviceTimeZone,void 0===t.sourcePage&&delete t.sourcePage,void 0===t.sourceModule&&delete t.sourceModule,void 0===t.sourceElement&&delete t.sourceElement,void 0===t.sourcePosition&&delete t.sourcePosition,t},[l,e.formVariant,e.url,e.sensitiveDataAuthorization,e.deviceTimeZone,e.sourcePage,e.sourceModule,e.sourceElement,e.sourcePosition,e.mParticleGranted]);return(0,t.useEffect)(()=>{(0,i.areObjectValuesDefined)(d)&&!o&&n(!0)},[d,o]),(0,t.useCallback)(async()=>{if(r&&o&&!c.current)try{window.mParticle?.logEvent?.("signup-complete",window.mParticle?.EventType?.Other,d),c.current=!0,console.debug(`MParticle: Event "signup-complete" tracked - ${d.pageId}`)}catch(e){console.error('MParticle: Event "signup-complete" failed',e)}},[r,d,o])}],576816);let r=(0,e.i(981030).atom)({});e.s(["gsiEmailStatesAtom",0,r],703123)},874905,e=>{"use strict";e.i(546584);var t=e.i(699173),i=e.i(592121),s=e.i(185312),a=e.i(546446),r=e.i(683903),l=e.i(671525),o=e.i(901351),n=e.i(310847),c=e.i(776169),d=e.i(422825),A=e.i(837879),u=e.i(576816),m=e.i(553329),g=e.i(695881),h=e.i(143851),p=e.i(703123),f=e.i(61284);let x=(0,g.createLogger)("useGoogleLogin");var E=e.i(404893),w=e.i(367810),y=e.i(792461);e.s(["GoogleAuthScript",0,function({onLoad:e,prompt:g=!0,isUserLoggedIn:b,redirectToCheckoutOnSignup:v}){let B=(0,r.useTranslations)("GoogleLogin"),O=(0,a.useSetAtom)(E.googleLoginInitilizedAtom),{loginWithGoogle:j,error:Q,clearError:R}=function(e=!1){let t=(0,r.useTranslations)("GoogleLogin"),[s,g]=(0,i.useState)(null),E=(0,a.useSetAtom)(n.userHasLoggedInBeforeAtom),w=(0,a.useAtomValue)(p.gsiEmailStatesAtom),{updateEmailSubscriptions:y}=(0,d.useEmailPreferences)({skipStatus:!0}),{refresh:b}=(0,l.usePageNavigation)(),{syncPreferencesFromUpsx:v}=(0,c.usePreferences)(),{authSuccess:B,authRedirect:O}=(0,h.useUserLogin)(),j=(0,A.useSubscriptionsEnabled)(),Q=(0,u.useSignupComplete)({formVariant:"account page google",sensitiveDataAuthorization:!0,deviceTimeZone:"u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0});return{loginWithGoogle:(0,i.useCallback)(async i=>{let{credential:s}=i;g(null);try{let t=await o.upsxClient.auth.loginWithGoogle({google_id_token:s}),i=t?.isFirstLogin;if(await B({email:t.email,userID:t.userID,type:i?"signup":"login"},!1,{skipSignupCompleteEvent:!!i}),i){let{error:e}=await (0,m.tryCatch)(Q());e&&x.warn("Failed to track signup-complete for Google signup",e)}let{newsletter:a,weekly:r,onYourRadar:l,marketing:n,alwaysSubscribe:c}=w||{};return(i||c)&&await y({newsletter:a,weekly:r,onYourRadar:l,marketing:n}).catch(e=>{console.error("Failed to update email subscriptions",e)}),i&&e&&j?O(f.PROMO_CHECKOUT_URL):O(),!0}catch(e){console.error("Failed to login with Google",e);try{let i=e?.data,s=i?.messageCode;if(!s)throw Error("No Error Message");switch(s){case 1e3:case 1026:case 1033:g({header:t("emailAlreadyUsedGoogleHeader"),body:t.raw("emailAlreadyUsedGoogleBody")});break;case 1027:case 1030:g({header:t("emailAlreadyRegisteredGoogleHeader"),body:t("emailAlreadyRegisteredGoogleBody")});break;default:throw Error("No Specific Error")}}catch(e){g({header:t("somethingWentWrong")})}return!1}},[E,v,b,B,O,y,w,e,j,Q]),error:s,clearError:(0,i.useCallback)(()=>{g(null)},[])}}(v),z=(0,y.useRefMemo)(j),C=(0,i.useRef)(null);Q&&(C.current=Q);let k=C.current;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.default,{src:"https://accounts.google.com/gsi/client",onLoad:()=>{let t=window.google?.accounts?.id;t&&(t.initialize({client_id:"797231885346-rai9vgnvf4u38enai8bhginnnrh5uvch.apps.googleusercontent.com",context:"signin",ux_mode:"popup",use_fedcm_for_prompt:!0,callback:e=>{z.current?.(e)}}),O(!0)),e?.(),!b&&g&&t?.prompt()},id:"google-gsi-script"}),k&&(0,t.jsx)(w.Dialog,{open:!!Q,onOpenChange:e=>!e&&R(),children:(0,t.jsx)(w.BasicDialog,{showCloseButton:!1,title:k.header||"",description:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:k.body||""}}),primaryAction:{label:B("cancel"),onClick:R}})})]})}],874905)},499239,e=>{"use strict";var t=e.i(981030),i=e.i(284007);(0,t.atom)("auth");let s=(0,t.atom)(null);(0,t.atom)(null);let a=(0,t.atom)(!1),r=(0,t.atom)(null),l=(0,i.atomWithStorage)("wxu-web/keyval:cart","",void 0,{getOnInit:!0}),o=(0,t.atom)(""),n=(0,t.atom)(null),c=(0,i.atomWithStorage)("wxu-web/keyval:eventChainId","",void 0,{getOnInit:!0}),d=(0,t.atom)("idle");e.s(["addressDataAtom",0,s,"billingPreviewDataAtom",0,n,"cartProductIdAtom",0,l,"checkoutValidationAtom",0,d,"eventChainIdAtom",0,c,"promoCodeAtom",0,r,"showSuccessDialogAtom",0,a,"tpccAtom",0,o])},105335,e=>{"use strict";var t=e.i(699173),i=e.i(592121),s=e.i(747961);let a=(0,i.forwardRef)(({title:e,titleId:i,desc:s,descId:a,...r},l)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:l,"aria-labelledby":i,"aria-describedby":a,...r,children:[s?(0,t.jsx)("desc",{id:a,children:s}):null,void 0===e?(0,t.jsx)("title",{id:i,children:"Warning"}):e?(0,t.jsx)("title",{id:i,children:e}):null,(0,t.jsxs)("g",{fill:"currentColor",clipPath:"url(#a)",children:[(0,t.jsx)("path",{d:"M8.81 11.454a.8.8 0 1 1-1.6 0 .8.8 0 0 1 1.6 0M8.747 8.8V4.4a.75.75 0 1 0-1.5 0v4.4a.75.75 0 1 0 1.5 0"}),(0,t.jsx)("path",{fillRule:"evenodd",d:"M.83 8a7.167 7.167 0 1 1 14.333 0A7.167 7.167 0 0 1 .83 8m7.167-6.166a6.167 6.167 0 1 0 0 12.333 6.167 6.167 0 0 0 0-12.333",clipRule:"evenodd"})]}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"a",children:(0,t.jsx)("path",{fill:"currentColor",d:"M0 0h16v16H0z"})})})]})),r=i.default.forwardRef((e,i)=>(0,t.jsx)(s.BaseIcon,{ref:i,icon:a,...e}));r.displayName="Warning",e.s(["Warning",0,r])},118119,e=>{"use strict";var t=e.i(699173),i=e.i(592121),s=e.i(990420),a=e.i(666021),r=e.i(683903),l=e.i(924689),o=e.i(143851),n=e.i(269767),c=e.i(240058),d=e.i(825440),A=e.i(368847),u=e.i(677988),m=e.i(877957),g=e.i(609958),h=e.i(558802);let p=l.z.object({email:l.z.email({message:"Please enter a valid email address"}),password:l.z.string().min(8,{message:"Password must be at least 8 characters"})});e.s(["default",0,({loginBtnText:e})=>{let l=(0,r.useTranslations)("UserAuth"),{login:f}=(0,o.useUserLogin)(),[x,E]=(0,i.useState)(!1),[w,y]=(0,i.useState)(null),b=(0,s.useForm)({resolver:(0,a.zodResolver)(p),defaultValues:{email:"",password:""}}),v=async e=>{E(!0),y(null);try{await f(e.email,e.password)||(y("Invalid email or password. Please try again."),E(!1))}catch(e){y("An error occurred during login. Please try again."),E(!1),console.error("Login error:",e)}};return(0,t.jsxs)("div",{className:"@container/loginForm",children:[w&&(0,t.jsx)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-700",children:w}),(0,t.jsx)(n.Form,{...b,children:(0,t.jsxs)("form",{onSubmit:b.handleSubmit(v),children:[(0,t.jsx)(n.FormField,{control:b.control,name:"email",render:({field:e})=>(0,t.jsx)(n.FormItem,{children:(0,t.jsx)(n.FormControl,{children:(0,t.jsx)(d.Input,{...e,type:"email",label:l("email"),icon:g.Email})})})}),(0,t.jsx)(n.FormField,{control:b.control,name:"password",render:({field:e})=>(0,t.jsx)(n.FormItem,{children:(0,t.jsx)(n.FormControl,{children:(0,t.jsx)(u.PasswordInput,{...e,label:l("password"),icon:h.Locked})})})}),(0,t.jsxs)("div",{className:"prose mb-6 flex max-w-full flex-col justify-between gap-2 @lg/loginForm:flex-row-reverse @lg/loginForm:gap-6",children:[(0,t.jsx)("div",{className:"@max-lg/loginForm:text-right",children:(0,t.jsx)(c.default,{href:"/forgot-password",className:"text-sm whitespace-nowrap hover:underline",children:l("forgotPassword")})}),(0,t.jsx)(A.Text,{className:"m-0 @lg/loginForm:max-w-xl",dangerouslySetInnerHTML:{__html:l.raw("authenticationUniformityNote")}})]}),(0,t.jsx)(m.Button,{type:"submit",loading:x,disabled:x,children:e||l("signin")})]})})]})}])},81083,e=>{"use strict";var t=e.i(699173),i=e.i(592121),s=e.i(683903),a=e.i(118119),r=e.i(264268),l=e.i(877957),o=e.i(368847),n=e.i(983950),c=e.i(528600),d=e.i(731672),A=e.i(526824);e.s(["default",0,({initSignin:e,showLastName:u,hideConfirmPassword:m})=>{let[g,h]=(0,i.useState)(e),p=(0,s.useTranslations)("UserAuth"),{user:f,userProfile:x}=(0,c.useUser)(),{email:E,firstName:w}=x||{},y=(0,d.useUserLogout)(),{userLastName:b}=(0,A.useUserLastName)();return f?.isUserLoggedIn?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-6 flex items-end justify-between gap-1",children:[(0,t.jsx)(o.Text,{variant:"Title.M",color:"secondary",className:"font-semibold",children:p("yourAccount")}),(0,t.jsx)(l.Button,{variant:"link",type:"button",className:(0,o.textVariants)({className:"h-[revert] p-0",variant:"Body.M"}),onClick:()=>y(),children:p("logout")})]}),(0,t.jsx)(o.Text,{color:"secondary",children:[w,b].filter(Boolean).join(" ")}),(0,t.jsx)(o.Text,{color:"secondary",children:E})]}):(0,t.jsx)("div",{children:g?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-4 flex justify-between",children:[(0,t.jsx)(o.Text,{variant:"Title.M",className:"font-semibold",children:p("signin")}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(o.Text,{color:"secondary",children:[p("noAccount")," "]}),(0,t.jsx)(l.Button,{variant:"link",type:"button",className:(0,o.textVariants)({className:"h-[revert] p-0",variant:"Body.M",color:"secondary"}),onClick:()=>h(!1),children:p("signup")})]})]}),(0,t.jsx)(a.default,{loginBtnText:p("signinAndContinue")})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(o.Text,{className:"mb-2",children:p("haveAccount")}),(0,t.jsxs)("div",{className:"flex justify-center gap-4",children:[(0,t.jsx)(l.Button,{variant:"secondary",className:"bg-gray-100",onClick:()=>h(!0),children:p("signin")}),(0,t.jsx)(n.default,{text:"signin_with",shape:"pill"})]})]}),(0,t.jsxs)("div",{className:"relative my-6",children:[(0,t.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,t.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,t.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,t.jsx)("span",{className:"bg-white px-2 text-gray-500 uppercase",children:p("or")})})]}),(0,t.jsx)(o.Text,{variant:"Title.M",className:"mb-4 font-semibold",children:p("signup")}),(0,t.jsx)(r.default,{signupBtnText:p("signupAndContinue"),showLastName:u,hideConfirmPassword:m})]})})}])},448829,e=>{e.q("/_next/static/media/morning-brief.3m5sb25ar_gt_.jpg")},404916,e=>{e.q("/_next/static/media/weekly-brief.1w3o73yj6bssx.jpg")},583231,e=>{e.q("/_next/static/media/on-your-radar.2rtgy8b1b8699.jpg")},877095,e=>{e.q("/_next/static/media/ski-snow-report.0z452bmd17nfh.jpg")},499050,e=>{e.q("/_next/static/media/garden-report.132lziinbpp-z.jpg")},846413,e=>{e.q("/_next/static/media/fairway-forecast.0m_64_pnc37r-.jpg")},467394,e=>{e.q("/_next/static/media/tailgate-report.0bmwzb5gpzsvm.jpg")},331252,e=>{e.q("/_next/static/media/travel-emails.0wn7qp8hk-p0x.jpg")},841118,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.MOE_SUBSCRIPTION_CATEGORIES=i.MOE_TO_PUBLIC=i.EMAIL_CATEGORIES=void 0,i.isMoeSubscriptionCategory=function(e){return!!e&&e in i.EMAIL_CATEGORIES},i.publicNameToMoeCategory=function(e){return s[e]},i.EMAIL_CATEGORIES={"daily-newsletter":{publicName:"daily-newsletters-1",name:"Morning Brief",cadence:"Daily",description:"Your local forecast, plus daily trivia, stunning photos and our meteorologists' top picks. All in one place, every morning."},"marketing-emails":{publicName:"marketing-emails-1",name:"Offers and Promotions",cadence:"",description:"Stop paying full price – our curated offers deliver hand-picked discounts and product reviews across everything from outdoor gear to home essentials, so you never miss out on the sales."},"wu-marketing-emails":{publicName:"wu-marketing-emails-1",name:"Weather Underground",cadence:"",description:"A global community, connecting data from environmental sensors. The future of weather is personal, hyperlocal, and smarter than you think."},"activity-snow-newsletter":{publicName:"activity-snow-newsletter",name:"Weekly Snow Report",cadence:"Weekly (Monthly during off-season)",description:"Forecasts from every major ski region across the country, in one quick and easy roundup. Your mountain planning cheat sheet, delivered fresh."},"weekly-brief":{publicName:"weekly-brief",name:"Weekly Brief",cadence:"Weekly",description:"Your week ahead, plus the biggest weather stories, what's brewing next and expert answers to your questions. All the weather that matters, every week."},"on-your-radar":{publicName:"on-your-radar",name:"On Your Radar",cadence:"Weekly",description:"New products, tools and features you need to know about, rounded up for you. The latest from our team, every week."},"fairway-forecast":{publicName:"fairway-forecast",name:"Fairway Forecast",cadence:"Weekly",description:"A golf spotlight synced to the forecast, helping you find more time on the green to improve your swing."},"gardening-emails":{publicName:"gardening-emails",name:"Garden Report",cadence:"Weekly",description:"Expert gardening insights and forecast-synced tips to help your home and garden thrive every week."},"travel-emails":{publicName:"travel-emails",name:"The Window Seat",cadence:"Weekly",description:"Travel sweet spots and forecast-synced timing guides for your bucket-list destinations. Quick, weather-driven intel packed with travel trivia and expert gear recommendations to fuel your next adventure."},"tailgate-emails":{publicName:"tailgate-emails",name:"Tailgate Report",cadence:"Weekly",description:"Game day weather outlooks and key climate stories impacting this week's matchups. Complete with tough-weather venue guides, fan setups, and must-have tailgating gear."}},i.MOE_TO_PUBLIC=Object.fromEntries(Object.entries(i.EMAIL_CATEGORIES).map(([e,{publicName:t}])=>[e,t]));let s=Object.fromEntries(Object.entries(i.MOE_TO_PUBLIC).map(([e,t])=>[t,e]));i.MOE_SUBSCRIPTION_CATEGORIES=Object.keys(i.EMAIL_CATEGORIES)},828615,e=>{"use strict";var t=e.i(699173),i=e.i(528600),s=e.i(592121),a=e.i(961123),r=e.i(381477),l=e.i(695478),o=e.i(343277),n=e.i(422825),c=e.i(790010),d=e.i(279887),A=e.i(553329),u=e.i(695881),m=e.i(841118);let g={src:e.i(448829).default,width:960,height:640,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDLeRWAAiVSBjIzz719ck11PJuf/9k="},h={src:e.i(404916).default,width:960,height:640,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDy6SZHjVRbxoVUAspOT7nmukzP/9k="},p={src:e.i(583231).default,width:960,height:548,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA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vAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDAOoxX3heS1On2sTS2nmSSxxqGYr0J4rnUHZyv1PQXLZK26P/Z"},b=[{category:"daily-newsletter",imageSrc:g.src,bgColor:"#3A62CD"},{category:"weekly-brief",imageSrc:h.src,bgColor:"#0D132A"},{category:"activity-snow-newsletter",imageSrc:f.src},{category:"on-your-radar",imageSrc:p.src},{category:"gardening-emails",imageSrc:x.src},{category:"tailgate-emails",imageSrc:w.src},{category:"fairway-forecast",imageSrc:E.src},{category:"travel-emails",imageSrc:y.src}].map(({category:e,...t})=>{let{publicName:i,name:s,cadence:a,description:r}=m.EMAIL_CATEGORIES[e];return{categoryName:i,name:s,cadence:a,description:r,...t}}),v=(0,u.createLogger)("useNewsletterSignup");var B=e.i(897360),O=e.i(747961);let j=(0,s.forwardRef)(({title:e,titleId:i,desc:s,descId:a,...r},l)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:l,"aria-labelledby":i,"aria-describedby":a,...r,children:[s?(0,t.jsx)("desc",{id:a,children:s}):null,void 0===e?(0,t.jsx)("title",{id:i,children:"Checkmark"}):e?(0,t.jsx)("title",{id:i,children:e}):null,(0,t.jsx)("path",{fill:"currentColor",d:"M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1m-1 9.795-2.5-2.5.795-.795L7 9.205 10.705 5.5l.798.793z"})]})),Q=s.default.forwardRef((e,i)=>(0,t.jsx)(O.BaseIcon,{ref:i,icon:j,...e}));Q.displayName="CheckmarkFilled";let R=(0,s.forwardRef)(({title:e,titleId:i,desc:s,descId:a,...r},l)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:l,"aria-labelledby":i,"aria-describedby":a,...r,children:[s?(0,t.jsx)("desc",{id:a,children:s}):null,void 0===e?(0,t.jsx)("title",{id:i,children:"Plus"}):e?(0,t.jsx)("title",{id:i,children:e}):null,(0,t.jsxs)("g",{fill:"currentColor",children:[(0,t.jsx)("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14M8 2.273a5.727 5.727 0 1 0 0 11.454A5.727 5.727 0 0 0 8 2.273"}),(0,t.jsx)("path",{d:"M11.182 8a.636.636 0 0 0-.636-.636h-1.91v-1.91a.636.636 0 1 0-1.272 0v1.91h-1.91a.636.636 0 1 0 0 1.272h1.91v1.91a.636.636 0 0 0 1.272 0v-1.91h1.91A.636.636 0 0 0 11.182 8"})]})]})),z=s.default.forwardRef((e,i)=>(0,t.jsx)(O.BaseIcon,{ref:i,icon:R,...e}));z.displayName="PlusOutline";var C=e.i(368847),k=e.i(877957),I=e.i(846871),N=e.i(632137),S=e.i(367810),D=e.i(598513),K=e.i(37429),F=e.i(240058);function P({newsletter:e,selected:i,onToggle:s,priority:a=!1,disabled:r=!1}){let{imageSrc:l,cadence:o,name:n,description:c,sampleUrl:d,bgColor:A}=e;return(0,t.jsxs)("div",{className:(0,N.cn)("relative isolate flex h-full overflow-hidden rounded-2xl border-2 border-transparent transition-colors duration-200 sm:flex-col",!r&&"hover:border-blue-500",i&&"border-blue-500"),children:[(0,t.jsx)("button",{type:"button",onClick:s,disabled:r,"aria-pressed":i,"aria-label":`${i?"Unsubscribe from":"Subscribe to"} ${n}`,className:(0,N.cn)("absolute inset-0 z-10 rounded-2xl focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:outline-none focus-visible:ring-inset",r?"cursor-not-allowed":"cursor-pointer")}),(0,t.jsxs)("div",{className:(0,N.cn)("relative aspect-[3/2] w-2/5 shrink-0 transition-opacity sm:aspect-[3/2] sm:w-full",r&&"opacity-90"),children:[(0,t.jsx)(K.default,{src:l,alt:"",fill:!0,sizes:"(max-width: 640px) 40vw, (max-width: 1024px) 50vw, 33vw",objectFit:A?"contain":"cover",priority:a,isFetchPriority:a,rounded:!1,className:"max-sm:rounded-r-2xl sm:rounded-b-2xl",style:A?{backgroundColor:A}:void 0}),(0,t.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 right-0 flex size-11.5 items-center justify-center rounded-full",children:i?(0,t.jsx)(Q,{className:"size-6.5 text-white"}):(0,t.jsx)(z,{className:"size-6.5 text-white"})})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-2 p-4 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(C.default,{variant:"Body.S.Bold",color:"secondary",children:o}),(0,t.jsx)(C.default,{variant:"Title.S",elementType:"h3",color:"primary",children:n}),(0,t.jsx)(C.default,{variant:"Body.S",color:"secondary",children:c})]}),d&&(0,t.jsx)(F.default,{href:d,className:"relative z-20 w-fit text-sm font-bold text-gray-900 underline underline-offset-2 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:outline-none",children:"View Sample"})]})]})}var U=e.i(990420),M=e.i(546446),T=e.i(666021),L=e.i(336726),W=e.i(527207),J=e.i(825440),Z=e.i(269767),V=e.i(697380),Y=e.i(909232),G=e.i(498076),H=e.i(546334),q=e.i(983950),X=e.i(81083);let _=()=>{let[e,i]=(0,s.useState)(!1);return(0,t.jsxs)(S.Dialog,{open:e,onOpenChange:i,children:[(0,t.jsx)(S.DialogTrigger,{asChild:!0,children:(0,t.jsx)(k.Button,{variant:"link",type:"button",className:"h-[revert] p-0 font-bold text-gray-900 underline underline-offset-2",children:"Sign In."})}),(0,t.jsxs)(S.DialogContent,{className:"flex max-h-[90dvh] max-w-sm flex-col overflow-hidden pt-10",onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget?.querySelector("input")?.focus()},children:[(0,t.jsx)(S.DialogTitle,{className:"sr-only",children:"Sign in"}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:(0,t.jsx)(X.default,{initSignin:!0})})]})]})};var $=e.i(924689);function ee({isUserLoggedIn:e,selectedCount:i,defaultEmail:a,defaultLocation:r,saving:l,disabled:o=!1,success:n,serverError:c,onSubmit:d}){let[A,u]=(0,s.useState)(!1),m=(0,M.useAtomValue)(V.fixedBottomAdHeightAtom),g=(0,G.useIsMobile)(),h=(0,Y.useClientMobileMedia)(),p=(0,s.useMemo)(()=>$.z.object({email:e?$.z.string():$.z.email({error:"Enter a valid email address."}),location:$.z.custom().refine(Boolean,{error:"Add your location."}),selectedCount:e?$.z.number():$.z.number().gt(0,{error:"Select at least one newsletter to continue."})}),[e]),f=(0,U.useForm)({resolver:(0,T.zodResolver)(p),defaultValues:{email:"",location:null,selectedCount:i}}),{control:x,handleSubmit:E,setValue:w,setError:y,trigger:b,formState:{isSubmitted:v,errors:B}}=f;(0,s.useEffect)(()=>{a&&w("email",a)},[a,w]),(0,s.useEffect)(()=>{r&&w("location",r)},[r,w]);let O=v||!!B.selectedCount;(0,s.useEffect)(()=>{w("selectedCount",i,{shouldValidate:O})},[w,i,O]),(0,s.useEffect)(()=>{c&&y("email",{type:"server",message:c})},[c,y]),(0,s.useEffect)(()=>{n&&u(!1)},[n]),(0,s.useEffect)(()=>(document.body.style.overflow=A&&h?"hidden":"",()=>{document.body.style.overflow=""}),[A,h]);let j=E(e=>d({email:e.email,location:e.location})),Q=e||i>0,R=()=>{Q?u(!0):b("selectedCount")},z=e=>{h&&(A||Q?u(!0):(e.currentTarget.blur(),R()))},I=`calc(${3.5*!!g}rem + ${m}px)`,S=i>0?`${i} ${1===i?"Newsletter":"Newsletters"} Selected`:"Sign up for our newsletters";return(0,t.jsx)(Z.Form,{...f,children:(0,t.jsxs)("form",{onSubmit:j,noValidate:!0,className:"contents",children:[(0,t.jsx)("div",{style:{"--ad-bottom":`${m}px`,"--mobile-offset":I},className:(0,N.cn)("z-adOverlay md:z-sticky border-t border-gray-200 bg-white","md:sticky md:bottom-[var(--ad-bottom)]",A?"max-md:animate-in max-md:fade-in-0 max-md:fixed max-md:inset-0 max-md:overflow-y-auto max-md:pt-14 max-md:duration-200":"max-md:sticky max-md:bottom-[var(--mobile-offset)]"),children:(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-3 px-4 py-4",children:[(0,t.jsxs)(k.Button,{type:"button",variant:"ghostUI",size:"text",onClick:()=>A?u(!1):R(),"aria-expanded":A,className:"flex w-full items-center justify-between text-left focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:outline-none md:pointer-events-none",children:[(0,t.jsx)(C.default,{variant:"Body.L.Bold",children:S}),A?(0,t.jsx)(L.ChevronDown,{className:"size-5 text-gray-900 md:hidden","aria-hidden":"true"}):(0,t.jsx)(W.ChevronUp,{className:"size-5 text-gray-900 md:hidden","aria-hidden":"true"})]}),(0,t.jsx)(Z.FormField,{control:x,name:"selectedCount",render:()=>(0,t.jsx)(Z.FormMessage,{className:"text-xxs text-alert-severe -mt-1"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] md:items-start md:gap-x-4 md:gap-y-1",children:[(0,t.jsx)(Z.FormField,{control:x,name:"email",disabled:o||l,render:({field:i})=>(0,t.jsx)(Z.FormItem,{className:"min-w-0 md:col-start-1 md:row-start-1",children:(0,t.jsx)(Z.FormControl,{children:(0,t.jsx)(J.Input,{...i,label:"Email address",type:"email",variant:"rounded",autoComplete:"email",onFocus:z,required:!e,readOnly:e})})})}),!e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,N.cn)("flex flex-col items-start gap-2 max-md:-mt-4 md:col-start-1 md:row-start-2",!A&&"max-md:hidden"),children:[(0,t.jsxs)(C.default,{variant:"Body.S",color:"secondary",children:["Already have an account? ",(0,t.jsx)(_,{})]}),(0,t.jsx)(q.default,{text:"signin_with",shape:"pill"})]}),(0,t.jsxs)("div",{"aria-hidden":"true",className:(0,N.cn)("flex items-center gap-3 text-gray-500 md:hidden",!A&&"max-md:hidden"),children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-gray-200"}),(0,t.jsx)(C.default,{variant:"Body.S",color:"secondary",children:"and"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-gray-200"})]})]}),(0,t.jsx)(Z.FormField,{control:x,name:"location",render:({field:e,fieldState:i})=>(0,t.jsx)(Z.FormItem,{className:(0,N.cn)("min-w-0 md:col-start-2 md:row-start-1",!A&&"max-md:hidden"),children:(0,t.jsx)(H.LocationInput,{location:e.value,onChangeLocation:e.onChange,label:"Add a city or zip code for your forecast",error:i.error?.message,disabled:o||l,className:"h-12 border-[#25242220]"})})}),(0,t.jsxs)(C.default,{variant:"Body.S",color:"secondary",className:(0,N.cn)("md:col-span-2 md:col-start-2 md:row-start-2",!A&&"max-md:hidden"),children:["By continuing, you're signing up to receive the selected email newsletters and confirm that you agree to the"," ",(0,t.jsx)(F.default,{href:"https://weather.com/termsofuse",className:"underline underline-offset-2",children:"Terms of Use"})," ","and"," ",(0,t.jsx)(F.default,{href:"https://weather.com/privacy",className:"underline underline-offset-2",children:"Privacy Policy"}),"."]}),(0,t.jsx)(k.Button,{type:"submit",size:"lg",loading:l,disabled:o,className:(0,N.cn)("h-12 self-start md:col-start-3 md:row-start-1",!A&&"max-md:hidden"),children:"Sign Up"})]})]})}),(0,t.jsx)("div",{"aria-hidden":"true",className:"hidden md:block",style:{height:m}}),(0,t.jsx)("div",{"aria-hidden":"true",className:"md:hidden",style:{height:56+m}})]})})}function et({isUserLoggedIn:e,userEmail:i,newsletterSignup:a}){let{submit:r,reset:l,status:o,error:n,initializing:c,defaultSelectedGroups:d,defaultLocation:A}=a,u=(0,D.useSendInteractionEvent)(),[m,g]=(0,s.useState)({}),h=(0,s.useRef)(!1);(0,s.useEffect)(()=>{!h.current&&d&&(h.current=!0,g(e=>({...d,...e})))},[d]);let p=b.filter(e=>m[e.categoryName]).length,f=p===b.length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Dialog,{open:"success"===o,onOpenChange:e=>{e||l()},children:(0,t.jsx)(S.DialogContent,{className:"max-w-md p-8",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[(0,t.jsx)("span",{className:"flex size-14 items-center justify-center rounded-full bg-green-100",children:(0,t.jsx)(B.Checkmark,{className:"size-7 text-green-600","aria-hidden":"true",title:""})}),(0,t.jsx)(S.DialogTitle,{asChild:!0,children:(0,t.jsx)(C.default,{variant:"Title.M",elementType:"h2",color:"primary",children:"You're all set"})}),(0,t.jsx)(S.DialogDescription,{asChild:!0,children:(0,t.jsx)(C.default,{variant:"Body.M",color:"secondary",children:"We've updated your newsletter preferences."})})]})})}),(0,t.jsxs)("div",{className:"container mx-auto max-w-6xl px-4 py-8",children:[(0,t.jsxs)("header",{className:"mb-6 flex flex-col gap-2",children:[(0,t.jsx)(C.default,{variant:"Title.XL",elementType:"h1",color:"primary",children:"Newsletters"}),(0,t.jsx)(C.default,{variant:"Body.M",color:"secondary",children:"Get the best of The Weather Channel straight to your inbox. Select from our newsletters below and enter your email to sign up."})]}),(0,t.jsx)("div",{className:"mb-4 flex justify-start",children:c?(0,t.jsxs)("span",{className:"inline-flex h-10 items-center gap-2 px-2 py-1",children:[(0,t.jsx)(I.Loader,{size:"sm",variant:"primary",label:"Loading your newsletter preferences"}),(0,t.jsx)(C.default,{variant:"Body.S",color:"secondary",children:"Getting your preferences…"})]}):(0,t.jsxs)(k.Button,{variant:"ghostUI",size:"text",onClick:()=>g(Object.fromEntries(b.map(e=>[e.categoryName,!f]))),"aria-pressed":f,className:(0,N.cn)("gap-2 rounded-full px-4 py-2.5 text-sm font-bold transition-colors focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:outline-none",f?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-900 hover:bg-gray-200"),children:[f?(0,t.jsx)(Q,{className:"size-5 text-blue-600","aria-hidden":"true",title:""}):(0,t.jsx)(z,{className:"size-5","aria-hidden":"true",title:""}),"Select All"]})}),(0,t.jsx)("ul",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:b.map((e,i)=>(0,t.jsx)("li",{className:"h-full",children:(0,t.jsx)(P,{newsletter:e,selected:!!m[e.categoryName],onToggle:()=>{let t;return t=e.categoryName,g(e=>({...e,[t]:!e[t]}))},priority:i{u({interactionElement:"newsletter signup",interactionType:"click",moduleId:"newsletter-page"}),r({email:e,location:t,selections:b.map(e=>({name:e.categoryName,isSubscribed:!!m[e.categoryName]}))})}})]})}e.s(["default",0,()=>{let{user:{isUserLoggedIn:e},userProfile:u}=(0,i.useUser)(),m=function(){let e=(0,a.useParams)(),t=e?.locale,{updateEmailPreference:u,emailSubscriptions:m,isLoadingPreferences:g}=(0,n.useEmailPreferences)({forceSubs:!0}),{user:{isUserLoggedIn:h,userID:p}}=(0,i.useUser)(),{signup:f}=(0,c.useUserSignup)(),x=(0,d.useTrackEmailSubscription)(),[E,w]=(0,s.useState)("idle"),[y,B]=(0,s.useState)(null),[O,j]=(0,s.useState)(),[Q,R]=(0,s.useState)(!1),z=(0,s.useMemo)(()=>{let e=h&&m?(0,l.findSubscriptionGroup)(m,"daily-newsletters-1")?.attributes?.location:void 0;return"string"==typeof e&&e?e:null},[m,h]),{data:C,isLoading:k}=(0,r.default)(z?["getLocationPointByPlaceId",z,t]:null,([e,t,i])=>(0,o.getLocationPointByPlaceId)(t,i));(0,s.useEffect)(()=>{if(Q||!h||!m)return;R(!0);let e={};b.forEach(t=>{e[t.categoryName]=(0,l.findSubscriptionGroup)(m,t.categoryName)?.isSubscribed||!1}),j(e)},[Q,h,m]);let I=h&&!m&&(!p||g),N=h&&!!m&&(!Q||k),S=(0,s.useCallback)(()=>{w("idle"),B(null)},[]);return{submit:(0,s.useCallback)(async({email:e,location:t,selections:i})=>{if(B(null),w("saving"),!h){let{success:t,error:i}=await f({email:e,password:null},!1);if(!t){B(936===i.messageCode||1027===i.messageCode?"An account with this email exists, please sign in to continue.":"We could not create an account for you, please try again."),w("error");return}}let s=t?(0,l.getMorningBriefAttrs)(t):void 0,a=i.map(({name:e,isSubscribed:t})=>({subscriptionGroupName:e,isSubscribed:t,...s&&"daily-newsletters-1"===e?{attributes:s}:void 0})),{data:r,error:o}=await (0,A.tryCatch)(u(a));return o||r?.status!=="success"?(o&&v.error("Email preferences request failed",{requestError:o}),B(r?.emailError??r?.error??"Failed to subscribe, please try again."),w("error"),r??void 0):(i.forEach(({name:e,isSubscribed:t})=>x({name:e,status:t})),w("success"),r)},[h,f,u,x]),reset:S,status:E,error:y,initializing:I||N,defaultSelectedGroups:O,defaultLocation:C?.location??null}}();return(0,t.jsx)(et,{isUserLoggedIn:e,userEmail:u?.email,newsletterSignup:m})}],828615)}]);