(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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])},797770,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["adsMetricsUnitAndZoneAtom",0,t])},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)})}])},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),l=e.i(864723),u=e.i(553329),c=e.i(592121),d=e.i(245943);let f=(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,u.tryCatch)(i.upsxClient.preference.updateMapSettings(e,r));if(!n)return!0;if(n instanceof d.APIError&&404===n.code){let{error:t}=await (0,u.tryCatch)(i.upsxClient.preference.createMapSettings(e,r));return!t||(f.warn("Failed to create map settings",t),!1)}return f.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),[f,p]=(0,t.useAtom)(a.wxuUserPreferenceAtom),m=async()=>{let{data:e,error:t}=await (0,u.tryCatch)(i.upsxClient.preference.getMapSettings("twc"));if(t||!e)return null;let{animationSpeed:r,autoplay:n,opacity:a,roadOverlay:o,style:s}=e,l={...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(l).length>0?l:null},g=async e=>{try{await i.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},y=async(t,r=!0)=>{try{let n,i=(n={...c,...t},d(n),p({...f,...t,locations:n.locations}),n);if(t?.unit){let e=(0,s.unitsSystemByName)(t.unit),r=e?.code||"e";(0,l.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(),m()]);if(!e?.userID)return null;let{mapSettings:r,...a}=e,o={...a,mapSettings:{...n.DEFAULT_MAP_SETTINGS,...t}};return y(o,!1),o}catch{return null}},updatePreferences:y}}],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])},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])},418982,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={cancelIdleCallback:function(){return o},requestIdleCallback:function(){return a}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},o="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},238163,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ESCAPE_REGEX:function(){return o},htmlEscapeAttributeString:function(){return c},htmlEscapeJsonString:function(){return u}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a={"&":"\\u0026",">":"\\u003e","":">"},l=/[&"']/g;function u(e){return e.replace(o,e=>a[e])}function c(e){return e.replace(l,e=>s[e])}},16129,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return E},handleClientScriptLoad:function(){return v},initScriptLoader:function(){return x}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(481258),o=e.r(744066),s=e.r(699173),l=a._(e.r(798973)),u=o._(e.r(592121)),c=e.r(205751),d=e.r(505171),f=e.r(418982),p=e.r(238163),m=new Map,g=new Set,y=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:i=null,dangerouslySetInnerHTML:a,children:o="",strategy:s="afterInteractive",onError:u,stylesheets:c}=e,f=r||t;if(f&&g.has(f))return;if(m.has(t)){g.add(f),m.get(t).then(n,u);return}let p=()=>{i&&i(),g.add(f)},y=document.createElement("script"),v=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),n&&n.call(this,t),p()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){u&&u(e)});a?(y.innerHTML=a.__html||"",p()):o?(y.textContent="string"==typeof o?o:Array.isArray(o)?o.join(""):"",p()):t&&(y.src=t,m.set(t,v)),(0,d.setAttributesFromProps)(y,e),"worker"===s&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",s),c&&(e=>{if(l.default.preinit)return e.forEach(e=>{l.default.preinit(e,{as:"style"})});if("u">typeof window){let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(c),document.body.appendChild(y)};function v(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,f.requestIdleCallback)(()=>y(e))}):y(e)}function x(e){e.forEach(v),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");g.add(t)})}function h(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:i=null,strategy:a="afterInteractive",onError:o,stylesheets:d,...m}=e,{updateScripts:v,scripts:x,getIsSsr:h,appDir:E,nonce:S}=(0,u.useContext)(c.HeadManagerContext);S=m.nonce||S;let w=(0,u.useRef)(!1);(0,u.useEffect)(()=>{let e=t||r;w.current||(i&&e&&g.has(e)&&i(),w.current=!0)},[i,t,r]);let _=(0,u.useRef)(!1);if((0,u.useEffect)(()=>{if(!_.current){if("afterInteractive"===a)y(e);else"lazyOnload"===a&&("complete"===document.readyState?(0,f.requestIdleCallback)(()=>y(e)):window.addEventListener("load",()=>{(0,f.requestIdleCallback)(()=>y(e))}));_.current=!0}},[e,a]),("beforeInteractive"===a||"worker"===a)&&(v?(x[a]=(x[a]||[]).concat([{id:t,src:r,onLoad:n,onReady:i,onError:o,...m,nonce:S}]),v(x)):h&&h()?g.add(t||r):h&&!h()&&y({...e,nonce:S})),E){if(d&&d.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===a)if(!r)return m.dangerouslySetInnerHTML&&(m.children=m.dangerouslySetInnerHTML.__html,delete m.dangerouslySetInnerHTML),(0,s.jsx)("script",{nonce:S,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([0,{...m,id:t}]))})`}});else return l.default.preload(r,m.integrity?{as:"script",integrity:m.integrity,nonce:S,crossOrigin:m.crossOrigin}:{as:"script",nonce:S,crossOrigin:m.crossOrigin}),(0,s.jsx)("script",{nonce:S,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,p.htmlEscapeJsonString)(JSON.stringify([r,{...m,id:t}]))})`}});"afterInteractive"===a&&r&&l.default.preload(r,m.integrity?{as:"script",integrity:m.integrity,nonce:S,crossOrigin:m.crossOrigin}:{as:"script",nonce:S,crossOrigin:m.crossOrigin})}return null}Object.defineProperty(h,"__nextScript",{value:!0});let E=h;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},185312,(e,t,r)=>{t.exports=e.r(16129)},5397,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["showAdminHeaderAtom",0,t])},688070,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["isWebViewOnlyAtom",0,t])},630986,e=>{"use strict";var t=e.i(546446),r=e.i(604323);e.s(["useCMSAttributes",0,()=>(0,t.useAtomValue)(r.metricsArticleDataAtom)])},37423,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["dprSdkIsInitializedAtom",0,t])},742436,283366,e=>{"use strict";e.s(["ExperimentContext",()=>M,"ExperimentProvider",()=>j,"default",()=>D,"useExperimentContext",()=>R],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(310847),s=e.i(546446),l=e.i(737801),u=e.i(688070),c=e.i(158662),d=e.i(528600),f=e.i(646341),p=e.i(553329);let m="production"!==t.default.env.VERCEL_TARGET_ENV,g=new Set;e.s(["getExposureVariantOverride",()=>I,"resetExposures",()=>C,"useExposure",()=>P],283366);var y=e.i(695881),v=e.i(358273);let x=(0,y.createLogger)("useExposure"),h="wxu-exp-exposed:",E=new Set,S=()=>{try{return(0,v.getMetricsSession)()?.sessionId||null}catch{return null}},w=e=>{try{let t=localStorage.getItem(h+e);return new Set(t?JSON.parse(t):[])}catch{return new Set}},_=(e,t)=>{try{for(let t=localStorage.length-1;t>=0;t--){let r=localStorage.key(t);r?.startsWith(h)&&r!==h+e&&localStorage.removeItem(r)}localStorage.setItem(h+e,JSON.stringify([...t]))}catch{}},b=e=>{if(0===E.size)return;let t=w(e);for(let e of E)t.add(e);_(e,t),E.clear()},A=e=>{let t=S();return t?(b(t),w(t).has(e)):E.has(e)},k=new Map;function I(e){return k.get(e)}function C(){E.clear(),k.clear();let e=S();if(e)try{localStorage.removeItem(h+e)}catch{}}function P(e,t){let r=void 0!==t,i=t?.variant,o=(0,n.useContext)(M);(0,n.useEffect)(()=>{if(!a.default||!o||A(e)||r&&void 0===i)return;let{client:t}=o;if(!t)return;let n=()=>{if(!A(e)){(e=>{let t=S();if(!t)return E.add(e);b(t);let r=w(t);r.add(e),_(t,r)})(e),void 0!==i&&k.set(e,i);try{t.exposure(e)}catch(e){x.error("Failed to track exposure:",e)}}};window.mParticle?.isInitialized?.()?n():window.mParticle?.ready?.(n)},[o,e,r,i])}let O="client-a74nh7wdmymfO9eOcl5awe1cgB30BDRV",T="production"!==t.default.env.VERCEL_TARGET_ENV,M=(0,n.createContext)(null),j=({children:e,scriptSrc:t})=>{let y,v,x=(0,s.useAtomValue)(o.wxuUserAnonymousIdAtom),h=(y=(0,l.useEventAttributes)(),v=(0,s.useAtomValue)(u.isWebViewOnlyAtom),(0,n.useCallback)((e,t={})=>{if(v)return void console.debug("Skipping enrolled-in-experiment in webview mode");if(!window.mParticle?.isInitialized?.())return void console.warn("MParticle is not initialized");if(!e)return void console.warn("No exposure data provided to trackEnrolledInExperiment");if(!e.experiment_key)return void console.debug(`[Experiment] Skipping exposure tracking for ${e.flag_key} - no experiment_key (feature flag only)`);try{let r={...y,newVariant:e.variant||"",newExperiment:e.experiment_key,newExperimentReceivedAt:Date.now()};window.mParticle?.logEvent?.("enrolled-in-experiment",window.mParticle?.EventType?.Other,r,t),console.debug(`MParticle: Event tracked - enrolled-in-experiment for ${e.flag_key||"unknown"}:${e.variant}`)}catch(e){console.error("MParticle: Failed to track event",e)}},[y,v])),E=(0,s.useSetAtom)(c.experimentJoinListAtom),{user:S}=(0,d.useUser)(),[w,_]=(0,n.useState)(!1),[b,A]=(0,n.useState)(!1),[,k]=(0,n.useState)(0),P=(0,n.useRef)(void 0),j=(0,n.useRef)(void 0),R=(0,f.getCookie)("ANON_C")?.toString();P.current=S.userID||void 0,j.current=R||x;let D=(0,n.useRef)(new Set),L=(0,n.useCallback)(e=>{let t=I(e.flag_key),r=void 0!==t?{...e,variant:t}:e,n=`${r.flag_key}::${r.variant??""}`;D.current.has(n)||(D.current.add(n),h(r),function({exposure:e,userId:t,deviceId:r}){if(!e.experiment_key){m&&console.debug(`[Experiment] Skipping Amplitude HTTP exposure for ${e.flag_key} — no experiment_key (feature flag only)`);return}if(!t&&!r){m&&console.debug("[Experiment] Skipping Amplitude HTTP exposure — no user identity");return}let n=`${e.flag_key}::${e.variant??""}`;if(g.has(n)){m&&console.debug(`[Experiment] Skipping duplicate Amplitude HTTP exposure: ${n}`);return}g.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:m?"dev":"prod",experimentation_platform:"amplitude_experiment"}}]};(async()=>{let{data:t,error:r}=await (0,p.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}`):m&&console.debug("[Experiment] Amplitude HTTP exposure sent:",{flag_key:e.flag_key,variant:e.variant})})()}({exposure:r,userId:P.current,deviceId:j.current}))},[h]),[N,F]=(0,n.useState)({});(0,n.useEffect)(()=>{if(a.default){let e=(0,f.getCookie)("amplitude-variants");if(e)try{let t=JSON.parse(e.toString());F(t),T&&Object.keys(t).length>0&&console.debug("[Experiment] Loaded server variants from cookie:",Object.keys(t))}catch(e){console.error("[Experiment] Failed to parse variants cookie:",e)}}},[]),(0,n.useEffect)(()=>{0===Object.keys(N).length?E(null):E(JSON.stringify(Object.entries(N).filter(([,e])=>!!e?.key).map(([e,t])=>{let r=t.key??"",n=Math.floor(Date.now()/1e3);return`${e},${r},${n}`})))},[N,E]);let H=function(e,t,r){let i=(0,n.useRef)(null),[o,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!o&&a.default&&O&&t){if(!window.Experiment)return void console.error("Amplitude Experiment SDK not loaded. Script may still be loading.");try{let t=Object.keys(r).length>0;i.current=window.Experiment.initialize(O,{debug:T,fetchTimeoutMillis:5e3,retryFetchOnFailure:!0,fetchOnStart:!1,automaticExposureTracking:!1,exposureTrackingProvider:{track:t=>{try{e(t),T&&console.debug("[Experiment] Exposure tracked:",t)}catch(e){console.error("[Experiment] Failed to track exposure:",e)}}},initialVariants:t?r:void 0,source:t?"initialVariants":"localStorage"}),s(!0),T&&(t?console.debug("[Experiment] SDK initialized with server variants:",Object.keys(r)):console.debug("[Experiment] SDK initialized (will fetch from API)"))}catch(e){console.error("Failed to initialize Amplitude Experiment SDK:",e)}}},[o,t,e,r]),i.current}(L,w,N);return(0,n.useEffect)(()=>{(async()=>{if(!H)return;let e=(0,f.getCookie)("ANON_C")?.toString()||x;if(!e&&!S.userID){T&&console.debug("[Experiment] No user identifier available"),A(!0);return}let t={device_id:e,...S.userID?{user_id:S.userID}:{},user_properties:{}};T&&console.debug("[Experiment] Fetching experiments from API for user:",t);try{await H.fetch(t)}catch(e){console.error("[Experiment] Failed to fetch experiments:",e)}finally{A(!0)}})()},[H,x,S.userID]),(0,n.useEffect)(()=>{D.current.clear(),g.clear(),C(),k(e=>e+1)},[S.userID]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{src:t,strategy:"afterInteractive",onLoad:()=>{_(!0),T&&console.debug("Amplitude Experiment script loaded")},onError:e=>{console.error("Failed to load Amplitude Experiment script:",e)}}),(0,r.jsx)(M.Provider,{value:{client:H,variant:(e,t)=>{if(!H)return t;let r=H.variant(e,t);return T&&console.debug("[Experiment] Current Variant:",r),r},fetch:e=>{if(!H)return Promise.resolve();if(!e){let e=(0,f.getCookie)("ANON_C")?.toString()||x;if(e||S.userID){let t={device_id:e,...S.userID?{user_id:S.userID}:{},user_properties:{}};return H.fetch(t)}}return H.fetch(e)},isFetchComplete:b},children:e})]})},R=()=>{let e=(0,n.useContext)(M);if(!e)throw Error("useExperimentContext must be used within an AmplitudeExperimentProvider");return e},D=j},436028,e=>{"use strict";e.s(["hasLength",0,e=>Array.isArray(e)&&e.length>0])}]);