From 56261ded4b36c4235e7e2066094996005a3d4a65 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Sun, 23 Feb 2025 23:31:13 -0600 Subject: [PATCH] capture dist --- dist/index.html | 2 +- dist/resources/ws.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.html b/dist/index.html index feda2ae..89f7a2a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -WeatherStar 4000+
WeatherStar 4000+
v5.13.6
Enter your location above to continue
WeatherStar
4000+ v5.13.6
Current Conditions
Hourly Forecast
TEMP
WIND
Hourly Graph
Temperature
Cloud %
Precip %
75
65
55
12a
6a
12p
6p
12a
Travel Forecast
For
LOW
HIGH
Current
Conditions
Wind:
Humidity:
Dewpoint:
Ceiling:
Visibility:
Pressure:
Local
Forecast
Latest
Observations
°F
°C
Weather
Wind
Regional
Observations
Almanac
Monday
Tuesday
Sunrise:
6:24 am
6:25 am
Sunset:
6:24 am
6:25 am
Moon Data:
Extended
Forecast
Lo
Hi
Local
Radar
PRECIP
Light
Heavy

More information
Selected displays
Settings
Sharing
Copy Permalink Link copied to clipboard!
Forecast Information
Location:
Station Id:
Radar Id:
Zone Id:
Last Update: (None)
\ No newline at end of file +WeatherStar 4000+
WeatherStar 4000+
v5.14.0
Enter your location above to continue
WeatherStar
4000+ v5.14.0
Current Conditions
Hourly Forecast
TEMP
WIND
Hourly Graph
Temperature
Cloud %
Precip %
75
65
55
12a
6a
12p
6p
12a
Travel Forecast
For
LOW
HIGH
Current
Conditions
Wind:
Humidity:
Dewpoint:
Ceiling:
Visibility:
Pressure:
Local
Forecast
Latest
Observations
°F
°C
Weather
Wind
Regional
Observations
Almanac
Monday
Tuesday
Sunrise:
6:24 am
6:25 am
Sunset:
6:24 am
6:25 am
Moon Data:
Extended
Forecast
Lo
Hi
Local
Radar
PRECIP
Light
Heavy

More information
Selected displays
Settings
Sharing
Copy Permalink Link copied to clipboard!
Forecast Information
Location:
Station Id:
Radar Id:
Zone Id:
Last Update: (None)
\ No newline at end of file diff --git a/dist/resources/ws.min.js b/dist/resources/ws.min.js index 928a43d..25f16c0 100644 --- a/dist/resources/ws.min.js +++ b/dist/resources/ws.min.js @@ -1 +1 @@ -(()=>{"use strict";var e={2:(e,t,s)=>{var n=s(592),r=s(73),a=s(24),i=s(211),o=s(125);class l extends a.A{constructor(e,t,s){super(e,t,"Hourly Graph",s),document.addEventListener("DOMContentLoaded",(()=>{this.moveHeader()}))}moveHeader(){const e=this.fillTemplate("top-right",{});this.elem.querySelector(".header .right").append(e)}async getData(){if(!super.getData())return;const e=await(0,r.A)((()=>this.stillWaiting()));if(void 0===e)return void this.setStatus(n.Ay.failed);const t=e.map((e=>e.temperature)),s=e.map((e=>e.probabilityOfPrecipitation)),a=e.map((e=>e.skyCover));this.data={skyCover:a,temperature:t,probabilityOfPrecipitation:s},this.setStatus(n.Ay.loaded)}drawCanvas(){this.image||(this.image=this.elem.querySelector(".chart img"));const e=285;this.image.width=532,this.image.height=e;const t=document.createElement("canvas");t.width=532,t.height=e;const s=t.getContext("2d");s.imageSmoothingEnabled=!1;const n=c(0,5,this.data.temperature.length-1,532),r=o.c9.now().startOf("hour");document.querySelector(".x-axis .l-1").innerHTML=h(r),document.querySelector(".x-axis .l-2").innerHTML=h(r.plus({hour:6})),document.querySelector(".x-axis .l-3").innerHTML=h(r.plus({hour:12})),document.querySelector(".x-axis .l-4").innerHTML=h(r.plus({hour:18})),document.querySelector(".x-axis .l-5").innerHTML=h(r.plus({hour:24}));const a=c(0,275,100,10),i=u(this.data.skyCover,n,a);d(i,s,{strokeStyle:"lightgrey",lineWidth:3});const l=u(this.data.probabilityOfPrecipitation,n,a);d(l,s,{strokeStyle:"aqua",lineWidth:3});const m=Math.min(...this.data.temperature),f=Math.max(...this.data.temperature),g=Math.round((m+f)/2),y=c(m,275,f,10),p=u(this.data.temperature,n,y);d(p,s,{strokeStyle:"red",lineWidth:3});const w=String.fromCharCode(176);this.elem.querySelector(".y-axis .l-1").innerHTML=(f+w).substring(0,3),this.elem.querySelector(".y-axis .l-2").innerHTML=(g+w).substring(0,3),this.elem.querySelector(".y-axis .l-3").innerHTML=(m+w).substring(0,3),this.image.src=t.toDataURL(),super.drawCanvas(),this.finishDraw()}}const c=(e,t,s,n)=>{const r=(n-t)/(s-e),a=t-r*e;return e=>r*e+a},u=(e,t,s)=>e.map(((e,n)=>[t(n),s(e)])),d=(e,t,s)=>{t.beginPath(),t.strokeStyle="black",t.lineWidth=(s?.lineWidth??2)+2,t.moveTo(e[0][0],e[0][1]),e.slice(1).forEach((e=>t.lineTo(e[0],e[1]+2))),t.stroke(),t.beginPath(),t.strokeStyle=s?.strokeStyle??"red",t.lineWidth=s?.lineWidth??2,t.moveTo(e[0][0],e[0][1]),e.slice(1).forEach((e=>t.lineTo(e[0],e[1]))),t.stroke()},h=e=>e.toFormat("ha").slice(0,-1);(0,i.Kb)(new l(4,"hourly-graph"))},24:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(592),r=s(125),a=s(211),i=s(999),o=s(302);const l=class{constructor(e,t,s,r){this.navId=e,this.elemId=void 0,this.data=void 0,this.loadingStatus=n.Ay.loading,this.name=s??t,this.getDataCallbacks=[],this.stillWaitingCallbacks=[],this.defaultEnabled=r,this.okToDrawCurrentConditions=!0,this.okToDrawCurrentDateTime=!0,this.showOnProgress=!0,this.timing={totalScreens:1,baseDelay:9e3,delay:1},this.navBaseCount=0,this.screenIndex=-1,this.storeElemId(t),this.isEnabled?this.setStatus(n.Ay.loading):this.setStatus(n.Ay.disabled),this.startNavCount(),document.addEventListener("DOMContentLoaded",(()=>{this.loadTemplates()}))}generateCheckbox(e=!0){if("progress"===this.elemId)return!1;const t=(0,i.J)()?.[`${this.elemId}-checkbox`];let s;void 0!==t&&(s="true"===t);let n=s??window.localStorage.getItem(`display-enabled: ${this.elemId}`);null===n&&(n=e),this.isEnabled=!("true"!==n&&!0!==n),window.localStorage.setItem(`display-enabled: ${this.elemId}`,this.isEnabled);const r=document.createElement("label");r.for=`${this.elemId}-checkbox`,r.id=`${this.elemId}-label`;const a=document.createElement("input");a.type="checkbox",a.value=!0,a.id=`${this.elemId}-checkbox`,a.name=`${this.elemId}-checkbox`,a.checked=this.isEnabled,a.addEventListener("change",(e=>this.checkboxChange(e)));const o=document.createElement("span");o.innerHTML=this.name;const l=document.createElement("span");return l.innerHTML="!!!",l.classList.add("alert"),r.append(a,o,l),this.checkbox=r,r}checkboxChange(e){this.isEnabled=e.target.checked,window.localStorage.setItem(`display-enabled: ${this.elemId}`,this.isEnabled),this.getData()}setStatus(e){this.status=e,(0,a.yB)({id:this.navId,status:this.status}),this.checkbox&&(this.checkbox.classList.remove(...n.LR),this.checkbox.classList.add((0,n.qx)(e)))}get status(){return this.loadingStatus}set status(e){this.loadingStatus=e}storeElemId(e){this.elemId||(this.elemId=e)}getData(e){return this.data=void 0,e&&(this.weatherParameters=e),this.isEnabled?(this.setStatus(n.Ay.loading),this.calcNavTiming(),!0):(this.setStatus(n.Ay.disabled),!1)}getDataCallback(){this.getDataCallbacks.forEach((e=>e(this.data))),this.getDataCallbacks=[]}drawCanvas(){this.screenIndex<0&&(this.screenIndex=0),this.okToDrawCurrentDateTime&&this.drawCurrentDateTime()}finishDraw(){this.okToDrawCurrentDateTime&&(this.drawCurrentDateTime(),this.dateTimeInterval||(this.dateTimeInterval=setInterval((()=>this.active&&this.drawCurrentDateTime()),100)))}drawCurrentDateTime(){const e=r.c9.local().setZone((0,a.eB)()),t=e.toLocaleString(r.c9.TIME_WITH_SECONDS).padStart(11," "),s=e.toFormat(" ccc LLL ")+e.day.toString().padStart(2," "),n=this.elem.querySelector(".date-time.date"),i=this.elem.querySelector(".date-time.time");i&&this.lastTime!==t&&(i.innerHTML=t.toUpperCase()),this.lastTime=t,n&&this.lastDate!==s&&(n.innerHTML=s.toUpperCase()),this.lastDate=s}showCanvas(e){e===a.ab.command.firstFrame&&this.navNext(e),e===a.ab.command.lastFrame&&this.navPrev(e),this.startNavCount(),this.elem.classList.add("show"),document.querySelector("#divTwc").classList.add(this.elemId)}hideCanvas(){this.resetNavBaseCount(),this.elem.classList.remove("show"),document.querySelector("#divTwc").classList.remove(this.elemId)}get active(){return 0!==this.elem.offsetHeight}get enabled(){return this.isEnabled}navBaseTime(){(0,a.F4)()&&this.active&&(this.navBaseCount+=1,this.baseCountChange&&this.baseCountChange(this.navBaseCount),this.updateScreenFromBaseCount())}async updateScreenFromBaseCount(){const e=this.screenIndexFromBaseCount();!1!==e?e!==this.screenIndex&&(this.screenIndex=-1===e?0:e,this.screenIndexChange?this.screenIndexChange(this.screenIndex):await this.drawCanvas(),this.showCanvas()):this.sendNavDisplayMessage(a.ab.response.next)}calcNavTiming(){if(!1===this.timing)return;Array.isArray(this.timing.delay)&&(this.timing.totalScreens=this.timing.delay.length);let e=[];if("number"==typeof this.timing.delay)for(let t=0;t"object"==typeof e?e.time:e));let t=0;if(this.timing.fullDelay=e.map((e=>{const s=t+e;return t+=e,s})),Array.isArray(this.timing.delay)&&"object"==typeof this.timing.delay[0])this.timing.screenIndexes=this.timing.delay.map((e=>e.si));else{this.timing.screenIndexes=[];for(let e=0;ee>this.navBaseCount));this.navBaseCount=e}this.updateScreenFromBaseCount()}navPrev(e){if(e===a.ab.command.lastFrame)this.navBaseCount=this.timing.fullDelay[this.timing.totalScreens-1]-1;else{const e=this.timing.fullDelay.reduce(((e,t)=>te>this.navBaseCount));return-1!==e&&this.timing.screenIndexes[e]}startNavCount(){this.navInterval||(this.navInterval=setInterval((()=>this.navBaseTime()),this.timing.baseDelay*o.A.speed.value))}resetNavBaseCount(){this.navBaseCount=0,this.screenIndex=-1,this.navInterval&&(clearInterval(this.navInterval),this.navInterval=void 0)}sendNavDisplayMessage(e){(0,a.Ju)({id:this.navId,type:e})}loadTemplates(){if(this.templates={},this.elem=document.querySelector(`#${this.elemId}-html`),!this.elem)return;this.elem.querySelectorAll(".template").forEach((e=>{const t=e.classList[0],s=e.cloneNode(!0);s.classList.remove("template"),this.templates[t]=s,e.remove()}))}fillTemplate(e,t){const s=this.templates[e];if(!s)return!1;const n=s.cloneNode(!0);return Object.entries(t).forEach((([e,t])=>{const s=n.querySelector(`.${e}`);s&&("string"==typeof t||"number"==typeof t?s.innerHTML=t:"img"===t?.type&&(s.querySelector("img").src=t.src))})),n}stillWaiting(){this.isEnabled&&this.setStatus(n.Ay.retrying),this.stillWaitingCallbacks.forEach((e=>e())),this.stillWaitingCallbacks=[]}}},47:(e,t,s)=>{s.d(t,{b:()=>o,u:()=>a});var n=s(440),r=s(147);const a=(e,t=!1)=>new Promise((s=>{const n=new Image;if(n.onload=e=>{s(e.target)},e instanceof Blob)n.src=window.URL.createObjectURL(e);else{let s=e;t&&(s=(0,r.O)(e)),n.src=s}})),i=[],o=e=>!i.includes(e)&&((0,n.av)(e),i.push(e),!0)},73:(e,t,s)=>{s.d(t,{A:()=>p});var n=s(592),r=s(125),a=s(440),i=s(413),o=s(716),l=s(519),c=s(24),u=s(211),d=s(247);class h extends c.A{constructor(e,t,s){super(e,t,"Hourly Forecast",s),this.timing.baseDelay=20;this.timing.delay=[450];for(let e=0;e<4;e+=1)this.timing.delay.push(300);this.timing.delay.push(150)}async getData(e){const t=super.getData(e);let s;try{s=await(0,a.Pq)(e.forecastGridData,{retryCount:3,stillWaiting:()=>this.stillWaiting()})}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),this.isEnabled&&this.setStatus(n.Ay.failed),void this.getDataCallback(void 0)}this.data=await m(s.properties),this.getDataCallback(),t&&(this.setStatus(n.Ay.loaded),this.drawLongCanvas())}async drawLongCanvas(){const e=this.elem.querySelector(".hourly-lines");e.innerHTML="";const t=r.c9.local(),s=this.data.map(((e,s)=>{const n={},r=t.plus({hours:s}).toLocaleString({weekday:"short",hour:"numeric"});n.hour=r;const a=Math.round(e.temperature).toString().padStart(3),i=Math.round(e.apparentTemperature).toString().padStart(3);n.temp=a,a!==i&&(n.like=i);let o="Calm";if(e.windSpeed>0){const t=Math.round(e.windSpeed).toString();o=e.windDirection+Array(6-e.windDirection.length-t.length).join(" ")+t}return n.wind=o,n.icon={type:"img",src:e.icon},this.fillTemplate("hourly-row",n)}));e.append(...s)}drawCanvas(){super.drawCanvas(),this.finishDraw()}showCanvas(){this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".hourly-lines").offsetHeight-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}async getCurrentData(e){return e&&this.stillWaitingCallbacks.push(e),new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push((()=>e(this.data)))}))}}const m=async e=>{const t=g(e.temperature.values),s=g(e.apparentTemperature.values),n=g(e.windSpeed.values),r=g(e.windDirection.values),a=g(e.skyCover.values),o=g(e.weather.values),c=g(e.iceAccumulation.values),u=g(e.probabilityOfPrecipitation.values),d=g(e.snowfallAmount.values),h=await f(a,o,c,u,d,n);return t.map(((e,o)=>({temperature:(0,i.sz)(t[o]),apparentTemperature:(0,i.sz)(s[o]),windSpeed:(0,i.lt)(n[o]),windDirection:(0,l.Up)(r[o]),probabilityOfPrecipitation:u[o],skyCover:a[o],icon:h[o]})))},f=async(e,t,s,n,a,i)=>{const l=r.c9.local().startOf("hour"),c=(await(0,d.A)()).sun,u=r.IX.fromDateTimes(r.c9.fromJSDate(c[0].sunset),r.c9.fromJSDate(c[1].sunrise)),h=r.c9.fromJSDate(c[1].sunset);return e.map(((r,c)=>{const d=l.plus({hours:c}),m=u.contains(d)||d>h;return(0,o.ZJ)(e[c],t[c],s[c],n[c],a[c],i[c],m)}))},g=e=>{const t=r.c9.utc().startOf("hour").toMillis(),s=[];return e.forEach((e=>{let n=Date.parse(e.validTime.substr(0,e.validTime.indexOf("/")));const a=n+r.dw.fromISO(e.validTime.substr(e.validTime.indexOf("/")+1)).shiftTo("milliseconds").values.milliseconds;do{n>=t&&s.length<24&&s.push(e.value),n+=36e5}while(n{var n=s(519),r=s(440),a=s(592),i=s(891),o=s(413),l=s(24),c=s(211);class u extends l.A{constructor(e,t){super(e,t,"Latest Observations",!0),this.MaximumRegionalStations=7}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,s=Object.keys(StationInfo).map((e=>{const s=StationInfo[e],r=(0,n.Io)(s.lat,s.lon,t.latitude,t.longitude);return{...s,distance:r}})).sort(((e,t)=>e.distance-t.distance)).slice(0,30),r=[];let i=Math.min(s.length,7),o=0;for(;r.length<7&&i<=s.length;){const e=await h(s.slice(o,i));r.push(...e),o+=i,i=Math.min(s.length+1,o+7-r.length)}this.data=r.slice(0,this.MaximumRegionalStations),0!==this.data.length?this.setStatus(a.Ay.loaded):this.setStatus(a.Ay.noData)}async drawCanvas(){super.drawCanvas();const e=this.data.sort(((e,t)=>e.Name{const t=(0,n.Up)(e.windDirection.value),s=Math.round((0,o.sz)(e.temperature.value)),r=Math.round((0,o.Yy)(e.windSpeed.value)),a={location:(0,i.C)(e.city).substr(0,14),temp:s,weather:d(e.textDescription).substr(0,9)};return a.wind=r>0?t+Array(6-t.length-r.toString().length).join(" ")+r.toString():"NA"===r?"NA":"Calm",this.fillTemplate("observation-row",a)})),s=this.elem.querySelector(".observation-lines");s.innerHTML="",s.append(...t),this.finishDraw()}}const d=e=>{let t=e;return t=t.replace(/Light/,"L"),t=t.replace(/Heavy/,"H"),t=t.replace(/Partly/,"P"),t=t.replace(/Mostly/,"M"),t=t.replace(/Few/,"F"),t=t.replace(/Thunderstorm/,"T'storm"),t=t.replace(/ in /,""),t=t.replace(/Vicinity/,""),t=t.replace(/ and /," "),t=t.replace(/Freezing Rain/,"Frz Rn"),t=t.replace(/Freezing/,"Frz"),t=t.replace(/Unknown Precip/,""),t=t.replace(/L Snow Fog/,"L Snw/Fog"),t=t.replace(/ with /,"/"),t},h=async e=>(await Promise.all(e.map((async e=>{try{const t=await(0,r.Pq)(`https://api.weather.gov/stations/${e.id}/observations/latest`,{retryCount:1,stillWaiting:()=>(void 0).stillWaiting()});return null!==t.properties.temperature.value&&""!==t.properties.textDescription&&null!==t.properties.windSpeed.value&&{...t.properties,StationId:e.id,city:e.city}}catch(t){return console.log(`Unable to get latest observations for ${e.id}`),!1}})))).filter((e=>e));(0,c.Kb)(new u(2,"latest-observations"))},125:(e,t,s)=>{s.d(t,{IX:()=>Ts,c9:()=>gn,dw:()=>ks});class n extends Error{}class r extends n{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class a extends n{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class i extends n{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class o extends n{}class l extends n{constructor(e){super(`Invalid unit ${e}`)}}class c extends n{}class u extends n{constructor(){super("Zone is an abstract class")}}const d="numeric",h="short",m="long",f={year:d,month:d,day:d},g={year:d,month:h,day:d},y={year:d,month:h,day:d,weekday:h},p={year:d,month:m,day:d},w={year:d,month:m,day:d,weekday:m},v={hour:d,minute:d},S={hour:d,minute:d,second:d},b={hour:d,minute:d,second:d,timeZoneName:h},k={hour:d,minute:d,second:d,timeZoneName:m},C={hour:d,minute:d,hourCycle:"h23"},T={hour:d,minute:d,second:d,hourCycle:"h23"},x={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:h},L={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:m},D={year:d,month:d,day:d,hour:d,minute:d},M={year:d,month:d,day:d,hour:d,minute:d,second:d},I={year:d,month:h,day:d,hour:d,minute:d},N={year:d,month:h,day:d,hour:d,minute:d,second:d},O={year:d,month:h,day:d,weekday:h,hour:d,minute:d},E={year:d,month:m,day:d,hour:d,minute:d,timeZoneName:h},$={year:d,month:m,day:d,hour:d,minute:d,second:d,timeZoneName:h},F={year:d,month:m,day:d,weekday:m,hour:d,minute:d,timeZoneName:m},q={year:d,month:m,day:d,weekday:m,hour:d,minute:d,second:d,timeZoneName:m};class W{get type(){throw new u}get name(){throw new u}get ianaName(){return this.name}get isUniversal(){throw new u}offsetName(e,t){throw new u}formatOffset(e,t){throw new u}offset(e){throw new u}equals(e){throw new u}get isValid(){throw new u}}let A=null;class V extends W{static get instance(){return null===A&&(A=new V),A}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return st(e,t,s)}formatOffset(e,t){return it(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let H={};const P={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let _={};class z extends W{static create(e){return _[e]||(_[e]=new z(e)),_[e]}static resetCache(){_={},H={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=z.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return st(e,t,s,this.name)}formatOffset(e,t){return it(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const s=(n=this.name,H[n]||(H[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),H[n]);var n;let[r,a,i,o,l,c,u]=s.formatToParts?function(e,t){const s=e.formatToParts(t),n=[];for(let e=0;e=0?h:1e3+h,(Qe({year:r,month:a,day:i,hour:24===l?0:l,minute:c,second:u,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Z={};let U={};function R(e,t={}){const s=JSON.stringify([e,t]);let n=U[s];return n||(n=new Intl.DateTimeFormat(e,t),U[s]=n),n}let j={};let B={};let J=null;let G={};function Y(e,t,s,n){const r=e.listingMode();return"error"===r?null:"en"===r?s(t):n(t)}class K{constructor(e,t,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:n,floor:r,...a}=s;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...s};s.padTo>0&&(t.minimumIntegerDigits=s.padTo),this.inf=function(e,t={}){const s=JSON.stringify([e,t]);let n=j[s];return n||(n=new Intl.NumberFormat(e,t),j[s]=n),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Ue(this.floor?Math.floor(e):Je(e,3),this.padTo)}}class Q{constructor(e,t,s){let n;if(this.opts=s,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,s=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&z.create(s).valid?(n=s,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=R(t,r)}format(){return this.originalZone?this.formatToParts().map((({value:e})=>e)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map((e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e})):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class X{constructor(e,t,s){this.opts={style:"long",...s},!t&&Ve()&&(this.rtf=function(e,t={}){const{base:s,...n}=t,r=JSON.stringify([e,n]);let a=B[r];return a||(a=new Intl.RelativeTimeFormat(e,t),B[r]=a),a}(e,s))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,s="always",n=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===s&&a){const s="days"===e;switch(t){case 1:return s?"tomorrow":`next ${r[e][0]}`;case-1:return s?"yesterday":`last ${r[e][0]}`;case 0:return s?"today":`this ${r[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=r[e],u=n?l?c[1]:c[2]||c[1]:l?r[e][0]:e;return i?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ee={firstDay:1,minimalDays:4,weekend:[6,7]};class te{static fromOpts(e){return te.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,s,n,r=!1){const a=e||ve.defaultLocale,i=a||(r?"en-US":J||(J=(new Intl.DateTimeFormat).resolvedOptions().locale,J)),o=t||ve.defaultNumberingSystem,l=s||ve.defaultOutputCalendar,c=ze(n)||ve.defaultWeekSettings;return new te(i,o,l,c,a)}static resetCache(){J=null,U={},j={},B={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:s,weekSettings:n}={}){return te.create(e,t,s,n)}constructor(e,t,s,n,r){const[a,i,o]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const s=e.indexOf("-u-");if(-1===s)return[e];{let t,n;try{t=R(e).resolvedOptions(),n=e}catch(r){const a=e.substring(0,s);t=R(a).resolvedOptions(),n=a}const{numberingSystem:r,calendar:a}=t;return[n,r,a]}}(e);this.locale=a,this.numberingSystem=t||i||null,this.outputCalendar=s||o||null,this.weekSettings=n,this.intl=function(e,t,s){return s||t?(e.includes("-u-")||(e+="-u"),s&&(e+=`-ca-${s}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?te.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ze(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Y(this,e,dt,(()=>{const s=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=function(e){const t=[];for(let s=1;s<=12;s++){const n=gn.utc(2009,s,1);t.push(e(n))}return t}((e=>this.extract(e,s,"month")))),this.monthsCache[n][e]}))}weekdays(e,t=!1){return Y(this,e,gt,(()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let s=1;s<=7;s++){const n=gn.utc(2016,11,13+s);t.push(e(n))}return t}((e=>this.extract(e,s,"weekday")))),this.weekdaysCache[n][e]}))}meridiems(){return Y(this,void 0,(()=>yt),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[gn.utc(2016,11,13,9),gn.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e){return Y(this,e,St,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[gn.utc(-40,1,1),gn.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,s){const n=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===s));return n?n.value:null}numberFormatter(e={}){return new K(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Q(e,this.intl,t)}relFormatter(e={}){return new X(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const s=JSON.stringify([e,t]);let n=Z[s];return n||(n=new Intl.ListFormat(e,t),Z[s]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:He()?function(e){let t=G[e];if(!t){const s=new Intl.Locale(e);t="getWeekInfo"in s?s.getWeekInfo():s.weekInfo,G[e]=t}return t}(this.locale):ee}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let se=null;class ne extends W{static get utcInstance(){return null===se&&(se=new ne(0)),se}static instance(e){return 0===e?ne.utcInstance:new ne(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new ne(nt(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${it(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${it(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return it(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class re extends W{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ae(e,t){if(qe(e)||null===e)return t;if(e instanceof W)return e;if("string"==typeof e){const s=e.toLowerCase();return"default"===s?t:"local"===s||"system"===s?V.instance:"utc"===s||"gmt"===s?ne.utcInstance:ne.parseSpecifier(s)||z.create(e)}return We(e)?ne.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new re(e)}const ie={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},oe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},le=ie.hanidec.replace(/[\[|\]]/g,"").split("");let ce={};function ue({numberingSystem:e},t=""){const s=e||"latn";return ce[s]||(ce[s]={}),ce[s][t]||(ce[s][t]=new RegExp(`${ie[s]}${t}`)),ce[s][t]}let de,he=()=>Date.now(),me="system",fe=null,ge=null,ye=null,pe=60,we=null;class ve{static get now(){return he}static set now(e){he=e}static set defaultZone(e){me=e}static get defaultZone(){return ae(me,V.instance)}static get defaultLocale(){return fe}static set defaultLocale(e){fe=e}static get defaultNumberingSystem(){return ge}static set defaultNumberingSystem(e){ge=e}static get defaultOutputCalendar(){return ye}static set defaultOutputCalendar(e){ye=e}static get defaultWeekSettings(){return we}static set defaultWeekSettings(e){we=ze(e)}static get twoDigitCutoffYear(){return pe}static set twoDigitCutoffYear(e){pe=e%100}static get throwOnInvalid(){return de}static set throwOnInvalid(e){de=e}static resetCaches(){te.resetCache(),z.resetCache(),gn.resetCache(),ce={}}}class Se{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const be=[0,31,59,90,120,151,181,212,243,273,304,334],ke=[0,31,60,91,121,152,182,213,244,274,305,335];function Ce(e,t){return new Se("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Te(e,t,s){const n=new Date(Date.UTC(e,t-1,s));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return 0===r?7:r}function xe(e,t,s){return s+(Ge(e)?ke:be)[t-1]}function Le(e,t){const s=Ge(e)?ke:be,n=s.findIndex((e=>eet(n,t,s)?(l=n+1,c=1):l=n,{weekYear:l,weekNumber:c,weekday:o,...ot(e)}}function Ie(e,t=4,s=1){const{weekYear:n,weekNumber:r,weekday:a}=e,i=De(Te(n,1,t),s),o=Ye(n);let l,c=7*r+a-i-7+t;c<1?(l=n-1,c+=Ye(l)):c>o?(l=n+1,c-=Ye(n)):l=n;const{month:u,day:d}=Le(l,c);return{year:l,month:u,day:d,...ot(e)}}function Ne(e){const{year:t,month:s,day:n}=e;return{year:t,ordinal:xe(t,s,n),...ot(e)}}function Oe(e){const{year:t,ordinal:s}=e,{month:n,day:r}=Le(t,s);return{year:t,month:n,day:r,...ot(e)}}function Ee(e,t){if(!qe(e.localWeekday)||!qe(e.localWeekNumber)||!qe(e.localWeekYear)){if(!qe(e.weekday)||!qe(e.weekNumber)||!qe(e.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return qe(e.localWeekday)||(e.weekday=e.localWeekday),qe(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),qe(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function $e(e){const t=Ae(e.year),s=Ze(e.month,1,12),n=Ze(e.day,1,Ke(e.year,e.month));return t?s?!n&&Ce("day",e.day):Ce("month",e.month):Ce("year",e.year)}function Fe(e){const{hour:t,minute:s,second:n,millisecond:r}=e,a=Ze(t,0,23)||24===t&&0===s&&0===n&&0===r,i=Ze(s,0,59),o=Ze(n,0,59),l=Ze(r,0,999);return a?i?o?!l&&Ce("millisecond",r):Ce("second",n):Ce("minute",s):Ce("hour",t)}function qe(e){return void 0===e}function We(e){return"number"==typeof e}function Ae(e){return"number"==typeof e&&e%1==0}function Ve(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function He(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function Pe(e,t,s){if(0!==e.length)return e.reduce(((e,n)=>{const r=[t(n),n];return e&&s(e[0],r[0])===e[0]?e:r}),null)[1]}function _e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ze(e){if(null==e)return null;if("object"!=typeof e)throw new c("Week settings must be an object");if(!Ze(e.firstDay,1,7)||!Ze(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((e=>!Ze(e,1,7))))throw new c("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Ze(e,t,s){return Ae(e)&&e>=t&&e<=s}function Ue(e,t=2){let s;return s=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),s}function Re(e){return qe(e)||null===e||""===e?void 0:parseInt(e,10)}function je(e){return qe(e)||null===e||""===e?void 0:parseFloat(e)}function Be(e){if(!qe(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Je(e,t,s=!1){const n=10**t;return(s?Math.trunc:Math.round)(e*n)/n}function Ge(e){return e%4==0&&(e%100!=0||e%400==0)}function Ye(e){return Ge(e)?366:365}function Ke(e,t){const s=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===s?Ge(e+(t-s)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][s-1]}function Qe(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Xe(e,t,s){return-De(Te(e,1,t),s)+t-1}function et(e,t=4,s=1){const n=Xe(e,t,s),r=Xe(e+1,t,s);return(Ye(e)-n+r)/7}function tt(e){return e>99?e:e>ve.twoDigitCutoffYear?1900+e:2e3+e}function st(e,t,s,n=null){const r=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const i={timeZoneName:t,...a},o=new Intl.DateTimeFormat(s,i).formatToParts(r).find((e=>"timezonename"===e.type.toLowerCase()));return o?o.value:null}function nt(e,t){let s=parseInt(e,10);Number.isNaN(s)&&(s=0);const n=parseInt(t,10)||0;return 60*s+(s<0||Object.is(s,-0)?-n:n)}function rt(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new c(`Invalid unit value ${e}`);return t}function at(e,t){const s={};for(const n in e)if(_e(e,n)){const r=e[n];if(null==r)continue;s[t(n)]=rt(r)}return s}function it(e,t){const s=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),r=e>=0?"+":"-";switch(t){case"short":return`${r}${Ue(s,2)}:${Ue(n,2)}`;case"narrow":return`${r}${s}${n>0?`:${n}`:""}`;case"techie":return`${r}${Ue(s,2)}${Ue(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ot(e){return function(e,t){return t.reduce(((t,s)=>(t[s]=e[s],t)),{})}(e,["hour","minute","second","millisecond"])}const lt=["January","February","March","April","May","June","July","August","September","October","November","December"],ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ut=["J","F","M","A","M","J","J","A","S","O","N","D"];function dt(e){switch(e){case"narrow":return[...ut];case"short":return[...ct];case"long":return[...lt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ht=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],mt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ft=["M","T","W","T","F","S","S"];function gt(e){switch(e){case"narrow":return[...ft];case"short":return[...mt];case"long":return[...ht];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const yt=["AM","PM"],pt=["Before Christ","Anno Domini"],wt=["BC","AD"],vt=["B","A"];function St(e){switch(e){case"narrow":return[...vt];case"short":return[...wt];case"long":return[...pt];default:return null}}function bt(e,t){let s="";for(const n of e)n.literal?s+=n.val:s+=t(n.val);return s}const kt={D:f,DD:g,DDD:p,DDDD:w,t:v,tt:S,ttt:b,tttt:k,T:C,TT:T,TTT:x,TTTT:L,f:D,ff:I,fff:E,ffff:F,F:M,FF:N,FFF:$,FFFF:q};class Ct{static create(e,t={}){return new Ct(e,t)}static parseFormat(e){let t=null,s="",n=!1;const r=[];for(let a=0;a0&&r.push({literal:n||/^\s+$/.test(s),val:s}),t=null,s="",n=!n):n||i===t?s+=i:(s.length>0&&r.push({literal:/^\s+$/.test(s),val:s}),s=i,t=i)}return s.length>0&&r.push({literal:n||/^\s+$/.test(s),val:s}),r}static macroTokenToFormatOpts(e){return kt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Ue(e,t);const s={...this.opts};return t>0&&(s.padTo=t),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const s="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,r=(t,s)=>this.loc.extract(e,t,s),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>s?function(e){return yt[e.hour<12?0:1]}(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,n)=>s?function(e,t){return dt(t)[e.month-1]}(e,t):r(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>s?function(e,t){return gt(t)[e.weekday-1]}(e,t):r(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const s=Ct.macroTokenToFormatOpts(t);return s?this.formatWithSystemDefault(e,s):t},u=t=>s?function(e,t){return St(t)[e.year<0?0:1]}(e,t):r({era:t},"era");return bt(Ct.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return n?r({day:"numeric"},"day"):this.num(e.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(e.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(e.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}}))}formatDurationFromString(e,t){const s=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=Ct.parseFormat(t),r=n.reduce(((e,{literal:t,val:s})=>t?e:e.concat(s)),[]);return bt(n,(e=>t=>{const n=s(t);return n?this.num(e.get(n),t.length):t})(e.shiftTo(...r.map(s).filter((e=>e)))))}}const Tt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function xt(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function Lt(...e){return t=>e.reduce((([e,s,n],r)=>{const[a,i,o]=r(t,n);return[{...e,...a},i||s,o]}),[{},null,1]).slice(0,2)}function Dt(e,...t){if(null==e)return[null,null];for(const[s,n]of t){const t=s.exec(e);if(t)return n(t)}return[null,null]}function Mt(...e){return(t,s)=>{const n={};let r;for(r=0;rvoid 0!==e&&(t||e&&u)?-e:e;return[{years:h(je(s)),months:h(je(n)),weeks:h(je(r)),days:h(je(a)),hours:h(je(i)),minutes:h(je(o)),seconds:h(je(l),"-0"===l),milliseconds:h(Be(c),d)}]}const Ut={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Rt(e,t,s,n,r,a,i){const o={year:2===t.length?tt(Re(t)):Re(t),month:ct.indexOf(s)+1,day:Re(n),hour:Re(r),minute:Re(a)};return i&&(o.second=Re(i)),e&&(o.weekday=e.length>3?ht.indexOf(e)+1:mt.indexOf(e)+1),o}const jt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Bt(e){const[,t,s,n,r,a,i,o,l,c,u,d]=e,h=Rt(t,r,n,s,a,i,o);let m;return m=l?Ut[l]:c?0:nt(u,d),[h,new ne(m)]}const Jt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Gt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Yt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Kt(e){const[,t,s,n,r,a,i,o]=e;return[Rt(t,r,n,s,a,i,o),ne.utcInstance]}function Qt(e){const[,t,s,n,r,a,i,o]=e;return[Rt(t,o,s,n,r,a,i),ne.utcInstance]}const Xt=xt(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Et),es=xt(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Et),ts=xt(/(\d{4})-?(\d{3})/,Et),ss=xt(Ot),ns=Lt((function(e,t){return[{year:At(e,t),month:At(e,t+1,1),day:At(e,t+2,1)},null,t+3]}),Vt,Ht,Pt),rs=Lt($t,Vt,Ht,Pt),as=Lt(Ft,Vt,Ht,Pt),is=Lt(Vt,Ht,Pt);const os=Lt(Vt);const ls=xt(/(\d{4})-(\d\d)-(\d\d)/,Wt),cs=xt(qt),us=Lt(Vt,Ht,Pt);const ds="Invalid Duration",hs={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},ms={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...hs},fs=365.2425,gs=30.436875,ys={years:{quarters:4,months:12,weeks:52.1775,days:fs,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:gs,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...hs},ps=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ws=ps.slice(0).reverse();function vs(e,t,s=!1){const n={values:s?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new ks(n)}function Ss(e,t){let s=t.milliseconds??0;for(const n of ws.slice(1))t[n]&&(s+=t[n]*e[n].milliseconds);return s}function bs(e,t){const s=Ss(e,t)<0?-1:1;ps.reduceRight(((n,r)=>{if(qe(t[r]))return n;if(n){const a=t[n]*s,i=e[r][n],o=Math.floor(a/i);t[r]+=o*s,t[n]-=o*i*s}return r}),null),ps.reduce(((s,n)=>{if(qe(t[n]))return s;if(s){const r=t[s]%1;t[s]-=r,t[n]+=r*e[s][n]}return n}),null)}class ks{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let s=t?ys:ms;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||te.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,t){return ks.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new c("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new ks({values:at(e,ks.normalizeUnit),loc:te.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(We(e))return ks.fromMillis(e);if(ks.isDuration(e))return e;if("object"==typeof e)return ks.fromObject(e);throw new c(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[s]=function(e){return Dt(e,[zt,Zt])}(e);return s?ks.fromObject(s,t):ks.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[s]=function(e){return Dt(e,[_t,os])}(e);return s?ks.fromObject(s,t):ks.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new c("need to specify a reason the Duration is invalid");const s=e instanceof Se?e:new Se(e,t);if(ve.throwOnInvalid)throw new i(s);return new ks({invalid:s})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new l(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const s={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Ct.create(this.loc,s).formatDurationFromString(this,e):ds}toHuman(e={}){if(!this.isValid)return ds;const t=ps.map((t=>{const s=this.values[t];return qe(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(s)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Je(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return gn.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Ss(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ks.fromDurationLike(e),s={};for(const e of ps)(_e(t.values,e)||_e(this.values,e))&&(s[e]=t.get(e)+this.get(e));return vs(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const t=ks.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const s of Object.keys(this.values))t[s]=rt(e(this.values[s],s));return vs(this,{values:t},!0)}get(e){return this[ks.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return vs(this,{values:{...this.values,...at(e,ks.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:s,matrix:n}={}){return vs(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:s})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return bs(this.matrix,e),vs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return vs(this,{values:function(e){const t={};for(const[s,n]of Object.entries(e))0!==n&&(t[s]=n);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>ks.normalizeUnit(e)));const t={},s={},n=this.toObject();let r;for(const a of ps)if(e.indexOf(a)>=0){r=a;let e=0;for(const t in s)e+=this.matrix[t][a]*s[t],s[t]=0;We(n[a])&&(e+=n[a]);const i=Math.trunc(e);t[a]=i,s[a]=(1e3*e-1e3*i)/1e3}else We(n[a])&&(s[a]=n[a]);for(const e in s)0!==s[e]&&(t[r]+=e===r?s[e]:s[e]/this.matrix[r][e]);return bs(this.matrix,t),vs(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return vs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const n of ps)if(t=this.values[n],s=e.values[n],!(void 0===t||0===t?void 0===s||0===s:t===s))return!1;var t,s;return!0}}const Cs="Invalid Interval";class Ts{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new c("need to specify a reason the Interval is invalid");const s=e instanceof Se?e:new Se(e,t);if(ve.throwOnInvalid)throw new a(s);return new Ts({invalid:s})}static fromDateTimes(e,t){const s=yn(e),n=yn(t),r=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Ts.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(yn).filter((e=>this.contains(e))).sort(((e,t)=>e.toMillis()-t.toMillis())),s=[];let{s:n}=this,r=0;for(;n+this.e?this.e:e;s.push(Ts.fromDateTimes(n,a)),n=a,r+=1}return s}splitBy(e){const t=ks.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let s,{s:n}=this,r=1;const a=[];for(;ne*r)));s=+e>+this.e?this.e:e,a.push(Ts.fromDateTimes(n,s)),n=s,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,s=this.e=s?null:Ts.fromDateTimes(t,s)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ts.fromDateTimes(t,s)}static merge(e){const[t,s]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],s)=>t?t.overlaps(s)||t.abutsStart(s)?[e,t.union(s)]:[e.concat([t]),s]:[e,s]),[[],null]);return s&&t.push(s),t}static xor(e){let t=null,s=0;const n=[],r=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),a=Array.prototype.concat(...r).sort(((e,t)=>e.time-t.time));for(const e of a)s+="s"===e.type?1:-1,1===s?t=e.time:(t&&+t!=+e.time&&n.push(Ts.fromDateTimes(t,e.time)),t=null);return Ts.merge(n)}difference(...e){return Ts.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?Ct.create(this.s.loc.clone(t),e).formatInterval(this):Cs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Cs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Cs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Cs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ks.invalid(this.invalidReason)}mapEndpoints(e){return Ts.fromDateTimes(e(this.s),e(this.e))}}class xs{static hasDST(e=ve.defaultZone){const t=gn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return z.isValidZone(e)}static normalizeZone(e){return ae(e,ve.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||te.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||te.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||te.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||te.create(t,s,r)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||te.create(t,s,r)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null}={}){return(n||te.create(t,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null}={}){return(n||te.create(t,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return te.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return te.create(t,null,"gregory").eras(e)}static features(){return{relative:Ve(),localeWeek:He()}}}function Ls(e,t){const s=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=s(t)-s(e);return Math.floor(ks.fromMillis(n).as("days"))}function Ds(e,t,s,n){let[r,a,i,o]=function(e,t,s){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const s=Ls(e,t);return(s-s%7)/7}],["days",Ls]],r={},a=e;let i,o;for(const[l,c]of n)s.indexOf(l)>=0&&(i=l,r[l]=c(e,t),o=a.plus(r),o>t?(r[l]--,(e=a.plus(r))>t&&(o=e,r[l]--,e=a.plus(r))):e=o);return[e,r,o,i]}(e,t,s);const l=t-r,c=s.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(i0?ks.fromMillis(l,n).shiftTo(...c).plus(u):u}function Ms(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let s=0;s=s&&n<=r&&(t+=n-s)}}return parseInt(t,10)}return t}(e))}}const Is=`[ ${String.fromCharCode(160)}]`,Ns=new RegExp(Is,"g");function Os(e){return e.replace(/\./g,"\\.?").replace(Ns,Is)}function Es(e){return e.replace(/\./g,"").replace(Ns," ").toLowerCase()}function $s(e,t){return null===e?null:{regex:RegExp(e.map(Os).join("|")),deser:([s])=>e.findIndex((e=>Es(s)===Es(e)))+t}}function Fs(e,t){return{regex:e,deser:([,e,t])=>nt(e,t),groups:t}}function qs(e){return{regex:e,deser:([e])=>e}}const Ws={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let As=null;function Vs(e,t){return Array.prototype.concat(...e.map((e=>function(e,t){if(e.literal)return e;const s=_s(Ct.macroTokenToFormatOpts(e.val),t);return null==s||s.includes(void 0)?e:s}(e,t))))}class Hs{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Vs(Ct.parseFormat(t),e),this.units=this.tokens.map((t=>function(e,t){const s=ue(t),n=ue(t,"{2}"),r=ue(t,"{3}"),a=ue(t,"{4}"),i=ue(t,"{6}"),o=ue(t,"{1,2}"),l=ue(t,"{1,3}"),c=ue(t,"{1,6}"),u=ue(t,"{1,9}"),d=ue(t,"{2,4}"),h=ue(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return $s(t.eras("short"),0);case"GG":return $s(t.eras("long"),0);case"y":return Ms(c);case"yy":case"kk":return Ms(d,tt);case"yyyy":case"kkkk":return Ms(a);case"yyyyy":return Ms(h);case"yyyyyy":return Ms(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Ms(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Ms(n);case"MMM":return $s(t.months("short",!0),1);case"MMMM":return $s(t.months("long",!0),1);case"LLL":return $s(t.months("short",!1),1);case"LLLL":return $s(t.months("long",!1),1);case"o":case"S":return Ms(l);case"ooo":case"SSS":return Ms(r);case"u":return qs(u);case"uu":return qs(o);case"uuu":case"E":case"c":return Ms(s);case"a":return $s(t.meridiems(),0);case"EEE":return $s(t.weekdays("short",!1),1);case"EEEE":return $s(t.weekdays("long",!1),1);case"ccc":return $s(t.weekdays("short",!0),1);case"cccc":return $s(t.weekdays("long",!0),1);case"Z":case"ZZ":return Fs(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return Fs(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return qs(/[a-z_+-/]{1,256}?/i);case" ":return qs(/[^\S\n\r]/);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e))),this.disqualifyingUnit=this.units.find((e=>e.invalidReason)),!this.disqualifyingUnit){const[e,t]=[`^${(s=this.units).map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,s];this.regex=RegExp(e,"i"),this.handlers=t}var s}explainFromTokens(e){if(this.isValid){const[t,s]=function(e,t,s){const n=e.match(t);if(n){const e={};let t=1;for(const r in s)if(_e(s,r)){const a=s[r],i=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(n.slice(t,t+i))),t+=i}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,r,a]=s?function(e){let t,s=null;return qe(e.z)||(s=z.create(e.z)),qe(e.Z)||(s||(s=new ne(e.Z)),t=e.Z),qe(e.q)||(e.M=3*(e.q-1)+1),qe(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),qe(e.u)||(e.S=Be(e.u)),[Object.keys(e).reduce(((t,s)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(s);return n&&(t[n]=e[s]),t}),{}),s,t]}(s):[null,null,void 0];if(_e(s,"a")&&_e(s,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:s,result:n,zone:r,specificOffset:a}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Ps(e,t,s){return new Hs(e,s).explainFromTokens(t)}function _s(e,t){if(!e)return null;const s=Ct.create(t,e).dtFormatter((As||(As=gn.fromMillis(1555555555555)),As)),n=s.formatToParts(),r=s.resolvedOptions();return n.map((t=>function(e,t,s){const{type:n,value:r}=e;if("literal"===n){const e=/^\s+$/.test(r);return{literal:!e,val:e?" ":r}}const a=t[n];let i=n;"hour"===n&&(i=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":s.hour12?"hour12":"hour24");let o=Ws[i];if("object"==typeof o&&(o=o[a]),o)return{literal:!1,val:o}}(t,e,r)))}const zs="Invalid DateTime",Zs=864e13;function Us(e){return new Se("unsupported zone",`the zone "${e.name}" is not supported`)}function Rs(e){return null===e.weekData&&(e.weekData=Me(e.c)),e.weekData}function js(e){return null===e.localWeekData&&(e.localWeekData=Me(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Bs(e,t){const s={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new gn({...s,...t,old:s})}function Js(e,t,s){let n=e-60*t*1e3;const r=s.offset(n);if(t===r)return[n,t];n-=60*(r-t)*1e3;const a=s.offset(n);return r===a?[n,r]:[e-60*Math.min(r,a)*1e3,Math.max(r,a)]}function Gs(e,t){const s=new Date(e+=60*t*1e3);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),millisecond:s.getUTCMilliseconds()}}function Ys(e,t,s){return Js(Qe(e),t,s)}function Ks(e,t){const s=e.o,n=e.c.year+Math.trunc(t.years),r=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:n,month:r,day:Math.min(e.c.day,Ke(n,r))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=ks.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=Qe(a);let[l,c]=Js(o,s,e.zone);return 0!==i&&(l+=i,c=e.zone.offset(l)),{ts:l,o:c}}function Qs(e,t,s,n,r,a){const{setZone:i,zone:o}=s;if(e&&0!==Object.keys(e).length||t){const n=t||o,r=gn.fromObject(e,{...s,zone:n,specificOffset:a});return i?r:r.setZone(o)}return gn.invalid(new Se("unparsable",`the input "${r}" can't be parsed as ${n}`))}function Xs(e,t,s=!0){return e.isValid?Ct.create(te.create("en-US"),{allowZ:s,forceSimple:!0}).formatDateTimeFromString(e,t):null}function en(e,t){const s=e.c.year>9999||e.c.year<0;let n="";return s&&e.c.year>=0&&(n+="+"),n+=Ue(e.c.year,s?6:4),t?(n+="-",n+=Ue(e.c.month),n+="-",n+=Ue(e.c.day)):(n+=Ue(e.c.month),n+=Ue(e.c.day)),n}function tn(e,t,s,n,r,a){let i=Ue(e.c.hour);return t?(i+=":",i+=Ue(e.c.minute),0===e.c.millisecond&&0===e.c.second&&s||(i+=":")):i+=Ue(e.c.minute),0===e.c.millisecond&&0===e.c.second&&s||(i+=Ue(e.c.second),0===e.c.millisecond&&n||(i+=".",i+=Ue(e.c.millisecond,3))),r&&(e.isOffsetFixed&&0===e.offset&&!a?i+="Z":e.o<0?(i+="-",i+=Ue(Math.trunc(-e.o/60)),i+=":",i+=Ue(Math.trunc(-e.o%60))):(i+="+",i+=Ue(Math.trunc(e.o/60)),i+=":",i+=Ue(Math.trunc(e.o%60)))),a&&(i+="["+e.zone.ianaName+"]"),i}const sn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},rn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},an=["year","month","day","hour","minute","second","millisecond"],on=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ln=["year","ordinal","hour","minute","second","millisecond"];function cn(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new l(e);return t}(e)}}function un(e,t){const s=ae(t.zone,ve.defaultZone);if(!s.isValid)return gn.invalid(Us(s));const n=te.fromObject(t);let r,a;if(qe(e.year))r=ve.now();else{for(const t of an)qe(e[t])&&(e[t]=sn[t]);const t=$e(e)||Fe(e);if(t)return gn.invalid(t);const n=function(e){return fn[e]||(void 0===mn&&(mn=ve.now()),fn[e]=e.offset(mn)),fn[e]}(s);[r,a]=Ys(e,n,s)}return new gn({ts:r,zone:s,loc:n,o:a})}function dn(e,t,s){const n=!!qe(s.round)||s.round,r=(e,r)=>{e=Je(e,n||s.calendary?0:2,!0);return t.loc.clone(s).relFormatter(s).format(e,r)},a=n=>s.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(s.unit)return r(a(s.unit),s.unit);for(const e of s.units){const t=a(e);if(Math.abs(t)>=1)return r(t,e)}return r(e>t?-0:0,s.units[s.units.length-1])}function hn(e){let t,s={};return e.length>0&&"object"==typeof e[e.length-1]?(s=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[s,t]}let mn,fn={};class gn{constructor(e){const t=e.zone||ve.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new Se("invalid input"):null)||(t.isValid?null:Us(t));this.ts=qe(e.ts)?ve.now():e.ts;let n=null,r=null;if(!s){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,r]=[e.old.c,e.old.o];else{const a=We(e.o)&&!e.old?e.o:t.offset(this.ts);n=Gs(this.ts,a),s=Number.isNaN(n.year)?new Se("invalid input"):null,n=s?null:n,r=s?null:a}}this._zone=t,this.loc=e.loc||te.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new gn({})}static local(){const[e,t]=hn(arguments),[s,n,r,a,i,o,l]=t;return un({year:s,month:n,day:r,hour:a,minute:i,second:o,millisecond:l},e)}static utc(){const[e,t]=hn(arguments),[s,n,r,a,i,o,l]=t;return e.zone=ne.utcInstance,un({year:s,month:n,day:r,hour:a,minute:i,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const s=(n=e,"[object Date]"===Object.prototype.toString.call(n)?e.valueOf():NaN);var n;if(Number.isNaN(s))return gn.invalid("invalid input");const r=ae(t.zone,ve.defaultZone);return r.isValid?new gn({ts:s,zone:r,loc:te.fromObject(t)}):gn.invalid(Us(r))}static fromMillis(e,t={}){if(We(e))return e<-Zs||e>Zs?gn.invalid("Timestamp out of range"):new gn({ts:e,zone:ae(t.zone,ve.defaultZone),loc:te.fromObject(t)});throw new c(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(We(e))return new gn({ts:1e3*e,zone:ae(t.zone,ve.defaultZone),loc:te.fromObject(t)});throw new c("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const s=ae(t.zone,ve.defaultZone);if(!s.isValid)return gn.invalid(Us(s));const n=te.fromObject(t),r=at(e,cn),{minDaysInFirstWeek:a,startOfWeek:i}=Ee(r,n),l=ve.now(),c=qe(t.specificOffset)?s.offset(l):t.specificOffset,u=!qe(r.ordinal),d=!qe(r.year),h=!qe(r.month)||!qe(r.day),m=d||h,f=r.weekYear||r.weekNumber;if((m||u)&&f)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new o("Can't mix ordinal dates with month/day");const g=f||r.weekday&&!m;let y,p,w=Gs(l,c);g?(y=on,p=nn,w=Me(w,a,i)):u?(y=ln,p=rn,w=Ne(w)):(y=an,p=sn);let v=!1;for(const e of y){qe(r[e])?r[e]=v?p[e]:w[e]:v=!0}const S=g?function(e,t=4,s=1){const n=Ae(e.weekYear),r=Ze(e.weekNumber,1,et(e.weekYear,t,s)),a=Ze(e.weekday,1,7);return n?r?!a&&Ce("weekday",e.weekday):Ce("week",e.weekNumber):Ce("weekYear",e.weekYear)}(r,a,i):u?function(e){const t=Ae(e.year),s=Ze(e.ordinal,1,Ye(e.year));return t?!s&&Ce("ordinal",e.ordinal):Ce("year",e.year)}(r):$e(r),b=S||Fe(r);if(b)return gn.invalid(b);const k=g?Ie(r,a,i):u?Oe(r):r,[C,T]=Ys(k,c,s),x=new gn({ts:C,zone:s,o:T,loc:n});return r.weekday&&m&&e.weekday!==x.weekday?gn.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${x.toISO()}`):x.isValid?x:gn.invalid(x.invalid)}static fromISO(e,t={}){const[s,n]=function(e){return Dt(e,[Xt,ns],[es,rs],[ts,as],[ss,is])}(e);return Qs(s,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[s,n]=function(e){return Dt(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[jt,Bt])}(e);return Qs(s,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[s,n]=function(e){return Dt(e,[Jt,Kt],[Gt,Kt],[Yt,Qt])}(e);return Qs(s,n,t,"HTTP",t)}static fromFormat(e,t,s={}){if(qe(e)||qe(t))throw new c("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:r=null}=s,a=te.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[i,o,l,u]=function(e,t,s){const{result:n,zone:r,specificOffset:a,invalidReason:i}=Ps(e,t,s);return[n,r,a,i]}(a,e,t);return u?gn.invalid(u):Qs(i,o,s,`format ${t}`,e,l)}static fromString(e,t,s={}){return gn.fromFormat(e,t,s)}static fromSQL(e,t={}){const[s,n]=function(e){return Dt(e,[ls,ns],[cs,us])}(e);return Qs(s,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new c("need to specify a reason the DateTime is invalid");const s=e instanceof Se?e:new Se(e,t);if(ve.throwOnInvalid)throw new r(s);return new gn({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const s=_s(e,te.fromObject(t));return s?s.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return Vs(Ct.parseFormat(e),te.fromObject(t)).map((e=>e.val)).join("")}static resetCache(){mn=void 0,fn={}}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Rs(this).weekYear:NaN}get weekNumber(){return this.isValid?Rs(this).weekNumber:NaN}get weekday(){return this.isValid?Rs(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?js(this).weekday:NaN}get localWeekNumber(){return this.isValid?js(this).weekNumber:NaN}get localWeekYear(){return this.isValid?js(this).weekYear:NaN}get ordinal(){return this.isValid?Ne(this.c).ordinal:NaN}get monthShort(){return this.isValid?xs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?xs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?xs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?xs.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,s=Qe(this.c),n=this.zone.offset(s-e),r=this.zone.offset(s+e),a=this.zone.offset(s-n*t),i=this.zone.offset(s-r*t);if(a===i)return[this];const o=s-a*t,l=s-i*t,c=Gs(o,a),u=Gs(l,i);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Bs(this,{ts:o}),Bs(this,{ts:l})]:[this]}get isInLeapYear(){return Ge(this.year)}get daysInMonth(){return Ke(this.year,this.month)}get daysInYear(){return this.isValid?Ye(this.year):NaN}get weeksInWeekYear(){return this.isValid?et(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?et(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:s,calendar:n}=Ct.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:s,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(ne.instance(e),t)}toLocal(){return this.setZone(ve.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:s=!1}={}){if((e=ae(e,ve.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||s){const t=e.offset(this.ts),s=this.toObject();[n]=Ys(s,t,e)}return Bs(this,{ts:n,zone:e})}return gn.invalid(Us(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:s}={}){return Bs(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:s})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=at(e,cn),{minDaysInFirstWeek:s,startOfWeek:n}=Ee(t,this.loc),r=!qe(t.weekYear)||!qe(t.weekNumber)||!qe(t.weekday),a=!qe(t.ordinal),i=!qe(t.year),l=!qe(t.month)||!qe(t.day),c=i||l,u=t.weekYear||t.weekNumber;if((c||a)&&u)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&a)throw new o("Can't mix ordinal dates with month/day");let d;r?d=Ie({...Me(this.c,s,n),...t},s,n):qe(t.ordinal)?(d={...this.toObject(),...t},qe(t.day)&&(d.day=Math.min(Ke(d.year,d.month),d.day))):d=Oe({...Ne(this.c),...t});const[h,m]=Ys(d,this.o,this.zone);return Bs(this,{ts:h,o:m})}plus(e){if(!this.isValid)return this;return Bs(this,Ks(this,ks.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Bs(this,Ks(this,ks.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const s={},n=ks.normalizeUnit(e);switch(n){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;tthis.valueOf(),i=Ds(a?this:e,a?e:this,r,n);var o;return a?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(gn.now(),e,t)}until(e){return this.isValid?Ts.fromDateTimes(this,e):this}hasSame(e,t,s){if(!this.isValid)return!1;const n=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t,s)<=n&&n<=r.endOf(t,s)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||gn.fromObject({},{zone:this.zone}),s=e.padding?thise.valueOf()),Math.min)}static max(...e){if(!e.every(gn.isDateTime))throw new c("max requires all arguments be DateTimes");return Pe(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,s={}){const{locale:n=null,numberingSystem:r=null}=s;return Ps(te.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,s={}){return gn.fromFormatExplain(e,t,s)}static buildFormatParser(e,t={}){const{locale:s=null,numberingSystem:n=null}=t,r=te.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});return new Hs(r,e)}static fromFormatParser(e,t,s={}){if(qe(e)||qe(t))throw new c("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:r=null}=s,a=te.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});if(!a.equals(t.locale))throw new c(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`);const{result:i,zone:o,specificOffset:l,invalidReason:u}=t.explainFromTokens(e);return u?gn.invalid(u):Qs(i,o,s,`format ${t.format}`,e,l)}static get DATE_SHORT(){return f}static get DATE_MED(){return g}static get DATE_MED_WITH_WEEKDAY(){return y}static get DATE_FULL(){return p}static get DATE_HUGE(){return w}static get TIME_SIMPLE(){return v}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return b}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return C}static get TIME_24_WITH_SECONDS(){return T}static get TIME_24_WITH_SHORT_OFFSET(){return x}static get TIME_24_WITH_LONG_OFFSET(){return L}static get DATETIME_SHORT(){return D}static get DATETIME_SHORT_WITH_SECONDS(){return M}static get DATETIME_MED(){return I}static get DATETIME_MED_WITH_SECONDS(){return N}static get DATETIME_MED_WITH_WEEKDAY(){return O}static get DATETIME_FULL(){return E}static get DATETIME_FULL_WITH_SECONDS(){return $}static get DATETIME_HUGE(){return F}static get DATETIME_HUGE_WITH_SECONDS(){return q}}function yn(e){if(gn.isDateTime(e))return e;if(e&&e.valueOf&&We(e.valueOf()))return gn.fromJSDate(e);if(e&&"object"==typeof e)return gn.fromObject(e);throw new c(`Unknown datetime argument: ${e}, of type ${typeof e}`)}},147:(e,t,s)=>{s.d(t,{O:()=>n});const n=e=>{let t=e;return t=t.replace("https://api.weather.gov/",`${window.location.protocol}//${window.location.host}/`),t=t.replace("https://www.cpc.ncep.noaa.gov/",`${window.location.protocol}//${window.location.host}/`),t}},187:(e,t,s)=>{var n=s(592),r=s(519),a=s(440),i=s(413),o=s(716),l=s(47),c=s(125),u=s(24),d=s(211);const h=(e,t,s)=>({daytime:e.isDaytime,temperature:e.temperature||0,name:v(t.city),icon:e.icon,x:s.x,y:s.y,time:e.startTime}),m=(e,t,s,n)=>{let r=0,a=0;return r=56*(73-e),r-=n,r>1142-2*n?r=1142-2*n:r<0&&(r=0),a=25*(-175-t)*-1,a-=s,a>1200-2*s?a=1200-2*s:a<0&&(a=0),{x:a,y:r}},f=(e,t,s,n)=>{let r=0,a=0;return r=55.2*(25-e),r-=n,r>571-2*n?r=571-2*n:r<0&&(r=0),a=41.775*(-164.5-t)*-1,a-=s,a>600-2*s?a=600-2*s:a<0&&(a=0),{x:a,y:r}},g=(e,t,s,n)=>({minLat:-1*((t+2*n)/56-73),maxLat:-1*(t/56-73),minLon:-1*(-1*e/25+175),maxLon:-1*(-1*(e+2*s)/25+175)}),y=(e,t,s,n)=>({minLat:-1*((t+2*n)/55.2-25),maxLat:-1*(t/55.2-25),minLon:-1*(-1*e/41.775+164.5),maxLon:-1*(-1*(e+2*s)/41.775+164.5)}),p=(e,t,s)=>{let n=37*(e.lon-s),r=70*(t-e.lat);return r<30&&(r=30),r>282&&(r=282),n<40&&(n=40),n>580&&(n=580),{x:n,y:r}},w=(e,t,s)=>{let n=57*(e.lon-s),r=70*(t-e.lat);return r<30&&(r=30),r>282&&(r=282),n<40&&(n=40),n>580&&(n=580),{x:n,y:r}},v=e=>e.match(/[^,/;\\-]*/)[0].substr(0,12);var S=s(348);class b extends u.A{constructor(e,t){super(e,t,"Regional Forecast",!0),this.timing.totalScreens=3}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let s="images/Basemap2.png";"HI"===t.state?s="images/HawaiiRadarMap4.png":"AK"===t.state&&(s="images/AlaskaRadarMap6.png"),this.elem.querySelector(".map img").src=s;const c={x:240,y:117},u=((e,t,s,n,r)=>{if("AK"===r)return m(e,t,s,n);if("HI"===r)return f(e,t,s,n);let a=0,i=0;return a=55.2*(50.5-e),a-=n,a>1600-2*n?a=1600-2*n:a<0&&(a=0),i=41.775*(-127.5-t)*-1,i-=s,i>2550-2*s?i=2550-2*s:i<0&&(i=0),{x:i,y:a}})(t.latitude,t.longitude,c.x,c.y,t.state),d=(S=u.x,b=u.y,C=c.x,T=c.y,"AK"===(x=t.state)?g(S,b,C,T):"HI"===x?y(S,b,C,T):{minLat:-1*((b+2*T)/55.2-50.5),maxLat:-1*(b/55.2-50.5),minLon:-1*(-1*S/41.775+127.5),maxLon:-1*(-1*(S+2*C)/41.775+127.5)});var S,b,C,T,x;let L=2.5;"HI"===t.state&&(L=1);const D=Object.values(StationInfo).map((e=>({...e,targetDistance:L}))),M=[...RegionalCities,...D],I=[];M.forEach((e=>{if(e.lat>d.minLat&&e.latd.minLon&&e.lon{const a=(0,r.Io)(e.lon,e.lat,n.lon,n.lat);return s&&a>=t}),!0)&&I.push(e)}}));const N=await Promise.all(I.map((async e=>{try{const s=e?.point??await k(e.lat,e.lon);if(!s)throw new Error("No pre-loaded point");const n=(async(e,t)=>{try{const t=(await(0,a.Pq)(`https://api.weather.gov/gridpoints/${e.wfo}/${e.x},${e.y}/stations`)).features[0].id,s=await(0,a.Pq)(`${t}/observations/latest`);if(!s.properties.icon)return!1;const n=(0,o.Wu)(s.properties.icon,!s.properties.daytime);return!!n&&((0,l.b)(n),s.properties)}catch(e){return console.log(`Unable to get regional observations for ${t.Name??t.city}`),console.error(e.status,e.responseJSON),!1}})(s,e),r=await(0,a.Pq)(`https://api.weather.gov/gridpoints/${s.wfo}/${s.x},${s.y}/forecast`),c=((e,t,s,n)=>{"AK"===n&&p(e,t,s),"HI"===n&&w(e,t,s);let r=57*(e.lon-s),a=70*(t-e.lat);return a<30&&(a=30),a>282&&(a=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:a}})(e,d.maxLat,d.minLon,t.state),u=await n;if(!u)return!1;const m={daytime:!!/\/day\//.test(u.icon),temperature:(0,i.sz)(u.temperature.value),name:v(e.city),icon:u.icon,x:c.x,y:c.y};return(0,l.b)((0,o.Wu)(m.icon,!m.daytime)),[m,h(r.properties.periods[1],e,c),h(r.properties.periods[2],e,c)]}catch(t){return console.log(`No regional forecast data for '${e.name??e.city}'`),console.log(t),!1}}))),O=N.filter((e=>e));0!==O.length?(this.data={regionalData:O,offsetXY:c,sourceXY:u},this.setStatus(n.Ay.loaded)):this.setStatus(n.Ay.noData)}drawCanvas(){super.drawCanvas();const{regionalData:e,sourceXY:t,offsetXY:s}=this.data,n=this.elem.querySelector(".title.dual .top"),r=this.elem.querySelector(".title.dual .bottom");if(0===this.screenIndex)n.innerHTML="Regional",r.innerHTML="Observations";else{const t=c.c9.fromISO(e[0][this.screenIndex].time).toLocaleString({weekday:"long"});n.innerHTML="Forecast for",r.innerHTML=e[0][this.screenIndex].daytime?t:`${t} Night`}const a=640/(2*s.x);this.elem.querySelector(".map").style.transform=`scale(${a}) translate(-${t.x}px, -${t.y}px)`;const i=e.map((e=>{const t={},s=e[this.screenIndex];t.icon={type:"img",src:(0,o.Wu)(s.icon,!s.daytime)},t.city=s.name;const{temperature:n}=s;t.temp=n;const{x:r,y:a}=s,i=this.fillTemplate("location",t);return i.style.left=`${r}px`,i.style.top=`${a}px`,i})),l=this.elem.querySelector(".location-container");l.innerHTML="",l.append(...i),this.finishDraw()}}const k=async(e,t)=>{const s=await(0,S.f)(e,t);return{x:s.properties.gridX,y:s.properties.gridY,wfo:s.properties.gridId}};(0,d.Kb)(new b(6,"regional-forecast"))},211:(e,t,s)=>{s.d(t,{F4:()=>k,Fx:()=>R,Ju:()=>T,K$:()=>z,Kb:()=>F,Lg:()=>W,XR:()=>E,ab:()=>C,eB:()=>j,iU:()=>w,kY:()=>$,pv:()=>O,q:()=>M,u6:()=>P,yB:()=>v});var n=s(430),r=s(592),a=s(519),i=s(440),o=s(348),l=s(302);document.addEventListener("DOMContentLoaded",(()=>{p()}));const c=[];let u,d=!1;const h={},m=6e5,f="#chkAutoRefresh";let g=null,y=0;const p=async()=>{window.addEventListener("resize",E),E();const e=localStorage.getItem("autoRefresh");document.querySelector(f).checked=!e||"true"===e,document.querySelector(f).addEventListener("change",V),q()},w=e=>!!e.type&&("navButton"===e.type?N(e.message):console.error(`Unknown event ${e.type}`)),v=e=>{if(e.id<0)return;if(!u)return;if(u.drawCanvas(c,S()),c[0].status===r.Ay.loading)return;const t=c.findIndex((e=>e.enabled&&e.timing.totalScreens>0));0!==e.id||e.status!==r.Ay.failed&&e.status!==r.Ay.retrying||(e.id=t,e.status=c[t].status),0===e.id&&e.status===r.Ay.loaded&&0===c[0].timing.totalScreens&&(e.id=t,e.status=c[t].status),k()&&e.id===t&&e.status===r.Ay.loaded&&x(C.command.firstFrame),S()c.reduce(((e,t)=>t.status!==r.Ay.loading?e+1:e),0),b=()=>{c.forEach((e=>e.hideCanvas()))},k=()=>d,C={response:{previous:Symbol("previous"),inProgress:Symbol("inProgress"),next:Symbol("next")},command:{firstFrame:Symbol("firstFrame"),previousFrame:Symbol("previousFrame"),nextFrame:Symbol("nextFrame"),lastFrame:Symbol("lastFrame")}},T=e=>{e.type===C.response.previous&&L(-1),e.type===C.response.next&&L(1)},x=e=>{const t=M();if(u.hideCanvas(),!t){let e,t=0;do{c[t].status===r.Ay.loaded&&c[t].timing.totalScreens>0&&(e=c[t]),t+=1}while(!e&&t{const t=c.length,s=D();let n;for(let i=0;i0));i+=1);if(n<=s&&Z())return;const i=c[n];b(),e<0&&i.showCanvas(C.command.lastFrame),e>0&&i.showCanvas(C.command.firstFrame)},D=()=>c.findIndex((e=>e.active)),M=()=>c[D()],I=e=>{d=e;const t=document.querySelector("#NavigatePlay");localStorage.setItem("play",d),d?((0,n.A)(!0),t.title="Pause",t.src="images/nav/ic_pause_white_24dp_2x.png"):((0,n.A)(!1),t.title="Play",t.src="images/nav/ic_play_arrow_white_24dp_2x.png"),u&&d&&!M()&&x(C.command.firstFrame)},N=e=>{switch(e){case"play":I(!0);break;case"playToggle":I(!d);break;case"stop":I(!1);break;case"next":I(!1),x(C.command.nextFrame);break;case"previous":I(!1),x(C.command.previousFrame);break;case"menu":I(!1),u.showCanvas(),b();break;default:console.error(`Unknown navButton ${e}`)}},O=e=>c[e],E=()=>{const e=l.A.wide.value?854:640,t=document.querySelector("#divTwcBottom").getBoundingClientRect().width/e,s=window.innerHeight/480,n=Math.min(t,s);n<1||document.fullscreenElement||l.A.kiosk?document.querySelector("#container").style.transform=`scale(${n})`:document.querySelector("#container").style.transform="unset"},$=()=>{c.forEach((e=>{e.status=r.Ay.loading}))},F=e=>{c[e.navId]=e,q()},q=()=>{const e=document.querySelector("#enabledDisplays");if(!e)return;const t=c.map((e=>e.generateCheckbox(e.defaultEnabled))).filter((e=>e));e.innerHTML="",e.append(...t)},W=e=>{u=e},A=e=>{document.querySelector("#spanCity").innerHTML=`${e.city}, `,document.querySelector("#spanState").innerHTML=e.state,document.querySelector("#spanStationId").innerHTML=e.stationId,document.querySelector("#spanRadarId").innerHTML=e.radarId,document.querySelector("#spanZoneId").innerHTML=e.zoneId},V=e=>{const{checked:t}=e.target;t?_():z(),localStorage.setItem("autoRefresh",t)},H=e=>{e?(document.querySelector("#spanLastRefresh").innerHTML=e.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}),document.querySelector(f).checked&&_()):document.querySelector("#spanLastRefresh").innerHTML="(none)"},P=(e,t)=>{(async(e,t)=>{const s=await(0,o.f)(e.lat,e.lon);"function"==typeof t&&t(s);const n=await(0,i.Pq)(s.properties.observationStations),r=n.features[0].properties.stationIdentifier;let{city:a}=s.properties.relativeLocation.properties;const{state:l}=s.properties.relativeLocation.properties;r in StationInfo&&(a=StationInfo[r].city,[a]=a.split("/"),a=a.replace(/\s+$/,"")),h.latitude=e.lat,h.longitude=e.lon,h.zoneId=s.properties.forecastZone.substr(-6),h.radarId=s.properties.radarStation.substr(-3),h.stationId=r,h.weatherOffice=s.properties.cwa,h.city=a,h.state=l,h.timeZone=s.properties.timeZone,h.forecast=s.properties.forecast,h.forecastGridData=s.properties.forecastGridData,h.stations=n.features,A(h),b(),document.querySelector("#loading").style.display="none",u&&(await u.drawCanvas(),u.showCanvas()),c.forEach((e=>e.getData(h)))})(e,t),H(null)},_=()=>{if(g)return;y=0;const e=()=>{y+=500;let e=m-y;e<0&&(e=0);const t=new Date(e);document.querySelector("#spanRefreshCountDown").innerHTML=`${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}`,y>=m&&!k()&&U()};g=window.setInterval(e,500),e()},z=()=>{g&&(window.clearInterval(g),document.querySelector("#spanRefreshCountDown").innerHTML="--:--",g=null)},Z=()=>!!(y>=m&&k())&&(U(),!0),U=()=>{U.callback&&U.callback()},R=e=>{U.callback=e},j=()=>h.timeZone},247:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(47),r=s(125),a=s(592),i=s(24),o=s(211);class l extends i.A{constructor(e,t){super(e,t,"Almanac",!0),this.backgroundImage0=(0,n.u)("images/BackGround3_1.png"),(0,n.b)("images/2/Full-Moon.gif"),(0,n.b)("images/2/Last-Quarter.gif"),(0,n.b)("images/2/New-Moon.gif"),(0,n.b)("images/2/First-Quarter.gif"),this.timing.totalScreens=1}async getData(e){const t=super.getData(e),s=e??this.weatherParameters,{sun:n,moon:r}=this.calcSunMoonData(s);this.data={sun:n,moon:r},this.getDataCallback(),t&&this.setStatus(a.Ay.loaded)}calcSunMoonData(e){const t=[SunCalc.getTimes(new Date,e.latitude,e.longitude),SunCalc.getTimes(r.c9.local().plus({days:1}).toJSDate(),e.latitude,e.longitude)],s=[];let n=r.c9.local().minus({days:1}),{phase:a}=SunCalc.getMoonIllumination(n.toJSDate()),i=0;do{const e=a;n=n.plus({days:1}),a=SunCalc.getMoonIllumination(n.toJSDate()).phase,e<.25&&a>=.25&&s.push(this.getMoonTransition(.25,"First",n)),e<.5&&a>=.5&&s.push(this.getMoonTransition(.5,"Full",n)),e<.75&&a>=.75&&s.push(this.getMoonTransition(.75,"Last",n)),e>a&&s.push(this.getMoonTransition(0,"New",n)),i+=1}while(i<=30&&s.length<4);return{sun:t,moon:s}}getMoonTransition(e,t,s,n=0){let r=s,{phase:a}=SunCalc.getMoonIllumination(r.toJSDate()),i=0;const o={hours:0===n?-1:0,minutes:1===n?1:0,seconds:2===n?-1:0,milliseconds:3===n?1:0};let l=(t,s)=>t=e;n%2==0&&(l=(t,s)=>t>e&&s<=e);do{const s=a;if(r=r.plus(o),a=SunCalc.getMoonIllumination(r.toJSDate()).phase,a>.9&&(a-=1),l(s,a)){if(n>=3)break;return this.getMoonTransition(e,t,r,n+1)}i+=1}while(i<1e3);return{phase:t,date:r}}async drawCanvas(){super.drawCanvas();const e=this.data,t=r.c9.local(),s=t.plus({days:1});this.elem.querySelector(".day-1").innerHTML=t.toLocaleString({weekday:"long"}),this.elem.querySelector(".day-2").innerHTML=s.toLocaleString({weekday:"long"}),this.elem.querySelector(".rise-1").innerHTML=r.c9.fromJSDate(e.sun[0].sunrise).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".rise-2").innerHTML=r.c9.fromJSDate(e.sun[1].sunrise).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-1").innerHTML=r.c9.fromJSDate(e.sun[0].sunset).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-2").innerHTML=r.c9.fromJSDate(e.sun[1].sunset).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase();const n=e.moon.map((e=>{const t={},s=e.date.toLocaleString({month:"short",day:"numeric"});return t.date=s,t.type=e.phase,t.icon={type:"img",src:c(e.phase)},this.fillTemplate("day",t)})),a=this.elem.querySelector(".moon .days");a.innerHTML="",a.append(...n),this.finishDraw()}async getSun(){return new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push(e)}))}}const c=e=>{switch(e){case"Full":return"images/2/Full-Moon.gif";case"Last":return"images/2/Last-Quarter.gif";case"New":return"images/2/New-Moon.gif";default:return"images/2/First-Quarter.gif"}},u=new l(9,"almanac");(0,o.Kb)(u);const d=u.getSun.bind(u)},302:(e,t,s)=>{s.d(t,{A:()=>u});var n=s(999);const r="Settings";const a=class{constructor(e,t,s,r,a,i,o){this.shortName=e,this.name=t,this.defaultValue=r,this.myValue=r,this.type=s??"checkbox",this.sticky=i,this.values=o,this.changeAction=a??(()=>{});const l=(0,n.J)()?.[`settings-${e}-${s}`];let c;"checkbox"===s&&void 0!==l&&(c="true"===l),"select"===s&&void 0!==l&&(c=parseFloat(l));const u=c??this.getFromLocalStorage();if(i&&null!==u&&(this.myValue=u),"select"===s)this.selectChange({target:{value:this.myValue}});else this.checkboxChange({target:{checked:this.myValue}})}generateSelect(){const e=document.createElement("label");e.for=`settings-${this.shortName}-select`,e.id=`settings-${this.shortName}-label`;const t=document.createElement("span");t.innerHTML=`${this.name} `,e.append(t);const s=document.createElement("select");return s.id=`settings-${this.shortName}-select`,s.name=`settings-${this.shortName}-select`,s.addEventListener("change",(e=>this.selectChange(e))),this.values.forEach((([e,t])=>{const n=document.createElement("option");n.value=e.toFixed(2),n.innerHTML=t,s.append(n)})),e.append(s),this.element=e,this.selectHighlight(this.myValue),e}generateCheckbox(){const e=document.createElement("label");e.for=`settings-${this.shortName}-checkbox`,e.id=`settings-${this.shortName}-label`;const t=document.createElement("input");t.type="checkbox",t.value=!0,t.id=`settings-${this.shortName}-checkbox`,t.name=`settings-${this.shortName}-checkbox`,t.checked=this.myValue,t.addEventListener("change",(e=>this.checkboxChange(e)));const s=document.createElement("span");return s.innerHTML=this.name,e.append(t,s),this.element=e,e}checkboxChange(e){this.myValue=e.target.checked,this.storeToLocalStorage(this.myValue),this.changeAction(this.myValue)}selectChange(e){this.myValue=parseFloat(e.target.value),this.storeToLocalStorage(this.myValue),this.changeAction(this.myValue)}storeToLocalStorage(e){if(!this.sticky)return;const t=localStorage?.getItem(r)??"{}",s=JSON.parse(t);s[this.shortName]=e,localStorage?.setItem(r,JSON.stringify(s))}getFromLocalStorage(){const e=localStorage?.getItem(r);try{if(e){const t=JSON.parse(e)?.[this.shortName];if(void 0!==t)switch(this.type){case"boolean":case"select":return t;default:return null}}}catch{return null}return null}get value(){return this.myValue}set value(e){if(this.myValue=e,"select"===this.type)this.selectHighlight(e);else this.element.checked=e;this.storeToLocalStorage(this.myValue),this.changeAction(this.myValue)}selectHighlight(e){this.element.querySelectorAll("option").forEach((t=>{t.selected=e.toFixed(2)===t.value}))}generate(){return"select"===this.type?this.generateSelect():this.generateCheckbox()}};document.addEventListener("DOMContentLoaded",(()=>{o()}));const i={speed:{value:1}},o=()=>{i.wide=new a("wide","Widescreen","checkbox",!1,l,!0),i.kiosk=new a("kiosk","Kiosk","boolean",!1,c,!1),i.speed=new a("speed","Speed","select",1,null,!0,[[.5,"Very Fast"],[.75,"Fast"],[1,"Normal"],[1.25,"Slow"],[1.5,"Very Slow"]]);const e=Object.values(i).map((e=>e.generate())),t=document.querySelector("#settings");t.innerHTML="",t.append(...e)},l=e=>{const t=document.querySelector("#divTwc");e?t.classList.add("wide"):t.classList.remove("wide")},c=e=>{const t=document.querySelector("body");e?(t.classList.add("kiosk"),window.dispatchEvent(new Event("resize"))):t.classList.remove("kiosk")},u=i},348:(e,t,s)=>{s.d(t,{f:()=>r});var n=s(440);const r=async(e,t)=>{try{return await(0,n.Pq)(`https://api.weather.gov/points/${e},${t}`)}catch(s){return console.log(`Unable to get point ${e}, ${t}`),console.error(s),!1}}},413:(e,t,s)=>{s.d(t,{Q8:()=>o,X4:()=>n,Yy:()=>r,lt:()=>i,sz:()=>a,yX:()=>l});const n=(e,t)=>Math.trunc(e*10**t)/10**t,r=e=>Math.round(e/1.60934),a=e=>Math.round(9*e/5+32),i=e=>Math.round(e/1.60934),o=e=>Math.round(e/.3048),l=e=>n(2953e-7*e,2)},423:(e,t,s)=>{s.d(t,{A:()=>p});var n=s(592),r=s(47),a=s(440),i=s(519),o=s(891),l=s(716),c=s(24),u=s(211),d=s(413);const h=["U","C","H","W","Y","T","S","M","O","L","A","F","B","N","V","R","D","E","I","G","J"];class m extends c.A{constructor(e,t){super(e,t,"Current Conditions",!0),this.backgroundImage=(0,r.u)("images/BackGround1_1.png")}async getData(e){const t=super.getData(e),s=(e??this.weatherParameters).stations.filter((e=>4===e?.properties?.stationIdentifier?.length&&!h.includes(e.properties.stationIdentifier.slice(0,1))));let i,o,c=0;for(;!i&&cthis.stillWaiting()}),null===i.features[0].properties.temperature.value||null===i.features[0].properties.windSpeed.value||null===i.features[0].properties.textDescription||""===i.features[0].properties.textDescription||null===i.features[0].properties.icon||null===i.features[0].properties.dewpoint.value||null===i.features[0].properties.barometricPressure.value)throw i=void 0,new Error(`Unable to get observations: ${o.properties.stationIdentifier}, trying next station`)}catch(e){console.error(e)}}if(!i)return console.error("All current weather stations exhausted"),this.isEnabled&&this.setStatus(n.Ay.failed),void this.getDataCallback(void 0);this.data=g({...i,station:o}),this.getDataCallback(),t&&((0,r.b)((0,l.XV)(i.features[0].properties.icon)),this.setStatus(n.Ay.loaded))}async drawCanvas(){super.drawCanvas();let e=this.data.observations.textDescription;e.length>15&&(e=f(e));const t={temp:this.data.Temperature+String.fromCharCode(176),condition:e,wind:this.data.WindDirection.padEnd(3,"")+this.data.WindSpeed.toString().padStart(3," "),location:(0,o.C)(this.data.station.properties.name).substr(0,20),humidity:`${this.data.Humidity}%`,dewpoint:this.data.DewPoint+String.fromCharCode(176),ceiling:0===this.data.Ceiling?"Unlimited":this.data.Ceiling+this.data.CeilingUnit,visibility:this.data.Visibility+this.data.VisibilityUnit,pressure:`${this.data.Pressure} ${this.data.PressureDirection}`,icon:{type:"img",src:this.data.Icon}};this.data.WindGust&&(t["wind-gusts"]=`Gusts to ${this.data.WindGust}`),this.data.observations.heatIndex.value&&this.data.HeatIndex!==this.data.Temperature?(t["heat-index-label"]="Heat Index:",t["heat-index"]=this.data.HeatIndex+String.fromCharCode(176)):this.data.observations.windChill.value&&""!==this.data.WindChill&&this.data.WindChill{this.data&&e(this.data),this.getDataCallbacks.push((()=>e(this.data)))}))}}const f=e=>{let t=e;return t=t.replace(/Light/g,"L"),t=t.replace(/Heavy/g,"H"),t=t.replace(/Partly/g,"P"),t=t.replace(/Mostly/g,"M"),t=t.replace(/Few/g,"F"),t=t.replace(/Thunderstorm/g,"T'storm"),t=t.replace(/ in /g,""),t=t.replace(/Vicinity/g,""),t=t.replace(/ and /g," "),t=t.replace(/Freezing Rain/g,"Frz Rn"),t=t.replace(/Freezing/g,"Frz"),t=t.replace(/Unknown Precip/g,""),t=t.replace(/L Snow Fog/g,"L Snw/Fog"),t=t.replace(/ with /g,"/"),t},g=e=>{const t=e.features[0].properties;e.observations=t,e.Temperature=Math.round(t.temperature.value),e.TemperatureUnit="C",e.DewPoint=Math.round(t.dewpoint.value),e.Ceiling=Math.round(t.cloudLayers[0]?.base?.value??0),e.CeilingUnit="m.",e.Visibility=Math.round(t.visibility.value/1e3),e.VisibilityUnit=" km.",e.WindSpeed=Math.round(t.windSpeed.value),e.WindDirection=(0,i.Up)(t.windDirection.value),e.Pressure=Math.round(t.barometricPressure.value),e.HeatIndex=Math.round(t.heatIndex.value),e.WindChill=Math.round(t.windChill.value),e.WindGust=Math.round(t.windGust.value),e.WindUnit="KPH",e.Humidity=Math.round(t.relativeHumidity.value),e.Icon=(0,l.XV)(t.icon),e.PressureDirection="",e.TextConditions=t.textDescription;const s=t.barometricPressure.value-e.features[1].properties.barometricPressure.value;return s>150&&(e.PressureDirection="R"),s<-150&&(e.PressureDirection="F"),e.Temperature=(0,d.sz)(e.Temperature),e.TemperatureUnit="F",e.DewPoint=(0,d.sz)(e.DewPoint),e.Ceiling=100*Math.round((0,d.Q8)(e.Ceiling)/100),e.CeilingUnit="ft.",e.Visibility=(0,d.lt)(t.visibility.value/1e3),e.VisibilityUnit=" mi.",e.WindSpeed=(0,d.Yy)(e.WindSpeed),e.WindUnit="MPH",e.Pressure=(0,d.yX)(e.Pressure).toFixed(2),e.HeatIndex=(0,d.sz)(e.HeatIndex),e.WindChill=(0,d.sz)(e.WindChill),e.WindGust=(0,d.Yy)(e.WindGust),e},y=new m(1,"current-weather");(0,u.Kb)(y);const p=y.getCurrentWeather.bind(y)},430:(e,t,s)=>{s.d(t,{A:()=>a});let n=!1;const r=(e=!1)=>(r.controller||(r.controller=new NoSleep),n!==e&&(n=e,e?r.controller.enable():r.controller.disable())),a=r},440:(e,t,s)=>{s.d(t,{Pq:()=>r,Qq:()=>a,av:()=>i});var n=s(147);const r=(e,t)=>o(e,"json",t),a=(e,t)=>o(e,"text",t),i=(e,t)=>o(e,"blob",t),o=async(e,t,s={})=>{const r={method:"GET",mode:"cors",type:"GET",retryCount:0,...s};r.originalRetries=r.retryCount;let a=e;!0===r.cors&&(a=(0,n.O)(e));const i=new URL(a,`${window.location.origin}/`);r.data&&Object.keys(r.data).forEach((e=>{const t=r.data[e];i.searchParams.append(e,t)}));const o=await l(i,r);if(!o.ok)throw new Error(`Fetch error ${o.status} ${o.statusText} while fetching ${o.url}`);switch(t){case"json":return o.json();case"text":return o.text();case"blob":return o.blob();default:return o}},l=(e,t)=>new Promise(((s,n)=>{fetch(e,t).then((n=>{if(t.retryCount>0){if(n.status>=500&&n.status<=599&&t.retryCount>0){"function"==typeof t.stillWaiting&&t.retryCount===t.originalRetries&&t.stillWaiting();const n={...t,retryCount:t.retryCount-1};return s(c(u(t.originalRetries-n.retryCount),l,e,n))}return s(n)}return s(n)})).catch((e=>n(e)))})),c=(e,t,...s)=>new Promise((n=>{setTimeout((()=>{n(t(...s))}),e)})),u=e=>{switch(e){case 1:return 1e3;case 2:return 2e3;case 3:return 5e3;case 4:return 1e4;default:return 3e4}}},498:(e,t,s)=>{var n=s(592),r=s(440),a=s(125),i=s(716),o=s(47),l=s(24),c=s(211);class u extends l.A{constructor(e,t){super(e,t,"Extended Forecast",!0),this.timing.totalScreens=2}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let s;try{s=await(0,r.Pq)(t.forecast,{data:{units:"us"},retryCount:3,stillWaiting:()=>this.stillWaiting()})}catch(e){return console.error("Unable to get extended forecast"),console.error(e.status,e.responseJSON),void this.setStatus(n.Ay.failed)}this.data=d(s.properties.periods),this.screenIndex=0,this.setStatus(n.Ay.loaded)}async drawCanvas(){super.drawCanvas();const e=this.data.slice(0+3*this.screenIndex,3+3*this.screenIndex).map((e=>{const t={icon:{type:"img",src:e.icon},condition:e.text,date:e.dayName},{low:s}=e;void 0!==s&&(t["value-lo"]=Math.round(s));const{high:n}=e;return t["value-hi"]=Math.round(n),this.fillTemplate("day",t)})),t=this.elem.querySelector(".day-container");t.innerHTML="",t.append(...e),this.finishDraw()}}const d=e=>{const t=[0,1,2,3,4,5,6].map((e=>a.c9.local().startOf("day").plus({days:e}).toLocaleString({weekday:"short"})));let s=0;const n=[];return e.forEach((e=>{n[s]||n.push({dayName:"",low:void 0,high:void 0,text:void 0,icon:void 0});const r=n[s];r.icon=(0,i.XV)(e.icon),r.text=h(e.shortForecast),r.dayName=t[s],(0,o.b)(r.icon),e.isDaytime?(r.high=e.temperature,s+=1):r.low=e.temperature})),n},h=e=>{const t=[[/ and /gi," "],[/slight /gi,""],[/chance /gi,""],[/very /gi,""],[/patchy /gi,""],[/areas /gi,""],[/dense /gi,""],[/Thunderstorm/g,"T'Storm"]].reduce(((e,[t,s])=>e.replace(t,s)),e);let s=t.split(" ");-1!==t.indexOf("then")&&(s=t.split(" then "),s=s[1].split(" "));let n=s[0].substr(0,10),r="";s[1]&&(n.endsWith(".")?n=n.replace(/\./,""):r=s[1].substr(0,10),"Blowing"===r&&(r=""));let a=n;return""!==r&&(a+=` ${r}`),a};(0,c.Kb)(new u(8,"extended-forecast"))},503:(e,t,s)=>{var n=s(592),r=s(125),a=s(47),i=s(440),o=s(147),l=s(24),c=s(211);class u extends l.A{constructor(e,t){super(e,t,"Local Radar",!0),this.okToDrawCurrentConditions=!1,this.okToDrawCurrentDateTime=!1,this.dopplerRadarImageMax=6,this.timing.baseDelay=350,this.timing.delay=[{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:12,si:5}]}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;if("AK"===t.state||"HI"===t.state)return void this.setStatus(n.Ay.noData);let s="images/4000RadarMap2.jpg";"HI"===t.State&&(s="images/HawaiiRadarMap2.png"),this.baseMap=await(0,a.u)(s);const l=[];let u=r.c9.utc().minus({days:1}).startOf("day");for(;u<=r.c9.utc().startOf("day");)l.push(`https://mesonet.agron.iastate.edu/archive/data/${u.toFormat("yyyy/LL/dd")}/GIS/uscomp/`),u=u.plus({days:1});const d=(await Promise.all(l.map((async e=>{try{return(0,i.Qq)(e,{cors:!0})}catch(e){return console.log("Unable to get list of radars"),console.error(e),this.setStatus(n.Ay.failed),!1}})))).filter((e=>e)).flatMap(((e,t)=>{const s=(new DOMParser).parseFromString(e,"text/html"),n=s.createElement("base");n.href=l[t],s.head.append(n);const r=s.querySelectorAll("a"),a=[];return Array.from(r).forEach((e=>{e.innerHTML?.match(/n0r_\d{12}\.png/)&&a.push(e.href)})),a})),h=/_(\d{12})\.png/,m=d.sort(((e,t)=>e.match(h)[1]{let n=0,r=0;return n=55.2*(51.75-e.latitude),n-=s,n>3200-2*s?n=3200-2*s:n<0&&(n=0),r=41.775*(-130.37-e.longitude)*-1,r-=t,r>5100-2*t?r=5100-2*t:r<0&&(r=0),{x:2*r,y:2*n}})(t,240,138),w=document.createElement("canvas");w.width=y,w.height=1600;const v=w.getContext("2d");v.imageSmoothingEnabled=!1;const S=((e,t,s)=>{let n=0,r=0;return n=61.4481*(51-e.latitude),n-=s,n>6e3-2*s?n=6e3-2*s:n<0&&(n=0),r=42.1768*(-129.138-e.longitude)*-1,r-=t,r>2800-2*t?r=2800-2*t:r<0&&(r=0),{x:2*r,y:2*n}})(t,240,138),b=S.x/2,k=S.y/2,C=await Promise.all(m.map((async e=>{const t=document.createElement("canvas");t.width=640,t.height=367;const s=t.getContext("2d");s.imageSmoothingEnabled=!1;const n=await fetch((0,o.O)(e));if(!n.ok)throw new Error(`Unable to fetch radar error ${n.status} ${n.statusText} from ${n.url}`);const i=await n.blob(),l=e.match(/_(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)\./);let u;if(l){const[,e,t,s,n,a]=l;u=r.c9.fromObject({year:e,month:t,day:s,hour:n,minute:a},{zone:"UTC"}).setZone((0,c.eB)())}else u=r.c9.fromHTTP(n.headers.get("last-modified")).setZone((0,c.eB)());const d=await(0,a.u)(i);v.clearRect(0,0,y,1600),v.drawImage(d,0,0,y,1600),s.drawImage(await this.baseMap,p.x,p.y,480,276,0,0,640,367);const h=document.createElement("canvas");h.width=640,h.height=367;const m=h.getContext("2d",{willReadFrequently:!0});m.imageSmoothingEnabled=!1,m.drawImage(w,b,k,240,163.1,0,0,640,367),(e=>{const t=e.getImageData(0,0,e.canvas.width,e.canvas.height);for(let e=0;e{const s=e.getImageData(0,0,e.canvas.width,e.canvas.height),n=t.getImageData(0,0,t.canvas.width,t.canvas.height);for(let e=0;ee.elem))),this.timing.totalScreens=C.length,this.data=C.map((e=>e.canvas)),this.times=C.map((e=>e.time)),this.setStatus(n.Ay.loaded)}async drawCanvas(){super.drawCanvas();const e=this.times[this.screenIndex].toLocaleString(r.c9.TIME_SIMPLE),t=e.length>=8?e:` ${e}`;this.elem.querySelector(".header .right .time").innerHTML=t;const s=this.elem.querySelector(".frame").scrollHeight;this.elem.querySelector(".scroll-area").style.top=-this.screenIndex*s+"px",this.finishDraw()}}(0,c.Kb)(new u(10,"radar"))},516:(e,t,s)=>{var n=s(891);var r=s(423),a=s(211);const i=String.fromCharCode(176);let o,l=0;const c=()=>{const e=(0,a.q)();e?.okToDrawCurrentConditions?(l=(l+1)%d.length,u()):"progress"===e?.elemId&&(l=0)},u=async()=>{const e=await(0,r.A)();e&&h(d[l](e))},d=[e=>`Conditions at ${(0,n.C)(e.station.properties.name).substr(0,20)}`,e=>{let t=`Temp: ${e.Temperature}${i}${e.TemperatureUnit}`;return e.observations.heatIndex.value?t+=` Heat Index: ${e.HeatIndex}${i}${e.TemperatureUnit}`:e.observations.windChill.value&&(t+=` Wind Chill: ${e.WindChill}${i}${e.TemperatureUnit}`),t},e=>`Humidity: ${e.Humidity}% Dewpoint: ${e.DewPoint}${i}${e.TemperatureUnit}`,e=>`Barometric Pressure: ${e.Pressure} ${e.PressureDirection}`,e=>{let t=e.WindSpeed>0?`Wind: ${e.WindDirection} ${e.WindSpeed} ${e.WindUnit}`:"Wind: Calm";return e.WindGust>0&&(t+=` Gusts to ${e.WindGust}`),t},e=>{const t=`${e.Ceiling} ${e.CeilingUnit}`;return`Visib: ${e.Visibility} ${e.VisibilityUnit} Ceiling: ${0===e.Ceiling?"Unlimited":t}`}],h=e=>{var t,s;t=".weather-display .scroll .fixed",s=t=>{t.innerHTML=e},[...document.querySelectorAll(t)].forEach(s)};document.addEventListener("DOMContentLoaded",(()=>{o||(o=setInterval(c,4e3)),u()}))},519:(e,t,s)=>{s.d(t,{Io:()=>r,LV:()=>a,Up:()=>n});const n=e=>["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor(e/22.5+.5)%16],r=(e,t,s,n)=>Math.sqrt((s-e)**2+(n-t)**2),a=(e,t)=>(e%t+t)%t},592:(e,t,s)=>{s.d(t,{Ay:()=>i,LR:()=>a,qx:()=>r});const n={loading:Symbol("loading"),loaded:Symbol("loaded"),failed:Symbol("failed"),noData:Symbol("noData"),disabled:Symbol("disabled"),retrying:Symbol("retrying")},r=e=>{switch(e){case n.loading:return"loading";case n.loaded:return"press-here";case n.failed:return"failed";case n.noData:return"no-data";case n.disabled:return"disabled";case n.retrying:return"retrying";default:return""}},a=["loading","press-here","failed","no-data","disabled","retrying"],i=n},652:(e,t,s)=>{var n=s(440),r=s(430),a=s(211),i=s(413),o=s(999),l=s(302);document.addEventListener("DOMContentLoaded",(()=>{m()}));const c=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),u="#txtAddress",d="#ToggleFullScreen",h="#btnGetGps",m=()=>{document.querySelector(u).addEventListener("focus",(e=>{e.target.select()})),(0,a.Fx)(b),document.querySelector("#NavigateMenu").addEventListener("click",S),document.querySelector("#NavigateRefresh").addEventListener("click",C),document.querySelector("#NavigateNext").addEventListener("click",T),document.querySelector("#NavigatePrevious").addEventListener("click",x),document.querySelector("#NavigatePlay").addEventListener("click",I),document.querySelector(d).addEventListener("click",y);const e=document.querySelector(h);e.addEventListener("click",O),navigator.geolocation||(e.style.display="none"),document.querySelector("#divTwc").addEventListener("mousemove",(()=>{document.fullscreenElement&&D()})),window.addEventListener("resize",E),E.wasFull=!1,document.querySelector(u).addEventListener("keydown",(e=>{"Enter"===e.code&&t()})),document.querySelector("#btnGetLatLng").addEventListener("click",(()=>t())),document.addEventListener("keydown",M),document.addEventListener("touchmove",(e=>{document.fullscreenElement&&e.preventDefault()})),$(u).devbridgeAutocomplete({serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest",deferRequestBy:300,paramName:"text",params:{f:"json",countryCode:"USA",category:c,maxSuggestions:10},dataType:"json",transformResult:e=>({suggestions:e.suggestions.map((e=>({value:e.text,data:e.magicKey})))}),minChars:3,showNoSuggestionNotice:!0,noSuggestionNotice:"No results found. Please try a different search string.",onSelect(e){f(e,this)},width:490});const t=()=>{const e=$(u).devbridgeAutocomplete();return e.suggestions[0]&&$(e.suggestionsContainer.children[0]).trigger("click"),!1},s=(0,o.J)(),n=s.latLonQuery&&s.latLon,r=s.latLonQuery??localStorage.getItem("latLonQuery"),i=s.latLon??localStorage.getItem("latLon"),m=localStorage.getItem("latLonFromGPS")&&!n;if(r&&i&&!m){document.querySelector(u).value=r,b(JSON.parse(i))}m&&O(),l.A.kiosk.value="true"===s["settings-kiosk-checkbox"];const g=s["settings-kiosk-checkbox"]??localStorage.getItem("play");null!==g&&"true"!==g||N("navButton","play"),document.querySelector("#btnClearQuery").addEventListener("click",(()=>{document.querySelector("#spanCity").innerHTML="",document.querySelector("#spanState").innerHTML="",document.querySelector("#spanStationId").innerHTML="",document.querySelector("#spanRadarId").innerHTML="",document.querySelector("#spanZoneId").innerHTML="",document.querySelector("#chkAutoRefresh").checked=!0,localStorage.removeItem("autoRefresh"),localStorage.removeItem("play"),N("navButton","play"),localStorage.removeItem("latLonQuery"),localStorage.removeItem("latLon"),localStorage.removeItem("latLonFromGPS"),document.querySelector(h).classList.remove("active")})),document.querySelector("#container").addEventListener("swiped-left",(()=>k("left"))),document.querySelector("#container").addEventListener("swiped-right",(()=>k("right")))},f=async(e,t)=>{if(t.previousSuggestionValue===e.value)return;const s=(await(0,n.Pq)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:e.value,magicKey:e.data,f:"json"}})).locations[0];s?(localStorage.removeItem("latLonFromGPS"),document.querySelector(h).classList.remove("active"),g(s.feature.geometry)):console.error("An unexpected error occurred. Please try a different search string.")},g=(e,t)=>{const s={lat:(0,i.X4)(e.y,4),lon:(0,i.X4)(e.x,4)};localStorage.setItem("latLonQuery",document.querySelector(u).value),localStorage.setItem("latLon",JSON.stringify(s)),b(s,t)},y=()=>(document.fullscreenElement?w():p(),(0,a.F4)()?(0,r.A)(!0):(0,r.A)(!1),D(),!1),p=()=>{const e=document.querySelector("#divTwc"),t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t?t.call(e,{navigationUI:"hide"}):window.scrollTo(0,0),(0,a.XR)(),D();const s=document.querySelector(d);s.src="images/nav/ic_fullscreen_exit_white_24dp_2x.png",s.title="Exit fullscreen"},w=()=>{document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),(0,a.XR)(),v()},v=()=>{const e=document.querySelector(d);e.src="images/nav/ic_fullscreen_white_24dp_2x.png",e.title="Enter fullscreen",document.querySelector("#divTwc").classList.remove("no-cursor");const t=document.querySelector("#divTwcBottom");t.classList.remove("hidden"),t.classList.add("visible")},S=()=>(N("navButton","menu"),!1),b=(e,t)=>{e&&(b.latLon=e);const{latLon:s}=b;s&&(document.querySelector(u).blur(),(0,a.K$)(),(0,a.u6)(s,t))},k=e=>{if("left"===e)T();else x()},C=()=>((0,a.kY)(),b(),!1),T=()=>(N("navButton","next"),!1),x=()=>(N("navButton","previous"),!1);let L=null;const D=()=>{document.activeElement.blur();const e=document.querySelector("#divTwcBottom");e.classList.remove("hidden"),e.classList.add("visible"),document.querySelector("#divTwc").classList.remove("no-cursor"),L&&(clearTimeout(L),L=null),L=setTimeout((()=>{document.fullscreenElement&&(e.classList.remove("visible"),e.classList.add("hidden"),document.querySelector("#divTwc").classList.add("no-cursor"))}),2e3)},M=e=>{const{key:t}=e;if(document.fullscreenElement||document.activeElement===document.body)switch(t){case" ":return e.preventDefault(),I(),!1;case"ArrowRight":case"PageDown":return e.preventDefault(),T(),!1;case"ArrowLeft":case"PageUp":return e.preventDefault(),x(),!1;case"ArrowUp":return e.preventDefault(),S(),!1;case"0":return C(),!1;case"F":case"f":return y(),!1}return!1},I=()=>(N("navButton","playToggle"),!1),N=(e,t={})=>{(0,a.iU)({type:e,message:t})},O=async()=>{if(!navigator.geolocation)return;const e=document.querySelector(h);if(e.classList.contains("active"))return e.classList.remove("active"),void localStorage.removeItem("latLonFromGPS");e.classList.add("active");const t=await(async()=>new Promise((e=>{navigator.geolocation.getCurrentPosition(e)})))(),{latitude:s,longitude:n}=t.coords,r=document.querySelector(u);r.value=`${(0,i.X4)(s,4)}, ${(0,i.X4)(n,4)}`,g({y:s,x:n},(e=>{const t=e.properties.relativeLocation.properties,a=`${t.city}, ${t.state}`;localStorage.setItem("latLon",JSON.stringify({lat:s,lon:n})),localStorage.setItem("latLonQuery",a),localStorage.setItem("latLonFromGPS",!0),r.value=`${t.city}, ${t.state}`}))},E=()=>{E.wasFull&&!document.fullscreenElement&&v(),!E.wasFull&&document.fullscreenElement,E.wasFull=!!document.fullscreenElement}},704:(e,t,s)=>{var n=s(592),r=s(440),a=s(24),i=s(211);class o extends a.A{constructor(e,t){super(e,t,"Local Forecast",!0),this.timing.baseDelay=5e3}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,s=await this.getRawData(t);if(!s)return void this.setStatus(n.Ay.failed);const r=l(s);this.screenTexts=r.map((e=>{let t=`${e.DayName.toUpperCase()}...`;return t+=e.Text.toUpperCase().replace("..."," "),t}));const a=this.screenTexts.map((e=>this.fillTemplate("forecast",{text:e}))),i=this.elem.querySelector(".forecasts");i.innerHTML="",i.append(...a),this.pageHeight=i.parentNode.scrollHeight,a.forEach((e=>{const t=Math.ceil(e.scrollHeight/this.pageHeight)*this.pageHeight;e.style.height=`${t}px`})),this.timing.totalScreens=i.scrollHeight/this.pageHeight,this.calcNavTiming(),this.setStatus(n.Ay.loaded)}async getRawData(e){try{return await(0,r.Pq)(e.forecast,{data:{units:"us"},retryCount:3,stillWaiting:()=>this.stillWaiting()})}catch(t){return console.error(`GetWeatherForecast failed: ${e.forecast}`),console.error(t.status,t.responseJSON),this.setStatus(n.Ay.failed),!1}}async drawCanvas(){super.drawCanvas();const e=-this.screenIndex*this.pageHeight;this.elem.querySelector(".forecasts").style.top=`${e}px`,this.finishDraw()}}const l=e=>e.properties.periods.slice(0,6).map((e=>({DayName:e.name.toUpperCase(),Text:e.detailedForecast})));(0,i.Kb)(new o(7,"local-forecast"))},709:(e,t,s)=>{var n=s(592),r=s(440),a=s(716),i=s(125),o=s(24),l=s(211);class c extends o.A{constructor(e,t,s){super(e,t,"Travel Forecast",s),this.timing.baseDelay=20;const n=TravelCities.length/4,r=Math.floor(n)-2,a=r%1;this.timing.delay=[450];for(let e=0;e{try{if(!e.point)throw new Error("No pre-loaded point");const t=await(0,r.Pq)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),s=t.properties.periods[0].isDaytime?0:1;return{today:0===s,high:t.properties.periods[s].temperature,low:t.properties.periods[s+1].temperature,name:e.Name,icon:(0,a.Wu)(t.properties.periods[s].icon)}}catch(t){return console.error(`GetTravelWeather for ${e.Name} failed`),console.error(t.status,t.responseJSON),{name:e.Name,error:!0}}})),t=await Promise.all(e);this.data=t;this.data.some((e=>e.high))?(this.setStatus(n.Ay.loaded),this.drawLongCanvas()):this.setStatus(n.Ay.noData)}async drawLongCanvas(){const e=this.elem.querySelector(".travel-lines");e.innerHTML="";const t=this.data.map((e=>{if(e.error)return!1;const t={city:e};if(e.icon){t.city=e.name;const{low:s,high:n}=e,r=Math.round(s).toString(),a=Math.round(n).toString();t.low=r,t.high=a;const{icon:i}=e;t.icon={type:"img",src:i}}else t.error="NO TRAVEL DATA AVAILABLE";return this.fillTemplate("travel-row",t)})).filter((e=>e));e.append(...t)}async drawCanvas(){super.drawCanvas();const e=this.data;this.elem.querySelector(".header .title.dual .bottom").innerHTML=`For ${u(e)}`,this.finishDraw()}async showCanvas(){await this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".travel-lines").offsetHeight-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}getLongCanvas(){return this.longCanvas}}const u=e=>e.reduce(((e,t)=>{if(t&&""===e){return i.c9.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"");(0,l.Kb)(new c(5,"travel",!1))},716:(e,t,s)=>{s.d(t,{Wu:()=>n,XV:()=>r,ZJ:()=>a});const n=(e,t)=>{const s=t??e.indexOf("/night/")>=0,n=e=>`images/r/${e}`;let r=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[&,.?]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===r){const t=e.match(/&j=(.*)&/);[,r]=t}switch(r+(s?"-n":"")){case"skc":case"hot":case"haze":return n("Sunny.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return n("Clear-1992.gif");case"bkn":return n("Mostly-Cloudy-1994-2.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":return n("Partly-Clear-1994-2.gif");case"sct":case"few":return n("Partly-Cloudy.gif");case"sct-n":case"nsct":case"nsct-n":return n("Mostly-Clear.gif");case"ovc":case"ovc-n":return n("Cloudy.gif");case"fog":case"fog-n":return n("Fog.gif");case"rain_sleet":case"sleet":case"sleet-n":return n("Sleet.gif");case"rain_showers":case"rain_showers_high":return n("Scattered-Showers-1994-2.gif");case"rain_showers-n":case"rain_showers_high-n":return n("Scattered-Showers-Night-1994-2.gif");case"rain":case"rain-n":return n("Rain-1992.gif");case"snow":case"snow-n":return n(a>50?"Heavy-Snow-1994-2.gif":"Light-Snow.gif");case"rain_snow":case"rain_snow-n":return n("Rain-Snow-1992.gif");case"snow_fzra":case"snow_fzra-n":return n("Freezing-Rain-Snow-1992.gif");case"fzra":case"fzra-n":case"rain_fzra":case"rain_fzra-n":return n("Freezing-Rain-1992.gif");case"snow_sleet":case"snow_sleet-n":return n("Snow and Sleet.gif");case"tsra_sct":case"tsra":return n("Scattered-Tstorms-1994-2.gif");case"tsra_sct-n":case"tsra-n":return n("Scattered-Tstorms-Night-1994-2.gif");case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":case"hurricane-n":case"tropical_storm-n":return n("Thunderstorm.gif");case"wind":case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind-n":case"wind_few-n":case"wind_bkn-n":case"wind_ovc-n":return n("Wind.gif");case"wind_skc":return n("Sunny-Wind-1994.gif");case"wind_skc-n":case"wind_sct-n":return n("Clear-Wind-1994.gif");case"blizzard":case"blizzard-n":return n("Blowing Snow.gif");case"cold":return n("cold.gif");default:return console.log(`Unable to locate regional icon for ${r} ${e} ${s}`),!1}},r=(e,t)=>{if(!e)return!1;const s=e=>`images/${e}`,n=t??e.indexOf("/night/")>=0;let r=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[&,.?]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===r){const t=e.match(/&j=(.*)&/);[,r]=t}switch(r+(n?"-n":"")){case"skc":case"hot":case"haze":case"cold":return s("CC_Clear1.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return s("CC_Clear0.gif");case"sct":case"few":case"bkn":return s("CC_PartlyCloudy1.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":case"sct-n":case"nsct":case"nsct-n":return s("CC_PartlyCloudy0.gif");case"ovc":case"novc":case"ovc-n":return s("CC_Cloudy.gif");case"fog":case"fog-n":return s("CC_Fog.gif");case"rain_sleet":case"rain_sleet-n":case"sleet":case"sleet-n":return s("Sleet.gif");case"rain_showers":case"rain_showers_high":case"rain_showers-n":case"rain_showers_high-n":return s("CC_Showers.gif");case"rain":case"rain-n":return s("CC_Rain.gif");case"snow":case"snow-n":return s(a>50?"CC_Snow.gif":"CC_SnowShowers.gif");case"rain_snow":return s("CC_RainSnow.gif");case"snow_fzra":case"snow_fzra-n":case"fzra":case"fzra-n":case"rain_fzra":case"rain_fzra-n":return s("CC_FreezingRain.gif");case"snow_sleet":return s("Snow-Sleet.gif");case"tsra_sct":case"tsra":return s("EF_ScatTstorms.gif");case"tsra_sct-n":case"tsra-n":case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":case"hurricane-n":case"tropical_storm-n":return s("CC_TStorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind_skc":case"wind_few-n":case"wind_bkn-n":case"wind_ovc-n":case"wind_skc-n":case"wind_sct-n":return s("CC_Windy.gif");case"blizzard":case"blizzard-n":return s("Blowing-Snow.gif");default:return console.log(`Unable to locate icon for ${r} ${e} ${n}`),!1}},a=(e,t,s,n,r,a,i=!1)=>{const o=e=>`images/r/${e}`;let l=!1,c=!1,u=!1,d=!1,h=!1;return t.forEach((e=>{e.weather&&(e.weather.toLowerCase().includes("thunder")&&(l=!0),e.weather.toLowerCase().includes("snow")&&(c=!0),e.weather.toLowerCase().includes("ice")&&(u=!0),e.weather.toLowerCase().includes("fog")&&(d=!0),e.weather.toLowerCase().includes("wind")&&(h=!0))})),o(s>0||u?"Freezing-Rain-1992.gif":r>10?a>30||h?"Blowing Snow.gif":"Heavy-Snow-1994.gif":(r>0||c)&&l?"ThunderSnow.gif":r>0||c?"Light-Snow.gif":l?"Thunderstorm.gif":n>70?"Rain-1992.gif":n>50?"Shower.gif":n>30?i?"Scattered-Showers-Night.gif":"Scattered-Showers-1994.gif":d?"Fog.gif":e>70?"Cloudy.gif":e>50?i?"Partly-Clear-1994.gif":"Mostly-Cloudy-1994.gif":e>30?i?"Mostly-Clear.gif":"Partly-Cloudy.gif":i?"Clear-1992.gif":"Sunny.gif")}},749:(e,t,s)=>{var n=s(592),r=s(440),a=s(24),i=s(211);const o={Extreme:10,Severe:5},l={"Hurricane Warning":2,"Tornado Warning":3,"Severe Thunderstorm Warning":1};class c extends a.A{constructor(e,t,s){super(e,t,"Hazards",s),this.showOnProgress=!1,this.timing.totalScreens=0}async getData(e){const t=super.getData(e),s=this.checkbox.querySelector(".alert");s.classList.remove("show");try{const e=new URL("https://api.weather.gov/alerts/active");e.searchParams.append("point",`${this.weatherParameters.latitude},${this.weatherParameters.longitude}`),e.searchParams.append("limit",5);const t=(await(0,r.Pq)(e,{retryCount:3,stillWaiting:()=>this.stillWaiting()})).features??[],n=t.reduce(((e,t)=>e||"Immediate"===t.properties.urgency),!1),a=t.sort(((e,t)=>u(t.properties.severity,t.properties.event)-u(e.properties.severity,e.properties.event))).filter((e=>"Unknown"!==e.properties.severity&&(!n||"Immediate"===e.properties.urgency)));this.data=a,this.data.length>0&&s.classList.add("show")}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),this.isEnabled&&this.setStatus(n.Ay.failed),void this.getDataCallback(void 0)}this.getDataCallback(),t?this.drawLongCanvas():this.setStatus(n.Ay.loaded)}async drawLongCanvas(){const e=this.elem.querySelector(".hazard-lines");e.innerHTML="";const t=this.data.map((e=>{const t={};return t["hazard-text"]=`${e.properties.event}

${e.properties.description.replaceAll("\n\n","

").replaceAll("\n"," ")}`,this.fillTemplate("hazard",t)}));if(e.append(...t),0===t.length)return this.setStatus(n.Ay.loaded),this.timing.totalScreens=0,void this.setStatus(n.Ay.loaded);this.timing.baseDelay=20;const s=Math.max(Math.ceil(e.scrollHeight/400)-3,1);this.timing.delay=[550];for(let e=0;e{this.data&&e(this.data),this.getDataCallbacks.push((()=>e(this.data)))}))}screenIndexFromBaseCount(){const e=super.screenIndexFromBaseCount();return!1===e&&(this.timing.totalScreens=0),e}}const u=(e,t)=>(o[e]??0)+(l[t]??0);(0,i.Kb)(new c(0,"hazards",!0))},891:(e,t,s)=>{s.d(t,{C:()=>n});const n=e=>[/^[ A-Za-z]+ \/ /,/^[ A-Za-z]+\//,/^[ A-Za-z]+, /].reduce(((e,t)=>e.replace(t,"")),e)},951:(e,t,s)=>{var n=s(47),r=s(592),a=s(24),i=s(211);class o extends a.A{constructor(e,t){super(e,t,"",!1),this.backgroundImage=(0,n.u)("images/BackGround1_1.png"),this.timing=!1,document.addEventListener("DOMContentLoaded",(()=>{this.version=document.querySelector("#version").innerHTML,this.elem.querySelector(".container").addEventListener("click",this.lineClick.bind(this))})),this.okToDrawCurrentConditions=!1}async drawCanvas(e,t){if(!this.elem)return;if(super.drawCanvas(),this.progressCover||(this.progressCover=this.elem.querySelector(".scroll .cover")),!e)return;const s=e.map(((e,t)=>{if(!1===e.showOnProgress)return!1;const s={name:e.name},n=(0,r.qx)(e.status),a=this.fillTemplate("item",s);if(!a)return!1;const i=a.querySelector(".links");return i.classList.remove(...r.LR),i.classList.add(n),i.dataset.index=t,a})).filter((e=>e)),n=this.elem.querySelector(".container");n.innerHTML="",n.append(...s),this.finishDraw();const a=t/e.length;this.progressCover.style.width=100*(1-a)+"%",a<1?this.progressCover.parentNode.classList.add("show"):setTimeout((()=>this.progressCover.parentNode.classList.remove("show")),1e3)}lineClick(e){const t=e.target?.parentNode?.dataset?.index;if(void 0===t)return;const s=+t;(0,i.iU)("navButton");const n=(0,i.pv)(s);n&&n.status===r.Ay.loaded&&(n.showCanvas(i.ab.command.firstFrame),this.elem.classList.remove("show"))}}const l=new o(-1,"progress");(0,i.Lg)(l)},999:(e,t,s)=>{s.d(t,{J:()=>l}),document.addEventListener("DOMContentLoaded",(()=>r()));const n={kiosk:"settings-kiosk-checkbox"},r=()=>{const e=document.querySelector("#share-link");e.addEventListener("click",a),navigator?.clipboard||(e.textContent="Get Permalink")},a=async e=>{e.preventDefault();const t=document.querySelectorAll("input[type=checkbox]"),s={};[...t].forEach((e=>{e?.id&&(s[e.id]=e?.checked??!1)}));[...document.querySelectorAll("select")].forEach((e=>{e?.id&&(s[e.id]=e?.value??0)})),s.latLonQuery=localStorage.getItem("latLonQuery"),s.latLon=localStorage.getItem("latLon");const n=new URLSearchParams(s).toString(),r=new URL(`?${n}`,document.location.href);navigator?.clipboard?i(r):o(r)},i=async e=>{try{await navigator.clipboard.writeText(e.toString());const t=document.querySelector("#share-link-copied");t.style.display="inline",setTimeout((()=>{t.style.display="none"}),5e3)}catch(e){console.error(e)}},o=e=>{const t=document.querySelector("#share-link-instructions"),s=t.querySelector("#share-link-url");s.value=e,t.style.display="inline",s.focus(),s.select()},l=()=>{if(l.params)return l.params;const e=[...new URLSearchParams(window.location.search)];return e.forEach((t=>{const s=n[t[0]];s&&e.push([s,t[1]])})),l.params=Object.fromEntries(e),l.params}}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s(516),s(749),s(423),s(247),s(716),s(498),s(73),s(2),s(94),s(704),s(503),s(187),s(709),s(951);s(652)})(); \ No newline at end of file +(()=>{"use strict";var e={2:(e,t,s)=>{var n=s(592),r=s(73),a=s(24),i=s(211),o=s(125);class l extends a.A{constructor(e,t,s){super(e,t,"Hourly Graph",s),document.addEventListener("DOMContentLoaded",(()=>{this.moveHeader()}))}moveHeader(){const e=this.fillTemplate("top-right",{});this.elem.querySelector(".header .right").append(e)}async getData(){if(!super.getData())return;const e=await(0,r.A)((()=>this.stillWaiting()));if(void 0===e)return void this.setStatus(n.Ay.failed);const t=e.map((e=>e.temperature)),s=e.map((e=>e.probabilityOfPrecipitation)),a=e.map((e=>e.skyCover));this.data={skyCover:a,temperature:t,probabilityOfPrecipitation:s,temperatureUnit:e[0].temperatureUnit},this.setStatus(n.Ay.loaded)}drawCanvas(){this.image||(this.image=this.elem.querySelector(".chart img"));const e=285;this.image.width=532,this.image.height=e;const t=document.createElement("canvas");t.width=532,t.height=e;const s=t.getContext("2d");s.imageSmoothingEnabled=!1;const n=c(0,5,this.data.temperature.length-1,532),r=o.c9.now().startOf("hour");document.querySelector(".x-axis .l-1").innerHTML=h(r),document.querySelector(".x-axis .l-2").innerHTML=h(r.plus({hour:6})),document.querySelector(".x-axis .l-3").innerHTML=h(r.plus({hour:12})),document.querySelector(".x-axis .l-4").innerHTML=h(r.plus({hour:18})),document.querySelector(".x-axis .l-5").innerHTML=h(r.plus({hour:24}));const a=c(0,275,100,10),i=u(this.data.skyCover,n,a);d(i,s,{strokeStyle:"lightgrey",lineWidth:3});const l=u(this.data.probabilityOfPrecipitation,n,a);d(l,s,{strokeStyle:"aqua",lineWidth:3});const m=Math.min(...this.data.temperature),f=Math.max(...this.data.temperature),g=Math.round((m+f)/2),y=c(m,275,f,10),p=u(this.data.temperature,n,y);d(p,s,{strokeStyle:"red",lineWidth:3});const w=String.fromCharCode(176);this.elem.querySelector(".y-axis .l-1").innerHTML=(f+w).substring(0,3),this.elem.querySelector(".y-axis .l-2").innerHTML=(g+w).substring(0,3),this.elem.querySelector(".y-axis .l-3").innerHTML=(m+w).substring(0,3),this.image.src=t.toDataURL(),this.elem.querySelector(".temperature").innerHTML=`Temperature ${String.fromCharCode(176)}${this.data.temperatureUnit}`,super.drawCanvas(),this.finishDraw()}}const c=(e,t,s,n)=>{const r=(n-t)/(s-e),a=t-r*e;return e=>r*e+a},u=(e,t,s)=>e.map(((e,n)=>[t(n),s(e)])),d=(e,t,s)=>{t.beginPath(),t.strokeStyle="black",t.lineWidth=(s?.lineWidth??2)+2,t.moveTo(e[0][0],e[0][1]),e.slice(1).forEach((e=>t.lineTo(e[0],e[1]+2))),t.stroke(),t.beginPath(),t.strokeStyle=s?.strokeStyle??"red",t.lineWidth=s?.lineWidth??2,t.moveTo(e[0][0],e[0][1]),e.slice(1).forEach((e=>t.lineTo(e[0],e[1]))),t.stroke()},h=e=>e.toFormat("ha").slice(0,-1);(0,i.Kb)(new l(4,"hourly-graph"))},24:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(592),r=s(125),a=s(211),i=s(999),o=s(302);const l=class{constructor(e,t,s,r){this.navId=e,this.elemId=void 0,this.data=void 0,this.loadingStatus=n.Ay.loading,this.name=s??t,this.getDataCallbacks=[],this.stillWaitingCallbacks=[],this.defaultEnabled=r,this.okToDrawCurrentConditions=!0,this.okToDrawCurrentDateTime=!0,this.showOnProgress=!0,this.timing={totalScreens:1,baseDelay:9e3,delay:1},this.navBaseCount=0,this.screenIndex=-1,this.storeElemId(t),this.isEnabled?this.setStatus(n.Ay.loading):this.setStatus(n.Ay.disabled),this.startNavCount(),document.addEventListener("DOMContentLoaded",(()=>{this.loadTemplates()}))}generateCheckbox(e=!0){if("progress"===this.elemId)return!1;const t=(0,i.J)()?.[`${this.elemId}-checkbox`];let s;void 0!==t&&(s="true"===t);let n=s??window.localStorage.getItem(`display-enabled: ${this.elemId}`);null===n&&(n=e),this.isEnabled=!("true"!==n&&!0!==n),window.localStorage.setItem(`display-enabled: ${this.elemId}`,this.isEnabled);const r=document.createElement("label");r.for=`${this.elemId}-checkbox`,r.id=`${this.elemId}-label`;const a=document.createElement("input");a.type="checkbox",a.value=!0,a.id=`${this.elemId}-checkbox`,a.name=`${this.elemId}-checkbox`,a.checked=this.isEnabled,a.addEventListener("change",(e=>this.checkboxChange(e)));const o=document.createElement("span");o.innerHTML=this.name;const l=document.createElement("span");return l.innerHTML="!!!",l.classList.add("alert"),r.append(a,o,l),this.checkbox=r,r}checkboxChange(e){this.isEnabled=e.target.checked,window.localStorage.setItem(`display-enabled: ${this.elemId}`,this.isEnabled),this.getData()}setStatus(e){this.status=e,(0,a.yB)({id:this.navId,status:this.status}),this.checkbox&&(this.checkbox.classList.remove(...n.LR),this.checkbox.classList.add((0,n.qx)(e)))}get status(){return this.loadingStatus}set status(e){this.loadingStatus=e}storeElemId(e){this.elemId||(this.elemId=e)}getData(e){return this.data=void 0,e&&(this.weatherParameters=e),this.isEnabled?(this.setStatus(n.Ay.loading),this.calcNavTiming(),!0):(this.setStatus(n.Ay.disabled),!1)}getDataCallback(){this.getDataCallbacks.forEach((e=>e(this.data))),this.getDataCallbacks=[]}drawCanvas(){this.screenIndex<0&&(this.screenIndex=0),this.okToDrawCurrentDateTime&&this.drawCurrentDateTime()}finishDraw(){this.okToDrawCurrentDateTime&&(this.drawCurrentDateTime(),this.dateTimeInterval||(this.dateTimeInterval=setInterval((()=>this.active&&this.drawCurrentDateTime()),100)))}drawCurrentDateTime(){const e=r.c9.local().setZone((0,a.eB)()),t=e.toLocaleString(r.c9.TIME_WITH_SECONDS).padStart(11," "),s=e.toFormat(" ccc LLL ")+e.day.toString().padStart(2," "),n=this.elem.querySelector(".date-time.date"),i=this.elem.querySelector(".date-time.time");i&&this.lastTime!==t&&(i.innerHTML=t.toUpperCase()),this.lastTime=t,n&&this.lastDate!==s&&(n.innerHTML=s.toUpperCase()),this.lastDate=s}showCanvas(e){e===a.ab.command.firstFrame&&this.navNext(e),e===a.ab.command.lastFrame&&this.navPrev(e),this.startNavCount(),this.elem.classList.add("show"),document.querySelector("#divTwc").classList.add(this.elemId)}hideCanvas(){this.resetNavBaseCount(),this.elem.classList.remove("show"),document.querySelector("#divTwc").classList.remove(this.elemId)}get active(){return 0!==this.elem.offsetHeight}get enabled(){return this.isEnabled}navBaseTime(){(0,a.F4)()&&this.active&&(this.navBaseCount+=1,this.baseCountChange&&this.baseCountChange(this.navBaseCount),this.updateScreenFromBaseCount())}async updateScreenFromBaseCount(){const e=this.screenIndexFromBaseCount();!1!==e?e!==this.screenIndex&&(this.screenIndex=-1===e?0:e,this.screenIndexChange?this.screenIndexChange(this.screenIndex):await this.drawCanvas(),this.showCanvas()):this.sendNavDisplayMessage(a.ab.response.next)}calcNavTiming(){if(!1===this.timing)return;Array.isArray(this.timing.delay)&&(this.timing.totalScreens=this.timing.delay.length);let e=[];if("number"==typeof this.timing.delay)for(let t=0;t"object"==typeof e?e.time:e));let t=0;if(this.timing.fullDelay=e.map((e=>{const s=t+e;return t+=e,s})),Array.isArray(this.timing.delay)&&"object"==typeof this.timing.delay[0])this.timing.screenIndexes=this.timing.delay.map((e=>e.si));else{this.timing.screenIndexes=[];for(let e=0;ee>this.navBaseCount));this.navBaseCount=e}this.updateScreenFromBaseCount()}navPrev(e){if(e===a.ab.command.lastFrame)this.navBaseCount=this.timing.fullDelay[this.timing.totalScreens-1]-1;else{const e=this.timing.fullDelay.reduce(((e,t)=>te>this.navBaseCount));return-1!==e&&this.timing.screenIndexes[e]}startNavCount(){this.navInterval||(this.navInterval=setInterval((()=>this.navBaseTime()),this.timing.baseDelay*o.A.speed.value))}resetNavBaseCount(){this.navBaseCount=0,this.screenIndex=-1,this.navInterval&&(clearInterval(this.navInterval),this.navInterval=void 0)}sendNavDisplayMessage(e){(0,a.Ju)({id:this.navId,type:e})}loadTemplates(){if(this.templates={},this.elem=document.querySelector(`#${this.elemId}-html`),!this.elem)return;this.elem.querySelectorAll(".template").forEach((e=>{const t=e.classList[0],s=e.cloneNode(!0);s.classList.remove("template"),this.templates[t]=s,e.remove()}))}fillTemplate(e,t){const s=this.templates[e];if(!s)return!1;const n=s.cloneNode(!0);return Object.entries(t).forEach((([e,t])=>{const s=n.querySelector(`.${e}`);s&&("string"==typeof t||"number"==typeof t?s.innerHTML=t:"img"===t?.type&&(s.querySelector("img").src=t.src))})),n}stillWaiting(){this.isEnabled&&this.setStatus(n.Ay.retrying),this.stillWaitingCallbacks.forEach((e=>e())),this.stillWaitingCallbacks=[]}}},47:(e,t,s)=>{s.d(t,{b:()=>o,u:()=>a});var n=s(440),r=s(147);const a=(e,t=!1)=>new Promise((s=>{const n=new Image;if(n.onload=e=>{s(e.target)},e instanceof Blob)n.src=window.URL.createObjectURL(e);else{let s=e;t&&(s=(0,r.O)(e)),n.src=s}})),i=[],o=e=>!i.includes(e)&&((0,n.av)(e),i.push(e),!0)},73:(e,t,s)=>{s.d(t,{A:()=>p});var n=s(592),r=s(125),a=s(440),i=s(413),o=s(716),l=s(519),c=s(24),u=s(211),d=s(247);class h extends c.A{constructor(e,t,s){super(e,t,"Hourly Forecast",s),this.timing.baseDelay=20;this.timing.delay=[450];for(let e=0;e<4;e+=1)this.timing.delay.push(300);this.timing.delay.push(150)}async getData(e){const t=super.getData(e);let s;try{s=await(0,a.Pq)(e.forecastGridData,{retryCount:3,stillWaiting:()=>this.stillWaiting()})}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),this.isEnabled&&this.setStatus(n.Ay.failed),void this.getDataCallback(void 0)}this.data=await m(s.properties),this.getDataCallback(),t&&(this.setStatus(n.Ay.loaded),this.drawLongCanvas())}async drawLongCanvas(){const e=this.elem.querySelector(".hourly-lines");e.innerHTML="";const t=(0,i.X1)(),s=r.c9.local(),n=this.data.map(((e,n)=>{const r={},a=s.plus({hours:n}).toLocaleString({weekday:"short",hour:"numeric"});r.hour=a;const i=t(e.temperature).toString().padStart(3),o=Math.round(e.apparentTemperature).toString().padStart(3);r.temp=i,i!==o&&(r.like=o);let l="Calm";if(e.windSpeed>0){const t=Math.round(e.windSpeed).toString();l=e.windDirection+Array(6-e.windDirection.length-t.length).join(" ")+t}return r.wind=l,r.icon={type:"img",src:e.icon},this.fillTemplate("hourly-row",r)}));e.append(...n)}drawCanvas(){super.drawCanvas(),this.finishDraw()}showCanvas(){this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".hourly-lines").offsetHeight-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}async getCurrentData(e){return e&&this.stillWaitingCallbacks.push(e),new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push((()=>e(this.data)))}))}}const m=async e=>{const t=(0,i.X1)(),s=(0,i.NA)(),n=g(e.temperature.values),r=g(e.apparentTemperature.values),a=g(e.windSpeed.values),o=g(e.windDirection.values),c=g(e.skyCover.values),u=g(e.weather.values),d=g(e.iceAccumulation.values),h=g(e.probabilityOfPrecipitation.values),m=g(e.snowfallAmount.values),y=await f(c,u,d,h,m,a);return n.map(((e,i)=>({temperature:t(n[i]),temperatureUnit:t.units,apparentTemperature:t(r[i]),windSpeed:s(a[i]),windUnit:s.units,windDirection:(0,l.Up)(o[i]),probabilityOfPrecipitation:h[i],skyCover:c[i],icon:y[i]})))},f=async(e,t,s,n,a,i)=>{const l=r.c9.local().startOf("hour"),c=(await(0,d.A)()).sun,u=r.IX.fromDateTimes(r.c9.fromJSDate(c[0].sunset),r.c9.fromJSDate(c[1].sunrise)),h=r.c9.fromJSDate(c[1].sunset);return e.map(((r,c)=>{const d=l.plus({hours:c}),m=u.contains(d)||d>h;return(0,o.ZJ)(e[c],t[c],s[c],n[c],a[c],i[c],m)}))},g=e=>{const t=r.c9.utc().startOf("hour").toMillis(),s=[];return e.forEach((e=>{let n=Date.parse(e.validTime.substr(0,e.validTime.indexOf("/")));const a=n+r.dw.fromISO(e.validTime.substr(e.validTime.indexOf("/")+1)).shiftTo("milliseconds").values.milliseconds;do{n>=t&&s.length<24&&s.push(e.value),n+=36e5}while(n{var n=s(519),r=s(440),a=s(592),i=s(891),o=s(413),l=s(24),c=s(211),u=s(302);class d extends l.A{constructor(e,t){super(e,t,"Latest Observations",!0),this.MaximumRegionalStations=7}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,s=Object.keys(StationInfo).map((e=>{const s=StationInfo[e],r=(0,n.Io)(s.lat,s.lon,t.latitude,t.longitude);return{...s,distance:r}})).sort(((e,t)=>e.distance-t.distance)).slice(0,30),r=[];let i=Math.min(s.length,7),o=0;for(;r.length<7&&i<=s.length;){const e=await m(s.slice(o,i));r.push(...e),o+=i,i=Math.min(s.length+1,o+7-r.length)}this.data=r.slice(0,this.MaximumRegionalStations),0!==this.data.length?this.setStatus(a.Ay.loaded):this.setStatus(a.Ay.noData)}async drawCanvas(){super.drawCanvas();const e=this.data.sort(((e,t)=>e.Name{const r=(0,n.Up)(e.windDirection.value),a=s(e.temperature.value),o=t(e.windSpeed.value),l={location:(0,i.C)(e.city).substr(0,14),temp:a,weather:h(e.textDescription).substr(0,9)};return l.wind=o>0?r+Array(6-r.length-o.toString().length).join(" ")+o.toString():"NA"===o?"NA":"Calm",this.fillTemplate("observation-row",l)})),a=this.elem.querySelector(".observation-lines");a.innerHTML="",a.append(...r),this.finishDraw()}}const h=e=>{let t=e;return t=t.replace(/Light/,"L"),t=t.replace(/Heavy/,"H"),t=t.replace(/Partly/,"P"),t=t.replace(/Mostly/,"M"),t=t.replace(/Few/,"F"),t=t.replace(/Thunderstorm/,"T'storm"),t=t.replace(/ in /,""),t=t.replace(/Vicinity/,""),t=t.replace(/ and /," "),t=t.replace(/Freezing Rain/,"Frz Rn"),t=t.replace(/Freezing/,"Frz"),t=t.replace(/Unknown Precip/,""),t=t.replace(/L Snow Fog/,"L Snw/Fog"),t=t.replace(/ with /,"/"),t},m=async e=>(await Promise.all(e.map((async e=>{try{const t=await(0,r.Pq)(`https://api.weather.gov/stations/${e.id}/observations/latest`,{retryCount:1,stillWaiting:()=>(void 0).stillWaiting()});return null!==t.properties.temperature.value&&""!==t.properties.textDescription&&null!==t.properties.windSpeed.value&&{...t.properties,StationId:e.id,city:e.city}}catch(t){return console.log(`Unable to get latest observations for ${e.id}`),!1}})))).filter((e=>e));(0,c.Kb)(new d(2,"latest-observations"))},125:(e,t,s)=>{s.d(t,{IX:()=>Ts,c9:()=>gn,dw:()=>ks});class n extends Error{}class r extends n{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class a extends n{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class i extends n{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class o extends n{}class l extends n{constructor(e){super(`Invalid unit ${e}`)}}class c extends n{}class u extends n{constructor(){super("Zone is an abstract class")}}const d="numeric",h="short",m="long",f={year:d,month:d,day:d},g={year:d,month:h,day:d},y={year:d,month:h,day:d,weekday:h},p={year:d,month:m,day:d},w={year:d,month:m,day:d,weekday:m},v={hour:d,minute:d},S={hour:d,minute:d,second:d},b={hour:d,minute:d,second:d,timeZoneName:h},k={hour:d,minute:d,second:d,timeZoneName:m},C={hour:d,minute:d,hourCycle:"h23"},T={hour:d,minute:d,second:d,hourCycle:"h23"},L={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:h},x={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:m},D={year:d,month:d,day:d,hour:d,minute:d},M={year:d,month:d,day:d,hour:d,minute:d,second:d},I={year:d,month:h,day:d,hour:d,minute:d},N={year:d,month:h,day:d,hour:d,minute:d,second:d},O={year:d,month:h,day:d,weekday:h,hour:d,minute:d},E={year:d,month:m,day:d,hour:d,minute:d,timeZoneName:h},$={year:d,month:m,day:d,hour:d,minute:d,second:d,timeZoneName:h},F={year:d,month:m,day:d,weekday:m,hour:d,minute:d,timeZoneName:m},q={year:d,month:m,day:d,weekday:m,hour:d,minute:d,second:d,timeZoneName:m};class A{get type(){throw new u}get name(){throw new u}get ianaName(){return this.name}get isUniversal(){throw new u}offsetName(e,t){throw new u}formatOffset(e,t){throw new u}offset(e){throw new u}equals(e){throw new u}get isValid(){throw new u}}let W=null;class V extends A{static get instance(){return null===W&&(W=new V),W}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return st(e,t,s)}formatOffset(e,t){return it(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let _={};const H={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let P={};class z extends A{static create(e){return P[e]||(P[e]=new z(e)),P[e]}static resetCache(){P={},_={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=z.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return st(e,t,s,this.name)}formatOffset(e,t){return it(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const s=(n=this.name,_[n]||(_[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),_[n]);var n;let[r,a,i,o,l,c,u]=s.formatToParts?function(e,t){const s=e.formatToParts(t),n=[];for(let e=0;e=0?h:1e3+h,(Ke({year:r,month:a,day:i,hour:24===l?0:l,minute:c,second:u,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let U={};let Z={};function R(e,t={}){const s=JSON.stringify([e,t]);let n=Z[s];return n||(n=new Intl.DateTimeFormat(e,t),Z[s]=n),n}let j={};let B={};let J=null;let G={};function Y(e,t,s,n){const r=e.listingMode();return"error"===r?null:"en"===r?s(t):n(t)}class X{constructor(e,t,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:n,floor:r,...a}=s;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...s};s.padTo>0&&(t.minimumIntegerDigits=s.padTo),this.inf=function(e,t={}){const s=JSON.stringify([e,t]);let n=j[s];return n||(n=new Intl.NumberFormat(e,t),j[s]=n),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Ze(this.floor?Math.floor(e):Je(e,3),this.padTo)}}class K{constructor(e,t,s){let n;if(this.opts=s,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,s=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&z.create(s).valid?(n=s,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=R(t,r)}format(){return this.originalZone?this.formatToParts().map((({value:e})=>e)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map((e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e})):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Q{constructor(e,t,s){this.opts={style:"long",...s},!t&&Ve()&&(this.rtf=function(e,t={}){const{base:s,...n}=t,r=JSON.stringify([e,n]);let a=B[r];return a||(a=new Intl.RelativeTimeFormat(e,t),B[r]=a),a}(e,s))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,s="always",n=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===s&&a){const s="days"===e;switch(t){case 1:return s?"tomorrow":`next ${r[e][0]}`;case-1:return s?"yesterday":`last ${r[e][0]}`;case 0:return s?"today":`this ${r[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,c=r[e],u=n?l?c[1]:c[2]||c[1]:l?r[e][0]:e;return i?`${o} ${u} ago`:`in ${o} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ee={firstDay:1,minimalDays:4,weekend:[6,7]};class te{static fromOpts(e){return te.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,s,n,r=!1){const a=e||ve.defaultLocale,i=a||(r?"en-US":J||(J=(new Intl.DateTimeFormat).resolvedOptions().locale,J)),o=t||ve.defaultNumberingSystem,l=s||ve.defaultOutputCalendar,c=ze(n)||ve.defaultWeekSettings;return new te(i,o,l,c,a)}static resetCache(){J=null,Z={},j={},B={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:s,weekSettings:n}={}){return te.create(e,t,s,n)}constructor(e,t,s,n,r){const[a,i,o]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const s=e.indexOf("-u-");if(-1===s)return[e];{let t,n;try{t=R(e).resolvedOptions(),n=e}catch(r){const a=e.substring(0,s);t=R(a).resolvedOptions(),n=a}const{numberingSystem:r,calendar:a}=t;return[n,r,a]}}(e);this.locale=a,this.numberingSystem=t||i||null,this.outputCalendar=s||o||null,this.weekSettings=n,this.intl=function(e,t,s){return s||t?(e.includes("-u-")||(e+="-u"),s&&(e+=`-ca-${s}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?te.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ze(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Y(this,e,dt,(()=>{const s=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=function(e){const t=[];for(let s=1;s<=12;s++){const n=gn.utc(2009,s,1);t.push(e(n))}return t}((e=>this.extract(e,s,"month")))),this.monthsCache[n][e]}))}weekdays(e,t=!1){return Y(this,e,gt,(()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let s=1;s<=7;s++){const n=gn.utc(2016,11,13+s);t.push(e(n))}return t}((e=>this.extract(e,s,"weekday")))),this.weekdaysCache[n][e]}))}meridiems(){return Y(this,void 0,(()=>yt),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[gn.utc(2016,11,13,9),gn.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e){return Y(this,e,St,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[gn.utc(-40,1,1),gn.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,s){const n=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===s));return n?n.value:null}numberFormatter(e={}){return new X(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new K(e,this.intl,t)}relFormatter(e={}){return new Q(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const s=JSON.stringify([e,t]);let n=U[s];return n||(n=new Intl.ListFormat(e,t),U[s]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:_e()?function(e){let t=G[e];if(!t){const s=new Intl.Locale(e);t="getWeekInfo"in s?s.getWeekInfo():s.weekInfo,G[e]=t}return t}(this.locale):ee}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let se=null;class ne extends A{static get utcInstance(){return null===se&&(se=new ne(0)),se}static instance(e){return 0===e?ne.utcInstance:new ne(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new ne(nt(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${it(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${it(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return it(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class re extends A{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ae(e,t){if(qe(e)||null===e)return t;if(e instanceof A)return e;if("string"==typeof e){const s=e.toLowerCase();return"default"===s?t:"local"===s||"system"===s?V.instance:"utc"===s||"gmt"===s?ne.utcInstance:ne.parseSpecifier(s)||z.create(e)}return Ae(e)?ne.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new re(e)}const ie={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},oe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},le=ie.hanidec.replace(/[\[|\]]/g,"").split("");let ce={};function ue({numberingSystem:e},t=""){const s=e||"latn";return ce[s]||(ce[s]={}),ce[s][t]||(ce[s][t]=new RegExp(`${ie[s]}${t}`)),ce[s][t]}let de,he=()=>Date.now(),me="system",fe=null,ge=null,ye=null,pe=60,we=null;class ve{static get now(){return he}static set now(e){he=e}static set defaultZone(e){me=e}static get defaultZone(){return ae(me,V.instance)}static get defaultLocale(){return fe}static set defaultLocale(e){fe=e}static get defaultNumberingSystem(){return ge}static set defaultNumberingSystem(e){ge=e}static get defaultOutputCalendar(){return ye}static set defaultOutputCalendar(e){ye=e}static get defaultWeekSettings(){return we}static set defaultWeekSettings(e){we=ze(e)}static get twoDigitCutoffYear(){return pe}static set twoDigitCutoffYear(e){pe=e%100}static get throwOnInvalid(){return de}static set throwOnInvalid(e){de=e}static resetCaches(){te.resetCache(),z.resetCache(),gn.resetCache(),ce={}}}class Se{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const be=[0,31,59,90,120,151,181,212,243,273,304,334],ke=[0,31,60,91,121,152,182,213,244,274,305,335];function Ce(e,t){return new Se("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Te(e,t,s){const n=new Date(Date.UTC(e,t-1,s));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return 0===r?7:r}function Le(e,t,s){return s+(Ge(e)?ke:be)[t-1]}function xe(e,t){const s=Ge(e)?ke:be,n=s.findIndex((e=>eet(n,t,s)?(l=n+1,c=1):l=n,{weekYear:l,weekNumber:c,weekday:o,...ot(e)}}function Ie(e,t=4,s=1){const{weekYear:n,weekNumber:r,weekday:a}=e,i=De(Te(n,1,t),s),o=Ye(n);let l,c=7*r+a-i-7+t;c<1?(l=n-1,c+=Ye(l)):c>o?(l=n+1,c-=Ye(n)):l=n;const{month:u,day:d}=xe(l,c);return{year:l,month:u,day:d,...ot(e)}}function Ne(e){const{year:t,month:s,day:n}=e;return{year:t,ordinal:Le(t,s,n),...ot(e)}}function Oe(e){const{year:t,ordinal:s}=e,{month:n,day:r}=xe(t,s);return{year:t,month:n,day:r,...ot(e)}}function Ee(e,t){if(!qe(e.localWeekday)||!qe(e.localWeekNumber)||!qe(e.localWeekYear)){if(!qe(e.weekday)||!qe(e.weekNumber)||!qe(e.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return qe(e.localWeekday)||(e.weekday=e.localWeekday),qe(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),qe(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function $e(e){const t=We(e.year),s=Ue(e.month,1,12),n=Ue(e.day,1,Xe(e.year,e.month));return t?s?!n&&Ce("day",e.day):Ce("month",e.month):Ce("year",e.year)}function Fe(e){const{hour:t,minute:s,second:n,millisecond:r}=e,a=Ue(t,0,23)||24===t&&0===s&&0===n&&0===r,i=Ue(s,0,59),o=Ue(n,0,59),l=Ue(r,0,999);return a?i?o?!l&&Ce("millisecond",r):Ce("second",n):Ce("minute",s):Ce("hour",t)}function qe(e){return void 0===e}function Ae(e){return"number"==typeof e}function We(e){return"number"==typeof e&&e%1==0}function Ve(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function _e(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function He(e,t,s){if(0!==e.length)return e.reduce(((e,n)=>{const r=[t(n),n];return e&&s(e[0],r[0])===e[0]?e:r}),null)[1]}function Pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ze(e){if(null==e)return null;if("object"!=typeof e)throw new c("Week settings must be an object");if(!Ue(e.firstDay,1,7)||!Ue(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((e=>!Ue(e,1,7))))throw new c("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Ue(e,t,s){return We(e)&&e>=t&&e<=s}function Ze(e,t=2){let s;return s=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),s}function Re(e){return qe(e)||null===e||""===e?void 0:parseInt(e,10)}function je(e){return qe(e)||null===e||""===e?void 0:parseFloat(e)}function Be(e){if(!qe(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Je(e,t,s=!1){const n=10**t;return(s?Math.trunc:Math.round)(e*n)/n}function Ge(e){return e%4==0&&(e%100!=0||e%400==0)}function Ye(e){return Ge(e)?366:365}function Xe(e,t){const s=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===s?Ge(e+(t-s)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][s-1]}function Ke(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Qe(e,t,s){return-De(Te(e,1,t),s)+t-1}function et(e,t=4,s=1){const n=Qe(e,t,s),r=Qe(e+1,t,s);return(Ye(e)-n+r)/7}function tt(e){return e>99?e:e>ve.twoDigitCutoffYear?1900+e:2e3+e}function st(e,t,s,n=null){const r=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const i={timeZoneName:t,...a},o=new Intl.DateTimeFormat(s,i).formatToParts(r).find((e=>"timezonename"===e.type.toLowerCase()));return o?o.value:null}function nt(e,t){let s=parseInt(e,10);Number.isNaN(s)&&(s=0);const n=parseInt(t,10)||0;return 60*s+(s<0||Object.is(s,-0)?-n:n)}function rt(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new c(`Invalid unit value ${e}`);return t}function at(e,t){const s={};for(const n in e)if(Pe(e,n)){const r=e[n];if(null==r)continue;s[t(n)]=rt(r)}return s}function it(e,t){const s=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),r=e>=0?"+":"-";switch(t){case"short":return`${r}${Ze(s,2)}:${Ze(n,2)}`;case"narrow":return`${r}${s}${n>0?`:${n}`:""}`;case"techie":return`${r}${Ze(s,2)}${Ze(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ot(e){return function(e,t){return t.reduce(((t,s)=>(t[s]=e[s],t)),{})}(e,["hour","minute","second","millisecond"])}const lt=["January","February","March","April","May","June","July","August","September","October","November","December"],ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ut=["J","F","M","A","M","J","J","A","S","O","N","D"];function dt(e){switch(e){case"narrow":return[...ut];case"short":return[...ct];case"long":return[...lt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ht=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],mt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ft=["M","T","W","T","F","S","S"];function gt(e){switch(e){case"narrow":return[...ft];case"short":return[...mt];case"long":return[...ht];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const yt=["AM","PM"],pt=["Before Christ","Anno Domini"],wt=["BC","AD"],vt=["B","A"];function St(e){switch(e){case"narrow":return[...vt];case"short":return[...wt];case"long":return[...pt];default:return null}}function bt(e,t){let s="";for(const n of e)n.literal?s+=n.val:s+=t(n.val);return s}const kt={D:f,DD:g,DDD:p,DDDD:w,t:v,tt:S,ttt:b,tttt:k,T:C,TT:T,TTT:L,TTTT:x,f:D,ff:I,fff:E,ffff:F,F:M,FF:N,FFF:$,FFFF:q};class Ct{static create(e,t={}){return new Ct(e,t)}static parseFormat(e){let t=null,s="",n=!1;const r=[];for(let a=0;a0&&r.push({literal:n||/^\s+$/.test(s),val:s}),t=null,s="",n=!n):n||i===t?s+=i:(s.length>0&&r.push({literal:/^\s+$/.test(s),val:s}),s=i,t=i)}return s.length>0&&r.push({literal:n||/^\s+$/.test(s),val:s}),r}static macroTokenToFormatOpts(e){return kt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Ze(e,t);const s={...this.opts};return t>0&&(s.padTo=t),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const s="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,r=(t,s)=>this.loc.extract(e,t,s),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>s?function(e){return yt[e.hour<12?0:1]}(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,n)=>s?function(e,t){return dt(t)[e.month-1]}(e,t):r(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>s?function(e,t){return gt(t)[e.weekday-1]}(e,t):r(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const s=Ct.macroTokenToFormatOpts(t);return s?this.formatWithSystemDefault(e,s):t},u=t=>s?function(e,t){return St(t)[e.year<0?0:1]}(e,t):r({era:t},"era");return bt(Ct.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return n?r({day:"numeric"},"day"):this.num(e.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(e.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(e.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}}))}formatDurationFromString(e,t){const s=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=Ct.parseFormat(t),r=n.reduce(((e,{literal:t,val:s})=>t?e:e.concat(s)),[]);return bt(n,(e=>t=>{const n=s(t);return n?this.num(e.get(n),t.length):t})(e.shiftTo(...r.map(s).filter((e=>e)))))}}const Tt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Lt(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function xt(...e){return t=>e.reduce((([e,s,n],r)=>{const[a,i,o]=r(t,n);return[{...e,...a},i||s,o]}),[{},null,1]).slice(0,2)}function Dt(e,...t){if(null==e)return[null,null];for(const[s,n]of t){const t=s.exec(e);if(t)return n(t)}return[null,null]}function Mt(...e){return(t,s)=>{const n={};let r;for(r=0;rvoid 0!==e&&(t||e&&u)?-e:e;return[{years:h(je(s)),months:h(je(n)),weeks:h(je(r)),days:h(je(a)),hours:h(je(i)),minutes:h(je(o)),seconds:h(je(l),"-0"===l),milliseconds:h(Be(c),d)}]}const Zt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Rt(e,t,s,n,r,a,i){const o={year:2===t.length?tt(Re(t)):Re(t),month:ct.indexOf(s)+1,day:Re(n),hour:Re(r),minute:Re(a)};return i&&(o.second=Re(i)),e&&(o.weekday=e.length>3?ht.indexOf(e)+1:mt.indexOf(e)+1),o}const jt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Bt(e){const[,t,s,n,r,a,i,o,l,c,u,d]=e,h=Rt(t,r,n,s,a,i,o);let m;return m=l?Zt[l]:c?0:nt(u,d),[h,new ne(m)]}const Jt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Gt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Yt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Xt(e){const[,t,s,n,r,a,i,o]=e;return[Rt(t,r,n,s,a,i,o),ne.utcInstance]}function Kt(e){const[,t,s,n,r,a,i,o]=e;return[Rt(t,o,s,n,r,a,i),ne.utcInstance]}const Qt=Lt(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Et),es=Lt(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Et),ts=Lt(/(\d{4})-?(\d{3})/,Et),ss=Lt(Ot),ns=xt((function(e,t){return[{year:Wt(e,t),month:Wt(e,t+1,1),day:Wt(e,t+2,1)},null,t+3]}),Vt,_t,Ht),rs=xt($t,Vt,_t,Ht),as=xt(Ft,Vt,_t,Ht),is=xt(Vt,_t,Ht);const os=xt(Vt);const ls=Lt(/(\d{4})-(\d\d)-(\d\d)/,At),cs=Lt(qt),us=xt(Vt,_t,Ht);const ds="Invalid Duration",hs={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},ms={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...hs},fs=365.2425,gs=30.436875,ys={years:{quarters:4,months:12,weeks:52.1775,days:fs,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:gs,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...hs},ps=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ws=ps.slice(0).reverse();function vs(e,t,s=!1){const n={values:s?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new ks(n)}function Ss(e,t){let s=t.milliseconds??0;for(const n of ws.slice(1))t[n]&&(s+=t[n]*e[n].milliseconds);return s}function bs(e,t){const s=Ss(e,t)<0?-1:1;ps.reduceRight(((n,r)=>{if(qe(t[r]))return n;if(n){const a=t[n]*s,i=e[r][n],o=Math.floor(a/i);t[r]+=o*s,t[n]-=o*i*s}return r}),null),ps.reduce(((s,n)=>{if(qe(t[n]))return s;if(s){const r=t[s]%1;t[s]-=r,t[n]+=r*e[s][n]}return n}),null)}class ks{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let s=t?ys:ms;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||te.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,t){return ks.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new c("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new ks({values:at(e,ks.normalizeUnit),loc:te.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ae(e))return ks.fromMillis(e);if(ks.isDuration(e))return e;if("object"==typeof e)return ks.fromObject(e);throw new c(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[s]=function(e){return Dt(e,[zt,Ut])}(e);return s?ks.fromObject(s,t):ks.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[s]=function(e){return Dt(e,[Pt,os])}(e);return s?ks.fromObject(s,t):ks.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new c("need to specify a reason the Duration is invalid");const s=e instanceof Se?e:new Se(e,t);if(ve.throwOnInvalid)throw new i(s);return new ks({invalid:s})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new l(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const s={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Ct.create(this.loc,s).formatDurationFromString(this,e):ds}toHuman(e={}){if(!this.isValid)return ds;const t=ps.map((t=>{const s=this.values[t];return qe(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(s)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Je(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return gn.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Ss(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ks.fromDurationLike(e),s={};for(const e of ps)(Pe(t.values,e)||Pe(this.values,e))&&(s[e]=t.get(e)+this.get(e));return vs(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const t=ks.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const s of Object.keys(this.values))t[s]=rt(e(this.values[s],s));return vs(this,{values:t},!0)}get(e){return this[ks.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return vs(this,{values:{...this.values,...at(e,ks.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:s,matrix:n}={}){return vs(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:s})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return bs(this.matrix,e),vs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return vs(this,{values:function(e){const t={};for(const[s,n]of Object.entries(e))0!==n&&(t[s]=n);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>ks.normalizeUnit(e)));const t={},s={},n=this.toObject();let r;for(const a of ps)if(e.indexOf(a)>=0){r=a;let e=0;for(const t in s)e+=this.matrix[t][a]*s[t],s[t]=0;Ae(n[a])&&(e+=n[a]);const i=Math.trunc(e);t[a]=i,s[a]=(1e3*e-1e3*i)/1e3}else Ae(n[a])&&(s[a]=n[a]);for(const e in s)0!==s[e]&&(t[r]+=e===r?s[e]:s[e]/this.matrix[r][e]);return bs(this.matrix,t),vs(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return vs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const n of ps)if(t=this.values[n],s=e.values[n],!(void 0===t||0===t?void 0===s||0===s:t===s))return!1;var t,s;return!0}}const Cs="Invalid Interval";class Ts{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new c("need to specify a reason the Interval is invalid");const s=e instanceof Se?e:new Se(e,t);if(ve.throwOnInvalid)throw new a(s);return new Ts({invalid:s})}static fromDateTimes(e,t){const s=yn(e),n=yn(t),r=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Ts.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(yn).filter((e=>this.contains(e))).sort(((e,t)=>e.toMillis()-t.toMillis())),s=[];let{s:n}=this,r=0;for(;n+this.e?this.e:e;s.push(Ts.fromDateTimes(n,a)),n=a,r+=1}return s}splitBy(e){const t=ks.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let s,{s:n}=this,r=1;const a=[];for(;ne*r)));s=+e>+this.e?this.e:e,a.push(Ts.fromDateTimes(n,s)),n=s,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,s=this.e=s?null:Ts.fromDateTimes(t,s)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ts.fromDateTimes(t,s)}static merge(e){const[t,s]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],s)=>t?t.overlaps(s)||t.abutsStart(s)?[e,t.union(s)]:[e.concat([t]),s]:[e,s]),[[],null]);return s&&t.push(s),t}static xor(e){let t=null,s=0;const n=[],r=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),a=Array.prototype.concat(...r).sort(((e,t)=>e.time-t.time));for(const e of a)s+="s"===e.type?1:-1,1===s?t=e.time:(t&&+t!=+e.time&&n.push(Ts.fromDateTimes(t,e.time)),t=null);return Ts.merge(n)}difference(...e){return Ts.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?Ct.create(this.s.loc.clone(t),e).formatInterval(this):Cs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Cs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Cs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Cs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ks.invalid(this.invalidReason)}mapEndpoints(e){return Ts.fromDateTimes(e(this.s),e(this.e))}}class Ls{static hasDST(e=ve.defaultZone){const t=gn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return z.isValidZone(e)}static normalizeZone(e){return ae(e,ve.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||te.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||te.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||te.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||te.create(t,s,r)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||te.create(t,s,r)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null}={}){return(n||te.create(t,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:n=null}={}){return(n||te.create(t,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return te.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return te.create(t,null,"gregory").eras(e)}static features(){return{relative:Ve(),localeWeek:_e()}}}function xs(e,t){const s=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=s(t)-s(e);return Math.floor(ks.fromMillis(n).as("days"))}function Ds(e,t,s,n){let[r,a,i,o]=function(e,t,s){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const s=xs(e,t);return(s-s%7)/7}],["days",xs]],r={},a=e;let i,o;for(const[l,c]of n)s.indexOf(l)>=0&&(i=l,r[l]=c(e,t),o=a.plus(r),o>t?(r[l]--,(e=a.plus(r))>t&&(o=e,r[l]--,e=a.plus(r))):e=o);return[e,r,o,i]}(e,t,s);const l=t-r,c=s.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(i0?ks.fromMillis(l,n).shiftTo(...c).plus(u):u}function Ms(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let s=0;s=s&&n<=r&&(t+=n-s)}}return parseInt(t,10)}return t}(e))}}const Is=`[ ${String.fromCharCode(160)}]`,Ns=new RegExp(Is,"g");function Os(e){return e.replace(/\./g,"\\.?").replace(Ns,Is)}function Es(e){return e.replace(/\./g,"").replace(Ns," ").toLowerCase()}function $s(e,t){return null===e?null:{regex:RegExp(e.map(Os).join("|")),deser:([s])=>e.findIndex((e=>Es(s)===Es(e)))+t}}function Fs(e,t){return{regex:e,deser:([,e,t])=>nt(e,t),groups:t}}function qs(e){return{regex:e,deser:([e])=>e}}const As={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Ws=null;function Vs(e,t){return Array.prototype.concat(...e.map((e=>function(e,t){if(e.literal)return e;const s=Ps(Ct.macroTokenToFormatOpts(e.val),t);return null==s||s.includes(void 0)?e:s}(e,t))))}class _s{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Vs(Ct.parseFormat(t),e),this.units=this.tokens.map((t=>function(e,t){const s=ue(t),n=ue(t,"{2}"),r=ue(t,"{3}"),a=ue(t,"{4}"),i=ue(t,"{6}"),o=ue(t,"{1,2}"),l=ue(t,"{1,3}"),c=ue(t,"{1,6}"),u=ue(t,"{1,9}"),d=ue(t,"{2,4}"),h=ue(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return $s(t.eras("short"),0);case"GG":return $s(t.eras("long"),0);case"y":return Ms(c);case"yy":case"kk":return Ms(d,tt);case"yyyy":case"kkkk":return Ms(a);case"yyyyy":return Ms(h);case"yyyyyy":return Ms(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Ms(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Ms(n);case"MMM":return $s(t.months("short",!0),1);case"MMMM":return $s(t.months("long",!0),1);case"LLL":return $s(t.months("short",!1),1);case"LLLL":return $s(t.months("long",!1),1);case"o":case"S":return Ms(l);case"ooo":case"SSS":return Ms(r);case"u":return qs(u);case"uu":return qs(o);case"uuu":case"E":case"c":return Ms(s);case"a":return $s(t.meridiems(),0);case"EEE":return $s(t.weekdays("short",!1),1);case"EEEE":return $s(t.weekdays("long",!1),1);case"ccc":return $s(t.weekdays("short",!0),1);case"cccc":return $s(t.weekdays("long",!0),1);case"Z":case"ZZ":return Fs(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return Fs(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return qs(/[a-z_+-/]{1,256}?/i);case" ":return qs(/[^\S\n\r]/);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e))),this.disqualifyingUnit=this.units.find((e=>e.invalidReason)),!this.disqualifyingUnit){const[e,t]=[`^${(s=this.units).map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,s];this.regex=RegExp(e,"i"),this.handlers=t}var s}explainFromTokens(e){if(this.isValid){const[t,s]=function(e,t,s){const n=e.match(t);if(n){const e={};let t=1;for(const r in s)if(Pe(s,r)){const a=s[r],i=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(n.slice(t,t+i))),t+=i}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,r,a]=s?function(e){let t,s=null;return qe(e.z)||(s=z.create(e.z)),qe(e.Z)||(s||(s=new ne(e.Z)),t=e.Z),qe(e.q)||(e.M=3*(e.q-1)+1),qe(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),qe(e.u)||(e.S=Be(e.u)),[Object.keys(e).reduce(((t,s)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(s);return n&&(t[n]=e[s]),t}),{}),s,t]}(s):[null,null,void 0];if(Pe(s,"a")&&Pe(s,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:s,result:n,zone:r,specificOffset:a}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Hs(e,t,s){return new _s(e,s).explainFromTokens(t)}function Ps(e,t){if(!e)return null;const s=Ct.create(t,e).dtFormatter((Ws||(Ws=gn.fromMillis(1555555555555)),Ws)),n=s.formatToParts(),r=s.resolvedOptions();return n.map((t=>function(e,t,s){const{type:n,value:r}=e;if("literal"===n){const e=/^\s+$/.test(r);return{literal:!e,val:e?" ":r}}const a=t[n];let i=n;"hour"===n&&(i=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":s.hour12?"hour12":"hour24");let o=As[i];if("object"==typeof o&&(o=o[a]),o)return{literal:!1,val:o}}(t,e,r)))}const zs="Invalid DateTime",Us=864e13;function Zs(e){return new Se("unsupported zone",`the zone "${e.name}" is not supported`)}function Rs(e){return null===e.weekData&&(e.weekData=Me(e.c)),e.weekData}function js(e){return null===e.localWeekData&&(e.localWeekData=Me(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Bs(e,t){const s={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new gn({...s,...t,old:s})}function Js(e,t,s){let n=e-60*t*1e3;const r=s.offset(n);if(t===r)return[n,t];n-=60*(r-t)*1e3;const a=s.offset(n);return r===a?[n,r]:[e-60*Math.min(r,a)*1e3,Math.max(r,a)]}function Gs(e,t){const s=new Date(e+=60*t*1e3);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),millisecond:s.getUTCMilliseconds()}}function Ys(e,t,s){return Js(Ke(e),t,s)}function Xs(e,t){const s=e.o,n=e.c.year+Math.trunc(t.years),r=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:n,month:r,day:Math.min(e.c.day,Xe(n,r))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=ks.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=Ke(a);let[l,c]=Js(o,s,e.zone);return 0!==i&&(l+=i,c=e.zone.offset(l)),{ts:l,o:c}}function Ks(e,t,s,n,r,a){const{setZone:i,zone:o}=s;if(e&&0!==Object.keys(e).length||t){const n=t||o,r=gn.fromObject(e,{...s,zone:n,specificOffset:a});return i?r:r.setZone(o)}return gn.invalid(new Se("unparsable",`the input "${r}" can't be parsed as ${n}`))}function Qs(e,t,s=!0){return e.isValid?Ct.create(te.create("en-US"),{allowZ:s,forceSimple:!0}).formatDateTimeFromString(e,t):null}function en(e,t){const s=e.c.year>9999||e.c.year<0;let n="";return s&&e.c.year>=0&&(n+="+"),n+=Ze(e.c.year,s?6:4),t?(n+="-",n+=Ze(e.c.month),n+="-",n+=Ze(e.c.day)):(n+=Ze(e.c.month),n+=Ze(e.c.day)),n}function tn(e,t,s,n,r,a){let i=Ze(e.c.hour);return t?(i+=":",i+=Ze(e.c.minute),0===e.c.millisecond&&0===e.c.second&&s||(i+=":")):i+=Ze(e.c.minute),0===e.c.millisecond&&0===e.c.second&&s||(i+=Ze(e.c.second),0===e.c.millisecond&&n||(i+=".",i+=Ze(e.c.millisecond,3))),r&&(e.isOffsetFixed&&0===e.offset&&!a?i+="Z":e.o<0?(i+="-",i+=Ze(Math.trunc(-e.o/60)),i+=":",i+=Ze(Math.trunc(-e.o%60))):(i+="+",i+=Ze(Math.trunc(e.o/60)),i+=":",i+=Ze(Math.trunc(e.o%60)))),a&&(i+="["+e.zone.ianaName+"]"),i}const sn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},rn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},an=["year","month","day","hour","minute","second","millisecond"],on=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ln=["year","ordinal","hour","minute","second","millisecond"];function cn(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new l(e);return t}(e)}}function un(e,t){const s=ae(t.zone,ve.defaultZone);if(!s.isValid)return gn.invalid(Zs(s));const n=te.fromObject(t);let r,a;if(qe(e.year))r=ve.now();else{for(const t of an)qe(e[t])&&(e[t]=sn[t]);const t=$e(e)||Fe(e);if(t)return gn.invalid(t);const n=function(e){return fn[e]||(void 0===mn&&(mn=ve.now()),fn[e]=e.offset(mn)),fn[e]}(s);[r,a]=Ys(e,n,s)}return new gn({ts:r,zone:s,loc:n,o:a})}function dn(e,t,s){const n=!!qe(s.round)||s.round,r=(e,r)=>{e=Je(e,n||s.calendary?0:2,!0);return t.loc.clone(s).relFormatter(s).format(e,r)},a=n=>s.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(s.unit)return r(a(s.unit),s.unit);for(const e of s.units){const t=a(e);if(Math.abs(t)>=1)return r(t,e)}return r(e>t?-0:0,s.units[s.units.length-1])}function hn(e){let t,s={};return e.length>0&&"object"==typeof e[e.length-1]?(s=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[s,t]}let mn,fn={};class gn{constructor(e){const t=e.zone||ve.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new Se("invalid input"):null)||(t.isValid?null:Zs(t));this.ts=qe(e.ts)?ve.now():e.ts;let n=null,r=null;if(!s){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,r]=[e.old.c,e.old.o];else{const a=Ae(e.o)&&!e.old?e.o:t.offset(this.ts);n=Gs(this.ts,a),s=Number.isNaN(n.year)?new Se("invalid input"):null,n=s?null:n,r=s?null:a}}this._zone=t,this.loc=e.loc||te.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new gn({})}static local(){const[e,t]=hn(arguments),[s,n,r,a,i,o,l]=t;return un({year:s,month:n,day:r,hour:a,minute:i,second:o,millisecond:l},e)}static utc(){const[e,t]=hn(arguments),[s,n,r,a,i,o,l]=t;return e.zone=ne.utcInstance,un({year:s,month:n,day:r,hour:a,minute:i,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const s=(n=e,"[object Date]"===Object.prototype.toString.call(n)?e.valueOf():NaN);var n;if(Number.isNaN(s))return gn.invalid("invalid input");const r=ae(t.zone,ve.defaultZone);return r.isValid?new gn({ts:s,zone:r,loc:te.fromObject(t)}):gn.invalid(Zs(r))}static fromMillis(e,t={}){if(Ae(e))return e<-Us||e>Us?gn.invalid("Timestamp out of range"):new gn({ts:e,zone:ae(t.zone,ve.defaultZone),loc:te.fromObject(t)});throw new c(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ae(e))return new gn({ts:1e3*e,zone:ae(t.zone,ve.defaultZone),loc:te.fromObject(t)});throw new c("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const s=ae(t.zone,ve.defaultZone);if(!s.isValid)return gn.invalid(Zs(s));const n=te.fromObject(t),r=at(e,cn),{minDaysInFirstWeek:a,startOfWeek:i}=Ee(r,n),l=ve.now(),c=qe(t.specificOffset)?s.offset(l):t.specificOffset,u=!qe(r.ordinal),d=!qe(r.year),h=!qe(r.month)||!qe(r.day),m=d||h,f=r.weekYear||r.weekNumber;if((m||u)&&f)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new o("Can't mix ordinal dates with month/day");const g=f||r.weekday&&!m;let y,p,w=Gs(l,c);g?(y=on,p=nn,w=Me(w,a,i)):u?(y=ln,p=rn,w=Ne(w)):(y=an,p=sn);let v=!1;for(const e of y){qe(r[e])?r[e]=v?p[e]:w[e]:v=!0}const S=g?function(e,t=4,s=1){const n=We(e.weekYear),r=Ue(e.weekNumber,1,et(e.weekYear,t,s)),a=Ue(e.weekday,1,7);return n?r?!a&&Ce("weekday",e.weekday):Ce("week",e.weekNumber):Ce("weekYear",e.weekYear)}(r,a,i):u?function(e){const t=We(e.year),s=Ue(e.ordinal,1,Ye(e.year));return t?!s&&Ce("ordinal",e.ordinal):Ce("year",e.year)}(r):$e(r),b=S||Fe(r);if(b)return gn.invalid(b);const k=g?Ie(r,a,i):u?Oe(r):r,[C,T]=Ys(k,c,s),L=new gn({ts:C,zone:s,o:T,loc:n});return r.weekday&&m&&e.weekday!==L.weekday?gn.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${L.toISO()}`):L.isValid?L:gn.invalid(L.invalid)}static fromISO(e,t={}){const[s,n]=function(e){return Dt(e,[Qt,ns],[es,rs],[ts,as],[ss,is])}(e);return Ks(s,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[s,n]=function(e){return Dt(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[jt,Bt])}(e);return Ks(s,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[s,n]=function(e){return Dt(e,[Jt,Xt],[Gt,Xt],[Yt,Kt])}(e);return Ks(s,n,t,"HTTP",t)}static fromFormat(e,t,s={}){if(qe(e)||qe(t))throw new c("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:r=null}=s,a=te.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[i,o,l,u]=function(e,t,s){const{result:n,zone:r,specificOffset:a,invalidReason:i}=Hs(e,t,s);return[n,r,a,i]}(a,e,t);return u?gn.invalid(u):Ks(i,o,s,`format ${t}`,e,l)}static fromString(e,t,s={}){return gn.fromFormat(e,t,s)}static fromSQL(e,t={}){const[s,n]=function(e){return Dt(e,[ls,ns],[cs,us])}(e);return Ks(s,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new c("need to specify a reason the DateTime is invalid");const s=e instanceof Se?e:new Se(e,t);if(ve.throwOnInvalid)throw new r(s);return new gn({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const s=Ps(e,te.fromObject(t));return s?s.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return Vs(Ct.parseFormat(e),te.fromObject(t)).map((e=>e.val)).join("")}static resetCache(){mn=void 0,fn={}}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Rs(this).weekYear:NaN}get weekNumber(){return this.isValid?Rs(this).weekNumber:NaN}get weekday(){return this.isValid?Rs(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?js(this).weekday:NaN}get localWeekNumber(){return this.isValid?js(this).weekNumber:NaN}get localWeekYear(){return this.isValid?js(this).weekYear:NaN}get ordinal(){return this.isValid?Ne(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ls.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ls.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ls.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ls.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,s=Ke(this.c),n=this.zone.offset(s-e),r=this.zone.offset(s+e),a=this.zone.offset(s-n*t),i=this.zone.offset(s-r*t);if(a===i)return[this];const o=s-a*t,l=s-i*t,c=Gs(o,a),u=Gs(l,i);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Bs(this,{ts:o}),Bs(this,{ts:l})]:[this]}get isInLeapYear(){return Ge(this.year)}get daysInMonth(){return Xe(this.year,this.month)}get daysInYear(){return this.isValid?Ye(this.year):NaN}get weeksInWeekYear(){return this.isValid?et(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?et(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:s,calendar:n}=Ct.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:s,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(ne.instance(e),t)}toLocal(){return this.setZone(ve.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:s=!1}={}){if((e=ae(e,ve.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||s){const t=e.offset(this.ts),s=this.toObject();[n]=Ys(s,t,e)}return Bs(this,{ts:n,zone:e})}return gn.invalid(Zs(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:s}={}){return Bs(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:s})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=at(e,cn),{minDaysInFirstWeek:s,startOfWeek:n}=Ee(t,this.loc),r=!qe(t.weekYear)||!qe(t.weekNumber)||!qe(t.weekday),a=!qe(t.ordinal),i=!qe(t.year),l=!qe(t.month)||!qe(t.day),c=i||l,u=t.weekYear||t.weekNumber;if((c||a)&&u)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&a)throw new o("Can't mix ordinal dates with month/day");let d;r?d=Ie({...Me(this.c,s,n),...t},s,n):qe(t.ordinal)?(d={...this.toObject(),...t},qe(t.day)&&(d.day=Math.min(Xe(d.year,d.month),d.day))):d=Oe({...Ne(this.c),...t});const[h,m]=Ys(d,this.o,this.zone);return Bs(this,{ts:h,o:m})}plus(e){if(!this.isValid)return this;return Bs(this,Xs(this,ks.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Bs(this,Xs(this,ks.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const s={},n=ks.normalizeUnit(e);switch(n){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;tthis.valueOf(),i=Ds(a?this:e,a?e:this,r,n);var o;return a?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(gn.now(),e,t)}until(e){return this.isValid?Ts.fromDateTimes(this,e):this}hasSame(e,t,s){if(!this.isValid)return!1;const n=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t,s)<=n&&n<=r.endOf(t,s)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||gn.fromObject({},{zone:this.zone}),s=e.padding?thise.valueOf()),Math.min)}static max(...e){if(!e.every(gn.isDateTime))throw new c("max requires all arguments be DateTimes");return He(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,s={}){const{locale:n=null,numberingSystem:r=null}=s;return Hs(te.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,s={}){return gn.fromFormatExplain(e,t,s)}static buildFormatParser(e,t={}){const{locale:s=null,numberingSystem:n=null}=t,r=te.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});return new _s(r,e)}static fromFormatParser(e,t,s={}){if(qe(e)||qe(t))throw new c("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:r=null}=s,a=te.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});if(!a.equals(t.locale))throw new c(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`);const{result:i,zone:o,specificOffset:l,invalidReason:u}=t.explainFromTokens(e);return u?gn.invalid(u):Ks(i,o,s,`format ${t.format}`,e,l)}static get DATE_SHORT(){return f}static get DATE_MED(){return g}static get DATE_MED_WITH_WEEKDAY(){return y}static get DATE_FULL(){return p}static get DATE_HUGE(){return w}static get TIME_SIMPLE(){return v}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return b}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return C}static get TIME_24_WITH_SECONDS(){return T}static get TIME_24_WITH_SHORT_OFFSET(){return L}static get TIME_24_WITH_LONG_OFFSET(){return x}static get DATETIME_SHORT(){return D}static get DATETIME_SHORT_WITH_SECONDS(){return M}static get DATETIME_MED(){return I}static get DATETIME_MED_WITH_SECONDS(){return N}static get DATETIME_MED_WITH_WEEKDAY(){return O}static get DATETIME_FULL(){return E}static get DATETIME_FULL_WITH_SECONDS(){return $}static get DATETIME_HUGE(){return F}static get DATETIME_HUGE_WITH_SECONDS(){return q}}function yn(e){if(gn.isDateTime(e))return e;if(e&&e.valueOf&&Ae(e.valueOf()))return gn.fromJSDate(e);if(e&&"object"==typeof e)return gn.fromObject(e);throw new c(`Unknown datetime argument: ${e}, of type ${typeof e}`)}},147:(e,t,s)=>{s.d(t,{O:()=>n});const n=e=>{let t=e;return t=t.replace("https://api.weather.gov/",`${window.location.protocol}//${window.location.host}/`),t=t.replace("https://www.cpc.ncep.noaa.gov/",`${window.location.protocol}//${window.location.host}/`),t}},187:(e,t,s)=>{var n=s(592),r=s(519),a=s(440),i=s(413),o=s(716),l=s(47),c=s(125),u=s(24),d=s(211);const h=(e,t,s)=>({daytime:e.isDaytime,temperature:e.temperature||0,name:v(t.city),icon:e.icon,x:s.x,y:s.y,time:e.startTime}),m=(e,t,s,n)=>{let r=0,a=0;return r=56*(73-e),r-=n,r>1142-2*n?r=1142-2*n:r<0&&(r=0),a=25*(-175-t)*-1,a-=s,a>1200-2*s?a=1200-2*s:a<0&&(a=0),{x:a,y:r}},f=(e,t,s,n)=>{let r=0,a=0;return r=55.2*(25-e),r-=n,r>571-2*n?r=571-2*n:r<0&&(r=0),a=41.775*(-164.5-t)*-1,a-=s,a>600-2*s?a=600-2*s:a<0&&(a=0),{x:a,y:r}},g=(e,t,s,n)=>({minLat:-1*((t+2*n)/56-73),maxLat:-1*(t/56-73),minLon:-1*(-1*e/25+175),maxLon:-1*(-1*(e+2*s)/25+175)}),y=(e,t,s,n)=>({minLat:-1*((t+2*n)/55.2-25),maxLat:-1*(t/55.2-25),minLon:-1*(-1*e/41.775+164.5),maxLon:-1*(-1*(e+2*s)/41.775+164.5)}),p=(e,t,s)=>{let n=37*(e.lon-s),r=70*(t-e.lat);return r<30&&(r=30),r>282&&(r=282),n<40&&(n=40),n>580&&(n=580),{x:n,y:r}},w=(e,t,s)=>{let n=57*(e.lon-s),r=70*(t-e.lat);return r<30&&(r=30),r>282&&(r=282),n<40&&(n=40),n>580&&(n=580),{x:n,y:r}},v=e=>e.match(/[^,/;\\-]*/)[0].substr(0,12);var S=s(348);class b extends u.A{constructor(e,t){super(e,t,"Regional Forecast",!0),this.timing.totalScreens=3}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let s="images/Basemap2.png";"HI"===t.state?s="images/HawaiiRadarMap4.png":"AK"===t.state&&(s="images/AlaskaRadarMap6.png"),this.elem.querySelector(".map img").src=s;const c={x:240,y:117},u=((e,t,s,n,r)=>{if("AK"===r)return m(e,t,s,n);if("HI"===r)return f(e,t,s,n);let a=0,i=0;return a=55.2*(50.5-e),a-=n,a>1600-2*n?a=1600-2*n:a<0&&(a=0),i=41.775*(-127.5-t)*-1,i-=s,i>2550-2*s?i=2550-2*s:i<0&&(i=0),{x:i,y:a}})(t.latitude,t.longitude,c.x,c.y,t.state),d=(S=u.x,b=u.y,C=c.x,T=c.y,"AK"===(L=t.state)?g(S,b,C,T):"HI"===L?y(S,b,C,T):{minLat:-1*((b+2*T)/55.2-50.5),maxLat:-1*(b/55.2-50.5),minLon:-1*(-1*S/41.775+127.5),maxLon:-1*(-1*(S+2*C)/41.775+127.5)});var S,b,C,T,L;let x=2.5;"HI"===t.state&&(x=1);const D=Object.values(StationInfo).map((e=>({...e,targetDistance:x}))),M=[...RegionalCities,...D],I=[];M.forEach((e=>{if(e.lat>d.minLat&&e.latd.minLon&&e.lon{const a=(0,r.Io)(e.lon,e.lat,n.lon,n.lat);return s&&a>=t}),!0)&&I.push(e)}}));const N=(0,i.X1)(),O=await Promise.all(I.map((async e=>{try{const s=e?.point??await k(e.lat,e.lon);if(!s)throw new Error("No pre-loaded point");const n=(async(e,t)=>{try{const t=(await(0,a.Pq)(`https://api.weather.gov/gridpoints/${e.wfo}/${e.x},${e.y}/stations`)).features[0].id,s=await(0,a.Pq)(`${t}/observations/latest`);if(!s.properties.icon)return!1;const n=(0,o.Wu)(s.properties.icon,!s.properties.daytime);return!!n&&((0,l.b)(n),s.properties)}catch(e){return console.log(`Unable to get regional observations for ${t.Name??t.city}`),console.error(e.status,e.responseJSON),!1}})(s,e),r=await(0,a.Pq)(`https://api.weather.gov/gridpoints/${s.wfo}/${s.x},${s.y}/forecast`),i=((e,t,s,n)=>{"AK"===n&&p(e,t,s),"HI"===n&&w(e,t,s);let r=57*(e.lon-s),a=70*(t-e.lat);return a<30&&(a=30),a>282&&(a=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:a}})(e,d.maxLat,d.minLon,t.state),c=await n;if(!c)return!1;const u={daytime:!!/\/day\//.test(c.icon),temperature:N(c.temperature.value),name:v(e.city),icon:c.icon,x:i.x,y:i.y};return(0,l.b)((0,o.Wu)(u.icon,!u.daytime)),[u,h(r.properties.periods[1],e,i),h(r.properties.periods[2],e,i)]}catch(t){return console.log(`No regional forecast data for '${e.name??e.city}'`),console.log(t),!1}}))),E=O.filter((e=>e));0!==E.length?(this.data={regionalData:E,offsetXY:c,sourceXY:u},this.setStatus(n.Ay.loaded)):this.setStatus(n.Ay.noData)}drawCanvas(){super.drawCanvas();const{regionalData:e,sourceXY:t,offsetXY:s}=this.data,n=this.elem.querySelector(".title.dual .top"),r=this.elem.querySelector(".title.dual .bottom");if(0===this.screenIndex)n.innerHTML="Regional",r.innerHTML="Observations";else{const t=c.c9.fromISO(e[0][this.screenIndex].time).toLocaleString({weekday:"long"});n.innerHTML="Forecast for",r.innerHTML=e[0][this.screenIndex].daytime?t:`${t} Night`}const a=640/(2*s.x);this.elem.querySelector(".map").style.transform=`scale(${a}) translate(-${t.x}px, -${t.y}px)`;const i=e.map((e=>{const t={},s=e[this.screenIndex];t.icon={type:"img",src:(0,o.Wu)(s.icon,!s.daytime)},t.city=s.name;const{temperature:n}=s;t.temp=n;const{x:r,y:a}=s,i=this.fillTemplate("location",t);return i.style.left=`${r}px`,i.style.top=`${a}px`,i})),l=this.elem.querySelector(".location-container");l.innerHTML="",l.append(...i),this.finishDraw()}}const k=async(e,t)=>{const s=await(0,S.f)(e,t);return{x:s.properties.gridX,y:s.properties.gridY,wfo:s.properties.gridId}};(0,d.Kb)(new b(6,"regional-forecast"))},211:(e,t,s)=>{s.d(t,{F4:()=>k,Fx:()=>R,Ju:()=>T,K$:()=>z,Kb:()=>F,Lg:()=>A,XR:()=>E,ab:()=>C,eB:()=>j,iU:()=>w,kY:()=>$,pv:()=>O,q:()=>M,u6:()=>H,yB:()=>v});var n=s(430),r=s(592),a=s(519),i=s(440),o=s(348),l=s(302);document.addEventListener("DOMContentLoaded",(()=>{p()}));const c=[];let u,d=!1;const h={},m=6e5,f="#chkAutoRefresh";let g=null,y=0;const p=async()=>{window.addEventListener("resize",E),E();const e=localStorage.getItem("autoRefresh");document.querySelector(f).checked=!e||"true"===e,document.querySelector(f).addEventListener("change",V),q()},w=e=>!!e.type&&("navButton"===e.type?N(e.message):console.error(`Unknown event ${e.type}`)),v=e=>{if(e.id<0)return;if(!u)return;if(u.drawCanvas(c,S()),c[0].status===r.Ay.loading)return;const t=c.findIndex((e=>e.enabled&&e.timing.totalScreens>0));0!==e.id||e.status!==r.Ay.failed&&e.status!==r.Ay.retrying||(e.id=t,e.status=c[t].status),0===e.id&&e.status===r.Ay.loaded&&0===c[0].timing.totalScreens&&(e.id=t,e.status=c[t].status),k()&&e.id===t&&e.status===r.Ay.loaded&&L(C.command.firstFrame),S()c.reduce(((e,t)=>t.status!==r.Ay.loading?e+1:e),0),b=()=>{c.forEach((e=>e.hideCanvas()))},k=()=>d,C={response:{previous:Symbol("previous"),inProgress:Symbol("inProgress"),next:Symbol("next")},command:{firstFrame:Symbol("firstFrame"),previousFrame:Symbol("previousFrame"),nextFrame:Symbol("nextFrame"),lastFrame:Symbol("lastFrame")}},T=e=>{e.type===C.response.previous&&x(-1),e.type===C.response.next&&x(1)},L=e=>{const t=M();if(u.hideCanvas(),!t){let e,t=0;do{c[t].status===r.Ay.loaded&&c[t].timing.totalScreens>0&&(e=c[t]),t+=1}while(!e&&t{const t=c.length,s=D();let n;for(let i=0;i0));i+=1);if(n<=s&&U())return;const i=c[n];b(),e<0&&i.showCanvas(C.command.lastFrame),e>0&&i.showCanvas(C.command.firstFrame)},D=()=>c.findIndex((e=>e.active)),M=()=>c[D()],I=e=>{d=e;const t=document.querySelector("#NavigatePlay");localStorage.setItem("play",d),d?((0,n.A)(!0),t.title="Pause",t.src="images/nav/ic_pause_white_24dp_2x.png"):((0,n.A)(!1),t.title="Play",t.src="images/nav/ic_play_arrow_white_24dp_2x.png"),u&&d&&!M()&&L(C.command.firstFrame)},N=e=>{switch(e){case"play":I(!0);break;case"playToggle":I(!d);break;case"stop":I(!1);break;case"next":I(!1),L(C.command.nextFrame);break;case"previous":I(!1),L(C.command.previousFrame);break;case"menu":I(!1),u.showCanvas(),b();break;default:console.error(`Unknown navButton ${e}`)}},O=e=>c[e],E=()=>{const e=l.A.wide.value?854:640,t=document.querySelector("#divTwcBottom").getBoundingClientRect().width/e,s=window.innerHeight/480,n=Math.min(t,s);n<1||document.fullscreenElement||l.A.kiosk?document.querySelector("#container").style.transform=`scale(${n})`:document.querySelector("#container").style.transform="unset"},$=()=>{c.forEach((e=>{e.status=r.Ay.loading}))},F=e=>{c[e.navId]=e,q()},q=()=>{const e=document.querySelector("#enabledDisplays");if(!e)return;const t=c.map((e=>e.generateCheckbox(e.defaultEnabled))).filter((e=>e));e.innerHTML="",e.append(...t)},A=e=>{u=e},W=e=>{document.querySelector("#spanCity").innerHTML=`${e.city}, `,document.querySelector("#spanState").innerHTML=e.state,document.querySelector("#spanStationId").innerHTML=e.stationId,document.querySelector("#spanRadarId").innerHTML=e.radarId,document.querySelector("#spanZoneId").innerHTML=e.zoneId},V=e=>{const{checked:t}=e.target;t?P():z(),localStorage.setItem("autoRefresh",t)},_=e=>{e?(document.querySelector("#spanLastRefresh").innerHTML=e.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}),document.querySelector(f).checked&&P()):document.querySelector("#spanLastRefresh").innerHTML="(none)"},H=(e,t)=>{(async(e,t)=>{const s=await(0,o.f)(e.lat,e.lon);"function"==typeof t&&t(s);const n=await(0,i.Pq)(s.properties.observationStations),r=n.features[0].properties.stationIdentifier;let{city:a}=s.properties.relativeLocation.properties;const{state:l}=s.properties.relativeLocation.properties;r in StationInfo&&(a=StationInfo[r].city,[a]=a.split("/"),a=a.replace(/\s+$/,"")),h.latitude=e.lat,h.longitude=e.lon,h.zoneId=s.properties.forecastZone.substr(-6),h.radarId=s.properties.radarStation.substr(-3),h.stationId=r,h.weatherOffice=s.properties.cwa,h.city=a,h.state=l,h.timeZone=s.properties.timeZone,h.forecast=s.properties.forecast,h.forecastGridData=s.properties.forecastGridData,h.stations=n.features,W(h),b(),document.querySelector("#loading").style.display="none",u&&(await u.drawCanvas(),u.showCanvas()),c.forEach((e=>e.getData(h)))})(e,t),_(null)},P=()=>{if(g)return;y=0;const e=()=>{y+=500;let e=m-y;e<0&&(e=0);const t=new Date(e);document.querySelector("#spanRefreshCountDown").innerHTML=`${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}`,y>=m&&!k()&&Z()};g=window.setInterval(e,500),e()},z=()=>{g&&(window.clearInterval(g),document.querySelector("#spanRefreshCountDown").innerHTML="--:--",g=null)},U=()=>!!(y>=m&&k())&&(Z(),!0),Z=()=>{Z.callback&&Z.callback()},R=e=>{Z.callback=e},j=()=>h.timeZone},247:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(47),r=s(125),a=s(592),i=s(24),o=s(211);class l extends i.A{constructor(e,t){super(e,t,"Almanac",!0),this.backgroundImage0=(0,n.u)("images/BackGround3_1.png"),(0,n.b)("images/2/Full-Moon.gif"),(0,n.b)("images/2/Last-Quarter.gif"),(0,n.b)("images/2/New-Moon.gif"),(0,n.b)("images/2/First-Quarter.gif"),this.timing.totalScreens=1}async getData(e){const t=super.getData(e),s=e??this.weatherParameters,{sun:n,moon:r}=this.calcSunMoonData(s);this.data={sun:n,moon:r},this.getDataCallback(),t&&this.setStatus(a.Ay.loaded)}calcSunMoonData(e){const t=[SunCalc.getTimes(new Date,e.latitude,e.longitude),SunCalc.getTimes(r.c9.local().plus({days:1}).toJSDate(),e.latitude,e.longitude)],s=[];let n=r.c9.local().minus({days:1}),{phase:a}=SunCalc.getMoonIllumination(n.toJSDate()),i=0;do{const e=a;n=n.plus({days:1}),a=SunCalc.getMoonIllumination(n.toJSDate()).phase,e<.25&&a>=.25&&s.push(this.getMoonTransition(.25,"First",n)),e<.5&&a>=.5&&s.push(this.getMoonTransition(.5,"Full",n)),e<.75&&a>=.75&&s.push(this.getMoonTransition(.75,"Last",n)),e>a&&s.push(this.getMoonTransition(0,"New",n)),i+=1}while(i<=30&&s.length<4);return{sun:t,moon:s}}getMoonTransition(e,t,s,n=0){let r=s,{phase:a}=SunCalc.getMoonIllumination(r.toJSDate()),i=0;const o={hours:0===n?-1:0,minutes:1===n?1:0,seconds:2===n?-1:0,milliseconds:3===n?1:0};let l=(t,s)=>t=e;n%2==0&&(l=(t,s)=>t>e&&s<=e);do{const s=a;if(r=r.plus(o),a=SunCalc.getMoonIllumination(r.toJSDate()).phase,a>.9&&(a-=1),l(s,a)){if(n>=3)break;return this.getMoonTransition(e,t,r,n+1)}i+=1}while(i<1e3);return{phase:t,date:r}}async drawCanvas(){super.drawCanvas();const e=this.data,t=r.c9.local(),s=t.plus({days:1});this.elem.querySelector(".day-1").innerHTML=t.toLocaleString({weekday:"long"}),this.elem.querySelector(".day-2").innerHTML=s.toLocaleString({weekday:"long"}),this.elem.querySelector(".rise-1").innerHTML=r.c9.fromJSDate(e.sun[0].sunrise).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".rise-2").innerHTML=r.c9.fromJSDate(e.sun[1].sunrise).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-1").innerHTML=r.c9.fromJSDate(e.sun[0].sunset).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-2").innerHTML=r.c9.fromJSDate(e.sun[1].sunset).toLocaleString(r.c9.TIME_SIMPLE).toLowerCase();const n=e.moon.map((e=>{const t={},s=e.date.toLocaleString({month:"short",day:"numeric"});return t.date=s,t.type=e.phase,t.icon={type:"img",src:c(e.phase)},this.fillTemplate("day",t)})),a=this.elem.querySelector(".moon .days");a.innerHTML="",a.append(...n),this.finishDraw()}async getSun(){return new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push(e)}))}}const c=e=>{switch(e){case"Full":return"images/2/Full-Moon.gif";case"Last":return"images/2/Last-Quarter.gif";case"New":return"images/2/New-Moon.gif";default:return"images/2/First-Quarter.gif"}},u=new l(9,"almanac");(0,o.Kb)(u);const d=u.getSun.bind(u)},302:(e,t,s)=>{s.d(t,{A:()=>d});var n=s(999);const r="Settings";const a=class{constructor(e,t,s,r,a,i,o){this.shortName=e,this.name=t,this.defaultValue=r,this.myValue=r,this.type=s??"checkbox",this.sticky=i,this.values=o,this.changeAction=a??(()=>{});const l=(0,n.J)()?.[`settings-${e}-${s}`];let c;"checkbox"===s&&void 0!==l&&(c="true"===l),"select"===s&&void 0!==l&&(c=parseFloat(l)),"select"===s&&void 0!==l&&Number.isNaN(c)&&(c=l);const u=c??this.getFromLocalStorage();if(i&&null!==u&&(this.myValue=u),"select"===s)this.selectChange({target:{value:this.myValue}});else this.checkboxChange({target:{checked:this.myValue}})}generateSelect(){const e=document.createElement("label");e.for=`settings-${this.shortName}-select`,e.id=`settings-${this.shortName}-label`;const t=document.createElement("span");t.innerHTML=`${this.name} `,e.append(t);const s=document.createElement("select");return s.id=`settings-${this.shortName}-select`,s.name=`settings-${this.shortName}-select`,s.addEventListener("change",(e=>this.selectChange(e))),this.values.forEach((([e,t])=>{const n=document.createElement("option");n.value="number"==typeof e?e.toFixed(2):e,n.innerHTML=t,s.append(n)})),e.append(s),this.element=e,this.selectHighlight(this.myValue),e}generateCheckbox(){const e=document.createElement("label");e.for=`settings-${this.shortName}-checkbox`,e.id=`settings-${this.shortName}-label`;const t=document.createElement("input");t.type="checkbox",t.value=!0,t.id=`settings-${this.shortName}-checkbox`,t.name=`settings-${this.shortName}-checkbox`,t.checked=this.myValue,t.addEventListener("change",(e=>this.checkboxChange(e)));const s=document.createElement("span");return s.innerHTML=this.name,e.append(t,s),this.element=e,e}checkboxChange(e){this.myValue=e.target.checked,this.storeToLocalStorage(this.myValue),this.changeAction(this.myValue)}selectChange(e){this.myValue=parseFloat(e.target.value),Number.isNaN(this.myValue)&&(this.myValue=e.target.value),this.storeToLocalStorage(this.myValue),this.changeAction(this.myValue)}storeToLocalStorage(e){if(!this.sticky)return;const t=localStorage?.getItem(r)??"{}",s=JSON.parse(t);s[this.shortName]=e,localStorage?.setItem(r,JSON.stringify(s))}getFromLocalStorage(){const e=localStorage?.getItem(r);try{if(e){const t=JSON.parse(e)?.[this.shortName];if(void 0!==t)switch(this.type){case"boolean":case"select":return t;default:return null}}}catch{return null}return null}get value(){return this.myValue}set value(e){if(this.myValue=e,"select"===this.type)this.selectHighlight(e);else this.element.checked=e;this.storeToLocalStorage(this.myValue),this.changeAction(this.myValue)}selectHighlight(e){this.element.querySelectorAll("option").forEach((t=>{t.selected=e?.toFixed?.(2)===t.value||e===t.value}))}generate(){return"select"===this.type?this.generateSelect():this.generateCheckbox()}};document.addEventListener("DOMContentLoaded",(()=>{o()}));const i={speed:{value:1}},o=()=>{i.wide=new a("wide","Widescreen","checkbox",!1,l,!0),i.kiosk=new a("kiosk","Kiosk","boolean",!1,c,!1),i.speed=new a("speed","Speed","select",1,null,!0,[[.5,"Very Fast"],[.75,"Fast"],[1,"Normal"],[1.25,"Slow"],[1.5,"Very Slow"]]),i.units=new a("units","Units","select","us",u,!0,[["us","US"],["si","Metric"]]);const e=Object.values(i).map((e=>e.generate())),t=document.querySelector("#settings");t.innerHTML="",t.append(...e)},l=e=>{const t=document.querySelector("#divTwc");e?t.classList.add("wide"):t.classList.remove("wide")},c=e=>{const t=document.querySelector("body");e?(t.classList.add("kiosk"),window.dispatchEvent(new Event("resize"))):t.classList.remove("kiosk")},u=()=>{u.firstRunDone&&window.location.reload(),u.firstRunDone=!0},d=i},348:(e,t,s)=>{s.d(t,{f:()=>r});var n=s(440);const r=async(e,t)=>{try{return await(0,n.Pq)(`https://api.weather.gov/points/${e},${t}`)}catch(s){return console.log(`Unable to get point ${e}, ${t}`),console.error(s),!1}}},413:(e,t,s)=>{s.d(t,{Mi:()=>d,NA:()=>u,S_:()=>c,X1:()=>l,X4:()=>r,u7:()=>o});var n=s(302);const r=(e,t)=>Math.trunc(e*10**t)/10**t,a=e=>Math.round(e/1.60934),i=e=>Math.round(9*e/5+32),o=(e="si")=>{let t=e=>Math.round(e);return e!==n.A.units.value&&(t=a),"si"===n.A.units.value?t.units="kph":t.units="MPH",t},l=(e="si")=>{let t=e=>Math.round(e);return e!==n.A.units.value&&(t=i),"si"===n.A.units.value?t.units="C":t.units="F",t},c=(e="si")=>{let t=e=>Math.round(e);return e!==n.A.units.value&&(t=e=>{return 100*Math.round((t=e,Math.round(t/.3048)/100));var t}),"si"===n.A.units.value?t.units="m.":t.units="ft.",t},u=(e="si")=>{let t=e=>Math.round(e/1e3);return e!==n.A.units.value&&(t=e=>{return Math.round((t=e,Math.round(t/1.60934)/1e3));var t}),"si"===n.A.units.value?t.units=" km.":t.units=" mi.",t},d=(e="si")=>{let t=e=>Math.round(e/100);return e!==n.A.units.value&&(t=e=>{return(t=e,r(2953e-7*t,2)).toFixed(2);var t}),"si"===n.A.units.value?t.units=" mbar":t.units=" in.hg",t}},423:(e,t,s)=>{s.d(t,{A:()=>p});var n=s(592),r=s(47),a=s(440),i=s(519),o=s(891),l=s(716),c=s(24),u=s(211),d=s(413);const h=["U","C","H","W","Y","T","S","M","O","L","A","F","B","N","V","R","D","E","I","G","J"];class m extends c.A{constructor(e,t){super(e,t,"Current Conditions",!0),this.backgroundImage=(0,r.u)("images/BackGround1_1.png")}async getData(e){const t=super.getData(e),s=(e??this.weatherParameters).stations.filter((e=>4===e?.properties?.stationIdentifier?.length&&!h.includes(e.properties.stationIdentifier.slice(0,1))));let i,o,c=0;for(;!i&&cthis.stillWaiting()}),null===i.features[0].properties.temperature.value||null===i.features[0].properties.windSpeed.value||null===i.features[0].properties.textDescription||""===i.features[0].properties.textDescription||null===i.features[0].properties.icon||null===i.features[0].properties.dewpoint.value||null===i.features[0].properties.barometricPressure.value)throw i=void 0,new Error(`Unable to get observations: ${o.properties.stationIdentifier}, trying next station`)}catch(e){console.error(e)}}if(!i)return console.error("All current weather stations exhausted"),this.isEnabled&&this.setStatus(n.Ay.failed),void this.getDataCallback(void 0);this.data=g({...i,station:o}),this.getDataCallback(),t&&((0,r.b)((0,l.XV)(i.features[0].properties.icon)),this.setStatus(n.Ay.loaded))}async drawCanvas(){super.drawCanvas();let e=this.data.observations.textDescription;e.length>15&&(e=f(e));const t={temp:this.data.Temperature+String.fromCharCode(176),condition:e,wind:this.data.WindDirection.padEnd(3,"")+this.data.WindSpeed.toString().padStart(3," "),location:(0,o.C)(this.data.station.properties.name).substr(0,20),humidity:`${this.data.Humidity}%`,dewpoint:this.data.DewPoint+String.fromCharCode(176),ceiling:0===this.data.Ceiling?"Unlimited":this.data.Ceiling+this.data.CeilingUnit,visibility:this.data.Visibility+this.data.VisibilityUnit,pressure:`${this.data.Pressure} ${this.data.PressureDirection}`,icon:{type:"img",src:this.data.Icon}};this.data.WindGust&&(t["wind-gusts"]=`Gusts to ${this.data.WindGust}`),this.data.observations.heatIndex.value&&this.data.HeatIndex!==this.data.Temperature?(t["heat-index-label"]="Heat Index:",t["heat-index"]=this.data.HeatIndex+String.fromCharCode(176)):this.data.observations.windChill.value&&""!==this.data.WindChill&&this.data.WindChill{this.data&&e(this.data),this.getDataCallbacks.push((()=>e(this.data)))}))}}const f=e=>{let t=e;return t=t.replace(/Light/g,"L"),t=t.replace(/Heavy/g,"H"),t=t.replace(/Partly/g,"P"),t=t.replace(/Mostly/g,"M"),t=t.replace(/Few/g,"F"),t=t.replace(/Thunderstorm/g,"T'storm"),t=t.replace(/ in /g,""),t=t.replace(/Vicinity/g,""),t=t.replace(/ and /g," "),t=t.replace(/Freezing Rain/g,"Frz Rn"),t=t.replace(/Freezing/g,"Frz"),t=t.replace(/Unknown Precip/g,""),t=t.replace(/L Snow Fog/g,"L Snw/Fog"),t=t.replace(/ with /g,"/"),t},g=e=>{const t=(0,d.u7)(),s=(0,d.X1)(),n=(0,d.S_)(),r=(0,d.NA)(),a=(0,d.Mi)(),o=e.features[0].properties;e.observations=o,e.Temperature=s(o.temperature.value),e.TemperatureUnit=s.units,e.DewPoint=s(o.dewpoint.value),e.Ceiling=n(o.cloudLayers[0]?.base?.value??0),e.CeilingUnit=n.units,e.Visibility=r(o.visibility.value),e.VisibilityUnit=r.units,e.Pressure=a(o.barometricPressure.value),e.PressureUnit=a.units,e.HeatIndex=s(o.heatIndex.value),e.WindChill=s(o.windChill.value),e.WindSpeed=t(o.windSpeed.value),e.WindDirection=(0,i.Up)(o.windDirection.value),e.WindGust=t(o.windGust.value),e.WindSpeed=t(e.WindSpeed),e.WindUnit=t.units,e.Humidity=Math.round(o.relativeHumidity.value),e.Icon=(0,l.XV)(o.icon),e.PressureDirection="",e.TextConditions=o.textDescription;const c=o.barometricPressure.value-e.features[1].properties.barometricPressure.value;return c>150&&(e.PressureDirection="R"),c<-150&&(e.PressureDirection="F"),e},y=new m(1,"current-weather");(0,u.Kb)(y);const p=y.getCurrentWeather.bind(y)},430:(e,t,s)=>{s.d(t,{A:()=>a});let n=!1;const r=(e=!1)=>(r.controller||(r.controller=new NoSleep),n!==e&&(n=e,e?r.controller.enable():r.controller.disable())),a=r},440:(e,t,s)=>{s.d(t,{Pq:()=>r,Qq:()=>a,av:()=>i});var n=s(147);const r=(e,t)=>o(e,"json",t),a=(e,t)=>o(e,"text",t),i=(e,t)=>o(e,"blob",t),o=async(e,t,s={})=>{const r={method:"GET",mode:"cors",type:"GET",retryCount:0,...s};r.originalRetries=r.retryCount;let a=e;!0===r.cors&&(a=(0,n.O)(e));const i=new URL(a,`${window.location.origin}/`);r.data&&Object.keys(r.data).forEach((e=>{const t=r.data[e];i.searchParams.append(e,t)}));const o=await l(i,r);if(!o.ok)throw new Error(`Fetch error ${o.status} ${o.statusText} while fetching ${o.url}`);switch(t){case"json":return o.json();case"text":return o.text();case"blob":return o.blob();default:return o}},l=(e,t)=>new Promise(((s,n)=>{fetch(e,t).then((n=>{if(t.retryCount>0){if(n.status>=500&&n.status<=599&&t.retryCount>0){"function"==typeof t.stillWaiting&&t.retryCount===t.originalRetries&&t.stillWaiting();const n={...t,retryCount:t.retryCount-1};return s(c(u(t.originalRetries-n.retryCount),l,e,n))}return s(n)}return s(n)})).catch((e=>n(e)))})),c=(e,t,...s)=>new Promise((n=>{setTimeout((()=>{n(t(...s))}),e)})),u=e=>{switch(e){case 1:return 1e3;case 2:return 2e3;case 3:return 5e3;case 4:return 1e4;default:return 3e4}}},498:(e,t,s)=>{var n=s(592),r=s(440),a=s(125),i=s(716),o=s(47),l=s(24),c=s(211),u=s(302);class d extends l.A{constructor(e,t){super(e,t,"Extended Forecast",!0),this.timing.totalScreens=2}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let s;try{s=await(0,r.Pq)(t.forecast,{data:{units:u.A.units.value},retryCount:3,stillWaiting:()=>this.stillWaiting()})}catch(e){return console.error("Unable to get extended forecast"),console.error(e.status,e.responseJSON),void this.setStatus(n.Ay.failed)}this.data=h(s.properties.periods),this.screenIndex=0,this.setStatus(n.Ay.loaded)}async drawCanvas(){super.drawCanvas();const e=this.data.slice(0+3*this.screenIndex,3+3*this.screenIndex).map((e=>{const t={icon:{type:"img",src:e.icon},condition:e.text,date:e.dayName},{low:s}=e;void 0!==s&&(t["value-lo"]=Math.round(s));const{high:n}=e;return t["value-hi"]=Math.round(n),this.fillTemplate("day",t)})),t=this.elem.querySelector(".day-container");t.innerHTML="",t.append(...e),this.finishDraw()}}const h=e=>{const t=[0,1,2,3,4,5,6].map((e=>a.c9.local().startOf("day").plus({days:e}).toLocaleString({weekday:"short"})));let s=0;const n=[];return e.forEach((e=>{n[s]||n.push({dayName:"",low:void 0,high:void 0,text:void 0,icon:void 0});const r=n[s];r.icon=(0,i.XV)(e.icon),r.text=m(e.shortForecast),r.dayName=t[s],(0,o.b)(r.icon),e.isDaytime?(r.high=e.temperature,s+=1):r.low=e.temperature})),n},m=e=>{const t=[[/ and /gi," "],[/slight /gi,""],[/chance /gi,""],[/very /gi,""],[/patchy /gi,""],[/areas /gi,""],[/dense /gi,""],[/Thunderstorm/g,"T'Storm"]].reduce(((e,[t,s])=>e.replace(t,s)),e);let s=t.split(" ");-1!==t.indexOf("then")&&(s=t.split(" then "),s=s[1].split(" "));let n=s[0].substr(0,10),r="";s[1]&&(n.endsWith(".")?n=n.replace(/\./,""):r=s[1].substr(0,10),"Blowing"===r&&(r=""));let a=n;return""!==r&&(a+=` ${r}`),a};(0,c.Kb)(new d(8,"extended-forecast"))},503:(e,t,s)=>{var n=s(592),r=s(125),a=s(47),i=s(440),o=s(147),l=s(24),c=s(211);class u extends l.A{constructor(e,t){super(e,t,"Local Radar",!0),this.okToDrawCurrentConditions=!1,this.okToDrawCurrentDateTime=!1,this.dopplerRadarImageMax=6,this.timing.baseDelay=350,this.timing.delay=[{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:12,si:5}]}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;if("AK"===t.state||"HI"===t.state)return void this.setStatus(n.Ay.noData);let s="images/4000RadarMap2.jpg";"HI"===t.State&&(s="images/HawaiiRadarMap2.png"),this.baseMap=await(0,a.u)(s);const l=[];let u=r.c9.utc().minus({days:1}).startOf("day");for(;u<=r.c9.utc().startOf("day");)l.push(`https://mesonet.agron.iastate.edu/archive/data/${u.toFormat("yyyy/LL/dd")}/GIS/uscomp/`),u=u.plus({days:1});const d=(await Promise.all(l.map((async e=>{try{return(0,i.Qq)(e,{cors:!0})}catch(e){return console.log("Unable to get list of radars"),console.error(e),this.setStatus(n.Ay.failed),!1}})))).filter((e=>e)).flatMap(((e,t)=>{const s=(new DOMParser).parseFromString(e,"text/html"),n=s.createElement("base");n.href=l[t],s.head.append(n);const r=s.querySelectorAll("a"),a=[];return Array.from(r).forEach((e=>{e.innerHTML?.match(/n0r_\d{12}\.png/)&&a.push(e.href)})),a})),h=/_(\d{12})\.png/,m=d.sort(((e,t)=>e.match(h)[1]{let n=0,r=0;return n=55.2*(51.75-e.latitude),n-=s,n>3200-2*s?n=3200-2*s:n<0&&(n=0),r=41.775*(-130.37-e.longitude)*-1,r-=t,r>5100-2*t?r=5100-2*t:r<0&&(r=0),{x:2*r,y:2*n}})(t,240,138),w=document.createElement("canvas");w.width=y,w.height=1600;const v=w.getContext("2d");v.imageSmoothingEnabled=!1;const S=((e,t,s)=>{let n=0,r=0;return n=61.4481*(51-e.latitude),n-=s,n>6e3-2*s?n=6e3-2*s:n<0&&(n=0),r=42.1768*(-129.138-e.longitude)*-1,r-=t,r>2800-2*t?r=2800-2*t:r<0&&(r=0),{x:2*r,y:2*n}})(t,240,138),b=S.x/2,k=S.y/2,C=await Promise.all(m.map((async e=>{const t=document.createElement("canvas");t.width=640,t.height=367;const s=t.getContext("2d");s.imageSmoothingEnabled=!1;const n=await fetch((0,o.O)(e));if(!n.ok)throw new Error(`Unable to fetch radar error ${n.status} ${n.statusText} from ${n.url}`);const i=await n.blob(),l=e.match(/_(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)\./);let u;if(l){const[,e,t,s,n,a]=l;u=r.c9.fromObject({year:e,month:t,day:s,hour:n,minute:a},{zone:"UTC"}).setZone((0,c.eB)())}else u=r.c9.fromHTTP(n.headers.get("last-modified")).setZone((0,c.eB)());const d=await(0,a.u)(i);v.clearRect(0,0,y,1600),v.drawImage(d,0,0,y,1600),s.drawImage(await this.baseMap,p.x,p.y,480,276,0,0,640,367);const h=document.createElement("canvas");h.width=640,h.height=367;const m=h.getContext("2d",{willReadFrequently:!0});m.imageSmoothingEnabled=!1,m.drawImage(w,b,k,240,163.1,0,0,640,367),(e=>{const t=e.getImageData(0,0,e.canvas.width,e.canvas.height);for(let e=0;e{const s=e.getImageData(0,0,e.canvas.width,e.canvas.height),n=t.getImageData(0,0,t.canvas.width,t.canvas.height);for(let e=0;ee.elem))),this.timing.totalScreens=C.length,this.data=C.map((e=>e.canvas)),this.times=C.map((e=>e.time)),this.setStatus(n.Ay.loaded)}async drawCanvas(){super.drawCanvas();const e=this.times[this.screenIndex].toLocaleString(r.c9.TIME_SIMPLE),t=e.length>=8?e:` ${e}`;this.elem.querySelector(".header .right .time").innerHTML=t;const s=this.elem.querySelector(".frame").scrollHeight;this.elem.querySelector(".scroll-area").style.top=-this.screenIndex*s+"px",this.finishDraw()}}(0,c.Kb)(new u(10,"radar"))},516:(e,t,s)=>{var n=s(891);var r=s(423),a=s(211);const i=String.fromCharCode(176);let o,l=0;const c=()=>{const e=(0,a.q)();e?.okToDrawCurrentConditions?(l=(l+1)%d.length,u()):"progress"===e?.elemId&&(l=0)},u=async()=>{const e=await(0,r.A)();e&&h(d[l](e))},d=[e=>`Conditions at ${(0,n.C)(e.station.properties.name).substr(0,20)}`,e=>{let t=`Temp: ${e.Temperature}${i}${e.TemperatureUnit}`;return e.observations.heatIndex.value?t+=` Heat Index: ${e.HeatIndex}${i}${e.TemperatureUnit}`:e.observations.windChill.value&&(t+=` Wind Chill: ${e.WindChill}${i}${e.TemperatureUnit}`),t},e=>`Humidity: ${e.Humidity}% Dewpoint: ${e.DewPoint}${i}${e.TemperatureUnit}`,e=>`Barometric Pressure: ${e.Pressure} ${e.PressureUnit} ${e.PressureDirection}`,e=>{let t=e.WindSpeed>0?`Wind: ${e.WindDirection} ${e.WindSpeed} ${e.WindUnit}`:"Wind: Calm";return e.WindGust>0&&(t+=` Gusts to ${e.WindGust}`),t},e=>{const t=`${e.Ceiling} ${e.CeilingUnit}`;return`Visib: ${e.Visibility} ${e.VisibilityUnit} Ceiling: ${0===e.Ceiling?"Unlimited":t}`}],h=e=>{var t,s;t=".weather-display .scroll .fixed",s=t=>{t.innerHTML=e},[...document.querySelectorAll(t)].forEach(s)};document.addEventListener("DOMContentLoaded",(()=>{o||(o=setInterval(c,4e3)),u()}))},519:(e,t,s)=>{s.d(t,{Io:()=>r,LV:()=>a,Up:()=>n});const n=e=>["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor(e/22.5+.5)%16],r=(e,t,s,n)=>Math.sqrt((s-e)**2+(n-t)**2),a=(e,t)=>(e%t+t)%t},592:(e,t,s)=>{s.d(t,{Ay:()=>i,LR:()=>a,qx:()=>r});const n={loading:Symbol("loading"),loaded:Symbol("loaded"),failed:Symbol("failed"),noData:Symbol("noData"),disabled:Symbol("disabled"),retrying:Symbol("retrying")},r=e=>{switch(e){case n.loading:return"loading";case n.loaded:return"press-here";case n.failed:return"failed";case n.noData:return"no-data";case n.disabled:return"disabled";case n.retrying:return"retrying";default:return""}},a=["loading","press-here","failed","no-data","disabled","retrying"],i=n},652:(e,t,s)=>{var n=s(440),r=s(430),a=s(211),i=s(413),o=s(999),l=s(302);document.addEventListener("DOMContentLoaded",(()=>{m()}));const c=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),u="#txtAddress",d="#ToggleFullScreen",h="#btnGetGps",m=()=>{document.querySelector(u).addEventListener("focus",(e=>{e.target.select()})),(0,a.Fx)(b),document.querySelector("#NavigateMenu").addEventListener("click",S),document.querySelector("#NavigateRefresh").addEventListener("click",C),document.querySelector("#NavigateNext").addEventListener("click",T),document.querySelector("#NavigatePrevious").addEventListener("click",L),document.querySelector("#NavigatePlay").addEventListener("click",I),document.querySelector(d).addEventListener("click",y);const e=document.querySelector(h);e.addEventListener("click",O),navigator.geolocation||(e.style.display="none"),document.querySelector("#divTwc").addEventListener("mousemove",(()=>{document.fullscreenElement&&D()})),window.addEventListener("resize",E),E.wasFull=!1,document.querySelector(u).addEventListener("keydown",(e=>{"Enter"===e.code&&t()})),document.querySelector("#btnGetLatLng").addEventListener("click",(()=>t())),document.addEventListener("keydown",M),document.addEventListener("touchmove",(e=>{document.fullscreenElement&&e.preventDefault()})),$(u).devbridgeAutocomplete({serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest",deferRequestBy:300,paramName:"text",params:{f:"json",countryCode:"USA",category:c,maxSuggestions:10},dataType:"json",transformResult:e=>({suggestions:e.suggestions.map((e=>({value:e.text,data:e.magicKey})))}),minChars:3,showNoSuggestionNotice:!0,noSuggestionNotice:"No results found. Please try a different search string.",onSelect(e){f(e,this)},width:490});const t=()=>{const e=$(u).devbridgeAutocomplete();return e.suggestions[0]&&$(e.suggestionsContainer.children[0]).trigger("click"),!1},s=(0,o.J)(),n=s.latLonQuery&&s.latLon,r=s.latLonQuery??localStorage.getItem("latLonQuery"),i=s.latLon??localStorage.getItem("latLon"),m=localStorage.getItem("latLonFromGPS")&&!n;if(r&&i&&!m){document.querySelector(u).value=r,b(JSON.parse(i))}m&&O(),l.A.kiosk.value="true"===s["settings-kiosk-checkbox"];const g=s["settings-kiosk-checkbox"]??localStorage.getItem("play");null!==g&&"true"!==g||N("navButton","play"),document.querySelector("#btnClearQuery").addEventListener("click",(()=>{document.querySelector("#spanCity").innerHTML="",document.querySelector("#spanState").innerHTML="",document.querySelector("#spanStationId").innerHTML="",document.querySelector("#spanRadarId").innerHTML="",document.querySelector("#spanZoneId").innerHTML="",document.querySelector("#chkAutoRefresh").checked=!0,localStorage.removeItem("autoRefresh"),localStorage.removeItem("play"),N("navButton","play"),localStorage.removeItem("latLonQuery"),localStorage.removeItem("latLon"),localStorage.removeItem("latLonFromGPS"),document.querySelector(h).classList.remove("active")})),document.querySelector("#container").addEventListener("swiped-left",(()=>k("left"))),document.querySelector("#container").addEventListener("swiped-right",(()=>k("right")))},f=async(e,t)=>{if(t.previousSuggestionValue===e.value)return;const s=(await(0,n.Pq)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:e.value,magicKey:e.data,f:"json"}})).locations[0];s?(localStorage.removeItem("latLonFromGPS"),document.querySelector(h).classList.remove("active"),g(s.feature.geometry)):console.error("An unexpected error occurred. Please try a different search string.")},g=(e,t)=>{const s={lat:(0,i.X4)(e.y,4),lon:(0,i.X4)(e.x,4)};localStorage.setItem("latLonQuery",document.querySelector(u).value),localStorage.setItem("latLon",JSON.stringify(s)),b(s,t)},y=()=>(document.fullscreenElement?w():p(),(0,a.F4)()?(0,r.A)(!0):(0,r.A)(!1),D(),!1),p=()=>{const e=document.querySelector("#divTwc"),t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t?t.call(e,{navigationUI:"hide"}):window.scrollTo(0,0),(0,a.XR)(),D();const s=document.querySelector(d);s.src="images/nav/ic_fullscreen_exit_white_24dp_2x.png",s.title="Exit fullscreen"},w=()=>{document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),(0,a.XR)(),v()},v=()=>{const e=document.querySelector(d);e.src="images/nav/ic_fullscreen_white_24dp_2x.png",e.title="Enter fullscreen",document.querySelector("#divTwc").classList.remove("no-cursor");const t=document.querySelector("#divTwcBottom");t.classList.remove("hidden"),t.classList.add("visible")},S=()=>(N("navButton","menu"),!1),b=(e,t)=>{e&&(b.latLon=e);const{latLon:s}=b;s&&(document.querySelector(u).blur(),(0,a.K$)(),(0,a.u6)(s,t))},k=e=>{if("left"===e)T();else L()},C=()=>((0,a.kY)(),b(),!1),T=()=>(N("navButton","next"),!1),L=()=>(N("navButton","previous"),!1);let x=null;const D=()=>{document.activeElement.blur();const e=document.querySelector("#divTwcBottom");e.classList.remove("hidden"),e.classList.add("visible"),document.querySelector("#divTwc").classList.remove("no-cursor"),x&&(clearTimeout(x),x=null),x=setTimeout((()=>{document.fullscreenElement&&(e.classList.remove("visible"),e.classList.add("hidden"),document.querySelector("#divTwc").classList.add("no-cursor"))}),2e3)},M=e=>{const{key:t}=e;if(document.fullscreenElement||document.activeElement===document.body)switch(t){case" ":return e.preventDefault(),I(),!1;case"ArrowRight":case"PageDown":return e.preventDefault(),T(),!1;case"ArrowLeft":case"PageUp":return e.preventDefault(),L(),!1;case"ArrowUp":return e.preventDefault(),S(),!1;case"0":return C(),!1;case"F":case"f":return y(),!1}return!1},I=()=>(N("navButton","playToggle"),!1),N=(e,t={})=>{(0,a.iU)({type:e,message:t})},O=async()=>{if(!navigator.geolocation)return;const e=document.querySelector(h);if(e.classList.contains("active"))return e.classList.remove("active"),void localStorage.removeItem("latLonFromGPS");e.classList.add("active");const t=await(async()=>new Promise((e=>{navigator.geolocation.getCurrentPosition(e)})))(),{latitude:s,longitude:n}=t.coords,r=document.querySelector(u);r.value=`${(0,i.X4)(s,4)}, ${(0,i.X4)(n,4)}`,g({y:s,x:n},(e=>{const t=e.properties.relativeLocation.properties,a=`${t.city}, ${t.state}`;localStorage.setItem("latLon",JSON.stringify({lat:s,lon:n})),localStorage.setItem("latLonQuery",a),localStorage.setItem("latLonFromGPS",!0),r.value=`${t.city}, ${t.state}`}))},E=()=>{E.wasFull&&!document.fullscreenElement&&v(),!E.wasFull&&document.fullscreenElement,E.wasFull=!!document.fullscreenElement}},704:(e,t,s)=>{var n=s(592),r=s(440),a=s(24),i=s(211),o=s(302);class l extends a.A{constructor(e,t){super(e,t,"Local Forecast",!0),this.timing.baseDelay=5e3}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,s=await this.getRawData(t);if(!s)return void this.setStatus(n.Ay.failed);const r=c(s);this.screenTexts=r.map((e=>{let t=`${e.DayName.toUpperCase()}...`;return t+=e.Text.toUpperCase().replace("..."," "),t}));const a=this.screenTexts.map((e=>this.fillTemplate("forecast",{text:e}))),i=this.elem.querySelector(".forecasts");i.innerHTML="",i.append(...a),this.pageHeight=i.parentNode.scrollHeight,a.forEach((e=>{const t=Math.ceil(e.scrollHeight/this.pageHeight)*this.pageHeight;e.style.height=`${t}px`})),this.timing.totalScreens=i.scrollHeight/this.pageHeight,this.calcNavTiming(),this.setStatus(n.Ay.loaded)}async getRawData(e){try{return await(0,r.Pq)(e.forecast,{data:{units:o.A.units.value},retryCount:3,stillWaiting:()=>this.stillWaiting()})}catch(t){return console.error(`GetWeatherForecast failed: ${e.forecast}`),console.error(t.status,t.responseJSON),this.setStatus(n.Ay.failed),!1}}async drawCanvas(){super.drawCanvas();const e=-this.screenIndex*this.pageHeight;this.elem.querySelector(".forecasts").style.top=`${e}px`,this.finishDraw()}}const c=e=>e.properties.periods.slice(0,6).map((e=>({DayName:e.name.toUpperCase(),Text:e.detailedForecast})));(0,i.Kb)(new l(7,"local-forecast"))},709:(e,t,s)=>{var n=s(592),r=s(440),a=s(716),i=s(125),o=s(24),l=s(211),c=s(302);class u extends o.A{constructor(e,t,s){super(e,t,"Travel Forecast",s),this.timing.baseDelay=20;const n=TravelCities.length/4,r=Math.floor(n)-2,a=r%1;this.timing.delay=[450];for(let e=0;e{try{if(!e.point)throw new Error("No pre-loaded point");const t=await(0,r.Pq)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`,{data:{units:c.A.units.value}}),s=t.properties.periods[0].isDaytime?0:1;return{today:0===s,high:t.properties.periods[s].temperature,low:t.properties.periods[s+1].temperature,name:e.Name,icon:(0,a.Wu)(t.properties.periods[s].icon)}}catch(t){return console.error(`GetTravelWeather for ${e.Name} failed`),console.error(t.status,t.responseJSON),{name:e.Name,error:!0}}})),t=await Promise.all(e);this.data=t;this.data.some((e=>e.high))?(this.setStatus(n.Ay.loaded),this.drawLongCanvas()):this.setStatus(n.Ay.noData)}async drawLongCanvas(){const e=this.elem.querySelector(".travel-lines");e.innerHTML="";const t=this.data.map((e=>{if(e.error)return!1;const t={city:e};if(e.icon){t.city=e.name;const{low:s,high:n}=e,r=Math.round(s).toString(),a=Math.round(n).toString();t.low=r,t.high=a;const{icon:i}=e;t.icon={type:"img",src:i}}else t.error="NO TRAVEL DATA AVAILABLE";return this.fillTemplate("travel-row",t)})).filter((e=>e));e.append(...t)}async drawCanvas(){super.drawCanvas();const e=this.data;this.elem.querySelector(".header .title.dual .bottom").innerHTML=`For ${d(e)}`,this.finishDraw()}async showCanvas(){await this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".travel-lines").offsetHeight-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}getLongCanvas(){return this.longCanvas}}const d=e=>e.reduce(((e,t)=>{if(t&&""===e){return i.c9.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"");(0,l.Kb)(new u(5,"travel",!1))},716:(e,t,s)=>{s.d(t,{Wu:()=>n,XV:()=>r,ZJ:()=>a});const n=(e,t)=>{const s=t??e.indexOf("/night/")>=0,n=e=>`images/r/${e}`;let r=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[&,.?]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===r){const t=e.match(/&j=(.*)&/);[,r]=t}switch(r+(s?"-n":"")){case"skc":case"hot":case"haze":return n("Sunny.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return n("Clear-1992.gif");case"bkn":return n("Mostly-Cloudy-1994-2.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":return n("Partly-Clear-1994-2.gif");case"sct":case"few":return n("Partly-Cloudy.gif");case"sct-n":case"nsct":case"nsct-n":return n("Mostly-Clear.gif");case"ovc":case"ovc-n":return n("Cloudy.gif");case"fog":case"fog-n":return n("Fog.gif");case"rain_sleet":case"sleet":case"sleet-n":return n("Sleet.gif");case"rain_showers":case"rain_showers_high":return n("Scattered-Showers-1994-2.gif");case"rain_showers-n":case"rain_showers_high-n":return n("Scattered-Showers-Night-1994-2.gif");case"rain":case"rain-n":return n("Rain-1992.gif");case"snow":case"snow-n":return n(a>50?"Heavy-Snow-1994-2.gif":"Light-Snow.gif");case"rain_snow":case"rain_snow-n":return n("Rain-Snow-1992.gif");case"snow_fzra":case"snow_fzra-n":return n("Freezing-Rain-Snow-1992.gif");case"fzra":case"fzra-n":case"rain_fzra":case"rain_fzra-n":return n("Freezing-Rain-1992.gif");case"snow_sleet":case"snow_sleet-n":return n("Snow and Sleet.gif");case"tsra_sct":case"tsra":return n("Scattered-Tstorms-1994-2.gif");case"tsra_sct-n":case"tsra-n":return n("Scattered-Tstorms-Night-1994-2.gif");case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":case"hurricane-n":case"tropical_storm-n":return n("Thunderstorm.gif");case"wind":case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind-n":case"wind_few-n":case"wind_bkn-n":case"wind_ovc-n":return n("Wind.gif");case"wind_skc":return n("Sunny-Wind-1994.gif");case"wind_skc-n":case"wind_sct-n":return n("Clear-Wind-1994.gif");case"blizzard":case"blizzard-n":return n("Blowing Snow.gif");case"cold":return n("cold.gif");default:return console.log(`Unable to locate regional icon for ${r} ${e} ${s}`),!1}},r=(e,t)=>{if(!e)return!1;const s=e=>`images/${e}`,n=t??e.indexOf("/night/")>=0;let r=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[&,.?]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===r){const t=e.match(/&j=(.*)&/);[,r]=t}switch(r+(n?"-n":"")){case"skc":case"hot":case"haze":case"cold":return s("CC_Clear1.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return s("CC_Clear0.gif");case"sct":case"few":case"bkn":return s("CC_PartlyCloudy1.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":case"sct-n":case"nsct":case"nsct-n":return s("CC_PartlyCloudy0.gif");case"ovc":case"novc":case"ovc-n":return s("CC_Cloudy.gif");case"fog":case"fog-n":return s("CC_Fog.gif");case"rain_sleet":case"rain_sleet-n":case"sleet":case"sleet-n":return s("Sleet.gif");case"rain_showers":case"rain_showers_high":case"rain_showers-n":case"rain_showers_high-n":return s("CC_Showers.gif");case"rain":case"rain-n":return s("CC_Rain.gif");case"snow":case"snow-n":return s(a>50?"CC_Snow.gif":"CC_SnowShowers.gif");case"rain_snow":return s("CC_RainSnow.gif");case"snow_fzra":case"snow_fzra-n":case"fzra":case"fzra-n":case"rain_fzra":case"rain_fzra-n":return s("CC_FreezingRain.gif");case"snow_sleet":return s("Snow-Sleet.gif");case"tsra_sct":case"tsra":return s("EF_ScatTstorms.gif");case"tsra_sct-n":case"tsra-n":case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":case"hurricane-n":case"tropical_storm-n":return s("CC_TStorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind_skc":case"wind_few-n":case"wind_bkn-n":case"wind_ovc-n":case"wind_skc-n":case"wind_sct-n":return s("CC_Windy.gif");case"blizzard":case"blizzard-n":return s("Blowing-Snow.gif");default:return console.log(`Unable to locate icon for ${r} ${e} ${n}`),!1}},a=(e,t,s,n,r,a,i=!1)=>{const o=e=>`images/r/${e}`;let l=!1,c=!1,u=!1,d=!1,h=!1;return t.forEach((e=>{e.weather&&(e.weather.toLowerCase().includes("thunder")&&(l=!0),e.weather.toLowerCase().includes("snow")&&(c=!0),e.weather.toLowerCase().includes("ice")&&(u=!0),e.weather.toLowerCase().includes("fog")&&(d=!0),e.weather.toLowerCase().includes("wind")&&(h=!0))})),o(s>0||u?"Freezing-Rain-1992.gif":r>10?a>30||h?"Blowing Snow.gif":"Heavy-Snow-1994.gif":(r>0||c)&&l?"ThunderSnow.gif":r>0||c?"Light-Snow.gif":l?"Thunderstorm.gif":n>70?"Rain-1992.gif":n>50?"Shower.gif":n>30?i?"Scattered-Showers-Night.gif":"Scattered-Showers-1994.gif":d?"Fog.gif":e>70?"Cloudy.gif":e>50?i?"Partly-Clear-1994.gif":"Mostly-Cloudy-1994.gif":e>30?i?"Mostly-Clear.gif":"Partly-Cloudy.gif":i?"Clear-1992.gif":"Sunny.gif")}},749:(e,t,s)=>{var n=s(592),r=s(440),a=s(24),i=s(211);const o={Extreme:10,Severe:5},l={"Hurricane Warning":2,"Tornado Warning":3,"Severe Thunderstorm Warning":1};class c extends a.A{constructor(e,t,s){super(e,t,"Hazards",s),this.showOnProgress=!1,this.timing.totalScreens=0}async getData(e){const t=super.getData(e),s=this.checkbox.querySelector(".alert");s.classList.remove("show");try{const e=new URL("https://api.weather.gov/alerts/active");e.searchParams.append("point",`${this.weatherParameters.latitude},${this.weatherParameters.longitude}`),e.searchParams.append("limit",5);const t=(await(0,r.Pq)(e,{retryCount:3,stillWaiting:()=>this.stillWaiting()})).features??[],n=t.reduce(((e,t)=>e||"Immediate"===t.properties.urgency),!1),a=t.sort(((e,t)=>u(t.properties.severity,t.properties.event)-u(e.properties.severity,e.properties.event))).filter((e=>"Unknown"!==e.properties.severity&&(!n||"Immediate"===e.properties.urgency)));this.data=a,this.data.length>0&&s.classList.add("show")}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),this.isEnabled&&this.setStatus(n.Ay.failed),void this.getDataCallback(void 0)}this.getDataCallback(),t?this.drawLongCanvas():this.setStatus(n.Ay.loaded)}async drawLongCanvas(){const e=this.elem.querySelector(".hazard-lines");e.innerHTML="";const t=this.data.map((e=>{const t={};return t["hazard-text"]=`${e.properties.event}

${e.properties.description.replaceAll("\n\n","

").replaceAll("\n"," ")}`,this.fillTemplate("hazard",t)}));if(e.append(...t),0===t.length)return this.setStatus(n.Ay.loaded),this.timing.totalScreens=0,void this.setStatus(n.Ay.loaded);this.timing.baseDelay=20;const s=Math.max(Math.ceil(e.scrollHeight/400)-3,1);this.timing.delay=[550];for(let e=0;e{this.data&&e(this.data),this.getDataCallbacks.push((()=>e(this.data)))}))}screenIndexFromBaseCount(){const e=super.screenIndexFromBaseCount();return!1===e&&(this.timing.totalScreens=0),e}}const u=(e,t)=>(o[e]??0)+(l[t]??0);(0,i.Kb)(new c(0,"hazards",!0))},891:(e,t,s)=>{s.d(t,{C:()=>n});const n=e=>[/^[ A-Za-z]+ \/ /,/^[ A-Za-z]+\//,/^[ A-Za-z]+, /].reduce(((e,t)=>e.replace(t,"")),e)},951:(e,t,s)=>{var n=s(47),r=s(592),a=s(24),i=s(211);class o extends a.A{constructor(e,t){super(e,t,"",!1),this.backgroundImage=(0,n.u)("images/BackGround1_1.png"),this.timing=!1,document.addEventListener("DOMContentLoaded",(()=>{this.version=document.querySelector("#version").innerHTML,this.elem.querySelector(".container").addEventListener("click",this.lineClick.bind(this))})),this.okToDrawCurrentConditions=!1}async drawCanvas(e,t){if(!this.elem)return;if(super.drawCanvas(),this.progressCover||(this.progressCover=this.elem.querySelector(".scroll .cover")),!e)return;const s=e.map(((e,t)=>{if(!1===e.showOnProgress)return!1;const s={name:e.name},n=(0,r.qx)(e.status),a=this.fillTemplate("item",s);if(!a)return!1;const i=a.querySelector(".links");return i.classList.remove(...r.LR),i.classList.add(n),i.dataset.index=t,a})).filter((e=>e)),n=this.elem.querySelector(".container");n.innerHTML="",n.append(...s),this.finishDraw();const a=t/e.length;this.progressCover.style.width=100*(1-a)+"%",a<1?this.progressCover.parentNode.classList.add("show"):setTimeout((()=>this.progressCover.parentNode.classList.remove("show")),1e3)}lineClick(e){const t=e.target?.parentNode?.dataset?.index;if(void 0===t)return;const s=+t;(0,i.iU)("navButton");const n=(0,i.pv)(s);n&&n.status===r.Ay.loaded&&(n.showCanvas(i.ab.command.firstFrame),this.elem.classList.remove("show"))}}const l=new o(-1,"progress");(0,i.Lg)(l)},999:(e,t,s)=>{s.d(t,{J:()=>l}),document.addEventListener("DOMContentLoaded",(()=>r()));const n={kiosk:"settings-kiosk-checkbox"},r=()=>{const e=document.querySelector("#share-link");e.addEventListener("click",a),navigator?.clipboard||(e.textContent="Get Permalink")},a=async e=>{e.preventDefault();const t=document.querySelectorAll("input[type=checkbox]"),s={};[...t].forEach((e=>{e?.id&&(s[e.id]=e?.checked??!1)}));[...document.querySelectorAll("select")].forEach((e=>{e?.id&&(s[e.id]=e?.value??0)})),s.latLonQuery=localStorage.getItem("latLonQuery"),s.latLon=localStorage.getItem("latLon");const n=new URLSearchParams(s).toString(),r=new URL(`?${n}`,document.location.href);navigator?.clipboard?i(r):o(r)},i=async e=>{try{await navigator.clipboard.writeText(e.toString());const t=document.querySelector("#share-link-copied");t.style.display="inline",setTimeout((()=>{t.style.display="none"}),5e3)}catch(e){console.error(e)}},o=e=>{const t=document.querySelector("#share-link-instructions"),s=t.querySelector("#share-link-url");s.value=e,t.style.display="inline",s.focus(),s.select()},l=()=>{if(l.params)return l.params;const e=[...new URLSearchParams(window.location.search)];return e.forEach((t=>{const s=n[t[0]];s&&e.push([s,t[1]])})),l.params=Object.fromEntries(e),l.params}}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s(516),s(749),s(423),s(247),s(716),s(498),s(73),s(2),s(94),s(704),s(503),s(187),s(709),s(951);s(652)})(); \ No newline at end of file