(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,609858,674339,e=>{"use strict";var t=e.i(546446),r=e.i(592121);let n=(0,e.i(981030).atom)({timestamp:new Date().toISOString()});e.s(["debugDataAtom",0,n],674339),e.s(["useDebugSystem",0,function(){let[e,i]=(0,t.useAtom)(n),a=(0,r.useCallback)((e,t)=>{i(r=>{let n=r?.[e]||{},i="object"==typeof t&&null!==t&&"object"==typeof n?{...n,...t}:t;return{...r,[e]:i}})},[i]),o=(0,r.useCallback)((e,t)=>{i(r=>{let n=r||{timestamp:new Date().toISOString()},i=n.components||{};if(null===t){let t={...i};return delete t[e],{...n,components:t}}return{...n,components:{...i,[e]:t}}})},[i]),s=(0,r.useCallback)(e=>{a("page",e)},[a]),u=(0,r.useCallback)(e=>{a("route",e)},[a]),l=(0,r.useCallback)(e=>{Object.entries(e).forEach(([e,t])=>{t&&a(e,t)})},[a]);return{debugData:e,updateSection:a,updateComponentData:o,setPageData:s,clearAllDebugData:(0,r.useCallback)(()=>{i({timestamp:new Date().toISOString()})},[i]),updateRouteInfo:u,updatePageDebug:l}}],609858)},752496,e=>{"use strict";var t=e.i(592121),r=e.i(609858);let n=(0,e.i(695881).createLogger)("DebugCollector");e.s(["DebugCollectorClient",0,function({componentName:e,data:i,page:a,onUpdateData:o,onSetPageData:s}){let{updateComponentData:u,setPageData:l}=(0,r.useDebugSystem)(),c=(0,t.useRef)(!1),d=o||u,p=s||l;return(0,t.useEffect)(()=>{if(i)return n.lifecycle(`Collecting component data for ${e}`,{dataKeys:Object.keys(i),hasPerformance:!!i.performance,hasContext:!!i.context}),d(e,{...i,_collectedAt:new Date().toISOString()}),()=>{n.lifecycle(`Cleaning up data for ${e}`),d(e,null)}},[e,i,d]),(0,t.useEffect)(()=>{a&&!c.current&&(n.lifecycle("Setting page metadata",{title:a.title,assetName:a.assetName,collection:a.collection}),p({...a,_updatedAt:new Date().toISOString()}),c.current=!0)},[a,p]),null}])},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])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),n=e.i(301904),i=e.i(901351),a=e.i(310847),o=e.i(528600),s=e.i(617874),u=e.i(858040),l=e.i(553329),c=e.i(592121),d=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:t}}=(0,o.useUser)();return{saveMapSettings:(0,c.useCallback)(async r=>{if(!t)return!1;let{error:n}=await (0,l.tryCatch)(i.upsxClient.preference.updateMapSettings(e,r));if(!n)return!0;if(n instanceof d.APIError&&404===n.code){let{error:t}=await (0,l.tryCatch)(i.upsxClient.preference.createMapSettings(e,r));return!t||(p.warn("Failed to create map settings",t),!1)}return p.warn("Failed to update map settings",n),!1},[t,e])}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,o.useUser)(),[c,d]=(0,t.useAtom)(r.userPreferencesAtom),[p,m]=(0,t.useAtom)(a.wxuUserPreferenceAtom),f=async()=>{let{data:e,error:t}=await (0,l.tryCatch)(i.upsxClient.preference.getMapSettings("twc"));if(t||!e)return null;let{animationSpeed:r,autoplay:n,opacity:a,roadOverlay:o,style:s}=e,u={...void 0!==r&&{animationSpeed:r},...void 0!==n&&{autoplay:n},...void 0!==a&&{opacity:a},...void 0!==o&&{roadOverlay:o},...void 0!==s&&{style:s}};return Object.keys(u).length>0?u:null},g=async e=>{try{await i.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},v=async(t,r=!0)=>{try{let n,i=(n={...c,...t},d(n),m({...p,...t,locations:n.locations}),n);if(t?.unit){let e=(0,s.unitsSystemByName)(t.unit),r=e?.code||"e";(0,u.setCookie)(s.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await g(i),{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([i.upsxClient.preference.getPreference(),f()]);if(!e?.userID)return null;let{mapSettings:r,...a}=e,o={...a,mapSettings:{...n.DEFAULT_MAP_SETTINGS,...t}};return v(o,!1),o}catch{return null}},updatePreferences:v}}],776169)},491045,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),n=(0,t.atomWithStorage)("wx-purchase-source-attribution",null,r);e.s(["purchaseSourceAttributionAtom",0,n])},284007,e=>{"use strict";var t=e.i(981030);let r={get url(){return`file://${e.P("node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/jotai/esm/vanilla/utils.mjs")}`}},n=Symbol((r.env?r.env.MODE:void 0)!=="production"?"RESET":""),i=e=>"function"==typeof(null==e?void 0:e.then);function a(e=()=>{try{return window.localStorage}catch(e){(r.env?r.env.MODE:void 0)!=="production"&&"u">typeof window&&console.warn(e);return}},t){var n;let o,s,u,l,c={getItem:(r,n)=>{var a,u;let l=e=>{if(o!==(e=e||"")){try{s=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return n}o=e}return s},c=null!=(u=null==(a=e())?void 0:a.getItem(r))?u:null;return i(c)?c.then(l):l(c)},setItem:(r,n)=>{var i;return null==(i=e())?void 0:i.setItem(r,JSON.stringify(n,null==t?void 0:t.replacer))},removeItem:t=>{var r;return null==(r=e())?void 0:r.removeItem(t)}};try{u=null==(n=e())?void 0:n.subscribe}catch(e){}return!u&&"u">typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(u=(t,r)=>{if(!(e()instanceof window.Storage))return()=>{};let n=n=>{n.storageArea===e()&&n.key===t&&r(n.newValue)};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}}),u&&(l=u,c.subscribe=(e,t,r)=>l(e,e=>{let n;try{n=JSON.parse(e||"")}catch(e){n=r}t(n)})),c}let o=a(),s=new WeakMap,u={state:"loading"};e.s(["RESET",0,n,"atomWithStorage",0,function(e,a,s=o,u){let l=null==u?void 0:u.getOnInit,c=(0,t.atom)(l?s.getItem(e,a):a);return(r.env?r.env.MODE:void 0)!=="production"&&(c.debugPrivate=!0),c.onMount=t=>{let r;return t(s.getItem(e,a)),s.subscribe&&(r=s.subscribe(e,t,a)),r},(0,t.atom)(e=>e(c),(t,r,o)=>{let u="function"==typeof o?o(t(c)):o;return u===n?(r(c,a),s.removeItem(e)):i(u)?u.then(t=>(r(c,t),s.setItem(e,t))):(r(c,u),s.setItem(e,u))})},"createJSONStorage",0,a,"loadable",0,function(e){let n;return n=()=>{let n=new WeakMap,i=(0,t.atom)([()=>{},0]);i.unstable_onInit=e=>{e.set(i,([,t])=>[()=>e.set(i,([e,t])=>[e,t+1]),t])},(r.env?r.env.MODE:void 0)!=="production"&&(i.debugPrivate=!0);let a=(0,t.atom)(t=>{let r,a,[o]=t(i);try{r=t(e)}catch(e){return{state:"hasError",error:e}}if("function"!=typeof(null==(a=r)?void 0:a.then))return{state:"hasData",data:r};let s=r,l=n.get(s);return l?l:(s.then(e=>{n.set(s,{state:"hasData",data:e}),o()},e=>{n.set(s,{state:"hasError",error:e}),o()}),n.get(s)||(n.set(s,u),u))});return(r.env?r.env.MODE:void 0)!=="production"&&(a.debugPrivate=!0),(0,t.atom)(e=>e(a))},(s.has(e)?s:s.set(e,n())).get(e)}])},537989,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["pageIdAtom",0,t])},236593,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),n=(0,t.atomWithStorage)("wx-source-module",null,r);e.s(["sourceModuleAtom",0,n])},608201,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),n=(0,t.atomWithStorage)("wx-source-page",null,r);e.s(["sourcePageAtom",0,n])},185312,(e,t,r)=>{t.exports=e.r(16129)},318849,e=>{"use strict";let t=!1,r="upsx-recent-purchase-at";e.s(["SWR_CACHE_LEGACY_STORAGE_KEY",0,"app-cache","SWR_CACHE_STORAGE_KEY",0,"wxu-swr-cache-v1","disableSwrPersist",0,()=>{t=!0},"hasRecentPurchase",0,e=>{try{let t=localStorage.getItem(r);if(!t)return!1;let n=Number(t);if(!Number.isFinite(n))return!1;return Date.now()-nt,"markRecentPurchase",0,()=>{try{localStorage.setItem(r,String(Date.now()))}catch{}}])},45846,e=>{"use strict";let t=new(e.i(245943)).UPSXClient({baseUrl:"https://upsx.weather.com"});e.s(["upsxClient",0,t])},491240,e=>{"use strict";let t=(0,e.i(695881).createLogger)("MParticleIdentity");e.s(["truncateIdentityValue",0,e=>"string"==typeof e&&e.length>256?(t.warn(`identity value exceeded 256 chars (${e.length}); truncating`),e.slice(0,256)):e])},806262,e=>{"use strict";e.i(592121);var t=e.i(546446);e.i(284007),e.i(981030);let r=new WeakMap;e.s(["useHydrateAtoms",0,function(e,n){var i;let a,o=(0,t.useStore)(n),s=(i=o,(a=r.get(i))||(a=new WeakSet,r.set(i,a)),a);for(let[t,...r]of e)(!s.has(t)||(null==n?void 0:n.dangerouslyForceHydrate))&&(s.add(t),o.set(t,...r))}])},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),n=(0,t.atom)(null);e.s(["activeEventAtom",0,n,"layoutStateAtom",0,r])},991511,e=>{"use strict";var t=e.i(592121),r=e.i(806262),n=e.i(546446);e.s(["useRehydrateAtoms",0,e=>{(0,r.useHydrateAtoms)(e);let i=(0,n.useStore)(),a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{for(let[e,t]of a.current)i.get(e)!==t&&i.set(e,t)})}])},797770,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["adsMetricsUnitAndZoneAtom",0,t])},688070,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["isWebViewOnlyAtom",0,t])},328343,562209,e=>{"use strict";var t=e.i(592121),r=e.i(546446),n=e.i(737801),i=e.i(688070);e.s(["useEnrolledInExperimentEvent",0,()=>{let e=(0,n.useEventAttributes)(),a=(0,r.useAtomValue)(i.isWebViewOnlyAtom);return(0,t.useCallback)((t,r={})=>{if(a)return void console.debug("Skipping enrolled-in-experiment in webview mode");if(!window.mParticle?.isInitialized?.())return void console.warn("MParticle is not initialized");if(!t)return void console.warn("No exposure data provided to trackEnrolledInExperiment");if(!t.experiment_key)return void console.debug(`[Experiment] Skipping exposure tracking for ${t.flag_key} - no experiment_key (feature flag only)`);try{let n={...e,newVariant:t.variant||"",newExperiment:t.flag_key,newExperimentKey:t.experiment_key,newExperimentReceivedAt:Date.now()};window.mParticle?.logEvent?.("enrolled-in-experiment",window.mParticle?.EventType?.Other,n,r),console.debug(`MParticle: Event tracked - enrolled-in-experiment for ${t.flag_key||"unknown"}:${t.variant}`)}catch(e){console.error("MParticle: Failed to track event",e)}},[e,a])}],328343);var a=e.i(546584),o=e.i(553329);let s="production"!==a.default.env.VERCEL_TARGET_ENV,u=new Set;e.s(["resetTrackedExposures",0,function(){u.clear()},"trackAmplitudeExposure",0,function({exposure:e,userId:t,deviceId:r}){if(!e.experiment_key){s&&console.debug(`[Experiment] Skipping Amplitude HTTP exposure for ${e.flag_key} — no experiment_key (feature flag only)`);return}if(!t&&!r){s&&console.debug("[Experiment] Skipping Amplitude HTTP exposure — no user identity");return}let n=`${e.flag_key}::${e.variant??""}`;if(u.has(n)){s&&console.debug(`[Experiment] Skipping duplicate Amplitude HTTP exposure: ${n}`);return}u.add(n);let i={api_key:"bb1117981ed2a95dc4fa64b75661d681",events:[{event_type:"$exposure",user_id:t,device_id:r,ip:"$remote",event_properties:{flag_key:e.flag_key,variant:e.variant,experiment_key:e.experiment_key,platform:"web",app_name:"wx-next-web",environment:s?"dev":"prod",experimentation_platform:"amplitude_experiment"}}]};(async()=>{let{data:t,error:r}=await (0,o.tryCatch)(fetch("https://api2.amplitude.com/2/httpapi",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),keepalive:!0}));return r?console.error("[Experiment] Failed to send exposure to Amplitude HTTP API:",r):t&&!t.ok?console.error(`[Experiment] Amplitude HTTP API returned ${t.status}`):s&&console.debug("[Experiment] Amplitude HTTP exposure sent:",{flag_key:e.flag_key,variant:e.variant})})()}],562209)},283366,e=>{"use strict";e.s(["getExposureVariantOverride",()=>g,"resetExposures",()=>v,"useExposure",()=>y]);var t=e.i(592121),r=e.i(695881),n=e.i(333350),i=e.i(358273),a=e.i(742436);let o=(0,r.createLogger)("useExposure"),s="wxu-exp-exposed:",u=new Set,l=()=>{try{return(0,i.getMetricsSession)()?.sessionId||null}catch{return null}},c=e=>{try{let t=localStorage.getItem(s+e);return new Set(t?JSON.parse(t):[])}catch{return new Set}},d=(e,t)=>{try{for(let t=localStorage.length-1;t>=0;t--){let r=localStorage.key(t);r?.startsWith(s)&&r!==s+e&&localStorage.removeItem(r)}localStorage.setItem(s+e,JSON.stringify([...t]))}catch{}},p=e=>{if(0===u.size)return;let t=c(e);for(let e of u)t.add(e);d(e,t),u.clear()},m=e=>{let t=l();return t?(p(t),c(t).has(e)):u.has(e)},f=new Map;function g(e){return f.get(e)}function v(){u.clear(),f.clear();let e=l();if(e)try{localStorage.removeItem(s+e)}catch{}}function y(e,r){let i=void 0!==r,s=r?.variant,g=(0,t.useContext)(a.ExperimentContext);(0,t.useEffect)(()=>{if(!n.default||!g||m(e)||i&&void 0===s)return;let{client:t}=g;if(!t)return;let r=()=>{if(!m(e)){(e=>{let t=l();if(!t)return u.add(e);p(t);let r=c(t);r.add(e),d(t,r)})(e),void 0!==s&&f.set(e,s);try{t.exposure(e)}catch(e){o.error("Failed to track exposure:",e)}}};window.mParticle?.isInitialized?.()?r():window.mParticle?.ready?.(r)},[g,e,i,s])}},742436,e=>{"use strict";e.s(["ExperimentContext",()=>f,"ExperimentProvider",()=>g,"default",()=>y,"useExperimentContext",()=>v],742436);var t=e.i(546584),r=e.i(699173),n=e.i(592121),i=e.i(185312),a=e.i(333350),o=e.i(546446),s=e.i(328343),u=e.i(158662),l=e.i(528600),c=e.i(562209),d=e.i(283366);let p="client-a74nh7wdmymfO9eOcl5awe1cgB30BDRV",m="production"!==t.default.env.VERCEL_TARGET_ENV,f=(0,n.createContext)(null),g=({children:e,scriptSrc:t})=>{let g=(0,s.useEnrolledInExperimentEvent)(),v=(0,o.useSetAtom)(u.experimentJoinListAtom),{user:y}=(0,l.useUser)(),[w,x]=(0,n.useState)(!1),[S,E]=(0,n.useState)(!1),[,h]=(0,n.useState)(0),b=(0,n.useRef)(void 0),A=(0,n.useRef)(void 0);b.current=y.userID||void 0,A.current=y.anonId||void 0;let k=(0,n.useRef)(new Set),I=(0,n.useRef)({}),_=function(e,t){let r=(0,n.useRef)(null),[i,o]=(0,n.useState)(!1),s=(0,n.useRef)(e);return s.current=e,(0,n.useEffect)(()=>{if(!i&&a.default&&p&&t){if(!window.Experiment)return void console.error("Amplitude Experiment SDK not loaded. Script may still be loading.");try{r.current=window.Experiment.initialize(p,{debug:m,fetchTimeoutMillis:5e3,retryFetchOnFailure:!0,fetchOnStart:!1,automaticExposureTracking:!1,exposureTrackingProvider:{track:e=>{try{s.current(e),m&&console.debug("[Experiment] Exposure tracked:",e)}catch(e){console.error("[Experiment] Failed to track exposure:",e)}}},source:"localStorage"}),o(!0),m&&console.debug("[Experiment] SDK initialized (will fetch from API)")}catch(e){console.error("Failed to initialize Amplitude Experiment SDK:",e)}}},[i,t]),r.current}((0,n.useCallback)(e=>{let t=(0,d.getExposureVariantOverride)(e.flag_key),r=void 0!==t?{...e,variant:t}:e,n=`${r.flag_key}::${r.variant??""}`;if(k.current.has(n))return;k.current.add(n);let[i]=JSON.parse(JSON.stringify(Object.entries({[r.flag_key]:{key:r.variant}}).filter(([,e])=>!!e?.key).map(([e,t])=>{let r=t.key??"",n=Math.floor(Date.now()/1e3);return`${e},${r},${n}`})));i&&(I.current={...I.current,[r.flag_key]:i},v(JSON.stringify(Object.values(I.current)))),g(r),(0,c.trackAmplitudeExposure)({exposure:r,userId:b.current,deviceId:A.current})},[g,v]),w);return(0,n.useEffect)(()=>{(async()=>{if(!_)return;let e=y.anonId;if(!e&&!y.userID){m&&console.debug("[Experiment] No user identifier available"),E(!0);return}let t={device_id:e,...y.userID?{user_id:y.userID}:{},user_properties:{}};m&&console.debug("[Experiment] Fetching experiments from API for user:",t);try{await _.fetch(t)}catch(e){console.error("[Experiment] Failed to fetch experiments:",e)}finally{E(!0)}})()},[_,y.anonId,y.userID]),(0,n.useEffect)(()=>{k.current.clear(),(0,c.resetTrackedExposures)(),(0,d.resetExposures)(),I.current={},v(null),h(e=>e+1)},[y.userID,v]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{src:t,strategy:"afterInteractive",onLoad:()=>{x(!0),m&&console.debug("Amplitude Experiment script loaded")},onError:e=>{console.error("Failed to load Amplitude Experiment script:",e)}}),(0,r.jsx)(f.Provider,{value:{client:_,variant:(e,t)=>{if(!_)return t;let r=_.variant(e,t);return m&&console.debug("[Experiment] Current Variant:",r),r},fetch:e=>{if(!_)return Promise.resolve();if(!e){let e=y.anonId;if(e||y.userID){let t={device_id:e,...y.userID?{user_id:y.userID}:{},user_properties:{}};return _.fetch(t)}}return _.fetch(e)},isFetchComplete:S},children:e})]})},v=()=>{let e=(0,n.useContext)(f);if(!e)throw Error("useExperimentContext must be used within an AmplitudeExperimentProvider");return e},y=g},647292,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["webViewPlatformAtom",0,t])},456215,e=>{"use strict";e.s(["isSnowCastWebView",0,function(e){return"snowcast"===e||e.startsWith("snowcast-")},"isWebViewIos",0,function(e){return"ios"===e||e.endsWith("-ios")}])},630986,e=>{"use strict";var t=e.i(546446),r=e.i(604323);e.s(["useCMSAttributes",0,()=>(0,t.useAtomValue)(r.metricsArticleDataAtom)])},5397,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["showAdminHeaderAtom",0,t])},37423,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["dprSdkIsInitializedAtom",0,t])},436028,e=>{"use strict";e.s(["hasLength",0,e=>Array.isArray(e)&&e.length>0])},458001,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["cscCountryCodeAtom",0,t])},849177,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["adsDisabledAtom",0,t])},21121,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["showVelvetcakeModuleAtom",0,t])}]);