1 line
66 KiB
JavaScript
1 line
66 KiB
JavaScript
class e extends Error{}class L extends e{constructor(e){super("Invalid DateTime: "+e.toMessage())}}class z extends e{constructor(e){super("Invalid Interval: "+e.toMessage())}}class j extends e{constructor(e){super("Invalid Duration: "+e.toMessage())}}class v extends e{}class q extends e{constructor(e){super("Invalid unit "+e)}}class u extends e{}class r extends e{constructor(){super("Zone is an abstract class")}}var t="numeric",n="short",s="long";const A={year:t,month:t,day:t},$={year:t,month:n,day:t},U={year:t,month:n,day:t,weekday:n},_={year:t,month:s,day:t},Y={year:t,month:s,day:t,weekday:s},R={hour:t,minute:t},H={hour:t,minute:t,second:t},P={hour:t,minute:t,second:t,timeZoneName:n},J={hour:t,minute:t,second:t,timeZoneName:s},G={hour:t,minute:t,hourCycle:"h23"},B={hour:t,minute:t,second:t,hourCycle:"h23"},Q={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:n},K={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:s},X={year:t,month:t,day:t,hour:t,minute:t},ee={year:t,month:t,day:t,hour:t,minute:t,second:t},te={year:t,month:n,day:t,hour:t,minute:t},re={year:t,month:n,day:t,hour:t,minute:t,second:t},ne={year:t,month:n,day:t,weekday:n,hour:t,minute:t},se={year:t,month:s,day:t,hour:t,minute:t,timeZoneName:n},ie={year:t,month:s,day:t,hour:t,minute:t,second:t,timeZoneName:n},ae={year:t,month:s,day:t,weekday:s,hour:t,minute:t,timeZoneName:s},oe={year:t,month:s,day:t,weekday:s,hour:t,minute:t,second:t,timeZoneName:s};class i{get type(){throw new r}get name(){throw new r}get ianaName(){return this.name}get isUniversal(){throw new r}offsetName(e,t){throw new r}formatOffset(e,t){throw new r}offset(e){throw new r}equals(e){throw new r}get isValid(){throw new r}}let ue=null;class le extends i{static get instance(){return ue=null===ue?new le:ue}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return It(e,t,r)}formatOffset(e,t){return Ct(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let ce={};function he(e){return ce[e]||(ce[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ce[e]}const de={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function me(e,t){var e=e.format(t).replace(/\u200E/g,""),[,t,e,r,n,s,i,a]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(e);return[r,t,e,n,s,i,a]}function fe(e,t){var r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){var{type:s,value:i}=r[e],a=de[s];"era"===s?n[a]=i:S(a)||(n[a]=parseInt(i,10))}return n}let ye={};class a extends i{static create(e){return ye[e]||(ye[e]=new a(e)),ye[e]}static resetCache(){ye={},ce={}}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=a.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return It(e,t,r,this.name)}formatOffset(e,t){return Ct(this.offset(e),t)}offset(e){e=new Date(e);if(isNaN(e))return NaN;var t=he(this.name);let[r,n,s,i,a,o,u]=(t.formatToParts?fe:me)(t,e);t=+e,e=t%1e3;return(bt({year:r="BC"===i?1-Math.abs(r):r,month:n,day:s,hour:24===a?0:a,minute:o,second:u,millisecond:0})-(t-=0<=e?e:1e3+e))/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let ge={};function ve(e,t={}){var r=JSON.stringify([e,t]);let n=ge[r];return n||(n=new Intl.ListFormat(e,t),ge[r]=n),n}let we={};function pe(e,t={}){var r=JSON.stringify([e,t]);let n=we[r];return n||(n=new Intl.DateTimeFormat(e,t),we[r]=n),n}let ke={};function Se(e,t={}){var r=JSON.stringify([e,t]);let n=ke[r];return n||(n=new Intl.NumberFormat(e,t),ke[r]=n),n}let Te={};function Oe(e,t={}){const{base:r,...n}=t;var s=JSON.stringify([e,n]);let i=Te[s];return i||(i=new Intl.RelativeTimeFormat(e,t),Te[s]=i),i}let be=null;function Ne(){return be=be||(new Intl.DateTimeFormat).resolvedOptions().locale}let De={};function Me(e){let t=De[e];var r;return t||(r=new Intl.Locale(e),t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,De[e]=t),t}function Ie(n){var s=n.indexOf("-x-"),s=(n=-1!==s?n.substring(0,s):n).indexOf("-u-");if(-1===s)return[n];{let t,r;try{t=pe(n).resolvedOptions(),r=n}catch(e){n=n.substring(0,s);t=pe(n).resolvedOptions(),r=n}var{numberingSystem:s,calendar:n}=t;return[r,s,n]}}function Ve(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+="-ca-"+r),t)&&(e+="-nu-"+t),e}function xe(t){var r=[];for(let e=1;e<=12;e++){var n=W.utc(2009,e,1);r.push(t(n))}return r}function Ee(t){var r=[];for(let e=1;e<=7;e++){var n=W.utc(2016,11,13+e);r.push(t(n))}return r}function Ce(e,t,r,n){e=e.listingMode();return"error"===e?null:("en"===e?r:n)(t)}function Fe(e){return(!e.numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)}class Ze{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...i}=r;(!t||0<Object.keys(i).length)&&(t={useGrouping:!1,...r},0<r.padTo&&(t.minimumIntegerDigits=r.padTo),this.inf=Se(e,t))}format(e){var t;return this.inf?(t=this.floor?Math.floor(e):e,this.inf.format(t)):g(this.floor?Math.floor(e):St(e,3),this.padTo)}}class We{constructor(e,t,r){this.opts=r;let n=this.originalZone=void 0;this.opts.timeZone?this.dt=e:"fixed"===e.zone.type?(r=0<=(r=e.offset/60*-1)?"Etc/GMT+"+r:"Etc/GMT"+r,0!==e.offset&&a.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)):"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);r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=pe(t,r)}format(){return this.originalZone?this.formatToParts().map((({value:e})=>e)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){var e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map((e=>{var t;return"timeZoneName"===e.type?(t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName}),{...e,value:t}):e})):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Le{constructor(e,t,r){this.opts={style:"long",...r},!t&&yt()&&(this.rtf=Oe(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):Qt(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ze={firstDay:1,minimalDays:4,weekend:[6,7]};class w{static fromOpts(e){return w.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,s=!1){e=e||k.defaultLocale,s=e||(s?"en-US":Ne()),t=t||k.defaultNumberingSystem,r=r||k.defaultOutputCalendar,n=pt(n)||k.defaultWeekSettings;return new w(s,t,r,n,e)}static resetCache(){be=null,we={},ke={},Te={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return w.create(e,t,r,n)}constructor(e,t,r,n,s){var[e,i,a]=Ie(e);this.locale=e,this.numberingSystem=t||i||null,this.outputCalendar=r||a||null,this.weekSettings=n,this.intl=Ve(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return null==this.fastNumbersCached&&(this.fastNumbersCached=Fe(this)),this.fastNumbersCached}listingMode(){var 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?w.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,pt(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(r,n=!1){return Ce(this,r,zt,(()=>{const t=n?{month:r,day:"numeric"}:{month:r},e=n?"format":"standalone";return this.monthsCache[e][r]||(this.monthsCache[e][r]=xe((e=>this.extract(e,t,"month")))),this.monthsCache[e][r]}))}weekdays(r,n=!1){return Ce(this,r,$t,(()=>{const t=n?{weekday:r,year:"numeric",month:"long",day:"numeric"}:{weekday:r},e=n?"format":"standalone";return this.weekdaysCache[e][r]||(this.weekdaysCache[e][r]=Ee((e=>this.extract(e,t,"weekday")))),this.weekdaysCache[e][r]}))}meridiems(){return Ce(this,void 0,(()=>Ut),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[W.utc(2016,11,13,9),W.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(e){return Ce(this,e,Ht,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[W.utc(-40,1,1),W.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,r){e=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===r));return e?e.value:null}numberFormatter(e={}){return new Ze(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new We(e,this.intl,t)}relFormatter(e={}){return new Le(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ve(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||(gt()?Me(this.locale):ze)}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 je=null;class d extends i{static get utcInstance(){return je=null===je?new d(0):je}static instance(e){return 0===e?d.utcInstance:new d(e)}static parseSpecifier(e){if(e){e=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new d(Vt(e[1],e[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":"UTC"+Ct(this.fixed,"narrow")}get ianaName(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+Ct(-this.fixed,"narrow")}offsetName(){return this.name}formatOffset(e,t){return Ct(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 qe extends i{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 p(e,t){var r;return S(e)||null===e?t:e instanceof i?e:"string"==typeof e?"default"===(r=e.toLowerCase())?t:"local"===r||"system"===r?le.instance:"utc"===r||"gmt"===r?d.utcInstance:d.parseSpecifier(r)||a.create(e):h(e)?d.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new qe(e)}const Ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$e={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]},Ue=Ae.hanidec.replace(/[\[|\]]/g,"").split("");let o={};function _e(){o={}}function y({numberingSystem:e},t=""){e=e||"latn";return o[e]||(o[e]={}),o[e][t]||(o[e][t]=new RegExp(""+Ae[e]+t)),o[e][t]}let Ye=()=>Date.now(),Re="system",He=null,Pe=null,Je=null,Ge=60,Be,Qe=null;class k{static get now(){return Ye}static set now(e){Ye=e}static set defaultZone(e){Re=e}static get defaultZone(){return p(Re,le.instance)}static get defaultLocale(){return He}static set defaultLocale(e){He=e}static get defaultNumberingSystem(){return Pe}static set defaultNumberingSystem(e){Pe=e}static get defaultOutputCalendar(){return Je}static set defaultOutputCalendar(e){Je=e}static get defaultWeekSettings(){return Qe}static set defaultWeekSettings(e){Qe=pt(e)}static get twoDigitCutoffYear(){return Ge}static set twoDigitCutoffYear(e){Ge=e%100}static get throwOnInvalid(){return Be}static set throwOnInvalid(e){Be=e}static resetCaches(){w.resetCache(),a.resetCache(),W.resetCache(),_e()}}class l{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?this.reason+": "+this.explanation:this.reason}}const Ke=[0,31,59,90,120,151,181,212,243,273,304,334],Xe=[0,31,60,91,121,152,182,213,244,274,305,335];function c(e,t){return new l("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function et(e,t,r){t=new Date(Date.UTC(e,t-1,r)),e<100&&0<=e&&t.setUTCFullYear(t.getUTCFullYear()-1900),r=t.getUTCDay();return 0===r?7:r}function tt(e,t,r){return r+(Tt(e)?Xe:Ke)[t-1]}function rt(e,t){var e=Tt(e)?Xe:Ke,r=e.findIndex((e=>e<t));return{month:r+1,day:t-e[r]}}function nt(e,t){return(e-t+7)%7+1}function st(e,t=4,r=1){var{year:n,month:s,day:i}=e,a=tt(n,s,i),s=nt(et(n,s,i),r);let o=Math.floor((a-s+14-t)/7),u;return o<1?(u=n-1,o=Dt(u,t,r)):o>Dt(n,t,r)?(u=n+1,o=1):u=n,{weekYear:u,weekNumber:o,weekday:s,...Ft(e)}}function it(e,t=4,r=1){var{weekYear:n,weekNumber:s,weekday:i}=e,r=nt(et(n,1,t),r),a=b(n);let o=7*s+i-r-7+t,u;o<1?(u=n-1,o+=b(u)):o>a?(u=n+1,o-=b(n)):u=n;var{month:s,day:i}=rt(u,o);return{year:u,month:s,day:i,...Ft(e)}}function at(e){var{year:t,month:r,day:n}=e;return{year:t,ordinal:tt(t,r,n),...Ft(e)}}function ot(e){var{year:t,ordinal:r}=e,{month:r,day:n}=rt(t,r);return{year:t,month:r,day:n,...Ft(e)}}function ut(e,t){if(S(e.localWeekday)&&S(e.localWeekNumber)&&S(e.localWeekYear))return{minDaysInFirstWeek:4,startOfWeek:1};if(S(e.weekday)&&S(e.weekNumber)&&S(e.weekYear))return S(e.localWeekday)||(e.weekday=e.localWeekday),S(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),S(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()};throw new v("Cannot mix locale-based week fields with ISO-based week fields")}function lt(e,t=4,r=1){var n=mt(e.weekYear),t=f(e.weekNumber,1,Dt(e.weekYear,t,r)),r=f(e.weekday,1,7);return n?t?!r&&c("weekday",e.weekday):c("week",e.weekNumber):c("weekYear",e.weekYear)}function ct(e){var t=mt(e.year),r=f(e.ordinal,1,b(e.year));return t?!r&&c("ordinal",e.ordinal):c("year",e.year)}function ht(e){var t=mt(e.year),r=f(e.month,1,12),n=f(e.day,1,Ot(e.year,e.month));return t?r?!n&&c("day",e.day):c("month",e.month):c("year",e.year)}function dt(e){var{hour:e,minute:t,second:r,millisecond:n}=e,s=f(e,0,23)||24===e&&0===t&&0===r&&0===n,i=f(t,0,59),a=f(r,0,59),o=f(n,0,999);return s?i?a?!o&&c("millisecond",n):c("second",r):c("minute",t):c("hour",e)}function S(e){return void 0===e}function h(e){return"number"==typeof e}function mt(e){return"number"==typeof e&&e%1==0}function ft(e){return"[object Date]"===Object.prototype.toString.call(e)}function yt(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function gt(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function vt(e){return Array.isArray(e)?e:[e]}function wt(e,r,n){if(0!==e.length)return e.reduce(((e,t)=>{t=[r(t),t];return e&&n(e[0],t[0])===e[0]?e:t}),null)[1]}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pt(e){if(null==e)return null;if("object"!=typeof e)throw new u("Week settings must be an object");if(f(e.firstDay,1,7)&&f(e.minimalDays,1,7)&&Array.isArray(e.weekend)&&!e.weekend.some((e=>!f(e,1,7))))return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)};throw new u("Invalid week settings")}function f(e,t,r){return mt(e)&&t<=e&&e<=r}function g(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function T(e){if(!S(e)&&null!==e&&""!==e)return parseInt(e,10)}function O(e){if(!S(e)&&null!==e&&""!==e)return parseFloat(e)}function kt(e){if(!S(e)&&null!==e&&""!==e)return e=1e3*parseFloat("0."+e),Math.floor(e)}function St(e,t,r=!1){t=10**t;return(r?Math.trunc:Math.round)(e*t)/t}function Tt(e){return e%4==0&&(e%100!=0||e%400==0)}function b(e){return Tt(e)?366:365}function Ot(e,t){var r,n=(n=t-1)-(r=12)*Math.floor(n/r)+1;return 2==n?Tt(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&0<=e.year&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function Nt(e,t,r){return-nt(et(e,1,t),r)+t-1}function Dt(e,t=4,r=1){var n=Nt(e,t,r),t=Nt(e+1,t,r);return(b(e)-n+t)/7}function Mt(e){return 99<e?e:e>k.twoDigitCutoffYear?1900+e:2e3+e}function It(e,t,r,n=null){var e=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},n=(n&&(s.timeZone=n),{timeZoneName:t,...s}),t=new Intl.DateTimeFormat(r,n).formatToParts(e).find((e=>"timezonename"===e.type.toLowerCase()));return t?t.value:null}function Vt(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);e=parseInt(t,10)||0,t=r<0||Object.is(r,-0)?-e:e;return 60*r+t}function xt(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u("Invalid unit value "+e);return t}function Et(e,t){var r,n={};for(const s in e)m(e,s)&&null!=(r=e[s])&&(n[t(s)]=xt(r));return n}function Ct(e,t){var r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),s=0<=e?"+":"-";switch(t){case"short":return s+g(r,2)+":"+g(n,2);case"narrow":return s+r+(0<n?":"+n:"");case"techie":return s+g(r,2)+g(n,2);default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ft(e){return r=e,["hour","minute","second","millisecond"].reduce(((e,t)=>(e[t]=r[t],e)),{});var r}const Zt=["January","February","March","April","May","June","July","August","September","October","November","December"],Wt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Lt=["J","F","M","A","M","J","J","A","S","O","N","D"];function zt(e){switch(e){case"narrow":return[...Lt];case"short":return[...Wt];case"long":return[...Zt];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 jt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],qt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],At=["M","T","W","T","F","S","S"];function $t(e){switch(e){case"narrow":return[...At];case"short":return[...qt];case"long":return[...jt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ut=["AM","PM"],_t=["Before Christ","Anno Domini"],Yt=["BC","AD"],Rt=["B","A"];function Ht(e){switch(e){case"narrow":return[...Rt];case"short":return[...Yt];case"long":return[..._t];default:return null}}function Pt(e){return Ut[e.hour<12?0:1]}function Jt(e,t){return $t(t)[e.weekday-1]}function Gt(e,t){return zt(t)[e.month-1]}function Bt(e,t){return Ht(t)[e.year<0?0:1]}function Qt(e,t,r="always",n=!1){var 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=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&i){var a="days"===e;switch(t){case 1:return a?"tomorrow":"next "+s[e][0];case-1:return a?"yesterday":"last "+s[e][0];case 0:return a?"today":"this "+s[e][0]}}var r=Object.is(t,-0)||t<0,i=Math.abs(t),t=1===i,o=s[e],n=n?!t&&o[2]||o[1]:t?s[e][0]:e;return r?i+` ${n} ago`:`in ${i} `+n}function Kt(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const Xt={D:A,DD:$,DDD:_,DDDD:Y,t:R,tt:H,ttt:P,tttt:J,T:G,TT:B,TTT:Q,TTTT:K,f:X,ff:te,fff:se,ffff:ae,F:ee,FF:re,FFF:ie,FFFF:oe};class N{static create(e,t={}){return new N(e,t)}static parseFormat(t){let r=null,n="",s=!1;var i=[];for(let e=0;e<t.length;e++){var a=t.charAt(e);"'"===a?(0<n.length&&i.push({literal:s||/^\s+$/.test(n),val:n}),r=null,n="",s=!s):s||a===r?n+=a:(0<n.length&&i.push({literal:/^\s+$/.test(n),val:n}),n=a,r=a)}return 0<n.length&&i.push({literal:s||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return Xt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return null===this.systemLoc&&(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){var r;return this.opts.forceSimple?g(e,t):(r={...this.opts},0<t&&(r.padTo=t),this.loc.numberFormatter(r).format(e))}formatDateTimeFromString(r,e){const n="en"===this.loc.listingMode(),t=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(e,t)=>this.loc.extract(r,e,t),i=e=>r.isOffsetFixed&&0===r.offset&&e.allowZ?"Z":r.isValid?r.zone.formatOffset(r.ts,e.format):"",a=()=>n?Pt(r):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(e,t)=>n?Gt(r,e):s(t?{month:e}:{month:e,day:"numeric"},"month"),u=(e,t)=>n?Jt(r,e):s(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),l=e=>{var t=N.macroTokenToFormatOpts(e);return t?this.formatWithSystemDefault(r,t):e},c=e=>n?Bt(r,e):s({era:e},"era");return Kt(N.parseFormat(e),(e=>{switch(e){case"S":return this.num(r.millisecond);case"u":case"SSS":return this.num(r.millisecond,3);case"s":return this.num(r.second);case"ss":return this.num(r.second,2);case"uu":return this.num(Math.floor(r.millisecond/10),2);case"uuu":return this.num(Math.floor(r.millisecond/100));case"m":return this.num(r.minute);case"mm":return this.num(r.minute,2);case"h":return this.num(r.hour%12==0?12:r.hour%12);case"hh":return this.num(r.hour%12==0?12:r.hour%12,2);case"H":return this.num(r.hour);case"HH":return this.num(r.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return r.zone.offsetName(r.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return r.zone.offsetName(r.ts,{format:"long",locale:this.loc.locale});case"z":return r.zoneName;case"a":return a();case"d":return t?s({day:"numeric"},"day"):this.num(r.day);case"dd":return t?s({day:"2-digit"},"day"):this.num(r.day,2);case"c":return this.num(r.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(r.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return t?s({month:"numeric",day:"numeric"},"month"):this.num(r.month);case"LL":return t?s({month:"2-digit",day:"numeric"},"month"):this.num(r.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return t?s({month:"numeric"},"month"):this.num(r.month);case"MM":return t?s({month:"2-digit"},"month"):this.num(r.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return t?s({year:"numeric"},"year"):this.num(r.year);case"yy":return t?s({year:"2-digit"},"year"):this.num(r.year.toString().slice(-2),2);case"yyyy":return t?s({year:"numeric"},"year"):this.num(r.year,4);case"yyyyyy":return t?s({year:"numeric"},"year"):this.num(r.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(r.weekYear.toString().slice(-2),2);case"kkkk":return this.num(r.weekYear,4);case"W":return this.num(r.weekNumber);case"WW":return this.num(r.weekNumber,2);case"n":return this.num(r.localWeekNumber);case"nn":return this.num(r.localWeekNumber,2);case"ii":return this.num(r.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(r.localWeekYear,4);case"o":return this.num(r.ordinal);case"ooo":return this.num(r.ordinal,3);case"q":return this.num(r.quarter);case"qq":return this.num(r.quarter,2);case"X":return this.num(Math.floor(r.ts/1e3));case"x":return this.num(r.ts);default:return l(e)}}))}formatDurationFromString(e,t){const r=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=N.parseFormat(t),s=n.reduce(((e,{literal:t,val:r})=>t?e:e.concat(r)),[]),i=e.shiftTo(...s.map(r).filter((e=>e)));return Kt(n,(a=i,e=>{var t=r(e);return t?this.num(a.get(t),e.length):e}));var a}}n=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function D(...e){e=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${e}$`)}function M(...e){return i=>e.reduce((([e,t,r],n)=>{var[n,r,s]=n(i,r);return[{...e,...n},r||t,s]}),[{},null,1]).slice(0,2)}function er(e,...t){if(null!=e)for(var[r,n]of t){r=r.exec(e);if(r)return n(r)}return[null,null]}function tr(...s){return(e,t)=>{var r={};let n;for(n=0;n<s.length;n++)r[s[n]]=T(e[t+n]);return[r,null,t+n]}}var t=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,s=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,rr=RegExp(s.source+`(?:${t.source}?(?:\\[(${n.source})\\])?)?`),nr=RegExp(`(?:T${rr.source})?`),sr=tr("weekYear","weekNumber","weekDay"),ir=tr("year","ordinal"),t=RegExp(s.source+` ?(?:${t.source}|(${n.source}))?`),n=RegExp(`(?: ${t.source})?`);function ar(e,t,r){e=e[t];return S(e)?r:T(e)}function or(e,t){return[{hours:ar(e,t,0),minutes:ar(e,t+1,0),seconds:ar(e,t+2,0),milliseconds:kt(e[t+3])},null,t+4]}function ur(e,t){var r=!e[t]&&!e[t+1],e=Vt(e[t+1],e[t+2]);return[{},r?null:d.instance(e),t+3]}function lr(e,t){return[{},e[t]?a.create(e[t]):null,t+1]}const cr=RegExp(`^T?${s.source}$`),hr=/^-?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 dr(e){var[e,t,r,n,s,i,a,o,u]=e;const l="-"===e[0];var e=o&&"-"===o[0],c=(e,t=!1)=>void 0!==e&&(t||e&&l)?-e:e;return[{years:c(O(t)),months:c(O(r)),weeks:c(O(n)),days:c(O(s)),hours:c(O(i)),minutes:c(O(a)),seconds:c(O(o),"-0"===o),milliseconds:c(kt(u),e)}]}const mr={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fr(e,t,r,n,s,i,a){t={year:2===t.length?Mt(T(t)):T(t),month:Wt.indexOf(r)+1,day:T(n),hour:T(s),minute:T(i)};return a&&(t.second=T(a)),e&&(t.weekday=3<e.length?jt.indexOf(e)+1:qt.indexOf(e)+1),t}const yr=/^(?:(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 gr(e){var[,e,t,r,n,s,i,a,o,u,l,c]=e,e=fr(e,n,r,t,s,i,a);let h;return h=o?mr[o]:u?0:Vt(l,c),[e,new d(h)]}const vr=/^(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$/,wr=/^(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$/,pr=/^(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 kr(e){var[,e,t,r,n,s,i,a]=e;return[fr(e,n,r,t,s,i,a),d.utcInstance]}function Sr(e){var[,e,t,r,n,s,i,a]=e;return[fr(e,a,t,r,n,s,i),d.utcInstance]}const Tr=D(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,nr),Or=D(/(\d{4})-?W(\d\d)(?:-?(\d))?/,nr),br=D(/(\d{4})-?(\d{3})/,nr),Nr=D(rr),Dr=M((function(e,t){return[{year:ar(e,t),month:ar(e,t+1,1),day:ar(e,t+2,1)},null,t+3]}),or,ur,lr),Mr=M(sr,or,ur,lr),Ir=M(ir,or,ur,lr),Vr=M(or,ur,lr);function xr(e){return er(e,[Tr,Dr],[Or,Mr],[br,Ir],[Nr,Vr])}function Er(e){return er(e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim(),[yr,gr])}function Cr(e){return er(e,[vr,kr],[wr,kr],[pr,Sr])}function Fr(e){return er(e,[hr,dr])}const Zr=M(or);function Wr(e){return er(e,[cr,Zr])}const Lr=D(/(\d{4})-(\d\d)-(\d\d)/,n),zr=D(t),jr=M(or,ur,lr);function qr(e){return er(e,[Lr,Dr],[zr,jr])}const Ar="Invalid Duration",$r={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}},Ur={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},...$r},_r=365.2425,Yr=30.436875,Rr={years:{quarters:4,months:12,weeks:_r/7,days:_r,hours:24*_r,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:_r/28,days:_r/4,hours:24*_r/4,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:Yr/7,days:Yr,hours:24*Yr,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...$r},I=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Hr=I.slice(0).reverse();function V(e,t,r=!1){r={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new x(r)}function Pr(e,t){let r=t.milliseconds??0;for(const n of Hr.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function Jr(s,i){const a=Pr(s,i)<0?-1:1;I.reduceRight(((e,t)=>{var r,n;return S(i[t])?e:(e&&(n=i[e]*a,r=s[t][e],n=Math.floor(n/r),i[t]+=n*a,i[e]-=n*r*a),t)}),null),I.reduce(((e,t)=>{var r;return S(i[t])?e:(e&&(r=i[e]%1,i[e]-=r,i[t]+=r*s[e][t]),t)}),null)}function Gr(e){var t,r,n={};for([t,r]of Object.entries(e))0!==r&&(n[t]=r);return n}class x{constructor(e){var t="longterm"===e.conversionAccuracy||!1;let r=t?Rr:Ur;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||w.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return x.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new x({values:Et(e,x.normalizeUnit),loc:w.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(h(e))return x.fromMillis(e);if(x.isDuration(e))return e;if("object"==typeof e)return x.fromObject(e);throw new u(`Unknown duration argument ${e} of type `+typeof e)}static fromISO(e,t){var[r]=Fr(e);return r?x.fromObject(r,t):x.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){var[r]=Wr(e);return r?x.fromObject(r,t):x.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");e=e instanceof l?e:new l(e,t);if(k.throwOnInvalid)throw new j(e);return new x({invalid:e})}static normalizeUnit(e){var 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)return t;throw new q(e)}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={}){t={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?N.create(this.loc,t).formatDurationFromString(this,e):Ar}toHuman(r={}){var e;return this.isValid?(e=I.map((e=>{var t=this.values[e];return S(t)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...r,unit:e.slice(0,-1)}).format(t)})).filter((e=>e)),this.loc.listFormatter({type:"conjunction",style:r.listStyle||"narrow",...r}).format(e)):Ar}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+=St(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){var t;return!this.isValid||(t=this.toMillis())<0||864e5<=t?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},W.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?Pr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;var t=x.fromDurationLike(e),r={};for(const n of I)(m(t.values,n)||m(this.values,n))&&(r[n]=t.get(n)+this.get(n));return V(this,{values:r},!0)}minus(e){return this.isValid?(e=x.fromDurationLike(e),this.plus(e.negate())):this}mapUnits(e){if(!this.isValid)return this;var t={};for(const r of Object.keys(this.values))t[r]=xt(e(this.values[r],r));return V(this,{values:t},!0)}get(e){return this[x.normalizeUnit(e)]}set(e){return this.isValid?V(this,{values:{...this.values,...Et(e,x.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){e=this.loc.clone({locale:e,numberingSystem:t});return V(this,{loc:e,matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){var e;return this.isValid?(e=this.toObject(),Jr(this.matrix,e),V(this,{values:e},!0)):this}rescale(){var e;return this.isValid?(e=Gr(this.normalize().shiftToAll().toObject()),V(this,{values:e},!0)):this}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>x.normalizeUnit(e)));var t={},r={},n=this.toObject();let s;for(const a of I)if(0<=e.indexOf(a)){s=a;let e=0;for(const o in r)e+=this.matrix[o][a]*r[o],r[o]=0;h(n[a])&&(e+=n[a]);var i=Math.trunc(e);t[a]=i,r[a]=(1e3*e-1e3*i)/1e3}else h(n[a])&&(r[a]=n[a]);for(const u in r)0!==r[u]&&(t[s]+=u===s?r[u]:r[u]/this.matrix[s][u]);return Jr(this.matrix,t),V(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;var e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return V(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 I)if(t=this.values[n],r=e.values[n],!(void 0===t||0===t?void 0===r||0===r:t===r))return!1;var t,r;return!0}}const Br="Invalid Interval";function Qr(e,t){return e&&e.isValid?t&&t.isValid?t<e?E.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=`+t.toISO()):null:E.invalid("missing or invalid end"):E.invalid("missing or invalid start")}class E{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 u("need to specify a reason the Interval is invalid");e=e instanceof l?e:new l(e,t);if(k.throwOnInvalid)throw new z(e);return new E({invalid:e})}static fromDateTimes(e,t){var e=_n(e),t=_n(t),r=Qr(e,t);return null==r?new E({start:e,end:t}):r}static after(e,t){t=x.fromDurationLike(t),e=_n(e);return E.fromDateTimes(e,e.plus(t))}static before(e,t){t=x.fromDurationLike(t),e=_n(e);return E.fromDateTimes(e.minus(t),e)}static fromISO(e,s){var[i,a]=(e||"").split("/",2);if(i&&a){let e,t;try{e=W.fromISO(i,s),t=e.isValid}catch(a){t=!1}let r,n;try{r=W.fromISO(a,s),n=r.isValid}catch(a){n=!1}if(t&&n)return E.fromDateTimes(e,r);if(t){var o=x.fromISO(a,s);if(o.isValid)return E.after(e,o)}else if(n){o=x.fromISO(i,s);if(o.isValid)return E.before(r,o)}}return E.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 isValid(){return null===this.invalidReason}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;var r=this.start.startOf(e,t);let n;return n=(n=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}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?E.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];var t=e.map(_n).filter((e=>this.contains(e))).sort(((e,t)=>e.toMillis()-t.toMillis())),r=[];let n=this["s"],s=0;for(;n<this.e;){var i=t[s]||this.e,i=+i>+this.e?this.e:i;r.push(E.fromDateTimes(n,i)),n=i,s+=1}return r}splitBy(e){var t=x.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r=this["s"],n=1,s;for(var i=[];r<this.e;){var a=this.start.plus(t.mapUnits((e=>e*n)));s=+a>+this.e?this.e:a,i.push(E.fromDateTimes(r,s)),r=s,n+=1}return i}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}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e}equals(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){var t;return this.isValid?(t=(this.s>e.s?this:e).s,(e=(this.e<e.e?this:e).e)<=t?null:E.fromDateTimes(t,e)):this}union(e){var t;return this.isValid?(t=(this.s<e.s?this:e).s,e=(this.e>e.e?this:e).e,E.fromDateTimes(t,e)):this}static merge(e){var[e,t]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r]),[[],null]);return t&&e.push(t),e}static xor(e){let t=null,r=0;var n=[],e=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]));for(const s of Array.prototype.concat(...e).sort(((e,t)=>e.time-t.time)))r+="s"===s.type?1:-1,t=1===r?s.time:(t&&+t!=+s.time&&n.push(E.fromDateTimes(t,s.time)),null);return E.merge(n)}difference(...e){return E.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Br}[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=A,t={}){return this.isValid?N.create(this.s.loc.clone(t),e).formatInterval(this):Br}toISO(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Br}toISODate(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Br}toISOTime(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Br}toFormat(e,{separator:t=" – "}={}){return this.isValid?""+this.s.toFormat(e)+t+this.e.toFormat(e):Br}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):x.invalid(this.invalidReason)}mapEndpoints(e){return E.fromDateTimes(e(this.s),e(this.e))}}class Kr{static hasDST(e=k.defaultZone){var t=W.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return a.isValidZone(e)}static normalizeZone(e){return p(e,k.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||w.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||w.create(t,r,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||w.create(t,r,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||w.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||w.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return w.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return w.create(t,null,"gregory").eras(e)}static features(){return{relative:yt(),localeWeek:gt()}}}function Xr(e,t){var r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),t=r(t)-r(e);return Math.floor(x.fromMillis(t).as("days"))}function en(e,t,r,n){let[s,i,a,o]=function(e,t,r){var n,s,i={},a=e;let o,u;for([n,s]of[["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)=>{e=Xr(e,t);return(e-e%7)/7}],["days",Xr]])0<=r.indexOf(n)&&(i[o=n]=s(e,t),(u=a.plus(i))>t?(i[n]--,t<(e=a.plus(i))&&(u=e,i[n]--,e=a.plus(i))):e=u);return[e,i,u,o]}(e,t,r);e=t-s,r=r.filter((e=>0<=["hours","minutes","seconds","milliseconds"].indexOf(e))),0===r.length&&(a=a<t?s.plus({[o]:1}):a)!==s&&(i[o]=(i[o]||0)+e/(a-s)),t=x.fromObject(i,n);return 0<r.length?x.fromMillis(e,n).shiftTo(...r).plus(t):t}function C(e,t=e=>e){return{regex:e,deser:([e])=>t(function(t){let r=parseInt(t,10);if(isNaN(r)){r="";for(let e=0;e<t.length;e++){var n=t.charCodeAt(e);if(-1!==t[e].search(Ae.hanidec))r+=Ue.indexOf(t[e]);else for(const a in $e){var[s,i]=$e[a];s<=n&&n<=i&&(r+=n-s)}}return parseInt(r,10)}return r}(e))}}const tn=`[ ${String.fromCharCode(160)}]`,rn=new RegExp(tn,"g");function nn(e){return e.replace(/\./g,"\\.?").replace(rn,tn)}function sn(e){return e.replace(/\./g,"").replace(rn," ").toLowerCase()}function F(e,r){return null===e?null:{regex:RegExp(e.map(nn).join("|")),deser:([t])=>e.findIndex((e=>sn(t)===sn(e)))+r}}function an(e,t){return{regex:e,deser:([,e,t])=>Vt(e,t),groups:t}}function on(e){return{regex:e,deser:([e])=>e}}function un(t,r){const n=y(r),s=y(r,"{2}"),i=y(r,"{3}"),a=y(r,"{4}"),o=y(r,"{6}"),u=y(r,"{1,2}"),l=y(r,"{1,3}"),c=y(r,"{1,6}"),h=y(r,"{1,9}"),d=y(r,"{2,4}"),m=y(r,"{4,6}"),f=e=>({regex:RegExp(e.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:([e])=>e,literal:!0});var e=(e=>{if(t.literal)return f(e);switch(e.val){case"G":return F(r.eras("short"),0);case"GG":return F(r.eras("long"),0);case"y":return C(c);case"yy":return C(d,Mt);case"yyyy":return C(a);case"yyyyy":return C(m);case"yyyyyy":return C(o);case"M":return C(u);case"MM":return C(s);case"MMM":return F(r.months("short",!0),1);case"MMMM":return F(r.months("long",!0),1);case"L":return C(u);case"LL":return C(s);case"LLL":return F(r.months("short",!1),1);case"LLLL":return F(r.months("long",!1),1);case"d":return C(u);case"dd":return C(s);case"o":return C(l);case"ooo":return C(i);case"HH":return C(s);case"H":return C(u);case"hh":return C(s);case"h":return C(u);case"mm":return C(s);case"m":case"q":return C(u);case"qq":return C(s);case"s":return C(u);case"ss":return C(s);case"S":return C(l);case"SSS":return C(i);case"u":return on(h);case"uu":return on(u);case"uuu":return C(n);case"a":return F(r.meridiems(),0);case"kkkk":return C(a);case"kk":return C(d,Mt);case"W":return C(u);case"WW":return C(s);case"E":case"c":return C(n);case"EEE":return F(r.weekdays("short",!1),1);case"EEEE":return F(r.weekdays("long",!1),1);case"ccc":return F(r.weekdays("short",!0),1);case"cccc":return F(r.weekdays("long",!0),1);case"Z":case"ZZ":return an(new RegExp(`([+-]${u.source})(?::(${s.source}))?`),2);case"ZZZ":return an(new RegExp(`([+-]${u.source})(${s.source})?`),2);case"z":return on(/[a-z_+-/]{1,256}?/i);case" ":return on(/[^\S\n\r]/);default:return f(e)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return e.token=t,e}const ln={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 cn(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}function hn(e,t,r){var n=e.match(t);if(n){var s,i,a={};let e=1;for(const o in r)m(r,o)&&(i=(s=r[o]).groups?s.groups+1:1,!s.literal&&s.token&&(a[s.token.val[0]]=s.deser(n.slice(e,e+i))),e+=i);return[n,a]}return[n,{}]}function dn(n){let e=null,t;return S(n.z)||(e=a.create(n.z)),S(n.Z)||(e=e||new d(n.Z),t=n.Z),S(n.q)||(n.M=3*(n.q-1)+1),S(n.h)||(n.h<12&&1===n.a?n.h+=12:12===n.h&&0===n.a&&(n.h=0)),0===n.G&&n.y&&(n.y=-n.y),S(n.u)||(n.S=kt(n.u)),[Object.keys(n).reduce(((e,t)=>{var r=(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}})(t);return r&&(e[r]=n[t]),e}),{}),e,t]}let mn=null;function fn(e,r){return Array.prototype.concat(...e.map((e=>{return t=r,(e=e).literal||null==(t=wn(N.macroTokenToFormatOpts(e.val),t))||t.includes(void 0)?e:t;var t})))}class yn{constructor(t,e){var r;this.locale=t,this.format=e,this.tokens=fn(N.parseFormat(e),t),this.units=this.tokens.map((e=>un(e,t))),this.disqualifyingUnit=this.units.find((e=>e.invalidReason)),this.disqualifyingUnit||([e,r]=cn(this.units),this.regex=RegExp(e,"i"),this.handlers=r)}explainFromTokens(e){if(this.isValid){var[t,r]=hn(e,this.regex,this.handlers),[n,s,i]=r?dn(r):[null,null,void 0];if(m(r,"a")&&m(r,"H"))throw new v("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:s,specificOffset:i}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function gn(e,t,r){return new yn(e,r).explainFromTokens(t)}function vn(e,t,r){var{result:e,zone:t,specificOffset:r,invalidReason:n}=gn(e,t,r);return[e,t,r,n]}function wn(o,e){if(!o)return null;var e=N.create(e,o).dtFormatter(mn=mn||W.fromMillis(1555555555555)),t=e.formatToParts();const u=e.resolvedOptions();return t.map((r=>{{var n=o,s=u,{type:r,value:i}=r;if("literal"===r)return{literal:!(a=/^\s+$/.test(i)),val:a?" ":i};var a=n[r];let e=r,t=("hour"===r&&(e=null!=n.hour12?n.hour12?"hour12":"hour24":null!=n.hourCycle?"h11"===n.hourCycle||"h12"===n.hourCycle?"hour12":"hour24":s.hour12?"hour12":"hour24"),ln[e]);return(t="object"==typeof t?t[a]:t)?{literal:!1,val:t}:void 0}}))}const pn="Invalid DateTime";function kn(e){return new l("unsupported zone",`the zone "${e.name}" is not supported`)}function Sn(e){return null===e.weekData&&(e.weekData=st(e.c)),e.weekData}function Tn(e){return null===e.localWeekData&&(e.localWeekData=st(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Z(e,t){e={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new W({...e,...t,old:e})}function On(e,t,r){var n=e-60*t*1e3,s=r.offset(n);return t===s?[n,t]:s===(r=r.offset(n-=60*(s-t)*1e3))?[n,s]:[e-60*Math.min(s,r)*1e3,Math.max(s,r)]}function bn(e,t){e+=60*t*1e3;t=new Date(e);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Nn(e,t,r){return On(bt(e),t,r)}function Dn(e,t){var r=e.o,n=e.c.year+Math.trunc(t.years),s=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),n={...e.c,year:n,month:s,day:Math.min(e.c.day,Ot(n,s))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},s=x.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");let[i,a]=On(bt(n),r,e.zone);return 0!==s&&(i+=s,a=e.zone.offset(i)),{ts:i,o:a}}function Mn(e,t,r,n,s,i){var{setZone:a,zone:o}=r;return e&&0!==Object.keys(e).length||t?(t=t||o,e=W.fromObject(e,{...r,zone:t,specificOffset:i}),a?e:e.setZone(o)):W.invalid(new l("unparsable",`the input "${s}" can't be parsed as `+n))}function In(e,t,r=!0){return e.isValid?N.create(w.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Vn(e,t){var r=9999<e.c.year||e.c.year<0;let n="";return r&&0<=e.c.year&&(n+="+"),n+=g(e.c.year,r?6:4),n=t?(n=(n+="-")+g(e.c.month)+"-")+g(e.c.day):(n+=g(e.c.month))+g(e.c.day)}function xn(e,t,r,n,s,i){let a=g(e.c.hour);return t?(a=(a+=":")+g(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(a+=":")):a+=g(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(a+=g(e.c.second),0===e.c.millisecond&&n)||(a=(a+=".")+g(e.c.millisecond,3)),s&&(e.isOffsetFixed&&0===e.offset&&!i?a+="Z":a=e.o<0?(a=(a+="-")+g(Math.trunc(-e.o/60))+":")+g(Math.trunc(-e.o%60)):(a=(a+="+")+g(Math.trunc(e.o/60))+":")+g(Math.trunc(e.o%60))),i&&(a+="["+e.zone.ianaName+"]"),a}const En={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Cn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Fn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Zn=["year","month","day","hour","minute","second","millisecond"],Wn=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ln=["year","ordinal","hour","minute","second","millisecond"];function zn(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:var t=e,r={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"}[t.toLowerCase()];if(r)return r;throw new q(t)}}function jn(e,t){var r=p(t.zone,k.defaultZone);if(!r.isValid)return W.invalid(kn(r));t=w.fromObject(t);let n,s;if(S(e.year))n=k.now();else{for(const a of Zn)S(e[a])&&(e[a]=En[a]);var i=ht(e)||dt(e);if(i)return W.invalid(i);i=r,Un[i]||(void 0===$n&&($n=k.now()),Un[i]=i.offset($n));i=Un[i];[n,s]=Nn(e,i,r)}return new W({ts:n,zone:r,loc:t,o:s})}function qn(t,r,n){const s=!!S(n.round)||n.round,e=(e,t)=>(e=St(e,s||n.calendary?0:2,!0),r.loc.clone(n).relFormatter(n).format(e,t)),i=e=>n.calendary?r.hasSame(t,e)?0:r.startOf(e).diff(t.startOf(e),e).get(e):r.diff(t,e).get(e);if(n.unit)return e(i(n.unit),n.unit);for(const o of n.units){var a=i(o);if(1<=Math.abs(a))return e(a,o)}return e(r<t?-0:0,n.units[n.units.length-1])}function An(e){let t={},r;return r=0<e.length&&"object"==typeof e[e.length-1]?(t=e[e.length-1],Array.from(e).slice(0,e.length-1)):Array.from(e),[t,r]}let $n,Un={};class W{constructor(e){var t,r=e.zone||k.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new l("invalid input"):null)||(r.isValid?null:kn(r)),s=(this.ts=S(e.ts)?k.now():e.ts,null),i=null;n||(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r)?[s,i]=[e.old.c,e.old.o]:(t=h(e.o)&&!e.old?e.o:r.offset(this.ts),s=bn(this.ts,t),n=Number.isNaN(s.year)?new l("invalid input"):null,s=n?null:s,i=n?null:t)),this._zone=r,this.loc=e.loc||w.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=s,this.o=i,this.isLuxonDateTime=!0}static now(){return new W({})}static local(){var[e,t]=An(arguments),[t,r,n,s,i,a,o]=t;return jn({year:t,month:r,day:n,hour:s,minute:i,second:a,millisecond:o},e)}static utc(){var[e,t]=An(arguments),[t,r,n,s,i,a,o]=t;return e.zone=d.utcInstance,jn({year:t,month:r,day:n,hour:s,minute:i,second:a,millisecond:o},e)}static fromJSDate(e,t={}){var r,e=ft(e)?e.valueOf():NaN;return Number.isNaN(e)?W.invalid("invalid input"):(r=p(t.zone,k.defaultZone)).isValid?new W({ts:e,zone:r,loc:w.fromObject(t)}):W.invalid(kn(r))}static fromMillis(e,t={}){if(h(e))return e<-864e13||864e13<e?W.invalid("Timestamp out of range"):new W({ts:e,zone:p(t.zone,k.defaultZone),loc:w.fromObject(t)});throw new u(`fromMillis requires a numerical input, but received a ${typeof e} with value `+e)}static fromSeconds(e,t={}){if(h(e))return new W({ts:1e3*e,zone:p(t.zone,k.defaultZone),loc:w.fromObject(t)});throw new u("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};var r=p(t.zone,k.defaultZone);if(!r.isValid)return W.invalid(kn(r));var n=w.fromObject(t),s=Et(e,zn),{minDaysInFirstWeek:i,startOfWeek:a}=ut(s,n),o=k.now(),t=S(t.specificOffset)?r.offset(o):t.specificOffset,u=!S(s.ordinal),l=!S(s.year),c=!S(s.month)||!S(s.day),l=l||c,h=s.weekYear||s.weekNumber;if((l||u)&&h)throw new v("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&u)throw new v("Can't mix ordinal dates with month/day");c=h||s.weekday&&!l;let d,m,f=bn(o,t),y=(c?(d=Wn,m=Cn,f=st(f,i,a)):u?(d=Ln,m=Fn,f=at(f)):(d=Zn,m=En),!1);for(const g of d)S(s[g])?y?s[g]=m[g]:s[g]=f[g]:y=!0;var h=(c?lt(s,i,a):(u?ct:ht)(s))||dt(s);return h?W.invalid(h):([o,h]=Nn(c?it(s,i,a):u?ot(s):s,t,r),c=new W({ts:o,zone:r,o:h,loc:n}),s.weekday&&l&&e.weekday!==c.weekday?W.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of `+c.toISO()):c.isValid?c:W.invalid(c.invalid))}static fromISO(e,t={}){var[r,n]=xr(e);return Mn(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){var[r,n]=Er(e);return Mn(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){var[e,r]=Cr(e);return Mn(e,r,t,"HTTP",t)}static fromFormat(e,t,r={}){if(S(e)||S(t))throw new u("fromFormat requires an input string and a format");var{locale:n=null,numberingSystem:s=null}=r,[n,s,i,a]=vn(w.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),e,t);return a?W.invalid(a):Mn(n,s,r,"format "+t,e,i)}static fromString(e,t,r={}){return W.fromFormat(e,t,r)}static fromSQL(e,t={}){var[r,n]=qr(e);return Mn(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the DateTime is invalid");e=e instanceof l?e:new l(e,t);if(k.throwOnInvalid)throw new L(e);return new W({invalid:e})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){e=wn(e,w.fromObject(t));return e?e.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return fn(N.parseFormat(e),w.fromObject(t)).map((e=>e.val)).join("")}static resetCache(){$n=void 0,Un={}}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?Sn(this).weekYear:NaN}get weekNumber(){return this.isValid?Sn(this).weekNumber:NaN}get weekday(){return this.isValid?Sn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Tn(this).weekday:NaN}get localWeekNumber(){return this.isValid?Tn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Tn(this).weekYear:NaN}get ordinal(){return this.isValid?at(this.c).ordinal:NaN}get monthShort(){return this.isValid?Kr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Kr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Kr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Kr.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(){var e,t,r,n;return this.isValid&&!this.isOffsetFixed&&(e=bt(this.c),r=this.zone.offset(e-864e5),n=this.zone.offset(e+864e5),(r=this.zone.offset(e-6e4*r))!==(n=this.zone.offset(e-6e4*n)))&&(t=e-6e4*n,r=bn(e=e-6e4*r,r),n=bn(t,n),r.hour===n.hour)&&r.minute===n.minute&&r.second===n.second&&r.millisecond===n.millisecond?[Z(this,{ts:e}),Z(this,{ts:t})]:[this]}get isInLeapYear(){return Tt(this.year)}get daysInMonth(){return Ot(this.year,this.month)}get daysInYear(){return this.isValid?b(this.year):NaN}get weeksInWeekYear(){return this.isValid?Dt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Dt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){var{locale:e,numberingSystem:t,calendar:r}=N.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:e,numberingSystem:t,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(d.instance(e),t)}toLocal(){return this.setZone(k.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if((t=p(t,k.defaultZone)).equals(this.zone))return this;if(t.isValid){let e=this.ts;return(r||n)&&(r=t.offset(this.ts),n=this.toObject(),[e]=Nn(n,r,t)),Z(this,{ts:e,zone:t})}return W.invalid(kn(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){e=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return Z(this,{loc:e})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;var e=Et(e,zn),{minDaysInFirstWeek:t,startOfWeek:r}=ut(e,this.loc),n=!S(e.weekYear)||!S(e.weekNumber)||!S(e.weekday),s=!S(e.ordinal),i=!S(e.year),a=!S(e.month)||!S(e.day),o=e.weekYear||e.weekNumber;if((i||a||s)&&o)throw new v("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new v("Can't mix ordinal dates with month/day");let u;n?u=it({...st(this.c,t,r),...e},t,r):S(e.ordinal)?(u={...this.toObject(),...e},S(e.day)&&(u.day=Math.min(Ot(u.year,u.month),u.day))):u=ot({...at(this.c),...e});var[i,o]=Nn(u,this.o,this.zone);return Z(this,{ts:i,o:o})}plus(e){return this.isValid?Z(this,Dn(this,x.fromDurationLike(e))):this}minus(e){return this.isValid?Z(this,Dn(this,x.fromDurationLike(e).negate())):this}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;var r,n={},e=x.normalizeUnit(e);switch(e){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}return"weeks"===e&&(t?(t=this.loc.getStartOfWeek(),r=this["weekday"],r<t&&(n.weekNumber=this.weekNumber-1),n.weekday=t):n.weekday=1),"quarters"===e&&(r=Math.ceil(this.month/3),n.month=3*(r-1)+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?N.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):pn}toLocaleString(e=A,t={}){return this.isValid?N.create(this.loc.clone(t),e).formatDateTime(this):pn}toLocaleParts(e={}){return this.isValid?N.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:s=!1}={}){var i;return this.isValid?(i=Vn(this,e="extended"===e),(i+="T")+xn(this,e,t,r,n,s)):null}toISODate({format:e="extended"}={}){return this.isValid?Vn(this,"extended"===e):null}toISOWeekDate(){return In(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:s=!1,format:i="extended"}={}){return this.isValid?(n?"T":"")+xn(this,"extended"===i,t,e,r,s):null}toRFC2822(){return In(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return In(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Vn(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(t||e)&&(r&&(n+=" "),t?n+="z":e&&(n+="ZZ")),In(this,n,!0)}toSQL(e={}){return this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null}toString(){return this.isValid?this.toISO():pn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){var t;return this.isValid?(t={...this.c},e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t):{}}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){var n;return this.isValid&&e.isValid?(r={locale:this.locale,numberingSystem:this.numberingSystem,...r},t=vt(t).map(x.normalizeUnit),e=en((n=e.valueOf()>this.valueOf())?this:e,n?e:this,t,r),n?e.negate():e):x.invalid("created by diffing an invalid DateTime")}diffNow(e="milliseconds",t={}){return this.diff(W.now(),e,t)}until(e){return this.isValid?E.fromDateTimes(this,e):this}hasSame(e,t,r){var n;return!!this.isValid&&(n=e.valueOf(),(e=this.setZone(e.zone,{keepLocalTime:!0})).startOf(t,r)<=n)&&n<=e.endOf(t,r)}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;var t=e.base||W.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let n=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(n=e.unit,s=void 0),qn(t,this.plus(r),{...e,numeric:"always",units:n,unit:s})}toRelativeCalendar(e={}){return this.isValid?qn(e.base||W.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(e.every(W.isDateTime))return wt(e,(e=>e.valueOf()),Math.min);throw new u("min requires all arguments be DateTimes")}static max(...e){if(e.every(W.isDateTime))return wt(e,(e=>e.valueOf()),Math.max);throw new u("max requires all arguments be DateTimes")}static fromFormatExplain(e,t,r={}){var{locale:r=null,numberingSystem:n=null}=r;return gn(w.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return W.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){var{locale:t=null,numberingSystem:r=null}=t,t=w.fromOpts({locale:t,numberingSystem:r,defaultToEN:!0});return new yn(t,e)}static fromFormatParser(e,t,r={}){if(S(e)||S(t))throw new u("fromFormatParser requires an input string and a format parser");var n,s,i,{locale:a=null,numberingSystem:o=null}=r,a=w.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});if(a.equals(t.locale))return({result:o,zone:n,specificOffset:s,invalidReason:i}=t.explainFromTokens(e)),i?W.invalid(i):Mn(o,n,r,"format "+t.format,e,s);throw new u(`fromFormatParser called with a locale of ${a}, `+"but the format parser was created for "+t.locale)}static get DATE_SHORT(){return A}static get DATE_MED(){return $}static get DATE_MED_WITH_WEEKDAY(){return U}static get DATE_FULL(){return _}static get DATE_HUGE(){return Y}static get TIME_SIMPLE(){return R}static get TIME_WITH_SECONDS(){return H}static get TIME_WITH_SHORT_OFFSET(){return P}static get TIME_WITH_LONG_OFFSET(){return J}static get TIME_24_SIMPLE(){return G}static get TIME_24_WITH_SECONDS(){return B}static get TIME_24_WITH_SHORT_OFFSET(){return Q}static get TIME_24_WITH_LONG_OFFSET(){return K}static get DATETIME_SHORT(){return X}static get DATETIME_SHORT_WITH_SECONDS(){return ee}static get DATETIME_MED(){return te}static get DATETIME_MED_WITH_SECONDS(){return re}static get DATETIME_MED_WITH_WEEKDAY(){return ne}static get DATETIME_FULL(){return se}static get DATETIME_FULL_WITH_SECONDS(){return ie}static get DATETIME_HUGE(){return ae}static get DATETIME_HUGE_WITH_SECONDS(){return oe}}function _n(e){if(W.isDateTime(e))return e;if(e&&e.valueOf&&h(e.valueOf()))return W.fromJSDate(e);if(e&&"object"==typeof e)return W.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type `+typeof e)}s="3.5.0";export{W as DateTime,x as Duration,d as FixedOffsetZone,a as IANAZone,Kr as Info,E as Interval,qe as InvalidZone,k as Settings,le as SystemZone,s as VERSION,i as Zone}; |