pocketbase/ui/dist/assets/autocomplete.worker-CqGtSdE...

5 lines
89 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){"use strict";class P extends Error{}class $n extends P{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Zn extends P{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Un extends P{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class j extends P{}class at extends P{constructor(e){super(`Invalid unit ${e}`)}}class D extends P{}class Z extends P{constructor(){super("Zone is an abstract class")}}const f="numeric",C="short",M="long",ge={year:f,month:f,day:f},ot={year:f,month:C,day:f},qn={year:f,month:C,day:f,weekday:C},ut={year:f,month:M,day:f},lt={year:f,month:M,day:f,weekday:M},ct={hour:f,minute:f},ft={hour:f,minute:f,second:f},dt={hour:f,minute:f,second:f,timeZoneName:C},ht={hour:f,minute:f,second:f,timeZoneName:M},mt={hour:f,minute:f,hourCycle:"h23"},yt={hour:f,minute:f,second:f,hourCycle:"h23"},gt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:C},pt={hour:f,minute:f,second:f,hourCycle:"h23",timeZoneName:M},wt={year:f,month:f,day:f,hour:f,minute:f},St={year:f,month:f,day:f,hour:f,minute:f,second:f},kt={year:f,month:C,day:f,hour:f,minute:f},Tt={year:f,month:C,day:f,hour:f,minute:f,second:f},zn={year:f,month:C,day:f,weekday:C,hour:f,minute:f},Ot={year:f,month:M,day:f,hour:f,minute:f,timeZoneName:C},Nt={year:f,month:M,day:f,hour:f,minute:f,second:f,timeZoneName:C},Et={year:f,month:M,day:f,weekday:M,hour:f,minute:f,timeZoneName:M},xt={year:f,month:M,day:f,weekday:M,hour:f,minute:f,second:f,timeZoneName:M};class ie{get type(){throw new Z}get name(){throw new Z}get ianaName(){return this.name}get isUniversal(){throw new Z}offsetName(e,t){throw new Z}formatOffset(e,t){throw new Z}offset(e){throw new Z}equals(e){throw new Z}get isValid(){throw new Z}}let Ce=null;class pe extends ie{static get instance(){return Ce===null&&(Ce=new pe),Ce}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Kt(e,t,n)}formatOffset(e,t){return le(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let we={};function Pn(s){return we[s]||(we[s]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),we[s]}const Yn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jn(s,e){const t=s.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,r,i,a,o,u,l,c]=n;return[a,r,i,o,u,l,c]}function Bn(s,e){const t=s.formatToParts(e),n=[];for(let r=0;r<t.length;r++){const{type:i,value:a}=t[r],o=Yn[i];i==="era"?n[o]=a:y(o)||(n[o]=parseInt(a,10))}return n}let Se={};class $ extends ie{static create(e){return Se[e]||(Se[e]=new $(e)),Se[e]}static resetCache(){Se={},we={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=$.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Kt(e,t,n,this.name)}formatOffset(e,t){return le(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=Pn(this.name);let[r,i,a,o,u,l,c]=n.formatToParts?Bn(n,t):Jn(n,t);o==="BC"&&(r=-Math.abs(r)+1);const p=Ee({year:r,month:i,day:a,hour:u===24?0:u,minute:l,second:c,millisecond:0});let m=+t;const N=m%1e3;return m-=N>=0?N:1e3+N,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let bt={};function Gn(s,e={}){const t=JSON.stringify([s,e]);let n=bt[t];return n||(n=new Intl.ListFormat(s,e),bt[t]=n),n}let We={};function Le(s,e={}){const t=JSON.stringify([s,e]);let n=We[t];return n||(n=new Intl.DateTimeFormat(s,e),We[t]=n),n}let Re={};function jn(s,e={}){const t=JSON.stringify([s,e]);let n=Re[t];return n||(n=new Intl.NumberFormat(s,e),Re[t]=n),n}let $e={};function Kn(s,e={}){const{base:t,...n}=e,r=JSON.stringify([s,n]);let i=$e[r];return i||(i=new Intl.RelativeTimeFormat(s,e),$e[r]=i),i}let ae=null;function Hn(){return ae||(ae=new Intl.DateTimeFormat().resolvedOptions().locale,ae)}let It={};function _n(s){let e=It[s];if(!e){const t=new Intl.Locale(s);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,It[s]=e}return e}function Qn(s){const e=s.indexOf("-x-");e!==-1&&(s=s.substring(0,e));const t=s.indexOf("-u-");if(t===-1)return[s];{let n,r;try{n=Le(s).resolvedOptions(),r=s}catch{const u=s.substring(0,t);n=Le(u).resolvedOptions(),r=u}const{numberingSystem:i,calendar:a}=n;return[r,i,a]}}function Xn(s,e,t){return(t||e)&&(s.includes("-u-")||(s+="-u"),t&&(s+=`-ca-${t}`),e&&(s+=`-nu-${e}`)),s}function es(s){const e=[];for(let t=1;t<=12;t++){const n=g.utc(2009,t,1);e.push(s(n))}return e}function ts(s){const e=[];for(let t=1;t<=7;t++){const n=g.utc(2016,11,13+t);e.push(s(n))}return e}function ke(s,e,t,n){const r=s.listingMode();return r==="error"?null:r==="en"?t(e):n(e)}function ns(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}class ss{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...n};n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=jn(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Je(e,3);return b(t,this.padTo)}}}class rs{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&$.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(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=Le(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:n}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class is{constructor(e,t,n){this.opts={style:"long",...n},!t&&Jt()&&(this.rtf=Kn(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):xs(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const as={firstDay:1,minimalDays:4,weekend:[6,7]};class T{static fromOpts(e){return T.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const a=e||x.defaultLocale,o=a||(i?"en-US":Hn()),u=t||x.defaultNumberingSystem,l=n||x.defaultOutputCalendar,c=Pe(r)||x.defaultWeekSettings;return new T(o,u,l,c,a)}static resetCache(){ae=null,We={},Re={},$e={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return T.create(e,t,n,r)}constructor(e,t,n,r,i){const[a,o,u]=Qn(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||u||null,this.weekSettings=r,this.intl=Xn(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ns(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:T.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Pe(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return ke(this,e,Qt,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=es(i=>this.extract(i,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1){return ke(this,e,tn,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ts(i=>this.extract(i,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return ke(this,void 0,()=>nn,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[g.utc(2016,11,13,9),g.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return ke(this,e,sn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[g.utc(-40,1,1),g.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t),i=r.formatToParts(),a=i.find(o=>o.type.toLowerCase()===n);return a?a.value:null}numberFormatter(e={}){return new ss(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new rs(e,this.intl,t)}relFormatter(e={}){return new is(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Gn(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Bt()?_n(this.locale):as}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}}let Ze=null;class v extends ie{static get utcInstance(){return Ze===null&&(Ze=new v(0)),Ze}static instance(e){return e===0?v.utcInstance:new v(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new v(xe(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${le(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${le(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return le(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class os extends ie{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 U(s,e){if(y(s)||s===null)return e;if(s instanceof ie)return s;if(cs(s)){const t=s.toLowerCase();return t==="default"?e:t==="local"||t==="system"?pe.instance:t==="utc"||t==="gmt"?v.utcInstance:v.parseSpecifier(t)||$.create(s)}else return Y(s)?v.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new os(s)}let vt=()=>Date.now(),Dt="system",Mt=null,Ft=null,Vt=null,At=60,Ct,Wt=null;class x{static get now(){return vt}static set now(e){vt=e}static set defaultZone(e){Dt=e}static get defaultZone(){return U(Dt,pe.instance)}static get defaultLocale(){return Mt}static set defaultLocale(e){Mt=e}static get defaultNumberingSystem(){return Ft}static set defaultNumberingSystem(e){Ft=e}static get defaultOutputCalendar(){return Vt}static set defaultOutputCalendar(e){Vt=e}static get defaultWeekSettings(){return Wt}static set defaultWeekSettings(e){Wt=Pe(e)}static get twoDigitCutoffYear(){return At}static set twoDigitCutoffYear(e){At=e%100}static get throwOnInvalid(){return Ct}static set throwOnInvalid(e){Ct=e}static resetCaches(){T.resetCache(),$.resetCache()}}class W{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Lt=[0,31,59,90,120,151,181,212,243,273,304,334],Rt=[0,31,60,91,121,152,182,213,244,274,305,335];function F(s,e){return new W("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${s}, which is invalid`)}function Ue(s,e,t){const n=new Date(Date.UTC(s,e-1,t));s<100&&s>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const r=n.getUTCDay();return r===0?7:r}function $t(s,e,t){return t+(oe(s)?Rt:Lt)[e-1]}function Zt(s,e){const t=oe(s)?Rt:Lt,n=t.findIndex(i=>i<e),r=e-t[n];return{month:n+1,day:r}}function qe(s,e){return(s-e+7)%7+1}function Te(s,e=4,t=1){const{year:n,month:r,day:i}=s,a=$t(n,r,i),o=qe(Ue(n,r,i),t);let u=Math.floor((a-o+14-e)/7),l;return u<1?(l=n-1,u=ue(l,e,t)):u>ue(n,e,t)?(l=n+1,u=1):l=n,{weekYear:l,weekNumber:u,weekday:o,...Ie(s)}}function Ut(s,e=4,t=1){const{weekYear:n,weekNumber:r,weekday:i}=s,a=qe(Ue(n,1,e),t),o=H(n);let u=r*7+i-a-7+e,l;u<1?(l=n-1,u+=H(l)):u>o?(l=n+1,u-=H(n)):l=n;const{month:c,day:h}=Zt(l,u);return{year:l,month:c,day:h,...Ie(s)}}function ze(s){const{year:e,month:t,day:n}=s,r=$t(e,t,n);return{year:e,ordinal:r,...Ie(s)}}function qt(s){const{year:e,ordinal:t}=s,{month:n,day:r}=Zt(e,t);return{year:e,month:n,day:r,...Ie(s)}}function zt(s,e){if(!y(s.localWeekday)||!y(s.localWeekNumber)||!y(s.localWeekYear)){if(!y(s.weekday)||!y(s.weekNumber)||!y(s.weekYear))throw new j("Cannot mix locale-based week fields with ISO-based week fields");return y(s.localWeekday)||(s.weekday=s.localWeekday),y(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),y(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function us(s,e=4,t=1){const n=Oe(s.weekYear),r=V(s.weekNumber,1,ue(s.weekYear,e,t)),i=V(s.weekday,1,7);return n?r?i?!1:F("weekday",s.weekday):F("week",s.weekNumber):F("weekYear",s.weekYear)}function ls(s){const e=Oe(s.year),t=V(s.ordinal,1,H(s.year));return e?t?!1:F("ordinal",s.ordinal):F("year",s.year)}function Pt(s){const e=Oe(s.year),t=V(s.month,1,12),n=V(s.day,1,Ne(s.year,s.month));return e?t?n?!1:F("day",s.day):F("month",s.month):F("year",s.year)}function Yt(s){const{hour:e,minute:t,second:n,millisecond:r}=s,i=V(e,0,23)||e===24&&t===0&&n===0&&r===0,a=V(t,0,59),o=V(n,0,59),u=V(r,0,999);return i?a?o?u?!1:F("millisecond",r):F("second",n):F("minute",t):F("hour",e)}function y(s){return typeof s>"u"}function Y(s){return typeof s=="number"}function Oe(s){return typeof s=="number"&&s%1===0}function cs(s){return typeof s=="string"}function fs(s){return Object.prototype.toString.call(s)==="[object Date]"}function Jt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Bt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function ds(s){return Array.isArray(s)?s:[s]}function Gt(s,e,t){if(s.length!==0)return s.reduce((n,r)=>{const i=[e(r),r];return n&&t(n[0],i[0])===n[0]?n:i},null)[1]}function hs(s,e){return e.reduce((t,n)=>(t[n]=s[n],t),{})}function K(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function Pe(s){if(s==null)return null;if(typeof s!="object")throw new D("Week settings must be an object");if(!V(s.firstDay,1,7)||!V(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(e=>!V(e,1,7)))throw new D("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function V(s,e,t){return Oe(s)&&s>=e&&s<=t}function ms(s,e){return s-e*Math.floor(s/e)}function b(s,e=2){const t=s<0;let n;return t?n="-"+(""+-s).padStart(e,"0"):n=(""+s).padStart(e,"0"),n}function q(s){if(!(y(s)||s===null||s===""))return parseInt(s,10)}function J(s){if(!(y(s)||s===null||s===""))return parseFloat(s)}function Ye(s){if(!(y(s)||s===null||s==="")){const e=parseFloat("0."+s)*1e3;return Math.floor(e)}}function Je(s,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(s*n)/n}function oe(s){return s%4===0&&(s%100!==0||s%400===0)}function H(s){return oe(s)?366:365}function Ne(s,e){const t=ms(e-1,12)+1,n=s+(e-t)/12;return t===2?oe(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ee(s){let e=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(e=new Date(e),e.setUTCFullYear(s.year,s.month-1,s.day)),+e}function jt(s,e,t){return-qe(Ue(s,1,e),t)+e-1}function ue(s,e=4,t=1){const n=jt(s,e,t),r=jt(s+1,e,t);return(H(s)-n+r)/7}function Be(s){return s>99?s:s>x.twoDigitCutoffYear?1900+s:2e3+s}function Kt(s,e,t,n=null){const r=new Date(s),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(i.timeZone=n);const a={timeZoneName:e,...i},o=new Intl.DateTimeFormat(t,a).formatToParts(r).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function xe(s,e){let t=parseInt(s,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,r=t<0||Object.is(t,-0)?-n:n;return t*60+r}function Ht(s){const e=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(e))throw new D(`Invalid unit value ${s}`);return e}function be(s,e){const t={};for(const n in s)if(K(s,n)){const r=s[n];if(r==null)continue;t[e(n)]=Ht(r)}return t}function le(s,e){const t=Math.trunc(Math.abs(s/60)),n=Math.trunc(Math.abs(s%60)),r=s>=0?"+":"-";switch(e){case"short":return`${r}${b(t,2)}:${b(n,2)}`;case"narrow":return`${r}${t}${n>0?`:${n}`:""}`;case"techie":return`${r}${b(t,2)}${b(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ie(s){return hs(s,["hour","minute","second","millisecond"])}const ys=["January","February","March","April","May","June","July","August","September","October","November","December"],_t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gs=["J","F","M","A","M","J","J","A","S","O","N","D"];function Qt(s){switch(s){case"narrow":return[...gs];case"short":return[..._t];case"long":return[...ys];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 Xt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],en=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ps=["M","T","W","T","F","S","S"];function tn(s){switch(s){case"narrow":return[...ps];case"short":return[...en];case"long":return[...Xt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const nn=["AM","PM"],ws=["Before Christ","Anno Domini"],Ss=["BC","AD"],ks=["B","A"];function sn(s){switch(s){case"narrow":return[...ks];case"short":return[...Ss];case"long":return[...ws];default:return null}}function Ts(s){return nn[s.hour<12?0:1]}function Os(s,e){return tn(e)[s.weekday-1]}function Ns(s,e){return Qt(e)[s.month-1]}function Es(s,e){return sn(e)[s.year<0?0:1]}function xs(s,e,t="always",n=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(s)===-1;if(t==="auto"&&i){const h=s==="days";switch(e){case 1:return h?"tomorrow":`next ${r[s][0]}`;case-1:return h?"yesterday":`last ${r[s][0]}`;case 0:return h?"today":`this ${r[s][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=r[s],c=n?u?l[1]:l[2]||l[1]:u?r[s][0]:s;return a?`${o} ${c} ago`:`in ${o} ${c}`}function rn(s,e){let t="";for(const n of s)n.literal?t+=n.val:t+=e(n.val);return t}const bs={D:ge,DD:ot,DDD:ut,DDDD:lt,t:ct,tt:ft,ttt:dt,tttt:ht,T:mt,TT:yt,TTT:gt,TTTT:pt,f:wt,ff:kt,fff:Ot,ffff:Et,F:St,FF:Tt,FFF:Nt,FFFF:xt};class I{static create(e,t={}){return new I(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let a=0;a<e.length;a++){const o=e.charAt(a);o==="'"?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return bs[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return b(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,N)=>this.loc.extract(e,m,N),a=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>n?Ts(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,N)=>n?Ns(e,m):i(N?{month:m}:{month:m,day:"numeric"},"month"),l=(m,N)=>n?Os(e,m):i(N?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{const N=I.macroTokenToFormatOpts(m);return N?this.formatWithSystemDefault(e,N):m},h=m=>n?Es(e,m):i({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return rn(I.parseFormat(t),p)}formatDurationFromString(e,t){const n=u=>{switch(u[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}},r=u=>l=>{const c=n(l);return c?this.num(u.get(c),l.length):l},i=I.parseFormat(t),a=i.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),o=e.shiftTo(...a.map(n).filter(u=>u));return rn(i,r(o))}}const an=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function _(...s){const e=s.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function Q(...s){return e=>s.reduce(([t,n,r],i)=>{const[a,o,u]=i(e,r);return[{...t,...a},o||n,u]},[{},null,1]).slice(0,2)}function X(s,...e){if(s==null)return[null,null];for(const[t,n]of e){const r=t.exec(s);if(r)return n(r)}return[null,null]}function on(...s){return(e,t)=>{const n={};let r;for(r=0;r<s.length;r++)n[s[r]]=q(e[t+r]);return[n,null,t+r]}}const un=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Is=`(?:${un.source}?(?:\\[(${an.source})\\])?)?`,Ge=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ln=RegExp(`${Ge.source}${Is}`),je=RegExp(`(?:T${ln.source})?`),vs=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ds=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ms=/(\d{4})-?(\d{3})/,Fs=on("weekYear","weekNumber","weekDay"),Vs=on("year","ordinal"),As=/(\d{4})-(\d\d)-(\d\d)/,cn=RegExp(`${Ge.source} ?(?:${un.source}|(${an.source}))?`),Cs=RegExp(`(?: ${cn.source})?`);function ee(s,e,t){const n=s[e];return y(n)?t:q(n)}function Ws(s,e){return[{year:ee(s,e),month:ee(s,e+1,1),day:ee(s,e+2,1)},null,e+3]}function te(s,e){return[{hours:ee(s,e,0),minutes:ee(s,e+1,0),seconds:ee(s,e+2,0),milliseconds:Ye(s[e+3])},null,e+4]}function ce(s,e){const t=!s[e]&&!s[e+1],n=xe(s[e+1],s[e+2]),r=t?null:v.instance(n);return[{},r,e+3]}function fe(s,e){const t=s[e]?$.create(s[e]):null;return[{},t,e+1]}const Ls=RegExp(`^T?${Ge.source}$`),Rs=/^-?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 $s(s){const[e,t,n,r,i,a,o,u,l]=s,c=e[0]==="-",h=u&&u[0]==="-",p=(m,N=!1)=>m!==void 0&&(N||m&&c)?-m:m;return[{years:p(J(t)),months:p(J(n)),weeks:p(J(r)),days:p(J(i)),hours:p(J(a)),minutes:p(J(o)),seconds:p(J(u),u==="-0"),milliseconds:p(Ye(l),h)}]}const Zs={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 Ke(s,e,t,n,r,i,a){const o={year:e.length===2?Be(q(e)):q(e),month:_t.indexOf(t)+1,day:q(n),hour:q(r),minute:q(i)};return a&&(o.second=q(a)),s&&(o.weekday=s.length>3?Xt.indexOf(s)+1:en.indexOf(s)+1),o}const Us=/^(?:(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 qs(s){const[,e,t,n,r,i,a,o,u,l,c,h]=s,p=Ke(e,r,n,t,i,a,o);let m;return u?m=Zs[u]:l?m=0:m=xe(c,h),[p,new v(m)]}function zs(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ps=/^(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$/,Ys=/^(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$/,Js=/^(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 fn(s){const[,e,t,n,r,i,a,o]=s;return[Ke(e,r,n,t,i,a,o),v.utcInstance]}function Bs(s){const[,e,t,n,r,i,a,o]=s;return[Ke(e,o,t,n,r,i,a),v.utcInstance]}const Gs=_(vs,je),js=_(Ds,je),Ks=_(Ms,je),Hs=_(ln),dn=Q(Ws,te,ce,fe),_s=Q(Fs,te,ce,fe),Qs=Q(Vs,te,ce,fe),Xs=Q(te,ce,fe);function er(s){return X(s,[Gs,dn],[js,_s],[Ks,Qs],[Hs,Xs])}function tr(s){return X(zs(s),[Us,qs])}function nr(s){return X(s,[Ps,fn],[Ys,fn],[Js,Bs])}function sr(s){return X(s,[Rs,$s])}const rr=Q(te);function ir(s){return X(s,[Ls,rr])}const ar=_(As,Cs),or=_(cn),ur=Q(te,ce,fe);function lr(s){return X(s,[ar,dn],[or,ur])}const hn="Invalid Duration",mn={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}},cr={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},...mn},A=146097/400,ne=146097/4800,fr={years:{quarters:4,months:12,weeks:A/7,days:A,hours:A*24,minutes:A*24*60,seconds:A*24*60*60,milliseconds:A*24*60*60*1e3},quarters:{months:3,weeks:A/28,days:A/4,hours:A*24/4,minutes:A*24*60/4,seconds:A*24*60*60/4,milliseconds:A*24*60*60*1e3/4},months:{weeks:ne/7,days:ne,hours:ne*24,minutes:ne*24*60,seconds:ne*24*60*60,milliseconds:ne*24*60*60*1e3},...mn},B=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],dr=B.slice(0).reverse();function z(s,e,t=!1){const n={values:t?e.values:{...s.values,...e.values||{}},loc:s.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||s.conversionAccuracy,matrix:e.matrix||s.matrix};return new w(n)}function yn(s,e){let t=e.milliseconds??0;for(const n of dr.slice(1))e[n]&&(t+=e[n]*s[n].milliseconds);return t}function gn(s,e){const t=yn(s,e)<0?-1:1;B.reduceRight((n,r)=>{if(y(e[r]))return n;if(n){const i=e[n]*t,a=s[r][n],o=Math.floor(i/a);e[r]+=o*t,e[n]-=o*a*t}return r},null),B.reduce((n,r)=>{if(y(e[r]))return n;if(n){const i=e[n]%1;e[n]-=i,e[r]+=i*s[n][r]}return r},null)}function hr(s){const e={};for(const[t,n]of Object.entries(s))n!==0&&(e[t]=n);return e}class w{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?fr:cr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||T.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return w.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new D(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new w({values:be(e,w.normalizeUnit),loc:T.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Y(e))return w.fromMillis(e);if(w.isDuration(e))return e;if(typeof e=="object")return w.fromObject(e);throw new D(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=sr(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=ir(e);return n?w.fromObject(n,t):w.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new D("need to specify a reason the Duration is invalid");const n=e instanceof W?e:new W(e,t);if(x.throwOnInvalid)throw new Un(n);return new w({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()];if(!t)throw new at(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?I.create(this.loc,n).formatDurationFromString(this,e):hn}toHuman(e={}){if(!this.isValid)return hn;const t=B.map(n=>{const r=this.values[n];return y(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Je(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},g.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?yn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e),n={};for(const r of B)(K(t.values,r)||K(this.values,r))&&(n[r]=t.get(r)+this.get(r));return z(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=w.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]=Ht(e(this.values[n],n));return z(this,{values:t},!0)}get(e){return this[w.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...be(e,w.normalizeUnit)};return z(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return z(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return gn(this.matrix,e),z(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=hr(this.normalize().shiftToAll().toObject());return z(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>w.normalizeUnit(a));const t={},n={},r=this.toObject();let i;for(const a of B)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in n)o+=this.matrix[l][a]*n[l],n[l]=0;Y(r[a])&&(o+=r[a]);const u=Math.trunc(o);t[a]=u,n[a]=(o*1e3-u*1e3)/1e3}else Y(r[a])&&(n[a]=r[a]);for(const a in n)n[a]!==0&&(t[i]+=a===i?n[a]:n[a]/this.matrix[i][a]);return gn(this.matrix,t),z(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return z(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(n,r){return n===void 0||n===0?r===void 0||r===0:n===r}for(const n of B)if(!t(this.values[n],e.values[n]))return!1;return!0}}const se="Invalid Interval";function mr(s,e){return!s||!s.isValid?E.invalid("missing or invalid start"):!e||!e.isValid?E.invalid("missing or invalid end"):e<s?E.invalid("end before start",`The end of an interval must be after its start, but you had start=${s.toISO()} and end=${e.toISO()}`):null}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 D("need to specify a reason the Interval is invalid");const n=e instanceof W?e:new W(e,t);if(x.throwOnInvalid)throw new Zn(n);return new E({invalid:n})}static fromDateTimes(e,t){const n=he(e),r=he(t),i=mr(n,r);return i??new E({start:n,end:r})}static after(e,t){const n=w.fromDurationLike(t),r=he(e);return E.fromDateTimes(r,r.plus(n))}static before(e,t){const n=w.fromDurationLike(t),r=he(e);return E.fromDateTimes(r.minus(n),r)}static fromISO(e,t){const[n,r]=(e||"").split("/",2);if(n&&r){let i,a;try{i=g.fromISO(n,t),a=i.isValid}catch{a=!1}let o,u;try{o=g.fromISO(r,t),u=o.isValid}catch{u=!1}if(a&&u)return E.fromDateTimes(i,o);if(a){const l=w.fromISO(r,t);if(l.isValid)return E.after(i,l)}else if(u){const l=w.fromISO(n,t);if(l.isValid)return E.before(o,l)}}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 this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let r;return t!=null&&t.useLocaleWeeks?r=this.end.reconfigure({locale:n.locale}):r=this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?E.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(he).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),n=[];let{s:r}=this,i=0;for(;r<this.e;){const a=t[i]||this.e,o=+a>+this.e?this.e:a;n.push(E.fromDateTimes(r,o)),r=o,i+=1}return n}splitBy(e){const t=w.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,r=1,i;const a=[];for(;n<this.e;){const o=this.start.plus(t.mapUnits(u=>u*r));i=+o>+this.e?this.e:o,a.push(E.fromDateTimes(n,i)),n=i,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>=n?null:E.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,n=this.e>e.e?this.e:e.e;return E.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((r,i)=>r.s-i.s).reduce(([r,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[r,i.union(a)]:[r.concat([i]),a]:[r,a],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)n+=u.type==="s"?1:-1,n===1?t=u.time:(t&&+t!=+u.time&&r.push(E.fromDateTimes(t,u.time)),t=null);return E.merge(r)}difference(...e){return E.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:se}[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=ge,t={}){return this.isValid?I.create(this.s.loc.clone(t),e).formatInterval(this):se}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:se}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:se}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:se}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:se}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):w.invalid(this.invalidReason)}mapEndpoints(e){return E.fromDateTimes(e(this.s),e(this.e))}}class ve{static hasDST(e=x.defaultZone){const t=g.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $.isValidZone(e)}static normalizeZone(e){return U(e,x.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||T.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||T.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||T.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||T.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return T.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return T.create(t,null,"gregory").eras(e)}static features(){return{relative:Jt(),localeWeek:Bt()}}}function pn(s,e){const t=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(s);return Math.floor(w.fromMillis(n).as("days"))}function yr(s,e,t){const n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const c=pn(u,l);return(c-c%7)/7}],["days",pn]],r={},i=s;let a,o;for(const[u,l]of n)t.indexOf(u)>=0&&(a=u,r[u]=l(s,e),o=i.plus(r),o>e?(r[u]--,s=i.plus(r),s>e&&(o=s,r[u]--,s=i.plus(r))):s=o);return[s,r,o,a]}function gr(s,e,t,n){let[r,i,a,o]=yr(s,e,t);const u=e-r,l=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);l.length===0&&(a<e&&(a=r.plus({[o]:1})),a!==r&&(i[o]=(i[o]||0)+u/(a-r)));const c=w.fromObject(i,n);return l.length>0?w.fromMillis(u,n).shiftTo(...l).plus(c):c}const He={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},wn={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]},pr=He.hanidec.replace(/[\[|\]]/g,"").split("");function wr(s){let e=parseInt(s,10);if(isNaN(e)){e="";for(let t=0;t<s.length;t++){const n=s.charCodeAt(t);if(s[t].search(He.hanidec)!==-1)e+=pr.indexOf(s[t]);else for(const r in wn){const[i,a]=wn[r];n>=i&&n<=a&&(e+=n-i)}}return parseInt(e,10)}else return e}function L({numberingSystem:s},e=""){return new RegExp(`${He[s||"latn"]}${e}`)}const Sr="missing Intl.DateTimeFormat.formatToParts support";function S(s,e=t=>t){return{regex:s,deser:([t])=>e(wr(t))}}const Sn="[  ]",kn=new RegExp(Sn,"g");function kr(s){return s.replace(/\./g,"\\.?").replace(kn,Sn)}function Tn(s){return s.replace(/\./g,"").replace(kn," ").toLowerCase()}function R(s,e){return s===null?null:{regex:RegExp(s.map(kr).join("|")),deser:([t])=>s.findIndex(n=>Tn(t)===Tn(n))+e}}function On(s,e){return{regex:s,deser:([,t,n])=>xe(t,n),groups:e}}function De(s){return{regex:s,deser:([e])=>e}}function Tr(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Or(s,e){const t=L(e),n=L(e,"{2}"),r=L(e,"{3}"),i=L(e,"{4}"),a=L(e,"{6}"),o=L(e,"{1,2}"),u=L(e,"{1,3}"),l=L(e,"{1,6}"),c=L(e,"{1,9}"),h=L(e,"{2,4}"),p=L(e,"{4,6}"),m=k=>({regex:RegExp(Tr(k.val)),deser:([re])=>re,literal:!0}),O=(k=>{if(s.literal)return m(k);switch(k.val){case"G":return R(e.eras("short"),0);case"GG":return R(e.eras("long"),0);case"y":return S(l);case"yy":return S(h,Be);case"yyyy":return S(i);case"yyyyy":return S(p);case"yyyyyy":return S(a);case"M":return S(o);case"MM":return S(n);case"MMM":return R(e.months("short",!0),1);case"MMMM":return R(e.months("long",!0),1);case"L":return S(o);case"LL":return S(n);case"LLL":return R(e.months("short",!1),1);case"LLLL":return R(e.months("long",!1),1);case"d":return S(o);case"dd":return S(n);case"o":return S(u);case"ooo":return S(r);case"HH":return S(n);case"H":return S(o);case"hh":return S(n);case"h":return S(o);case"mm":return S(n);case"m":return S(o);case"q":return S(o);case"qq":return S(n);case"s":return S(o);case"ss":return S(n);case"S":return S(u);case"SSS":return S(r);case"u":return De(c);case"uu":return De(o);case"uuu":return S(t);case"a":return R(e.meridiems(),0);case"kkkk":return S(i);case"kk":return S(h,Be);case"W":return S(o);case"WW":return S(n);case"E":case"c":return S(t);case"EEE":return R(e.weekdays("short",!1),1);case"EEEE":return R(e.weekdays("long",!1),1);case"ccc":return R(e.weekdays("short",!0),1);case"cccc":return R(e.weekdays("long",!0),1);case"Z":case"ZZ":return On(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return On(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return De(/[a-z_+-/]{1,256}?/i);case" ":return De(/[^\S\n\r]/);default:return m(k)}})(s)||{invalidReason:Sr};return O.token=s,O}const Nr={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 Er(s,e,t){const{type:n,value:r}=s;if(n==="literal"){const u=/^\s+$/.test(r);return{literal:!u,val:u?" ":r}}const i=e[n];let a=n;n==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=t.hour12?"hour12":"hour24");let o=Nr[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function xr(s){return[`^${s.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,s]}function br(s,e,t){const n=s.match(e);if(n){const r={};let i=1;for(const a in t)if(K(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(r[o.token.val[0]]=o.deser(n.slice(i,i+u))),i+=u}return[n,r]}else return[n,{}]}function Ir(s){const e=i=>{switch(i){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}};let t=null,n;return y(s.z)||(t=$.create(s.z)),y(s.Z)||(t||(t=new v(s.Z)),n=s.Z),y(s.q)||(s.M=(s.q-1)*3+1),y(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),y(s.u)||(s.S=Ye(s.u)),[Object.keys(s).reduce((i,a)=>{const o=e(a);return o&&(i[o]=s[a]),i},{}),t,n]}let _e=null;function vr(){return _e||(_e=g.fromMillis(1555555555555)),_e}function Dr(s,e){if(s.literal)return s;const t=I.macroTokenToFormatOpts(s.val),n=xn(t,e);return n==null||n.includes(void 0)?s:n}function Nn(s,e){return Array.prototype.concat(...s.map(t=>Dr(t,e)))}function En(s,e,t){const n=Nn(I.parseFormat(t),s),r=n.map(a=>Or(a,s)),i=r.find(a=>a.invalidReason);if(i)return{input:e,tokens:n,invalidReason:i.invalidReason};{const[a,o]=xr(r),u=RegExp(a,"i"),[l,c]=br(e,u,o),[h,p,m]=c?Ir(c):[null,null,void 0];if(K(c,"a")&&K(c,"H"))throw new j("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:u,rawMatches:l,matches:c,result:h,zone:p,specificOffset:m}}}function Mr(s,e,t){const{result:n,zone:r,specificOffset:i,invalidReason:a}=En(s,e,t);return[n,r,i,a]}function xn(s,e){if(!s)return null;const n=I.create(e,s).dtFormatter(vr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(a=>Er(a,s,i))}const Qe="Invalid DateTime",bn=864e13;function Me(s){return new W("unsupported zone",`the zone "${s.name}" is not supported`)}function Xe(s){return s.weekData===null&&(s.weekData=Te(s.c)),s.weekData}function et(s){return s.localWeekData===null&&(s.localWeekData=Te(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function G(s,e){const t={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new g({...t,...e,old:t})}function In(s,e,t){let n=s-e*60*1e3;const r=t.offset(n);if(e===r)return[n,e];n-=(r-e)*60*1e3;const i=t.offset(n);return r===i?[n,r]:[s-Math.min(r,i)*60*1e3,Math.max(r,i)]}function Fe(s,e){s+=e*60*1e3;const t=new Date(s);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Ve(s,e,t){return In(Ee(s),e,t)}function vn(s,e){const t=s.o,n=s.c.year+Math.trunc(e.years),r=s.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...s.c,year:n,month:r,day:Math.min(s.c.day,Ne(n,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=w.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=Ee(i);let[u,l]=In(o,t,s.zone);return a!==0&&(u+=a,l=s.zone.offset(u)),{ts:u,o:l}}function de(s,e,t,n,r,i){const{setZone:a,zone:o}=t;if(s&&Object.keys(s).length!==0||e){const u=e||o,l=g.fromObject(s,{...t,zone:u,specificOffset:i});return a?l:l.setZone(o)}else return g.invalid(new W("unparsable",`the input "${r}" can't be parsed as ${n}`))}function Ae(s,e,t=!0){return s.isValid?I.create(T.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(s,e):null}function tt(s,e){const t=s.c.year>9999||s.c.year<0;let n="";return t&&s.c.year>=0&&(n+="+"),n+=b(s.c.year,t?6:4),e?(n+="-",n+=b(s.c.month),n+="-",n+=b(s.c.day)):(n+=b(s.c.month),n+=b(s.c.day)),n}function Dn(s,e,t,n,r,i){let a=b(s.c.hour);return e?(a+=":",a+=b(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=":")):a+=b(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!t)&&(a+=b(s.c.second),(s.c.millisecond!==0||!n)&&(a+=".",a+=b(s.c.millisecond,3))),r&&(s.isOffsetFixed&&s.offset===0&&!i?a+="Z":s.o<0?(a+="-",a+=b(Math.trunc(-s.o/60)),a+=":",a+=b(Math.trunc(-s.o%60))):(a+="+",a+=b(Math.trunc(s.o/60)),a+=":",a+=b(Math.trunc(s.o%60)))),i&&(a+="["+s.zone.ianaName+"]"),a}const Mn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Fr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Vr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Fn=["year","month","day","hour","minute","second","millisecond"],Ar=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cr=["year","ordinal","hour","minute","second","millisecond"];function Wr(s){const e={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"}[s.toLowerCase()];if(!e)throw new at(s);return e}function Vn(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Wr(s)}}function An(s,e){const t=U(e.zone,x.defaultZone),n=T.fromObject(e),r=x.now();let i,a;if(y(s.year))i=r;else{for(const l of Fn)y(s[l])&&(s[l]=Mn[l]);const o=Pt(s)||Yt(s);if(o)return g.invalid(o);const u=t.offset(r);[i,a]=Ve(s,u,t)}return new g({ts:i,zone:t,loc:n,o:a})}function Cn(s,e,t){const n=y(t.round)?!0:t.round,r=(a,o)=>(a=Je(a,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(s,a)?0:e.startOf(a).diff(s.startOf(a),a).get(a):e.diff(s,a).get(a);if(t.unit)return r(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return r(o,a)}return r(s>e?-0:0,t.units[t.units.length-1])}function Wn(s){let e={},t;return s.length>0&&typeof s[s.length-1]=="object"?(e=s[s.length-1],t=Array.from(s).slice(0,s.length-1)):t=Array.from(s),[e,t]}class g{constructor(e){const t=e.zone||x.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new W("invalid input"):null)||(t.isValid?null:Me(t));this.ts=y(e.ts)?x.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const o=t.offset(this.ts);r=Fe(this.ts,o),n=Number.isNaN(r.year)?new W("invalid input"):null,r=n?null:r,i=n?null:o}this._zone=t,this.loc=e.loc||T.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new g({})}static local(){const[e,t]=Wn(arguments),[n,r,i,a,o,u,l]=t;return An({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=Wn(arguments),[n,r,i,a,o,u,l]=t;return e.zone=v.utcInstance,An({year:n,month:r,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const n=fs(e)?e.valueOf():NaN;if(Number.isNaN(n))return g.invalid("invalid input");const r=U(t.zone,x.defaultZone);return r.isValid?new g({ts:n,zone:r,loc:T.fromObject(t)}):g.invalid(Me(r))}static fromMillis(e,t={}){if(Y(e))return e<-bn||e>bn?g.invalid("Timestamp out of range"):new g({ts:e,zone:U(t.zone,x.defaultZone),loc:T.fromObject(t)});throw new D(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Y(e))return new g({ts:e*1e3,zone:U(t.zone,x.defaultZone),loc:T.fromObject(t)});throw new D("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=U(t.zone,x.defaultZone);if(!n.isValid)return g.invalid(Me(n));const r=T.fromObject(t),i=be(e,Vn),{minDaysInFirstWeek:a,startOfWeek:o}=zt(i,r),u=x.now(),l=y(t.specificOffset)?n.offset(u):t.specificOffset,c=!y(i.ordinal),h=!y(i.year),p=!y(i.month)||!y(i.day),m=h||p,N=i.weekYear||i.weekNumber;if((m||c)&&N)throw new j("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new j("Can't mix ordinal dates with month/day");const O=N||i.weekday&&!m;let k,re,me=Fe(u,l);O?(k=Ar,re=Fr,me=Te(me,a,o)):c?(k=Cr,re=Vr,me=ze(me)):(k=Fn,re=Mn);let Ln=!1;for(const ye of k){const Yr=i[ye];y(Yr)?Ln?i[ye]=re[ye]:i[ye]=me[ye]:Ln=!0}const Ur=O?us(i,a,o):c?ls(i):Pt(i),Rn=Ur||Yt(i);if(Rn)return g.invalid(Rn);const qr=O?Ut(i,a,o):c?qt(i):i,[zr,Pr]=Ve(qr,l,n),it=new g({ts:zr,zone:n,o:Pr,loc:r});return i.weekday&&m&&e.weekday!==it.weekday?g.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${it.toISO()}`):it}static fromISO(e,t={}){const[n,r]=er(e);return de(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=tr(e);return de(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=nr(e);return de(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(y(e)||y(t))throw new D("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[o,u,l,c]=Mr(a,e,t);return c?g.invalid(c):de(o,u,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return g.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=lr(e);return de(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new D("need to specify a reason the DateTime is invalid");const n=e instanceof W?e:new W(e,t);if(x.throwOnInvalid)throw new $n(n);return new g({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=xn(e,T.fromObject(t));return n?n.map(r=>r?r.val:null).join(""):null}static expandFormat(e,t={}){return Nn(I.parseFormat(e),T.fromObject(t)).map(r=>r.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}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?Xe(this).weekYear:NaN}get weekNumber(){return this.isValid?Xe(this).weekNumber:NaN}get weekday(){return this.isValid?Xe(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?et(this).weekday:NaN}get localWeekNumber(){return this.isValid?et(this).weekNumber:NaN}get localWeekYear(){return this.isValid?et(this).weekYear:NaN}get ordinal(){return this.isValid?ze(this.c).ordinal:NaN}get monthShort(){return this.isValid?ve.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ve.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ve.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ve.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?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=Ee(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];const u=n-a*t,l=n-o*t,c=Fe(u,a),h=Fe(l,o);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[G(this,{ts:u}),G(this,{ts:l})]:[this]}get isInLeapYear(){return oe(this.year)}get daysInMonth(){return Ne(this.year,this.month)}get daysInYear(){return this.isValid?H(this.year):NaN}get weeksInWeekYear(){return this.isValid?ue(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ue(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=I.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(v.instance(e),t)}toLocal(){return this.setZone(x.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=U(e,x.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const i=e.offset(this.ts),a=this.toObject();[r]=Ve(a,i,e)}return G(this,{ts:r,zone:e})}else return g.invalid(Me(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return G(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=be(e,Vn),{minDaysInFirstWeek:n,startOfWeek:r}=zt(t,this.loc),i=!y(t.weekYear)||!y(t.weekNumber)||!y(t.weekday),a=!y(t.ordinal),o=!y(t.year),u=!y(t.month)||!y(t.day),l=o||u,c=t.weekYear||t.weekNumber;if((l||a)&&c)throw new j("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new j("Can't mix ordinal dates with month/day");let h;i?h=Ut({...Te(this.c,n,r),...t},n,r):y(t.ordinal)?(h={...this.toObject(),...t},y(t.day)&&(h.day=Math.min(Ne(h.year,h.month),h.day))):h=qt({...ze(this.c),...t});const[p,m]=Ve(h,this.o,this.zone);return G(this,{ts:p,o:m})}plus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e);return G(this,vn(this,t))}minus(e){if(!this.isValid)return this;const t=w.fromDurationLike(e).negate();return G(this,vn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=w.normalizeUnit(e);switch(r){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;break}if(r==="weeks")if(t){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(n.weekNumber=this.weekNumber-1),n.weekday=i}else n.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return 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?I.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Qe}toLocaleString(e=ge,t={}){return this.isValid?I.create(this.loc.clone(t),e).formatDateTime(this):Qe}toLocaleParts(e={}){return this.isValid?I.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=e==="extended";let o=tt(this,a);return o+="T",o+=Dn(this,a,t,n,r,i),o}toISODate({format:e="extended"}={}){return this.isValid?tt(this,e==="extended"):null}toISOWeekDate(){return Ae(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(r?"T":"")+Dn(this,a==="extended",t,e,n,i):null}toRFC2822(){return Ae(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ae(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?tt(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),Ae(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Qe}[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={}){if(!this.isValid)return{};const t={...this.c};return 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",n={}){if(!this.isValid||!e.isValid)return w.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=ds(t).map(w.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,u=a?e:this,l=gr(o,u,i,r);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(g.now(),e,t)}until(e){return this.isValid?E.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||g.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),Cn(t,this.plus(n),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?Cn(e.base||g.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(g.isDateTime))throw new D("min requires all arguments be DateTimes");return Gt(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(g.isDateTime))throw new D("max requires all arguments be DateTimes");return Gt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n,a=T.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return En(a,e,t)}static fromStringExplain(e,t,n={}){return g.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return ge}static get DATE_MED(){return ot}static get DATE_MED_WITH_WEEKDAY(){return qn}static get DATE_FULL(){return ut}static get DATE_HUGE(){return lt}static get TIME_SIMPLE(){return ct}static get TIME_WITH_SECONDS(){return ft}static get TIME_WITH_SHORT_OFFSET(){return dt}static get TIME_WITH_LONG_OFFSET(){return ht}static get TIME_24_SIMPLE(){return mt}static get TIME_24_WITH_SECONDS(){return yt}static get TIME_24_WITH_SHORT_OFFSET(){return gt}static get TIME_24_WITH_LONG_OFFSET(){return pt}static get DATETIME_SHORT(){return wt}static get DATETIME_SHORT_WITH_SECONDS(){return St}static get DATETIME_MED(){return kt}static get DATETIME_MED_WITH_SECONDS(){return Tt}static get DATETIME_MED_WITH_WEEKDAY(){return zn}static get DATETIME_FULL(){return Ot}static get DATETIME_FULL_WITH_SECONDS(){return Nt}static get DATETIME_HUGE(){return Et}static get DATETIME_HUGE_WITH_SECONDS(){return xt}}function he(s){if(g.isDateTime(s))return s;if(s&&s.valueOf&&Y(s.valueOf()))return g.fromJSDate(s);if(s&&typeof s=="object")return g.fromObject(s);throw new D(`Unknown datetime argument: ${s}, of type ${typeof s}`)}const Lr=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Rr=[".mp4",".avi",".mov",".3gp",".wmv"],$r=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Zr=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class d{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||d.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return d.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!d.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!d.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let n=e.length-1;n>=0;n--)if(e[n]==t){e.splice(n,1);break}}static pushUnique(e,t){d.inArray(e,t)||e.push(t)}static findByKey(e,t,n){e=Array.isArray(e)?e:[];for(let r in e)if(e[r][t]==n)return e[r];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const n={};for(let r in e)n[e[r][t]]=n[e[r][t]]||[],n[e[r][t]].push(e[r]);return n}static removeByKey(e,t,n){for(let r in e)if(e[r][t]==n){e.splice(r,1);break}}static pushOrReplaceByKey(e,t,n="id"){for(let r=e.length-1;r>=0;r--)if(e[r][n]==t[n]){e[r]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const n={};for(const r of e)n[r[t]]=r;return Object.values(n)}static filterRedactedProps(e,t="******"){const n=JSON.parse(JSON.stringify(e||{}));for(let r in n)typeof n[r]=="object"&&n[r]!==null?n[r]=d.filterRedactedProps(n[r],t):n[r]===t&&delete n[r];return n}static getNestedVal(e,t,n=null,r="."){let i=e||{},a=(t||"").split(r);for(const o of a){if(!d.isObject(i)&&!Array.isArray(i)||typeof i[o]>"u")return n;i=i[o]}return i}static setByPath(e,t,n,r="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let i=e,a=t.split(r),o=a.pop();for(const u of a)(!d.isObject(i)&&!Array.isArray(i)||!d.isObject(i[u])&&!Array.isArray(i[u]))&&(i[u]={}),i=i[u];i[o]=n}static deleteByPath(e,t,n="."){let r=e||{},i=(t||"").split(n),a=i.pop();for(const o of i)(!d.isObject(r)&&!Array.isArray(r)||!d.isObject(r[o])&&!Array.isArray(r[o]))&&(r[o]={}),r=r[o];Array.isArray(r)?r.splice(a,1):d.isObject(r)&&delete r[a],i.length>0&&(Array.isArray(r)&&!r.length||d.isObject(r)&&!Object.keys(r).length)&&(Array.isArray(e)&&e.length>0||d.isObject(e)&&Object.keys(e).length>0)&&d.deleteByPath(e,i.join(n),n)}static randomString(e=10){let t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}static randomSecret(e=15){if(typeof crypto>"u")return d.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const n="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=n.charAt(t[i]%n.length);return r}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let n=e[e.length-1];n!=="."&&n!=="?"&&n!=="!"&&(e+=".")}return e}static trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,n=!0){return e=""+e,e.length<=t?e:e.substring(0,t)+(n?"...":"")}static truncateObject(e){const t={};for(let n in e){let r=e[n];typeof r=="string"&&(r=d.truncate(r,150,!0)),t[n]=r}return t}static slugify(e,t="_",n=[".","=","-"]){if(e==="")return"";const r={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let i in r)e=e.replace(r[i],i);return e.replace(new RegExp("["+n.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const n=[],r=(e||"").replaceAll("\\"+t,"{_PB_ESCAPED_}").split(t).map(i=>i.replaceAll("{_PB_ESCAPED_}",t));for(let i of r)i=i.trim(),d.isEmpty(i)||n.push(i);return n}static joinNonEmpty(e,t=", "){e=e||[];const n=[],r=t.length>1?t.trim():t;for(let i of e)i=typeof i=="string"?i.trim():"",d.isEmpty(i)||n.push(i.replaceAll(r,"\\"+r));return n.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},n=t[e.length]||t[19];return g.fromFormat(e,n,{zone:"UTC"})}return g.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return d.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(n=>{console.warn("Failed to copy.",n)})}static download(e,t){const n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",t),n.setAttribute("target","_blank"),n.click(),n.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n);d.download(r,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const n=decodeURIComponent(atob(t));return JSON.parse(n)||{}}catch(n){console.warn("Failed to parse JWT payload data.",n)}return{}}static hasImageExtension(e){return e=e||"",!!Lr.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Rr.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!$r.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Zr.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return d.hasImageExtension(e)?"image":d.hasDocumentExtension(e)?"document":d.hasVideoExtension(e)?"video":d.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,n=100){return new Promise(r=>{let i=new FileReader;i.onload=function(a){let o=new Image;o.onload=function(){let u=document.createElement("canvas"),l=u.getContext("2d"),c=o.width,h=o.height;return u.width=t,u.height=n,l.drawImage(o,c>h?(c-h)/2:0,0,c>h?h:c,c>h?h:c,0,0,t,n),r(u.toDataURL(e.type))},o.src=a.target.result},i.readAsDataURL(e)})}static addValueToFormData(e,t,n){if(!(typeof n>"u"))if(d.isEmpty(n))e.append(t,"");else if(Array.isArray(n))for(const r of n)d.addValueToFormData(e,t,r);else n instanceof File?e.append(t,n):n instanceof Date?e.append(t,n.toISOString()):d.isObject(n)?e.append(t,JSON.stringify(n)):e.append(t,""+n)}static dummyCollectionRecord(e){var u,l,c,h,p,m,N;const t=(e==null?void 0:e.schema)||[],n=(e==null?void 0:e.type)==="auth",r=(e==null?void 0:e.type)==="view",i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};n&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!r||d.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!r||d.extractColumnsFromQuery((l=e==null?void 0:e.options)==null?void 0:l.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const O of t){let k=null;O.type==="number"?k=123:O.type==="date"?k="2022-01-01 10:00:00.123Z":O.type==="bool"?k=!0:O.type==="email"?k="test@example.com":O.type==="url"?k="https://example.com":O.type==="json"?k="JSON":O.type==="file"?(k="filename.jpg",((c=O.options)==null?void 0:c.maxSelect)!==1&&(k=[k])):O.type==="select"?(k=(p=(h=O.options)==null?void 0:h.values)==null?void 0:p[0],((m=O.options)==null?void 0:m.maxSelect)!==1&&(k=[k])):O.type==="relation"?(k="RELATION_RECORD_ID",((N=O.options)==null?void 0:N.maxSelect)!==1&&(k=[k])):k="test",i[O.name]=k}return i}static dummyCollectionSchemaData(e){var r,i,a,o;const t=(e==null?void 0:e.schema)||[],n={};for(const u of t){let l=null;if(u.type==="number")l=123;else if(u.type==="date")l="2022-01-01 10:00:00.123Z";else if(u.type==="bool")l=!0;else if(u.type==="email")l="test@example.com";else if(u.type==="url")l="https://example.com";else if(u.type==="json")l="JSON";else{if(u.type==="file")continue;u.type==="select"?(l=(i=(r=u.options)==null?void 0:r.values)==null?void 0:i[0],((a=u.options)==null?void 0:a.maxSelect)!==1&&(l=[l])):u.type==="relation"?(l="RELATION_RECORD_ID",((o=u.options)==null?void 0:o.maxSelect)!==1&&(l=[l])):l="test"}n[u.name]=l}return n}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,n=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let l in e)if(l!=="schema"&&JSON.stringify(e[l])!==JSON.stringify(t[l]))return!0;const r=Array.isArray(e.schema)?e.schema:[],i=Array.isArray(t.schema)?t.schema:[],a=r.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(i,"id",l.id)),o=i.filter(l=>(l==null?void 0:l.id)&&!d.findByKey(r,"id",l.id)),u=i.filter(l=>{const c=d.isObject(l)&&d.findByKey(r,"id",l.id);if(!c)return!1;for(let h in c)if(JSON.stringify(l[h])!=JSON.stringify(c[h]))return!0;return!1});return!!(o.length||u.length||n&&a.length)}static sortCollections(e=[]){const t=[],n=[],r=[];for(const a of e)a.type==="auth"?t.push(a):a.type==="base"?n.push(a):r.push(a);function i(a,o){return a.name>o.name?1:a.name<o.name?-1:0}return[].concat(t.sort(i),n.sort(i),r.sort(i))}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(r){let i=r.parentNode;for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}function n(r){if(r){for(const i of r.children)n(i);e.includes(r.tagName)?(r.removeAttribute("style"),r.removeAttribute("class")):t(r)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(r,i)=>{n(i.node)},file_picker_types:"image",file_picker_callback:(r,i,a)=>{const o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("accept","image/*"),o.addEventListener("change",u=>{const l=u.target.files[0],c=new FileReader;c.addEventListener("load",()=>{if(!tinymce)return;const h="blobid"+new Date().getTime(),p=tinymce.activeEditor.editorUpload.blobCache,m=c.result.split(",")[1],N=p.create(h,l,m);p.add(N),r(N.blobUri(),{title:l.name})}),c.readAsDataURL(l)}),o.click()},setup:r=>{r.on("keydown",a=>{(a.ctrlKey||a.metaKey)&&a.code=="KeyS"&&r.formElement&&(a.preventDefault(),a.stopPropagation(),r.formElement.dispatchEvent(new KeyboardEvent("keydown",a)))});const i="tinymce_last_direction";r.on("init",()=>{var o;const a=(o=window==null?void 0:window.localStorage)==null?void 0:o.getItem(i);!r.isDirty()&&r.getContent()==""&&a=="rtl"&&r.execCommand("mceDirectionRTL")}),r.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:a=>{a([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"ltr"),r.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"rtl"),r.execCommand("mceDirectionRTL")}}])}}),r.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:a=>{a([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{r.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{r.execCommand("mceImage")}}])}})}}}static displayValue(e,t,n="N/A"){e=e||{},t=t||[];let r=[];for(const a of t){let o=e[a];typeof o>"u"||(o=d.stringifyValue(o,n),r.push(o))}if(r.length>0)return r.join(", ");const i=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const a of i){let o=d.stringifyValue(e[a],"");if(o)return o}return n}static stringifyValue(e,t="N/A",n=150){if(d.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?d.plainText(e):e,d.truncate(e,n)||t;if(Array.isArray(e)&&typeof e[0]!="object")return d.truncate(e.join(","),n);if(typeof e=="object")try{return d.truncate(JSON.stringify(e),n)||t}catch{return t}return e}static extractColumnsFromQuery(e){var a;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const n=e.match(/select\s+([\s\S]+)\s+from/),r=((a=n==null?void 0:n[1])==null?void 0:a.split(","))||[],i=[];for(let o of r){const u=o.trim().split(" ").pop();u!=""&&u!=t&&i.push(u.replace(/[\'\"\`\[\]\s]/g,""))}return i}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let n=[t+"id"];if(e.type==="view")for(let i of d.extractColumnsFromQuery(e.options.query))d.pushUnique(n,t+i);else e.type==="auth"?(n.push(t+"username"),n.push(t+"email"),n.push(t+"emailVisibility"),n.push(t+"verified"),n.push(t+"created"),n.push(t+"updated")):(n.push(t+"created"),n.push(t+"updated"));const r=e.schema||[];for(const i of r)d.pushUnique(n,t+i.name);return n}static getCollectionAutocompleteKeys(e,t,n="",r=0){var o,u,l;let i=e.find(c=>c.name==t||c.id==t);if(!i||r>=4)return[];i.schema=i.schema||[];let a=d.getAllCollectionIdentifiers(i,n);for(const c of i.schema){const h=n+c.name;if(c.type=="relation"&&((o=c.options)!=null&&o.collectionId)){const p=d.getCollectionAutocompleteKeys(e,c.options.collectionId,h+".",r+1);p.length&&(a=a.concat(p))}((u=c.options)==null?void 0:u.maxSelect)!=1&&["select","file","relation"].includes(c.type)&&(a.push(h+":each"),a.push(h+":length"))}for(const c of e){c.schema=c.schema||[];for(const h of c.schema)if(h.type=="relation"&&((l=h.options)==null?void 0:l.collectionId)==i.id){const p=n+c.name+"_via_"+h.name,m=d.getCollectionAutocompleteKeys(e,c.id,p+".",r+2);m.length&&(a=a.concat(m))}}return a}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const n of e){const r="@collection."+n.name+".",i=d.getCollectionAutocompleteKeys(e,n.name,r);for(const a of i)t.push(a)}return t}static getRequestAutocompleteKeys(e,t){const n=[];n.push("@request.context"),n.push("@request.method"),n.push("@request.query."),n.push("@request.data."),n.push("@request.headers."),n.push("@request.auth.id"),n.push("@request.auth.collectionId"),n.push("@request.auth.collectionName"),n.push("@request.auth.verified"),n.push("@request.auth.username"),n.push("@request.auth.email"),n.push("@request.auth.emailVisibility"),n.push("@request.auth.created"),n.push("@request.auth.updated");const r=e.filter(i=>i.type==="auth");for(const i of r){const a=d.getCollectionAutocompleteKeys(e,i.id,"@request.auth.");for(const o of a)d.pushUnique(n,o)}if(t){const i=["created","updated"],a=d.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const o of a){n.push(o);const u=o.split(".");u.length===3&&u[2].indexOf(":")===-1&&!i.includes(u[2])&&n.push(o+":isset")}}return n}static parseIndex(e){var u,l,c,h,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},r=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((r==null?void 0:r.length)!=7)return t;const i=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((u=r[1])==null?void 0:u.trim().toLowerCase())==="unique",t.optional=!d.isEmpty((l=r[2])==null?void 0:l.trim());const a=(r[3]||"").split(".");a.length==2?(t.schemaName=a[0].replace(i,""),t.indexName=a[1].replace(i,"")):(t.schemaName="",t.indexName=a[0].replace(i,"")),t.tableName=(r[4]||"").replace(i,"");const o=(r[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of o){m=m.trim().replaceAll("{PB_TEMP}",",");const O=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((O==null?void 0:O.length)!=4)continue;const k=(h=(c=O[1])==null?void 0:c.trim())==null?void 0:h.replace(i,"");k&&t.columns.push({name:k,collate:O[2]||"",sort:((p=O[3])==null?void 0:p.toUpperCase())||""})}return t.where=r[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+d.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const n=e.columns.filter(r=>!!(r!=null&&r.name));return n.length>1&&(t+=`
`),t+=n.map(r=>{let i="";return r.name.includes("(")||r.name.includes(" ")?i+=r.name:i+="`"+r.name+"`",r.collate&&(i+=" COLLATE "+r.collate),r.sort&&(i+=" "+r.sort.toUpperCase()),i}).join(`,
`),n.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const n=d.parseIndex(e);return n.tableName=t,d.buildIndex(n)}static replaceIndexColumn(e,t,n){if(t===n)return e;const r=d.parseIndex(e);let i=!1;for(let a of r.columns)a.name===t&&(a.name=n,i=!0);return i?d.buildIndex(r):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const n=["=","!=","~","!~",">",">=","<","<="];for(const r of n)if(e.includes(r))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(r=>`${r}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return d.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",n=window.location.hash;const r=n.indexOf("?");r>-1&&(t=n.substring(r+1),n=n.substring(0,r));const i=new URLSearchParams(t);for(let u in e){const l=e[u];l===null?i.delete(u):i.set(u,l)}t=i.toString(),t!=""&&(n+="?"+t);let a=window.location.href;const o=a.indexOf("#");o>-1&&(a=a.substring(0,o)),window.location.replace(a+n)}}const nt=11e3;onmessage=s=>{var t,n;if(!s.data.collections)return;const e={};e.baseKeys=d.getCollectionAutocompleteKeys(s.data.collections,(t=s.data.baseCollection)==null?void 0:t.name),e.baseKeys=rt(e.baseKeys.sort(st),nt),s.data.disableRequestKeys||(e.requestKeys=d.getRequestAutocompleteKeys(s.data.collections,(n=s.data.baseCollection)==null?void 0:n.name),e.requestKeys=rt(e.requestKeys.sort(st),nt)),s.data.disableCollectionJoinKeys||(e.collectionJoinKeys=d.getCollectionJoinAutocompleteKeys(s.data.collections),e.collectionJoinKeys=rt(e.collectionJoinKeys.sort(st),nt)),postMessage(e)};function st(s,e){return s.length-e.length}function rt(s,e){return s.length>e?s.slice(0,e):s}})();