UNPKG

@anoki/fse-ui

Version:

FSE UI components library

1 lines 71.7 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class G extends Error{}class Bn extends G{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class jn extends G{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Qn extends G{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Q extends G{}class Rt extends G{constructor(e){super(`Invalid unit ${e}`)}}class M extends G{}class U extends G{constructor(){super("Zone is an abstract class")}}const c="numeric",L="short",D="long",De={year:c,month:c,day:c},qt={year:c,month:L,day:c},Kn={year:c,month:L,day:c,weekday:L},Ht={year:c,month:D,day:c},Yt={year:c,month:D,day:c,weekday:D},Pt={hour:c,minute:c},Gt={hour:c,minute:c,second:c},Jt={hour:c,minute:c,second:c,timeZoneName:L},_t={hour:c,minute:c,second:c,timeZoneName:D},Bt={hour:c,minute:c,hourCycle:"h23"},jt={hour:c,minute:c,second:c,hourCycle:"h23"},Qt={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:L},Kt={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:D},Xt={year:c,month:c,day:c,hour:c,minute:c},en={year:c,month:c,day:c,hour:c,minute:c,second:c},tn={year:c,month:L,day:c,hour:c,minute:c},nn={year:c,month:L,day:c,hour:c,minute:c,second:c},Xn={year:c,month:L,day:c,weekday:L,hour:c,minute:c},rn={year:c,month:D,day:c,hour:c,minute:c,timeZoneName:L},sn={year:c,month:D,day:c,hour:c,minute:c,second:c,timeZoneName:L},an={year:c,month:D,day:c,weekday:D,hour:c,minute:c,timeZoneName:D},on={year:c,month:D,day:c,weekday:D,hour:c,minute:c,second:c,timeZoneName:D};class te{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 Le=null;class ge extends te{static get instance(){return Le===null&&(Le=new ge),Le}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Tn(e,t,r)}formatOffset(e,t){return me(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Ye=new Map;function er(n){let e=Ye.get(n);return e===void 0&&(e=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"}),Ye.set(n,e)),e}const tr={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function nr(n,e){const t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,i,a,o,u,l,f]=r;return[a,s,i,o,u,l,f]}function rr(n,e){const t=n.formatToParts(e),r=[];for(let s=0;s<t.length;s++){const{type:i,value:a}=t[s],o=tr[i];i==="era"?r[o]=a:h(o)||(r[o]=parseInt(a,10))}return r}const Ze=new Map;class $ extends te{static create(e){let t=Ze.get(e);return t===void 0&&Ze.set(e,t=new $(e)),t}static resetCache(){Ze.clear(),Ye.clear()}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{return!1}}constructor(e){super(),this.zoneName=e,this.valid=$.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Tn(e,t,r,this.name)}formatOffset(e,t){return me(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=er(this.name);let[s,i,a,o,u,l,f]=r.formatToParts?rr(r,t):nr(r,t);o==="BC"&&(s=-Math.abs(s)+1);const T=Ve({year:s,month:i,day:a,hour:u===24?0:u,minute:l,second:f,millisecond:0});let d=+t;const O=d%1e3;return d-=O>=0?O:1e3+O,(T-d)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ft={};function sr(n,e={}){const t=JSON.stringify([n,e]);let r=ft[t];return r||(r=new Intl.ListFormat(n,e),ft[t]=r),r}const Pe=new Map;function Ge(n,e={}){const t=JSON.stringify([n,e]);let r=Pe.get(t);return r===void 0&&(r=new Intl.DateTimeFormat(n,e),Pe.set(t,r)),r}const Je=new Map;function ir(n,e={}){const t=JSON.stringify([n,e]);let r=Je.get(t);return r===void 0&&(r=new Intl.NumberFormat(n,e),Je.set(t,r)),r}const _e=new Map;function ar(n,e={}){const{base:t,...r}=e,s=JSON.stringify([n,r]);let i=_e.get(s);return i===void 0&&(i=new Intl.RelativeTimeFormat(n,e),_e.set(s,i)),i}let ce=null;function or(){return ce||(ce=new Intl.DateTimeFormat().resolvedOptions().locale,ce)}const Be=new Map;function un(n){let e=Be.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Be.set(n,e)),e}const je=new Map;function ur(n){let e=je.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...ln,...e}),je.set(n,e)}return e}function lr(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let r,s;try{r=Ge(n).resolvedOptions(),s=n}catch{const u=n.substring(0,t);r=Ge(u).resolvedOptions(),s=u}const{numberingSystem:i,calendar:a}=r;return[s,i,a]}}function cr(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function fr(n){const e=[];for(let t=1;t<=12;t++){const r=m.utc(2009,t,1);e.push(n(r))}return e}function dr(n){const e=[];for(let t=1;t<=7;t++){const r=m.utc(2016,11,13+t);e.push(n(r))}return e}function Se(n,e,t,r){const s=n.listingMode();return s==="error"?null:s==="en"?t(e):r(e)}function hr(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||un(n.locale).numberingSystem==="latn"}class mr{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:i,...a}=r;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...r};r.padTo>0&&(o.minimumIntegerDigits=r.padTo),this.inf=ir(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):it(e,3);return v(t,this.padTo)}}}class yr{constructor(e,t,r){this.opts=r,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&$.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||s,this.dtf=Ge(t,i)}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(t=>{if(t.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:r}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class gr{constructor(e,t,r){this.opts={style:"long",...r},!t&&wn()&&(this.rtf=ar(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):$r(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ln={firstDay:1,minimalDays:4,weekend:[6,7]};class k{static fromOpts(e){return k.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,s,i=!1){const a=e||p.defaultLocale,o=a||(i?"en-US":or()),u=t||p.defaultNumberingSystem,l=r||p.defaultOutputCalendar,f=Ke(s)||p.defaultWeekSettings;return new k(o,u,l,f,a)}static resetCache(){ce=null,Pe.clear(),Je.clear(),_e.clear(),Be.clear(),je.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:s}={}){return k.create(e,t,r,s)}constructor(e,t,r,s,i){const[a,o,u]=lr(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=r||u||null,this.weekSettings=s,this.intl=cr(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=hr(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:k.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Ke(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Se(this,e,On,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");t&=!r;const s=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";if(!this.monthsCache[i][e]){const a=r?o=>this.dtFormatter(o,s).format():o=>this.extract(o,s,"month");this.monthsCache[i][e]=fr(a)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return Se(this,e,Nn,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=dr(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return Se(this,void 0,()=>In,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[m.utc(2016,11,13,9),m.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Se(this,e,Dn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[m.utc(-40,1,1),m.utc(2017,1,1)].map(r=>this.extract(r,t,"era"))),this.eraCache[e]})}extract(e,t,r){const s=this.dtFormatter(e,t),i=s.formatToParts(),a=i.find(o=>o.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new mr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new yr(e,this.intl,t)}relFormatter(e={}){return new gr(this.intl,this.isEnglish(),e)}listFormatter(e={}){return sr(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||un(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:kn()?ur(this.locale):ln}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 $e=null;class I extends te{static get utcInstance(){return $e===null&&($e=new I(0)),$e}static instance(e){return e===0?I.utcInstance:new I(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new I(Ce(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${me(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${me(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return me(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class cn extends te{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 R(n,e){if(h(n)||n===null)return e;if(n instanceof te)return n;if(Or(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?ge.instance:t==="utc"||t==="gmt"?I.utcInstance:I.parseSpecifier(t)||$.create(n)}else return q(n)?I.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new cn(n)}const tt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},dt={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]},wr=tt.hanidec.replace(/[\[|\]]/g,"").split("");function kr(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);if(n[t].search(tt.hanidec)!==-1)e+=wr.indexOf(n[t]);else for(const s in dt){const[i,a]=dt[s];r>=i&&r<=a&&(e+=r-i)}}return parseInt(e,10)}else return e}const Qe=new Map;function Tr(){Qe.clear()}function V({numberingSystem:n},e=""){const t=n||"latn";let r=Qe.get(t);r===void 0&&(r=new Map,Qe.set(t,r));let s=r.get(e);return s===void 0&&(s=new RegExp(`${tt[t]}${e}`),r.set(e,s)),s}let ht=()=>Date.now(),mt="system",yt=null,gt=null,wt=null,kt=60,Tt,St=null;class p{static get now(){return ht}static set now(e){ht=e}static set defaultZone(e){mt=e}static get defaultZone(){return R(mt,ge.instance)}static get defaultLocale(){return yt}static set defaultLocale(e){yt=e}static get defaultNumberingSystem(){return gt}static set defaultNumberingSystem(e){gt=e}static get defaultOutputCalendar(){return wt}static set defaultOutputCalendar(e){wt=e}static get defaultWeekSettings(){return St}static set defaultWeekSettings(e){St=Ke(e)}static get twoDigitCutoffYear(){return kt}static set twoDigitCutoffYear(e){kt=e%100}static get throwOnInvalid(){return Tt}static set throwOnInvalid(e){Tt=e}static resetCaches(){k.resetCache(),$.resetCache(),m.resetCache(),Tr()}}class W{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const fn=[0,31,59,90,120,151,181,212,243,273,304,334],dn=[0,31,60,91,121,152,182,213,244,274,305,335];function x(n,e){return new W("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function nt(n,e,t){const r=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const s=r.getUTCDay();return s===0?7:s}function hn(n,e,t){return t+(we(n)?dn:fn)[e-1]}function mn(n,e){const t=we(n)?dn:fn,r=t.findIndex(i=>i<e),s=e-t[r];return{month:r+1,day:s}}function rt(n,e){return(n-e+7)%7+1}function Ee(n,e=4,t=1){const{year:r,month:s,day:i}=n,a=hn(r,s,i),o=rt(nt(r,s,i),t);let u=Math.floor((a-o+14-e)/7),l;return u<1?(l=r-1,u=ye(l,e,t)):u>ye(r,e,t)?(l=r+1,u=1):l=r,{weekYear:l,weekNumber:u,weekday:o,...We(n)}}function pt(n,e=4,t=1){const{weekYear:r,weekNumber:s,weekday:i}=n,a=rt(nt(r,1,e),t),o=K(r);let u=s*7+i-a-7+e,l;u<1?(l=r-1,u+=K(l)):u>o?(l=r+1,u-=K(r)):l=r;const{month:f,day:y}=mn(l,u);return{year:l,month:f,day:y,...We(n)}}function Ae(n){const{year:e,month:t,day:r}=n,s=hn(e,t,r);return{year:e,ordinal:s,...We(n)}}function Ot(n){const{year:e,ordinal:t}=n,{month:r,day:s}=mn(e,t);return{year:e,month:r,day:s,...We(n)}}function vt(n,e){if(!h(n.localWeekday)||!h(n.localWeekNumber)||!h(n.localWeekYear)){if(!h(n.weekday)||!h(n.weekNumber)||!h(n.weekYear))throw new Q("Cannot mix locale-based week fields with ISO-based week fields");return h(n.localWeekday)||(n.weekday=n.localWeekday),h(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),h(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Sr(n,e=4,t=1){const r=Fe(n.weekYear),s=b(n.weekNumber,1,ye(n.weekYear,e,t)),i=b(n.weekday,1,7);return r?s?i?!1:x("weekday",n.weekday):x("week",n.weekNumber):x("weekYear",n.weekYear)}function pr(n){const e=Fe(n.year),t=b(n.ordinal,1,K(n.year));return e?t?!1:x("ordinal",n.ordinal):x("year",n.year)}function yn(n){const e=Fe(n.year),t=b(n.month,1,12),r=b(n.day,1,xe(n.year,n.month));return e?t?r?!1:x("day",n.day):x("month",n.month):x("year",n.year)}function gn(n){const{hour:e,minute:t,second:r,millisecond:s}=n,i=b(e,0,23)||e===24&&t===0&&r===0&&s===0,a=b(t,0,59),o=b(r,0,59),u=b(s,0,999);return i?a?o?u?!1:x("millisecond",s):x("second",r):x("minute",t):x("hour",e)}function h(n){return typeof n>"u"}function q(n){return typeof n=="number"}function Fe(n){return typeof n=="number"&&n%1===0}function Or(n){return typeof n=="string"}function vr(n){return Object.prototype.toString.call(n)==="[object Date]"}function wn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function kn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Mr(n){return Array.isArray(n)?n:[n]}function Mt(n,e,t){if(n.length!==0)return n.reduce((r,s)=>{const i=[e(s),s];return r&&t(r[0],i[0])===r[0]?r:i},null)[1]}function Nr(n,e){return e.reduce((t,r)=>(t[r]=n[r],t),{})}function ee(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ke(n){if(n==null)return null;if(typeof n!="object")throw new M("Week settings must be an object");if(!b(n.firstDay,1,7)||!b(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!b(e,1,7)))throw new M("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function b(n,e,t){return Fe(n)&&n>=e&&n<=t}function Ir(n,e){return n-e*Math.floor(n/e)}function v(n,e=2){const t=n<0;let r;return t?r="-"+(""+-n).padStart(e,"0"):r=(""+n).padStart(e,"0"),r}function z(n){if(!(h(n)||n===null||n===""))return parseInt(n,10)}function H(n){if(!(h(n)||n===null||n===""))return parseFloat(n)}function st(n){if(!(h(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function it(n,e,t="round"){const r=10**e;switch(t){case"expand":return n>0?Math.ceil(n*r)/r:Math.floor(n*r)/r;case"trunc":return Math.trunc(n*r)/r;case"round":return Math.round(n*r)/r;case"floor":return Math.floor(n*r)/r;case"ceil":return Math.ceil(n*r)/r;default:throw new RangeError(`Value rounding ${t} is out of range`)}}function we(n){return n%4===0&&(n%100!==0||n%400===0)}function K(n){return we(n)?366:365}function xe(n,e){const t=Ir(e-1,12)+1,r=n+(e-t)/12;return t===2?we(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ve(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function Nt(n,e,t){return-rt(nt(n,1,e),t)+e-1}function ye(n,e=4,t=1){const r=Nt(n,e,t),s=Nt(n+1,e,t);return(K(n)-r+s)/7}function Xe(n){return n>99?n:n>p.twoDigitCutoffYear?1900+n:2e3+n}function Tn(n,e,t,r=null){const s=new Date(n),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const a={timeZoneName:e,...i},o=new Intl.DateTimeFormat(t,a).formatToParts(s).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function Ce(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const r=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-r:r;return t*60+s}function Sn(n){const e=Number(n);if(typeof n=="boolean"||n===""||!Number.isFinite(e))throw new M(`Invalid unit value ${n}`);return e}function be(n,e){const t={};for(const r in n)if(ee(n,r)){const s=n[r];if(s==null)continue;t[e(r)]=Sn(s)}return t}function me(n,e){const t=Math.trunc(Math.abs(n/60)),r=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${v(t,2)}:${v(r,2)}`;case"narrow":return`${s}${t}${r>0?`:${r}`:""}`;case"techie":return`${s}${v(t,2)}${v(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function We(n){return Nr(n,["hour","minute","second","millisecond"])}const Dr=["January","February","March","April","May","June","July","August","September","October","November","December"],pn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Er=["J","F","M","A","M","J","J","A","S","O","N","D"];function On(n){switch(n){case"narrow":return[...Er];case"short":return[...pn];case"long":return[...Dr];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 vn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Mn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],xr=["M","T","W","T","F","S","S"];function Nn(n){switch(n){case"narrow":return[...xr];case"short":return[...Mn];case"long":return[...vn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const In=["AM","PM"],br=["Before Christ","Anno Domini"],Fr=["BC","AD"],Vr=["B","A"];function Dn(n){switch(n){case"narrow":return[...Vr];case"short":return[...Fr];case"long":return[...br];default:return null}}function Cr(n){return In[n.hour<12?0:1]}function Wr(n,e){return Nn(e)[n.weekday-1]}function Lr(n,e){return On(e)[n.month-1]}function Zr(n,e){return Dn(e)[n.year<0?0:1]}function $r(n,e,t="always",r=!1){const s={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."]},i=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&i){const y=n==="days";switch(e){case 1:return y?"tomorrow":`next ${s[n][0]}`;case-1:return y?"yesterday":`last ${s[n][0]}`;case 0:return y?"today":`this ${s[n][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=s[n],f=r?u?l[1]:l[2]||l[1]:u?s[n][0]:n;return a?`${o} ${f} ago`:`in ${o} ${f}`}function It(n,e){let t="";for(const r of n)r.literal?t+=r.val:t+=e(r.val);return t}const Ar={D:De,DD:qt,DDD:Ht,DDDD:Yt,t:Pt,tt:Gt,ttt:Jt,tttt:_t,T:Bt,TT:jt,TTT:Qt,TTTT:Kt,f:Xt,ff:tn,fff:rn,ffff:an,F:en,FF:nn,FFF:sn,FFFF:on};class N{static create(e,t={}){return new N(e,t)}static parseFormat(e){let t=null,r="",s=!1;const i=[];for(let a=0;a<e.length;a++){const o=e.charAt(a);o==="'"?((r.length>0||s)&&i.push({literal:s||/^\s+$/.test(r),val:r===""?"'":r}),t=null,r="",s=!s):s||o===t?r+=o:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&i.push({literal:s||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return Ar[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),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,r=void 0){if(this.opts.forceSimple)return v(e,t);const s={...this.opts};return t>0&&(s.padTo=t),r&&(s.signDisplay=r),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const r=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(d,O)=>this.loc.extract(e,d,O),a=d=>e.isOffsetFixed&&e.offset===0&&d.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,d.format):"",o=()=>r?Cr(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(d,O)=>r?Lr(e,d):i(O?{month:d}:{month:d,day:"numeric"},"month"),l=(d,O)=>r?Wr(e,d):i(O?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const O=N.macroTokenToFormatOpts(d);return O?this.formatWithSystemDefault(e,O):d},y=d=>r?Zr(e,d):i({era:d},"era"),T=d=>{switch(d){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 o();case"d":return s?i({day:"numeric"},"day"):this.num(e.day);case"dd":return s?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return s?i({month:"numeric"},"month"):this.num(e.month);case"MM":return s?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return s?i({year:"numeric"},"year"):this.num(e.year);case"yy":return s?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return y("short");case"GG":return y("long");case"GGGGG":return y("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 f(d)}};return It(N.parseFormat(t),T)}formatDurationFromString(e,t){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,s=f=>{switch(f[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(f,y)=>T=>{const d=s(T);if(d){const O=y.isNegativeDuration&&d!==y.largestUnit?r:1;let F;return this.opts.signMode==="negativeLargestOnly"&&d!==y.largestUnit?F="never":this.opts.signMode==="all"?F="always":F="auto",this.num(f.get(d)*O,T.length,F)}else return T},a=N.parseFormat(t),o=a.reduce((f,{literal:y,val:T})=>y?f:f.concat(T),[]),u=e.shiftTo(...o.map(s).filter(f=>f)),l={isNegativeDuration:u<0,largestUnit:Object.keys(u.values)[0]};return It(a,i(u,l))}}const En=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ne(...n){const e=n.reduce((t,r)=>t+r.source,"");return RegExp(`^${e}$`)}function re(...n){return e=>n.reduce(([t,r,s],i)=>{const[a,o,u]=i(e,s);return[{...t,...a},o||r,u]},[{},null,1]).slice(0,2)}function se(n,...e){if(n==null)return[null,null];for(const[t,r]of e){const s=t.exec(n);if(s)return r(s)}return[null,null]}function xn(...n){return(e,t)=>{const r={};let s;for(s=0;s<n.length;s++)r[n[s]]=z(e[t+s]);return[r,null,t+s]}}const bn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Ur=`(?:${bn.source}?(?:\\[(${En.source})\\])?)?`,at=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Fn=RegExp(`${at.source}${Ur}`),ot=RegExp(`(?:[Tt]${Fn.source})?`),zr=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Rr=/(\d{4})-?W(\d\d)(?:-?(\d))?/,qr=/(\d{4})-?(\d{3})/,Hr=xn("weekYear","weekNumber","weekDay"),Yr=xn("year","ordinal"),Pr=/(\d{4})-(\d\d)-(\d\d)/,Vn=RegExp(`${at.source} ?(?:${bn.source}|(${En.source}))?`),Gr=RegExp(`(?: ${Vn.source})?`);function X(n,e,t){const r=n[e];return h(r)?t:z(r)}function Jr(n,e){return[{year:X(n,e),month:X(n,e+1,1),day:X(n,e+2,1)},null,e+3]}function ie(n,e){return[{hours:X(n,e,0),minutes:X(n,e+1,0),seconds:X(n,e+2,0),milliseconds:st(n[e+3])},null,e+4]}function ke(n,e){const t=!n[e]&&!n[e+1],r=Ce(n[e+1],n[e+2]),s=t?null:I.instance(r);return[{},s,e+3]}function Te(n,e){const t=n[e]?$.create(n[e]):null;return[{},t,e+1]}const _r=RegExp(`^T?${at.source}$`),Br=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function jr(n){const[e,t,r,s,i,a,o,u,l]=n,f=e[0]==="-",y=u&&u[0]==="-",T=(d,O=!1)=>d!==void 0&&(O||d&&f)?-d:d;return[{years:T(H(t)),months:T(H(r)),weeks:T(H(s)),days:T(H(i)),hours:T(H(a)),minutes:T(H(o)),seconds:T(H(u),u==="-0"),milliseconds:T(st(l),y)}]}const Qr={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ut(n,e,t,r,s,i,a){const o={year:e.length===2?Xe(z(e)):z(e),month:pn.indexOf(t)+1,day:z(r),hour:z(s),minute:z(i)};return a&&(o.second=z(a)),n&&(o.weekday=n.length>3?vn.indexOf(n)+1:Mn.indexOf(n)+1),o}const Kr=/^(?:(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 Xr(n){const[,e,t,r,s,i,a,o,u,l,f,y]=n,T=ut(e,s,r,t,i,a,o);let d;return u?d=Qr[u]:l?d=0:d=Ce(f,y),[T,new I(d)]}function es(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ts=/^(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$/,ns=/^(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$/,rs=/^(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 Dt(n){const[,e,t,r,s,i,a,o]=n;return[ut(e,s,r,t,i,a,o),I.utcInstance]}function ss(n){const[,e,t,r,s,i,a,o]=n;return[ut(e,o,t,r,s,i,a),I.utcInstance]}const is=ne(zr,ot),as=ne(Rr,ot),os=ne(qr,ot),us=ne(Fn),Cn=re(Jr,ie,ke,Te),ls=re(Hr,ie,ke,Te),cs=re(Yr,ie,ke,Te),fs=re(ie,ke,Te);function ds(n){return se(n,[is,Cn],[as,ls],[os,cs],[us,fs])}function hs(n){return se(es(n),[Kr,Xr])}function ms(n){return se(n,[ts,Dt],[ns,Dt],[rs,ss])}function ys(n){return se(n,[Br,jr])}const gs=re(ie);function ws(n){return se(n,[_r,gs])}const ks=ne(Pr,Gr),Ts=ne(Vn),Ss=re(ie,ke,Te);function ps(n){return se(n,[ks,Cn],[Ts,Ss])}const Et="Invalid Duration",Wn={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Os={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Wn},E=146097/400,_=146097/4800,vs={years:{quarters:4,months:12,weeks:E/7,days:E,hours:E*24,minutes:E*24*60,seconds:E*24*60*60,milliseconds:E*24*60*60*1e3},quarters:{months:3,weeks:E/28,days:E/4,hours:E*24/4,minutes:E*24*60/4,seconds:E*24*60*60/4,milliseconds:E*24*60*60*1e3/4},months:{weeks:_/7,days:_,hours:_*24,minutes:_*24*60,seconds:_*24*60*60,milliseconds:_*24*60*60*1e3},...Wn},P=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ms=P.slice(0).reverse();function A(n,e,t=!1){const r={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new g(r)}function Ln(n,e){let t=e.milliseconds??0;for(const r of Ms.slice(1))e[r]&&(t+=e[r]*n[r].milliseconds);return t}function xt(n,e){const t=Ln(n,e)<0?-1:1;P.reduceRight((r,s)=>{if(h(e[s]))return r;if(r){const i=e[r]*t,a=n[s][r],o=Math.floor(i/a);e[s]+=o*t,e[r]-=o*a*t}return s},null),P.reduce((r,s)=>{if(h(e[s]))return r;if(r){const i=e[r]%1;e[r]-=i,e[s]+=i*n[r][s]}return s},null)}function bt(n){const e={};for(const[t,r]of Object.entries(n))r!==0&&(e[t]=r);return e}class g{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let r=t?vs:Os;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||k.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return g.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new M(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new g({values:be(e,g.normalizeUnit),loc:k.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(q(e))return g.fromMillis(e);if(g.isDuration(e))return e;if(typeof e=="object")return g.fromObject(e);throw new M(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=ys(e);return r?g.fromObject(r,t):g.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=ws(e);return r?g.fromObject(r,t):g.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new M("need to specify a reason the Duration is invalid");const r=e instanceof W?e:new W(e,t);if(p.throwOnInvalid)throw new Qn(r);return new g({invalid:r})}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()];if(!t)throw new Rt(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 r={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?N.create(this.loc,r).formatDurationFromString(this,e):Et}toHuman(e={}){if(!this.isValid)return Et;const t=e.showZeros!==!1,r=P.map(s=>{const i=this.values[s];return h(i)||i===0&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(i)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=it(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},m.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?Ln(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=g.fromDurationLike(e),r={};for(const s of P)(ee(t.values,s)||ee(this.values,s))&&(r[s]=t.get(s)+this.get(s));return A(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=g.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=Sn(e(this.values[r],r));return A(this,{values:t},!0)}get(e){return this[g.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...be(e,g.normalizeUnit)};return A(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:s}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:r};return A(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return xt(this.matrix,e),A(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=bt(this.normalize().shiftToAll().toObject());return A(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>g.normalizeUnit(a));const t={},r={},s=this.toObject();let i;for(const a of P)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in r)o+=this.matrix[l][a]*r[l],r[l]=0;q(s[a])&&(o+=s[a]);const u=Math.trunc(o);t[a]=u,r[a]=(o*1e3-u*1e3)/1e3}else q(s[a])&&(r[a]=s[a]);for(const a in r)r[a]!==0&&(t[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return xt(this.matrix,t),A(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]=this.values[t]===0?0:-this.values[t];return A(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=bt(this.values);return A(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 this.invalid===null}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||!this.loc.equals(e.loc))return!1;function t(r,s){return r===void 0||r===0?s===void 0||s===0:r===s}for(const r of P)if(!t(this.values[r],e.values[r]))return!1;return!0}}const B="Invalid Interval";function Ns(n,e){return!n||!n.isValid?S.invalid("missing or invalid start"):!e||!e.isValid?S.invalid("missing or invalid end"):e<n?S.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class S{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 M("need to specify a reason the Interval is invalid");const r=e instanceof W?e:new W(e,t);if(p.throwOnInvalid)throw new jn(r);return new S({invalid:r})}static fromDateTimes(e,t){const r=le(e),s=le(t),i=Ns(r,s);return i??new S({start:r,end:s})}static after(e,t){const r=g.fromDurationLike(t),s=le(e);return S.fromDateTimes(s,s.plus(r))}static before(e,t){const r=g.fromDurationLike(t),s=le(e);return S.fromDateTimes(s.minus(r),s)}static fromISO(e,t){const[r,s]=(e||"").split("/",2);if(r&&s){let i,a;try{i=m.fromISO(r,t),a=i.isValid}catch{a=!1}let o,u;try{o=m.fromISO(s,t),u=o.isValid}catch{u=!1}if(a&&u)return S.fromDateTimes(i,o);if(a){const l=g.fromISO(s,t);if(l.isValid)return S.after(i,l)}else if(u){const l=g.fromISO(r,t);if(l.isValid)return S.before(o,l)}}return S.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let s;return t!=null&&t.useLocaleWeeks?s=this.end.reconfigure({locale:r.locale}):s=this.end,s=s.startOf(e,t),Math.floor(s.diff(r,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?S.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(le).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),r=[];let{s}=this,i=0;for(;s<this.e;){const a=t[i]||this.e,o=+a>+this.e?this.e:a;r.push(S.fromDateTimes(s,o)),s=o,i+=1}return r}splitBy(e){const t=g.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:r}=this,s=1,i;const a=[];for(;r<this.e;){const o=this.start.plus(t.mapUnits(u=>u*s));i=+o>+this.e?this.e:o,a.push(S.fromDateTimes(r,i)),r=i,s+=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}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1: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,r=this.e<e.e?this.e:e.e;return t>=r?null:S.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return S.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((s,i)=>s.s-i.s).reduce(([s,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[s,i.union(a)]:[s.concat([i]),a]:[s,a],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const s=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)r+=u.type==="s"?1:-1,r===1?t=u.time:(t&&+t!=+u.time&&s.push(S.fromDateTimes(t,u.time)),t=null);return S.merge(s)}difference(...e){return S.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:B}[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=De,t={}){return this.isValid?N.create(this.s.loc.clone(t),e).formatInterval(this):B}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:B}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:B}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:B}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:B}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):g.invalid(this.invalidReason)}mapEndpoints(e){return S.fromDateTimes(e(this.s),e(this.e))}}class fe{static hasDST(e=p.defaultZone){const t=m.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $.isValidZone(e)}static normalizeZone(e){return R(e,p.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||k.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||k.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||k.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||k.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||k.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||k.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||k.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return k.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return k.create(t,null,"gregory").eras(e)}static features(){return{relative:wn(),localeWeek:kn()}}}function Ft(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=t(e)-t(n);return Math.floor(g.fromMillis(r).as("days"))}function Is(n,e,t){const r=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const f=Ft(u,l);return(f-f%7)/7}],["days",Ft]],s={},i=n;let a,o;for(const[u,l]of r)t.indexOf(u)>=0&&(a=u,s[u]=l(n,e),o=i.plus(s),o>e?(s[u]--,n=i.plus(s),n>e&&(o=n,s[u]--,n=i.plus(s))):n=o);return[n,s,o,a]}function Ds(n,e,t,r){let[s,i,a,o]=Is(n,e,t);const u=e-s,l=t.filter(y=>["hours","minutes","seconds","milliseconds"].indexOf(y)>=0);l.length===0&&(a<e&&(a=s.plus({[o]:1})),a!==s&&(i[o]=(i[o]||0)+u/(a-s)));const f=g.fromObject(i,r);return l.length>0?g.fromMillis(u,r).shiftTo(...l).plus(f):f}const Es="missing Intl.DateTimeFormat.formatToParts support";function w(n,e=t=>t){return{regex:n,deser:([t])=>e(kr(t))}}const xs=" ",Zn=`[ ${xs}]`,$n=new RegExp(Zn,"g");function bs(n){return n.replace(/\./g,"\\.?").replace($n,Zn)}function Vt(n){return n.replace(/\./g,"").replace($n," ").toLowerCase()}function C(n,e){return n===null?null:{regex:RegExp(n.map(bs).join("|")),deser:([t])=>n.findIndex(r=>Vt(t)===Vt(r))+e}}function Ct(n,e){return{regex:n,deser:([,t,r])=>Ce(t,r),groups:e}}function pe(n){return{regex:n,deser:([e])=>e}}function Fs(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vs(n,e){const t=V(e),r=V(e,"{2}"),s=V(e,"{3}"),i=V(e,"{4}"),a=V(e,"{6}"),o=V(e,"{1,2}"),u=V(e,"{1,3}"),l=V(e,"{1,6}"),f=V(e,"{1,9}"),y=V(e,"{2,4}"),T=V(e,"{4,6}"),d=Z=>({regex:RegExp(Fs(Z.val)),deser:([J])=>J,literal:!0}),F=(Z=>{if(n.literal)return d(Z);switch(Z.val){case"G":return C(e.eras("short"),0);case"GG":return C(e.eras("long"),0);case"y":return w(l);case"yy":return w(y,Xe);case"yyyy":return w(i);case"yyyyy":return w(T);case"yyyyyy":return w(a);case"M":return w(o);case"MM":return w(r);case"MMM":return C(e.months("short",!0),1);case"MMMM":return C(e.months("long",!0),1);case"L":return w(o);case"LL":return w(r);case"LLL":return C(e.months("short",!1),1);case"LLLL":return C(e.months("long",!1),1);case"d":return w(o);case"dd":return w(r);case"o":return w(u);case"ooo":return w(s);case"HH":return w(r);case"H":return w(o);case"hh":return w(r);case"h":return w(o);case"mm":return w(r);case"m":return w(o);case"q":return w(o);case"qq":return w(r);case"s":return w(o);case"ss":return w(r);case"S":return w(u);case"SSS":return w(s);case"u":return pe(f);case"uu":return pe(o);case"uuu":return w(t);case"a":return C(e.meridiems(),0);case"kkkk":return w(i);case"kk":return w(y,Xe);case"W":return w(o);case"WW":return w(r);case"E":case"c":return w(t);case"EEE":return C(e.weekdays("short",!1),1);case"EEEE":return C(e.weekdays("long",!1),1);case"ccc":return C(e.weekdays("short",!0),1);case"cccc":return C(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ct(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Ct(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return pe(/[a-z_+-/]{1,256}?/i);case" ":return pe(/[^\S\n\r]/);default:return d(Z)}})(n)||{invalidReason:Es};return F.token=n,F}const Cs={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"}};function Ws(n,e,t){const{type:r,value:s}=n;if(r==="literal"){const u=/^\s+$/.test(s);return{literal:!u,val:u?" ":s}}const i=e[r];let a=r;r==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=t.hour12?"hour12":"hour24");let o=Cs[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function Ls(n){return[`^${n.map(t=>t.regex).reduce((t,r)=>`${t}(${r.source})`,"")}$`,n]}function Zs(n,e,t){const r=n.match(e);if(r){const s={};let i=1;for(const a in t)if(ee(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(i,i+u))),i+=u}return[r,s]}else return[r,{}]}function $s(n){const e=i=>{switch(i){case"S":return"millisecond";case"s"