UNPKG

@nocobase/plugin-auth

Version:

User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.

1 lines 87 kB
(function(){var e={222:function(e,t,n){(function(t,r){if(typeof define==="function"&&define.amd){define(["luxon"],r)}else if(true){e.exports=r(n(687),n(81))}else{}})(this,(function(e,t){const r={};const i=t&&t.spawn;const s=n(14)(e);const o=n(468)(s,i);e.DateTime.prototype.getWeekDay=function(){return this.weekday===7?0:this.weekday};r.job=(e,t,n,r,i,s,a,u,l)=>new o(e,t,n,r,i,s,a,u,l);r.time=(e,t)=>new s(e,t);r.sendAt=e=>r.time(e).sendAt();r.timeout=e=>r.time(e).getTimeout();r.CronJob=o;r.CronTime=s;return r}))},468:function(e){function CronJob(e,t){function fnWrap(e){let n;let r;switch(typeof e){case"string":r=e.split(" ");n=r.shift();return t.bind(undefined,n,r);case"object":n=e&&e.command;if(n){r=e.args;const i=e.options;return t.bind(undefined,n,r,i)}break}return e}function CJ(t,n,r,i,s,o,a,u,l){let c=t;let f=0;for(let e=0;e<arguments.length;e++){if(arguments[e]!==undefined){f++}}if(typeof t!=="string"&&f===1){n=t.onTick;r=t.onComplete;o=t.context;i=t.start||t.startNow||t.startJob;s=t.timeZone;a=t.runOnInit;c=t.cronTime;u=t.utcOffset;l=t.unrefTimeout}this.context=o||this;this._callbacks=[];this.onComplete=fnWrap(r);this.cronTime=new e(c,s,u);this.unrefTimeout=l;addCallback.call(this,fnWrap(n));if(a){this.lastExecution=new Date;fireOnTick.call(this)}if(i){start.call(this)}return this}const addCallback=function(e){if(typeof e==="function"){this._callbacks.push(e)}};CJ.prototype.addCallback=addCallback;CJ.prototype.setTime=function(e){if(typeof e!=="object"){throw new Error("time must be an instance of CronTime.")}const t=this.running;this.stop();this.cronTime=e;if(t)this.start()};CJ.prototype.nextDate=function(){return this.cronTime.sendAt()};const fireOnTick=function(){for(let e=this._callbacks.length-1;e>=0;e--){this._callbacks[e].call(this.context,this.onComplete)}};CJ.prototype.fireOnTick=fireOnTick;CJ.prototype.nextDates=function(e){return this.cronTime.sendAt(e)};const start=function(){if(this.running){return}const e=2147483647;const t=this;let n=this.cronTime.getTimeout();let r=0;let i;if(this.cronTime.realDate){this.runOnce=true}function _setTimeout(e){i=Date.now();t._timeout=setTimeout(callbackWrapper,e);if(t.unrefTimeout&&typeof t._timeout.unref==="function"){t._timeout.unref()}}function callbackWrapper(){const s=i+n-Date.now();if(s>0){let e=t.cronTime.getTimeout();if(e>s){e=s}r+=e}t.lastExecution=new Date;if(r){if(r>e){r-=e;n=e}else{n=r;r=0}_setTimeout(n)}else{t.running=false;if(!t.runOnce){t.start()}t.fireOnTick()}}if(n>=0){this.running=true;if(n>e){r=n-e;n=e}_setTimeout(n)}else{this.stop()}};CJ.prototype.start=start;CJ.prototype.lastDate=function(){return this.lastExecution};CJ.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this.running=false;if(typeof this.onComplete==="function"){this.onComplete()}};return CJ}e.exports=CronJob},14:function(e){const t=[[0,59],[0,59],[0,23],[1,31],[0,11],[0,6]];const n=[31,29,31,30,31,30,31,31,30,31,30,31];const r=["0","*","*","*","*","*"];const i={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};const s=["second","minute","hour","dayOfMonth","month","dayOfWeek"];const o=s.length;const a={"@yearly":"0 0 0 1 0 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"};const u=/\*/g;const l=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g;function CronTime(e){function CT(t,n,r){this.source=t;if(n){const t=e.DateTime.fromObject({},{zone:n});if(t.invalid){throw new Error("Invalid timezone.")}this.zone=n}if(typeof r!=="undefined"){this.utcOffset=r}const i=this;s.forEach((e=>{i[e]={}}));if(this.source instanceof Date||this.source instanceof e.DateTime){if(this.source instanceof Date){this.source=e.DateTime.fromJSDate(this.source)}this.realDate=true}else{this._parse(this.source);this._verifyParse()}}CT.prototype={_verifyParse:function(){const e=Object.keys(this.month);const t=Object.keys(this.dayOfMonth);let r=false;let i=NaN;for(let s=0;s<e.length;s++){const o=e[s];const a=n[parseInt(o,10)];for(let e=0;e<t.length;e++){const n=t[e];if(n<=a){r=true}}if(!r){i=o;console.warn(`Month '${o}' is limited to '${a}' days.`)}}if(!r){const e=n[parseInt(i,10)];for(let n=0;n<t.length;n++){const r=t[n];if(r>e){delete this.dayOfMonth[r];const t=Number(r)%e;this.dayOfMonth[t]=true}}}},sendAt:function(t){let n=this.realDate?this.source:e.DateTime.local();if(this.zone){n=n.setZone(this.zone)}if(typeof this.utcOffset!=="undefined"){const e=parseInt(this.utcOffset>=60||this.utcOffset<=-60?this.utcOffset/60:this.utcOffset);const t=this.utcOffset>=60||this.utcOffset<=-60?Math.abs(this.utcOffset-e*60):0;const r=t>=10?t:"0"+t;let i="UTC";if(parseInt(this.utcOffset)<0){i+=`${e===0?"-0":e}:${r}`}else{i+=`+${e}:${r}`}n=n.setZone(i);if(n.invalid){throw new Error("ERROR: You specified an invalid UTC offset.")}}if(this.realDate){if(e.DateTime.local()>n){throw new Error("WARNING: Date in past. Will never be fired.")}return n}if(isNaN(t)||t<0){return this._getNextDateFrom(n)}else{const e=[];for(;t>0;t--){n=this._getNextDateFrom(n);e.push(n)}return e}},getTimeout:function(){return Math.max(-1,this.sendAt()-e.DateTime.local())},toString:function(){return this.toJSON().join(" ")},toJSON:function(){const e=this;return s.map((function(t){return e._wcOrAll(t)}))},getNextDateFrom:function(e,t){return this._getNextDateFrom(e,t)},_getNextDateFrom:function(t,n){if(t instanceof Date){t=e.DateTime.fromJSDate(t)}let r=t;const i=t.toMillis();if(n){r=r.setZone(n)}if(!this.realDate){if(r.millisecond>0){r=r.set({millisecond:0,second:r.second+1})}}if(r.invalid){throw new Error("ERROR: You specified an invalid date.")}const s=e.DateTime.now().plus({years:8});while(true){const o=r-t;if(r>s){throw new Error(`Something went wrong. No execution date was found in the next 8 years.\n\t\t\t\t\t\t\tPlease provide the following string if you would like to help debug:\n\t\t\t\t\t\t\tTime Zone: ${n||'""'} - Cron String: ${this} - UTC offset: ${r.offset}\n\t\t\t\t\t\t\t- current Date: ${e.DateTime.local().toString()}`)}if(!(r.month-1 in this.month)&&Object.keys(this.month).length!==12){r=r.plus({months:1});r=r.set({day:1,hour:0,minute:0,second:0});if(this._forwardDSTJump(0,0,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}if(!(r.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!(r.getWeekDay()in this.dayOfWeek&&Object.keys(this.dayOfWeek).length!==7)){r=r.plus({days:1});r=r.set({hour:0,minute:0,second:0});if(this._forwardDSTJump(0,0,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}if(!(r.getWeekDay()in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!(r.day in this.dayOfMonth&&Object.keys(this.dayOfMonth).length!==31)){r=r.plus({days:1});r=r.set({hour:0,minute:0,second:0});if(this._forwardDSTJump(0,0,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}if(!(r.hour in this.hour)&&Object.keys(this.hour).length!==24){const e=r.hour===23&&o>864e5?0:r.hour+1;const t=r.minute;r=r.set({hour:e});r=r.set({minute:0,second:0});if(this._forwardDSTJump(e,t,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}if(!(r.minute in this.minute)&&Object.keys(this.minute).length!==60){const e=r.minute===59&&o>36e5?0:r.minute+1;const t=r.hour+(e===60?1:0);r=r.set({minute:e});r=r.set({second:0});if(this._forwardDSTJump(t,e,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}if(!(r.second in this.second)&&Object.keys(this.second).length!==60){const e=r.second===59&&o>6e4?0:r.second+1;const t=r.minute+(e===60);const n=r.hour+(t===60?1:0);r=r.set({second:e});if(this._forwardDSTJump(n,t,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}if(r.toMillis()===i){const e=r.second+1;const t=r.minute+(e===60);const n=r.hour+(t===60?1:0);r=r.set({second:e});if(this._forwardDSTJump(n,t,r)){const[e,t]=this._findPreviousDSTJump(r);r=t;if(e)break}continue}break}return r},_findPreviousDSTJump:function(e){let t,n,r,i;let s=e;const o=60*24;let a=0;do{if(++a>o){throw new Error(`ERROR: This DST checking related function assumes the input DateTime (${e.toISO()}) is within 24 hours of a DST jump.`)}t=s.minute-1;n=s.hour;if(t<0){t+=60;n=(n+24-1)%24}s=s.minus({minute:1});r=s.minute;i=s.hour}while(t===r&&n===i);const u=s.plus({minute:1}).set({seconds:0,millisecond:0});const l=u.minus({second:1});if(e.month in this.month&&e.day in this.dayOfMonth&&e.getWeekDay()in this.dayOfWeek){return[this._checkTimeInSkippedRange(l,u),u]}return[false,u]},_checkTimeInSkippedRange:function(e,t){const n=(e.minute+1)%60;const r=(e.hour+(n===0))%24;const i=t.hour-r+1;const s=n===0&&t.minute===0;if(i===2&&s){return r in this.hour}else if(i===1){return r in this.hour&&this._checkTimeInSkippedRangeSingleHour(n,t.minute)}else{return this._checkTimeInSkippedRangeMultiHour(r,n,t.hour,t.minute)}},_checkTimeInSkippedRangeSingleHour:function(e,t){for(let n=e;n<t;++n){if(n in this.minute)return true}return t in this.minute&&0 in this.second},_checkTimeInSkippedRangeMultiHour:function(e,t,n,r){if(e>=n){throw new Error(`ERROR: This DST checking related function assumes the forward jump starting hour (${e}) is less than the end hour (${n})`)}const i=Array.from({length:60-t},((e,n)=>t+n));const s=Array.from({length:r},((e,t)=>t));const o=Array.from({length:60},((e,t)=>t));const selectRange=t=>{if(t===e){return i}else if(t===n){return s}else{return o}};for(let t=e;t<=n;++t){if(!(t in this.hour))continue;const e=selectRange(t);for(const t of e){if(t in this.minute)return true}}return n in this.hour&&r in this.minute&&0 in this.second},_forwardDSTJump:function(e,t,n){const r=n.hour;const i=n.minute;const s=e%24<r;const o=t%60<i;return s||o},_wcOrAll:function(e){if(this._hasAll(e)){return"*"}const t=[];for(const n in this[e]){t.push(n)}return t.join(",")},_hasAll:function(e){const n=t[s.indexOf(e)];for(let t=n[0],r=n[1];t<r;t++){if(!(t in this[e])){return false}}return true},_parse:function(e){e=e.toLowerCase();if(e in a){e=a[e]}e=e.replace(/[a-z]{1,3}/gi,(e=>{if(e in i){return i[e]}throw new Error(`Unknown alias: ${e}`)}));const n=e.trim().split(/\s+/);if(n.length<o-1){throw new Error("Too few fields")}if(n.length>o){throw new Error("Too many fields")}const u=n.length;for(let e=0;e<o;e++){const i=n[e-(o-u)]||r[e];this._parseField(i,s[e],t[e])}},_parseField:function(e,t,n){const r=this[t];let i;const s=n[0];const o=n[1];const a=e.split(",");a.forEach((e=>{const t=e.indexOf("*");if(t!==-1&&t!==0){throw new Error(`Field (${e}) has an invalid wildcard expression`)}}));e=e.replace(u,`${s}-${o}`);const c=e.split(",");for(let n=0;n<c.length;n++){if(c[n].match(l)){c[n].replace(l,((n,a,u,l)=>{a=parseInt(a,10);u=u!==undefined?parseInt(u,10):undefined;const c=!isNaN(parseInt(l,10));if(l==="0"){throw new Error(`Field (${t}) has a step of zero`)}l=parseInt(l,10)||1;if(u!==undefined&&a>u){throw new Error(`Field (${t}) has an invalid range`)}const f=a<s||u!==undefined&&u>o||u===undefined&&a>o;if(f){throw new Error(`Field value (${e}) is out of range`)}a=Math.min(Math.max(s,~~Math.abs(a)),o);if(u!==undefined){u=Math.min(o,~~Math.abs(u))}else{u=c?o:a}i=a;do{r[i]=true;i+=l}while(i<=u)}))}else{throw new Error(`Field (${t}) cannot be parsed`)}}}};return CT}e.exports=CronTime},687:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class LuxonError extends Error{}class InvalidDateTimeError extends LuxonError{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class InvalidIntervalError extends LuxonError{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class InvalidDurationError extends LuxonError{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class ConflictingSpecificationError extends LuxonError{}class InvalidUnitError extends LuxonError{constructor(e){super(`Invalid unit ${e}`)}}class InvalidArgumentError extends LuxonError{}class ZoneIsAbstractError extends LuxonError{constructor(){super("Zone is an abstract class")}}const n="numeric",r="short",i="long";const s={year:n,month:n,day:n};const o={year:n,month:r,day:n};const a={year:n,month:r,day:n,weekday:r};const u={year:n,month:i,day:n};const l={year:n,month:i,day:n,weekday:i};const c={hour:n,minute:n};const f={hour:n,minute:n,second:n};const d={hour:n,minute:n,second:n,timeZoneName:r};const h={hour:n,minute:n,second:n,timeZoneName:i};const m={hour:n,minute:n,hourCycle:"h23"};const y={hour:n,minute:n,second:n,hourCycle:"h23"};const g={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:r};const p={hour:n,minute:n,second:n,hourCycle:"h23",timeZoneName:i};const T={year:n,month:n,day:n,hour:n,minute:n};const w={year:n,month:n,day:n,hour:n,minute:n,second:n};const O={year:n,month:r,day:n,hour:n,minute:n};const S={year:n,month:r,day:n,hour:n,minute:n,second:n};const D={year:n,month:r,day:n,weekday:r,hour:n,minute:n};const v={year:n,month:i,day:n,hour:n,minute:n,timeZoneName:r};const b={year:n,month:i,day:n,hour:n,minute:n,second:n,timeZoneName:r};const I={year:n,month:i,day:n,weekday:i,hour:n,minute:n,timeZoneName:i};const k={year:n,month:i,day:n,weekday:i,hour:n,minute:n,second:n,timeZoneName:i};class Zone{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get ianaName(){return this.name}get isUniversal(){throw new ZoneIsAbstractError}offsetName(e,t){throw new ZoneIsAbstractError}formatOffset(e,t){throw new ZoneIsAbstractError}offset(e){throw new ZoneIsAbstractError}equals(e){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}}let x=null;class SystemZone extends Zone{static get instance(){if(x===null){x=new SystemZone}return x}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return false}offsetName(e,{format:t,locale:n}){return parseZoneInfo(e,t,n)}formatOffset(e,t){return formatOffset(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return true}}let N={};function makeDTF(e){if(!N[e]){N[e]=new Intl.DateTimeFormat("en-US",{hour12:false,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})}return N[e]}const M={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function hackyOffset(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,s,o,a,u,l,c]=r;return[o,i,s,a,u,l,c]}function partsOffset(e,t){const n=e.formatToParts(t);const r=[];for(let e=0;e<n.length;e++){const{type:t,value:i}=n[e];const s=M[t];if(t==="era"){r[s]=i}else if(!isUndefined(s)){r[s]=parseInt(i,10)}}return r}let E={};class IANAZone extends Zone{static create(e){if(!E[e]){E[e]=new IANAZone(e)}return E[e]}static resetCache(){E={};N={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e){return false}try{new Intl.DateTimeFormat("en-US",{timeZone:e}).format();return true}catch(e){return false}}constructor(e){super();this.zoneName=e;this.valid=IANAZone.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return false}offsetName(e,{format:t,locale:n}){return parseZoneInfo(e,t,n,this.name)}formatOffset(e,t){return formatOffset(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=makeDTF(this.name);let[r,i,s,o,a,u,l]=n.formatToParts?partsOffset(n,t):hackyOffset(n,t);if(o==="BC"){r=-Math.abs(r)+1}const c=a===24?0:a;const f=objToLocalTS({year:r,month:i,day:s,hour:c,minute:u,second:l,millisecond:0});let d=+t;const h=d%1e3;d-=h>=0?h:1e3+h;return(f-d)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let F={};function getCachedLF(e,t={}){const n=JSON.stringify([e,t]);let r=F[n];if(!r){r=new Intl.ListFormat(e,t);F[n]=r}return r}let Z={};function getCachedDTF(e,t={}){const n=JSON.stringify([e,t]);let r=Z[n];if(!r){r=new Intl.DateTimeFormat(e,t);Z[n]=r}return r}let C={};function getCachedINF(e,t={}){const n=JSON.stringify([e,t]);let r=C[n];if(!r){r=new Intl.NumberFormat(e,t);C[n]=r}return r}let L={};function getCachedRTF(e,t={}){const{base:n,...r}=t;const i=JSON.stringify([e,r]);let s=L[i];if(!s){s=new Intl.RelativeTimeFormat(e,t);L[i]=s}return s}let A=null;function systemLocale(){if(A){return A}else{A=(new Intl.DateTimeFormat).resolvedOptions().locale;return A}}function parseLocaleString(e){const t=e.indexOf("-x-");if(t!==-1){e=e.substring(0,t)}const n=e.indexOf("-u-");if(n===-1){return[e]}else{let t;let r;try{t=getCachedDTF(e).resolvedOptions();r=e}catch(i){const s=e.substring(0,n);t=getCachedDTF(s).resolvedOptions();r=s}const{numberingSystem:i,calendar:s}=t;return[r,i,s]}}function intlConfigString(e,t,n){if(n||t){if(!e.includes("-u-")){e+="-u"}if(n){e+=`-ca-${n}`}if(t){e+=`-nu-${t}`}return e}else{return e}}function mapMonths(e){const t=[];for(let n=1;n<=12;n++){const r=DateTime.utc(2016,n,1);t.push(e(r))}return t}function mapWeekdays(e){const t=[];for(let n=1;n<=7;n++){const r=DateTime.utc(2016,11,13+n);t.push(e(r))}return t}function listStuff(e,t,n,r,i){const s=e.listingMode(n);if(s==="error"){return null}else if(s==="en"){return r(t)}else{return i(t)}}function supportsFastNumbers(e){if(e.numberingSystem&&e.numberingSystem!=="latn"){return false}else{return e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}}class PolyNumberFormatter{constructor(e,t,n){this.padTo=n.padTo||0;this.floor=n.floor||false;const{padTo:r,floor:i,...s}=n;if(!t||Object.keys(s).length>0){const t={useGrouping:false,...n};if(n.padTo>0)t.minimumIntegerDigits=n.padTo;this.inf=getCachedINF(e,t)}}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):roundTo(e,3);return padStart(t,this.padTo)}}}class PolyDateFormatter{constructor(e,t,n){this.opts=n;this.originalZone=undefined;let r=undefined;if(this.opts.timeZone){this.dt=e}else if(e.zone.type==="fixed"){const t=-1*(e.offset/60);const n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;if(e.offset!==0&&IANAZone.create(n).valid){r=n;this.dt=e}else{r="UTC";this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset});this.originalZone=e.zone}}else if(e.zone.type==="system"){this.dt=e}else if(e.zone.type==="iana"){this.dt=e;r=e.zone.name}else{r="UTC";this.dt=e.setZone("UTC").plus({minutes:e.offset});this.originalZone=e.zone}const i={...this.opts};i.timeZone=i.timeZone||r;this.dtf=getCachedDTF(t,i)}format(){if(this.originalZone){return this.formatToParts().map((({value:e})=>e)).join("")}return this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone){return e.map((e=>{if(e.type==="timeZoneName"){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}else{return e}}))}return e}resolvedOptions(){return this.dtf.resolvedOptions()}}class PolyRelFormatter{constructor(e,t,n){this.opts={style:"long",...n};if(!t&&hasRelative()){this.rtf=getCachedRTF(e,n)}}format(e,t){if(this.rtf){return this.rtf.format(e,t)}else{return formatRelativeTime(t,e,this.opts.numeric,this.opts.style!=="long")}}formatToParts(e,t){if(this.rtf){return this.rtf.formatToParts(e,t)}else{return[]}}}class Locale{static fromOpts(e){return Locale.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=false){const i=e||Settings.defaultLocale;const s=i||(r?"en-US":systemLocale());const o=t||Settings.defaultNumberingSystem;const a=n||Settings.defaultOutputCalendar;return new Locale(s,o,a,i)}static resetCache(){A=null;Z={};C={};L={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Locale.create(e,t,n)}constructor(e,t,n,r){const[i,s,o]=parseLocaleString(e);this.locale=i;this.numberingSystem=t||s||null;this.outputCalendar=n||o||null;this.intl=intlConfigString(this.locale,this.numberingSystem,this.outputCalendar);this.weekdaysCache={format:{},standalone:{}};this.monthsCache={format:{},standalone:{}};this.meridiemCache=null;this.eraCache={};this.specifiedLocale=r;this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null){this.fastNumbersCached=supportsFastNumbers(this)}return this.fastNumbersCached}listingMode(){const e=this.isEnglish();const t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){if(!e||Object.getOwnPropertyNames(e).length===0){return this}else{return Locale.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||false)}}redefaultToEN(e={}){return this.clone({...e,defaultToEN:true})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:false})}months(e,t=false,n=true){return listStuff(this,e,n,months,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";if(!this.monthsCache[r][e]){this.monthsCache[r][e]=mapMonths((e=>this.extract(e,n,"month")))}return this.monthsCache[r][e]}))}weekdays(e,t=false,n=true){return listStuff(this,e,n,weekdays,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";if(!this.weekdaysCache[r][e]){this.weekdaysCache[r][e]=mapWeekdays((e=>this.extract(e,n,"weekday")))}return this.weekdaysCache[r][e]}))}meridiems(e=true){return listStuff(this,undefined,e,(()=>G),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=true){return listStuff(this,e,t,eras,(()=>{const t={era:e};if(!this.eraCache[e]){this.eraCache[e]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))}return this.eraCache[e]}))}extract(e,t,n){const r=this.dtFormatter(e,t),i=r.formatToParts(),s=i.find((e=>e.type.toLowerCase()===n));return s?s.value:null}numberFormatter(e={}){return new PolyNumberFormatter(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new PolyDateFormatter(e,this.intl,t)}relFormatter(e={}){return new PolyRelFormatter(this.intl,this.isEnglish(),e)}listFormatter(e={}){return getCachedLF(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let V=null;class FixedOffsetZone extends Zone{static get utcInstance(){if(V===null){V=new FixedOffsetZone(0)}return V}static instance(e){return e===0?FixedOffsetZone.utcInstance:new FixedOffsetZone(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t){return new FixedOffsetZone(signedOffset(t[1],t[2]))}}return null}constructor(e){super();this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0){return"Etc/UTC"}else{return`Etc/GMT${formatOffset(-this.fixed,"narrow")}`}}offsetName(){return this.name}formatOffset(e,t){return formatOffset(this.fixed,t)}get isUniversal(){return true}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return true}}class InvalidZone extends Zone{constructor(e){super();this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return false}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return false}get isValid(){return false}}function normalizeZone(e,t){if(isUndefined(e)||e===null){return t}else if(e instanceof Zone){return e}else if(isString(e)){const n=e.toLowerCase();if(n==="default")return t;else if(n==="local"||n==="system")return SystemZone.instance;else if(n==="utc"||n==="gmt")return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(n)||IANAZone.create(e)}else if(isNumber(e)){return FixedOffsetZone.instance(e)}else if(typeof e==="object"&&e.offset&&typeof e.offset==="number"){return e}else{return new InvalidZone(e)}}let now=()=>Date.now(),$="system",_=null,U=null,R=null,j=60,z;class Settings{static get now(){return now}static set now(e){now=e}static set defaultZone(e){$=e}static get defaultZone(){return normalizeZone($,SystemZone.instance)}static get defaultLocale(){return _}static set defaultLocale(e){_=e}static get defaultNumberingSystem(){return U}static set defaultNumberingSystem(e){U=e}static get defaultOutputCalendar(){return R}static set defaultOutputCalendar(e){R=e}static get twoDigitCutoffYear(){return j}static set twoDigitCutoffYear(e){j=e%100}static get throwOnInvalid(){return z}static set throwOnInvalid(e){z=e}static resetCaches(){Locale.resetCache();IANAZone.resetCache()}}function isUndefined(e){return typeof e==="undefined"}function isNumber(e){return typeof e==="number"}function isInteger(e){return typeof e==="number"&&e%1===0}function isString(e){return typeof e==="string"}function isDate(e){return Object.prototype.toString.call(e)==="[object Date]"}function hasRelative(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(e){return false}}function maybeArray(e){return Array.isArray(e)?e:[e]}function bestBy(e,t,n){if(e.length===0){return undefined}return e.reduce(((e,r)=>{const i=[t(r),r];if(!e){return i}else if(n(e[0],i[0])===e[0]){return e}else{return i}}),null)[1]}function pick(e,t){return t.reduce(((t,n)=>{t[n]=e[n];return t}),{})}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function integerBetween(e,t,n){return isInteger(e)&&e>=t&&e<=n}function floorMod(e,t){return e-t*Math.floor(e/t)}function padStart(e,t=2){const n=e<0;let r;if(n){r="-"+(""+-e).padStart(t,"0")}else{r=(""+e).padStart(t,"0")}return r}function parseInteger(e){if(isUndefined(e)||e===null||e===""){return undefined}else{return parseInt(e,10)}}function parseFloating(e){if(isUndefined(e)||e===null||e===""){return undefined}else{return parseFloat(e)}}function parseMillis(e){if(isUndefined(e)||e===null||e===""){return undefined}else{const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function roundTo(e,t,n=false){const r=10**t,i=n?Math.trunc:Math.round;return i(e*r)/r}function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}function daysInYear(e){return isLeapYear(e)?366:365}function daysInMonth(e,t){const n=floorMod(t-1,12)+1,r=e+(t-n)/12;if(n===2){return isLeapYear(r)?29:28}else{return[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}}function objToLocalTS(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);if(e.year<100&&e.year>=0){t=new Date(t);t.setUTCFullYear(e.year,e.month-1,e.day)}return+t}function weeksInWeekYear(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function untruncateYear(e){if(e>99){return e}else return e>Settings.twoDigitCutoffYear?1900+e:2e3+e}function parseZoneInfo(e,t,n,r=null){const i=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(r){s.timeZone=r}const o={timeZoneName:t,...s};const a=new Intl.DateTimeFormat(n,o).formatToParts(i).find((e=>e.type.toLowerCase()==="timezonename"));return a?a.value:null}function signedOffset(e,t){let n=parseInt(e,10);if(Number.isNaN(n)){n=0}const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function asNumber(e){const t=Number(e);if(typeof e==="boolean"||e===""||Number.isNaN(t))throw new InvalidArgumentError(`Invalid unit value ${e}`);return t}function normalizeObject(e,t){const n={};for(const r in e){if(hasOwnProperty(e,r)){const i=e[r];if(i===undefined||i===null)continue;n[t(r)]=asNumber(i)}}return n}function formatOffset(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${padStart(n,2)}:${padStart(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${padStart(n,2)}${padStart(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function timeObject(e){return pick(e,["hour","minute","second","millisecond"])}const W=["January","February","March","April","May","June","July","August","September","October","November","December"];const q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const J=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return[...J];case"short":return[...q];case"long":return[...W];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 P=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];const Y=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];const H=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return[...H];case"short":return[...Y];case"long":return[...P];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const G=["AM","PM"];const B=["Before Christ","Anno Domini"];const Q=["BC","AD"];const K=["B","A"];function eras(e){switch(e){case"narrow":return[...K];case"short":return[...Q];case"long":return[...B];default:return null}}function meridiemForDateTime(e){return G[e.hour<12?0:1]}function weekdayForDateTime(e,t){return weekdays(t)[e.weekday-1]}function monthForDateTime(e,t){return months(t)[e.month-1]}function eraForDateTime(e,t){return eras(t)[e.year<0?0:1]}function formatRelativeTime(e,t,n="always",r=false){const i={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."]};const s=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&s){const n=e==="days";switch(t){case 1:return n?"tomorrow":`next ${i[e][0]}`;case-1:return n?"yesterday":`last ${i[e][0]}`;case 0:return n?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),u=a===1,l=i[e],c=r?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return o?`${a} ${c} ago`:`in ${a} ${c}`}function stringifyTokens(e,t){let n="";for(const r of e){if(r.literal){n+=r.val}else{n+=t(r.val)}}return n}const X={D:s,DD:o,DDD:u,DDDD:l,t:c,tt:f,ttt:d,tttt:h,T:m,TT:y,TTT:g,TTTT:p,f:T,ff:O,fff:v,ffff:I,F:w,FF:S,FFF:b,FFFF:k};class Formatter{static create(e,t={}){return new Formatter(e,t)}static parseFormat(e){let t=null,n="",r=false;const i=[];for(let s=0;s<e.length;s++){const o=e.charAt(s);if(o==="'"){if(n.length>0){i.push({literal:r||/^\s+$/.test(n),val:n})}t=null;n="";r=!r}else if(r){n+=o}else if(o===t){n+=o}else{if(n.length>0){i.push({literal:/^\s+$/.test(n),val:n})}n=o;t=o}}if(n.length>0){i.push({literal:r||/^\s+$/.test(n),val:n})}return i}static macroTokenToFormatOpts(e){return X[e]}constructor(e,t){this.opts=t;this.loc=e;this.systemLoc=null}formatWithSystemDefault(e,t){if(this.systemLoc===null){this.systemLoc=this.loc.redefaultToSystem()}const n=this.systemLoc.dtFormatter(e,{...this.opts,...t});return n.format()}formatDateTime(e,t={}){const n=this.loc.dtFormatter(e,{...this.opts,...t});return n.format()}formatDateTimeParts(e,t={}){const n=this.loc.dtFormatter(e,{...this.opts,...t});return n.formatToParts()}formatInterval(e,t={}){const n=this.loc.dtFormatter(e.start,{...this.opts,...t});return n.dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t={}){const n=this.loc.dtFormatter(e,{...this.opts,...t});return n.resolvedOptions()}num(e,t=0){if(this.opts.forceSimple){return padStart(e,t)}const n={...this.opts};if(t>0){n.padTo=t}return this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",string=(t,n)=>this.loc.extract(e,t,n),formatOffset=t=>{if(e.isOffsetFixed&&e.offset===0&&t.allowZ){return"Z"}return e.isValid?e.zone.formatOffset(e.ts,t.format):""},meridiem=()=>n?meridiemForDateTime(e):string({hour:"numeric",hourCycle:"h12"},"dayperiod"),month=(t,r)=>n?monthForDateTime(e,t):string(r?{month:t}:{month:t,day:"numeric"},"month"),weekday=(t,r)=>n?weekdayForDateTime(e,t):string(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),maybeMacro=t=>{const n=Formatter.macroTokenToFormatOpts(t);if(n){return this.formatWithSystemDefault(e,n)}else{return t}},era=t=>n?eraForDateTime(e,t):string({era:t},"era"),tokenToString=t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return formatOffset({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return formatOffset({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return formatOffset({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 meridiem();case"d":return r?string({day:"numeric"},"day"):this.num(e.day);case"dd":return r?string({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return weekday("short",true);case"cccc":return weekday("long",true);case"ccccc":return weekday("narrow",true);case"E":return this.num(e.weekday);case"EEE":return weekday("short",false);case"EEEE":return weekday("long",false);case"EEEEE":return weekday("narrow",false);case"L":return r?string({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?string({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return month("short",true);case"LLLL":return month("long",true);case"LLLLL":return month("narrow",true);case"M":return r?string({month:"numeric"},"month"):this.num(e.month);case"MM":return r?string({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return month("short",false);case"MMMM":return month("long",false);case"MMMMM":return month("narrow",false);case"y":return r?string({year:"numeric"},"year"):this.num(e.year);case"yy":return r?string({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?string({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?string({year:"numeric"},"year"):this.num(e.year,6);case"G":return era("short");case"GG":return era("long");case"GGGGG":return era("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"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 maybeMacro(t)}};return stringifyTokens(Formatter.parseFormat(t),tokenToString)}formatDurationFromString(e,t){const tokenToField=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}},tokenToString=e=>t=>{const n=tokenToField(t);if(n){return this.num(e.get(n),t.length)}else{return t}},n=Formatter.parseFormat(t),r=n.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]),i=e.shiftTo(...r.map(tokenToField).filter((e=>e)));return stringifyTokens(n,tokenToString(i))}}class Invalid{constructor(e,t){this.reason=e;this.explanation=t}toMessage(){if(this.explanation){return`${this.reason}: ${this.explanation}`}else{return this.reason}}}const ee=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function combineRegexes(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function combineExtractors(...e){return t=>e.reduce((([e,n,r],i)=>{const[s,o,a]=i(t,r);return[{...e,...s},o||n,a]}),[{},null,1]).slice(0,2)}function parse(e,...t){if(e==null){return[null,null]}for(const[n,r]of t){const t=n.exec(e);if(t){return r(t)}}return[null,null]}function simpleParse(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++){r[e[i]]=parseInteger(t[n+i])}return[r,null,n+i]}}const te=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;const ne=`(?:${te.source}?(?:\\[(${ee.source})\\])?)?`;const re=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;const ie=RegExp(`${re.source}${ne}`);const se=RegExp(`(?:T${ie.source})?`);const oe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;const ae=/(\d{4})-?W(\d\d)(?:-?(\d))?/;const ue=/(\d{4})-?(\d{3})/;const le=simpleParse("weekYear","weekNumber","weekDay");const ce=simpleParse("year","ordinal");const fe=/(\d{4})-(\d\d)-(\d\d)/;const de=RegExp(`${re.source} ?(?:${te.source}|(${ee.source}))?`);const he=RegExp(`(?: ${de.source})?`);function int(e,t,n){const r=e[t];return isUndefined(r)?n:parseInteger(r)}function extractISOYmd(e,t){const n={year:int(e,t),month:int(e,t+1,1),day:int(e,t+2,1)};return[n,null,t+3]}function extractISOTime(e,t){const n={hours:int(e,t,0),minutes:int(e,t+1,0),seconds:int(e,t+2,0),milliseconds:parseMillis(e[t+3])};return[n,null,t+4]}function extractISOOffset(e,t){const n=!e[t]&&!e[t+1],r=signedOffset(e[t+1],e[t+2]),i=n?null:FixedOffsetZone.instance(r);return[{},i,t+3]}function extractIANAZone(e,t){const n=e[t]?IANAZone.create(e[t]):null;return[{},n,t+1]}const me=RegExp(`^T?${re.source}$`);const ye=/^-?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 extractISODuration(e){const[t,n,r,i,s,o,a,u,l]=e;const c=t[0]==="-";const f=u&&u[0]==="-";const maybeNegate=(e,t=false)=>e!==undefined&&(t||e&&c)?-e:e;return[{years:maybeNegate(parseFloating(n)),months:maybeNegate(parseFloating(r)),weeks:maybeNegate(parseFloating(i)),days:maybeNegate(parseFloating(s)),hours:maybeNegate(parseFloating(o)),minutes:maybeNegate(parseFloating(a)),seconds:maybeNegate(parseFloating(u),u==="-0"),milliseconds:maybeNegate(parseMillis(l),f)}]}const ge={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fromStrings(e,t,n,r,i,s,o){const a={year:t.length===2?untruncateYear(parseInteger(t)):parseInteger(t),month:q.indexOf(n)+1,day:parseInteger(r),hour:parseInteger(i),minute:parseInteger(s)};if(o)a.second=parseInteger(o);if(e){a.weekday=e.length>3?P.indexOf(e)+1:Y.indexOf(e)+1}return a}const pe=/^(?:(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 extractRFC2822(e){const[,t,n,r,i,s,o,a,u,l,c,f]=e,d=fromStrings(t,i,r,n,s,o,a);let h;if(u){h=ge[u]}else if(l){h=0}else{h=signedOffset(c,f)}return[d,new FixedOffsetZone(h)]}function preprocessRFC2822(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Te=/^(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$/,we=/^(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$/,Oe=/^(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 extractRFC1123Or850(e){const[,t,n,r,i,s,o,a]=e,u=fromStrings(t,i,r,n,s,o,a);return[u,FixedOffsetZone.utcInstance]}function extractASCII(e){const[,t,n,r,i,s,o,a]=e,u=fromStrings(t,a,n,r,i,s,o);return[u,FixedOffsetZone.utcInstance]}const Se=combineRegexes(oe,se);const De=combineRegexes(ae,se);const ve=combineRegexes(ue,se);const be=combineRegexes(ie);const Ie=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone);const ke=combineExtractors(le,extractISOTime,extractISOOffset,extractIANAZone);const xe=combineExtractors(ce,extractISOTime,extractISOOffset,extractIANAZone);const Ne=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseISODate(e){return parse(e,[Se,Ie],[De,ke],[ve,xe],[be,Ne])}function parseRFC2822Date(e){return parse(preprocessRFC2822(e),[pe,extractRFC2822])}function parseHTTPDate(e){return parse(e,[Te,extractRFC1123Or850],[we,extractRFC1123Or850],[Oe,extractASCII])}function parseISODuration(e){return parse(e,[ye,extractISODuration])}const Me=combineExtractors(extractISOTime);function parseISOTimeOnly(e){return parse(e,[me,Me])}const Ee=combineRegexes(fe,he);const Fe=combineRegexes(de);const Ze=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);function parseSQL(e){return parse(e,[Ee,Ie],[Fe,Ze])}const Ce="Invalid Duration";const Le={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ae={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:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Le},Ve=146097/400,$e=146097/4800,_e={years:{quarters:4,months:12,weeks:Ve/7,days:Ve,hours:Ve*24,minutes:Ve*24*60,seconds:Ve*24*60*60,milliseconds:Ve*24*60*60*1e3},quarters:{months:3,weeks:Ve/28,days:Ve/4,hours:Ve*24/4,minutes:Ve*24*60/4,seconds:Ve*24*60*60/4,milliseconds:Ve*24*60*60*1e3/4},months:{weeks:$e/7,days:$e,hours:$e*24,minutes:$e*24*60,seconds:$e*24*60*60,milliseconds:$e*24*60*60*1e3},...Le};const Ue=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"];const Re=Ue.slice(0).reverse();function clone$1(e,t,n=false){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Duration(r)}function antiTrunc(e){return e<0?Math.floor(e):Math.ceil(e)}function convert(e,t,n,r,i){const s=e[i][n],o=t[n]/s,a=Math.sign(o)===Math.sign(r[i]),u=!a&&r[i]!==0&&Math.abs(o)<=1?antiTrunc(o):Math.trunc(o);r[i]+=u;t[n]-=u*s}function normalizeValues(e,t){Re.reduce(((n,r)=>{if(!isUndefined(t[r])){if(n){convert(e,t,n,t,r)}return r}else{return n}}),null)}function removeZeroes(e){const t={};for(const[n,r]of Object.entries(e)){if(r!==0){t[n]=r}}return t}class Duration{constructor(e){const t=e.conversionAccuracy==="longterm"||false;let n=t?_e:Ae;if(e.matrix){n=e.matrix}this.values=e.values;this.loc=e.loc||Locale.create();this.conversionAccuracy=t?"longterm":"casual";this.invalid=e.invalid||null;this.matrix=n;this.isLuxonDuration=true}static fromMillis(e,t){return Duration.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!=="object"){throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`)}return new Duration({values:normalizeObject(e,Duration.normalizeUnit),loc:Locale.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(isNumber(e)){return Duration.fromMillis(e)}else if(Duration.isDuration(e)){return e}else if(typeof e==="object"){return Duration.fromObject(e)}else{throw new InvalidArgumentError(`Unknown duration argument ${e} of type ${typeof e}`)}}static fromISO(e,t){const[n]=parseISODuration(e);if(n){return Duration.fromObject(n,t)}else{return Duration.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}}static fromISOTime(e,t){const[n]=parseISOTimeOnly(e);if(n){return Duration.fromObject(n,t)}else{return Duration.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}}static invalid(e,t=null){if(!e){throw new InvalidArgumentError("need to specify a reason the Duration is invalid")}const n=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid){throw new InvalidDurationError(n)}else{return new Duration({invalid:n})}}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new InvalidUnitError(e);return t}static isDuration(e){return e&&e.isLuxonDuration||false}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:t.round!==false&&t.floor!==false};return this.isValid?Formatter.create(this.loc,n).formatDurationFromString(this,e):Ce}toHuman(e={}){const t=Ue.map((t=>{const n=this.values[t];if(isUndefined(n)){return null}return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(n)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let e="P";if(this.years!==0)e+=this.years+"Y";if(this.months!==0||this.quarters!==0)e+=this.months+this.quarters*3+"M";if(this.weeks!==0)e+=this.weeks+"W";if(this.days!==0)e+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)e+="T";if(this.hours!==0)e+=this.hours+"H";if(this.minutes!==0)e+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)e+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S";if(e==="P")e+="T0S";return e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:false,suppressSeconds:false,includePrefix:false,format:"extended",...e};const n=this.shiftTo("hours","minutes","seconds","milliseconds");let r=e.format==="basic"?"hhmm":"hh:mm";if(!e.suppressSeconds||n.seconds!==0||n.milliseconds!==0){r+=e.format==="basic"?"ss":":ss";if(!e.suppressMilliseconds||n.milliseconds!==0){r+=".SSS"}}let i=n.toFormat(r);if(e.includePrefix){i="T"+i}return i}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Duration.fromDurationLike(e),n={};for(const e of Ue){if(hasOwnProperty(t.values,e)||hasOwnProperty(this.values,e)){n[e]=t.get(e)+this.get(e)}}return clone$1(this,{values:n},true)}minus(e){if(!this.isValid)return this;const t=Duration.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values)){t[n]=asNumber(e(this.values[n],n))}return clone$1(this,{values:t},true)}get(e){return this[Duration.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...normalizeObject(e,Duration.normalizeUnit)};return clone$1(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){const i=this.loc.clone({locale:e,numberingSystem:t});const s={loc:i,matrix:r,conversionAccuracy:n};return clone$1(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();normalizeValues(this.matrix,e);return clone$1(this,{values:e},true)}rescale(){if(!this.isValid)return this;const e=removeZeroes(this.normalize().shiftToAll().toObject());return clone$1(this,{values:e},true)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0){return this}e=e.map((e=>Duration.normalizeUnit(e)));const t={},n={},r=this.toObject();let i;for(const s of Ue){if(e.indexOf(s)>=0){i=s;let e=0;for(const t in n){e+=this.matrix[t][s]*n[t];n[t]=0}if(isNumber(r[s])){e+=r[s]}const o=Math.trunc(e);t[s]=o;n[s]=(e*1e3-o*1e3)/1e3;for(const e in r){if(Ue.indexOf(e)>Ue.indexOf(s)){convert(this.matrix,r,e,t,s)}}}else if(isNumber(r[s])){n[s]=r[s]}}for(const e in n){if(n[e]!==0){t[i]+=e===i?n[e]:n[e]/this.matrix[i][e]}}return clone$1(this,{values:t},true).normalize()}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}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 clone$1(this,{values:e},true)}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){return false}if(!this.loc.equals(e.loc)){return false}function eq(e,t){if(e===undefined||e===0)return t===undefined||t===0;return e===t}for(const t of Ue)