(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,806262,e=>{"use strict";e.i(247865);var t=e.i(546446);e.i(284007),e.i(981030);let r=new WeakMap;e.s(["useHydrateAtoms",0,function(e,i){var n;let a,s=(0,t.useStore)(i),o=(n=s,(a=r.get(n))||(a=new WeakSet,r.set(n,a)),a);for(let[t,...r]of e)(!o.has(t)||(null==i?void 0:i.dangerouslyForceHydrate))&&(o.add(t),s.set(t,...r))}])},284007,e=>{"use strict";var t=e.i(981030);let r=Symbol(""),i=e=>"function"==typeof(null==e?void 0:e.then);function n(e=()=>{try{return window.localStorage}catch(e){return}},t){var r;let a,s,o,u,l={getItem:(r,n)=>{var o,u;let l=e=>{if(a!==(e=e||"")){try{s=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return n}a=e}return s},c=null!=(u=null==(o=e())?void 0:o.getItem(r))?u:null;return i(c)?c.then(l):l(c)},setItem:(r,i)=>{var n;return null==(n=e())?void 0:n.setItem(r,JSON.stringify(i,null==t?void 0:t.replacer))},removeItem:t=>{var r;return null==(r=e())?void 0:r.removeItem(t)}};try{o=null==(r=e())?void 0:r.subscribe}catch(e){}return!o&&"u">typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(o=(t,r)=>{if(!(e()instanceof window.Storage))return()=>{};let i=i=>{i.storageArea===e()&&i.key===t&&r(i.newValue)};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i)}}),o&&(u=o,l.subscribe=(e,t,r)=>u(e,e=>{let i;try{i=JSON.parse(e||"")}catch(e){i=r}t(i)})),l}let a=n(),s=new WeakMap,o={state:"loading"};e.s(["RESET",0,r,"atomWithStorage",0,function(e,n,s=a,o){let u=null==o?void 0:o.getOnInit,l=(0,t.atom)(u?s.getItem(e,n):n);return l.onMount=t=>{let r;return t(s.getItem(e,n)),s.subscribe&&(r=s.subscribe(e,t,n)),r},(0,t.atom)(e=>e(l),(t,a,o)=>{let u="function"==typeof o?o(t(l)):o;return u===r?(a(l,n),s.removeItem(e)):i(u)?u.then(t=>(a(l,t),s.setItem(e,t))):(a(l,u),s.setItem(e,u))})},"createJSONStorage",0,n,"loadable",0,function(e){let r;return r=()=>{let r=new WeakMap,i=(0,t.atom)([()=>{},0]);i.unstable_onInit=e=>{e.set(i,([,t])=>[()=>e.set(i,([e,t])=>[e,t+1]),t])};let n=(0,t.atom)(t=>{let n,a,[s]=t(i);try{n=t(e)}catch(e){return{state:"hasError",error:e}}if("function"!=typeof(null==(a=n)?void 0:a.then))return{state:"hasData",data:n};let u=n,l=r.get(u);return l?l:(u.then(e=>{r.set(u,{state:"hasData",data:e}),s()},e=>{r.set(u,{state:"hasError",error:e}),s()}),r.get(u)||(r.set(u,o),o))});return(0,t.atom)(e=>e(n))},(s.has(e)?s:s.set(e,r())).get(e)}])},990033,e=>{"use strict";let t,r="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),i=new Uint8Array(16),n=[];for(let e=0;e= 16");if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,a){if((u=u||0)a.length)throw RangeError(`UUID byte range ${u}:${u+15} is out of buffer bounds`);for(let e=0;e{"use strict";let t=(0,e.i(981030).atom)("");e.s(["adsMetricsUnitAndZoneAtom",0,t])},604323,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["metricsArticleDataAtom",0,t])},513539,e=>{"use strict";var t=e.i(981030);let r=(0,t.atom)(null),i=(0,t.atom)(null);e.s(["activeEventAtom",0,i,"layoutStateAtom",0,r])},236433,e=>{"use strict";let t=(0,e.i(981030).atom)(null);e.s(["pageAtomsPathnameAtom",0,t])},537989,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["pageIdAtom",0,t])},608201,236593,e=>{"use strict";var t=e.i(284007);let r={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function i(){try{return window.sessionStorage}catch{return r}}let n=(0,t.createJSONStorage)(i),a=(0,t.atomWithStorage)("wx-source-page",null,n,{getOnInit:!0});e.s(["sourcePageAtom",0,a],608201);let s=(0,t.createJSONStorage)(i),o=(0,t.atomWithStorage)("wx-source-module",null,s,{getOnInit:!0});e.s(["sourceModuleAtom",0,o],236593)},736677,220126,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),i=(0,t.atomWithStorage)("wx-ht-source-page",null,r);e.s(["sourcePageAtom",0,i],736677);let n=(0,t.createJSONStorage)(()=>sessionStorage),a=(0,t.atomWithStorage)("wx-ht-source-module",null,n);e.s(["sourceModuleAtom",0,a],220126)},947118,221085,e=>{"use strict";let t;var r=e.i(247865);let i=new Set,n=0,a=()=>"function"==typeof window.mParticle?.init,s=()=>{void 0!==t&&(clearInterval(t),t=void 0)},o=()=>{if(!a()||(s(),0===i.size))return;let e=[...i];for(let t of(i.clear(),e))t()},u=()=>{void 0===t&&(n=0,t=setInterval(()=>{n+=100,o(),n>=3e4&&s()},100))},l=e=>(i.add(e),u(),()=>{i.delete(e)}),c=e=>a()?(e(),()=>{}):l(e),d=e=>a()?()=>{}:l(e),m=()=>!1;e.s(["subscribeSdkLoaded",0,c,"useIsSdkLoaded",0,()=>(0,r.useSyncExternalStore)(d,a,m),"watchForSdkLoad",0,e=>{if("u"{};if(a())return o(),()=>{};u();let t=Array.from(document.scripts).find(t=>t.getAttribute("src")===e);if(!t)return()=>{};let r=()=>o();return t.addEventListener("load",r),()=>{t.removeEventListener("load",r)}}],221085);let p=e=>"function"==typeof window.mParticle?.ready?(window.mParticle?.ready?.(e),()=>{}):c(()=>{window.mParticle?.ready?.(e),e()}),f=()=>!!window.mParticle?.isInitialized?.(),g=()=>!1;e.s(["useIsInitialized",0,()=>(0,r.useSyncExternalStore)(p,f,g)],947118)},678651,(e,t,r)=>{"use strict";function i(e){let t=new URLSearchParams;for(let[r,i]of Object.entries(e))void 0!==i&&t.append(r,i);return t}Object.defineProperty(r,"__esModule",{value:!0}),r.queryStringToSearchParams=i,r.urlFrom=function({host:e,...t}){if(!e)throw Error("Host is missing");let r=new URL(`https://${e}`);return Object.assign(r,{...t,hostname:e}),t.query&&(r.search=i(t.query).toString()),r}},671525,e=>{"use strict";var t=e.i(725287);let r=()=>{let e=(0,t.useRouter)();return{navigate:(t,r={})=>{let{mpa:i=!0,replace:n=!1}=r;i?n?window.location.replace(t):window.location.href=t:n?e.replace(t):e.push(t)},refresh:(t={})=>{let{mpa:r=!0}=t;r?window.location.reload():e.refresh()},router:e}};e.s(["default",0,r,"usePageNavigation",0,r])},725296,e=>{"use strict";var t,r=e.i(965586),i=((t={}).CA="ca",t.CA_QC="ca-qc",t.EXEMPT="exempt",t.GDPR="gdpr",t.JP="jp",t.KR="kr",t.LATAM_CO="latam-co",t.LATAM_DO="latam-do",t.LATAM_PE="latam-pe",t.LGPD="lgpd",t.PIPL="pipl",t.TR_KVKK="tr-kvkk",t.USA="usa",t.USA_CCPA="usa-ccpa",t.USA_CO="usa-co",t.USA_CT="usa-ct",t.USA_VA="usa-va",t);Object.values(i);let n={"usa-ut":"usa"},a=e=>e?n[e]??e:void 0;e.s(["RESTRICTIVE_REGIMES",0,["ca-qc","gdpr","latam-co","latam-do","latam-pe","lgpd","pipl","tr-kvkk"],"Regime",()=>i,"US_REGIMES",0,["usa","usa-ccpa","usa-co","usa-ct","usa-va"],"default",0,i,"getRegime",0,()=>(()=>{let e=(0,r.getCookie)("ci")?.toString();if(e)for(let t of e.split("&")){let e=t.indexOf("=");if(e>-1&&"TWC-Privacy"===t.slice(0,e))return a(t.slice(e+1))}})()??a((0,r.getCookie)("twc-privacy")?.toString())??"exempt"])},617874,e=>{"use strict";let t="Imperial",r="Metric",i="Hybrid",n={code:"e",name:t,temp:"F",speed:"mph",distance:"mi",accumulation:"in",precip:"in",pressure:"in"},a={code:"m",name:r,temp:"C",speed:"km/h",distance:"km",accumulation:"cm",precip:"mm",pressure:"mb"},s={code:"h",name:i,temp:"C",speed:"mph",distance:"mi",accumulation:"in",precip:"in",pressure:"mb"};e.s(["UNITS_COOKIE_KEY",0,"unitOfMeasurement","UNIT_HYBRID",0,i,"UNIT_IMPERIAL",0,t,"UNIT_METRIC",0,r,"imperial",0,n,"unitsSystemByCode",0,function(e){switch(e?.toLowerCase()){case"e":case"f":return n;case"m":case"c":return a;case"h":return s;default:return null}},"unitsSystemByName",0,function(e=""){switch(e.toLowerCase()){case"imperial":case"Imperial":return n;case"metric":case"Metric":return a;case"hybrid":case"Hybrid":return s;default:return null}}])},889753,301904,e=>{"use strict";var t=e.i(284007),r=e.i(617874),i=e.i(990033),n=e.i(981030),a=e.i(543512);let s={animationSpeed:1,autoplay:!0,opacity:90,roadOverlay:"default",style:"default"};e.s(["DEFAULT_MAP_SETTINGS",0,s],301904);let o=(0,n.atom)(a.UserSubscriptionTiers.none),u=(0,t.atomWithStorage)("userProfile",null,void 0,{getOnInit:!0}),l=(0,t.atomWithStorage)("userPreferences",{userID:(0,i.v4)(),unit:r.UNIT_IMPERIAL,locations:[],locale:"en_US",mapSettings:s,favoriteWeatherComponents:[],favoriteActivityComponents:[],dashboard:[]},void 0,{getOnInit:!0});e.s(["userPreferencesAtom",0,l,"userProfileAtom",0,u,"userTierAtom",0,o],889753)},905059,e=>{"use strict";let t=(0,e.i(284007).atomWithStorage)("wx-next/user:mapLayerOrder",null,void 0,{getOnInit:!0});e.s(["mapLayerOrderAtom",0,t])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),i=e.i(301904),n=e.i(905059),a=e.i(901351),s=e.i(310847),o=e.i(528600),u=e.i(617874),l=e.i(540768),c=e.i(553329),d=e.i(247865),m=e.i(245943);let p=(0,e.i(695881).createLogger)("useMapSettings");e.s(["WEB_MAP_SETTINGS_PLATFORM",0,"twc","useMapSettings",0,function(e="twc"){let{user:{isUserLoggedIn:r}}=(0,o.useUser)(),i=(0,t.useSetAtom)(n.mapLayerOrderAtom),s=(0,d.useCallback)(async t=>{if(!r)return!1;let{error:i}=await (0,c.tryCatch)(a.upsxClient.preference.updateMapSettings(e,t));if(!i)return!0;if(i instanceof m.APIError&&404===i.code){let{error:r}=await (0,c.tryCatch)(a.upsxClient.preference.createMapSettings(e,t));return!r||(p.warn("Failed to create map settings",r),!1)}return p.warn("Failed to update map settings",i),!1},[r,e]),u=(0,d.useCallback)((e,t)=>{i(e?.layerOrder??t)},[i]),l=(0,d.useCallback)(async t=>{if(!r||0===t.length)return!1;i(t);let{data:n,error:s}=await (0,c.tryCatch)(a.upsxClient.preference.reorderMapSettingsLayers(e,{order:t}));if(!s)return u(n,t),!0;if(s instanceof m.APIError&&404===s.code){let{data:r,error:i}=await (0,c.tryCatch)(a.upsxClient.preference.createMapSettings(e,{layerOrder:t}));if(!i)return u(r,t),!0;if(i instanceof m.APIError&&409===i.code){let{data:r,error:i}=await (0,c.tryCatch)(a.upsxClient.preference.reorderMapSettingsLayers(e,{order:t}));return i?(p.warn("Failed to reorder map layers after create",i),!1):(u(r,t),!0)}return p.warn("Failed to create map settings layer order",i),!1}return p.warn("Failed to reorder map layers",s),!1},[r,e,u,i]),f=(0,d.useCallback)(async(t,n,s)=>{if(!r)return!1;i(s);let{data:o,error:d}=await (0,c.tryCatch)(a.upsxClient.preference.moveMapSettingsLayer(e,t,{placement:n}));return d?d instanceof m.APIError&&(404===d.code||400===d.code)?l(s):(p.warn("Failed to move map layer",d),!1):(u(o,s),!0)},[r,e,u,l,i]);return{saveMapSettings:s,saveLayerOrder:l,moveLayer:f}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,o.useUser)(),[d,m]=(0,t.useAtom)(r.userPreferencesAtom),[p,f]=(0,t.useAtom)(s.wxuUserPreferenceAtom),g=(0,t.useSetAtom)(n.mapLayerOrderAtom),y=async()=>{let{data:e,error:t}=await (0,c.tryCatch)(a.upsxClient.preference.getMapSettings("twc"));if(t)return{ok:!1,mapSettings:null,layerOrder:null};if(!e)return{ok:!0,mapSettings:null,layerOrder:null};let{animationSpeed:r,autoplay:i,opacity:n,roadOverlay:s,style:o}=e,u={...void 0!==r&&{animationSpeed:r},...void 0!==i&&{autoplay:i},...void 0!==n&&{opacity:n},...void 0!==s&&{roadOverlay:s},...void 0!==o&&{style:o}};return{ok:!0,mapSettings:Object.keys(u).length>0?u:null,layerOrder:e.layerOrder?.length?e.layerOrder:null}},S=async e=>{try{await a.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},w=async(t,r=!0)=>{try{let i,n=(i={...d,...t},m(i),f({...p,...t,locations:i.locations}),i);if(t?.unit){let e=(0,u.unitsSystemByName)(t.unit),r=e?.code||"e";(0,l.setCookie)(u.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await S(n),{success:!0}}catch(e){return console.error("Failed to update preferences:",e),{success:!1,error:e instanceof Error?e.message:"Failed to update preferences"}}};return{syncPreferencesFromUpsx:async()=>{try{let[e,t]=await Promise.all([a.upsxClient.preference.getPreference(),y()]);if(!e?.userID)return null;let{mapSettings:r,layerOrder:n,ok:s}=t;s&&g(n);let{mapSettings:o,...u}=e,l={...u,mapSettings:{...i.DEFAULT_MAP_SETTINGS,...r}};return w(l,!1),l}catch{return null}},updatePreferences:w}}],776169)},528600,949920,e=>{"use strict";let t;var r=e.i(247865),i=e.i(546446),n=e.i(381477);let a=(0,e.i(66396).withMiddleware)(n.default,e=>(t,r,i)=>(i.revalidateOnFocus=!1,i.revalidateIfStale=!1,i.revalidateOnReconnect=!1,e(t,r,i)));e.s(["default",0,a],949920);var s=e.i(889753),o=e.i(901351),u=e.i(310847),l=e.i(543512),c=e.i(990033),d=e.i(333350),m=e.i(495110),p=e.i(513513),f=e.i(960576);e.s(["useUser",0,function(){let[e,n]=(0,i.useAtom)(s.userProfileAtom),[g,y]=(0,i.useAtom)(u.wxuUserAnonymousIdAtom),[S,w]=(0,i.useAtom)(u.wxuUserAccountUserAccountResponseAtom),[h,v]=(0,r.useState)(!1),A=(0,i.useSetAtom)(u.wxuLoginRedirectPageAtom),I=(0,m.useIsHydratingRender)();d.default&&!h&&(A(window.location.href),v(!0));let b=(0,i.useAtomValue)(s.userTierAtom),U=(0,p.isUserLoggedIn)(b),P=g;!P&&d.default&&(t||(t=(0,f.readEarlyAnonId)()??(0,c.v4)()),P=t),d.default&&!g&&P&&y(P),!e&&S&&n(S);let E=a(U?"upsx/id":null,()=>o.upsxClient.account.getAccountId(),{shouldRetryOnError:e=>"APIError"!==e.name}),{userID:C=""}=E?.data||{},T=a(C&&e?.userID!==C?"upsx/account":null,()=>o.upsxClient.account.getAccount(),{shouldRetryOnError:e=>"APIError"!==e.name,onSuccess:e=>{n(e),w(e)}});return{user:{anonId:P,userID:C,isUserLoggedIn:U,subscriptionTier:b,isUserPremium:(0,p.isUserTierPremium)(b),isUserAdFree:b===l.UserSubscriptionTiers.adFree},userProfile:I?null:e,isUserIdLoading:E.isLoading,profileError:T.error}}],528600)},543512,e=>{"use strict";var t,r=((t={})[t.none=-1]="none",t[t.standard=0]="standard",t[t.premium=1]="premium",t[t.adFree=2]="adFree",t[t.premiumWithAd=3]="premiumWithAd",t);let i=Object.entries(r).reduce((e,[t,r])=>(e[r]=t,e),{});Object.entries(r).reduce((e,[t,r])=>(e[r.toString()]=r,e),{}),e.s(["UserSubscriptionPremiumTiers",0,[1,2,3],"UserSubscriptionTierKeysMap",0,i,"UserSubscriptionTiers",()=>r,"UserSubscriptionTiersMap",0,{standard:0,tier0:1,tier1:1,"ad-free-v2":2,tier3:3}])},960576,e=>{"use strict";let t="wxu-exp-anon-id";e.s(["clearEarlyAnonId",0,function(){try{window.localStorage.removeItem(t)}catch{}},"readEarlyAnonId",0,function(){let e=window.__wxExperimentDeviceId;if("string"==typeof e&&e)return e;try{return window.localStorage.getItem(t)||void 0}catch{return}}])},513513,e=>{"use strict";var t=e.i(543512);t.UserSubscriptionTiers.none,t.UserSubscriptionTiers.standard,t.UserSubscriptionTiers.adFree,t.UserSubscriptionTiers.premium,t.UserSubscriptionTiers.premiumWithAd,e.s(["hasRadarFeature",0,function(e){return void 0!==e&&t.UserSubscriptionPremiumTiers.includes(e)},"isUserLoggedIn",0,function(e){return void 0!==e&&e>t.UserSubscriptionTiers.none},"isUserTierPremium",0,function(e){return t.UserSubscriptionPremiumTiers.includes(e)}],513513)},901351,e=>{"use strict";e.i(288906);var t=e.i(245943),r=e.i(810564);let i=new t.UPSXClient({baseUrl:(0,r.upsxApiUrl)("https://upsx.weather.com")});e.s(["upsxClient",0,i])},991511,e=>{"use strict";var t=e.i(247865),r=e.i(806262),i=e.i(546446);e.s(["useRehydrateAtoms",0,e=>{(0,r.useHydrateAtoms)(e);let n=(0,i.useStore)(),a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{for(let[e,t]of a.current)n.get(e)!==t&&n.set(e,t)})}])},553329,e=>{"use strict";async function t(e){try{return{data:await e,error:null}}catch(e){return{data:null,error:e}}}e.s(["tryCatch",0,t])}]);