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

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 Y extends Error{}class qn extends Y{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class zn extends Y{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Pn extends Y{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class j extends Y{}class lt extends Y{constructor(e){super(`Invalid unit ${e}`)}}class x extends Y{}class U extends Y{constructor(){super("Zone is an abstract class")}}const c="numeric",W="short",v="long",Se={year:c,month:c,day:c},ct={year:c,month:W,day:c},Yn={year:c,month:W,day:c,weekday:W},ft={year:c,month:v,day:c},dt={year:c,month:v,day:c,weekday:v},ht={hour:c,minute:c},mt={hour:c,minute:c,second:c},yt={hour:c,minute:c,second:c,timeZoneName:W},gt={hour:c,minute:c,second:c,timeZoneName:v},pt={hour:c,minute:c,hourCycle:"h23"},wt={hour:c,minute:c,second:c,hourCycle:"h23"},St={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:W},kt={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:v},Tt={year:c,month:c,day:c,hour:c,minute:c},Ot={year:c,month:c,day:c,hour:c,minute:c,second:c},Et={year:c,month:W,day:c,hour:c,minute:c},Nt={year:c,month:W,day:c,hour:c,minute:c,second:c},Jn={year:c,month:W,day:c,weekday:W,hour:c,minute:c},xt={year:c,month:v,day:c,hour:c,minute:c,timeZoneName:W},bt={year:c,month:v,day:c,hour:c,minute:c,second:c,timeZoneName:W},It={year:c,month:v,day:c,weekday:v,hour:c,minute:c,timeZoneName:v},vt={year:c,month:v,day:c,weekday:v,hour:c,minute:c,second:c,timeZoneName:v};class oe{get type(){throw new U}get name(){throw new U}get ianaName(){return this.name}get isUniversal(){throw new U}offsetName(e,t){throw new U}formatOffset(e,t){throw new U}offset(e){throw new U}equals(e){throw new U}get isValid(){throw new U}}let $e=null;class ke extends oe{static get instance(){return $e===null&&($e=new ke),$e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Xt(e,t,n)}formatOffset(e,t){return fe(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Te={};function Bn(r){return Te[r]||(Te[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Te[r]}const Gn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function jn(r,e){const t=r.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,i,a,o,u,l,f]=n;return[a,s,i,o,u,l,f]}function Kn(r,e){const t=r.formatToParts(e),n=[];for(let s=0;s<t.length;s++){const{type:i,value:a}=t[s],o=Gn[i];i==="era"?n[o]=a:g(o)||(n[o]=parseInt(a,10))}return n}let Oe={};class $ extends oe{static create(e){return Oe[e]||(Oe[e]=new $(e)),Oe[e]}static resetCache(){Oe={},Te={}}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 Xt(e,t,n,this.name)}formatOffset(e,t){return fe(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=Bn(this.name);let[s,i,a,o,u,l,f]=n.formatToParts?Kn(n,t):jn(n,t);o==="BC"&&(s=-Math.abs(s)+1);const k=Ie({year:s,month:i,day:a,hour:u===24?0:u,minute:l,second:f,millisecond:0});let m=+t;const E=m%1e3;return m-=E>=0?E:1e3+E,(k-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Mt={};function Hn(r,e={}){const t=JSON.stringify([r,e]);let n=Mt[t];return n||(n=new Intl.ListFormat(r,e),Mt[t]=n),n}let Ue={};function Ze(r,e={}){const t=JSON.stringify([r,e]);let n=Ue[t];return n||(n=new Intl.DateTimeFormat(r,e),Ue[t]=n),n}let qe={};function Qn(r,e={}){const t=JSON.stringify([r,e]);let n=qe[t];return n||(n=new Intl.NumberFormat(r,e),qe[t]=n),n}let ze={};function _n(r,e={}){const{base:t,...n}=e,s=JSON.stringify([r,n]);let i=ze[s];return i||(i=new Intl.RelativeTimeFormat(r,e),ze[s]=i),i}let ue=null;function Xn(){return ue||(ue=new Intl.DateTimeFormat().resolvedOptions().locale,ue)}let Dt={};function er(r){let e=Dt[r];if(!e){const t=new Intl.Locale(r);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,Dt[r]=e}return e}function tr(r){const e=r.indexOf("-x-");e!==-1&&(r=r.substring(0,e));const t=r.indexOf("-u-");if(t===-1)return[r];{let n,s;try{n=Ze(r).resolvedOptions(),s=r}catch{const u=r.substring(0,t);n=Ze(u).resolvedOptions(),s=u}const{numberingSystem:i,calendar:a}=n;return[s,i,a]}}function nr(r,e,t){return(t||e)&&(r.includes("-u-")||(r+="-u"),t&&(r+=`-ca-${t}`),e&&(r+=`-nu-${e}`)),r}function rr(r){const e=[];for(let t=1;t<=12;t++){const n=y.utc(2009,t,1);e.push(r(n))}return e}function sr(r){const e=[];for(let t=1;t<=7;t++){const n=y.utc(2016,11,13+t);e.push(r(n))}return e}function Ee(r,e,t,n){const s=r.listingMode();return s==="error"?null:s==="en"?t(e):n(e)}function ir(r){return r.numberingSystem&&r.numberingSystem!=="latn"?!1:r.numberingSystem==="latn"||!r.locale||r.locale.startsWith("en")||new Intl.DateTimeFormat(r.intl).resolvedOptions().numberingSystem==="latn"}class ar{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:s,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=Qn(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):He(e,3);return N(t,this.padTo)}}}class or{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&$.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||s,this.dtf=Ze(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 ur{constructor(e,t,n){this.opts={style:"long",...n},!t&&Kt()&&(this.rtf=_n(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):Fr(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const lr={firstDay:1,minimalDays:4,weekend:[6,7]};class S{static fromOpts(e){return S.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,s,i=!1){const a=e||T.defaultLocale,o=a||(i?"en-US":Xn()),u=t||T.defaultNumberingSystem,l=n||T.defaultOutputCalendar,f=je(s)||T.defaultWeekSettings;return new S(o,u,l,f,a)}static resetCache(){ue=null,Ue={},qe={},ze={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:s}={}){return S.create(e,t,n,s)}constructor(e,t,n,s,i){const[a,o,u]=tr(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||u||null,this.weekSettings=s,this.intl=nr(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=ir(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:S.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,je(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 Ee(this,e,nn,()=>{const n=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=rr(i=>this.extract(i,n,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1){return Ee(this,e,an,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=sr(i=>this.extract(i,n,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return Ee(this,void 0,()=>on,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[y.utc(2016,11,13,9),y.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ee(this,e,un,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[y.utc(-40,1,1),y.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const s=this.dtFormatter(e,t),i=s.formatToParts(),a=i.find(o=>o.type.toLowerCase()===n);return a?a.value:null}numberFormatter(e={}){return new ar(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new or(e,this.intl,t)}relFormatter(e={}){return new ur(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Hn(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:Ht()?er(this.locale):lr}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Pe=null;class I extends oe{static get utcInstance(){return Pe===null&&(Pe=new I(0)),Pe}static instance(e){return e===0?I.utcInstance:new I(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new I(ve(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${fe(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${fe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return fe(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 cr extends oe{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 Z(r,e){if(g(r)||r===null)return e;if(r instanceof oe)return r;if(gr(r)){const t=r.toLowerCase();return t==="default"?e:t==="local"||t==="system"?ke.instance:t==="utc"||t==="gmt"?I.utcInstance:I.parseSpecifier(t)||$.create(r)}else return q(r)?I.instance(r):typeof r=="object"&&"offset"in r&&typeof r.offset=="function"?r:new cr(r)}const Ye={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},Ft={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]},fr=Ye.hanidec.replace(/[\[|\]]/g,"").split("");function dr(r){let e=parseInt(r,10);if(isNaN(e)){e="";for(let t=0;t<r.length;t++){const n=r.charCodeAt(t);if(r[t].search(Ye.hanidec)!==-1)e+=fr.indexOf(r[t]);else for(const s in Ft){const[i,a]=Ft[s];n>=i&&n<=a&&(e+=n-i)}}return parseInt(e,10)}else return e}let K={};function hr(){K={}}function C({numberingSystem:r},e=""){const t=r||"latn";return K[t]||(K[t]={}),K[t][e]||(K[t][e]=new RegExp(`${Ye[t]}${e}`)),K[t][e]}let Vt=()=>Date.now(),At="system",Wt=null,Ct=null,Lt=null,Rt=60,$t,Ut=null;class T{static get now(){return Vt}static set now(e){Vt=e}static set defaultZone(e){At=e}static get defaultZone(){return Z(At,ke.instance)}static get defaultLocale(){return Wt}static set defaultLocale(e){Wt=e}static get defaultNumberingSystem(){return Ct}static set defaultNumberingSystem(e){Ct=e}static get defaultOutputCalendar(){return Lt}static set defaultOutputCalendar(e){Lt=e}static get defaultWeekSettings(){return Ut}static set defaultWeekSettings(e){Ut=je(e)}static get twoDigitCutoffYear(){return Rt}static set twoDigitCutoffYear(e){Rt=e%100}static get throwOnInvalid(){return $t}static set throwOnInvalid(e){$t=e}static resetCaches(){S.resetCache(),$.resetCache(),y.resetCache(),hr()}}class L{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Zt=[0,31,59,90,120,151,181,212,243,273,304,334],qt=[0,31,60,91,121,152,182,213,244,274,305,335];function F(r,e){return new L("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${r}, which is invalid`)}function Je(r,e,t){const n=new Date(Date.UTC(r,e-1,t));r<100&&r>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const s=n.getUTCDay();return s===0?7:s}function zt(r,e,t){return t+(le(r)?qt:Zt)[e-1]}function Pt(r,e){const t=le(r)?qt:Zt,n=t.findIndex(i=>i<e),s=e-t[n];return{month:n+1,day:s}}function Be(r,e){return(r-e+7)%7+1}function Ne(r,e=4,t=1){const{year:n,month:s,day:i}=r,a=zt(n,s,i),o=Be(Je(n,s,i),t);let u=Math.floor((a-o+14-e)/7),l;return u<1?(l=n-1,u=ce(l,e,t)):u>ce(n,e,t)?(l=n+1,u=1):l=n,{weekYear:l,weekNumber:u,weekday:o,...De(r)}}function Yt(r,e=4,t=1){const{weekYear:n,weekNumber:s,weekday:i}=r,a=Be(Je(n,1,e),t),o=Q(n);let u=s*7+i-a-7+e,l;u<1?(l=n-1,u+=Q(l)):u>o?(l=n+1,u-=Q(n)):l=n;const{month:f,day:h}=Pt(l,u);return{year:l,month:f,day:h,...De(r)}}function Ge(r){const{year:e,month:t,day:n}=r,s=zt(e,t,n);return{year:e,ordinal:s,...De(r)}}function Jt(r){const{year:e,ordinal:t}=r,{month:n,day:s}=Pt(e,t);return{year:e,month:n,day:s,...De(r)}}function Bt(r,e){if(!g(r.localWeekday)||!g(r.localWeekNumber)||!g(r.localWeekYear)){if(!g(r.weekday)||!g(r.weekNumber)||!g(r.weekYear))throw new j("Cannot mix locale-based week fields with ISO-based week fields");return g(r.localWeekday)||(r.weekday=r.localWeekday),g(r.localWeekNumber)||(r.weekNumber=r.localWeekNumber),g(r.localWeekYear)||(r.weekYear=r.localWeekYear),delete r.localWeekday,delete r.localWeekNumber,delete r.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function mr(r,e=4,t=1){const n=xe(r.weekYear),s=V(r.weekNumber,1,ce(r.weekYear,e,t)),i=V(r.weekday,1,7);return n?s?i?!1:F("weekday",r.weekday):F("week",r.weekNumber):F("weekYear",r.weekYear)}function yr(r){const e=xe(r.year),t=V(r.ordinal,1,Q(r.year));return e?t?!1:F("ordinal",r.ordinal):F("year",r.year)}function Gt(r){const e=xe(r.year),t=V(r.month,1,12),n=V(r.day,1,be(r.year,r.month));return e?t?n?!1:F("day",r.day):F("month",r.month):F("year",r.year)}function jt(r){const{hour:e,minute:t,second:n,millisecond:s}=r,i=V(e,0,23)||e===24&&t===0&&n===0&&s===0,a=V(t,0,59),o=V(n,0,59),u=V(s,0,999);return i?a?o?u?!1:F("millisecond",s):F("second",n):F("minute",t):F("hour",e)}function g(r){return typeof r>"u"}function q(r){return typeof r=="number"}function xe(r){return typeof r=="number"&&r%1===0}function gr(r){return typeof r=="string"}function pr(r){return Object.prototype.toString.call(r)==="[object Date]"}function Kt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ht(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function wr(r){return Array.isArray(r)?r:[r]}function Qt(r,e,t){if(r.length!==0)return r.reduce((n,s)=>{const i=[e(s),s];return n&&t(n[0],i[0])===n[0]?n:i},null)[1]}function Sr(r,e){return e.reduce((t,n)=>(t[n]=r[n],t),{})}function H(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function je(r){if(r==null)return null;if(typeof r!="object")throw new x("Week settings must be an object");if(!V(r.firstDay,1,7)||!V(r.minimalDays,1,7)||!Array.isArray(r.weekend)||r.weekend.some(e=>!V(e,1,7)))throw new x("Invalid week settings");return{firstDay:r.firstDay,minimalDays:r.minimalDays,weekend:Array.from(r.weekend)}}function V(r,e,t){return xe(r)&&r>=e&&r<=t}function kr(r,e){return r-e*Math.floor(r/e)}function N(r,e=2){const t=r<0;let n;return t?n="-"+(""+-r).padStart(e,"0"):n=(""+r).padStart(e,"0"),n}function z(r){if(!(g(r)||r===null||r===""))return parseInt(r,10)}function J(r){if(!(g(r)||r===null||r===""))return parseFloat(r)}function Ke(r){if(!(g(r)||r===null||r==="")){const e=parseFloat("0."+r)*1e3;return Math.floor(e)}}function He(r,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(r*n)/n}function le(r){return r%4===0&&(r%100!==0||r%400===0)}function Q(r){return le(r)?366:365}function be(r,e){const t=kr(e-1,12)+1,n=r+(e-t)/12;return t===2?le(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ie(r){let e=Date.UTC(r.year,r.month-1,r.day,r.hour,r.minute,r.second,r.millisecond);return r.year<100&&r.year>=0&&(e=new Date(e),e.setUTCFullYear(r.year,r.month-1,r.day)),+e}function _t(r,e,t){return-Be(Je(r,1,e),t)+e-1}function ce(r,e=4,t=1){const n=_t(r,e,t),s=_t(r+1,e,t);return(Q(r)-n+s)/7}function Qe(r){return r>99?r:r>T.twoDigitCutoffYear?1900+r:2e3+r}function Xt(r,e,t,n=null){const s=new Date(r),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(s).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function ve(r,e){let t=parseInt(r,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-n:n;return t*60+s}function en(r){const e=Number(r);if(typeof r=="boolean"||r===""||Number.isNaN(e))throw new x(`Invalid unit value ${r}`);return e}function Me(r,e){const t={};for(const n in r)if(H(r,n)){const s=r[n];if(s==null)continue;t[e(n)]=en(s)}return t}function fe(r,e){const t=Math.trunc(Math.abs(r/60)),n=Math.trunc(Math.abs(r%60)),s=r>=0?"+":"-";switch(e){case"short":return`${s}${N(t,2)}:${N(n,2)}`;case"narrow":return`${s}${t}${n>0?`:${n}`:""}`;case"techie":return`${s}${N(t,2)}${N(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function De(r){return Sr(r,["hour","minute","second","millisecond"])}const Tr=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Or=["J","F","M","A","M","J","J","A","S","O","N","D"];function nn(r){switch(r){case"narrow":return[...Or];case"short":return[...tn];case"long":return[...Tr];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 rn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],sn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Er=["M","T","W","T","F","S","S"];function an(r){switch(r){case"narrow":return[...Er];case"short":return[...sn];case"long":return[...rn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const on=["AM","PM"],Nr=["Before Christ","Anno Domini"],xr=["BC","AD"],br=["B","A"];function un(r){switch(r){case"narrow":return[...br];case"short":return[...xr];case"long":return[...Nr];default:return null}}function Ir(r){return on[r.hour<12?0:1]}function vr(r,e){return an(e)[r.weekday-1]}function Mr(r,e){return nn(e)[r.month-1]}function Dr(r,e){return un(e)[r.year<0?0:1]}function Fr(r,e,t="always",n=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(r)===-1;if(t==="auto"&&i){const h=r==="days";switch(e){case 1:return h?"tomorrow":`next ${s[r][0]}`;case-1:return h?"yesterday":`last ${s[r][0]}`;case 0:return h?"today":`this ${s[r][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=s[r],f=n?u?l[1]:l[2]||l[1]:u?s[r][0]:r;return a?`${o} ${f} ago`:`in ${o} ${f}`}function ln(r,e){let t="";for(const n of r)n.literal?t+=n.val:t+=e(n.val);return t}const Vr={D:Se,DD:ct,DDD:ft,DDDD:dt,t:ht,tt:mt,ttt:yt,tttt:gt,T:pt,TT:wt,TTT:St,TTTT:kt,f:Tt,ff:Et,fff:xt,ffff:It,F:Ot,FF:Nt,FFF:bt,FFFF:vt};class b{static create(e,t={}){return new b(e,t)}static parseFormat(e){let t=null,n="",s=!1;const i=[];for(let a=0;a<e.length;a++){const o=e.charAt(a);o==="'"?(n.length>0&&i.push({literal:s||/^\s+$/.test(n),val:n}),t=null,n="",s=!s):s||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:s||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return Vr[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 N(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",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,E)=>this.loc.extract(e,m,E),a=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>n?Ir(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,E)=>n?Mr(e,m):i(E?{month:m}:{month:m,day:"numeric"},"month"),l=(m,E)=>n?vr(e,m):i(E?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const E=b.macroTokenToFormatOpts(m);return E?this.formatWithSystemDefault(e,E):m},h=m=>n?Dr(e,m):i({era:m},"era"),k=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 s?i({day:"numeric"},"day"):this.num(e.day);case"dd":return s?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return s?i({month:"numeric"},"month"):this.num(e.month);case"MM":return s?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return s?i({year:"numeric"},"year"):this.num(e.year);case"yy":return s?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return 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 f(m)}};return ln(b.parseFormat(t),k)}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}},s=u=>l=>{const f=n(l);return f?this.num(u.get(f),l.length):l},i=b.parseFormat(t),a=i.reduce((u,{literal:l,val:f})=>l?u:u.concat(f),[]),o=e.shiftTo(...a.map(n).filter(u=>u));return ln(i,s(o))}}const cn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function _(...r){const e=r.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function X(...r){return e=>r.reduce(([t,n,s],i)=>{const[a,o,u]=i(e,s);return[{...t,...a},o||n,u]},[{},null,1]).slice(0,2)}function ee(r,...e){if(r==null)return[null,null];for(const[t,n]of e){const s=t.exec(r);if(s)return n(s)}return[null,null]}function fn(...r){return(e,t)=>{const n={};let s;for(s=0;s<r.length;s++)n[r[s]]=z(e[t+s]);return[n,null,t+s]}}const dn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ar=`(?:${dn.source}?(?:\\[(${cn.source})\\])?)?`,_e=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hn=RegExp(`${_e.source}${Ar}`),Xe=RegExp(`(?:T${hn.source})?`),Wr=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Cr=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Lr=/(\d{4})-?(\d{3})/,Rr=fn("weekYear","weekNumber","weekDay"),$r=fn("year","ordinal"),Ur=/(\d{4})-(\d\d)-(\d\d)/,mn=RegExp(`${_e.source} ?(?:${dn.source}|(${cn.source}))?`),Zr=RegExp(`(?: ${mn.source})?`);function te(r,e,t){const n=r[e];return g(n)?t:z(n)}function qr(r,e){return[{year:te(r,e),month:te(r,e+1,1),day:te(r,e+2,1)},null,e+3]}function ne(r,e){return[{hours:te(r,e,0),minutes:te(r,e+1,0),seconds:te(r,e+2,0),milliseconds:Ke(r[e+3])},null,e+4]}function de(r,e){const t=!r[e]&&!r[e+1],n=ve(r[e+1],r[e+2]),s=t?null:I.instance(n);return[{},s,e+3]}function he(r,e){const t=r[e]?$.create(r[e]):null;return[{},t,e+1]}const zr=RegExp(`^T?${_e.source}$`),Pr=/^-?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 Yr(r){const[e,t,n,s,i,a,o,u,l]=r,f=e[0]==="-",h=u&&u[0]==="-",k=(m,E=!1)=>m!==void 0&&(E||m&&f)?-m:m;return[{years:k(J(t)),months:k(J(n)),weeks:k(J(s)),days:k(J(i)),hours:k(J(a)),minutes:k(J(o)),seconds:k(J(u),u==="-0"),milliseconds:k(Ke(l),h)}]}const Jr={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 et(r,e,t,n,s,i,a){const o={year:e.length===2?Qe(z(e)):z(e),month:tn.indexOf(t)+1,day:z(n),hour:z(s),minute:z(i)};return a&&(o.second=z(a)),r&&(o.weekday=r.length>3?rn.indexOf(r)+1:sn.indexOf(r)+1),o}const Br=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Gr(r){const[,e,t,n,s,i,a,o,u,l,f,h]=r,k=et(e,s,n,t,i,a,o);let m;return u?m=Jr[u]:l?m=0:m=ve(f,h),[k,new I(m)]}function jr(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Kr=/^(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$/,Hr=/^(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$/,Qr=/^(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 yn(r){const[,e,t,n,s,i,a,o]=r;return[et(e,s,n,t,i,a,o),I.utcInstance]}function _r(r){const[,e,t,n,s,i,a,o]=r;return[et(e,o,t,n,s,i,a),I.utcInstance]}const Xr=_(Wr,Xe),es=_(Cr,Xe),ts=_(Lr,Xe),ns=_(hn),gn=X(qr,ne,de,he),rs=X(Rr,ne,de,he),ss=X($r,ne,de,he),is=X(ne,de,he);function as(r){return ee(r,[Xr,gn],[es,rs],[ts,ss],[ns,is])}function os(r){return ee(jr(r),[Br,Gr])}function us(r){return ee(r,[Kr,yn],[Hr,yn],[Qr,_r])}function ls(r){return ee(r,[Pr,Yr])}const cs=X(ne);function fs(r){return ee(r,[zr,cs])}const ds=_(Ur,Zr),hs=_(mn),ms=X(ne,de,he);function ys(r){return ee(r,[ds,gn],[hs,ms])}const pn="Invalid Duration",wn={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}},gs={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},...wn},A=146097/400,re=146097/4800,ps={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:re/7,days:re,hours:re*24,minutes:re*24*60,seconds:re*24*60*60,milliseconds:re*24*60*60*1e3},...wn},B=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ws=B.slice(0).reverse();function P(r,e,t=!1){const n={values:t?e.values:{...r.values,...e.values||{}},loc:r.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||r.conversionAccuracy,matrix:e.matrix||r.matrix};return new p(n)}function Sn(r,e){let t=e.milliseconds??0;for(const n of ws.slice(1))e[n]&&(t+=e[n]*r[n].milliseconds);return t}function kn(r,e){const t=Sn(r,e)<0?-1:1;B.reduceRight((n,s)=>{if(g(e[s]))return n;if(n){const i=e[n]*t,a=r[s][n],o=Math.floor(i/a);e[s]+=o*t,e[n]-=o*a*t}return s},null),B.reduce((n,s)=>{if(g(e[s]))return n;if(n){const i=e[n]%1;e[n]-=i,e[s]+=i*r[n][s]}return s},null)}function Ss(r){const e={};for(const[t,n]of Object.entries(r))n!==0&&(e[t]=n);return e}class p{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?ps:gs;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||S.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return p.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new x(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new p({values:Me(e,p.normalizeUnit),loc:S.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(q(e))return p.fromMillis(e);if(p.isDuration(e))return e;if(typeof e=="object")return p.fromObject(e);throw new x(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=ls(e);return n?p.fromObject(n,t):p.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=fs(e);return n?p.fromObject(n,t):p.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new x("need to specify a reason the Duration is invalid");const n=e instanceof L?e:new L(e,t);if(T.throwOnInvalid)throw new Pn(n);return new p({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 lt(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?b.create(this.loc,n).formatDurationFromString(this,e):pn}toHuman(e={}){if(!this.isValid)return pn;const t=B.map(n=>{const s=this.values[n];return g(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(s)}).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+=He(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},y.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?Sn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=p.fromDurationLike(e),n={};for(const s of B)(H(t.values,s)||H(this.values,s))&&(n[s]=t.get(s)+this.get(s));return P(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=p.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]=en(e(this.values[n],n));return P(this,{values:t},!0)}get(e){return this[p.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...Me(e,p.normalizeUnit)};return P(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:s}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:n};return P(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return kn(this.matrix,e),P(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Ss(this.normalize().shiftToAll().toObject());return P(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>p.normalizeUnit(a));const t={},n={},s=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;q(s[a])&&(o+=s[a]);const u=Math.trunc(o);t[a]=u,n[a]=(o*1e3-u*1e3)/1e3}else q(s[a])&&(n[a]=s[a]);for(const a in n)n[a]!==0&&(t[i]+=a===i?n[a]:n[a]/this.matrix[i][a]);return kn(this.matrix,t),P(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 P(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,s){return n===void 0||n===0?s===void 0||s===0:n===s}for(const n of B)if(!t(this.values[n],e.values[n]))return!1;return!0}}const se="Invalid Interval";function ks(r,e){return!r||!r.isValid?O.invalid("missing or invalid start"):!e||!e.isValid?O.invalid("missing or invalid end"):e<r?O.invalid("end before start",`The end of an interval must be after its start, but you had start=${r.toISO()} and end=${e.toISO()}`):null}class O{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 x("need to specify a reason the Interval is invalid");const n=e instanceof L?e:new L(e,t);if(T.throwOnInvalid)throw new zn(n);return new O({invalid:n})}static fromDateTimes(e,t){const n=ye(e),s=ye(t),i=ks(n,s);return i??new O({start:n,end:s})}static after(e,t){const n=p.fromDurationLike(t),s=ye(e);return O.fromDateTimes(s,s.plus(n))}static before(e,t){const n=p.fromDurationLike(t),s=ye(e);return O.fromDateTimes(s.minus(n),s)}static fromISO(e,t){const[n,s]=(e||"").split("/",2);if(n&&s){let i,a;try{i=y.fromISO(n,t),a=i.isValid}catch{a=!1}let o,u;try{o=y.fromISO(s,t),u=o.isValid}catch{u=!1}if(a&&u)return O.fromDateTimes(i,o);if(a){const l=p.fromISO(s,t);if(l.isValid)return O.after(i,l)}else if(u){const l=p.fromISO(n,t);if(l.isValid)return O.before(o,l)}}return O.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 s;return t!=null&&t.useLocaleWeeks?s=this.end.reconfigure({locale:n.locale}):s=this.end,s=s.startOf(e,t),Math.floor(s.diff(n,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?O.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ye).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),n=[];let{s}=this,i=0;for(;s<this.e;){const a=t[i]||this.e,o=+a>+this.e?this.e:a;n.push(O.fromDateTimes(s,o)),s=o,i+=1}return n}splitBy(e){const t=p.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,s=1,i;const a=[];for(;n<this.e;){const o=this.start.plus(t.mapUnits(u=>u*s));i=+o>+this.e?this.e:o,a.push(O.fromDateTimes(n,i)),n=i,s+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e<e.e?this.e:e.e;return t>=n?null:O.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 O.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((s,i)=>s.s-i.s).reduce(([s,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[s,i.union(a)]:[s.concat([i]),a]:[s,a],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const s=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)n+=u.type==="s"?1:-1,n===1?t=u.time:(t&&+t!=+u.time&&s.push(O.fromDateTimes(t,u.time)),t=null);return O.merge(s)}difference(...e){return O.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=Se,t={}){return this.isValid?b.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):p.invalid(this.invalidReason)}mapEndpoints(e){return O.fromDateTimes(e(this.s),e(this.e))}}class Fe{static hasDST(e=T.defaultZone){const t=y.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 Z(e,T.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||S.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||S.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||S.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||S.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||S.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null}={}){return(s||S.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null}={}){return(s||S.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return S.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return S.create(t,null,"gregory").eras(e)}static features(){return{relative:Kt(),localeWeek:Ht()}}}function Tn(r,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(r);return Math.floor(p.fromMillis(n).as("days"))}function Ts(r,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 f=Tn(u,l);return(f-f%7)/7}],["days",Tn]],s={},i=r;let a,o;for(const[u,l]of n)t.indexOf(u)>=0&&(a=u,s[u]=l(r,e),o=i.plus(s),o>e?(s[u]--,r=i.plus(s),r>e&&(o=r,s[u]--,r=i.plus(s))):r=o);return[r,s,o,a]}function Os(r,e,t,n){let[s,i,a,o]=Ts(r,e,t);const u=e-s,l=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);l.length===0&&(a<e&&(a=s.plus({[o]:1})),a!==s&&(i[o]=(i[o]||0)+u/(a-s)));const f=p.fromObject(i,n);return l.length>0?p.fromMillis(u,n).shiftTo(...l).plus(f):f}const Es="missing Intl.DateTimeFormat.formatToParts support";function w(r,e=t=>t){return{regex:r,deser:([t])=>e(dr(t))}}const On="[  ]",En=new RegExp(On,"g");function Ns(r){return r.replace(/\./g,"\\.?").replace(En,On)}function Nn(r){return r.replace(/\./g,"").replace(En," ").toLowerCase()}function R(r,e){return r===null?null:{regex:RegExp(r.map(Ns).join("|")),deser:([t])=>r.findIndex(n=>Nn(t)===Nn(n))+e}}function xn(r,e){return{regex:r,deser:([,t,n])=>ve(t,n),groups:e}}function Ve(r){return{regex:r,deser:([e])=>e}}function xs(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function bs(r,e){const t=C(e),n=C(e,"{2}"),s=C(e,"{3}"),i=C(e,"{4}"),a=C(e,"{6}"),o=C(e,"{1,2}"),u=C(e,"{1,3}"),l=C(e,"{1,6}"),f=C(e,"{1,9}"),h=C(e,"{2,4}"),k=C(e,"{4,6}"),m=D=>({regex:RegExp(xs(D.val)),deser:([ae])=>ae,literal:!0}),M=(D=>{if(r.literal)return m(D);switch(D.val){case"G":return R(e.eras("short"),0);case"GG":return R(e.eras("long"),0);case"y":return w(l);case"yy":return w(h,Qe);case"yyyy":return w(i);case"yyyyy":return w(k);case"yyyyyy":return w(a);case"M":return w(o);case"MM":return w(n);case"MMM":return R(e.months("short",!0),1);case"MMMM":return R(e.months("long",!0),1);case"L":return w(o);case"LL":return w(n);case"LLL":return R(e.months("short",!1),1);case"LLLL":return R(e.months("long",!1),1);case"d":return w(o);case"dd":return w(n);case"o":return w(u);case"ooo":return w(s);case"HH":return w(n);case"H":return w(o);case"hh":return w(n);case"h":return w(o);case"mm":return w(n);case"m":return w(o);case"q":return w(o);case"qq":return w(n);case"s":return w(o);case"ss":return w(n);case"S":return w(u);case"SSS":return w(s);case"u":return Ve(f);case"uu":return Ve(o);case"uuu":return w(t);case"a":return R(e.meridiems(),0);case"kkkk":return w(i);case"kk":return w(h,Qe);case"W":return w(o);case"WW":return w(n);case"E":case"c":return w(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 xn(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return xn(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return Ve(/[a-z_+-/]{1,256}?/i);case" ":return Ve(/[^\S\n\r]/);default:return m(D)}})(r)||{invalidReason:Es};return M.token=r,M}const Is={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 vs(r,e,t){const{type:n,value:s}=r;if(n==="literal"){const u=/^\s+$/.test(s);return{literal:!u,val:u?" ":s}}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=Is[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function Ms(r){return[`^${r.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,r]}function Ds(r,e,t){const n=r.match(e);if(n){const s={};let i=1;for(const a in t)if(H(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(n.slice(i,i+u))),i+=u}return[n,s]}else return[n,{}]}function Fs(r){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 g(r.z)||(t=$.create(r.z)),g(r.Z)||(t||(t=new I(r.Z)),n=r.Z),g(r.q)||(r.M=(r.q-1)*3+1),g(r.h)||(r.h<12&&r.a===1?r.h+=12:r.h===12&&r.a===0&&(r.h=0)),r.G===0&&r.y&&(r.y=-r.y),g(r.u)||(r.S=Ke(r.u)),[Object.keys(r).reduce((i,a)=>{const o=e(a);return o&&(i[o]=r[a]),i},{}),t,n]}let tt=null;function Vs(){return tt||(tt=y.fromMillis(1555555555555)),tt}function As(r,e){if(r.literal)return r;const t=b.macroTokenToFormatOpts(r.val),n=Mn(t,e);return n==null||n.includes(void 0)?r:n}function bn(r,e){return Array.prototype.concat(...r.map(t=>As(t,e)))}class In{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=bn(b.parseFormat(t),e),this.units=this.tokens.map(n=>bs(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,s]=Ms(this.units);this.regex=RegExp(n,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[t,n]=Ds(e,this.regex,this.handlers),[s,i,a]=n?Fs(n):[null,null,void 0];if(H(n,"a")&&H(n,"H"))throw new j("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:s,zone:i,specificOffset:a}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function vn(r,e,t){return new In(r,t).explainFromTokens(e)}function Ws(r,e,t){const{result:n,zone:s,specificOffset:i,invalidReason:a}=vn(r,e,t);return[n,s,i,a]}function Mn(r,e){if(!r)return null;const n=b.create(e,r).dtFormatter(Vs()),s=n.formatToParts(),i=n.resolvedOptions();return s.map(a=>vs(a,r,i))}const nt="Invalid DateTime",Cs=864e13;function me(r){return new L("unsupported zone",`the zone "${r.name}" is not supported`)}function rt(r){return r.weekData===null&&(r.weekData=Ne(r.c)),r.weekData}function st(r){return r.localWeekData===null&&(r.localWeekData=Ne(r.c,r.loc.getMinDaysInFirstWeek(),r.loc.getStartOfWeek())),r.localWeekData}function G(r,e){const t={ts:r.ts,zone:r.zone,c:r.c,o:r.o,loc:r.loc,invalid:r.invalid};return new y({...t,...e,old:t})}function Dn(r,e,t){let n=r-e*60*1e3;const s=t.offset(n);if(e===s)return[n,e];n-=(s-e)*60*1e3;const i=t.offset(n);return s===i?[n,s]:[r-Math.min(s,i)*60*1e3,Math.max(s,i)]}function Ae(r,e){r+=e*60*1e3;const t=new Date(r);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function We(r,e,t){return Dn(Ie(r),e,t)}function Fn(r,e){const t=r.o,n=r.c.year+Math.trunc(e.years),s=r.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...r.c,year:n,month:s,day:Math.min(r.c.day,be(n,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=p.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=Ie(i);let[u,l]=Dn(o,t,r.zone);return a!==0&&(u+=a,l=r.zone.offset(u)),{ts:u,o:l}}function ie(r,e,t,n,s,i){const{setZone:a,zone:o}=t;if(r&&Object.keys(r).length!==0||e){const u=e||o,l=y.fromObject(r,{...t,zone:u,specificOffset:i});return a?l:l.setZone(o)}else return y.invalid(new L("unparsable",`the input "${s}" can't be parsed as ${n}`))}function Ce(r,e,t=!0){return r.isValid?b.create(S.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(r,e):null}function it(r,e){const t=r.c.year>9999||r.c.year<0;let n="";return t&&r.c.year>=0&&(n+="+"),n+=N(r.c.year,t?6:4),e?(n+="-",n+=N(r.c.month),n+="-",n+=N(r.c.day)):(n+=N(r.c.month),n+=N(r.c.day)),n}function Vn(r,e,t,n,s,i){let a=N(r.c.hour);return e?(a+=":",a+=N(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!t)&&(a+=":")):a+=N(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!t)&&(a+=N(r.c.second),(r.c.millisecond!==0||!n)&&(a+=".",a+=N(r.c.millisecond,3))),s&&(r.isOffsetFixed&&r.offset===0&&!i?a+="Z":r.o<0?(a+="-",a+=N(Math.trunc(-r.o/60)),a+=":",a+=N(Math.trunc(-r.o%60))):(a+="+",a+=N(Math.trunc(r.o/60)),a+=":",a+=N(Math.trunc(r.o%60)))),i&&(a+="["+r.zone.ianaName+"]"),a}const An={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ls={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Rs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Wn=["year","month","day","hour","minute","second","millisecond"],$s=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Us=["year","ordinal","hour","minute","second","millisecond"];function Zs(r){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"}[r.toLowerCase()];if(!e)throw new lt(r);return e}function Cn(r){switch(r.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Zs(r)}}function qs(r){return Re[r]||(Le===void 0&&(Le=T.now()),Re[r]=r.offset(Le)),Re[r]}function Ln(r,e){const t=Z(e.zone,T.defaultZone);if(!t.isValid)return y.invalid(me(t));const n=S.fromObject(e);let s,i;if(g(r.year))s=T.now();else{for(const u of Wn)g(r[u])&&(r[u]=An[u]);const a=Gt(r)||jt(r);if(a)return y.invalid(a);const o=qs(t);[s,i]=We(r,o,t)}return new y({ts:s,zone:t,loc:n,o:i})}function Rn(r,e,t){const n=g(t.round)?!0:t.round,s=(a,o)=>(a=He(a,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(r,a)?0:e.startOf(a).diff(r.startOf(a),a).get(a):e.diff(r,a).get(a);if(t.unit)return s(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return s(o,a)}return s(r>e?-0:0,t.units[t.units.length-1])}function $n(r){let e={},t;return r.length>0&&typeof r[r.length-1]=="object"?(e=r[r.length-1],t=Array.from(r).slice(0,r.length-1)):t=Array.from(r),[e,t]}let Le,Re={};class y{constructor(e){const t=e.zone||T.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new L("invalid input"):null)||(t.isValid?null:me(t));this.ts=g(e.ts)?T.now():e.ts;let s=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,i]=[e.old.c,e.old.o];else{const o=q(e.o)&&!e.old?e.o:t.offset(this.ts);s=Ae(this.ts,o),n=Number.isNaN(s.year)?new L("invalid input"):null,s=n?null:s,i=n?null:o}this._zone=t,this.loc=e.loc||S.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=s,this.o=i,this.isLuxonDateTime=!0}static now(){return new y({})}static local(){const[e,t]=$n(arguments),[n,s,i,a,o,u,l]=t;return Ln({year:n,month:s,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=$n(arguments),[n,s,i,a,o,u,l]=t;return e.zone=I.utcInstance,Ln({year:n,month:s,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const n=pr(e)?e.valueOf():NaN;if(Number.isNaN(n))return y.invalid("invalid input");const s=Z(t.zone,T.defaultZone);return s.isValid?new y({ts:n,zone:s,loc:S.fromObject(t)}):y.invalid(me(s))}static fromMillis(e,t={}){if(q(e))return e<-864e13||e>Cs?y.invalid("Timestamp out of range"):new y({ts:e,zone:Z(t.zone,T.defaultZone),loc:S.fromObject(t)});throw new x(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(q(e))return new y({ts:e*1e3,zone:Z(t.zone,T.defaultZone),loc:S.fromObject(t)});throw new x("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=Z(t.zone,T.defaultZone);if(!n.isValid)return y.invalid(me(n));const s=S.fromObject(t),i=Me(e,Cn),{minDaysInFirstWeek:a,startOfWeek:o}=Bt(i,s),u=T.now(),l=g(t.specificOffset)?n.offset(u):t.specificOffset,f=!g(i.ordinal),h=!g(i.year),k=!g(i.month)||!g(i.day),m=h||k,E=i.weekYear||i.weekNumber;if((m||f)&&E)throw new j("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(k&&f)throw new j("Can't mix ordinal dates with month/day");const M=E||i.weekday&&!m;let D,ae,ge=Ae(u,l);M?(D=$s,ae=Ls,ge=Ne(ge,a,o)):f?(D=Us,ae=Rs,ge=Ge(ge)):(D=Wn,ae=An);let Un=!1;for(const we of D){const _s=i[we];g(_s)?Un?i[we]=ae[we]:i[we]=ge[we]:Un=!0}const js=M?mr(i,a,o):f?yr(i):Gt(i),Zn=js||jt(i);if(Zn)return y.invalid(Zn);const Ks=M?Yt(i,a,o):f?Jt(i):i,[Hs,Qs]=We(Ks,l,n),pe=new y({ts:Hs,zone:n,o:Qs,loc:s});return i.weekday&&m&&e.weekday!==pe.weekday?y.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${pe.toISO()}`):pe.isValid?pe:y.invalid(pe.invalid)}static fromISO(e,t={}){const[n,s]=as(e);return ie(n,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,s]=os(e);return ie(n,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,s]=us(e);return ie(n,s,t,"HTTP",t)}static fromFormat(e,t,n={}){if(g(e)||g(t))throw new x("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:i=null}=n,a=S.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0}),[o,u,l,f]=Ws(a,e,t);return f?y.invalid(f):ie(o,u,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return y.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,s]=ys(e);return ie(n,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new x("need to specify a reason the DateTime is invalid");const n=e instanceof L?e:new L(e,t);if(T.throwOnInvalid)throw new qn(n);return new y({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=Mn(e,S.fromObject(t));return n?n.map(s=>s?s.val:null).join(""):null}static expandFormat(e,t={}){return bn(b.parseFormat(e),S.fromObject(t)).map(s=>s.val).join("")}static resetCache(){Le=void 0,Re={}}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?rt(this).weekYear:NaN}get weekNumber(){return this.isValid?rt(this).weekNumber:NaN}get weekday(){return this.isValid?rt(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?st(this).weekday:NaN}get localWeekNumber(){return this.isValid?st(this).weekNumber:NaN}get localWeekYear(){return this.isValid?st(this).weekYear:NaN}get ordinal(){return this.isValid?Ge(this.c).ordinal:NaN}get monthShort(){return this.isValid?Fe.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Fe.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Fe.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Fe.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=Ie(this.c),s=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-s*t),o=this.zone.offset(n-i*t);if(a===o)return[this];const u=n-a*t,l=n-o*t,f=Ae(u,a),h=Ae(l,o);return f.hour===h.hour&&f.minute===h.minute&&f.second===h.second&&f.millisecond===h.millisecond?[G(this,{ts:u}),G(this,{ts:l})]:[this]}get isInLeapYear(){return le(this.year)}get daysInMonth(){return be(this.year,this.month)}get daysInYear(){return this.isValid?Q(this.year):NaN}get weeksInWeekYear(){return this.isValid?ce(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ce(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:s}=b.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(I.instance(e),t)}toLocal(){return this.setZone(T.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=Z(e,T.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||n){const i=e.offset(this.ts),a=this.toObject();[s]=We(a,i,e)}return G(this,{ts:s,zone:e})}else return y.invalid(me(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return G(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Me(e,Cn),{minDaysInFirstWeek:n,startOfWeek:s}=Bt(t,this.loc),i=!g(t.weekYear)||!g(t.weekNumber)||!g(t.weekday),a=!g(t.ordinal),o=!g(t.year),u=!g(t.month)||!g(t.day),l=o||u,f=t.weekYear||t.weekNumber;if((l||a)&&f)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=Yt({...Ne(this.c,n,s),...t},n,s):g(t.ordinal)?(h={...this.toObject(),...t},g(t.day)&&(h.day=Math.min(be(h.year,h.month),h.day))):h=Jt({...Ge(this.c),...t});const[k,m]=We(h,this.o,this.zone);return G(this,{ts:k,o:m})}plus(e){if(!this.isValid)return this;const t=p.fromDurationLike(e);return G(this,Fn(this,t))}minus(e){if(!this.isValid)return this;const t=p.fromDurationLike(e).negate();return G(this,Fn(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},s=p.normalizeUnit(e);switch(s){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(s==="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(s==="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?b.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):nt}toLocaleString(e=Se,t={}){return this.isValid?b.create(this.loc.clone(t),e).formatDateTime(this):nt}toLocaleParts(e={}){return this.isValid?b.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:s=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=e==="extended";let o=it(this,a);return o+="T",o+=Vn(this,a,t,n,s,i),o}toISODate({format:e="extended"}={}){return this.isValid?it(this,e==="extended"):null}toISOWeekDate(){return Ce(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:s=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(s?"T":"")+Vn(this,a==="extended",t,e,n,i):null}toRFC2822(){return Ce(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ce(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?it(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(n&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Ce(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():nt}[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 p.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=wr(t).map(p.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,u=a?e:this,l=Os(o,u,i,s);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(y.now(),e,t)}until(e){return this.isValid?O.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const s=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=s&&s<=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||y.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(s=e.unit,i=void 0),Rn(t,this.plus(n),{...e,numeric:"always",units:s,unit:i})}toRelativeCalendar(e={}){return this.isValid?Rn(e.base||y.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(y.isDateTime))throw new x("min requires all arguments be DateTimes");return Qt(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(y.isDateTime))throw new x("max requires all arguments be DateTimes");return Qt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:s=null,numberingSystem:i=null}=n,a=S.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0});return vn(a,e,t)}static fromStringExplain(e,t,n={}){return y.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:s=null}=t,i=S.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return new In(i,e)}static fromFormatParser(e,t,n={}){if(g(e)||g(t))throw new x("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:i=null}=n,a=S.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0});if(!a.equals(t.locale))throw new x(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`);const{result:o,zone:u,specificOffset:l,invalidReason:f}=t.explainFromTokens(e);return f?y.invalid(f):ie(o,u,n,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Se}static get DATE_MED(){return ct}static get DATE_MED_WITH_WEEKDAY(){return Yn}static get DATE_FULL(){return ft}static get DATE_HUGE(){return dt}static get TIME_SIMPLE(){return ht}static get TIME_WITH_SECONDS(){return mt}static get TIME_WITH_SHORT_OFFSET(){return yt}static get TIME_WITH_LONG_OFFSET(){return gt}static get TIME_24_SIMPLE(){return pt}static get TIME_24_WITH_SECONDS(){return wt}static get TIME_24_WITH_SHORT_OFFSET(){return St}static get TIME_24_WITH_LONG_OFFSET(){return kt}static get DATETIME_SHORT(){return Tt}static get DATETIME_SHORT_WITH_SECONDS(){return Ot}static get DATETIME_MED(){return Et}static get DATETIME_MED_WITH_SECONDS(){return Nt}static get DATETIME_MED_WITH_WEEKDAY(){return Jn}static get DATETIME_FULL(){return xt}static get DATETIME_FULL_WITH_SECONDS(){return bt}static get DATETIME_HUGE(){return It}static get DATETIME_HUGE_WITH_SECONDS(){return vt}}function ye(r){if(y.isDateTime(r))return r;if(r&&r.valueOf&&q(r.valueOf()))return y.fromJSDate(r);if(r&&typeof r=="object")return y.fromObject(r);throw new x(`Unknown datetime argument: ${r}, of type ${typeof r}`)}const zs=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Ps=[".mp4",".avi",".mov",".3gp",".wmv"],Ys=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Js=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],Bs=["relation","file","select"],Gs=["text","email","url","editor"];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 zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||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 mergeUnique(e,t){for(let n of t)d.pushUnique(e,n);return e}static findByKey(e,t,n){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==n)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const n={};for(let s in e)n[e[s][t]]=n[e[s][t]]||[],n[e[s][t]].push(e[s]);return n}static removeByKey(e,t,n){for(let s in e)if(e[s][t]==n){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,n="id"){for(let s=e.length-1;s>=0;s--)if(e[s][n]==t[n]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const n={};for(const s of e)n[s[t]]=s;return Object.values(n)}static filterRedactedProps(e,t="******"){const n=JSON.parse(JSON.stringify(e||{}));for(let s in n)typeof n[s]=="object"&&n[s]!==null?n[s]=d.filterRedactedProps(n[s],t):n[s]===t&&delete n[s];return n}static getNestedVal(e,t,n=null,s="."){let i=e||{},a=(t||"").split(s);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,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let i=e,a=t.split(s),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 s=e||{},i=(t||"").split(n),a=i.pop();for(const o of i)(!d.isObject(s)&&!Array.isArray(s)||!d.isObject(s[o])&&!Array.isArray(s[o]))&&(s[o]={}),s=s[o];Array.isArray(s)?s.splice(a,1):d.isObject(s)&&delete s[a],i.length>0&&(Array.isArray(s)&&!s.length||d.isObject(s)&&!Object.keys(s).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 s=0;s<e;s++)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 s="";for(let i=0;i<e;i++)s+=n.charAt(t[i]%n.length);return s}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 s=e[n];typeof s=="string"&&(s=d.truncate(s,150,!0)),t[n]=s}return t}static slugify(e,t="_",n=[".","=","-"]){if(e==="")return"";const s={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 s)e=e.replace(s[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=[],s=(e||"").replaceAll("\\"+t,"{_PB_ESCAPED_}").split(t).map(i=>i.replaceAll("{_PB_ESCAPED_}",t));for(let i of s)i=i.trim(),d.isEmpty(i)||n.push(i);return n}static joinNonEmpty(e,t=", "){e=e||[];const n=[],s=t.length>1?t.trim():t;for(let i of e)i=typeof i=="string"?i.trim():"",d.isEmpty(i)||n.push(i.replaceAll(s,"\\"+s));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 y.fromFormat(e,n,{zone:"UTC"})}return typeof e=="number"?y.fromMillis(e):y.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(typeof e=="object")try{e=JSON.stringify(e,null,2)}catch{}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"}),s=window.URL.createObjectURL(n);d.download(s,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||"",!!zs.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Ps.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Ys.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Js.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(s=>{let i=new FileReader;i.onload=function(a){let o=new Image;o.onload=function(){let u=document.createElement("canvas"),l=u.getContext("2d"),f=o.width,h=o.height;return u.width=t,u.height=n,l.drawImage(o,f>h?(f-h)/2:0,0,f>h?h:f,f>h?h:f,0,0,t,n),s(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 s of n)d.addValueToFormData(e,t,s);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){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},d.dummyCollectionSchemaData(e))}static dummyCollectionSchemaData(e,t=!1){var i;const n=(e==null?void 0:e.fields)||[],s={};for(const a of n){if(a.hidden||t&&a.primaryKey&&a.autogeneratePattern||t&&a.type==="autodate")continue;let o=null;if(a.type==="number")o=123;else if(a.type==="date"||a.type==="autodate")o="2022-01-01 10:00:00.123Z";else if(a.type=="bool")o=!0;else if(a.type=="email")o="test@example.com";else if(a.type=="url")o="https://example.com";else if(a.type=="json")o="JSON";else if(a.type=="file"){if(t)continue;o="filename.jpg",a.maxSelect!=1&&(o=[o])}else a.type=="select"?(o=(i=a==null?void 0:a.values)==null?void 0:i[0],(a==null?void 0:a.maxSelect)!=1&&(o=[o])):a.type=="relation"?(o="RELATION_RECORD_ID",(a==null?void 0:a.maxSelect)!=1&&(o=[o])):o="test";s[a.name]=o}return s}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){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"password":return"ri-lock-password-line";case"autodate":return"ri-calendar-check-line";case"geoPoint":return"ri-map-pin-2-line";default:return"ri-star-s-line"}}static getFieldValueType(e){switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){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)&&(e==null?void 0:e.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!=="fields"&&JSON.stringify(e[l])!==JSON.stringify(t[l]))return!0;const s=Array.isArray(e.fields)?e.fields:[],i=Array.isArray(t.fields)?t.fields:[],a=s.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(s,"id",l.id)),u=i.filter(l=>{const f=d.isObject(l)&&d.findByKey(s,"id",l.id);if(!f)return!1;for(let h in f)if(JSON.stringify(l[h])!=JSON.stringify(f[h]))return!0;return!1});return!!(o.length||u.length||n&&a.length)}static sortCollections(e=[]){const t=[],n=[],s=[];for(const a of e)a.type==="auth"?t.push(a):a.type==="base"?n.push(a):s.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),s.sort(i))}static getExpandPresentableRelFields(e,t,n=2){let s=[];const i=t.find(a=>a.id==e.collectionId);if(!i)return s;for(const a of i.fields){if(!a.presentable||a.type!="relation"||n<=0)continue;const o=d.getExpandPresentableRelFields(a,t,n-1);for(const u of o)s.push(e.name+"."+u)}return s.length||s.push(e.name),s}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(s){let i=s.parentNode;for(;s.firstChild;)i.insertBefore(s.firstChild,s);i.removeChild(s)}function n(s){if(s){for(const i of s.children)n(i);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,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:(s,i)=>{n(i.node)},file_picker_types:"image",file_picker_callback:(s,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],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const h="blobid"+new Date().getTime(),k=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],E=k.create(h,l,m);k.add(E),s(E.blobUri(),{title:l.name})}),f.readAsDataURL(l)}),o.click()},setup:s=>{s.on("keydown",a=>{(a.ctrlKey||a.metaKey)&&a.code=="KeyS"&&s.formElement&&(a.preventDefault(),a.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",a)))});const i="tinymce_last_direction";s.on("init",()=>{var o;const a=(o=window==null?void 0:window.localStorage)==null?void 0:o.getItem(i);!s.isDirty()&&s.getContent()==""&&a=="rtl"&&s.execCommand("mceDirectionRTL")}),s.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"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var u;(u=window==null?void 0:window.localStorage)==null||u.setItem(i,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:a=>{a([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,n="N/A"){e=e||{},t=t||[];let s=[];for(const a of t){let o=e[a];typeof o>"u"||(o=d.stringifyValue(o,n),s.push(o))}if(s.length>0)return s.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/),s=((a=n==null?void 0:n[1])==null?void 0:a.split(","))||[],i=[];for(let o of s){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.viewQuery))d.pushUnique(n,t+i);const s=e.fields||[];for(const i of s)i.type=="geoPoint"?(d.pushUnique(n,t+i.name+".lon"),d.pushUnique(n,t+i.name+".lat")):d.pushUnique(n,t+i.name);return n}static getCollectionAutocompleteKeys(e,t,n="",s=0){let i=e.find(o=>o.name==t||o.id==t);if(!i||s>=4)return[];i.fields=i.fields||[];let a=d.getAllCollectionIdentifiers(i,n);for(const o of i.fields){const u=n+o.name;if(o.type=="relation"&&o.collectionId){const l=d.getCollectionAutocompleteKeys(e,o.collectionId,u+".",s+1);l.length&&(a=a.concat(l))}o.maxSelect!=1&&Bs.includes(o.type)?(a.push(u+":each"),a.push(u+":length")):Gs.includes(o.type)&&a.push(u+":lower")}for(const o of e){o.fields=o.fields||[];for(const u of o.fields)if(u.type=="relation"&&u.collectionId==i.id){const l=n+o.name+"_via_"+u.name,f=d.getCollectionAutocompleteKeys(e,o.id,l+".",s+2);f.length&&(a=a.concat(f))}}return a}static getCollectionJoinAutocompleteKeys(e){const t=[];let n,s;for(const i of e)if(!i.system){n="@collection."+i.name+".",s=d.getCollectionAutocompleteKeys(e,i.name,n);for(const a of s)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.body."),n.push("@request.headers."),n.push("@request.auth.collectionId"),n.push("@request.auth.collectionName");const s=e.filter(i=>i.type==="auth");for(const i of s){if(i.system)continue;const a=d.getCollectionAutocompleteKeys(e,i.id,"@request.auth.");for(const o of a)d.pushUnique(n,o)}if(t){const i=d.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const a of i){n.push(a);const o=a.split(".");o.length===3&&o[2].indexOf(":")===-1&&n.push(a+":isset")}}return n}static parseIndex(e){var u,l,f,h,k;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/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((s==null?void 0:s.length)!=7)return t;const i=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((u=s[1])==null?void 0:u.trim().toLowerCase())==="unique",t.optional=!d.isEmpty((l=s[2])==null?void 0:l.trim());const a=(s[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=(s[4]||"").replace(i,"");const o=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of o){m=m.trim().replaceAll("{PB_TEMP}",",");const M=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((M==null?void 0:M.length)!=4)continue;const D=(h=(f=M[1])==null?void 0:f.trim())==null?void 0:h.replace(i,"");D&&t.columns.push({name:D,collate:M[2]||"",sort:((k=M[3])==null?void 0:k.toUpperCase())||""})}return t.where=s[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(10)}\` `,t+=`ON \`${e.tableName}\` (`;const n=e.columns.filter(s=>!!(s!=null&&s.name));return n.length>1&&(t+=`
`),t+=n.map(s=>{let i="";return s.name.includes("(")||s.name.includes(" ")?i+=s.name:i+="`"+s.name+"`",s.collate&&(i+=" COLLATE "+s.collate),s.sort&&(i+=" "+s.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 s=d.parseIndex(e);let i=!1;for(let a of s.columns)a.name===t&&(a.name=n,i=!0);return i?d.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const n=["=","!=","~","!~",">",">=","<","<="];for(const s of n)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return d.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},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 s=n.indexOf("?");s>-1&&(t=n.substring(s+1),n=n.substring(0,s));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 at=11e3;onmessage=r=>{var t,n;if(!r.data.collections)return;const e={};e.baseKeys=d.getCollectionAutocompleteKeys(r.data.collections,(t=r.data.baseCollection)==null?void 0:t.name),e.baseKeys=ut(e.baseKeys.sort(ot),at),r.data.disableRequestKeys||(e.requestKeys=d.getRequestAutocompleteKeys(r.data.collections,(n=r.data.baseCollection)==null?void 0:n.name),e.requestKeys=ut(e.requestKeys.sort(ot),at)),r.data.disableCollectionJoinKeys||(e.collectionJoinKeys=d.getCollectionJoinAutocompleteKeys(r.data.collections),e.collectionJoinKeys=ut(e.collectionJoinKeys.sort(ot),at)),postMessage(e)};function ot(r,e){return r.length-e.length}function ut(r,e){return r.length>e?r.slice(0,e):r}})();