@powerhousedao/connect 4.0.2 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/{AddDriveModal.p7BAcZI-.js → AddDriveModal.C2kSav8D.js} +2 -2
  2. package/dist/assets/{AddDriveModal.p7BAcZI-.js.map → AddDriveModal.C2kSav8D.js.map} +1 -1
  3. package/dist/assets/{CreateDocumentModal.Dqrz5hH6.js → CreateDocumentModal.C6cJyOce.js} +2 -2
  4. package/dist/assets/{CreateDocumentModal.Dqrz5hH6.js.map → CreateDocumentModal.C6cJyOce.js.map} +1 -1
  5. package/dist/assets/{DebugSettingsModal.bktV3R4o.js → DebugSettingsModal.BfgbCLT1.js} +2 -2
  6. package/dist/assets/{DebugSettingsModal.bktV3R4o.js.map → DebugSettingsModal.BfgbCLT1.js.map} +1 -1
  7. package/dist/assets/{SettingsModal.v6MDShEt.js → SettingsModal.sw3bc6AS.js} +2 -2
  8. package/dist/assets/{SettingsModal.v6MDShEt.js.map → SettingsModal.sw3bc6AS.js.map} +1 -1
  9. package/dist/assets/{app.DRjxvXgZ.js → app.LIiY9_Fz.js} +4 -4
  10. package/dist/assets/{app.DRjxvXgZ.js.map → app.LIiY9_Fz.js.map} +1 -1
  11. package/dist/assets/{atlas-import.D-1JNzDF.js → atlas-import.4dachugj.js} +2 -2
  12. package/dist/assets/{atlas-import.D-1JNzDF.js.map → atlas-import.4dachugj.js.map} +1 -1
  13. package/dist/assets/{connect.config.Bl522MZ-.js → connect.config.DiOix9wN.js} +2 -2
  14. package/dist/assets/{connect.config.Bl522MZ-.js.map → connect.config.DiOix9wN.js.map} +1 -1
  15. package/dist/assets/{content.B90LTx2R.js → content.CKwzH4A6.js} +2 -2
  16. package/dist/assets/{content.B90LTx2R.js.map → content.CKwzH4A6.js.map} +1 -1
  17. package/dist/assets/{cookie-banner.BflJ_-R7.js → cookie-banner.DZfUOcl5.js} +2 -2
  18. package/dist/assets/{cookie-banner.BflJ_-R7.js.map → cookie-banner.DZfUOcl5.js.map} +1 -1
  19. package/dist/assets/{home.LSDLsYfQ.js → home.RjAKOXsG.js} +2 -2
  20. package/dist/assets/{home.LSDLsYfQ.js.map → home.RjAKOXsG.js.map} +1 -1
  21. package/dist/assets/{index.BP4s3txd.js → index.Bzg5b2-l.js} +2 -2
  22. package/dist/assets/{index.BP4s3txd.js.map → index.Bzg5b2-l.js.map} +1 -1
  23. package/dist/assets/{index.CfvJlibT.js → index.C9_ibJMG.js} +2 -2
  24. package/dist/assets/{index.CfvJlibT.js.map → index.C9_ibJMG.js.map} +1 -1
  25. package/dist/assets/{index.DZIUQrDX.js → index.CCw1FVfF.js} +2 -2
  26. package/dist/assets/{index.DZIUQrDX.js.map → index.CCw1FVfF.js.map} +1 -1
  27. package/dist/assets/{index.DxMbBa4t.js → index.CXdyyvMp.js} +2 -2
  28. package/dist/assets/{index.DxMbBa4t.js.map → index.CXdyyvMp.js.map} +1 -1
  29. package/dist/assets/{index.CQq9NDhS.js → index.ZN-5ybqT.js} +2 -2
  30. package/dist/assets/{index.CQq9NDhS.js.map → index.ZN-5ybqT.js.map} +1 -1
  31. package/dist/assets/{index.CCVn0TYs.js → index.d9lnrxLT.js} +3 -3
  32. package/dist/assets/{index.CCVn0TYs.js.map → index.d9lnrxLT.js.map} +1 -1
  33. package/dist/assets/{main.B1bxjzO_.js → main.B3yLWoSv.js} +3 -3
  34. package/dist/assets/{main.B1bxjzO_.js.map → main.B3yLWoSv.js.map} +1 -1
  35. package/dist/assets/{modal.DkeAvbgE.js → modal.CfVDDyC4.js} +3 -3
  36. package/dist/assets/{modal.DkeAvbgE.js.map → modal.CfVDDyC4.js.map} +1 -1
  37. package/dist/assets/{modals.qPhvMVJi.js → modals.CF6srNVI.js} +2 -2
  38. package/dist/assets/{modals.qPhvMVJi.js.map → modals.CF6srNVI.js.map} +1 -1
  39. package/dist/assets/{registerServiceWorker.CVNX9BXR.js → registerServiceWorker.Eb207Eu9.js} +2 -2
  40. package/dist/assets/{registerServiceWorker.CVNX9BXR.js.map → registerServiceWorker.Eb207Eu9.js.map} +1 -1
  41. package/dist/assets/{root.DQyo35Dp.js → root.57GaakYu.js} +2 -2
  42. package/dist/assets/{root.DQyo35Dp.js.map → root.57GaakYu.js.map} +1 -1
  43. package/dist/assets/{useAcceptedCookies.0TM695Xt.js → useAcceptedCookies.Dhp4DVwx.js} +2 -2
  44. package/dist/assets/{useAcceptedCookies.0TM695Xt.js.map → useAcceptedCookies.Dhp4DVwx.js.map} +1 -1
  45. package/dist/assets/useConnectConfig.wQH58ec9.js +2 -0
  46. package/dist/assets/{useConnectConfig.DNp9tNlB.js.map → useConnectConfig.wQH58ec9.js.map} +1 -1
  47. package/dist/assets/{useDefaultDocumentModelEditor.Cdcz1e6Y.js → useDefaultDocumentModelEditor.q2XXU104.js} +2 -2
  48. package/dist/assets/{useDefaultDocumentModelEditor.Cdcz1e6Y.js.map → useDefaultDocumentModelEditor.q2XXU104.js.map} +1 -1
  49. package/dist/assets/{useDocumentDriveServer.DD-BlMNw.js → useDocumentDriveServer.D670OoQu.js} +2 -2
  50. package/dist/assets/{useDocumentDriveServer.DD-BlMNw.js.map → useDocumentDriveServer.D670OoQu.js.map} +1 -1
  51. package/dist/assets/{useFeatureFlags.Cfr2cv-9.js → useFeatureFlags.CXC9_-UZ.js} +2 -2
  52. package/dist/assets/{useFeatureFlags.Cfr2cv-9.js.map → useFeatureFlags.CXC9_-UZ.js.map} +1 -1
  53. package/dist/assets/{user.DV886TFh.js → user.VfmtjJcC.js} +4 -4
  54. package/dist/assets/{user.DV886TFh.js.map → user.VfmtjJcC.js.map} +1 -1
  55. package/dist/index.html +1 -1
  56. package/dist/vite-envs.sh +1 -1
  57. package/package.json +9 -9
  58. package/dist/assets/useConnectConfig.DNp9tNlB.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.DxMbBa4t.js","./user.DV886TFh.js","./connect.config.Bl522MZ-.js","./index.DFyMrewv.js","./browser.BkwNmV2Z.js","./index.CCVn0TYs.js","./app-skeleton.js","./index-B7k827uL.css","./index.DZIUQrDX.js","./useFeatureFlags.Cfr2cv-9.js","./useAcceptedCookies.0TM695Xt.js","./useConnectConfig.DNp9tNlB.js","./index.CAUjMUXb.js","./registerServiceWorker.CVNX9BXR.js","./index.CfvJlibT.js","./home.LSDLsYfQ.js","./modals.qPhvMVJi.js","./i18next.CqOP20KE.js","./useDocumentDriveServer.DD-BlMNw.js","./slug.C6xW_7Wm.js","./modal.DkeAvbgE.js","./content.B90LTx2R.js","./react-error-boundary.esm.BVdm9PKb.js","./useDefaultDocumentModelEditor.Cdcz1e6Y.js","./useTranslation.BpVv6XIW.js","./toast.EfwsdSRg.js","./root.DQyo35Dp.js","./atlas-import.D-1JNzDF.js"])))=>i.map(i=>d[i]);
2
- var oT=Object.defineProperty;var aT=(r,e,t)=>e in r?oT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>aT(r,typeof e!="symbol"?e+"":e,t);import{jsxs as Ht,jsx as Re,Fragment as TC}from"react/jsx-runtime";import{r as $e,e as zt,p as ve,g as uT,U as qC,f as lT,Q as cT,h as hT,i as fT,j as dT,k as AC,c as yn,l as pT,m as mT,I as gT,_ as ht,n as Ur,R as yT,b as Ef,a as bT,o as wT,q as vT,s as _T,W as CT,T as ET,t as ST}from"./index.DFyMrewv.js";import*as pe from"react";import Or,{useMemo as uf,useEffect as st,useState as vd,createContext as TT,useContext as qT,useRef as Sf,Suspense as Cr}from"react";import{c as Fe}from"./connect.config.Bl522MZ-.js";import{e as AT,u as OT}from"./user.DV886TFh.js";import{u as RT,a as NT,d as _d,r as OC}from"./useFeatureFlags.Cfr2cv-9.js";import{a as IT,u as xT,b as lf}from"./index.CCVn0TYs.js";import{u as RC}from"./useAcceptedCookies.0TM695Xt.js";import{u as $T}from"./useConnectConfig.DNp9tNlB.js";import*as PT from"react-dom";import{l as kT,D as LT,a as MT,R as DT,c as jT,b as FT,u as BT,E as UT,m as VT,d as NC,e as QT,f as WT,g as HT,h as zT}from"./index.CAUjMUXb.js";import{s as GT}from"./registerServiceWorker.CVNX9BXR.js";class IC{get prefix(){return""}push(e){}pop(){}popAndReturn(e){return e}async record(e,t){return await t()}recordSync(e,t){return t()}}var cn;(function(r){r[r.AnalyticsPath=0]="AnalyticsPath",r[r.AnalyticsPathSegment=1]="AnalyticsPathSegment",r[r.AnalyticsPeriod=2]="AnalyticsPeriod"})(cn||(cn={}));var Cd;(function(r){r[r.Year=0]="Year",r[r.Quarter=1]="Quarter",r[r.Month=2]="Month"})(Cd||(Cd={}));class it{constructor(e){de(this,"_segments");this._segments=e}get segments(){return this._segments}static fromString(e){const t=un(e,"/").map(n=>Qe.fromString(n));return new it(t)}static fromStringArray(e){return new it(e.map(t=>Qe.fromString(t)))}static fromArray(e){return new it(e)}static fromJSON(e){const t=e._v.split("/").map(n=>Qe.fromString(n));return new it(t)}toJSON(){return{_t:cn.AnalyticsPath,_v:this.toString()}}toString(e=""){return this._segments.map(t=>t.toString()).join("/")+e}firstSegment(){return this._segments.length>0?this._segments[0]:new Qe}reduce(){const e=this._segments.slice(1);return e.length<1&&e.push(new Qe),new it(e)}applyLod(e){const t=[...this._segments];for(;t.length<e;)t.push(new Qe);return new it(t.slice(0,e))}}class Qe{constructor(e=null,t=[]){de(this,"_filters",null);de(this,"_groups",null);this._filters=e,this._groups=t}get filters(){return this._filters}get groups(){return this._groups}static fromString(e){const t=un(e,":");let n;t[0]==="*"?n=null:n=un(t[0],",").map(a=>Qe.unescape(a));let i;return t[1]===void 0||t[1].length<1?i=[]:t[1]==="*"?i=null:i=un(t[1],",").map(a=>Qe.unescape(a)),new Qe(n,i)}static escape(e){return e.replace(/(\\|:|\/|,)/gi,"\\$1")}static unescape(e){return e.replace(/\\(.)/gi,"$1")}toJSON(){return{_t:cn.AnalyticsPathSegment,_v:this.toString()}}toString(){let e="";return this._filters===null?e+="*":e+=this._filters.map(t=>Qe.escape(t)).join(","),this._groups===null?e+=":*":this._groups.length>0&&(e+=":"+this._groups.map(t=>Qe.escape(t)).join(",")),e}}const JT={":":new RegExp("(?<!\\\\):"),",":new RegExp("(?<!\\\\),"),"/":new RegExp("(?<!\\\\)\\/")};function un(r,e){let t="@@";for(;r.indexOf(t)>-1;)t+="@";return r.replaceAll("\\\\",t).split(JT[e]).map(n=>n.replaceAll(t,"\\\\"))}var Ed;(function(r){r[r.Budget=0]="Budget",r[r.Forecast=1]="Forecast",r[r.Actuals=2]="Actuals",r[r.PaymentsOnChain=3]="PaymentsOnChain",r[r.PaymentsOffChainIncluded=4]="PaymentsOffChainIncluded",r[r.FTEs=5]="FTEs"})(Ed||(Ed={}));var je;(function(r){r[r.VectorAdd=0]="VectorAdd",r[r.VectorSubtract=1]="VectorSubtract",r[r.ScalarMultiply=2]="ScalarMultiply",r[r.ScalarDivide=3]="ScalarDivide"})(je||(je={}));var nt;(function(r){r[r.Total=0]="Total",r[r.Annual=1]="Annual",r[r.SemiAnnual=2]="SemiAnnual",r[r.Quarterly=3]="Quarterly",r[r.Monthly=4]="Monthly",r[r.Weekly=5]="Weekly",r[r.Daily=6]="Daily",r[r.Hourly=7]="Hourly"})(nt||(nt={}));class At extends Error{}class KT extends At{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class YT extends At{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ZT extends At{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Gt extends At{}class xC extends At{constructor(e){super(`Invalid unit ${e}`)}}class Le extends At{}class gt extends At{constructor(){super("Zone is an abstract class")}}const ie="numeric",et="short",Be="long",hn={year:ie,month:ie,day:ie},$C={year:ie,month:et,day:ie},XT={year:ie,month:et,day:ie,weekday:et},PC={year:ie,month:Be,day:ie},kC={year:ie,month:Be,day:ie,weekday:Be},LC={hour:ie,minute:ie},MC={hour:ie,minute:ie,second:ie},DC={hour:ie,minute:ie,second:ie,timeZoneName:et},jC={hour:ie,minute:ie,second:ie,timeZoneName:Be},FC={hour:ie,minute:ie,hourCycle:"h23"},BC={hour:ie,minute:ie,second:ie,hourCycle:"h23"},UC={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:et},VC={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:Be},QC={year:ie,month:ie,day:ie,hour:ie,minute:ie},WC={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},HC={year:ie,month:et,day:ie,hour:ie,minute:ie},zC={year:ie,month:et,day:ie,hour:ie,minute:ie,second:ie},eq={year:ie,month:et,day:ie,weekday:et,hour:ie,minute:ie},GC={year:ie,month:Be,day:ie,hour:ie,minute:ie,timeZoneName:et},JC={year:ie,month:Be,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:et},KC={year:ie,month:Be,day:ie,weekday:Be,hour:ie,minute:ie,timeZoneName:Be},YC={year:ie,month:Be,day:ie,weekday:Be,hour:ie,minute:ie,second:ie,timeZoneName:Be};class Rr{get type(){throw new gt}get name(){throw new gt}get ianaName(){return this.name}get isUniversal(){throw new gt}offsetName(e,t){throw new gt}formatOffset(e,t){throw new gt}offset(e){throw new gt}equals(e){throw new gt}get isValid(){throw new gt}}let Yn=null;class bn extends Rr{static get instance(){return Yn===null&&(Yn=new bn),Yn}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return uE(e,t,n)}formatOffset(e,t){return qr(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const cf=new Map;function tq(r){let e=cf.get(r);return e===void 0&&(e=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"}),cf.set(r,e)),e}const rq={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function nq(r,e){const t=r.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,i,a,o,s,l,u,h]=n;return[o,i,a,s,l,u,h]}function iq(r,e){const t=r.formatToParts(e),n=[];for(let i=0;i<t.length;i++){const{type:a,value:o}=t[i],s=rq[a];a==="era"?n[s]=o:ce(s)||(n[s]=parseInt(o,10))}return n}const Zn=new Map;class ft extends Rr{static create(e){let t=Zn.get(e);return t===void 0&&Zn.set(e,t=new ft(e)),t}static resetCache(){Zn.clear(),cf.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=ft.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return uE(e,t,n,this.name)}formatOffset(e,t){return qr(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const n=tq(this.name);let[i,a,o,s,l,u,h]=n.formatToParts?iq(n,t):nq(n,t);s==="BC"&&(i=-Math.abs(i)+1);const f=vn({year:i,month:a,day:o,hour:l===24?0:l,minute:u,second:h,millisecond:0});let d=+t;const w=d%1e3;return d-=w>=0?w:1e3+w,(f-d)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Sd={};function sq(r,e={}){const t=JSON.stringify([r,e]);let n=Sd[t];return n||(n=new Intl.ListFormat(r,e),Sd[t]=n),n}const hf=new Map;function ff(r,e={}){const t=JSON.stringify([r,e]);let n=hf.get(t);return n===void 0&&(n=new Intl.DateTimeFormat(r,e),hf.set(t,n)),n}const df=new Map;function oq(r,e={}){const t=JSON.stringify([r,e]);let n=df.get(t);return n===void 0&&(n=new Intl.NumberFormat(r,e),df.set(t,n)),n}const pf=new Map;function aq(r,e={}){const{base:t,...n}=e,i=JSON.stringify([r,n]);let a=pf.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(r,e),pf.set(i,a)),a}let Er=null;function uq(){return Er||(Er=new Intl.DateTimeFormat().resolvedOptions().locale,Er)}const mf=new Map;function ZC(r){let e=mf.get(r);return e===void 0&&(e=new Intl.DateTimeFormat(r).resolvedOptions(),mf.set(r,e)),e}const gf=new Map;function lq(r){let e=gf.get(r);if(!e){const t=new Intl.Locale(r);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...XC,...e}),gf.set(r,e)}return e}function cq(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,i;try{n=ff(r).resolvedOptions(),i=r}catch{const l=r.substring(0,t);n=ff(l).resolvedOptions(),i=l}const{numberingSystem:a,calendar:o}=n;return[i,a,o]}}function hq(r,e,t){return(t||e)&&(r.includes("-u-")||(r+="-u"),t&&(r+=`-ca-${t}`),e&&(r+=`-nu-${e}`)),r}function fq(r){const e=[];for(let t=1;t<=12;t++){const n=ue.utc(2009,t,1);e.push(r(n))}return e}function dq(r){const e=[];for(let t=1;t<=7;t++){const n=ue.utc(2016,11,13+t);e.push(r(n))}return e}function Vr(r,e,t,n){const i=r.listingMode();return i==="error"?null:i==="en"?t(e):n(e)}function pq(r){return r.numberingSystem&&r.numberingSystem!=="latn"?!1:r.numberingSystem==="latn"||!r.locale||r.locale.startsWith("en")||ZC(r.locale).numberingSystem==="latn"}class mq{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:i,floor:a,...o}=n;if(!t||Object.keys(o).length>0){const s={useGrouping:!1,...n};n.padTo>0&&(s.minimumIntegerDigits=n.padTo),this.inf=oq(e,s)}}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):Rf(e,3);return xe(t,this.padTo)}}}class gq{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ft.create(s).valid?(i=s,this.dt=e):(i="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,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=ff(t,a)}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 yq{constructor(e,t,n){this.opts={style:"long",...n},!t&&oE()&&(this.rtf=aq(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):jq(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const XC={firstDay:1,minimalDays:4,weekend:[6,7]};class _e{static fromOpts(e){return _e.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,i,a=!1){const o=e||Ne.defaultLocale,s=o||(a?"en-US":uq()),l=t||Ne.defaultNumberingSystem,u=n||Ne.defaultOutputCalendar,h=bf(i)||Ne.defaultWeekSettings;return new _e(s,l,u,h,o)}static resetCache(){Er=null,hf.clear(),df.clear(),pf.clear(),mf.clear(),gf.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:i}={}){return _e.create(e,t,n,i)}constructor(e,t,n,i,a){const[o,s,l]=cq(e);this.locale=o,this.numberingSystem=t||s||null,this.outputCalendar=n||l||null,this.weekSettings=i,this.intl=hq(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=pq(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:_e.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,bf(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 Vr(this,e,hE,()=>{const n=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=fq(a=>this.extract(a,n,"month"))),this.monthsCache[i][e]})}weekdays(e,t=!1){return Vr(this,e,pE,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=dq(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Vr(this,void 0,()=>mE,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ue.utc(2016,11,13,9),ue.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Vr(this,e,gE,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[ue.utc(-40,1,1),ue.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const i=this.dtFormatter(e,t),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===n);return o?o.value:null}numberFormatter(e={}){return new mq(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new gq(e,this.intl,t)}relFormatter(e={}){return new yq(this.intl,this.isEnglish(),e)}listFormatter(e={}){return sq(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ZC(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:aE()?lq(this.locale):XC}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 Xn=null;class De extends Rr{static get utcInstance(){return Xn===null&&(Xn=new De(0)),Xn}static instance(e){return e===0?De.utcInstance:new De(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new De(_n(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${qr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${qr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return qr(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 bq extends Rr{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 wt(r,e){if(ce(r)||r===null)return e;if(r instanceof Rr)return r;if(Sq(r)){const t=r.toLowerCase();return t==="default"?e:t==="local"||t==="system"?bn.instance:t==="utc"||t==="gmt"?De.utcInstance:De.parseSpecifier(t)||ft.create(r)}else return vt(r)?De.instance(r):typeof r=="object"&&"offset"in r&&typeof r.offset=="function"?r:new bq(r)}const Tf={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Td={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]},wq=Tf.hanidec.replace(/[\[|\]]/g,"").split("");function vq(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(Tf.hanidec)!==-1)e+=wq.indexOf(r[t]);else for(const i in Td){const[a,o]=Td[i];n>=a&&n<=o&&(e+=n-a)}}return parseInt(e,10)}else return e}const yf=new Map;function _q(){yf.clear()}function Ke({numberingSystem:r},e=""){const t=r||"latn";let n=yf.get(t);n===void 0&&(n=new Map,yf.set(t,n));let i=n.get(e);return i===void 0&&(i=new RegExp(`${Tf[t]}${e}`),n.set(e,i)),i}let qd=()=>Date.now(),Ad="system",Od=null,Rd=null,Nd=null,Id=60,xd,$d=null;class Ne{static get now(){return qd}static set now(e){qd=e}static set defaultZone(e){Ad=e}static get defaultZone(){return wt(Ad,bn.instance)}static get defaultLocale(){return Od}static set defaultLocale(e){Od=e}static get defaultNumberingSystem(){return Rd}static set defaultNumberingSystem(e){Rd=e}static get defaultOutputCalendar(){return Nd}static set defaultOutputCalendar(e){Nd=e}static get defaultWeekSettings(){return $d}static set defaultWeekSettings(e){$d=bf(e)}static get twoDigitCutoffYear(){return Id}static set twoDigitCutoffYear(e){Id=e%100}static get throwOnInvalid(){return xd}static set throwOnInvalid(e){xd=e}static resetCaches(){_e.resetCache(),ft.resetCache(),ue.resetCache(),_q()}}class Xe{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const eE=[0,31,59,90,120,151,181,212,243,273,304,334],tE=[0,31,60,91,121,152,182,213,244,274,305,335];function We(r,e){return new Xe("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${r}, which is invalid`)}function qf(r,e,t){const n=new Date(Date.UTC(r,e-1,t));r<100&&r>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const i=n.getUTCDay();return i===0?7:i}function rE(r,e,t){return t+(Nr(r)?tE:eE)[e-1]}function nE(r,e){const t=Nr(r)?tE:eE,n=t.findIndex(a=>a<e),i=e-t[n];return{month:n+1,day:i}}function Af(r,e){return(r-e+7)%7+1}function fn(r,e=4,t=1){const{year:n,month:i,day:a}=r,o=rE(n,i,a),s=Af(qf(n,i,a),t);let l=Math.floor((o-s+14-e)/7),u;return l<1?(u=n-1,l=Ar(u,e,t)):l>Ar(n,e,t)?(u=n+1,l=1):u=n,{weekYear:u,weekNumber:l,weekday:s,...Cn(r)}}function Pd(r,e=4,t=1){const{weekYear:n,weekNumber:i,weekday:a}=r,o=Af(qf(n,1,e),t),s=Jt(n);let l=i*7+a-o-7+e,u;l<1?(u=n-1,l+=Jt(u)):l>s?(u=n+1,l-=Jt(n)):u=n;const{month:h,day:c}=nE(u,l);return{year:u,month:h,day:c,...Cn(r)}}function ei(r){const{year:e,month:t,day:n}=r,i=rE(e,t,n);return{year:e,ordinal:i,...Cn(r)}}function kd(r){const{year:e,ordinal:t}=r,{month:n,day:i}=nE(e,t);return{year:e,month:n,day:i,...Cn(r)}}function Ld(r,e){if(!ce(r.localWeekday)||!ce(r.localWeekNumber)||!ce(r.localWeekYear)){if(!ce(r.weekday)||!ce(r.weekNumber)||!ce(r.weekYear))throw new Gt("Cannot mix locale-based week fields with ISO-based week fields");return ce(r.localWeekday)||(r.weekday=r.localWeekday),ce(r.localWeekNumber)||(r.weekNumber=r.localWeekNumber),ce(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 Cq(r,e=4,t=1){const n=wn(r.weekYear),i=He(r.weekNumber,1,Ar(r.weekYear,e,t)),a=He(r.weekday,1,7);return n?i?a?!1:We("weekday",r.weekday):We("week",r.weekNumber):We("weekYear",r.weekYear)}function Eq(r){const e=wn(r.year),t=He(r.ordinal,1,Jt(r.year));return e?t?!1:We("ordinal",r.ordinal):We("year",r.year)}function iE(r){const e=wn(r.year),t=He(r.month,1,12),n=He(r.day,1,dn(r.year,r.month));return e?t?n?!1:We("day",r.day):We("month",r.month):We("year",r.year)}function sE(r){const{hour:e,minute:t,second:n,millisecond:i}=r,a=He(e,0,23)||e===24&&t===0&&n===0&&i===0,o=He(t,0,59),s=He(n,0,59),l=He(i,0,999);return a?o?s?l?!1:We("millisecond",i):We("second",n):We("minute",t):We("hour",e)}function ce(r){return typeof r>"u"}function vt(r){return typeof r=="number"}function wn(r){return typeof r=="number"&&r%1===0}function Sq(r){return typeof r=="string"}function Tq(r){return Object.prototype.toString.call(r)==="[object Date]"}function oE(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function aE(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function qq(r){return Array.isArray(r)?r:[r]}function Md(r,e,t){if(r.length!==0)return r.reduce((n,i)=>{const a=[e(i),i];return n&&t(n[0],a[0])===n[0]?n:a},null)[1]}function Aq(r,e){return e.reduce((t,n)=>(t[n]=r[n],t),{})}function Yt(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function bf(r){if(r==null)return null;if(typeof r!="object")throw new Le("Week settings must be an object");if(!He(r.firstDay,1,7)||!He(r.minimalDays,1,7)||!Array.isArray(r.weekend)||r.weekend.some(e=>!He(e,1,7)))throw new Le("Invalid week settings");return{firstDay:r.firstDay,minimalDays:r.minimalDays,weekend:Array.from(r.weekend)}}function He(r,e,t){return wn(r)&&r>=e&&r<=t}function Oq(r,e){return r-e*Math.floor(r/e)}function xe(r,e=2){const t=r<0;let n;return t?n="-"+(""+-r).padStart(e,"0"):n=(""+r).padStart(e,"0"),n}function bt(r){if(!(ce(r)||r===null||r===""))return parseInt(r,10)}function Et(r){if(!(ce(r)||r===null||r===""))return parseFloat(r)}function Of(r){if(!(ce(r)||r===null||r==="")){const e=parseFloat("0."+r)*1e3;return Math.floor(e)}}function Rf(r,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(r*n)/n}function Nr(r){return r%4===0&&(r%100!==0||r%400===0)}function Jt(r){return Nr(r)?366:365}function dn(r,e){const t=Oq(e-1,12)+1,n=r+(e-t)/12;return t===2?Nr(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function vn(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 Dd(r,e,t){return-Af(qf(r,1,e),t)+e-1}function Ar(r,e=4,t=1){const n=Dd(r,e,t),i=Dd(r+1,e,t);return(Jt(r)-n+i)/7}function wf(r){return r>99?r:r>Ne.twoDigitCutoffYear?1900+r:2e3+r}function uE(r,e,t,n=null){const i=new Date(r),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const o={timeZoneName:e,...a},s=new Intl.DateTimeFormat(t,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function _n(r,e){let t=parseInt(r,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,i=t<0||Object.is(t,-0)?-n:n;return t*60+i}function lE(r){const e=Number(r);if(typeof r=="boolean"||r===""||Number.isNaN(e))throw new Le(`Invalid unit value ${r}`);return e}function pn(r,e){const t={};for(const n in r)if(Yt(r,n)){const i=r[n];if(i==null)continue;t[e(n)]=lE(i)}return t}function qr(r,e){const t=Math.trunc(Math.abs(r/60)),n=Math.trunc(Math.abs(r%60)),i=r>=0?"+":"-";switch(e){case"short":return`${i}${xe(t,2)}:${xe(n,2)}`;case"narrow":return`${i}${t}${n>0?`:${n}`:""}`;case"techie":return`${i}${xe(t,2)}${xe(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Cn(r){return Aq(r,["hour","minute","second","millisecond"])}const Rq=["January","February","March","April","May","June","July","August","September","October","November","December"],cE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Nq=["J","F","M","A","M","J","J","A","S","O","N","D"];function hE(r){switch(r){case"narrow":return[...Nq];case"short":return[...cE];case"long":return[...Rq];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 fE=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],dE=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Iq=["M","T","W","T","F","S","S"];function pE(r){switch(r){case"narrow":return[...Iq];case"short":return[...dE];case"long":return[...fE];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const mE=["AM","PM"],xq=["Before Christ","Anno Domini"],$q=["BC","AD"],Pq=["B","A"];function gE(r){switch(r){case"narrow":return[...Pq];case"short":return[...$q];case"long":return[...xq];default:return null}}function kq(r){return mE[r.hour<12?0:1]}function Lq(r,e){return pE(e)[r.weekday-1]}function Mq(r,e){return hE(e)[r.month-1]}function Dq(r,e){return gE(e)[r.year<0?0:1]}function jq(r,e,t="always",n=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(r)===-1;if(t==="auto"&&a){const c=r==="days";switch(e){case 1:return c?"tomorrow":`next ${i[r][0]}`;case-1:return c?"yesterday":`last ${i[r][0]}`;case 0:return c?"today":`this ${i[r][0]}`}}const o=Object.is(e,-0)||e<0,s=Math.abs(e),l=s===1,u=i[r],h=n?l?u[1]:u[2]||u[1]:l?i[r][0]:r;return o?`${s} ${h} ago`:`in ${s} ${h}`}function jd(r,e){let t="";for(const n of r)n.literal?t+=n.val:t+=e(n.val);return t}const Fq={D:hn,DD:$C,DDD:PC,DDDD:kC,t:LC,tt:MC,ttt:DC,tttt:jC,T:FC,TT:BC,TTT:UC,TTTT:VC,f:QC,ff:HC,fff:GC,ffff:KC,F:WC,FF:zC,FFF:JC,FFFF:YC};class Me{static create(e,t={}){return new Me(e,t)}static parseFormat(e){let t=null,n="",i=!1;const a=[];for(let o=0;o<e.length;o++){const s=e.charAt(o);s==="'"?(n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),t=null,n="",i=!i):i||s===t?n+=s:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(e){return Fq[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 xe(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",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(d,w)=>this.loc.extract(e,d,w),o=d=>e.isOffsetFixed&&e.offset===0&&d.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,d.format):"",s=()=>n?kq(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,w)=>n?Mq(e,d):a(w?{month:d}:{month:d,day:"numeric"},"month"),u=(d,w)=>n?Lq(e,d):a(w?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),h=d=>{const w=Me.macroTokenToFormatOpts(d);return w?this.formatWithSystemDefault(e,w):d},c=d=>n?Dq(e,d):a({era:d},"era"),f=d=>{switch(d){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({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 s();case"d":return i?a({day:"numeric"},"day"):this.num(e.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(e.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(e.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("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 h(d)}};return jd(Me.parseFormat(t),f)}formatDurationFromString(e,t){const n=l=>{switch(l[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}},i=l=>u=>{const h=n(u);return h?this.num(l.get(h),u.length):u},a=Me.parseFormat(t),o=a.reduce((l,{literal:u,val:h})=>u?l:l.concat(h),[]),s=e.shiftTo(...o.map(n).filter(l=>l));return jd(a,i(s))}}const yE=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function tr(...r){const e=r.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function rr(...r){return e=>r.reduce(([t,n,i],a)=>{const[o,s,l]=a(e,i);return[{...t,...o},s||n,l]},[{},null,1]).slice(0,2)}function nr(r,...e){if(r==null)return[null,null];for(const[t,n]of e){const i=t.exec(r);if(i)return n(i)}return[null,null]}function bE(...r){return(e,t)=>{const n={};let i;for(i=0;i<r.length;i++)n[r[i]]=bt(e[t+i]);return[n,null,t+i]}}const wE=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Bq=`(?:${wE.source}?(?:\\[(${yE.source})\\])?)?`,Nf=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,vE=RegExp(`${Nf.source}${Bq}`),If=RegExp(`(?:T${vE.source})?`),Uq=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Vq=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Qq=/(\d{4})-?(\d{3})/,Wq=bE("weekYear","weekNumber","weekDay"),Hq=bE("year","ordinal"),zq=/(\d{4})-(\d\d)-(\d\d)/,_E=RegExp(`${Nf.source} ?(?:${wE.source}|(${yE.source}))?`),Gq=RegExp(`(?: ${_E.source})?`);function Kt(r,e,t){const n=r[e];return ce(n)?t:bt(n)}function Jq(r,e){return[{year:Kt(r,e),month:Kt(r,e+1,1),day:Kt(r,e+2,1)},null,e+3]}function ir(r,e){return[{hours:Kt(r,e,0),minutes:Kt(r,e+1,0),seconds:Kt(r,e+2,0),milliseconds:Of(r[e+3])},null,e+4]}function Ir(r,e){const t=!r[e]&&!r[e+1],n=_n(r[e+1],r[e+2]),i=t?null:De.instance(n);return[{},i,e+3]}function xr(r,e){const t=r[e]?ft.create(r[e]):null;return[{},t,e+1]}const Kq=RegExp(`^T?${Nf.source}$`),Yq=/^-?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 Zq(r){const[e,t,n,i,a,o,s,l,u]=r,h=e[0]==="-",c=l&&l[0]==="-",f=(d,w=!1)=>d!==void 0&&(w||d&&h)?-d:d;return[{years:f(Et(t)),months:f(Et(n)),weeks:f(Et(i)),days:f(Et(a)),hours:f(Et(o)),minutes:f(Et(s)),seconds:f(Et(l),l==="-0"),milliseconds:f(Of(u),c)}]}const Xq={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 xf(r,e,t,n,i,a,o){const s={year:e.length===2?wf(bt(e)):bt(e),month:cE.indexOf(t)+1,day:bt(n),hour:bt(i),minute:bt(a)};return o&&(s.second=bt(o)),r&&(s.weekday=r.length>3?fE.indexOf(r)+1:dE.indexOf(r)+1),s}const eA=/^(?:(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 tA(r){const[,e,t,n,i,a,o,s,l,u,h,c]=r,f=xf(e,i,n,t,a,o,s);let d;return l?d=Xq[l]:u?d=0:d=_n(h,c),[f,new De(d)]}function rA(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const nA=/^(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$/,iA=/^(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$/,sA=/^(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 Fd(r){const[,e,t,n,i,a,o,s]=r;return[xf(e,i,n,t,a,o,s),De.utcInstance]}function oA(r){const[,e,t,n,i,a,o,s]=r;return[xf(e,s,t,n,i,a,o),De.utcInstance]}const aA=tr(Uq,If),uA=tr(Vq,If),lA=tr(Qq,If),cA=tr(vE),CE=rr(Jq,ir,Ir,xr),hA=rr(Wq,ir,Ir,xr),fA=rr(Hq,ir,Ir,xr),dA=rr(ir,Ir,xr);function pA(r){return nr(r,[aA,CE],[uA,hA],[lA,fA],[cA,dA])}function mA(r){return nr(rA(r),[eA,tA])}function gA(r){return nr(r,[nA,Fd],[iA,Fd],[sA,oA])}function yA(r){return nr(r,[Yq,Zq])}const bA=rr(ir);function wA(r){return nr(r,[Kq,bA])}const vA=tr(zq,Gq),_A=tr(_E),CA=rr(ir,Ir,xr);function EA(r){return nr(r,[vA,CE],[_A,CA])}const Bd="Invalid Duration",EE={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}},SA={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},...EE},Ve=146097/400,Ut=146097/4800,TA={years:{quarters:4,months:12,weeks:Ve/7,days:Ve,hours:Ve*24,minutes:Ve*24*60,seconds:Ve*24*60*60,milliseconds:Ve*24*60*60*1e3},quarters:{months:3,weeks:Ve/28,days:Ve/4,hours:Ve*24/4,minutes:Ve*24*60/4,seconds:Ve*24*60*60/4,milliseconds:Ve*24*60*60*1e3/4},months:{weeks:Ut/7,days:Ut,hours:Ut*24,minutes:Ut*24*60,seconds:Ut*24*60*60,milliseconds:Ut*24*60*60*1e3},...EE},Tt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],qA=Tt.slice(0).reverse();function yt(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 ye(n)}function SE(r,e){let t=e.milliseconds??0;for(const n of qA.slice(1))e[n]&&(t+=e[n]*r[n].milliseconds);return t}function Ud(r,e){const t=SE(r,e)<0?-1:1;Tt.reduceRight((n,i)=>{if(ce(e[i]))return n;if(n){const a=e[n]*t,o=r[i][n],s=Math.floor(a/o);e[i]+=s*t,e[n]-=s*o*t}return i},null),Tt.reduce((n,i)=>{if(ce(e[i]))return n;if(n){const a=e[n]%1;e[n]-=a,e[i]+=a*r[n][i]}return i},null)}function AA(r){const e={};for(const[t,n]of Object.entries(r))n!==0&&(e[t]=n);return e}class ye{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?TA:SA;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||_e.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return ye.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Le(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ye({values:pn(e,ye.normalizeUnit),loc:_e.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(vt(e))return ye.fromMillis(e);if(ye.isDuration(e))return e;if(typeof e=="object")return ye.fromObject(e);throw new Le(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=yA(e);return n?ye.fromObject(n,t):ye.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=wA(e);return n?ye.fromObject(n,t):ye.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Le("need to specify a reason the Duration is invalid");const n=e instanceof Xe?e:new Xe(e,t);if(Ne.throwOnInvalid)throw new ZT(n);return new ye({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 xC(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?Me.create(this.loc,n).formatDurationFromString(this,e):Bd}toHuman(e={}){if(!this.isValid)return Bd;const t=Tt.map(n=>{const i=this.values[n];return ce(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(i)}).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+=Rf(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},ue.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?SE(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ye.fromDurationLike(e),n={};for(const i of Tt)(Yt(t.values,i)||Yt(this.values,i))&&(n[i]=t.get(i)+this.get(i));return yt(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=ye.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]=lE(e(this.values[n],n));return yt(this,{values:t},!0)}get(e){return this[ye.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...pn(e,ye.normalizeUnit)};return yt(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:i}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:i,conversionAccuracy:n};return yt(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ud(this.matrix,e),yt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=AA(this.normalize().shiftToAll().toObject());return yt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ye.normalizeUnit(o));const t={},n={},i=this.toObject();let a;for(const o of Tt)if(e.indexOf(o)>=0){a=o;let s=0;for(const u in n)s+=this.matrix[u][o]*n[u],n[u]=0;vt(i[o])&&(s+=i[o]);const l=Math.trunc(s);t[o]=l,n[o]=(s*1e3-l*1e3)/1e3}else vt(i[o])&&(n[o]=i[o]);for(const o in n)n[o]!==0&&(t[a]+=o===a?n[o]:n[o]/this.matrix[a][o]);return Ud(this.matrix,t),yt(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 yt(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,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(const n of Tt)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Vt="Invalid Interval";function OA(r,e){return!r||!r.isValid?Te.invalid("missing or invalid start"):!e||!e.isValid?Te.invalid("missing or invalid end"):e<r?Te.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 Te{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 Le("need to specify a reason the Interval is invalid");const n=e instanceof Xe?e:new Xe(e,t);if(Ne.throwOnInvalid)throw new YT(n);return new Te({invalid:n})}static fromDateTimes(e,t){const n=wr(e),i=wr(t),a=OA(n,i);return a??new Te({start:n,end:i})}static after(e,t){const n=ye.fromDurationLike(t),i=wr(e);return Te.fromDateTimes(i,i.plus(n))}static before(e,t){const n=ye.fromDurationLike(t),i=wr(e);return Te.fromDateTimes(i.minus(n),i)}static fromISO(e,t){const[n,i]=(e||"").split("/",2);if(n&&i){let a,o;try{a=ue.fromISO(n,t),o=a.isValid}catch{o=!1}let s,l;try{s=ue.fromISO(i,t),l=s.isValid}catch{l=!1}if(o&&l)return Te.fromDateTimes(a,s);if(o){const u=ye.fromISO(i,t);if(u.isValid)return Te.after(a,u)}else if(l){const u=ye.fromISO(n,t);if(u.isValid)return Te.before(s,u)}}return Te.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let i;return t!=null&&t.useLocaleWeeks?i=this.end.reconfigure({locale:n.locale}):i=this.end,i=i.startOf(e,t),Math.floor(i.diff(n,e).get(e))+(i.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?Te.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(wr).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),n=[];let{s:i}=this,a=0;for(;i<this.e;){const o=t[a]||this.e,s=+o>+this.e?this.e:o;n.push(Te.fromDateTimes(i,s)),i=s,a+=1}return n}splitBy(e){const t=ye.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,i=1,a;const o=[];for(;n<this.e;){const s=this.start.plus(t.mapUnits(l=>l*i));a=+s>+this.e?this.e:s,o.push(Te.fromDateTimes(n,a)),n=a,i+=1}return o}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:Te.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 Te.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const i=[],a=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((l,u)=>l.time-u.time);for(const l of s)n+=l.type==="s"?1:-1,n===1?t=l.time:(t&&+t!=+l.time&&i.push(Te.fromDateTimes(t,l.time)),t=null);return Te.merge(i)}difference(...e){return Te.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Vt}[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=hn,t={}){return this.isValid?Me.create(this.s.loc.clone(t),e).formatInterval(this):Vt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vt}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vt}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ye.invalid(this.invalidReason)}mapEndpoints(e){return Te.fromDateTimes(e(this.s),e(this.e))}}class Qr{static hasDST(e=Ne.defaultZone){const t=ue.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ft.isValidZone(e)}static normalizeZone(e){return wt(e,Ne.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||_e.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||_e.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||_e.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||_e.create(t,n,a)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||_e.create(t,n,a)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null}={}){return(i||_e.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null}={}){return(i||_e.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return _e.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return _e.create(t,null,"gregory").eras(e)}static features(){return{relative:oE(),localeWeek:aE()}}}function Vd(r,e){const t=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(r);return Math.floor(ye.fromMillis(n).as("days"))}function RA(r,e,t){const n=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const h=Vd(l,u);return(h-h%7)/7}],["days",Vd]],i={},a=r;let o,s;for(const[l,u]of n)t.indexOf(l)>=0&&(o=l,i[l]=u(r,e),s=a.plus(i),s>e?(i[l]--,r=a.plus(i),r>e&&(s=r,i[l]--,r=a.plus(i))):r=s);return[r,i,s,o]}function NA(r,e,t,n){let[i,a,o,s]=RA(r,e,t);const l=e-i,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+l/(o-i)));const h=ye.fromObject(a,n);return u.length>0?ye.fromMillis(l,n).shiftTo(...u).plus(h):h}const IA="missing Intl.DateTimeFormat.formatToParts support";function we(r,e=t=>t){return{regex:r,deser:([t])=>e(vq(t))}}const xA=" ",TE=`[ ${xA}]`,qE=new RegExp(TE,"g");function $A(r){return r.replace(/\./g,"\\.?").replace(qE,TE)}function Qd(r){return r.replace(/\./g,"").replace(qE," ").toLowerCase()}function Ye(r,e){return r===null?null:{regex:RegExp(r.map($A).join("|")),deser:([t])=>r.findIndex(n=>Qd(t)===Qd(n))+e}}function Wd(r,e){return{regex:r,deser:([,t,n])=>_n(t,n),groups:e}}function Wr(r){return{regex:r,deser:([e])=>e}}function PA(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kA(r,e){const t=Ke(e),n=Ke(e,"{2}"),i=Ke(e,"{3}"),a=Ke(e,"{4}"),o=Ke(e,"{6}"),s=Ke(e,"{1,2}"),l=Ke(e,"{1,3}"),u=Ke(e,"{1,6}"),h=Ke(e,"{1,9}"),c=Ke(e,"{2,4}"),f=Ke(e,"{4,6}"),d=m=>({regex:RegExp(PA(m.val)),deser:([g])=>g,literal:!0}),_=(m=>{if(r.literal)return d(m);switch(m.val){case"G":return Ye(e.eras("short"),0);case"GG":return Ye(e.eras("long"),0);case"y":return we(u);case"yy":return we(c,wf);case"yyyy":return we(a);case"yyyyy":return we(f);case"yyyyyy":return we(o);case"M":return we(s);case"MM":return we(n);case"MMM":return Ye(e.months("short",!0),1);case"MMMM":return Ye(e.months("long",!0),1);case"L":return we(s);case"LL":return we(n);case"LLL":return Ye(e.months("short",!1),1);case"LLLL":return Ye(e.months("long",!1),1);case"d":return we(s);case"dd":return we(n);case"o":return we(l);case"ooo":return we(i);case"HH":return we(n);case"H":return we(s);case"hh":return we(n);case"h":return we(s);case"mm":return we(n);case"m":return we(s);case"q":return we(s);case"qq":return we(n);case"s":return we(s);case"ss":return we(n);case"S":return we(l);case"SSS":return we(i);case"u":return Wr(h);case"uu":return Wr(s);case"uuu":return we(t);case"a":return Ye(e.meridiems(),0);case"kkkk":return we(a);case"kk":return we(c,wf);case"W":return we(s);case"WW":return we(n);case"E":case"c":return we(t);case"EEE":return Ye(e.weekdays("short",!1),1);case"EEEE":return Ye(e.weekdays("long",!1),1);case"ccc":return Ye(e.weekdays("short",!0),1);case"cccc":return Ye(e.weekdays("long",!0),1);case"Z":case"ZZ":return Wd(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return Wd(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return Wr(/[a-z_+-/]{1,256}?/i);case" ":return Wr(/[^\S\n\r]/);default:return d(m)}})(r)||{invalidReason:IA};return _.token=r,_}const LA={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 MA(r,e,t){const{type:n,value:i}=r;if(n==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const a=e[n];let o=n;n==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let s=LA[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function DA(r){return[`^${r.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,r]}function jA(r,e,t){const n=r.match(e);if(n){const i={};let a=1;for(const o in t)if(Yt(t,o)){const s=t[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(a,a+l))),a+=l}return[n,i]}else return[n,{}]}function FA(r){const e=a=>{switch(a){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 ce(r.z)||(t=ft.create(r.z)),ce(r.Z)||(t||(t=new De(r.Z)),n=r.Z),ce(r.q)||(r.M=(r.q-1)*3+1),ce(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),ce(r.u)||(r.S=Of(r.u)),[Object.keys(r).reduce((a,o)=>{const s=e(o);return s&&(a[s]=r[o]),a},{}),t,n]}let ti=null;function BA(){return ti||(ti=ue.fromMillis(1555555555555)),ti}function UA(r,e){if(r.literal)return r;const t=Me.macroTokenToFormatOpts(r.val),n=NE(t,e);return n==null||n.includes(void 0)?r:n}function AE(r,e){return Array.prototype.concat(...r.map(t=>UA(t,e)))}class OE{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=AE(Me.parseFormat(t),e),this.units=this.tokens.map(n=>kA(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,i]=DA(this.units);this.regex=RegExp(n,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){const[t,n]=jA(e,this.regex,this.handlers),[i,a,o]=n?FA(n):[null,null,void 0];if(Yt(n,"a")&&Yt(n,"H"))throw new Gt("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:i,zone:a,specificOffset:o}}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 RE(r,e,t){return new OE(r,t).explainFromTokens(e)}function VA(r,e,t){const{result:n,zone:i,specificOffset:a,invalidReason:o}=RE(r,e,t);return[n,i,a,o]}function NE(r,e){if(!r)return null;const n=Me.create(e,r).dtFormatter(BA()),i=n.formatToParts(),a=n.resolvedOptions();return i.map(o=>MA(o,r,a))}const ri="Invalid DateTime",Hd=864e13;function Sr(r){return new Xe("unsupported zone",`the zone "${r.name}" is not supported`)}function ni(r){return r.weekData===null&&(r.weekData=fn(r.c)),r.weekData}function ii(r){return r.localWeekData===null&&(r.localWeekData=fn(r.c,r.loc.getMinDaysInFirstWeek(),r.loc.getStartOfWeek())),r.localWeekData}function St(r,e){const t={ts:r.ts,zone:r.zone,c:r.c,o:r.o,loc:r.loc,invalid:r.invalid};return new ue({...t,...e,old:t})}function IE(r,e,t){let n=r-e*60*1e3;const i=t.offset(n);if(e===i)return[n,e];n-=(i-e)*60*1e3;const a=t.offset(n);return i===a?[n,i]:[r-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Hr(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 ln(r,e,t){return IE(vn(r),e,t)}function zd(r,e){const t=r.o,n=r.c.year+Math.trunc(e.years),i=r.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...r.c,year:n,month:i,day:Math.min(r.c.day,dn(n,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ye.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"),s=vn(a);let[l,u]=IE(s,t,r.zone);return o!==0&&(l+=o,u=r.zone.offset(l)),{ts:l,o:u}}function Qt(r,e,t,n,i,a){const{setZone:o,zone:s}=t;if(r&&Object.keys(r).length!==0||e){const l=e||s,u=ue.fromObject(r,{...t,zone:l,specificOffset:a});return o?u:u.setZone(s)}else return ue.invalid(new Xe("unparsable",`the input "${i}" can't be parsed as ${n}`))}function zr(r,e,t=!0){return r.isValid?Me.create(_e.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(r,e):null}function si(r,e){const t=r.c.year>9999||r.c.year<0;let n="";return t&&r.c.year>=0&&(n+="+"),n+=xe(r.c.year,t?6:4),e?(n+="-",n+=xe(r.c.month),n+="-",n+=xe(r.c.day)):(n+=xe(r.c.month),n+=xe(r.c.day)),n}function Gd(r,e,t,n,i,a){let o=xe(r.c.hour);return e?(o+=":",o+=xe(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!t)&&(o+=":")):o+=xe(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!t)&&(o+=xe(r.c.second),(r.c.millisecond!==0||!n)&&(o+=".",o+=xe(r.c.millisecond,3))),i&&(r.isOffsetFixed&&r.offset===0&&!a?o+="Z":r.o<0?(o+="-",o+=xe(Math.trunc(-r.o/60)),o+=":",o+=xe(Math.trunc(-r.o%60))):(o+="+",o+=xe(Math.trunc(r.o/60)),o+=":",o+=xe(Math.trunc(r.o%60)))),a&&(o+="["+r.zone.ianaName+"]"),o}const xE={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},QA={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},WA={ordinal:1,hour:0,minute:0,second:0,millisecond:0},$E=["year","month","day","hour","minute","second","millisecond"],HA=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],zA=["year","ordinal","hour","minute","second","millisecond"];function GA(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 xC(r);return e}function Jd(r){switch(r.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return GA(r)}}function JA(r){if(Tr===void 0&&(Tr=Ne.now()),r.type!=="iana")return r.offset(Tr);const e=r.name;let t=vf.get(e);return t===void 0&&(t=r.offset(Tr),vf.set(e,t)),t}function Kd(r,e){const t=wt(e.zone,Ne.defaultZone);if(!t.isValid)return ue.invalid(Sr(t));const n=_e.fromObject(e);let i,a;if(ce(r.year))i=Ne.now();else{for(const l of $E)ce(r[l])&&(r[l]=xE[l]);const o=iE(r)||sE(r);if(o)return ue.invalid(o);const s=JA(t);[i,a]=ln(r,s,t)}return new ue({ts:i,zone:t,loc:n,o:a})}function Yd(r,e,t){const n=ce(t.round)?!0:t.round,i=(o,s)=>(o=Rf(o,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,s)),a=o=>t.calendary?e.hasSame(r,o)?0:e.startOf(o).diff(r.startOf(o),o).get(o):e.diff(r,o).get(o);if(t.unit)return i(a(t.unit),t.unit);for(const o of t.units){const s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(r>e?-0:0,t.units[t.units.length-1])}function Zd(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 Tr;const vf=new Map;class ue{constructor(e){const t=e.zone||Ne.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Xe("invalid input"):null)||(t.isValid?null:Sr(t));this.ts=ce(e.ts)?Ne.now():e.ts;let i=null,a=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[i,a]=[e.old.c,e.old.o];else{const s=vt(e.o)&&!e.old?e.o:t.offset(this.ts);i=Hr(this.ts,s),n=Number.isNaN(i.year)?new Xe("invalid input"):null,i=n?null:i,a=n?null:s}this._zone=t,this.loc=e.loc||_e.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new ue({})}static local(){const[e,t]=Zd(arguments),[n,i,a,o,s,l,u]=t;return Kd({year:n,month:i,day:a,hour:o,minute:s,second:l,millisecond:u},e)}static utc(){const[e,t]=Zd(arguments),[n,i,a,o,s,l,u]=t;return e.zone=De.utcInstance,Kd({year:n,month:i,day:a,hour:o,minute:s,second:l,millisecond:u},e)}static fromJSDate(e,t={}){const n=Tq(e)?e.valueOf():NaN;if(Number.isNaN(n))return ue.invalid("invalid input");const i=wt(t.zone,Ne.defaultZone);return i.isValid?new ue({ts:n,zone:i,loc:_e.fromObject(t)}):ue.invalid(Sr(i))}static fromMillis(e,t={}){if(vt(e))return e<-Hd||e>Hd?ue.invalid("Timestamp out of range"):new ue({ts:e,zone:wt(t.zone,Ne.defaultZone),loc:_e.fromObject(t)});throw new Le(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(vt(e))return new ue({ts:e*1e3,zone:wt(t.zone,Ne.defaultZone),loc:_e.fromObject(t)});throw new Le("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=wt(t.zone,Ne.defaultZone);if(!n.isValid)return ue.invalid(Sr(n));const i=_e.fromObject(t),a=pn(e,Jd),{minDaysInFirstWeek:o,startOfWeek:s}=Ld(a,i),l=Ne.now(),u=ce(t.specificOffset)?n.offset(l):t.specificOffset,h=!ce(a.ordinal),c=!ce(a.year),f=!ce(a.month)||!ce(a.day),d=c||f,w=a.weekYear||a.weekNumber;if((d||h)&&w)throw new Gt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&h)throw new Gt("Can't mix ordinal dates with month/day");const _=w||a.weekday&&!d;let m,g,p=Hr(l,u);_?(m=HA,g=QA,p=fn(p,o,s)):h?(m=zA,g=WA,p=ei(p)):(m=$E,g=xE);let b=!1;for(const C of m){const q=a[C];ce(q)?b?a[C]=g[C]:a[C]=p[C]:b=!0}const v=_?Cq(a,o,s):h?Eq(a):iE(a),E=v||sE(a);if(E)return ue.invalid(E);const T=_?Pd(a,o,s):h?kd(a):a,[S,R]=ln(T,u,n),j=new ue({ts:S,zone:n,o:R,loc:i});return a.weekday&&d&&e.weekday!==j.weekday?ue.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${j.toISO()}`):j.isValid?j:ue.invalid(j.invalid)}static fromISO(e,t={}){const[n,i]=pA(e);return Qt(n,i,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,i]=mA(e);return Qt(n,i,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,i]=gA(e);return Qt(n,i,t,"HTTP",t)}static fromFormat(e,t,n={}){if(ce(e)||ce(t))throw new Le("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:a=null}=n,o=_e.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,l,u,h]=VA(o,e,t);return h?ue.invalid(h):Qt(s,l,n,`format ${t}`,e,u)}static fromString(e,t,n={}){return ue.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,i]=EA(e);return Qt(n,i,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Le("need to specify a reason the DateTime is invalid");const n=e instanceof Xe?e:new Xe(e,t);if(Ne.throwOnInvalid)throw new KT(n);return new ue({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=NE(e,_e.fromObject(t));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(e,t={}){return AE(Me.parseFormat(e),_e.fromObject(t)).map(i=>i.val).join("")}static resetCache(){Tr=void 0,vf.clear()}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?ni(this).weekYear:NaN}get weekNumber(){return this.isValid?ni(this).weekNumber:NaN}get weekday(){return this.isValid?ni(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ii(this).weekday:NaN}get localWeekNumber(){return this.isValid?ii(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ii(this).weekYear:NaN}get ordinal(){return this.isValid?ei(this.c).ordinal:NaN}get monthShort(){return this.isValid?Qr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Qr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Qr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Qr.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=vn(this.c),i=this.zone.offset(n-e),a=this.zone.offset(n+e),o=this.zone.offset(n-i*t),s=this.zone.offset(n-a*t);if(o===s)return[this];const l=n-o*t,u=n-s*t,h=Hr(l,o),c=Hr(u,s);return h.hour===c.hour&&h.minute===c.minute&&h.second===c.second&&h.millisecond===c.millisecond?[St(this,{ts:l}),St(this,{ts:u})]:[this]}get isInLeapYear(){return Nr(this.year)}get daysInMonth(){return dn(this.year,this.month)}get daysInYear(){return this.isValid?Jt(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ar(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ar(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:i}=Me.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:i}}toUTC(e=0,t={}){return this.setZone(De.instance(e),t)}toLocal(){return this.setZone(Ne.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=wt(e,Ne.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(t||n){const a=e.offset(this.ts),o=this.toObject();[i]=ln(o,a,e)}return St(this,{ts:i,zone:e})}else return ue.invalid(Sr(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const i=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return St(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=pn(e,Jd),{minDaysInFirstWeek:n,startOfWeek:i}=Ld(t,this.loc),a=!ce(t.weekYear)||!ce(t.weekNumber)||!ce(t.weekday),o=!ce(t.ordinal),s=!ce(t.year),l=!ce(t.month)||!ce(t.day),u=s||l,h=t.weekYear||t.weekNumber;if((u||o)&&h)throw new Gt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Gt("Can't mix ordinal dates with month/day");let c;a?c=Pd({...fn(this.c,n,i),...t},n,i):ce(t.ordinal)?(c={...this.toObject(),...t},ce(t.day)&&(c.day=Math.min(dn(c.year,c.month),c.day))):c=kd({...ei(this.c),...t});const[f,d]=ln(c,this.o,this.zone);return St(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=ye.fromDurationLike(e);return St(this,zd(this,t))}minus(e){if(!this.isValid)return this;const t=ye.fromDurationLike(e).negate();return St(this,zd(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},i=ye.normalizeUnit(e);switch(i){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(i==="weeks")if(t){const a=this.loc.getStartOfWeek(),{weekday:o}=this;o<a&&(n.weekNumber=this.weekNumber-1),n.weekday=a}else n.weekday=1;if(i==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-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?Me.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ri}toLocaleString(e=hn,t={}){return this.isValid?Me.create(this.loc.clone(t),e).formatDateTime(this):ri}toLocaleParts(e={}){return this.isValid?Me.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;const o=e==="extended";let s=si(this,o);return s+="T",s+=Gd(this,o,t,n,i,a),s}toISODate({format:e="extended"}={}){return this.isValid?si(this,e==="extended"):null}toISOWeekDate(){return zr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+Gd(this,o==="extended",t,e,n,a):null}toRFC2822(){return zr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?si(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(t||e)&&(n&&(i+=" "),t?i+="z":e&&(i+="ZZ")),zr(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ri}[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 ye.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=qq(t).map(ye.normalizeUnit),o=e.valueOf()>this.valueOf(),s=o?this:e,l=o?e:this,u=NA(s,l,a,i);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(ue.now(),e,t)}until(e){return this.isValid?Te.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const i=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(t,n)<=i&&i<=a.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||ue.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let i=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(i=e.unit,a=void 0),Yd(t,this.plus(n),{...e,numeric:"always",units:i,unit:a})}toRelativeCalendar(e={}){return this.isValid?Yd(e.base||ue.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(ue.isDateTime))throw new Le("min requires all arguments be DateTimes");return Md(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(ue.isDateTime))throw new Le("max requires all arguments be DateTimes");return Md(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:i=null,numberingSystem:a=null}=n,o=_e.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return RE(o,e,t)}static fromStringExplain(e,t,n={}){return ue.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:i=null}=t,a=_e.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return new OE(a,e)}static fromFormatParser(e,t,n={}){if(ce(e)||ce(t))throw new Le("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:a=null}=n,o=_e.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(t.locale))throw new Le(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:s,zone:l,specificOffset:u,invalidReason:h}=t.explainFromTokens(e);return h?ue.invalid(h):Qt(s,l,n,`format ${t.format}`,e,u)}static get DATE_SHORT(){return hn}static get DATE_MED(){return $C}static get DATE_MED_WITH_WEEKDAY(){return XT}static get DATE_FULL(){return PC}static get DATE_HUGE(){return kC}static get TIME_SIMPLE(){return LC}static get TIME_WITH_SECONDS(){return MC}static get TIME_WITH_SHORT_OFFSET(){return DC}static get TIME_WITH_LONG_OFFSET(){return jC}static get TIME_24_SIMPLE(){return FC}static get TIME_24_WITH_SECONDS(){return BC}static get TIME_24_WITH_SHORT_OFFSET(){return UC}static get TIME_24_WITH_LONG_OFFSET(){return VC}static get DATETIME_SHORT(){return QC}static get DATETIME_SHORT_WITH_SECONDS(){return WC}static get DATETIME_MED(){return HC}static get DATETIME_MED_WITH_SECONDS(){return zC}static get DATETIME_MED_WITH_WEEKDAY(){return eq}static get DATETIME_FULL(){return GC}static get DATETIME_FULL_WITH_SECONDS(){return JC}static get DATETIME_HUGE(){return KC}static get DATETIME_HUGE_WITH_SECONDS(){return YC}}function wr(r){if(ue.isDateTime(r))return r;if(r&&r.valueOf&&vt(r.valueOf()))return ue.fromJSDate(r);if(r&&typeof r=="object")return ue.fromObject(r);throw new Le(`Unknown datetime argument: ${r}, of type ${typeof r}`)}const KA=r=>{const e=[],t=YA(r);let n=t.next();for(;n;)e.push(n),n=t.next();return e},YA=r=>({...r,next:ZA(r)}),ZA=r=>{let e=r.start;return()=>{if(e==null)return null;let t=null;switch(r.granularity){case nt.Total:t=XA(e,r.end);break;case nt.Annual:t=eO(e,r.end);break;case nt.SemiAnnual:t=tO(e,r.end);break;case nt.Quarterly:t=rO(e,r.end);break;case nt.Monthly:t=nO(e,r.end);break;case nt.Weekly:t=iO(e,r.end);break;case nt.Daily:t=sO(e,r.end);break;case nt.Hourly:t=oO(e,r.end)}return t===null?e=null:e=t.end.plus({milliseconds:1}),t}},XA=(r,e)=>e<=r?null:{period:"total",start:r,end:e},eO=(r,e)=>{if(e<=r)return null;const t=r.toUTC(),n=ue.utc(t.year,t.month,t.day).plus({years:1});return{period:"annual",start:r,end:n}},tO=(r,e)=>{if(e<=r)return null;const t=ue.utc(r.year,7,1),n=ue.utc(r.year,12,31,23,59,59,999);let i;return t>r?i=t:i=n,i>e&&(i=e),{period:"semiAnnual",start:r,end:i}},rO=(r,e)=>{if(e<=r)return null;let t;const n=r.toUTC(),i=n.month;return i<3?t=ue.utc(n.year,4,1):i<6?t=ue.utc(n.year,7,1):i<9?t=ue.utc(n.year,10,1):t=ue.utc(n.year,12,31,23,59,59,999),t>e&&(t=e),{period:"quarterly",start:r,end:t}},nO=(r,e)=>{if(e<=r)return null;const t=r.toUTC();let n=ue.utc(t.year,t.month,t.day).plus({months:1}).startOf("month");return n>e&&(r.hasSame(e,"month")||(n=e)),{period:"monthly",start:r,end:n}},iO=(r,e)=>{if(e<=r)return null;const t=r.toUTC(),n=ue.utc(t.year,t.month,t.day).plus({weeks:1}).startOf("week");return n>e&&!n.hasSame(e,"day")?{period:"weekly",start:r,end:e}:{period:"weekly",start:r,end:n}},sO=(r,e)=>{if(e<=r)return null;let n=r.toUTC().plus({days:1}).startOf("day");return(n>e||n.hasSame(e,"day"))&&(n=e),{period:"daily",start:r,end:n}},oO=(r,e)=>{if(e<=r)return null;let n=r.toUTC().plus({hours:1});return n>e&&r.hour!==e.hour&&(n=e.toUTC()),{period:"hourly",start:r,end:n}},aO=r=>Math.floor((r.month-1)/3)+1;class $f{static discretize(e,t,n,i,a){const o=this._buildIndex(e,t),s=KA(this._calculateRange(n,i,a,e)),l=this._discretizeNode(o,{},t,s);return this._groupResultsByPeriod(s,l)}static _calculateRange(e,t,n,i){let a=e||null,o=t||null;if(a==null||o==null)for(const s of i){a==null&&(a=s.start);const l=s.end||s.start;(o==null||o<l)&&(o=l)}if(a==null||o==null)throw new Error("Cannot determine query start and/or end.");return{start:a,end:o,granularity:n}}static _groupResultsByPeriod(e,t){const n={};for(const i of e){const a=i.start.toISO()+"-"+i.period,o=$f._getPeriodString(i);n[a]={period:o,start:i.start,end:i.end,rows:[]}}for(const i of t)for(const a of Object.keys(i.series))n[a].rows.push({dimensions:i.dimensions,metric:i.metric,unit:i.unit=="__NULL__"?null:i.unit,value:i.series[a].inc,sum:i.series[a].sum});return Object.values(n)}static _getPeriodString(e){switch(e.period){case"annual":return e.start.year.toString();case"semiAnnual":return`${e.start.year}/${e.start.month<7?"H1":"H2"}`;case"quarterly":return`${e.start.year}/Q${aO(e.start)}`;case"monthly":const t=e.start.toUTC().month,n=t<10?`0${t}`:`${t}`;return`${e.start.year}/${n}`;case"weekly":return`${e.start.weekYear}/W${e.start.weekNumber}`;case"daily":const i=e.start.month,a=e.start.day,o=i<10?`0${i}`:`${i}`,s=a<10?`0${a}`:`${a}`;return`${e.start.year}/${o}/${s}`;case"hourly":const l=e.start.month,u=e.start.day,h=e.start.hour,c=l<10?`0${l}`:`${l}`,f=u<10?`0${u}`:`${u}`,d=h<10?`0${h}`:`${h}`;return`${e.start.year}/${c}/${f}/${d}`;default:return e.period}}static _discretizeNode(e,t,n,i){const a=[];if(n.length>0){const o=n[0];Object.keys(e).forEach((s,l,u)=>{const h={...t};h[o]=s,a.push(...this._discretizeNode(e[s],h,n.slice(1),i))})}else Object.keys(e).forEach(o=>{a.push(...this._discretizeLeaf(e[o],i,o,t))});return a}static _discretizeLeaf(e,t,n,i){const a=[];return Object.keys(e).forEach(o=>{const s={};Object.keys(i).forEach(l=>{s[l]={path:e[o][0].dimensions[l],icon:e[o][0].dimensions.icon,label:e[o][0].dimensions.label,description:e[o][0].dimensions.description}}),a.push({unit:o,metric:n,dimensions:s,series:this._discretizeSeries(e[o],t)})}),a}static _discretizeSeries(e,t){const n={};for(const i of e){let a=this._getValue(i,t[0].start);for(const o of t){const s=this._getValue(i,o.end),l=`${o.start.toISO()}-${o.period}`;n[l]?(n[l].inc+=s-a,n[l].sum+=s):n[l]={inc:s-a,sum:s},a=s}}return n}static _getValue(e,t){switch(e.fn){case"Single":return this._getSingleValue(e,t);case"DssVest":return this._getVestValue(e,t);default:return 0}}static _getSingleValue(e,t){return t>=e.start?e.value:0}static _getVestValue(e,t){var u;const n=t,i=e.start,a=e.end,o=(u=e.params)!=null&&u.cliff?ue.fromISO(e.params.cliff):null;if(n<i||o&&n<o)return 0;if(a&&n>=a)return e.value;const s=Te.fromDateTimes(i,n),l=Te.fromDateTimes(i,a||n);return s.length()/l.length()*e.value}static _buildIndex(e,t){const n={},i={},a=t[0]||"";for(const o of e){const s=o.dimensions[a];i[s]===void 0&&(i[s]=[]),i[s].push(o)}if(t.length>1){const o=t.slice(1);Object.keys(i).forEach(s=>{n[s]=this._buildIndex(i[s],o)})}else Object.keys(i).forEach(o=>{n[o]=this._buildMetricsIndex(i[o])});return n}static _buildMetricsIndex(e){const t={},n={};for(const i of e){const a=i.metric;n[a]===void 0&&(n[a]=[]),n[a].push(i)}return Object.keys(n).forEach(i=>t[i]=this._buildUnitIndex(n[i])),t}static _buildUnitIndex(e){const t={};for(const n of e){const i=n.unit||"__NULL__";t[i]===void 0&&(t[i]=[]),t[i].push(n)}return t}}class uO{constructor(e,t){de(this,"_analyticsStore");de(this,"_profiler");this._analyticsStore=e,this._profiler=t??new IC}async executeCompound(e){let t;const n={start:e.start,end:e.end,granularity:e.granularity,lod:e.lod,select:e.select,metrics:e.expression.inputs.metrics,currency:e.expression.inputs.currency},i={start:e.start,end:e.end,granularity:e.granularity,lod:{priceData:1},select:{priceData:[it.fromString("atlas")]},metrics:[e.expression.operand.metric],currency:e.expression.operand.currency},a=await this.execute(n),o=await this.execute(i);return[je.VectorAdd,je.VectorSubtract].includes(e.expression.operator)?t=await this._profiler.record("ApplyVectorOperator",async()=>await this._applyVectorOperator(a,o,e.expression.operator,e.expression.resultCurrency)):t=await this._profiler.record("ApplyScalarOperator",async()=>await this._applyScalarOperator(a,o,e.expression.operator,e.expression.operand.useSum,e.expression.resultCurrency)),t}async execute(e){const t=await this._executeSeriesQuery(e),n=this._profiler.recordSync("ApplyLODs",()=>this._applyLods(t,e.lod)),i=Object.keys(e.select);return this._profiler.recordSync("Discretize",()=>n.length<1?[]:$f.discretize(n,i,e.start,e.end,e.granularity))}async executeMultiCurrency(e,t){const n={...e,currency:t.targetCurrency??e.currency};let i=await this.execute(n);for(const a of t.conversions){const o={start:e.start,end:e.end,granularity:e.granularity,lod:e.lod,select:e.select,expression:{inputs:{metrics:n.metrics,currency:a.currency},operator:je.ScalarMultiply,operand:{metric:a.metric,currency:t.targetCurrency,useSum:!0},resultCurrency:t.targetCurrency}},s=await this.executeCompound(o);i=await this._applyVectorOperator(i,s,je.VectorAdd,t.targetCurrency)}return i}async _applyVectorOperator(e,t,n,i){if([je.ScalarMultiply,je.ScalarDivide].includes(n))throw new Error("Invalid operator for vector operation");return t}async _applyScalarOperator(e,t,n,i,a){if([je.VectorAdd,je.VectorSubtract].includes(n))throw new Error("Invalid operator for scalar operation");const o=[],s={},l=i?"sum":"value";for(const u of t)u.rows.length>0&&(s[u.period]=u.rows[0][l]);for(const u of e){const h={period:u.period,start:u.start,end:u.end,rows:u.rows.map(c=>({dimensions:c.dimensions,metric:c.metric,unit:a?a.toString():c.unit,value:this._calculateOutputValue(c.value,n,s[u.period]),sum:-1}))};o.push(h)}return o}_calculateOutputValue(e,t,n){switch(t){case je.VectorAdd:return e+n;case je.VectorSubtract:return e-n;case je.ScalarMultiply:return e*n;case je.ScalarDivide:return e/n}}async _executeSeriesQuery(e){const t={start:e.start,end:e.end,select:e.select,metrics:e.metrics,currency:e.currency};return await this._analyticsStore.getMatchingSeries(t)}_applyLods(e,t){return e.map(n=>({...n,dimensions:this._applyDimensionsLods(n.dimensions,t)}))}_applyDimensionsLods(e,t){const n={};for(const[i,a]of Object.entries(t))a!==null&&e[i]&&(n[i]=e[i].path.applyLod(a).toString(),n.icon=e[i].icon.toString(),n.label=e[i].label.toString(),n.description=e[i].description.toString());return n}async getDimensions(){return await this._analyticsStore.getDimensions()}}class lO extends Error{constructor(t){super(t.map(n=>n.message).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.CXdyyvMp.js","./user.VfmtjJcC.js","./connect.config.DiOix9wN.js","./index.DFyMrewv.js","./browser.BkwNmV2Z.js","./index.d9lnrxLT.js","./app-skeleton.js","./index-B7k827uL.css","./index.CCw1FVfF.js","./useFeatureFlags.CXC9_-UZ.js","./useAcceptedCookies.Dhp4DVwx.js","./useConnectConfig.wQH58ec9.js","./index.CAUjMUXb.js","./registerServiceWorker.Eb207Eu9.js","./index.C9_ibJMG.js","./home.RjAKOXsG.js","./modals.CF6srNVI.js","./i18next.CqOP20KE.js","./useDocumentDriveServer.D670OoQu.js","./slug.C6xW_7Wm.js","./modal.CfVDDyC4.js","./content.CKwzH4A6.js","./react-error-boundary.esm.BVdm9PKb.js","./useDefaultDocumentModelEditor.q2XXU104.js","./useTranslation.BpVv6XIW.js","./toast.EfwsdSRg.js","./root.57GaakYu.js","./atlas-import.4dachugj.js"])))=>i.map(i=>d[i]);
2
+ var oT=Object.defineProperty;var aT=(r,e,t)=>e in r?oT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>aT(r,typeof e!="symbol"?e+"":e,t);import{jsxs as Ht,jsx as Re,Fragment as TC}from"react/jsx-runtime";import{r as $e,e as zt,p as ve,g as uT,U as qC,f as lT,Q as cT,h as hT,i as fT,j as dT,k as AC,c as yn,l as pT,m as mT,I as gT,_ as ht,n as Ur,R as yT,b as Ef,a as bT,o as wT,q as vT,s as _T,W as CT,T as ET,t as ST}from"./index.DFyMrewv.js";import*as pe from"react";import Or,{useMemo as uf,useEffect as st,useState as vd,createContext as TT,useContext as qT,useRef as Sf,Suspense as Cr}from"react";import{c as Fe}from"./connect.config.DiOix9wN.js";import{e as AT,u as OT}from"./user.VfmtjJcC.js";import{u as RT,a as NT,d as _d,r as OC}from"./useFeatureFlags.CXC9_-UZ.js";import{a as IT,u as xT,b as lf}from"./index.d9lnrxLT.js";import{u as RC}from"./useAcceptedCookies.Dhp4DVwx.js";import{u as $T}from"./useConnectConfig.wQH58ec9.js";import*as PT from"react-dom";import{l as kT,D as LT,a as MT,R as DT,c as jT,b as FT,u as BT,E as UT,m as VT,d as NC,e as QT,f as WT,g as HT,h as zT}from"./index.CAUjMUXb.js";import{s as GT}from"./registerServiceWorker.Eb207Eu9.js";class IC{get prefix(){return""}push(e){}pop(){}popAndReturn(e){return e}async record(e,t){return await t()}recordSync(e,t){return t()}}var cn;(function(r){r[r.AnalyticsPath=0]="AnalyticsPath",r[r.AnalyticsPathSegment=1]="AnalyticsPathSegment",r[r.AnalyticsPeriod=2]="AnalyticsPeriod"})(cn||(cn={}));var Cd;(function(r){r[r.Year=0]="Year",r[r.Quarter=1]="Quarter",r[r.Month=2]="Month"})(Cd||(Cd={}));class it{constructor(e){de(this,"_segments");this._segments=e}get segments(){return this._segments}static fromString(e){const t=un(e,"/").map(n=>Qe.fromString(n));return new it(t)}static fromStringArray(e){return new it(e.map(t=>Qe.fromString(t)))}static fromArray(e){return new it(e)}static fromJSON(e){const t=e._v.split("/").map(n=>Qe.fromString(n));return new it(t)}toJSON(){return{_t:cn.AnalyticsPath,_v:this.toString()}}toString(e=""){return this._segments.map(t=>t.toString()).join("/")+e}firstSegment(){return this._segments.length>0?this._segments[0]:new Qe}reduce(){const e=this._segments.slice(1);return e.length<1&&e.push(new Qe),new it(e)}applyLod(e){const t=[...this._segments];for(;t.length<e;)t.push(new Qe);return new it(t.slice(0,e))}}class Qe{constructor(e=null,t=[]){de(this,"_filters",null);de(this,"_groups",null);this._filters=e,this._groups=t}get filters(){return this._filters}get groups(){return this._groups}static fromString(e){const t=un(e,":");let n;t[0]==="*"?n=null:n=un(t[0],",").map(a=>Qe.unescape(a));let i;return t[1]===void 0||t[1].length<1?i=[]:t[1]==="*"?i=null:i=un(t[1],",").map(a=>Qe.unescape(a)),new Qe(n,i)}static escape(e){return e.replace(/(\\|:|\/|,)/gi,"\\$1")}static unescape(e){return e.replace(/\\(.)/gi,"$1")}toJSON(){return{_t:cn.AnalyticsPathSegment,_v:this.toString()}}toString(){let e="";return this._filters===null?e+="*":e+=this._filters.map(t=>Qe.escape(t)).join(","),this._groups===null?e+=":*":this._groups.length>0&&(e+=":"+this._groups.map(t=>Qe.escape(t)).join(",")),e}}const JT={":":new RegExp("(?<!\\\\):"),",":new RegExp("(?<!\\\\),"),"/":new RegExp("(?<!\\\\)\\/")};function un(r,e){let t="@@";for(;r.indexOf(t)>-1;)t+="@";return r.replaceAll("\\\\",t).split(JT[e]).map(n=>n.replaceAll(t,"\\\\"))}var Ed;(function(r){r[r.Budget=0]="Budget",r[r.Forecast=1]="Forecast",r[r.Actuals=2]="Actuals",r[r.PaymentsOnChain=3]="PaymentsOnChain",r[r.PaymentsOffChainIncluded=4]="PaymentsOffChainIncluded",r[r.FTEs=5]="FTEs"})(Ed||(Ed={}));var je;(function(r){r[r.VectorAdd=0]="VectorAdd",r[r.VectorSubtract=1]="VectorSubtract",r[r.ScalarMultiply=2]="ScalarMultiply",r[r.ScalarDivide=3]="ScalarDivide"})(je||(je={}));var nt;(function(r){r[r.Total=0]="Total",r[r.Annual=1]="Annual",r[r.SemiAnnual=2]="SemiAnnual",r[r.Quarterly=3]="Quarterly",r[r.Monthly=4]="Monthly",r[r.Weekly=5]="Weekly",r[r.Daily=6]="Daily",r[r.Hourly=7]="Hourly"})(nt||(nt={}));class At extends Error{}class KT extends At{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class YT extends At{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ZT extends At{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Gt extends At{}class xC extends At{constructor(e){super(`Invalid unit ${e}`)}}class Le extends At{}class gt extends At{constructor(){super("Zone is an abstract class")}}const ie="numeric",et="short",Be="long",hn={year:ie,month:ie,day:ie},$C={year:ie,month:et,day:ie},XT={year:ie,month:et,day:ie,weekday:et},PC={year:ie,month:Be,day:ie},kC={year:ie,month:Be,day:ie,weekday:Be},LC={hour:ie,minute:ie},MC={hour:ie,minute:ie,second:ie},DC={hour:ie,minute:ie,second:ie,timeZoneName:et},jC={hour:ie,minute:ie,second:ie,timeZoneName:Be},FC={hour:ie,minute:ie,hourCycle:"h23"},BC={hour:ie,minute:ie,second:ie,hourCycle:"h23"},UC={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:et},VC={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:Be},QC={year:ie,month:ie,day:ie,hour:ie,minute:ie},WC={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},HC={year:ie,month:et,day:ie,hour:ie,minute:ie},zC={year:ie,month:et,day:ie,hour:ie,minute:ie,second:ie},eq={year:ie,month:et,day:ie,weekday:et,hour:ie,minute:ie},GC={year:ie,month:Be,day:ie,hour:ie,minute:ie,timeZoneName:et},JC={year:ie,month:Be,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:et},KC={year:ie,month:Be,day:ie,weekday:Be,hour:ie,minute:ie,timeZoneName:Be},YC={year:ie,month:Be,day:ie,weekday:Be,hour:ie,minute:ie,second:ie,timeZoneName:Be};class Rr{get type(){throw new gt}get name(){throw new gt}get ianaName(){return this.name}get isUniversal(){throw new gt}offsetName(e,t){throw new gt}formatOffset(e,t){throw new gt}offset(e){throw new gt}equals(e){throw new gt}get isValid(){throw new gt}}let Yn=null;class bn extends Rr{static get instance(){return Yn===null&&(Yn=new bn),Yn}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return uE(e,t,n)}formatOffset(e,t){return qr(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const cf=new Map;function tq(r){let e=cf.get(r);return e===void 0&&(e=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"}),cf.set(r,e)),e}const rq={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function nq(r,e){const t=r.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,i,a,o,s,l,u,h]=n;return[o,i,a,s,l,u,h]}function iq(r,e){const t=r.formatToParts(e),n=[];for(let i=0;i<t.length;i++){const{type:a,value:o}=t[i],s=rq[a];a==="era"?n[s]=o:ce(s)||(n[s]=parseInt(o,10))}return n}const Zn=new Map;class ft extends Rr{static create(e){let t=Zn.get(e);return t===void 0&&Zn.set(e,t=new ft(e)),t}static resetCache(){Zn.clear(),cf.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=ft.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return uE(e,t,n,this.name)}formatOffset(e,t){return qr(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const n=tq(this.name);let[i,a,o,s,l,u,h]=n.formatToParts?iq(n,t):nq(n,t);s==="BC"&&(i=-Math.abs(i)+1);const f=vn({year:i,month:a,day:o,hour:l===24?0:l,minute:u,second:h,millisecond:0});let d=+t;const w=d%1e3;return d-=w>=0?w:1e3+w,(f-d)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Sd={};function sq(r,e={}){const t=JSON.stringify([r,e]);let n=Sd[t];return n||(n=new Intl.ListFormat(r,e),Sd[t]=n),n}const hf=new Map;function ff(r,e={}){const t=JSON.stringify([r,e]);let n=hf.get(t);return n===void 0&&(n=new Intl.DateTimeFormat(r,e),hf.set(t,n)),n}const df=new Map;function oq(r,e={}){const t=JSON.stringify([r,e]);let n=df.get(t);return n===void 0&&(n=new Intl.NumberFormat(r,e),df.set(t,n)),n}const pf=new Map;function aq(r,e={}){const{base:t,...n}=e,i=JSON.stringify([r,n]);let a=pf.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(r,e),pf.set(i,a)),a}let Er=null;function uq(){return Er||(Er=new Intl.DateTimeFormat().resolvedOptions().locale,Er)}const mf=new Map;function ZC(r){let e=mf.get(r);return e===void 0&&(e=new Intl.DateTimeFormat(r).resolvedOptions(),mf.set(r,e)),e}const gf=new Map;function lq(r){let e=gf.get(r);if(!e){const t=new Intl.Locale(r);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...XC,...e}),gf.set(r,e)}return e}function cq(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,i;try{n=ff(r).resolvedOptions(),i=r}catch{const l=r.substring(0,t);n=ff(l).resolvedOptions(),i=l}const{numberingSystem:a,calendar:o}=n;return[i,a,o]}}function hq(r,e,t){return(t||e)&&(r.includes("-u-")||(r+="-u"),t&&(r+=`-ca-${t}`),e&&(r+=`-nu-${e}`)),r}function fq(r){const e=[];for(let t=1;t<=12;t++){const n=ue.utc(2009,t,1);e.push(r(n))}return e}function dq(r){const e=[];for(let t=1;t<=7;t++){const n=ue.utc(2016,11,13+t);e.push(r(n))}return e}function Vr(r,e,t,n){const i=r.listingMode();return i==="error"?null:i==="en"?t(e):n(e)}function pq(r){return r.numberingSystem&&r.numberingSystem!=="latn"?!1:r.numberingSystem==="latn"||!r.locale||r.locale.startsWith("en")||ZC(r.locale).numberingSystem==="latn"}class mq{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:i,floor:a,...o}=n;if(!t||Object.keys(o).length>0){const s={useGrouping:!1,...n};n.padTo>0&&(s.minimumIntegerDigits=n.padTo),this.inf=oq(e,s)}}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):Rf(e,3);return xe(t,this.padTo)}}}class gq{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ft.create(s).valid?(i=s,this.dt=e):(i="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,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=ff(t,a)}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 yq{constructor(e,t,n){this.opts={style:"long",...n},!t&&oE()&&(this.rtf=aq(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):jq(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const XC={firstDay:1,minimalDays:4,weekend:[6,7]};class _e{static fromOpts(e){return _e.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,i,a=!1){const o=e||Ne.defaultLocale,s=o||(a?"en-US":uq()),l=t||Ne.defaultNumberingSystem,u=n||Ne.defaultOutputCalendar,h=bf(i)||Ne.defaultWeekSettings;return new _e(s,l,u,h,o)}static resetCache(){Er=null,hf.clear(),df.clear(),pf.clear(),mf.clear(),gf.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:i}={}){return _e.create(e,t,n,i)}constructor(e,t,n,i,a){const[o,s,l]=cq(e);this.locale=o,this.numberingSystem=t||s||null,this.outputCalendar=n||l||null,this.weekSettings=i,this.intl=hq(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=pq(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:_e.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,bf(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 Vr(this,e,hE,()=>{const n=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=fq(a=>this.extract(a,n,"month"))),this.monthsCache[i][e]})}weekdays(e,t=!1){return Vr(this,e,pE,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=dq(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Vr(this,void 0,()=>mE,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ue.utc(2016,11,13,9),ue.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Vr(this,e,gE,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[ue.utc(-40,1,1),ue.utc(2017,1,1)].map(n=>this.extract(n,t,"era"))),this.eraCache[e]})}extract(e,t,n){const i=this.dtFormatter(e,t),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===n);return o?o.value:null}numberFormatter(e={}){return new mq(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new gq(e,this.intl,t)}relFormatter(e={}){return new yq(this.intl,this.isEnglish(),e)}listFormatter(e={}){return sq(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ZC(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:aE()?lq(this.locale):XC}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 Xn=null;class De extends Rr{static get utcInstance(){return Xn===null&&(Xn=new De(0)),Xn}static instance(e){return e===0?De.utcInstance:new De(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new De(_n(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${qr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${qr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return qr(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 bq extends Rr{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 wt(r,e){if(ce(r)||r===null)return e;if(r instanceof Rr)return r;if(Sq(r)){const t=r.toLowerCase();return t==="default"?e:t==="local"||t==="system"?bn.instance:t==="utc"||t==="gmt"?De.utcInstance:De.parseSpecifier(t)||ft.create(r)}else return vt(r)?De.instance(r):typeof r=="object"&&"offset"in r&&typeof r.offset=="function"?r:new bq(r)}const Tf={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Td={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]},wq=Tf.hanidec.replace(/[\[|\]]/g,"").split("");function vq(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(Tf.hanidec)!==-1)e+=wq.indexOf(r[t]);else for(const i in Td){const[a,o]=Td[i];n>=a&&n<=o&&(e+=n-a)}}return parseInt(e,10)}else return e}const yf=new Map;function _q(){yf.clear()}function Ke({numberingSystem:r},e=""){const t=r||"latn";let n=yf.get(t);n===void 0&&(n=new Map,yf.set(t,n));let i=n.get(e);return i===void 0&&(i=new RegExp(`${Tf[t]}${e}`),n.set(e,i)),i}let qd=()=>Date.now(),Ad="system",Od=null,Rd=null,Nd=null,Id=60,xd,$d=null;class Ne{static get now(){return qd}static set now(e){qd=e}static set defaultZone(e){Ad=e}static get defaultZone(){return wt(Ad,bn.instance)}static get defaultLocale(){return Od}static set defaultLocale(e){Od=e}static get defaultNumberingSystem(){return Rd}static set defaultNumberingSystem(e){Rd=e}static get defaultOutputCalendar(){return Nd}static set defaultOutputCalendar(e){Nd=e}static get defaultWeekSettings(){return $d}static set defaultWeekSettings(e){$d=bf(e)}static get twoDigitCutoffYear(){return Id}static set twoDigitCutoffYear(e){Id=e%100}static get throwOnInvalid(){return xd}static set throwOnInvalid(e){xd=e}static resetCaches(){_e.resetCache(),ft.resetCache(),ue.resetCache(),_q()}}class Xe{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const eE=[0,31,59,90,120,151,181,212,243,273,304,334],tE=[0,31,60,91,121,152,182,213,244,274,305,335];function We(r,e){return new Xe("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${r}, which is invalid`)}function qf(r,e,t){const n=new Date(Date.UTC(r,e-1,t));r<100&&r>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const i=n.getUTCDay();return i===0?7:i}function rE(r,e,t){return t+(Nr(r)?tE:eE)[e-1]}function nE(r,e){const t=Nr(r)?tE:eE,n=t.findIndex(a=>a<e),i=e-t[n];return{month:n+1,day:i}}function Af(r,e){return(r-e+7)%7+1}function fn(r,e=4,t=1){const{year:n,month:i,day:a}=r,o=rE(n,i,a),s=Af(qf(n,i,a),t);let l=Math.floor((o-s+14-e)/7),u;return l<1?(u=n-1,l=Ar(u,e,t)):l>Ar(n,e,t)?(u=n+1,l=1):u=n,{weekYear:u,weekNumber:l,weekday:s,...Cn(r)}}function Pd(r,e=4,t=1){const{weekYear:n,weekNumber:i,weekday:a}=r,o=Af(qf(n,1,e),t),s=Jt(n);let l=i*7+a-o-7+e,u;l<1?(u=n-1,l+=Jt(u)):l>s?(u=n+1,l-=Jt(n)):u=n;const{month:h,day:c}=nE(u,l);return{year:u,month:h,day:c,...Cn(r)}}function ei(r){const{year:e,month:t,day:n}=r,i=rE(e,t,n);return{year:e,ordinal:i,...Cn(r)}}function kd(r){const{year:e,ordinal:t}=r,{month:n,day:i}=nE(e,t);return{year:e,month:n,day:i,...Cn(r)}}function Ld(r,e){if(!ce(r.localWeekday)||!ce(r.localWeekNumber)||!ce(r.localWeekYear)){if(!ce(r.weekday)||!ce(r.weekNumber)||!ce(r.weekYear))throw new Gt("Cannot mix locale-based week fields with ISO-based week fields");return ce(r.localWeekday)||(r.weekday=r.localWeekday),ce(r.localWeekNumber)||(r.weekNumber=r.localWeekNumber),ce(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 Cq(r,e=4,t=1){const n=wn(r.weekYear),i=He(r.weekNumber,1,Ar(r.weekYear,e,t)),a=He(r.weekday,1,7);return n?i?a?!1:We("weekday",r.weekday):We("week",r.weekNumber):We("weekYear",r.weekYear)}function Eq(r){const e=wn(r.year),t=He(r.ordinal,1,Jt(r.year));return e?t?!1:We("ordinal",r.ordinal):We("year",r.year)}function iE(r){const e=wn(r.year),t=He(r.month,1,12),n=He(r.day,1,dn(r.year,r.month));return e?t?n?!1:We("day",r.day):We("month",r.month):We("year",r.year)}function sE(r){const{hour:e,minute:t,second:n,millisecond:i}=r,a=He(e,0,23)||e===24&&t===0&&n===0&&i===0,o=He(t,0,59),s=He(n,0,59),l=He(i,0,999);return a?o?s?l?!1:We("millisecond",i):We("second",n):We("minute",t):We("hour",e)}function ce(r){return typeof r>"u"}function vt(r){return typeof r=="number"}function wn(r){return typeof r=="number"&&r%1===0}function Sq(r){return typeof r=="string"}function Tq(r){return Object.prototype.toString.call(r)==="[object Date]"}function oE(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function aE(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function qq(r){return Array.isArray(r)?r:[r]}function Md(r,e,t){if(r.length!==0)return r.reduce((n,i)=>{const a=[e(i),i];return n&&t(n[0],a[0])===n[0]?n:a},null)[1]}function Aq(r,e){return e.reduce((t,n)=>(t[n]=r[n],t),{})}function Yt(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function bf(r){if(r==null)return null;if(typeof r!="object")throw new Le("Week settings must be an object");if(!He(r.firstDay,1,7)||!He(r.minimalDays,1,7)||!Array.isArray(r.weekend)||r.weekend.some(e=>!He(e,1,7)))throw new Le("Invalid week settings");return{firstDay:r.firstDay,minimalDays:r.minimalDays,weekend:Array.from(r.weekend)}}function He(r,e,t){return wn(r)&&r>=e&&r<=t}function Oq(r,e){return r-e*Math.floor(r/e)}function xe(r,e=2){const t=r<0;let n;return t?n="-"+(""+-r).padStart(e,"0"):n=(""+r).padStart(e,"0"),n}function bt(r){if(!(ce(r)||r===null||r===""))return parseInt(r,10)}function Et(r){if(!(ce(r)||r===null||r===""))return parseFloat(r)}function Of(r){if(!(ce(r)||r===null||r==="")){const e=parseFloat("0."+r)*1e3;return Math.floor(e)}}function Rf(r,e,t=!1){const n=10**e;return(t?Math.trunc:Math.round)(r*n)/n}function Nr(r){return r%4===0&&(r%100!==0||r%400===0)}function Jt(r){return Nr(r)?366:365}function dn(r,e){const t=Oq(e-1,12)+1,n=r+(e-t)/12;return t===2?Nr(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function vn(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 Dd(r,e,t){return-Af(qf(r,1,e),t)+e-1}function Ar(r,e=4,t=1){const n=Dd(r,e,t),i=Dd(r+1,e,t);return(Jt(r)-n+i)/7}function wf(r){return r>99?r:r>Ne.twoDigitCutoffYear?1900+r:2e3+r}function uE(r,e,t,n=null){const i=new Date(r),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);const o={timeZoneName:e,...a},s=new Intl.DateTimeFormat(t,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function _n(r,e){let t=parseInt(r,10);Number.isNaN(t)&&(t=0);const n=parseInt(e,10)||0,i=t<0||Object.is(t,-0)?-n:n;return t*60+i}function lE(r){const e=Number(r);if(typeof r=="boolean"||r===""||Number.isNaN(e))throw new Le(`Invalid unit value ${r}`);return e}function pn(r,e){const t={};for(const n in r)if(Yt(r,n)){const i=r[n];if(i==null)continue;t[e(n)]=lE(i)}return t}function qr(r,e){const t=Math.trunc(Math.abs(r/60)),n=Math.trunc(Math.abs(r%60)),i=r>=0?"+":"-";switch(e){case"short":return`${i}${xe(t,2)}:${xe(n,2)}`;case"narrow":return`${i}${t}${n>0?`:${n}`:""}`;case"techie":return`${i}${xe(t,2)}${xe(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Cn(r){return Aq(r,["hour","minute","second","millisecond"])}const Rq=["January","February","March","April","May","June","July","August","September","October","November","December"],cE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Nq=["J","F","M","A","M","J","J","A","S","O","N","D"];function hE(r){switch(r){case"narrow":return[...Nq];case"short":return[...cE];case"long":return[...Rq];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 fE=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],dE=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Iq=["M","T","W","T","F","S","S"];function pE(r){switch(r){case"narrow":return[...Iq];case"short":return[...dE];case"long":return[...fE];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const mE=["AM","PM"],xq=["Before Christ","Anno Domini"],$q=["BC","AD"],Pq=["B","A"];function gE(r){switch(r){case"narrow":return[...Pq];case"short":return[...$q];case"long":return[...xq];default:return null}}function kq(r){return mE[r.hour<12?0:1]}function Lq(r,e){return pE(e)[r.weekday-1]}function Mq(r,e){return hE(e)[r.month-1]}function Dq(r,e){return gE(e)[r.year<0?0:1]}function jq(r,e,t="always",n=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(r)===-1;if(t==="auto"&&a){const c=r==="days";switch(e){case 1:return c?"tomorrow":`next ${i[r][0]}`;case-1:return c?"yesterday":`last ${i[r][0]}`;case 0:return c?"today":`this ${i[r][0]}`}}const o=Object.is(e,-0)||e<0,s=Math.abs(e),l=s===1,u=i[r],h=n?l?u[1]:u[2]||u[1]:l?i[r][0]:r;return o?`${s} ${h} ago`:`in ${s} ${h}`}function jd(r,e){let t="";for(const n of r)n.literal?t+=n.val:t+=e(n.val);return t}const Fq={D:hn,DD:$C,DDD:PC,DDDD:kC,t:LC,tt:MC,ttt:DC,tttt:jC,T:FC,TT:BC,TTT:UC,TTTT:VC,f:QC,ff:HC,fff:GC,ffff:KC,F:WC,FF:zC,FFF:JC,FFFF:YC};class Me{static create(e,t={}){return new Me(e,t)}static parseFormat(e){let t=null,n="",i=!1;const a=[];for(let o=0;o<e.length;o++){const s=e.charAt(o);s==="'"?(n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),t=null,n="",i=!i):i||s===t?n+=s:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(e){return Fq[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 xe(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",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(d,w)=>this.loc.extract(e,d,w),o=d=>e.isOffsetFixed&&e.offset===0&&d.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,d.format):"",s=()=>n?kq(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,w)=>n?Mq(e,d):a(w?{month:d}:{month:d,day:"numeric"},"month"),u=(d,w)=>n?Lq(e,d):a(w?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),h=d=>{const w=Me.macroTokenToFormatOpts(d);return w?this.formatWithSystemDefault(e,w):d},c=d=>n?Dq(e,d):a({era:d},"era"),f=d=>{switch(d){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({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 s();case"d":return i?a({day:"numeric"},"day"):this.num(e.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(e.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(e.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("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 h(d)}};return jd(Me.parseFormat(t),f)}formatDurationFromString(e,t){const n=l=>{switch(l[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}},i=l=>u=>{const h=n(u);return h?this.num(l.get(h),u.length):u},a=Me.parseFormat(t),o=a.reduce((l,{literal:u,val:h})=>u?l:l.concat(h),[]),s=e.shiftTo(...o.map(n).filter(l=>l));return jd(a,i(s))}}const yE=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function tr(...r){const e=r.reduce((t,n)=>t+n.source,"");return RegExp(`^${e}$`)}function rr(...r){return e=>r.reduce(([t,n,i],a)=>{const[o,s,l]=a(e,i);return[{...t,...o},s||n,l]},[{},null,1]).slice(0,2)}function nr(r,...e){if(r==null)return[null,null];for(const[t,n]of e){const i=t.exec(r);if(i)return n(i)}return[null,null]}function bE(...r){return(e,t)=>{const n={};let i;for(i=0;i<r.length;i++)n[r[i]]=bt(e[t+i]);return[n,null,t+i]}}const wE=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Bq=`(?:${wE.source}?(?:\\[(${yE.source})\\])?)?`,Nf=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,vE=RegExp(`${Nf.source}${Bq}`),If=RegExp(`(?:T${vE.source})?`),Uq=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Vq=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Qq=/(\d{4})-?(\d{3})/,Wq=bE("weekYear","weekNumber","weekDay"),Hq=bE("year","ordinal"),zq=/(\d{4})-(\d\d)-(\d\d)/,_E=RegExp(`${Nf.source} ?(?:${wE.source}|(${yE.source}))?`),Gq=RegExp(`(?: ${_E.source})?`);function Kt(r,e,t){const n=r[e];return ce(n)?t:bt(n)}function Jq(r,e){return[{year:Kt(r,e),month:Kt(r,e+1,1),day:Kt(r,e+2,1)},null,e+3]}function ir(r,e){return[{hours:Kt(r,e,0),minutes:Kt(r,e+1,0),seconds:Kt(r,e+2,0),milliseconds:Of(r[e+3])},null,e+4]}function Ir(r,e){const t=!r[e]&&!r[e+1],n=_n(r[e+1],r[e+2]),i=t?null:De.instance(n);return[{},i,e+3]}function xr(r,e){const t=r[e]?ft.create(r[e]):null;return[{},t,e+1]}const Kq=RegExp(`^T?${Nf.source}$`),Yq=/^-?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 Zq(r){const[e,t,n,i,a,o,s,l,u]=r,h=e[0]==="-",c=l&&l[0]==="-",f=(d,w=!1)=>d!==void 0&&(w||d&&h)?-d:d;return[{years:f(Et(t)),months:f(Et(n)),weeks:f(Et(i)),days:f(Et(a)),hours:f(Et(o)),minutes:f(Et(s)),seconds:f(Et(l),l==="-0"),milliseconds:f(Of(u),c)}]}const Xq={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 xf(r,e,t,n,i,a,o){const s={year:e.length===2?wf(bt(e)):bt(e),month:cE.indexOf(t)+1,day:bt(n),hour:bt(i),minute:bt(a)};return o&&(s.second=bt(o)),r&&(s.weekday=r.length>3?fE.indexOf(r)+1:dE.indexOf(r)+1),s}const eA=/^(?:(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 tA(r){const[,e,t,n,i,a,o,s,l,u,h,c]=r,f=xf(e,i,n,t,a,o,s);let d;return l?d=Xq[l]:u?d=0:d=_n(h,c),[f,new De(d)]}function rA(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const nA=/^(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$/,iA=/^(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$/,sA=/^(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 Fd(r){const[,e,t,n,i,a,o,s]=r;return[xf(e,i,n,t,a,o,s),De.utcInstance]}function oA(r){const[,e,t,n,i,a,o,s]=r;return[xf(e,s,t,n,i,a,o),De.utcInstance]}const aA=tr(Uq,If),uA=tr(Vq,If),lA=tr(Qq,If),cA=tr(vE),CE=rr(Jq,ir,Ir,xr),hA=rr(Wq,ir,Ir,xr),fA=rr(Hq,ir,Ir,xr),dA=rr(ir,Ir,xr);function pA(r){return nr(r,[aA,CE],[uA,hA],[lA,fA],[cA,dA])}function mA(r){return nr(rA(r),[eA,tA])}function gA(r){return nr(r,[nA,Fd],[iA,Fd],[sA,oA])}function yA(r){return nr(r,[Yq,Zq])}const bA=rr(ir);function wA(r){return nr(r,[Kq,bA])}const vA=tr(zq,Gq),_A=tr(_E),CA=rr(ir,Ir,xr);function EA(r){return nr(r,[vA,CE],[_A,CA])}const Bd="Invalid Duration",EE={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}},SA={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},...EE},Ve=146097/400,Ut=146097/4800,TA={years:{quarters:4,months:12,weeks:Ve/7,days:Ve,hours:Ve*24,minutes:Ve*24*60,seconds:Ve*24*60*60,milliseconds:Ve*24*60*60*1e3},quarters:{months:3,weeks:Ve/28,days:Ve/4,hours:Ve*24/4,minutes:Ve*24*60/4,seconds:Ve*24*60*60/4,milliseconds:Ve*24*60*60*1e3/4},months:{weeks:Ut/7,days:Ut,hours:Ut*24,minutes:Ut*24*60,seconds:Ut*24*60*60,milliseconds:Ut*24*60*60*1e3},...EE},Tt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],qA=Tt.slice(0).reverse();function yt(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 ye(n)}function SE(r,e){let t=e.milliseconds??0;for(const n of qA.slice(1))e[n]&&(t+=e[n]*r[n].milliseconds);return t}function Ud(r,e){const t=SE(r,e)<0?-1:1;Tt.reduceRight((n,i)=>{if(ce(e[i]))return n;if(n){const a=e[n]*t,o=r[i][n],s=Math.floor(a/o);e[i]+=s*t,e[n]-=s*o*t}return i},null),Tt.reduce((n,i)=>{if(ce(e[i]))return n;if(n){const a=e[n]%1;e[n]-=a,e[i]+=a*r[n][i]}return i},null)}function AA(r){const e={};for(const[t,n]of Object.entries(r))n!==0&&(e[t]=n);return e}class ye{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let n=t?TA:SA;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||_e.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return ye.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Le(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ye({values:pn(e,ye.normalizeUnit),loc:_e.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(vt(e))return ye.fromMillis(e);if(ye.isDuration(e))return e;if(typeof e=="object")return ye.fromObject(e);throw new Le(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=yA(e);return n?ye.fromObject(n,t):ye.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=wA(e);return n?ye.fromObject(n,t):ye.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Le("need to specify a reason the Duration is invalid");const n=e instanceof Xe?e:new Xe(e,t);if(Ne.throwOnInvalid)throw new ZT(n);return new ye({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 xC(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?Me.create(this.loc,n).formatDurationFromString(this,e):Bd}toHuman(e={}){if(!this.isValid)return Bd;const t=Tt.map(n=>{const i=this.values[n];return ce(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(i)}).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+=Rf(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},ue.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?SE(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ye.fromDurationLike(e),n={};for(const i of Tt)(Yt(t.values,i)||Yt(this.values,i))&&(n[i]=t.get(i)+this.get(i));return yt(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=ye.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]=lE(e(this.values[n],n));return yt(this,{values:t},!0)}get(e){return this[ye.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...pn(e,ye.normalizeUnit)};return yt(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:i}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:i,conversionAccuracy:n};return yt(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ud(this.matrix,e),yt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=AA(this.normalize().shiftToAll().toObject());return yt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ye.normalizeUnit(o));const t={},n={},i=this.toObject();let a;for(const o of Tt)if(e.indexOf(o)>=0){a=o;let s=0;for(const u in n)s+=this.matrix[u][o]*n[u],n[u]=0;vt(i[o])&&(s+=i[o]);const l=Math.trunc(s);t[o]=l,n[o]=(s*1e3-l*1e3)/1e3}else vt(i[o])&&(n[o]=i[o]);for(const o in n)n[o]!==0&&(t[a]+=o===a?n[o]:n[o]/this.matrix[a][o]);return Ud(this.matrix,t),yt(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 yt(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,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(const n of Tt)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Vt="Invalid Interval";function OA(r,e){return!r||!r.isValid?Te.invalid("missing or invalid start"):!e||!e.isValid?Te.invalid("missing or invalid end"):e<r?Te.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 Te{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 Le("need to specify a reason the Interval is invalid");const n=e instanceof Xe?e:new Xe(e,t);if(Ne.throwOnInvalid)throw new YT(n);return new Te({invalid:n})}static fromDateTimes(e,t){const n=wr(e),i=wr(t),a=OA(n,i);return a??new Te({start:n,end:i})}static after(e,t){const n=ye.fromDurationLike(t),i=wr(e);return Te.fromDateTimes(i,i.plus(n))}static before(e,t){const n=ye.fromDurationLike(t),i=wr(e);return Te.fromDateTimes(i.minus(n),i)}static fromISO(e,t){const[n,i]=(e||"").split("/",2);if(n&&i){let a,o;try{a=ue.fromISO(n,t),o=a.isValid}catch{o=!1}let s,l;try{s=ue.fromISO(i,t),l=s.isValid}catch{l=!1}if(o&&l)return Te.fromDateTimes(a,s);if(o){const u=ye.fromISO(i,t);if(u.isValid)return Te.after(a,u)}else if(l){const u=ye.fromISO(n,t);if(u.isValid)return Te.before(s,u)}}return Te.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const n=this.start.startOf(e,t);let i;return t!=null&&t.useLocaleWeeks?i=this.end.reconfigure({locale:n.locale}):i=this.end,i=i.startOf(e,t),Math.floor(i.diff(n,e).get(e))+(i.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?Te.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(wr).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),n=[];let{s:i}=this,a=0;for(;i<this.e;){const o=t[a]||this.e,s=+o>+this.e?this.e:o;n.push(Te.fromDateTimes(i,s)),i=s,a+=1}return n}splitBy(e){const t=ye.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:n}=this,i=1,a;const o=[];for(;n<this.e;){const s=this.start.plus(t.mapUnits(l=>l*i));a=+s>+this.e?this.e:s,o.push(Te.fromDateTimes(n,a)),n=a,i+=1}return o}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:Te.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 Te.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const i=[],a=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((l,u)=>l.time-u.time);for(const l of s)n+=l.type==="s"?1:-1,n===1?t=l.time:(t&&+t!=+l.time&&i.push(Te.fromDateTimes(t,l.time)),t=null);return Te.merge(i)}difference(...e){return Te.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Vt}[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=hn,t={}){return this.isValid?Me.create(this.s.loc.clone(t),e).formatInterval(this):Vt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vt}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vt}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ye.invalid(this.invalidReason)}mapEndpoints(e){return Te.fromDateTimes(e(this.s),e(this.e))}}class Qr{static hasDST(e=Ne.defaultZone){const t=ue.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ft.isValidZone(e)}static normalizeZone(e){return wt(e,Ne.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||_e.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||_e.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||_e.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||_e.create(t,n,a)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||_e.create(t,n,a)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null}={}){return(i||_e.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:i=null}={}){return(i||_e.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return _e.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return _e.create(t,null,"gregory").eras(e)}static features(){return{relative:oE(),localeWeek:aE()}}}function Vd(r,e){const t=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=t(e)-t(r);return Math.floor(ye.fromMillis(n).as("days"))}function RA(r,e,t){const n=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const h=Vd(l,u);return(h-h%7)/7}],["days",Vd]],i={},a=r;let o,s;for(const[l,u]of n)t.indexOf(l)>=0&&(o=l,i[l]=u(r,e),s=a.plus(i),s>e?(i[l]--,r=a.plus(i),r>e&&(s=r,i[l]--,r=a.plus(i))):r=s);return[r,i,s,o]}function NA(r,e,t,n){let[i,a,o,s]=RA(r,e,t);const l=e-i,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+l/(o-i)));const h=ye.fromObject(a,n);return u.length>0?ye.fromMillis(l,n).shiftTo(...u).plus(h):h}const IA="missing Intl.DateTimeFormat.formatToParts support";function we(r,e=t=>t){return{regex:r,deser:([t])=>e(vq(t))}}const xA=" ",TE=`[ ${xA}]`,qE=new RegExp(TE,"g");function $A(r){return r.replace(/\./g,"\\.?").replace(qE,TE)}function Qd(r){return r.replace(/\./g,"").replace(qE," ").toLowerCase()}function Ye(r,e){return r===null?null:{regex:RegExp(r.map($A).join("|")),deser:([t])=>r.findIndex(n=>Qd(t)===Qd(n))+e}}function Wd(r,e){return{regex:r,deser:([,t,n])=>_n(t,n),groups:e}}function Wr(r){return{regex:r,deser:([e])=>e}}function PA(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kA(r,e){const t=Ke(e),n=Ke(e,"{2}"),i=Ke(e,"{3}"),a=Ke(e,"{4}"),o=Ke(e,"{6}"),s=Ke(e,"{1,2}"),l=Ke(e,"{1,3}"),u=Ke(e,"{1,6}"),h=Ke(e,"{1,9}"),c=Ke(e,"{2,4}"),f=Ke(e,"{4,6}"),d=m=>({regex:RegExp(PA(m.val)),deser:([g])=>g,literal:!0}),_=(m=>{if(r.literal)return d(m);switch(m.val){case"G":return Ye(e.eras("short"),0);case"GG":return Ye(e.eras("long"),0);case"y":return we(u);case"yy":return we(c,wf);case"yyyy":return we(a);case"yyyyy":return we(f);case"yyyyyy":return we(o);case"M":return we(s);case"MM":return we(n);case"MMM":return Ye(e.months("short",!0),1);case"MMMM":return Ye(e.months("long",!0),1);case"L":return we(s);case"LL":return we(n);case"LLL":return Ye(e.months("short",!1),1);case"LLLL":return Ye(e.months("long",!1),1);case"d":return we(s);case"dd":return we(n);case"o":return we(l);case"ooo":return we(i);case"HH":return we(n);case"H":return we(s);case"hh":return we(n);case"h":return we(s);case"mm":return we(n);case"m":return we(s);case"q":return we(s);case"qq":return we(n);case"s":return we(s);case"ss":return we(n);case"S":return we(l);case"SSS":return we(i);case"u":return Wr(h);case"uu":return Wr(s);case"uuu":return we(t);case"a":return Ye(e.meridiems(),0);case"kkkk":return we(a);case"kk":return we(c,wf);case"W":return we(s);case"WW":return we(n);case"E":case"c":return we(t);case"EEE":return Ye(e.weekdays("short",!1),1);case"EEEE":return Ye(e.weekdays("long",!1),1);case"ccc":return Ye(e.weekdays("short",!0),1);case"cccc":return Ye(e.weekdays("long",!0),1);case"Z":case"ZZ":return Wd(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return Wd(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return Wr(/[a-z_+-/]{1,256}?/i);case" ":return Wr(/[^\S\n\r]/);default:return d(m)}})(r)||{invalidReason:IA};return _.token=r,_}const LA={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 MA(r,e,t){const{type:n,value:i}=r;if(n==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const a=e[n];let o=n;n==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let s=LA[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function DA(r){return[`^${r.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,r]}function jA(r,e,t){const n=r.match(e);if(n){const i={};let a=1;for(const o in t)if(Yt(t,o)){const s=t[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(a,a+l))),a+=l}return[n,i]}else return[n,{}]}function FA(r){const e=a=>{switch(a){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 ce(r.z)||(t=ft.create(r.z)),ce(r.Z)||(t||(t=new De(r.Z)),n=r.Z),ce(r.q)||(r.M=(r.q-1)*3+1),ce(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),ce(r.u)||(r.S=Of(r.u)),[Object.keys(r).reduce((a,o)=>{const s=e(o);return s&&(a[s]=r[o]),a},{}),t,n]}let ti=null;function BA(){return ti||(ti=ue.fromMillis(1555555555555)),ti}function UA(r,e){if(r.literal)return r;const t=Me.macroTokenToFormatOpts(r.val),n=NE(t,e);return n==null||n.includes(void 0)?r:n}function AE(r,e){return Array.prototype.concat(...r.map(t=>UA(t,e)))}class OE{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=AE(Me.parseFormat(t),e),this.units=this.tokens.map(n=>kA(n,e)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){const[n,i]=DA(this.units);this.regex=RegExp(n,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){const[t,n]=jA(e,this.regex,this.handlers),[i,a,o]=n?FA(n):[null,null,void 0];if(Yt(n,"a")&&Yt(n,"H"))throw new Gt("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:i,zone:a,specificOffset:o}}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 RE(r,e,t){return new OE(r,t).explainFromTokens(e)}function VA(r,e,t){const{result:n,zone:i,specificOffset:a,invalidReason:o}=RE(r,e,t);return[n,i,a,o]}function NE(r,e){if(!r)return null;const n=Me.create(e,r).dtFormatter(BA()),i=n.formatToParts(),a=n.resolvedOptions();return i.map(o=>MA(o,r,a))}const ri="Invalid DateTime",Hd=864e13;function Sr(r){return new Xe("unsupported zone",`the zone "${r.name}" is not supported`)}function ni(r){return r.weekData===null&&(r.weekData=fn(r.c)),r.weekData}function ii(r){return r.localWeekData===null&&(r.localWeekData=fn(r.c,r.loc.getMinDaysInFirstWeek(),r.loc.getStartOfWeek())),r.localWeekData}function St(r,e){const t={ts:r.ts,zone:r.zone,c:r.c,o:r.o,loc:r.loc,invalid:r.invalid};return new ue({...t,...e,old:t})}function IE(r,e,t){let n=r-e*60*1e3;const i=t.offset(n);if(e===i)return[n,e];n-=(i-e)*60*1e3;const a=t.offset(n);return i===a?[n,i]:[r-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Hr(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 ln(r,e,t){return IE(vn(r),e,t)}function zd(r,e){const t=r.o,n=r.c.year+Math.trunc(e.years),i=r.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...r.c,year:n,month:i,day:Math.min(r.c.day,dn(n,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ye.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"),s=vn(a);let[l,u]=IE(s,t,r.zone);return o!==0&&(l+=o,u=r.zone.offset(l)),{ts:l,o:u}}function Qt(r,e,t,n,i,a){const{setZone:o,zone:s}=t;if(r&&Object.keys(r).length!==0||e){const l=e||s,u=ue.fromObject(r,{...t,zone:l,specificOffset:a});return o?u:u.setZone(s)}else return ue.invalid(new Xe("unparsable",`the input "${i}" can't be parsed as ${n}`))}function zr(r,e,t=!0){return r.isValid?Me.create(_e.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(r,e):null}function si(r,e){const t=r.c.year>9999||r.c.year<0;let n="";return t&&r.c.year>=0&&(n+="+"),n+=xe(r.c.year,t?6:4),e?(n+="-",n+=xe(r.c.month),n+="-",n+=xe(r.c.day)):(n+=xe(r.c.month),n+=xe(r.c.day)),n}function Gd(r,e,t,n,i,a){let o=xe(r.c.hour);return e?(o+=":",o+=xe(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!t)&&(o+=":")):o+=xe(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!t)&&(o+=xe(r.c.second),(r.c.millisecond!==0||!n)&&(o+=".",o+=xe(r.c.millisecond,3))),i&&(r.isOffsetFixed&&r.offset===0&&!a?o+="Z":r.o<0?(o+="-",o+=xe(Math.trunc(-r.o/60)),o+=":",o+=xe(Math.trunc(-r.o%60))):(o+="+",o+=xe(Math.trunc(r.o/60)),o+=":",o+=xe(Math.trunc(r.o%60)))),a&&(o+="["+r.zone.ianaName+"]"),o}const xE={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},QA={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},WA={ordinal:1,hour:0,minute:0,second:0,millisecond:0},$E=["year","month","day","hour","minute","second","millisecond"],HA=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],zA=["year","ordinal","hour","minute","second","millisecond"];function GA(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 xC(r);return e}function Jd(r){switch(r.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return GA(r)}}function JA(r){if(Tr===void 0&&(Tr=Ne.now()),r.type!=="iana")return r.offset(Tr);const e=r.name;let t=vf.get(e);return t===void 0&&(t=r.offset(Tr),vf.set(e,t)),t}function Kd(r,e){const t=wt(e.zone,Ne.defaultZone);if(!t.isValid)return ue.invalid(Sr(t));const n=_e.fromObject(e);let i,a;if(ce(r.year))i=Ne.now();else{for(const l of $E)ce(r[l])&&(r[l]=xE[l]);const o=iE(r)||sE(r);if(o)return ue.invalid(o);const s=JA(t);[i,a]=ln(r,s,t)}return new ue({ts:i,zone:t,loc:n,o:a})}function Yd(r,e,t){const n=ce(t.round)?!0:t.round,i=(o,s)=>(o=Rf(o,n||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,s)),a=o=>t.calendary?e.hasSame(r,o)?0:e.startOf(o).diff(r.startOf(o),o).get(o):e.diff(r,o).get(o);if(t.unit)return i(a(t.unit),t.unit);for(const o of t.units){const s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(r>e?-0:0,t.units[t.units.length-1])}function Zd(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 Tr;const vf=new Map;class ue{constructor(e){const t=e.zone||Ne.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Xe("invalid input"):null)||(t.isValid?null:Sr(t));this.ts=ce(e.ts)?Ne.now():e.ts;let i=null,a=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[i,a]=[e.old.c,e.old.o];else{const s=vt(e.o)&&!e.old?e.o:t.offset(this.ts);i=Hr(this.ts,s),n=Number.isNaN(i.year)?new Xe("invalid input"):null,i=n?null:i,a=n?null:s}this._zone=t,this.loc=e.loc||_e.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new ue({})}static local(){const[e,t]=Zd(arguments),[n,i,a,o,s,l,u]=t;return Kd({year:n,month:i,day:a,hour:o,minute:s,second:l,millisecond:u},e)}static utc(){const[e,t]=Zd(arguments),[n,i,a,o,s,l,u]=t;return e.zone=De.utcInstance,Kd({year:n,month:i,day:a,hour:o,minute:s,second:l,millisecond:u},e)}static fromJSDate(e,t={}){const n=Tq(e)?e.valueOf():NaN;if(Number.isNaN(n))return ue.invalid("invalid input");const i=wt(t.zone,Ne.defaultZone);return i.isValid?new ue({ts:n,zone:i,loc:_e.fromObject(t)}):ue.invalid(Sr(i))}static fromMillis(e,t={}){if(vt(e))return e<-Hd||e>Hd?ue.invalid("Timestamp out of range"):new ue({ts:e,zone:wt(t.zone,Ne.defaultZone),loc:_e.fromObject(t)});throw new Le(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(vt(e))return new ue({ts:e*1e3,zone:wt(t.zone,Ne.defaultZone),loc:_e.fromObject(t)});throw new Le("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=wt(t.zone,Ne.defaultZone);if(!n.isValid)return ue.invalid(Sr(n));const i=_e.fromObject(t),a=pn(e,Jd),{minDaysInFirstWeek:o,startOfWeek:s}=Ld(a,i),l=Ne.now(),u=ce(t.specificOffset)?n.offset(l):t.specificOffset,h=!ce(a.ordinal),c=!ce(a.year),f=!ce(a.month)||!ce(a.day),d=c||f,w=a.weekYear||a.weekNumber;if((d||h)&&w)throw new Gt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&h)throw new Gt("Can't mix ordinal dates with month/day");const _=w||a.weekday&&!d;let m,g,p=Hr(l,u);_?(m=HA,g=QA,p=fn(p,o,s)):h?(m=zA,g=WA,p=ei(p)):(m=$E,g=xE);let b=!1;for(const C of m){const q=a[C];ce(q)?b?a[C]=g[C]:a[C]=p[C]:b=!0}const v=_?Cq(a,o,s):h?Eq(a):iE(a),E=v||sE(a);if(E)return ue.invalid(E);const T=_?Pd(a,o,s):h?kd(a):a,[S,R]=ln(T,u,n),j=new ue({ts:S,zone:n,o:R,loc:i});return a.weekday&&d&&e.weekday!==j.weekday?ue.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${j.toISO()}`):j.isValid?j:ue.invalid(j.invalid)}static fromISO(e,t={}){const[n,i]=pA(e);return Qt(n,i,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,i]=mA(e);return Qt(n,i,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,i]=gA(e);return Qt(n,i,t,"HTTP",t)}static fromFormat(e,t,n={}){if(ce(e)||ce(t))throw new Le("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:a=null}=n,o=_e.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,l,u,h]=VA(o,e,t);return h?ue.invalid(h):Qt(s,l,n,`format ${t}`,e,u)}static fromString(e,t,n={}){return ue.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,i]=EA(e);return Qt(n,i,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Le("need to specify a reason the DateTime is invalid");const n=e instanceof Xe?e:new Xe(e,t);if(Ne.throwOnInvalid)throw new KT(n);return new ue({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=NE(e,_e.fromObject(t));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(e,t={}){return AE(Me.parseFormat(e),_e.fromObject(t)).map(i=>i.val).join("")}static resetCache(){Tr=void 0,vf.clear()}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?ni(this).weekYear:NaN}get weekNumber(){return this.isValid?ni(this).weekNumber:NaN}get weekday(){return this.isValid?ni(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ii(this).weekday:NaN}get localWeekNumber(){return this.isValid?ii(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ii(this).weekYear:NaN}get ordinal(){return this.isValid?ei(this.c).ordinal:NaN}get monthShort(){return this.isValid?Qr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Qr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Qr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Qr.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=vn(this.c),i=this.zone.offset(n-e),a=this.zone.offset(n+e),o=this.zone.offset(n-i*t),s=this.zone.offset(n-a*t);if(o===s)return[this];const l=n-o*t,u=n-s*t,h=Hr(l,o),c=Hr(u,s);return h.hour===c.hour&&h.minute===c.minute&&h.second===c.second&&h.millisecond===c.millisecond?[St(this,{ts:l}),St(this,{ts:u})]:[this]}get isInLeapYear(){return Nr(this.year)}get daysInMonth(){return dn(this.year,this.month)}get daysInYear(){return this.isValid?Jt(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ar(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ar(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:i}=Me.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:i}}toUTC(e=0,t={}){return this.setZone(De.instance(e),t)}toLocal(){return this.setZone(Ne.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if(e=wt(e,Ne.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(t||n){const a=e.offset(this.ts),o=this.toObject();[i]=ln(o,a,e)}return St(this,{ts:i,zone:e})}else return ue.invalid(Sr(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){const i=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return St(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=pn(e,Jd),{minDaysInFirstWeek:n,startOfWeek:i}=Ld(t,this.loc),a=!ce(t.weekYear)||!ce(t.weekNumber)||!ce(t.weekday),o=!ce(t.ordinal),s=!ce(t.year),l=!ce(t.month)||!ce(t.day),u=s||l,h=t.weekYear||t.weekNumber;if((u||o)&&h)throw new Gt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Gt("Can't mix ordinal dates with month/day");let c;a?c=Pd({...fn(this.c,n,i),...t},n,i):ce(t.ordinal)?(c={...this.toObject(),...t},ce(t.day)&&(c.day=Math.min(dn(c.year,c.month),c.day))):c=kd({...ei(this.c),...t});const[f,d]=ln(c,this.o,this.zone);return St(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=ye.fromDurationLike(e);return St(this,zd(this,t))}minus(e){if(!this.isValid)return this;const t=ye.fromDurationLike(e).negate();return St(this,zd(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},i=ye.normalizeUnit(e);switch(i){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(i==="weeks")if(t){const a=this.loc.getStartOfWeek(),{weekday:o}=this;o<a&&(n.weekNumber=this.weekNumber-1),n.weekday=a}else n.weekday=1;if(i==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-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?Me.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ri}toLocaleString(e=hn,t={}){return this.isValid?Me.create(this.loc.clone(t),e).formatDateTime(this):ri}toLocaleParts(e={}){return this.isValid?Me.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;const o=e==="extended";let s=si(this,o);return s+="T",s+=Gd(this,o,t,n,i,a),s}toISODate({format:e="extended"}={}){return this.isValid?si(this,e==="extended"):null}toISOWeekDate(){return zr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+Gd(this,o==="extended",t,e,n,a):null}toRFC2822(){return zr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?si(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(t||e)&&(n&&(i+=" "),t?i+="z":e&&(i+="ZZ")),zr(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ri}[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 ye.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=qq(t).map(ye.normalizeUnit),o=e.valueOf()>this.valueOf(),s=o?this:e,l=o?e:this,u=NA(s,l,a,i);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(ue.now(),e,t)}until(e){return this.isValid?Te.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const i=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(t,n)<=i&&i<=a.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||ue.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0;let i=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(i=e.unit,a=void 0),Yd(t,this.plus(n),{...e,numeric:"always",units:i,unit:a})}toRelativeCalendar(e={}){return this.isValid?Yd(e.base||ue.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(ue.isDateTime))throw new Le("min requires all arguments be DateTimes");return Md(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(ue.isDateTime))throw new Le("max requires all arguments be DateTimes");return Md(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:i=null,numberingSystem:a=null}=n,o=_e.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return RE(o,e,t)}static fromStringExplain(e,t,n={}){return ue.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:i=null}=t,a=_e.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return new OE(a,e)}static fromFormatParser(e,t,n={}){if(ce(e)||ce(t))throw new Le("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:a=null}=n,o=_e.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(t.locale))throw new Le(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:s,zone:l,specificOffset:u,invalidReason:h}=t.explainFromTokens(e);return h?ue.invalid(h):Qt(s,l,n,`format ${t.format}`,e,u)}static get DATE_SHORT(){return hn}static get DATE_MED(){return $C}static get DATE_MED_WITH_WEEKDAY(){return XT}static get DATE_FULL(){return PC}static get DATE_HUGE(){return kC}static get TIME_SIMPLE(){return LC}static get TIME_WITH_SECONDS(){return MC}static get TIME_WITH_SHORT_OFFSET(){return DC}static get TIME_WITH_LONG_OFFSET(){return jC}static get TIME_24_SIMPLE(){return FC}static get TIME_24_WITH_SECONDS(){return BC}static get TIME_24_WITH_SHORT_OFFSET(){return UC}static get TIME_24_WITH_LONG_OFFSET(){return VC}static get DATETIME_SHORT(){return QC}static get DATETIME_SHORT_WITH_SECONDS(){return WC}static get DATETIME_MED(){return HC}static get DATETIME_MED_WITH_SECONDS(){return zC}static get DATETIME_MED_WITH_WEEKDAY(){return eq}static get DATETIME_FULL(){return GC}static get DATETIME_FULL_WITH_SECONDS(){return JC}static get DATETIME_HUGE(){return KC}static get DATETIME_HUGE_WITH_SECONDS(){return YC}}function wr(r){if(ue.isDateTime(r))return r;if(r&&r.valueOf&&vt(r.valueOf()))return ue.fromJSDate(r);if(r&&typeof r=="object")return ue.fromObject(r);throw new Le(`Unknown datetime argument: ${r}, of type ${typeof r}`)}const KA=r=>{const e=[],t=YA(r);let n=t.next();for(;n;)e.push(n),n=t.next();return e},YA=r=>({...r,next:ZA(r)}),ZA=r=>{let e=r.start;return()=>{if(e==null)return null;let t=null;switch(r.granularity){case nt.Total:t=XA(e,r.end);break;case nt.Annual:t=eO(e,r.end);break;case nt.SemiAnnual:t=tO(e,r.end);break;case nt.Quarterly:t=rO(e,r.end);break;case nt.Monthly:t=nO(e,r.end);break;case nt.Weekly:t=iO(e,r.end);break;case nt.Daily:t=sO(e,r.end);break;case nt.Hourly:t=oO(e,r.end)}return t===null?e=null:e=t.end.plus({milliseconds:1}),t}},XA=(r,e)=>e<=r?null:{period:"total",start:r,end:e},eO=(r,e)=>{if(e<=r)return null;const t=r.toUTC(),n=ue.utc(t.year,t.month,t.day).plus({years:1});return{period:"annual",start:r,end:n}},tO=(r,e)=>{if(e<=r)return null;const t=ue.utc(r.year,7,1),n=ue.utc(r.year,12,31,23,59,59,999);let i;return t>r?i=t:i=n,i>e&&(i=e),{period:"semiAnnual",start:r,end:i}},rO=(r,e)=>{if(e<=r)return null;let t;const n=r.toUTC(),i=n.month;return i<3?t=ue.utc(n.year,4,1):i<6?t=ue.utc(n.year,7,1):i<9?t=ue.utc(n.year,10,1):t=ue.utc(n.year,12,31,23,59,59,999),t>e&&(t=e),{period:"quarterly",start:r,end:t}},nO=(r,e)=>{if(e<=r)return null;const t=r.toUTC();let n=ue.utc(t.year,t.month,t.day).plus({months:1}).startOf("month");return n>e&&(r.hasSame(e,"month")||(n=e)),{period:"monthly",start:r,end:n}},iO=(r,e)=>{if(e<=r)return null;const t=r.toUTC(),n=ue.utc(t.year,t.month,t.day).plus({weeks:1}).startOf("week");return n>e&&!n.hasSame(e,"day")?{period:"weekly",start:r,end:e}:{period:"weekly",start:r,end:n}},sO=(r,e)=>{if(e<=r)return null;let n=r.toUTC().plus({days:1}).startOf("day");return(n>e||n.hasSame(e,"day"))&&(n=e),{period:"daily",start:r,end:n}},oO=(r,e)=>{if(e<=r)return null;let n=r.toUTC().plus({hours:1});return n>e&&r.hour!==e.hour&&(n=e.toUTC()),{period:"hourly",start:r,end:n}},aO=r=>Math.floor((r.month-1)/3)+1;class $f{static discretize(e,t,n,i,a){const o=this._buildIndex(e,t),s=KA(this._calculateRange(n,i,a,e)),l=this._discretizeNode(o,{},t,s);return this._groupResultsByPeriod(s,l)}static _calculateRange(e,t,n,i){let a=e||null,o=t||null;if(a==null||o==null)for(const s of i){a==null&&(a=s.start);const l=s.end||s.start;(o==null||o<l)&&(o=l)}if(a==null||o==null)throw new Error("Cannot determine query start and/or end.");return{start:a,end:o,granularity:n}}static _groupResultsByPeriod(e,t){const n={};for(const i of e){const a=i.start.toISO()+"-"+i.period,o=$f._getPeriodString(i);n[a]={period:o,start:i.start,end:i.end,rows:[]}}for(const i of t)for(const a of Object.keys(i.series))n[a].rows.push({dimensions:i.dimensions,metric:i.metric,unit:i.unit=="__NULL__"?null:i.unit,value:i.series[a].inc,sum:i.series[a].sum});return Object.values(n)}static _getPeriodString(e){switch(e.period){case"annual":return e.start.year.toString();case"semiAnnual":return`${e.start.year}/${e.start.month<7?"H1":"H2"}`;case"quarterly":return`${e.start.year}/Q${aO(e.start)}`;case"monthly":const t=e.start.toUTC().month,n=t<10?`0${t}`:`${t}`;return`${e.start.year}/${n}`;case"weekly":return`${e.start.weekYear}/W${e.start.weekNumber}`;case"daily":const i=e.start.month,a=e.start.day,o=i<10?`0${i}`:`${i}`,s=a<10?`0${a}`:`${a}`;return`${e.start.year}/${o}/${s}`;case"hourly":const l=e.start.month,u=e.start.day,h=e.start.hour,c=l<10?`0${l}`:`${l}`,f=u<10?`0${u}`:`${u}`,d=h<10?`0${h}`:`${h}`;return`${e.start.year}/${c}/${f}/${d}`;default:return e.period}}static _discretizeNode(e,t,n,i){const a=[];if(n.length>0){const o=n[0];Object.keys(e).forEach((s,l,u)=>{const h={...t};h[o]=s,a.push(...this._discretizeNode(e[s],h,n.slice(1),i))})}else Object.keys(e).forEach(o=>{a.push(...this._discretizeLeaf(e[o],i,o,t))});return a}static _discretizeLeaf(e,t,n,i){const a=[];return Object.keys(e).forEach(o=>{const s={};Object.keys(i).forEach(l=>{s[l]={path:e[o][0].dimensions[l],icon:e[o][0].dimensions.icon,label:e[o][0].dimensions.label,description:e[o][0].dimensions.description}}),a.push({unit:o,metric:n,dimensions:s,series:this._discretizeSeries(e[o],t)})}),a}static _discretizeSeries(e,t){const n={};for(const i of e){let a=this._getValue(i,t[0].start);for(const o of t){const s=this._getValue(i,o.end),l=`${o.start.toISO()}-${o.period}`;n[l]?(n[l].inc+=s-a,n[l].sum+=s):n[l]={inc:s-a,sum:s},a=s}}return n}static _getValue(e,t){switch(e.fn){case"Single":return this._getSingleValue(e,t);case"DssVest":return this._getVestValue(e,t);default:return 0}}static _getSingleValue(e,t){return t>=e.start?e.value:0}static _getVestValue(e,t){var u;const n=t,i=e.start,a=e.end,o=(u=e.params)!=null&&u.cliff?ue.fromISO(e.params.cliff):null;if(n<i||o&&n<o)return 0;if(a&&n>=a)return e.value;const s=Te.fromDateTimes(i,n),l=Te.fromDateTimes(i,a||n);return s.length()/l.length()*e.value}static _buildIndex(e,t){const n={},i={},a=t[0]||"";for(const o of e){const s=o.dimensions[a];i[s]===void 0&&(i[s]=[]),i[s].push(o)}if(t.length>1){const o=t.slice(1);Object.keys(i).forEach(s=>{n[s]=this._buildIndex(i[s],o)})}else Object.keys(i).forEach(o=>{n[o]=this._buildMetricsIndex(i[o])});return n}static _buildMetricsIndex(e){const t={},n={};for(const i of e){const a=i.metric;n[a]===void 0&&(n[a]=[]),n[a].push(i)}return Object.keys(n).forEach(i=>t[i]=this._buildUnitIndex(n[i])),t}static _buildUnitIndex(e){const t={};for(const n of e){const i=n.unit||"__NULL__";t[i]===void 0&&(t[i]=[]),t[i].push(n)}return t}}class uO{constructor(e,t){de(this,"_analyticsStore");de(this,"_profiler");this._analyticsStore=e,this._profiler=t??new IC}async executeCompound(e){let t;const n={start:e.start,end:e.end,granularity:e.granularity,lod:e.lod,select:e.select,metrics:e.expression.inputs.metrics,currency:e.expression.inputs.currency},i={start:e.start,end:e.end,granularity:e.granularity,lod:{priceData:1},select:{priceData:[it.fromString("atlas")]},metrics:[e.expression.operand.metric],currency:e.expression.operand.currency},a=await this.execute(n),o=await this.execute(i);return[je.VectorAdd,je.VectorSubtract].includes(e.expression.operator)?t=await this._profiler.record("ApplyVectorOperator",async()=>await this._applyVectorOperator(a,o,e.expression.operator,e.expression.resultCurrency)):t=await this._profiler.record("ApplyScalarOperator",async()=>await this._applyScalarOperator(a,o,e.expression.operator,e.expression.operand.useSum,e.expression.resultCurrency)),t}async execute(e){const t=await this._executeSeriesQuery(e),n=this._profiler.recordSync("ApplyLODs",()=>this._applyLods(t,e.lod)),i=Object.keys(e.select);return this._profiler.recordSync("Discretize",()=>n.length<1?[]:$f.discretize(n,i,e.start,e.end,e.granularity))}async executeMultiCurrency(e,t){const n={...e,currency:t.targetCurrency??e.currency};let i=await this.execute(n);for(const a of t.conversions){const o={start:e.start,end:e.end,granularity:e.granularity,lod:e.lod,select:e.select,expression:{inputs:{metrics:n.metrics,currency:a.currency},operator:je.ScalarMultiply,operand:{metric:a.metric,currency:t.targetCurrency,useSum:!0},resultCurrency:t.targetCurrency}},s=await this.executeCompound(o);i=await this._applyVectorOperator(i,s,je.VectorAdd,t.targetCurrency)}return i}async _applyVectorOperator(e,t,n,i){if([je.ScalarMultiply,je.ScalarDivide].includes(n))throw new Error("Invalid operator for vector operation");return t}async _applyScalarOperator(e,t,n,i,a){if([je.VectorAdd,je.VectorSubtract].includes(n))throw new Error("Invalid operator for scalar operation");const o=[],s={},l=i?"sum":"value";for(const u of t)u.rows.length>0&&(s[u.period]=u.rows[0][l]);for(const u of e){const h={period:u.period,start:u.start,end:u.end,rows:u.rows.map(c=>({dimensions:c.dimensions,metric:c.metric,unit:a?a.toString():c.unit,value:this._calculateOutputValue(c.value,n,s[u.period]),sum:-1}))};o.push(h)}return o}_calculateOutputValue(e,t,n){switch(t){case je.VectorAdd:return e+n;case je.VectorSubtract:return e-n;case je.ScalarMultiply:return e*n;case je.ScalarDivide:return e/n}}async _executeSeriesQuery(e){const t={start:e.start,end:e.end,select:e.select,metrics:e.metrics,currency:e.currency};return await this._analyticsStore.getMatchingSeries(t)}_applyLods(e,t){return e.map(n=>({...n,dimensions:this._applyDimensionsLods(n.dimensions,t)}))}_applyDimensionsLods(e,t){const n={};for(const[i,a]of Object.entries(t))a!==null&&e[i]&&(n[i]=e[i].path.applyLod(a).toString(),n.icon=e[i].icon.toString(),n.label=e[i].label.toString(),n.description=e[i].description.toString());return n}async getDimensions(){return await this._analyticsStore.getDimensions()}}class lO extends Error{constructor(t){super(t.map(n=>n.message).join(`
3
3
  `));de(this,"innerErrors");this.name="NotificationError",this.innerErrors=t}}class cO{constructor(){de(this,"_subscriptions",new Map)}subscribeToPath(e,t){const n=this.normalizePath(e.toString("/"));return this._subscriptions.has(n)||this._subscriptions.set(n,new Set),this._subscriptions.get(n).add(t),()=>{const i=this._subscriptions.get(n);i&&(i.delete(t),i.size===0&&this._subscriptions.delete(n))}}notifySubscribers(e){if(e.length===0||this._subscriptions.size===0)return;const t=[];for(const n of e){const i=this.normalizePath(n.toString("/")),a=this.getPathPrefixes(i),o=[];a.filter(s=>this._subscriptions.has(s)).forEach(s=>{o.push({prefix:s,callbacks:this._subscriptions.get(s)})});for(const[s,l]of this._subscriptions.entries())a.includes(s)||this.pathMatchesWildcardPattern(i,s)&&o.push({prefix:s,callbacks:l});if(o.length!==0)for(const{callbacks:s}of o)for(const l of s)try{l(n)}catch(u){t.push(u)}}if(t.length>0)throw new lO(t)}normalizePath(e){return"/"+e.split("/").filter(i=>i.length>0).join("/")}pathMatchesWildcardPattern(e,t){if(t.includes("*")){const n=e.split("/").filter(a=>a.length>0),i=t.split("/").filter(a=>a.length>0);if(i.length>n.length)return!1;for(let a=0;a<i.length;a++){const o=i[a],s=n[a];if(!(o==="*"||o.startsWith("*:"))&&o!==s)return!1}return!0}return e===t||e.startsWith(t+"/")}getPathPrefixes(e){const t=e.split("/").filter(a=>a.length>0),n=[];let i="";for(const a of t)i=i?`${i}/${a}`:`/${a}`,n.push(i);return n.length===0&&e==="/"&&n.push("/"),n}}function hO(r){return r.replace(/\w+/g,function(e){return e[0].toUpperCase()+e.slice(1)}).replace(/\s+/g,"")}class fO{constructor({executor:e,knex:t}){de(this,"_executor");de(this,"_knex");de(this,"_subscriptionManager",new cO);this._executor=e,this._knex=t}destroy(){this._knex.destroy()}async clearSeriesBySource(e,t=!1){const n=this._knex("AnalyticsSeries").whereLike("source",e.toString("/%")).delete();let i=await this._executor.execute(n);return t&&(i+=await this.clearEmptyAnalyticsDimensions()),this._subscriptionManager.notifySubscribers([e]),i}async clearEmptyAnalyticsDimensions(){const e=this._knex("AnalyticsDimension AS AD").whereNotExists(t=>t.select("*").from("AnalyticsSeries_AnalyticsDimension AS ASAD").where("ASAD.dimensionId",this._knex.ref("AD.id"))).delete();return await this._executor.execute(e)}async getMatchingSeries(e){const t=e.currency?e.currency.firstSegment().filters:null,n=this._buildViewQuery("AV",Object.keys(e.select),e.metrics.map(o=>o),t,e.end),i=this._knex(this._knex.raw(n)).select("AV.*");for(const[o,s]of Object.entries(e.select))i.leftJoin(`AnalyticsDimension as ${o}`,l=>{l.on(`${o}.path`,`dim_${o}`)}),i.select(`${o}.icon as dim_icon`),i.select(`${o}.description as dim_description`),i.select(`${o}.label as dim_label`),s.length==1?i.andWhereLike(`dim_${o}`,s[0].toString("/%")):s.length>1&&i.andWhere(l=>(s.forEach(u=>l.orWhereLike(`dim_${o}`,u.toString("/%"))),l));i.orderBy("start");const a=await this._executor.execute(i);return this._formatQueryRecords(a,Object.keys(e.select))}async addSeriesValue(e){return this.addSeriesValues([e])}async addSeriesValues(e){const t={};for(let i=0;i<e.length;i++){const a=e[i],o=this._knex("AnalyticsSeries").insert({start:a.start.toJSDate(),end:a.end?a.end.toJSDate():null,source:a.source.toString("/"),metric:hO(a.metric),value:a.value,unit:a.unit||null,fn:a.fn||"Single",params:a.params||null},"id"),s=await this._executor.execute(o);for(const[l,u]of Object.entries(e[i].dimensions||{})){t[l]||(t[l]={});const h=u.toString("/");t[l][h]||(t[l][h]=[]),t[l][h].push(s[0].id)}}for(const[i,a]of Object.entries(t))await this._linkDimensions(i,a);for(let i=0;i<e.length;i++){const a=e[i].dimensionMetadata;a&&await this.addDimensionMetadata(a.path,a.icon,a.label,a.description)}const n=e.map(i=>i.source);this._subscriptionManager.notifySubscribers(n)}_formatQueryRecords(e,t){return e.map(i=>{const a={id:i.id,source:it.fromString(i.source.slice(0,-1)),start:ue.fromJSDate(i.start),end:i.end?ue.fromJSDate(i.end):null,metric:i.metric,value:i.value,unit:i.unit,fn:i.fn,params:i.params,dimensions:{}};return t.forEach(o=>a.dimensions[o]={path:it.fromString(i[`dim_${o}`]?i[`dim_${o}`].slice(0,-1):"?"),icon:i.dim_icon?i.dim_icon:"",label:i.dim_label?i.dim_label:"",description:i.dim_description?i.dim_description:""}),a}).sort((i,a)=>i.id-a.id)}_buildViewQuery(e,t,n,i,a){const o=this._knex("AnalyticsSeries as AS_inner").select("*").whereIn("metric",n);for(const s of t)o.select(this._buildDimensionQuery(s));return i&&i.length>0&&i[0]!==""&&o.whereIn("unit",i),a&&o.where("start","<",a.toISO()),`(${o.toString()}) AS "${e}"`}_buildDimensionQuery(e){const t=this._knex.ref("AS_inner.id");return this._knex("AnalyticsSeries_AnalyticsDimension as ASAD").leftJoin("AnalyticsDimension as AD","AD.id","ASAD.dimensionId").where("ASAD.seriesId",t).where("AD.dimension",e).select("path").as(`dim_${e}`)}async _linkDimensions(e,t){const n=this._knex("AnalyticsDimension").select("path","id").where("dimension",e).whereIn("path",Object.keys(t)),i=await this._executor.execute(n);for(const[a,o]of Object.entries(t)){const s=i.findIndex(u=>u.path==a),l=s<0?await this._createDimensionPath(e,a):i[s].id;for(let u=0;u<o.length;u++){const h=this._knex("AnalyticsSeries_AnalyticsDimension").insert({seriesId:o[u],dimensionId:l});await this._executor.execute(h)}}}async _createDimensionPath(e,t){const n=this._knex("AnalyticsDimension").insert({dimension:e,path:t},"id");return(await this._executor.execute(n))[0].id}async addDimensionMetadata(e,t,n,i){if(!t&&!n&&!i)return;const a=this._knex("AnalyticsDimension").where("path",`${e.toString()}/`).update({icon:t||"",label:n||"",description:i||""});await this._executor.execute(a)}async getDimensions(){const e=this._knex.select("dimension","path","icon","label","description").from("AnalyticsDimension").whereNotNull("path").whereNot("path","").whereNot("path","/"),n=(await this._executor.execute(e)).reduce((a,o)=>(a[o.dimension]||(a[o.dimension]={name:o.dimension,values:[]}),a[o.dimension].values.push({path:o.path,icon:o.icon,label:o.label,description:o.description}),a),{});return Object.values(n)}async getMetrics(){const e=this._knex("AnalyticsSeries").select("metric").distinct().whereNotNull("metric"),n=(await this._executor.execute(e)).map(a=>a.metric);return["Budget","Forecast","Actuals","PaymentsOnChain","PaymentsOffChainIncluded"].forEach(a=>{n.includes(a)||n.push(a)}),n}async getCurrencies(){const e=this._knex("AnalyticsSeries").select("unit").distinct().whereNotNull("unit");return(await this._executor.execute(e)).map(n=>n.unit)}subscribeToSource(e,t){return this._subscriptionManager.subscribeToPath(e,t)}}var Gr={exports:{}},Jr={},Kr={},Yr={},Xd;function PE(){if(Xd)return Yr;Xd=1,Object.defineProperty(Yr,"__esModule",{value:!0});let r=class extends Error{};return Yr.TimeoutError=r,Yr}var Ze={},Zr={},ep;function dO(){if(ep)return Zr;ep=1,Object.defineProperty(Zr,"__esModule",{value:!0});let r=class{constructor(t){this._value=t.value,this._error=t.error}value(){return this._value}reason(){return this._error}isRejected(){return!!this._error}isFulfilled(){return!!this._value}};return Zr.PromiseInspection=r,Zr}var tp;function Pf(){if(tp)return Ze;tp=1,Object.defineProperty(Ze,"__esModule",{value:!0});const r=dO();function e(){let u=null,h=null;return{promise:new Promise((f,d)=>{u=f,h=d}),resolve:u,reject:h}}Ze.defer=e;function t(){return Date.now()}Ze.now=t;function n(u,h){return Math.abs(h-u)}Ze.duration=n;function i(u){return typeof u>"u"?!0:a(u)}Ze.checkOptionalTime=i;function a(u){return typeof u=="number"&&u===Math.round(u)&&u>0}Ze.checkRequiredTime=a;function o(u){return new Promise(h=>setTimeout(h,u))}Ze.delay=o;function s(u){return u.then(h=>new r.PromiseInspection({value:h})).catch(h=>new r.PromiseInspection({error:h}))}Ze.reflect=s;function l(u){try{const h=u();return Promise.resolve(h)}catch(h){return Promise.reject(h)}}return Ze.tryPromise=l,Ze}var rp;function pO(){if(rp)return Kr;rp=1,Object.defineProperty(Kr,"__esModule",{value:!0});const r=PE(),e=Pf();let t=class{constructor(a){this.timeoutMillis=a,this.deferred=e.defer(),this.possibleTimeoutCause=null,this.isRejected=!1,this.promise=n(this.deferred.promise,a).catch(o=>(o instanceof r.TimeoutError&&(this.possibleTimeoutCause?o=new r.TimeoutError(this.possibleTimeoutCause.message):o=new r.TimeoutError("operation timed out for an unknown reason")),this.isRejected=!0,Promise.reject(o)))}abort(){this.reject(new Error("aborted"))}reject(a){this.deferred.reject(a)}resolve(a){this.deferred.resolve(a)}};Kr.PendingOperation=t;function n(i,a){return new Promise((o,s)=>{const l=setTimeout(()=>s(new r.TimeoutError),a);i.then(u=>{clearTimeout(l),o(u)}).catch(u=>{clearTimeout(l),s(u)})})}return Kr}var Xr={},np;function mO(){if(np)return Xr;np=1,Object.defineProperty(Xr,"__esModule",{value:!0});const r=Pf();let e=class kE{constructor(n){this.resource=n,this.resource=n,this.timestamp=r.now(),this.deferred=r.defer()}get promise(){return this.deferred.promise}resolve(){return this.deferred.resolve(void 0),new kE(this.resource)}};return Xr.Resource=e,Xr}var en={exports:{}},ip;function Ot(){if(ip)return en.exports;ip=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(E,T,S){return Function.prototype.apply.call(E,T,S)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:t=function(E){return Object.getOwnPropertyNames(E)};function n(v){console&&console.warn&&console.warn(v)}var i=Number.isNaN||function(E){return E!==E};function a(){a.init.call(this)}en.exports=a,en.exports.once=g,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(v){if(typeof v!="number"||v<0||i(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");o=v}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||i(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function l(v){return v._maxListeners===void 0?a.defaultMaxListeners:v._maxListeners}a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(E){for(var T=[],S=1;S<arguments.length;S++)T.push(arguments[S]);var R=E==="error",j=this._events;if(j!==void 0)R=R&&j.error===void 0;else if(!R)return!1;if(R){var C;if(T.length>0&&(C=T[0]),C instanceof Error)throw C;var q=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw q.context=C,q}var M=j[E];if(M===void 0)return!1;if(typeof M=="function")e(M,this,T);else for(var B=M.length,y=w(M,B),S=0;S<B;++S)e(y[S],this,T);return!0};function u(v,E,T,S){var R,j,C;if(s(T),j=v._events,j===void 0?(j=v._events=Object.create(null),v._eventsCount=0):(j.newListener!==void 0&&(v.emit("newListener",E,T.listener?T.listener:T),j=v._events),C=j[E]),C===void 0)C=j[E]=T,++v._eventsCount;else if(typeof C=="function"?C=j[E]=S?[T,C]:[C,T]:S?C.unshift(T):C.push(T),R=l(v),R>0&&C.length>R&&!C.warned){C.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=v,q.type=E,q.count=C.length,n(q)}return v}a.prototype.addListener=function(E,T){return u(this,E,T,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(E,T){return u(this,E,T,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(v,E,T){var S={fired:!1,wrapFn:void 0,target:v,type:E,listener:T},R=h.bind(S);return R.listener=T,S.wrapFn=R,R}a.prototype.once=function(E,T){return s(T),this.on(E,c(this,E,T)),this},a.prototype.prependOnceListener=function(E,T){return s(T),this.prependListener(E,c(this,E,T)),this},a.prototype.removeListener=function(E,T){var S,R,j,C,q;if(s(T),R=this._events,R===void 0)return this;if(S=R[E],S===void 0)return this;if(S===T||S.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete R[E],R.removeListener&&this.emit("removeListener",E,S.listener||T));else if(typeof S!="function"){for(j=-1,C=S.length-1;C>=0;C--)if(S[C]===T||S[C].listener===T){q=S[C].listener,j=C;break}if(j<0)return this;j===0?S.shift():_(S,j),S.length===1&&(R[E]=S[0]),R.removeListener!==void 0&&this.emit("removeListener",E,q||T)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(E){var T,S,R;if(S=this._events,S===void 0)return this;if(S.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):S[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete S[E]),this;if(arguments.length===0){var j=Object.keys(S),C;for(R=0;R<j.length;++R)C=j[R],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=S[E],typeof T=="function")this.removeListener(E,T);else if(T!==void 0)for(R=T.length-1;R>=0;R--)this.removeListener(E,T[R]);return this};function f(v,E,T){var S=v._events;if(S===void 0)return[];var R=S[E];return R===void 0?[]:typeof R=="function"?T?[R.listener||R]:[R]:T?m(R):w(R,R.length)}a.prototype.listeners=function(E){return f(this,E,!0)},a.prototype.rawListeners=function(E){return f(this,E,!1)},a.listenerCount=function(v,E){return typeof v.listenerCount=="function"?v.listenerCount(E):d.call(v,E)},a.prototype.listenerCount=d;function d(v){var E=this._events;if(E!==void 0){var T=E[v];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function w(v,E){for(var T=new Array(E),S=0;S<E;++S)T[S]=v[S];return T}function _(v,E){for(;E+1<v.length;E++)v[E]=v[E+1];v.pop()}function m(v){for(var E=new Array(v.length),T=0;T<E.length;++T)E[T]=v[T].listener||v[T];return E}function g(v,E){return new Promise(function(T,S){function R(C){v.removeListener(E,j),S(C)}function j(){typeof v.removeListener=="function"&&v.removeListener("error",R),T([].slice.call(arguments))}b(v,E,j,{once:!0}),E!=="error"&&p(v,R,{once:!0})})}function p(v,E,T){typeof v.on=="function"&&b(v,"error",E,T)}function b(v,E,T,S){if(typeof v.on=="function")S.once?v.once(E,T):v.on(E,T);else if(typeof v.addEventListener=="function")v.addEventListener(E,function R(j){S.once&&v.removeEventListener(E,R),T(j)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}return en.exports}var sp;function gO(){if(sp)return Jr;sp=1,Object.defineProperty(Jr,"__esModule",{value:!0});const r=pO(),e=mO(),t=Pf(),n=Ot(),i=$e;let a=class{constructor(u){if(this.destroyed=!1,this.emitter=new n.EventEmitter,u=u||{},!u.create)throw new Error("Tarn: opt.create function most be provided");if(!u.destroy)throw new Error("Tarn: opt.destroy function most be provided");if(typeof u.min!="number"||u.min<0||u.min!==Math.round(u.min))throw new Error("Tarn: opt.min must be an integer >= 0");if(typeof u.max!="number"||u.max<=0||u.max!==Math.round(u.max))throw new Error("Tarn: opt.max must be an integer > 0");if(u.min>u.max)throw new Error("Tarn: opt.max is smaller than opt.min");if(!t.checkOptionalTime(u.acquireTimeoutMillis))throw new Error("Tarn: invalid opt.acquireTimeoutMillis "+JSON.stringify(u.acquireTimeoutMillis));if(!t.checkOptionalTime(u.createTimeoutMillis))throw new Error("Tarn: invalid opt.createTimeoutMillis "+JSON.stringify(u.createTimeoutMillis));if(!t.checkOptionalTime(u.destroyTimeoutMillis))throw new Error("Tarn: invalid opt.destroyTimeoutMillis "+JSON.stringify(u.destroyTimeoutMillis));if(!t.checkOptionalTime(u.idleTimeoutMillis))throw new Error("Tarn: invalid opt.idleTimeoutMillis "+JSON.stringify(u.idleTimeoutMillis));if(!t.checkOptionalTime(u.reapIntervalMillis))throw new Error("Tarn: invalid opt.reapIntervalMillis "+JSON.stringify(u.reapIntervalMillis));if(!t.checkOptionalTime(u.createRetryIntervalMillis))throw new Error("Tarn: invalid opt.createRetryIntervalMillis "+JSON.stringify(u.createRetryIntervalMillis));const h={create:!0,validate:!0,destroy:!0,log:!0,min:!0,max:!0,acquireTimeoutMillis:!0,createTimeoutMillis:!0,destroyTimeoutMillis:!0,idleTimeoutMillis:!0,reapIntervalMillis:!0,createRetryIntervalMillis:!0,propagateCreateError:!0};for(const c of Object.keys(u))if(!h[c])throw new Error(`Tarn: unsupported option opt.${c}`);this.creator=u.create,this.destroyer=u.destroy,this.validate=typeof u.validate=="function"?u.validate:()=>!0,this.log=u.log||(()=>{}),this.acquireTimeoutMillis=u.acquireTimeoutMillis||3e4,this.createTimeoutMillis=u.createTimeoutMillis||3e4,this.destroyTimeoutMillis=u.destroyTimeoutMillis||5e3,this.idleTimeoutMillis=u.idleTimeoutMillis||3e4,this.reapIntervalMillis=u.reapIntervalMillis||1e3,this.createRetryIntervalMillis=u.createRetryIntervalMillis||200,this.propagateCreateError=!!u.propagateCreateError,this.min=u.min,this.max=u.max,this.used=[],this.free=[],this.pendingCreates=[],this.pendingAcquires=[],this.pendingDestroys=[],this.pendingValidations=[],this.destroyed=!1,this.interval=null,this.eventId=1}numUsed(){return this.used.length}numFree(){return this.free.length}numPendingAcquires(){return this.pendingAcquires.length}numPendingValidations(){return this.pendingValidations.length}numPendingCreates(){return this.pendingCreates.length}acquire(){const u=this.eventId++;this._executeEventHandlers("acquireRequest",u);const h=new r.PendingOperation(this.acquireTimeoutMillis);return this.pendingAcquires.push(h),h.promise=h.promise.then(c=>(this._executeEventHandlers("acquireSuccess",u,c),c)).catch(c=>(this._executeEventHandlers("acquireFail",u,c),o(this.pendingAcquires,h),Promise.reject(c))),this._tryAcquireOrCreate(),h}release(u){this._executeEventHandlers("release",u);for(let h=0,c=this.used.length;h<c;++h){const f=this.used[h];if(f.resource===u)return this.used.splice(h,1),this.free.push(f.resolve()),this._tryAcquireOrCreate(),!0}return!1}isEmpty(){return[this.numFree(),this.numUsed(),this.numPendingAcquires(),this.numPendingValidations(),this.numPendingCreates()].reduce((u,h)=>u+h)===0}check(){const u=t.now(),h=[],c=this.min-this.used.length,f=this.free.length-c;let d=0;this.free.forEach(w=>{t.duration(u,w.timestamp)>=this.idleTimeoutMillis&&d<f?(d++,this._destroy(w.resource)):h.push(w)}),this.free=h,this.isEmpty()&&this._stopReaping()}destroy(){const u=this.eventId++;return this._executeEventHandlers("poolDestroyRequest",u),this._stopReaping(),this.destroyed=!0,t.reflect(Promise.all(this.pendingCreates.map(h=>t.reflect(h.promise))).then(()=>new Promise((h,c)=>{if(this.numPendingValidations()===0){h();return}const f=setInterval(()=>{this.numPendingValidations()===0&&(i.clearInterval(f),h())},100)})).then(()=>Promise.all(this.used.map(h=>t.reflect(h.promise)))).then(()=>Promise.all(this.pendingAcquires.map(h=>(h.abort(),t.reflect(h.promise))))).then(()=>Promise.all(this.free.map(h=>t.reflect(this._destroy(h.resource))))).then(()=>Promise.all(this.pendingDestroys.map(h=>h.promise))).then(()=>{this.free=[],this.pendingAcquires=[]})).then(h=>(this._executeEventHandlers("poolDestroySuccess",u),this.emitter.removeAllListeners(),h))}on(u,h){this.emitter.on(u,h)}removeListener(u,h){this.emitter.removeListener(u,h)}removeAllListeners(u){this.emitter.removeAllListeners(u)}_tryAcquireOrCreate(){this.destroyed||(this._hasFreeResources()?this._doAcquire():this._shouldCreateMoreResources()&&this._doCreate())}_hasFreeResources(){return this.free.length>0}_doAcquire(){for(;this._canAcquire();){const u=this.pendingAcquires.shift(),h=this.free.pop();if(h===void 0||u===void 0){const f="this.free was empty while trying to acquire resource";throw this.log(`Tarn: ${f}`,"warn"),new Error(`Internal error, should never happen. ${f}`)}this.pendingValidations.push(u),this.used.push(h);const c=new r.PendingOperation(this.acquireTimeoutMillis);u.promise.catch(f=>{c.abort()}),c.promise.catch(f=>(this.log("Tarn: resource validator threw an exception "+f.stack,"warn"),!1)).then(f=>{try{f&&!u.isRejected?(this._startReaping(),u.resolve(h.resource)):(o(this.used,h),f?this.free.push(h):(this._destroy(h.resource),setTimeout(()=>{this._tryAcquireOrCreate()},0)),u.isRejected||this.pendingAcquires.unshift(u))}finally{o(this.pendingValidations,u)}}),this._validateResource(h.resource).then(f=>{c.resolve(f)}).catch(f=>{c.reject(f)})}}_canAcquire(){return this.free.length>0&&this.pendingAcquires.length>0}_validateResource(u){try{return Promise.resolve(this.validate(u))}catch(h){return Promise.reject(h)}}_shouldCreateMoreResources(){return this.used.length+this.pendingCreates.length<this.max&&this.pendingCreates.length<this.pendingAcquires.length}_doCreate(){const u=this.pendingAcquires.slice();this._create().promise.then(()=>(this._tryAcquireOrCreate(),null)).catch(c=>{this.propagateCreateError&&this.pendingAcquires.length!==0&&this.pendingAcquires[0].reject(c),u.forEach(f=>{f.possibleTimeoutCause=c}),t.delay(this.createRetryIntervalMillis).then(()=>this._tryAcquireOrCreate())})}_create(){const u=this.eventId++;this._executeEventHandlers("createRequest",u);const h=new r.PendingOperation(this.createTimeoutMillis);return h.promise=h.promise.catch(c=>{throw o(this.pendingCreates,h)&&this._executeEventHandlers("createFail",u,c),c}),this.pendingCreates.push(h),s(this.creator).then(c=>h.isRejected?(this.destroyer(c),null):(o(this.pendingCreates,h),this.free.push(new e.Resource(c)),h.resolve(c),this._executeEventHandlers("createSuccess",u,c),null)).catch(c=>(h.isRejected||(o(this.pendingCreates,h)&&this._executeEventHandlers("createFail",u,c),h.reject(c)),null)),h}_destroy(u){const h=this.eventId++;this._executeEventHandlers("destroyRequest",h,u);const c=new r.PendingOperation(this.destroyTimeoutMillis);return Promise.resolve().then(()=>this.destroyer(u)).then(()=>{c.resolve(u)}).catch(d=>{c.reject(d)}),this.pendingDestroys.push(c),c.promise.then(d=>(this._executeEventHandlers("destroySuccess",h,u),d)).catch(d=>this._logDestroyerError(h,u,d)).then(d=>{const w=this.pendingDestroys.findIndex(_=>_===c);return this.pendingDestroys.splice(w,1),d})}_logDestroyerError(u,h,c){this._executeEventHandlers("destroyFail",u,h,c),this.log("Tarn: resource destroyer threw an exception "+c.stack,"warn")}_startReaping(){this.interval||(this._executeEventHandlers("startReaping"),this.interval=setInterval(()=>this.check(),this.reapIntervalMillis))}_stopReaping(){this.interval!==null&&(this._executeEventHandlers("stopReaping"),i.clearInterval(this.interval)),this.interval=null}_executeEventHandlers(u,...h){this.emitter.listeners(u).forEach(f=>{try{f(...h)}catch(d){this.log(`Tarn: event handler "${u}" threw an exception ${d.stack}`,"warn")}})}};Jr.Pool=a;function o(l,u){const h=l.indexOf(u);return h===-1?!1:(l.splice(h,1),!0)}function s(l){return new Promise((u,h)=>{const c=(f,d)=>{f?h(f):u(d)};t.tryPromise(()=>l(c)).then(f=>{f&&u(f)}).catch(f=>{h(f)})})}return Jr}var op;function yO(){return op||(op=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0});const t=gO();e.Pool=t.Pool;const n=PE();e.TimeoutError=n.TimeoutError,r.exports={Pool:t.Pool,TimeoutError:n.TimeoutError}}(Gr,Gr.exports)),Gr.exports}var oi={},ai={},ui,ap;function kf(){return ap||(ap=1,ui=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),ui}var li,up;function En(){if(up)return li;up=1;var r=kf();return li=function(){return r()&&!!Symbol.toStringTag},li}var ci,lp;function Lf(){return lp||(lp=1,ci=Object),ci}var hi,cp;function bO(){return cp||(cp=1,hi=Error),hi}var fi,hp;function wO(){return hp||(hp=1,fi=EvalError),fi}var di,fp;function vO(){return fp||(fp=1,di=RangeError),di}var pi,dp;function _O(){return dp||(dp=1,pi=ReferenceError),pi}var mi,pp;function LE(){return pp||(pp=1,mi=SyntaxError),mi}var gi,mp;function $r(){return mp||(mp=1,gi=TypeError),gi}var yi,gp;function CO(){return gp||(gp=1,yi=URIError),yi}var bi,yp;function EO(){return yp||(yp=1,bi=Math.abs),bi}var wi,bp;function SO(){return bp||(bp=1,wi=Math.floor),wi}var vi,wp;function TO(){return wp||(wp=1,vi=Math.max),vi}var _i,vp;function qO(){return vp||(vp=1,_i=Math.min),_i}var Ci,_p;function AO(){return _p||(_p=1,Ci=Math.pow),Ci}var Ei,Cp;function OO(){return Cp||(Cp=1,Ei=Math.round),Ei}var Si,Ep;function RO(){return Ep||(Ep=1,Si=Number.isNaN||function(e){return e!==e}),Si}var Ti,Sp;function NO(){if(Sp)return Ti;Sp=1;var r=RO();return Ti=function(t){return r(t)||t===0?t:t<0?-1:1},Ti}var qi,Tp;function IO(){return Tp||(Tp=1,qi=Object.getOwnPropertyDescriptor),qi}var Ai,qp;function sr(){if(qp)return Ai;qp=1;var r=IO();if(r)try{r([],"length")}catch{r=null}return Ai=r,Ai}var Oi,Ap;function Sn(){if(Ap)return Oi;Ap=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return Oi=r,Oi}var Ri,Op;function xO(){if(Op)return Ri;Op=1;var r=typeof Symbol<"u"&&Symbol,e=kf();return Ri=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Ri}var Ni,Rp;function ME(){return Rp||(Rp=1,Ni=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ni}var Ii,Np;function DE(){if(Np)return Ii;Np=1;var r=Lf();return Ii=r.getPrototypeOf||null,Ii}var xi,Ip;function $O(){if(Ip)return xi;Ip=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(l,u){for(var h=[],c=0;c<l.length;c+=1)h[c]=l[c];for(var f=0;f<u.length;f+=1)h[f+l.length]=u[f];return h},a=function(l,u){for(var h=[],c=u,f=0;c<l.length;c+=1,f+=1)h[f]=l[c];return h},o=function(s,l){for(var u="",h=0;h<s.length;h+=1)u+=s[h],h+1<s.length&&(u+=l);return u};return xi=function(l){var u=this;if(typeof u!="function"||e.apply(u)!==n)throw new TypeError(r+u);for(var h=a(arguments,1),c,f=function(){if(this instanceof c){var g=u.apply(this,i(h,arguments));return Object(g)===g?g:this}return u.apply(l,i(h,arguments))},d=t(0,u.length-h.length),w=[],_=0;_<d;_++)w[_]="$"+_;if(c=Function("binder","return function ("+o(w,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var m=function(){};m.prototype=u.prototype,c.prototype=new m,m.prototype=null}return c},xi}var $i,xp;function Pr(){if(xp)return $i;xp=1;var r=$O();return $i=Function.prototype.bind||r,$i}var Pi,$p;function Mf(){return $p||($p=1,Pi=Function.prototype.call),Pi}var ki,Pp;function Df(){return Pp||(Pp=1,ki=Function.prototype.apply),ki}var Li,kp;function PO(){return kp||(kp=1,Li=typeof Reflect<"u"&&Reflect&&Reflect.apply),Li}var Mi,Lp;function jE(){if(Lp)return Mi;Lp=1;var r=Pr(),e=Df(),t=Mf(),n=PO();return Mi=n||r.call(t,e),Mi}var Di,Mp;function jf(){if(Mp)return Di;Mp=1;var r=Pr(),e=$r(),t=Mf(),n=jE();return Di=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Di}var ji,Dp;function kO(){if(Dp)return ji;Dp=1;var r=jf(),e=sr(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return ji=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,ji}var Fi,jp;function Ff(){if(jp)return Fi;jp=1;var r=ME(),e=DE(),t=kO();return Fi=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Fi}var Bi,Fp;function FE(){if(Fp)return Bi;Fp=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=Pr();return Bi=t.call(r,e),Bi}var Ui,Bp;function Bf(){if(Bp)return Ui;Bp=1;var r,e=Lf(),t=bO(),n=wO(),i=vO(),a=_O(),o=LE(),s=$r(),l=CO(),u=EO(),h=SO(),c=TO(),f=qO(),d=AO(),w=OO(),_=NO(),m=Function,g=function(z){try{return m('"use strict"; return ('+z+").constructor;")()}catch{}},p=sr(),b=Sn(),v=function(){throw new s},E=p?function(){try{return v}catch{try{return p(arguments,"callee").get}catch{return v}}}():v,T=xO()(),S=Ff(),R=DE(),j=ME(),C=Df(),q=Mf(),M={},B=typeof Uint8Array>"u"||!S?r:S(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":T&&S?S([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":M,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&S?S(S([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!S?r:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":p,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!S?r:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&S?S(""[Symbol.iterator]()):r,"%Symbol%":T?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":E,"%TypedArray%":B,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":q,"%Function.prototype.apply%":C,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":R,"%Math.abs%":u,"%Math.floor%":h,"%Math.max%":c,"%Math.min%":f,"%Math.pow%":d,"%Math.round%":w,"%Math.sign%":_,"%Reflect.getPrototypeOf%":j},A=function z(Q){var Z;if(Q==="%AsyncFunction%")Z=g("async function () {}");else if(Q==="%GeneratorFunction%")Z=g("function* () {}");else if(Q==="%AsyncGeneratorFunction%")Z=g("async function* () {}");else if(Q==="%AsyncGenerator%"){var te=z("%AsyncGeneratorFunction%");te&&(Z=te.prototype)}else if(Q==="%AsyncIteratorPrototype%"){var se=z("%AsyncGenerator%");se&&S&&(Z=S(se.prototype))}return y[Q]=Z,Z},$={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},K=Pr(),ee=FE(),W=K.call(q,Array.prototype.concat),I=K.call(C,Array.prototype.splice),H=K.call(q,String.prototype.replace),J=K.call(q,String.prototype.slice),P=K.call(q,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,D=function(Q){var Z=J(Q,0,1),te=J(Q,-1);if(Z==="%"&&te!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(te==="%"&&Z!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var se=[];return H(Q,O,function(ae,k,V,he){se[se.length]=V?H(he,x,"$1"):k||ae}),se},Y=function(Q,Z){var te=Q,se;if(ee($,te)&&(se=$[te],te="%"+se[0]+"%"),ee(y,te)){var ae=y[te];if(ae===M&&(ae=A(te)),typeof ae>"u"&&!Z)throw new s("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:se,name:te,value:ae}}throw new o("intrinsic "+Q+" does not exist!")};return Ui=function(Q,Z){if(typeof Q!="string"||Q.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Z!="boolean")throw new s('"allowMissing" argument must be a boolean');if(P(/^%?[^%]*%?$/,Q)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var te=D(Q),se=te.length>0?te[0]:"",ae=Y("%"+se+"%",Z),k=ae.name,V=ae.value,he=!1,oe=ae.alias;oe&&(se=oe[0],I(te,W([0,1],oe)));for(var be=1,G=!0;be<te.length;be+=1){var Ae=te[be],Ce=J(Ae,0,1),Se=J(Ae,-1);if((Ce==='"'||Ce==="'"||Ce==="`"||Se==='"'||Se==="'"||Se==="`")&&Ce!==Se)throw new o("property names with quotes must have matching quotes");if((Ae==="constructor"||!G)&&(he=!0),se+="."+Ae,k="%"+se+"%",ee(y,k))V=y[k];else if(V!=null){if(!(Ae in V)){if(!Z)throw new s("base intrinsic for "+Q+" exists, but the property is not available.");return}if(p&&be+1>=te.length){var fe=p(V,Ae);G=!!fe,G&&"get"in fe&&!("originalValue"in fe.get)?V=fe.get:V=V[Ae]}else G=ee(V,Ae),V=V[Ae];G&&!he&&(y[k]=V)}}return V},Ui}var Vi,Up;function or(){if(Up)return Vi;Up=1;var r=Bf(),e=jf(),t=e([r("%String.prototype.indexOf%")]);return Vi=function(i,a){var o=r(i,!!a);return typeof o=="function"&&t(i,".prototype.")>-1?e([o]):o},Vi}var Qi,Vp;function LO(){if(Vp)return Qi;Vp=1;var r=En()(),e=or(),t=e("Object.prototype.toString"),n=function(s){return r&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:t(s)==="[object Arguments]"},i=function(s){return n(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&t(s)!=="[object Array]"&&"callee"in s&&t(s.callee)==="[object Function]"},a=function(){return n(arguments)}();return n.isLegacyArguments=i,Qi=a?n:i,Qi}var Wi,Qp;function MO(){if(Qp)return Wi;Qp=1;var r=or(),e=En()(),t=FE(),n=sr(),i;if(e){var a=r("RegExp.prototype.exec"),o={},s=function(){throw o},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),i=function(f){if(!f||typeof f!="object")return!1;var d=n(f,"lastIndex"),w=d&&t(d,"value");if(!w)return!1;try{a(f,l)}catch(_){return _===o}}}else{var u=r("Object.prototype.toString"),h="[object RegExp]";i=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===h}}return Wi=i,Wi}var Hi,Wp;function DO(){if(Wp)return Hi;Wp=1;var r=or(),e=MO(),t=r("RegExp.prototype.exec"),n=$r();return Hi=function(a){if(!e(a))throw new n("`regex` must be a RegExp");return function(s){return t(a,s)!==null}},Hi}var zi,Hp;function jO(){if(Hp)return zi;Hp=1;var r=or(),e=DO(),t=e(/^\s*(?:function)?\*/),n=En()(),i=Ff(),a=r("Object.prototype.toString"),o=r("Function.prototype.toString"),s=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},l;return zi=function(h){if(typeof h!="function")return!1;if(t(o(h)))return!0;if(!n){var c=a(h);return c==="[object GeneratorFunction]"}if(!i)return!1;if(typeof l>"u"){var f=s();l=f?i(f):!1}return i(h)===l},zi}var Gi,zp;function FO(){if(zp)return Gi;zp=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(p){p!==n&&(e=null)}else e=null;var i=/^\s*class\b/,a=function(b){try{var v=r.call(b);return i.test(v)}catch{return!1}},o=function(b){try{return a(b)?!1:(r.call(b),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",u="[object Function]",h="[object GeneratorFunction]",c="[object HTMLAllCollection]",f="[object HTML document.all class]",d="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),m=function(){return!1};if(typeof document=="object"){var g=document.all;s.call(g)===s.call(document.all)&&(m=function(b){if((_||!b)&&(typeof b>"u"||typeof b=="object"))try{var v=s.call(b);return(v===c||v===f||v===d||v===l)&&b("")==null}catch{}return!1})}return Gi=e?function(b){if(m(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{e(b,null,t)}catch(v){if(v!==n)return!1}return!a(b)&&o(b)}:function(b){if(m(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(w)return o(b);if(a(b))return!1;var v=s.call(b);return v!==u&&v!==h&&!/^\[object HTML/.test(v)?!1:o(b)},Gi}var Ji,Gp;function BO(){if(Gp)return Ji;Gp=1;var r=FO(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(l,u,h){for(var c=0,f=l.length;c<f;c++)t.call(l,c)&&(h==null?u(l[c],c,l):u.call(h,l[c],c,l))},i=function(l,u,h){for(var c=0,f=l.length;c<f;c++)h==null?u(l.charAt(c),c,l):u.call(h,l.charAt(c),c,l)},a=function(l,u,h){for(var c in l)t.call(l,c)&&(h==null?u(l[c],c,l):u.call(h,l[c],c,l))};function o(s){return e.call(s)==="[object Array]"}return Ji=function(l,u,h){if(!r(u))throw new TypeError("iterator must be a function");var c;arguments.length>=3&&(c=h),o(l)?n(l,u,c):typeof l=="string"?i(l,u,c):a(l,u,c)},Ji}var Ki,Jp;function UO(){return Jp||(Jp=1,Ki=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ki}var Yi,Kp;function VO(){if(Kp)return Yi;Kp=1;var r=UO(),e=typeof globalThis>"u"?zt:globalThis;return Yi=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},Yi}var Zi={exports:{}},Xi,Yp;function BE(){if(Yp)return Xi;Yp=1;var r=Sn(),e=LE(),t=$r(),n=sr();return Xi=function(a,o,s){if(!a||typeof a!="object"&&typeof a!="function")throw new t("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!n&&n(a,o);if(r)r(a,o,{configurable:h===null&&f?f.configurable:!h,enumerable:l===null&&f?f.enumerable:!l,value:s,writable:u===null&&f?f.writable:!u});else if(c||!l&&!u&&!h)a[o]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Xi}var es,Zp;function UE(){if(Zp)return es;Zp=1;var r=Sn(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},es=e,es}var ts,Xp;function QO(){if(Xp)return ts;Xp=1;var r=Bf(),e=BE(),t=UE()(),n=sr(),i=$r(),a=r("%Math.floor%");return ts=function(s,l){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||a(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],h=!0,c=!0;if("length"in s&&n){var f=n(s,"length");f&&!f.configurable&&(h=!1),f&&!f.writable&&(c=!1)}return(h||c||!u)&&(t?e(s,"length",l,!0,!0):e(s,"length",l)),s},ts}var rs,em;function WO(){if(em)return rs;em=1;var r=Pr(),e=Df(),t=jE();return rs=function(){return t(r,e,arguments)},rs}var tm;function Tn(){return tm||(tm=1,function(r){var e=QO(),t=Sn(),n=jf(),i=WO();r.exports=function(o){var s=n(arguments),l=o.length-(arguments.length-1);return e(s,1+(l>0?l:0),!0)},t?t(r.exports,"apply",{value:i}):r.exports.apply=i}(Zi)),Zi.exports}var ns,rm;function VE(){if(rm)return ns;rm=1;var r=BO(),e=VO(),t=Tn(),n=or(),i=sr(),a=Ff(),o=n("Object.prototype.toString"),s=En()(),l=typeof globalThis>"u"?zt:globalThis,u=e(),h=n("String.prototype.slice"),c=n("Array.prototype.indexOf",!0)||function(m,g){for(var p=0;p<m.length;p+=1)if(m[p]===g)return p;return-1},f={__proto__:null};s&&i&&a?r(u,function(_){var m=new l[_];if(Symbol.toStringTag in m&&a){var g=a(m),p=i(g,Symbol.toStringTag);if(!p&&g){var b=a(g);p=i(b,Symbol.toStringTag)}f["$"+_]=t(p.get)}}):r(u,function(_){var m=new l[_],g=m.slice||m.set;g&&(f["$"+_]=t(g))});var d=function(m){var g=!1;return r(f,function(p,b){if(!g)try{"$"+p(m)===b&&(g=h(b,1))}catch{}}),g},w=function(m){var g=!1;return r(f,function(p,b){if(!g)try{p(m),g=h(b,1)}catch{}}),g};return ns=function(m){if(!m||typeof m!="object")return!1;if(!s){var g=h(o(m),8,-1);return c(u,g)>-1?g:g!=="Object"?!1:w(m)}return i?d(m):null},ns}var is,nm;function HO(){if(nm)return is;nm=1;var r=VE();return is=function(t){return!!r(t)},is}var im;function zO(){return im||(im=1,function(r){var e=LO(),t=jO(),n=VE(),i=HO();function a(G){return G.call.bind(G)}var o=typeof BigInt<"u",s=typeof Symbol<"u",l=a(Object.prototype.toString),u=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),c=a(Boolean.prototype.valueOf);if(o)var f=a(BigInt.prototype.valueOf);if(s)var d=a(Symbol.prototype.valueOf);function w(G,Ae){if(typeof G!="object")return!1;try{return Ae(G),!0}catch{return!1}}r.isArgumentsObject=e,r.isGeneratorFunction=t,r.isTypedArray=i;function _(G){return typeof Promise<"u"&&G instanceof Promise||G!==null&&typeof G=="object"&&typeof G.then=="function"&&typeof G.catch=="function"}r.isPromise=_;function m(G){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(G):i(G)||P(G)}r.isArrayBufferView=m;function g(G){return n(G)==="Uint8Array"}r.isUint8Array=g;function p(G){return n(G)==="Uint8ClampedArray"}r.isUint8ClampedArray=p;function b(G){return n(G)==="Uint16Array"}r.isUint16Array=b;function v(G){return n(G)==="Uint32Array"}r.isUint32Array=v;function E(G){return n(G)==="Int8Array"}r.isInt8Array=E;function T(G){return n(G)==="Int16Array"}r.isInt16Array=T;function S(G){return n(G)==="Int32Array"}r.isInt32Array=S;function R(G){return n(G)==="Float32Array"}r.isFloat32Array=R;function j(G){return n(G)==="Float64Array"}r.isFloat64Array=j;function C(G){return n(G)==="BigInt64Array"}r.isBigInt64Array=C;function q(G){return n(G)==="BigUint64Array"}r.isBigUint64Array=q;function M(G){return l(G)==="[object Map]"}M.working=typeof Map<"u"&&M(new Map);function B(G){return typeof Map>"u"?!1:M.working?M(G):G instanceof Map}r.isMap=B;function y(G){return l(G)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function A(G){return typeof Set>"u"?!1:y.working?y(G):G instanceof Set}r.isSet=A;function $(G){return l(G)==="[object WeakMap]"}$.working=typeof WeakMap<"u"&&$(new WeakMap);function K(G){return typeof WeakMap>"u"?!1:$.working?$(G):G instanceof WeakMap}r.isWeakMap=K;function ee(G){return l(G)==="[object WeakSet]"}ee.working=typeof WeakSet<"u"&&ee(new WeakSet);function W(G){return ee(G)}r.isWeakSet=W;function I(G){return l(G)==="[object ArrayBuffer]"}I.working=typeof ArrayBuffer<"u"&&I(new ArrayBuffer);function H(G){return typeof ArrayBuffer>"u"?!1:I.working?I(G):G instanceof ArrayBuffer}r.isArrayBuffer=H;function J(G){return l(G)==="[object DataView]"}J.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&J(new DataView(new ArrayBuffer(1),0,1));function P(G){return typeof DataView>"u"?!1:J.working?J(G):G instanceof DataView}r.isDataView=P;var O=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function x(G){return l(G)==="[object SharedArrayBuffer]"}function D(G){return typeof O>"u"?!1:(typeof x.working>"u"&&(x.working=x(new O)),x.working?x(G):G instanceof O)}r.isSharedArrayBuffer=D;function Y(G){return l(G)==="[object AsyncFunction]"}r.isAsyncFunction=Y;function z(G){return l(G)==="[object Map Iterator]"}r.isMapIterator=z;function Q(G){return l(G)==="[object Set Iterator]"}r.isSetIterator=Q;function Z(G){return l(G)==="[object Generator]"}r.isGeneratorObject=Z;function te(G){return l(G)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=te;function se(G){return w(G,u)}r.isNumberObject=se;function ae(G){return w(G,h)}r.isStringObject=ae;function k(G){return w(G,c)}r.isBooleanObject=k;function V(G){return o&&w(G,f)}r.isBigIntObject=V;function he(G){return s&&w(G,d)}r.isSymbolObject=he;function oe(G){return se(G)||ae(G)||k(G)||V(G)||he(G)}r.isBoxedPrimitive=oe;function be(G){return typeof Uint8Array<"u"&&(H(G)||D(G))}r.isAnyArrayBuffer=be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(G){Object.defineProperty(r,G,{enumerable:!1,value:function(){throw new Error(G+" is not supported in userland")}})})}(ai)),ai}var ss,sm;function GO(){return sm||(sm=1,ss=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),ss}var tn={exports:{}},om;function JO(){return om||(om=1,typeof Object.create=="function"?tn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:tn.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),tn.exports}var am;function Ue(){return am||(am=1,function(r){var e={},t=Object.getOwnPropertyDescriptors||function(O){for(var x=Object.keys(O),D={},Y=0;Y<x.length;Y++)D[x[Y]]=Object.getOwnPropertyDescriptor(O,x[Y]);return D},n=/%[sdj%]/g;r.format=function(P){if(!T(P)){for(var O=[],x=0;x<arguments.length;x++)O.push(s(arguments[x]));return O.join(" ")}for(var x=1,D=arguments,Y=D.length,z=String(P).replace(n,function(Z){if(Z==="%%")return"%";if(x>=Y)return Z;switch(Z){case"%s":return String(D[x++]);case"%d":return Number(D[x++]);case"%j":try{return JSON.stringify(D[x++])}catch{return"[Circular]"}default:return Z}}),Q=D[x];x<Y;Q=D[++x])b(Q)||!C(Q)?z+=" "+Q:z+=" "+s(Q);return z},r.deprecate=function(P,O){if(typeof ve<"u"&&ve.noDeprecation===!0)return P;if(typeof ve>"u")return function(){return r.deprecate(P,O).apply(this,arguments)};var x=!1;function D(){if(!x){if(ve.throwDeprecation)throw new Error(O);ve.traceDeprecation?console.trace(O):console.error(O),x=!0}return P.apply(this,arguments)}return D};var i={},a=/^$/;if(e.NODE_DEBUG){var o=e.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i")}r.debuglog=function(P){if(P=P.toUpperCase(),!i[P])if(a.test(P)){var O=ve.pid;i[P]=function(){var x=r.format.apply(r,arguments);console.error("%s %d: %s",P,O,x)}}else i[P]=function(){};return i[P]};function s(P,O){var x={seen:[],stylize:u};return arguments.length>=3&&(x.depth=arguments[2]),arguments.length>=4&&(x.colors=arguments[3]),p(O)?x.showHidden=O:O&&r._extend(x,O),R(x.showHidden)&&(x.showHidden=!1),R(x.depth)&&(x.depth=2),R(x.colors)&&(x.colors=!1),R(x.customInspect)&&(x.customInspect=!0),x.colors&&(x.stylize=l),c(x,P,x.depth)}r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(P,O){var x=s.styles[O];return x?"\x1B["+s.colors[x][0]+"m"+P+"\x1B["+s.colors[x][1]+"m":P}function u(P,O){return P}function h(P){var O={};return P.forEach(function(x,D){O[x]=!0}),O}function c(P,O,x){if(P.customInspect&&O&&B(O.inspect)&&O.inspect!==r.inspect&&!(O.constructor&&O.constructor.prototype===O)){var D=O.inspect(x,P);return T(D)||(D=c(P,D,x)),D}var Y=f(P,O);if(Y)return Y;var z=Object.keys(O),Q=h(z);if(P.showHidden&&(z=Object.getOwnPropertyNames(O)),M(O)&&(z.indexOf("message")>=0||z.indexOf("description")>=0))return d(O);if(z.length===0){if(B(O)){var Z=O.name?": "+O.name:"";return P.stylize("[Function"+Z+"]","special")}if(j(O))return P.stylize(RegExp.prototype.toString.call(O),"regexp");if(q(O))return P.stylize(Date.prototype.toString.call(O),"date");if(M(O))return d(O)}var te="",se=!1,ae=["{","}"];if(g(O)&&(se=!0,ae=["[","]"]),B(O)){var k=O.name?": "+O.name:"";te=" [Function"+k+"]"}if(j(O)&&(te=" "+RegExp.prototype.toString.call(O)),q(O)&&(te=" "+Date.prototype.toUTCString.call(O)),M(O)&&(te=" "+d(O)),z.length===0&&(!se||O.length==0))return ae[0]+te+ae[1];if(x<0)return j(O)?P.stylize(RegExp.prototype.toString.call(O),"regexp"):P.stylize("[Object]","special");P.seen.push(O);var V;return se?V=w(P,O,x,Q,z):V=z.map(function(he){return _(P,O,x,Q,he,se)}),P.seen.pop(),m(V,te,ae)}function f(P,O){if(R(O))return P.stylize("undefined","undefined");if(T(O)){var x="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return P.stylize(x,"string")}if(E(O))return P.stylize(""+O,"number");if(p(O))return P.stylize(""+O,"boolean");if(b(O))return P.stylize("null","null")}function d(P){return"["+Error.prototype.toString.call(P)+"]"}function w(P,O,x,D,Y){for(var z=[],Q=0,Z=O.length;Q<Z;++Q)W(O,String(Q))?z.push(_(P,O,x,D,String(Q),!0)):z.push("");return Y.forEach(function(te){te.match(/^\d+$/)||z.push(_(P,O,x,D,te,!0))}),z}function _(P,O,x,D,Y,z){var Q,Z,te;if(te=Object.getOwnPropertyDescriptor(O,Y)||{value:O[Y]},te.get?te.set?Z=P.stylize("[Getter/Setter]","special"):Z=P.stylize("[Getter]","special"):te.set&&(Z=P.stylize("[Setter]","special")),W(D,Y)||(Q="["+Y+"]"),Z||(P.seen.indexOf(te.value)<0?(b(x)?Z=c(P,te.value,null):Z=c(P,te.value,x-1),Z.indexOf(`
4
4
  `)>-1&&(z?Z=Z.split(`
5
5
  `).map(function(se){return" "+se}).join(`
@@ -211,5 +211,5 @@ ${i.message}`)}}validateConnection(i){return i&&!i._fatalError&&!i._protocolErro
211
211
  * LICENSE.md file in the root directory of this source tree.
212
212
  *
213
213
  * @license MIT
214
- */function gn(){return gn=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gn.apply(this,arguments)}function Cf(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((e,t)=>{let n=r[t];return e.concat(Array.isArray(n)?n.map(i=>[t,i]):[[t,n]])},[]))}function v1(r,e){let t=Cf(r);return e&&e.forEach((n,i)=>{t.has(i)||e.getAll(i).forEach(a=>{t.append(i,a)})}),t}const _1="6";try{window.__reactRouterVersion=_1}catch{}function C1(r,e){return jT({basename:e==null?void 0:e.basename,future:gn({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:FT({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||E1(),routes:r,mapRouteProperties:VT,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function E1(){var r;let e=(r=window)==null?void 0:r.__staticRouterHydrationData;return e&&e.errors&&(e=gn({},e,{errors:S1(e.errors)})),e}function S1(r){if(!r)return null;let e=Object.entries(r),t={};for(let[n,i]of e)if(i&&i.__type==="RouteErrorResponse")t[n]=new UT(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",t[n]=o}catch{}}if(t[n]==null){let a=new Error(i.message);a.stack="",t[n]=a}}else t[n]=i;return t}const T1=pe.createContext({isTransitioning:!1}),q1=pe.createContext(new Map),A1="startTransition",wC=pe[A1],O1="flushSync",vC=PT[O1];function R1(r){wC?wC(r):r()}function _r(r){vC?vC(r):r()}class N1{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}}function I1(r){let{fallbackElement:e,router:t,future:n}=r,[i,a]=pe.useState(t.state),[o,s]=pe.useState(),[l,u]=pe.useState({isTransitioning:!1}),[h,c]=pe.useState(),[f,d]=pe.useState(),[w,_]=pe.useState(),m=pe.useRef(new Map),{v7_startTransition:g}=n||{},p=pe.useCallback(R=>{g?R1(R):R()},[g]),b=pe.useCallback((R,j)=>{let{deletedFetchers:C,flushSync:q,viewTransitionOpts:M}=j;R.fetchers.forEach((y,A)=>{y.data!==void 0&&m.current.set(A,y.data)}),C.forEach(y=>m.current.delete(y));let B=t.window==null||t.window.document==null||typeof t.window.document.startViewTransition!="function";if(!M||B){q?_r(()=>a(R)):p(()=>a(R));return}if(q){_r(()=>{f&&(h&&h.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let y=t.window.document.startViewTransition(()=>{_r(()=>a(R))});y.finished.finally(()=>{_r(()=>{c(void 0),d(void 0),s(void 0),u({isTransitioning:!1})})}),_r(()=>d(y));return}f?(h&&h.resolve(),f.skipTransition(),_({state:R,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(s(R),u({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[t.window,f,h,m,p]);pe.useLayoutEffect(()=>t.subscribe(b),[t,b]),pe.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new N1)},[l]),pe.useEffect(()=>{if(h&&o&&t.window){let R=o,j=h.promise,C=t.window.document.startViewTransition(async()=>{p(()=>a(R)),await j});C.finished.finally(()=>{c(void 0),d(void 0),s(void 0),u({isTransitioning:!1})}),d(C)}},[p,o,h,t.window]),pe.useEffect(()=>{h&&o&&i.location.key===o.location.key&&h.resolve()},[h,f,i.location,o]),pe.useEffect(()=>{!l.isTransitioning&&w&&(s(w.state),u({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),_(void 0))},[l.isTransitioning,w]),pe.useEffect(()=>{},[]);let v=pe.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:R=>t.navigate(R),push:(R,j,C)=>t.navigate(R,{state:j,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(R,j,C)=>t.navigate(R,{replace:!0,state:j,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[t]),E=t.basename||"/",T=pe.useMemo(()=>({router:t,navigator:v,static:!1,basename:E}),[t,v,E]),S=pe.useMemo(()=>({v7_relativeSplatPath:t.future.v7_relativeSplatPath}),[t.future.v7_relativeSplatPath]);return pe.useEffect(()=>kT(),[n,t.future]),pe.createElement(pe.Fragment,null,pe.createElement(LT.Provider,{value:T},pe.createElement(MT.Provider,{value:i},pe.createElement(q1.Provider,{value:m.current},pe.createElement(T1.Provider,{value:l},pe.createElement(DT,{basename:E,location:i.location,navigationType:i.historyAction,navigator:v,future:S},i.initialized||t.future.v7_partialHydration?pe.createElement(x1,{routes:t.routes,future:t.future,state:i}):e))))),null)}const x1=pe.memo($1);function $1(r){let{routes:e,future:t,state:n}=r;return BT(e,void 0,n,t)}var _C;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(_C||(_C={}));var CC;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(CC||(CC={}));function Dx(r){let e=pe.useRef(Cf(r)),t=pe.useRef(!1),n=NC(),i=pe.useMemo(()=>v1(n.search,t.current?null:e.current),[n.search]),a=QT(),o=pe.useCallback((s,l)=>{const u=Cf(typeof s=="function"?s(i):s);t.current=!0,a("?"+u,l)},[a,i]);return[i,o]}const EC=yn(["sentry"]);let bd=!1;async function nT(){return await ht(()=>import("./index.DxMbBa4t.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)}async function P1(){const r=window.__VITE_ENVS.SENTRY_RELEASE,e=await nT(),t=[e.httpClientIntegration(),e.extraErrorDataIntegration({depth:5}),e.replayIntegration(),e.captureConsoleIntegration({levels:["error"]})];Fe.sentry.tracing&&t.push(e.reactRouterV6BrowserTracingIntegration({useEffect:Or.useEffect,useLocation:NC,useNavigationType:zT,createRoutesFromChildren:HT,matchRoutes:WT})),e.init({release:r,dsn:Fe.sentry.dsn,environment:Fe.sentry.env,integrations:t,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(n,i){const a=i.originalException;return a instanceof TypeError&&a.message.includes("Failed to fetch")&&!navigator.onLine?null:n}}),bd=!0}async function k1(){if(!bd)return;const e=(await nT()).getClient();return e==null?void 0:e.close()}function L1(){const[r]=RC(),{analytics:e}=r;st(()=>{if(!e){k1().catch(t=>EC.error(t));return}bd||!Fe.sentry.dsn||Fe.sentry.dsn===""||P1().catch(t=>EC.error(t))},[e])}var M1=Object.defineProperty,D1=Object.getOwnPropertyDescriptor,ut=(r,e,t,n)=>{for(var i=D1(e,t),a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=o(e,t,i)||i);return i&&M1(e,t,i),i};function lt(r,e,t){const n=t.value;t.value=function(...i){if(!this.server)throw new Error("Read mode document drive not initialized.");return n.apply(this,i)}}function j1(r){const e=Object.getPrototypeOf(r);Object.getOwnPropertyNames(e).forEach(n=>{const i=Object.getOwnPropertyDescriptor(e,n);i&&typeof i.value=="function"&&n!=="constructor"&&(r[n]=r[n].bind(r))})}class rt{constructor(e){de(this,"server");j1(this),this.server=e}getServer(){return this.server}setDocumentDrive(e){this.server=e}migrateReadDrive(e,t){return this.server.migrateReadDrive(e,t)}addReadDrive(e,t){return this.server.addReadDrive(e,t)}getReadDrives(){return this.server.getReadDrives()}getReadDriveBySlug(e){return this.server.getReadDriveBySlug(e)}getReadDrive(e){return this.server.getReadDrive(e)}getReadDriveContext(e){return this.server.getReadDriveContext(e)}fetchDrive(e){return this.server.fetchDrive(e)}fetchDocument(e,t,n){return this.server.fetchDocument(e,t,n)}deleteReadDrive(e){return this.server.deleteReadDrive(e)}onReadDrivesUpdate(e){return this.server.onReadDrivesUpdate(e)}}ut([lt],rt.prototype,"migrateReadDrive");ut([lt],rt.prototype,"addReadDrive");ut([lt],rt.prototype,"getReadDrives");ut([lt],rt.prototype,"getReadDriveBySlug");ut([lt],rt.prototype,"getReadDrive");ut([lt],rt.prototype,"getReadDriveContext");ut([lt],rt.prototype,"fetchDrive");ut([lt],rt.prototype,"fetchDocument");ut([lt],rt.prototype,"deleteReadDrive");ut([lt],rt.prototype,"onReadDrivesUpdate");const Wt=new rt,iT=TT({...Wt,readDrives:[]});async function F1(r){const e=await r.getReadDrives();return(await Promise.all(e.map(n=>r.getReadDrive(n)))).filter(n=>!(n instanceof yT))}const B1=r=>{const e=RT(),[t,n]=vd([]),i=NT(),[a,o]=vd(!1);st(()=>{e&&(Wt.setDocumentDrive(e),o(!0))},[e]);const s=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);uf(()=>{if(!a||s===void 0)return;const u=s?"READ":"WRITE",h=Wt.getServer();h&&typeof h.setAllDefaultDrivesAccessLevel=="function"&&h.setAllDefaultDrivesAccessLevel(u).catch(Ur.error)},[s,a]),st(()=>{if(!a)return;F1(Wt).then(h=>n(h)).catch(Ur.error);const u=Wt.onReadDrivesUpdate(h=>{n(c=>c.length!==h.length||_d(c)!==_d(h)?h:c)}).catch(Ur.error);return()=>{u.then(h=>h==null?void 0:h()).catch(Ur.error)}},[a]);const l=uf(()=>({...Wt,readDrives:t}),[t]);return Re(iT.Provider,{...r,value:l})},jx=()=>qT(iT),U1=({children:r})=>(L1(),r);function V1(r){return r.map(e=>({packageName:e.manifest.name,processors:e.processors})).reduce((e,t)=>(t.processors&&(e=[...e,{packageName:t.packageName,processors:t.processors}]),e),[])}const Q1=bT(async r=>{const e=await r(AT);return V1(e)}),W1=()=>Ef(Q1);async function H1(){const r=await lf.get(OC),e=new y1(r.listeners,r);return r.on("driveAdded",async t=>{await e.registerDrive(t.header.id)}),e}const Kn=IT(H1);Kn.debugLabel="processorManagerAtomInConnect";const z1=()=>Ef(Kn),sT=xT(Kn);sT.debugLabel="unwrappedProcessorManagerInConnect";const wd=()=>Ef(sT);lf.sub(OC,()=>lf.get(Kn));const er=yn(["reactor-analytics"]);function G1(r){return async()=>{const e=(await ht(async()=>{const{default:a}=await import("./pglite-worker.dssW4LQw.js");return{default:a}},[],import.meta.url)).default,{PGliteWorker:t}=await ht(async()=>{const{PGliteWorker:a}=await import("./index.DFyMrewv.js").then(o=>o.df);return{PGliteWorker:a}},[],import.meta.url),n=new e({name:"pglite-worker"});n.onmessage=a=>{er.verbose(a.data)},n.onerror=a=>{throw er.error(a.message),a.error};const i=new t(n,{meta:{databaseName:r},extensions:{live:vT}});return await i.waitReady,i}}async function J1(r,e,t,n,i){return await r.registerFactory(n,i({analyticsStore:e,relationalDb:t}))}async function K1(r,e){const{processorFactory:t}=await ht(async()=>{const{processorFactory:n}=await import("./index.DZIUQrDX.js");return{processorFactory:n}},__vite__mapDeps([8,3,2,4,1,5,6,7,9,10,11,12,13]),import.meta.url);return await r.registerFactory("@powerhousedao/diff-analyzer",t({analyticsStore:e}))}async function Y1(r,e){const{processorFactory:t}=await ht(async()=>{const{processorFactory:n}=await import("./index.CfvJlibT.js");return{processorFactory:n}},__vite__mapDeps([14,3,2,4,1,5,6,7,9,10,11,12,13]),import.meta.url);return await r.registerFactory("@powerhousedao/common/drive-analytics",t({analyticsStore:e}))}function Z1(){const r=yd(),e=wd(),t=Sf(!1);return st(()=>{!r.data||!e||t.current||(t.current=!0,K1(e,r.data).catch(er.error))},[r.data,e]),null}function X1(){const r=yd(),e=wd(),t=Sf(!1);return st(()=>{!r.data||!e||t.current||(t.current=!0,Y1(e,r.data).then(()=>{er.verbose("Drive analytics processor registered")}).catch(er.error))},[r.data,e]),null}function ex(){const r=W1(),e=yd(),t=_T(),n=wd(),i=Sf(!1);return st(()=>{if(!e.data||!n||i.current||r.length===0||!t.db)return;i.current=!0;let a=0;for(const{packageName:o,processors:s}of r)J1(n,e.data,t.db,`${o}-${a}`,s).catch(er.error),a++},[e.data,n,t]),null}function tx({children:r}){const e=Fe.analytics.useWorker?G1(Fe.analytics.databaseName):void 0,t=wT();st(()=>{if(!e){t({db:null,isLoading:!1,error:null});return}e().then(i=>{t({db:i,isLoading:!1,error:null})}).catch(i=>{const a=i instanceof Error?i:new Error(String(i));t({db:null,isLoading:!1,error:a})})},[]);const n=Ht(TC,{children:[Fe.analytics.diffProcessorEnabled&&Re(Z1,{}),Fe.analytics.driveAnalyticsEnabled&&Re(X1,{}),Fe.analytics.externalProcessorsEnabled&&Re(ex,{}),r]});return Re(g1,{options:{databaseName:Fe.analytics.databaseName,pgLiteFactory:e},children:n})}const rx=Or.lazy(()=>ht(()=>import("./home.LSDLsYfQ.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,16,17,18,9,19,20,11]),import.meta.url).then(r=>({default:r.Home}))),nx=Or.lazy(()=>ht(()=>import("./content.B90LTx2R.js"),__vite__mapDeps([21,3,22,9,1,2,4,5,6,7,23,18,12,20,24,25,10,11,13]),import.meta.url)),ix=Or.lazy(()=>ht(()=>import("./root.DQyo35Dp.js"),__vite__mapDeps([26,22,3,12,16,17,18,1,2,4,5,6,7,9,19,20,11,25,24,10,13]),import.meta.url)),sx=Or.lazy(()=>ht(()=>import("./atlas-import.D-1JNzDF.js"),__vite__mapDeps([27,3,25,9,1,2,4,5,6,7,12,18]),import.meta.url).then(r=>({default:r.AtlasImport}))),ox=Fe.routerBasename.endsWith("/")?Fe.routerBasename.slice(0,-1):Fe.routerBasename;function ax(r){return C1(r,{basename:ox,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function ux(){return[{element:Re(Cr,{name:"RouteRoot",children:Re(ix,{})}),children:[{index:!0,element:Re(Cr,{name:"Home",children:Re(rx,{})})},{path:"d?/:driveId?/*?",element:Re(Cr,{name:"Drive",children:Re(nx,{})})},{path:"import/:documentId",element:Re(Cr,{name:"AtlasImport",children:Re(sx,{})})}]}]}const lx=ux(),cx=ax(lx),hx=()=>Re(I1,{router:cx});window.__VITE_ENVS.MODE==="development"?window.documentEditorDebugTools=new w1:GT.registerServiceWorker(!1);const fx=()=>(OT(),null),dx=()=>(z1(),null),px=()=>Ht(TC,{children:[Re(U1,{children:Re(CT,{children:Re(B1,{children:Ht(tx,{children:[Re(ET,{position:"bottom-right",containerId:"connect"}),Ht(ST,{children:[Re(hx,{}),Re(b1,{})]})]})})})}),Ht(Cr,{children:[Re(dx,{}),Re(fx,{})]})]}),Fx=Object.freeze(Object.defineProperty({__proto__:null,default:px},Symbol.toStringTag,{value:"Module"}));export{it as A,ue as D,Mx as a,nt as b,jx as c,Dx as d,Fx as e,yd as u};
215
- //# sourceMappingURL=app.DRjxvXgZ.js.map
214
+ */function gn(){return gn=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gn.apply(this,arguments)}function Cf(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((e,t)=>{let n=r[t];return e.concat(Array.isArray(n)?n.map(i=>[t,i]):[[t,n]])},[]))}function v1(r,e){let t=Cf(r);return e&&e.forEach((n,i)=>{t.has(i)||e.getAll(i).forEach(a=>{t.append(i,a)})}),t}const _1="6";try{window.__reactRouterVersion=_1}catch{}function C1(r,e){return jT({basename:e==null?void 0:e.basename,future:gn({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:FT({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||E1(),routes:r,mapRouteProperties:VT,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function E1(){var r;let e=(r=window)==null?void 0:r.__staticRouterHydrationData;return e&&e.errors&&(e=gn({},e,{errors:S1(e.errors)})),e}function S1(r){if(!r)return null;let e=Object.entries(r),t={};for(let[n,i]of e)if(i&&i.__type==="RouteErrorResponse")t[n]=new UT(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",t[n]=o}catch{}}if(t[n]==null){let a=new Error(i.message);a.stack="",t[n]=a}}else t[n]=i;return t}const T1=pe.createContext({isTransitioning:!1}),q1=pe.createContext(new Map),A1="startTransition",wC=pe[A1],O1="flushSync",vC=PT[O1];function R1(r){wC?wC(r):r()}function _r(r){vC?vC(r):r()}class N1{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}}function I1(r){let{fallbackElement:e,router:t,future:n}=r,[i,a]=pe.useState(t.state),[o,s]=pe.useState(),[l,u]=pe.useState({isTransitioning:!1}),[h,c]=pe.useState(),[f,d]=pe.useState(),[w,_]=pe.useState(),m=pe.useRef(new Map),{v7_startTransition:g}=n||{},p=pe.useCallback(R=>{g?R1(R):R()},[g]),b=pe.useCallback((R,j)=>{let{deletedFetchers:C,flushSync:q,viewTransitionOpts:M}=j;R.fetchers.forEach((y,A)=>{y.data!==void 0&&m.current.set(A,y.data)}),C.forEach(y=>m.current.delete(y));let B=t.window==null||t.window.document==null||typeof t.window.document.startViewTransition!="function";if(!M||B){q?_r(()=>a(R)):p(()=>a(R));return}if(q){_r(()=>{f&&(h&&h.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let y=t.window.document.startViewTransition(()=>{_r(()=>a(R))});y.finished.finally(()=>{_r(()=>{c(void 0),d(void 0),s(void 0),u({isTransitioning:!1})})}),_r(()=>d(y));return}f?(h&&h.resolve(),f.skipTransition(),_({state:R,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(s(R),u({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[t.window,f,h,m,p]);pe.useLayoutEffect(()=>t.subscribe(b),[t,b]),pe.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new N1)},[l]),pe.useEffect(()=>{if(h&&o&&t.window){let R=o,j=h.promise,C=t.window.document.startViewTransition(async()=>{p(()=>a(R)),await j});C.finished.finally(()=>{c(void 0),d(void 0),s(void 0),u({isTransitioning:!1})}),d(C)}},[p,o,h,t.window]),pe.useEffect(()=>{h&&o&&i.location.key===o.location.key&&h.resolve()},[h,f,i.location,o]),pe.useEffect(()=>{!l.isTransitioning&&w&&(s(w.state),u({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),_(void 0))},[l.isTransitioning,w]),pe.useEffect(()=>{},[]);let v=pe.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:R=>t.navigate(R),push:(R,j,C)=>t.navigate(R,{state:j,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(R,j,C)=>t.navigate(R,{replace:!0,state:j,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[t]),E=t.basename||"/",T=pe.useMemo(()=>({router:t,navigator:v,static:!1,basename:E}),[t,v,E]),S=pe.useMemo(()=>({v7_relativeSplatPath:t.future.v7_relativeSplatPath}),[t.future.v7_relativeSplatPath]);return pe.useEffect(()=>kT(),[n,t.future]),pe.createElement(pe.Fragment,null,pe.createElement(LT.Provider,{value:T},pe.createElement(MT.Provider,{value:i},pe.createElement(q1.Provider,{value:m.current},pe.createElement(T1.Provider,{value:l},pe.createElement(DT,{basename:E,location:i.location,navigationType:i.historyAction,navigator:v,future:S},i.initialized||t.future.v7_partialHydration?pe.createElement(x1,{routes:t.routes,future:t.future,state:i}):e))))),null)}const x1=pe.memo($1);function $1(r){let{routes:e,future:t,state:n}=r;return BT(e,void 0,n,t)}var _C;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(_C||(_C={}));var CC;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(CC||(CC={}));function Dx(r){let e=pe.useRef(Cf(r)),t=pe.useRef(!1),n=NC(),i=pe.useMemo(()=>v1(n.search,t.current?null:e.current),[n.search]),a=QT(),o=pe.useCallback((s,l)=>{const u=Cf(typeof s=="function"?s(i):s);t.current=!0,a("?"+u,l)},[a,i]);return[i,o]}const EC=yn(["sentry"]);let bd=!1;async function nT(){return await ht(()=>import("./index.CXdyyvMp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)}async function P1(){const r=window.__VITE_ENVS.SENTRY_RELEASE,e=await nT(),t=[e.httpClientIntegration(),e.extraErrorDataIntegration({depth:5}),e.replayIntegration(),e.captureConsoleIntegration({levels:["error"]})];Fe.sentry.tracing&&t.push(e.reactRouterV6BrowserTracingIntegration({useEffect:Or.useEffect,useLocation:NC,useNavigationType:zT,createRoutesFromChildren:HT,matchRoutes:WT})),e.init({release:r,dsn:Fe.sentry.dsn,environment:Fe.sentry.env,integrations:t,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(n,i){const a=i.originalException;return a instanceof TypeError&&a.message.includes("Failed to fetch")&&!navigator.onLine?null:n}}),bd=!0}async function k1(){if(!bd)return;const e=(await nT()).getClient();return e==null?void 0:e.close()}function L1(){const[r]=RC(),{analytics:e}=r;st(()=>{if(!e){k1().catch(t=>EC.error(t));return}bd||!Fe.sentry.dsn||Fe.sentry.dsn===""||P1().catch(t=>EC.error(t))},[e])}var M1=Object.defineProperty,D1=Object.getOwnPropertyDescriptor,ut=(r,e,t,n)=>{for(var i=D1(e,t),a=r.length-1,o;a>=0;a--)(o=r[a])&&(i=o(e,t,i)||i);return i&&M1(e,t,i),i};function lt(r,e,t){const n=t.value;t.value=function(...i){if(!this.server)throw new Error("Read mode document drive not initialized.");return n.apply(this,i)}}function j1(r){const e=Object.getPrototypeOf(r);Object.getOwnPropertyNames(e).forEach(n=>{const i=Object.getOwnPropertyDescriptor(e,n);i&&typeof i.value=="function"&&n!=="constructor"&&(r[n]=r[n].bind(r))})}class rt{constructor(e){de(this,"server");j1(this),this.server=e}getServer(){return this.server}setDocumentDrive(e){this.server=e}migrateReadDrive(e,t){return this.server.migrateReadDrive(e,t)}addReadDrive(e,t){return this.server.addReadDrive(e,t)}getReadDrives(){return this.server.getReadDrives()}getReadDriveBySlug(e){return this.server.getReadDriveBySlug(e)}getReadDrive(e){return this.server.getReadDrive(e)}getReadDriveContext(e){return this.server.getReadDriveContext(e)}fetchDrive(e){return this.server.fetchDrive(e)}fetchDocument(e,t,n){return this.server.fetchDocument(e,t,n)}deleteReadDrive(e){return this.server.deleteReadDrive(e)}onReadDrivesUpdate(e){return this.server.onReadDrivesUpdate(e)}}ut([lt],rt.prototype,"migrateReadDrive");ut([lt],rt.prototype,"addReadDrive");ut([lt],rt.prototype,"getReadDrives");ut([lt],rt.prototype,"getReadDriveBySlug");ut([lt],rt.prototype,"getReadDrive");ut([lt],rt.prototype,"getReadDriveContext");ut([lt],rt.prototype,"fetchDrive");ut([lt],rt.prototype,"fetchDocument");ut([lt],rt.prototype,"deleteReadDrive");ut([lt],rt.prototype,"onReadDrivesUpdate");const Wt=new rt,iT=TT({...Wt,readDrives:[]});async function F1(r){const e=await r.getReadDrives();return(await Promise.all(e.map(n=>r.getReadDrive(n)))).filter(n=>!(n instanceof yT))}const B1=r=>{const e=RT(),[t,n]=vd([]),i=NT(),[a,o]=vd(!1);st(()=>{e&&(Wt.setDocumentDrive(e),o(!0))},[e]);const s=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);uf(()=>{if(!a||s===void 0)return;const u=s?"READ":"WRITE",h=Wt.getServer();h&&typeof h.setAllDefaultDrivesAccessLevel=="function"&&h.setAllDefaultDrivesAccessLevel(u).catch(Ur.error)},[s,a]),st(()=>{if(!a)return;F1(Wt).then(h=>n(h)).catch(Ur.error);const u=Wt.onReadDrivesUpdate(h=>{n(c=>c.length!==h.length||_d(c)!==_d(h)?h:c)}).catch(Ur.error);return()=>{u.then(h=>h==null?void 0:h()).catch(Ur.error)}},[a]);const l=uf(()=>({...Wt,readDrives:t}),[t]);return Re(iT.Provider,{...r,value:l})},jx=()=>qT(iT),U1=({children:r})=>(L1(),r);function V1(r){return r.map(e=>({packageName:e.manifest.name,processors:e.processors})).reduce((e,t)=>(t.processors&&(e=[...e,{packageName:t.packageName,processors:t.processors}]),e),[])}const Q1=bT(async r=>{const e=await r(AT);return V1(e)}),W1=()=>Ef(Q1);async function H1(){const r=await lf.get(OC),e=new y1(r.listeners,r);return r.on("driveAdded",async t=>{await e.registerDrive(t.header.id)}),e}const Kn=IT(H1);Kn.debugLabel="processorManagerAtomInConnect";const z1=()=>Ef(Kn),sT=xT(Kn);sT.debugLabel="unwrappedProcessorManagerInConnect";const wd=()=>Ef(sT);lf.sub(OC,()=>lf.get(Kn));const er=yn(["reactor-analytics"]);function G1(r){return async()=>{const e=(await ht(async()=>{const{default:a}=await import("./pglite-worker.dssW4LQw.js");return{default:a}},[],import.meta.url)).default,{PGliteWorker:t}=await ht(async()=>{const{PGliteWorker:a}=await import("./index.DFyMrewv.js").then(o=>o.df);return{PGliteWorker:a}},[],import.meta.url),n=new e({name:"pglite-worker"});n.onmessage=a=>{er.verbose(a.data)},n.onerror=a=>{throw er.error(a.message),a.error};const i=new t(n,{meta:{databaseName:r},extensions:{live:vT}});return await i.waitReady,i}}async function J1(r,e,t,n,i){return await r.registerFactory(n,i({analyticsStore:e,relationalDb:t}))}async function K1(r,e){const{processorFactory:t}=await ht(async()=>{const{processorFactory:n}=await import("./index.CCw1FVfF.js");return{processorFactory:n}},__vite__mapDeps([8,3,2,4,1,5,6,7,9,10,11,12,13]),import.meta.url);return await r.registerFactory("@powerhousedao/diff-analyzer",t({analyticsStore:e}))}async function Y1(r,e){const{processorFactory:t}=await ht(async()=>{const{processorFactory:n}=await import("./index.C9_ibJMG.js");return{processorFactory:n}},__vite__mapDeps([14,3,2,4,1,5,6,7,9,10,11,12,13]),import.meta.url);return await r.registerFactory("@powerhousedao/common/drive-analytics",t({analyticsStore:e}))}function Z1(){const r=yd(),e=wd(),t=Sf(!1);return st(()=>{!r.data||!e||t.current||(t.current=!0,K1(e,r.data).catch(er.error))},[r.data,e]),null}function X1(){const r=yd(),e=wd(),t=Sf(!1);return st(()=>{!r.data||!e||t.current||(t.current=!0,Y1(e,r.data).then(()=>{er.verbose("Drive analytics processor registered")}).catch(er.error))},[r.data,e]),null}function ex(){const r=W1(),e=yd(),t=_T(),n=wd(),i=Sf(!1);return st(()=>{if(!e.data||!n||i.current||r.length===0||!t.db)return;i.current=!0;let a=0;for(const{packageName:o,processors:s}of r)J1(n,e.data,t.db,`${o}-${a}`,s).catch(er.error),a++},[e.data,n,t]),null}function tx({children:r}){const e=Fe.analytics.useWorker?G1(Fe.analytics.databaseName):void 0,t=wT();st(()=>{if(!e){t({db:null,isLoading:!1,error:null});return}e().then(i=>{t({db:i,isLoading:!1,error:null})}).catch(i=>{const a=i instanceof Error?i:new Error(String(i));t({db:null,isLoading:!1,error:a})})},[]);const n=Ht(TC,{children:[Fe.analytics.diffProcessorEnabled&&Re(Z1,{}),Fe.analytics.driveAnalyticsEnabled&&Re(X1,{}),Fe.analytics.externalProcessorsEnabled&&Re(ex,{}),r]});return Re(g1,{options:{databaseName:Fe.analytics.databaseName,pgLiteFactory:e},children:n})}const rx=Or.lazy(()=>ht(()=>import("./home.RjAKOXsG.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,16,17,18,9,19,20,11]),import.meta.url).then(r=>({default:r.Home}))),nx=Or.lazy(()=>ht(()=>import("./content.CKwzH4A6.js"),__vite__mapDeps([21,3,22,9,1,2,4,5,6,7,23,18,12,20,24,25,10,11,13]),import.meta.url)),ix=Or.lazy(()=>ht(()=>import("./root.57GaakYu.js"),__vite__mapDeps([26,22,3,12,16,17,18,1,2,4,5,6,7,9,19,20,11,25,24,10,13]),import.meta.url)),sx=Or.lazy(()=>ht(()=>import("./atlas-import.4dachugj.js"),__vite__mapDeps([27,3,25,9,1,2,4,5,6,7,12,18]),import.meta.url).then(r=>({default:r.AtlasImport}))),ox=Fe.routerBasename.endsWith("/")?Fe.routerBasename.slice(0,-1):Fe.routerBasename;function ax(r){return C1(r,{basename:ox,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function ux(){return[{element:Re(Cr,{name:"RouteRoot",children:Re(ix,{})}),children:[{index:!0,element:Re(Cr,{name:"Home",children:Re(rx,{})})},{path:"d?/:driveId?/*?",element:Re(Cr,{name:"Drive",children:Re(nx,{})})},{path:"import/:documentId",element:Re(Cr,{name:"AtlasImport",children:Re(sx,{})})}]}]}const lx=ux(),cx=ax(lx),hx=()=>Re(I1,{router:cx});window.__VITE_ENVS.MODE==="development"?window.documentEditorDebugTools=new w1:GT.registerServiceWorker(!1);const fx=()=>(OT(),null),dx=()=>(z1(),null),px=()=>Ht(TC,{children:[Re(U1,{children:Re(CT,{children:Re(B1,{children:Ht(tx,{children:[Re(ET,{position:"bottom-right",containerId:"connect"}),Ht(ST,{children:[Re(hx,{}),Re(b1,{})]})]})})})}),Ht(Cr,{children:[Re(dx,{}),Re(fx,{})]})]}),Fx=Object.freeze(Object.defineProperty({__proto__:null,default:px},Symbol.toStringTag,{value:"Module"}));export{it as A,ue as D,Mx as a,nt as b,jx as c,Dx as d,Fx as e,yd as u};
215
+ //# sourceMappingURL=app.LIiY9_Fz.js.map