(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,471652,(e,a,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AlmanacInterval=void 0,(i=r||(t.AlmanacInterval=r={})).DAILY="D",i.MONTHLY="M"},141050,(e,a,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformAlmanac=void 0,t.getDailyAlmanac=d,t.getSingleDayAlmanac=s,t.getMonthlyAlmanac=c;let r=e.r(103763),i=e.r(678651),n=e.r(414655),l=e.r(992591),o=e.r(471652);async function d(e){let a=(0,r.getDailyAlmanacUrlConfig)(e),l=(0,i.urlFrom)(a),o=await fetch(l,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:86400}}),d=await (0,n.handleFetchResponse)(o);return(0,t.transformAlmanac)(d)}async function s(e){let a=(0,r.getSingleDayAlmanacUrlConfig)(e),l=(0,i.urlFrom)(a),o=await fetch(l,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:86400}}),d=await (0,n.handleFetchResponse)(o);return(0,t.transformAlmanac)(d)}async function c(e){let a=(0,r.getMonthlyAlmanacUrlConfig)(e),l=(0,i.urlFrom)(a),o=await fetch(l,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:86400}}),d=await (0,n.handleFetchResponse)(o);return(0,t.transformAlmanac)(d)}t.transformAlmanac=(0,l.createTransformer)(e=>{var a;return{almanacInterval:(a=e.almanacInterval)===o.AlmanacInterval.DAILY||a===o.AlmanacInterval.MONTHLY?a:void 0,almanacRecordDate:e.almanacRecordDate??void 0,almanacRecordPeriod:e.almanacRecordPeriod??void 0,almanacRecordYearMax:e.almanacRecordYearMax??void 0,almanacRecordYearMin:e.almanacRecordYearMin??void 0,precipitationAverage:e.precipitationAverage??void 0,snowAccumulationAverage:e.snowAccumulationAverage??void 0,stationId:e.stationId??void 0,stationName:e.stationName??void 0,temperatureAverageMax:e.temperatureAverageMax??void 0,temperatureAverageMin:e.temperatureAverageMin??void 0,temperatureMean:e.temperatureMean??void 0,temperatureRecordMax:e.temperatureRecordMax??void 0,temperatureRecordMin:e.temperatureRecordMin??void 0}})},103763,(e,a,t)=>{"use strict";e.i(288906),Object.defineProperty(t,"__esModule",{value:!0}),t.getDailyAlmanacUrlConfig=function({geocode:e,units:a,startDay:t,startMonth:r,days:i}){return{host:"api.weather.com",protocol:"https",pathname:`/v3/wx/almanac/daily/${i}day`,query:{geocode:e,units:a,startDay:String(t),startMonth:String(r),format:"json",apiKey:"71f92ea9dd2f4790b92ea9dd2f779061"}}},t.getSingleDayAlmanacUrlConfig=function({geocode:e,units:a,day:t,month:r}){return{host:"api.weather.com",protocol:"https",pathname:"/v3/wx/almanac/daily/1day",query:{geocode:e,units:a,day:String(t),month:String(r),format:"json",apiKey:"71f92ea9dd2f4790b92ea9dd2f779061"}}},t.getMonthlyAlmanacUrlConfig=function({geocode:e,units:a,startMonth:t,months:r}){return{host:"api.weather.com",protocol:"https",pathname:`/v3/wx/almanac/monthly/${r}month`,query:{geocode:e,units:a,startMonth:String(t),format:"json",apiKey:"71f92ea9dd2f4790b92ea9dd2f779061"}}}},704162,(e,a,t)=>{"use strict";e.i(288906),Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentDateTimeUrlConfig=n,t.getCurrentDateTime=l;let r=e.r(678651),i=e.r(414655);function n({geocode:e}){return{host:"api.weather.com",protocol:"https",pathname:"/v3/dateTime",query:{geocode:e,format:"json",apiKey:"71f92ea9dd2f4790b92ea9dd2f779061"}}}async function l(e){let a=n(e),t=(0,r.urlFrom)(a),l=await fetch(t,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:300}});return await (0,i.handleFetchResponse)(l)}},740980,(e,a,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformHistoricalDailySummary=t.transformHistoricalHourly=void 0,t.getHistoricalHourlyForecast=s,t.getHistoricalDailySummary=c;let r=e.r(417669),i=e.r(678651),n=e.r(414655),l=e.r(992591),o=e.r(861160),d=e.r(349262);async function s(e){let a=(0,r.getHistoricalHourlyUrlConfig)(e),l=(0,i.urlFrom)(a),o=await fetch(l,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:300}}),d=await (0,n.handleFetchResponse)(o);return(0,t.transformHistoricalHourly)(d)}async function c(e){let a=(0,r.getHistoricalDailySummaryUrlConfig)(e),l=(0,i.urlFrom)(a),o=await fetch(l,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:3600}}),d=await (0,n.handleFetchResponse)(o);return(0,t.transformHistoricalDailySummary)(d)}t.transformHistoricalHourly=(0,l.createTransformer)(e=>({cloudCeiling:e.cloudCeiling??null,dayOfWeek:e.dayOfWeek??"",dayOrNight:e.dayOrNight??d.DayOrNight.DAY,expirationTimeUtc:e.expirationTimeUtc??0,iconCode:e.iconCode??44,iconCodeExtend:e.iconCodeExtend??0,precip24Hour:e.precip24Hour??0,pressureAltimeter:e.pressureAltimeter??0,pressureChange:e.pressureChange??0,pressureMeanSeaLevel:e.pressureMeanSeaLevel??0,pressureTendencyCode:e.pressureTendencyCode??0,pressureTendencyTrend:e.pressureTendencyTrend??"",relativeHumidity:e.relativeHumidity??0,snow24Hour:e.snow24Hour??"",sunriseTimeLocal:e.sunriseTimeLocal??"",sunriseTimeUtc:e.sunriseTimeUtc??0,sunsetTimeLocal:e.sunsetTimeLocal??"",sunsetTimeUtc:e.sunsetTimeUtc??0,temperature:e.temperature??0,temperatureChange24Hour:e.temperatureChange24Hour??0,temperatureDewPoint:e.temperatureDewPoint??0,temperatureFeelsLike:e.temperatureFeelsLike??0,temperatureHeatIndex:e.temperatureHeatIndex??0,temperatureMax24Hour:e.temperatureMax24Hour??"",temperatureMaxSince7Am:e.temperatureMaxSince7Am??0,temperatureMin24Hour:e.temperatureMin24Hour??0,temperatureWindChill:e.temperatureWindChill??0,uvDescription:e.uvDescription??d.UVDescription.LOW,uvIndex:e.uvIndex??0,validTimeLocal:e.validTimeLocal??"",validTimeUtc:e.validTimeUtc??0,visibility:e.visibility??0,windDirection:e.windDirection??0,windDirectionCardinal:(0,o.normalizeCardinal)(e.windDirectionCardinal??d.WindDirectionCardinal.NORTH),windGust:e.windGust??null,windSpeed:e.windSpeed??0,wxPhraseLong:e.wxPhraseLong??""})),t.transformHistoricalDailySummary=(0,l.createTransformer)(e=>({dayOfWeek:e.dayOfWeek??void 0,iconCodeDay:e.iconCodeDay??void 0,iconCodeExtendDay:e.iconCodeExtendDay??void 0,iconCodeExtendNight:e.iconCodeExtendNight??void 0,iconCodeNight:e.iconCodeNight??void 0,precip24Hour:e.precip24Hour??void 0,rain24Hour:e.rain24Hour??void 0,snow24Hour:e.snow24Hour??void 0,temperatureMax:e.temperatureMax??void 0,temperatureMin:e.temperatureMin??void 0,validTimeLocal:e.validTimeLocal??void 0,validTimeUtc:e.validTimeUtc??void 0,wxPhraseLongDay:e.wxPhraseLongDay??void 0,wxPhraseLongNight:e.wxPhraseLongNight??void 0}))},146230,e=>{"use strict";var a=e.i(902875),t=e.i(64412),r=e.i(247865),i=e.i(546446),n=e.i(725287),l=e.i(674885),o=e.i(617874),d=e.i(581014),s=e.i(380993),c=e.i(368847),m=e.i(632137);let u=({isLoading:e,barWidth:t="w-8",children:r})=>(0,a.jsx)(c.default,{variant:"Body.S",children:e?(0,a.jsx)("span",{className:(0,m.cn)("inline-block h-3 animate-pulse rounded bg-gray-200 align-middle",t)}):r}),p=({todayNormals:e,today:t,reportedConditions:r,monthlyAverages:i,locale:n,isLoading:l,error:o,formatTemperature:m,formatPrecip:p,isReportedPending:h,isMonthlyPending:y})=>{let g=(0,d.useTranslations)("Almanac"),v=t?new Intl.DateTimeFormat(n,{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${t}T00:00:00Z`)):void 0;if(o)return(0,a.jsx)(s.Card,{"aria-label":g("almanac"),"data-testid":"almanac",children:(0,a.jsx)(s.CardContent,{children:(0,a.jsx)(c.default,{variant:"Display.S",children:o.message||g("unableToLoadData")})})});let x=y?Array.from({length:3}):i;return(0,a.jsxs)(s.Card,{className:"not-prose @container/almanac","aria-label":g("almanac"),"data-testid":"almanac","aria-busy":l||h||y||void 0,children:[(0,a.jsx)(c.default,{variant:"Title.S",elementType:"h2",className:"mb-4",children:g("almanac")}),(0,a.jsxs)(s.CardContent,{className:"flex flex-col gap-6 p-0",children:[(0,a.jsxs)("table",{className:"w-full text-left",children:[(0,a.jsx)("caption",{className:"sr-only",children:g("todayAlmanacCaption")}),(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{scope:"col",className:"py-1",children:(0,a.jsx)(c.default,{variant:"Caption.S.Bold",children:v??g("today")})}),(0,a.jsx)("th",{scope:"col",className:"py-1",children:(0,a.jsx)(c.default,{variant:"Caption.S.Bold",children:g("high")})}),(0,a.jsx)("th",{scope:"col",className:"py-1",children:(0,a.jsx)(c.default,{variant:"Caption.S.Bold",children:g("low")})}),(0,a.jsx)("th",{scope:"col",className:"py-1",children:(0,a.jsx)(c.default,{variant:"Caption.S.Bold",children:g("precip")})})]})}),(0,a.jsxs)("tbody",{children:[(0,a.jsxs)("tr",{className:"border-b border-gray-200",children:[(0,a.jsx)("th",{scope:"row",className:"py-1.5",children:(0,a.jsx)(c.default,{variant:"Body.S",children:g("averages")})}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)(u,{isLoading:l,children:m(e?.temperatureAverageMax)})}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)(u,{isLoading:l,children:m(e?.temperatureAverageMin)})}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)(u,{isLoading:l,barWidth:"w-14",children:p(e?.precipitationAverage)})})]}),(0,a.jsxs)("tr",{className:"align-top",children:[(0,a.jsx)("th",{scope:"row",className:"py-1.5",children:(0,a.jsx)(c.default,{variant:"Body.S",children:g("records")})}),(0,a.jsxs)("td",{className:"py-1.5",children:[(0,a.jsx)(u,{isLoading:l,children:m(e?.temperatureRecordMax)}),l?(0,a.jsx)(c.default,{variant:"Body.S",elementType:"span",className:"block text-gray-700",children:(0,a.jsx)("span",{className:"inline-block h-3 w-10 animate-pulse rounded bg-gray-200 align-middle"})}):e?.almanacRecordYearMax!==void 0&&(0,a.jsx)(c.default,{variant:"Body.S",elementType:"span",className:"block text-gray-700",children:`(${e.almanacRecordYearMax})`})]}),(0,a.jsxs)("td",{className:"py-1.5",children:[(0,a.jsx)(u,{isLoading:l,children:m(e?.temperatureRecordMin)}),l?(0,a.jsx)(c.default,{variant:"Body.S",elementType:"span",className:"block text-gray-700",children:(0,a.jsx)("span",{className:"inline-block h-3 w-10 animate-pulse rounded bg-gray-200 align-middle"})}):e?.almanacRecordYearMin!==void 0&&(0,a.jsx)(c.default,{variant:"Body.S",elementType:"span",className:"block text-gray-700",children:`(${e.almanacRecordYearMin})`})]}),(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)(c.default,{variant:"Body.S",children:"--"})})]})]})]}),(0,a.jsxs)("table",{className:"w-full text-left",children:[(0,a.jsx)("caption",{className:"text-left",children:(0,a.jsx)(c.default,{variant:"Body.S.Bold",children:g("reportedConditions")})}),(0,a.jsx)("tbody",{children:[["yesterday",r?.yesterday],["lastSevenDays",r?.lastSevenDays],["monthToDate",r?.monthToDate]].map(([e,t],r,i)=>(0,a.jsxs)("tr",{className:r(0,a.jsx)("td",{className:"py-1.5",children:(0,a.jsx)(u,{isLoading:h,barWidth:2===t?"w-14":"w-8",children:e})},t))]},e))})]}),(0,a.jsxs)("table",{className:"w-full text-left",children:[(0,a.jsx)("caption",{className:"text-left",children:(0,a.jsx)(c.default,{variant:"Body.S.Bold",children:g("historicalMonthlyAvg")})}),(0,a.jsx)("tbody",{children:(x??[]).map((e,t)=>(0,a.jsxs)("tr",{className:te?e.slice(0,10):void 0;function f(e){let a=e.map(e=>e.temperatureMax).filter(e=>"number"==typeof e),t=e.map(e=>e.temperatureMin).filter(e=>"number"==typeof e),r=e.map(e=>e.precip24Hour).filter(e=>"number"==typeof e);return{temperatureMax:a.length?Math.max(...a):void 0,temperatureMin:t.length?Math.min(...t):void 0,precipTotal:r.length?r.reduce((e,a)=>e+a,0):void 0,dayCount:e.length}}let j=({location:e,initializing:t,initialError:d})=>{let s=(0,n.useParams)(),c=s?.locale||"en-US",m=(0,i.useAtomValue)(l.userUnitPreferenceAtom),u=(0,o.unitsSystemByName)(m),{todayNormals:j,reportedConditions:T,monthlyAverages:w,today:M,isLoading:A,isReportedPending:b,isMonthlyPending:C,error:N}=function(e){let a=(0,n.useParams)(),t=a?.locale||"en-US",d=(0,i.useAtomValue)(l.userUnitPreferenceAtom),s=(0,o.unitsSystemByName)(d)?.code,c=e?.geocode,{data:m,isLoading:u}=(0,h.default)(c?["almanac-date-time",c]:null,([,e])=>(0,v.getCurrentDateTime)({geocode:e}),{revalidateOnFocus:!1,dedupingInterval:6e4}),p=(0,r.useMemo)(()=>{if(m?.dateTime)return m.dateTime.slice(0,10);if(e?.ianaTimeZone){var a;return a=e.ianaTimeZone,new Intl.DateTimeFormat("en-CA",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}},[m?.dateTime,e?.ianaTimeZone]),{data:j,error:T}=(0,h.default)(c&&p?["almanac-today",c,s,p]:null,([,e,a,t])=>(0,y.getSingleDayAlmanac)({geocode:e,units:a,day:Number(t.slice(8,10)),month:Number(t.slice(5,7))}),{dedupingInterval:6e4}),{data:w,error:M}=(0,h.default)(c&&p?["almanac-monthly",c,s,p.slice(5,7)]:null,([,e,a,t])=>(0,y.getMonthlyAlmanac)({geocode:e,units:a,startMonth:Number(t),months:3}),{dedupingInterval:6e4}),{data:A,error:b}=(0,h.default)(c?["almanac-daily-summary",c,s,t]:null,([,e,a,t])=>(0,g.getHistoricalDailySummary)({geocode:e,units:a,language:t}),{dedupingInterval:6e4}),C=(0,r.useMemo)(()=>A&&p?function({days:e,today:a}){let t=e.filter(e=>{let t=x(e.validTimeLocal);return!!t&&t(x(e.validTimeLocal)??"").localeCompare(x(a.validTimeLocal)??"")),r=a.slice(0,7);return{yesterday:f(t.slice(-1)),lastSevenDays:f(t.slice(-7)),monthToDate:f(t.filter(e=>x(e.validTimeLocal)?.startsWith(r)))}}({days:A,today:p}):void 0,[A,p]);return{todayNormals:j?.[0],reportedConditions:C,monthlyAverages:w,today:p,isLoading:u||!p||!j&&!T,isReportedPending:!A&&!b,isMonthlyPending:!w&&!M,error:T||M||b||void 0}}(e),D=(0,r.useCallback)(e=>void 0===e?"--":`${Math.round(e)}\xb0`,[]),S=(0,r.useCallback)(e=>void 0===e?"--":`${e.toFixed(2)} ${u?.precip??""}`.trim(),[u?.precip]);return(0,a.jsx)(p,{todayNormals:j,today:M,reportedConditions:T,monthlyAverages:w,locale:c,isLoading:!!t||A,isReportedPending:!!t||b,isMonthlyPending:!!t||C,error:d??N,formatTemperature:D,formatPrecip:S})},T=()=>{let{location:e,isLoading:r,error:i}=(0,t.useLocation)();return(0,a.jsx)(j,{location:e,initializing:r,initialError:i})};e.s(["AlmanacBlockClient",0,T,"default",0,T],146230)},499484,function(e){e.n(e.i(146230))}]);